diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-13 00:46:47 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-13 00:46:47 +0000 |
commit | 67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7 (patch) | |
tree | 5f52a9eada2e9f3654fc327d7c14dfef570a6ecb /ktnef/gui/qwmf.cpp | |
parent | 2ee4bf4fd5eff93b2fbef0ff8e8063edffc5da5c (diff) | |
download | tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.tar.gz tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.zip |
Initial conversion of kdepim to TQt
This will probably require some tweaking before it will build under Qt4,
however Qt3 builds are OK. Any alterations this commit makes to kdepim
behaviour under Qt3 are unintentional and should be fixed.
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1227832 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ktnef/gui/qwmf.cpp')
-rw-r--r-- | ktnef/gui/qwmf.cpp | 268 |
1 files changed, 134 insertions, 134 deletions
diff --git a/ktnef/gui/qwmf.cpp b/ktnef/gui/qwmf.cpp index f8e19411e..8f8cd4d28 100644 --- a/ktnef/gui/qwmf.cpp +++ b/ktnef/gui/qwmf.cpp @@ -33,7 +33,7 @@ bool qwmfDebug = false; #include "wmfstruct.h" #include "metafuncs.h" -#define QWMF_DEBUG 0 +#define TQWMF_DEBUG 0 class WmfCmd @@ -112,7 +112,7 @@ void WinObjFontHandle::apply( TQPainter& p ) //----------------------------------------------------------------------------- -QWinMetaFile::QWinMetaFile() +TQWinMetaFile::TQWinMetaFile() { mValid = false; mFirstCmd = NULL; @@ -122,7 +122,7 @@ QWinMetaFile::QWinMetaFile() //----------------------------------------------------------------------------- -QWinMetaFile::~QWinMetaFile() +TQWinMetaFile::~TQWinMetaFile() { if ( mFirstCmd ) delete mFirstCmd; if ( mObjHandleTab ) delete[] mObjHandleTab; @@ -130,7 +130,7 @@ QWinMetaFile::~QWinMetaFile() //----------------------------------------------------------------------------- -bool QWinMetaFile::load( const TQString &filename ) +bool TQWinMetaFile::load( const TQString &filename ) { TQFile file( filename ); @@ -155,7 +155,7 @@ bool QWinMetaFile::load( const TQString &filename ) } //----------------------------------------------------------------------------- -bool QWinMetaFile::load( TQBuffer &buffer ) +bool TQWinMetaFile::load( TQBuffer &buffer ) { TQDataStream st; WmfEnhMetaHeader eheader; @@ -169,12 +169,12 @@ bool QWinMetaFile::load( TQBuffer &buffer ) mTextAlign = 0; mRotation = 0; - mTextColor = Qt::black; + mTextColor = TQt::black; if ( mFirstCmd ) delete mFirstCmd; mFirstCmd = NULL; st.setDevice( &buffer ); - st.setByteOrder( TQDataStream::LittleEndian ); // Great, I love Qt ! + st.setByteOrder( TQDataStream::LittleEndian ); // Great, I love TQt ! //----- Read placeable metafile header st >> pheader.key; @@ -198,7 +198,7 @@ bool QWinMetaFile::load( TQBuffer &buffer ) mBBox.setRight( pheader.bbox.right ); mBBox.setBottom( pheader.bbox.bottom ); mHeaderBoundingBox = mBBox; - if ( QWMF_DEBUG ) + if ( TQWMF_DEBUG ) { kdDebug() << endl << "-------------------------------------------------" << endl; kdDebug() << "WMF Placeable Header ( " << static_cast<int>(sizeof( pheader ) ) << "):" << endl; @@ -240,7 +240,7 @@ bool QWinMetaFile::load( TQBuffer &buffer ) st >> eheader.szlMillimeters.width; st >> eheader.szlMillimeters.height; - if ( QWMF_DEBUG ) + if ( TQWMF_DEBUG ) { kdDebug() << endl << "-------------------------------------------------" << endl; kdDebug() << "WMF Extended Header:" << endl; @@ -265,7 +265,7 @@ bool QWinMetaFile::load( TQBuffer &buffer ) st >> header.mtNoObjects; st >> header.mtMaxRecord; st >> header.mtNoParameters; - if ( QWMF_DEBUG ) { + if ( TQWMF_DEBUG ) { kdDebug() << "WMF Header: " << "mtSize=" << header.mtSize << endl; } } @@ -329,7 +329,7 @@ bool QWinMetaFile::load( TQBuffer &buffer ) //----------------------------------------------------------------------------- -bool QWinMetaFile::paint( const TQPaintDevice* aTarget, bool absolute ) +bool TQWinMetaFile::paint( const TQPaintDevice* aTarget, bool absolute ) { int idx, i; WmfCmd* cmd; @@ -349,7 +349,7 @@ bool QWinMetaFile::paint( const TQPaintDevice* aTarget, bool absolute ) mAbsoluteCoord = absolute; mPainter.begin( aTarget ); - if ( QWMF_DEBUG ) { + if ( TQWMF_DEBUG ) { kdDebug() << "Bounding box : " << mBBox.left() << " " << mBBox.top() << " " << mBBox.right() << " " << mBBox.bottom() << endl; } @@ -364,12 +364,12 @@ bool QWinMetaFile::paint( const TQPaintDevice* aTarget, bool absolute ) idx = cmd->funcIndex; ( this->*metaFuncTab[ idx ].method )( cmd->numParm, cmd->parm ); - if ( QWMF_DEBUG ) { + if ( TQWMF_DEBUG ) { TQString str = "", param; if ( metaFuncTab[ idx ].name == NULL ) { str += "UNKNOWN "; } - if ( metaFuncTab[ idx ].method == &QWinMetaFile::noop ) { + if ( metaFuncTab[ idx ].method == &TQWinMetaFile::noop ) { str += "UNIMPLEMENTED "; } str += metaFuncTab[ idx ].name; @@ -389,7 +389,7 @@ bool QWinMetaFile::paint( const TQPaintDevice* aTarget, bool absolute ) mWindowsCoord += 1; if ( mWindowsCoord == 2 ) { kdDebug() << "DRAW ANGLES " << endl; - mPainter.setPen( Qt::white ); + mPainter.setPen( TQt::white ); mPainter.drawPoint( mBBox.left(), mBBox.top() ); mPainter.drawPoint( mBBox.right(), mBBox.bottom() ); } @@ -402,7 +402,7 @@ bool QWinMetaFile::paint( const TQPaintDevice* aTarget, bool absolute ) //----------------s------------------------------------------------------------- // Metafile painter methods //----------------------------------------------------------------------------- -void QWinMetaFile::setWindowOrg( long, short* parm ) +void TQWinMetaFile::setWindowOrg( long, short* parm ) { if ( mAbsoluteCoord ) { TQRect r = mPainter.window(); @@ -421,9 +421,9 @@ void QWinMetaFile::setWindowOrg( long, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::setWindowExt( long, short* parm ) +void TQWinMetaFile::setWindowExt( long, short* parm ) { - // negative value allowed for width and height : QABS() forbidden + // negative value allowed for width and height : TQABS() forbidden if ( mAbsoluteCoord ) { TQRect r = mPainter.window(); mPainter.setWindow( r.left(), r.top(), parm[ 1 ], parm[ 0 ] ); @@ -456,28 +456,28 @@ void QWinMetaFile::setWindowExt( long, short* parm ) //----------------------------------------------------------------------------- // Drawing //----------------------------------------------------------------------------- -void QWinMetaFile::lineTo( long, short* parm ) +void TQWinMetaFile::lineTo( long, short* parm ) { mPainter.lineTo( parm[ 1 ], parm[ 0 ] ); } //----------------------------------------------------------------------------- -void QWinMetaFile::moveTo( long, short* parm ) +void TQWinMetaFile::moveTo( long, short* parm ) { mPainter.moveTo( parm[ 1 ], parm[ 0 ] ); } //----------------------------------------------------------------------------- -void QWinMetaFile::ellipse( long, short* parm ) +void TQWinMetaFile::ellipse( long, short* parm ) { mPainter.drawEllipse( parm[ 3 ], parm[ 2 ], parm[ 1 ]-parm[ 3 ], parm[ 0 ]-parm[ 2 ] ); } //----------------------------------------------------------------------------- -void QWinMetaFile::polygon( long, short* parm ) +void TQWinMetaFile::polygon( long, short* parm ) { TQPointArray* pa; @@ -487,7 +487,7 @@ void QWinMetaFile::polygon( long, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::polyPolygon( long, short* parm ) +void TQWinMetaFile::polyPolygon( long, short* parm ) { TQRegion region; int i, j, startPolygon; @@ -512,9 +512,9 @@ void QWinMetaFile::polyPolygon( long, short* parm ) mPainter.fillRect( win.left(), win.top(), win.width(), win.height(), mPainter.brush() ); // draw polygon's border if necessary - if ( mPainter.pen().style() != Qt::NoPen ) { + if ( mPainter.pen().style() != TQt::NoPen ) { mPainter.setClipping( false ); - mPainter.setBrush( Qt::NoBrush ); + mPainter.setBrush( TQt::NoBrush ); TQPointArray* pa; int idxPolygon = 1 + parm[ 0 ]; @@ -530,7 +530,7 @@ void QWinMetaFile::polyPolygon( long, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::polyline( long, short* parm ) +void TQWinMetaFile::polyline( long, short* parm ) { TQPointArray* pa; @@ -540,14 +540,14 @@ void QWinMetaFile::polyline( long, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::rectangle( long, short* parm ) +void TQWinMetaFile::rectangle( long, short* parm ) { mPainter.drawRect( parm[ 3 ], parm[ 2 ], parm[ 1 ]-parm[ 3 ], parm[ 0 ]-parm[ 2 ] ); } //----------------------------------------------------------------------------- -void QWinMetaFile::roundRect( long, short* parm ) +void TQWinMetaFile::roundRect( long, short* parm ) { int xRnd = 0, yRnd = 0; @@ -562,7 +562,7 @@ void QWinMetaFile::roundRect( long, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::arc( long, short* parm ) +void TQWinMetaFile::arc( long, short* parm ) { int xCenter, yCenter, angleStart, aLength; @@ -576,7 +576,7 @@ void QWinMetaFile::arc( long, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::chord( long, short* parm ) +void TQWinMetaFile::chord( long, short* parm ) { int xCenter, yCenter, angleStart, aLength; @@ -590,7 +590,7 @@ void QWinMetaFile::chord( long, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::pie( long, short* parm ) +void TQWinMetaFile::pie( long, short* parm ) { int xCenter, yCenter, angleStart, aLength; @@ -604,29 +604,29 @@ void QWinMetaFile::pie( long, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::setPolyFillMode( long, short* parm ) +void TQWinMetaFile::setPolyFillMode( long, short* parm ) { mWinding = parm[ 0 ]; } //----------------------------------------------------------------------------- -void QWinMetaFile::setBkColor( long, short* parm ) +void TQWinMetaFile::setBkColor( long, short* parm ) { mPainter.setBackgroundColor( color( parm ) ); } //----------------------------------------------------------------------------- -void QWinMetaFile::setBkMode( long, short* parm ) +void TQWinMetaFile::setBkMode( long, short* parm ) { - if ( parm[ 0 ]==1 ) mPainter.setBackgroundMode( Qt::TransparentMode ); - else mPainter.setBackgroundMode( Qt::OpaqueMode ); + if ( parm[ 0 ]==1 ) mPainter.setBackgroundMode( TQt::TransparentMode ); + else mPainter.setBackgroundMode( TQt::OpaqueMode ); } //----------------------------------------------------------------------------- -void QWinMetaFile::setPixel( long, short* parm ) +void TQWinMetaFile::setPixel( long, short* parm ) { TQPen pen = mPainter.pen(); mPainter.setPen( color( parm ) ); @@ -636,21 +636,21 @@ void QWinMetaFile::setPixel( long, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::setRop( long, short* parm ) +void TQWinMetaFile::setRop( long, short* parm ) { - mPainter.setRasterOp( winToQtRaster( parm[ 0 ] ) ); + mPainter.setRasterOp( winToTQtRaster( parm[ 0 ] ) ); } //----------------------------------------------------------------------------- -void QWinMetaFile::saveDC( long, short* ) +void TQWinMetaFile::saveDC( long, short* ) { mPainter.save(); } //----------------------------------------------------------------------------- -void QWinMetaFile::restoreDC( long, short *parm ) +void TQWinMetaFile::restoreDC( long, short *parm ) { for ( int i=0; i > parm[ 0 ] ; i-- ) mPainter.restore(); @@ -658,7 +658,7 @@ void QWinMetaFile::restoreDC( long, short *parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::intersectClipRect( long, short* parm ) +void TQWinMetaFile::intersectClipRect( long, short* parm ) { /* TODO: better implementation : need QT 3.0.2 TQRegion region = mPainter.clipRegion(); @@ -675,7 +675,7 @@ void QWinMetaFile::intersectClipRect( long, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::excludeClipRect( long, short* parm ) +void TQWinMetaFile::excludeClipRect( long, short* parm ) { /* TODO: better implementation : need QT 3.0.2 TQRegion region = mPainter.clipRegion(); @@ -694,21 +694,21 @@ void QWinMetaFile::excludeClipRect( long, short* parm ) //----------------------------------------------------------------------------- // Text //----------------------------------------------------------------------------- -void QWinMetaFile::setTextColor( long, short* parm ) +void TQWinMetaFile::setTextColor( long, short* parm ) { mTextColor = color( parm ); } //----------------------------------------------------------------------------- -void QWinMetaFile::setTextAlign( long, short* parm ) +void TQWinMetaFile::setTextAlign( long, short* parm ) { mTextAlign = parm[ 0 ]; } //----------------------------------------------------------------------------- -void QWinMetaFile::textOut( long num, short* parm ) +void TQWinMetaFile::textOut( long num, short* parm ) { short *copyParm = new short[ num + 1 ]; @@ -727,7 +727,7 @@ void QWinMetaFile::textOut( long num, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::extTextOut( long num, short* parm ) +void TQWinMetaFile::extTextOut( long num, short* parm ) { char* ptStr; int x, y, width, height; @@ -773,14 +773,14 @@ void QWinMetaFile::extTextOut( long num, short* parm ) if ( ( parm[ 2 ] > 1 ) && ( num >= (idxOffset + parm[ 2 ]) ) && ( parm[ 3 ] == 0 ) ) { // offset for each char int left = x; - mPainter.drawText( left, y, width, height, Qt::AlignLeft | Qt::AlignTop, text.mid(0, 1) ); + mPainter.drawText( left, y, width, height, TQt::AlignLeft | TQt::AlignTop, text.mid(0, 1) ); for ( int i = 1; i < parm[ 2 ] ; i++ ) { left += parm[ idxOffset + i - 1 ]; - mPainter.drawText( left, y, width, height, Qt::AlignLeft | Qt::AlignTop, text.mid(i, 1) ); + mPainter.drawText( left, y, width, height, TQt::AlignLeft | TQt::AlignTop, text.mid(i, 1) ); } } else { - mPainter.drawText( x, y, width, height, Qt::AlignLeft | Qt::AlignTop, text ); + mPainter.drawText( x, y, width, height, TQt::AlignLeft | TQt::AlignTop, text ); } mPainter.restore(); @@ -792,7 +792,7 @@ void QWinMetaFile::extTextOut( long num, short* parm ) //----------------------------------------------------------------------------- // Bitmap //----------------------------------------------------------------------------- -void QWinMetaFile::dibBitBlt( long num, short* parm ) +void TQWinMetaFile::dibBitBlt( long num, short* parm ) { if ( num > 9 ) { // DIB image TQImage bmpSrc; @@ -800,7 +800,7 @@ void QWinMetaFile::dibBitBlt( long num, short* parm ) if ( dibToBmp( bmpSrc, (char*)&parm[ 8 ], (num - 8) * 2 ) ) { long raster = toDWord( parm ); - mPainter.setRasterOp( winToQtRaster( raster ) ); + mPainter.setRasterOp( winToTQtRaster( raster ) ); // wmf file allow negative width or height mPainter.save(); @@ -817,20 +817,20 @@ void QWinMetaFile::dibBitBlt( long num, short* parm ) } } else { - kdDebug() << "QWinMetaFile::dibBitBlt without image: not implemented " << endl; + kdDebug() << "TQWinMetaFile::dibBitBlt without image: not implemented " << endl; } } //----------------------------------------------------------------------------- -void QWinMetaFile::dibStretchBlt( long num, short* parm ) +void TQWinMetaFile::dibStretchBlt( long num, short* parm ) { TQImage bmpSrc; if ( dibToBmp( bmpSrc, (char*)&parm[ 10 ], (num - 10) * 2 ) ) { long raster = toDWord( parm ); - mPainter.setRasterOp( winToQtRaster( raster ) ); + mPainter.setRasterOp( winToTQtRaster( raster ) ); // wmf file allow negative width or height mPainter.save(); @@ -852,14 +852,14 @@ void QWinMetaFile::dibStretchBlt( long num, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::stretchDib( long num, short* parm ) +void TQWinMetaFile::stretchDib( long num, short* parm ) { TQImage bmpSrc; if ( dibToBmp( bmpSrc, (char*)&parm[ 11 ], (num - 11) * 2 ) ) { long raster = toDWord( parm ); - mPainter.setRasterOp( winToQtRaster( raster ) ); + mPainter.setRasterOp( winToTQtRaster( raster ) ); // wmf file allow negative width or height mPainter.save(); @@ -881,7 +881,7 @@ void QWinMetaFile::stretchDib( long num, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::dibCreatePatternBrush( long num, short* parm ) +void TQWinMetaFile::dibCreatePatternBrush( long num, short* parm ) { WinObjPatternBrushHandle* handle = new WinObjPatternBrushHandle; addHandle( handle ); @@ -897,7 +897,7 @@ void QWinMetaFile::dibCreatePatternBrush( long num, short* parm ) //----------------------------------------------------------------------------- // Object handle //----------------------------------------------------------------------------- -void QWinMetaFile::selectObject( long, short* parm ) +void TQWinMetaFile::selectObject( long, short* parm ) { int idx = parm[ 0 ]; if ( idx>=0 && idx < MAX_OBJHANDLE && mObjHandleTab[ idx ] ) @@ -906,45 +906,45 @@ void QWinMetaFile::selectObject( long, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::deleteObject( long, short* parm ) +void TQWinMetaFile::deleteObject( long, short* parm ) { deleteHandle( parm[ 0 ] ); } //----------------------------------------------------------------------------- -void QWinMetaFile::createEmptyObject( long, short* ) +void TQWinMetaFile::createEmptyObject( long, short* ) { // allocation of an empty object (to keep object counting in sync) WinObjPenHandle* handle = new WinObjPenHandle; addHandle( handle ); - kdDebug() << "QWinMetaFile: unimplemented createObject " << endl; + kdDebug() << "TQWinMetaFile: unimplemented createObject " << endl; } //----------------------------------------------------------------------------- -void QWinMetaFile::createBrushIndirect( long, short* parm ) +void TQWinMetaFile::createBrushIndirect( long, short* parm ) { - static Qt::BrushStyle hatchedStyleTab[] = + static TQt::BrushStyle hatchedStyleTab[] = { - Qt::HorPattern, - Qt::FDiagPattern, - Qt::BDiagPattern, - Qt::CrossPattern, - Qt::DiagCrossPattern + TQt::HorPattern, + TQt::FDiagPattern, + TQt::BDiagPattern, + TQt::CrossPattern, + TQt::DiagCrossPattern }; - static Qt::BrushStyle styleTab[] = - { Qt::SolidPattern, - Qt::NoBrush, - Qt::FDiagPattern, /* hatched */ - Qt::Dense4Pattern, /* should be custom bitmap pattern */ - Qt::HorPattern, /* should be BS_INDEXED (?) */ - Qt::VerPattern, /* should be device-independent bitmap */ - Qt::Dense6Pattern, /* should be device-independent packed-bitmap */ - Qt::Dense2Pattern, /* should be BS_PATTERN8x8 */ - Qt::Dense3Pattern /* should be device-independent BS_DIBPATTERN8x8 */ + static TQt::BrushStyle styleTab[] = + { TQt::SolidPattern, + TQt::NoBrush, + TQt::FDiagPattern, /* hatched */ + TQt::Dense4Pattern, /* should be custom bitmap pattern */ + TQt::HorPattern, /* should be BS_INDEXED (?) */ + TQt::VerPattern, /* should be tqdevice-independent bitmap */ + TQt::Dense6Pattern, /* should be tqdevice-independent packed-bitmap */ + TQt::Dense2Pattern, /* should be BS_PATTERN8x8 */ + TQt::Dense3Pattern /* should be tqdevice-independent BS_DIBPATTERN8x8 */ }; - Qt::BrushStyle style; + TQt::BrushStyle style; short arg; WinObjBrushHandle* handle = new WinObjBrushHandle; addHandle( handle ); @@ -956,16 +956,16 @@ void QWinMetaFile::createBrushIndirect( long, short* parm ) if ( arg>=0 && arg<5 ) style = hatchedStyleTab[ arg ]; else { - kdDebug() << "QWinMetaFile::createBrushIndirect: invalid hatched brush " << arg << endl; - style = Qt::SolidPattern; + kdDebug() << "TQWinMetaFile::createBrushIndirect: invalid hatched brush " << arg << endl; + style = TQt::SolidPattern; } } else if ( arg>=0 && arg<9 ) style = styleTab[ arg ]; else { - kdDebug() << "QWinMetaFile::createBrushIndirect: invalid brush " << arg << endl; - style = Qt::SolidPattern; + kdDebug() << "TQWinMetaFile::createBrushIndirect: invalid brush " << arg << endl; + style = TQt::SolidPattern; } handle->brush.setStyle( style ); handle->brush.setColor( color( parm+1 ) ); @@ -973,28 +973,28 @@ void QWinMetaFile::createBrushIndirect( long, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::createPenIndirect( long, short* parm ) +void TQWinMetaFile::createPenIndirect( long, short* parm ) { - static Qt::PenStyle styleTab[] = - { Qt::SolidLine, Qt::DashLine, Qt::DotLine, Qt::DashDotLine, Qt::DashDotDotLine, - Qt::NoPen, Qt::SolidLine }; - Qt::PenStyle style; + static TQt::PenStyle styleTab[] = + { TQt::SolidLine, TQt::DashLine, TQt::DotLine, TQt::DashDotLine, TQt::DashDotDotLine, + TQt::NoPen, TQt::SolidLine }; + TQt::PenStyle style; WinObjPenHandle* handle = new WinObjPenHandle; addHandle( handle ); if ( parm[ 0 ]>=0 && parm[ 0 ]<6 ) style=styleTab[ parm[ 0 ] ]; else { - kdDebug() << "QWinMetaFile::createPenIndirect: invalid pen " << parm[ 0 ] << endl; - style = Qt::SolidLine; + kdDebug() << "TQWinMetaFile::createPenIndirect: invalid pen " << parm[ 0 ] << endl; + style = TQt::SolidLine; } handle->pen.setStyle( style ); handle->pen.setColor( color( parm+3 ) ); - handle->pen.setCapStyle( Qt::RoundCap ); + handle->pen.setCapStyle( TQt::RoundCap ); //int width = 0; - // TODO : width of pen proportional to device context width + // TODO : width of pen proportional to tqdevice context width // DOESN'T WORK /* TQRect devRec; @@ -1010,7 +1010,7 @@ void QWinMetaFile::createPenIndirect( long, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::createFontIndirect( long , short* parm) +void TQWinMetaFile::createFontIndirect( long , short* parm) { WinObjFontHandle* handle = new WinObjFontHandle; addHandle( handle ); @@ -1022,7 +1022,7 @@ void QWinMetaFile::createFontIndirect( long , short* parm) handle->font.setFamily( family ); handle->font.setFixedPitch( ((parm[ 8 ] & 0x01) == 0) ); // TODO: investigation why some test case need -2. (size of font in logical point) - handle->font.setPointSize( QABS(parm[ 0 ]) - 2 ); + handle->font.setPointSize( TQABS(parm[ 0 ]) - 2 ); handle->font.setWeight( (parm[ 4 ] >> 3) ); handle->font.setItalic( (parm[ 5 ] & 0x01) ); handle->font.setUnderline( (parm[ 5 ] & 0x100) ); @@ -1032,12 +1032,12 @@ void QWinMetaFile::createFontIndirect( long , short* parm) //----------------------------------------------------------------------------- // Misc //----------------------------------------------------------------------------- -void QWinMetaFile::noop( long, short* ) +void TQWinMetaFile::noop( long, short* ) { } -void QWinMetaFile::end( long, short* ) +void TQWinMetaFile::end( long, short* ) { // end of file : // kdDebug() << "END bbox=( " << mBBox.left() << "; " << mBBox.top() << "; " << mBBox.width() << "; " << mBBox.height() << ")" << endl; @@ -1045,7 +1045,7 @@ void QWinMetaFile::end( long, short* ) //----------------------------------------------------------------------------- -unsigned short QWinMetaFile::calcCheckSum( WmfPlaceableHeader* apmfh ) +unsigned short TQWinMetaFile::calcCheckSum( WmfPlaceableHeader* apmfh ) { WORD* lpWord; WORD wResult, i; @@ -1062,7 +1062,7 @@ unsigned short QWinMetaFile::calcCheckSum( WmfPlaceableHeader* apmfh ) //----------------------------------------------------------------------------- -int QWinMetaFile::findFunc( unsigned short aFunc ) const +int TQWinMetaFile::findFunc( unsigned short aFunc ) const { int i; @@ -1074,7 +1074,7 @@ int QWinMetaFile::findFunc( unsigned short aFunc ) const } //----------------------------------------------------------------------------- -TQPointArray* QWinMetaFile::pointArray( short num, short* parm ) +TQPointArray* TQWinMetaFile::pointArray( short num, short* parm ) { int i; @@ -1087,7 +1087,7 @@ TQPointArray* QWinMetaFile::pointArray( short num, short* parm ) } //----------------------------------------------------------------------------- -unsigned int QWinMetaFile::toDWord( short* parm ) +unsigned int TQWinMetaFile::toDWord( short* parm ) { unsigned int l; @@ -1109,7 +1109,7 @@ unsigned int QWinMetaFile::toDWord( short* parm ) //----------------------------------------------------------------------------- -TQColor QWinMetaFile::color( short* parm ) +TQColor TQWinMetaFile::color( short* parm ) { unsigned int colorRef; int red, green, blue; @@ -1124,7 +1124,7 @@ TQColor QWinMetaFile::color( short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::xyToAngle( int xStart, int yStart, int xEnd, int yEnd, int& angleStart, int& angleLength ) +void TQWinMetaFile::xyToAngle( int xStart, int yStart, int xEnd, int yEnd, int& angleStart, int& angleLength ) { float aStart, aLength; @@ -1138,7 +1138,7 @@ void QWinMetaFile::xyToAngle( int xStart, int yStart, int xEnd, int yEnd, int& a //----------------------------------------------------------------------------- -void QWinMetaFile::addHandle( WinObjHandle* handle ) +void TQWinMetaFile::addHandle( WinObjHandle* handle ) { int idx; @@ -1148,11 +1148,11 @@ void QWinMetaFile::addHandle( WinObjHandle* handle ) if ( idx < MAX_OBJHANDLE ) mObjHandleTab[ idx ] = handle; else - kdDebug() << "QWinMetaFile error: handle table full !" << endl; + kdDebug() << "TQWinMetaFile error: handle table full !" << endl; } //----------------------------------------------------------------------------- -void QWinMetaFile::deleteHandle( int idx ) +void TQWinMetaFile::deleteHandle( int idx ) { if ( idx >= 0 && idx < MAX_OBJHANDLE && mObjHandleTab[ idx ] ) { @@ -1162,25 +1162,25 @@ void QWinMetaFile::deleteHandle( int idx ) } //----------------------------------------------------------------------------- -Qt::RasterOp QWinMetaFile::winToQtRaster( short parm ) const +TQt::RasterOp TQWinMetaFile::winToTQtRaster( short parm ) const { - static const Qt::RasterOp opTab[] = + static const TQt::RasterOp opTab[] = { - Qt::CopyROP, - Qt::ClearROP, Qt::NandROP, Qt::NotAndROP, Qt::NotCopyROP, - Qt::AndNotROP, Qt::NotROP, Qt::XorROP, Qt::NorROP, - Qt::AndROP, Qt::NotXorROP, Qt::NopROP, Qt::NotOrROP, - Qt::CopyROP, Qt::OrNotROP, Qt::OrROP, Qt::SetROP + TQt::CopyROP, + TQt::ClearROP, TQt::NandROP, TQt::NotAndROP, TQt::NotCopyROP, + TQt::AndNotROP, TQt::NotROP, TQt::XorROP, TQt::NorROP, + TQt::AndROP, TQt::NotXorROP, TQt::NopROP, TQt::NotOrROP, + TQt::CopyROP, TQt::OrNotROP, TQt::OrROP, TQt::SetROP }; if ( parm > 0 && parm <= 16 ) return opTab[ parm ]; else - return Qt::CopyROP; + return TQt::CopyROP; } //----------------------------------------------------------------------------- -Qt::RasterOp QWinMetaFile::winToQtRaster( long parm ) const +TQt::RasterOp TQWinMetaFile::winToTQtRaster( long parm ) const { /* TODO: Ternary raster operations 0x00C000CA dest = (source AND pattern) @@ -1190,24 +1190,24 @@ Qt::RasterOp QWinMetaFile::winToQtRaster( long parm ) const static const struct OpTab { long winRasterOp; - Qt::RasterOp qtRasterOp; + TQt::RasterOp qtRasterOp; } opTab[] = { - { 0x00CC0020, Qt::CopyROP }, - { 0x00EE0086, Qt::OrROP }, - { 0x008800C6, Qt::AndROP }, - { 0x00660046, Qt::XorROP }, - { 0x00440328, Qt::AndNotROP }, - { 0x00330008, Qt::NotCopyROP }, - { 0x001100A6, Qt::NandROP }, - { 0x00C000CA, Qt::CopyROP }, - { 0x00BB0226, Qt::NotOrROP }, - { 0x00F00021, Qt::CopyROP }, - { 0x00FB0A09, Qt::CopyROP }, - { 0x005A0049, Qt::CopyROP }, - { 0x00550009, Qt::NotROP }, - { 0x00000042, Qt::ClearROP }, - { 0x00FF0062, Qt::SetROP } + { 0x00CC0020, TQt::CopyROP }, + { 0x00EE0086, TQt::OrROP }, + { 0x008800C6, TQt::AndROP }, + { 0x00660046, TQt::XorROP }, + { 0x00440328, TQt::AndNotROP }, + { 0x00330008, TQt::NotCopyROP }, + { 0x001100A6, TQt::NandROP }, + { 0x00C000CA, TQt::CopyROP }, + { 0x00BB0226, TQt::NotOrROP }, + { 0x00F00021, TQt::CopyROP }, + { 0x00FB0A09, TQt::CopyROP }, + { 0x005A0049, TQt::CopyROP }, + { 0x00550009, TQt::NotROP }, + { 0x00000042, TQt::ClearROP }, + { 0x00FF0062, TQt::SetROP } }; int i; @@ -1218,11 +1218,11 @@ Qt::RasterOp QWinMetaFile::winToQtRaster( long parm ) const if ( i < 15 ) return opTab[ i ].qtRasterOp; else - return Qt::CopyROP; + return TQt::CopyROP; } //----------------------------------------------------------------------------- -bool QWinMetaFile::dibToBmp( TQImage& bmp, const char* dib, long size ) +bool TQWinMetaFile::dibToBmp( TQImage& bmp, const char* dib, long size ) { typedef struct _BMPFILEHEADER { WORD bmType; @@ -1245,7 +1245,7 @@ bool QWinMetaFile::dibToBmp( TQImage& bmp, const char* dib, long size ) bmpHeader->bmSize = sizeBmp; if ( !bmp.loadFromData( (const uchar*)bmpHeader, pattern.size(), "BMP" ) ) { - kdDebug() << "QWinMetaFile::dibToBmp: invalid bitmap " << endl; + kdDebug() << "TQWinMetaFile::dibToBmp: invalid bitmap " << endl; return false; } else { |