diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/kwmf | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
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
Diffstat (limited to 'lib/kwmf')
-rw-r--r-- | lib/kwmf/kowmfpaint.cc | 70 | ||||
-rw-r--r-- | lib/kwmf/kowmfpaint.h | 46 | ||||
-rw-r--r-- | lib/kwmf/kowmfread.cc | 12 | ||||
-rw-r--r-- | lib/kwmf/kowmfread.h | 62 | ||||
-rw-r--r-- | lib/kwmf/kowmfreadprivate.cc | 354 | ||||
-rw-r--r-- | lib/kwmf/kowmfreadprivate.h | 168 | ||||
-rw-r--r-- | lib/kwmf/kowmfstack.h | 20 | ||||
-rw-r--r-- | lib/kwmf/kowmfstruct.h | 140 | ||||
-rw-r--r-- | lib/kwmf/kowmfwrite.cc | 206 | ||||
-rw-r--r-- | lib/kwmf/kowmfwrite.h | 66 | ||||
-rw-r--r-- | lib/kwmf/kwmf.cc | 176 | ||||
-rw-r--r-- | lib/kwmf/kwmf.h | 90 | ||||
-rw-r--r-- | lib/kwmf/qwmf.cc | 246 | ||||
-rw-r--r-- | lib/kwmf/qwmf.h | 60 | ||||
-rw-r--r-- | lib/kwmf/wmfstruct.h | 4 |
15 files changed, 860 insertions, 860 deletions
diff --git a/lib/kwmf/kowmfpaint.cc b/lib/kwmf/kowmfpaint.cc index 7ce8ee8b..97a6e033 100644 --- a/lib/kwmf/kowmfpaint.cc +++ b/lib/kwmf/kowmfpaint.cc @@ -25,7 +25,7 @@ KoWmfPaint::KoWmfPaint() : KoWmfRead() { } -bool KoWmfPaint::play( QPaintDevice& target, bool relativeCoord ) +bool KoWmfPaint::play( TQPaintDevice& target, bool relativeCoord ) { if ( mPainter.isActive() ) return false; mTarget = ⌖ @@ -48,7 +48,7 @@ bool KoWmfPaint::begin() { } else { // some wmf files doesn't call setwindowOrg and setWindowExt, so it's better to do : - QRect rec = boundingRect(); + TQRect rec = boundingRect(); mPainter.setWindow( rec.left(), rec.top(), rec.width(), rec.height() ); } } @@ -58,12 +58,12 @@ bool KoWmfPaint::begin() { bool KoWmfPaint::end() { if ( mRelativeCoord ) { - QRect rec = boundingRect(); + TQRect rec = boundingRect(); // Draw 2 invisible points - // because QPicture::setBoundingRect() doesn't give expected result (QT3.1.2) + // because TQPicture::setBoundingRect() doesn't give expected result (QT3.1.2) // setBoundingRect( boundingRect() ); -// mPainter.setPen( Qt::NoPen ); +// mPainter.setPen( TQt::NoPen ); // mPainter.drawPoint( rec.left(), rec.top() ); // mPainter.drawPoint( rec.right(), rec.bottom() ); } @@ -81,13 +81,13 @@ void KoWmfPaint::restore() { } -void KoWmfPaint::setFont( const QFont &font ) { +void KoWmfPaint::setFont( const TQFont &font ) { mPainter.setFont( font ); } -void KoWmfPaint::setPen( const QPen &pen ) { - QPen p = pen; +void KoWmfPaint::setPen( const TQPen &pen ) { + TQPen p = pen; int width = pen.width(); if ( mTarget->isExtDev() ) { @@ -96,8 +96,8 @@ void KoWmfPaint::setPen( const QPen &pen ) { else { // WMF spec : width of pen in logical coordinate // => width of pen proportional with device context width - QRect devRec = mPainter.xForm( mPainter.window() ); - QRect rec = mPainter.window(); + TQRect devRec = mPainter.xForm( mPainter.window() ); + TQRect rec = mPainter.window(); if ( rec.width() != 0 ) width = ( width * devRec.width() ) / rec.width() ; else @@ -109,17 +109,17 @@ void KoWmfPaint::setPen( const QPen &pen ) { } -const QPen &KoWmfPaint::pen() const { +const TQPen &KoWmfPaint::pen() const { return mPainter.pen(); } -void KoWmfPaint::setBrush( const QBrush &brush ) { +void KoWmfPaint::setBrush( const TQBrush &brush ) { mPainter.setBrush( brush ); } -void KoWmfPaint::setBackgroundColor( const QColor &c ) { +void KoWmfPaint::setBackgroundColor( const TQColor &c ) { mPainter.setBackgroundColor( c ); } @@ -129,7 +129,7 @@ void KoWmfPaint::setBackgroundMode( Qt::BGMode mode ) { } -void KoWmfPaint::setRasterOp( Qt::RasterOp op ) { +void KoWmfPaint::setRasterOp( TQt::RasterOp op ) { mPainter.setRasterOp( op ); } @@ -153,7 +153,7 @@ void KoWmfPaint::setWindowOrg( int left, int top ) { mPainter.translate( -left, -top ); } else { - QRect rec = mPainter.window(); + TQRect rec = mPainter.window(); mPainter.setWindow( left, top, rec.width(), rec.height() ); } } @@ -161,7 +161,7 @@ void KoWmfPaint::setWindowOrg( int left, int top ) { void KoWmfPaint::setWindowExt( int w, int h ) { if ( mRelativeCoord ) { - QRect r = mPainter.window(); + TQRect r = mPainter.window(); double dx = mInternalWorldMatrix.dx(); double dy = mInternalWorldMatrix.dy(); double sx = mInternalWorldMatrix.m11(); @@ -182,24 +182,24 @@ void KoWmfPaint::setWindowExt( int w, int h ) { mPainter.translate( dx, dy ); } else { - QRect rec = mPainter.window(); + TQRect rec = mPainter.window(); mPainter.setWindow( rec.left(), rec.top(), w, h ); } } -void KoWmfPaint::setWorldMatrix( const QWMatrix &wm, bool combine ) { +void KoWmfPaint::setWorldMatrix( const TQWMatrix &wm, bool combine ) { mPainter.setWorldMatrix( wm, combine ); } -void KoWmfPaint::setClipRegion( const QRegion &rec ) { - mPainter.setClipRegion( rec, QPainter::CoordPainter ); +void KoWmfPaint::setClipRegion( const TQRegion &rec ) { + mPainter.setClipRegion( rec, TQPainter::CoordPainter ); } -QRegion KoWmfPaint::clipRegion() { - return mPainter.clipRegion( QPainter::CoordPainter ); +TQRegion KoWmfPaint::clipRegion() { + return mPainter.clipRegion( TQPainter::CoordPainter ); } @@ -243,28 +243,28 @@ void KoWmfPaint::drawChord( int x, int y, int w, int h, int a, int alen ) { } -void KoWmfPaint::drawPolyline( const QPointArray &pa ) { +void KoWmfPaint::drawPolyline( const TQPointArray &pa ) { mPainter.drawPolyline( pa ); } -void KoWmfPaint::drawPolygon( const QPointArray &pa, bool winding ) { - mPainter.drawPolygon( pa, winding ); +void KoWmfPaint::drawPolygon( const TQPointArray &pa, bool winding ) { + mPainter.tqdrawPolygon( pa, winding ); } -void KoWmfPaint::drawPolyPolygon( QPtrList<QPointArray>& listPa, bool winding ) { - QPointArray *pa; +void KoWmfPaint::drawPolyPolygon( TQPtrList<TQPointArray>& listPa, bool winding ) { + TQPointArray *pa; mPainter.save(); - QBrush brush = mPainter.brush(); + TQBrush brush = mPainter.brush(); // define clipping region - QRegion region; + TQRegion region; for ( pa = listPa.first() ; pa ; pa = listPa.next() ) { region = region.eor( *pa ); } - mPainter.setClipRegion( region, QPainter::CoordPainter ); + mPainter.setClipRegion( region, TQPainter::CoordPainter ); // fill polygons if ( brush != Qt::NoBrush ) { @@ -273,10 +273,10 @@ void KoWmfPaint::drawPolyPolygon( QPtrList<QPointArray>& listPa, bool winding ) // draw polygon's border mPainter.setClipping( false ); - if ( mPainter.pen().style() != Qt::NoPen ) { - mPainter.setBrush( Qt::NoBrush ); + if ( mPainter.pen().style() != TQt::NoPen ) { + mPainter.setBrush( TQt::NoBrush ); for ( pa = listPa.first() ; pa ; pa = listPa.next() ) { - mPainter.drawPolygon( *pa, winding ); + mPainter.tqdrawPolygon( *pa, winding ); } } @@ -285,12 +285,12 @@ void KoWmfPaint::drawPolyPolygon( QPtrList<QPointArray>& listPa, bool winding ) } -void KoWmfPaint::drawImage( int x, int y, const QImage &img, int sx, int sy, int sw, int sh ) { +void KoWmfPaint::drawImage( int x, int y, const TQImage &img, int sx, int sy, int sw, int sh ) { mPainter.drawImage( x, y, img, sx, sy, sw, sh ); } -void KoWmfPaint::drawText( int x, int y, int w, int h, int flags, const QString& s, double ) { +void KoWmfPaint::drawText( int x, int y, int w, int h, int flags, const TQString& s, double ) { mPainter.drawText( x, y, w, h, flags, s ); } diff --git a/lib/kwmf/kowmfpaint.h b/lib/kwmf/kowmfpaint.h index b229f2ff..7fb9356d 100644 --- a/lib/kwmf/kowmfpaint.h +++ b/lib/kwmf/kowmfpaint.h @@ -18,18 +18,18 @@ #ifndef _KOWMFPAINT_H_ #define _KOWMFPAINT_H_ -#include <qpainter.h> +#include <tqpainter.h> #include "kowmfread.h" #include <../kofficecore/koffice_export.h> /** * KoWmfPaint inherits the abstract class KoWmfRead - * and redirects WMF actions onto a QPaintDevice. + * and redirects WMF actions onto a TQPaintDevice. * Uses relative or absolute coordinate. * * how to use: * <pre> - * QPixmap pix( 100, 100 ); + * TQPixmap pix( 100, 100 ); * KoWmfPaint wmf; * if ( wmf.load( "/home/test.wmf" ) ) { * wmf.play( pix ); @@ -46,33 +46,33 @@ public: ~KoWmfPaint() { } /** - * play WMF file on a QPaintDevice. Return true on success. + * play WMF file on a TQPaintDevice. Return true on success. * Use absolute or relative coordinate : * absolute coord. reset the world transfomation Matrix (by default) * relative coord. use the existing world transfomation Matrix */ - bool play( QPaintDevice& target, bool relativeCoord=false ); + bool play( TQPaintDevice& target, bool relativeCoord=false ); private: // ------------------------------------------------------------------------- - // A virtual QPainter + // A virtual TQPainter bool begin(); bool end(); void save(); void restore(); // Drawing tools - void setFont( const QFont& font ); + void setFont( const TQFont& font ); // the pen : the width of the pen is in logical coordinate - void setPen( const QPen& pen ); - const QPen& pen() const; - void setBrush( const QBrush& brush ); + void setPen( const TQPen& pen ); + const TQPen& pen() const; + void setBrush( const TQBrush& brush ); // Drawing attributes/modes - void setBackgroundColor( const QColor& c ); + void setBackgroundColor( const TQColor& c ); void setBackgroundMode( Qt::BGMode mode ); - void setRasterOp( Qt::RasterOp op ); + void setRasterOp( TQt::RasterOp op ); /** * Change logical Coordinate @@ -86,8 +86,8 @@ private: // Clipping // the 'CoordinateMode' is ommitted : always CoordPainter in wmf // setClipRegion() is often used with save() and restore() => implement all or none - void setClipRegion( const QRegion &rec ); - QRegion clipRegion(); + void setClipRegion( const TQRegion &rec ); + TQRegion clipRegion(); // Graphics drawing functions void moveTo( int x, int y ); @@ -98,29 +98,29 @@ private: void drawArc( int x, int y, int w, int h, int a, int alen ); void drawPie( int x, int y, int w, int h, int a, int alen ); void drawChord( int x, int y, int w, int h, int a, int alen ); - void drawPolyline( const QPointArray& pa ); - void drawPolygon( const QPointArray& pa, bool winding=FALSE ); + void drawPolyline( const TQPointArray& pa ); + void drawPolygon( const TQPointArray& pa, bool winding=FALSE ); /** * drawPolyPolygon draw the XOR of a list of polygons * listPa : list of polygons */ - void drawPolyPolygon( QPtrList<QPointArray>& listPa, bool winding=FALSE ); - void drawImage( int x, int y, const QImage &, int sx = 0, int sy = 0, int sw = -1, int sh = -1 ); + void drawPolyPolygon( TQPtrList<TQPointArray>& listPa, bool winding=FALSE ); + void drawImage( int x, int y, const TQImage &, int sx = 0, int sy = 0, int sw = -1, int sh = -1 ); // Text drawing functions // rotation = the degrees of rotation in counterclockwise // not yet implemented in KWinMetaFile - void drawText( int x, int y, int w, int h, int flags, const QString &s, double rotation ); + void drawText( int x, int y, int w, int h, int flags, const TQString &s, double rotation ); // matrix transformation : only used in some bitmap manipulation - void setWorldMatrix( const QWMatrix &, bool combine=FALSE ); + void setWorldMatrix( const TQWMatrix &, bool combine=FALSE ); private: - QPainter mPainter; - QPaintDevice *mTarget; + TQPainter mPainter; + TQPaintDevice *mTarget; bool mRelativeCoord; // memorisation of WMF matrix transformation (in relative coordinate) - QWMatrix mInternalWorldMatrix; + TQWMatrix mInternalWorldMatrix; }; diff --git a/lib/kwmf/kowmfread.cc b/lib/kwmf/kowmfread.cc index a4df0023..f932ae3a 100644 --- a/lib/kwmf/kowmfread.cc +++ b/lib/kwmf/kowmfread.cc @@ -16,7 +16,7 @@ * Boston, MA 02110-1301, USA. */ -#include <qfile.h> +#include <tqfile.h> #include <kdebug.h> #include "kowmfread.h" @@ -31,13 +31,13 @@ KoWmfRead::~KoWmfRead() { } -bool KoWmfRead::load( const QString& filename ) +bool KoWmfRead::load( const TQString& filename ) { - QFile file( filename ); + TQFile file( filename ); if ( !file.open( IO_ReadOnly ) ) { - kdDebug() << "KoWmfRead : Cannot open file " << QFile::encodeName(filename) << endl; + kdDebug() << "KoWmfRead : Cannot open file " << TQString(TQFile::encodeName(filename)) << endl; return false; } @@ -48,7 +48,7 @@ bool KoWmfRead::load( const QString& filename ) } -bool KoWmfRead::load( const QByteArray& array ) +bool KoWmfRead::load( const TQByteArray& array ) { return mKwmf->load( array ); } @@ -80,7 +80,7 @@ bool KoWmfRead::isEnhanced( void ) const { } -QRect KoWmfRead::boundingRect( void ) const { +TQRect KoWmfRead::boundingRect( void ) const { return mKwmf->mBBox; } diff --git a/lib/kwmf/kowmfread.h b/lib/kwmf/kowmfread.h index becfc74f..ff8fa9be 100644 --- a/lib/kwmf/kowmfread.h +++ b/lib/kwmf/kowmfread.h @@ -18,24 +18,24 @@ #ifndef _KOWMFREAD_H_ #define _KOWMFREAD_H_ -#include <qpen.h> -#include <qbrush.h> -#include <qfont.h> -#include <qcolor.h> -#include <qrect.h> -#include <qregion.h> -#include <qimage.h> -#include <qwmatrix.h> -#include <qstring.h> -#include <qptrlist.h> -#include <qpointarray.h> +#include <tqpen.h> +#include <tqbrush.h> +#include <tqfont.h> +#include <tqcolor.h> +#include <tqrect.h> +#include <tqregion.h> +#include <tqimage.h> +#include <tqwmatrix.h> +#include <tqstring.h> +#include <tqptrlist.h> +#include <tqpointarray.h> #include <../kofficecore/koffice_export.h> class KoWmfReadPrivate; /** * KoWmfRead allows the redirection of the actions stored in a WMF file. - * Most of the virtuals functions are compatible with QPainter format. + * Most of the virtuals functions are compatible with TQPainter format. * * How to use : * inherit this class and define abstract functions @@ -52,8 +52,8 @@ public: /** * Load WMF file. Returns true on success. */ - virtual bool load( const QString& fileName ); - virtual bool load( const QByteArray& array ); + virtual bool load( const TQString& fileName ); + virtual bool load( const TQByteArray& array ); /** * play the WMF file => call virtuals functions @@ -74,7 +74,7 @@ public: * Placeable Meta File : return the bounding box from header * always in logical coordinate */ - virtual QRect boundingRect( void ) const; + virtual TQRect boundingRect( void ) const; /** * Returns the default DotPerInch for placeable meta file, @@ -90,24 +90,24 @@ public: void setDebug( int nbFunc ); // ------------------------------------------------------------------------- - // A virtual QPainter : inherit those virtuals functions - // for a good documentation : check QPainter documentation + // A virtual TQPainter : inherit those virtuals functions + // for a good documentation : check TQPainter documentation virtual bool begin() = 0; virtual bool end() = 0; virtual void save() = 0; virtual void restore() = 0; // Drawing tools - virtual void setFont( const QFont & ) = 0; + virtual void setFont( const TQFont & ) = 0; // the pen : the width of the pen is in logical coordinate - virtual void setPen( const QPen &p ) = 0; - virtual const QPen &pen() const = 0; - virtual void setBrush( const QBrush & ) = 0; + virtual void setPen( const TQPen &p ) = 0; + virtual const TQPen &pen() const = 0; + virtual void setBrush( const TQBrush & ) = 0; // Drawing attributes/modes - virtual void setBackgroundColor( const QColor & ) = 0; + virtual void setBackgroundColor( const TQColor & ) = 0; virtual void setBackgroundMode( Qt::BGMode ) = 0; - virtual void setRasterOp( Qt::RasterOp ) = 0; + virtual void setRasterOp( TQt::RasterOp ) = 0; // Change logical Coordinate // some wmf files call those functions several times in the middle of a drawing @@ -118,8 +118,8 @@ public: // Clipping // the 'CoordinateMode' parameter is ommitted : always CoordPainter in wmf // setClipRegion() is often used with save() and restore() => implement all or none - virtual void setClipRegion( const QRegion & ) = 0; - virtual QRegion clipRegion() = 0; + virtual void setClipRegion( const TQRegion & ) = 0; + virtual TQRegion clipRegion() = 0; // Graphics drawing functions virtual void moveTo( int x, int y ) = 0; @@ -130,20 +130,20 @@ public: virtual void drawArc( int x, int y, int w, int h, int a, int alen ) = 0; virtual void drawPie( int x, int y, int w, int h, int a, int alen ) = 0; virtual void drawChord( int x, int y, int w, int h, int a, int alen ) = 0; - virtual void drawPolyline( const QPointArray &pa ) = 0; - virtual void drawPolygon( const QPointArray &pa, bool winding=FALSE ) = 0; + virtual void drawPolyline( const TQPointArray &pa ) = 0; + virtual void drawPolygon( const TQPointArray &pa, bool winding=FALSE ) = 0; // drawPolyPolygon draw the XOR of a list of polygons // listPa : list of polygons - virtual void drawPolyPolygon( QPtrList<QPointArray>& listPa, bool winding=FALSE ) = 0; - virtual void drawImage( int x, int y, const QImage &, int sx = 0, int sy = 0, int sw = -1, int sh = -1 ) = 0; + virtual void drawPolyPolygon( TQPtrList<TQPointArray>& listPa, bool winding=FALSE ) = 0; + virtual void drawImage( int x, int y, const TQImage &, int sx = 0, int sy = 0, int sw = -1, int sh = -1 ) = 0; // Text drawing functions // rotation = the degrees of rotation in counterclockwise // not yet implemented in KWinMetaFile - virtual void drawText( int x, int y, int w, int h, int flags, const QString &s, double rotation ) = 0; + virtual void drawText( int x, int y, int w, int h, int flags, const TQString &s, double rotation ) = 0; // matrix transformation : only used for bitmap manipulation - virtual void setWorldMatrix( const QWMatrix &, bool combine=FALSE ) = 0; + virtual void setWorldMatrix( const TQWMatrix &, bool combine=FALSE ) = 0; private: KoWmfReadPrivate *mKwmf; 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 <math.h> -#include <qfileinfo.h> -#include <qimage.h> -#include <qwmatrix.h> -#include <qptrlist.h> -#include <qpointarray.h> -#include <qdatastream.h> +#include <tqfileinfo.h> +#include <tqimage.h> +#include <tqwmatrix.h> +#include <tqptrlist.h> +#include <tqpointarray.h> +#include <tqdatastream.h> #include <kdebug.h> #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<QPointArray> listPa; + TQ_UINT16 numberPoly; + TQ_UINT16 sizePoly; + TQPtrList<TQPointArray> 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 ); diff --git a/lib/kwmf/kowmfreadprivate.h b/lib/kwmf/kowmfreadprivate.h index 4dda478b..ea95e563 100644 --- a/lib/kwmf/kowmfreadprivate.h +++ b/lib/kwmf/kowmfreadprivate.h @@ -20,13 +20,13 @@ #ifndef _KOWMFREADPRIVATE_H_ #define _KOWMFREADPRIVATE_H_ -#include <qpen.h> -#include <qcolor.h> -#include <qfont.h> -#include <qrect.h> -#include <qregion.h> -#include <qbuffer.h> -#include <qstring.h> +#include <tqpen.h> +#include <tqcolor.h> +#include <tqfont.h> +#include <tqrect.h> +#include <tqregion.h> +#include <tqbuffer.h> +#include <tqstring.h> #include "kowmfstruct.h" #include "kowmfstack.h" @@ -47,7 +47,7 @@ public: /** * Load WMF file. Returns true on success. */ - bool load( const QByteArray& array ); + bool load( const TQByteArray& array ); /** * Plays a metafile in @p readKwmf and returns true on success. @@ -59,142 +59,142 @@ public: /* Metafile painter methods */ /// set window origin - void setWindowOrg( Q_UINT32 size, QDataStream& stream ); + void setWindowOrg( TQ_UINT32 size, TQDataStream& stream ); /// set window extents - void setWindowExt( Q_UINT32 size, QDataStream& stream ); + void setWindowExt( TQ_UINT32 size, TQDataStream& stream ); /// scale window extents - void ScaleWindowExt( Q_UINT32, QDataStream& stream ); + void ScaleWindowExt( TQ_UINT32, TQDataStream& stream ); /// offset in window origin - void OffsetWindowOrg( Q_UINT32, QDataStream& stream ); + void OffsetWindowOrg( TQ_UINT32, TQDataStream& stream ); /****************** Drawing *******************/ /// draw line to coord - void lineTo( Q_UINT32 size, QDataStream& stream ); + void lineTo( TQ_UINT32 size, TQDataStream& stream ); /// move pen to coord - void moveTo( Q_UINT32 size, QDataStream& stream ); + void moveTo( TQ_UINT32 size, TQDataStream& stream ); /// draw ellipse - void ellipse( Q_UINT32 size, QDataStream& stream ); + void ellipse( TQ_UINT32 size, TQDataStream& stream ); /// draw polygon - void polygon( Q_UINT32 size, QDataStream& stream ); + void polygon( TQ_UINT32 size, TQDataStream& stream ); /// draw a list of polygons - void polyPolygon( Q_UINT32 size, QDataStream& stream ); + void polyPolygon( TQ_UINT32 size, TQDataStream& stream ); /// draw series of lines - void polyline( Q_UINT32 size, QDataStream& stream ); + void polyline( TQ_UINT32 size, TQDataStream& stream ); /// draw a rectangle - void rectangle( Q_UINT32 size, QDataStream& stream ); + void rectangle( TQ_UINT32 size, TQDataStream& stream ); /// draw round rectangle - void roundRect( Q_UINT32 size, QDataStream& stream ); + void roundRect( TQ_UINT32 size, TQDataStream& stream ); /// draw arc - void arc( Q_UINT32 size, QDataStream& stream ); + void arc( TQ_UINT32 size, TQDataStream& stream ); /// draw chord - void chord( Q_UINT32 size, QDataStream& stream ); + void chord( TQ_UINT32 size, TQDataStream& stream ); /// draw pie - void pie( Q_UINT32 size, QDataStream& stream ); + void pie( TQ_UINT32 size, TQDataStream& stream ); /// set polygon fill mode - void setPolyFillMode( Q_UINT32 size, QDataStream& stream ); + void setPolyFillMode( TQ_UINT32 size, TQDataStream& stream ); /// set background pen color - void setBkColor( Q_UINT32 size, QDataStream& stream ); + void setBkColor( TQ_UINT32 size, TQDataStream& stream ); /// set background pen mode - void setBkMode( Q_UINT32 size, QDataStream& stream ); + void setBkMode( TQ_UINT32 size, TQDataStream& stream ); /// set a pixel - void setPixel( Q_UINT32 size, QDataStream& stream ); + void setPixel( TQ_UINT32 size, TQDataStream& stream ); /// set raster operation mode - void setRop( Q_UINT32 size, QDataStream& stream ); + void setRop( TQ_UINT32 size, TQDataStream& stream ); /// save device context */ - void saveDC( Q_UINT32 size, QDataStream& stream ); + void saveDC( TQ_UINT32 size, TQDataStream& stream ); /// restore device context - void restoreDC( Q_UINT32 size, QDataStream& stream ); + void restoreDC( TQ_UINT32 size, TQDataStream& stream ); /// clipping region is the intersection of this region and the original region - void intersectClipRect( Q_UINT32 size, QDataStream& stream ); + void intersectClipRect( TQ_UINT32 size, TQDataStream& stream ); /// delete a clipping rectangle of the original region - void excludeClipRect( Q_UINT32 size, QDataStream& stream ); + void excludeClipRect( TQ_UINT32 size, TQDataStream& stream ); /****************** Text *******************/ /// set text color - void setTextColor( Q_UINT32 size, QDataStream& stream ); - /// set text alignment - void setTextAlign( Q_UINT32 size, QDataStream& stream ); + void setTextColor( TQ_UINT32 size, TQDataStream& stream ); + /// set text tqalignment + void setTextAlign( TQ_UINT32 size, TQDataStream& stream ); /// draw text - void textOut( Q_UINT32 size, QDataStream& stream ); - void extTextOut( Q_UINT32 size, QDataStream& stream ); + void textOut( TQ_UINT32 size, TQDataStream& stream ); + void extTextOut( TQ_UINT32 size, TQDataStream& stream ); /****************** Bitmap *******************/ - void SetStretchBltMode( Q_UINT32, QDataStream& stream ); + void SetStretchBltMode( TQ_UINT32, TQDataStream& stream ); /// copies a DIB into a dest location - void dibBitBlt( Q_UINT32 size, QDataStream& stream ); + void dibBitBlt( TQ_UINT32 size, TQDataStream& stream ); /// stretches a DIB into a dest location - void dibStretchBlt( Q_UINT32 size, QDataStream& stream ); - void stretchDib( Q_UINT32 size, QDataStream& stream ); + void dibStretchBlt( TQ_UINT32 size, TQDataStream& stream ); + void stretchDib( TQ_UINT32 size, TQDataStream& stream ); /// create a pattern brush - void dibCreatePatternBrush( Q_UINT32 size, QDataStream& stream ); + void dibCreatePatternBrush( TQ_UINT32 size, TQDataStream& stream ); /****************** Object handle *******************/ /// activate object handle - void selectObject( Q_UINT32 size, QDataStream& stream ); + void selectObject( TQ_UINT32 size, TQDataStream& stream ); /// free object handle - void deleteObject( Q_UINT32 size, QDataStream& stream ); + void deleteObject( TQ_UINT32 size, TQDataStream& stream ); /// create an empty object in the object list void createEmptyObject(); /// create a logical brush - void createBrushIndirect( Q_UINT32 size, QDataStream& stream ); + void createBrushIndirect( TQ_UINT32 size, TQDataStream& stream ); /// create a logical pen - void createPenIndirect( Q_UINT32 size, QDataStream& stream ); + void createPenIndirect( TQ_UINT32 size, TQDataStream& stream ); /// create a logical font - void createFontIndirect( Q_UINT32 size, QDataStream& stream ); + void createFontIndirect( TQ_UINT32 size, TQDataStream& stream ); /****************** misc *******************/ /// end of meta file - void end( Q_UINT32, QDataStream& stream ); + void end( TQ_UINT32, TQDataStream& stream ); /** Calculate header checksum */ - static Q_UINT16 calcCheckSum( WmfPlaceableHeader* ); + static TQ_UINT16 calcCheckSum( WmfPlaceableHeader* ); // function unimplemented - void notyet( Q_UINT32, QDataStream& stream ); - void region( Q_UINT32, QDataStream& stream ); - void palette( Q_UINT32, QDataStream& stream ); - void escape( Q_UINT32, QDataStream& stream ); - void setRelAbs( Q_UINT32, QDataStream& stream ); - void setMapMode( Q_UINT32, QDataStream& stream ); - void extFloodFill( Q_UINT32, QDataStream& stream ); - void startDoc( Q_UINT32, QDataStream& stream ); - void startPage( Q_UINT32, QDataStream& stream ); - void endDoc( Q_UINT32, QDataStream& stream ); - void endPage( Q_UINT32, QDataStream& stream ); - void resetDC( Q_UINT32, QDataStream& stream ); - void bitBlt( Q_UINT32, QDataStream& stream ); - void setDibToDev( Q_UINT32, QDataStream& stream ); - void createBrush( Q_UINT32, QDataStream& stream ); - void createPatternBrush( Q_UINT32, QDataStream& stream ); - void createBitmap( Q_UINT32, QDataStream& stream ); - void createBitmapIndirect( Q_UINT32, QDataStream& stream ); - void createPalette( Q_UINT32, QDataStream& stream ); - void createRegion( Q_UINT32, QDataStream& stream ); + void notyet( TQ_UINT32, TQDataStream& stream ); + void region( TQ_UINT32, TQDataStream& stream ); + void palette( TQ_UINT32, TQDataStream& stream ); + void escape( TQ_UINT32, TQDataStream& stream ); + void setRelAbs( TQ_UINT32, TQDataStream& stream ); + void setMapMode( TQ_UINT32, TQDataStream& stream ); + void extFloodFill( TQ_UINT32, TQDataStream& stream ); + void startDoc( TQ_UINT32, TQDataStream& stream ); + void startPage( TQ_UINT32, TQDataStream& stream ); + void endDoc( TQ_UINT32, TQDataStream& stream ); + void endPage( TQ_UINT32, TQDataStream& stream ); + void resetDC( TQ_UINT32, TQDataStream& stream ); + void bitBlt( TQ_UINT32, TQDataStream& stream ); + void setDibToDev( TQ_UINT32, TQDataStream& stream ); + void createBrush( TQ_UINT32, TQDataStream& stream ); + void createPatternBrush( TQ_UINT32, TQDataStream& stream ); + void createBitmap( TQ_UINT32, TQDataStream& stream ); + void createBitmapIndirect( TQ_UINT32, TQDataStream& stream ); + void createPalette( TQ_UINT32, TQDataStream& stream ); + void createRegion( TQ_UINT32, TQDataStream& stream ); private: //----------------------------------------------------------------------------- - // Utilities and conversion Wmf -> Qt + // Utilities and conversion Wmf -> TQt /** Handle win-object-handles */ bool addHandle( KoWmfHandle* ); void deleteHandle( int ); - /** Convert QINT16 points into QPointArray */ - void pointArray( QDataStream& stream, QPointArray& pa ); + /** Convert TQINT16 points into TQPointArray */ + void pointArray( TQDataStream& stream, TQPointArray& pa ); - /** Convertion between windows color and QColor */ - QColor qtColor( Q_UINT32 color ) const - { return QColor( color & 0xFF, (color>>8) & 0xFF, (color>>16) & 0xFF ); } + /** Convertion between windows color and TQColor */ + TQColor qtColor( TQ_UINT32 color ) const + { return TQColor( color & 0xFF, (color>>8) & 0xFF, (color>>16) & 0xFF ); } /** Convert (x1,y1) and (x2, y2) positions in angle and angleLength */ void xyToAngle( int xStart, int yStart, int xEnd, int yEnd, int& angle, int& aLength ); /** Convert windows rasterOp in QT rasterOp */ - Qt::RasterOp winToQtRaster( Q_UINT16 param ) const; - Qt::RasterOp winToQtRaster( Q_UINT32 param ) const; + TQt::RasterOp winToTQtRaster( TQ_UINT16 param ) const; + TQt::RasterOp winToTQtRaster( TQ_UINT32 param ) const; /** Converts DIB to BMP */ - bool dibToBmp( QImage& bmp, QDataStream& stream, Q_UINT32 size); + bool dibToBmp( TQImage& bmp, TQDataStream& stream, TQ_UINT32 size); public: @@ -205,7 +205,7 @@ public: bool mEnhanced; /// bounding rectangle - QRect mBBox; // placeable file : this is the header + TQRect mBBox; // placeable file : this is the header // standard file : this is the value in setWindowOrg and setWindowExt /// number of points per inch for the default size int mDpi; @@ -218,15 +218,15 @@ private: KoWmfRead *mReadWmf; // current coordinate != mBBox - QRect mWindow; + TQRect mWindow; // current state of the drawing - QColor mTextColor; - Q_UINT16 mTextAlign; + TQColor mTextColor; + TQ_UINT16 mTextAlign; int mTextRotation; bool mWinding; // memory allocation for WMF file - QBuffer* mBuffer; + TQBuffer* mBuffer; int mOffsetFirstRecord; // stack of object handle @@ -240,7 +240,7 @@ private: * static data */ static const struct KoWmfFunc { - void ( KoWmfReadPrivate::*method )( Q_UINT32, QDataStream& ); + void ( KoWmfReadPrivate::*method )( TQ_UINT32, TQDataStream& ); } koWmfFunc[] = { { &KoWmfReadPrivate::end }, // 0 { &KoWmfReadPrivate::setBkColor }, // 1 diff --git a/lib/kwmf/kowmfstack.h b/lib/kwmf/kowmfstack.h index 0dcb5a8d..876318ab 100644 --- a/lib/kwmf/kowmfstack.h +++ b/lib/kwmf/kowmfstack.h @@ -19,11 +19,11 @@ #ifndef _KOWMFSTACK_H_ #define _KOWMFSTACK_H_ -#include <qpen.h> -#include <qcolor.h> -#include <qfont.h> -#include <qbrush.h> -#include <qpixmap.h> +#include <tqpen.h> +#include <tqcolor.h> +#include <tqfont.h> +#include <tqbrush.h> +#include <tqpixmap.h> class KoWmfRead; @@ -42,7 +42,7 @@ class KoWmfBrushHandle: public KoWmfHandle public: virtual ~KoWmfBrushHandle() {}; virtual void apply( KoWmfRead * ); - QBrush brush; + TQBrush brush; }; class KoWmfPenHandle: public KoWmfHandle @@ -50,7 +50,7 @@ class KoWmfPenHandle: public KoWmfHandle public: virtual ~KoWmfPenHandle() {}; virtual void apply( KoWmfRead * ); - QPen pen; + TQPen pen; }; class KoWmfPatternBrushHandle: public KoWmfHandle @@ -58,8 +58,8 @@ class KoWmfPatternBrushHandle: public KoWmfHandle public: virtual ~KoWmfPatternBrushHandle() {}; virtual void apply( KoWmfRead * ); - QBrush brush; - QPixmap image; + TQBrush brush; + TQPixmap image; }; class KoWmfFontHandle: public KoWmfHandle @@ -67,7 +67,7 @@ class KoWmfFontHandle: public KoWmfHandle public: virtual ~KoWmfFontHandle() {}; virtual void apply( KoWmfRead * ); - QFont font; + TQFont font; int rotation; }; diff --git a/lib/kwmf/kowmfstruct.h b/lib/kwmf/kowmfstruct.h index 2837fa71..d94a9d79 100644 --- a/lib/kwmf/kowmfstruct.h +++ b/lib/kwmf/kowmfstruct.h @@ -5,116 +5,116 @@ #ifndef _KOWMFSTRUCT_H_ #define _KOWMFSTRUCT_H_ -#include <qglobal.h> -#include <qnamespace.h> +#include <tqglobal.h> +#include <tqnamespace.h> #define APMHEADER_KEY 0x9AC6CDD7 #define ENHMETA_SIGNATURE 0x464D4520 struct WmfMetaHeader { - Q_UINT16 fileType; // Type of metafile (0=memory, 1=disk) - Q_UINT16 headerSize; // always 9 - Q_UINT16 version; - Q_UINT32 fileSize; // Total size of the metafile in WORDs - Q_UINT16 numOfObjects; // Maximum Number of objects in the stack - Q_UINT32 maxRecordSize; // The size of largest record in WORDs - Q_UINT16 numOfParameters; // not used (always 0) + TQ_UINT16 fileType; // Type of metafile (0=memory, 1=disk) + TQ_UINT16 headerSize; // always 9 + TQ_UINT16 version; + TQ_UINT32 fileSize; // Total size of the metafile in WORDs + TQ_UINT16 numOfObjects; // Maximum Number of objects in the stack + TQ_UINT32 maxRecordSize; // The size of largest record in WORDs + TQ_UINT16 numOfParameters; // not used (always 0) }; struct WmfPlaceableHeader { - Q_UINT32 key; // Magic number (always 9AC6CDD7h) - Q_UINT16 handle; // Metafile HANDLE number (always 0) - Q_INT16 left; // Left coordinate in metafile units - Q_INT16 top; - Q_INT16 right; - Q_INT16 bottom; - Q_UINT16 inch; // Number of metafile units per inch - Q_UINT32 reserved; - Q_UINT16 checksum; // Checksum value for previous 10 WORDs + TQ_UINT32 key; // Magic number (always 9AC6CDD7h) + TQ_UINT16 handle; // Metafile HANDLE number (always 0) + TQ_INT16 left; // Left coordinate in metafile units + TQ_INT16 top; + TQ_INT16 right; + TQ_INT16 bottom; + TQ_UINT16 inch; // Number of metafile units per inch + TQ_UINT32 reserved; + TQ_UINT16 checksum; // Checksum value for previous 10 WORDs }; struct WmfEnhMetaHeader { - Q_UINT32 recordType; // Record type (is always 00000001h) - Q_UINT32 recordSize; // Record size in bytes. This may be greater + TQ_UINT32 recordType; // Record type (is always 00000001h) + TQ_UINT32 recordSize; // Record size in bytes. This may be greater // than the sizeof( ENHMETAHEADER ). - Q_INT32 boundsLeft; // Inclusive-inclusive bounds in device units - Q_INT32 boundsTop; - Q_INT32 boundsRight; - Q_INT32 boundsBottom; - Q_INT32 frameLeft; // Inclusive-inclusive Picture Frame - Q_INT32 frameTop; - Q_INT32 frameRight; - Q_INT32 frameBottom; - Q_UINT32 signature; // Signature. Must be ENHMETA_SIGNATURE. - Q_UINT32 version; // Version number - Q_UINT32 size; // Size of the metafile in bytes - Q_UINT32 numOfRecords; // Number of records in the metafile - Q_UINT16 numHandles; // Number of handles in the handle table + TQ_INT32 boundsLeft; // Inclusive-inclusive bounds in device units + TQ_INT32 boundsTop; + TQ_INT32 boundsRight; + TQ_INT32 boundsBottom; + TQ_INT32 frameLeft; // Inclusive-inclusive Picture Frame + TQ_INT32 frameTop; + TQ_INT32 frameRight; + TQ_INT32 frameBottom; + TQ_UINT32 signature; // Signature. Must be ENHMETA_SIGNATURE. + TQ_UINT32 version; // Version number + TQ_UINT32 size; // Size of the metafile in bytes + TQ_UINT32 numOfRecords; // Number of records in the metafile + TQ_UINT16 numHandles; // Number of handles in the handle table // Handle index zero is reserved. - Q_UINT16 reserved; // always 0 - Q_UINT32 sizeOfDescription; // Number of chars in the unicode description string + TQ_UINT16 reserved; // always 0 + TQ_UINT32 sizeOfDescription; // Number of chars in the tqunicode description string // This is 0 if there is no description string - Q_UINT32 offsetOfDescription; // Offset to the metafile description record. + TQ_UINT32 offsetOfDescription; // Offset to the metafile description record. // This is 0 if there is no description string - Q_UINT32 numPaletteEntries; // Number of color palette entries - Q_INT32 widthDevicePixels; // Size of the reference device in pixels - Q_INT32 heightDevicePixels; - Q_INT32 widthDeviceMM; // Size of the reference device in millimeters - Q_INT32 heightDeviceMM; + TQ_UINT32 numPaletteEntries; // Number of color palette entries + TQ_INT32 widthDevicePixels; // Size of the reference device in pixels + TQ_INT32 heightDevicePixels; + TQ_INT32 widthDeviceMM; // Size of the reference device in millimeters + TQ_INT32 heightDeviceMM; }; struct WmfMetaRecord { - Q_UINT32 size; // Total size of the record in WORDs - Q_UINT16 function; // Record function number - Q_UINT16 param[ 1 ]; // Q_UINT16 array of parameters + TQ_UINT32 size; // Total size of the record in WORDs + TQ_UINT16 function; // Record function number + TQ_UINT16 param[ 1 ]; // TQ_UINT16 array of parameters }; struct WmfEnhMetaRecord { - Q_UINT32 function; // Record function number - Q_UINT32 size; // Record size in bytes - Q_UINT32 param[ 1 ]; // Q_UINT32 array of parameters + TQ_UINT32 function; // Record function number + TQ_UINT32 size; // Record size in bytes + TQ_UINT32 param[ 1 ]; // TQ_UINT32 array of parameters }; // Static data static const struct OpTab { - Q_UINT32 winRasterOp; - Qt::RasterOp qtRasterOp; + TQ_UINT32 winRasterOp; + TQt::RasterOp qtRasterOp; } koWmfOpTab32[] = { - { 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 } }; - static const Qt::RasterOp koWmfOpTab16[] = + static const TQt::RasterOp koWmfOpTab16[] = { - 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 }; static const Qt::BrushStyle koWmfHatchedStyleBrush[] = diff --git a/lib/kwmf/kowmfwrite.cc b/lib/kwmf/kowmfwrite.cc index 1c553391..22a0d131 100644 --- a/lib/kwmf/kowmfwrite.cc +++ b/lib/kwmf/kowmfwrite.cc @@ -17,8 +17,8 @@ */ #include <math.h> -#include <qfile.h> -#include <qdatastream.h> +#include <tqfile.h> +#include <tqdatastream.h> #include <kdebug.h> @@ -32,18 +32,18 @@ class KoWmfWritePrivate { public: - QRect mBBox; // bounding rectangle + TQRect mBBox; // bounding rectangle int mDpi; // number of point per inch for the default size int mMaxRecordSize; // memory allocation for WMF file - QFile mFileOut; - QDataStream mSt; + TQFile mFileOut; + TQDataStream mSt; }; -KoWmfWrite::KoWmfWrite( const QString& fileName ) { +KoWmfWrite::KoWmfWrite( const TQString& fileName ) { d = new KoWmfWritePrivate; d->mDpi = 1024; @@ -68,26 +68,26 @@ bool KoWmfWrite::begin() { if ( !d->mFileOut.open( IO_WriteOnly ) ) { - kdDebug() << "Cannot open file " << QFile::encodeName(d->mFileOut.name()) << endl; + kdDebug() << "Cannot open file " << TQString(TQFile::encodeName(d->mFileOut.name())) << endl; return false; } d->mSt.setDevice( &d->mFileOut ); - d->mSt.setByteOrder( QDataStream::LittleEndian ); + d->mSt.setByteOrder( TQDataStream::LittleEndian ); // reserved placeable and standard header for ( int i=0 ; i < 10 ; i++ ) { - d->mSt << (Q_UINT32)0; + d->mSt << (TQ_UINT32)0; } // initialize the stack of objects // Pen - d->mSt << (Q_UINT32)8 << (Q_UINT16)0x02FA; - d->mSt << (Q_UINT16)5 << (Q_UINT16)0 << (Q_UINT16)0 << (Q_UINT32)0; + d->mSt << (TQ_UINT32)8 << (TQ_UINT16)0x02FA; + d->mSt << (TQ_UINT16)5 << (TQ_UINT16)0 << (TQ_UINT16)0 << (TQ_UINT32)0; // Brush - d->mSt << (Q_UINT32)7 << (Q_UINT16)0x02FC; - d->mSt << (Q_UINT16)1 << (Q_UINT32)0 << (Q_UINT16)0; + d->mSt << (TQ_UINT32)7 << (TQ_UINT16)0x02FC; + d->mSt << (TQ_UINT16)1 << (TQ_UINT32)0 << (TQ_UINT16)0; for ( int i=0 ; i < 4 ; i++ ) { - d->mSt << (Q_UINT32)8 << (Q_UINT16)0x02FA << (Q_UINT16)0 << (Q_UINT32)0 << (Q_UINT32)0; + d->mSt << (TQ_UINT32)8 << (TQ_UINT16)0x02FA << (TQ_UINT16)0 << (TQ_UINT32)0 << (TQ_UINT32)0; } d->mMaxRecordSize = 8; @@ -97,10 +97,10 @@ bool KoWmfWrite::begin() { bool KoWmfWrite::end() { WmfPlaceableHeader pheader = { 0x9AC6CDD7, 0, 0, 0, 0, 0, 0, 0, 0 }; - Q_UINT16 checksum; + TQ_UINT16 checksum; // End of the wmf file - d->mSt << (Q_UINT32)3 << (Q_UINT16)0; + d->mSt << (TQ_UINT32)3 << (TQ_UINT16)0; // adjust header pheader.left = d->mBBox.left(); @@ -112,11 +112,11 @@ bool KoWmfWrite::end() { // write headers d->mFileOut.at( 0 ); - d->mSt << (Q_UINT32)0x9AC6CDD7 << (Q_UINT16)0; - d->mSt << (Q_INT16)d->mBBox.left() << (Q_INT16)d->mBBox.top() << (Q_INT16)d->mBBox.right() << (Q_INT16)d->mBBox.bottom(); - d->mSt << (Q_UINT16)d->mDpi << (Q_UINT32)0 << checksum; - d->mSt << (Q_UINT16)1 << (Q_UINT16)9 << (Q_UINT16)0x300 << (Q_UINT32)(d->mFileOut.size()/2); - d->mSt << (Q_UINT16)6 << (Q_UINT32)d->mMaxRecordSize << (Q_UINT16)0; + 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; d->mFileOut.close(); @@ -125,24 +125,24 @@ bool KoWmfWrite::end() { void KoWmfWrite::save() { - d->mSt << (Q_UINT32)3 << (Q_UINT16)0x001E; + d->mSt << (TQ_UINT32)3 << (TQ_UINT16)0x001E; } void KoWmfWrite::restore() { - d->mSt << (Q_UINT32)4 << (Q_UINT16)0x0127 << (Q_UINT16)1; + d->mSt << (TQ_UINT32)4 << (TQ_UINT16)0x0127 << (TQ_UINT16)1; } -void KoWmfWrite::setPen( const QPen &pen ) { +void KoWmfWrite::setPen( const TQPen &pen ) { int style; - int max = sizeof(koWmfStylePen) / sizeof(Qt::SolidLine); + int max = sizeof(koWmfStylePen) / sizeof(TQt::SolidLine); // we can't delete an object currently selected // select another object - d->mSt << (Q_UINT32)4 << (Q_UINT16)0x012D << (Q_UINT16)0; + d->mSt << (TQ_UINT32)4 << (TQ_UINT16)0x012D << (TQ_UINT16)0; // delete object - d->mSt << (Q_UINT32)4 << (Q_UINT16)0x01f0 << (Q_UINT16)2; + d->mSt << (TQ_UINT32)4 << (TQ_UINT16)0x01f0 << (TQ_UINT16)2; for ( style=0 ; style < max ; style++ ) { if ( koWmfStylePen[ style ] == pen.style() ) break; @@ -151,23 +151,23 @@ void KoWmfWrite::setPen( const QPen &pen ) { // SolidLine style = 0; } - d->mSt << (Q_UINT32)8 << (Q_UINT16)0x02FA; - d->mSt << (Q_UINT16)style << (Q_UINT16)pen.width() << (Q_UINT16)0 << (Q_UINT32)winColor( pen.color() ); + 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() ); // select object - d->mSt << (Q_UINT32)4 << (Q_UINT16)0x012D << (Q_UINT16)2; + d->mSt << (TQ_UINT32)4 << (TQ_UINT16)0x012D << (TQ_UINT16)2; } -void KoWmfWrite::setBrush( const QBrush &brush ) { +void KoWmfWrite::setBrush( const TQBrush &brush ) { int style; - int max = sizeof(koWmfStyleBrush) / sizeof(Qt::NoBrush); + int max = sizeof(koWmfStyleBrush) / sizeof(TQt::NoBrush); // we can't delete an object currently selected // select another object - d->mSt << (Q_UINT32)4 << (Q_UINT16)0x012D << (Q_UINT16)1; + d->mSt << (TQ_UINT32)4 << (TQ_UINT16)0x012D << (TQ_UINT16)1; // delete object - d->mSt << (Q_UINT32)4 << (Q_UINT16)0x01f0 << (Q_UINT16)3; + d->mSt << (TQ_UINT32)4 << (TQ_UINT16)0x01f0 << (TQ_UINT16)3; for ( style=0 ; style < max ; style++ ) { if ( koWmfStyleBrush[ style ] == brush.style() ) break; @@ -176,34 +176,34 @@ void KoWmfWrite::setBrush( const QBrush &brush ) { // SolidPattern style = 0; } - d->mSt << (Q_UINT32)7 << (Q_UINT16)0x02FC; - d->mSt << (Q_UINT16)style << (Q_UINT32)winColor( brush.color() ) << (Q_UINT16)0; + d->mSt << (TQ_UINT32)7 << (TQ_UINT16)0x02FC; + d->mSt << (TQ_UINT16)style << (TQ_UINT32)winColor( brush.color() ) << (TQ_UINT16)0; // select object - d->mSt << (Q_UINT32)4 << (Q_UINT16)0x012D << (Q_UINT16)3; + d->mSt << (TQ_UINT32)4 << (TQ_UINT16)0x012D << (TQ_UINT16)3; } -void KoWmfWrite::setFont( const QFont & ) { +void KoWmfWrite::setFont( const TQFont & ) { } -void KoWmfWrite::setBackgroundColor( const QColor &c ) { - d->mSt << (Q_UINT32)5 << (Q_UINT16)0x0201 << (Q_UINT32)winColor( c ); +void KoWmfWrite::setBackgroundColor( const TQColor &c ) { + d->mSt << (TQ_UINT32)5 << (TQ_UINT16)0x0201 << (TQ_UINT32)winColor( c ); } void KoWmfWrite::setBackgroundMode( Qt::BGMode mode ) { - d->mSt << (Q_UINT32)4 << (Q_UINT16)0x0102; + d->mSt << (TQ_UINT32)4 << (TQ_UINT16)0x0102; if ( mode == Qt::TransparentMode ) - d->mSt << (Q_UINT16)1; + d->mSt << (TQ_UINT16)1; else - d->mSt << (Q_UINT16)0; + d->mSt << (TQ_UINT16)0; } -void KoWmfWrite::setRasterOp( Qt::RasterOp op ) { - d->mSt << (Q_UINT32)5 << (Q_UINT16)0x0104 << (Q_UINT32)qtRasterToWin32( op ); +void KoWmfWrite::setRasterOp( TQt::RasterOp op ) { + d->mSt << (TQ_UINT32)5 << (TQ_UINT16)0x0104 << (TQ_UINT32)qtRasterToWin32( op ); } @@ -211,14 +211,14 @@ void KoWmfWrite::setWindow( int left, int top, int width, int height ) { d->mBBox.setRect( left, top, width, height ); // windowOrg - d->mSt << (Q_UINT32)5 << (Q_UINT16)0x020B << (Q_UINT16)top << (Q_UINT16)left; + d->mSt << (TQ_UINT32)5 << (TQ_UINT16)0x020B << (TQ_UINT16)top << (TQ_UINT16)left; // windowExt - d->mSt << (Q_UINT32)5 << (Q_UINT16)0x020C << (Q_UINT16)height << (Q_UINT16)width; + d->mSt << (TQ_UINT32)5 << (TQ_UINT16)0x020C << (TQ_UINT16)height << (TQ_UINT16)width; } -void KoWmfWrite::setClipRegion( const QRegion & ) { +void KoWmfWrite::setClipRegion( const TQRegion & ) { } @@ -232,43 +232,43 @@ void KoWmfWrite::clipping( bool enable ) { void KoWmfWrite::moveTo( int left, int top ) { - d->mSt << (Q_UINT32)5 << (Q_UINT16)0x0214 << (Q_UINT16)top << (Q_UINT16)left; + d->mSt << (TQ_UINT32)5 << (TQ_UINT16)0x0214 << (TQ_UINT16)top << (TQ_UINT16)left; } void KoWmfWrite::lineTo( int left, int top ) { - d->mSt << (Q_UINT32)5 << (Q_UINT16)0x0213 << (Q_UINT16)top << (Q_UINT16)left; + d->mSt << (TQ_UINT32)5 << (TQ_UINT16)0x0213 << (TQ_UINT16)top << (TQ_UINT16)left; } void KoWmfWrite::drawRect( int left, int top, int width, int height ) { - QRect rec( left, top, width, height ); + TQRect rec( left, top, width, height ); - d->mSt << (Q_UINT32)7 << (Q_UINT16)0x041B; - d->mSt << (Q_UINT16)rec.bottom() << (Q_UINT16)rec.right() << (Q_UINT16)rec.top() << (Q_UINT16)rec.left(); + 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(); } void KoWmfWrite::drawRoundRect( int left, int top, int width, int height , int roudw, int roudh ) { int widthCorner, heightCorner; - QRect rec( left, top, width, height ); + TQRect rec( left, top, width, height ); // convert percentage (roundw, roudh) in (widthCorner, heightCorner) widthCorner = ( roudw * width ) / 100; heightCorner = ( roudh * height ) / 100; - d->mSt << (Q_UINT32)9 << (Q_UINT16)0x061C << (Q_UINT16)heightCorner << (Q_UINT16)widthCorner; - d->mSt << (Q_UINT16)rec.bottom() << (Q_UINT16)rec.right() << (Q_UINT16)rec.top() << (Q_UINT16)rec.left(); + 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(); - d->mMaxRecordSize = QMAX( d->mMaxRecordSize, 9 ); + d->mMaxRecordSize = TQMAX( d->mMaxRecordSize, 9 ); } void KoWmfWrite::drawEllipse( int left, int top, int width, int height ) { - QRect rec( left, top, width, height ); + TQRect rec( left, top, width, height ); - d->mSt << (Q_UINT32)7 << (Q_UINT16)0x0418; - d->mSt << (Q_UINT16)rec.bottom() << (Q_UINT16)rec.right() << (Q_UINT16)rec.top() << (Q_UINT16)rec.left(); + 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(); } @@ -280,13 +280,13 @@ void KoWmfWrite::drawArc( int left, int top, int width, int height , int a, int xCenter = left + (width / 2); yCenter = top + (height / 2); - d->mSt << (Q_UINT32)11 << (Q_UINT16)0x0817; - d->mSt << (Q_UINT16)(yCenter + offYEnd) << (Q_UINT16)(xCenter + offXEnd); - d->mSt << (Q_UINT16)(yCenter + offYStart) << (Q_UINT16)(xCenter + offXStart); - d->mSt << (Q_UINT16)(top + height) << (Q_UINT16)(left + width); - d->mSt << (Q_UINT16)top << (Q_UINT16)left; + 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; - d->mMaxRecordSize = QMAX( d->mMaxRecordSize, 11 ); + d->mMaxRecordSize = TQMAX( d->mMaxRecordSize, 11 ); } @@ -298,13 +298,13 @@ void KoWmfWrite::drawPie( int left, int top, int width, int height , int a, int xCenter = left + (width / 2); yCenter = top + (height / 2); - d->mSt << (Q_UINT32)11 << (Q_UINT16)0x081A; - d->mSt << (Q_UINT16)(yCenter + offYEnd) << (Q_UINT16)(xCenter + offXEnd); - d->mSt << (Q_UINT16)(yCenter + offYStart) << (Q_UINT16)(xCenter + offXStart); - d->mSt << (Q_UINT16)(top + height) << (Q_UINT16)(left + width); - d->mSt << (Q_UINT16)top << (Q_UINT16)left; + 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; - d->mMaxRecordSize = QMAX( d->mMaxRecordSize, 11 ); + d->mMaxRecordSize = TQMAX( d->mMaxRecordSize, 11 ); } @@ -316,50 +316,50 @@ void KoWmfWrite::drawChord( int left, int top, int width, int height , int a, in xCenter = left + (width / 2); yCenter = top + (height / 2); - d->mSt << (Q_UINT32)11 << (Q_UINT16)0x0830; - d->mSt << (Q_UINT16)(yCenter + offYEnd) << (Q_UINT16)(xCenter + offXEnd); - d->mSt << (Q_UINT16)(yCenter + offYStart) << (Q_UINT16)(xCenter + offXStart); - d->mSt << (Q_UINT16)(top + height) << (Q_UINT16)(left + width); - d->mSt << (Q_UINT16)top << (Q_UINT16)left; + 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; - d->mMaxRecordSize = QMAX( d->mMaxRecordSize, 11 ); + d->mMaxRecordSize = TQMAX( d->mMaxRecordSize, 11 ); } -void KoWmfWrite::drawPolyline( const QPointArray &pa ) { +void KoWmfWrite::drawPolyline( const TQPointArray &pa ) { int size = 4 + (pa.size() * 2); - d->mSt << (Q_UINT32)size << (Q_UINT16)0x0325 << (Q_UINT16)pa.size(); + d->mSt << (TQ_UINT32)size << (TQ_UINT16)0x0325 << (TQ_UINT16)pa.size(); pointArray( pa ); - d->mMaxRecordSize = QMAX( d->mMaxRecordSize, size ); + d->mMaxRecordSize = TQMAX( d->mMaxRecordSize, size ); } -void KoWmfWrite::drawPolygon( const QPointArray &pa, bool ) { +void KoWmfWrite::drawPolygon( const TQPointArray &pa, bool ) { int size = 4 + (pa.size() * 2); - d->mSt << (Q_UINT32)size << (Q_UINT16)0x0324 << (Q_UINT16)pa.size(); + d->mSt << (TQ_UINT32)size << (TQ_UINT16)0x0324 << (TQ_UINT16)pa.size(); pointArray( pa ); - d->mMaxRecordSize = QMAX( d->mMaxRecordSize, size ); + d->mMaxRecordSize = TQMAX( d->mMaxRecordSize, size ); } -void KoWmfWrite::drawPolyPolygon( QPtrList<QPointArray>& listPa, bool ) { +void KoWmfWrite::drawPolyPolygon( TQPtrList<TQPointArray>& listPa, bool ) { - QPointArray *pa; + TQPointArray *pa; int sizeArrayPoly = 0; for ( pa = listPa.first() ; pa ; pa = listPa.next() ) { sizeArrayPoly += (pa->size() * 2); } int size = 4 + listPa.count() + sizeArrayPoly; - d->mSt << (Q_UINT32)size << (Q_UINT16)0x0538 << (Q_UINT16)listPa.count(); + d->mSt << (TQ_UINT32)size << (TQ_UINT16)0x0538 << (TQ_UINT16)listPa.count(); // number of point for each Polygon for ( pa = listPa.first() ; pa ; pa = listPa.next() ) { - d->mSt << (Q_UINT16)pa->size(); + d->mSt << (TQ_UINT16)pa->size(); } // list of points @@ -367,44 +367,44 @@ void KoWmfWrite::drawPolyPolygon( QPtrList<QPointArray>& listPa, bool ) { pointArray( *pa ); } - d->mMaxRecordSize = QMAX( d->mMaxRecordSize, size ); + d->mMaxRecordSize = TQMAX( d->mMaxRecordSize, size ); } -void KoWmfWrite::drawImage( int , int , const QImage &, int , int , int , int ) { +void KoWmfWrite::drawImage( int , int , const TQImage &, int , int , int , int ) { /* - QImage img; + TQImage img; img = image; img.setFormat( "BMP" ); - QIODevice io = img.ioDevice(); + TQIODevice io = img.ioDevice(); io.at( 14 ); // skip the BMP header d->mSt << io.readAll(); */ } -void KoWmfWrite::drawText( int , int , int , int , int , const QString& , double ) { -// d->mSt << (Q_UINT32)3 << (Q_UINT16)0x0A32; +void KoWmfWrite::drawText( int , int , int , int , int , const TQString& , double ) { +// d->mSt << (TQ_UINT32)3 << (TQ_UINT16)0x0A32; } //----------------------------------------------------------------------------- -// Utilities and conversion Qt --> Wmf +// Utilities and conversion TQt --> Wmf -void KoWmfWrite::pointArray( const QPointArray &pa ) { +void KoWmfWrite::pointArray( const TQPointArray &pa ) { int left, top, i, max; for ( i=0, max=pa.size() ; i < max ; i++ ) { pa.point( i, &left, &top ); - d->mSt << (Q_INT16)left << (Q_INT16)top; + d->mSt << (TQ_INT16)left << (TQ_INT16)top; } } -Q_UINT32 KoWmfWrite::winColor( QColor color ) { - Q_UINT32 c; +TQ_UINT32 KoWmfWrite::winColor( TQColor color ) { + TQ_UINT32 c; c = (color.red() & 0xFF); c += ( (color.green() & 0xFF) << 8 ); @@ -427,7 +427,7 @@ void KoWmfWrite::angleToxy( int &xStart, int &yStart, int &xEnd, int &yEnd, int } -Q_UINT16 KoWmfWrite::qtRasterToWin16( Qt::RasterOp op ) const { +TQ_UINT16 KoWmfWrite::qtRasterToWin16( TQt::RasterOp op ) const { int i; for ( i=0 ; i < 17 ; i++ ) { @@ -435,13 +435,13 @@ Q_UINT16 KoWmfWrite::qtRasterToWin16( Qt::RasterOp op ) const { } if ( i < 17 ) - return (Q_UINT16)i; + return (TQ_UINT16)i; else - return (Q_UINT16)0; + return (TQ_UINT16)0; } -Q_UINT32 KoWmfWrite::qtRasterToWin32( Qt::RasterOp op ) const { +TQ_UINT32 KoWmfWrite::qtRasterToWin32( TQt::RasterOp op ) const { int i; for ( i=0 ; i < 15 ; i++ ) { diff --git a/lib/kwmf/kowmfwrite.h b/lib/kwmf/kowmfwrite.h index 1063ef76..bc3e1411 100644 --- a/lib/kwmf/kowmfwrite.h +++ b/lib/kwmf/kowmfwrite.h @@ -18,24 +18,24 @@ #ifndef _KOWMFWRITE_H_ #define _KOWMFWRITE_H_ -#include <qpen.h> -#include <qbrush.h> -#include <qcolor.h> -#include <qfont.h> -#include <qrect.h> -#include <qbuffer.h> -#include <qregion.h> -#include <qstring.h> -#include <qwmatrix.h> -#include <qimage.h> -#include <qptrlist.h> -#include <qpointarray.h> +#include <tqpen.h> +#include <tqbrush.h> +#include <tqcolor.h> +#include <tqfont.h> +#include <tqrect.h> +#include <tqbuffer.h> +#include <tqregion.h> +#include <tqstring.h> +#include <tqwmatrix.h> +#include <tqimage.h> +#include <tqptrlist.h> +#include <tqpointarray.h> #include <koffice_export.h> class KoWmfWritePrivate; /** * KoWmfWrite allows to create a windows placeable meta file (WMF). - * Most of the functions are compatible with QPainter format. + * Most of the functions are compatible with TQPainter format. * * sample of utilization: * <pre> @@ -49,13 +49,13 @@ class KoWmfWritePrivate; class KOWMF_EXPORT KoWmfWrite { public: - KoWmfWrite( const QString& fileName ); + KoWmfWrite( const TQString& fileName ); virtual ~KoWmfWrite(); // ------------------------------------------------------------------------- // virtual Painter - // for a good documentation : check QPainter documentation + // for a good documentation : check TQPainter documentation /** * Open the file. Returns true on success. */ @@ -75,15 +75,15 @@ public: void setDefaultDpi( int dpi ); // Drawing tools - void setFont( const QFont& f ); + void setFont( const TQFont& f ); // the width of the pen is in logical coordinate - void setPen( const QPen& p ); - void setBrush( const QBrush& b ); + void setPen( const TQPen& p ); + void setBrush( const TQBrush& b ); // Drawing attributes/modes - void setBackgroundColor( const QColor& r ); + void setBackgroundColor( const TQColor& r ); void setBackgroundMode( Qt::BGMode ); - void setRasterOp( Qt::RasterOp ); + void setRasterOp( TQt::RasterOp ); // Change logical Coordinate void setWindow( int left, int top , int width, int height ); @@ -91,7 +91,7 @@ public: // Clipping // the 'CoordinateMode' parameter is ommitted : always CoordPainter in wmf // not yet implemented - void setClipRegion( const QRegion& r ); + void setClipRegion( const TQRegion& r ); void clipping( bool enable ); // Graphics drawing functions @@ -103,34 +103,34 @@ public: void drawArc( int left, int top, int width, int height, int a, int alen ); void drawPie( int left, int top, int width, int height, int a, int alen ); void drawChord( int left, int top, int width, int height, int a, int alen ); - void drawPolyline( const QPointArray& pa ); - void drawPolygon( const QPointArray& pa, bool winding=FALSE ); + void drawPolyline( const TQPointArray& pa ); + void drawPolygon( const TQPointArray& pa, bool winding=FALSE ); // drawPolyPolygon draw the XOR of a list of polygons // listPa : list of polygons - void drawPolyPolygon( QPtrList<QPointArray>& listPa, bool winding=FALSE ); - void drawImage( int left, int top, const QImage &, int sx = 0, int sy = 0, int sw = -1, int sh = -1 ); + void drawPolyPolygon( TQPtrList<TQPointArray>& listPa, bool winding=FALSE ); + void drawImage( int left, int top, const TQImage &, int sx = 0, int sy = 0, int sw = -1, int sh = -1 ); // Text drawing functions // rotation = the degrees of rotation in counterclockwise // not yet implemented - void drawText( int x, int y, int w, int h, int flags, const QString &s, double rotation ); + void drawText( int x, int y, int w, int h, int flags, const TQString &s, double rotation ); private: //----------------------------------------------------------------------------- - // Utilities and conversion Qt --> Wmf + // Utilities and conversion TQt --> Wmf - /** Convert QPointArray into Q_INT16 position (result in mSt) */ - void pointArray( const QPointArray& pa ); + /** Convert TQPointArray into TQ_INT16 position (result in mSt) */ + void pointArray( const TQPointArray& pa ); - /** Convertion between windows color and QColor */ - Q_UINT32 winColor( QColor color ); + /** Convertion between windows color and TQColor */ + TQ_UINT32 winColor( TQColor color ); /** Convert angle a and alen in coordinate (xStart,yStart) and (xEnd, yEnd) */ void angleToxy( int& xStart, int& yStart, int& xEnd, int& yEnd, int a, int alen ); /** Convert windows rasterOp in QT rasterOp */ - Q_UINT16 qtRasterToWin16( Qt::RasterOp op ) const; - Q_UINT32 qtRasterToWin32( Qt::RasterOp op ) const; + TQ_UINT16 qtRasterToWin16( TQt::RasterOp op ) const; + TQ_UINT32 qtRasterToWin32( TQt::RasterOp op ) const; private: diff --git a/lib/kwmf/kwmf.cc b/lib/kwmf/kwmf.cc index 989b3e29..0a0d2c12 100644 --- a/lib/kwmf/kwmf.cc +++ b/lib/kwmf/kwmf.cc @@ -26,10 +26,10 @@ DESCRIPTION #include <kdebug.h> #include <math.h> -#include <qfile.h> -#include <qpointarray.h> +#include <tqfile.h> +#include <tqpointarray.h> #include <kwmf.h> -#include <qrect.h> +#include <tqrect.h> #define PI (3.14159265358979323846) @@ -73,13 +73,13 @@ unsigned KWmf::getColour( } void KWmf::genericArc( - QString type, - QDataStream &operands) + TQString type, + TQDataStream &operands) { - QPoint topLeft; - QPoint bottomRight; - QPoint start; - QPoint end; + TQPoint topLeft; + TQPoint bottomRight; + TQPoint start; + TQPoint end; topLeft = normalisePoint(operands); bottomRight = normalisePoint(operands); @@ -90,8 +90,8 @@ void KWmf::genericArc( // From each point draw a line to the center of the ellipse: the intercepts define // the ends of the arc. - QRect ellipse(topLeft, bottomRight); - QPoint centre = ellipse.center(); + TQRect ellipse(topLeft, bottomRight); + TQPoint centre = ellipse.center(); double startAngle = atan2((double)(centre.y() - start.y()), (double)(centre.x() - start.x())); double stopAngle = atan2((double)(centre.y() - end.y()), (double)(centre.x() - end.x())); @@ -155,9 +155,9 @@ void KWmf::handleDelete(int idx) void KWmf::invokeHandler( S16 opcode, U32 words, - QDataStream &operands) + TQDataStream &operands) { - typedef void (KWmf::*method)(U32 words, QDataStream &operands); + typedef void (KWmf::*method)(U32 words, TQDataStream &operands); typedef struct { @@ -262,7 +262,7 @@ void KWmf::invokeHandler( " operands: " << words << endl; else kdError(s_area) << "invokeHandler: unsupported opcode: 0x" << - QString::number(opcode, 16) << + TQString::number(opcode, 16) << " operands: " << words << endl; // Skip data we cannot use. @@ -287,19 +287,19 @@ void KWmf::invokeHandler( if (words) { - QByteArray *record = new QByteArray(words * 2); - QDataStream *body; + TQByteArray *record = new TQByteArray(words * 2); + TQDataStream *body; operands.readRawBytes(record->data(), words * 2); - body = new QDataStream(*record, IO_ReadOnly); - body->setByteOrder(QDataStream::LittleEndian); + body = new TQDataStream(*record, IO_ReadOnly); + body->setByteOrder(TQDataStream::LittleEndian); (this->*result)(words, *body); delete body; delete record; } else { - QDataStream *body = new QDataStream(); + TQDataStream *body = new TQDataStream(); (this->*result)(words, *body); delete body; @@ -307,52 +307,52 @@ void KWmf::invokeHandler( } } -QPoint KWmf::normalisePoint( - QDataStream &operands) +TQPoint KWmf::normalisePoint( + TQDataStream &operands) { S16 x; S16 y; operands >> x >> y; - return QPoint((x - m_windowOrgX) * m_windowFlipX / m_dpi, (y - m_windowOrgY) * m_windowFlipY / m_dpi); + return TQPoint((x - m_windowOrgX) * m_windowFlipX / m_dpi, (y - m_windowOrgY) * m_windowFlipY / m_dpi); } -QSize KWmf::normaliseSize( - QDataStream &operands) +TQSize KWmf::normaliseSize( + TQDataStream &operands) { S16 width; S16 height; operands >> width >> height; - return QSize(width / m_dpi, height / m_dpi); + return TQSize(width / m_dpi, height / m_dpi); } bool KWmf::parse( - const QString &file) + const TQString &file) { - QFile in(file); + TQFile in(file); if (!in.open(IO_ReadOnly)) { kdError(s_area) << "Unable to open input file!" << endl; in.close(); return false; } - QDataStream stream(&in); + TQDataStream stream(&in); bool result = parse(stream, in.size()); in.close(); return result; } bool KWmf::parse( - QDataStream &stream, + TQDataStream &stream, unsigned size) { int startedAt; bool isPlaceable; bool isEnhanced; - startedAt = stream.device()->at(); - stream.setByteOrder(QDataStream::LittleEndian); // Great, I love Qt ! + startedAt = stream.tqdevice()->at(); + stream.setByteOrder(TQDataStream::LittleEndian); // Great, I love TQt ! for (int i = 0; i < s_maxHandles; i++) m_objectHandles[i] = NULL; @@ -400,7 +400,7 @@ bool KWmf::parse( S16 nHandles; // Number of handles in the handle table // Handle index zero is reserved. S16 sReserved; // Reserved. Must be zero. - S32 nDescription; // Number of chars in the unicode description string + S32 nDescription; // Number of chars in the tqunicode description string // This is 0 if there is no description string S32 offDescription; // Offset to the metafile description record. // This is 0 if there is no description string @@ -477,7 +477,7 @@ bool KWmf::parse( } else { - stream.device()->at(startedAt); + stream.tqdevice()->at(startedAt); m_dpi = (unsigned)((double)576 / m_dpi); m_windowOrgX = 0; m_windowOrgY = 0; @@ -487,7 +487,7 @@ bool KWmf::parse( //----- Read as enhanced metafile header - fileAt = stream.device()->at(); + fileAt = stream.tqdevice()->at(); stream >> eheader.iType; stream >> eheader.nSize; stream >> eheader.rclBounds.left; @@ -539,7 +539,7 @@ bool KWmf::parse( { // debug("WMF Header"); //----- Read as standard metafile header - stream.device()->at(fileAt); + stream.tqdevice()->at(fileAt); stream >> header.mtType; stream >> header.mtHeaderSize; stream >> header.mtVersion; @@ -558,42 +558,42 @@ bool KWmf::parse( */ } - walk((size - (stream.device()->at() - startedAt)) / 2, stream); + walk((size - (stream.tqdevice()->at() - startedAt)) / 2, stream); return true; } void KWmf::opArc( U32 /*words*/, - QDataStream &operands) + TQDataStream &operands) { genericArc("arc", operands); } void KWmf::opBrushCreateIndirect( U32 /*words*/, - QDataStream &operands) + TQDataStream &operands) { - 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 device-independent bitmap + TQt::Dense6Pattern, // should be device-independent packed-bitmap + TQt::Dense2Pattern, // should be BS_PATTERN8x8 + TQt::Dense3Pattern // should be device-independent BS_DIBPATTERN8x8 }; - Qt::BrushStyle style; + TQt::BrushStyle style; WinObjBrushHandle *handle = handleCreateBrush(); S16 arg; S32 colour; @@ -611,7 +611,7 @@ void KWmf::opBrushCreateIndirect( else { kdError(s_area) << "createBrushIndirect: invalid hatched brush " << arg << endl; - style = Qt::SolidPattern; + style = TQt::SolidPattern; } } else @@ -623,7 +623,7 @@ void KWmf::opBrushCreateIndirect( else { kdError(s_area) << "createBrushIndirect: invalid brush " << arg << endl; - style = Qt::SolidPattern; + style = TQt::SolidPattern; operands >> discard; } handle->m_style = style; @@ -631,27 +631,27 @@ void KWmf::opBrushCreateIndirect( void KWmf::opEllipse( U32 /*words*/, - QDataStream &operands) + TQDataStream &operands) { - QPoint topLeft; - QPoint bottomRight; + TQPoint topLeft; + TQPoint bottomRight; topLeft = normalisePoint(operands); bottomRight = normalisePoint(operands); - QRect ellipse(topLeft, bottomRight); + TQRect ellipse(topLeft, bottomRight); gotEllipse(m_dc, "full", ellipse.center(), ellipse.size() / 2, 0, 0); } void KWmf::opLineTo( U32 /*words*/, - QDataStream &operands) + TQDataStream &operands) { - QPoint lineTo; + TQPoint lineTo; lineTo = normalisePoint(operands); - QPointArray points(2); + TQPointArray points(2); points.setPoint(0, m_lineFrom); points.setPoint(1, lineTo); gotPolyline(m_dc, points); @@ -663,14 +663,14 @@ void KWmf::opLineTo( void KWmf::opMoveTo( U32 /*words*/, - QDataStream &operands) + TQDataStream &operands) { m_lineFrom = normalisePoint(operands); } void KWmf::opNoop( U32 words, - QDataStream &operands) + TQDataStream &operands) { skip(words, operands); } @@ -678,7 +678,7 @@ void KWmf::opNoop( //----------------------------------------------------------------------------- void KWmf::opObjectDelete( U32 /*words*/, - QDataStream &operands) + TQDataStream &operands) { S16 idx; @@ -689,7 +689,7 @@ void KWmf::opObjectDelete( //----------------------------------------------------------------------------- void KWmf::opObjectSelect( U32 /*words*/, - QDataStream &operands) + TQDataStream &operands) { S16 idx; @@ -704,7 +704,7 @@ void KWmf::opObjectSelect( void KWmf::opPenCreateIndirect( U32 /*words*/, - QDataStream &operands) + TQDataStream &operands) { static Qt::PenStyle styleTab[] = { @@ -730,7 +730,7 @@ void KWmf::opPenCreateIndirect( else { kdError(s_area) << "createPenIndirect: invalid pen " << arg << endl; - handle->m_style = Qt::SolidLine; + handle->m_style = TQt::SolidLine; } operands >> arg; handle->m_width = arg; @@ -740,14 +740,14 @@ void KWmf::opPenCreateIndirect( void KWmf::opPie( U32 /*words*/, - QDataStream &operands) + TQDataStream &operands) { genericArc("pie", operands); } void KWmf::opPolygonSetFillMode( U32 /*words*/, - QDataStream &operands) + TQDataStream &operands) { S16 tmp; @@ -757,12 +757,12 @@ void KWmf::opPolygonSetFillMode( void KWmf::opPolygon( U32 /*words*/, - QDataStream &operands) + TQDataStream &operands) { S16 tmp; operands >> tmp; - QPointArray points(tmp); + TQPointArray points(tmp); for (int i = 0; i < tmp; i++) { @@ -773,12 +773,12 @@ void KWmf::opPolygon( void KWmf::opPolyline( U32 /*words*/, - QDataStream &operands) + TQDataStream &operands) { S16 tmp; operands >> tmp; - QPointArray points(tmp); + TQPointArray points(tmp); for (int i = 0; i < tmp; i++) { @@ -789,15 +789,15 @@ void KWmf::opPolyline( void KWmf::opRectangle( U32 /*words*/, - QDataStream &operands) + TQDataStream &operands) { - QPoint topLeft; - QSize size; + TQPoint topLeft; + TQSize size; topLeft = normalisePoint(operands); size = normaliseSize(operands); - QRect rect(topLeft, size); - QPointArray points(4); + TQRect rect(topLeft, size); + TQPointArray points(4); points.setPoint(0, topLeft); points.setPoint(1, rect.topRight()); @@ -808,7 +808,7 @@ void KWmf::opRectangle( void KWmf::opRestoreDc( U32 /*words*/, - QDataStream &operands) + TQDataStream &operands) { S16 pop; S16 i; @@ -822,7 +822,7 @@ void KWmf::opRestoreDc( void KWmf::opSaveDc( U32 /*words*/, - QDataStream &/*operands*/) + TQDataStream &/*operands*/) { m_savedDcs.push(m_dc); @@ -831,7 +831,7 @@ void KWmf::opSaveDc( void KWmf::opWindowSetOrg( U32 /*words*/, - QDataStream &operands) + TQDataStream &operands) { S16 top; S16 left; @@ -843,7 +843,7 @@ void KWmf::opWindowSetOrg( void KWmf::opWindowSetExt( U32 /*words*/, - QDataStream &operands) + TQDataStream &operands) { S16 height; S16 width; @@ -871,7 +871,7 @@ void KWmf::penSet( void KWmf::skip( U32 words, - QDataStream &operands) + TQDataStream &operands) { if ((int)words < 0) { @@ -893,7 +893,7 @@ void KWmf::skip( void KWmf::walk( U32 words, - QDataStream &operands) + TQDataStream &operands) { // Read bits: // diff --git a/lib/kwmf/kwmf.h b/lib/kwmf/kwmf.h index 4f1b050a..e3afe5e5 100644 --- a/lib/kwmf/kwmf.h +++ b/lib/kwmf/kwmf.h @@ -30,10 +30,10 @@ DESCRIPTION #ifndef KWMF_H #define KWMF_H -#include <qvaluestack.h> +#include <tqvaluestack.h> #include <koffice_export.h> -class QDataStream; -class QPointArray; +class TQDataStream; +class TQPointArray; class KOWMF_EXPORT KWmf { @@ -48,9 +48,9 @@ public: // Called to parse the given file. bool parse( - const QString &file); + const TQString &file); bool parse( - QDataStream &stream, + TQDataStream &stream, unsigned size); class KOWMF_EXPORT DrawContext @@ -80,20 +80,20 @@ protected: virtual void gotEllipse( const DrawContext &dc, - QString type, - QPoint topLeft, - QSize halfAxes, + TQString type, + TQPoint topLeft, + TQSize halfAxes, unsigned startAngle, unsigned stopAngle) = 0; virtual void gotPolygon( const DrawContext &dc, - const QPointArray &points) = 0; + const TQPointArray &points) = 0; virtual void gotPolyline( const DrawContext &dc, - const QPointArray &points) = 0; + const TQPointArray &points) = 0; virtual void gotRectangle( const DrawContext &dc, - const QPointArray &points) = 0; + const TQPointArray &points) = 0; private: // Debug support. @@ -112,8 +112,8 @@ private: int m_windowFlipX; int m_windowFlipY; DrawContext m_dc; - QValueStack<DrawContext> m_savedDcs; - QPoint m_lineFrom; + TQValueStack<DrawContext> m_savedDcs; + TQPoint m_lineFrom; // Windows handle management. @@ -149,71 +149,71 @@ private: WinObjHandle **m_objectHandles; unsigned getColour(S32 colour); - QPoint normalisePoint( - QDataStream &operands); - QSize normaliseSize( - QDataStream &operands); + TQPoint normalisePoint( + TQDataStream &operands); + TQSize normaliseSize( + TQDataStream &operands); void genericArc( - QString type, - QDataStream &operands); + TQString type, + TQDataStream &operands); // Opcode handling and painter methods. void walk( U32 words, - QDataStream &stream); + TQDataStream &stream); void skip( U32 words, - QDataStream &operands); + TQDataStream &operands); void invokeHandler( S16 opcode, U32 words, - QDataStream &operands); + TQDataStream &operands); /* // draw multiple polygons - void opPolypolygon(U32 words, QDataStream &operands); + void opPolypolygon(U32 words, TQDataStream &operands); */ - void opArc(U32 words, QDataStream &operands); + void opArc(U32 words, TQDataStream &operands); // create a logical brush - void opBrushCreateIndirect(U32 words, QDataStream &operands); - void opEllipse(U32 words, QDataStream &operands); + void opBrushCreateIndirect(U32 words, TQDataStream &operands); + void opEllipse(U32 words, TQDataStream &operands); // draw line to coord - void opLineTo(U32 words, QDataStream &operands); + void opLineTo(U32 words, TQDataStream &operands); // move pen to coord - void opMoveTo(U32 words, QDataStream &operands); + void opMoveTo(U32 words, TQDataStream &operands); // do nothing - void opNoop(U32 words, QDataStream &operands); + void opNoop(U32 words, TQDataStream &operands); // Free object handle - void opObjectDelete(U32 words, QDataStream &operands); + void opObjectDelete(U32 words, TQDataStream &operands); // Activate object handle - void opObjectSelect(U32 words, QDataStream &operands); + void opObjectSelect(U32 words, TQDataStream &operands); // create a logical pen - void opPenCreateIndirect(U32 words, QDataStream &operands); - void opPie(U32 words, QDataStream &operands); + void opPenCreateIndirect(U32 words, TQDataStream &operands); + void opPie(U32 words, TQDataStream &operands); // draw polygon - void opPolygon(U32 words, QDataStream &operands); + void opPolygon(U32 words, TQDataStream &operands); // set polygon fill mode - void opPolygonSetFillMode(U32 words, QDataStream &operands); + void opPolygonSetFillMode(U32 words, TQDataStream &operands); // draw series of lines - void opPolyline(U32 words, QDataStream &operands); - void opRectangle(U32 words, QDataStream &operands); + void opPolyline(U32 words, TQDataStream &operands); + void opRectangle(U32 words, TQDataStream &operands); // restore drawing context - void opRestoreDc(U32 words, QDataStream &operands); + void opRestoreDc(U32 words, TQDataStream &operands); // save drawing context - void opSaveDc(U32 words, QDataStream &operands); + void opSaveDc(U32 words, TQDataStream &operands); // set window origin - void opWindowSetOrg(U32 words, QDataStream &operands); + void opWindowSetOrg(U32 words, TQDataStream &operands); // set window extents - void opWindowSetExt(U32 words, QDataStream &operands); + void opWindowSetExt(U32 words, TQDataStream &operands); /* // set background pen color - void opsetBkColor(U32 words, QDataStream &operands); + void opsetBkColor(U32 words, TQDataStream &operands); // set background pen mode - void opsetBkMode(U32 words, QDataStream &operands); + void opsetBkMode(U32 words, TQDataStream &operands); // Set raster operation mode - void opsetRop(U32 words, QDataStream &operands); + void opsetRop(U32 words, TQDataStream &operands); // Escape (enhanced command set) - void opescape(U32 words, QDataStream &operands); + void opescape(U32 words, TQDataStream &operands); */ }; diff --git a/lib/kwmf/qwmf.cc b/lib/kwmf/qwmf.cc index 89e2f50f..a7451b46 100644 --- a/lib/kwmf/qwmf.cc +++ b/lib/kwmf/qwmf.cc @@ -19,12 +19,12 @@ #include <math.h> #include <assert.h> -#include <qfileinfo.h> -#include <qpixmap.h> -#include <qpainter.h> -#include <qdatastream.h> -#include <qapplication.h> -#include <qbuffer.h> +#include <tqfileinfo.h> +#include <tqpixmap.h> +#include <tqpainter.h> +#include <tqdatastream.h> +#include <tqapplication.h> +#include <tqbuffer.h> #include <kdebug.h> bool qwmfDebug = false; @@ -33,7 +33,7 @@ bool qwmfDebug = false; #include "wmfstruct.h" #include "metafuncs.h" -#define QWMF_DEBUG 0 +#define TQWMF_DEBUG 0 class WmfCmd @@ -50,59 +50,59 @@ public: class WinObjHandle { public: - virtual void apply( QPainter& p ) = 0; + virtual void apply( TQPainter& p ) = 0; }; class WinObjBrushHandle: public WinObjHandle { public: - virtual void apply( QPainter& p ); - QBrush brush; + virtual void apply( TQPainter& p ); + TQBrush brush; virtual ~WinObjBrushHandle() {}; }; class WinObjPenHandle: public WinObjHandle { public: - virtual void apply( QPainter& p ); - QPen pen; + virtual void apply( TQPainter& p ); + TQPen pen; virtual ~WinObjPenHandle() {}; }; class WinObjPatternBrushHandle: public WinObjHandle { public: - virtual void apply( QPainter& p ); - QBrush brush; - QPixmap image; + virtual void apply( TQPainter& p ); + TQBrush brush; + TQPixmap image; virtual ~WinObjPatternBrushHandle() {}; }; class WinObjFontHandle: public WinObjHandle { public: - virtual void apply( QPainter& p ); - QFont font; + virtual void apply( TQPainter& p ); + TQFont font; int rotation; virtual ~WinObjFontHandle() {}; }; -void WinObjBrushHandle::apply( QPainter& p ) +void WinObjBrushHandle::apply( TQPainter& p ) { p.setBrush( brush ); } -void WinObjPenHandle::apply( QPainter& p ) +void WinObjPenHandle::apply( TQPainter& p ) { p.setPen( pen ); } -void WinObjPatternBrushHandle::apply( QPainter& p ) +void WinObjPatternBrushHandle::apply( TQPainter& p ) { p.setBrush( brush ); } -void WinObjFontHandle::apply( QPainter& p ) +void WinObjFontHandle::apply( TQPainter& p ) { p.setFont( font ); } @@ -130,34 +130,34 @@ QWinMetaFile::~QWinMetaFile() //----------------------------------------------------------------------------- -bool QWinMetaFile::load( const QString &filename ) +bool QWinMetaFile::load( const TQString &filename ) { - QFile file( filename ); + TQFile file( filename ); if ( !file.exists() ) { - kdDebug() << "File " << QFile::encodeName(filename) << " does not exist" << endl; + kdDebug() << "File " << TQString(TQFile::encodeName(filename)) << " does not exist" << endl; return false; } if ( !file.open( IO_ReadOnly ) ) { - kdDebug() << "Cannot open file " << QFile::encodeName(filename) << endl; + kdDebug() << "Cannot open file " << TQString(TQFile::encodeName(filename)) << endl; return false; } - QByteArray ba = file.readAll(); + TQByteArray ba = file.readAll(); file.close(); - QBuffer buffer( ba ); + TQBuffer buffer( ba ); buffer.open( IO_ReadOnly ); return load( buffer ); } //----------------------------------------------------------------------------- -bool QWinMetaFile::load( QBuffer &buffer ) +bool QWinMetaFile::load( TQBuffer &buffer ) { - QDataStream st; + TQDataStream st; WmfEnhMetaHeader eheader; WmfMetaHeader header; WmfPlaceableHeader pheader; @@ -169,12 +169,12 @@ bool QWinMetaFile::load( QBuffer &buffer ) mTextAlign = 0; mRotation = 0; - mTextColor = Qt::black; + mTextColor = TQt::black; if ( mFirstCmd ) delete mFirstCmd; mFirstCmd = NULL; st.setDevice( &buffer ); - st.setByteOrder( QDataStream::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( QBuffer &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( QBuffer &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( QBuffer &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( QBuffer &buffer ) //----------------------------------------------------------------------------- -bool QWinMetaFile::paint( const QPaintDevice* aTarget, bool absolute ) +bool QWinMetaFile::paint( const TQPaintDevice* aTarget, bool absolute ) { int idx, i; WmfCmd* cmd; @@ -348,8 +348,8 @@ bool QWinMetaFile::paint( const QPaintDevice* aTarget, bool absolute ) mWinding = false; mAbsoluteCoord = absolute; - mPainter.begin( aTarget ); - if ( QWMF_DEBUG ) { + mPainter.tqbegin( const_cast<TQPaintDevice*>(aTarget) ); + if ( TQWMF_DEBUG ) { kdDebug() << "Bounding box : " << mBBox.left() << " " << mBBox.top() << " " << mBBox.right() << " " << mBBox.bottom() << endl; } @@ -364,8 +364,8 @@ bool QWinMetaFile::paint( const QPaintDevice* aTarget, bool absolute ) idx = cmd->funcIndex; ( this->*metaFuncTab[ idx ].method )( cmd->numParm, cmd->parm ); - if ( QWMF_DEBUG ) { - QString str = "", param; + if ( TQWMF_DEBUG ) { + TQString str = "", param; if ( metaFuncTab[ idx ].name == NULL ) { str += "UNKNOWN "; } @@ -384,12 +384,12 @@ bool QWinMetaFile::paint( const QPaintDevice* aTarget, bool absolute ) } } /* - // TODO: cleanup this code when QPicture::setBoundingBox() is possible in KOClipart (QT31) - // because actually QPicture::boundingBox() != mBBox() + // TODO: cleanup this code when TQPicture::setBoundingBox() is possible in KOClipart (QT31) + // because actually TQPicture::boundingBox() != mBBox() 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() ); } @@ -405,7 +405,7 @@ bool QWinMetaFile::paint( const QPaintDevice* aTarget, bool absolute ) void QWinMetaFile::setWindowOrg( long, short* parm ) { if ( mAbsoluteCoord ) { - QRect r = mPainter.window(); + TQRect r = mPainter.window(); mPainter.setWindow( parm[ 1 ], parm[ 0 ], r.width(), r.height() ); } else { @@ -423,14 +423,14 @@ void QWinMetaFile::setWindowOrg( long, short* parm ) //----------------------------------------------------------------------------- void QWinMetaFile::setWindowExt( long, short* parm ) { - // negative value allowed for width and height : QABS() forbidden + // negative value allowed for width and height : TQABS() forbidden if ( mAbsoluteCoord ) { - QRect r = mPainter.window(); + TQRect r = mPainter.window(); mPainter.setWindow( r.left(), r.top(), parm[ 1 ], parm[ 0 ] ); } else { if ( (parm[ 0 ] != 0) && (parm[ 1 ] != 0) ) { - QRect r = mPainter.window(); + TQRect r = mPainter.window(); double dx = mInternalWorldMatrix.dx(); double dy = mInternalWorldMatrix.dy(); double sx = mInternalWorldMatrix.m11(); @@ -479,44 +479,44 @@ void QWinMetaFile::ellipse( long, short* parm ) //----------------------------------------------------------------------------- void QWinMetaFile::polygon( long, short* parm ) { - QPointArray* pa; + TQPointArray* pa; pa = pointArray( parm[ 0 ], &parm[ 1 ] ); - mPainter.drawPolygon( *pa, mWinding ); + mPainter.tqdrawPolygon( *pa, mWinding ); } //----------------------------------------------------------------------------- void QWinMetaFile::polyPolygon( long, short* parm ) { - QRegion region; + TQRegion region; int i, j, startPolygon; mPainter.save(); // define clipping region - QRect win = bbox(); + TQRect win = bbox(); startPolygon = 1+parm[ 0 ]; for ( i=0 ; i < parm[ 0 ] ; i++ ) { - QPointArray pa1( parm[ 1+i ] ); + TQPointArray pa1( parm[ 1+i ] ); for ( j=0 ; j < parm[ 1+i ] ; j++) { pa1.setPoint ( j, parm[ startPolygon ], parm[ startPolygon+1 ] ); startPolygon += 2; } - QRegion r( pa1 ); + TQRegion r( pa1 ); region = region.eor( r ); } - mPainter.setClipRegion( region, QPainter::CoordPainter ); + mPainter.setClipRegion( region, TQPainter::CoordPainter ); // fill polygons 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 ); - QPointArray* pa; + TQPointArray* pa; int idxPolygon = 1 + parm[ 0 ]; for ( i=0 ; i < parm[ 0 ] ; i++ ) { pa = pointArray( parm[ 1+i ], &parm[ idxPolygon ] ); @@ -532,7 +532,7 @@ void QWinMetaFile::polyPolygon( long, short* parm ) //----------------------------------------------------------------------------- void QWinMetaFile::polyline( long, short* parm ) { - QPointArray* pa; + TQPointArray* pa; pa = pointArray( parm[ 0 ], &parm[ 1 ] ); mPainter.drawPolyline( *pa ); @@ -628,7 +628,7 @@ void QWinMetaFile::setBkMode( long, short* parm ) //----------------------------------------------------------------------------- void QWinMetaFile::setPixel( long, short* parm ) { - QPen pen = mPainter.pen(); + TQPen pen = mPainter.pen(); mPainter.setPen( color( parm ) ); mPainter.drawPoint( parm[ 3 ], parm[ 2 ] ); mPainter.setPen( pen ); @@ -638,7 +638,7 @@ void QWinMetaFile::setPixel( long, short* parm ) //----------------------------------------------------------------------------- void QWinMetaFile::setRop( long, short* parm ) { - mPainter.setRasterOp( winToQtRaster( parm[ 0 ] ) ); + mPainter.setRasterOp( winToTQtRaster( parm[ 0 ] ) ); } @@ -661,16 +661,16 @@ void QWinMetaFile::restoreDC( long, short *parm ) void QWinMetaFile::intersectClipRect( long, short* parm ) { /* TODO: better implementation : need QT 3.0.2 - QRegion region = mPainter.clipRegion(); + TQRegion region = mPainter.clipRegion(); if ( region.isEmpty() ) region = bbox(); */ - QRegion region( bbox() ); + TQRegion region( bbox() ); - QRegion newRegion( parm[ 3 ], parm[ 2 ], parm[ 1 ] - parm[ 3 ], parm[ 0 ] - parm[ 2 ] ); + TQRegion newRegion( parm[ 3 ], parm[ 2 ], parm[ 1 ] - parm[ 3 ], parm[ 0 ] - parm[ 2 ] ); region = region.intersect( newRegion ); - mPainter.setClipRegion( region, QPainter::CoordPainter ); + mPainter.setClipRegion( region, TQPainter::CoordPainter ); } @@ -678,16 +678,16 @@ void QWinMetaFile::intersectClipRect( long, short* parm ) void QWinMetaFile::excludeClipRect( long, short* parm ) { /* TODO: better implementation : need QT 3.0.2 - QRegion region = mPainter.clipRegion(); + TQRegion region = mPainter.clipRegion(); if ( region.isEmpty() ) region = bbox(); */ - QRegion region( bbox() ); + TQRegion region( bbox() ); - QRegion newRegion( parm[ 3 ], parm[ 2 ], parm[ 1 ] - parm[ 3 ], parm[ 0 ] - parm[ 2 ] ); + TQRegion newRegion( parm[ 3 ], parm[ 2 ], parm[ 1 ] - parm[ 3 ], parm[ 0 ] - parm[ 2 ] ); region = region.subtract( newRegion ); - mPainter.setClipRegion( region, QPainter::CoordPainter ); + mPainter.setClipRegion( region, TQPainter::CoordPainter ); } @@ -738,16 +738,16 @@ void QWinMetaFile::extTextOut( long num, short* parm ) else ptStr = (char*)&parm[ 4 ]; - QCString text( ptStr, parm[ 2 ] + 1 ); + TQCString text( ptStr, parm[ 2 ] + 1 ); - QFontMetrics fm( mPainter.font() ); + TQFontMetrics fm( mPainter.font() ); width = fm.width( text ) + fm.descent(); // because fm.width(text) isn't rigth with Italic text height = fm.height(); mPainter.save(); if ( mTextAlign & 0x01 ) { // (left, top) position = current logical position - QPoint pos = mPainter.pos(); + TQPoint pos = mPainter.pos(); x = pos.x(); y = pos.y(); } @@ -762,7 +762,7 @@ void QWinMetaFile::extTextOut( long num, short* parm ) mPainter.translate( -parm[ 1 ], -parm[ 0 ] ); } - // alignment + // tqalignment if ( mTextAlign & 0x06 ) x -= ( width / 2 ); if ( mTextAlign & 0x08 ) @@ -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(); @@ -795,21 +795,21 @@ void QWinMetaFile::extTextOut( long num, short* parm ) void QWinMetaFile::dibBitBlt( long num, short* parm ) { if ( num > 9 ) { // DIB image - QImage bmpSrc; + TQImage bmpSrc; 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(); if ( parm[ 5 ] < 0 ) { // width < 0 => 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 ); mPainter.setWorldMatrix( m, true ); } if ( parm[ 4 ] < 0 ) { // height < 0 => 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 ); mPainter.setWorldMatrix( m, true ); } mPainter.drawImage( parm[ 7 ], parm[ 6 ], bmpSrc, parm[ 3 ], parm[ 2 ], parm[ 5 ], parm[ 4 ] ); @@ -825,25 +825,25 @@ void QWinMetaFile::dibBitBlt( long num, short* parm ) //----------------------------------------------------------------------------- void QWinMetaFile::dibStretchBlt( long num, short* parm ) { - QImage bmpSrc; + 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(); if ( parm[ 7 ] < 0 ) { // width < 0 => 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 ); mPainter.setWorldMatrix( m, true ); } if ( parm[ 6 ] < 0 ) { // height < 0 => 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 ); mPainter.setWorldMatrix( m, true ); } bmpSrc = bmpSrc.copy( parm[ 5 ], parm[ 4 ], parm[ 3 ], parm[ 2 ] ); - // TODO: scale the bitmap ( QImage::scale(parm[ 7 ], parm[ 6 ]) is actually too slow ) + // TODO: scale the bitmap ( TQImage::scale(parm[ 7 ], parm[ 6 ]) is actually too slow ) mPainter.drawImage( parm[ 9 ], parm[ 8 ], bmpSrc ); mPainter.restore(); @@ -854,25 +854,25 @@ void QWinMetaFile::dibStretchBlt( long num, short* parm ) //----------------------------------------------------------------------------- void QWinMetaFile::stretchDib( long num, short* parm ) { - QImage bmpSrc; + 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(); if ( parm[ 8 ] < 0 ) { // width < 0 => 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 ); mPainter.setWorldMatrix( m, true ); } if ( parm[ 7 ] < 0 ) { // height < 0 => 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 ); mPainter.setWorldMatrix( m, true ); } bmpSrc = bmpSrc.copy( parm[ 6 ], parm[ 5 ], parm[ 4 ], parm[ 3 ] ); - // TODO: scale the bitmap ( QImage::scale(parm[ 8 ], parm[ 7 ]) is actually too slow ) + // TODO: scale the bitmap ( TQImage::scale(parm[ 8 ], parm[ 7 ]) is actually too slow ) mPainter.drawImage( parm[ 10 ], parm[ 9 ], bmpSrc ); mPainter.restore(); @@ -885,7 +885,7 @@ void QWinMetaFile::dibCreatePatternBrush( long num, short* parm ) { WinObjPatternBrushHandle* handle = new WinObjPatternBrushHandle; addHandle( handle ); - QImage bmpSrc; + TQImage bmpSrc; if ( dibToBmp( bmpSrc, (char*)&parm[ 2 ], (num - 2) * 2 ) ) { handle->image = bmpSrc; @@ -997,7 +997,7 @@ void QWinMetaFile::createPenIndirect( long, short* parm ) // TODO : width of pen proportional to device context width // DOESN'T WORK /* - QRect devRec; + TQRect devRec; devRec = mPainter.xForm( mBBox ); width = ( parm[ 0 ] * devRec.width() ) / mBBox.width() ; kdDebug() << "CreatePenIndirect: " << endl; @@ -1015,14 +1015,14 @@ void QWinMetaFile::createFontIndirect( long , short* parm) WinObjFontHandle* handle = new WinObjFontHandle; addHandle( handle ); - QString family( (const char*)&parm[ 9 ] ); + TQString family( (const char*)&parm[ 9 ] ); mRotation = -parm[ 2 ] / 10; // text rotation (in 1/10 degree) // TODO: memorisation of rotation in object Font 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) ); @@ -1074,7 +1074,7 @@ int QWinMetaFile::findFunc( unsigned short aFunc ) const } //----------------------------------------------------------------------------- -QPointArray* QWinMetaFile::pointArray( short num, short* parm ) +TQPointArray* QWinMetaFile::pointArray( short num, short* parm ) { int i; @@ -1109,7 +1109,7 @@ unsigned int QWinMetaFile::toDWord( short* parm ) //----------------------------------------------------------------------------- -QColor QWinMetaFile::color( short* parm ) +TQColor QWinMetaFile::color( short* parm ) { unsigned int colorRef; int red, green, blue; @@ -1119,7 +1119,7 @@ QColor QWinMetaFile::color( short* parm ) green = ( colorRef>>8 ) & 255; blue = ( colorRef>>16 ) & 255; - return QColor( red, green, blue ); + return TQColor( red, green, blue ); } @@ -1162,25 +1162,25 @@ void QWinMetaFile::deleteHandle( int idx ) } //----------------------------------------------------------------------------- -Qt::RasterOp QWinMetaFile::winToQtRaster( short parm ) const +TQt::RasterOp QWinMetaFile::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 QWinMetaFile::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( QImage& bmp, const char* dib, long size ) +bool QWinMetaFile::dibToBmp( TQImage& bmp, const char* dib, long size ) { typedef struct _BMPFILEHEADER { WORD bmType; @@ -1234,7 +1234,7 @@ bool QWinMetaFile::dibToBmp( QImage& bmp, const char* dib, long size ) int sizeBmp = size + 14; - QByteArray pattern( sizeBmp ); // BMP header and DIB data + TQByteArray pattern( sizeBmp ); // BMP header and DIB data pattern.fill(0); memcpy( &pattern[ 14 ], dib, size ); diff --git a/lib/kwmf/qwmf.h b/lib/kwmf/qwmf.h index 1787f4c8..3bc668c9 100644 --- a/lib/kwmf/qwmf.h +++ b/lib/kwmf/qwmf.h @@ -19,17 +19,17 @@ #ifndef qwmf_h #define qwmf_h -#include <qstring.h> -#include <qpainter.h> -#include <qwmatrix.h> -#include <qpointarray.h> -#include <qpen.h> -#include <qcolor.h> -#include <qimage.h> -#include <qrect.h> - -class QBuffer; -class QString; +#include <tqstring.h> +#include <tqpainter.h> +#include <tqwmatrix.h> +#include <tqpointarray.h> +#include <tqpen.h> +#include <tqcolor.h> +#include <tqimage.h> +#include <tqrect.h> + +class TQBuffer; +class TQString; class WmfCmd; class WinObjHandle; class WinObjPenHandle; @@ -40,11 +40,11 @@ struct WmfPlaceableHeader; * QWinMetaFile is a WMF viewer based on QT toolkit * How to use QWinMetaFile : * <pre> - * #include "qwmf.h" + *�#include "tqwmf.h" * QWinMetaFile wmf; - * QPicture pic; // or QImage pic; + * TQPicture pic; // or TQImage pic; * if ( wmf.load( filename ) - * wmf.paint( &pic ); + *� �wmf.paint( &pic ); * </pre> */ @@ -59,8 +59,8 @@ public: * Load WMF file. * @return true on success. */ - virtual bool load( const QString &fileName ); - virtual bool load( QBuffer &buffer ); + virtual bool load( const TQString &fileName ); + virtual bool load( TQBuffer &buffer ); /** * Paint metafile to given paint-device using absolute or relative coordinate. @@ -69,7 +69,7 @@ public: * * @return true on success. */ - virtual bool paint( const QPaintDevice* target, bool absolute=false ); + virtual bool paint( const TQPaintDevice* target, bool absolute=false ); /** * @return true if the metafile is placeable. @@ -84,7 +84,7 @@ public: /** * @return bounding rectangle */ - QRect bbox( void ) const { return mBBox; } + TQRect bbox( void ) const { return mBBox; } public: // should be protected but cannot /* Metafile painter methods */ @@ -139,7 +139,7 @@ public: // should be protected but cannot /****************** Text *******************/ /** set text color */ void setTextColor( long num, short* parms ); - /** set text alignment */ + /** set text tqalignment */ void setTextAlign( long num, short* parms ); /** draw text */ void textOut( long num, short* parms ); @@ -185,10 +185,10 @@ protected: virtual int findFunc( unsigned short aFunc ) const; /** Fills given parms into mPoints. */ - QPointArray* pointArray( short num, short* parms ); + TQPointArray* pointArray( short num, short* parms ); /** Returns color given by the two parameters */ - QColor color( short* parm ); + TQColor color( short* parm ); /** Converts two parameters to long */ unsigned int toDWord( short* parm ); @@ -201,30 +201,30 @@ protected: void deleteHandle( int ); /** Convert windows rasterOp in QT rasterOp */ - Qt::RasterOp winToQtRaster( short parm ) const; - Qt::RasterOp winToQtRaster( long parm ) const; + TQt::RasterOp winToTQtRaster( short parm ) const; + TQt::RasterOp winToTQtRaster( long parm ) const; /** Converts DIB to BMP */ - bool dibToBmp( QImage& bmp, const char* dib, long size); + bool dibToBmp( TQImage& bmp, const char* dib, long size); protected: - QPainter mPainter; + TQPainter mPainter; bool mIsPlaceable, mIsEnhanced, mValid; // coordinate system bool mAbsoluteCoord; - QWMatrix mInternalWorldMatrix; // memorisation of WMF matrix transformation - QRect mHeaderBoundingBox; - QRect mBBox; + TQWMatrix mInternalWorldMatrix; // memorisation of WMF matrix transformation + TQRect mHeaderBoundingBox; + TQRect mBBox; // information shared between Metafile Functions - QColor mTextColor; + TQColor mTextColor; int mTextAlign, mRotation; bool mWinding; WmfCmd* mFirstCmd; WinObjHandle** mObjHandleTab; - QPointArray mPoints; + TQPointArray mPoints; int mDpi; }; diff --git a/lib/kwmf/wmfstruct.h b/lib/kwmf/wmfstruct.h index ca4f1f7d..33a4a67c 100644 --- a/lib/kwmf/wmfstruct.h +++ b/lib/kwmf/wmfstruct.h @@ -6,7 +6,7 @@ typedef short WORD; typedef int DWORD; -typedef Q_INT32 LONG; +typedef TQ_INT32 LONG; typedef void* _HANDLE; typedef struct _RECT @@ -53,7 +53,7 @@ struct WmfEnhMetaHeader WORD nHandles; // Number of handles in the handle table // Handle index zero is reserved. WORD sReserved; // Reserved. Must be zero. - DWORD nDescription; // Number of chars in the unicode description string + DWORD nDescription; // Number of chars in the tqunicode description string // This is 0 if there is no description string DWORD offDescription; // Offset to the metafile description record. // This is 0 if there is no description string |