From f008adb5a77e094eaf6abf3fc0f36958e66896a5 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 25 Jun 2011 05:28:35 +0000 Subject: TQt4 port koffice This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- lib/kwmf/kowmfreadprivate.cc | 354 +++++++++++++++++++++---------------------- 1 file changed, 177 insertions(+), 177 deletions(-) (limited to 'lib/kwmf/kowmfreadprivate.cc') diff --git a/lib/kwmf/kowmfreadprivate.cc b/lib/kwmf/kowmfreadprivate.cc index 7a8c5efa..a5a8ea18 100644 --- a/lib/kwmf/kowmfreadprivate.cc +++ b/lib/kwmf/kowmfreadprivate.cc @@ -19,12 +19,12 @@ */ #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include "kowmfreadprivate.h" @@ -59,7 +59,7 @@ KoWmfReadPrivate::~KoWmfReadPrivate() } -bool KoWmfReadPrivate::load( const QByteArray& array ) +bool KoWmfReadPrivate::load( const TQByteArray& array ) { // delete previous buffer if ( mBuffer != 0 ) { @@ -68,7 +68,7 @@ bool KoWmfReadPrivate::load( const QByteArray& array ) } // load into buffer - mBuffer = new QBuffer( array ); + mBuffer = new TQBuffer( array ); mBuffer->open( IO_ReadOnly ); // read and check the header @@ -78,11 +78,11 @@ bool KoWmfReadPrivate::load( const QByteArray& array ) unsigned short checksum; int filePos; - QDataStream st( mBuffer ); - st.setByteOrder( QDataStream::LittleEndian ); + TQDataStream st( mBuffer ); + st.setByteOrder( TQDataStream::LittleEndian ); mStackOverflow = mWinding = false; mTextAlign = mTextRotation = 0; - mTextColor = Qt::black; + mTextColor = TQt::black; mValid = false; mStandard = false; mPlaceable = false; @@ -90,7 +90,7 @@ bool KoWmfReadPrivate::load( const QByteArray& array ) //----- Read placeable metafile header st >> pheader.key; - if ( pheader.key==( Q_UINT32 )APMHEADER_KEY ) { + if ( pheader.key==( TQ_UINT32 )APMHEADER_KEY ) { mPlaceable = true; st >> pheader.handle; st >> pheader.left; @@ -175,8 +175,8 @@ bool KoWmfReadPrivate::load( const QByteArray& array ) // check bounding rectangle for standard meta file if ( (mValid) && (mStandard) ) { - Q_UINT16 numFunction = 1; - Q_UINT32 size; + TQ_UINT16 numFunction = 1; + TQ_UINT32 size; bool firstOrg=true, firstExt=true; // search functions setWindowOrg and setWindowExt @@ -192,7 +192,7 @@ bool KoWmfReadPrivate::load( const QByteArray& array ) numFunction &= 0xFF; if ( numFunction == 11 ) { - Q_INT16 top, left; + TQ_INT16 top, left; st >> top >> left; if ( firstOrg ) { @@ -206,7 +206,7 @@ bool KoWmfReadPrivate::load( const QByteArray& array ) } } if ( numFunction == 12 ) { - Q_INT16 width, height; + TQ_INT16 width, height; st >> height >> width; if ( width < 0 ) width = -width; @@ -255,13 +255,13 @@ bool KoWmfReadPrivate::play( KoWmfRead* readWmf ) mObjHandleTab[ i ] = 0; } - Q_UINT16 numFunction; - Q_UINT32 size; + TQ_UINT16 numFunction; + TQ_UINT32 size; int bufferOffset, j; // buffer with functions - QDataStream st( mBuffer ); - st.setByteOrder( QDataStream::LittleEndian ); + TQDataStream st( mBuffer ); + st.setByteOrder( TQDataStream::LittleEndian ); mReadWmf = readWmf; mWindow = mBBox; @@ -276,7 +276,7 @@ bool KoWmfReadPrivate::play( KoWmfRead* readWmf ) st >> size >> numFunction; /** - * mapping between n° function and index of table 'metaFuncTab' + * mapping between n� function and index of table 'metaFuncTab' * lower 8 digits of the function => entry in the table */ numFunction &= 0xFF; @@ -295,10 +295,10 @@ bool KoWmfReadPrivate::play( KoWmfRead* readWmf ) if ( (j+12) > mNbrFunc ) { // output last 12 functions int offBuff = mBuffer->at(); - Q_UINT16 param; + TQ_UINT16 param; kdDebug() << j << " : " << numFunction << " : "; - for ( Q_UINT16 i=0 ; i < (size-3) ; i++ ) { + for ( TQ_UINT16 i=0 ; i < (size-3) ; i++ ) { st >> param; kdDebug() << param << " "; } @@ -334,9 +334,9 @@ bool KoWmfReadPrivate::play( KoWmfRead* readWmf ) //----------------------------------------------------------------------------- // Metafile painter methods -void KoWmfReadPrivate::setWindowOrg( Q_UINT32, QDataStream& stream ) +void KoWmfReadPrivate::setWindowOrg( TQ_UINT32, TQDataStream& stream ) { - Q_INT16 top, left; + TQ_INT16 top, left; stream >> top >> left; mReadWmf->setWindowOrg( left, top ); @@ -348,9 +348,9 @@ void KoWmfReadPrivate::setWindowOrg( Q_UINT32, QDataStream& stream ) /* TODO : deeper look in negative width and height */ -void KoWmfReadPrivate::setWindowExt( Q_UINT32, QDataStream& stream ) +void KoWmfReadPrivate::setWindowExt( TQ_UINT32, TQDataStream& stream ) { - Q_INT16 width, height; + TQ_INT16 width, height; // negative value allowed for width and height stream >> height >> width; @@ -361,9 +361,9 @@ void KoWmfReadPrivate::setWindowExt( Q_UINT32, QDataStream& stream ) } -void KoWmfReadPrivate::OffsetWindowOrg( Q_UINT32, QDataStream &stream ) +void KoWmfReadPrivate::OffsetWindowOrg( TQ_UINT32, TQDataStream &stream ) { - Q_INT16 offTop, offLeft; + TQ_INT16 offTop, offLeft; stream >> offTop >> offLeft; mReadWmf->setWindowOrg( mWindow.left() + offLeft, mWindow.top() + offTop ); @@ -372,10 +372,10 @@ void KoWmfReadPrivate::OffsetWindowOrg( Q_UINT32, QDataStream &stream ) } -void KoWmfReadPrivate::ScaleWindowExt( Q_UINT32, QDataStream &stream ) +void KoWmfReadPrivate::ScaleWindowExt( TQ_UINT32, TQDataStream &stream ) { - Q_INT16 width, height; - Q_INT16 heightDenom, heightNum, widthDenom, widthNum; + TQ_INT16 width, height; + TQ_INT16 heightDenom, heightNum, widthDenom, widthNum; stream >> heightDenom >> heightNum >> widthDenom >> widthNum; @@ -393,62 +393,62 @@ void KoWmfReadPrivate::ScaleWindowExt( Q_UINT32, QDataStream &stream ) //----------------------------------------------------------------------------- // Drawing -void KoWmfReadPrivate::lineTo( Q_UINT32, QDataStream& stream ) +void KoWmfReadPrivate::lineTo( TQ_UINT32, TQDataStream& stream ) { - Q_INT16 top, left; + TQ_INT16 top, left; stream >> top >> left; mReadWmf->lineTo( left, top ); } -void KoWmfReadPrivate::moveTo( Q_UINT32, QDataStream& stream ) +void KoWmfReadPrivate::moveTo( TQ_UINT32, TQDataStream& stream ) { - Q_INT16 top, left; + TQ_INT16 top, left; stream >> top >> left; mReadWmf->moveTo( left, top ); } -void KoWmfReadPrivate::ellipse( Q_UINT32, QDataStream& stream ) +void KoWmfReadPrivate::ellipse( TQ_UINT32, TQDataStream& stream ) { - Q_INT16 top, left, right, bottom; + TQ_INT16 top, left, right, bottom; stream >> bottom >> right >> top >> left; mReadWmf->drawEllipse( left, top, right-left, bottom-top ); } -void KoWmfReadPrivate::polygon( Q_UINT32, QDataStream& stream ) +void KoWmfReadPrivate::polygon( TQ_UINT32, TQDataStream& stream ) { - Q_UINT16 num; + TQ_UINT16 num; stream >> num; - QPointArray pa( num ); + TQPointArray pa( num ); pointArray( stream, pa ); mReadWmf->drawPolygon( pa, mWinding ); } -void KoWmfReadPrivate::polyPolygon( Q_UINT32, QDataStream& stream ) +void KoWmfReadPrivate::polyPolygon( TQ_UINT32, TQDataStream& stream ) { - Q_UINT16 numberPoly; - Q_UINT16 sizePoly; - QPtrList listPa; + TQ_UINT16 numberPoly; + TQ_UINT16 sizePoly; + TQPtrList listPa; stream >> numberPoly; listPa.setAutoDelete( true ); for ( int i=0 ; i < numberPoly ; i++ ) { stream >> sizePoly; - listPa.append( new QPointArray( sizePoly ) ); + listPa.append( new TQPointArray( sizePoly ) ); } // list of point array - QPointArray *pa; + TQPointArray *pa; for ( pa = listPa.first() ; pa ; pa = listPa.next() ) { pointArray( stream, *pa ); } @@ -459,32 +459,32 @@ void KoWmfReadPrivate::polyPolygon( Q_UINT32, QDataStream& stream ) } -void KoWmfReadPrivate::polyline( Q_UINT32, QDataStream& stream ) +void KoWmfReadPrivate::polyline( TQ_UINT32, TQDataStream& stream ) { - Q_UINT16 num; + TQ_UINT16 num; stream >> num; - QPointArray pa( num ); + TQPointArray pa( num ); pointArray( stream, pa ); mReadWmf->drawPolyline( pa ); } -void KoWmfReadPrivate::rectangle( Q_UINT32, QDataStream& stream ) +void KoWmfReadPrivate::rectangle( TQ_UINT32, TQDataStream& stream ) { - Q_INT16 top, left, right, bottom; + TQ_INT16 top, left, right, bottom; stream >> bottom >> right >> top >> left; mReadWmf->drawRect( left, top, right-left, bottom-top ); } -void KoWmfReadPrivate::roundRect( Q_UINT32, QDataStream& stream ) +void KoWmfReadPrivate::roundRect( TQ_UINT32, TQDataStream& stream ) { int xRnd = 0, yRnd = 0; - Q_UINT16 widthCorner, heightCorner; - Q_INT16 top, left, right, bottom; + TQ_UINT16 widthCorner, heightCorner; + TQ_INT16 top, left, right, bottom; stream >> heightCorner >> widthCorner; stream >> bottom >> right >> top >> left; @@ -499,11 +499,11 @@ void KoWmfReadPrivate::roundRect( Q_UINT32, QDataStream& stream ) } -void KoWmfReadPrivate::arc( Q_UINT32, QDataStream& stream ) +void KoWmfReadPrivate::arc( TQ_UINT32, TQDataStream& stream ) { int xCenter, yCenter, angleStart, aLength; - Q_INT16 topEnd, leftEnd, topStart, leftStart; - Q_INT16 top, left, right, bottom; + TQ_INT16 topEnd, leftEnd, topStart, leftStart; + TQ_INT16 top, left, right, bottom; stream >> topEnd >> leftEnd >> topStart >> leftStart; stream >> bottom >> right >> top >> left; @@ -516,11 +516,11 @@ void KoWmfReadPrivate::arc( Q_UINT32, QDataStream& stream ) } -void KoWmfReadPrivate::chord( Q_UINT32, QDataStream& stream ) +void KoWmfReadPrivate::chord( TQ_UINT32, TQDataStream& stream ) { int xCenter, yCenter, angleStart, aLength; - Q_INT16 topEnd, leftEnd, topStart, leftStart; - Q_INT16 top, left, right, bottom; + TQ_INT16 topEnd, leftEnd, topStart, leftStart; + TQ_INT16 top, left, right, bottom; stream >> topEnd >> leftEnd >> topStart >> leftStart; stream >> bottom >> right >> top >> left; @@ -533,11 +533,11 @@ void KoWmfReadPrivate::chord( Q_UINT32, QDataStream& stream ) } -void KoWmfReadPrivate::pie( Q_UINT32, QDataStream& stream ) +void KoWmfReadPrivate::pie( TQ_UINT32, TQDataStream& stream ) { int xCenter, yCenter, angleStart, aLength; - Q_INT16 topEnd, leftEnd, topStart, leftStart; - Q_INT16 top, left, right, bottom; + TQ_INT16 topEnd, leftEnd, topStart, leftStart; + TQ_INT16 top, left, right, bottom; stream >> topEnd >> leftEnd >> topStart >> leftStart; stream >> bottom >> right >> top >> left; @@ -550,27 +550,27 @@ void KoWmfReadPrivate::pie( Q_UINT32, QDataStream& stream ) } -void KoWmfReadPrivate::setPolyFillMode( Q_UINT32, QDataStream& stream ) +void KoWmfReadPrivate::setPolyFillMode( TQ_UINT32, TQDataStream& stream ) { - Q_UINT16 winding; + TQ_UINT16 winding; stream >> winding; mWinding = (winding != 0); } -void KoWmfReadPrivate::setBkColor( Q_UINT32, QDataStream& stream ) +void KoWmfReadPrivate::setBkColor( TQ_UINT32, TQDataStream& stream ) { - Q_UINT32 color; + TQ_UINT32 color; stream >> color; mReadWmf->setBackgroundColor( qtColor( color ) ); } -void KoWmfReadPrivate::setBkMode( Q_UINT32, QDataStream& stream ) +void KoWmfReadPrivate::setBkMode( TQ_UINT32, TQDataStream& stream ) { - Q_UINT16 bkMode; + TQ_UINT16 bkMode; stream >> bkMode; if ( bkMode == 1 ) @@ -580,15 +580,15 @@ void KoWmfReadPrivate::setBkMode( Q_UINT32, QDataStream& stream ) } -void KoWmfReadPrivate::setPixel( Q_UINT32, QDataStream& stream ) +void KoWmfReadPrivate::setPixel( TQ_UINT32, TQDataStream& stream ) { - Q_INT16 top, left; - Q_UINT32 color; + TQ_INT16 top, left; + TQ_UINT32 color; stream >> color >> top >> left; - QPen oldPen = mReadWmf->pen(); - QPen pen = oldPen; + TQPen oldPen = mReadWmf->pen(); + TQPen pen = oldPen; pen.setColor( qtColor( color ) ); mReadWmf->setPen( pen ); mReadWmf->moveTo( left, top ); @@ -597,24 +597,24 @@ void KoWmfReadPrivate::setPixel( Q_UINT32, QDataStream& stream ) } -void KoWmfReadPrivate::setRop( Q_UINT32, QDataStream& stream ) +void KoWmfReadPrivate::setRop( TQ_UINT32, TQDataStream& stream ) { - Q_UINT16 rop; + TQ_UINT16 rop; stream >> rop; - mReadWmf->setRasterOp( winToQtRaster( rop ) ); + mReadWmf->setRasterOp( winToTQtRaster( rop ) ); } -void KoWmfReadPrivate::saveDC( Q_UINT32, QDataStream& ) +void KoWmfReadPrivate::saveDC( TQ_UINT32, TQDataStream& ) { mReadWmf->save(); } -void KoWmfReadPrivate::restoreDC( Q_UINT32, QDataStream& stream ) +void KoWmfReadPrivate::restoreDC( TQ_UINT32, TQDataStream& stream ) { - Q_INT16 num; + TQ_INT16 num; stream >> num; for ( int i=0; i > num ; i-- ) @@ -622,14 +622,14 @@ void KoWmfReadPrivate::restoreDC( Q_UINT32, QDataStream& stream ) } -void KoWmfReadPrivate::intersectClipRect( Q_UINT32, QDataStream& stream ) +void KoWmfReadPrivate::intersectClipRect( TQ_UINT32, TQDataStream& stream ) { - Q_INT16 top, left, right, bottom; + TQ_INT16 top, left, right, bottom; stream >> bottom >> right >> top >> left; - QRegion region = mReadWmf->clipRegion(); - QRegion newRegion( left, top, right-left, bottom-top ); + TQRegion region = mReadWmf->clipRegion(); + TQRegion newRegion( left, top, right-left, bottom-top ); if ( region.isEmpty() ) { region = newRegion; } @@ -641,14 +641,14 @@ void KoWmfReadPrivate::intersectClipRect( Q_UINT32, QDataStream& stream ) } -void KoWmfReadPrivate::excludeClipRect( Q_UINT32, QDataStream& stream ) +void KoWmfReadPrivate::excludeClipRect( TQ_UINT32, TQDataStream& stream ) { - Q_INT16 top, left, right, bottom; + TQ_INT16 top, left, right, bottom; stream >> bottom >> right >> top >> left; - QRegion region = mReadWmf->clipRegion(); - QRegion newRegion( left, top, right-left, bottom-top ); + TQRegion region = mReadWmf->clipRegion(); + TQRegion newRegion( left, top, right-left, bottom-top ); if ( region.isEmpty() ) { region = newRegion; } @@ -663,22 +663,22 @@ void KoWmfReadPrivate::excludeClipRect( Q_UINT32, QDataStream& stream ) //----------------------------------------------------------------------------- // Text -void KoWmfReadPrivate::setTextColor( Q_UINT32, QDataStream& stream ) +void KoWmfReadPrivate::setTextColor( TQ_UINT32, TQDataStream& stream ) { - Q_UINT32 color; + TQ_UINT32 color; stream >> color; mTextColor = qtColor( color ); } -void KoWmfReadPrivate::setTextAlign( Q_UINT32, QDataStream& stream ) +void KoWmfReadPrivate::setTextAlign( TQ_UINT32, TQDataStream& stream ) { stream >> mTextAlign; } -void KoWmfReadPrivate::textOut( Q_UINT32, QDataStream& ) +void KoWmfReadPrivate::textOut( TQ_UINT32, TQDataStream& ) { if ( mNbrFunc ) { kdDebug() << "textOut : unimplemented " << endl; @@ -686,7 +686,7 @@ void KoWmfReadPrivate::textOut( Q_UINT32, QDataStream& ) } -void KoWmfReadPrivate::extTextOut( Q_UINT32 , QDataStream& ) +void KoWmfReadPrivate::extTextOut( TQ_UINT32 , TQDataStream& ) { if ( mNbrFunc ) { kdDebug() << "extTextOut : unimplemented " << endl; @@ -698,7 +698,7 @@ void KoWmfReadPrivate::extTextOut( Q_UINT32 , QDataStream& ) //----------------------------------------------------------------------------- // Bitmap -void KoWmfReadPrivate::SetStretchBltMode( Q_UINT32, QDataStream& ) +void KoWmfReadPrivate::SetStretchBltMode( TQ_UINT32, TQDataStream& ) { if ( mNbrFunc ) { kdDebug() << "SetStretchBltMode : unimplemented " << endl; @@ -706,31 +706,31 @@ void KoWmfReadPrivate::SetStretchBltMode( Q_UINT32, QDataStream& ) } -void KoWmfReadPrivate::dibBitBlt( Q_UINT32 size, QDataStream& stream ) +void KoWmfReadPrivate::dibBitBlt( TQ_UINT32 size, TQDataStream& stream ) { - Q_UINT32 raster; - Q_INT16 topSrc, leftSrc, widthSrc, heightSrc; - Q_INT16 topDst, leftDst; + TQ_UINT32 raster; + TQ_INT16 topSrc, leftSrc, widthSrc, heightSrc; + TQ_INT16 topDst, leftDst; stream >> raster; stream >> topSrc >> leftSrc >> heightSrc >> widthSrc; stream >> topDst >> leftDst; if ( size > 11 ) { // DIB image - QImage bmpSrc; + TQImage bmpSrc; if ( dibToBmp( bmpSrc, stream, (size - 11) * 2 ) ) { - mReadWmf->setRasterOp( winToQtRaster( raster ) ); + mReadWmf->setRasterOp( winToTQtRaster( raster ) ); mReadWmf->save(); if ( widthSrc < 0 ) { // negative width => horizontal flip - QWMatrix m( -1.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F ); + TQWMatrix m( -1.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F ); mReadWmf->setWorldMatrix( m, true ); } if ( heightSrc < 0 ) { // negative height => vertical flip - QWMatrix m( 1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F ); + TQWMatrix m( 1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F ); mReadWmf->setWorldMatrix( m, true ); } mReadWmf->drawImage( leftDst, topDst, bmpSrc, leftSrc, topSrc, widthSrc, heightSrc ); @@ -743,33 +743,33 @@ void KoWmfReadPrivate::dibBitBlt( Q_UINT32 size, QDataStream& stream ) } -void KoWmfReadPrivate::dibStretchBlt( Q_UINT32 size, QDataStream& stream ) +void KoWmfReadPrivate::dibStretchBlt( TQ_UINT32 size, TQDataStream& stream ) { - Q_UINT32 raster; - Q_INT16 topSrc, leftSrc, widthSrc, heightSrc; - Q_INT16 topDst, leftDst, widthDst, heightDst; - QImage bmpSrc; + TQ_UINT32 raster; + TQ_INT16 topSrc, leftSrc, widthSrc, heightSrc; + TQ_INT16 topDst, leftDst, widthDst, heightDst; + TQImage bmpSrc; stream >> raster; stream >> heightSrc >> widthSrc >> topSrc >> leftSrc; stream >> heightDst >> widthDst >> topDst >> leftDst; if ( dibToBmp( bmpSrc, stream, (size - 13) * 2 ) ) { - mReadWmf->setRasterOp( winToQtRaster( raster ) ); + mReadWmf->setRasterOp( winToTQtRaster( raster ) ); mReadWmf->save(); if ( widthDst < 0 ) { // negative width => horizontal flip - QWMatrix m( -1.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F ); + TQWMatrix m( -1.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F ); mReadWmf->setWorldMatrix( m, true ); } if ( heightDst < 0 ) { // negative height => vertical flip - QWMatrix m( 1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F ); + TQWMatrix m( 1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F ); mReadWmf->setWorldMatrix( m, true ); } bmpSrc = bmpSrc.copy( leftSrc, topSrc, widthSrc, heightSrc ); - // TODO: scale the bitmap : QImage::scale(widthDst, heightDst) + // TODO: scale the bitmap : TQImage::scale(widthDst, heightDst) // is actually too slow mReadWmf->drawImage( leftDst, topDst, bmpSrc ); @@ -778,33 +778,33 @@ void KoWmfReadPrivate::dibStretchBlt( Q_UINT32 size, QDataStream& stream ) } -void KoWmfReadPrivate::stretchDib( Q_UINT32 size, QDataStream& stream ) +void KoWmfReadPrivate::stretchDib( TQ_UINT32 size, TQDataStream& stream ) { - Q_UINT32 raster; - Q_INT16 arg, topSrc, leftSrc, widthSrc, heightSrc; - Q_INT16 topDst, leftDst, widthDst, heightDst; - QImage bmpSrc; + TQ_UINT32 raster; + TQ_INT16 arg, topSrc, leftSrc, widthSrc, heightSrc; + TQ_INT16 topDst, leftDst, widthDst, heightDst; + TQImage bmpSrc; stream >> raster >> arg; stream >> heightSrc >> widthSrc >> topSrc >> leftSrc; stream >> heightDst >> widthDst >> topDst >> leftDst; if ( dibToBmp( bmpSrc, stream, (size - 14) * 2 ) ) { - mReadWmf->setRasterOp( winToQtRaster( raster ) ); + mReadWmf->setRasterOp( winToTQtRaster( raster ) ); mReadWmf->save(); if ( widthDst < 0 ) { // negative width => horizontal flip - QWMatrix m( -1.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F ); + TQWMatrix m( -1.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F ); mReadWmf->setWorldMatrix( m, true ); } if ( heightDst < 0 ) { // negative height => vertical flip - QWMatrix m( 1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F ); + TQWMatrix m( 1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F ); mReadWmf->setWorldMatrix( m, true ); } bmpSrc = bmpSrc.copy( leftSrc, topSrc, widthSrc, heightSrc ); - // TODO: scale the bitmap ( QImage::scale(param[ 8 ], param[ 7 ]) is actually too slow ) + // TODO: scale the bitmap ( TQImage::scale(param[ 8 ], param[ 7 ]) is actually too slow ) mReadWmf->drawImage( leftDst, topDst, bmpSrc ); mReadWmf->restore(); @@ -812,13 +812,13 @@ void KoWmfReadPrivate::stretchDib( Q_UINT32 size, QDataStream& stream ) } -void KoWmfReadPrivate::dibCreatePatternBrush( Q_UINT32 size, QDataStream& stream ) +void KoWmfReadPrivate::dibCreatePatternBrush( TQ_UINT32 size, TQDataStream& stream ) { KoWmfPatternBrushHandle* handle = new KoWmfPatternBrushHandle; if ( addHandle( handle ) ) { - Q_UINT32 arg; - QImage bmpSrc; + TQ_UINT32 arg; + TQImage bmpSrc; stream >> arg; if ( dibToBmp( bmpSrc, stream, (size - 5) * 2 ) ) { @@ -835,9 +835,9 @@ void KoWmfReadPrivate::dibCreatePatternBrush( Q_UINT32 size, QDataStream& stream //----------------------------------------------------------------------------- // Object handle -void KoWmfReadPrivate::selectObject( Q_UINT32, QDataStream& stream ) +void KoWmfReadPrivate::selectObject( TQ_UINT32, TQDataStream& stream ) { - Q_UINT16 idx; + TQ_UINT16 idx; stream >> idx; if ( (idx < mNbrObject) && (mObjHandleTab[ idx ] != 0) ) @@ -847,9 +847,9 @@ void KoWmfReadPrivate::selectObject( Q_UINT32, QDataStream& stream ) } -void KoWmfReadPrivate::deleteObject( Q_UINT32, QDataStream& stream ) +void KoWmfReadPrivate::deleteObject( TQ_UINT32, TQDataStream& stream ) { - Q_UINT16 idx; + TQ_UINT16 idx; stream >> idx; deleteHandle( idx ); @@ -865,11 +865,11 @@ void KoWmfReadPrivate::createEmptyObject() } -void KoWmfReadPrivate::createBrushIndirect( Q_UINT32, QDataStream& stream ) +void KoWmfReadPrivate::createBrushIndirect( TQ_UINT32, TQDataStream& stream ) { Qt::BrushStyle style; - Q_UINT16 sty, arg2; - Q_UINT32 color; + TQ_UINT16 sty, arg2; + TQ_UINT32 color; KoWmfBrushHandle* handle = new KoWmfBrushHandle; if ( addHandle( handle ) ) { @@ -898,12 +898,12 @@ void KoWmfReadPrivate::createBrushIndirect( Q_UINT32, QDataStream& stream ) } -void KoWmfReadPrivate::createPenIndirect( Q_UINT32, QDataStream& stream ) +void KoWmfReadPrivate::createPenIndirect( TQ_UINT32, TQDataStream& stream ) { // TODO: userStyle and alternateStyle Qt::PenStyle penStyle; - Q_UINT32 color; - Q_UINT16 style, width, arg; + TQ_UINT32 color; + TQ_UINT16 style, width, arg; KoWmfPenHandle* handle = new KoWmfPenHandle; @@ -925,10 +925,10 @@ void KoWmfReadPrivate::createPenIndirect( Q_UINT32, QDataStream& stream ) } -void KoWmfReadPrivate::createFontIndirect( Q_UINT32 size, QDataStream& stream ) +void KoWmfReadPrivate::createFontIndirect( TQ_UINT32 size, TQDataStream& stream ) { - Q_INT16 pointSize, rotation; - Q_UINT16 weight, property, fixedPitch, arg; + TQ_INT16 pointSize, rotation; + TQ_UINT16 weight, property, fixedPitch, arg; KoWmfFontHandle* handle = new KoWmfFontHandle; @@ -944,7 +944,7 @@ void KoWmfReadPrivate::createFontIndirect( Q_UINT32 size, QDataStream& stream ) handle->font.setFixedPitch( ((fixedPitch & 0x01) == 0) ); // TODO: investigation why some test case need -2 // size of font in logical point - handle->font.setPointSize( QABS(pointSize) - 2 ); + handle->font.setPointSize( TQABS(pointSize) - 2 ); handle->font.setWeight( (weight >> 3) ); handle->font.setItalic( (property & 0x01) ); handle->font.setUnderline( (property & 0x100) ); @@ -962,17 +962,17 @@ void KoWmfReadPrivate::createFontIndirect( Q_UINT32 size, QDataStream& stream ) //----------------------------------------------------------------------------- // Misc functions -void KoWmfReadPrivate::end( Q_UINT32, QDataStream& ) +void KoWmfReadPrivate::end( TQ_UINT32, TQDataStream& ) { } -Q_UINT16 KoWmfReadPrivate::calcCheckSum( WmfPlaceableHeader* apmfh ) +TQ_UINT16 KoWmfReadPrivate::calcCheckSum( WmfPlaceableHeader* apmfh ) { - Q_UINT16* lpWord; - Q_UINT16 wResult, i; + TQ_UINT16* lpWord; + TQ_UINT16 wResult, i; // Start with the first word - wResult = *( lpWord = ( Q_UINT16* )( apmfh ) ); + wResult = *( lpWord = ( TQ_UINT16* )( apmfh ) ); // XOR in each of the other 9 words for( i=1; i<=9; i++ ) { @@ -982,126 +982,126 @@ Q_UINT16 KoWmfReadPrivate::calcCheckSum( WmfPlaceableHeader* apmfh ) } -void KoWmfReadPrivate::notyet( Q_UINT32, QDataStream& ) +void KoWmfReadPrivate::notyet( TQ_UINT32, TQDataStream& ) { if ( mNbrFunc ) { kdDebug() << "unimplemented " << endl; } } -void KoWmfReadPrivate::region( Q_UINT32, QDataStream& ) +void KoWmfReadPrivate::region( TQ_UINT32, TQDataStream& ) { if ( mNbrFunc ) { kdDebug() << "region : unimplemented " << endl; } } -void KoWmfReadPrivate::palette( Q_UINT32, QDataStream& ) +void KoWmfReadPrivate::palette( TQ_UINT32, TQDataStream& ) { if ( mNbrFunc ) { kdDebug() << "palette : unimplemented " << endl; } } -void KoWmfReadPrivate::escape( Q_UINT32, QDataStream& ) +void KoWmfReadPrivate::escape( TQ_UINT32, TQDataStream& ) { if ( mNbrFunc ) { kdDebug() << "escape : unimplemented " << endl; } } -void KoWmfReadPrivate::setRelAbs( Q_UINT32, QDataStream& ) +void KoWmfReadPrivate::setRelAbs( TQ_UINT32, TQDataStream& ) { if ( mNbrFunc ) { kdDebug() << "setRelAbs : unimplemented " << endl; } } -void KoWmfReadPrivate::setMapMode( Q_UINT32, QDataStream& ) +void KoWmfReadPrivate::setMapMode( TQ_UINT32, TQDataStream& ) { if ( mNbrFunc ) { kdDebug() << "setMapMode : unimplemented " << endl; } } -void KoWmfReadPrivate::extFloodFill( Q_UINT32, QDataStream& ) +void KoWmfReadPrivate::extFloodFill( TQ_UINT32, TQDataStream& ) { if ( mNbrFunc ) { kdDebug() << "extFloodFill : unimplemented " << endl; } } -void KoWmfReadPrivate::startDoc( Q_UINT32, QDataStream& ) +void KoWmfReadPrivate::startDoc( TQ_UINT32, TQDataStream& ) { if ( mNbrFunc ) { kdDebug() << "startDoc : unimplemented " << endl; } } -void KoWmfReadPrivate::startPage( Q_UINT32, QDataStream& ) +void KoWmfReadPrivate::startPage( TQ_UINT32, TQDataStream& ) { if ( mNbrFunc ) { kdDebug() << "startPage : unimplemented " << endl; } } -void KoWmfReadPrivate::endDoc( Q_UINT32, QDataStream& ) +void KoWmfReadPrivate::endDoc( TQ_UINT32, TQDataStream& ) { if ( mNbrFunc ) { kdDebug() << "endDoc : unimplemented " << endl; } } -void KoWmfReadPrivate::endPage( Q_UINT32, QDataStream& ) +void KoWmfReadPrivate::endPage( TQ_UINT32, TQDataStream& ) { if ( mNbrFunc ) { kdDebug() << "endPage : unimplemented " << endl; } } -void KoWmfReadPrivate::resetDC( Q_UINT32, QDataStream& ) +void KoWmfReadPrivate::resetDC( TQ_UINT32, TQDataStream& ) { if ( mNbrFunc ) { kdDebug() << "resetDC : unimplemented " << endl; } } -void KoWmfReadPrivate::bitBlt( Q_UINT32, QDataStream& ) +void KoWmfReadPrivate::bitBlt( TQ_UINT32, TQDataStream& ) { if ( mNbrFunc ) { kdDebug() << "bitBlt : unimplemented " << endl; } } -void KoWmfReadPrivate::setDibToDev( Q_UINT32, QDataStream& ) +void KoWmfReadPrivate::setDibToDev( TQ_UINT32, TQDataStream& ) { if ( mNbrFunc ) { kdDebug() << "setDibToDev : unimplemented " << endl; } } -void KoWmfReadPrivate::createBrush( Q_UINT32, QDataStream& ) +void KoWmfReadPrivate::createBrush( TQ_UINT32, TQDataStream& ) { if ( mNbrFunc ) { kdDebug() << "createBrush : unimplemented " << endl; } } -void KoWmfReadPrivate::createPatternBrush( Q_UINT32, QDataStream& ) +void KoWmfReadPrivate::createPatternBrush( TQ_UINT32, TQDataStream& ) { if ( mNbrFunc ) { kdDebug() << "createPatternBrush : unimplemented " << endl; } } -void KoWmfReadPrivate::createBitmap( Q_UINT32, QDataStream& ) +void KoWmfReadPrivate::createBitmap( TQ_UINT32, TQDataStream& ) { if ( mNbrFunc ) { kdDebug() << "createBitmap : unimplemented " << endl; } } -void KoWmfReadPrivate::createBitmapIndirect( Q_UINT32, QDataStream& ) +void KoWmfReadPrivate::createBitmapIndirect( TQ_UINT32, TQDataStream& ) { createEmptyObject(); if ( mNbrFunc ) { @@ -1109,7 +1109,7 @@ void KoWmfReadPrivate::createBitmapIndirect( Q_UINT32, QDataStream& ) } } -void KoWmfReadPrivate::createPalette( Q_UINT32, QDataStream& ) +void KoWmfReadPrivate::createPalette( TQ_UINT32, TQDataStream& ) { createEmptyObject(); if ( mNbrFunc ) { @@ -1117,7 +1117,7 @@ void KoWmfReadPrivate::createPalette( Q_UINT32, QDataStream& ) } } -void KoWmfReadPrivate::createRegion( Q_UINT32, QDataStream& ) +void KoWmfReadPrivate::createRegion( TQ_UINT32, TQDataStream& ) { createEmptyObject(); if ( mNbrFunc ) { @@ -1128,7 +1128,7 @@ void KoWmfReadPrivate::createRegion( Q_UINT32, QDataStream& ) //----------------------------------------------------------------------------- -// Utilities and conversion Wmf -> Qt +// Utilities and conversion Wmf -> TQt bool KoWmfReadPrivate::addHandle( KoWmfHandle* handle ) { @@ -1163,9 +1163,9 @@ void KoWmfReadPrivate::deleteHandle( int idx ) } -void KoWmfReadPrivate::pointArray( QDataStream& stream, QPointArray& pa ) +void KoWmfReadPrivate::pointArray( TQDataStream& stream, TQPointArray& pa ) { - Q_INT16 left, top; + TQ_INT16 left, top; int i, max; for ( i=0, max=pa.size() ; i < max ; i++ ) { @@ -1188,16 +1188,16 @@ void KoWmfReadPrivate::xyToAngle( int xStart, int yStart, int xEnd, int yEnd, in } -Qt::RasterOp KoWmfReadPrivate::winToQtRaster( Q_UINT16 param ) const +TQt::RasterOp KoWmfReadPrivate::winToTQtRaster( TQ_UINT16 param ) const { if ( param < 17 ) return koWmfOpTab16[ param ]; else - return Qt::CopyROP; + return TQt::CopyROP; } -Qt::RasterOp KoWmfReadPrivate::winToQtRaster( Q_UINT32 param ) const +TQt::RasterOp KoWmfReadPrivate::winToTQtRaster( TQ_UINT32 param ) const { /* TODO: Ternary raster operations 0x00C000CA dest = (source AND pattern) @@ -1213,23 +1213,23 @@ Qt::RasterOp KoWmfReadPrivate::winToQtRaster( Q_UINT32 param ) const if ( i < 15 ) return koWmfOpTab32[ i ].qtRasterOp; else - return Qt::CopyROP; + return TQt::CopyROP; } -bool KoWmfReadPrivate::dibToBmp( QImage& bmp, QDataStream& stream, Q_UINT32 size ) +bool KoWmfReadPrivate::dibToBmp( TQImage& bmp, TQDataStream& stream, TQ_UINT32 size ) { typedef struct _BMPFILEHEADER { - Q_UINT16 bmType; - Q_UINT32 bmSize; - Q_UINT16 bmReserved1; - Q_UINT16 bmReserved2; - Q_UINT32 bmOffBits; + TQ_UINT16 bmType; + TQ_UINT32 bmSize; + TQ_UINT16 bmReserved1; + TQ_UINT16 bmReserved2; + TQ_UINT32 bmOffBits; } BMPFILEHEADER; int sizeBmp = size + 14; - QByteArray pattern( sizeBmp ); // BMP header and DIB data + TQByteArray pattern( sizeBmp ); // BMP header and DIB data pattern.fill(0); stream.readRawBytes( &pattern[ 14 ], size ); -- cgit v1.2.1