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 /filters/karbon/svg | |
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 'filters/karbon/svg')
-rw-r--r-- | filters/karbon/svg/color.h | 4 | ||||
-rw-r--r-- | filters/karbon/svg/svgexport.cc | 80 | ||||
-rw-r--r-- | filters/karbon/svg/svgexport.h | 29 | ||||
-rw-r--r-- | filters/karbon/svg/svggraphiccontext.h | 10 | ||||
-rw-r--r-- | filters/karbon/svg/svgimport.cc | 280 | ||||
-rw-r--r-- | filters/karbon/svg/svgimport.h | 65 |
6 files changed, 235 insertions, 233 deletions
diff --git a/filters/karbon/svg/color.h b/filters/karbon/svg/color.h index bfdc93c6..49bc2e52 100644 --- a/filters/karbon/svg/color.h +++ b/filters/karbon/svg/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/svg/svgexport.cc b/filters/karbon/svg/svgexport.cc index 4f434d4d..2e661039 100644 --- a/filters/karbon/svg/svgexport.cc +++ b/filters/karbon/svg/svgexport.cc @@ -17,11 +17,11 @@ * Boston, MA 02110-1301, USA. */ -#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> @@ -48,10 +48,10 @@ #include <kdebug.h> -QString INDENT(" "); +TQString INDENT(" "); void -printIndentation( QTextStream *stream, unsigned int indent ) +printIndentation( TQTextStream *stream, unsigned int indent ) { for( unsigned int i = 0; i < indent;++i) *stream << INDENT; @@ -61,14 +61,14 @@ typedef KGenericFactory<SvgExport, KoFilter> SvgExportFactory; K_EXPORT_COMPONENT_FACTORY( libkarbonsvgexport, SvgExportFactory( "kofficefilters" ) ) -SvgExport::SvgExport( KoFilter*, const char*, const QStringList& ) +SvgExport::SvgExport( KoFilter*, const char*, const TQStringList& ) : KoFilter(), m_indent( 0 ), m_indent2( 0 ), m_trans( 0L ) { m_gc.setAutoDelete( true ); } -KoFilter::ConversionStatus -SvgExport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus +SvgExport::convert( const TQCString& from, const TQCString& to ) { if ( to != "image/svg+xml" || from != "application/x-karbon" ) { @@ -79,22 +79,22 @@ SvgExport::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: VDocument doc; @@ -149,7 +149,7 @@ SvgExport::visitVDocument( VDocument& document ) SvgGraphicsContext *gc = new SvgGraphicsContext; m_gc.push( gc ); - QWMatrix mat; + TQWMatrix mat; mat.scale( 1, -1 ); mat.translate( 0, -document.height() ); @@ -167,12 +167,12 @@ SvgExport::visitVDocument( VDocument& document ) *m_body << "</svg>" << endl; } -QString +TQString SvgExport::getID( VObject *obj ) { if( obj && !obj->name().isEmpty() ) - return QString( " id=\"%1\"" ).arg( obj->name() ); - return QString(); + return TQString( " id=\"%1\"" ).tqarg( obj->name() ); + return TQString(); } void @@ -213,7 +213,7 @@ SvgExport::visitVLayer( VLayer& layer ) } void -SvgExport::writePathToStream( VPath &composite, const QString &id, QTextStream *stream, unsigned int indent ) +SvgExport::writePathToStream( VPath &composite, const TQString &id, TQTextStream *stream, unsigned int indent ) { if( ! stream ) return; @@ -226,7 +226,7 @@ SvgExport::writePathToStream( VPath &composite, const QString &id, QTextStream * getFill( *( composite.fill() ), stream ); getStroke( *( composite.stroke() ), stream ); - QString d; + TQString d; composite.saveSvgPath( d ); *stream << " d=\"" << d << "\" "; @@ -254,15 +254,15 @@ SvgExport::visitVSubpath( VSubpath& ) { } -QString createUID() +TQString createUID() { static unsigned int nr = 0; - return "defitem" + QString().setNum( nr++ ); + return "defitem" + TQString().setNum( nr++ ); } void -SvgExport::getColorStops( const QPtrVector<VColorStop> &colorStops ) +SvgExport::getColorStops( const TQPtrVector<VColorStop> &colorStops ) { m_indent2++; for( unsigned int i = 0; i < colorStops.count() ; i++ ) @@ -270,7 +270,7 @@ SvgExport::getColorStops( const QPtrVector<VColorStop> &colorStops ) printIndentation( m_defs, m_indent2 ); *m_defs << "<stop stop-color=\""; getHexColor( m_defs, colorStops.at( i )->color ); - *m_defs << "\" offset=\"" << QString().setNum( colorStops.at( i )->rampPoint ); + *m_defs << "\" offset=\"" << TQString().setNum( colorStops.at( i )->rampPoint ); *m_defs << "\" stop-opacity=\"" << colorStops.at( i )->color.opacity() << "\"" << " />" << endl; } m_indent2--; @@ -279,7 +279,7 @@ SvgExport::getColorStops( const QPtrVector<VColorStop> &colorStops ) void SvgExport::getGradient( const VGradient& grad ) { - QString uid = createUID(); + TQString uid = createUID(); if( grad.type() == VGradient::linear ) { printIndentation( m_defs, m_indent2 ); @@ -314,7 +314,7 @@ SvgExport::getGradient( const VGradient& grad ) *m_defs << "fx=\"" << grad.focalPoint().x() << "\" "; *m_defs << "fy=\"" << grad.focalPoint().y() << "\" "; double r = sqrt( pow( grad.vector().x() - grad.origin().x(), 2 ) + pow( grad.vector().y() - grad.origin().y(), 2 ) ); - *m_defs << "r=\"" << QString().setNum( r ) << "\" "; + *m_defs << "r=\"" << TQString().setNum( r ) << "\" "; if( grad.repeatMethod() == VGradient::reflect ) *m_defs << "spreadMethod=\"reflect\" "; else if( grad.repeatMethod() == VGradient::repeat ) @@ -341,7 +341,7 @@ SvgExport::getGradient( const VGradient& grad ) *m_defs << "fx=\"" << grad.focalPoint().x() << "\" "; *m_defs << "fy=\"" << grad.focalPoint().y() << "\" "; double r = sqrt( pow( grad.vector().x() - grad.origin().x(), 2 ) + pow( grad.vector().y() - grad.origin().y(), 2 ) ); - *m_defs << "r=\"" << QString().setNum( r ) << "\" "; + *m_defs << "r=\"" << TQString().setNum( r ) << "\" "; if( grad.repeatMethod() == VGradient::reflect ) *m_defs << "spreadMethod=\"reflect\" "; else if( grad.repeatMethod() == VGradient::repeat ) @@ -361,7 +361,7 @@ SvgExport::getGradient( const VGradient& grad ) void SvgExport::getPattern( const VPattern & ) { - QString uid = createUID(); + TQString uid = createUID(); printIndentation( m_defs, m_indent2 ); *m_defs << "<pattern id=\"" << uid << "\" "; *m_defs << "width=\"" << "\" "; @@ -376,7 +376,7 @@ SvgExport::getPattern( const VPattern & ) } void -SvgExport::getFill( const VFill& fill, QTextStream *stream ) +SvgExport::getFill( const VFill& fill, TQTextStream *stream ) { *stream << " fill=\""; if( fill.type() == VFill::none ) @@ -394,7 +394,7 @@ SvgExport::getFill( const VFill& fill, QTextStream *stream ) } void -SvgExport::getStroke( const VStroke& stroke, QTextStream *stream ) +SvgExport::getStroke( const VStroke& stroke, TQTextStream *stream ) { if( stroke.type() != m_gc.current()->stroke.type() ) { @@ -443,7 +443,7 @@ SvgExport::getStroke( const VStroke& stroke, QTextStream *stream ) *stream << " stroke-dashoffset=\"" << stroke.dashPattern().offset() << "\""; *stream << " stroke-dasharray=\" "; - QValueListConstIterator<float> itr; + TQValueListConstIterator<float> itr; for(itr = stroke.dashPattern().array().begin(); itr != stroke.dashPattern().array().end(); ++itr ) { *stream << *itr << " "; @@ -453,11 +453,11 @@ SvgExport::getStroke( const VStroke& stroke, QTextStream *stream ) } void -SvgExport::getHexColor( QTextStream *stream, const VColor& color ) +SvgExport::getHexColor( TQTextStream *stream, const VColor& color ) { // Convert the various color-spaces to hex - QString Output; + TQString Output; VColor copy( color ); copy.setColorSpace( VColor::rgb ); @@ -475,7 +475,7 @@ SvgExport::visitVText( VText& text ) m_trans->visitVPath( path ); - QString id = createUID(); + TQString id = createUID(); writePathToStream( path, " id=\""+ id + "\"", m_defs, m_indent2 ); printIndentation( m_body, m_indent++ ); @@ -490,9 +490,9 @@ SvgExport::visitVText( VText& text ) *m_body << " font-weight=\"bold\""; if( text.font().italic() ) *m_body << " font-style=\"italic\""; - if( text.alignment() == VText::Center ) + if( text.tqalignment() == VText::Center ) *m_body << " text-anchor=\"middle\""; - else if( text.alignment() == VText::Right ) + else if( text.tqalignment() == VText::Right ) *m_body << " text-anchor=\"end\""; *m_body << ">" << endl; diff --git a/filters/karbon/svg/svgexport.h b/filters/karbon/svg/svgexport.h index 8a4eab63..6a79fb07 100644 --- a/filters/karbon/svg/svgexport.h +++ b/filters/karbon/svg/svgexport.h @@ -27,9 +27,9 @@ #include "svggraphiccontext.h" -#include <qptrstack.h> +#include <tqptrstack.h> -class QTextStream; +class TQTextStream; class VColor; class VPath; class VDocument; @@ -46,12 +46,13 @@ class VTransformCmd; class SvgExport : public KoFilter, private VVisitor { Q_OBJECT + TQ_OBJECT public: - SvgExport( KoFilter* parent, const char* name, const QStringList& ); + SvgExport( KoFilter* tqparent, const char* name, const TQStringList& ); virtual ~SvgExport() {} - 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 ); @@ -62,21 +63,21 @@ private: virtual void visitVSubpath( VSubpath& path ); virtual void visitVText( VText& text ); - void getStroke( const VStroke& stroke, QTextStream *stream ); - void getColorStops( const QPtrVector<VColorStop> &colorStops ); - void getFill( const VFill& fill, QTextStream *stream ); + void getStroke( const VStroke& stroke, TQTextStream *stream ); + void getColorStops( const TQPtrVector<VColorStop> &colorStops ); + void getFill( const VFill& fill, TQTextStream *stream ); void getGradient( const VGradient& grad ); void getPattern( const VPattern& patt ); - void getHexColor( QTextStream *, const VColor& color ); - QString getID( VObject *obj ); + void getHexColor( TQTextStream *, const VColor& color ); + TQString getID( VObject *obj ); - void writePathToStream( VPath &composite, const QString &id, QTextStream *stream, unsigned int indent ); + void writePathToStream( VPath &composite, const TQString &id, TQTextStream *stream, unsigned int indent ); - QTextStream* m_stream; - QTextStream* m_defs; - QTextStream* m_body; + TQTextStream* m_stream; + TQTextStream* m_defs; + TQTextStream* m_body; - QPtrStack<SvgGraphicsContext> m_gc; + TQPtrStack<SvgGraphicsContext> m_gc; unsigned int m_indent; unsigned int m_indent2; diff --git a/filters/karbon/svg/svggraphiccontext.h b/filters/karbon/svg/svggraphiccontext.h index 96737fd9..e9d5eb4b 100644 --- a/filters/karbon/svg/svggraphiccontext.h +++ b/filters/karbon/svg/svggraphiccontext.h @@ -33,16 +33,16 @@ 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; - color = Qt::black; + color = TQt::black; } VFill fill; VFillRule fillRule; VStroke stroke; - QWMatrix matrix; - QFont font; - QColor color; + TQWMatrix matrix; + TQFont font; + TQColor color; }; #endif diff --git a/filters/karbon/svg/svgimport.cc b/filters/karbon/svg/svgimport.cc index f97546c6..b8b580f7 100644 --- a/filters/karbon/svg/svgimport.cc +++ b/filters/karbon/svg/svgimport.cc @@ -35,15 +35,15 @@ #include <core/vgroup.h> #include <core/vimage.h> #include <core/vlayer.h> -#include <qcolor.h> -#include <qfile.h> -#include <qregexp.h> +#include <tqcolor.h> +#include <tqfile.h> +#include <tqregexp.h> #include <kfilterdev.h> typedef KGenericFactory<SvgImport, KoFilter> SvgImportFactory; K_EXPORT_COMPONENT_FACTORY( libkarbonsvgimport, SvgImportFactory( "kofficefilters" ) ) -SvgImport::SvgImport(KoFilter *, const char *, const QStringList&) : +SvgImport::SvgImport(KoFilter *, const char *, const TQStringList&) : KoFilter(), outdoc( "DOC" ) { @@ -54,20 +54,20 @@ SvgImport::~SvgImport() { } -KoFilter::ConversionStatus SvgImport::convert(const QCString& from, const QCString& to) +KoFilter::ConversiontqStatus SvgImport::convert(const TQCString& from, const TQCString& to) { // check for proper conversion if( to != "application/x-karbon" || from != "image/svg+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==".svgz")) //in case of .svgz (extension used prioritary) strMime="application/x-gzip"; // Compressed with gzip @@ -78,7 +78,7 @@ KoFilter::ConversionStatus SvgImport::convert(const QCString& from, const QCStri /*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 SvgImport::convert(const QCString& from, const QCStri } int line, col; - QString errormessage; + TQString errormessage; const bool parsed=inpdoc.setContent( in, &errormessage, &line, &col ); @@ -107,7 +107,7 @@ KoFilter::ConversionStatus SvgImport::convert(const QCString& from, const QCStri // Do the conversion! convert(); // add paper info, we always need custom for svg (Rob) - QDomElement paper = outdoc.createElement( "PAPER" ); + TQDomElement paper = outdoc.createElement( "PAPER" ); outdoc.documentElement().appendChild( paper ); paper.setAttribute( "format", PG_CUSTOM ); paper.setAttribute( "width", m_document.width() ); @@ -119,7 +119,7 @@ KoFilter::ConversionStatus SvgImport::convert(const QCString& from, const QCStri 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 @@ -128,7 +128,7 @@ KoFilter::ConversionStatus SvgImport::convert(const QCString& from, const QCStri void SvgImport::convert() { SvgGraphicsContext *gc = new SvgGraphicsContext; - 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; @@ -138,12 +138,12 @@ void SvgImport::convert() m_outerRect = m_document.boundingBox(); // undo y-mirroring - //m_debug->append(QString("%1\tUndo Y-mirroring.").arg(m_time.elapsed())); + //m_debug->append(TQString("%1\tUndo Y-mirroring.").tqarg(m_time.elapsed())); 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 ) ); @@ -153,7 +153,7 @@ void SvgImport::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 ); @@ -166,7 +166,7 @@ void SvgImport::convert() // Helper functions // --------------------------------------------------------------------------------------- -double SvgImport::toPercentage( QString s ) +double SvgImport::toPercentage( TQString s ) { if( s.endsWith( "%" ) ) return s.remove( '%' ).toDouble(); @@ -174,7 +174,7 @@ double SvgImport::toPercentage( QString s ) return s.toDouble() * 100.0; } -double SvgImport::fromPercentage( QString s ) +double SvgImport::fromPercentage( TQString s ) { if( s.endsWith( "%" ) ) return s.remove( '%' ).toDouble() / 100.0; @@ -182,7 +182,7 @@ double SvgImport::fromPercentage( QString s ) return s.toDouble(); } -double SvgImport::getScalingFromMatrix( QWMatrix &matrix ) +double SvgImport::getScalingFromMatrix( TQWMatrix &matrix ) { double xscale = matrix.m11() + matrix.m12(); double yscale = matrix.m22() + matrix.m21(); @@ -258,15 +258,15 @@ void SvgImport::addGraphicContext() m_gc.push( gc ); } -void SvgImport::setupTransform( const QDomElement &e ) +void SvgImport::setupTransform( const TQDomElement &e ) { SvgGraphicsContext *gc = m_gc.current(); - QWMatrix mat = VPath::parseTransform( e.attribute( "transform" ) ); + TQWMatrix mat = VPath::parseTransform( e.attribute( "transform" ) ); gc->matrix = mat * gc->matrix; } -VObject* SvgImport::findObject( const QString &name, VGroup* group ) +VObject* SvgImport::findObject( const TQString &name, VGroup* group ) { if( ! group ) return 0L; @@ -290,9 +290,9 @@ VObject* SvgImport::findObject( const QString &name, VGroup* group ) return 0L; } -VObject* SvgImport::findObject( const QString &name ) +VObject* SvgImport::findObject( const TQString &name ) { - QPtrVector<VLayer> vector; + TQPtrVector<VLayer> vector; m_document.layers().toVector( &vector ); for( int i = vector.count() - 1; i >= 0; i-- ) { @@ -307,22 +307,22 @@ VObject* SvgImport::findObject( const QString &name ) return 0L; } -SvgImport::GradientHelper* SvgImport::findGradient( const QString &id, const QString &href) +SvgImport::GradientHelper* SvgImport::findGradient( const TQString &id, const TQString &href) { // check if gradient was already parsed, and return it - if( m_gradients.contains( id ) ) + if( m_gradients.tqcontains( id ) ) return &m_gradients[ id ]; // check if gradient was stored for later parsing - if( !m_defs.contains( id ) ) + if( !m_defs.tqcontains( id ) ) return 0L; - QDomElement e = m_defs[ id ]; + TQDomElement e = m_defs[ id ]; if(e.childNodes().count() == 0) { - QString mhref = e.attribute("xlink:href").mid(1); + TQString mhref = e.attribute("xlink:href").mid(1); - if(m_defs.contains(mhref)) + if(m_defs.tqcontains(mhref)) return findGradient(mhref, id); else return 0L; @@ -334,22 +334,22 @@ SvgImport::GradientHelper* SvgImport::findGradient( const QString &id, const QSt } // return successfully parsed gradient or NULL - QString n; + TQString n; if(href.isEmpty()) n = id; else n = href; - if( m_gradients.contains( n ) ) + if( m_gradients.tqcontains( n ) ) return &m_gradients[ n ]; else return 0L; } -QDomElement SvgImport::mergeStyles( const QDomElement &referencedBy, const QDomElement &referencedElement ) +TQDomElement SvgImport::mergeStyles( const TQDomElement &referencedBy, const TQDomElement &referencedElement ) { // First use all the style attributes of the element being referenced. - QDomElement e = referencedElement; + TQDomElement e = referencedElement; // Now go through the style attributes of the element that is referencing and substitute the original ones. if( !referencedBy.attribute( "color" ).isEmpty() ) @@ -388,7 +388,7 @@ QDomElement SvgImport::mergeStyles( const QDomElement &referencedBy, const QDomE // Parsing functions // --------------------------------------------------------------------------------------- -double SvgImport::parseUnit( const QString &unit, bool horiz, bool vert, KoRect bbox ) +double SvgImport::parseUnit( const TQString &unit, bool horiz, bool vert, KoRect bbox ) { // TODO : percentage? double value = 0; @@ -439,42 +439,42 @@ double SvgImport::parseUnit( const QString &unit, bool horiz, bool vert, KoRect return value; } -QColor SvgImport::parseColor( const QString &rgbColor ) +TQColor SvgImport::parseColor( const TQString &rgbColor ) { int r, g, b; keywordToRGB( rgbColor, r, g, b ); - return QColor( r, g, b ); + return TQColor( r, g, b ); } -void SvgImport::parseColor( VColor &color, const QString &s ) +void SvgImport::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 if( s == "currentColor" ) @@ -484,8 +484,8 @@ void SvgImport::parseColor( VColor &color, const QString &s ) } else { - QString rgbColor = s.stripWhiteSpace(); - QColor c; + TQString rgbColor = s.stripWhiteSpace(); + TQColor c; if( rgbColor.startsWith( "#" ) ) c.setNamedColor( rgbColor ); else @@ -494,17 +494,17 @@ void SvgImport::parseColor( VColor &color, const QString &s ) } } -void SvgImport::parseColorStops( VGradient *gradient, const QDomElement &e ) +void SvgImport::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; @@ -517,13 +517,13 @@ void SvgImport::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" ) @@ -538,7 +538,7 @@ void SvgImport::parseColorStops( VGradient *gradient, const QDomElement &e ) } } -void SvgImport::parseGradient( const QDomElement &e , const QDomElement &referencedBy) +void SvgImport::parseGradient( const TQDomElement &e , const TQDomElement &referencedBy) { // IMPROVEMENTS: // - Store the parsed colorstops in some sort of a cache so they don't need to be parsed again. @@ -555,7 +555,7 @@ void SvgImport::parseGradient( const QDomElement &e , const QDomElement &referen if(e.childNodes().count() == 0) { - QString href = e.attribute("xlink:href").mid(1); + TQString href = e.attribute("xlink:href").mid(1); if(href.isEmpty()) { @@ -572,17 +572,17 @@ void SvgImport::parseGradient( const QDomElement &e , const QDomElement &referen } // Use the gradient that is referencing, or if there isn't one, the original gradient. - QDomElement b; + TQDomElement b; if( !referencedBy.isNull() ) b = referencedBy; else b = e; - QString id = b.attribute("id"); + TQString id = b.attribute("id"); if( !id.isEmpty() ) { // Copy existing gradient if it exists - if( m_gradients.find( id ) != m_gradients.end() ) + if( m_gradients.tqfind( id ) != m_gradients.end() ) gradhelper.gradient = m_gradients[ id ].gradient; } @@ -598,13 +598,13 @@ void SvgImport::parseGradient( const QDomElement &e , const QDomElement &referen else { // try style attr - QString style = b.attribute( "style" ).simplifyWhiteSpace(); - QStringList substyles = QStringList::split( ';', style ); - for( QStringList::Iterator it = substyles.begin(); it != substyles.end(); ++it ) + TQString style = b.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 == "color" ) parseColor( c, params ); } @@ -642,7 +642,7 @@ void SvgImport::parseGradient( const QDomElement &e , const QDomElement &referen gradhelper.gradient.setType( VGradient::radial ); } // handle spread method - QString spreadMethod = b.attribute( "spreadMethod" ); + TQString spreadMethod = b.attribute( "spreadMethod" ); if( !spreadMethod.isEmpty() ) { if( spreadMethod == "reflect" ) @@ -663,7 +663,7 @@ void SvgImport::parseGradient( const QDomElement &e , const QDomElement &referen m_gradients.insert( b.attribute( "id" ), gradhelper ); } -void SvgImport::parsePA( VObject *obj, SvgGraphicsContext *gc, const QString &command, const QString ¶ms ) +void SvgImport::parsePA( VObject *obj, SvgGraphicsContext *gc, const TQString &command, const TQString ¶ms ) { VColor fillcolor = gc->fill.color(); VColor strokecolor = gc->stroke.color(); @@ -676,9 +676,9 @@ void SvgImport::parsePA( VObject *obj, SvgGraphicsContext *gc, const QString &co 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 ); GradientHelper *gradHelper = findGradient( key ); if( gradHelper ) { @@ -692,17 +692,17 @@ void SvgImport::parsePA( VObject *obj, SvgGraphicsContext *gc, const QString &co //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 ) ); if(gc->fill.gradient().type() == VGradient::radial) { - 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; @@ -739,9 +739,9 @@ void SvgImport::parsePA( VObject *obj, SvgGraphicsContext *gc, const QString &co 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 ); GradientHelper *gradHelper = findGradient( key ); if( gradHelper ) @@ -784,13 +784,13 @@ void SvgImport::parsePA( VObject *obj, SvgGraphicsContext *gc, const QString &co gc->stroke.setMiterLimit( params.toFloat() ); else if( command == "stroke-dasharray" ) { - QValueList<float> array; + TQValueList<float> array; if(params != "none") { // with "stroke-dasharray", the separator is a white space // inside style attribute, stroke-dasharray is separated by comma (,) - QStringList dashes = QStringList::split( QRegExp("[\\s,]"), params ); - for( QStringList::Iterator it = dashes.begin(); it != dashes.end(); ++it ) + TQStringList dashes = TQStringList::split( TQRegExp("[\\s,]"), params ); + for( TQStringList::Iterator it = dashes.begin(); it != dashes.end(); ++it ) array.append( (*it).toFloat() ); } gc->stroke.dashPattern().setArray( array ); @@ -809,8 +809,8 @@ void SvgImport::parsePA( VObject *obj, SvgGraphicsContext *gc, const QString &co } else if( command == "font-family" ) { - QString family = params; - family.replace( '\'' , ' ' ); + TQString family = params; + family.tqreplace( '\'' , ' ' ); gc->font.setFamily( family ); } else if( command == "font-size" ) @@ -820,7 +820,7 @@ void SvgImport::parsePA( VObject *obj, SvgGraphicsContext *gc, const QString &co } else if( command == "font-weight" ) { - int weight = QFont::Normal; + int weight = TQFont::Normal; // map svg weight to qt weight // svg value qt value @@ -831,7 +831,7 @@ void SvgImport::parsePA( VObject *obj, SvgGraphicsContext *gc, const QString &co // 800,900 87,99 if( params == "bold" ) - weight = QFont::Bold; + weight = TQFont::Bold; else if( params == "lighter" ) { weight = gc->font.weight(); @@ -915,7 +915,7 @@ void SvgImport::parsePA( VObject *obj, SvgGraphicsContext *gc, const QString &co gc->stroke.setColor( strokecolor ); } -void SvgImport::parseStyle( VObject *obj, const QDomElement &e ) +void SvgImport::parseStyle( VObject *obj, const TQDomElement &e ) { SvgGraphicsContext *gc = m_gc.current(); if( !gc ) return; @@ -949,13 +949,13 @@ void SvgImport::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 ); } @@ -972,7 +972,7 @@ void SvgImport::parseStyle( VObject *obj, const QDomElement &e ) gc->stroke.setLineWidth( lineWidth ); } -void SvgImport::parseFont( const QDomElement &e ) +void SvgImport::parseFont( const TQDomElement &e ) { SvgGraphicsContext *gc = m_gc.current(); if( !gc ) return; @@ -987,16 +987,16 @@ void SvgImport::parseFont( const QDomElement &e ) parsePA( 0L, m_gc.current(), "text-decoration", e.attribute( "text-decoration" ) ); } -void SvgImport::parseUse( VGroup *grp, const QDomElement &e ) +void SvgImport::parseUse( VGroup *grp, const TQDomElement &e ) { - QString id = e.attribute( "xlink:href" ); + TQString id = e.attribute( "xlink:href" ); if( !id.isEmpty() ) { addGraphicContext(); setupTransform( e ); - QString key = id.mid( 1 ); + TQString key = id.mid( 1 ); if( !e.attribute( "x" ).isEmpty() && !e.attribute( "y" ).isEmpty() ) { @@ -1006,9 +1006,9 @@ void SvgImport::parseUse( VGroup *grp, const QDomElement &e ) m_gc.current()->matrix.translate(tx,ty); } - if(m_defs.contains(key)) + if(m_defs.tqcontains(key)) { - QDomElement a = m_defs[key]; + TQDomElement a = m_defs[key]; if(a.tagName() == "g" || a.tagName() == "a") parseGroup( grp, a); else @@ -1023,11 +1023,11 @@ void SvgImport::parseUse( VGroup *grp, const QDomElement &e ) } } -void SvgImport::parseGroup( VGroup *grp, const QDomElement &e ) +void SvgImport::parseGroup( VGroup *grp, const TQDomElement &e ) { - 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; // treat svg link <a> as group so we don't miss its child elements @@ -1090,17 +1090,17 @@ void SvgImport::parseGroup( VGroup *grp, const QDomElement &e ) } } -void SvgImport::parseDefs( const QDomElement &e ) +void SvgImport::parseDefs( const TQDomElement &e ) { - 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; - QString definition = b.attribute( "id" ); + TQString definition = b.attribute( "id" ); if( !definition.isEmpty() ) { - if( !m_defs.contains( definition ) ) + if( !m_defs.tqcontains( definition ) ) m_defs.insert( definition, b ); } } @@ -1110,13 +1110,13 @@ void SvgImport::parseDefs( const QDomElement &e ) // Creating functions // --------------------------------------------------------------------------------------- -void SvgImport::createText( VGroup *grp, const QDomElement &b ) +void SvgImport::createText( VGroup *grp, const TQDomElement &b ) { const double pathLength = 10.0; VText *text = 0L; - QString content; - QString anchor; + TQString content; + TQString anchor; VSubpath base( 0L ); VPath *path = 0L; double offset = 0.0; @@ -1139,9 +1139,9 @@ void SvgImport::createText( VGroup *grp, const QDomElement &b ) base.lineTo( KoPoint( x + pathLength, 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(); @@ -1151,8 +1151,8 @@ void SvgImport::createText( VGroup *grp, const QDomElement &b ) if( e.attribute( "xlink:href" ).isEmpty() ) continue; - QString key = e.attribute( "xlink:href" ).mid( 1 ); - if( ! m_defs.contains(key) ) + TQString key = e.attribute( "xlink:href" ).mid( 1 ); + if( ! m_defs.tqcontains(key) ) { // try to find referenced object in document VObject* obj = findObject( key ); @@ -1164,7 +1164,7 @@ void SvgImport::createText( VGroup *grp, const QDomElement &b ) } else { - QDomElement p = m_defs[key]; + TQDomElement p = m_defs[key]; createObject( grp, p, VObject::deleted); } if( ! path ) @@ -1174,7 +1174,7 @@ void SvgImport::createText( VGroup *grp, const QDomElement &b ) if( ! e.attribute( "startOffset" ).isEmpty() ) { - QString start = e.attribute( "startOffset" ); + TQString start = e.attribute( "startOffset" ); if( start.endsWith( "%" ) ) offset = 0.01 * start.remove( '%' ).toDouble(); else @@ -1197,8 +1197,8 @@ void SvgImport::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() ); @@ -1213,8 +1213,8 @@ void SvgImport::createText( VGroup *grp, const QDomElement &b ) if( e.attribute( "xlink:href" ).isEmpty() ) continue; - QString key = e.attribute( "xlink:href" ).mid( 1 ); - if( ! m_defs.contains(key) ) + TQString key = e.attribute( "xlink:href" ).mid( 1 ); + if( ! m_defs.tqcontains(key) ) { // try to find referenced object in document VObject* obj = findObject( key ); @@ -1226,7 +1226,7 @@ void SvgImport::createText( VGroup *grp, const QDomElement &b ) } else { - QDomElement p = m_defs[key]; + TQDomElement p = m_defs[key]; content += p.text(); } } @@ -1263,9 +1263,9 @@ void SvgImport::createText( VGroup *grp, const QDomElement &b ) text->setName( b.attribute("id") ); if( anchor == "middle" ) - text->setAlignment( VText::Center ); + text->tqsetAlignment( VText::Center ); else if( anchor == "end" ) - text->setAlignment( VText::Right ); + text->tqsetAlignment( VText::Right ); if( offset > 0.0 ) text->setOffset( offset ); @@ -1279,7 +1279,7 @@ void SvgImport::createText( VGroup *grp, const QDomElement &b ) delete( m_gc.pop() ); } -void SvgImport::createObject( VGroup *grp, const QDomElement &b, const VObject::VState state, const QDomElement &style ) +void SvgImport::createObject( VGroup *grp, const TQDomElement &b, const VObject::VState state, const TQDomElement &style ) { VObject *obj = 0L; @@ -1327,12 +1327,12 @@ void SvgImport::createObject( VGroup *grp, const QDomElement &b, const VObject:: 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() ); @@ -1357,7 +1357,7 @@ void SvgImport::createObject( VGroup *grp, const QDomElement &b, const VObject:: } else if( b.tagName() == "image" ) { - QString fname = b.attribute("xlink:href"); + TQString fname = b.attribute("xlink:href"); obj = new VImage( 0L, fname ); } diff --git a/filters/karbon/svg/svgimport.h b/filters/karbon/svg/svgimport.h index a558c1fc..24857b65 100644 --- a/filters/karbon/svg/svgimport.h +++ b/filters/karbon/svg/svgimport.h @@ -21,9 +21,9 @@ #define __SVGIMPORT_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> @@ -39,12 +39,13 @@ class VPath; class SvgImport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - SvgImport(KoFilter *parent, const char *name, const QStringList&); + SvgImport(KoFilter *tqparent, const char *name, const TQStringList&); virtual ~SvgImport(); - virtual KoFilter::ConversionStatus convert(const QCString& from, const QCString& to); + virtual KoFilter::ConversiontqStatus convert(const TQCString& from, const TQCString& to); protected: class GradientHelper @@ -56,46 +57,46 @@ protected: } VGradient gradient; bool bbox; - QWMatrix gradientTransform; + TQWMatrix gradientTransform; }; - void parseGroup( VGroup *, const QDomElement & ); - void parseDefs( const QDomElement & ); - void parseUse( VGroup *, const QDomElement & ); - void parseStyle( VObject *, const QDomElement & ); - void parsePA( VObject *, SvgGraphicsContext *, const QString &, const QString & ); - void parseGradient( const QDomElement &, const QDomElement &referencedBy = 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 parseDefs( const TQDomElement & ); + void parseUse( VGroup *, const TQDomElement & ); + void parseStyle( VObject *, const TQDomElement & ); + void parsePA( VObject *, SvgGraphicsContext *, const TQString &, const TQString & ); + void parseGradient( const TQDomElement &, const TQDomElement &referencedBy = 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(); - void createObject( VGroup *grp, const QDomElement &, VObject::VState state = VObject::normal, const QDomElement &style = QDomElement() ); - void createText( VGroup *, const QDomElement & ); - void parseFont( const QDomElement & ); + void createObject( VGroup *grp, const TQDomElement &, VObject::VState state = VObject::normal, const TQDomElement &style = 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 * ); // find gradient with given id in gradient map - GradientHelper* findGradient( const QString &id, const QString &href = 0 ); + GradientHelper* findGradient( const TQString &id, const TQString &href = 0 ); // Determine scaling factor from given matrix - double getScalingFromMatrix( QWMatrix &matrix ); + double getScalingFromMatrix( TQWMatrix &matrix ); - QDomElement mergeStyles( const QDomElement &, const QDomElement & ); + TQDomElement mergeStyles( const TQDomElement &, const TQDomElement & ); private: VDocument m_document; - QPtrStack<SvgGraphicsContext> m_gc; - QMap<QString, GradientHelper> m_gradients; - QMap<QString, QDomElement> m_defs; + TQPtrStack<SvgGraphicsContext> m_gc; + TQMap<TQString, GradientHelper> m_gradients; + TQMap<TQString, TQDomElement> m_defs; KoRect m_outerRect; }; |