You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
457 lines
13 KiB
457 lines
13 KiB
15 years ago
|
/* This file is part of the KDE libraries
|
||
|
* Copyright (c) 2003 thierry lorthiois (lorthioist@wanadoo.fr)
|
||
|
*
|
||
|
* This library is free software; you can redistribute it and/or
|
||
|
* modify it under the terms of the GNU Library General Public
|
||
|
* License version 2 as published by the Free Software Foundation.
|
||
|
*
|
||
|
* This library is distributed in the hope that it will be useful,
|
||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
|
* Library General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU Library General Public License
|
||
|
* along with this library; see the file COPYING.LIB. If not, write to
|
||
|
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||
|
* Boston, MA 02110-1301, USA.
|
||
|
*/
|
||
|
|
||
|
#include <math.h>
|
||
14 years ago
|
#include <tqfile.h>
|
||
|
#include <tqdatastream.h>
|
||
15 years ago
|
|
||
|
#include <kdebug.h>
|
||
|
|
||
|
#include "kowmfstruct.h"
|
||
|
#include "kowmfreadprivate.h"
|
||
|
#include "kowmfwrite.h"
|
||
|
|
||
|
/**
|
||
|
* Private data
|
||
|
*/
|
||
|
class KoWmfWritePrivate
|
||
|
{
|
||
|
public:
|
||
14 years ago
|
TQRect mBBox; // bounding rectangle
|
||
15 years ago
|
int mDpi; // number of point per inch for the default size
|
||
|
int mMaxRecordSize;
|
||
|
|
||
|
// memory allocation for WMF file
|
||
14 years ago
|
TQFile mFileOut;
|
||
|
TQDataStream mSt;
|
||
15 years ago
|
};
|
||
|
|
||
|
|
||
|
|
||
14 years ago
|
KoWmfWrite::KoWmfWrite( const TQString& fileName ) {
|
||
15 years ago
|
d = new KoWmfWritePrivate;
|
||
|
|
||
|
d->mDpi = 1024;
|
||
|
d->mMaxRecordSize = 0;
|
||
|
d->mFileOut.setName( fileName );
|
||
|
}
|
||
|
|
||
|
KoWmfWrite::~KoWmfWrite() {
|
||
|
delete d;
|
||
|
}
|
||
|
|
||
|
|
||
|
void KoWmfWrite::setDefaultDpi( int dpi ) {
|
||
|
d->mDpi = dpi;
|
||
|
}
|
||
|
|
||
|
|
||
|
//-----------------------------------------------------------------------------
|
||
|
// Virtual Painter => create the WMF
|
||
|
|
||
|
bool KoWmfWrite::begin() {
|
||
|
|
||
|
if ( !d->mFileOut.open( IO_WriteOnly ) )
|
||
|
{
|
||
14 years ago
|
kdDebug() << "Cannot open file " << TQString(TQFile::encodeName(d->mFileOut.name())) << endl;
|
||
15 years ago
|
return false;
|
||
|
}
|
||
|
d->mSt.setDevice( &d->mFileOut );
|
||
14 years ago
|
d->mSt.setByteOrder( TQDataStream::LittleEndian );
|
||
15 years ago
|
|
||
|
// reserved placeable and standard header
|
||
|
for ( int i=0 ; i < 10 ; i++ ) {
|
||
14 years ago
|
d->mSt << (TQ_UINT32)0;
|
||
15 years ago
|
}
|
||
|
|
||
|
// initialize the stack of objects
|
||
|
// Pen
|
||
14 years ago
|
d->mSt << (TQ_UINT32)8 << (TQ_UINT16)0x02FA;
|
||
|
d->mSt << (TQ_UINT16)5 << (TQ_UINT16)0 << (TQ_UINT16)0 << (TQ_UINT32)0;
|
||
15 years ago
|
// Brush
|
||
14 years ago
|
d->mSt << (TQ_UINT32)7 << (TQ_UINT16)0x02FC;
|
||
|
d->mSt << (TQ_UINT16)1 << (TQ_UINT32)0 << (TQ_UINT16)0;
|
||
15 years ago
|
for ( int i=0 ; i < 4 ; i++ ) {
|
||
14 years ago
|
d->mSt << (TQ_UINT32)8 << (TQ_UINT16)0x02FA << (TQ_UINT16)0 << (TQ_UINT32)0 << (TQ_UINT32)0;
|
||
15 years ago
|
}
|
||
|
d->mMaxRecordSize = 8;
|
||
|
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
|
||
|
bool KoWmfWrite::end() {
|
||
|
WmfPlaceableHeader pheader = { 0x9AC6CDD7, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||
14 years ago
|
TQ_UINT16 checksum;
|
||
15 years ago
|
|
||
|
// End of the wmf file
|
||
14 years ago
|
d->mSt << (TQ_UINT32)3 << (TQ_UINT16)0;
|
||
15 years ago
|
|
||
|
// adjust header
|
||
|
pheader.left = d->mBBox.left();
|
||
|
pheader.top = d->mBBox.top();
|
||
|
pheader.right = d->mBBox.right();
|
||
|
pheader.bottom = d->mBBox.bottom();
|
||
|
pheader.inch = d->mDpi;
|
||
|
checksum = KoWmfReadPrivate::calcCheckSum( &pheader );
|
||
|
|
||
|
// write headers
|
||
|
d->mFileOut.at( 0 );
|
||
14 years ago
|
d->mSt << (TQ_UINT32)0x9AC6CDD7 << (TQ_UINT16)0;
|
||
|
d->mSt << (TQ_INT16)d->mBBox.left() << (TQ_INT16)d->mBBox.top() << (TQ_INT16)d->mBBox.right() << (TQ_INT16)d->mBBox.bottom();
|
||
|
d->mSt << (TQ_UINT16)d->mDpi << (TQ_UINT32)0 << checksum;
|
||
|
d->mSt << (TQ_UINT16)1 << (TQ_UINT16)9 << (TQ_UINT16)0x300 << (TQ_UINT32)(d->mFileOut.size()/2);
|
||
|
d->mSt << (TQ_UINT16)6 << (TQ_UINT32)d->mMaxRecordSize << (TQ_UINT16)0;
|
||
15 years ago
|
|
||
|
d->mFileOut.close();
|
||
|
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
|
||
|
void KoWmfWrite::save() {
|
||
14 years ago
|
d->mSt << (TQ_UINT32)3 << (TQ_UINT16)0x001E;
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
|
void KoWmfWrite::restore() {
|
||
14 years ago
|
d->mSt << (TQ_UINT32)4 << (TQ_UINT16)0x0127 << (TQ_UINT16)1;
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
14 years ago
|
void KoWmfWrite::setPen( const TQPen &pen ) {
|
||
15 years ago
|
int style;
|
||
14 years ago
|
int max = sizeof(koWmfStylePen) / sizeof(TQt::SolidLine);
|
||
15 years ago
|
|
||
|
// we can't delete an object currently selected
|
||
|
// select another object
|
||
14 years ago
|
d->mSt << (TQ_UINT32)4 << (TQ_UINT16)0x012D << (TQ_UINT16)0;
|
||
15 years ago
|
// delete object
|
||
14 years ago
|
d->mSt << (TQ_UINT32)4 << (TQ_UINT16)0x01f0 << (TQ_UINT16)2;
|
||
15 years ago
|
|
||
|
for ( style=0 ; style < max ; style++ ) {
|
||
|
if ( koWmfStylePen[ style ] == pen.style() ) break;
|
||
|
}
|
||
|
if ( style == max ) {
|
||
|
// SolidLine
|
||
|
style = 0;
|
||
|
}
|
||
14 years ago
|
d->mSt << (TQ_UINT32)8 << (TQ_UINT16)0x02FA;
|
||
|
d->mSt << (TQ_UINT16)style << (TQ_UINT16)pen.width() << (TQ_UINT16)0 << (TQ_UINT32)winColor( pen.color() );
|
||
15 years ago
|
|
||
|
// select object
|
||
14 years ago
|
d->mSt << (TQ_UINT32)4 << (TQ_UINT16)0x012D << (TQ_UINT16)2;
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
14 years ago
|
void KoWmfWrite::setBrush( const TQBrush &brush ) {
|
||
15 years ago
|
int style;
|
||
14 years ago
|
int max = sizeof(koWmfStyleBrush) / sizeof(TQt::NoBrush);
|
||
15 years ago
|
|
||
|
// we can't delete an object currently selected
|
||
|
// select another object
|
||
14 years ago
|
d->mSt << (TQ_UINT32)4 << (TQ_UINT16)0x012D << (TQ_UINT16)1;
|
||
15 years ago
|
// delete object
|
||
14 years ago
|
d->mSt << (TQ_UINT32)4 << (TQ_UINT16)0x01f0 << (TQ_UINT16)3;
|
||
15 years ago
|
|
||
|
for ( style=0 ; style < max ; style++ ) {
|
||
|
if ( koWmfStyleBrush[ style ] == brush.style() ) break;
|
||
|
}
|
||
|
if ( style == max ) {
|
||
|
// SolidPattern
|
||
|
style = 0;
|
||
|
}
|
||
14 years ago
|
d->mSt << (TQ_UINT32)7 << (TQ_UINT16)0x02FC;
|
||
|
d->mSt << (TQ_UINT16)style << (TQ_UINT32)winColor( brush.color() ) << (TQ_UINT16)0;
|
||
15 years ago
|
|
||
|
// select object
|
||
14 years ago
|
d->mSt << (TQ_UINT32)4 << (TQ_UINT16)0x012D << (TQ_UINT16)3;
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
14 years ago
|
void KoWmfWrite::setFont( const TQFont & ) {
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
14 years ago
|
void KoWmfWrite::setBackgroundColor( const TQColor &c ) {
|
||
|
d->mSt << (TQ_UINT32)5 << (TQ_UINT16)0x0201 << (TQ_UINT32)winColor( c );
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
|
void KoWmfWrite::setBackgroundMode( Qt::BGMode mode ) {
|
||
14 years ago
|
d->mSt << (TQ_UINT32)4 << (TQ_UINT16)0x0102;
|
||
15 years ago
|
if ( mode == Qt::TransparentMode )
|
||
14 years ago
|
d->mSt << (TQ_UINT16)1;
|
||
15 years ago
|
else
|
||
14 years ago
|
d->mSt << (TQ_UINT16)0;
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
14 years ago
|
void KoWmfWrite::setRasterOp( TQt::RasterOp op ) {
|
||
|
d->mSt << (TQ_UINT32)5 << (TQ_UINT16)0x0104 << (TQ_UINT32)qtRasterToWin32( op );
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
|
void KoWmfWrite::setWindow( int left, int top, int width, int height ) {
|
||
|
d->mBBox.setRect( left, top, width, height );
|
||
|
|
||
|
// windowOrg
|
||
14 years ago
|
d->mSt << (TQ_UINT32)5 << (TQ_UINT16)0x020B << (TQ_UINT16)top << (TQ_UINT16)left;
|
||
15 years ago
|
|
||
|
// windowExt
|
||
14 years ago
|
d->mSt << (TQ_UINT32)5 << (TQ_UINT16)0x020C << (TQ_UINT16)height << (TQ_UINT16)width;
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
14 years ago
|
void KoWmfWrite::setClipRegion( const TQRegion & ) {
|
||
15 years ago
|
|
||
|
}
|
||
|
|
||
|
|
||
|
void KoWmfWrite::clipping( bool enable ) {
|
||
|
if ( !enable ) {
|
||
|
// clipping region == bounding rectangle
|
||
|
setClipRegion( d->mBBox );
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
void KoWmfWrite::moveTo( int left, int top ) {
|
||
14 years ago
|
d->mSt << (TQ_UINT32)5 << (TQ_UINT16)0x0214 << (TQ_UINT16)top << (TQ_UINT16)left;
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
|
void KoWmfWrite::lineTo( int left, int top ) {
|
||
14 years ago
|
d->mSt << (TQ_UINT32)5 << (TQ_UINT16)0x0213 << (TQ_UINT16)top << (TQ_UINT16)left;
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
|
void KoWmfWrite::drawRect( int left, int top, int width, int height ) {
|
||
14 years ago
|
TQRect rec( left, top, width, height );
|
||
15 years ago
|
|
||
14 years ago
|
d->mSt << (TQ_UINT32)7 << (TQ_UINT16)0x041B;
|
||
|
d->mSt << (TQ_UINT16)rec.bottom() << (TQ_UINT16)rec.right() << (TQ_UINT16)rec.top() << (TQ_UINT16)rec.left();
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
|
void KoWmfWrite::drawRoundRect( int left, int top, int width, int height , int roudw, int roudh ) {
|
||
|
int widthCorner, heightCorner;
|
||
14 years ago
|
TQRect rec( left, top, width, height );
|
||
15 years ago
|
|
||
|
// convert percentage (roundw, roudh) in (widthCorner, heightCorner)
|
||
|
widthCorner = ( roudw * width ) / 100;
|
||
|
heightCorner = ( roudh * height ) / 100;
|
||
|
|
||
14 years ago
|
d->mSt << (TQ_UINT32)9 << (TQ_UINT16)0x061C << (TQ_UINT16)heightCorner << (TQ_UINT16)widthCorner;
|
||
|
d->mSt << (TQ_UINT16)rec.bottom() << (TQ_UINT16)rec.right() << (TQ_UINT16)rec.top() << (TQ_UINT16)rec.left();
|
||
15 years ago
|
|
||
14 years ago
|
d->mMaxRecordSize = TQMAX( d->mMaxRecordSize, 9 );
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
|
void KoWmfWrite::drawEllipse( int left, int top, int width, int height ) {
|
||
14 years ago
|
TQRect rec( left, top, width, height );
|
||
15 years ago
|
|
||
14 years ago
|
d->mSt << (TQ_UINT32)7 << (TQ_UINT16)0x0418;
|
||
|
d->mSt << (TQ_UINT16)rec.bottom() << (TQ_UINT16)rec.right() << (TQ_UINT16)rec.top() << (TQ_UINT16)rec.left();
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
|
void KoWmfWrite::drawArc( int left, int top, int width, int height , int a, int alen ) {
|
||
|
int xCenter, yCenter;
|
||
|
int offXStart, offYStart, offXEnd, offYEnd;
|
||
|
|
||
|
angleToxy( offXStart, offYStart, offXEnd, offYEnd, a, alen );
|
||
|
xCenter = left + (width / 2);
|
||
|
yCenter = top + (height / 2);
|
||
|
|
||
14 years ago
|
d->mSt << (TQ_UINT32)11 << (TQ_UINT16)0x0817;
|
||
|
d->mSt << (TQ_UINT16)(yCenter + offYEnd) << (TQ_UINT16)(xCenter + offXEnd);
|
||
|
d->mSt << (TQ_UINT16)(yCenter + offYStart) << (TQ_UINT16)(xCenter + offXStart);
|
||
|
d->mSt << (TQ_UINT16)(top + height) << (TQ_UINT16)(left + width);
|
||
|
d->mSt << (TQ_UINT16)top << (TQ_UINT16)left;
|
||
15 years ago
|
|
||
14 years ago
|
d->mMaxRecordSize = TQMAX( d->mMaxRecordSize, 11 );
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
|
void KoWmfWrite::drawPie( int left, int top, int width, int height , int a, int alen ) {
|
||
|
int xCenter, yCenter;
|
||
|
int offXStart, offYStart, offXEnd, offYEnd;
|
||
|
|
||
|
angleToxy( offXStart, offYStart, offXEnd, offYEnd, a, alen );
|
||
|
xCenter = left + (width / 2);
|
||
|
yCenter = top + (height / 2);
|
||
|
|
||
14 years ago
|
d->mSt << (TQ_UINT32)11 << (TQ_UINT16)0x081A;
|
||
|
d->mSt << (TQ_UINT16)(yCenter + offYEnd) << (TQ_UINT16)(xCenter + offXEnd);
|
||
|
d->mSt << (TQ_UINT16)(yCenter + offYStart) << (TQ_UINT16)(xCenter + offXStart);
|
||
|
d->mSt << (TQ_UINT16)(top + height) << (TQ_UINT16)(left + width);
|
||
|
d->mSt << (TQ_UINT16)top << (TQ_UINT16)left;
|
||
15 years ago
|
|
||
14 years ago
|
d->mMaxRecordSize = TQMAX( d->mMaxRecordSize, 11 );
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
|
void KoWmfWrite::drawChord( int left, int top, int width, int height , int a, int alen ) {
|
||
|
int xCenter, yCenter;
|
||
|
int offXStart, offYStart, offXEnd, offYEnd;
|
||
|
|
||
|
angleToxy( offXStart, offYStart, offXEnd, offYEnd, a, alen );
|
||
|
xCenter = left + (width / 2);
|
||
|
yCenter = top + (height / 2);
|
||
|
|
||
14 years ago
|
d->mSt << (TQ_UINT32)11 << (TQ_UINT16)0x0830;
|
||
|
d->mSt << (TQ_UINT16)(yCenter + offYEnd) << (TQ_UINT16)(xCenter + offXEnd);
|
||
|
d->mSt << (TQ_UINT16)(yCenter + offYStart) << (TQ_UINT16)(xCenter + offXStart);
|
||
|
d->mSt << (TQ_UINT16)(top + height) << (TQ_UINT16)(left + width);
|
||
|
d->mSt << (TQ_UINT16)top << (TQ_UINT16)left;
|
||
15 years ago
|
|
||
14 years ago
|
d->mMaxRecordSize = TQMAX( d->mMaxRecordSize, 11 );
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
14 years ago
|
void KoWmfWrite::drawPolyline( const TQPointArray &pa ) {
|
||
15 years ago
|
int size = 4 + (pa.size() * 2);
|
||
|
|
||
14 years ago
|
d->mSt << (TQ_UINT32)size << (TQ_UINT16)0x0325 << (TQ_UINT16)pa.size();
|
||
15 years ago
|
pointArray( pa );
|
||
|
|
||
14 years ago
|
d->mMaxRecordSize = TQMAX( d->mMaxRecordSize, size );
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
14 years ago
|
void KoWmfWrite::drawPolygon( const TQPointArray &pa, bool ) {
|
||
15 years ago
|
int size = 4 + (pa.size() * 2);
|
||
|
|
||
14 years ago
|
d->mSt << (TQ_UINT32)size << (TQ_UINT16)0x0324 << (TQ_UINT16)pa.size();
|
||
15 years ago
|
pointArray( pa );
|
||
|
|
||
14 years ago
|
d->mMaxRecordSize = TQMAX( d->mMaxRecordSize, size );
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
14 years ago
|
void KoWmfWrite::drawPolyPolygon( TQPtrList<TQPointArray>& listPa, bool ) {
|
||
15 years ago
|
|
||
14 years ago
|
TQPointArray *pa;
|
||
15 years ago
|
int sizeArrayPoly = 0;
|
||
|
|
||
|
for ( pa = listPa.first() ; pa ; pa = listPa.next() ) {
|
||
|
sizeArrayPoly += (pa->size() * 2);
|
||
|
}
|
||
|
int size = 4 + listPa.count() + sizeArrayPoly;
|
||
14 years ago
|
d->mSt << (TQ_UINT32)size << (TQ_UINT16)0x0538 << (TQ_UINT16)listPa.count();
|
||
15 years ago
|
|
||
|
// number of point for each Polygon
|
||
|
for ( pa = listPa.first() ; pa ; pa = listPa.next() ) {
|
||
14 years ago
|
d->mSt << (TQ_UINT16)pa->size();
|
||
15 years ago
|
}
|
||
|
|
||
|
// list of points
|
||
|
for ( pa = listPa.first() ; pa ; pa = listPa.next() ) {
|
||
|
pointArray( *pa );
|
||
|
}
|
||
|
|
||
14 years ago
|
d->mMaxRecordSize = TQMAX( d->mMaxRecordSize, size );
|
||
15 years ago
|
|
||
|
}
|
||
|
|
||
|
|
||
14 years ago
|
void KoWmfWrite::drawImage( int , int , const TQImage &, int , int , int , int ) {
|
||
15 years ago
|
/*
|
||
14 years ago
|
TQImage img;
|
||
15 years ago
|
|
||
|
img = image;
|
||
|
img.setFormat( "BMP" );
|
||
|
|
||
14 years ago
|
TQIODevice io = img.ioDevice();
|
||
15 years ago
|
io.at( 14 ); // skip the BMP header
|
||
|
d->mSt << io.readAll();
|
||
|
*/
|
||
|
}
|
||
|
|
||
|
|
||
14 years ago
|
void KoWmfWrite::drawText( int , int , int , int , int , const TQString& , double ) {
|
||
|
// d->mSt << (TQ_UINT32)3 << (TQ_UINT16)0x0A32;
|
||
15 years ago
|
}
|
||
|
|
||
|
//-----------------------------------------------------------------------------
|
||
14 years ago
|
// Utilities and conversion TQt --> Wmf
|
||
15 years ago
|
|
||
14 years ago
|
void KoWmfWrite::pointArray( const TQPointArray &pa ) {
|
||
15 years ago
|
int left, top, i, max;
|
||
|
|
||
|
for ( i=0, max=pa.size() ; i < max ; i++ ) {
|
||
|
pa.point( i, &left, &top );
|
||
14 years ago
|
d->mSt << (TQ_INT16)left << (TQ_INT16)top;
|
||
15 years ago
|
}
|
||
|
}
|
||
|
|
||
|
|
||
14 years ago
|
TQ_UINT32 KoWmfWrite::winColor( TQColor color ) {
|
||
|
TQ_UINT32 c;
|
||
15 years ago
|
|
||
|
c = (color.red() & 0xFF);
|
||
|
c += ( (color.green() & 0xFF) << 8 );
|
||
|
c += ( (color.blue() & 0xFF) << 16 );
|
||
|
|
||
|
return c;
|
||
|
}
|
||
|
|
||
|
|
||
|
void KoWmfWrite::angleToxy( int &xStart, int &yStart, int &xEnd, int &yEnd, int a, int alen ) {
|
||
|
double angleStart, angleLength;
|
||
|
|
||
|
angleStart = ((double)a * 3.14166) / 2880;
|
||
|
angleLength = ((double)alen * 3.14166) / 2880;
|
||
|
|
||
|
xStart = (int)(cos(angleStart) * 50);
|
||
|
yStart = -(int)(sin(angleStart) * 50);
|
||
|
xEnd = (int)(cos(angleLength) * 50);
|
||
|
yEnd = -(int)(sin(angleLength) * 50);
|
||
|
}
|
||
|
|
||
|
|
||
14 years ago
|
TQ_UINT16 KoWmfWrite::qtRasterToWin16( TQt::RasterOp op ) const {
|
||
15 years ago
|
int i;
|
||
|
|
||
|
for ( i=0 ; i < 17 ; i++ ) {
|
||
|
if ( koWmfOpTab16[ i ] == op ) break;
|
||
|
}
|
||
|
|
||
|
if ( i < 17 )
|
||
14 years ago
|
return (TQ_UINT16)i;
|
||
15 years ago
|
else
|
||
14 years ago
|
return (TQ_UINT16)0;
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
14 years ago
|
TQ_UINT32 KoWmfWrite::qtRasterToWin32( TQt::RasterOp op ) const {
|
||
15 years ago
|
int i;
|
||
|
|
||
|
for ( i=0 ; i < 15 ; i++ ) {
|
||
|
if ( koWmfOpTab32[ i ].qtRasterOp == op ) break;
|
||
|
}
|
||
|
|
||
|
if ( i < 15 )
|
||
|
return koWmfOpTab32[ i ].winRasterOp;
|
||
|
else
|
||
|
return koWmfOpTab32[ 0 ].winRasterOp;
|
||
|
}
|
||
|
|