summaryrefslogtreecommitdiffstats
path: root/filters/karbon/wmf
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /filters/karbon/wmf
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-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 'filters/karbon/wmf')
-rw-r--r--filters/karbon/wmf/wmfexport.cc24
-rw-r--r--filters/karbon/wmf/wmfexport.h19
-rw-r--r--filters/karbon/wmf/wmfimport.cc12
-rw-r--r--filters/karbon/wmf/wmfimport.h5
-rw-r--r--filters/karbon/wmf/wmfimportparser.cc56
-rw-r--r--filters/karbon/wmf/wmfimportparser.h48
6 files changed, 83 insertions, 81 deletions
diff --git a/filters/karbon/wmf/wmfexport.cc b/filters/karbon/wmf/wmfexport.cc
index 5f1e94d7..a04dfc11 100644
--- a/filters/karbon/wmf/wmfexport.cc
+++ b/filters/karbon/wmf/wmfexport.cc
@@ -17,8 +17,8 @@
*/
#include <config.h>
-#include <qdom.h>
-#include <qcstring.h>
+#include <tqdom.h>
+#include <tqcstring.h>
#include <kdebug.h>
#include <kgenericfactory.h>
#include <KoFilterChain.h>
@@ -48,7 +48,7 @@ typedef KGenericFactory<WmfExport, KoFilter> WmfExportFactory;
K_EXPORT_COMPONENT_FACTORY( libwmfexport, WmfExportFactory( "kofficefilters" ) )
-WmfExport::WmfExport( KoFilter *, const char *, const QStringList&) :
+WmfExport::WmfExport( KoFilter *, const char *, const TQStringList&) :
KoFilter()
{
}
@@ -57,7 +57,7 @@ WmfExport::~WmfExport()
{
}
-KoFilter::ConversionStatus WmfExport::convert( const QCString& from, const QCString& to )
+KoFilter::ConversiontqStatus WmfExport::convert( const TQCString& from, const TQCString& to )
{
if( to != "image/x-wmf" || from != "application/x-karbon" ) {
return KoFilter::NotImplemented;
@@ -76,9 +76,9 @@ KoFilter::ConversionStatus WmfExport::convert( const QCString& from, const QCStr
return KoFilter::WrongFormat;
}
- QDomDocument domIn;
+ TQDomDocument domIn;
domIn.setContent( storeIn );
- QDomElement docNode = domIn.documentElement();
+ TQDomElement docNode = domIn.documentElement();
// Load the document.
mDoc = new VDocument;
@@ -123,8 +123,8 @@ void WmfExport::visitVDocument( VDocument& document ) {
void WmfExport::visitVPath( VPath& composite ) {
- QPen pen;
- QBrush brush;
+ TQPen pen;
+ TQBrush brush;
getPen( pen, composite.stroke() );
getBrush( brush, composite.fill() );
@@ -133,7 +133,7 @@ void WmfExport::visitVPath( VPath& composite ) {
if ( mListPa.count() > 0 ) {
mWmf->setPen( pen );
- if( (brush.style() == Qt::NoBrush)
+ if( (brush.style() == TQt::NoBrush)
&& (mListPa.count() == 1) ) {
mWmf->drawPolyline( *mListPa.first() );
}
@@ -158,7 +158,7 @@ void WmfExport::visitVSubpath( VSubpath& path ) {
VSubpath *newPath;
VSubpathIterator itr( path );
VFlattenCmd cmd( 0L, INCH_TO_POINT(0.3 / (double)mDpi) );
- QPointArray *pa = new QPointArray( path.count() );
+ TQPointArray *pa = new TQPointArray( path.count() );
int nbrPoint=0; // number of points in the path
for( ; itr.current(); ++itr ) {
@@ -221,7 +221,7 @@ void WmfExport::visitVText( VText& text ) {
}
-void WmfExport::getBrush( QBrush& brush, const VFill *fill ) {
+void WmfExport::getBrush( TQBrush& brush, const VFill *fill ) {
if( (fill->type() == VFill::solid) || (fill->type() == VFill::grad)
|| (fill->type() == VFill::patt) ) {
if ( fill->color().opacity() < 0.1 ) {
@@ -238,7 +238,7 @@ void WmfExport::getBrush( QBrush& brush, const VFill *fill ) {
}
-void WmfExport::getPen( QPen& pen, const VStroke *stroke ) {
+void WmfExport::getPen( TQPen& pen, const VStroke *stroke ) {
if( (stroke->type() == VStroke::solid) || (stroke->type() == VStroke::grad)
|| (stroke->type() == VStroke::patt) ) {
// TODO : Dash pattern.
diff --git a/filters/karbon/wmf/wmfexport.h b/filters/karbon/wmf/wmfexport.h
index 8f107ee0..9d7bf9cb 100644
--- a/filters/karbon/wmf/wmfexport.h
+++ b/filters/karbon/wmf/wmfexport.h
@@ -19,10 +19,10 @@
#ifndef WMFEXPORT_H
#define WMFEXPORT_H
-#include <qpen.h>
-#include <qbrush.h>
-#include <qptrlist.h>
-#include <qpointarray.h>
+#include <tqpen.h>
+#include <tqbrush.h>
+#include <tqptrlist.h>
+#include <tqpointarray.h>
#include <KoFilter.h>
#include "vvisitor.h"
@@ -35,20 +35,21 @@ class VText;
class WmfExport : public KoFilter, private VVisitor
{
Q_OBJECT
+ TQ_OBJECT
public:
- WmfExport( KoFilter *parent, const char *name, const QStringList&);
+ WmfExport( KoFilter *tqparent, const char *name, const TQStringList&);
virtual ~WmfExport();
- virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to );
+ virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to );
private:
void visitVPath( VPath& composite );
void visitVDocument( VDocument& document );
void visitVSubpath( VSubpath& path );
void visitVText( VText& text );
- void getBrush( QBrush& brush, const VFill *fill );
- void getPen( QPen& pen, const VStroke *stroke );
+ void getBrush( TQBrush& brush, const VFill *fill );
+ void getPen( TQPen& pen, const VStroke *stroke );
// coordinate transformation
// translate origin from (left,bottom) to (left,top) -> scale to wmf size
@@ -65,7 +66,7 @@ private:
int mDpi;
double mScaleX;
double mScaleY;
- QPtrList<QPointArray> mListPa;
+ TQPtrList<TQPointArray> mListPa;
};
#endif
diff --git a/filters/karbon/wmf/wmfimport.cc b/filters/karbon/wmf/wmfimport.cc
index eadad26b..23eaaa12 100644
--- a/filters/karbon/wmf/wmfimport.cc
+++ b/filters/karbon/wmf/wmfimport.cc
@@ -21,8 +21,8 @@ DESCRIPTION
*/
#include <config.h>
-#include <qdom.h>
-#include <qcstring.h>
+#include <tqdom.h>
+#include <tqcstring.h>
#include <kdebug.h>
#include <kgenericfactory.h>
#include <KoFilterChain.h>
@@ -36,7 +36,7 @@ typedef KGenericFactory<WMFImport, KoFilter> WMFImportFactory;
K_EXPORT_COMPONENT_FACTORY( libwmfimport, WMFImportFactory( "kofficefilters" ) )
-WMFImport::WMFImport( KoFilter *, const char *, const QStringList&) :
+WMFImport::WMFImport( KoFilter *, const char *, const TQStringList&) :
KoFilter()
{
}
@@ -45,7 +45,7 @@ WMFImport::~WMFImport()
{
}
-KoFilter::ConversionStatus WMFImport::convert( const QCString& from, const QCString& to )
+KoFilter::ConversiontqStatus WMFImport::convert( const TQCString& from, const TQCString& to )
{
if( to != "application/x-karbon" || from != "image/x-wmf" )
return KoFilter::NotImplemented;
@@ -66,8 +66,8 @@ KoFilter::ConversionStatus WMFImport::convert( const QCString& from, const QCStr
kdError(3800) << "Unable to open output file!" << endl;
return KoFilter::StorageCreationError;
}
- QDomDocument outdoc = document.saveXML();
- QCString content = outdoc.toCString();
+ TQDomDocument outdoc = document.saveXML();
+ TQCString content = outdoc.toCString();
// kdDebug() << " content : " << content << endl;
out->writeBlock( content , content.length() );
diff --git a/filters/karbon/wmf/wmfimport.h b/filters/karbon/wmf/wmfimport.h
index e1290422..45ddefec 100644
--- a/filters/karbon/wmf/wmfimport.h
+++ b/filters/karbon/wmf/wmfimport.h
@@ -30,12 +30,13 @@ DESCRIPTION
class WMFImport : public KoFilter
{
Q_OBJECT
+ TQ_OBJECT
public:
- WMFImport( KoFilter *parent, const char *name, const QStringList&);
+ WMFImport( KoFilter *tqparent, const char *name, const TQStringList&);
virtual ~WMFImport();
- virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to );
+ virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to );
};
diff --git a/filters/karbon/wmf/wmfimportparser.cc b/filters/karbon/wmf/wmfimportparser.cc
index 2eb380a4..275490fe 100644
--- a/filters/karbon/wmf/wmfimportparser.cc
+++ b/filters/karbon/wmf/wmfimportparser.cc
@@ -47,7 +47,7 @@ bool WMFImportParser::play( VDocument& doc )
// Virtual Painter
bool WMFImportParser::begin() {
- QRect bounding = boundingRect();
+ TQRect bounding = boundingRect();
mBackgroundMode = Qt::TransparentMode;
mCurrentOrg.setX( bounding.left() );
@@ -87,26 +87,26 @@ void WMFImportParser::restore() {
}
-void WMFImportParser::setFont( const QFont & ) {
+void WMFImportParser::setFont( const TQFont & ) {
}
-void WMFImportParser::setPen( const QPen &pen ) {
+void WMFImportParser::setPen( const TQPen &pen ) {
mPen = pen;
}
-const QPen &WMFImportParser::pen() const {
+const TQPen &WMFImportParser::pen() const {
return mPen;
}
-void WMFImportParser::setBrush( const QBrush &brush ) {
+void WMFImportParser::setBrush( const TQBrush &brush ) {
mBrush = brush;
}
-void WMFImportParser::setBackgroundColor( const QColor &c ) {
+void WMFImportParser::setBackgroundColor( const TQColor &c ) {
mBackgroundColor = c;
}
@@ -116,7 +116,7 @@ void WMFImportParser::setBackgroundMode( Qt::BGMode mode ) {
}
-void WMFImportParser::setRasterOp( Qt::RasterOp ) {
+void WMFImportParser::setRasterOp( TQt::RasterOp ) {
}
@@ -135,15 +135,15 @@ void WMFImportParser::setWindowExt( int width, int height ) {
}
-void WMFImportParser::setWorldMatrix( const QWMatrix &, bool ) {
+void WMFImportParser::setWorldMatrix( const TQWMatrix &, bool ) {
}
-void WMFImportParser::setClipRegion( const QRegion & ) {
+void WMFImportParser::setClipRegion( const TQRegion & ) {
}
-QRegion WMFImportParser::clipRegion() {
+TQRegion WMFImportParser::clipRegion() {
return mClippingRegion;
}
@@ -241,7 +241,7 @@ void WMFImportParser::drawChord( int x, int y, int w, int h, int aStart, int aLe
}
-void WMFImportParser::drawPolyline( const QPointArray &pa ) {
+void WMFImportParser::drawPolyline( const TQPointArray &pa ) {
VPath *polyline = new VPath( mDoc );
appendPen( *polyline );
appendPoints( *polyline, pa );
@@ -250,7 +250,7 @@ void WMFImportParser::drawPolyline( const QPointArray &pa ) {
}
-void WMFImportParser::drawPolygon( const QPointArray &pa, bool ) {
+void WMFImportParser::drawPolygon( const TQPointArray &pa, bool ) {
VPath *polygon = new VPath( mDoc );
appendPen( *polygon );
appendBrush( *polygon );
@@ -261,7 +261,7 @@ void WMFImportParser::drawPolygon( const QPointArray &pa, bool ) {
}
-void WMFImportParser::drawPolyPolygon( QPtrList<QPointArray>& listPa, bool ) {
+void WMFImportParser::drawPolyPolygon( TQPtrList<TQPointArray>& listPa, bool ) {
VPath *path = new VPath( mDoc );
if ( listPa.count() > 0 ) {
@@ -282,10 +282,10 @@ void WMFImportParser::drawPolyPolygon( QPtrList<QPointArray>& listPa, bool ) {
}
-void WMFImportParser::drawImage( int , int , const QImage &, int , int , int , int ) {}
+void WMFImportParser::drawImage( int , int , const TQImage &, int , int , int , int ) {}
-void WMFImportParser::drawText( int , int , int , int , int , const QString& , double ) {}
+void WMFImportParser::drawText( int , int , int , int , int , const TQString& , double ) {}
//-----------------------------------------------------------------------------
@@ -296,30 +296,30 @@ void WMFImportParser::appendPen( VObject& obj )
VStroke stroke( mDoc );
stroke.setLineCap( VStroke::capRound );
- if ( mPen.style() == Qt::NoPen ) {
+ if ( mPen.style() == TQt::NoPen ) {
stroke.setType( VStroke::none );
}
else {
- QValueList<float> dashes;
+ TQValueList<float> dashes;
stroke.setType( VStroke::solid );
switch ( mPen.style() ) {
- case Qt::DashLine :
+ case TQt::DashLine :
stroke.dashPattern().setArray( dashes << MM_TO_POINT(3) << MM_TO_POINT(2) );
break;
- case Qt::DotLine :
+ case TQt::DotLine :
stroke.dashPattern().setArray( dashes << MM_TO_POINT(1) << MM_TO_POINT(1) );
break;
- case Qt::DashDotLine :
+ case TQt::DashDotLine :
stroke.dashPattern().setArray( dashes << MM_TO_POINT(3) << MM_TO_POINT(1) << MM_TO_POINT(1) << MM_TO_POINT(1) );
break;
- case Qt::DashDotDotLine :
+ case TQt::DashDotDotLine :
stroke.dashPattern().setArray( dashes << MM_TO_POINT(3) << MM_TO_POINT(1) << MM_TO_POINT(1) << MM_TO_POINT(1) << MM_TO_POINT(1) << MM_TO_POINT(1) );
break;
default:
break;
}
}
- stroke.setColor( mPen.color() );
+ stroke.setColor( TQColor(mPen.color()) );
double width = mPen.width() * mScaleX;
stroke.setLineWidth( ((width < 0.99) ? 1 : width) );
obj.setStroke( stroke );
@@ -329,23 +329,23 @@ void WMFImportParser::appendPen( VObject& obj )
void WMFImportParser::appendBrush( VObject& obj )
{
VFill fill( mBackgroundColor );
- fill.setColor( mBrush.color() );
+ fill.setColor( TQColor(mBrush.color()) );
switch ( mBrush.style() ) {
- case Qt::NoBrush :
+ case TQt::NoBrush :
fill.setType( VFill::none );
break;
- case Qt::SolidPattern :
+ case TQt::SolidPattern :
fill.setType( VFill::solid );
break;
- case Qt::CustomPattern :
+ case TQt::CustomPattern :
// TODO: bitmap pattern brush
fill.setType( VFill::solid );
//fill.pattern().
break;
default :
// TODO: pattern brush
- if ( mBackgroundMode == Qt::OpaqueMode ) {
+ if ( mBackgroundMode == TQt::OpaqueMode ) {
fill.setColor( mBackgroundColor );
fill.setType( VFill::solid );
}
@@ -358,7 +358,7 @@ void WMFImportParser::appendBrush( VObject& obj )
}
-void WMFImportParser::appendPoints(VPath &path, const QPointArray& pa)
+void WMFImportParser::appendPoints(VPath &path, const TQPointArray& pa)
{
// list of point array
if ( pa.size() > 0 ) {
diff --git a/filters/karbon/wmf/wmfimportparser.h b/filters/karbon/wmf/wmfimportparser.h
index fcb1fbe2..4e904d7f 100644
--- a/filters/karbon/wmf/wmfimportparser.h
+++ b/filters/karbon/wmf/wmfimportparser.h
@@ -18,8 +18,8 @@
#ifndef _WMFIMPORTPARSER_H_
#define _WMFIMPORTPARSER_H_
-#include <qpainter.h>
-#include <qdom.h>
+#include <tqpainter.h>
+#include <tqdom.h>
#include <core/vdocument.h>
#include <core/vcomposite.h>
#include <kowmfread.h>
@@ -45,23 +45,23 @@ public:
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
@@ -75,8 +75,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 );
@@ -87,29 +87,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
// 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 );
//-----------------------------------------------------------------------------
// Utilities
// Add pen, brush and points to a path
void appendPen( VObject& obj );
void appendBrush( VObject& obj );
- void appendPoints(VPath& path, const QPointArray& pa);
+ void appendPoints(VPath& path, const TQPointArray& pa);
// coordinate transformation
// translate wmf to (0,0) -> scale to document size -> translate to karbon (0,0)
// Wmf origin is (left,top) corner
@@ -125,17 +125,17 @@ private:
private:
VDocument *mDoc;
- QRegion mClippingRegion;
- QPen mPen;
- QBrush mBrush;
+ TQRegion mClippingRegion;
+ TQPen mPen;
+ TQBrush mBrush;
Qt::BGMode mBackgroundMode;
- QColor mBackgroundColor;
+ TQColor mBackgroundColor;
// current origin of WMF logical coordinate
- QPoint mCurrentOrg;
+ TQPoint mCurrentOrg;
double mScaleX;
double mScaleY;
// current position in WMF coordinate (INT16)
- QPoint mCurrentPoint;
+ TQPoint mCurrentPoint;
};
#endif