diff options
Diffstat (limited to 'karbon/core')
46 files changed, 654 insertions, 654 deletions
diff --git a/karbon/core/vclipgroup.cc b/karbon/core/vclipgroup.cc index fb96f609..2451f321 100644 --- a/karbon/core/vclipgroup.cc +++ b/karbon/core/vclipgroup.cc @@ -22,7 +22,7 @@ #include <config.h> #endif -#include <qdom.h> +#include <tqdom.h> #include <kdebug.h> @@ -32,7 +32,7 @@ #include "vsegment.h" #include <vpainter.h> #include "vtext.h" -VClipGroup::VClipGroup( VObject* parent, VState state ) : VGroup( parent, state ) {} +VClipGroup::VClipGroup( VObject* tqparent, VState state ) : VGroup( tqparent, state ) {} VClipGroup::VClipGroup( const VClipGroup& group ) : VGroup( group ) {} VClipGroup::~VClipGroup() { } @@ -72,9 +72,9 @@ VClipGroup* VClipGroup::clone() const } -void VClipGroup::save( QDomElement& element ) const +void VClipGroup::save( TQDomElement& element ) const { - QDomElement me = element.ownerDocument().createElement( "CLIP" ); + TQDomElement me = element.ownerDocument().createElement( "CLIP" ); element.appendChild( me ); // save objects: @@ -84,18 +84,18 @@ void VClipGroup::save( QDomElement& element ) const itr.current()->save( me ); } -void VClipGroup::load( const QDomElement& element ) +void VClipGroup::load( const TQDomElement& element ) { m_objects.setAutoDelete( true ); m_objects.clear(); m_objects.setAutoDelete( false ); - QDomNodeList list = element.childNodes(); + TQDomNodeList list = element.childNodes(); for( uint i = 0; i < list.count(); ++i ) { if( list.item( i ).isElement() ) { - QDomElement e = list.item( i ).toElement(); + TQDomElement e = list.item( i ).toElement(); if( e.tagName() == "COMPOSITE" || e.tagName() == "PATH" ) // TODO : remove COMPOSITE later { @@ -146,7 +146,7 @@ void PathRenderer::visitVSubpath( VSubpath& path ) KoPoint p2; KoPoint p3; - QString buffer; + TQString buffer; if(segment->state() != VSegment::deleted) { diff --git a/karbon/core/vclipgroup.h b/karbon/core/vclipgroup.h index 640f3b11..f53055c6 100644 --- a/karbon/core/vclipgroup.h +++ b/karbon/core/vclipgroup.h @@ -33,7 +33,7 @@ class VPainter; class KARBONBASE_EXPORT VClipGroup : public VGroup { public: - VClipGroup( VObject* parent, VState state = normal ); + VClipGroup( VObject* tqparent, VState state = normal ); VClipGroup ( const VClipGroup& group ); virtual ~VClipGroup(); @@ -42,8 +42,8 @@ public: virtual VClipGroup* clone() const; - virtual void save( QDomElement& element ) const; - virtual void load( const QDomElement& element ); + virtual void save( TQDomElement& element ) const; + virtual void load( const TQDomElement& element ); }; diff --git a/karbon/core/vcolor.cc b/karbon/core/vcolor.cc index c82777eb..f8f237d5 100644 --- a/karbon/core/vcolor.cc +++ b/karbon/core/vcolor.cc @@ -19,7 +19,7 @@ */ -#include <qdom.h> +#include <tqdom.h> #include "vcolor.h" #include "vglobal.h" @@ -47,7 +47,7 @@ VColor::VColor( const VColor& color ) m_value[3] = color.m_value[3]; } -VColor::VColor( const QColor& color ) +VColor::VColor( const TQColor& color ) { m_colorSpace = rgb; m_opacity = 1.0; @@ -57,12 +57,12 @@ VColor::VColor( const QColor& color ) m_value[2] = color.blue() / 255.0; } -VColor::operator QColor() const +VColor::operator TQColor() const { VColor copy( *this ); copy.convertToColorSpace( rgb ); - QColor color; + TQColor color; color.setRgb( int( 255 * copy[0] ), int( 255 * copy[1] ), int( 255 * copy[2] ) ); return color; @@ -294,9 +294,9 @@ VColor::convertToColorSpace( const VColorSpace colorSpace ) } void -VColor::save( QDomElement& element ) const +VColor::save( TQDomElement& element ) const { - QDomElement me = element.ownerDocument().createElement( "COLOR" ); + TQDomElement me = element.ownerDocument().createElement( "COLOR" ); element.appendChild( me ); if( m_colorSpace != rgb ) @@ -318,7 +318,7 @@ VColor::save( QDomElement& element ) const } void -VColor::load( const QDomElement& element ) +VColor::load( const TQDomElement& element ) { switch( element.attribute( "colorSpace" ).toUShort() ) { diff --git a/karbon/core/vcolor.h b/karbon/core/vcolor.h index cf48370e..4b1534e0 100644 --- a/karbon/core/vcolor.h +++ b/karbon/core/vcolor.h @@ -22,10 +22,10 @@ #define __VCOLOR_H__ -#include <qcolor.h> -#include <qstring.h> +#include <tqcolor.h> +#include <tqstring.h> #include <koffice_export.h> -class QDomElement; +class TQDomElement; /** @@ -63,16 +63,16 @@ public: VColor( const VColor& color ); /** - * Constructs a new VColor by copying data from the specified QColor + * Constructs a new VColor by copying data from the specified TQColor * * @param color the color to copy from */ - VColor( const QColor& color ); + VColor( const TQColor& color ); /** - * Cast operator to QColor. + * Cast operator to TQColor. */ - operator QColor() const; + operator TQColor() const; /** * Index operator to access color components. @@ -159,14 +159,14 @@ public: * * @param element the DOM element to which the attributes are saved */ - void save( QDomElement& element ) const; + void save( TQDomElement& element ) const; /** * Load this color's state from xml and initialize it accordingly. * * @param element the DOM element from which the attributes are read */ - void load( const QDomElement& element ); + void load( const TQDomElement& element ); private: void convertToColorSpace( const VColorSpace colorSpace ); @@ -176,7 +176,7 @@ private: float m_value[4]; float m_opacity; - QString m_name; + TQString m_name; }; #endif diff --git a/karbon/core/vcomposite.cc b/karbon/core/vcomposite.cc index 8cd61311..d8eaf027 100644 --- a/karbon/core/vcomposite.cc +++ b/karbon/core/vcomposite.cc @@ -17,10 +17,10 @@ * Boston, MA 02110-1301, USA. */ -#include <qdom.h> -#include <qpainter.h> -#include <qwmatrix.h> -#include <qregexp.h> +#include <tqdom.h> +#include <tqpainter.h> +#include <tqwmatrix.h> +#include <tqregexp.h> #include <KoPoint.h> #include <KoRect.h> @@ -44,8 +44,8 @@ #include <kdebug.h> -VPath::VPath( VObject* parent, VState state ) - : VObject( parent, state ), m_fillRule( winding ) +VPath::VPath( VObject* tqparent, VState state ) + : VObject( tqparent, state ), m_fillRule( winding ) { m_paths.setAutoDelete( true ); @@ -124,9 +124,9 @@ VPath::draw( VPainter* painter, const KoRect *rect ) const if( !itr.current()->isEmpty() ) { painter->newPath(); - painter->setRasterOp( Qt::XorROP ); - painter->setPen( Qt::yellow ); - painter->setBrush( Qt::NoBrush ); + painter->setRasterOp( TQt::XorROP ); + painter->setPen( TQt::yellow ); + painter->setBrush( TQt::NoBrush ); VSubpathIterator jtr( *( itr.current() ) ); for( ; jtr.current(); ++jtr ) @@ -156,14 +156,14 @@ VPath::draw( VPainter* painter, const KoRect *rect ) const } } - painter->setRasterOp( Qt::CopyROP ); - painter->setPen( Qt::NoPen ); + painter->setRasterOp( TQt::CopyROP ); + painter->setPen( TQt::NoPen ); painter->setBrush( *fill() ); painter->fillPath(); // draw stroke: painter->setPen( *stroke() ); - painter->setBrush( Qt::NoBrush ); + painter->setBrush( TQt::NoBrush ); painter->strokePath(); } @@ -264,7 +264,7 @@ bool VPath::pointIsInside( const KoPoint& p ) const { // Check if point is inside boundingbox. - if( !boundingBox().contains( p ) ) + if( !boundingBox().tqcontains( p ) ) return false; @@ -340,16 +340,16 @@ VPath::clone() const } void -VPath::save( QDomElement& element ) const +VPath::save( TQDomElement& element ) const { if( state() != deleted ) { - QDomElement me = element.ownerDocument().createElement( "PATH" ); + TQDomElement me = element.ownerDocument().createElement( "PATH" ); element.appendChild( me ); VObject::save( me ); - QString d; + TQString d; saveSvgPath( d ); me.setAttribute( "d", d ); @@ -368,7 +368,7 @@ VPath::saveOasis( KoStore *store, KoXmlWriter *docWriter, KoGenStyles &mainStyle { docWriter->startElement( "draw:path" ); - QString d; + TQString d; saveSvgPath( d ); docWriter->addAttribute( "svg:d", d ); @@ -377,7 +377,7 @@ VPath::saveOasis( KoStore *store, KoXmlWriter *docWriter, KoGenStyles &mainStyle double w = boundingBox().width(); double h = boundingBox().height(); - docWriter->addAttribute( "svg:viewBox", QString( "%1 %2 %3 %4" ).arg( x ).arg( y ).arg( w ).arg( h ) ); + docWriter->addAttribute( "svg:viewBox", TQString( "%1 %2 %3 %4" ).tqarg( x ).tqarg( y ).tqarg( w ).tqarg( h ) ); docWriter->addAttributePt( "svg:x", x ); docWriter->addAttributePt( "svg:y", y ); docWriter->addAttributePt( "svg:width", w ); @@ -385,11 +385,11 @@ VPath::saveOasis( KoStore *store, KoXmlWriter *docWriter, KoGenStyles &mainStyle VObject::saveOasis( store, docWriter, mainStyles, index ); - QWMatrix tmpMat; + TQWMatrix tmpMat; tmpMat.scale( 1, -1 ); tmpMat.translate( 0, -document()->height() ); - QString transform = buildOasisTransform( tmpMat ); + TQString transform = buildOasisTransform( tmpMat ); if( !transform.isEmpty() ) docWriter->addAttribute( "draw:transform", transform ); @@ -402,7 +402,7 @@ VPath::saveOasisFill( KoGenStyles &mainStyles, KoGenStyle &stylesobjectauto ) co { if( m_fill ) { - QWMatrix mat; + TQWMatrix mat; mat.scale( 1, -1 ); mat.translate( 0, -document()->height() ); @@ -417,19 +417,19 @@ VPath::saveOasisFill( KoGenStyles &mainStyles, KoGenStyle &stylesobjectauto ) co } void -VPath::transformByViewbox( const QDomElement &element, QString viewbox ) +VPath::transformByViewbox( const TQDomElement &element, TQString viewbox ) { if( ! viewbox.isEmpty() ) { // allow for viewbox def with ',' or whitespace - QStringList points = QStringList::split( ' ', viewbox.replace( ',', ' ' ).simplifyWhiteSpace() ); + TQStringList points = TQStringList::split( ' ', viewbox.tqreplace( ',', ' ' ).simplifyWhiteSpace() ); - double w = KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "width", QString::null ) ); - double h = KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "height", QString::null ) ); - double x = KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "x", QString::null ) ); - double y = KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "y", QString::null ) ); + double w = KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "width", TQString() ) ); + double h = KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "height", TQString() ) ); + double x = KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "x", TQString() ) ); + double y = KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "y", TQString() ) ); - QWMatrix mat; + TQWMatrix mat; mat.translate( x-KoUnit::parseValue( points[0] ), y-KoUnit::parseValue( points[1] ) ); mat.scale( w / KoUnit::parseValue( points[2] ) , h / KoUnit::parseValue( points[3] ) ); VTransformCmd cmd( 0L, mat ); @@ -438,42 +438,42 @@ VPath::transformByViewbox( const QDomElement &element, QString viewbox ) } bool -VPath::loadOasis( const QDomElement &element, KoOasisLoadingContext &context ) +VPath::loadOasis( const TQDomElement &element, KoOasisLoadingContext &context ) { setState( normal ); - QString viewbox; + TQString viewbox; if( element.localName() == "path" ) { - QString data = element.attributeNS( KoXmlNS::svg, "d", QString::null ); + TQString data = element.attributeNS( KoXmlNS::svg, "d", TQString() ); if( data.length() > 0 ) { loadSvgPath( data ); } - m_fillRule = element.attributeNS( KoXmlNS::svg, "fill-rule", QString::null ) == "winding" ? winding : evenOdd; + m_fillRule = element.attributeNS( KoXmlNS::svg, "fill-rule", TQString() ) == "winding" ? winding : evenOdd; - viewbox = element.attributeNS( KoXmlNS::svg, "viewBox", QString::null ); + viewbox = element.attributeNS( KoXmlNS::svg, "viewBox", TQString() ); } - else if( element.localName() == "custom-shape" ) + else if( element.localName() == "custom-tqshape" ) { - QDomNodeList list = element.childNodes(); + TQDomNodeList list = element.childNodes(); for( uint i = 0; i < list.count(); ++i ) { if( list.item( i ).isElement() ) { - QDomElement e = list.item( i ).toElement(); + TQDomElement e = list.item( i ).toElement(); if( e.namespaceURI() != KoXmlNS::draw ) continue; - if( e.localName() == "enhanced-geometry" ) + if( e.localName() == "enhanced-tqgeometry" ) { - QString data = e.attributeNS( KoXmlNS::draw, "enhanced-path", QString::null ); + TQString data = e.attributeNS( KoXmlNS::draw, "enhanced-path", TQString() ); if( ! data.isEmpty() ) loadSvgPath( data ); - viewbox = e.attributeNS( KoXmlNS::svg, "viewBox", QString::null ); + viewbox = e.attributeNS( KoXmlNS::svg, "viewBox", TQString() ); } } } @@ -481,7 +481,7 @@ VPath::loadOasis( const QDomElement &element, KoOasisLoadingContext &context ) transformByViewbox( element, viewbox ); - QString trafo = element.attributeNS( KoXmlNS::draw, "transform", QString::null ); + TQString trafo = element.attributeNS( KoXmlNS::draw, "transform", TQString() ); if( !trafo.isEmpty() ) transformOasis( trafo ); @@ -489,24 +489,24 @@ VPath::loadOasis( const QDomElement &element, KoOasisLoadingContext &context ) } void -VPath::load( const QDomElement& element ) +VPath::load( const TQDomElement& element ) { setState( normal ); VObject::load( element ); - QString data = element.attribute( "d" ); + TQString data = element.attribute( "d" ); if( data.length() > 0 ) { loadSvgPath( data ); } m_fillRule = element.attribute( "fillRule" ) == 0 ? evenOdd : winding; - QDomNodeList list = element.childNodes(); + TQDomNodeList list = element.childNodes(); for( uint i = 0; i < list.count(); ++i ) { if( list.item( i ).isElement() ) { - QDomElement child = list.item( i ).toElement(); + TQDomElement child = list.item( i ).toElement(); if( child.tagName() == "PATH" ) { @@ -522,21 +522,21 @@ VPath::load( const QDomElement& element ) } } - QString trafo = element.attribute( "transform" ); + TQString trafo = element.attribute( "transform" ); if( !trafo.isEmpty() ) transform( trafo ); } void -VPath::loadSvgPath( const QString &d ) +VPath::loadSvgPath( const TQString &d ) { - //QTime s;s.start(); + //TQTime s;s.start(); parseSVG( d, true ); //kdDebug(38000) << "Parsing time : " << s.elapsed() << endl; } void -VPath::saveSvgPath( QString &d ) const +VPath::saveSvgPath( TQString &d ) const { // save paths to svg: VSubpathListIterator itr( m_paths ); @@ -578,36 +578,36 @@ VPath::accept( VVisitor& visitor ) } void -VPath::transform( const QString &transform ) +VPath::transform( const TQString &transform ) { VTransformCmd cmd( 0L, parseTransform( transform ) ); cmd.visitVPath( *this ); } void -VPath::transformOasis( const QString &transform ) +VPath::transformOasis( const TQString &transform ) { VTransformCmd cmd( 0L, parseOasisTransform( transform ) ); cmd.visitVPath( *this ); } -QWMatrix -VPath::parseTransform( const QString &transform ) +TQWMatrix +VPath::parseTransform( const TQString &transform ) { - QWMatrix result; + TQWMatrix result; // Split string for handling 1 transform statement at a time - QStringList subtransforms = QStringList::split(')', transform); - QStringList::ConstIterator it = subtransforms.begin(); - QStringList::ConstIterator end = subtransforms.end(); + TQStringList subtransforms = TQStringList::split(')', transform); + TQStringList::ConstIterator it = subtransforms.begin(); + TQStringList::ConstIterator end = subtransforms.end(); for(; it != end; ++it) { - QStringList subtransform = QStringList::split('(', (*it)); + TQStringList subtransform = TQStringList::split('(', (*it)); subtransform[0] = subtransform[0].stripWhiteSpace().lower(); subtransform[1] = subtransform[1].simplifyWhiteSpace(); - QRegExp reg("[,( ]"); - QStringList params = QStringList::split(reg, subtransform[1]); + TQRegExp reg("[,( ]"); + TQStringList params = TQStringList::split(reg, subtransform[1]); if(subtransform[0].startsWith(";") || subtransform[0].startsWith(",")) subtransform[0] = subtransform[0].right(subtransform[0].length() - 1); @@ -656,23 +656,23 @@ VPath::parseTransform( const QString &transform ) return result; } -QWMatrix -VPath::parseOasisTransform( const QString &transform ) +TQWMatrix +VPath::parseOasisTransform( const TQString &transform ) { - QWMatrix result; + TQWMatrix result; // Split string for handling 1 transform statement at a time - QStringList subtransforms = QStringList::split(')', transform); - QStringList::ConstIterator it = subtransforms.begin(); - QStringList::ConstIterator end = subtransforms.end(); + TQStringList subtransforms = TQStringList::split(')', transform); + TQStringList::ConstIterator it = subtransforms.begin(); + TQStringList::ConstIterator end = subtransforms.end(); for(; it != end; ++it) { - QStringList subtransform = QStringList::split('(', (*it)); + TQStringList subtransform = TQStringList::split('(', (*it)); subtransform[0] = subtransform[0].stripWhiteSpace().lower(); subtransform[1] = subtransform[1].simplifyWhiteSpace(); - QRegExp reg("[,( ]"); - QStringList params = QStringList::split(reg, subtransform[1]); + TQRegExp reg("[,( ]"); + TQStringList params = TQStringList::split(reg, subtransform[1]); if(subtransform[0].startsWith(";") || subtransform[0].startsWith(",")) subtransform[0] = subtransform[0].right(subtransform[0].length() - 1); @@ -730,46 +730,46 @@ VPath::parseOasisTransform( const QString &transform ) return result; } -QString +TQString VPath::buildSvgTransform() const { return buildSvgTransform( m_matrix ); } -QString -VPath::buildSvgTransform( const QWMatrix &mat ) const +TQString +VPath::buildSvgTransform( const TQWMatrix &mat ) const { - QString transform; + TQString transform; if( !mat.isIdentity() ) { - transform = QString( "matrix(%1, %2, %3, %4, %5, %6)" ).arg( mat.m11() ) - .arg( mat.m12() ) - .arg( mat.m21() ) - .arg( mat.m22() ) - .arg( mat.dx() ) - .arg( mat.dy() ); + transform = TQString( "matrix(%1, %2, %3, %4, %5, %6)" ).tqarg( mat.m11() ) + .tqarg( mat.m12() ) + .tqarg( mat.m21() ) + .tqarg( mat.m22() ) + .tqarg( mat.dx() ) + .tqarg( mat.dy() ); } return transform; } -QString +TQString VPath::buildOasisTransform() const { return buildSvgTransform( m_matrix ); } -QString -VPath::buildOasisTransform( const QWMatrix &mat ) const +TQString +VPath::buildOasisTransform( const TQWMatrix &mat ) const { - QString transform; + TQString transform; if( !mat.isIdentity() ) { - transform = QString( "matrix(%1, %2, %3, %4, %5pt, %6pt)" ).arg( mat.m11() ) - .arg( mat.m12() ) - .arg( mat.m21() ) - .arg( mat.m22() ) - .arg( mat.dx() ) - .arg( mat.dy() ); + transform = TQString( "matrix(%1, %2, %3, %4, %5pt, %6pt)" ).tqarg( mat.m11() ) + .tqarg( mat.m12() ) + .tqarg( mat.m21() ) + .tqarg( mat.m22() ) + .tqarg( mat.dx() ) + .tqarg( mat.dy() ); } return transform; } diff --git a/karbon/core/vcomposite.h b/karbon/core/vcomposite.h index e786294b..bcac57dd 100644 --- a/karbon/core/vcomposite.h +++ b/karbon/core/vcomposite.h @@ -21,7 +21,7 @@ #define __VCOMPOSITE_H__ -#include <qptrlist.h> +#include <tqptrlist.h> #include <KoPoint.h> @@ -30,14 +30,14 @@ #include "vfillrule.h" #include <koffice_export.h> -class QDomElement; +class TQDomElement; class VPainter; class VSegment; class VVisitor; class VSubpath; -typedef QPtrList<VSubpath> VSubpathList; -typedef QPtrListIterator<VSubpath> VSubpathListIterator; +typedef TQPtrList<VSubpath> VSubpathList; +typedef TQPtrListIterator<VSubpath> VSubpathListIterator; /** @@ -47,7 +47,7 @@ typedef QPtrListIterator<VSubpath> VSubpathListIterator; class KARBONBASE_EXPORT VPath : public VObject, SVGPathParser { public: - VPath( VObject* parent, VState state = normal ); + VPath( VObject* tqparent, VState state = normal ); VPath( const VPath& path ); virtual ~VPath(); @@ -187,36 +187,36 @@ public: } - virtual void save( QDomElement& element ) const; + virtual void save( TQDomElement& element ) const; virtual void saveOasis( KoStore *store, KoXmlWriter *docWriter, KoGenStyles &mainStyles, int &index ) const; - virtual void load( const QDomElement& element ); - virtual bool loadOasis( const QDomElement &element, KoOasisLoadingContext &context ); + virtual void load( const TQDomElement& element ); + virtual bool loadOasis( const TQDomElement &element, KoOasisLoadingContext &context ); virtual VPath* clone() const; virtual void accept( VVisitor& visitor ); - void transform( const QString &transform ); - void transformOasis( const QString &transform ); + void transform( const TQString &transform ); + void transformOasis( const TQString &transform ); - static QWMatrix parseTransform( const QString &transform ); + static TQWMatrix parseTransform( const TQString &transform ); - void transform( const QWMatrix &mat ) + void transform( const TQWMatrix &mat ) { m_matrix *= mat; } - void loadSvgPath( const QString & ); - void saveSvgPath( QString & ) const; + void loadSvgPath( const TQString & ); + void saveSvgPath( TQString & ) const; protected: - QString buildSvgTransform() const; - QString buildSvgTransform( const QWMatrix &mat ) const; - QString buildOasisTransform() const; - QString buildOasisTransform( const QWMatrix &mat ) const; + TQString buildSvgTransform() const; + TQString buildSvgTransform( const TQWMatrix &mat ) const; + TQString buildOasisTransform() const; + TQString buildOasisTransform( const TQWMatrix &mat ) const; - void transformByViewbox( const QDomElement &element, QString viewbox ); + void transformByViewbox( const TQDomElement &element, TQString viewbox ); /// For svg path data parsing. virtual void svgMoveTo( double x1, double y1, bool abs = true ); @@ -225,10 +225,10 @@ protected: virtual void svgClosePath(); virtual void saveOasisFill( KoGenStyles &mainStyles, KoGenStyle &stylesojectauto ) const; - QWMatrix parseOasisTransform( const QString &transform ); + TQWMatrix parseOasisTransform( const TQString &transform ); protected: - QWMatrix m_matrix; + TQWMatrix m_matrix; private: /** diff --git a/karbon/core/vcursor.cc b/karbon/core/vcursor.cc index ed9d1f8d..a44004f2 100644 --- a/karbon/core/vcursor.cc +++ b/karbon/core/vcursor.cc @@ -18,7 +18,7 @@ */ #include "vcursor.h" -#include <qbitmap.h> +#include <tqbitmap.h> static const char* const cminus[] = { "16 16 6 1", @@ -72,7 +72,7 @@ static const char* const cplus[] = { "OOOOOOOOOOOOO O" }; -QCursor VCursor::createCursor( CursorType type ) +TQCursor VCursor::createCursor( CursorType type ) { switch( type ) { @@ -80,69 +80,69 @@ QCursor VCursor::createCursor( CursorType type ) return crossHair(); break; case ZoomPlus: - return QCursor( QPixmap( ( const char**) cplus ), -1, -1 ); + return TQCursor( TQPixmap( ( const char**) cplus ), -1, -1 ); break; case ZoomMinus: - return QCursor( QPixmap( ( const char**) cminus ), -1, -1 ); + return TQCursor( TQPixmap( ( const char**) cminus ), -1, -1 ); break; case NeedleArrow: return needleArrow(); break; - default: return QCursor( Qt::arrowCursor ); + default: return TQCursor( TQt::arrowCursor ); } } -QCursor VCursor::createCursor( const char * bitmap[], const char * mask[], int hotX, int hotY ) +TQCursor VCursor::createCursor( const char * bitmap[], const char * tqmask[], int hotX, int hotY ) { - // the cursor bitmap and mask - QBitmap b, m; + // the cursor bitmap and tqmask + TQBitmap b, m; - b = QPixmap( (const char**) bitmap ); - m = QPixmap( (const char**) mask ); + b = TQPixmap( (const char**) bitmap ); + m = TQPixmap( (const char**) tqmask ); - return QCursor( b, m, hotX, hotY ); + return TQCursor( b, m, hotX, hotY ); } -QCursor VCursor::crossHair() +TQCursor VCursor::crossHair() { static unsigned char cross_bits[] = { 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0xff, 0x7f, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00}; - QBitmap b = QBitmap( 15, 15, cross_bits, true ); - QBitmap m = b.createHeuristicMask( false ); + TQBitmap b = TQBitmap( 15, 15, cross_bits, true ); + TQBitmap m = b.createHeuristicMask( false ); - return QCursor( b, m, 7, 7 ); + return TQCursor( b, m, 7, 7 ); } -QCursor VCursor::needleArrow() +TQCursor VCursor::needleArrow() { static unsigned char needle_bits[] = { 0x00, 0x00, 0x10, 0x00, 0x20, 0x00, 0x60, 0x00, 0xc0, 0x00, 0xc0, 0x01, 0x80, 0x03, 0x80, 0x07, 0x00, 0x0f, 0x00, 0x1f, 0x00, 0x3e, 0x00, 0x7e, 0x00, 0x7c, 0x00, 0x1c, 0x00, 0x18, 0x00, 0x00}; - QBitmap b = QBitmap( 16, 16, needle_bits, true ); - QBitmap m = b.createHeuristicMask( false ); + TQBitmap b = TQBitmap( 16, 16, needle_bits, true ); + TQBitmap m = b.createHeuristicMask( false ); - return QCursor( b, m, 2, 0 ); + return TQCursor( b, m, 2, 0 ); } -QCursor VCursor::needleMoveArrow() +TQCursor VCursor::needleMoveArrow() { static unsigned char needle_move_bits[] = { 0x00, 0x00, 0x10, 0x00, 0x20, 0x00, 0x60, 0x00, 0xc0, 0x00, 0xc0, 0x01, 0x80, 0x03, 0x80, 0x07, 0x10, 0x0f, 0x38, 0x1f, 0x54, 0x3e, 0xfe, 0x7e, 0x54, 0x7c, 0x38, 0x1c, 0x10, 0x18, 0x00, 0x00}; - QBitmap b = QBitmap( 16, 16, needle_move_bits, true ); - QBitmap m = b.createHeuristicMask( false ); + TQBitmap b = TQBitmap( 16, 16, needle_move_bits, true ); + TQBitmap m = b.createHeuristicMask( false ); - return QCursor( b, m, 2, 0 ); + return TQCursor( b, m, 2, 0 ); } -QCursor VCursor::horzMove() +TQCursor VCursor::horzMove() { /* #define horzMove_width 15 @@ -159,8 +159,8 @@ QCursor VCursor::horzMove() 0x0c, 0x18, 0xfe, 0x3f, 0x0c, 0x18, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - QBitmap b = QBitmap( 15, 15, horzMove_bits, true ); - QBitmap m = b.createHeuristicMask( false ); + TQBitmap b = TQBitmap( 15, 15, horzMove_bits, true ); + TQBitmap m = b.createHeuristicMask( false ); - return QCursor( b, m, 7, 7 ); + return TQCursor( b, m, 7, 7 ); } diff --git a/karbon/core/vcursor.h b/karbon/core/vcursor.h index 84c89648..90ab1673 100644 --- a/karbon/core/vcursor.h +++ b/karbon/core/vcursor.h @@ -20,14 +20,14 @@ #ifndef __VCURSOR_H__ #define __VCURSOR_H__ -#include <qcursor.h> +#include <tqcursor.h> #include <koffice_export.h> /** * A helper class for easily creating cursors from XPMs. * * One can create a predefined unthemed cursor or create a cursor from two given XMPs, -* the cursor bitmap and the cursor mask. +* the cursor bitmap and the cursor tqmask. */ class KARBONBASE_EXPORT VCursor { @@ -47,24 +47,24 @@ public: * @param type the requested cursor id * @return the predefined cursor */ - static QCursor createCursor( CursorType type ); + static TQCursor createCursor( CursorType type ); /** * Creates a cursor from two specified XPM images. - * This is only a wrapper function for a QCursor ctor. + * This is only a wrapper function for a TQCursor ctor. */ - static QCursor createCursor( const char * bitmap[], const char * mask[], int hotX = -1, int hotY = -1 ); + static TQCursor createCursor( const char * bitmap[], const char * tqmask[], int hotX = -1, int hotY = -1 ); /** crosshair cursor */ - static QCursor crossHair(); + static TQCursor crossHair(); /** needle arraow cursor */ - static QCursor needleArrow(); + static TQCursor needleArrow(); /** needle arrow with four way arrow */ - static QCursor needleMoveArrow(); + static TQCursor needleMoveArrow(); - static QCursor horzMove(); + static TQCursor horzMove(); private: // prevent instantiation diff --git a/karbon/core/vdashpattern.cc b/karbon/core/vdashpattern.cc index e758e824..cc167584 100644 --- a/karbon/core/vdashpattern.cc +++ b/karbon/core/vdashpattern.cc @@ -17,7 +17,7 @@ * Boston, MA 02110-1301, USA. */ -#include <qdom.h> +#include <tqdom.h> #include "vdashpattern.h" @@ -27,19 +27,19 @@ VDashPattern::VDashPattern( double offset ) } void -VDashPattern::save( QDomElement& element ) const +VDashPattern::save( TQDomElement& element ) const { if( m_array.size() != 0 ) { - QDomElement me = element.ownerDocument().createElement( "DASHPATTERN" ); + TQDomElement me = element.ownerDocument().createElement( "DASHPATTERN" ); element.appendChild( me ); if( m_offset != 0.0 ) me.setAttribute( "offset", m_offset ); - QDomElement dash; + TQDomElement dash; - QValueListConstIterator<float> itr; + TQValueListConstIterator<float> itr; for( itr = m_array.begin(); itr != m_array.end(); ++itr ) { dash = element.ownerDocument().createElement( "DASH" ); @@ -50,18 +50,18 @@ VDashPattern::save( QDomElement& element ) const } void -VDashPattern::load( const QDomElement& element ) +VDashPattern::load( const TQDomElement& element ) { m_offset = element.attribute( "offset", "0.0" ).toDouble(); float value; - QDomNodeList list = element.childNodes(); + TQDomNodeList list = element.childNodes(); for( uint i = 0; i < list.count(); ++i ) { if( list.item( i ).isElement() ) { - QDomElement e = list.item( i ).toElement(); + TQDomElement e = list.item( i ).toElement(); if( e.tagName() == "DASH" ) { value = e.attribute( "l", "0.0" ).toFloat(); diff --git a/karbon/core/vdashpattern.h b/karbon/core/vdashpattern.h index 1abf4e41..9dd3af1d 100644 --- a/karbon/core/vdashpattern.h +++ b/karbon/core/vdashpattern.h @@ -20,10 +20,10 @@ #ifndef __VDASHPATTERN_H__ #define __VDASHPATTERN_H__ -#include <qvaluelist.h> +#include <tqvaluelist.h> #include <koffice_export.h> -class QDomElement; +class TQDomElement; /** @@ -42,19 +42,19 @@ class KARBONBASE_EXPORT VDashPattern public: VDashPattern( double dashOffset = 0.0 ); - const QValueList<float>& array() const { return m_array; } - void setArray( const QValueList<float>& array ) + const TQValueList<float>& array() const { return m_array; } + void setArray( const TQValueList<float>& array ) { m_array = array; } // dash offset: float offset() const { return m_offset; } void setOffset( float offset ) { m_offset = offset; } - void save( QDomElement& element ) const; - void load( const QDomElement& element ); + void save( TQDomElement& element ) const; + void load( const TQDomElement& element ); private: - QValueList<float> m_array; + TQValueList<float> m_array; float m_offset; }; diff --git a/karbon/core/vdocument.cc b/karbon/core/vdocument.cc index d87ad368..0384141b 100644 --- a/karbon/core/vdocument.cc +++ b/karbon/core/vdocument.cc @@ -17,7 +17,7 @@ * Boston, MA 02110-1301, USA. */ -#include <qdom.h> +#include <tqdom.h> #include "vdocument.h" #include "vselection.h" @@ -65,12 +65,12 @@ VDocument::~VDocument() void VDocument::drawPage( VPainter *p, const KoPageLayout &pl, bool showPageMargins ) const { - p->setPen( Qt::black ); - p->setBrush( Qt::white ); + p->setPen( TQt::black ); + p->setBrush( TQt::white ); p->drawRect( 0, 0, m_width, m_height ); - p->setPen( Qt::NoPen ); - p->setBrush( Qt::black ); + p->setPen( TQt::NoPen ); + p->setBrush( TQt::black ); p->drawRect( m_width, - 2, 2, m_height ); p->drawRect( 0, - 2, m_width, 2 ); //p->drawRect( 0, m_height - 1, m_width, 1 ); @@ -82,7 +82,7 @@ VDocument::drawPage( VPainter *p, const KoPageLayout &pl, bool showPageMargins ) double dx = m_gridData.freq.width(); double dy = m_gridData.freq.height(); p->setPen( s ); - p->setBrush( Qt::NoBrush ); + p->setBrush( TQt::NoBrush ); KoPoint p0( dx, dy ); while( p0.x() < m_width ) { @@ -112,11 +112,11 @@ VDocument::drawPage( VPainter *p, const KoPageLayout &pl, bool showPageMargins ) int mb = int( pl.ptBottom ); VStroke s( 0, 1 ); - s.setColor( Qt::blue ); - QValueList<float> dashes; + s.setColor( TQt::blue ); + TQValueList<float> dashes; s.dashPattern().setArray( dashes << 5 << 5 ); p->setPen( s ); - p->setBrush( Qt::NoBrush ); + p->setBrush( TQt::NoBrush ); p->drawRect(ml, mt, m_width-ml-mr, m_height-mt-mb); } } @@ -124,7 +124,7 @@ VDocument::drawPage( VPainter *p, const KoPageLayout &pl, bool showPageMargins ) void VDocument::draw( VPainter *painter, const KoRect* rect ) const { - QPtrListIterator<VLayer> itr = m_layers; + TQPtrListIterator<VLayer> itr = m_layers; for ( ; itr.current(); ++itr ) { @@ -151,20 +151,20 @@ VDocument::removeLayer( VLayer* layer ) bool VDocument::canRaiseLayer( VLayer* layer ) { - int pos = m_layers.find( layer ); + int pos = m_layers.tqfind( layer ); return (pos != int( m_layers.count() ) - 1 && pos >= 0 ); } bool VDocument::canLowerLayer( VLayer* layer ) { - int pos = m_layers.find( layer ); + int pos = m_layers.tqfind( layer ); return (pos>0); } void VDocument::raiseLayer( VLayer* layer ) { - int pos = m_layers.find( layer ); + int pos = m_layers.tqfind( layer ); if( pos != int( m_layers.count() ) - 1 && pos >= 0 ) { VLayer* layer = m_layers.take( pos ); @@ -175,7 +175,7 @@ VDocument::raiseLayer( VLayer* layer ) void VDocument::lowerLayer( VLayer* layer ) { - int pos = m_layers.find( layer ); + int pos = m_layers.tqfind( layer ); if ( pos > 0 ) { VLayer* layer = m_layers.take( pos ); @@ -186,13 +186,13 @@ VDocument::lowerLayer( VLayer* layer ) int VDocument::layerPos( VLayer* layer ) { - return m_layers.find( layer ); + return m_layers.tqfind( layer ); } // VDocument::layerPos void VDocument::setActiveLayer( VLayer* layer ) { - if ( m_layers.find( layer ) != -1 ) + if ( m_layers.tqfind( layer ) != -1 ) m_activeLayer = layer; } // VDocument::setActiveLayer @@ -202,11 +202,11 @@ VDocument::append( VObject* object ) m_activeLayer->append( object ); } -QDomDocument +TQDomDocument VDocument::saveXML() const { - QDomDocument doc; - QDomElement me = doc.createElement( "DOC" ); + TQDomDocument doc; + TQDomElement me = doc.createElement( "DOC" ); doc.appendChild( me ); save( me ); return doc; @@ -231,7 +231,7 @@ VDocument::saveOasis( KoStore *store, KoXmlWriter *docWriter, KoGenStyles &mainS } void -VDocument::save( QDomElement& me ) const +VDocument::save( TQDomElement& me ) const { me.setAttribute( "mime", "application/x-karbon" ), me.setAttribute( "version", "0.1" ); @@ -258,13 +258,13 @@ VDocument::clone() const } void -VDocument::load( const QDomElement& doc ) +VDocument::load( const TQDomElement& doc ) { loadXML( doc ); } bool -VDocument::loadXML( const QDomElement& doc ) +VDocument::loadXML( const TQDomElement& doc ) { if( doc.attribute( "mime" ) != "application/x-karbon" || doc.attribute( "syntaxVersion" ) != "0.1" ) @@ -284,14 +284,14 @@ VDocument::loadXML( const QDomElement& doc ) } void -VDocument::loadDocumentContent( const QDomElement& doc ) +VDocument::loadDocumentContent( const TQDomElement& doc ) { - QDomNodeList list = doc.childNodes(); + TQDomNodeList list = doc.childNodes(); for( uint i = 0; i < list.count(); ++i ) { if( list.item( i ).isElement() ) { - QDomElement e = list.item( i ).toElement(); + TQDomElement e = list.item( i ).toElement(); if( e.tagName() == "LAYER" ) { @@ -304,7 +304,7 @@ VDocument::loadDocumentContent( const QDomElement& doc ) } bool -VDocument::loadOasis( const QDomElement &element, KoOasisLoadingContext &context ) +VDocument::loadOasis( const TQDomElement &element, KoOasisLoadingContext &context ) { return m_layers.current()->loadOasis( element, context ); } @@ -315,9 +315,9 @@ VDocument::accept( VVisitor& visitor ) visitor.visitVDocument( *this ); } -QString +TQString VDocument::objectName( const VObject *obj ) const { - QMap<const VObject *, QString>::ConstIterator it = m_objectNames.find( obj ); + TQMap<const VObject *, TQString>::ConstIterator it = m_objectNames.tqfind( obj ); return it == m_objectNames.end() ? 0L : it.data(); } diff --git a/karbon/core/vdocument.h b/karbon/core/vdocument.h index 577dd1c2..45270d2e 100644 --- a/karbon/core/vdocument.h +++ b/karbon/core/vdocument.h @@ -23,23 +23,23 @@ #include <KoUnit.h> -#include <qstring.h> -#include <qptrlist.h> -#include <qptrdict.h> +#include <tqstring.h> +#include <tqptrlist.h> +#include <tqptrdict.h> #include "vobject.h" #include "karbon_grid_data.h" #include <koffice_export.h> -class QDomDocument; -class QDomElement; +class TQDomDocument; +class TQDomElement; class VSelection; class VLayer; class KoPageLayout; -typedef QPtrList<VLayer> VLayerList; -typedef QPtrListIterator<VLayer> VLayerListIterator; +typedef TQPtrList<VLayer> VLayerList; +typedef TQPtrListIterator<VLayer> VLayerListIterator; /** @@ -83,7 +83,7 @@ public: * Draw the document frame to a painting device. * * @param painter abstraction that is used to render to a painting device. - * @param pl layout describing the page to draw on (restricting the painter) + * @param pl tqlayout describing the page to draw on (restricting the painter) * @param drawPageMargins if @c true, also draw the crop marks for the page margins, * otherwise, don't draw them. */ @@ -216,14 +216,14 @@ public: */ const VLayerList& layers() const { return m_layers; } - QDomDocument saveXML() const; + TQDomDocument saveXML() const; virtual void saveOasis( KoStore *store, KoXmlWriter *docWriter, KoGenStyles &mainStyles ) const; enum { STYLE_GRAPHICAUTO = 20, STYLE_LINEAR_GRADIENT, STYLE_RADIAL_GRADIENT, STYLE_STROKE }; - bool loadXML( const QDomElement& doc ); - virtual bool loadOasis( const QDomElement &element, KoOasisLoadingContext &context ); - virtual void save( QDomElement& element ) const; - virtual void load( const QDomElement& element ); - void loadDocumentContent( const QDomElement& doc ); + bool loadXML( const TQDomElement& doc ); + virtual bool loadOasis( const TQDomElement &element, KoOasisLoadingContext &context ); + virtual void save( TQDomElement& element ) const; + virtual void load( const TQDomElement& element ); + void loadDocumentContent( const TQDomElement& doc ); virtual VDocument* clone() const; @@ -265,7 +265,7 @@ public: * @param obj the object to retrieve name for * @return the custom name of the object or an empty string if no custom name is set */ - QString objectName( const VObject *obj ) const; + TQString objectName( const VObject *obj ) const; /** * Sets custom name of specified object. @@ -276,7 +276,7 @@ public: * @param obj the object to set custom name for * @param name the the custom name to set */ - void setObjectName( const VObject *obj, const QString name ) { m_objectNames.insert( obj, name ); } + void setObjectName( const VObject *obj, const TQString name ) { m_objectNames.insert( obj, name ); } bool saveAsPath() const { return m_saveAsPath; } void saveAsPath( bool b ) { m_saveAsPath = b; } @@ -315,7 +315,7 @@ private: */ KoUnit::Unit m_unit; - QMap<const VObject *, QString> m_objectNames; + TQMap<const VObject *, TQString> m_objectNames; // TODO this flag is used nowhere, can we remove it? bool m_saveAsPath; diff --git a/karbon/core/vfill.cc b/karbon/core/vfill.cc index 44f69f75..549045ae 100644 --- a/karbon/core/vfill.cc +++ b/karbon/core/vfill.cc @@ -18,7 +18,7 @@ * Boston, MA 02110-1301, USA. */ -#include <qdom.h> +#include <tqdom.h> #include <kdebug.h> #include <KoGenStyles.h> @@ -31,8 +31,8 @@ VFill::VFill() : m_type( none ) { - /*m_gradient.addStop( VColor( Qt::red.rgb() ), 0.0 ); - m_gradient.addStop( VColor( Qt::yellow.rgb() ), 1.0 ); + /*m_gradient.addStop( VColor( TQt::red.rgb() ), 0.0 ); + m_gradient.addStop( VColor( TQt::yellow.rgb() ), 1.0 ); m_gradient.setOrigin( KoPoint( 0, 0 ) ); m_gradient.setVector( KoPoint( 0, 50 ) ); m_gradient.setSpreadMethod( gradient_spread_reflect );*/ @@ -48,14 +48,14 @@ VFill::VFill( const VColor &c ) VFill::VFill( const VFill& fill ) { - // doesn't copy parent: + // doesn't copy tqparent: *this = fill; } void -VFill::save( QDomElement& element ) const +VFill::save( TQDomElement& element ) const { - QDomElement me = element.ownerDocument().createElement( "FILL" ); + TQDomElement me = element.ownerDocument().createElement( "FILL" ); element.appendChild( me ); if( !( m_type == none ) ) @@ -81,17 +81,17 @@ VFill::saveOasis( KoGenStyles &mainStyles, KoGenStyle &style ) const if( m_type == solid ) { style.addProperty( "draw:fill", "solid" ); - style.addProperty( "draw:fill-color", QColor( m_color ).name() ); + style.addProperty( "draw:fill-color", TQColor( m_color ).name() ); if( m_color.opacity() < 1 ) - style.addProperty( "draw:opacity", QString( "%1%" ).arg( m_color.opacity() * 100. ) ); + style.addProperty( "draw:opacity", TQString( "%1%" ).tqarg( m_color.opacity() * 100. ) ); } else if( m_type == grad ) { style.addProperty( "draw:fill", "gradient" ); - QString grad = m_gradient.saveOasis( mainStyles ); + TQString grad = m_gradient.saveOasis( mainStyles ); style.addProperty( "draw:fill-gradient-name", grad ); if( m_color.opacity() < 1 ) - style.addProperty( "draw:opacity", QString( "%1%" ).arg( m_color.opacity() * 100. ) ); + style.addProperty( "draw:opacity", TQString( "%1%" ).tqarg( m_color.opacity() * 100. ) ); } else if( m_type == patt ) style.addProperty( "draw:fill", "hatch" ); @@ -100,7 +100,7 @@ VFill::saveOasis( KoGenStyles &mainStyles, KoGenStyle &style ) const } void -VFill::loadOasis( const QDomElement &/*object*/, KoOasisLoadingContext &context, VObject* parent ) +VFill::loadOasis( const TQDomElement &/*object*/, KoOasisLoadingContext &context, VObject* tqparent ) { KoStyleStack &stack = context.styleStack(); if( stack.hasAttributeNS( KoXmlNS::draw, "fill" ) ) @@ -108,17 +108,17 @@ VFill::loadOasis( const QDomElement &/*object*/, KoOasisLoadingContext &context, if( stack.attributeNS( KoXmlNS::draw, "fill" ) == "solid" ) { setType( VFill::solid ); - setColor( QColor( stack.attributeNS( KoXmlNS::draw, "fill-color" ) ) ); + setColor( TQColor( stack.attributeNS( KoXmlNS::draw, "fill-color" ) ) ); } else if( stack.attributeNS( KoXmlNS::draw, "fill" ) == "gradient" ) { setType( VFill::grad ); - QString style = stack.attributeNS( KoXmlNS::draw, "fill-gradient-name" ); + TQString style = stack.attributeNS( KoXmlNS::draw, "fill-gradient-name" ); kdDebug()<<" style gradient name :"<<style<<endl; - QDomElement *grad = context.oasisStyles().drawStyles()[ style ]; + TQDomElement *grad = context.oasisStyles().drawStyles()[ style ]; kdDebug()<<" style gradient name :"<< grad <<endl; if( grad ) - m_gradient.loadOasis( *grad, stack, parent ); + m_gradient.loadOasis( *grad, stack, tqparent ); } if( stack.hasAttributeNS( KoXmlNS::draw, "opacity" ) ) m_color.setOpacity( stack.attributeNS( KoXmlNS::draw, "opacity" ).remove( '%' ).toFloat() / 100. ); @@ -126,17 +126,17 @@ VFill::loadOasis( const QDomElement &/*object*/, KoOasisLoadingContext &context, } void -VFill::load( const QDomElement& element ) +VFill::load( const TQDomElement& element ) { m_type = none; // load color: - QDomNodeList list = element.childNodes(); + TQDomNodeList list = element.childNodes(); for( uint i = 0; i < list.count(); ++i ) { if( list.item( i ).isElement() ) { - QDomElement e = list.item( i ).toElement(); + TQDomElement e = list.item( i ).toElement(); if( e.tagName() == "COLOR" ) { m_type = solid; @@ -161,7 +161,7 @@ VFill::operator=( const VFill& fill ) { if( this != &fill ) { - // dont copy the parent! + // dont copy the tqparent! m_type = fill.m_type; m_color = fill.m_color; m_gradient = fill.m_gradient; @@ -172,7 +172,7 @@ VFill::operator=( const VFill& fill ) } void -VFill::transform( const QWMatrix& m ) +VFill::transform( const TQWMatrix& m ) { if( type() == VFill::grad ) gradient().transform( m ); diff --git a/karbon/core/vfill.h b/karbon/core/vfill.h index 67a31722..d05b8c88 100644 --- a/karbon/core/vfill.h +++ b/karbon/core/vfill.h @@ -26,18 +26,18 @@ #include "vpattern.h" #include <koffice_export.h> -class QDomElement; +class TQDomElement; class KoGenStyle; class KoGenStyles; class KoOasisLoadingContext; /** - * Manages the fill of shapes. + * Manages the fill of tqshapes. * * The fill can be solid or gradient. - * Also two fill rules are supported that effect how the shape is - * filled. For explanation see the QPainter documentation. + * Also two fill rules are supported that effect how the tqshape is + * filled. For explanation see the TQPainter documentation. * * Default is no fill and even-odd filling rule. */ @@ -69,14 +69,14 @@ public: VFillType type() const { return m_type; } void setType( VFillType type ) { m_type = type; } - void save( QDomElement& element ) const; + void save( TQDomElement& element ) const; void saveOasis( KoGenStyles &mainStyles, KoGenStyle &style ) const; - void load( const QDomElement& element ); - void loadOasis( const QDomElement &object, KoOasisLoadingContext &context, VObject* parent = 0L ); + void load( const TQDomElement& element ); + void loadOasis( const TQDomElement &object, KoOasisLoadingContext &context, VObject* tqparent = 0L ); VFill& operator=( const VFill& fill ); - void transform( const QWMatrix& m ); + void transform( const TQWMatrix& m ); private: VColor m_color; diff --git a/karbon/core/vgradient.cc b/karbon/core/vgradient.cc index cd3b55b6..11d6239f 100644 --- a/karbon/core/vgradient.cc +++ b/karbon/core/vgradient.cc @@ -17,8 +17,8 @@ * Boston, MA 02110-1301, USA. */ -#include <qdom.h> -#include <qbuffer.h> +#include <tqdom.h> +#include <tqbuffer.h> #include "vdocument.h" #include "vglobal.h" @@ -28,7 +28,7 @@ #include <KoXmlWriter.h> #include <KoXmlNS.h> -int VGradient::VColorStopList::compareItems( QPtrCollection::Item item1, QPtrCollection::Item item2 ) +int VGradient::VColorStopList::compareItems( TQPtrCollection::Item item1, TQPtrCollection::Item item2 ) { float r1 = ( (VColorStop*)item1 )->rampPoint; float r2 = ( (VColorStop*)item2 )->rampPoint; @@ -66,7 +66,7 @@ VGradient::VGradient( const VGradient& gradient ) m_repeatMethod = gradient.m_repeatMethod; m_colorStops.clear(); - QPtrVector<VColorStop> cs = gradient.colorStops(); + TQPtrVector<VColorStop> cs = gradient.colorStops(); for( uint i = 0; i < cs.count(); i++ ) m_colorStops.append( new VColorStop( *cs[i] ) ); m_colorStops.sort(); @@ -86,7 +86,7 @@ VGradient& VGradient::operator=( const VGradient& gradient ) m_repeatMethod = gradient.m_repeatMethod; m_colorStops.clear(); - QPtrVector<VColorStop> cs = gradient.colorStops(); + TQPtrVector<VColorStop> cs = gradient.colorStops(); for( uint i = 0; i < cs.count(); i++ ) m_colorStops.append( new VColorStop( *cs[i] ) ); m_colorStops.sort(); @@ -94,9 +94,9 @@ VGradient& VGradient::operator=( const VGradient& gradient ) return *this; } // VGradient::operator= -const QPtrVector<VColorStop> VGradient::colorStops() const +const TQPtrVector<VColorStop> VGradient::colorStops() const { - QPtrVector<VColorStop> v; + TQPtrVector<VColorStop> v; m_colorStops.toVector( &v ); v.setAutoDelete( false ); return v; @@ -140,9 +140,9 @@ void VGradient::removeStop( const VColorStop& colorstop ) } // VGradient::removeStop void -VGradient::save( QDomElement& element ) const +VGradient::save( TQDomElement& element ) const { - QDomElement me = element.ownerDocument().createElement( "GRADIENT" ); + TQDomElement me = element.ownerDocument().createElement( "GRADIENT" ); me.setAttribute( "originX", m_origin.x() ); me.setAttribute( "originY", m_origin.y() ); @@ -155,10 +155,10 @@ VGradient::save( QDomElement& element ) const // save stops VColorStop* colorstop; - QPtrList<VColorStop>& colorStops = const_cast<VColorStopList&>( m_colorStops ); + TQPtrList<VColorStop>& colorStops = const_cast<VColorStopList&>( m_colorStops ); for( colorstop = colorStops.first(); colorstop; colorstop = colorStops.next() ) { - QDomElement stop = element.ownerDocument().createElement( "COLORSTOP" ); + TQDomElement stop = element.ownerDocument().createElement( "COLORSTOP" ); colorstop->color.save( stop ); stop.setAttribute( "ramppoint", colorstop->rampPoint ); stop.setAttribute( "midpoint", colorstop->midPoint ); @@ -168,7 +168,7 @@ VGradient::save( QDomElement& element ) const element.appendChild( me ); } -QString +TQString VGradient::saveOasis( KoGenStyles &mainStyles ) const { bool radial = m_type == VGradient::radial; @@ -198,50 +198,50 @@ VGradient::saveOasis( KoGenStyles &mainStyles ) const gradientStyle.addAttribute( "svg:spreadMethod", "reflect" ); else gradientStyle.addAttribute( "svg:spreadMethod", "pad" ); - QBuffer buffer; + TQBuffer buffer; buffer.open( IO_WriteOnly ); - KoXmlWriter elementWriter( &buffer ); // TODO pass indentation level + KoXmlWriter elementWriter( TQT_TQIODEVICE(&buffer) ); // TODO pass indentation level // save stops VColorStop* colorstop; - QPtrList<VColorStop>& colorStops = const_cast<VColorStopList&>( m_colorStops ); + TQPtrList<VColorStop>& colorStops = const_cast<VColorStopList&>( m_colorStops ); for( colorstop = colorStops.first(); colorstop; colorstop = colorStops.next() ) { elementWriter.startElement( "svg:stop" ); - elementWriter.addAttribute( "svg:offset", QString( "%1" ).arg( colorstop->rampPoint ) ); - elementWriter.addAttribute( "svg:color", QColor( colorstop->color ).name() ); + elementWriter.addAttribute( "svg:offset", TQString( "%1" ).tqarg( colorstop->rampPoint ) ); + elementWriter.addAttribute( "svg:color", TQColor( colorstop->color ).name() ); if( colorstop->color.opacity() < 1 ) - elementWriter.addAttribute( "svg:stop-opacity", QString( "%1" ).arg( colorstop->color.opacity() ) ); + elementWriter.addAttribute( "svg:stop-opacity", TQString( "%1" ).tqarg( colorstop->color.opacity() ) ); elementWriter.endElement(); } - QString elementContents = QString::fromUtf8( buffer.buffer(), buffer.buffer().size() ); + TQString elementContents = TQString::fromUtf8( buffer.buffer(), buffer.buffer().size() ); gradientStyle.addChildElement( "svg:stop", elementContents ); return mainStyles.lookup( gradientStyle, "gradient" ); } void -VGradient::loadOasis( const QDomElement &object, KoStyleStack &/*stack*/, VObject* parent ) +VGradient::loadOasis( const TQDomElement &object, KoStyleStack &/*stack*/, VObject* tqparent ) { kdDebug(38000) << "namespaceURI: " << object.namespaceURI() << endl; kdDebug(38000) << "localName: " << object.localName() << endl; KoRect bb; - if( parent ) - bb = parent->boundingBox(); + if( tqparent ) + bb = tqparent->boundingBox(); if( object.namespaceURI() == KoXmlNS::draw && object.localName() == "gradient" ) { m_repeatMethod = VGradient::reflect; - QString strType = object.attributeNS( KoXmlNS::draw, "style", QString::null ); + TQString strType = object.attributeNS( KoXmlNS::draw, "style", TQString() ); if( strType == "radial" ) { m_type = VGradient::radial; // TODO : find out whether Oasis works with boundingBox only? - double cx = KoUnit::parseValue( object.attributeNS( KoXmlNS::draw, "cx", QString::null ).remove("%") ); + double cx = KoUnit::parseValue( object.attributeNS( KoXmlNS::draw, "cx", TQString() ).remove("%") ); m_origin.setX( bb.bottomLeft().x() + bb.width() * 0.01 * cx ); - double cy = KoUnit::parseValue( object.attributeNS( KoXmlNS::draw, "cy", QString::null ).remove("%") ); + double cy = KoUnit::parseValue( object.attributeNS( KoXmlNS::draw, "cy", TQString() ).remove("%") ); m_origin.setY( bb.bottomLeft().y() - bb.height() * 0.01 * cy ); m_focalPoint = m_origin; m_vector = bb.topRight(); @@ -261,8 +261,8 @@ VGradient::loadOasis( const QDomElement &object, KoStyleStack &/*stack*/, VObjec } else return; - VColor startColor( QColor( object.attributeNS( KoXmlNS::draw, "start-color", QString::null ) ) ); - VColor endColor( QColor( object.attributeNS( KoXmlNS::draw, "end-color", QString::null ) ) ); + VColor startColor( TQColor( object.attributeNS( KoXmlNS::draw, "start-color", TQString() ) ) ); + VColor endColor( TQColor( object.attributeNS( KoXmlNS::draw, "end-color", TQString() ) ) ); double startOpacity = 0.01 * object.attributeNS( KoXmlNS::draw, "start-intensity", "100" ).remove("%").toDouble(); double endOpacity = 0.01 * object.attributeNS( KoXmlNS::draw, "end-intensity", "100" ).remove("%").toDouble(); @@ -280,25 +280,25 @@ VGradient::loadOasis( const QDomElement &object, KoStyleStack &/*stack*/, VObjec if( object.localName() == "linearGradient" ) { m_type = VGradient::linear; - m_origin.setX( KoUnit::parseValue( object.attributeNS( KoXmlNS::svg, "x1", QString::null ) ) ); - m_origin.setY( KoUnit::parseValue( object.attributeNS( KoXmlNS::svg, "y1", QString::null ) ) ); - m_vector.setX( KoUnit::parseValue( object.attributeNS( KoXmlNS::svg, "x2", QString::null ) ) ); - m_vector.setY( KoUnit::parseValue( object.attributeNS( KoXmlNS::svg, "y2", QString::null ) ) ); + m_origin.setX( KoUnit::parseValue( object.attributeNS( KoXmlNS::svg, "x1", TQString() ) ) ); + m_origin.setY( KoUnit::parseValue( object.attributeNS( KoXmlNS::svg, "y1", TQString() ) ) ); + m_vector.setX( KoUnit::parseValue( object.attributeNS( KoXmlNS::svg, "x2", TQString() ) ) ); + m_vector.setY( KoUnit::parseValue( object.attributeNS( KoXmlNS::svg, "y2", TQString() ) ) ); m_focalPoint = m_origin; } else if( object.localName() == "radialGradient" ) { m_type = VGradient::radial; - m_origin.setX( KoUnit::parseValue( object.attributeNS( KoXmlNS::svg, "cx", QString::null ) ) ); - m_origin.setY( KoUnit::parseValue( object.attributeNS( KoXmlNS::svg, "cy", QString::null ) ) ); - double r = KoUnit::parseValue( object.attributeNS( KoXmlNS::svg, "r", QString::null ) ); + m_origin.setX( KoUnit::parseValue( object.attributeNS( KoXmlNS::svg, "cx", TQString() ) ) ); + m_origin.setY( KoUnit::parseValue( object.attributeNS( KoXmlNS::svg, "cy", TQString() ) ) ); + double r = KoUnit::parseValue( object.attributeNS( KoXmlNS::svg, "r", TQString() ) ); m_vector.setX( m_origin.x() + r ); m_vector.setY( m_origin.y() ); - m_focalPoint.setX( KoUnit::parseValue( object.attributeNS( KoXmlNS::svg, "fx", QString::null ) ) ); - m_focalPoint.setY( KoUnit::parseValue( object.attributeNS( KoXmlNS::svg, "fy", QString::null ) ) ); + m_focalPoint.setX( KoUnit::parseValue( object.attributeNS( KoXmlNS::svg, "fx", TQString() ) ) ); + m_focalPoint.setY( KoUnit::parseValue( object.attributeNS( KoXmlNS::svg, "fy", TQString() ) ) ); } - QString strSpread( object.attributeNS( KoXmlNS::svg, "spreadMethod", "pad" ) ); + TQString strSpread( object.attributeNS( KoXmlNS::svg, "spreadMethod", "pad" ) ); if( strSpread == "repeat" ) m_repeatMethod = VGradient::repeat; else if( strSpread == "reflect" ) @@ -309,16 +309,16 @@ VGradient::loadOasis( const QDomElement &object, KoStyleStack &/*stack*/, VObjec m_colorStops.clear(); // load stops - QDomNodeList list = object.childNodes(); + TQDomNodeList list = object.childNodes(); for( uint i = 0; i < list.count(); ++i ) { if( list.item( i ).isElement() ) { - QDomElement colorstop = list.item( i ).toElement(); + TQDomElement colorstop = list.item( i ).toElement(); if( colorstop.namespaceURI() == KoXmlNS::svg && colorstop.localName() == "stop" ) { - VColor color( QColor( colorstop.attributeNS( KoXmlNS::svg, "color", QString::null ) ) ); + VColor color( TQColor( colorstop.attributeNS( KoXmlNS::svg, "color", TQString() ) ) ); color.setOpacity( colorstop.attributeNS( KoXmlNS::svg, "stop-opacity", "1.0" ).toDouble() ); addStop( color, colorstop.attributeNS( KoXmlNS::svg, "offset", "0.0" ).toDouble(), 0.5 ); } @@ -329,7 +329,7 @@ VGradient::loadOasis( const QDomElement &object, KoStyleStack &/*stack*/, VObjec } void -VGradient::load( const QDomElement& element ) +VGradient::load( const TQDomElement& element ) { m_origin.setX( element.attribute( "originX", "0.0" ).toDouble() ); m_origin.setY( element.attribute( "originY", "0.0" ).toDouble() ); @@ -343,12 +343,12 @@ VGradient::load( const QDomElement& element ) m_colorStops.clear(); // load stops - QDomNodeList list = element.childNodes(); + TQDomNodeList list = element.childNodes(); for( uint i = 0; i < list.count(); ++i ) { if( list.item( i ).isElement() ) { - QDomElement colorstop = list.item( i ).toElement(); + TQDomElement colorstop = list.item( i ).toElement(); if( colorstop.tagName() == "COLORSTOP" ) { @@ -362,7 +362,7 @@ VGradient::load( const QDomElement& element ) } void -VGradient::transform( const QWMatrix &m ) +VGradient::transform( const TQWMatrix &m ) { m_origin = m_origin.transform( m ); m_focalPoint = m_focalPoint.transform( m ); diff --git a/karbon/core/vgradient.h b/karbon/core/vgradient.h index 5587af7e..8341eeab 100644 --- a/karbon/core/vgradient.h +++ b/karbon/core/vgradient.h @@ -20,15 +20,15 @@ #ifndef __VGRADIENT_H__ #define __VGRADIENT_H__ -#include <qptrlist.h> -#include <qptrvector.h> +#include <tqptrlist.h> +#include <tqptrvector.h> #include <koffice_export.h> #include <KoPoint.h> #include "vcolor.h" -class QDomElement; +class TQDomElement; class KoGenStyle; class KoGenStyles; class KoStyleStack; @@ -74,10 +74,10 @@ public: repeat = 2 }; - class VColorStopList : public QPtrList<VColorStop> + class VColorStopList : public TQPtrList<VColorStop> { protected: - virtual int compareItems( QPtrCollection::Item item1, QPtrCollection::Item item2 ); + virtual int compareItems( TQPtrCollection::Item item1, TQPtrCollection::Item item2 ); }; // VColorStopList VGradient( VGradientType type = linear ); @@ -91,7 +91,7 @@ public: VGradientRepeatMethod repeatMethod() const { return m_repeatMethod; } void setRepeatMethod( VGradientRepeatMethod repeatMethod ) { m_repeatMethod = repeatMethod; } - const QPtrVector<VColorStop> colorStops() const; + const TQPtrVector<VColorStop> colorStops() const; void addStop( const VColorStop& colorStop ); void addStop( const VColor &color, float rampPoint, float midPoint ); void removeStop( const VColorStop& colorStop ); @@ -106,12 +106,12 @@ public: KoPoint vector() const { return m_vector; } void setVector( const KoPoint &vector ) { m_vector = vector; } - void save( QDomElement& element ) const; - QString saveOasis( KoGenStyles &mainStyles ) const; - void load( const QDomElement& element ); - void loadOasis( const QDomElement &object, KoStyleStack &stack, VObject* parent = 0L ); + void save( TQDomElement& element ) const; + TQString saveOasis( KoGenStyles &mainStyles ) const; + void load( const TQDomElement& element ); + void loadOasis( const TQDomElement &object, KoStyleStack &stack, VObject* tqparent = 0L ); - void transform( const QWMatrix& m ); + void transform( const TQWMatrix& m ); protected: VColorStopList m_colorStops; diff --git a/karbon/core/vgroup.cc b/karbon/core/vgroup.cc index d356b2b1..8a426577 100644 --- a/karbon/core/vgroup.cc +++ b/karbon/core/vgroup.cc @@ -21,7 +21,7 @@ #include <config.h> #endif -#include <qdom.h> +#include <tqdom.h> #include <KoStore.h> #include <KoXmlWriter.h> @@ -51,8 +51,8 @@ #include <kdebug.h> -VGroup::VGroup( VObject* parent, VState state ) - : VObject( parent, state ) +VGroup::VGroup( VObject* tqparent, VState state ) + : VObject( tqparent, state ) { m_stroke = new VStroke( this ); m_fill = new VFill(); @@ -157,11 +157,11 @@ VGroup::setState( const VState state ) } void -VGroup::save( QDomElement& element ) const +VGroup::save( TQDomElement& element ) const { if( state() != deleted ) { - QDomElement me = element.ownerDocument().createElement( "GROUP" ); + TQDomElement me = element.ownerDocument().createElement( "GROUP" ); element.appendChild( me ); // save objects: @@ -193,18 +193,18 @@ VGroup::saveOasis( KoStore *store, KoXmlWriter *docWriter, KoGenStyles &mainStyl } bool -VGroup::loadOasis( const QDomElement &element, KoOasisLoadingContext &context ) +VGroup::loadOasis( const TQDomElement &element, KoOasisLoadingContext &context ) { m_objects.setAutoDelete( true ); m_objects.clear(); m_objects.setAutoDelete( false ); - QDomNodeList list = element.childNodes(); + TQDomNodeList list = element.childNodes(); for( uint i = 0; i < list.count(); ++i ) { if( list.item( i ).isElement() ) { - QDomElement e = list.item( i ).toElement(); + TQDomElement e = list.item( i ).toElement(); kdDebug(38000) << "VGroup::loadOasis: e.tagName() = " << e.tagName() << endl; kdDebug(38000) << "VGroup::loadOasis: e.namespaceURI() = " << e.namespaceURI() << endl; @@ -215,7 +215,7 @@ VGroup::loadOasis( const QDomElement &element, KoOasisLoadingContext &context ) context.styleStack().save(); - if( e.localName() == "path" || e.localName() == "custom-shape" ) + if( e.localName() == "path" || e.localName() == "custom-tqshape" ) { VPath* composite = new VPath( this ); composite->loadOasis( e, context ); @@ -260,7 +260,7 @@ VGroup::loadOasis( const QDomElement &element, KoOasisLoadingContext &context ) } void -VGroup::load( const QDomElement& element ) +VGroup::load( const TQDomElement& element ) { m_objects.setAutoDelete( true ); m_objects.clear(); @@ -268,12 +268,12 @@ VGroup::load( const QDomElement& element ) VObject::load( element ); - QDomNodeList list = element.childNodes(); + TQDomNodeList list = element.childNodes(); for( uint i = 0; i < list.count(); ++i ) { if( list.item( i ).isElement() ) { - QDomElement e = list.item( i ).toElement(); + TQDomElement e = list.item( i ).toElement(); if( e.tagName() == "COMPOSITE" || e.tagName() == "PATH" ) // TODO : remove COMPOSITE later { @@ -365,7 +365,7 @@ VGroup::take( const VObject& object ) { m_objects.removeRef( &object ); - invalidateBoundingBox(); + tqinvalidateBoundingBox(); } void @@ -375,7 +375,7 @@ VGroup::append( VObject* object ) m_objects.append( object ); - invalidateBoundingBox(); + tqinvalidateBoundingBox(); } void @@ -383,9 +383,9 @@ VGroup::insertInfrontOf( VObject* newObject, VObject* oldObject ) { newObject->setParent( this ); - m_objects.insert( m_objects.find( oldObject ), newObject ); + m_objects.insert( m_objects.tqfind( oldObject ), newObject ); - invalidateBoundingBox(); + tqinvalidateBoundingBox(); } void @@ -393,6 +393,6 @@ VGroup::clear() { m_objects.clear(); - invalidateBoundingBox(); + tqinvalidateBoundingBox(); } diff --git a/karbon/core/vgroup.h b/karbon/core/vgroup.h index 25190178..29eb3842 100644 --- a/karbon/core/vgroup.h +++ b/karbon/core/vgroup.h @@ -20,12 +20,12 @@ #ifndef __VGROUP_H__ #define __VGROUP_H__ -#include <qptrlist.h> +#include <tqptrlist.h> #include "vobject.h" #include <koffice_export.h> -typedef QPtrList<VObject> VObjectList; -typedef QPtrListIterator<VObject> VObjectListIterator; +typedef TQPtrList<VObject> VObjectList; +typedef TQPtrListIterator<VObject> VObjectListIterator; /** * Base class for all sort of VObject conglomerats. @@ -35,14 +35,14 @@ class KARBONBASE_EXPORT VGroup : public VObject { public: /** - * Constructs a new group object that is child of parent and has the given state. + * Constructs a new group object that is child of tqparent and has the given state. * * The object's fill and stroke are created here. * - * @param parent the new object's parent + * @param tqparent the new object's tqparent * @param state the new object's state */ - VGroup( VObject* parent, VState state = normal ); + VGroup( VObject* tqparent, VState state = normal ); /** * Copy constructor. @@ -65,10 +65,10 @@ public: virtual void setState( const VState state ); - virtual void save( QDomElement& element ) const; + virtual void save( TQDomElement& element ) const; virtual void saveOasis( KoStore *store, KoXmlWriter *docWriter, KoGenStyles &mainStyles, int &index ) const; - virtual void load( const QDomElement& element ); - virtual bool loadOasis( const QDomElement &element, KoOasisLoadingContext &context ); + virtual void load( const TQDomElement& element ); + virtual bool loadOasis( const TQDomElement &element, KoOasisLoadingContext &context ); virtual VGroup* clone() const; diff --git a/karbon/core/vgroup_iface.cc b/karbon/core/vgroup_iface.cc index fec75358..9de952b3 100644 --- a/karbon/core/vgroup_iface.cc +++ b/karbon/core/vgroup_iface.cc @@ -34,10 +34,10 @@ VGroupIface::clear() m_group->clear(); } -QValueList<DCOPRef> +TQValueList<DCOPRef> VGroupIface::objects() { - QValueList<DCOPRef> lst; + TQValueList<DCOPRef> lst; VObjectListIterator itr = m_group->objects(); for( ; itr.current(); ++itr ) lst.append( DCOPRef( kapp->dcopClient()->appId(), itr.current()->dcopObject()->objId() ) ); diff --git a/karbon/core/vgroup_iface.h b/karbon/core/vgroup_iface.h index c189a7a1..afb0c6e7 100644 --- a/karbon/core/vgroup_iface.h +++ b/karbon/core/vgroup_iface.h @@ -20,14 +20,14 @@ #ifndef __VGROUP_IFACE_H__ #define __VGROUP_IFACE_H__ -#include <qvaluelist.h> +#include <tqvaluelist.h> #include "vobject_iface.h" class VGroup; -//typedef QPtrList<VObject> VObjectList; -//typedef QPtrListIterator<VObject> VObjectListIterator; +//typedef TQPtrList<VObject> VObjectList; +//typedef TQPtrListIterator<VObject> VObjectListIterator; class VGroupIface : public VObjectIface { @@ -44,7 +44,7 @@ k_dcop: //virtual void insertInfrontOf( VObject* newObject, VObject* oldObject ); void clear(); - QValueList<DCOPRef> objects(); + TQValueList<DCOPRef> objects(); private: VGroup *m_group; diff --git a/karbon/core/vimage.cc b/karbon/core/vimage.cc index a8bbf138..7f75254b 100644 --- a/karbon/core/vimage.cc +++ b/karbon/core/vimage.cc @@ -9,20 +9,20 @@ #include "vfill.h" #include "vstroke.h" -#include <qdom.h> -#include <qimage.h> +#include <tqdom.h> +#include <tqimage.h> #include <KoRect.h> #include <render/vqpainter.h> #include <kdebug.h> -VImage::VImage( VObject *parent, const QString &fname ) : VObject( parent ), m_image( 0L ), m_fname( fname ) +VImage::VImage( VObject *tqparent, const TQString &fname ) : VObject( tqparent ), m_image( 0L ), m_fname( fname ) { m_stroke = new VStroke( this ); m_stroke->setType( VStroke::none ); m_fill = new VFill(); - m_image = new QImage( m_fname ); + m_image = new TQImage( m_fname ); if( m_image->depth() != 32 ) *m_image = m_image->convertDepth( 32 ); m_image->setAlphaBuffer( true ); @@ -33,7 +33,7 @@ VImage::VImage( VObject *parent, const QString &fname ) : VObject( parent ), m_i VImage::VImage( const VImage &other ) : VObject( other ) { if( other.m_image ) - m_image = new QImage( *other.m_image ); + m_image = new TQImage( *other.m_image ); else m_image = 0L; @@ -77,17 +77,17 @@ VImage::draw( VPainter *painter, const KoRect * ) const painter->lineTo( bl ); painter->lineTo( tl ); - painter->setRasterOp( Qt::XorROP ); + painter->setRasterOp( TQt::XorROP ); //painter->setPen( stroke() ); - painter->setPen( Qt::yellow ); - painter->setBrush( Qt::NoBrush ); + painter->setPen( TQt::yellow ); + painter->setBrush( TQt::NoBrush ); painter->strokePath(); return; } //painter->setWorldMatrix( m_matrix ); - //*m_image = m_image->smoothScale( m_image->width() * zoomFactor, m_image->height() * zoomFactor, QImage::ScaleMin ); + //*m_image = m_image->smoothScale( m_image->width() * zoomFactor, m_image->height() * zoomFactor, TQ_ScaleMin ); m_boundingBox = KoRect( 0, 0, m_image->width(), m_image->height() ); m_boundingBox = m_boundingBox.transform( m_matrix ); if( !m_image->isNull() ) @@ -95,9 +95,9 @@ VImage::draw( VPainter *painter, const KoRect * ) const } void -VImage::transform( const QWMatrix& m ) +VImage::transform( const TQWMatrix& m ) { - //QWMatrix m2 = m; + //TQWMatrix m2 = m; //m_matrix *= m2.scale( 1.0, -1.0 ); m_matrix *= m; kdDebug(38000) << "dx : " << m.dx() << ", dy : " << m.dy() << endl; @@ -111,11 +111,11 @@ VImage::clone() const } void -VImage::save( QDomElement& element ) const +VImage::save( TQDomElement& element ) const { if( state() != deleted ) { - QDomElement me = element.ownerDocument().createElement( "IMAGE" ); + TQDomElement me = element.ownerDocument().createElement( "IMAGE" ); element.appendChild( me ); me.setAttribute( "fname", m_fname ); @@ -129,7 +129,7 @@ VImage::save( QDomElement& element ) const } void -VImage::load( const QDomElement& element ) +VImage::load( const TQDomElement& element ) { setState( normal ); m_fname = element.attribute( "fname" ); @@ -141,7 +141,7 @@ VImage::load( const QDomElement& element ) element.attribute( "dy", "0.0" ).toDouble() ); kdDebug(38000) << "VImage::load : " << m_fname.latin1() << endl; delete m_image; - m_image = new QImage( m_fname ); + m_image = new TQImage( m_fname ); if( m_image->depth() != 32 ) *m_image = m_image->convertDepth( 32 ); m_image->setAlphaBuffer( true ); diff --git a/karbon/core/vimage.h b/karbon/core/vimage.h index d73e4ee7..2933b4eb 100644 --- a/karbon/core/vimage.h +++ b/karbon/core/vimage.h @@ -7,31 +7,31 @@ #include "vobject.h" #include <koffice_export.h> -class QImage; +class TQImage; // all vobjects exist inside a layer. class KARBONBASE_EXPORT VImage : public VObject { public: - VImage( VObject *parent, const QString &fname = "" ); + VImage( VObject *tqparent, const TQString &fname = "" ); VImage( const VImage & ); virtual ~VImage(); virtual void draw( VPainter *painter, const KoRect *rect ) const; - virtual void transform( const QWMatrix& m ); + virtual void transform( const TQWMatrix& m ); virtual VObject* clone() const; - virtual void save( QDomElement& element ) const; - virtual void load( const QDomElement& element ); + virtual void save( TQDomElement& element ) const; + virtual void load( const TQDomElement& element ); virtual void accept( VVisitor& visitor ); private: - QImage *m_image; - QString m_fname; - QWMatrix m_matrix; + TQImage *m_image; + TQString m_fname; + TQWMatrix m_matrix; }; #endif diff --git a/karbon/core/vkarbonplugin.cc b/karbon/core/vkarbonplugin.cc index 94f38fe5..d05043d9 100644 --- a/karbon/core/vkarbonplugin.cc +++ b/karbon/core/vkarbonplugin.cc @@ -19,7 +19,7 @@ #include "vkarbonplugin.h" -VKarbonPlugin::VKarbonPlugin( QObject *parent, const char* name ) : Plugin( parent, name ) +VKarbonPlugin::VKarbonPlugin( TQObject *tqparent, const char* name ) : Plugin( tqparent, name ) { } diff --git a/karbon/core/vkarbonplugin.h b/karbon/core/vkarbonplugin.h index 39563829..e86680a0 100644 --- a/karbon/core/vkarbonplugin.h +++ b/karbon/core/vkarbonplugin.h @@ -26,7 +26,7 @@ class KARBONBASE_EXPORT VKarbonPlugin : public KParts::Plugin { public: - VKarbonPlugin( QObject *parent, const char* name ); + VKarbonPlugin( TQObject *tqparent, const char* name ); virtual ~VKarbonPlugin() {} }; diff --git a/karbon/core/vlayer.cc b/karbon/core/vlayer.cc index f74a3d4b..49c3bc11 100644 --- a/karbon/core/vlayer.cc +++ b/karbon/core/vlayer.cc @@ -17,7 +17,7 @@ * Boston, MA 02110-1301, USA. */ -#include <qdom.h> +#include <tqdom.h> #include <klocale.h> #include <KoRect.h> @@ -35,8 +35,8 @@ #include "vfill.h" #include "vstroke.h" -VLayer::VLayer( VObject* parent, VState state ) - : VGroup( parent, state ) +VLayer::VLayer( VObject* tqparent, VState state ) + : VGroup( tqparent, state ) { setName( "Layer" ); // HACK : vlayer just shouldn't have fill/stroke at all @@ -111,7 +111,7 @@ VLayer::downwards( const VObject& object ) { if( m_objects.getFirst() == &object ) return; - int index = m_objects.find( &object ); + int index = m_objects.tqfind( &object ); bool bLast = m_objects.getLast() == &object; m_objects.remove( index ); @@ -131,11 +131,11 @@ VLayer::sendToBack( const VObject& object ) } void -VLayer::save( QDomElement& element ) const +VLayer::save( TQDomElement& element ) const { if( state() != deleted ) { - QDomElement me = element.ownerDocument().createElement( "LAYER" ); + TQDomElement me = element.ownerDocument().createElement( "LAYER" ); element.appendChild( me ); if( state() == normal || state() == normal_locked || state() == VObject::selected ) @@ -165,7 +165,7 @@ VLayer::saveOasis( KoStore *store, KoXmlWriter *docWriter, KoGenStyles &mainStyl } void -VLayer::load( const QDomElement& element ) +VLayer::load( const TQDomElement& element ) { setState( element.attribute( "visible" ) == 0 ? hidden : normal ); VGroup::load( element ); diff --git a/karbon/core/vlayer.h b/karbon/core/vlayer.h index 26524416..7dbd126b 100644 --- a/karbon/core/vlayer.h +++ b/karbon/core/vlayer.h @@ -22,7 +22,7 @@ #include "vgroup.h" #include <koffice_export.h> -class QDomElement; +class TQDomElement; class DCOPObject; @@ -37,12 +37,12 @@ class KARBONBASE_EXPORT VLayer : public VGroup { public: /** - * Constructs a new layer object that is child of parent and has the given state. + * Constructs a new layer object that is child of tqparent and has the given state. * - * @param parent the new object's parent + * @param tqparent the new object's tqparent * @param state the new object's state */ - VLayer( VObject* parent, VState state = normal ); + VLayer( VObject* tqparent, VState state = normal ); /** * Copy constructor. @@ -56,9 +56,9 @@ public: virtual void draw( VPainter *painter, const KoRect* rect = 0L ) const; - virtual void save( QDomElement& element ) const; + virtual void save( TQDomElement& element ) const; virtual void saveOasis( KoStore *store, KoXmlWriter *docWriter, KoGenStyles &mainStyles, int &index ) const; - virtual void load( const QDomElement& element ); + virtual void load( const TQDomElement& element ); virtual VLayer* clone() const; diff --git a/karbon/core/vlayer_iface.cc b/karbon/core/vlayer_iface.cc index 7db8a20b..168e6a4a 100644 --- a/karbon/core/vlayer_iface.cc +++ b/karbon/core/vlayer_iface.cc @@ -30,12 +30,12 @@ VLayerIface::VLayerIface( VLayer* layer ) } void -VLayerIface::setName( const QString& name ) +VLayerIface::setName( const TQString& name ) { m_layer->setName( name ); } -QString +TQString VLayerIface::name() const { return m_layer->name(); diff --git a/karbon/core/vlayer_iface.h b/karbon/core/vlayer_iface.h index 9f34a4e0..e177d507 100644 --- a/karbon/core/vlayer_iface.h +++ b/karbon/core/vlayer_iface.h @@ -21,7 +21,7 @@ #define __VLAYER_IFACE_H__ #include "vgroup_iface.h" -#include <qstring.h> +#include <tqstring.h> class VLayer; @@ -33,8 +33,8 @@ public: VLayerIface( VLayer* layer ); k_dcop: - void setName( const QString& name ); - QString name() const; + void setName( const TQString& name ); + TQString name() const; void setSelected( bool state ); bool selected() const; diff --git a/karbon/core/vobject.cc b/karbon/core/vobject.cc index af2fee35..2f9333ac 100644 --- a/karbon/core/vobject.cc +++ b/karbon/core/vobject.cc @@ -17,7 +17,7 @@ * Boston, MA 02110-1301, USA. */ -#include <qdom.h> +#include <tqdom.h> #include "vdocument.h" #include "vfill.h" @@ -33,15 +33,15 @@ #include <KoOasisLoadingContext.h> #include <KoOasisStyles.h> -VObject::VObject( VObject* parent, VState state ) : m_dcop( 0L ) +VObject::VObject( VObject* tqparent, VState state ) : m_dcop( 0L ) { m_stroke = 0L; m_fill = 0L; - m_parent = parent; + m_parent = tqparent; m_state = state; - invalidateBoundingBox(); + tqinvalidateBoundingBox(); } VObject::VObject( const VObject& obj ) @@ -52,7 +52,7 @@ VObject::VObject( const VObject& obj ) m_parent = obj.m_parent; m_state = obj.m_state; - invalidateBoundingBox(); + tqinvalidateBoundingBox(); m_dcop = 0L; VDocument *srcDoc = obj.document(); @@ -99,7 +99,7 @@ VObject::setFill( const VFill& fill ) } void -VObject::save( QDomElement& element ) const +VObject::save( TQDomElement& element ) const { if( m_stroke ) m_stroke->save( element ); @@ -109,7 +109,7 @@ VObject::save( QDomElement& element ) const VDocument *doc = document(); if( doc && !doc->objectName( this ).isEmpty() ) - element.setAttribute( "ID", QString( doc->objectName( this ) ) ); + element.setAttribute( "ID", TQString( doc->objectName( this ) ) ); } void @@ -118,7 +118,7 @@ VObject::saveOasis( KoStore *, KoXmlWriter *docWriter, KoGenStyles &mainStyles, if( !name().isEmpty() ) docWriter->addAttribute( "draw:name", name() ); - QWMatrix mat; + TQWMatrix mat; mat.scale( 1, -1 ); mat.translate( 0, -document()->height() ); @@ -131,9 +131,9 @@ VObject::saveOasis( KoStore *, KoXmlWriter *docWriter, KoGenStyles &mainStyles, stroke.transform( mat ); stroke.saveOasis( styleobjectauto ); } - QString st = mainStyles.lookup( styleobjectauto, "st" ); + TQString st = mainStyles.lookup( styleobjectauto, "st" ); if(document()) - docWriter->addAttribute( "draw:id", "obj" + QString::number( index ) ); + docWriter->addAttribute( "draw:id", "obj" + TQString::number( index ) ); docWriter->addAttribute( "draw:style-name", st ); } @@ -142,7 +142,7 @@ VObject::saveOasisFill( KoGenStyles &mainStyles, KoGenStyle &stylesobjectauto ) { if( m_fill ) { - QWMatrix mat; + TQWMatrix mat; mat.scale( 1, -1 ); mat.translate( 0, -document()->height() ); @@ -154,7 +154,7 @@ VObject::saveOasisFill( KoGenStyles &mainStyles, KoGenStyle &stylesobjectauto ) } void -VObject::load( const QDomElement& element ) +VObject::load( const TQDomElement& element ) { if( !m_stroke ) m_stroke = new VStroke( this ); @@ -178,7 +178,7 @@ VObject::load( const QDomElement& element ) } bool -VObject::loadOasis( const QDomElement &object, KoOasisLoadingContext &context ) +VObject::loadOasis( const TQDomElement &object, KoOasisLoadingContext &context ) { if( !m_stroke ) m_stroke = new VStroke( this ); @@ -195,19 +195,19 @@ VObject::loadOasis( const QDomElement &object, KoOasisLoadingContext &context ) m_fill->loadOasis( object, context, this ); if( object.hasAttributeNS( KoXmlNS::draw, "name" ) ) - setName( object.attributeNS( KoXmlNS::draw, "name", QString::null ) ); + setName( object.attributeNS( KoXmlNS::draw, "name", TQString() ) ); return true; } void -VObject::addStyles( const QDomElement* style, KoOasisLoadingContext & context ) +VObject::addStyles( const TQDomElement* style, KoOasisLoadingContext & context ) { if(style) { - // this function is necessary as parent styles can have parents themself - if( style->hasAttributeNS( KoXmlNS::style, "parent-style-name" ) ) - addStyles( context.oasisStyles().findStyle( style->attributeNS( KoXmlNS::style, "parent-style-name", QString::null ) ), context ); + // this function is necessary as tqparent styles can have tqparents themself + if( style->hasAttributeNS( KoXmlNS::style, "tqparent-style-name" ) ) + addStyles( context.oasisStyles().findStyle( style->attributeNS( KoXmlNS::style, "tqparent-style-name", TQString() ) ), context ); context.addStyles( style, "style-name" ); } } @@ -216,19 +216,19 @@ VDocument * VObject::document() const { VObject *obj = (VObject *)this; - while( obj->parent() ) - obj = obj->parent(); + while( obj->tqparent() ) + obj = obj->tqparent(); return dynamic_cast<VDocument *>( obj ); } -QString +TQString VObject::name() const { - return document() ? document()->objectName( this ) : QString(); + return document() ? document()->objectName( this ) : TQString(); } void -VObject::setName( const QString &s ) +VObject::setName( const TQString &s ) { if( document() ) document()->setObjectName( this, s ); diff --git a/karbon/core/vobject.h b/karbon/core/vobject.h index 9aa6885a..93a3ab1f 100644 --- a/karbon/core/vobject.h +++ b/karbon/core/vobject.h @@ -26,7 +26,7 @@ #include <dcopobject.h> #include <koffice_export.h> -class QDomElement; +class TQDomElement; class VDocument; class VFill; class VPainter; @@ -44,7 +44,7 @@ class KoGenStyle; * have the ability to draw itself using a painter, perform * hit detection, transform on demand, clone and load/save itself. * Also each object manages its own bounding box and keeps track of its - * parent object. + * tqparent object. */ class KARBONBASE_EXPORT VObject { @@ -57,22 +57,22 @@ public: hidden_locked = 3, /**< hidden and locked (r/o) */ deleted = 4, /**< deleted, nearly dead */ - // shape specific states: + // tqshape specific states: selected = 5, /**< visible, active and can be manipulated by tools */ edit = 6 /**< visible, active and is currently manipulated by a tool */ }; /** - * Constructs a new object that is child of parent and has the given state. + * Constructs a new object that is child of tqparent and has the given state. * - * @param parent the new object's parent + * @param tqparent the new object's tqparent * @param state the new object's state */ - VObject( VObject* parent, VState state = edit ); + VObject( VObject* tqparent, VState state = edit ); /** * Copy constructor. - * Copies parent, state and name of given object. + * Copies tqparent, state and name of given object. * * @param obj the object to copy properties from */ @@ -124,27 +124,27 @@ public: * This function is public so visitors can access it themself at the right * time when they manipulate many VSegments. */ - void invalidateBoundingBox() + void tqinvalidateBoundingBox() { m_boundingBoxIsInvalid = true; if( m_parent ) - m_parent->invalidateBoundingBox(); + m_parent->tqinvalidateBoundingBox(); } /** - * Sets a new parent object. + * Sets a new tqparent object. * - * @param parent the new parent object + * @param tqparent the new tqparent object */ - void setParent( VObject* parent ) { m_parent = parent; } + void setParent( VObject* tqparent ) { m_parent = tqparent; } /** - * Returns pointer to current parent object. + * Returns pointer to current tqparent object. * - * @return pointer to current parent object or 0 if no parent object is set + * @return pointer to current tqparent object or 0 if no tqparent object is set */ - VObject* parent() const { return m_parent; } + VObject* tqparent() const { return m_parent; } /** * Get the state the object is in. @@ -195,7 +195,7 @@ public: * * @param element the DOM element to which the attributes are saved */ - virtual void save( QDomElement& element ) const; + virtual void save( TQDomElement& element ) const; /** * Save this object's state to OpenDocument. @@ -212,7 +212,7 @@ public: * * @param element the DOM element from which the attributes are read */ - virtual void load( const QDomElement& element ); + virtual void load( const TQDomElement& element ); /** * Load this object's state from OpenDocument and initialize @@ -221,7 +221,7 @@ public: * @param element the DOM element to read attributes from * @param context FIXME */ - virtual bool loadOasis( const QDomElement &element, KoOasisLoadingContext &context ); + virtual bool loadOasis( const TQDomElement &element, KoOasisLoadingContext &context ); /** * Create an exact copy of this object. @@ -254,19 +254,19 @@ public: * * @return the object's name */ - virtual QString name() const; + virtual TQString name() const; /** * Sets the object's name to a given new name. * * @param s the new object name */ - void setName( const QString &s ); + void setName( const TQString &s ); /** * Return document the object belongs to. * - * @return pointer to parent document or 0 if object does not belong to a document + * @return pointer to tqparent document or 0 if object does not belong to a document */ VDocument *document() const; @@ -277,7 +277,7 @@ protected: * @param style FIXME * @param context FIXME */ - void addStyles( const QDomElement* style, KoOasisLoadingContext & context ); + void addStyles( const TQDomElement* style, KoOasisLoadingContext & context ); virtual void saveOasisFill( KoGenStyles &mainStyles, KoGenStyle &stylesojectauto ) const; diff --git a/karbon/core/vobject_iface.cc b/karbon/core/vobject_iface.cc index c93b68d6..09291ec4 100644 --- a/karbon/core/vobject_iface.cc +++ b/karbon/core/vobject_iface.cc @@ -41,11 +41,11 @@ VObjectIface::setState( int state ) } DCOPRef -VObjectIface::parent() const +VObjectIface::tqparent() const { - if( !m_object->parent() ) + if( !m_object->tqparent() ) return DCOPRef(); - return DCOPRef( kapp->dcopClient()->appId(), m_object->parent()->dcopObject()->objId() ); + return DCOPRef( kapp->dcopClient()->appId(), m_object->tqparent()->dcopObject()->objId() ); } diff --git a/karbon/core/vobject_iface.h b/karbon/core/vobject_iface.h index e1684ba2..e4a645ca 100644 --- a/karbon/core/vobject_iface.h +++ b/karbon/core/vobject_iface.h @@ -23,7 +23,7 @@ #include <KoRect.h> class VObject; -class QDomElement; +class TQDomElement; class VFill; class VPainter; class VStroke; @@ -44,10 +44,10 @@ k_dcop: const KoRect& boundingBox() const { return m_boundingBox; } bool boundingBoxIsInvalid() const; - void invalidateBoundingBox(); - void setParent( VObject* parent ) { m_parent = parent; }*/ + void tqinvalidateBoundingBox(); + void setParent( VObject* tqparent ) { m_parent = tqparent; }*/ - DCOPRef parent() const; + DCOPRef tqparent() const; int state() const; void setState( int state ); @@ -56,8 +56,8 @@ k_dcop: VFill* fill() const { return m_fill; } void setStroke( const VStroke& stroke ); void setFill( const VFill& fill ); - void save( QDomElement& element ) const; - void load( const QDomElement& element ); + void save( TQDomElement& element ) const; + void load( const TQDomElement& element ); VObject* clone() const = 0; void accept( VVisitor& ) {} void insertInfrontOf( VObject* , VObject* ) { }*/ diff --git a/karbon/core/vpath.cc b/karbon/core/vpath.cc index a9fcc8a1..88baa8fe 100644 --- a/karbon/core/vpath.cc +++ b/karbon/core/vpath.cc @@ -20,9 +20,9 @@ #include <math.h> -#include <qdom.h> -#include <qvaluelist.h> -#include <qwmatrix.h> +#include <tqdom.h> +#include <tqvaluelist.h> +#include <tqwmatrix.h> #include "vpath.h" #include "vsegment.h" @@ -52,7 +52,7 @@ public: m_list->push_front( itr ); else { - m_list = new QValueList<VSubpathIterator*>; + m_list = new TQValueList<VSubpathIterator*>; m_list->push_front( itr ); } } @@ -86,7 +86,7 @@ public: if( m_list ) { for( - QValueList<VSubpathIterator*>::Iterator itr = m_list->begin(); + TQValueList<VSubpathIterator*>::Iterator itr = m_list->begin(); itr != m_list->end(); ++itr ) { @@ -109,7 +109,7 @@ public: if( m_list ) { for( - QValueList<VSubpathIterator*>::Iterator itr = m_list->begin(); + TQValueList<VSubpathIterator*>::Iterator itr = m_list->begin(); itr != m_list->end(); ++itr ) { @@ -120,13 +120,13 @@ public: } private: - QValueList<VSubpathIterator*>* m_list; + TQValueList<VSubpathIterator*>* m_list; VSubpathIterator* m_iterator; }; -VSubpath::VSubpath( VObject* parent ) - : VObject( parent ) +VSubpath::VSubpath( VObject* tqparent ) + : VObject( tqparent ) { m_isClosed = false; @@ -416,14 +416,14 @@ bool VSubpath::pointIsInside( const KoPoint& p ) const { // If the point is not inside the boundingbox, it cannot be inside the path either. - if( !boundingBox().contains( p ) ) + if( !boundingBox().tqcontains( p ) ) return false; // First check if the point is inside the knot polygon (beziers are treated // as lines). /* This algorithm is taken from "Fast Winding Number Inclusion of a Point - * in a Polygon" by Dan Sunday, geometryalgorithms.com. + * in a Polygon" by Dan Sunday, tqgeometryalgorithms.com. */ /* @@ -481,7 +481,7 @@ VSubpath::pointIsInside( const KoPoint& p ) const // cache the closed evaluation bool closed = isClosed() || getLast()->knot() == getFirst()->knot(); - QValueList<double> rparams; + TQValueList<double> rparams; VSegment* segment = getFirst()->next(); @@ -528,7 +528,7 @@ VSubpath::pointIsInside( const KoPoint& p ) const // sort all intersections qHeapSort( rparams ); - QValueList<double>::iterator itr, etr = rparams.end(); + TQValueList<double>::iterator itr, etr = rparams.end(); for( itr = rparams.begin(); itr != etr; ++itr ) kdDebug(38000) << "intersection: " << *itr << endl; @@ -654,7 +654,7 @@ VSubpath::revert() return; - VSubpath list( parent() ); + VSubpath list( tqparent() ); list.moveTo( getLast()->knot() ); VSegment* segment = getLast(); @@ -701,7 +701,7 @@ VSubpath::clone() const } void -VSubpath::saveSvgPath( QString &d ) const +VSubpath::saveSvgPath( TQString &d ) const { // Save segments. VSegment* segment = getFirst(); @@ -715,21 +715,21 @@ VSubpath::saveSvgPath( QString &d ) const // Line. if( segment->prev() ) { - d += QString( "L%1 %2" ). - arg( segment->knot().x() ).arg( segment->knot().y() ); + d += TQString( "L%1 %2" ). + tqarg( segment->knot().x() ).tqarg( segment->knot().y() ); } // Moveto. else { - d += QString( "M%1 %2" ). - arg( segment->knot().x() ).arg( segment->knot().y() ); + d += TQString( "M%1 %2" ). + tqarg( segment->knot().x() ).tqarg( segment->knot().y() ); } } // Bezier ( degree >= 3 ). else { // We currently treat all beziers as cubic beziers. - d += QString( "C%1 %2 %3 %4 %5 %6" ). + d += TQString( "C%1 %2 %3 %4 %5 %6" ). arg( segment->point( segment->degree() - 3 ).x() ). arg( segment->point( segment->degree() - 3 ).y() ). arg( segment->point( segment->degree() - 2 ).x() ). @@ -748,18 +748,18 @@ VSubpath::saveSvgPath( QString &d ) const // TODO: remove this backward compatibility function after koffice 1.3.x void -VSubpath::load( const QDomElement& element ) +VSubpath::load( const TQDomElement& element ) { // We might have a "begin" segment. clear(); - QDomNodeList list = element.childNodes(); + TQDomNodeList list = element.childNodes(); for( uint i = 0; i < list.count(); ++i ) { if( list.item( i ).isElement() ) { - QDomElement segment = list.item( i ).toElement(); + TQDomElement segment = list.item( i ).toElement(); VSegment* s = new VSegment(); s->load( segment ); @@ -820,7 +820,7 @@ VSubpath::insert( const VSegment* segment ) m_current = s; ++m_number; - invalidateBoundingBox(); + tqinvalidateBoundingBox(); return true; } @@ -856,7 +856,7 @@ VSubpath::insert( uint index, const VSegment* segment ) m_current = s; ++m_number; - invalidateBoundingBox(); + tqinvalidateBoundingBox(); return true; } @@ -878,7 +878,7 @@ VSubpath::prepend( const VSegment* segment ) ++m_number; m_currentIndex = 0; - invalidateBoundingBox(); + tqinvalidateBoundingBox(); } void @@ -898,7 +898,7 @@ VSubpath::append( const VSegment* segment ) m_currentIndex = m_number; ++m_number; - invalidateBoundingBox(); + tqinvalidateBoundingBox(); } void @@ -924,7 +924,7 @@ VSubpath::clear() m_isClosed = false; - invalidateBoundingBox(); + tqinvalidateBoundingBox(); } VSegment* diff --git a/karbon/core/vpath.h b/karbon/core/vpath.h index 3287a75e..48c89a4c 100644 --- a/karbon/core/vpath.h +++ b/karbon/core/vpath.h @@ -26,8 +26,8 @@ #include "vobject.h" #include <koffice_export.h> -class QDomElement; -class QWMatrix; +class TQDomElement; +class TQWMatrix; class VSubpathIteratorList; class VSegment; class VVisitor; @@ -44,7 +44,7 @@ class KARBONBASE_EXPORT VSubpath : public VObject friend class VSubpathIterator; public: - VSubpath( VObject* parent ); + VSubpath( VObject* tqparent ); VSubpath( const VSubpath& list ); VSubpath( const VSegment& segment ); virtual ~VSubpath(); @@ -106,13 +106,13 @@ public: virtual const KoRect& boundingBox() const; - virtual void save( QDomElement& /*element*/) const + virtual void save( TQDomElement& /*element*/) const { } // VSubpaths cant be saved. // TODO: remove this backward compatibility function after koffice 1.3.x - virtual void load( const QDomElement& element ); + virtual void load( const TQDomElement& element ); - void saveSvgPath( QString & ) const; + void saveSvgPath( TQString & ) const; virtual VSubpath* clone() const; diff --git a/karbon/core/vpattern.cc b/karbon/core/vpattern.cc index 9929a1b9..3a9c181f 100644 --- a/karbon/core/vpattern.cc +++ b/karbon/core/vpattern.cc @@ -17,10 +17,10 @@ * Boston, MA 02110-1301, USA. */ -#include <qdom.h> +#include <tqdom.h> #include "vpattern.h" -#include <qpixmap.h> +#include <tqpixmap.h> #define THUMB_SIZE 30 VPattern::VPattern() @@ -29,13 +29,13 @@ VPattern::VPattern() validThumb = false; } -VPattern::VPattern( const QString &tilename ) +VPattern::VPattern( const TQString &tilename ) { load( tilename ); } void -VPattern::load( const QString &tilename ) +VPattern::load( const TQString &tilename ) { m_tilename = tilename; bool ok = m_image.load( tilename ); @@ -47,7 +47,7 @@ VPattern::load( const QString &tilename ) } m_image = m_image.convertDepth( 32 ); - m_pixmap.convertFromImage(m_image, QPixmap::AutoColor); + m_pixmap.convertFromImage(m_image, TQPixmap::AutoColor); if( m_image.width() > THUMB_SIZE || m_image.height() > THUMB_SIZE ) { int xsize = THUMB_SIZE; @@ -67,7 +67,7 @@ VPattern::load( const QString &tilename ) if(xsize > 30) xsize = 30; } - QImage thumbImg = m_image.smoothScale( xsize, ysize ); + TQImage thumbImg = m_image.smoothScale( xsize, ysize ); m_pixmapThumb.convertFromImage( thumbImg ); validThumb = true; } @@ -93,9 +93,9 @@ VPattern::tileHeight() const } void -VPattern::save( QDomElement& element ) const +VPattern::save( TQDomElement& element ) const { - QDomElement me = element.ownerDocument().createElement( "PATTERN" ); + TQDomElement me = element.ownerDocument().createElement( "PATTERN" ); me.setAttribute( "originX", m_origin.x() ); me.setAttribute( "originY", m_origin.y() ); @@ -108,7 +108,7 @@ VPattern::save( QDomElement& element ) const } void -VPattern::load( const QDomElement& element ) +VPattern::load( const TQDomElement& element ) { m_origin.setX( element.attribute( "originX", "0.0" ).toDouble() ); m_origin.setY( element.attribute( "originY", "0.0" ).toDouble() ); @@ -120,20 +120,20 @@ VPattern::load( const QDomElement& element ) } void -VPattern::transform( const QWMatrix &m ) +VPattern::transform( const TQWMatrix &m ) { m_origin = m_origin.transform( m ); m_vector = m_vector.transform( m ); } -QPixmap& VPattern::pixmap() const +TQPixmap& VPattern::pixmap() const { - return (QPixmap&)m_pixmap; + return (TQPixmap&)m_pixmap; } -QPixmap& VPattern::thumbPixmap() const +TQPixmap& VPattern::thumbPixmap() const { - return (QPixmap&)m_pixmapThumb; + return (TQPixmap&)m_pixmapThumb; } diff --git a/karbon/core/vpattern.h b/karbon/core/vpattern.h index 04870d7d..634a70dd 100644 --- a/karbon/core/vpattern.h +++ b/karbon/core/vpattern.h @@ -22,17 +22,17 @@ #include <KoPoint.h> #include <koIconChooser.h> -#include <qimage.h> -#include <qpixmap.h> +#include <tqimage.h> +#include <tqpixmap.h> #include <koffice_export.h> -class QDomElement; +class TQDomElement; class KARBONBASE_EXPORT VPattern : public KoIconItem { public: VPattern(); - VPattern( const QString &tilename ); + VPattern( const TQString &tilename ); unsigned char *pixels(); unsigned int tileWidth() const; @@ -44,29 +44,29 @@ public: KoPoint vector() const { return m_vector; } void setVector( const KoPoint &vector ) { m_vector = vector; } - void load( const QString &tilename ); + void load( const TQString &tilename ); - void save( QDomElement& element ) const; - void load( const QDomElement& element ); + void save( TQDomElement& element ) const; + void load( const TQDomElement& element ); - void transform( const QWMatrix& m ); + void transform( const TQWMatrix& m ); // for KoIconItem - QPixmap& pixmap() const ; - QPixmap& thumbPixmap() const; + TQPixmap& pixmap() const ; + TQPixmap& thumbPixmap() const; bool isValid() const { return m_valid; } - QString tilename() const { return m_tilename; } + TQString tilename() const { return m_tilename; } private: // coordinates: KoPoint m_origin; KoPoint m_vector; - QImage m_image; - QPixmap m_pixmap; - QPixmap m_pixmapThumb; - QString m_tilename; + TQImage m_image; + TQPixmap m_pixmap; + TQPixmap m_pixmapThumb; + TQString m_tilename; bool m_valid; }; diff --git a/karbon/core/vsegment.cc b/karbon/core/vsegment.cc index 3f0a4590..d18baeba 100644 --- a/karbon/core/vsegment.cc +++ b/karbon/core/vsegment.cc @@ -19,7 +19,7 @@ #include <math.h> -#include <qdom.h> +#include <tqdom.h> #include "vpainter.h" #include "vpath.h" @@ -418,7 +418,7 @@ VSegment::lengthParam( double len ) const double lengthMid = length( paramMid ); - while( QABS( lengthMid - len ) / len > VGlobal::paramLengthTolerance ) + while( TQABS( lengthMid - len ) / len > VGlobal::paramLengthTolerance ) { if( lengthMid < len ) param1 = paramMid; @@ -584,7 +584,7 @@ kdDebug(38000) << newCurve.getLast()->p( i ).x() << " " kdDebug(38000) << endl; // Find roots. - QValueList<double> params; + TQValueList<double> params; newCurve.getLast()->rootParams( params ); @@ -601,7 +601,7 @@ kdDebug(38000) << endl; resultParam = 0.0; // Iterate over the found candidate params. - for( QValueListConstIterator<double> itr = params.begin(); itr != params.end(); ++itr ) + for( TQValueListConstIterator<double> itr = params.begin(); itr != params.end(); ++itr ) { pointDerivativesAt( *itr, &dist ); dist -= p; @@ -625,7 +625,7 @@ kdDebug(38000) << endl; } void -VSegment::rootParams( QValueList<double>& params ) const +VSegment::rootParams( TQValueList<double>& params ) const { if( !prev() ) { @@ -942,7 +942,7 @@ VSegment::height( ( p.y() - a.y() ) * ( p.y() - a.y() ) ); // Normalize. - return QABS( det ) / norm; + return TQABS( det ) / norm; } bool @@ -1061,7 +1061,7 @@ VSegment::next() const // TODO: remove this backward compatibility function after koffice 1.3.x void -VSegment::load( const QDomElement& element ) +VSegment::load( const TQDomElement& element ) { if( element.tagName() == "CURVE" ) { diff --git a/karbon/core/vsegment.h b/karbon/core/vsegment.h index 402946a8..7dd0548a 100644 --- a/karbon/core/vsegment.h +++ b/karbon/core/vsegment.h @@ -20,8 +20,8 @@ #ifndef __VSEGMENT_H__ #define __VSEGMENT_H__ -#include <qptrlist.h> -#include <qvaluelist.h> +#include <tqptrlist.h> +#include <tqvaluelist.h> #include <KoPoint.h> #include <KoRect.h> @@ -29,7 +29,7 @@ #include "vglobal.h" #include <koffice_export.h> -class QDomElement; +class TQDomElement; class VPainter; /** @@ -371,7 +371,7 @@ public: void draw( VPainter* painter ) const; // TODO: remove this backward compatibility function after koffice 1.3.x. - void load( const QDomElement& element ); + void load( const TQDomElement& element ); /** @@ -384,7 +384,7 @@ private: * Calculates the solutions of y(x) = 0 where 0 <= x <= 1. The * returned parameters are not ordered. */ - void rootParams( QValueList<double>& params ) const; + void rootParams( TQValueList<double>& params ) const; /** * Calculates how often the control polygon crosses the x-axis. diff --git a/karbon/core/vselection.cc b/karbon/core/vselection.cc index ec9626ce..30398ec4 100644 --- a/karbon/core/vselection.cc +++ b/karbon/core/vselection.cc @@ -32,11 +32,11 @@ uint VSelection::m_handleNodeSize = 3; -VSelection::VSelection( VObject* parent ) - : VObject( parent ), m_showhandle( true ) +VSelection::VSelection( VObject* tqparent ) + : VObject( tqparent ), m_showhandle( true ) { m_handleRect = new KoRect[ 10 ]; - setStroke( VStroke( VColor( Qt::black ) ) ); + setStroke( VStroke( VColor( TQt::black ) ) ); setFill( VFill() ); m_selectObjects = true; @@ -79,7 +79,7 @@ VSelection::take( VObject& object ) m_objects.removeRef( &object ); if( object.state() >= selected ) object.setState( normal ); - invalidateBoundingBox(); + tqinvalidateBoundingBox(); } bool @@ -90,7 +90,7 @@ VSelection::take( const KoRect& rect, bool selectObjects, bool exclusive ) if( selectObjects ) { VSelectObjects op( m_objects, rect, false ); - if( op.visit( *static_cast<VDocument*>( parent() ) ) ) + if( op.visit( *static_cast<VDocument*>( tqparent() ) ) ) { selectNodes(); success = true; @@ -112,7 +112,7 @@ VSelection::take( const KoRect& rect, bool selectObjects, bool exclusive ) } } - invalidateBoundingBox(); + tqinvalidateBoundingBox(); return success; } @@ -123,10 +123,10 @@ VSelection::append() clear(); VSelectObjects op( m_objects ); - op.visit( *static_cast<VDocument*>( parent() ) ); + op.visit( *static_cast<VDocument*>( tqparent() ) ); selectNodes(); - invalidateBoundingBox(); + tqinvalidateBoundingBox(); } void @@ -135,10 +135,10 @@ VSelection::append( VObject* object ) // only append if item is not deleted or not already in list if( object->state() != deleted ) { - if( ! m_objects.containsRef( object ) ) + if( ! m_objects.tqcontainsRef( object ) ) m_objects.append( object ); object->setState( selected ); - invalidateBoundingBox(); + tqinvalidateBoundingBox(); } } @@ -159,7 +159,7 @@ VSelection::append( const KoRect& rect, bool selectObjects, bool exclusive ) { //m_objects.clear(); VSelectObjects op( m_objects, rect ); - if( op.visit( *static_cast<VDocument*>( parent() ) ) ) + if( op.visit( *static_cast<VDocument*>( tqparent() ) ) ) { selectNodes(); success = true; @@ -186,7 +186,7 @@ VSelection::append( const KoRect& rect, bool selectObjects, bool exclusive ) take( *( jtr.current() ) ); } - invalidateBoundingBox(); + tqinvalidateBoundingBox(); return success; } @@ -206,7 +206,7 @@ VSelection::clear() } m_objects.clear(); - invalidateBoundingBox(); + tqinvalidateBoundingBox(); } void @@ -222,8 +222,8 @@ VSelection::draw( VPainter* painter, double zoomFactor ) const const KoRect& rect = boundingBox(); // calculate displaycoords of big handle rect: - m_handleRect[ 0 ].setCoords( qRound( rect.left() ), qRound( rect.top() ), - qRound( rect.right() ), qRound( rect.bottom() ) ); + m_handleRect[ 0 ].setCoords( tqRound( rect.left() ), tqRound( rect.top() ), + tqRound( rect.right() ), tqRound( rect.bottom() ) ); KoPoint center = m_handleRect[ 0 ].center(); @@ -242,18 +242,18 @@ VSelection::draw( VPainter* painter, double zoomFactor ) const if( !m_showhandle ) return; // draw handle rect: - painter->setPen( Qt::blue.light() ); - painter->setBrush( Qt::NoBrush ); + painter->setPen( TQt::blue.light() ); + painter->setBrush( TQt::NoBrush ); painter->drawRect( KoRect( m_handleRect[ 0 ].x() * zoomFactor, m_handleRect[ 0 ].y() * zoomFactor, m_handleRect[ 0 ].width() * zoomFactor, m_handleRect[ 0 ].height() * zoomFactor ) ); - painter->setPen( Qt::blue.light() ); + painter->setPen( TQt::blue.light() ); // draw nodes: if( state() == VObject::selected ) { - painter->setPen( Qt::blue.light() ); - painter->setBrush( Qt::white ); + painter->setPen( TQt::blue.light() ); + painter->setBrush( TQt::white ); KoRect temp; for( uint i = node_lt; i <= node_rb; ++i ) @@ -295,14 +295,14 @@ VSelection::handleNode( const KoPoint &point ) const { for( uint i = node_lt; i <= node_rb; ++i ) { - if( m_handleRect[i].contains( point ) ) + if( m_handleRect[i].tqcontains( point ) ) return static_cast<VHandleNode>( i ); } return node_none; } -QPtrList<VSegment> +TQPtrList<VSegment> VSelection::getSegments( const KoRect& rect ) { VTestNodes op( rect ); diff --git a/karbon/core/vselection.h b/karbon/core/vselection.h index 31dbb266..c98e5bf1 100644 --- a/karbon/core/vselection.h +++ b/karbon/core/vselection.h @@ -22,7 +22,7 @@ #define __VSELECTION_H__ -#include <qptrlist.h> +#include <tqptrlist.h> #include <KoRect.h> @@ -30,13 +30,13 @@ #include "vvisitor.h" #include <koffice_export.h> class KoPoint; -class QObject; +class TQObject; class VPainter; class VVisitor; class VSegment; -typedef QPtrList<VObject> VObjectList; -typedef QPtrListIterator<VObject> VObjectListIterator; +typedef TQPtrList<VObject> VObjectList; +typedef TQPtrListIterator<VObject> VObjectListIterator; /// Ids of manipulation nodes. @@ -62,11 +62,11 @@ class KARBONBASE_EXPORT VSelection : public VObject, public VVisitor { public: /** - * Constructs a vselection with the specified parent. + * Constructs a vselection with the specified tqparent. * - * @param parent the selection's parent + * @param tqparent the selection's tqparent */ - VSelection( VObject* parent = 0L ); + VSelection( VObject* tqparent = 0L ); /** * Constructs a vselection by copying the specified selection. @@ -141,7 +141,7 @@ public: * @param rect the selection rect * @return the list of segments */ - QPtrList<VSegment> getSegments( const KoRect& rect ); + TQPtrList<VSegment> getSegments( const KoRect& rect ); /** * Selects or deselects all nodes. diff --git a/karbon/core/vstroke.cc b/karbon/core/vstroke.cc index b7431be5..0fe49e99 100644 --- a/karbon/core/vstroke.cc +++ b/karbon/core/vstroke.cc @@ -18,7 +18,7 @@ * Boston, MA 02110-1301, USA. */ -#include <qdom.h> +#include <tqdom.h> #include <KoGenStyles.h> #include <KoStyleStack.h> @@ -33,10 +33,10 @@ VStroke::VStroke() : m_parent(0L), m_lineWidth(1.0), m_lineCap(capButt), m_lineJoin(joinMiter), m_miterLimit(10.0), m_type(none) {} -VStroke::VStroke( VObject* parent, float width, const VLineCap cap, const VLineJoin join, +VStroke::VStroke( VObject* tqparent, float width, const VLineCap cap, const VLineJoin join, float miterLimit ) { - m_parent = parent; + m_parent = tqparent; m_type = solid; m_lineWidth = width; m_lineCap = cap; @@ -44,10 +44,10 @@ VStroke::VStroke( VObject* parent, float width, const VLineCap cap, const VLineJ m_miterLimit = miterLimit; } -VStroke::VStroke( const VColor &c, VObject* parent, float width, const VLineCap cap, const VLineJoin join, +VStroke::VStroke( const VColor &c, VObject* tqparent, float width, const VLineCap cap, const VLineJoin join, float miterLimit ) { - m_parent = parent; + m_parent = tqparent; m_type = solid; m_lineWidth = width; m_lineCap = cap; @@ -58,7 +58,7 @@ VStroke::VStroke( const VColor &c, VObject* parent, float width, const VLineCap VStroke::VStroke( const VStroke& stroke ) { - // doesn't copy parent: + // doesn't copy tqparent: *this = stroke; } @@ -67,15 +67,15 @@ VStroke::setLineWidth( float width ) { m_lineWidth = width; - // tell our parent so he can update his bbox: + // tell our tqparent so he can update his bbox: if( m_parent ) - m_parent->invalidateBoundingBox(); + m_parent->tqinvalidateBoundingBox(); } void -VStroke::save( QDomElement& element ) const +VStroke::save( TQDomElement& element ) const { - QDomElement me = element.ownerDocument().createElement( "STROKE" ); + TQDomElement me = element.ownerDocument().createElement( "STROKE" ); element.appendChild( me ); // save stroke parameters: @@ -114,10 +114,10 @@ VStroke::saveOasis( KoGenStyle &style ) const if( m_type == solid ) { style.addProperty( "draw:stroke", "solid" ); - style.addProperty( "svg:stroke-color", QColor( m_color ).name() ); + style.addProperty( "svg:stroke-color", TQColor( m_color ).name() ); style.addPropertyPt( "svg:stroke-width", m_lineWidth ); if( m_color.opacity() < 1 ) - style.addProperty( "svg:stroke-opacity", QString( "%1%" ).arg( m_color.opacity() * 100. ) ); + style.addProperty( "svg:stroke-opacity", TQString( "%1%" ).tqarg( m_color.opacity() * 100. ) ); } else if( m_type == none ) style.addProperty( "draw:stroke", "none" ); @@ -142,10 +142,10 @@ VStroke::loadOasis( const KoStyleStack &stack ) if( stack.attributeNS( KoXmlNS::draw, "stroke" ) == "solid" ) { setType( VStroke::solid ); - setColor( QColor( stack.attributeNS( KoXmlNS::svg, "stroke-color" ) ) ); + setColor( TQColor( stack.attributeNS( KoXmlNS::svg, "stroke-color" ) ) ); if( stack.hasAttributeNS( KoXmlNS::svg, "stroke-opacity" ) ) m_color.setOpacity( stack.attributeNS( KoXmlNS::svg, "stroke-opacity" ).remove( '%' ).toFloat() / 100. ); - QString join = stack.attributeNS( KoXmlNS::draw, "stroke-linejoin" ); + TQString join = stack.attributeNS( KoXmlNS::draw, "stroke-linejoin" ); if( !join.isEmpty() ) { if( join == "round" ) @@ -166,7 +166,7 @@ VStroke::loadOasis( const KoStyleStack &stack ) } void -VStroke::load( const QDomElement& element ) +VStroke::load( const TQDomElement& element ) { m_type = none; // load stroke parameters: @@ -200,12 +200,12 @@ VStroke::load( const QDomElement& element ) // load color: - QDomNodeList list = element.childNodes(); + TQDomNodeList list = element.childNodes(); for( uint i = 0; i < list.count(); ++i ) { if( list.item( i ).isElement() ) { - QDomElement e = list.item( i ).toElement(); + TQDomElement e = list.item( i ).toElement(); if( e.tagName() == "COLOR" ) { m_color.load( e ); @@ -235,13 +235,13 @@ VStroke::operator=( const VStroke& stroke ) { if( this != &stroke ) { - // dont copy the parent! + // dont copy the tqparent! m_type = stroke.m_type; m_lineWidth = stroke.m_lineWidth; - // Tell our parent about the linewidth change, so he can update his bbox: + // Tell our tqparent about the linewidth change, so he can update his bbox: //if( m_parent ) - // m_parent->invalidateBoundingBox(); + // m_parent->tqinvalidateBoundingBox(); m_lineCap = stroke.m_lineCap; m_lineJoin = stroke.m_lineJoin; @@ -256,7 +256,7 @@ VStroke::operator=( const VStroke& stroke ) } void -VStroke::transform( const QWMatrix& m ) +VStroke::transform( const TQWMatrix& m ) { if( type() == VStroke::grad ) gradient().transform( m ); diff --git a/karbon/core/vstroke.h b/karbon/core/vstroke.h index 6cfa338d..90eedc43 100644 --- a/karbon/core/vstroke.h +++ b/karbon/core/vstroke.h @@ -21,7 +21,7 @@ #ifndef __VSTROKE_H__ #define __VSTROKE_H__ -#include <qvaluelist.h> +#include <tqvaluelist.h> #include "vcolor.h" #include "vdashpattern.h" @@ -29,7 +29,7 @@ #include "vpattern.h" #include <koffice_export.h> -class QDomElement; +class TQDomElement; class VObject; class KoGenStyle; class KoStyleStack; @@ -72,14 +72,14 @@ public: }; VStroke(); - VStroke( VObject* parent, float width = 1.0, const VLineCap cap = capButt, + VStroke( VObject* tqparent, float width = 1.0, const VLineCap cap = capButt, const VLineJoin join = joinMiter, float miterLimit = 10.0 ); - VStroke( const VColor &c, VObject* parent = 0L, float width = 1.0, const VLineCap cap = capButt, + VStroke( const VColor &c, VObject* tqparent = 0L, float width = 1.0, const VLineCap cap = capButt, const VLineJoin join = joinMiter, float miterLimit = 10.0 ); VStroke( const VStroke& stroke ); - void setParent( VObject* parent ) { m_parent = parent; } - VObject* parent()const { return m_parent; } + void setParent( VObject* tqparent ) { m_parent = tqparent; } + VObject* tqparent()const { return m_parent; } VStrokeType type() const { return m_type; } void setType( VStrokeType type ) { m_type = type; } @@ -108,15 +108,15 @@ public: VDashPattern& dashPattern() { return m_dashPattern; } const VDashPattern& dashPattern() const { return m_dashPattern; } - void save( QDomElement& element ) const; + void save( TQDomElement& element ) const; void saveOasis( KoGenStyle &style ) const; - void load( const QDomElement& element ); + void load( const TQDomElement& element ); void loadOasis( const KoStyleStack &stack ); VStroke& operator=( const VStroke& stroke ); - void transform( const QWMatrix& m ); + void transform( const TQWMatrix& m ); private: VObject *m_parent; diff --git a/karbon/core/vtext.cc b/karbon/core/vtext.cc index 53c6af51..9f215b59 100644 --- a/karbon/core/vtext.cc +++ b/karbon/core/vtext.cc @@ -17,8 +17,8 @@ * Boston, MA 02110-1301, USA. */ -#include <qdom.h> -#include <qfile.h> +#include <tqdom.h> +#include <tqfile.h> #include <kdebug.h> #include <KoPoint.h> @@ -56,7 +56,7 @@ int traceMoveto( FT_Vector *to, VPath *composite ) double tox = ( to->x / 64.0 ); double toy = ( -to->y / 64.0 ); - //QString add = "M" + QString::number(tox) + "," + QString::number(toy) + " "; + //TQString add = "M" + TQString::number(tox) + "," + TQString::number(toy) + " "; //kdDebug(38000) << add.latin1() << endl; composite->moveTo( KoPoint( tox, toy ) ); @@ -68,7 +68,7 @@ int traceLineto( FT_Vector *to, VPath *composite ) double tox = ( to->x / 64.0 ); double toy = ( -to->y / 64.0 ); - //QString add = "L" + QString::number(tox) + "," + QString::number(toy) + " "; + //TQString add = "L" + TQString::number(tox) + "," + TQString::number(toy) + " "; //kdDebug(38000) << add.latin1() << endl; composite->lineTo( KoPoint( tox, toy ) ); @@ -83,7 +83,7 @@ int traceQuadraticBezier( FT_Vector *control, FT_Vector *to, VPath *composite ) double x2 = ( to->x / 64.0 ); double y2 = ( -to->y / 64.0 ); - //QString add = "Q" + QString::number(x1) + "," + QString::number(y1) + "," + QString::number(x2) + "," + QString::number(y2) + " "; + //TQString add = "Q" + TQString::number(x1) + "," + TQString::number(y1) + "," + TQString::number(x2) + "," + TQString::number(y2) + " "; //kdDebug(38000) << add.latin1() << endl; composite->curveTo( KoPoint( x1, y1 ), KoPoint( x2, y2 ), KoPoint( x2, y2 ) ); //composite->curve2To( KoPoint( x1, y1 ), KoPoint( x2, y2 ) ); @@ -100,7 +100,7 @@ int traceCubicBezier( FT_Vector *p, FT_Vector *q, FT_Vector *to, VPath *composit double x3 = ( to->x / 64.0 ); double y3 = ( -to->y / 64.0 ); - //QString add = "C" + QString::number(x1) + "," + QString::number(y1) + "," + QString::number(x2) + "," + QString::number(y2) + "," + QString::number(x3) + "," + QString::number(y3); + //TQString add = "C" + TQString::number(x1) + "," + TQString::number(y1) + "," + TQString::number(x2) + "," + TQString::number(y2) + "," + TQString::number(x3) + "," + TQString::number(y3); //kdDebug(38000) << add.latin1() << endl; composite->curveTo( KoPoint( x1, y1 ), KoPoint( x2, y2 ), KoPoint( x3, y3 ) ); @@ -120,15 +120,15 @@ FT_Outline_Funcs OutlineMethods = #endif // HAVE_KARBONTEXT -VText::VText( VObject* parent, VState state ) - : VObject( parent, state ), m_basePath( 0L ) +VText::VText( VObject* tqparent, VState state ) + : VObject( tqparent, state ), m_basePath( 0L ) { m_glyphs.setAutoDelete( true ); m_boundingBoxIsInvalid = true; m_stroke = new VStroke( this ); m_fill = new VFill(); m_position = (VText::Position)0; - m_alignment = (VText::Alignment)0; + m_tqalignment = (VText::Alignment)0; m_shadow = false; m_translucentShadow = false; m_shadowAngle = 0; @@ -137,8 +137,8 @@ VText::VText( VObject* parent, VState state ) } -VText::VText( const QFont &font, const VSubpath& basePath, Position position, Alignment alignment, const QString& text ) - : VObject( 0L ), m_font( font ), m_basePath( basePath ), m_position( position ), m_alignment( alignment ), m_text( text ) +VText::VText( const TQFont &font, const VSubpath& basePath, Position position, Alignment tqalignment, const TQString& text ) + : VObject( 0L ), m_font( font ), m_basePath( basePath ), m_position( position ), m_tqalignment( tqalignment ), m_text( text ) { m_glyphs.setAutoDelete( true ); m_boundingBoxIsInvalid = true; @@ -148,7 +148,7 @@ VText::VText( const QFont &font, const VSubpath& basePath, Position position, Al } VText::VText( const VText& text ) - : VObject( text ), m_font( text.m_font ), m_basePath( text.m_basePath ), m_position( text.m_position ), m_alignment( text.m_alignment ), m_text( text.m_text ), m_shadow( text.m_shadow ), m_translucentShadow( text.m_translucentShadow ), m_shadowDistance( text.m_shadowDistance ), m_shadowAngle( text.m_shadowAngle ), m_offset( text.m_offset ) + : VObject( text ), m_font( text.m_font ), m_basePath( text.m_basePath ), m_position( text.m_position ), m_tqalignment( text.m_tqalignment ), m_text( text.m_text ), m_shadow( text.m_shadow ), m_translucentShadow( text.m_translucentShadow ), m_shadowDistance( text.m_shadowDistance ), m_shadowAngle( text.m_shadowAngle ), m_offset( text.m_offset ) { m_stroke = new VStroke( *text.m_stroke ); m_stroke->setParent( this ); @@ -215,15 +215,15 @@ VText::draw( VPainter* painter, const KoRect* /*rect*/ ) const int shadowDx = int( m_shadowDistance * cos( m_shadowAngle / 360. * 6.2832 ) ); int shadowDy = int( m_shadowDistance * sin( m_shadowAngle / 360. * 6.2832 ) ); - VTransformCmd trafo( 0L, QWMatrix() ); + VTransformCmd trafo( 0L, TQWMatrix() ); for( itr.toFirst(); itr.current(); ++itr ) { - trafo.setMatrix( QWMatrix( 1, 0, 0, 1, shadowDx, shadowDy ) ); + trafo.setMatrix( TQWMatrix( 1, 0, 0, 1, shadowDx, shadowDy ) ); trafo.visit( *( itr.current() ) ); itr.current()->setFill( VFill( color ) ); itr.current()->setStroke( VStroke( color ) ); itr.current()->draw( painter ); - trafo.setMatrix( QWMatrix( 1, 0, 0, 1, -shadowDx, -shadowDy ) ); + trafo.setMatrix( TQWMatrix( 1, 0, 0, 1, -shadowDx, -shadowDy ) ); trafo.visit( *( itr.current() ) ); } } @@ -240,9 +240,9 @@ VText::draw( VPainter* painter, const KoRect* /*rect*/ ) const if( state() == edit )//|| state() == selected ) { painter->newPath(); - painter->setRasterOp( Qt::XorROP ); - painter->setPen( Qt::yellow ); - painter->setBrush( Qt::NoBrush ); + painter->setRasterOp( TQt::XorROP ); + painter->setPen( TQt::yellow ); + painter->setBrush( TQt::NoBrush ); for( itr.toFirst(); itr.current(); ++itr ) itr.current()->draw( painter ); @@ -287,7 +287,7 @@ VText::clone() const VGroup* VText::toVGroup() const { - VGroup* group = new VGroup( parent() ); + VGroup* group = new VGroup( tqparent() ); VPathListIterator itr( m_glyphs ); for( itr.toFirst(); itr.current(); ++itr ) @@ -304,11 +304,11 @@ VGroup* VText::toVGroup() const } // VText::toVGroup void -VText::save( QDomElement& element ) const +VText::save( TQDomElement& element ) const { if( state() != deleted ) { - QDomElement me = element.ownerDocument().createElement( "TEXT" ); + TQDomElement me = element.ownerDocument().createElement( "TEXT" ); VPath path( 0L ); path.combinePath( m_basePath ); @@ -323,7 +323,7 @@ VText::save( QDomElement& element ) const me.setAttribute( "italic", m_font.italic() ); me.setAttribute( "bold", m_font.bold() ); me.setAttribute( "position", m_position ); - me.setAttribute( "alignment", m_alignment ); + me.setAttribute( "tqalignment", m_tqalignment ); me.setAttribute( "shadow", m_shadow ); me.setAttribute( "translucentshadow", m_translucentShadow ); me.setAttribute( "shadowangle", m_shadowAngle ); @@ -339,17 +339,17 @@ VText::save( QDomElement& element ) const } void -VText::load( const QDomElement& element ) +VText::load( const TQDomElement& element ) { m_glyphs.clear(); m_font.setFamily( element.attribute( "family", "Times" ) ); m_font.setPointSize( element.attribute( "size", "12" ).toInt() ); m_font.setItalic( element.attribute( "italic" ).toInt() == 1 ); - m_font.setWeight( QFont::Normal ); + m_font.setWeight( TQFont::Normal ); m_font.setBold( element.attribute( "bold" ).toInt() == 1 ); m_position = (Position)element.attribute( "position", "0" ).toInt(); - m_alignment = (Alignment)element.attribute( "alignment", "0" ).toInt(); + m_tqalignment = (Alignment)element.attribute( "tqalignment", "0" ).toInt(); m_shadow = ( element.attribute( "shadow" ).toInt() == 1 ); m_translucentShadow = ( element.attribute( "translucentshadow" ).toInt() == 1 ); m_shadowAngle = element.attribute( "shadowangle" ).toInt(); @@ -359,8 +359,8 @@ VText::load( const QDomElement& element ) VObject::load( element ); - QDomNodeList list = element.childNodes(); - QDomElement e = list.item( 0 ).toElement(); + TQDomNodeList list = element.childNodes(); + TQDomElement e = list.item( 0 ).toElement(); // element to start with reading glyph paths and stroke, fill, etc. uint startElement = 0; @@ -401,7 +401,7 @@ VText::load( const QDomElement& element ) } void -VText::setText( const QString& text ) +VText::setText( const TQString& text ) { if( m_text != text ) { @@ -453,17 +453,17 @@ VText::traceText() // Build FontConfig request pattern int id = -1; - QString filename = buildRequest( m_font.family(), weight, slant, m_font.pointSize(), id ); + TQString filename = buildRequest( m_font.family(), weight, slant, m_font.pointSize(), id ); m_glyphs.clear(); - kdDebug(38000) << "Loading " << filename.latin1() << " for requested font \"" << m_font.family().latin1() << "\", " << m_font.pointSize() << " pt." << endl; + kdDebug(38000) << "Loading " << filename.latin1() << " for requested font \"" << TQString(m_font.family()).latin1() << "\", " << m_font.pointSize() << " pt." << endl; FT_UInt glyphIndex; FT_Face fontFace; // TODO : this lib should probably be a singleton (Rob) FT_Library library; FT_Init_FreeType( &library ); - FT_Error error = FT_New_Face( library, QFile::encodeName(filename), id, &fontFace ); + FT_Error error = FT_New_Face( library, TQFile::encodeName(filename), id, &fontFace ); if( error ) { @@ -473,7 +473,7 @@ VText::traceText() bool foundCharmap = false; - // Try to choose unicode charmap + // Try to choose tqunicode charmap for( int charmap = 0; charmap < fontFace->num_charmaps; charmap++ ) { if( fontFace->charmaps[charmap]->encoding == ft_encoding_unicode ) @@ -481,14 +481,14 @@ VText::traceText() FT_Error error = FT_Set_Charmap( fontFace, fontFace->charmaps[charmap] ); if( error ) { - kdDebug(38000) << "traceText(), unable to select unicode charmap." << endl; + kdDebug(38000) << "traceText(), unable to select tqunicode charmap." << endl; continue; } foundCharmap = true; } } - // Choose first charmap if no unicode charmap was found + // Choose first charmap if no tqunicode charmap was found if( ! foundCharmap ) { error = FT_Set_Charmap( fontFace, fontFace->charmaps[0] ); @@ -512,13 +512,13 @@ VText::traceText() // storing glyphs. float l = 0; - QValueList<float> glyphXAdvance; - QValueList<float> glyphYAdvance; + TQValueList<float> glyphXAdvance; + TQValueList<float> glyphYAdvance; for( unsigned int i = 0; i < m_text.length(); i++ ) { // get the glyph index for the current character - QChar character = m_text.at( i ); - glyphIndex = FT_Get_Char_Index( fontFace, character.unicode() ); + TQChar character = m_text.at( i ); + glyphIndex = FT_Get_Char_Index( fontFace, character.tqunicode() ); if( ! glyphIndex ) { kdDebug(38000) << "traceText(), unable get index of char : " << character << endl; @@ -575,7 +575,7 @@ VText::traceText() kdDebug(38000) << "traceText(), using offset : " << m_offset << endl; float x = m_offset * pathLength; - switch( m_alignment ) + switch( m_tqalignment ) { case Left: x += 0; break; case Center: x -= 0.5 * l; break; @@ -603,7 +603,7 @@ VText::traceText() // Step 1: place (0, 0) to the rotation center of the glyph. dx = *glyphXAdvance.at( i ) / 2; x += dx; - VTransformCmd trafo( 0L, QWMatrix( 1, 0, 0, 1, -dx, y + yoffset ) ); + VTransformCmd trafo( 0L, TQWMatrix( 1, 0, 0, 1, -dx, y + yoffset ) ); trafo.visit( *composite ); // Step 2: find the position where to draw. @@ -640,11 +640,11 @@ VText::traceText() // Step 3: transform glyph and append it. That's it, we've got // text following a path. Really easy, isn't it ;) ? - trafo.setMatrix( QWMatrix( tangent.x(), tangent.y(), tangent.y(), -tangent.x(), point.x(), point.y() ) ); + trafo.setMatrix( TQWMatrix( tangent.x(), tangent.y(), tangent.y(), -tangent.x(), point.x(), point.y() ) ); trafo.visit( *composite ); composite->setState( state() ); - //kdDebug(38000) << "Glyph: " << (QString)character << " [String pos: " << x << ", " << y << " / Canvas pos: " << point.x() << ", " << point.y() << "]" << endl; + //kdDebug(38000) << "Glyph: " << (TQString)character << " [String pos: " << x << ", " << y << " / Canvas pos: " << point.x() << ", " << point.y() << "]" << endl; x += dx; y += *glyphYAdvance.at( i ); @@ -655,17 +655,17 @@ VText::traceText() } // This routine is copied from KSVGFont (Rob) -QString -VText::buildRequest( QString family, int weight, int slant, double size, int &id ) +TQString +VText::buildRequest( TQString family, int weight, int slant, double size, int &id ) { // Strip those stupid [Xft or whatever]... int pos; - if( ( pos = family.find( '[' ) ) ) + if( ( pos = family.tqfind( '[' ) ) ) family = family.left( pos ); // Use FontConfig to locate & select fonts and use FreeType2 to open them FcPattern *pattern; - QString fileName; + TQString fileName; pattern = FcPatternBuild( 0, FC_WEIGHT, FcTypeInteger, weight, FC_SLANT, FcTypeInteger, slant, @@ -710,13 +710,13 @@ VText::buildRequest( QString family, int weight, int slant, double size, int &id FcPatternGetInteger(pattern, FC_INDEX, 0, &id) != FcResultMatch ) { kdDebug(38000) << "VText::buildRequest(), could not load font file for requested font \"" << family.latin1() << "\"" << endl; - return QString::null; + return TQString(); } - fileName = QFile::decodeName(reinterpret_cast<const char *>( temp )); + fileName = TQFile::decodeName(reinterpret_cast<const char *>( temp )); // get family name of matched font - QString newFamily; + TQString newFamily; if( FcResultMatch == FcPatternGetString( pattern, FC_FAMILY, 0, &temp ) ) m_font.setFamily( reinterpret_cast<const char *>( temp ) ); diff --git a/karbon/core/vtext.h b/karbon/core/vtext.h index 962705ea..55455c5f 100644 --- a/karbon/core/vtext.h +++ b/karbon/core/vtext.h @@ -24,9 +24,9 @@ #include <config.h> #endif -#include <qptrlist.h> -#include <qstring.h> -#include <qfont.h> +#include <tqptrlist.h> +#include <tqstring.h> +#include <tqfont.h> #include <koffice_export.h> #include "vpath.h" @@ -34,8 +34,8 @@ class VGroup; -typedef QPtrList<VPath> VPathList; -typedef QPtrListIterator<VPath> VPathListIterator; +typedef TQPtrList<VPath> VPathList; +typedef TQPtrListIterator<VPath> VPathListIterator; #ifdef Above #undef Above @@ -56,22 +56,22 @@ public: Right }; - VText( VObject* parent, VState state = normal ); - VText( const QFont &font, const VSubpath& basePath, Position position, Alignment alignment, const QString& text ); + VText( VObject* tqparent, VState state = normal ); + VText( const TQFont &font, const VSubpath& basePath, Position position, Alignment tqalignment, const TQString& text ); VText( const VText& text ); virtual ~VText(); virtual DCOPObject* dcopObject(); - virtual void setText( const QString& text ); - virtual const QString& text() { return m_text; } - virtual void setFont( const QFont& font ) { m_font = font; } - virtual const QFont& font() { return m_font; } + virtual void setText( const TQString& text ); + virtual const TQString& text() { return m_text; } + virtual void setFont( const TQFont& font ) { m_font = font; } + virtual const TQFont& font() { return m_font; } virtual void setBasePath( const VSubpath& path ) { m_basePath = path; } virtual VSubpath& basePath() { return m_basePath; } virtual void setPosition( Position position ) { m_position = position; } virtual Position position() { return m_position; } - virtual void setAlignment( Alignment alignment ) { m_alignment = alignment; } - virtual Alignment alignment() { return m_alignment; } + virtual void tqsetAlignment( Alignment tqalignment ) { m_tqalignment = tqalignment; } + virtual Alignment tqalignment() { return m_tqalignment; } virtual void setUseShadow( bool state ) { m_shadow = state; } virtual bool useShadow() { return m_shadow; } virtual void setShadow( int angle, int distance, bool translucent ) @@ -94,8 +94,8 @@ public: virtual const KoRect& boundingBox() const; - virtual void save( QDomElement& element ) const; - virtual void load( const QDomElement& element ); + virtual void save( TQDomElement& element ) const; + virtual void load( const TQDomElement& element ); virtual VText* clone() const; virtual VGroup* toVGroup() const; @@ -108,20 +108,20 @@ public: void traceText(); protected: - QString buildRequest( QString family, int weight, int slant, double size, int &id ); + TQString buildRequest( TQString family, int weight, int slant, double size, int &id ); #endif // HAVE_KARBONTEXT private: // The font to use to draw the text. - QFont m_font; + TQFont m_font; // The base path. Doesn't belong to the document. VSubpath m_basePath; // The text position Position m_position; - // The text alignment - Alignment m_alignment; + // The text tqalignment + Alignment m_tqalignment; // The text to draw - QString m_text; + TQString m_text; // Shadow parameters bool m_shadow; bool m_translucentShadow; diff --git a/karbon/core/vtext_iface.cc b/karbon/core/vtext_iface.cc index 1a01b192..7cbeaf37 100644 --- a/karbon/core/vtext_iface.cc +++ b/karbon/core/vtext_iface.cc @@ -26,12 +26,12 @@ VTextIface::VTextIface( VText *text ) } void -VTextIface::setText( QString text ) +VTextIface::setText( TQString text ) { m_text->setText( text ); } -QString +TQString VTextIface::text() { return m_text->text(); @@ -40,7 +40,7 @@ VTextIface::text() void VTextIface::setFontSize( int pointSize ) { - QFont font = m_text->font(); + TQFont font = m_text->font(); font.setPointSize( pointSize ); m_text->setFont( font ); } diff --git a/karbon/core/vtext_iface.h b/karbon/core/vtext_iface.h index 6cca452a..dc51eca7 100644 --- a/karbon/core/vtext_iface.h +++ b/karbon/core/vtext_iface.h @@ -32,8 +32,8 @@ public: VTextIface( VText *text ); k_dcop: - void setText( QString text ); - QString text(); + void setText( TQString text ); + TQString text(); void setFontSize( int pointSize ); int fontSize(); |