summaryrefslogtreecommitdiffstats
path: root/filters/karbon/xaml
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/xaml
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/xaml')
-rw-r--r--filters/karbon/xaml/color.h4
-rw-r--r--filters/karbon/xaml/xamlexport.cc60
-rw-r--r--filters/karbon/xaml/xamlexport.h23
-rw-r--r--filters/karbon/xaml/xamlgraphiccontext.h6
-rw-r--r--filters/karbon/xaml/xamlimport.cc234
-rw-r--r--filters/karbon/xaml/xamlimport.h55
6 files changed, 192 insertions, 190 deletions
diff --git a/filters/karbon/xaml/color.h b/filters/karbon/xaml/color.h
index bfdc93c6..49bc2e52 100644
--- a/filters/karbon/xaml/color.h
+++ b/filters/karbon/xaml/color.h
@@ -6,7 +6,7 @@
g = green; \
}
-void keywordToRGB( QString rgbColor, int &r, int &g, int &b )
+void keywordToRGB( TQString rgbColor, int &r, int &g, int &b )
{
if( rgbColor == "aliceblue" )
TORGB( 240, 248, 255)
@@ -206,7 +206,7 @@ void keywordToRGB( QString rgbColor, int &r, int &g, int &b )
TORGB( 245, 255, 250 )
else if( rgbColor == "mistyrose" )
TORGB( 255, 228, 225 )
- else if( rgbColor == "moccasin" )
+ else if( rgbColor == "tqmoccasin" )
TORGB( 255, 228, 181 )
else if( rgbColor == "navajowhite" )
TORGB( 255, 222, 173 )
diff --git a/filters/karbon/xaml/xamlexport.cc b/filters/karbon/xaml/xamlexport.cc
index c4ccb467..09dda268 100644
--- a/filters/karbon/xaml/xamlexport.cc
+++ b/filters/karbon/xaml/xamlexport.cc
@@ -20,11 +20,11 @@
// based on the SVG exporter. Not intended for public release
// Microsoft WVG renamed to XAML Graphics. Worry about that later.
-#include <qcstring.h>
-#include <qdom.h>
-#include <qfile.h>
-#include <qstring.h>
-#include <qvaluelist.h>
+#include <tqcstring.h>
+#include <tqdom.h>
+#include <tqfile.h>
+#include <tqstring.h>
+#include <tqvaluelist.h>
#include <kgenericfactory.h>
#include <KoFilter.h>
@@ -54,14 +54,14 @@ typedef KGenericFactory<XAMLExport, KoFilter> XAMLExportFactory;
K_EXPORT_COMPONENT_FACTORY( libkarbonxamlexport, XAMLExportFactory( "kofficefilters" ) )
-XAMLExport::XAMLExport( KoFilter*, const char*, const QStringList& )
+XAMLExport::XAMLExport( KoFilter*, const char*, const TQStringList& )
: KoFilter()
{
m_gc.setAutoDelete( true );
}
-KoFilter::ConversionStatus
-XAMLExport::convert( const QCString& from, const QCString& to )
+KoFilter::ConversiontqStatus
+XAMLExport::convert( const TQCString& from, const TQCString& to )
{
// TODO: ???
if ( to != "image/wvg+xml" || from != "application/x-karbon" )
@@ -73,22 +73,22 @@ XAMLExport::convert( const QCString& from, const QCString& to )
if( !storeIn )
return KoFilter::StupidError;
- QFile fileOut( m_chain->outputFile() );
+ TQFile fileOut( m_chain->outputFile() );
if( !fileOut.open( IO_WriteOnly ) )
{
delete storeIn;
return KoFilter::StupidError;
}
- QDomDocument domIn;
+ TQDomDocument domIn;
domIn.setContent( storeIn );
- QDomElement docNode = domIn.documentElement();
+ TQDomElement docNode = domIn.documentElement();
- m_stream = new QTextStream( &fileOut );
- QString body;
- m_body = new QTextStream( &body, IO_ReadWrite );
- QString defs;
- m_defs = new QTextStream( &defs, IO_ReadWrite );
+ m_stream = new TQTextStream( &fileOut );
+ TQString body;
+ m_body = new TQTextStream( &body, IO_ReadWrite );
+ TQString defs;
+ m_defs = new TQTextStream( &defs, IO_ReadWrite );
// load the document and export it:
@@ -157,12 +157,12 @@ XAMLExport::visitVDocument( VDocument& document )
*m_body << "</Canvas>" << endl;
}
-QString
+TQString
XAMLExport::getID( VObject *obj )
{
if( obj && !obj->name().isEmpty() )
- return QString( " Name=\"%1\"" ).arg( obj->name() );
- return QString();
+ return TQString( " Name=\"%1\"" ).tqarg( obj->name() );
+ return TQString();
}
// which markup to use? Group or Canvas?
@@ -185,7 +185,7 @@ XAMLExport::visitVPath( VPath& composite )
getFill( *( composite.fill() ) );
getStroke( *( composite.stroke() ) );
- QString d;
+ TQString d;
composite.saveSvgPath( d );
*m_body << " Data=\"" << d << "\" ";
@@ -205,22 +205,22 @@ XAMLExport::visitVSubpath( VSubpath& )
{
}
-QString createUID()
+TQString createUID()
{
static unsigned int nr = 0;
- return "defitem" + QString().setNum( nr++ );
+ return "defitem" + TQString().setNum( nr++ );
}
void
-XAMLExport::getColorStops( const QPtrVector<VColorStop> &colorStops )
+XAMLExport::getColorStops( const TQPtrVector<VColorStop> &colorStops )
{
for( unsigned int i = 0; i < colorStops.count() ; i++ )
{
*m_defs << "<GradientStop Color=\"";
getHexColor( m_defs, colorStops.at( i )->color );
- *m_defs << "\" Offset=\"" << QString().setNum( colorStops.at( i )->rampPoint );
- // XAML uses ARGB values and other methods such as masks for Transparency/Opacity # aa rrggbb
+ *m_defs << "\" Offset=\"" << TQString().setNum( colorStops.at( i )->rampPoint );
+ // XAML uses ARGB values and other methods such as tqmasks for Transparency/Opacity # aa rrggbb
// *m_defs << "\" stop-opacity=\"" << colorStops.at( i )->color.opacity() << "\"" << " />" << endl;
// Maybe this only applies to gradients, need to check.
}
@@ -229,7 +229,7 @@ XAMLExport::getColorStops( const QPtrVector<VColorStop> &colorStops )
void
XAMLExport::getGradient( const VGradient& grad )
{
- QString uid = createUID();
+ TQString uid = createUID();
if( grad.type() == VGradient::linear )
{
// do linear grad
@@ -262,7 +262,7 @@ XAMLExport::getGradient( const VGradient& grad )
*m_defs << "GradientOrigin=\"" << grad.focalPoint().x() << ",";
*m_defs << grad.focalPoint().y() << "\" ";
double r = sqrt( pow( grad.vector().x() - grad.origin().x(), 2 ) + pow( grad.vector().y() - grad.origin().y(), 2 ) );
- *m_defs << "Radius=\"" << QString().setNum( r ) << "\" ";
+ *m_defs << "Radius=\"" << TQString().setNum( r ) << "\" ";
if( grad.repeatMethod() == VGradient::reflect )
*m_defs << "SpreadMethod=\"Reflect\" ";
else if( grad.repeatMethod() == VGradient::repeat )
@@ -343,7 +343,7 @@ XAMLExport::getStroke( const VStroke& stroke )
*m_body << " StrokeDashOffset=\"" << stroke.dashPattern().offset() << "\"";
*m_body << " StrokeDashArray=\" ";
- QValueListConstIterator<float> itr;
+ TQValueListConstIterator<float> itr;
for(itr = stroke.dashPattern().array().begin(); itr != stroke.dashPattern().array().end(); ++itr )
{
*m_body << *itr << " ";
@@ -353,11 +353,11 @@ XAMLExport::getStroke( const VStroke& stroke )
}
void
-XAMLExport::getHexColor( QTextStream *stream, const VColor& color )
+XAMLExport::getHexColor( TQTextStream *stream, const VColor& color )
{
// Convert the various color-spaces to hex
- QString Output;
+ TQString Output;
VColor copy( color );
copy.setColorSpace( VColor::rgb );
diff --git a/filters/karbon/xaml/xamlexport.h b/filters/karbon/xaml/xamlexport.h
index 3d2701c6..cb762a8d 100644
--- a/filters/karbon/xaml/xamlexport.h
+++ b/filters/karbon/xaml/xamlexport.h
@@ -27,9 +27,9 @@
#include "xamlgraphiccontext.h"
-#include <qptrstack.h>
+#include <tqptrstack.h>
-class QTextStream;
+class TQTextStream;
class VColor;
class VPath;
class VDocument;
@@ -44,12 +44,13 @@ class VText;
class XAMLExport : public KoFilter, private VVisitor
{
Q_OBJECT
+ TQ_OBJECT
public:
- XAMLExport( KoFilter* parent, const char* name, const QStringList& );
+ XAMLExport( KoFilter* tqparent, const char* name, const TQStringList& );
virtual ~XAMLExport() {}
- virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to );
+ virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to );
private:
virtual void visitVPath( VPath& composite );
@@ -59,17 +60,17 @@ private:
//virtual void visitVText( VText& text );
void getStroke( const VStroke& stroke );
- void getColorStops( const QPtrVector<VColorStop> &colorStops );
+ void getColorStops( const TQPtrVector<VColorStop> &colorStops );
void getFill( const VFill& fill );
void getGradient( const VGradient& grad );
- void getHexColor( QTextStream *, const VColor& color );
- QString getID( VObject *obj );
+ void getHexColor( TQTextStream *, const VColor& color );
+ TQString getID( VObject *obj );
- QTextStream* m_stream;
- QTextStream* m_defs;
- QTextStream* m_body;
+ TQTextStream* m_stream;
+ TQTextStream* m_defs;
+ TQTextStream* m_body;
- QPtrStack<XAMLGraphicsContext> m_gc;
+ TQPtrStack<XAMLGraphicsContext> m_gc;
};
#endif
diff --git a/filters/karbon/xaml/xamlgraphiccontext.h b/filters/karbon/xaml/xamlgraphiccontext.h
index db4a8363..8f298138 100644
--- a/filters/karbon/xaml/xamlgraphiccontext.h
+++ b/filters/karbon/xaml/xamlgraphiccontext.h
@@ -33,14 +33,14 @@ public:
stroke.setLineWidth( 1.0 );
stroke.setLineCap( VStroke::capButt );
stroke.setLineJoin( VStroke::joinMiter );
- fill.setColor( VColor( Qt::black ) );
+ fill.setColor( VColor( TQt::black ) );
fillRule = winding;
}
VFill fill;
VFillRule fillRule;
VStroke stroke;
- QWMatrix matrix;
- QFont font;
+ TQWMatrix matrix;
+ TQFont font;
};
#endif
diff --git a/filters/karbon/xaml/xamlimport.cc b/filters/karbon/xaml/xamlimport.cc
index 297ff68d..b7f68bbb 100644
--- a/filters/karbon/xaml/xamlimport.cc
+++ b/filters/karbon/xaml/xamlimport.cc
@@ -24,9 +24,9 @@
#include <kdebug.h>
#include <KoUnit.h>
#include <KoGlobal.h>
-#include <shapes/vellipse.h>
-#include <shapes/vrectangle.h>
-#include <shapes/vpolygon.h>
+#include <tqshapes/vellipse.h>
+#include <tqshapes/vrectangle.h>
+#include <tqshapes/vpolygon.h>
#include <commands/vtransformcmd.h>
#include <core/vsegment.h>
#include <core/vtext.h>
@@ -34,14 +34,14 @@
#include <core/vgroup.h>
#include <core/vimage.h>
#include <core/vlayer.h>
-#include <qcolor.h>
-#include <qfile.h>
+#include <tqcolor.h>
+#include <tqfile.h>
#include <kfilterdev.h>
typedef KGenericFactory<XAMLImport, KoFilter> XAMLImportFactory;
K_EXPORT_COMPONENT_FACTORY( libkarbonxamlimport, XAMLImportFactory( "kofficefilters" ) )
-XAMLImport::XAMLImport(KoFilter *, const char *, const QStringList&) :
+XAMLImport::XAMLImport(KoFilter *, const char *, const TQStringList&) :
KoFilter(),
outdoc( "DOC" )
{
@@ -52,22 +52,22 @@ XAMLImport::~XAMLImport()
{
}
-KoFilter::ConversionStatus XAMLImport::convert(const QCString& from, const QCString& to)
+KoFilter::ConversiontqStatus XAMLImport::convert(const TQCString& from, const TQCString& to)
{
// check for proper conversion
if( to != "application/x-karbon" || from != "image/wvg+xml" )
return KoFilter::NotImplemented;
//Find the last extension
- QString strExt;
- QString fileIn ( m_chain->inputFile() );
- const int result=fileIn.findRev('.');
+ TQString strExt;
+ TQString fileIn ( m_chain->inputFile() );
+ const int result=fileIn.tqfindRev('.');
if (result>=0)
{
strExt=fileIn.mid(result).lower();
}
- QString strMime; // Mime type of the compressor
+ TQString strMime; // Mime type of the compressor
if ((strExt==".gz") //in case of .svg.gz (logical extension)
||(strExt==".wvgz")) //in case of .svgz (extension used prioritary)
strMime="application/x-gzip"; // Compressed with gzip
@@ -78,7 +78,7 @@ KoFilter::ConversionStatus XAMLImport::convert(const QCString& from, const QCStr
kdDebug(30514) << "File extension: -" << strExt << "- Compression: " << strMime << endl;
- QIODevice* in = KFilterDev::deviceForFile(fileIn,strMime);
+ TQIODevice* in = KFilterDev::deviceForFile(fileIn,strMime);
if (!in->open(IO_ReadOnly))
{
@@ -88,7 +88,7 @@ KoFilter::ConversionStatus XAMLImport::convert(const QCString& from, const QCStr
}
int line, col;
- QString errormessage;
+ TQString errormessage;
const bool parsed=inpdoc.setContent( in, &errormessage, &line, &col );
in->close();
delete in;
@@ -110,7 +110,7 @@ KoFilter::ConversionStatus XAMLImport::convert(const QCString& from, const QCStr
kdError(30514) << "Unable to open output file!" << endl;
return KoFilter::StorageCreationError;
}
- QCString cstring = outdoc.toCString(); // utf-8 already
+ TQCString cstring = outdoc.toCString(); // utf-8 already
out->writeBlock( cstring.data(), cstring.length() );
return KoFilter::OK; // was successful
@@ -120,7 +120,7 @@ void
XAMLImport::convert()
{
XAMLGraphicsContext *gc = new XAMLGraphicsContext;
- QDomElement docElem = inpdoc.documentElement();
+ TQDomElement docElem = inpdoc.documentElement();
KoRect bbox( 0, 0, 550.0, 841.0 );
double width = !docElem.attribute( "width" ).isEmpty() ? parseUnit( docElem.attribute( "width" ), true, false, bbox ) : 550.0;
double height = !docElem.attribute( "height" ).isEmpty() ? parseUnit( docElem.attribute( "height" ), false, true, bbox ) : 841.0;
@@ -132,8 +132,8 @@ XAMLImport::convert()
if( !docElem.attribute( "viewBox" ).isEmpty() )
{
// allow for viewbox def with ',' or whitespace
- QString viewbox( docElem.attribute( "viewBox" ) );
- QStringList points = QStringList::split( ' ', viewbox.replace( ',', ' ').simplifyWhiteSpace() );
+ TQString viewbox( docElem.attribute( "viewBox" ) );
+ TQStringList points = TQStringList::split( ' ', viewbox.tqreplace( ',', ' ').simplifyWhiteSpace() );
gc->matrix.scale( width / points[2].toFloat() , height / points[3].toFloat() );
m_outerRect.setWidth( m_outerRect.width() * ( points[2].toFloat() / width ) );
@@ -142,7 +142,7 @@ XAMLImport::convert()
m_gc.push( gc );
parseGroup( 0L, docElem );
- QWMatrix mat;
+ TQWMatrix mat;
mat.scale( 1, -1 );
mat.translate( 0, -m_document.height() );
VTransformCmd trafo( 0L, mat );
@@ -153,7 +153,7 @@ XAMLImport::convert()
#define DPI 90
double
-XAMLImport::toPercentage( QString s )
+XAMLImport::toPercentage( TQString s )
{
if( s.endsWith( "%" ) )
return s.remove( '%' ).toDouble();
@@ -162,7 +162,7 @@ XAMLImport::toPercentage( QString s )
}
double
-XAMLImport::fromPercentage( QString s )
+XAMLImport::fromPercentage( TQString s )
{
if( s.endsWith( "%" ) )
return s.remove( '%' ).toDouble() / 100.0;
@@ -233,7 +233,7 @@ getNumber( const char *ptr, double &number )
double
-XAMLImport::parseUnit( const QString &unit, bool horiz, bool vert, KoRect bbox )
+XAMLImport::parseUnit( const TQString &unit, bool horiz, bool vert, KoRect bbox )
{
// TODO : percentage?
double value = 0;
@@ -284,50 +284,50 @@ XAMLImport::parseUnit( const QString &unit, bool horiz, bool vert, KoRect bbox )
return value;
}
-QColor
-XAMLImport::parseColor( const QString &rgbColor )
+TQColor
+XAMLImport::parseColor( const TQString &rgbColor )
{
int r, g, b;
keywordToRGB( rgbColor, r, g, b );
- return QColor( r, g, b );
+ return TQColor( r, g, b );
}
void
-XAMLImport::parseColor( VColor &color, const QString &s )
+XAMLImport::parseColor( VColor &color, const TQString &s )
{
if( s.startsWith( "rgb(" ) )
{
- QString parse = s.stripWhiteSpace();
- QStringList colors = QStringList::split( ',', parse );
- QString r = colors[0].right( ( colors[0].length() - 4 ) );
- QString g = colors[1];
- QString b = colors[2].left( ( colors[2].length() - 1 ) );
+ TQString parse = s.stripWhiteSpace();
+ TQStringList colors = TQStringList::split( ',', parse );
+ TQString r = colors[0].right( ( colors[0].length() - 4 ) );
+ TQString g = colors[1];
+ TQString b = colors[2].left( ( colors[2].length() - 1 ) );
- if( r.contains( "%" ) )
+ if( r.tqcontains( "%" ) )
{
r = r.left( r.length() - 1 );
- r = QString::number( int( ( double( 255 * r.toDouble() ) / 100.0 ) ) );
+ r = TQString::number( int( ( double( 255 * r.toDouble() ) / 100.0 ) ) );
}
- if( g.contains( "%" ) )
+ if( g.tqcontains( "%" ) )
{
g = g.left( g.length() - 1 );
- g = QString::number( int( ( double( 255 * g.toDouble() ) / 100.0 ) ) );
+ g = TQString::number( int( ( double( 255 * g.toDouble() ) / 100.0 ) ) );
}
- if( b.contains( "%" ) )
+ if( b.tqcontains( "%" ) )
{
b = b.left( b.length() - 1 );
- b = QString::number( int( ( double( 255 * b.toDouble() ) / 100.0 ) ) );
+ b = TQString::number( int( ( double( 255 * b.toDouble() ) / 100.0 ) ) );
}
- QColor c( r.toInt(), g.toInt(), b.toInt() );
+ TQColor c( r.toInt(), g.toInt(), b.toInt() );
color.set( c.red() / 255.0, c.green() / 255.0, c.blue() / 255.0 );
}
else
{
- QString rgbColor = s.stripWhiteSpace();
- QColor c;
+ TQString rgbColor = s.stripWhiteSpace();
+ TQColor c;
if( rgbColor.startsWith( "#" ) )
c.setNamedColor( rgbColor );
else
@@ -337,17 +337,17 @@ XAMLImport::parseColor( VColor &color, const QString &s )
}
void
-XAMLImport::parseColorStops( VGradient *gradient, const QDomElement &e )
+XAMLImport::parseColorStops( VGradient *gradient, const TQDomElement &e )
{
VColor c;
- for( QDomNode n = e.firstChild(); !n.isNull(); n = n.nextSibling() )
+ for( TQDomNode n = e.firstChild(); !n.isNull(); n = n.nextSibling() )
{
- QDomElement stop = n.toElement();
+ TQDomElement stop = n.toElement();
if( stop.tagName() == "stop" )
{
float offset;
- QString temp = stop.attribute( "offset" );
- if( temp.contains( '%' ) )
+ TQString temp = stop.attribute( "offset" );
+ if( temp.tqcontains( '%' ) )
{
temp = temp.left( temp.length() - 1 );
offset = temp.toFloat() / 100.0;
@@ -360,13 +360,13 @@ XAMLImport::parseColorStops( VGradient *gradient, const QDomElement &e )
else
{
// try style attr
- QString style = stop.attribute( "style" ).simplifyWhiteSpace();
- QStringList substyles = QStringList::split( ';', style );
- for( QStringList::Iterator it = substyles.begin(); it != substyles.end(); ++it )
+ TQString style = stop.attribute( "style" ).simplifyWhiteSpace();
+ TQStringList substyles = TQStringList::split( ';', style );
+ for( TQStringList::Iterator it = substyles.begin(); it != substyles.end(); ++it )
{
- QStringList substyle = QStringList::split( ':', (*it) );
- QString command = substyle[0].stripWhiteSpace();
- QString params = substyle[1].stripWhiteSpace();
+ TQStringList substyle = TQStringList::split( ':', (*it) );
+ TQString command = substyle[0].stripWhiteSpace();
+ TQString params = substyle[1].stripWhiteSpace();
if( command == "stop-color" )
parseColor( c, params );
if( command == "stop-opacity" )
@@ -382,13 +382,13 @@ XAMLImport::parseColorStops( VGradient *gradient, const QDomElement &e )
}
void
-XAMLImport::parseGradient( const QDomElement &e )
+XAMLImport::parseGradient( const TQDomElement &e )
{
GradientHelper gradhelper;
gradhelper.gradient.clearStops();
gradhelper.gradient.setRepeatMethod( VGradient::none );
- QString href = e.attribute( "xlink:href" ).mid( 1 );
+ TQString href = e.attribute( "xlink:href" ).mid( 1 );
if( !href.isEmpty() )
{
//kdDebug() << "Indexing with href : " << href.latin1() << endl;
@@ -428,7 +428,7 @@ XAMLImport::parseGradient( const QDomElement &e )
gradhelper.gradient.setType( VGradient::radial );
}
// handle spread method
- QString spreadMethod = e.attribute( "spreadMethod" );
+ TQString spreadMethod = e.attribute( "spreadMethod" );
if( !spreadMethod.isEmpty() )
{
if( spreadMethod == "reflect" )
@@ -443,7 +443,7 @@ XAMLImport::parseGradient( const QDomElement &e )
}
void
-XAMLImport::parsePA( VObject *obj, XAMLGraphicsContext *gc, const QString &command, const QString &params )
+XAMLImport::parsePA( VObject *obj, XAMLGraphicsContext *gc, const TQString &command, const TQString &params )
{
VColor fillcolor = gc->fill.color();
VColor strokecolor = gc->stroke.color();
@@ -454,9 +454,9 @@ XAMLImport::parsePA( VObject *obj, XAMLGraphicsContext *gc, const QString &comma
gc->fill.setType( VFill::none );
else if( params.startsWith( "url(" ) )
{
- unsigned int start = params.find("#") + 1;
- unsigned int end = params.findRev(")");
- QString key = params.mid( start, end - start );
+ unsigned int start = params.tqfind("#") + 1;
+ unsigned int end = params.tqfindRev(")");
+ TQString key = params.mid( start, end - start );
gc->fill.gradient() = m_gradients[ key ].gradient;
if( m_gradients[ key ].bbox )
{
@@ -466,14 +466,14 @@ XAMLImport::parsePA( VObject *obj, XAMLGraphicsContext *gc, const QString &comma
//kdDebug() << "!!!!!!bbox y : " << bbox.y() << endl;
//kdDebug() << gc->fill.gradient().origin().x() << endl;
//kdDebug() << gc->fill.gradient().vector().x() << endl;
- double offsetx = parseUnit( QString( "%1%" ).arg( gc->fill.gradient().origin().x() ), true, false, bbox );
- double offsety = parseUnit( QString( "%1%" ).arg( gc->fill.gradient().origin().y() ), false, true, bbox );
+ double offsetx = parseUnit( TQString( "%1%" ).tqarg( gc->fill.gradient().origin().x() ), true, false, bbox );
+ double offsety = parseUnit( TQString( "%1%" ).tqarg( gc->fill.gradient().origin().y() ), false, true, bbox );
gc->fill.gradient().setOrigin( KoPoint( bbox.x() + offsetx, bbox.y() + offsety ) );
- offsetx = parseUnit( QString( "%1%" ).arg( gc->fill.gradient().focalPoint().x() ), true, false, bbox );
- offsety = parseUnit( QString( "%1%" ).arg( gc->fill.gradient().focalPoint().y() ), false, true, bbox );
+ offsetx = parseUnit( TQString( "%1%" ).tqarg( gc->fill.gradient().focalPoint().x() ), true, false, bbox );
+ offsety = parseUnit( TQString( "%1%" ).tqarg( gc->fill.gradient().focalPoint().y() ), false, true, bbox );
gc->fill.gradient().setFocalPoint( KoPoint( bbox.x() + offsetx, bbox.y() + offsety ) );
- offsetx = parseUnit( QString( "%1%" ).arg( gc->fill.gradient().vector().x() ), true, false, bbox );
- offsety = parseUnit( QString( "%1%" ).arg( gc->fill.gradient().vector().y() ), false, true, bbox );
+ offsetx = parseUnit( TQString( "%1%" ).tqarg( gc->fill.gradient().vector().x() ), true, false, bbox );
+ offsety = parseUnit( TQString( "%1%" ).tqarg( gc->fill.gradient().vector().y() ), false, true, bbox );
gc->fill.gradient().setVector( KoPoint( bbox.x() + offsetx, bbox.y() + offsety ) );
//kdDebug() << offsety << endl;
//kdDebug() << gc->fill.gradient().origin().x() << endl;
@@ -505,9 +505,9 @@ XAMLImport::parsePA( VObject *obj, XAMLGraphicsContext *gc, const QString &comma
gc->stroke.setType( VStroke::none );
else if( params.startsWith( "url(" ) )
{
- unsigned int start = params.find("#") + 1;
- unsigned int end = params.findRev(")");
- QString key = params.mid( start, end - start );
+ unsigned int start = params.tqfind("#") + 1;
+ unsigned int end = params.tqfindRev(")");
+ TQString key = params.mid( start, end - start );
gc->stroke.gradient() = m_gradients[ key ].gradient;
gc->stroke.gradient().transform( m_gradients[ key ].gradientTransform );
gc->stroke.gradient().transform( gc->matrix );
@@ -543,11 +543,11 @@ XAMLImport::parsePA( VObject *obj, XAMLGraphicsContext *gc, const QString &comma
gc->stroke.setMiterLimit( params.toFloat() );
else if( command == "stroke-dasharray" )
{
- QValueList<float> array;
+ TQValueList<float> array;
if(params != "none")
{
- QStringList dashes = QStringList::split( ' ', params );
- for( QStringList::Iterator it = dashes.begin(); it != dashes.end(); ++it )
+ TQStringList dashes = TQStringList::split( ' ', params );
+ for( TQStringList::Iterator it = dashes.begin(); it != dashes.end(); ++it )
array.append( (*it).toFloat() );
}
gc->stroke.dashPattern().setArray( array );
@@ -566,8 +566,8 @@ XAMLImport::parsePA( VObject *obj, XAMLGraphicsContext *gc, const QString &comma
}
else if( command == "font-family" )
{
- QString family = params;
- family.replace( '\'' , ' ' );
+ TQString family = params;
+ family.tqreplace( '\'' , ' ' );
gc->font.setFamily( family );
}
else if( command == "font-size" )
@@ -600,16 +600,16 @@ XAMLImport::addGraphicContext()
}
void
-XAMLImport::setupTransform( const QDomElement &e )
+XAMLImport::setupTransform( const TQDomElement &e )
{
XAMLGraphicsContext *gc = m_gc.current();
- QWMatrix mat = VPath::parseTransform( e.attribute( "transform" ) );
+ TQWMatrix mat = VPath::parseTransform( e.attribute( "transform" ) );
gc->matrix = mat * gc->matrix;
}
void
-XAMLImport::parseStyle( VObject *obj, const QDomElement &e )
+XAMLImport::parseStyle( VObject *obj, const TQDomElement &e )
{
XAMLGraphicsContext *gc = m_gc.current();
if( !gc ) return;
@@ -641,13 +641,13 @@ XAMLImport::parseStyle( VObject *obj, const QDomElement &e )
parsePA( obj, gc, "opacity", e.attribute( "opacity" ) );
// try style attr
- QString style = e.attribute( "style" ).simplifyWhiteSpace();
- QStringList substyles = QStringList::split( ';', style );
- for( QStringList::Iterator it = substyles.begin(); it != substyles.end(); ++it )
+ TQString style = e.attribute( "style" ).simplifyWhiteSpace();
+ TQStringList substyles = TQStringList::split( ';', style );
+ for( TQStringList::Iterator it = substyles.begin(); it != substyles.end(); ++it )
{
- QStringList substyle = QStringList::split( ':', (*it) );
- QString command = substyle[0].stripWhiteSpace();
- QString params = substyle[1].stripWhiteSpace();
+ TQStringList substyle = TQStringList::split( ':', (*it) );
+ TQString command = substyle[0].stripWhiteSpace();
+ TQString params = substyle[1].stripWhiteSpace();
parsePA( obj, gc, command, params );
}
@@ -662,7 +662,7 @@ XAMLImport::parseStyle( VObject *obj, const QDomElement &e )
}
void
-XAMLImport::parseFont( const QDomElement &e )
+XAMLImport::parseFont( const TQDomElement &e )
{
XAMLGraphicsContext *gc = m_gc.current();
if( !gc ) return;
@@ -676,15 +676,15 @@ XAMLImport::parseFont( const QDomElement &e )
}
void
-XAMLImport::parseGroup( VGroup *grp, const QDomElement &e )
+XAMLImport::parseGroup( VGroup *grp, const TQDomElement &e )
{
bool isDef = false;
if( e.tagName() == "defs" )
isDef = true;
- for( QDomNode n = e.firstChild(); !n.isNull(); n = n.nextSibling() )
+ for( TQDomNode n = e.firstChild(); !n.isNull(); n = n.nextSibling() )
{
- QDomElement b = n.toElement();
+ TQDomElement b = n.toElement();
if( b.isNull() ) continue;
VObject *obj = 0L;
if( b.tagName() == "g" )
@@ -749,13 +749,13 @@ XAMLImport::parseGroup( VGroup *grp, const QDomElement &e )
if( !b.attribute( "xlink:href" ).isEmpty() )
{
- QString params = b.attribute( "xlink:href" );
- unsigned int start = params.find("#") + 1;
- unsigned int end = params.findRev(")");
- QString key = params.mid( start, end - start );
- if(m_paths.contains(key))
+ TQString params = b.attribute( "xlink:href" );
+ unsigned int start = params.tqfind("#") + 1;
+ unsigned int end = params.tqfindRev(")");
+ TQString key = params.mid( start, end - start );
+ if(m_paths.tqcontains(key))
{
- QDomElement a = m_paths[key];
+ TQDomElement a = m_paths[key];
obj = createObject( a );
m_gc.current()->matrix.translate(tx,ty);
parsePA( grp, m_gc.current(), "fill", b.attribute( "fill" ) );
@@ -777,7 +777,7 @@ XAMLImport::parseGroup( VGroup *grp, const QDomElement &e )
}
}
-VObject* XAMLImport::findObject( const QString &name, VGroup* group )
+VObject* XAMLImport::findObject( const TQString &name, VGroup* group )
{
if( ! group )
return 0L;
@@ -801,9 +801,9 @@ VObject* XAMLImport::findObject( const QString &name, VGroup* group )
return 0L;
}
-VObject* XAMLImport::findObject( const QString &name )
+VObject* XAMLImport::findObject( const TQString &name )
{
- QPtrVector<VLayer> vector;
+ TQPtrVector<VLayer> vector;
m_document.layers().toVector( &vector );
for( int i = vector.count() - 1; i >= 0; i-- )
{
@@ -818,10 +818,10 @@ VObject* XAMLImport::findObject( const QString &name )
return 0L;
}
-void XAMLImport::createText( VGroup *grp, const QDomElement &b )
+void XAMLImport::createText( VGroup *grp, const TQDomElement &b )
{
VText *text = 0L;
- QString content;
+ TQString content;
VSubpath base( 0L );
VPath *path = 0L;
@@ -841,9 +841,9 @@ void XAMLImport::createText( VGroup *grp, const QDomElement &b )
base.lineTo( KoPoint( x + 10, y ) );
}
- for( QDomNode n = b.firstChild(); !n.isNull(); n = n.nextSibling() )
+ for( TQDomNode n = b.firstChild(); !n.isNull(); n = n.nextSibling() )
{
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
if( e.isNull() )
{
content += n.toCharacterData().data();
@@ -853,11 +853,11 @@ void XAMLImport::createText( VGroup *grp, const QDomElement &b )
if( e.attribute( "xlink:href" ).isEmpty() )
continue;
- QString uri = e.attribute( "xlink:href" );
- unsigned int start = uri.find("#") + 1;
- unsigned int end = uri.findRev(")");
- QString key = uri.mid( start, end - start );
- if( ! m_paths.contains(key) )
+ TQString uri = e.attribute( "xlink:href" );
+ unsigned int start = uri.tqfind("#") + 1;
+ unsigned int end = uri.tqfindRev(")");
+ TQString key = uri.mid( start, end - start );
+ if( ! m_paths.tqcontains(key) )
{
VObject* obj = findObject( key );
if( obj )
@@ -865,7 +865,7 @@ void XAMLImport::createText( VGroup *grp, const QDomElement &b )
}
else
{
- QDomElement p = m_paths[key];
+ TQDomElement p = m_paths[key];
path = dynamic_cast<VPath*>( createObject( p ) );
if( path )
path->setState( VObject::deleted );
@@ -882,8 +882,8 @@ void XAMLImport::createText( VGroup *grp, const QDomElement &b )
content += e.text();
if( base.isEmpty() && ! e.attribute( "x" ).isEmpty() && ! e.attribute( "y" ).isEmpty() )
{
- QStringList posX = QStringList::split( ", ", e.attribute( "x" ) );
- QStringList posY = QStringList::split( ", ", e.attribute( "y" ) );
+ TQStringList posX = TQStringList::split( ", ", e.attribute( "x" ) );
+ TQStringList posY = TQStringList::split( ", ", e.attribute( "y" ) );
if( posX.count() && posY.count() )
{
double x = parseUnit( posX.first() );
@@ -898,12 +898,12 @@ void XAMLImport::createText( VGroup *grp, const QDomElement &b )
if( e.attribute( "xlink:href" ).isEmpty() )
continue;
- QString uri = e.attribute( "xlink:href" );
- unsigned int start = uri.find("#") + 1;
- unsigned int end = uri.findRev(")");
- QString key = uri.mid( start, end - start );
+ TQString uri = e.attribute( "xlink:href" );
+ unsigned int start = uri.tqfind("#") + 1;
+ unsigned int end = uri.tqfindRev(")");
+ TQString key = uri.mid( start, end - start );
- if( ! m_paths.contains(key) )
+ if( ! m_paths.tqcontains(key) )
{
VObject* obj = findObject( key );
if( obj )
@@ -911,7 +911,7 @@ void XAMLImport::createText( VGroup *grp, const QDomElement &b )
}
else
{
- QDomElement p = m_paths[key];
+ TQDomElement p = m_paths[key];
content += p.text();
}
}
@@ -948,7 +948,7 @@ void XAMLImport::createText( VGroup *grp, const QDomElement &b )
delete( m_gc.pop() );
}
-VObject* XAMLImport::createObject( const QDomElement &b )
+VObject* XAMLImport::createObject( const TQDomElement &b )
{
if( b.tagName() == "rect" )
{
@@ -999,12 +999,12 @@ VObject* XAMLImport::createObject( const QDomElement &b )
VPath *path = new VPath( &m_document );
bool bFirst = true;
- QString points = b.attribute( "points" ).simplifyWhiteSpace();
- points.replace( ',', ' ' );
+ TQString points = b.attribute( "points" ).simplifyWhiteSpace();
+ points.tqreplace( ',', ' ' );
points.remove( '\r' );
points.remove( '\n' );
- QStringList pointList = QStringList::split( ' ', points );
- for( QStringList::Iterator it = pointList.begin(); it != pointList.end(); ++it)
+ TQStringList pointList = TQStringList::split( ' ', points );
+ for( TQStringList::Iterator it = pointList.begin(); it != pointList.end(); ++it)
{
KoPoint point;
point.setX( (*it).toDouble() );
@@ -1032,7 +1032,7 @@ VObject* XAMLImport::createObject( const QDomElement &b )
{
addGraphicContext();
setupTransform( b );
- QString fname = b.attribute("xlink:href");
+ TQString fname = b.attribute("xlink:href");
return new VImage( 0L, fname );
}
diff --git a/filters/karbon/xaml/xamlimport.h b/filters/karbon/xaml/xamlimport.h
index 05763419..83f11fc8 100644
--- a/filters/karbon/xaml/xamlimport.h
+++ b/filters/karbon/xaml/xamlimport.h
@@ -21,9 +21,9 @@
#define __XAMLIMPORT_H__
#include <KoFilter.h>
-#include <qdom.h>
-#include <qmap.h>
-#include <qptrstack.h>
+#include <tqdom.h>
+#include <tqmap.h>
+#include <tqptrstack.h>
#include <core/vdocument.h>
#include <core/vgradient.h>
#include <core/vfill.h>
@@ -37,12 +37,13 @@ class VPath;
class XAMLImport : public KoFilter
{
Q_OBJECT
+ TQ_OBJECT
public:
- XAMLImport(KoFilter *parent, const char *name, const QStringList&);
+ XAMLImport(KoFilter *tqparent, const char *name, const TQStringList&);
virtual ~XAMLImport();
- virtual KoFilter::ConversionStatus convert(const QCString& from, const QCString& to);
+ virtual KoFilter::ConversiontqStatus convert(const TQCString& from, const TQCString& to);
protected:
class GradientHelper
@@ -54,37 +55,37 @@ protected:
}
VGradient gradient;
bool bbox;
- QWMatrix gradientTransform;
+ TQWMatrix gradientTransform;
};
- void parseGroup( VGroup *, const QDomElement & );
- void parseStyle( VObject *, const QDomElement & );
- void parsePA( VObject *, XAMLGraphicsContext *, const QString &, const QString & );
- void parseGradient( const QDomElement & );
- void parseColorStops( VGradient *, const QDomElement & );
- double parseUnit( const QString &, bool horiz = false, bool vert = false, KoRect bbox = KoRect() );
- void parseColor( VColor &, const QString & );
- QColor parseColor( const QString & );
- double toPercentage( QString );
- double fromPercentage( QString );
- void setupTransform( const QDomElement & );
+ void parseGroup( VGroup *, const TQDomElement & );
+ void parseStyle( VObject *, const TQDomElement & );
+ void parsePA( VObject *, XAMLGraphicsContext *, const TQString &, const TQString & );
+ void parseGradient( const TQDomElement & );
+ void parseColorStops( VGradient *, const TQDomElement & );
+ double parseUnit( const TQString &, bool horiz = false, bool vert = false, KoRect bbox = KoRect() );
+ void parseColor( VColor &, const TQString & );
+ TQColor parseColor( const TQString & );
+ double toPercentage( TQString );
+ double fromPercentage( TQString );
+ void setupTransform( const TQDomElement & );
void addGraphicContext();
- QDomDocument inpdoc;
- QDomDocument outdoc;
+ TQDomDocument inpdoc;
+ TQDomDocument outdoc;
void convert();
- VObject* createObject( const QDomElement & );
- void createText( VGroup *, const QDomElement & );
- void parseFont( const QDomElement & );
+ VObject* createObject( const TQDomElement & );
+ void createText( VGroup *, const TQDomElement & );
+ void parseFont( const TQDomElement & );
// find object with given id in document
- VObject* findObject( const QString &name );
+ VObject* findObject( const TQString &name );
// find object with given id in given group
- VObject* findObject( const QString &name, VGroup * );
+ VObject* findObject( const TQString &name, VGroup * );
private:
VDocument m_document;
- QPtrStack<XAMLGraphicsContext> m_gc;
- QMap<QString, GradientHelper> m_gradients;
- QMap<QString, QDomElement> m_paths;
+ TQPtrStack<XAMLGraphicsContext> m_gc;
+ TQMap<TQString, GradientHelper> m_gradients;
+ TQMap<TQString, TQDomElement> m_paths;
KoRect m_outerRect;
};