diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /filters/karbon | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'filters/karbon')
56 files changed, 1758 insertions, 1740 deletions
diff --git a/filters/karbon/ai/ai88handler.cc b/filters/karbon/ai/ai88handler.cc index f3cf53a7..a271f33f 100644 --- a/filters/karbon/ai/ai88handler.cc +++ b/filters/karbon/ai/ai88handler.cc @@ -326,7 +326,7 @@ void AI88Handler::_handleSetFillPattern() AIElement elem (m_delegate->m_stack.top()); m_delegate->m_stack.pop(); - const QValueVector<AIElement> aval = elem.toElementArray(); + const TQValueVector<AIElement> aval = elem.toElementArray(); double ka = m_delegate->getDoubleValue(); double k = m_delegate->getDoubleValue(); @@ -341,7 +341,7 @@ void AI88Handler::_handleSetFillPattern() AIElement elem2 (m_delegate->m_stack.top()); m_delegate->m_stack.pop(); - const QString &name = elem2.toString(); + const TQString &name = elem2.toString(); if (m_delegate->m_gstateHandler) m_delegate->m_gstateHandler->gotFillPattern (name.latin1(), px, py, sx, sy, angle, rf, r, k, ka, aval); } @@ -350,7 +350,7 @@ void AI88Handler::_handleSetStrokePattern() AIElement elem (m_delegate->m_stack.top()); m_delegate->m_stack.pop(); - const QValueVector<AIElement> aval = elem.toElementArray(); + const TQValueVector<AIElement> aval = elem.toElementArray(); double ka = m_delegate->getDoubleValue(); double k = m_delegate->getDoubleValue(); @@ -365,7 +365,7 @@ void AI88Handler::_handleSetStrokePattern() AIElement elem2 (m_delegate->m_stack.top()); m_delegate->m_stack.pop(); - const QString &name = elem2.toString(); + const TQString &name = elem2.toString(); if (m_delegate->m_gstateHandler) m_delegate->m_gstateHandler->gotStrokePattern (name.latin1(), px, py, sx, sy, angle, rf, r, k, ka, aval); } @@ -406,7 +406,7 @@ void AI88Handler::_handleSetStrokeColorGray() void AI88Handler::_handleSetFillColorCustom() { double g = m_delegate->getDoubleValue(); - const QString name = m_delegate->getStringValue(); + const TQString name = m_delegate->getStringValue(); double k = m_delegate->getDoubleValue(); double y = m_delegate->getDoubleValue(); double m = m_delegate->getDoubleValue(); @@ -426,7 +426,7 @@ void AI88Handler::_handleSetDash() AIElement elem (m_delegate->m_stack.top()); m_delegate->m_stack.pop(); - const QValueVector<AIElement> aval = elem.toElementArray(); + const TQValueVector<AIElement> aval = elem.toElementArray(); if (m_delegate->m_gstateHandler) m_delegate->m_gstateHandler->gotDash (aval, fval); // qDebug ("dash operation finished"); } @@ -436,7 +436,7 @@ void AI88Handler::_handlePatternDefinition() AIElement elem (m_delegate->m_stack.top()); m_delegate->m_stack.pop(); - const QValueVector<AIElement> aval = elem.toElementArray(); + const TQValueVector<AIElement> aval = elem.toElementArray(); double ury = m_delegate->getDoubleValue(); double urx = m_delegate->getDoubleValue(); @@ -446,7 +446,7 @@ void AI88Handler::_handlePatternDefinition() AIElement elem2 (m_delegate->m_stack.top()); m_delegate->m_stack.pop(); - const QString &name = elem2.toString(); + const TQString &name = elem2.toString(); if (m_delegate->m_documentHandler) m_delegate->m_documentHandler->gotPatternDefinition (name.latin1(), aval, llx, lly, urx, ury); } @@ -455,7 +455,7 @@ void AI88Handler::_handleGsaveIncludeDocument() { AIElement elem2 (m_delegate->m_stack.top()); m_delegate->m_stack.pop(); - const QString &name = elem2.toString(); + const TQString &name = elem2.toString(); int ury = m_delegate->getIntValue(); int urx = m_delegate->getIntValue(); @@ -465,7 +465,7 @@ void AI88Handler::_handleGsaveIncludeDocument() { AIElement elem (m_delegate->m_stack.top()); m_delegate->m_stack.pop(); - const QValueVector<AIElement> aval = elem.toElementArray(); + const TQValueVector<AIElement> aval = elem.toElementArray(); if (m_delegate->m_embeddedHandler) m_delegate->m_embeddedHandler->gotGsaveIncludeDocument (aval, llx,lly,urx,ury,name.latin1()); } @@ -491,7 +491,7 @@ void AI88Handler::_handleSetCurrentText() { AIElement elem2 (m_delegate->m_stack.top()); m_delegate->m_stack.pop(); - const QString &fontname = elem2.toReference(); + const TQString &fontname = elem2.toReference(); if (m_delegate->m_textHandler) m_delegate->m_textHandler->gotFontDefinition (fontname.latin1(), size, leading, kerning, ta); @@ -502,7 +502,7 @@ void AI88Handler::_handleTextBlock (TextOperation to) { qDebug ("to element is (%s)",elem.typeName()); m_delegate->m_stack.pop(); - const QValueVector<AIElement> aval = elem.toElementArray(); + const TQValueVector<AIElement> aval = elem.toElementArray(); if (m_delegate->m_textHandler) m_delegate->m_textHandler->gotTextBlockBegin (aval, to); } @@ -511,7 +511,7 @@ void AI88Handler::_handleTextOutput () { AIElement elem (m_delegate->m_stack.top()); m_delegate->m_stack.pop(); - const QString &text = elem.toString(); + const TQString &text = elem.toString(); int length = -1; @@ -535,15 +535,15 @@ void AI88Handler::_handleFontEncoding() AIElement elem (m_delegate->m_stack.top()); m_delegate->m_stack.pop(); - const QString &oldFont = elem.toReference(); + const TQString &oldFont = elem.toReference(); AIElement elem2 (m_delegate->m_stack.top()); m_delegate->m_stack.pop(); - const QString &newFont = elem2.toReference(); + const TQString &newFont = elem2.toReference(); AIElement elem3 (m_delegate->m_stack.top()); m_delegate->m_stack.pop(); - const QValueVector<AIElement> encodingData = elem3.toElementArray(); + const TQValueVector<AIElement> encodingData = elem3.toElementArray(); if (m_delegate->m_textHandler) m_delegate->m_textHandler->gotFontEncoding (encodingData, oldFont.latin1(), newFont.latin1()); } @@ -551,7 +551,7 @@ void AI88Handler::_handleFontEncoding() void AI88Handler::_handleSetStrokeColorCustom() { double g = m_delegate->getDoubleValue(); - const QString name = m_delegate->getStringValue(); + const TQString name = m_delegate->getStringValue(); double k = m_delegate->getDoubleValue(); double y = m_delegate->getDoubleValue(); double m = m_delegate->getDoubleValue(); diff --git a/filters/karbon/ai/aicolor.h b/filters/karbon/ai/aicolor.h index b8cc1414..6e22984c 100644 --- a/filters/karbon/ai/aicolor.h +++ b/filters/karbon/ai/aicolor.h @@ -20,7 +20,7 @@ #ifndef AICOLOR_H #define AICOLOR_H -#include <qstring.h> +#include <tqstring.h> /** *@author diff --git a/filters/karbon/ai/aielement.cc b/filters/karbon/ai/aielement.cc index 13887b50..608bdf61 100644 --- a/filters/karbon/ai/aielement.cc +++ b/filters/karbon/ai/aielement.cc @@ -1,5 +1,5 @@ /* This file is part of the KDE project - Copyright (C) 2002, Dirk Sch�nberger <[email protected]> + Copyright (C) 2002, Dirk Sch�nberger <[email protected]> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -18,7 +18,7 @@ */ #include "aielement.h" -#include <qglobal.h> +#include <tqglobal.h> AIElement::Private::Private() { @@ -34,23 +34,23 @@ AIElement::Private::Private( Private* d ) case AIElement::String: case AIElement::Reference: case AIElement::Operator: - value.ptr = new QString( *((QString*)d->value.ptr) ); + value.ptr = new TQString( *((TQString*)d->value.ptr) ); break; case AIElement::CString: - // QCString is explicit shared - value.ptr = new QCString( *((QCString*)d->value.ptr) ); + // TQCString is explicit shared + value.ptr = new TQCString( *((TQCString*)d->value.ptr) ); break; /* case AIElement::List: - value.ptr = new QValueList<AIElement>( *((QValueList<AIElement>*)d->value.ptr) ); + value.ptr = new TQValueList<AIElement>( *((TQValueList<AIElement>*)d->value.ptr) ); break; */ case AIElement::ElementArray: - value.ptr = new QValueVector<AIElement>( *((QValueVector<AIElement>*)d->value.ptr) ); + value.ptr = new TQValueVector<AIElement>( *((TQValueVector<AIElement>*)d->value.ptr) ); break; case AIElement::Block: - value.ptr = new QValueVector<AIElement>( *((QValueVector<AIElement>*)d->value.ptr) ); + value.ptr = new TQValueVector<AIElement>( *((TQValueVector<AIElement>*)d->value.ptr) ); break; case AIElement::ByteArray: - value.ptr = new QByteArray( *((QByteArray*)d->value.ptr) ); + value.ptr = new TQByteArray( *((TQByteArray*)d->value.ptr) ); break; case AIElement::Int: value.i = d->value.i; @@ -83,22 +83,22 @@ void AIElement::Private::clear() case AIElement::String: case AIElement::Operator: case AIElement::Reference: - delete (QString*)value.ptr; + delete (TQString*)value.ptr; break; case AIElement::CString: - delete (QCString*)value.ptr; + delete (TQCString*)value.ptr; break; /* case AIElement::List: - delete (QValueList<AIElement>*)value.ptr; + delete (TQValueList<AIElement>*)value.ptr; break; */ case AIElement::ElementArray: - delete (QValueVector<AIElement>*)value.ptr; + delete (TQValueVector<AIElement>*)value.ptr; break; case AIElement::Block: - delete (QValueVector<AIElement>*)value.ptr; + delete (TQValueVector<AIElement>*)value.ptr; break; case AIElement::ByteArray: - delete (QByteArray*)value.ptr; + delete (TQByteArray*)value.ptr; break; case AIElement::Invalid: case AIElement::Int: @@ -136,7 +136,7 @@ AIElement::~AIElement() /*! Constructs a copy of the aielement, \a p, passed as the argument to this constructor. Usually this is a deep copy, but a shallow copy is made - if the stored data type is explicitly shared, as e.g. QImage is. + if the stored data type is explicitly shared, as e.g. TQImage is. */ AIElement::AIElement( const AIElement& p ) { @@ -147,25 +147,25 @@ AIElement::AIElement( const AIElement& p ) /*! Constructs a new aielement with a string value, \a val. */ -AIElement::AIElement( const QString& val, Type type ) +AIElement::AIElement( const TQString& val, Type type ) { d = new Private; d->typ = type; - d->value.ptr = new QString( val ); + d->value.ptr = new TQString( val ); } /*! Constructs a new aielement with a C-string value, \a val. - If you want to modify the QCString after you've passed it to this + If you want to modify the TQCString after you've passed it to this constructor, we recommend passing a deep copy (see - QCString::copy()). + TQCString::copy()). */ -AIElement::AIElement( const QCString& val ) +AIElement::AIElement( const TQCString& val ) { d = new Private; d->typ = CString; - d->value.ptr = new QCString( val ); + d->value.ptr = new TQCString( val ); } /*! @@ -180,7 +180,7 @@ AIElement::AIElement( const char* val ) if ( val == 0 ) return; d->typ = CString; - d->value.ptr = new QCString( val ); + d->value.ptr = new TQCString( val ); } /*! @@ -227,32 +227,32 @@ AIElement::AIElement( double val ) /*! Constructs a new aielement with a list value, \a val. */ -/* AIElement::AIElement( const QValueList<AIElement>& val ) +/* AIElement::AIElement( const TQValueList<AIElement>& val ) { d = new Private; d->typ = List; - d->value.ptr = new QValueList<AIElement>( val ); + d->value.ptr = new TQValueList<AIElement>( val ); } */ -AIElement::AIElement( const QValueVector<AIElement>& val, Type type ) +AIElement::AIElement( const TQValueVector<AIElement>& val, Type type ) { d = new Private; d->typ = type; - d->value.ptr = new QValueVector<AIElement>( val ); + d->value.ptr = new TQValueVector<AIElement>( val ); } -AIElement::AIElement( const QByteArray& val ) +AIElement::AIElement( const TQByteArray& val ) { d = new Private; d->typ = ByteArray; - d->value.ptr = new QByteArray( val ); + d->value.ptr = new TQByteArray( val ); } /*! Assigns the value of the aielement \a aielement to this aielement. This is a deep copy of the aielement, but note that if the aielement - holds an explicitly shared type such as QImage, a shallow copy + holds an explicitly shared type such as TQImage, a shallow copy is performed. */ AIElement& AIElement::operator= ( const AIElement& aielement ) @@ -283,7 +283,7 @@ void AIElement::detach() /*! Returns the name of the type stored in the aielement. The returned strings describe the C++ datatype used to store the - data: for example, "QFont", "QString", or "QValueList<AIElement>". + data: for example, "TQFont", TQSTRING_OBJECT_NAME_STRING, or "TQValueList<AIElement>". An Invalid aielement returns 0. */ const char* AIElement::typeName() const @@ -310,16 +310,16 @@ static const int ntypes = 11; static const char* const type_map[ntypes] = { 0, -// "QValueList<AIElement>", - "QString", +// "TQValueList<AIElement>", + TQSTRING_OBJECT_NAME_STRING, "int", "uint", "double", - "QCString", + "TQCString", "Operator", "Reference", - "QValueVector<AIElement>", - "QByteArray", + "TQValueVector<AIElement>", + TQBYTEARRAY_OBJECT_NAME_STRING, "uchar", }; @@ -351,59 +351,59 @@ AIElement::Type AIElement::nameToType( const char* name ) } /*! - Returns the aielement as a QString if the aielement has type() + Returns the aielement as a TQString if the aielement has type() String, CString, ByteArray, Int, Uint, Double, - or QString::null otherwise. + or TQString() otherwise. \sa asString() */ -const QString AIElement::toString() const +const TQString AIElement::toString() const { if ( d->typ == CString ) - return QString::fromLatin1( toCString() ); + return TQString::tqfromLatin1( toCString() ); if ( d->typ == Int ) - return QString::number( toInt() ); + return TQString::number( toInt() ); if ( d->typ == UInt ) - return QString::number( toUInt() ); + return TQString::number( toUInt() ); if ( d->typ == Double ) - return QString::number( toDouble() ); + return TQString::number( toDouble() ); if ( d->typ == Byte ) - return QString::number( toByte() ); + return TQString::number( toByte() ); if ( d->typ != String ) - return QString::null; - return *((QString*)d->value.ptr); + return TQString(); + return *((TQString*)d->value.ptr); } -const QString AIElement::toReference() const +const TQString AIElement::toReference() const { if ( d->typ != Reference ) - return QString::null; - return *((QString*)d->value.ptr); + return TQString(); + return *((TQString*)d->value.ptr); } -const QString AIElement::toOperator() const +const TQString AIElement::toOperator() const { if ( d->typ != Operator ) - return QString::null; - return *((QString*)d->value.ptr); + return TQString(); + return *((TQString*)d->value.ptr); } /*! - Returns the aielement as a QCString if the aielement has type() + Returns the aielement as a TQCString if the aielement has type() CString or String, or a 0 otherwise. \sa asCString() */ -const QCString AIElement::toCString() const +const TQCString AIElement::toCString() const { if ( d->typ == CString ) - return *((QCString*)d->value.ptr); + return *((TQCString*)d->value.ptr); if ( d->typ == String ) - return ((QString*)d->value.ptr)->latin1(); + return ((TQString*)d->value.ptr)->latin1(); if ( d->typ == Operator ) - return ((QString*)d->value.ptr)->latin1(); + return ((TQString*)d->value.ptr)->latin1(); if ( d->typ == Reference ) - return ((QString*)d->value.ptr)->latin1(); + return ((TQString*)d->value.ptr)->latin1(); return 0; } @@ -421,9 +421,9 @@ const QCString AIElement::toCString() const int AIElement::toInt( bool * ok ) const { if( d->typ == String ) - return ((QString*)d->value.ptr)->toInt( ok ); + return ((TQString*)d->value.ptr)->toInt( ok ); if ( d->typ == CString ) - return ((QCString*)d->value.ptr)->toInt( ok ); + return ((TQCString*)d->value.ptr)->toInt( ok ); if ( ok ) *ok = canCast( UInt ); if( d->typ == Int ) @@ -440,9 +440,9 @@ int AIElement::toInt( bool * ok ) const uchar AIElement::toByte( bool * ok ) const { if( d->typ == String ) - return ((QString*)d->value.ptr)->toShort( ok ); + return ((TQString*)d->value.ptr)->toShort( ok ); if ( d->typ == CString ) - return ((QCString*)d->value.ptr)->toShort( ok ); + return ((TQCString*)d->value.ptr)->toShort( ok ); if ( ok ) *ok = canCast( UInt ); if( d->typ == Byte ) @@ -469,9 +469,9 @@ uchar AIElement::toByte( bool * ok ) const uint AIElement::toUInt( bool * ok ) const { if( d->typ == String ) - return ((QString*)d->value.ptr)->toUInt( ok ); + return ((TQString*)d->value.ptr)->toUInt( ok ); if ( d->typ == CString ) - return ((QCString*)d->value.ptr)->toUInt( ok ); + return ((TQCString*)d->value.ptr)->toUInt( ok ); if ( ok ) *ok = canCast( UInt ); if( d->typ == Int ) @@ -498,9 +498,9 @@ uint AIElement::toUInt( bool * ok ) const double AIElement::toDouble( bool * ok ) const { if( d->typ == String ) - return ((QString*)d->value.ptr)->toDouble( ok ); + return ((TQString*)d->value.ptr)->toDouble( ok ); if ( d->typ == CString ) - return ((QCString*)d->value.ptr)->toDouble( ok ); + return ((TQCString*)d->value.ptr)->toDouble( ok ); if ( ok ) *ok = canCast( Double ); if ( d->typ == Double ) @@ -515,14 +515,14 @@ double AIElement::toDouble( bool * ok ) const } /*! - Returns the aielement as a QValueList<AIElement> if the aielement has type() + Returns the aielement as a TQValueList<AIElement> if the aielement has type() List or StringList, or an empty list otherwise. Note that if you want to iterate over the list, you should iterate over a copy, e.g. \code - QValueList<AIElement> list = myAIElement.toList(); - QValueList<AIElement>::Iterator it = list.begin(); + TQValueList<AIElement> list = myAIElement.toList(); + TQValueList<AIElement>::Iterator it = list.begin(); while( it != list.end() ) { myProcessing( *it ); ++it; @@ -531,40 +531,40 @@ double AIElement::toDouble( bool * ok ) const \sa asList() */ -/* const QValueList<AIElement> AIElement::toList() const +/* const TQValueList<AIElement> AIElement::toList() const { if ( d->typ == List ) - return *((QValueList<AIElement>*)d->value.ptr); - return QValueList<AIElement>(); + return *((TQValueList<AIElement>*)d->value.ptr); + return TQValueList<AIElement>(); } */ -const QValueVector<AIElement> AIElement::toElementArray() const +const TQValueVector<AIElement> AIElement::toElementArray() const { if ( d->typ == ElementArray ) - return *((QValueVector<AIElement>*)d->value.ptr); - return QValueVector<AIElement>(); + return *((TQValueVector<AIElement>*)d->value.ptr); + return TQValueVector<AIElement>(); } -const QValueVector<AIElement> AIElement::toBlock() const +const TQValueVector<AIElement> AIElement::toBlock() const { if ( d->typ == Block ) - return *((QValueVector<AIElement>*)d->value.ptr); - return QValueVector<AIElement>(); + return *((TQValueVector<AIElement>*)d->value.ptr); + return TQValueVector<AIElement>(); } -const QByteArray AIElement::toByteArray() const +const TQByteArray AIElement::toByteArray() const { if ( d->typ == ByteArray ) - return *((QByteArray*)d->value.ptr); - return QByteArray(); + return *((TQByteArray*)d->value.ptr); + return TQByteArray(); } -#define Q_VARIANT_AS( f ) Q##f& AIElement::as##f() { \ - if ( d->typ != f ) *this = AIElement( to##f() ); else detach(); return *((Q##f*)d->value.ptr);} +#define TQ_VARIANT_AS( f ) TQ##f& AIElement::as##f() { \ + if ( d->typ != f ) *this = AIElement( to##f() ); else detach(); return *((TQ##f*)d->value.ptr);} -Q_VARIANT_AS(String) -Q_VARIANT_AS(CString) +TQ_VARIANT_AS(String) +TQ_VARIANT_AS(CString) /*! Returns the aielement's value as int reference. @@ -632,41 +632,41 @@ uchar& AIElement::asByte() Note that if you want to iterate over the list, you should iterate over a copy, e.g. \code - QValueList<AIElement> list = myAIElement.asList(); - QValueList<AIElement>::Iterator it = list.begin(); + TQValueList<AIElement> list = myAIElement.asList(); + TQValueList<AIElement>::Iterator it = list.begin(); while( it != list.end() ) { myProcessing( *it ); ++it; } \endcode */ -/* QValueList<AIElement>& AIElement::asList() +/* TQValueList<AIElement>& AIElement::asList() { if ( d->typ != List ) *this = AIElement( toList() ); - return *((QValueList<AIElement>*)d->value.ptr); + return *((TQValueList<AIElement>*)d->value.ptr); } */ -QValueVector<AIElement>& AIElement::asElementArray() +TQValueVector<AIElement>& AIElement::asElementArray() { if ( d->typ != ElementArray ) *this = AIElement( toElementArray() ); - return *((QValueVector<AIElement>*)d->value.ptr); + return *((TQValueVector<AIElement>*)d->value.ptr); } -QValueVector<AIElement>& AIElement::asBlock() +TQValueVector<AIElement>& AIElement::asBlock() { if ( d->typ != Block ) *this = AIElement( toBlock() ); - return *((QValueVector<AIElement>*)d->value.ptr); + return *((TQValueVector<AIElement>*)d->value.ptr); } -QByteArray& AIElement::asByteArray() +TQByteArray& AIElement::asByteArray() { if ( d->typ != ByteArray ) *this = AIElement( toByteArray() ); - return *((QByteArray*)d->value.ptr); + return *((TQByteArray*)d->value.ptr); } /*! diff --git a/filters/karbon/ai/aielement.h b/filters/karbon/ai/aielement.h index 5c6ab045..4fdf64a2 100644 --- a/filters/karbon/ai/aielement.h +++ b/filters/karbon/ai/aielement.h @@ -20,11 +20,11 @@ #ifndef AIELEMENT_H #define AIELEMENT_H -// #include <qvaluelist.h> -#include <qvaluevector.h> +// #include <tqvaluelist.h> +#include <tqvaluevector.h> -class QString; -class QCString; +class TQString; +class TQCString; /** *@author @@ -52,15 +52,15 @@ public: AIElement(); ~AIElement(); AIElement( const AIElement& ); - AIElement( const QString&, Type type = String ); - AIElement( const QCString& ); + AIElement( const TQString&, Type type = String ); + AIElement( const TQCString& ); AIElement( const char* ); -// AIElement( const QValueList<AIElement>& ); - AIElement( const QValueVector<AIElement>&, Type type = ElementArray); +// AIElement( const TQValueList<AIElement>& ); + AIElement( const TQValueVector<AIElement>&, Type type = ElementArray); AIElement( int ); AIElement( uint ); AIElement( double ); - AIElement( const QByteArray& ); + AIElement( const TQByteArray& ); AIElement( uchar ); AIElement& operator= ( const AIElement& ); @@ -77,36 +77,36 @@ public: void clear(); - const QString toString() const; - const QCString toCString() const; + const TQString toString() const; + const TQCString toCString() const; int toInt( bool * ok=0 ) const; uint toUInt( bool * ok=0 ) const; double toDouble( bool * ok=0 ) const; -// const QValueList<AIElement> toList() const; - const QValueVector<AIElement> toElementArray() const; - const QValueVector<AIElement> toBlock() const; +// const TQValueList<AIElement> toList() const; + const TQValueVector<AIElement> toElementArray() const; + const TQValueVector<AIElement> toBlock() const; // Custom types - const QString toReference() const; - const QString toOperator() const; - const QByteArray toByteArray() const; + const TQString toReference() const; + const TQString toOperator() const; + const TQByteArray toByteArray() const; uchar toByte( bool * ok=0 ) const; -// QValueListConstIterator<AIElement> listBegin() const; -// QValueListConstIterator<AIElement> listEnd() const; - QString& asString(); - QCString& asCString(); +// TQValueListConstIterator<AIElement> listBegin() const; +// TQValueListConstIterator<AIElement> listEnd() const; + TQString& asString(); + TQCString& asCString(); int& asInt(); uint& asUInt(); double& asDouble(); -// QValueList<AIElement>& asList(); - QValueVector<AIElement>& asElementArray(); - QValueVector<AIElement>& asBlock(); +// TQValueList<AIElement>& asList(); + TQValueVector<AIElement>& asElementArray(); + TQValueVector<AIElement>& asBlock(); // Custom types - QString& asReference(); - QString& asToken(); - QByteArray& asByteArray(); + TQString& asReference(); + TQString& asToken(); + TQByteArray& asByteArray(); uchar& asByte(); static const char* typeToName( Type typ ); @@ -115,7 +115,7 @@ public: private: void detach(); - class Private : public QShared + class Private : public TQShared { public: Private(); diff --git a/filters/karbon/ai/aiimport.cc b/filters/karbon/ai/aiimport.cc index a5e24f5b..4a201ec5 100644 --- a/filters/karbon/ai/aiimport.cc +++ b/filters/karbon/ai/aiimport.cc @@ -1,5 +1,5 @@ /* This file is part of the KDE project - Copyright (C) 2002, Dirk Sch�nberger <[email protected]> + Copyright (C) 2002, Dirk Sch�nberger <[email protected]> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -17,10 +17,10 @@ * Boston, MA 02110-1301, USA. */ -#include <qdom.h> -#include <qcstring.h> -#include <qfile.h> -#include <qstring.h> +#include <tqdom.h> +#include <tqcstring.h> +#include <tqfile.h> +#include <tqstring.h> #include <kgenericfactory.h> #include <KoFilterChain.h> @@ -47,7 +47,7 @@ protected: K_EXPORT_COMPONENT_FACTORY( libkarbonaiimport, AiImportFactory() ) -AiImport::AiImport( KoFilter*, const char*, const QStringList& ) +AiImport::AiImport( KoFilter*, const char*, const TQStringList& ) : KoFilter() { } @@ -56,29 +56,29 @@ AiImport::~AiImport() { } -KoFilter::ConversionStatus -AiImport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus +AiImport::convert( const TQCString& from, const TQCString& to ) { if ( from != "application/illustrator" || to != "application/x-karbon" ) { return KoFilter::NotImplemented; } - QFile fileIn( m_chain->inputFile() ); + TQFile fileIn( m_chain->inputFile() ); if( !fileIn.open( IO_ReadOnly ) ) { fileIn.close(); return KoFilter::FileNotFound; } - QDomDocument doc ("DOC"); + TQDomDocument doc ("DOC"); KarbonAIParserBase parser; - if (!parser.parse (fileIn, doc)) + if (!parser.parse (*TQT_TQIODEVICE(&fileIn), doc)) { fileIn.close(); return KoFilter::CreationError; } - QString result = doc.toString(); + TQString result = doc.toString(); kdDebug() << result << endl; KoStoreDevice* storeOut = m_chain->storageFile( "root", KoStore::Write ); @@ -88,7 +88,7 @@ AiImport::convert( const QCString& from, const QCString& to ) return KoFilter::StorageCreationError; } - QCString cStr = result.latin1(); + TQCString cStr = result.latin1(); storeOut->writeBlock( cStr, cStr.size() - 1 ); return KoFilter::OK; diff --git a/filters/karbon/ai/aiimport.h b/filters/karbon/ai/aiimport.h index 2ec2d19b..901eba6d 100644 --- a/filters/karbon/ai/aiimport.h +++ b/filters/karbon/ai/aiimport.h @@ -24,20 +24,21 @@ #include "karbonaiparserbase.h" -class QDomElement; -class QTextStream; +class TQDomElement; +class TQTextStream; class AiImport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - AiImport( KoFilter* parent, const char* name, const QStringList& ); + AiImport( KoFilter* tqparent, const char* name, const TQStringList& ); virtual ~AiImport(); - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); /* private: - QString m_result; */ + TQString m_result; */ }; diff --git a/filters/karbon/ai/ailexer.cc b/filters/karbon/ai/ailexer.cc index 7b660f7f..a1ab4bda 100644 --- a/filters/karbon/ai/ailexer.cc +++ b/filters/karbon/ai/ailexer.cc @@ -19,7 +19,7 @@ #include <ctype.h> #include <stdlib.h> -#include <qstringlist.h> +#include <tqstringlist.h> #include "ailexer.h" #define CATEGORY_WHITESPACE -1 @@ -173,7 +173,7 @@ AILexer::AILexer(){ AILexer::~AILexer(){ } -bool AILexer::parse (QIODevice& fin){ +bool AILexer::parse (TQIODevice& fin){ char c; m_buffer.clear(); @@ -350,7 +350,7 @@ void AILexer::gotByte (uchar value) { qDebug ( "got byte %d" , value ); } -void AILexer::gotByteArray (const QByteArray &data) { +void AILexer::gotByteArray (const TQByteArray &data) { qDebug ( "got byte array" ); /* for ( uint i = 0; i < data.size(); i++ ) { @@ -413,11 +413,11 @@ void AILexer::doHandleByteArray () uint strIdx = 0; uint arrayIdx = 0; - QByteArray data (m_buffer.length() >> 1); + TQByteArray data (m_buffer.length() >> 1); while (strIdx < m_buffer.length()) { - const QString &item = m_buffer.mid (strIdx, 2); + const TQString &item = m_buffer.mid (strIdx, 2); uchar val = item.toShort(NULL, 16); data[arrayIdx] = val; strIdx += 2; @@ -431,7 +431,7 @@ uchar AILexer::getByte() { // qDebug ("convert string to byte (%s)", m_buffer.latin1()); - QStringList list = QStringList::split ("#", m_buffer.toString()); + TQStringList list = TQStringList::split ("#", m_buffer.toString()); int radix = list[0].toShort(); uchar value = list[1].toShort (NULL, radix); @@ -471,8 +471,8 @@ void StringBuffer::clear(){ m_length = 0; } -QString StringBuffer::toString() const { - QString ret(m_buffer); +TQString StringBuffer::toString() const { + TQString ret(m_buffer); return ret; } @@ -495,12 +495,12 @@ uint StringBuffer::length() { } double StringBuffer::toFloat() { - QString data = toString(); + TQString data = toString(); return data.toFloat(); } int StringBuffer::toInt() { - QString data = toString(); + TQString data = toString(); return data.toInt(); } @@ -508,7 +508,7 @@ const char *StringBuffer::latin1() { return m_buffer; } -QString StringBuffer::mid( uint index, uint len) const { - QString data = toString(); +TQString StringBuffer::mid( uint index, uint len) const { + TQString data = toString(); return data.mid(index,len); } diff --git a/filters/karbon/ai/ailexer.h b/filters/karbon/ai/ailexer.h index c53aab66..c0aaf022 100644 --- a/filters/karbon/ai/ailexer.h +++ b/filters/karbon/ai/ailexer.h @@ -20,8 +20,8 @@ #ifndef AILEXER_H #define AILEXER_H -#include <qiodevice.h> -#include <qstring.h> +#include <tqiodevice.h> +#include <tqstring.h> /** *@author Dirk Sch�nberger @@ -65,12 +65,12 @@ public: void append (char c); void clear(); - QString toString() const; + TQString toString() const; uint length(); double toFloat(); int toInt(); const char *latin1(); - QString mid( uint index, uint len=0xffffffff) const; + TQString mid( uint index, uint len=0xffffffff) const; private: char *m_buffer; uint m_length; @@ -84,7 +84,7 @@ public: AILexer(); virtual ~AILexer(); - virtual bool parse (QIODevice& fin); + virtual bool parse (TQIODevice& fin); private: State m_curState; StringBuffer m_buffer; @@ -116,7 +116,7 @@ protected: virtual void gotArrayStart (); virtual void gotArrayEnd (); virtual void gotByte (uchar value); - virtual void gotByteArray (const QByteArray &data); + virtual void gotByteArray (const TQByteArray &data); }; #endif diff --git a/filters/karbon/ai/aiparserbase.cc b/filters/karbon/ai/aiparserbase.cc index 63ace734..6e9ff040 100644 --- a/filters/karbon/ai/aiparserbase.cc +++ b/filters/karbon/ai/aiparserbase.cc @@ -20,8 +20,8 @@ #include "aiparserbase.h" #include "ai88handler.h" #include "ai3handler.h" -#include <qregexp.h> -#include <qstringlist.h> +#include <tqregexp.h> +#include <tqstringlist.h> typedef struct { char* op; @@ -204,7 +204,7 @@ AIParserBase::~AIParserBase(){ } -bool AIParserBase::parse (QIODevice& fin){ +bool AIParserBase::parse (TQIODevice& fin){ return AILexer::parse (fin); } @@ -376,13 +376,13 @@ void AIParserBase::handleElement (AIElement &element) if (m_sink == DS_Array) { if (m_debug) qDebug ("in mode array"); - QValueVector<AIElement> &elementArray = m_arrayStack.top(); + TQValueVector<AIElement> &elementArray = m_arrayStack.top(); elementArray.push_back(element); } if (m_sink == DS_Block) { if (m_debug) qDebug ("in mode block"); - QValueVector<AIElement> &elementArray = m_blockStack.top(); + TQValueVector<AIElement> &elementArray = m_blockStack.top(); elementArray.push_back(element); } else @@ -425,7 +425,7 @@ void AIParserBase::gotReference (const char *value) { if (m_ignoring) return; if (value == NULL) value = ""; if (m_debug) qDebug ("reference: %s", value); - QString string(value); + TQString string(value); AIElement element (string, AIElement::Reference); handleElement (element); if (m_debug) qDebug ("/got reference value"); @@ -441,7 +441,7 @@ void AIParserBase::gotByte (uchar value) { if (m_debug) qDebug ("/got byte value"); } -void AIParserBase::gotByteArray (const QByteArray &data) { +void AIParserBase::gotByteArray (const TQByteArray &data) { if (m_ignoring) return; AIElement element (data); handleElement (element); @@ -452,7 +452,7 @@ void AIParserBase::gotArrayStart () { if (m_ignoring) return; if (m_debug) qDebug ("got array start"); - QValueVector<AIElement> array; + TQValueVector<AIElement> array; m_arrayStack.push (array); m_sink = DS_Array; @@ -462,7 +462,7 @@ void AIParserBase::gotBlockStart () { if (m_ignoring) return; if (m_debug) qDebug ("got block start"); - QValueVector<AIElement> array; + TQValueVector<AIElement> array; m_blockStack.push (array); m_sink = DS_Block; @@ -472,7 +472,7 @@ void AIParserBase::gotArrayEnd () { if (m_ignoring) return; if (m_debug) qDebug ("got array end"); - QValueVector<AIElement> stackArray = m_arrayStack.pop(); + TQValueVector<AIElement> stackArray = m_arrayStack.pop(); if (m_arrayStack.empty()) { @@ -491,7 +491,7 @@ void AIParserBase::gotArrayEnd () { else { if (m_debug) qDebug ("put elements to nest stack level"); - QValueVector<AIElement> currentTOS = m_arrayStack.top(); + TQValueVector<AIElement> currentTOS = m_arrayStack.top(); currentTOS.push_back (stackArray); } } @@ -500,7 +500,7 @@ void AIParserBase::gotBlockEnd () { if (m_ignoring) return; if (m_debug) qDebug ("got block end"); - QValueVector<AIElement> stackArray = m_blockStack.pop(); + TQValueVector<AIElement> stackArray = m_blockStack.pop(); if (m_blockStack.empty()) { @@ -519,7 +519,7 @@ void AIParserBase::gotBlockEnd () { else { if (m_debug) qDebug ("put elements to nest stack level"); - QValueVector<AIElement> currentTOS = m_blockStack.top(); + TQValueVector<AIElement> currentTOS = m_blockStack.top(); currentTOS.push_back (stackArray); } } @@ -531,7 +531,7 @@ void AIParserBase::gotBlockEnd () { AIElement elem (m_stack.top()); m_stack.pop(); - const QValueVector<AIElement> aval = elem.toElementArray(); + const TQValueVector<AIElement> aval = elem.toElementArray(); if (m_gstateHandler) m_gstateHandler->gotDash (aval, fval); } */ @@ -553,7 +553,7 @@ void AIParserBase::gotBlockEnd () { AIElement elem (m_stack.top()); m_stack.pop(); - const QValueVector<AIElement> aval = elem.toElementArray(); + const TQValueVector<AIElement> aval = elem.toElementArray(); double ka = getDoubleValue(); double k = getDoubleValue(); @@ -568,7 +568,7 @@ void AIParserBase::gotBlockEnd () { AIElement elem2 (m_stack.top()); m_stack.pop(); - const QString &name = elem2.toString(); + const TQString &name = elem2.toString(); if (m_gstateHandler) m_gstateHandler->gotFillPattern (name.latin1(), px, py, sx, sy, angle, rf, r, k, ka, aval); } */ @@ -577,7 +577,7 @@ void AIParserBase::gotBlockEnd () { AIElement elem (m_stack.top()); m_stack.pop(); - const QValueVector<AIElement> aval = elem.toElementArray(); + const TQValueVector<AIElement> aval = elem.toElementArray(); double ka = getDoubleValue(); double k = getDoubleValue(); @@ -592,7 +592,7 @@ void AIParserBase::gotBlockEnd () { AIElement elem2 (m_stack.top()); m_stack.pop(); - const QString &name = elem2.toString(); + const TQString &name = elem2.toString(); if (m_gstateHandler) m_gstateHandler->gotStrokePattern (name.latin1(), px, py, sx, sy, angle, rf, r, k, ka, aval); } */ @@ -632,7 +632,7 @@ void AIParserBase::gotBlockEnd () { /*Ai88*/ /* void AIParserBase::_handleSetFillColorCustom() { double g = getDoubleValue(); - const QString &name = getStringValue(); + const TQString &name = getStringValue(); double k = getDoubleValue(); double y = getDoubleValue(); double m = getDoubleValue(); @@ -648,7 +648,7 @@ void AIParserBase::_handlePSGet() { m_stack.pop(); m_stack.pop(); - QString name ("xxx"); + TQString name ("xxx"); AIElement ref (name,AIElement::Reference); m_stack.push (ref); } @@ -660,7 +660,7 @@ void AIParserBase::_handlePSExec() { void AIParserBase::_handlePSString() { m_stack.pop(); - QString name ("stringval"); + TQString name ("stringval"); AIElement ref (name,AIElement::Reference); m_stack.push (ref); } @@ -668,13 +668,13 @@ void AIParserBase::_handlePSString() { void AIParserBase::_handlePSBind() { m_stack.pop(); - QString name ("bindentry"); + TQString name ("bindentry"); AIElement ref (name,AIElement::Reference); m_stack.push (ref); } void AIParserBase::_handlePSUserdict() { - QString name ("userdict"); + TQString name ("userdict"); AIElement ref (name,AIElement::Reference); m_stack.push (ref); } @@ -684,7 +684,7 @@ void AIParserBase::_handlePSDict() { m_stack.pop(); m_stack.pop(); - QString name ("dict"); + TQString name ("dict"); AIElement ref (name,AIElement::Reference); m_stack.push (ref); } @@ -699,7 +699,7 @@ void AIParserBase::_handlePSDup() { void AIParserBase::_handlePSBegin() { m_stack.pop(); - QString name ("dictionary begin"); + TQString name ("dictionary begin"); AIElement ref (name,AIElement::Reference); m_stack.push (ref); } @@ -714,7 +714,7 @@ void AIParserBase::_handlePSPut() { AIElement elem (m_stack.top()); m_stack.pop(); - const QValueVector<AIElement> aval = elem.toElementArray(); + const TQValueVector<AIElement> aval = elem.toElementArray(); double ury = getDoubleValue(); double urx = getDoubleValue(); @@ -724,7 +724,7 @@ void AIParserBase::_handlePSPut() { AIElement elem2 (m_stack.top()); m_stack.pop(); - const QString &name = elem2.toString(); + const TQString &name = elem2.toString(); if (m_documentHandler) m_documentHandler->gotPatternDefinition (name.latin1(), aval, llx, lly, urx, ury); } */ @@ -740,7 +740,7 @@ void AIParserBase::_handlePSDef() { /*Ai88*/ /* void AIParserBase::_handleSetStrokeColorCustom() { double g = getDoubleValue(); - const QString &name = getStringValue(); + const TQString &name = getStringValue(); double k = getDoubleValue(); double y = getDoubleValue(); double m = getDoubleValue(); @@ -763,22 +763,22 @@ void AIParserBase::_handleDocumentCustomColors(const char *) { void AIParserBase::_handleDocumentNeededResources(const char *data) { if (!data) return; - QStringList items = QStringList::split (' ', data); + TQStringList items = TQStringList::split (' ', data); - QString itemType = items[1]; - QString name = items[2]; - QString version = items[3]; - QString release = items[4]; + TQString itemType = items[1]; + TQString name = items[2]; + TQString version = items[3]; + TQString release = items[4]; } void AIParserBase::_handleIncludeResource(const char *data) { if (!data) return; - QStringList items = QStringList::split (' ', data); + TQStringList items = TQStringList::split (' ', data); - QString itemType = items[1]; - QString name = items[2]; - QString version = items[3]; - QString release = items[4]; + TQString itemType = items[1]; + TQString name = items[2]; + TQString version = items[3]; + TQString release = items[4]; m_modules.push_back (name); } @@ -787,20 +787,20 @@ void AIParserBase::_handleDocumentProcessColors(const char *data) { if (!data) return; int colorSet = 0; - QString tmp (data); + TQString tmp (data); signed int index; - index = tmp.find ("Cyan"); + index = tmp.tqfind ("Cyan"); if (index > 0) colorSet |= PC_Cyan; - index = tmp.find ("Magenta"); + index = tmp.tqfind ("Magenta"); if (index > 0) colorSet |= PC_Magenta; - index = tmp.find ("Yellow"); + index = tmp.tqfind ("Yellow"); if (index > 0) colorSet |= PC_Yellow; - index = tmp.find ("Black"); + index = tmp.tqfind ("Black"); if (index > 0) colorSet |= PC_Black; if (m_documentHandler) m_documentHandler->gotProcessColors (colorSet); @@ -813,7 +813,7 @@ void AIParserBase::_handleCMYKCustomColor(const char *) { AIElement elem2 (m_stack.top()); m_stack.pop(); - const QString &name = elem2.toString(); + const TQString &name = elem2.toString(); int ury = getIntValue(); int urx = getIntValue(); @@ -823,7 +823,7 @@ void AIParserBase::_handleCMYKCustomColor(const char *) { AIElement elem (m_stack.top()); m_stack.pop(); - const QValueVector<AIElement> aval = elem.toElementArray(); + const TQValueVector<AIElement> aval = elem.toElementArray(); if (m_embeddedHandler) m_embeddedHandler->gotGsaveIncludeDocument (aval, llx,lly,urx,ury,name.latin1()); } */ @@ -849,7 +849,7 @@ void AIParserBase::_handleCMYKCustomColor(const char *) { AIElement elem2 (m_stack.top()); m_stack.pop(); - const QString &fontname = elem2.toReference(); + const TQString &fontname = elem2.toReference(); if (m_textHandler) m_textHandler->gotFontDefinition (fontname.latin1(), size, leading, kerning, ta); } */ @@ -859,7 +859,7 @@ void AIParserBase::_handleCMYKCustomColor(const char *) { qDebug ("to element is (%s)",elem.typeName()); m_stack.pop(); - const QValueVector<AIElement> aval = elem.toElementArray(); + const TQValueVector<AIElement> aval = elem.toElementArray(); if (m_textHandler) m_textHandler->gotTextBlockBegin (aval, to); } */ @@ -868,7 +868,7 @@ void AIParserBase::_handleCMYKCustomColor(const char *) { AIElement elem (m_stack.top()); m_stack.pop(); - const QString &text = elem.toString(); + const TQString &text = elem.toString(); int length = -1; @@ -888,11 +888,11 @@ void AIParserBase::_handleCreationDate (const char *data) { if (!data) return; - QRegExp test ("\\((.+)\\) \\((.+)\\)"); + TQRegExp test ("\\((.+)\\) \\((.+)\\)"); if (test.search (data)) { - QString val1 = test.cap(1); - QString val2 = test.cap(2); + TQString val1 = test.cap(1); + TQString val2 = test.cap(2); if (m_documentHandler) m_documentHandler->gotCreationDate (val1.latin1(),val2.latin1()); } @@ -907,7 +907,7 @@ void AIParserBase::gotToken (const char *value) { if (m_sink == DS_Array) { if (m_debug) qDebug ("token in array"); - QString op (value); + TQString op (value); AIElement realElement (op, AIElement::Operator); handleElement (realElement); @@ -916,7 +916,7 @@ void AIParserBase::gotToken (const char *value) { if (m_sink == DS_Block) { if (m_debug) qDebug ("token in block"); - QString op (value); + TQString op (value); AIElement realElement (op, AIElement::Operator); handleElement (realElement); @@ -943,9 +943,9 @@ void AIParserBase::gotToken (const char *value) { } qWarning ( "unknown operator: %s", value ); - QString string(value); + TQString string(value); - if (m_modules.findIndex(string) != -1) + if (m_modules.tqfindIndex(string) != -1) { AIElement element (string, AIElement::Reference); handleElement (element); @@ -1019,13 +1019,13 @@ const bool AIParserBase::getBoolValue(void) { return getIntValue() == 1; } -const QString AIParserBase::getStringValue(void) { +const TQString AIParserBase::getStringValue(void) { const AIElement &elem = m_stack.pop(); return elem.toString(); } -const QString AIParserBase::getOperatorValue(void) { +const TQString AIParserBase::getOperatorValue(void) { const AIElement &elem = m_stack.pop(); return elem.toOperator(); @@ -1034,7 +1034,7 @@ const QString AIParserBase::getOperatorValue(void) { AIOperation AIParserBase::getAIOperation (const char *operand) { int i=0; - QString cmpValue (operand); + TQString cmpValue (operand); for(;;) { AIOperationMapping map = aiMappings[i]; if (map.op == NULL) return AIO_Other; @@ -1047,7 +1047,7 @@ AIOperation AIParserBase::getAIOperation (const char *operand) PSOperation AIParserBase::getPSOperation (const char *operand) { int i=0; - QString cmpValue (operand); + TQString cmpValue (operand); for(;;) { PSOperationMapping map = psMappings[i]; if (map.op == NULL) return PSO_Other; @@ -1058,7 +1058,7 @@ PSOperation AIParserBase::getPSOperation (const char *operand) } CommentOperation AIParserBase::getCommentOperation (const char *command) { - QString data (command); + TQString data (command); signed int index; @@ -1067,28 +1067,28 @@ CommentOperation AIParserBase::getCommentOperation (const char *command) { for(;;) { CommentOperationMapping map = commentMappings[i]; if (map.op == NULL) return CO_Other; - index = data.find (map.op); + index = data.tqfind (map.op); if (index >= 0) return map.action; i++; } } -void GStateHandlerBase::gotFillPattern (const char *pname, double px, double py, double sx, double sy, double angle, double rf, double r, double k, double ka, const QValueVector<AIElement>& transformData) { +void GStateHandlerBase::gotFillPattern (const char *pname, double px, double py, double sx, double sy, double angle, double rf, double r, double k, double ka, const TQValueVector<AIElement>& transformData) { qDebug ( "got fill pattern %s %f %f %f %f %f %f %f %f %f", pname, px, py, sx, sy, angle, rf, r, k, ka); arraytoa (transformData); qDebug ("/got fill pattern"); } -void GStateHandlerBase::gotStrokePattern (const char *pname, double px, double py, double sx, double sy, double angle, double rf, double r, double k, double ka, const QValueVector<AIElement>& transformData) { +void GStateHandlerBase::gotStrokePattern (const char *pname, double px, double py, double sx, double sy, double angle, double rf, double r, double k, double ka, const TQValueVector<AIElement>& transformData) { qDebug ( "got stroke pattern %s %f %f %f %f %f %f %f %f %f", pname, px, py, sx, sy, angle, rf, r, k, ka); arraytoa (transformData); qDebug ("/got stroke pattern"); } const char *AIParserBase::getValue (const char *input) { - QString data(input); + TQString data(input); - signed int index = data.find (':'); + signed int index = data.tqfind (':'); if (index < 0) return ""; index++; while (data.at(index) == ' ') index++; @@ -1098,9 +1098,9 @@ const char *AIParserBase::getValue (const char *input) { bool AIParserBase::getRectangle (const char* input, int &llx, int &lly, int &urx, int &ury) { if (input == NULL) return false; - QString s(input); - if (s.contains ("(atend)")) return false; - QStringList values = QStringList::split (" ", input); + TQString s(input); + if (s.tqcontains ("(atend)")) return false; + TQStringList values = TQStringList::split (" ", input); if (values.size() < 5) return false; llx = values[1].toInt(); lly = values[2].toInt(); @@ -1113,8 +1113,8 @@ bool AIParserBase::getRectangle (const char* input, int &llx, int &lly, int &urx bool AIParserBase::getPoint (const char* input, int &x, int &y) { if (input == NULL) return false; - QString s(input); - QStringList values = QStringList::split (" ", input); + TQString s(input); + TQStringList values = TQStringList::split (" ", input); if (values.size() < 3) return false; @@ -1139,20 +1139,20 @@ void AIParserBase::cleanupArrays() AIElement elem (m_stack.top()); m_stack.pop(); - const QString &oldFont = elem.toReference(); + const TQString &oldFont = elem.toReference(); AIElement elem2 (m_stack.top()); m_stack.pop(); - const QString &newFont = elem2.toReference(); + const TQString &newFont = elem2.toReference(); AIElement elem3 (m_stack.top()); m_stack.pop(); - const QValueVector<AIElement> encodingData = elem3.toElementArray(); + const TQValueVector<AIElement> encodingData = elem3.toElementArray(); if (m_textHandler) m_textHandler->gotFontEncoding (encodingData, oldFont.latin1(), newFont.latin1()); } */ -void TextHandlerBase::gotFontEncoding (const QValueVector<AIElement>& encodingData, const char*oldFontName, const char*newFontName) +void TextHandlerBase::gotFontEncoding (const TQValueVector<AIElement>& encodingData, const char*oldFontName, const char*newFontName) { qDebug ("font encoding %s to %s",oldFontName, newFontName); arraytoa (encodingData); @@ -1164,7 +1164,7 @@ void TextHandlerBase::gotFontDefinition (const char*fontName, double size, doubl qDebug ("font definition: name %s size %f leading %f kerning %f align %d", fontName, size, leading, kerning, align); } -void TextHandlerBase::gotTextBlockBegin (const QValueVector<AIElement>& transData, TextOperation mode) +void TextHandlerBase::gotTextBlockBegin (const TQValueVector<AIElement>& transData, TextOperation mode) { qDebug ("text block begin %d",mode); arraytoa (transData); @@ -1213,7 +1213,7 @@ const void elementtoa (const AIElement &/*data*/) } */ } -const void arraytoa (const QValueVector<AIElement> &/*data*/) +const void arraytoa (const TQValueVector<AIElement> &/*data*/) { /* qDebug ("array size is %d ",data.size()); if (data.size() > 0) @@ -1227,7 +1227,7 @@ const void arraytoa (const QValueVector<AIElement> &/*data*/) } */ } -const void stacktoa (const QValueStack<AIElement> &/*data*/) +const void stacktoa (const TQValueStack<AIElement> &/*data*/) { /* qDebug ("stack size is %d",data.size()); if (data.size() > 0) @@ -1241,7 +1241,7 @@ const void stacktoa (const QValueStack<AIElement> &/*data*/) qDebug (">>>>>>>>>>>>>>>>>>"); */ } -const void stacktoa2 (const QValueStack<QValueVector<AIElement> >&/*data*/) +const void stacktoa2 (const TQValueStack<TQValueVector<AIElement> >&/*data*/) { /* qDebug ("stack size is %d",data.size()); diff --git a/filters/karbon/ai/aiparserbase.h b/filters/karbon/ai/aiparserbase.h index 8d2633f3..14c00a14 100644 --- a/filters/karbon/ai/aiparserbase.h +++ b/filters/karbon/ai/aiparserbase.h @@ -22,19 +22,19 @@ #include "ailexer.h" -#include <qstring.h> -#include <qvaluestack.h> -#include <qvaluevector.h> -#include <qvaluelist.h> +#include <tqstring.h> +#include <tqvaluestack.h> +#include <tqvaluevector.h> +#include <tqvaluelist.h> #include "aielement.h" #include "aicolor.h" -const void arraytoa (const QValueVector<AIElement> &data); +const void arraytoa (const TQValueVector<AIElement> &data); const void elementtoa (const AIElement &data); -const void stacktoa (const QValueStack<AIElement> &data); -const void stacktoa2 (const QValueStack<QValueVector<AIElement> >&data); +const void stacktoa (const TQValueStack<AIElement> &data); +const void stacktoa2 (const TQValueStack<TQValueVector<AIElement> >&data); class GStateHandlerBase; class StructureHandlerBase; @@ -209,9 +209,9 @@ typedef enum { #define PatternTileFilledDefiniton "_" #define TextSizeUnknown -1 -/* typedef QValueVector<AElement> ElementArray; -typedef QValueStack<AIElement> ElementStack; -typedef QValueStack<ElementArray> ElementArrayStack; */ +/* typedef TQValueVector<AElement> ElementArray; +typedef TQValueStack<AIElement> ElementStack; +typedef TQValueStack<ElementArray> ElementArrayStack; */ typedef struct { PathElementType petype; @@ -234,19 +234,19 @@ protected: bool m_debug; private: bool m_ignoring; - QValueStack<AIElement> m_stack; - QValueStack<QValueVector<AIElement> > m_arrayStack; - QValueStack<QValueVector<AIElement> > m_blockStack; + TQValueStack<AIElement> m_stack; + TQValueStack<TQValueVector<AIElement> > m_arrayStack; + TQValueStack<TQValueVector<AIElement> > m_blockStack; DataSink m_sink; - QValueList<QString> m_modules; + TQValueList<TQString> m_modules; ContinuationMode m_continuationMode; const double getDoubleValue(void); const int getIntValue(void); const bool getBoolValue(void); - const QString getStringValue(void); - const QString& getReferenceValue(void); - const QString getOperatorValue(void); + const TQString getStringValue(void); + const TQString& getReferenceValue(void); + const TQString getOperatorValue(void); /*Ai88*/ // void _handleSetDash(); /*Ai88*/ // void _handleGsaveIncludeDocument(); @@ -308,7 +308,7 @@ protected: void gotArrayStart (); void gotArrayEnd (); void gotByte (uchar value); - void gotByteArray (const QByteArray &data); + void gotByteArray (const TQByteArray &data); GStateHandlerBase *m_gstateHandler; StructureHandlerBase *m_structureHandler; @@ -328,7 +328,7 @@ public: AIParserBase(); ~AIParserBase(); - bool parse (QIODevice& fin); + bool parse (TQIODevice& fin); }; const void aiotoa (AIOperation &data); @@ -342,15 +342,15 @@ class GStateHandlerBase virtual void gotFillColor (AIColor &) {} virtual void gotStrokeColor (AIColor &) {} - virtual void gotFillPattern (const char *pname, double px, double py, double sx, double sy, double angle, double rf, double r, double k, double ka, const QValueVector<AIElement>& transformData); - virtual void gotStrokePattern (const char *pname, double px, double py, double sx, double sy, double angle, double rf, double r, double k, double ka, const QValueVector<AIElement>& transformData); + virtual void gotFillPattern (const char *pname, double px, double py, double sx, double sy, double angle, double rf, double r, double k, double ka, const TQValueVector<AIElement>& transformData); + virtual void gotStrokePattern (const char *pname, double px, double py, double sx, double sy, double angle, double rf, double r, double k, double ka, const TQValueVector<AIElement>& transformData); virtual void gotFlatness (double) {} virtual void gotLineWidth (double) {} virtual void gotLineCaps (int) {} virtual void gotLineJoin (int) {} virtual void gotMiterLimit (double) {} virtual void gotWindingOrder (int) {} - virtual void gotDash (const QValueVector<AIElement>& /*dashData*/, double /*phase*/) {} + virtual void gotDash (const TQValueVector<AIElement>& /*dashData*/, double /*phase*/) {} }; class StructureHandlerBase { @@ -401,7 +401,7 @@ class DocumentHandlerBase { virtual void gotTemplate (const char *) {} virtual void gotTitle (const char *) {} virtual void gotCreator (const char *) {} - virtual void gotPatternDefinition (const char */*name*/, const QValueVector<AIElement>& /*layerData*/, double /*llx*/, double /*lly*/, double /*urx*/, double /*ury*/) {} + virtual void gotPatternDefinition (const char */*name*/, const TQValueVector<AIElement>& /*layerData*/, double /*llx*/, double /*lly*/, double /*urx*/, double /*ury*/) {} virtual void gotCreationDate (const char */*val1*/,const char */*val2*/) {} virtual void gotProcessColors (int /*colors*/) {} }; @@ -420,7 +420,7 @@ class EmbeddedHandlerBase { EmbeddedHandlerBase() {} virtual ~EmbeddedHandlerBase() {} - virtual void gotGsaveIncludeDocument (const QValueVector<AIElement>& /*transData*/, int /*llx*/, int /*lly*/, int /*urx*/, int /*ury*/, const char*/*fileName*/) {} + virtual void gotGsaveIncludeDocument (const TQValueVector<AIElement>& /*transData*/, int /*llx*/, int /*lly*/, int /*urx*/, int /*ury*/, const char*/*fileName*/) {} virtual void gotGrestore () {} }; @@ -429,9 +429,9 @@ class TextHandlerBase { TextHandlerBase() {} virtual ~TextHandlerBase() {} - virtual void gotFontEncoding (const QValueVector<AIElement>& encodingData, const char*oldFontName, const char*newFontName); + virtual void gotFontEncoding (const TQValueVector<AIElement>& encodingData, const char*oldFontName, const char*newFontName); virtual void gotFontDefinition (const char*fontName, double size, double leading, double kerning, TextAlign align); - virtual void gotTextBlockBegin (const QValueVector<AIElement>& transData, TextOperation mode); + virtual void gotTextBlockBegin (const TQValueVector<AIElement>& transData, TextOperation mode); virtual void gotTextOutput (const char*text, int length=-1); virtual void gotTextBlockEnd (); }; diff --git a/filters/karbon/ai/karbonaiparserbase.cc b/filters/karbon/ai/karbonaiparserbase.cc index 8c2b5a5f..77945723 100644 --- a/filters/karbon/ai/karbonaiparserbase.cc +++ b/filters/karbon/ai/karbonaiparserbase.cc @@ -25,7 +25,7 @@ #include <core/vclipgroup.h> #include <core/vvisitor.h> #include "aicolor.h" -#include <qwmatrix.h> +#include <tqwmatrix.h> #include <commands/vtransformcmd.h> #include <KoPageLayout.h> @@ -90,7 +90,7 @@ void KarbonAIParserBase::parsingFinished(){ if (m_bbox.height() > 0. ) m_document->setHeight (m_bbox.height()); -/* QWMatrix matrix; +/* TQWMatrix matrix; matrix.translate (-m_bbox.x(),-m_bbox.y()); VTransformNodes translator (matrix); @@ -101,8 +101,8 @@ void KarbonAIParserBase::parsingFinished(){ } // generic -QString KarbonAIParserBase::getParamList(Parameters& params){ - QString data(""); +TQString KarbonAIParserBase::getParamList(Parameters& params){ + TQString data(""); Parameter *param; @@ -450,7 +450,7 @@ void KarbonAIParserBase::doOutputCurrentPath2(PathOutputType type) m_curKarbonPath = new VPath( 0L ); } -bool KarbonAIParserBase::parse (QIODevice& fin, QDomDocument &doc) +bool KarbonAIParserBase::parse (TQIODevice& fin, TQDomDocument &doc) { bool res = AIParserBase::parse (fin); @@ -461,7 +461,7 @@ bool KarbonAIParserBase::parse (QIODevice& fin, QDomDocument &doc) qDebug ("before save document"); doc = m_document->saveXML(); // add paper info, we always need custom for svg (Rob) - QDomElement paper = doc.createElement( "PAPER" ); + TQDomElement paper = doc.createElement( "PAPER" ); doc.documentElement().appendChild( paper ); paper.setAttribute( "format", PG_CUSTOM ); paper.setAttribute( "width", m_document->width() ); @@ -471,7 +471,7 @@ bool KarbonAIParserBase::parse (QIODevice& fin, QDomDocument &doc) } else { - QDomDocument tempDoc; + TQDomDocument tempDoc; doc = tempDoc; } diff --git a/filters/karbon/ai/karbonaiparserbase.h b/filters/karbon/ai/karbonaiparserbase.h index 4b6f05a9..160fdc20 100644 --- a/filters/karbon/ai/karbonaiparserbase.h +++ b/filters/karbon/ai/karbonaiparserbase.h @@ -21,9 +21,9 @@ #define KARBONAIPARSERBASE_H #include <aiparserbase.h> -#include <qptrlist.h> -#include <qstring.h> -#include <qpair.h> +#include <tqptrlist.h> +#include <tqstring.h> +#include <tqpair.h> #include "aicolor.h" @@ -34,16 +34,16 @@ #include <core/vgroup.h> #include <core/vfill.h> #include <core/vstroke.h> -#include <qdom.h> +#include <tqdom.h> -#include <qptrstack.h> +#include <tqptrstack.h> /** *@author */ -typedef QPair<QString,QString> Parameter; -typedef QPtrList<Parameter> Parameters; -typedef QPtrList<PathElement> PathElements; +typedef TQPair<TQString,TQString> Parameter; +typedef TQPtrList<Parameter> Parameters; +typedef TQPtrList<PathElement> PathElements; typedef enum { POT_Filled = 1, POT_Stroked = 2, POT_FilledStroked = 3, POT_Clip = 4, POT_Ignore = 8, POT_Leave = -1, POT_Other = 0 } PathOutputType; typedef enum { PTT_Output = 1, PTT_Combine = 2 } PathTransferType; @@ -132,13 +132,13 @@ public: KarbonAIParserBase(); ~KarbonAIParserBase(); - bool parse (QIODevice& fin, QDomDocument &doc); + bool parse (TQIODevice& fin, TQDomDocument &doc); private: VPath *m_curKarbonPath; VDocument *m_document; VLayer *m_layer; VPath *m_combination; - QPtrStack<VGroup> m_groupStack; + TQPtrStack<VGroup> m_groupStack; FillMode m_fm; PathOutputType m_pot; @@ -171,7 +171,7 @@ protected: void parsingStarted(); void parsingFinished(); - QString getParamList(Parameters& params); + TQString getParamList(Parameters& params); void gotPathElement (PathElement &element); void gotFillPath (bool closed, bool reset, FillMode fm = FM_NonZero); diff --git a/filters/karbon/applixgraphics/applixgraphicimport.cc b/filters/karbon/applixgraphics/applixgraphicimport.cc index 2ee52685..8a433ec9 100644 --- a/filters/karbon/applixgraphics/applixgraphicimport.cc +++ b/filters/karbon/applixgraphics/applixgraphicimport.cc @@ -25,9 +25,9 @@ #endif #include <kdebug.h> -#include <qfile.h> -#include <qtextstream.h> -#include <qmessagebox.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqmessagebox.h> #include <KoFilterChain.h> #include <kgenericfactory.h> #include <math.h> @@ -115,7 +115,7 @@ applixGraphicsRect::applixGraphicsRect() : applixGraphicsLine() * * * * ******************************************************************************/ -APPLIXGRAPHICImport::APPLIXGRAPHICImport (KoFilter *, const char *, const QStringList&) : +APPLIXGRAPHICImport::APPLIXGRAPHICImport (KoFilter *, const char *, const TQStringList&) : KoFilter () { @@ -133,7 +133,7 @@ APPLIXGRAPHICImport::APPLIXGRAPHICImport (KoFilter *, const char *, const QStrin * * * * ******************************************************************************/ -KoFilter::ConversionStatus APPLIXGRAPHICImport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus APPLIXGRAPHICImport::convert( const TQCString& from, const TQCString& to ) { // Check MIME Types @@ -141,7 +141,7 @@ KoFilter::ConversionStatus APPLIXGRAPHICImport::convert( const QCString& from, c return KoFilter::NotImplemented; // Open Inputfile - QFile in (m_chain->inputFile()); + TQFile in (m_chain->inputFile()); if (!in.open (IO_ReadOnly) ) { kdError(30502) << "Unable to open input file!" << endl; @@ -149,21 +149,21 @@ KoFilter::ConversionStatus APPLIXGRAPHICImport::convert( const QCString& from, c return KoFilter::FileNotFound; } - QString str; + TQString str; // Create karbon header str += "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; str += "<!DOCTYPE karbon>\n"; str += " <karbon mime=\"application/x-karbon\" version=\"2\" editor=\"APPLIXGRAPHICS import filter\">\n"; // str += " <head>\n"; -// str += " <layout width=\"210\" lmargin=\"0\" format=\"a4\" bmargin=\"0\" height=\"297\" rmargin=\"0\" tmargin=\"0\" orientation=\"portrait\"/>\n"; +// str += " <tqlayout width=\"210\" lmargin=\"0\" format=\"a4\" bmargin=\"0\" height=\"297\" rmargin=\"0\" tmargin=\"0\" orientation=\"portrait\"/>\n"; // str += " <grid dx=\"20\" dy=\"20\" align=\"0\">\n"; // str += " <helplines align=\"0\"/>\n"; // str += " </grid>\n"; // str += " </head>\n"; str += " <layer name=\"ag-layer\" visible=\"1\">\n"; - QTextStream stream(&in); + TQTextStream stream(&in); int step = in.size()/50; int value = 0; int i = 0; @@ -171,7 +171,7 @@ KoFilter::ConversionStatus APPLIXGRAPHICImport::convert( const QCString& from, c int pos = 0; int vers[3] = { 0, 0, 0 }; int rueck; // Check scanf inputs - QString mystr; + TQString mystr; // Read Headline mystr = stream.readLine (); @@ -186,13 +186,13 @@ KoFilter::ConversionStatus APPLIXGRAPHICImport::convert( const QCString& from, c kdDebug (s_area) << "Header not correkt - May be it is not an applixgraphics file" << endl; kdDebug (s_area) << "Headerline: " << mystr << endl; - QMessageBox::critical (0L, "Applixgraphics header problem", - QString ("The Applixgraphics header is not correct. " + TQMessageBox::critical (0L, "Applixgraphics header problem", + TQString ("The Applixgraphics header is not correct. " "May be it is not an applixgraphics file! <BR>" - "This is the header line I did read:<BR><B>%1</B>").arg(mystr.latin1()), + "This is the header line I did read:<BR><B>%1</B>").tqarg(mystr.latin1()), "Comma"); - // i18n( "What is the separator used in this file ? First line is \n%1" ).arg(firstLine), + // i18n( "What is the separator used in this file ? First line is \n%1" ).tqarg(firstLine), return KoFilter::StupidError; } @@ -231,11 +231,11 @@ KoFilter::ConversionStatus APPLIXGRAPHICImport::convert( const QCString& from, c //mystr.remove (0, 7); - //remove_pos = mystr.find ('('); + //remove_pos = mystr.tqfind ('('); //mystr.remove (0, remove_pos); //agLine.offX= mystr.toInt(); - //remove_pos = mystr.find (','); + //remove_pos = mystr.tqfind (','); //mystr.remove (0, remove_pos); //agLine.offY= mystr.toInt(); rueck = sscanf ((const char *) mystr.latin1(), "(%d,%d)", @@ -301,16 +301,16 @@ KoFilter::ConversionStatus APPLIXGRAPHICImport::convert( const QCString& from, c str += " <polyline arrow1=\"0\" arrow2=\"0\" >\n"; // str += " <point x=\"" + agLine.ptX[0] + "\" y=\"" + agLine.ptY[0] + "\" />"; str += " <point x=\"" ; - str += QString::number ((agLine.ptX[0] + agLine.offX)/FAKTOR); + str += TQString::number ((agLine.ptX[0] + agLine.offX)/FAKTOR); str += "\" y=\""; - str += QString::number ((agLine.ptY[0] + agLine.offY)/FAKTOR); + str += TQString::number ((agLine.ptY[0] + agLine.offY)/FAKTOR); str += "\" />\n"; // str += " <point x=\"" + agLine.ptX[1] + "\" y=\"" + agLine.ptY[1] + "\" />"; str += " <point x=\""; - str += QString::number ((agLine.ptX[1] + agLine.offX)/FAKTOR); + str += TQString::number ((agLine.ptX[1] + agLine.offX)/FAKTOR); str += "\" y=\""; - str += QString::number ((agLine.ptY[1] + agLine.offY)/FAKTOR); + str += TQString::number ((agLine.ptY[1] + agLine.offY)/FAKTOR); str += "\" />\n"; str += " <gobject fillstyle=\"0\" linewidth=\"1\" strokecolor=\"#000000\" strokestyle=\"1\" >\n"; str += " <matrix dx=\"0\" dy=\"0\" m21=\"0\" m22=\"1\" m11=\"1\" m12=\"0\" />\n"; @@ -411,8 +411,8 @@ KoFilter::ConversionStatus APPLIXGRAPHICImport::convert( const QCString& from, c b = agLine.ptY[2] / 2; for (int i=0; i<nsides; i++) { - x[i] = qRound (a * cos (wink*M_PI/180)); - y[i] = qRound (b * sin (wink*M_PI/180)); + x[i] = tqRound (a * cos (wink*M_PI/180)); + y[i] = tqRound (b * sin (wink*M_PI/180)); wink += (360/nsides); } @@ -421,9 +421,9 @@ KoFilter::ConversionStatus APPLIXGRAPHICImport::convert( const QCString& from, c for (int i=0; i<nsides; i++) { str += " <point x=\"" ; - str += QString::number ((x[i] + agLine.offX)/FAKTOR); + str += TQString::number ((x[i] + agLine.offX)/FAKTOR); str += "\" y=\""; - str += QString::number ((y[i] + agLine.offY)/FAKTOR); + str += TQString::number ((y[i] + agLine.offY)/FAKTOR); str += "\" />\n"; } @@ -514,9 +514,9 @@ KoFilter::ConversionStatus APPLIXGRAPHICImport::convert( const QCString& from, c // Werte in die Struktur einlagern str += " <text "; str += "x=\"" ; - str += QString::number (agText.offX); + str += TQString::number (agText.offX); str += "\" y=\"" ; - str += QString::number (agText.offY); + str += TQString::number (agText.offY); str += "\" >\n"; str += " <![CDATA[" + agText.str; str += "]]>\n"; @@ -672,38 +672,38 @@ KoFilter::ConversionStatus APPLIXGRAPHICImport::convert( const QCString& from, c // Werte in die Struktur einlagern str += " <rectangle "; str += "x=\"" ; - str += QString::number ((agRect.offX)/FAKTOR); + str += TQString::number ((agRect.offX)/FAKTOR); str += "\" y=\""; - str += QString::number ((agRect.offY)/FAKTOR); + str += TQString::number ((agRect.offY)/FAKTOR); str += "\" width=\"" ; - str += QString::number ((agRect.ptX[2])/FAKTOR); + str += TQString::number ((agRect.ptX[2])/FAKTOR); str += "\" height=\""; - str += QString::number ((agRect.ptY[2])/FAKTOR); + str += TQString::number ((agRect.ptY[2])/FAKTOR); str += "\" >\n"; str += " <polyline arrow1=\"0\" arrow2=\"0\" >\n"; str += " <point x=\"" ; - str += QString::number ((agRect.ptX[0] + agRect.offX)/FAKTOR) ; + str += TQString::number ((agRect.ptX[0] + agRect.offX)/FAKTOR) ; str += "\" y=\"" ; - str += QString::number ((agRect.ptY[0] + agRect.offY)/FAKTOR) ; + str += TQString::number ((agRect.ptY[0] + agRect.offY)/FAKTOR) ; str += "\" />\n"; str += " <point x=\"" ; - str += QString::number ((agRect.ptX[0] + agRect.ptX[2] + agRect.offX)/FAKTOR) ; + str += TQString::number ((agRect.ptX[0] + agRect.ptX[2] + agRect.offX)/FAKTOR) ; str += "\" y=\"" ; - str += QString::number ((agRect.ptY[0] + agRect.offY)/FAKTOR) ; + str += TQString::number ((agRect.ptY[0] + agRect.offY)/FAKTOR) ; str += "\" />\n"; str += " <point x=\"" ; - str += QString::number ((agRect.ptX[0] + agRect.ptX[2] + agRect.offX)/FAKTOR) ; + str += TQString::number ((agRect.ptX[0] + agRect.ptX[2] + agRect.offX)/FAKTOR) ; str += "\" y=\"" ; - str += QString::number ((agRect.ptY[0] + agRect.ptY[2] + agRect.offY)/FAKTOR) ; + str += TQString::number ((agRect.ptY[0] + agRect.ptY[2] + agRect.offY)/FAKTOR) ; str += "\" />\n"; str += " <point x=\"" ; - str += QString::number ((agRect.ptX[0] + agRect.offX)/FAKTOR) ; + str += TQString::number ((agRect.ptX[0] + agRect.offX)/FAKTOR) ; str += "\" y=\"" ; - str += QString::number ((agRect.ptY[0] + agRect.ptY[2] + agRect.offY)/FAKTOR) ; + str += TQString::number ((agRect.ptY[0] + agRect.ptY[2] + agRect.offY)/FAKTOR) ; str += "\" />\n"; @@ -818,7 +818,7 @@ KoFilter::ConversionStatus APPLIXGRAPHICImport::convert( const QCString& from, c return KoFilter::StorageCreationError; } - QCString cstring = str.utf8(); + TQCString cstring = str.utf8(); out->writeBlock ( (const char*)cstring, cstring.size() - 1 ); in.close (); diff --git a/filters/karbon/applixgraphics/applixgraphicimport.h b/filters/karbon/applixgraphics/applixgraphicimport.h index a65e26db..4b25471d 100644 --- a/filters/karbon/applixgraphics/applixgraphicimport.h +++ b/filters/karbon/applixgraphics/applixgraphicimport.h @@ -26,12 +26,13 @@ class APPLIXGRAPHICImport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - APPLIXGRAPHICImport (KoFilter *parent, const char *name, const QStringList&); + APPLIXGRAPHICImport (KoFilter *tqparent, const char *name, const TQStringList&); virtual ~APPLIXGRAPHICImport() {} - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); }; @@ -47,7 +48,7 @@ class applixGraphicsLine int thickNess; int ptX[5]; int ptY[5]; - QString str; + TQString str; applixGraphicsLine (); // Constructor }; diff --git a/filters/karbon/eps/epsexport.cc b/filters/karbon/eps/epsexport.cc index 8ded1772..e1bd06a5 100644 --- a/filters/karbon/eps/epsexport.cc +++ b/filters/karbon/eps/epsexport.cc @@ -17,13 +17,13 @@ * Boston, MA 02110-1301, USA. */ -#include <qapplication.h> -#include <qcstring.h> -#include <qdatetime.h> // For creation date/time. -#include <qdom.h> -#include <qfile.h> -#include <qstring.h> -#include <qvaluelist.h> +#include <tqapplication.h> +#include <tqcstring.h> +#include <tqdatetime.h> // For creation date/time. +#include <tqdom.h> +#include <tqfile.h> +#include <tqstring.h> +#include <tqvaluelist.h> #include <kdebug.h> #include <kgenericfactory.h> @@ -82,13 +82,13 @@ protected: K_EXPORT_COMPONENT_FACTORY( libkarbonepsexport, EpsExportFactory() ) -EpsExport::EpsExport( KoFilter*, const char*, const QStringList& ) +EpsExport::EpsExport( KoFilter*, const char*, const TQStringList& ) : KoFilter(), m_exportHidden( true ) { } -KoFilter::ConversionStatus -EpsExport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus +EpsExport::convert( const TQCString& from, const TQCString& to ) { if ( to != "image/x-eps" || from != "application/x-karbon" ) { @@ -102,12 +102,12 @@ EpsExport::convert( const QCString& from, const QCString& to ) return KoFilter::StupidError; - KoFilter::ConversionStatus status = KoFilter::OK; + KoFilter::ConversiontqStatus status = KoFilter::OK; // Ask questions about PS level etc. EpsExportDlg* dialog = new EpsExportDlg(); - QApplication::setOverrideCursor( Qt::arrowCursor ); + TQApplication::setOverrideCursor( TQt::arrowCursor ); if( dialog->exec() ) { @@ -115,20 +115,20 @@ EpsExport::convert( const QCString& from, const QCString& to ) m_psLevel = dialog->psLevel() + 1; m_exportHidden = dialog->exportHidden(); - QFile fileOut( m_chain->outputFile() ); + TQFile fileOut( m_chain->outputFile() ); if( !fileOut.open( IO_WriteOnly ) ) { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); delete( dialog ); return KoFilter::StupidError; } - QDomDocument domIn; + TQDomDocument domIn; domIn.setContent( storeIn ); - QDomElement docNode = domIn.documentElement(); + TQDomElement docNode = domIn.documentElement(); - m_stream = new QTextStream( &fileOut ); + m_stream = new TQTextStream( &fileOut ); // Load the document. VDocument doc; @@ -146,7 +146,7 @@ EpsExport::convert( const QCString& from, const QCString& to ) status = KoFilter::UserCancelled; } - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); delete( dialog ); return status; @@ -165,11 +165,11 @@ EpsExport::visitVDocument( VDocument& document ) "%!PS-Adobe-3.0 EPSF-3.0\n" "%%BoundingBox: " << // Round down. - qRound( rect.left() - 0.5 ) << " " << - qRound( rect.top() - 0.5 ) << " " << + tqRound( rect.left() - 0.5 ) << " " << + tqRound( rect.top() - 0.5 ) << " " << // Round up. - qRound( rect.right() + 0.5 ) << " " << - qRound( rect.bottom() + 0.5 ) << "\n" << + tqRound( rect.right() + 0.5 ) << " " << + tqRound( rect.bottom() + 0.5 ) << "\n" << "%%HiResBoundingBox: " << rect.left() << " " << rect.top() << " " << @@ -184,7 +184,7 @@ EpsExport::visitVDocument( VDocument& document ) if( storeIn ) { - QDomDocument domIn; + TQDomDocument domIn; domIn.setContent( storeIn ); KoDocumentInfo docInfo; @@ -194,7 +194,7 @@ EpsExport::visitVDocument( VDocument& document ) static_cast<KoDocumentInfoAuthor*>( docInfo.page( "author" ) ); // Get creation date/time = "now". - QDateTime now( QDateTime::currentDateTime() ); + TQDateTime now( TQDateTime::tqcurrentDateTime() ); *m_stream << "%%CreationDate: (" << now.toString( Qt::LocalDate ) << ")\n" @@ -333,10 +333,10 @@ EpsExport::getStroke( const VStroke& stroke ) // Dash pattern. *m_stream << "["; - const QValueList<float>& + const TQValueList<float>& array( stroke.dashPattern().array() ); - QValueListConstIterator<float> itr = array.begin(); + TQValueListConstIterator<float> itr = array.begin(); for( ; itr != array.end(); ++itr ) *m_stream << *itr << " "; @@ -385,7 +385,7 @@ EpsExport::getFill( const VFill& fill ) *m_stream << l1_gsave << " "; VGradient grad = fill.gradient(); - QPtrVector<VColorStop> ramp = grad.colorStops(); + TQPtrVector<VColorStop> ramp = grad.colorStops(); if( ramp.size() < 2 ) { if( ramp.size() == 1 ) diff --git a/filters/karbon/eps/epsexport.h b/filters/karbon/eps/epsexport.h index b2dd4919..939887c9 100644 --- a/filters/karbon/eps/epsexport.h +++ b/filters/karbon/eps/epsexport.h @@ -25,7 +25,7 @@ #include "vvisitor.h" -class QTextStream; +class TQTextStream; class VColor; class VPath; class VDocument; @@ -40,12 +40,13 @@ class VText; class EpsExport : public KoFilter, private VVisitor { Q_OBJECT + TQ_OBJECT public: - EpsExport( KoFilter* parent, const char* name, const QStringList& ); + EpsExport( KoFilter* tqparent, const char* name, const TQStringList& ); virtual ~EpsExport() {} - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); private: virtual void visitVPath( VPath& composite ); @@ -61,7 +62,7 @@ private: bool isVisible( const VObject* object ) const; - QTextStream* m_stream; + TQTextStream* m_stream; uint m_psLevel; bool m_exportHidden; diff --git a/filters/karbon/eps/epsexportdlg.cc b/filters/karbon/eps/epsexportdlg.cc index 2fb34e14..df51b95b 100644 --- a/filters/karbon/eps/epsexportdlg.cc +++ b/filters/karbon/eps/epsexportdlg.cc @@ -17,11 +17,11 @@ * Boston, MA 02110-1301, USA. */ -#include <qbuttongroup.h> -#include <qradiobutton.h> -#include <qstring.h> -#include <qvbox.h> -#include <qcheckbox.h> +#include <tqbuttongroup.h> +#include <tqradiobutton.h> +#include <tqstring.h> +#include <tqvbox.h> +#include <tqcheckbox.h> #include <klocale.h> #include <knuminput.h> @@ -29,20 +29,20 @@ #include "epsexportdlg.h" -EpsExportDlg::EpsExportDlg( QWidget* parent, const char* name ) - : KDialogBase( parent, name, true, i18n( "EPS Export" ), Ok | Cancel ) +EpsExportDlg::EpsExportDlg( TQWidget* tqparent, const char* name ) + : KDialogBase( tqparent, name, true, i18n( "EPS Export" ), Ok | Cancel ) { - QVBox* page = makeVBoxMainWidget(); + TQVBox* page = makeVBoxMainWidget(); - m_psLevelButtons = new QButtonGroup( 1, QGroupBox::Horizontal, + m_psLevelButtons = new TQButtonGroup( 1, Qt::Horizontal, i18n( "Options" ), page ); - QRadioButton* radio; - radio = new QRadioButton( i18n( "PostScript level 1" ), m_psLevelButtons ); - radio = new QRadioButton( i18n( "PostScript level 2" ), m_psLevelButtons ); - radio = new QRadioButton( i18n( "PostScript level 3" ), m_psLevelButtons ); + TQRadioButton* radio; + radio = new TQRadioButton( i18n( "PostScript level 1" ), m_psLevelButtons ); + radio = new TQRadioButton( i18n( "PostScript level 2" ), m_psLevelButtons ); + radio = new TQRadioButton( i18n( "PostScript level 3" ), m_psLevelButtons ); - m_hiddenExport = new QCheckBox( i18n( "Export hidden layers" ), page ); + m_hiddenExport = new TQCheckBox( i18n( "Export hidden layers" ), page ); m_hiddenExport->setChecked( true ); m_psLevelButtons->setRadioButtonExclusive( true ); diff --git a/filters/karbon/eps/epsexportdlg.h b/filters/karbon/eps/epsexportdlg.h index 332ca882..6850fc97 100644 --- a/filters/karbon/eps/epsexportdlg.h +++ b/filters/karbon/eps/epsexportdlg.h @@ -23,21 +23,22 @@ #include <kdialogbase.h> -class QButtonGroup; -class QCheckBox; +class TQButtonGroup; +class TQCheckBox; class EpsExportDlg : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - EpsExportDlg( QWidget* parent = 0L, const char* name = 0L ); + EpsExportDlg( TQWidget* tqparent = 0L, const char* name = 0L ); uint psLevel() const; bool exportHidden() const; private: - QButtonGroup* m_psLevelButtons; - QCheckBox* m_hiddenExport; + TQButtonGroup* m_psLevelButtons; + TQCheckBox* m_hiddenExport; }; #endif diff --git a/filters/karbon/eps/epsimport.cc b/filters/karbon/eps/epsimport.cc index 2ff34a94..0fefb3e0 100644 --- a/filters/karbon/eps/epsimport.cc +++ b/filters/karbon/eps/epsimport.cc @@ -17,9 +17,9 @@ * Boston, MA 02110-1301, USA. */ -#include <qcstring.h> -#include <qstring.h> -#include <qfile.h> +#include <tqcstring.h> +#include <tqstring.h> +#include <tqfile.h> #include <kgenericfactory.h> #include <KoFilter.h> @@ -48,7 +48,7 @@ protected: K_EXPORT_COMPONENT_FACTORY( libkarbonepsimport, EpsImportFactory() ) -EpsImport::EpsImport( KoFilter*, const char*, const QStringList& ) +EpsImport::EpsImport( KoFilter*, const char*, const TQStringList& ) : KoFilter() { } @@ -57,8 +57,8 @@ EpsImport::~EpsImport() { } -KoFilter::ConversionStatus -EpsImport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus +EpsImport::convert( const TQCString& from, const TQCString& to ) { if( to != "application/illustrator" || @@ -70,18 +70,18 @@ EpsImport::convert( const QCString& from, const QCString& to ) } // Copy input filename: - QString input = m_chain->inputFile(); + TQString input = m_chain->inputFile(); // EPS original bounding box int llx = -1, lly = -1, urx = -1, ury = -1; BoundingBoxExtractor extractor; - QFile file (input); + TQFile file (input); if ( file.open(IO_ReadOnly) ) { - extractor.parse (file); + extractor.parse (*TQT_TQIODEVICE(&file)); llx = extractor.llx(); lly = extractor.lly(); urx = extractor.urx(); @@ -92,11 +92,11 @@ EpsImport::convert( const QCString& from, const QCString& to ) qDebug ("file could not be opened"); // sed filter - QString sedFilter = QString ("sed -e \"s/%%BoundingBox: 0 0 612 792/%%BoundingBox: %1 %2 %3 %4/g\""). - arg(llx).arg(lly).arg(urx).arg(ury); + TQString sedFilter = TQString ("sed -e \"s/%%BoundingBox: 0 0 612 792/%%BoundingBox: %1 %2 %3 %4/g\""). + tqarg(llx).tqarg(lly).tqarg(urx).tqarg(ury); // Build ghostscript call to convert ps/eps -> ai: - QString command( + TQString command( "gs -q -P- -dBATCH -dNOPAUSE -dSAFER -dPARANOIDSAFER -dNODISPLAY ps2ai.ps "); command += KProcess::quote(input); command += " | "; @@ -104,10 +104,10 @@ EpsImport::convert( const QCString& from, const QCString& to ) command += " > "; command += KProcess::quote(m_chain->outputFile()); - qDebug ("command to execute is (%s)", QFile::encodeName(command).data()); + qDebug ("command to execute is (%s)", TQFile::encodeName(command).data()); // Execute it: - if( !system( QFile::encodeName(command)) ) + if( !system( TQFile::encodeName(command)) ) return KoFilter::OK; else return KoFilter::StupidError; diff --git a/filters/karbon/eps/epsimport.h b/filters/karbon/eps/epsimport.h index 15673297..f5e17dfb 100644 --- a/filters/karbon/eps/epsimport.h +++ b/filters/karbon/eps/epsimport.h @@ -20,22 +20,23 @@ #ifndef __EPSIMPORT_H__ #define __EPSIMPORT_H__ -#include <qobject.h> +#include <tqobject.h> #include <KoFilter.h> -class QDomElement; -class QTextStream; +class TQDomElement; +class TQTextStream; class EpsImport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - EpsImport( KoFilter* parent, const char* name, const QStringList& ); + EpsImport( KoFilter* tqparent, const char* name, const TQStringList& ); virtual ~EpsImport(); - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); }; #endif diff --git a/filters/karbon/eps/pscommentlexer.cc b/filters/karbon/eps/pscommentlexer.cc index 46d993dc..dc0a67a1 100644 --- a/filters/karbon/eps/pscommentlexer.cc +++ b/filters/karbon/eps/pscommentlexer.cc @@ -19,7 +19,7 @@ #include <stdlib.h> #include <ctype.h> -#include <qstringlist.h> +#include <tqstringlist.h> #include "pscommentlexer.h" #define CATEGORY_WHITESPACE -1 @@ -82,7 +82,7 @@ PSCommentLexer::PSCommentLexer(){ PSCommentLexer::~PSCommentLexer(){ } -bool PSCommentLexer::parse (QIODevice& fin){ +bool PSCommentLexer::parse (TQIODevice& fin){ char c; m_buffer.clear(); @@ -249,8 +249,8 @@ void StringBuffer::clear(){ m_length = 0; } -QString StringBuffer::toString() const { - QString ret(m_buffer); +TQString StringBuffer::toString() const { + TQString ret(m_buffer); return ret; } @@ -273,12 +273,12 @@ uint StringBuffer::length() { } double StringBuffer::toFloat() { - QString data = toString(); + TQString data = toString(); return data.toFloat(); } int StringBuffer::toInt() { - QString data = toString(); + TQString data = toString(); return data.toInt(); } @@ -286,8 +286,8 @@ const char *StringBuffer::latin1() { return m_buffer; } -QString StringBuffer::mid( uint index, uint len) const { - QString data = toString(); +TQString StringBuffer::mid( uint index, uint len) const { + TQString data = toString(); return data.mid(index,len); } @@ -297,8 +297,8 @@ BoundingBoxExtractor::~BoundingBoxExtractor() {} void BoundingBoxExtractor::gotComment (const char *value) { - QString data (value); - if (data.find("%BoundingBox:")==-1) return; + TQString data (value); + if (data.tqfind("%BoundingBox:")==-1) return; getRectangle (value, m_llx, m_lly, m_urx, m_ury); } @@ -307,11 +307,11 @@ bool BoundingBoxExtractor::getRectangle (const char* input, int &llx, int &lly, { if (input == NULL) return false; - QString s(input); - if (s.contains ("(atend)")) return false; + TQString s(input); + if (s.tqcontains ("(atend)")) return false; - QString s2 = s.remove("%BoundingBox:"); - QStringList values = QStringList::split (" ", s2.latin1()); + TQString s2 = s.remove("%BoundingBox:"); + TQStringList values = TQStringList::split (" ", s2.latin1()); qDebug("size is %d",values.size()); // if (values.size() < 5) return false; llx = values[0].toInt(); diff --git a/filters/karbon/eps/pscommentlexer.h b/filters/karbon/eps/pscommentlexer.h index bf155211..f5893c75 100644 --- a/filters/karbon/eps/pscommentlexer.h +++ b/filters/karbon/eps/pscommentlexer.h @@ -20,8 +20,8 @@ #ifndef PSCOMMENTLEXER_H #define PSCOMMENTLEXER_H -#include <qiodevice.h> -#include <qstring.h> +#include <tqiodevice.h> +#include <tqstring.h> /** *@author Dirk Sch�nberger @@ -52,12 +52,12 @@ public: void append (char c); void clear(); - QString toString() const; + TQString toString() const; uint length(); double toFloat(); int toInt(); const char *latin1(); - QString mid( uint index, uint len=0xffffffff) const; + TQString mid( uint index, uint len=0xffffffff) const; private: char *m_buffer; uint m_length; @@ -71,7 +71,7 @@ public: PSCommentLexer(); virtual ~PSCommentLexer(); - virtual bool parse (QIODevice& fin); + virtual bool parse (TQIODevice& fin); private: State m_curState; StringBuffer m_buffer; diff --git a/filters/karbon/kontour/kontourimport.cpp b/filters/karbon/kontour/kontourimport.cpp index 88d2fc4b..a260fd50 100644 --- a/filters/karbon/kontour/kontourimport.cpp +++ b/filters/karbon/kontour/kontourimport.cpp @@ -1,5 +1,5 @@ /* This file is part of the KDE project - Copyright (C) 2002, Sven L�ppken <[email protected]> + Copyright (C) 2002, Sven L�ppken <[email protected]> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -30,15 +30,15 @@ #include <core/vpath.h> #include <core/vfill.h> #include <core/vstroke.h> -#include <qcolor.h> -#include <qfile.h> +#include <tqcolor.h> +#include <tqfile.h> #define DPI 90 typedef KGenericFactory<KontourImport, KoFilter> KontourImportFactory; K_EXPORT_COMPONENT_FACTORY( libkarbonkontourimport, KontourImportFactory( "kofficefilters" ) ) -KontourImport::KontourImport(KoFilter *, const char *, const QStringList&) : +KontourImport::KontourImport(KoFilter *, const char *, const TQStringList&) : KoFilter(), outdoc( "DOC" ) { @@ -49,7 +49,7 @@ KontourImport::~KontourImport() } -KoFilter::ConversionStatus KontourImport::convert(const QCString& from, const QCString& to) +KoFilter::ConversiontqStatus KontourImport::convert(const TQCString& from, const TQCString& to) { // check for proper conversion if ( to != "application/x-karbon" || ( from != "application/x-kontour" && from != "application/x-killustrator") ) @@ -74,14 +74,14 @@ KoFilter::ConversionStatus KontourImport::convert(const QCString& from, const QC kdError(30502) << "Unable to open output file!" << endl; return KoFilter::StorageCreationError; } - QCString cstring = outdoc.toCString(); // utf-8 already + TQCString cstring = outdoc.toCString(); // utf-8 already out->writeBlock( cstring.data(), cstring.length() ); return KoFilter::OK; // was successful } void -KontourImport::parseGObject( VObject *object, const QDomElement &e ) +KontourImport::parseGObject( VObject *object, const TQDomElement &e ) { if( !e.attribute( "fillstyle" ).isEmpty() ) { @@ -92,7 +92,7 @@ KontourImport::parseGObject( VObject *object, const QDomElement &e ) case 1: { fill.setType( VFill::solid ); - QColor c; + TQColor c; c.setNamedColor( e.attribute( "fillcolor" ) ); VColor color( c ); fill.setColor( color ); @@ -103,7 +103,7 @@ KontourImport::parseGObject( VObject *object, const QDomElement &e ) VGradient grad; // set color stops grad.clearStops(); - QColor c; + TQColor c; c.setNamedColor( e.attribute( "gradcolor1" ) ); VColor color( c ); grad.addStop( color, 0.0, 0.5 ); @@ -132,7 +132,7 @@ KontourImport::parseGObject( VObject *object, const QDomElement &e ) break; case 1: { - QColor c; + TQColor c; c.setNamedColor( e.attribute( "strokecolor" ) ); VColor color( c ); stroke.setColor( color ); @@ -140,12 +140,12 @@ KontourImport::parseGObject( VObject *object, const QDomElement &e ) break; case 2: case 3: case 4: case 5: { - QColor c; + TQColor c; c.setNamedColor( e.attribute( "strokecolor" ) ); VColor color( c ); stroke.setColor( color ); VDashPattern dash; - QValueList<float> list; + TQValueList<float> list; switch ( strokestyle ) { case 2: // dashed line @@ -172,8 +172,8 @@ KontourImport::parseGObject( VObject *object, const QDomElement &e ) object->setStroke( stroke ); } // handle matrix - QDomElement matrix = e.namedItem( "matrix" ).toElement(); - QWMatrix mat( matrix.attribute( "m11" ).toDouble(), + TQDomElement matrix = e.namedItem( "matrix" ).toElement(); + TQWMatrix mat( matrix.attribute( "m11" ).toDouble(), matrix.attribute( "m12" ).toDouble(), matrix.attribute( "m21" ).toDouble(), matrix.attribute( "m22" ).toDouble(), @@ -191,15 +191,15 @@ KontourImport::parseGObject( VObject *object, const QDomElement &e ) void KontourImport::convert() { - QDomElement docElem = inpdoc.documentElement(); - QDomElement lay; + TQDomElement docElem = inpdoc.documentElement(); + TQDomElement lay; double height; double width; if( docElem.attribute( "version" ).toInt() == 2 ) { lay = docElem; - height = lay.firstChild().namedItem( "layout" ).toElement().attribute( "height" ).toDouble(); - width = lay.firstChild().namedItem( "layout" ).toElement().attribute( "width" ).toDouble(); + height = lay.firstChild().namedItem( "tqlayout" ).toElement().attribute( "height" ).toDouble(); + width = lay.firstChild().namedItem( "tqlayout" ).toElement().attribute( "width" ).toDouble(); } else { @@ -217,9 +217,9 @@ KontourImport::convert() } void -KontourImport::parseGroup( const QDomElement &e ) +KontourImport::parseGroup( const TQDomElement &e ) { - QDomElement b = e; + TQDomElement b = e; for( ; !b.isNull(); b = b.nextSibling().toElement() ) { if ( b.tagName() == "rectangle" ) @@ -229,15 +229,15 @@ KontourImport::parseGroup( const QDomElement &e ) int width = b.attribute( "width" ).toInt(); int height = b.attribute( "height" ).toInt(); VObject *rect = new VRectangle( 0L, KoPoint( x, height + y ) , width, height ); - QDomElement object = b.namedItem( "polyline" ).namedItem( "gobject" ).toElement(); + TQDomElement object = b.namedItem( "polyline" ).namedItem( "gobject" ).toElement(); parseGObject( rect, object ); m_document.append( rect ); } else if ( b.tagName() == "ellipse" ) { - QDomElement object = b.namedItem( "gobject" ).toElement(); - QDomElement matrix = object.namedItem( "matrix" ).toElement(); + TQDomElement object = b.namedItem( "gobject" ).toElement(); + TQDomElement matrix = object.namedItem( "matrix" ).toElement(); /** * Kontour uses a quite different way to display ellipses, so we * need to calculate the values for the Karbon ellipse here @@ -259,7 +259,7 @@ KontourImport::parseGroup( const QDomElement &e ) * Kontour is much simpler because it doesn't support curves, so * we're done with connecting points with lines. */ - QDomElement point = b.firstChild().toElement(); + TQDomElement point = b.firstChild().toElement(); VPath *path = new VPath( &m_document ); double x, y; x = point.attribute( "x" ).toDouble(); @@ -277,7 +277,7 @@ KontourImport::parseGroup( const QDomElement &e ) } else if( b.tagName() == "polygon" ) { - QDomElement point = b.namedItem( "polyline" ).firstChild().toElement(); + TQDomElement point = b.namedItem( "polyline" ).firstChild().toElement(); VPath *path = new VPath( &m_document ); double x, y; x = point.attribute( "x" ).toDouble(); @@ -297,7 +297,7 @@ KontourImport::parseGroup( const QDomElement &e ) } else if( b.tagName() == "bezier" ) { - QDomElement point = b.namedItem( "polyline" ).firstChild().toElement(); + TQDomElement point = b.namedItem( "polyline" ).firstChild().toElement(); VPath *path = new VPath( &m_document ); double x, y; x = point.attribute( "x" ).toDouble(); diff --git a/filters/karbon/kontour/kontourimport.h b/filters/karbon/kontour/kontourimport.h index f227f908..9e9bc85a 100644 --- a/filters/karbon/kontour/kontourimport.h +++ b/filters/karbon/kontour/kontourimport.h @@ -21,27 +21,28 @@ #define __KONTOURIMPORT_H__ #include <KoFilter.h> -#include <qdom.h> +#include <tqdom.h> #include <core/vdocument.h> class KontourImport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - KontourImport(KoFilter *parent, const char *name, const QStringList&); + KontourImport(KoFilter *tqparent, const char *name, const TQStringList&); virtual ~KontourImport(); - virtual KoFilter::ConversionStatus convert(const QCString& from, const QCString& to); + virtual KoFilter::ConversiontqStatus convert(const TQCString& from, const TQCString& to); protected: - QDomDocument inpdoc; - QDomDocument outdoc; + TQDomDocument inpdoc; + TQDomDocument outdoc; void convert(); private: - void parseGObject( VObject *, const QDomElement & ); - void parseGroup( const QDomElement & ); + void parseGObject( VObject *, const TQDomElement & ); + void parseGroup( const TQDomElement & ); VDocument m_document; }; diff --git a/filters/karbon/msod/msod.cc b/filters/karbon/msod/msod.cc index dd848c83..ab48642d 100644 --- a/filters/karbon/msod/msod.cc +++ b/filters/karbon/msod/msod.cc @@ -21,12 +21,12 @@ DESCRIPTION */ #include <kdebug.h> -#include <qdatastream.h> -#include <qfile.h> -#include <qptrlist.h> -#include <qpointarray.h> -#include <qrect.h> -#include <qsize.h> +#include <tqdatastream.h> +#include <tqfile.h> +#include <tqptrlist.h> +#include <tqpointarray.h> +#include <tqrect.h> +#include <tqsize.h> #include <msod.h> #include <zlib.h> @@ -39,20 +39,20 @@ Msod::Msod( m_dpi = dpi; m_images.setAutoDelete(true); m_opt = new Options(*this); - m_shape.data = 0L; - m_shape.length = 0; + m_tqshape.data = 0L; + m_tqshape.length = 0; } Msod::~Msod() { - delete [] m_shape.data; + delete [] m_tqshape.data; delete m_opt; } void Msod::drawShape( - unsigned shapeType, - Q_UINT32 bytes, - QDataStream &operands) + unsigned tqshapeType, + TQ_UINT32 bytes, + TQDataStream &operands) { static const char *funcTab[] = { @@ -77,7 +77,7 @@ void Msod::drawShape( "SEAL", // Seal "ARC", // Arc "LINE", // Line - "PLAQUE", // Plaque + "PLATQUE", // Plaque "CAN", // Can "DONUT", // Donut "TEXTSIMPLE", // Textsimple @@ -132,14 +132,14 @@ void Msod::drawShape( "LIGHTNINGBOLT", // Lightningbolt "HEART", // Heart "PICTUREFRAME", // PictureFrame - "QUADARROW", // Quadarrow + "TQUADARROW", // Quadarrow "LEFTARROWCALLOUT", // Leftarrowcallout "RIGHTARROWCALLOUT", // Rightarrowcallout "UPARROWCALLOUT", // Uparrowcallout "DOWNARROWCALLOUT", // Downarrowcallout "LEFTRIGHTARROWCALLOUT", // Leftrightarrowcallout "UPDOWNARROWCALLOUT", // Updownarrowcallout - "QUADARROWCALLOUT", // Quadarrowcallout + "TQUADARROWCALLOUT", // Quadarrowcallout "BEVEL", // Bevel "LEFTBRACKET", // Leftbracket "RIGHTBRACKET", // Rightbracket @@ -153,8 +153,8 @@ void Msod::drawShape( "NOTCHEDRIGHTARROW", // Notchedrightarrow "BLOCKARC", // Blockarc "SMILEYFACE", // Smileyface - "VERTICALSCROLL", // Verticalscroll - "HORIZONTALSCROLL", // Horizontalscroll + "VERTICALSCROLL", //Qt::Verticalscroll + "HORIZONTALSCROLL", //Qt::Horizontalscroll "CIRCULARARROW", // Circulararrow "NOTCHEDCIRCULARARROW", // Notchedcirculararrow "UTURNARROW", // Uturnarrow @@ -262,26 +262,26 @@ void Msod::drawShape( }; struct { - Q_UINT32 spid; // The shape id + TQ_UINT32 spid; // The tqshape id union { - Q_UINT32 info; + TQ_UINT32 info; struct { - Q_UINT32 fGroup : 1; // This shape is a group shape - Q_UINT32 fChild : 1; // Not a top-level shape - Q_UINT32 fPatriarch : 1; // This is the topmost group shape. + TQ_UINT32 fGroup : 1; // This tqshape is a group tqshape + TQ_UINT32 fChild : 1; // Not a top-level tqshape + TQ_UINT32 fPatriarch : 1; // This is the topmost group tqshape. // Exactly one of these per drawing. - Q_UINT32 fDeleted : 1; // The shape has been deleted - Q_UINT32 fOleShape : 1; // The shape is an OLE object - Q_UINT32 fHaveMaster : 1; // Shape has a hspMaster property - Q_UINT32 fFlipH : 1; // Shape is flipped horizontally - Q_UINT32 fFlipV : 1; // Shape is flipped vertically - Q_UINT32 fConnector : 1; // Connector type of shape - Q_UINT32 fHaveAnchor : 1; // Shape has an anchor of some kind - Q_UINT32 fBackground : 1; // Background shape - Q_UINT32 fHaveSpt : 1; // Shape has a shape type property - Q_UINT32 reserved : 20; // Not yet used + TQ_UINT32 fDeleted : 1; // The shape.has been deleted + TQ_UINT32 fOleShape : 1; // The tqshape is an OLE object + TQ_UINT32 fHaveMaster : 1; // Shape has a hspMaster property + TQ_UINT32 fFlipH : 1; // Shape is flipped horizontally + TQ_UINT32 fFlipV : 1; // Shape is flipped vertically + TQ_UINT32 fConnector : 1; // Connector type of tqshape + TQ_UINT32 fHaveAnchor : 1; // Shape has an anchor of some kind + TQ_UINT32 fBackground : 1; // Background tqshape + TQ_UINT32 fHaveSpt : 1; // Shape has a tqshape type property + TQ_UINT32 reserved : 20; // Not yet used } fields; } grfPersistent; } data; @@ -291,12 +291,12 @@ void Msod::drawShape( operands >> data.spid; operands >> data.grfPersistent.info; bytes -= 8; - kdDebug(s_area) << "shape-id: " << data.spid << " type: " << funcTab[shapeType] << " (" << shapeType << ")" << + kdDebug(s_area) << "tqshape-id: " << data.spid << " type: " << funcTab[tqshapeType] << " (" << tqshapeType << ")" << (data.grfPersistent.fields.fGroup ? " group" : "") << (data.grfPersistent.fields.fChild ? " child" : "") << (data.grfPersistent.fields.fPatriarch ? " patriarch" : "") << (data.grfPersistent.fields.fDeleted ? " deleted" : "") << - (data.grfPersistent.fields.fOleShape ? " oleshape" : "") << + (data.grfPersistent.fields.fOleShape ? " oletqshape" : "") << (data.grfPersistent.fields.fHaveMaster ? " master" : "") << (data.grfPersistent.fields.fFlipH ? " flipv" : "") << (data.grfPersistent.fields.fConnector ? " connector" : "") << @@ -309,9 +309,9 @@ void Msod::drawShape( if ((!m_isRequiredDrawing) && (m_requestedShapeId != data.spid)) return; - // An active shape! Let's draw it... + // An active tqshape! Let's draw it... - switch (shapeType) + switch (tqshapeType) { case 0: if (m_opt->m_pVertices) @@ -322,14 +322,14 @@ void Msod::drawShape( case 1: if (bytes > 7) { - QPoint topLeft; - QSize size; + TQPoint topLeft; + TQSize size; topLeft = normalisePoint(operands); size = normaliseSize(operands); - QRect rect(topLeft, size); - QPointArray points(4); + TQRect rect(topLeft, size); + TQPointArray points(4); points.setPoint(0, topLeft); points.setPoint(1, rect.topRight()); @@ -340,12 +340,12 @@ void Msod::drawShape( case 20: if (bytes > 7) { - QPoint lineFrom; - QPoint lineTo; + TQPoint lineFrom; + TQPoint lineTo; lineTo = normalisePoint(operands); - QPointArray points(2); + TQPointArray points(2); points.setPoint(0, lineFrom); points.setPoint(1, lineTo); @@ -359,15 +359,15 @@ void Msod::drawShape( void Msod::invokeHandler( Header &op, - Q_UINT32 bytes, - QDataStream &operands) + TQ_UINT32 bytes, + TQDataStream &operands) { - typedef void (Msod::*method)(Header &op, Q_UINT32 bytes, QDataStream &operands); + typedef void (Msod::*method)(Header &op, TQ_UINT32 bytes, TQDataStream &operands); typedef struct { const char *name; - Q_UINT16 opcode; + TQ_UINT16 opcode; method handler; } opcodeEntry; @@ -432,7 +432,7 @@ void Msod::invokeHandler( " operands: " << bytes << endl; else kdWarning(s_area) << "invokeHandler: unsupported opcode: 0x" << - QString::number(op.opcode.fields.fbt, 16) << + TQString::number(op.opcode.fields.fbt, 16) << " operands: " << bytes << endl; // Skip data we cannot use. @@ -452,19 +452,19 @@ void Msod::invokeHandler( if (bytes) { - QByteArray *record = new QByteArray(bytes); - QDataStream *body; + TQByteArray *record = new TQByteArray(bytes); + TQDataStream *body; operands.readRawBytes(record->data(), bytes); - body = new QDataStream(*record, IO_ReadOnly); - body->setByteOrder(QDataStream::LittleEndian); + body = new TQDataStream(*record, IO_ReadOnly); + body->setByteOrder(TQDataStream::LittleEndian); (this->*result)(op, bytes, *body); delete body; delete record; } else { - QDataStream *body = new QDataStream(); + TQDataStream *body = new TQDataStream(); (this->*result)(op, bytes, *body); delete body; @@ -472,52 +472,52 @@ void Msod::invokeHandler( } } -QPoint Msod::normalisePoint( - QDataStream &operands) +TQPoint Msod::normalisePoint( + TQDataStream &operands) { - Q_UINT16 x; - Q_UINT16 y; + TQ_UINT16 x; + TQ_UINT16 y; operands >> x >> y; - return QPoint(x / m_dpi, y / m_dpi); + return TQPoint(x / m_dpi, y / m_dpi); } -QSize Msod::normaliseSize( - QDataStream &operands) +TQSize Msod::normaliseSize( + TQDataStream &operands) { - Q_UINT16 width; - Q_UINT16 height; + TQ_UINT16 width; + TQ_UINT16 height; operands >> width >> height; - return QSize(width / m_dpi, height / m_dpi); + return TQSize(width / m_dpi, height / m_dpi); } bool Msod::parse( - unsigned shapeId, - const QString &file, + unsigned tqshapeId, + const TQString &file, const char *delayStream) { - QFile in(file); + TQFile in(file); if (!in.open(IO_ReadOnly)) { kdError(s_area) << "Unable to open input file!" << endl; in.close(); return false; } - QDataStream stream(&in); - bool result = parse(shapeId, stream, in.size(), delayStream); + TQDataStream stream(&in); + bool result = parse(tqshapeId, stream, in.size(), delayStream); in.close(); return result; } bool Msod::parse( - unsigned shapeId, - QDataStream &stream, + unsigned tqshapeId, + TQDataStream &stream, unsigned size, const char *delayStream) { - stream.setByteOrder(QDataStream::LittleEndian); // Great, I love Qt ! - m_requestedShapeId = shapeId; + stream.setByteOrder(TQDataStream::LittleEndian); // Great, I love TQt ! + m_requestedShapeId = tqshapeId; m_isRequiredDrawing = false; m_delayStream = delayStream; @@ -529,26 +529,26 @@ bool Msod::parse( void Msod::opAlignrule( Header &, - Q_UINT32, - QDataStream &) + TQ_UINT32, + TQDataStream &) { } void Msod::opAnchor( Header &, - Q_UINT32, - QDataStream &) + TQ_UINT32, + TQDataStream &) { } void Msod::opArcrule( Header &, - Q_UINT32, - QDataStream &) + TQ_UINT32, + TQDataStream &) { } -void Msod::opBlip(Header &, Q_UINT32 bytes, QDataStream &operands) +void Msod::opBlip(Header &, TQ_UINT32 bytes, TQDataStream &operands) { typedef enum { @@ -568,25 +568,25 @@ void Msod::opBlip(Header &, Q_UINT32 bytes, QDataStream &operands) } MSOBLIPCOMPRESSION; bool hasPrimaryId; - Q_UINT32 length = 0; + TQ_UINT32 length = 0; struct { - Q_UINT32 cb; + TQ_UINT32 cb; struct { - Q_UINT32 x; - Q_UINT32 y; - Q_UINT32 w; - Q_UINT32 h; + TQ_UINT32 x; + TQ_UINT32 y; + TQ_UINT32 w; + TQ_UINT32 h; } bounds; struct { - Q_UINT32 w; - Q_UINT32 h; + TQ_UINT32 w; + TQ_UINT32 h; } ptSize; - Q_UINT32 cbSave; - Q_UINT8 compression; - Q_UINT8 filter; + TQ_UINT32 cbSave; + TQ_UINT8 compression; + TQ_UINT8 filter; } data; // Skip any explicit primary header (m_rgbUidprimary). @@ -684,7 +684,7 @@ void Msod::opBlip(Header &, Q_UINT32 bytes, QDataStream &operands) int result; tmp = new char[data.cb]; - result = uncompress((Q_UINT8 *)tmp, &destLen, (Q_UINT8 *)image->data, image->length); + result = uncompress((TQ_UINT8 *)tmp, &destLen, (TQ_UINT8 *)image->data, image->length); if (result != Z_OK) { kdError(s_area) << "opBlip: uncompress failed: " << result << endl; @@ -703,21 +703,21 @@ void Msod::opBlip(Header &, Q_UINT32 bytes, QDataStream &operands) // FBSE - File Blip Store Entry -void Msod::opBse(Header &op, Q_UINT32, QDataStream &operands) +void Msod::opBse(Header &op, TQ_UINT32, TQDataStream &operands) { struct { - Q_UINT8 btWin32; // Required type on Win32. - Q_UINT8 btMacOS; // Required type on Mac. - Q_UINT8 rgbUid[16]; // Identifier of blip. - Q_UINT16 tag; // currently unused. - Q_UINT32 size; // Blip size in stream. - Q_UINT32 cRef; // Reference count on the blip. - Q_UINT32 foDelay; // File offset in the delay stream. - Q_UINT8 usage; // How this blip is used (MSOBLIPUSAGE). - Q_UINT8 cbName; // length of the blip name. - Q_UINT8 unused2; // for the future. - Q_UINT8 unused3; // for the future. + TQ_UINT8 btWin32; // Required type on Win32. + TQ_UINT8 btMacOS; // Required type on Mac. + TQ_UINT8 rgbUid[16]; // Identifier of blip. + TQ_UINT16 tag; // currently unused. + TQ_UINT32 size; // Blip size in stream. + TQ_UINT32 cRef; // Reference count on the blip. + TQ_UINT32 foDelay; // File offset in the delay stream. + TQ_UINT8 usage; // How this blip is used (MSOBLIPUSAGE). + TQ_UINT8 cbName; // length of the blip name. + TQ_UINT8 unused2; // for the future. + TQ_UINT8 unused3; // for the future. } data; unsigned i; @@ -743,10 +743,10 @@ void Msod::opBse(Header &op, Q_UINT32, QDataStream &operands) if (data.size && data.cRef) { - QByteArray bytes; + TQByteArray bytes; bytes.setRawData(m_delayStream + data.foDelay, data.size); - QDataStream stream(bytes, IO_ReadOnly); - stream.setByteOrder(QDataStream::LittleEndian); + TQDataStream stream(bytes, IO_ReadOnly); + stream.setByteOrder(TQDataStream::LittleEndian); walk(data.size, stream); bytes.resetRawData(m_delayStream + data.foDelay, data.size); } @@ -758,41 +758,41 @@ void Msod::opBse(Header &op, Q_UINT32, QDataStream &operands) } } -void Msod::opBstorecontainer(Header &, Q_UINT32 bytes, QDataStream &operands) +void Msod::opBstorecontainer(Header &, TQ_UINT32 bytes, TQDataStream &operands) { walk(bytes, operands); } void Msod::opCalloutrule( Header &, - Q_UINT32, - QDataStream &) + TQ_UINT32, + TQDataStream &) { } void Msod::opChildanchor( Header &, - Q_UINT32, - QDataStream &) + TQ_UINT32, + TQDataStream &) { } -void Msod::opClientanchor(Header &, Q_UINT32, QDataStream &operands) +void Msod::opClientanchor(Header &, TQ_UINT32, TQDataStream &operands) { struct { - Q_UINT32 unknown; + TQ_UINT32 unknown; } data; operands >> data.unknown; kdDebug(s_area) << "client anchor: " << data.unknown << endl; } -void Msod::opClientdata(Header &, Q_UINT32, QDataStream &operands) +void Msod::opClientdata(Header &, TQ_UINT32, TQDataStream &operands) { struct { - Q_UINT32 unknown; + TQ_UINT32 unknown; } data; operands >> data.unknown; @@ -801,61 +801,61 @@ void Msod::opClientdata(Header &, Q_UINT32, QDataStream &operands) void Msod::opClientrule( Header &, - Q_UINT32, - QDataStream &) + TQ_UINT32, + TQDataStream &) { } void Msod::opClienttextbox( Header &, - Q_UINT32, - QDataStream &operands) + TQ_UINT32, + TQDataStream &operands) { struct { - Q_UINT32 unknown; + TQ_UINT32 unknown; } data; operands >> data.unknown; - kdDebug(s_area) << "client textbox: 0x" << QString::number(data.unknown,16) << endl; + kdDebug(s_area) << "client textbox: 0x" << TQString::number(data.unknown,16) << endl; } void Msod::opClsid( Header &, - Q_UINT32, - QDataStream &) + TQ_UINT32, + TQDataStream &) { } void Msod::opColormru( Header &, - Q_UINT32, - QDataStream &) + TQ_UINT32, + TQDataStream &) { } void Msod::opConnectorrule( Header &, - Q_UINT32, - QDataStream &) + TQ_UINT32, + TQDataStream &) { } void Msod::opDeletedpspl( Header &, - Q_UINT32, - QDataStream &) + TQ_UINT32, + TQDataStream &) { } // FDG - File DG -void Msod::opDg(Header &, Q_UINT32, QDataStream &operands) +void Msod::opDg(Header &, TQ_UINT32, TQDataStream &operands) { struct { - Q_UINT32 csp; // The number of shapes in this drawing. - Q_UINT32 spidCur; // The last shape ID given to an SP in this DG. + TQ_UINT32 csp; // The number of tqshapes in this drawing. + TQ_UINT32 spidCur; // The last tqshape ID given to an SP in this DG. } data; operands >> data.csp >> data.spidCur; @@ -867,36 +867,36 @@ void Msod::opDg(Header &, Q_UINT32, QDataStream &operands) } } -void Msod::opDgcontainer(Header &, Q_UINT32 bytes, QDataStream &operands) +void Msod::opDgcontainer(Header &, TQ_UINT32 bytes, TQDataStream &operands) { walk(bytes, operands); } // FDGG - File DGG -void Msod::opDgg(Header &, Q_UINT32, QDataStream &operands) +void Msod::opDgg(Header &, TQ_UINT32, TQDataStream &operands) { struct { - Q_UINT32 spidMax; // The current maximum shape ID. - Q_UINT32 cidcl; // The number of ID clusters (FIDCLs). - Q_UINT32 cspSaved; // The total number of shapes saved. - // (including deleted shapes, if undo + TQ_UINT32 spidMax; // The current maximum tqshape ID. + TQ_UINT32 cidcl; // The number of ID clusters (FIDCLs). + TQ_UINT32 cspSaved; // The total number of tqshapes saved. + // (including deleted tqshapes, if undo // information was saved). - Q_UINT32 cdgSaved; // The total number of drawings saved. + TQ_UINT32 cdgSaved; // The total number of drawings saved. } data; // File ID Cluster - used to save IDCLs struct { - Q_UINT32 dgid; // DG owning the SPIDs in this cluster - Q_UINT32 cspidCur; // number of SPIDs used so far + TQ_UINT32 dgid; // DG owning the SPIDs in this cluster + TQ_UINT32 cspidCur; // number of SPIDs used so far } data1; unsigned i; operands >> data.spidMax >> data.cidcl >> data.cspSaved >> data.cdgSaved; - kdDebug(s_area) << data.cspSaved << " shapes in " << + kdDebug(s_area) << data.cspSaved << " tqshapes in " << data.cidcl - 1 << " clusters in " << data.cdgSaved << " drawings" << endl; for (i = 0; i < data.cidcl - 1; i++) @@ -905,97 +905,97 @@ void Msod::opDgg(Header &, Q_UINT32, QDataStream &operands) } } -void Msod::opDggcontainer(Header &, Q_UINT32 bytes, QDataStream &operands) +void Msod::opDggcontainer(Header &, TQ_UINT32 bytes, TQDataStream &operands) { walk(bytes, operands); } void Msod::opOleobject( Header &, - Q_UINT32, - QDataStream &) + TQ_UINT32, + TQDataStream &) { } -void Msod::opOpt(Header &, Q_UINT32 bytes, QDataStream &operands) +void Msod::opOpt(Header &, TQ_UINT32 bytes, TQDataStream &operands) { m_opt->walk(bytes, operands); } void Msod::opRegroupitems( Header &, - Q_UINT32, - QDataStream &) + TQ_UINT32, + TQDataStream &) { } void Msod::opSelection( Header &, - Q_UINT32, - QDataStream &) + TQ_UINT32, + TQDataStream &) { } -void Msod::opSolvercontainer(Header &, Q_UINT32 bytes, QDataStream &operands) +void Msod::opSolvercontainer(Header &, TQ_UINT32 bytes, TQDataStream &operands) { walk(bytes, operands); } -void Msod::opSp(Header &op, Q_UINT32 bytes, QDataStream &operands) +void Msod::opSp(Header &op, TQ_UINT32 bytes, TQDataStream &operands) { - // We want to defer the act of drawing a shape until we have seen any options + // We want to defer the act of drawing a tqshape until we have seen any options // that may affect it. Thus, we merely store the data away, and let opSpContainer // do all the ahrd work. - m_shape.type = op.opcode.fields.inst; - m_shape.length = bytes; - m_shape.data = new char [bytes]; - operands.readRawBytes(m_shape.data, bytes); + m_tqshape.type = op.opcode.fields.inst; + m_tqshape.length = bytes; + m_tqshape.data = new char [bytes]; + operands.readRawBytes(m_tqshape.data, bytes); } -void Msod::opSpcontainer(Header &, Q_UINT32 bytes, QDataStream &operands) +void Msod::opSpcontainer(Header &, TQ_UINT32 bytes, TQDataStream &operands) { walk(bytes, operands); - // Having gathered all the information for this shape, we can now draw it. + // Having gathered all the information for this tqshape, we can now draw it. - QByteArray a; + TQByteArray a; - a.setRawData(m_shape.data, m_shape.length); - QDataStream s(a, IO_ReadOnly); - s.setByteOrder(QDataStream::LittleEndian); // Great, I love Qt ! - drawShape(m_shape.type, m_shape.length, s); - a.resetRawData(m_shape.data, m_shape.length); - delete [] m_shape.data; - m_shape.data = 0L; + a.setRawData(m_tqshape.data, m_tqshape.length); + TQDataStream s(a, IO_ReadOnly); + s.setByteOrder(TQDataStream::LittleEndian); // Great, I love TQt ! + drawShape(m_tqshape.type, m_tqshape.length, s); + a.resetRawData(m_tqshape.data, m_tqshape.length); + delete [] m_tqshape.data; + m_tqshape.data = 0L; } -void Msod::opSpgr(Header &, Q_UINT32, QDataStream &operands) +void Msod::opSpgr(Header &, TQ_UINT32, TQDataStream &operands) { struct { - Q_UINT32 x; - Q_UINT32 y; - Q_UINT32 w; - Q_UINT32 h; + TQ_UINT32 x; + TQ_UINT32 y; + TQ_UINT32 w; + TQ_UINT32 h; } data; operands >> data.x >> data.y >> data.w >> data.h; } -void Msod::opSpgrcontainer(Header &, Q_UINT32 bytes, QDataStream &operands) +void Msod::opSpgrcontainer(Header &, TQ_UINT32 bytes, TQDataStream &operands) { walk(bytes, operands); } -void Msod::opSplitmenucolors(Header &, Q_UINT32, QDataStream &operands) +void Msod::opSplitmenucolors(Header &, TQ_UINT32, TQDataStream &operands) { struct { - Q_UINT32 fill; - Q_UINT32 line; - Q_UINT32 shadow; - Q_UINT32 threeDee; + TQ_UINT32 fill; + TQ_UINT32 line; + TQ_UINT32 shadow; + TQ_UINT32 threeDee; } data; operands >> data.fill >> data.line >> data.shadow >> data.threeDee; @@ -1003,12 +1003,12 @@ void Msod::opSplitmenucolors(Header &, Q_UINT32, QDataStream &operands) void Msod::opTextbox( Header &, - Q_UINT32, - QDataStream &) + TQ_UINT32, + TQDataStream &) { } -void Msod::skip(Q_UINT32 bytes, QDataStream &operands) +void Msod::skip(TQ_UINT32 bytes, TQDataStream &operands) { if ((int)bytes < 0) { @@ -1017,8 +1017,8 @@ void Msod::skip(Q_UINT32 bytes, QDataStream &operands) } if (bytes) { - Q_UINT32 i; - Q_UINT8 discard; + TQ_UINT32 i; + TQ_UINT8 discard; kdDebug(s_area) << "skip: " << bytes << endl; for (i = 0; i < bytes; i++) @@ -1028,10 +1028,10 @@ void Msod::skip(Q_UINT32 bytes, QDataStream &operands) } } -void Msod::walk(Q_UINT32 bytes, QDataStream &operands) +void Msod::walk(TQ_UINT32 bytes, TQDataStream &operands) { Header op; - Q_UINT32 length = 0; + TQ_UINT32 length = 0; // Stop parsing when there are no more records. Note that we stop as soon // as we cannot get a complete header. @@ -1061,8 +1061,8 @@ void Msod::walk(Q_UINT32 bytes, QDataStream &operands) } Msod::Options::Options( - Msod &parent) : - m_parent(parent) + Msod &tqparent) : + m_parent(tqparent) { m_pVertices = 0L; initialise(); @@ -1073,7 +1073,7 @@ Msod::Options::~Options() delete m_pVertices; } -double Msod::Options::from1616ToDouble(Q_UINT32 value) +double Msod::Options::from1616ToDouble(TQ_UINT32 value) { return (value >> 16) + 65535.0 / (double)(value & 0xffff); } @@ -1085,7 +1085,7 @@ void Msod::Options::initialise() m_lTxid = 0; m_pib = 0; - m_pibName = QString::null; + m_pibName = TQString(); m_pibFlags = 0; m_pictureId = 0; m_fNoHitTestPicture = false; @@ -1097,7 +1097,7 @@ void Msod::Options::initialise() m_geoTop = 0; m_geoRight = 21600; m_geoBottom = 21600; - m_shapePath = 1; + m_tqshapePath = 1; delete m_pVertices; m_pVertices = 0L; m_fShadowOK = true; @@ -1133,11 +1133,11 @@ void Msod::Options::initialise() m_fBackground = false; } -void Msod::Options::walk(Q_UINT32 bytes, QDataStream &operands) +void Msod::Options::walk(TQ_UINT32 bytes, TQDataStream &operands) { Header op; - Q_UINT16 length = 0; - Q_UINT16 complexLength = 0; + TQ_UINT16 length = 0; + TQ_UINT16 complexLength = 0; // Reset all options to default values. @@ -1145,7 +1145,7 @@ void Msod::Options::walk(Q_UINT32 bytes, QDataStream &operands) // First process all simple options, and add all complex options to a list. - QPtrList<Header> complexOpts; + TQPtrList<Header> complexOpts; complexOpts.setAutoDelete(true); bool unsupported; while (length + complexLength < (int)bytes) @@ -1172,7 +1172,7 @@ void Msod::Options::walk(Q_UINT32 bytes, QDataStream &operands) break; case 128: m_lTxid = op.value; - kdDebug(s_area) << "textbox: 0x" << QString::number(op.value,16) << endl; + kdDebug(s_area) << "textbox: 0x" << TQString::number(op.value,16) << endl; break; case 260: if (op.opcode.fields.fBid) @@ -1187,9 +1187,9 @@ void Msod::Options::walk(Q_UINT32 bytes, QDataStream &operands) if (image->extension == "wmf") { - QByteArray a; + TQByteArray a; a.setRawData(image->data, image->length); - QDataStream s(a, IO_ReadOnly); + TQDataStream s(a, IO_ReadOnly); m_parent.KWmf::parse(s, image->length); a.resetRawData(image->data, image->length); } @@ -1233,7 +1233,7 @@ void Msod::Options::walk(Q_UINT32 bytes, QDataStream &operands) m_geoBottom = op.value; break; case 324: - m_shapePath = op.value; + m_tqshapePath = op.value; break; case 383: m_fShadowOK = (op.value & 0x0020) != 0; @@ -1294,7 +1294,7 @@ void Msod::Options::walk(Q_UINT32 bytes, QDataStream &operands) while (complexOpts.count()) { - Q_INT16 t16; + TQ_INT16 t16; unsigned i; op = *complexOpts.getFirst(); @@ -1308,11 +1308,11 @@ void Msod::Options::walk(Q_UINT32 bytes, QDataStream &operands) operands >> t16; if (!t16) break; - m_pibName += QChar(t16); + m_pibName += TQChar(t16); }; break; case 325: - m_pVertices = new QPointArray(op.value / 4); + m_pVertices = new TQPointArray(op.value / 4); for (i = 0; i < m_pVertices->count(); i++) { m_pVertices->setPoint(i, m_parent.normalisePoint(operands)); diff --git a/filters/karbon/msod/msod.h b/filters/karbon/msod/msod.h index a3dd9efe..a1243aaa 100644 --- a/filters/karbon/msod/msod.h +++ b/filters/karbon/msod/msod.h @@ -28,10 +28,10 @@ DESCRIPTION #ifndef MSOD_H #define MSOD_H -class QString; -class QPointArray; +class TQString; +class TQPointArray; #include <kwmf.h> -#include <qptrvector.h> +#include <tqptrvector.h> class Msod : private KWmf @@ -44,16 +44,16 @@ public: unsigned dpi); virtual ~Msod(); - // Called to parse the given file. We extract a drawing by shapeId. + // Called to parse the given file. We extract a drawing by tqshapeId. // If the drawing is not found, the return value will be false. bool parse( - unsigned shapeId, - const QString &file, + unsigned tqshapeId, + const TQString &file, const char *delayStream = 0L); bool parse( - unsigned shapeId, - QDataStream &stream, + unsigned tqshapeId, + TQDataStream &stream, unsigned size, const char *delayStream = 0L); @@ -74,25 +74,25 @@ protected: virtual void gotEllipse( const DrawContext &dc, - QString type, - QPoint topLeft, - QSize halfAxes, + TQString type, + TQPoint topLeft, + TQSize halfAxes, unsigned startAngle, unsigned stopAngle) = 0; virtual void gotPicture( unsigned id, - QString extension, + TQString extension, unsigned length, const char *data) = 0; virtual void gotPolygon( const DrawContext &dc, - const QPointArray &points) = 0; + const TQPointArray &points) = 0; virtual void gotPolyline( const DrawContext &dc, - const QPointArray &points) = 0; + const TQPointArray &points) = 0; virtual void gotRectangle( const DrawContext &dc, - const QPointArray &points) = 0; + const TQPointArray &points) = 0; private: Msod(const Msod &); @@ -114,16 +114,16 @@ private: unsigned type; char *data; unsigned length; - } m_shape; + } m_tqshape; - QPoint normalisePoint( - QDataStream &operands); - QSize normaliseSize( - QDataStream &operands); + TQPoint normalisePoint( + TQDataStream &operands); + TQSize normaliseSize( + TQDataStream &operands); void drawShape( - unsigned shapeType, - Q_UINT32 bytes, - QDataStream &operands); + unsigned tqshapeType, + TQ_UINT32 bytes, + TQDataStream &operands); public: @@ -132,15 +132,15 @@ public: { union { - Q_UINT32 info; + TQ_UINT32 info; struct { - Q_UINT32 ver: 4; - Q_UINT32 inst: 12; - Q_UINT32 fbt: 16; + TQ_UINT32 ver: 4; + TQ_UINT32 inst: 12; + TQ_UINT32 fbt: 16; } fields; } opcode; - Q_UINT32 cbLength; + TQ_UINT32 cbLength; } Header; private: @@ -163,89 +163,89 @@ private: class Image { public: - QString extension; + TQString extension; unsigned length; const char *data; Image() { data = 0L; } ~Image() { delete [] data; } }; - QPtrVector<Image> m_images; + TQPtrVector<Image> m_images; // Opcode handling and painter methods. void walk( - Q_UINT32 bytes, - QDataStream &operands); + TQ_UINT32 bytes, + TQDataStream &operands); void skip( - Q_UINT32 bytes, - QDataStream &operands); + TQ_UINT32 bytes, + TQDataStream &operands); void invokeHandler( Header &op, - Q_UINT32 bytes, - QDataStream &operands); - - void opAlignrule(Header &op, Q_UINT32 bytes, QDataStream &operands); - void opAnchor(Header &op, Q_UINT32 bytes, QDataStream &operands); - void opArcrule(Header &op, Q_UINT32 bytes, QDataStream &operands); - void opBlip(Header &op, Q_UINT32 bytes, QDataStream &operands); - void opBse(Header &op, Q_UINT32 bytes, QDataStream &operands); - void opBstorecontainer(Header &op, Q_UINT32 bytes, QDataStream &operands); - void opCalloutrule(Header &op, Q_UINT32 bytes, QDataStream &operands); - void opChildanchor(Header &op, Q_UINT32 bytes, QDataStream &operands); - void opClientanchor(Header &op, Q_UINT32 bytes, QDataStream &operands); - void opClientdata(Header &op, Q_UINT32 bytes, QDataStream &operands); - void opClientrule(Header &op, Q_UINT32 bytes, QDataStream &operands); - void opClienttextbox(Header &op, Q_UINT32 bytes, QDataStream &operands); - void opClsid(Header &op, Q_UINT32 bytes, QDataStream &operands); - void opColormru(Header &op, Q_UINT32 bytes, QDataStream &operands); - void opConnectorrule(Header &op, Q_UINT32 bytes, QDataStream &operands); - void opDeletedpspl(Header &op, Q_UINT32 bytes, QDataStream &operands); - void opDg(Header &op, Q_UINT32 bytes, QDataStream &operands); - void opDgcontainer(Header &op, Q_UINT32 bytes, QDataStream &operands); - void opDgg(Header &op, Q_UINT32 bytes, QDataStream &operands); - void opDggcontainer(Header &op, Q_UINT32 bytes, QDataStream &operands); - void opOleobject(Header &op, Q_UINT32 bytes, QDataStream &operands); - void opOpt(Header &op, Q_UINT32 bytes, QDataStream &operands); - void opRegroupitems(Header &op, Q_UINT32 bytes, QDataStream &operands); - void opSelection(Header &op, Q_UINT32 bytes, QDataStream &operands); - void opSolvercontainer(Header &op, Q_UINT32 bytes, QDataStream &operands); - void opSp(Header &op, Q_UINT32 bytes, QDataStream &operands); - void opSpcontainer(Header &op, Q_UINT32 bytes, QDataStream &operands); - void opSpgr(Header &op, Q_UINT32 bytes, QDataStream &operands); - void opSpgrcontainer(Header &op, Q_UINT32 bytes, QDataStream &operands); - void opSplitmenucolors(Header &op, Q_UINT32 bytes, QDataStream &operands); - void opTextbox(Header &op, Q_UINT32 bytes, QDataStream &operands); + TQ_UINT32 bytes, + TQDataStream &operands); + + void opAlignrule(Header &op, TQ_UINT32 bytes, TQDataStream &operands); + void opAnchor(Header &op, TQ_UINT32 bytes, TQDataStream &operands); + void opArcrule(Header &op, TQ_UINT32 bytes, TQDataStream &operands); + void opBlip(Header &op, TQ_UINT32 bytes, TQDataStream &operands); + void opBse(Header &op, TQ_UINT32 bytes, TQDataStream &operands); + void opBstorecontainer(Header &op, TQ_UINT32 bytes, TQDataStream &operands); + void opCalloutrule(Header &op, TQ_UINT32 bytes, TQDataStream &operands); + void opChildanchor(Header &op, TQ_UINT32 bytes, TQDataStream &operands); + void opClientanchor(Header &op, TQ_UINT32 bytes, TQDataStream &operands); + void opClientdata(Header &op, TQ_UINT32 bytes, TQDataStream &operands); + void opClientrule(Header &op, TQ_UINT32 bytes, TQDataStream &operands); + void opClienttextbox(Header &op, TQ_UINT32 bytes, TQDataStream &operands); + void opClsid(Header &op, TQ_UINT32 bytes, TQDataStream &operands); + void opColormru(Header &op, TQ_UINT32 bytes, TQDataStream &operands); + void opConnectorrule(Header &op, TQ_UINT32 bytes, TQDataStream &operands); + void opDeletedpspl(Header &op, TQ_UINT32 bytes, TQDataStream &operands); + void opDg(Header &op, TQ_UINT32 bytes, TQDataStream &operands); + void opDgcontainer(Header &op, TQ_UINT32 bytes, TQDataStream &operands); + void opDgg(Header &op, TQ_UINT32 bytes, TQDataStream &operands); + void opDggcontainer(Header &op, TQ_UINT32 bytes, TQDataStream &operands); + void opOleobject(Header &op, TQ_UINT32 bytes, TQDataStream &operands); + void opOpt(Header &op, TQ_UINT32 bytes, TQDataStream &operands); + void opRegroupitems(Header &op, TQ_UINT32 bytes, TQDataStream &operands); + void opSelection(Header &op, TQ_UINT32 bytes, TQDataStream &operands); + void opSolvercontainer(Header &op, TQ_UINT32 bytes, TQDataStream &operands); + void opSp(Header &op, TQ_UINT32 bytes, TQDataStream &operands); + void opSpcontainer(Header &op, TQ_UINT32 bytes, TQDataStream &operands); + void opSpgr(Header &op, TQ_UINT32 bytes, TQDataStream &operands); + void opSpgrcontainer(Header &op, TQ_UINT32 bytes, TQDataStream &operands); + void opSplitmenucolors(Header &op, TQ_UINT32 bytes, TQDataStream &operands); + void opTextbox(Header &op, TQ_UINT32 bytes, TQDataStream &operands); // Option handling. class Options { public: - Options(Msod &parent); + Options(Msod &tqparent); ~Options(); void walk( - Q_UINT32 bytes, - QDataStream &operands); + TQ_UINT32 bytes, + TQDataStream &operands); double m_rotation; - Q_UINT32 m_lTxid; + TQ_UINT32 m_lTxid; - Q_UINT32 m_pib; - QString m_pibName; - Q_UINT32 m_pibFlags; - Q_UINT32 m_pictureId; + TQ_UINT32 m_pib; + TQString m_pibName; + TQ_UINT32 m_pibFlags; + TQ_UINT32 m_pictureId; bool m_fNoHitTestPicture; bool m_pictureGray; bool m_pictureBiLevel; bool m_pictureActive; - Q_UINT32 m_geoLeft; - Q_UINT32 m_geoTop; - Q_UINT32 m_geoRight; - Q_UINT32 m_geoBottom; - Q_UINT32 m_shapePath; - QPointArray *m_pVertices; + TQ_UINT32 m_geoLeft; + TQ_UINT32 m_geoTop; + TQ_UINT32 m_geoRight; + TQ_UINT32 m_geoBottom; + TQ_UINT32 m_tqshapePath; + TQPointArray *m_pVertices; bool m_fShadowOK; bool m_f3DOK; bool m_fLineOK; @@ -259,10 +259,10 @@ private: bool m_fillUseRect; bool m_fNoFillHitTest; - Q_UINT32 m_lineColor; - Q_UINT32 m_lineBackColor; - Q_UINT32 m_lineType; - Q_UINT32 m_lineWidth; + TQ_UINT32 m_lineColor; + TQ_UINT32 m_lineBackColor; + TQ_UINT32 m_lineType; + TQ_UINT32 m_lineWidth; bool m_fArrowheadsOK; bool m_fLine; @@ -270,7 +270,7 @@ private: bool m_lineFillShape; bool m_fNoLineDrawDash; - Q_UINT32 m_bWMode; + TQ_UINT32 m_bWMode; bool m_fOleIcon; bool m_fPreferRelativeResize; @@ -285,19 +285,19 @@ private: { union { - Q_UINT16 info; + TQ_UINT16 info; struct { - Q_UINT16 pid: 14; - Q_UINT16 fBid: 1; - Q_UINT16 fComplex: 1; + TQ_UINT16 pid: 14; + TQ_UINT16 fBid: 1; + TQ_UINT16 fComplex: 1; } fields; } opcode; - Q_UINT32 value; + TQ_UINT32 value; } Header; void initialise(); - double from1616ToDouble(Q_UINT32 value); + double from1616ToDouble(TQ_UINT32 value); }; friend class Msod::Options; diff --git a/filters/karbon/msod/msodimport.cc b/filters/karbon/msod/msodimport.cc index 9af11181..903d50a2 100644 --- a/filters/karbon/msod/msodimport.cc +++ b/filters/karbon/msod/msodimport.cc @@ -25,9 +25,9 @@ DESCRIPTION #include <kmimetype.h> #include <kgenericfactory.h> #include <KoFilterChain.h> -#include <qfile.h> +#include <tqfile.h> #include <msodimport.h> -#include <qpointarray.h> +#include <tqpointarray.h> typedef KGenericFactory<MSODImport, KoFilter> MSODImportFactory; K_EXPORT_COMPONENT_FACTORY( libmsodimport, MSODImportFactory( "kofficefilters" ) ) @@ -37,7 +37,7 @@ const int MSODImport::s_area = 30505; MSODImport::MSODImport( KoFilter *, const char *, - const QStringList&) : + const TQStringList&) : KoEmbeddingFilter(), Msod(100) { } @@ -46,31 +46,31 @@ MSODImport::~MSODImport() { } -KoFilter::ConversionStatus MSODImport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus MSODImport::convert( const TQCString& from, const TQCString& to ) { if (to != "application/x-karbon" || from != "image/x-msod") return KoFilter::NotImplemented; - // Get configuration data: the shape id, and any delay stream that we were given. - unsigned shapeId; - emit commSignalShapeID( shapeId ); + // Get configuration data: the tqshape id, and any delay stream that we were given. + unsigned tqshapeId; + emit commSignalShapeID( tqshapeId ); const char *delayStream = 0L; emit commSignalDelayStream( delayStream ); kdDebug( s_area ) << "##################################################################" << endl; - kdDebug( s_area ) << "shape id: " << shapeId << endl; + kdDebug( s_area ) << "tqshape id: " << tqshapeId << endl; kdDebug( s_area ) << "delay stream: " << delayStream << endl; kdDebug( s_area ) << "##################################################################" << endl; /* - QString config = ""; // ###### FIXME: We aren't able to pass config data right now - QStringList args = QStringList::split(";", config); + TQString config = ""; // ###### FIXME: We aren't able to pass config data right now + TQStringList args = TQStringList::split(";", config); unsigned i; kdDebug(s_area) << "MSODImport::filter: config: " << config << endl; for (i = 0; i < args.count(); i++) { - if (args[i].startsWith("shape-id=")) + if (args[i].startsWith("tqshape-id=")) { - shapeId = args[i].mid(9).toUInt(); + tqshapeId = args[i].mid(9).toUInt(); } else if (args[i].startsWith("delay-stream=")) @@ -91,7 +91,7 @@ KoFilter::ConversionStatus MSODImport::convert( const QCString& from, const QCSt m_text += "<DOC mime=\"application/x-karbon\" syntaxVersion=\"0.1\" editor=\"WMF import filter\">\n"; m_text += " <LAYER name=\"Layer\" visible=\"1\">\n"; - if (!parse(shapeId, m_chain->inputFile(), delayStream)) + if (!parse(tqshapeId, m_chain->inputFile(), delayStream)) return KoFilter::WrongFormat; // close doc @@ -106,7 +106,7 @@ KoFilter::ConversionStatus MSODImport::convert( const QCString& from, const QCSt kdError(s_area) << "Cannot open output file" << endl; return KoFilter::StorageCreationError; } - QCString cstring ( m_text.utf8() ); + TQCString cstring ( m_text.utf8() ); dev->writeBlock(cstring.data(), cstring.size()-1); return KoFilter::OK; @@ -114,27 +114,27 @@ KoFilter::ConversionStatus MSODImport::convert( const QCString& from, const QCSt void MSODImport::gotEllipse( const DrawContext &/*dc*/, - QString /*type*/, - QPoint /*topLeft*/, - QSize /*halfAxes*/, + TQString /*type*/, + TQPoint /*topLeft*/, + TQSize /*halfAxes*/, unsigned /*startAngle*/, unsigned /*stopAngle*/) { // ### TODO #if 0 - m_text += "<ellipse angle1=\"" + QString::number(startAngle) + - "\" angle2=\"" + QString::number(stopAngle) + - "\" x=\"" + QString::number(topLeft.x()) + - "\" y=\"" + QString::number(topLeft.y()) + + m_text += "<ellipse angle1=\"" + TQString::number(startAngle) + + "\" angle2=\"" + TQString::number(stopAngle) + + "\" x=\"" + TQString::number(topLeft.x()) + + "\" y=\"" + TQString::number(topLeft.y()) + "\" kind=\"" + type + - "\" rx=\"" + QString::number(halfAxes.width()) + - "\" ry=\"" + QString::number(halfAxes.height()) + + "\" rx=\"" + TQString::number(halfAxes.width()) + + "\" ry=\"" + TQString::number(halfAxes.height()) + "\">\n"; - m_text += " <gobject fillcolor=\"#" + QString::number(dc.m_brushColour, 16) + - "\" fillstyle=\"" + QString::number(1 /*m_winding*/) + - "\" linewidth=\"" + QString::number(dc.m_penWidth) + - "\" strokecolor=\"#" + QString::number(dc.m_penColour, 16) + - "\" strokestyle=\"" + QString::number(dc.m_penStyle) + + m_text += " <gobject fillcolor=\"#" + TQString::number(dc.m_brushColour, 16) + + "\" fillstyle=\"" + TQString::number(1 /*m_winding*/) + + "\" linewidth=\"" + TQString::number(dc.m_penWidth) + + "\" strokecolor=\"#" + TQString::number(dc.m_penColour, 16) + + "\" strokestyle=\"" + TQString::number(dc.m_penStyle) + "\">\n"; m_text += " <matrix dx=\"0\" dy=\"0\" m21=\"0\" m22=\"1\" m11=\"1\" m12=\"0\"/>\n"; m_text += " </gobject>\n"; @@ -151,7 +151,7 @@ static void toRGB(int c, double &r, double &g, double &b) void MSODImport::gotPicture( unsigned key, - QString extension, + TQString extension, unsigned length, const char *data) { @@ -163,20 +163,20 @@ void MSODImport::gotPicture( (extension == "emf") || (extension == "pict")) { - int partRef = internalPartReference( QString::number( key ) ); + int partRef = internalPartReference( TQString::number( key ) ); if (partRef == -1) { m_embeddeeData = data; m_embeddeeLength = length; - QString srcMime( KoEmbeddingFilter::mimeTypeByExtension( extension ) ); + TQString srcMime( KoEmbeddingFilter::mimeTypeByExtension( extension ) ); if ( srcMime == KMimeType::defaultMimeType() ) kdWarning( s_area ) << "Couldn't determine the mimetype from the extension" << endl; - QCString destMime; // intentionally empty, the filter manager will do the rest - KoFilter::ConversionStatus status; - partRef = embedPart( srcMime.latin1(), destMime, status, QString::number( key ) ); + TQCString destMime; // intentionally empty, the filter manager will do the rest + KoFilter::ConversiontqStatus status; + partRef = embedPart( srcMime.latin1(), destMime, status, TQString::number( key ) ); m_embeddeeData = 0; m_embeddeeLength = 0; @@ -186,14 +186,14 @@ void MSODImport::gotPicture( return; } } - m_text += "<object url=\"" + QString::number( partRef ) + "\" mime=\""; - m_text += internalPartMimeType( QString::number( key ) ); + m_text += "<object url=\"" + TQString::number( partRef ) + "\" mime=\""; + m_text += internalPartMimeType( TQString::number( key ) ); m_text += "\" x=\"0\" y=\"0\" width=\"100\" height=\"200\"/>\n"; } else { // We could not import it as a part. Try as an image. - KTempFile tempFile( QString::null, '.' + extension ); + KTempFile tempFile( TQString(), '.' + extension ); tempFile.file()->writeBlock( data, length ); tempFile.close(); @@ -210,26 +210,26 @@ void MSODImport::gotPicture( void MSODImport::gotPolygon( const DrawContext &dc, - const QPointArray &points) + const TQPointArray &points) { kdDebug(s_area) << "MSODImport::gotPolygon" << endl; - kdDebug(s_area) << QString::number(dc.m_penWidth, 16) << endl; + kdDebug(s_area) << TQString::number(dc.m_penWidth, 16) << endl; kdDebug(s_area) << dc.m_penStyle << endl; m_text += "<COMPOSITE>\n"; if( dc.m_penWidth > 0 ) { - m_text += "<STROKE lineWidth=\"1\">\n";// + QString::number(dc.m_penWidth, 16) + "\">\n"; + m_text += "<STROKE lineWidth=\"1\">\n";// + TQString::number(dc.m_penWidth, 16) + "\">\n"; double r, g, b; toRGB(dc.m_penColour, r, g, b); - m_text += "<COLOR v1=\"" + QString::number(r) + "\" v2=\"" + QString::number(g) + "\" v3=\"" + QString::number(b) + "\" opacity=\"1\" colorSpace=\"0\" />\n"; + m_text += "<COLOR v1=\"" + TQString::number(r) + "\" v2=\"" + TQString::number(g) + "\" v3=\"" + TQString::number(b) + "\" opacity=\"1\" colorSpace=\"0\" />\n"; m_text += "</STROKE>\n"; } else m_text += "<STROKE lineWidth=\"1\" />\n"; - m_text += "<FILL fillRule=\"" + QString::number(dc.m_winding) + "\">\n"; + m_text += "<FILL fillRule=\"" + TQString::number(dc.m_winding) + "\">\n"; double r, g, b; toRGB(dc.m_brushColour, r, g, b); - m_text += "<COLOR v1=\"" + QString::number(r) + "\" v2=\"" + QString::number(g) + "\" v3=\"" + QString::number(b) + "\" opacity=\"1\" colorSpace=\"0\" />\n"; + m_text += "<COLOR v1=\"" + TQString::number(r) + "\" v2=\"" + TQString::number(g) + "\" v3=\"" + TQString::number(b) + "\" opacity=\"1\" colorSpace=\"0\" />\n"; m_text += "</FILL>\n"; m_text += "<PATH isClosed=\"1\" >\n"; @@ -241,12 +241,12 @@ void MSODImport::gotPolygon( void MSODImport::gotPolyline( const DrawContext &dc, - const QPointArray &points) + const TQPointArray &points) { kdDebug(s_area) << "MSODImport::gotPolyline" << endl; return; // ### TODO m_text += "<COMPOSITE>\n"; - m_text += "<STROKE lineWidth=\"" + QString::number(dc.m_penWidth) + "\">\n"; + m_text += "<STROKE lineWidth=\"" + TQString::number(dc.m_penWidth) + "\">\n"; m_text += "</STROKE>\n"; m_text += "<PATH isClosed=\"1\" >\n"; pointArray(points); @@ -256,24 +256,24 @@ void MSODImport::gotPolyline( void MSODImport::gotRectangle( const DrawContext &dc, - const QPointArray &points) + const TQPointArray &points) { // ### TODO #if 0 - QRect bounds = points.boundingRect(); + TQRect bounds = points.boundingRect(); - m_text += "<rectangle width=\"" + QString::number(bounds.width()) + - "\" x=\"" + QString::number(bounds.x()) + - "\" y=\"" + QString::number(bounds.y()) + - "\" height=\"" + QString::number(bounds.height()) + + m_text += "<rectangle width=\"" + TQString::number(bounds.width()) + + "\" x=\"" + TQString::number(bounds.x()) + + "\" y=\"" + TQString::number(bounds.y()) + + "\" height=\"" + TQString::number(bounds.height()) + "\" rounding=\"0\">\n"; m_text += "<polyline arrow1=\"0\" arrow2=\"0\">\n"; pointArray(points); - m_text += " <gobject fillcolor=\"#" + QString::number(dc.m_brushColour, 16) + - "\" fillstyle=\"" + QString::number(1 /*m_winding*/) + - "\" linewidth=\"" + QString::number(dc.m_penWidth) + - "\" strokecolor=\"#" + QString::number(dc.m_penColour, 16) + - "\" strokestyle=\"" + QString::number(dc.m_penStyle) + + m_text += " <gobject fillcolor=\"#" + TQString::number(dc.m_brushColour, 16) + + "\" fillstyle=\"" + TQString::number(1 /*m_winding*/) + + "\" linewidth=\"" + TQString::number(dc.m_penWidth) + + "\" strokecolor=\"#" + TQString::number(dc.m_penColour, 16) + + "\" strokestyle=\"" + TQString::number(dc.m_penStyle) + "\">\n"; m_text += " <matrix dx=\"0\" dy=\"0\" m21=\"0\" m22=\"1\" m11=\"1\" m12=\"0\"/>\n"; m_text += " </gobject>\n"; @@ -282,29 +282,29 @@ void MSODImport::gotRectangle( #endif } -void MSODImport::savePartContents( QIODevice* file ) +void MSODImport::savePartContents( TQIODevice* file ) { if ( m_embeddeeData != 0 && m_embeddeeLength != 0 ) file->writeBlock( m_embeddeeData, m_embeddeeLength ); } void MSODImport::pointArray( - const QPointArray &points) + const TQPointArray &points) { - m_text += "<MOVE x=\"" + QString::number(points.point(0).x()) + - "\" y=\"" + QString::number(points.point(0).y()) + + m_text += "<MOVE x=\"" + TQString::number(points.point(0).x()) + + "\" y=\"" + TQString::number(points.point(0).y()) + "\" />\n"; - kdDebug(s_area) << "\n<MOVE x=\"" + QString::number(points.point(0).x()) + - "\" y=\"" + QString::number(points.point(0).y()) + + kdDebug(s_area) << "\n<MOVE x=\"" + TQString::number(points.point(0).x()) + + "\" y=\"" + TQString::number(points.point(0).y()) + "\" />" << endl; for (unsigned int i = 1; i < points.count(); i++) { - m_text += "<LINE x=\"" + QString::number(points.point(i).x()) + - "\" y=\"" + QString::number(points.point(i).y()) + + m_text += "<LINE x=\"" + TQString::number(points.point(i).x()) + + "\" y=\"" + TQString::number(points.point(i).y()) + "\" />\n"; - kdDebug(s_area) << "<LINE x=\"" + QString::number(points.point(i).x()) + - "\" y=\"" + QString::number(points.point(i).y()) + + kdDebug(s_area) << "<LINE x=\"" + TQString::number(points.point(i).x()) + + "\" y=\"" + TQString::number(points.point(i).y()) + "\" />" << endl; } diff --git a/filters/karbon/msod/msodimport.h b/filters/karbon/msod/msodimport.h index cb6aec16..ec036bdf 100644 --- a/filters/karbon/msod/msodimport.h +++ b/filters/karbon/msod/msodimport.h @@ -30,54 +30,55 @@ class MSODImport : public KoEmbeddingFilter, protected Msod { Q_OBJECT + TQ_OBJECT public: MSODImport( - KoFilter *parent, + KoFilter *tqparent, const char *name, - const QStringList&); + const TQStringList&); virtual ~MSODImport(); - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); protected: virtual void gotEllipse( const DrawContext &dc, - QString type, - QPoint topLeft, - QSize halfAxes, + TQString type, + TQPoint topLeft, + TQSize halfAxes, unsigned startAngle, unsigned stopAngle); virtual void gotPicture( unsigned id, - QString extension, + TQString extension, unsigned length, const char *data); virtual void gotPolygon( const DrawContext &dc, - const QPointArray &points); + const TQPointArray &points); virtual void gotPolyline( const DrawContext &dc, - const QPointArray &points); + const TQPointArray &points); virtual void gotRectangle( const DrawContext &dc, - const QPointArray &points); + const TQPointArray &points); signals: - // Communication signals to the parent filters + // Communication signals to the tqparent filters void commSignalDelayStream( const char* delay ); - void commSignalShapeID( unsigned int& shapeID ); + void commSignalShapeID( unsigned int& tqshapeID ); private: - virtual void savePartContents( QIODevice* file ); + virtual void savePartContents( TQIODevice* file ); // Debug support. static const int s_area; void pointArray( - const QPointArray &points); - QString m_text; + const TQPointArray &points); + TQString m_text; // Embedded objects. const char* m_embeddeeData; diff --git a/filters/karbon/oodraw/oodrawimport.cc b/filters/karbon/oodraw/oodrawimport.cc index f52ed5b8..a31d80a4 100644 --- a/filters/karbon/oodraw/oodrawimport.cc +++ b/filters/karbon/oodraw/oodrawimport.cc @@ -21,9 +21,9 @@ #include <math.h> -#include <qdatetime.h> -#include <qfileinfo.h> -#include <qdir.h> +#include <tqdatetime.h> +#include <tqfileinfo.h> +#include <tqdir.h> #include <kzip.h> #include <karchive.h> @@ -50,7 +50,7 @@ typedef KGenericFactory<OoDrawImport, KoFilter> OoDrawImportFactory; K_EXPORT_COMPONENT_FACTORY( liboodrawimport, OoDrawImportFactory( "kofficefilters" ) ) -OoDrawImport::OoDrawImport( KoFilter *, const char *, const QStringList & ) +OoDrawImport::OoDrawImport( KoFilter *, const char *, const TQStringList & ) : KoFilter(), m_styles( 23, true ), m_styleStack( ooNS::style, ooNS::fo ) @@ -62,7 +62,7 @@ OoDrawImport::~OoDrawImport() { } -KoFilter::ConversionStatus OoDrawImport::convert( QCString const & from, QCString const & to ) +KoFilter::ConversiontqStatus OoDrawImport::convert( TQCString const & from, TQCString const & to ) { kdDebug() << "Entering Oodraw Import filter: " << from << " - " << to << endl; @@ -81,42 +81,42 @@ KoFilter::ConversionStatus OoDrawImport::convert( QCString const & from, QCStrin return KoFilter::FileNotFound; } - KoFilter::ConversionStatus preStatus = openFile(); + KoFilter::ConversiontqStatus pretqStatus = openFile(); - if( preStatus != KoFilter::OK ) + if( pretqStatus != KoFilter::OK ) { m_zip->close(); delete m_zip; - return preStatus; + return pretqStatus; } -/*QDomDocument docinfo; +/*TQDomDocument docinfo; createDocumentInfo( docinfo ); // store document info KoStoreDevice* out = m_chain->storageFile( "documentinfo.xml", KoStore::Write ); if( out ) { -QCString info = docinfo.toCString(); +TQCString info = docinfo.toCString(); //kdDebug() << " info :" << info << endl; -// WARNING: we cannot use KoStore::write(const QByteArray&) because it gives an extra NULL character at the end. +// WARNING: we cannot use KoStore::write(const TQByteArray&) because it gives an extra NULL character at the end. out->writeBlock( info , info.length() ); }*/ - QDomDocument docinfo; + TQDomDocument docinfo; createDocumentInfo( docinfo ); // store document info KoStoreDevice* out = m_chain->storageFile( "documentinfo.xml", KoStore::Write ); if( out ) { - QCString info = docinfo.toCString(); + TQCString info = docinfo.toCString(); //kdDebug(30518) << " info :" << info << endl; - // WARNING: we cannot use KoStore::write(const QByteArray&) because it gives an extra NULL character at the end. + // WARNING: we cannot use KoStore::write(const TQByteArray&) because it gives an extra NULL character at the end. out->writeBlock( info , info.length() ); } convert(); - QDomDocument outdoc = m_document.saveXML(); + TQDomDocument outdoc = m_document.saveXML(); // add paper info, we always need custom for svg (Rob) - QDomElement paper = outdoc.createElement( "PAPER" ); + TQDomElement paper = outdoc.createElement( "PAPER" ); outdoc.documentElement().appendChild( paper ); paper.setAttribute( "format", PG_CUSTOM ); paper.setAttribute( "width", m_document.width() ); @@ -126,7 +126,7 @@ out->writeBlock( info , info.length() ); out = m_chain->storageFile( "maindoc.xml", KoStore::Write ); if( out ) { - QCString content = outdoc.toCString(); + TQCString content = outdoc.toCString(); kdDebug() << " content :" << content << endl; out->writeBlock( content , content.length() ); } @@ -139,7 +139,7 @@ out->writeBlock( info , info.length() ); } // Very related to OoWriterImport::createDocumentInfo -void OoDrawImport::createDocumentInfo( QDomDocument &docinfo ) +void OoDrawImport::createDocumentInfo( TQDomDocument &docinfo ) { docinfo = KoDocument::createDomDocument( "document-info" /*DTD name*/, "document-info" /*tag name*/, "1.1" ); @@ -149,9 +149,9 @@ void OoDrawImport::createDocumentInfo( QDomDocument &docinfo ) // Very related to OoWriterImport::openFile() -KoFilter::ConversionStatus OoDrawImport::openFile() +KoFilter::ConversiontqStatus OoDrawImport::openFile() { - KoFilter::ConversionStatus status = loadAndParse( "content.xml", m_content ); + KoFilter::ConversiontqStatus status = loadAndParse( "content.xml", m_content ); if ( status != KoFilter::OK ) { kdError(30518) << "Content.xml could not be parsed correctly! Aborting!" << endl; @@ -159,7 +159,7 @@ KoFilter::ConversionStatus OoDrawImport::openFile() } // We do not stop if the following calls fail. - QDomDocument styles; + TQDomDocument styles; loadAndParse( "styles.xml", styles ); loadAndParse( "meta.xml", m_meta ); loadAndParse( "settings.xml", m_settings ); @@ -174,25 +174,25 @@ void OoDrawImport::convert() { m_document.saveAsPath( false ); - QDomElement content = m_content.documentElement(); + TQDomElement content = m_content.documentElement(); // content.xml contains some automatic-styles that we need to store - QDomNode automaticStyles = KoDom::namedItemNS( content, ooNS::office, "automatic-styles" ); + TQDomNode automaticStyles = KoDom::namedItemNS( content, ooNS::office, "automatic-styles" ); if( !automaticStyles.isNull() ) insertStyles( automaticStyles.toElement() ); - QDomNode body = KoDom::namedItemNS( content, ooNS::office, "body" ); + TQDomNode body = KoDom::namedItemNS( content, ooNS::office, "body" ); if( body.isNull() ) return; // we take the settings of the first slide for the whole document. - QDomElement drawPage = KoDom::namedItemNS( body, ooNS::draw, "page" ); + TQDomElement drawPage = KoDom::namedItemNS( body, ooNS::draw, "page" ); if( drawPage.isNull() ) // no pages? give up. return; - QDomElement *master = m_styles[drawPage.attributeNS( ooNS::draw, "master-page-name", QString::null )]; - QDomElement *style = m_styles[master->attributeNS( ooNS::style, "page-master-name", QString::null )]; - QDomElement properties = KoDom::namedItemNS( *style, ooNS::style, "properties" ).toElement(); + TQDomElement *master = m_styles[drawPage.attributeNS( ooNS::draw, "master-page-name", TQString() )]; + TQDomElement *style = m_styles[master->attributeNS( ooNS::style, "page-master-name", TQString() )]; + TQDomElement properties = KoDom::namedItemNS( *style, ooNS::style, "properties" ).toElement(); if( properties.isNull() ) { @@ -201,20 +201,20 @@ void OoDrawImport::convert() } else { - m_document.setWidth( KoUnit::parseValue(properties.attributeNS( ooNS::fo, "page-width", QString::null ) ) ); - m_document.setHeight( KoUnit::parseValue(properties.attributeNS( ooNS::fo, "page-height", QString::null ) ) ); + m_document.setWidth( KoUnit::parseValue(properties.attributeNS( ooNS::fo, "page-width", TQString() ) ) ); + m_document.setHeight( KoUnit::parseValue(properties.attributeNS( ooNS::fo, "page-height", TQString() ) ) ); } // parse all pages - for( QDomNode drawPage = body.firstChild(); !drawPage.isNull(); drawPage = drawPage.nextSibling() ) + for( TQDomNode drawPage = body.firstChild(); !drawPage.isNull(); drawPage = drawPage.nextSibling() ) { - QDomElement dp = drawPage.toElement(); + TQDomElement dp = drawPage.toElement(); m_styleStack.clear(); // remove all styles fillStyleStack( dp ); //m_styleStack.setPageMark(); // set the pagetitle - //QDomElement titleElement = doc.createElement( "Title" ); + //TQDomElement titleElement = doc.createElement( "Title" ); //titleElement.setAttribute( "title", dp.attributeNS( "name" ) ); //pageTitleElement.appendChild( titleElement ); @@ -223,27 +223,27 @@ void OoDrawImport::convert() } -KoFilter::ConversionStatus OoDrawImport::loadAndParse(const QString& filename, QDomDocument& doc) +KoFilter::ConversiontqStatus OoDrawImport::loadAndParse(const TQString& filename, TQDomDocument& doc) { return OoUtils::loadAndParse( filename, doc, m_zip); } void -OoDrawImport::parseGroup( VGroup *parent, const QDomElement& parentobject ) +OoDrawImport::parseGroup( VGroup *tqparent, const TQDomElement& tqparentobject ) { // parse all objects - for( QDomNode object = parentobject.firstChild(); !object.isNull(); object = object.nextSibling() ) + for( TQDomNode object = tqparentobject.firstChild(); !object.isNull(); object = object.nextSibling() ) { - QDomElement o = object.toElement(); + TQDomElement o = object.toElement(); if( o.namespaceURI() != ooNS::draw ) continue; - QString name = o.localName(); - QString drawID = o.attributeNS( ooNS::draw, "id", QString::null ); + TQString name = o.localName(); + TQString drawID = o.attributeNS( ooNS::draw, "id", TQString() ); VObject *obj = 0L; if( name == "g" ) // polyline { storeObjectStyles( o ); - VGroup *group = new VGroup( parent ); + VGroup *group = new VGroup( tqparent ); appendPen( *group ); appendBrush( *group ); obj = group; @@ -252,12 +252,12 @@ OoDrawImport::parseGroup( VGroup *parent, const QDomElement& parentobject ) else if( name == "rect" ) // rectangle { storeObjectStyles( o ); - double x = KoUnit::parseValue( o.attributeNS( ooNS::svg, "x", QString::null ) ); - double y = ymirror( KoUnit::parseValue( o.attributeNS( ooNS::svg, "y", QString::null ) ) ); - double w = KoUnit::parseValue( o.attributeNS( ooNS::svg, "width", QString::null ) ); - double h = KoUnit::parseValue( o.attributeNS( ooNS::svg, "height", QString::null ) ); - int corner = static_cast<int>( KoUnit::parseValue( o.attributeNS( ooNS::draw, "corner-radius", QString::null ) ) ); - VRectangle *rect = new VRectangle( parent, KoPoint( x, y ), w, h, corner ); + double x = KoUnit::parseValue( o.attributeNS( ooNS::svg, "x", TQString() ) ); + double y = ymirror( KoUnit::parseValue( o.attributeNS( ooNS::svg, "y", TQString() ) ) ); + double w = KoUnit::parseValue( o.attributeNS( ooNS::svg, "width", TQString() ) ); + double h = KoUnit::parseValue( o.attributeNS( ooNS::svg, "height", TQString() ) ); + int corner = static_cast<int>( KoUnit::parseValue( o.attributeNS( ooNS::draw, "corner-radius", TQString() ) ) ); + VRectangle *rect = new VRectangle( tqparent, KoPoint( x, y ), w, h, corner ); appendPen( *rect ); appendBrush( *rect ); obj = rect; @@ -265,13 +265,13 @@ OoDrawImport::parseGroup( VGroup *parent, const QDomElement& parentobject ) else if( name == "circle" || name == "ellipse" ) { storeObjectStyles( o ); - double w = KoUnit::parseValue( o.attributeNS( ooNS::svg, "width", QString::null ) ); - double h = KoUnit::parseValue( o.attributeNS( ooNS::svg, "height", QString::null ) ); - double x = KoUnit::parseValue( o.attributeNS( ooNS::svg, "x", QString::null ) ); - double y = ymirror( KoUnit::parseValue( o.attributeNS( ooNS::svg, "y", QString::null ) ) ) - h; - double start = o.attributeNS( ooNS::draw, "start-angle", QString::null ).toDouble(); - double end = o.attributeNS( ooNS::draw, "end-angle", QString::null ).toDouble(); - QString kind = o.attributeNS( ooNS::draw, "kind", QString::null ); + double w = KoUnit::parseValue( o.attributeNS( ooNS::svg, "width", TQString() ) ); + double h = KoUnit::parseValue( o.attributeNS( ooNS::svg, "height", TQString() ) ); + double x = KoUnit::parseValue( o.attributeNS( ooNS::svg, "x", TQString() ) ); + double y = ymirror( KoUnit::parseValue( o.attributeNS( ooNS::svg, "y", TQString() ) ) ) - h; + double start = o.attributeNS( ooNS::draw, "start-angle", TQString() ).toDouble(); + double end = o.attributeNS( ooNS::draw, "end-angle", TQString() ).toDouble(); + TQString kind = o.attributeNS( ooNS::draw, "kind", TQString() ); VEllipse::VEllipseType type = VEllipse::full; if( !kind.isEmpty() ) { @@ -282,7 +282,7 @@ OoDrawImport::parseGroup( VGroup *parent, const QDomElement& parentobject ) else if( kind == "arc" ) type = VEllipse::arc; } - VEllipse *ellipse = new VEllipse( parent, KoPoint( x, y ), w, h, type, start, end ); + VEllipse *ellipse = new VEllipse( tqparent, KoPoint( x, y ), w, h, type, start, end ); appendPen( *ellipse ); // arc has no brush if( kind != "arc" ) @@ -292,11 +292,11 @@ OoDrawImport::parseGroup( VGroup *parent, const QDomElement& parentobject ) else if( name == "line" ) // line { storeObjectStyles( o ); - VPath *line = new VPath( parent ); - double x1 = KoUnit::parseValue( o.attributeNS( ooNS::svg, "x1", QString::null ) ); - double y1 = ymirror( KoUnit::parseValue( o.attributeNS( ooNS::svg, "y1", QString::null ) ) ); - double x2 = KoUnit::parseValue( o.attributeNS( ooNS::svg, "x2", QString::null ) ); - double y2 = ymirror( KoUnit::parseValue( o.attributeNS( ooNS::svg, "y2", QString::null ) ) ); + VPath *line = new VPath( tqparent ); + double x1 = KoUnit::parseValue( o.attributeNS( ooNS::svg, "x1", TQString() ) ); + double y1 = ymirror( KoUnit::parseValue( o.attributeNS( ooNS::svg, "y1", TQString() ) ) ); + double x2 = KoUnit::parseValue( o.attributeNS( ooNS::svg, "x2", TQString() ) ); + double y2 = ymirror( KoUnit::parseValue( o.attributeNS( ooNS::svg, "y2", TQString() ) ) ); line->moveTo( KoPoint( x1, y1 ) ); line->lineTo( KoPoint( x2, y2 ) ); appendPen( *line ); @@ -306,7 +306,7 @@ OoDrawImport::parseGroup( VGroup *parent, const QDomElement& parentobject ) else if( name == "polyline" ) // polyline { storeObjectStyles( o ); - VPath *polyline = new VPath( parent ); + VPath *polyline = new VPath( tqparent ); appendPoints( *polyline, o); appendPen( *polyline ); appendBrush( *polyline ); @@ -315,9 +315,9 @@ OoDrawImport::parseGroup( VGroup *parent, const QDomElement& parentobject ) else if( name == "polygon" ) // polygon { storeObjectStyles( o ); - //VPolygon *polygon = new VPolygon( parent ); + //VPolygon *polygon = new VPolygon( tqparent ); //polygon->load( o ); - VPath *polygon = new VPath( parent ); + VPath *polygon = new VPath( tqparent ); appendPoints( *polygon, o ); appendPen( *polygon ); appendBrush( *polygon ); @@ -326,14 +326,14 @@ OoDrawImport::parseGroup( VGroup *parent, const QDomElement& parentobject ) else if( name == "path" ) // path { storeObjectStyles( o ); - VPath *path = new VPath( parent ); - path->loadSvgPath( o.attributeNS( ooNS::svg, "d", QString::null ) ); + VPath *path = new VPath( tqparent ); + path->loadSvgPath( o.attributeNS( ooNS::svg, "d", TQString() ) ); KoRect rect = parseViewBox( o ); - double x = KoUnit::parseValue( o.attributeNS( ooNS::svg, "x", QString::null ) ); - double y = ymirror( KoUnit::parseValue( o.attributeNS( ooNS::svg, "y", QString::null ) ) ); - double w = KoUnit::parseValue( o.attributeNS( ooNS::svg, "width", QString::null ) ); - double h = KoUnit::parseValue( o.attributeNS( ooNS::svg, "height", QString::null ) ); - QWMatrix mat; + double x = KoUnit::parseValue( o.attributeNS( ooNS::svg, "x", TQString() ) ); + double y = ymirror( KoUnit::parseValue( o.attributeNS( ooNS::svg, "y", TQString() ) ) ); + double w = KoUnit::parseValue( o.attributeNS( ooNS::svg, "width", TQString() ) ); + double h = KoUnit::parseValue( o.attributeNS( ooNS::svg, "height", TQString() ) ); + TQWMatrix mat; mat.translate( x, y ); mat.scale( w / rect.width(), -h / rect.height() ); path->transform( mat ); @@ -353,8 +353,8 @@ appendImage( doc, e, pictureElement, o ); kdDebug() << "Unsupported object '" << name << "'" << endl; continue; } - if( parent && obj ) - parent->append( obj ); + if( tqparent && obj ) + tqparent->append( obj ); else if( obj ) m_document.append( obj ); } @@ -373,9 +373,9 @@ OoDrawImport::appendPen( VObject &obj ) stroke.setType( VStroke::solid ); else if( m_styleStack.attributeNS( ooNS::draw, "stroke" ) == "dash" ) { - QValueList<float> dashes; + TQValueList<float> dashes; stroke.setType( VStroke::solid ); - QString style = m_styleStack.attributeNS( ooNS::draw, "stroke-dash" ); + TQString style = m_styleStack.attributeNS( ooNS::draw, "stroke-dash" ); if( style == "Ultrafine Dashed" || style == "Fine Dashed (var)" || style == "Dashed (var)" ) stroke.dashPattern().setArray( dashes << 2 << 2 ); @@ -412,7 +412,7 @@ OoDrawImport::appendBrush( VObject &obj ) { if( m_styleStack.hasAttributeNS( ooNS::draw, "fill" ) ) { - const QString fill = m_styleStack.attributeNS( ooNS::draw, "fill" ); + const TQString fill = m_styleStack.attributeNS( ooNS::draw, "fill" ); VFill f; if( fill == "solid" ) @@ -430,25 +430,25 @@ OoDrawImport::appendBrush( VObject &obj ) VGradient gradient; gradient.clearStops(); gradient.setRepeatMethod( VGradient::none ); - QString style = m_styleStack.attributeNS( ooNS::draw, "fill-gradient-name" ); + TQString style = m_styleStack.attributeNS( ooNS::draw, "fill-gradient-name" ); - QDomElement* draw = m_draws[style]; + TQDomElement* draw = m_draws[style]; if( draw ) { double border = 0.0; if( draw->hasAttributeNS( ooNS::draw, "border" ) ) - border += draw->attributeNS( ooNS::draw, "border", QString::null ).remove( '%' ).toDouble() / 100.0; + border += draw->attributeNS( ooNS::draw, "border", TQString() ).remove( '%' ).toDouble() / 100.0; VColor c; - parseColor( c, draw->attributeNS( ooNS::draw, "start-color", QString::null ) ); + parseColor( c, draw->attributeNS( ooNS::draw, "start-color", TQString() ) ); gradient.addStop( c, border, 0.5 ); - parseColor( c, draw->attributeNS( ooNS::draw, "end-color", QString::null ) ); + parseColor( c, draw->attributeNS( ooNS::draw, "end-color", TQString() ) ); gradient.addStop( c, 1.0, 0.5 ); - QString type = draw->attributeNS( ooNS::draw, "style", QString::null ); + TQString type = draw->attributeNS( ooNS::draw, "style", TQString() ); if( type == "linear" || type == "axial" ) { gradient.setType( VGradient::linear ); - int angle = draw->attributeNS( ooNS::draw, "angle", QString::null ).toInt() / 10; + int angle = draw->attributeNS( ooNS::draw, "angle", TQString() ).toInt() / 10; // make sure the angle is between 0 and 359 angle = abs( angle ); @@ -515,12 +515,12 @@ OoDrawImport::appendBrush( VObject &obj ) // and (un-)balanced settings of kpresenter. Let's try it. double x, y; if( draw->hasAttributeNS( ooNS::draw, "cx" ) ) - x = draw->attributeNS( ooNS::draw, "cx", QString::null ).remove( '%' ).toDouble() / 100.0; + x = draw->attributeNS( ooNS::draw, "cx", TQString() ).remove( '%' ).toDouble() / 100.0; else x = 0.5; if( draw->hasAttributeNS( ooNS::draw, "cy" ) ) - y = draw->attributeNS( ooNS::draw, "cy", QString::null ).remove( '%' ).toDouble() / 100.0; + y = draw->attributeNS( ooNS::draw, "cy", TQString() ).remove( '%' ).toDouble() / 100.0; else y = 0.5; @@ -540,8 +540,8 @@ OoDrawImport::appendBrush( VObject &obj ) } /*else if( fill == "hatch" ) { -QDomElement brush = doc.createElement( "BRUSH" ); -QString style = m_styleStack.attributeNS( "fill-hatch-name" ); +TQDomElement brush = doc.createElement( "BRUSH" ); +TQString style = m_styleStack.attributeNS( "fill-hatch-name" ); if( style == "Black 0 Degrees" ) brush.setAttribute( "style", 9 ); else if( style == "Black 90 Degrees" ) @@ -555,7 +555,7 @@ brush.setAttribute( "style", 13 ); else if( style == "Red Crossed 45 Degrees" || style == "Blue Crossed 45 Degrees" ) brush.setAttribute( "style", 14 ); -QDomElement* draw = m_draws[style]; +TQDomElement* draw = m_draws[style]; if( draw && draw->hasAttributeNS( "color" ) ) brush.setAttribute( "color", draw->attributeNS( "color" ) ); e.appendChild( brush ); @@ -563,88 +563,88 @@ e.appendChild( brush ); } void -OoDrawImport::createStyleMap( QDomDocument &docstyles ) +OoDrawImport::createStyleMap( TQDomDocument &docstyles ) { - QDomElement styles = docstyles.documentElement(); + TQDomElement styles = docstyles.documentElement(); if( styles.isNull() ) return; - QDomNode fixedStyles = KoDom::namedItemNS( styles, ooNS::office, "styles" ); + TQDomNode fixedStyles = KoDom::namedItemNS( styles, ooNS::office, "styles" ); if( !fixedStyles.isNull() ) { insertDraws( fixedStyles.toElement() ); insertStyles( fixedStyles.toElement() ); } - QDomNode automaticStyles = KoDom::namedItemNS( styles, ooNS::office, "automatic-styles" ); + TQDomNode automaticStyles = KoDom::namedItemNS( styles, ooNS::office, "automatic-styles" ); if( !automaticStyles.isNull() ) insertStyles( automaticStyles.toElement() ); - QDomNode masterStyles = KoDom::namedItemNS( styles, ooNS::office, "master-styles" ); + TQDomNode masterStyles = KoDom::namedItemNS( styles, ooNS::office, "master-styles" ); if( !masterStyles.isNull() ) insertStyles( masterStyles.toElement() ); } void -OoDrawImport::insertDraws( const QDomElement& styles ) +OoDrawImport::insertDraws( const TQDomElement& styles ) { - for( QDomNode n = styles.firstChild(); !n.isNull(); n = n.nextSibling() ) + for( TQDomNode n = styles.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if( !e.hasAttributeNS( ooNS::draw, "name" ) ) continue; - QString name = e.attributeNS( ooNS::draw, "name", QString::null ); - m_draws.insert( name, new QDomElement( e ) ); + TQString name = e.attributeNS( ooNS::draw, "name", TQString() ); + m_draws.insert( name, new TQDomElement( e ) ); } } void -OoDrawImport::insertStyles( const QDomElement& styles ) +OoDrawImport::insertStyles( const TQDomElement& styles ) { - for ( QDomNode n = styles.firstChild(); !n.isNull(); n = n.nextSibling() ) + for ( TQDomNode n = styles.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if( !e.hasAttributeNS( ooNS::style, "name" ) ) continue; - QString name = e.attributeNS( ooNS::style, "name", QString::null ); - m_styles.insert( name, new QDomElement( e ) ); + TQString name = e.attributeNS( ooNS::style, "name", TQString() ); + m_styles.insert( name, new TQDomElement( e ) ); //kdDebug() << "Style: '" << name << "' loaded " << endl; } } void -OoDrawImport::fillStyleStack( const QDomElement& object ) +OoDrawImport::fillStyleStack( const TQDomElement& object ) { // find all styles associated with an object and push them on the stack if( object.hasAttributeNS( ooNS::presentation, "style-name" ) ) - addStyles( m_styles[object.attributeNS( ooNS::presentation, "style-name", QString::null )] ); + addStyles( m_styles[object.attributeNS( ooNS::presentation, "style-name", TQString() )] ); if( object.hasAttributeNS( ooNS::draw, "style-name" ) ) - addStyles( m_styles[object.attributeNS( ooNS::draw, "style-name", QString::null )] ); + addStyles( m_styles[object.attributeNS( ooNS::draw, "style-name", TQString() )] ); if( object.hasAttributeNS( ooNS::draw, "text-style-name" ) ) - addStyles( m_styles[object.attributeNS( ooNS::draw, "text-style-name", QString::null )] ); + addStyles( m_styles[object.attributeNS( ooNS::draw, "text-style-name", TQString() )] ); if( object.hasAttributeNS( ooNS::text, "style-name" ) ) - addStyles( m_styles[object.attributeNS( ooNS::text, "style-name", QString::null )] ); + addStyles( m_styles[object.attributeNS( ooNS::text, "style-name", TQString() )] ); } void -OoDrawImport::addStyles( const QDomElement* style ) +OoDrawImport::addStyles( const TQDomElement* style ) { - // this function is necessary as parent styles can have parents themself - if( style->hasAttributeNS( ooNS::style, "parent-style-name" ) ) - addStyles( m_styles[style->attributeNS( ooNS::style, "parent-style-name", QString::null )] ); + // this function is necessary as tqparent styles can have tqparents themself + if( style->hasAttributeNS( ooNS::style, "tqparent-style-name" ) ) + addStyles( m_styles[style->attributeNS( ooNS::style, "tqparent-style-name", TQString() )] ); m_styleStack.push( *style ); } void -OoDrawImport::storeObjectStyles( const QDomElement& object ) +OoDrawImport::storeObjectStyles( const TQDomElement& object ) { //m_styleStack.clearPageMark(); // remove styles of previous object fillStyleStack( object ); @@ -652,14 +652,14 @@ OoDrawImport::storeObjectStyles( const QDomElement& object ) } KoRect -OoDrawImport::parseViewBox( const QDomElement& object ) +OoDrawImport::parseViewBox( const TQDomElement& object ) { KoRect rect; - if( !object.attributeNS( ooNS::svg, "viewBox", QString::null ).isEmpty() ) + if( !object.attributeNS( ooNS::svg, "viewBox", TQString() ).isEmpty() ) { // allow for viewbox def with ',' or whitespace - QString viewbox( object.attributeNS( ooNS::svg, "viewBox", QString::null ) ); - QStringList points = QStringList::split( ' ', viewbox.replace( ',', ' ').simplifyWhiteSpace() ); + TQString viewbox( object.attributeNS( ooNS::svg, "viewBox", TQString() ) ); + TQStringList points = TQStringList::split( ' ', viewbox.tqreplace( ',', ' ').simplifyWhiteSpace() ); rect.setX( points[0].toFloat() ); rect.setY( points[1].toFloat() ); @@ -670,24 +670,24 @@ OoDrawImport::parseViewBox( const QDomElement& object ) } void -OoDrawImport::appendPoints(VPath &path, const QDomElement& object) +OoDrawImport::appendPoints(VPath &path, const TQDomElement& object) { - double x = KoUnit::parseValue( object.attributeNS( ooNS::svg, "x", QString::null ) ); - double y = KoUnit::parseValue( object.attributeNS( ooNS::svg, "y", QString::null ) ); - double w = KoUnit::parseValue( object.attributeNS( ooNS::svg, "width", QString::null ) ); - double h = KoUnit::parseValue( object.attributeNS( ooNS::svg, "height", QString::null ) ); + double x = KoUnit::parseValue( object.attributeNS( ooNS::svg, "x", TQString() ) ); + double y = KoUnit::parseValue( object.attributeNS( ooNS::svg, "y", TQString() ) ); + double w = KoUnit::parseValue( object.attributeNS( ooNS::svg, "width", TQString() ) ); + double h = KoUnit::parseValue( object.attributeNS( ooNS::svg, "height", TQString() ) ); KoRect rect = parseViewBox( object ); rect.setX( rect.x() + x ); rect.setY( rect.y() + y ); - QStringList ptList = QStringList::split( ' ', object.attributeNS( ooNS::draw, "points", QString::null ) ); + TQStringList ptList = TQStringList::split( ' ', object.attributeNS( ooNS::draw, "points", TQString() ) ); - QString pt_x, pt_y; + TQString pt_x, pt_y; double tmp_x, tmp_y; KoPoint point; bool bFirst = true; - for( QStringList::Iterator it = ptList.begin(); it != ptList.end(); ++it ) + for( TQStringList::Iterator it = ptList.begin(); it != ptList.end(); ++it ) { tmp_x = rect.x() + ( (*it).section( ',', 0, 0 ).toInt() * w ) / rect.width(); tmp_y = rect.y() + ( (*it).section( ',', 1, 1 ).toInt() * h ) / rect.height(); @@ -705,41 +705,41 @@ OoDrawImport::appendPoints(VPath &path, const QDomElement& object) } void -OoDrawImport::parseColor( VColor &color, const QString &s ) +OoDrawImport::parseColor( VColor &color, const TQString &s ) { if( s.startsWith( "rgb(" ) ) { - QString parse = s.stripWhiteSpace(); - QStringList colors = QStringList::split( ',', parse ); - QString r = colors[0].right( ( colors[0].length() - 4 ) ); - QString g = colors[1]; - QString b = colors[2].left( ( colors[2].length() - 1 ) ); + TQString parse = s.stripWhiteSpace(); + TQStringList colors = TQStringList::split( ',', parse ); + TQString r = colors[0].right( ( colors[0].length() - 4 ) ); + TQString g = colors[1]; + TQString b = colors[2].left( ( colors[2].length() - 1 ) ); - if( r.contains( "%" ) ) + if( r.tqcontains( "%" ) ) { r = r.left( r.length() - 1 ); - r = QString::number( int( ( double( 255 * r.toDouble() ) / 100.0 ) ) ); + r = TQString::number( int( ( double( 255 * r.toDouble() ) / 100.0 ) ) ); } - if( g.contains( "%" ) ) + if( g.tqcontains( "%" ) ) { g = g.left( g.length() - 1 ); - g = QString::number( int( ( double( 255 * g.toDouble() ) / 100.0 ) ) ); + g = TQString::number( int( ( double( 255 * g.toDouble() ) / 100.0 ) ) ); } - if( b.contains( "%" ) ) + if( b.tqcontains( "%" ) ) { b = b.left( b.length() - 1 ); - b = QString::number( int( ( double( 255 * b.toDouble() ) / 100.0 ) ) ); + b = TQString::number( int( ( double( 255 * b.toDouble() ) / 100.0 ) ) ); } - QColor c( r.toInt(), g.toInt(), b.toInt() ); + TQColor c( r.toInt(), g.toInt(), b.toInt() ); color.set( c.red() / 255.0, c.green() / 255.0, c.blue() / 255.0 ); } else { - QString rgbColor = s.stripWhiteSpace(); - QColor c; + TQString rgbColor = s.stripWhiteSpace(); + TQColor c; if( rgbColor.startsWith( "#" ) ) c.setNamedColor( rgbColor ); //else diff --git a/filters/karbon/oodraw/oodrawimport.h b/filters/karbon/oodraw/oodrawimport.h index 06e664ac..ea29b276 100644 --- a/filters/karbon/oodraw/oodrawimport.h +++ b/filters/karbon/oodraw/oodrawimport.h @@ -23,9 +23,9 @@ #include <KoFilter.h> #include <KoStore.h> -#include <qdom.h> -#include <qdict.h> -#include <qcolor.h> +#include <tqdom.h> +#include <tqdict.h> +#include <tqcolor.h> #include <KoStyleStack.h> #include <core/vdocument.h> #include <core/vcomposite.h> @@ -38,38 +38,39 @@ class VGroup; class OoDrawImport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - OoDrawImport( KoFilter *parent, const char *name, const QStringList & ); + OoDrawImport( KoFilter *tqparent, const char *name, const TQStringList & ); virtual ~OoDrawImport(); - virtual KoFilter::ConversionStatus convert( QCString const & from, QCString const & to ); + virtual KoFilter::ConversiontqStatus convert( TQCString const & from, TQCString const & to ); private: - void createDocumentInfo( QDomDocument &docinfo ); - - void createStyleMap( QDomDocument &docstyles ); - void insertStyles( const QDomElement& styles ); - void insertDraws( const QDomElement& styles ); - void fillStyleStack( const QDomElement& object ); - void addStyles( const QDomElement* style ); - void storeObjectStyles( const QDomElement& object ); + void createDocumentInfo( TQDomDocument &docinfo ); + + void createStyleMap( TQDomDocument &docstyles ); + void insertStyles( const TQDomElement& styles ); + void insertDraws( const TQDomElement& styles ); + void fillStyleStack( const TQDomElement& object ); + void addStyles( const TQDomElement* style ); + void storeObjectStyles( const TQDomElement& object ); void appendPen( VObject &obj ); void appendBrush( VObject &obj ); - void appendPoints(VPath &path, const QDomElement& object); + void appendPoints(VPath &path, const TQDomElement& object); void convert(); - void parseGroup( VGroup *parent, const QDomElement& object ); - void parseColor( VColor &color, const QString &s ); + void parseGroup( VGroup *tqparent, const TQDomElement& object ); + void parseColor( VColor &color, const TQString &s ); double ymirror( double y ); - KoRect parseViewBox( const QDomElement& object ); + KoRect parseViewBox( const TQDomElement& object ); - KoFilter::ConversionStatus openFile(); - KoFilter::ConversionStatus loadAndParse(const QString& filename, QDomDocument& doc); + KoFilter::ConversiontqStatus openFile(); + KoFilter::ConversiontqStatus loadAndParse(const TQString& filename, TQDomDocument& doc); VDocument m_document; - QDomDocument m_content; - QDomDocument m_meta; - QDomDocument m_settings; - QDict<QDomElement> m_styles, m_draws; + TQDomDocument m_content; + TQDomDocument m_meta; + TQDomDocument m_settings; + TQDict<TQDomElement> m_styles, m_draws; KoStyleStack m_styleStack; KZip * m_zip; diff --git a/filters/karbon/png/pngexport.cc b/filters/karbon/png/pngexport.cc index 652074e9..4de61a44 100644 --- a/filters/karbon/png/pngexport.cc +++ b/filters/karbon/png/pngexport.cc @@ -17,12 +17,12 @@ * Boston, MA 02110-1301, USA. */ -#include <qcstring.h> -#include <qdom.h> -#include <qfile.h> -#include <qstring.h> -#include <qvaluelist.h> -#include <qimage.h> +#include <tqcstring.h> +#include <tqdom.h> +#include <tqfile.h> +#include <tqstring.h> +#include <tqvaluelist.h> +#include <tqimage.h> #include <kgenericfactory.h> #include <KoFilter.h> @@ -43,13 +43,13 @@ typedef KGenericFactory<PngExport, KoFilter> PngExportFactory; K_EXPORT_COMPONENT_FACTORY( libkarbonpngexport, PngExportFactory( "kofficefilters" ) ) -PngExport::PngExport( KoFilter*, const char*, const QStringList& ) +PngExport::PngExport( KoFilter*, const char*, const TQStringList& ) : KoFilter() { } -KoFilter::ConversionStatus -PngExport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus +PngExport::convert( const TQCString& from, const TQCString& to ) { if ( to != "image/png" || from != "application/x-karbon" ) { @@ -60,9 +60,9 @@ PngExport::convert( const QCString& from, const QCString& to ) if( !storeIn ) return KoFilter::StupidError; - QDomDocument domIn; + TQDomDocument domIn; domIn.setContent( storeIn ); - QDomElement docNode = domIn.documentElement(); + TQDomElement docNode = domIn.documentElement(); // load the document and export it: VDocument doc; @@ -74,18 +74,18 @@ PngExport::convert( const QCString& from, const QCString& to ) const KoRect &rect = bbox.boundingRect(); // create image with correct width and height - QImage img( int( rect.width() ), int( rect.height() ), 32 ); + TQImage img( int( rect.width() ), int( rect.height() ), 32 ); //img.setAlphaBuffer( true ); // Create painter and set up objects to draw VKoPainter p( img.bits(), rect.width(), rect.height() ); - p.clear( qRgba( 0xFF, 0xFF, 0xFF, 0xFF ) ); - p.setWorldMatrix( QWMatrix().translate( -rect.x(), -rect.y() ) ); + p.clear( tqRgba( 0xFF, 0xFF, 0xFF, 0xFF ) ); + p.setWorldMatrix( TQWMatrix().translate( -rect.x(), -rect.y() ) ); doc.draw( &p, &rect ); - QImage image = img.swapRGB(); - QImage mirrored = image.mirror( false, true ); + TQImage image = img.swapRGB(); + TQImage mirrored = image.mirror( false, true ); // save png mirrored.save( m_chain->outputFile(), "PNG" ); diff --git a/filters/karbon/png/pngexport.h b/filters/karbon/png/pngexport.h index a14e81c8..9fe9f7eb 100644 --- a/filters/karbon/png/pngexport.h +++ b/filters/karbon/png/pngexport.h @@ -27,12 +27,13 @@ class PngExport : public KoFilter, private VVisitor { Q_OBJECT + TQ_OBJECT public: - PngExport( KoFilter* parent, const char* name, const QStringList& ); + PngExport( KoFilter* tqparent, const char* name, const TQStringList& ); virtual ~PngExport() {} - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); }; #endif diff --git a/filters/karbon/svg/color.h b/filters/karbon/svg/color.h index bfdc93c6..49bc2e52 100644 --- a/filters/karbon/svg/color.h +++ b/filters/karbon/svg/color.h @@ -6,7 +6,7 @@ g = green; \ } -void keywordToRGB( QString rgbColor, int &r, int &g, int &b ) +void keywordToRGB( TQString rgbColor, int &r, int &g, int &b ) { if( rgbColor == "aliceblue" ) TORGB( 240, 248, 255) @@ -206,7 +206,7 @@ void keywordToRGB( QString rgbColor, int &r, int &g, int &b ) TORGB( 245, 255, 250 ) else if( rgbColor == "mistyrose" ) TORGB( 255, 228, 225 ) - else if( rgbColor == "moccasin" ) + else if( rgbColor == "tqmoccasin" ) TORGB( 255, 228, 181 ) else if( rgbColor == "navajowhite" ) TORGB( 255, 222, 173 ) diff --git a/filters/karbon/svg/svgexport.cc b/filters/karbon/svg/svgexport.cc index 4f434d4d..2e661039 100644 --- a/filters/karbon/svg/svgexport.cc +++ b/filters/karbon/svg/svgexport.cc @@ -17,11 +17,11 @@ * Boston, MA 02110-1301, USA. */ -#include <qcstring.h> -#include <qdom.h> -#include <qfile.h> -#include <qstring.h> -#include <qvaluelist.h> +#include <tqcstring.h> +#include <tqdom.h> +#include <tqfile.h> +#include <tqstring.h> +#include <tqvaluelist.h> #include <kgenericfactory.h> #include <KoFilter.h> @@ -48,10 +48,10 @@ #include <kdebug.h> -QString INDENT(" "); +TQString INDENT(" "); void -printIndentation( QTextStream *stream, unsigned int indent ) +printIndentation( TQTextStream *stream, unsigned int indent ) { for( unsigned int i = 0; i < indent;++i) *stream << INDENT; @@ -61,14 +61,14 @@ typedef KGenericFactory<SvgExport, KoFilter> SvgExportFactory; K_EXPORT_COMPONENT_FACTORY( libkarbonsvgexport, SvgExportFactory( "kofficefilters" ) ) -SvgExport::SvgExport( KoFilter*, const char*, const QStringList& ) +SvgExport::SvgExport( KoFilter*, const char*, const TQStringList& ) : KoFilter(), m_indent( 0 ), m_indent2( 0 ), m_trans( 0L ) { m_gc.setAutoDelete( true ); } -KoFilter::ConversionStatus -SvgExport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus +SvgExport::convert( const TQCString& from, const TQCString& to ) { if ( to != "image/svg+xml" || from != "application/x-karbon" ) { @@ -79,22 +79,22 @@ SvgExport::convert( const QCString& from, const QCString& to ) if( !storeIn ) return KoFilter::StupidError; - QFile fileOut( m_chain->outputFile() ); + TQFile fileOut( m_chain->outputFile() ); if( !fileOut.open( IO_WriteOnly ) ) { delete storeIn; return KoFilter::StupidError; } - QDomDocument domIn; + TQDomDocument domIn; domIn.setContent( storeIn ); - QDomElement docNode = domIn.documentElement(); + TQDomElement docNode = domIn.documentElement(); - m_stream = new QTextStream( &fileOut ); - QString body; - m_body = new QTextStream( &body, IO_ReadWrite ); - QString defs; - m_defs = new QTextStream( &defs, IO_ReadWrite ); + m_stream = new TQTextStream( &fileOut ); + TQString body; + m_body = new TQTextStream( &body, IO_ReadWrite ); + TQString defs; + m_defs = new TQTextStream( &defs, IO_ReadWrite ); // load the document and export it: VDocument doc; @@ -149,7 +149,7 @@ SvgExport::visitVDocument( VDocument& document ) SvgGraphicsContext *gc = new SvgGraphicsContext; m_gc.push( gc ); - QWMatrix mat; + TQWMatrix mat; mat.scale( 1, -1 ); mat.translate( 0, -document.height() ); @@ -167,12 +167,12 @@ SvgExport::visitVDocument( VDocument& document ) *m_body << "</svg>" << endl; } -QString +TQString SvgExport::getID( VObject *obj ) { if( obj && !obj->name().isEmpty() ) - return QString( " id=\"%1\"" ).arg( obj->name() ); - return QString(); + return TQString( " id=\"%1\"" ).tqarg( obj->name() ); + return TQString(); } void @@ -213,7 +213,7 @@ SvgExport::visitVLayer( VLayer& layer ) } void -SvgExport::writePathToStream( VPath &composite, const QString &id, QTextStream *stream, unsigned int indent ) +SvgExport::writePathToStream( VPath &composite, const TQString &id, TQTextStream *stream, unsigned int indent ) { if( ! stream ) return; @@ -226,7 +226,7 @@ SvgExport::writePathToStream( VPath &composite, const QString &id, QTextStream * getFill( *( composite.fill() ), stream ); getStroke( *( composite.stroke() ), stream ); - QString d; + TQString d; composite.saveSvgPath( d ); *stream << " d=\"" << d << "\" "; @@ -254,15 +254,15 @@ SvgExport::visitVSubpath( VSubpath& ) { } -QString createUID() +TQString createUID() { static unsigned int nr = 0; - return "defitem" + QString().setNum( nr++ ); + return "defitem" + TQString().setNum( nr++ ); } void -SvgExport::getColorStops( const QPtrVector<VColorStop> &colorStops ) +SvgExport::getColorStops( const TQPtrVector<VColorStop> &colorStops ) { m_indent2++; for( unsigned int i = 0; i < colorStops.count() ; i++ ) @@ -270,7 +270,7 @@ SvgExport::getColorStops( const QPtrVector<VColorStop> &colorStops ) printIndentation( m_defs, m_indent2 ); *m_defs << "<stop stop-color=\""; getHexColor( m_defs, colorStops.at( i )->color ); - *m_defs << "\" offset=\"" << QString().setNum( colorStops.at( i )->rampPoint ); + *m_defs << "\" offset=\"" << TQString().setNum( colorStops.at( i )->rampPoint ); *m_defs << "\" stop-opacity=\"" << colorStops.at( i )->color.opacity() << "\"" << " />" << endl; } m_indent2--; @@ -279,7 +279,7 @@ SvgExport::getColorStops( const QPtrVector<VColorStop> &colorStops ) void SvgExport::getGradient( const VGradient& grad ) { - QString uid = createUID(); + TQString uid = createUID(); if( grad.type() == VGradient::linear ) { printIndentation( m_defs, m_indent2 ); @@ -314,7 +314,7 @@ SvgExport::getGradient( const VGradient& grad ) *m_defs << "fx=\"" << grad.focalPoint().x() << "\" "; *m_defs << "fy=\"" << grad.focalPoint().y() << "\" "; double r = sqrt( pow( grad.vector().x() - grad.origin().x(), 2 ) + pow( grad.vector().y() - grad.origin().y(), 2 ) ); - *m_defs << "r=\"" << QString().setNum( r ) << "\" "; + *m_defs << "r=\"" << TQString().setNum( r ) << "\" "; if( grad.repeatMethod() == VGradient::reflect ) *m_defs << "spreadMethod=\"reflect\" "; else if( grad.repeatMethod() == VGradient::repeat ) @@ -341,7 +341,7 @@ SvgExport::getGradient( const VGradient& grad ) *m_defs << "fx=\"" << grad.focalPoint().x() << "\" "; *m_defs << "fy=\"" << grad.focalPoint().y() << "\" "; double r = sqrt( pow( grad.vector().x() - grad.origin().x(), 2 ) + pow( grad.vector().y() - grad.origin().y(), 2 ) ); - *m_defs << "r=\"" << QString().setNum( r ) << "\" "; + *m_defs << "r=\"" << TQString().setNum( r ) << "\" "; if( grad.repeatMethod() == VGradient::reflect ) *m_defs << "spreadMethod=\"reflect\" "; else if( grad.repeatMethod() == VGradient::repeat ) @@ -361,7 +361,7 @@ SvgExport::getGradient( const VGradient& grad ) void SvgExport::getPattern( const VPattern & ) { - QString uid = createUID(); + TQString uid = createUID(); printIndentation( m_defs, m_indent2 ); *m_defs << "<pattern id=\"" << uid << "\" "; *m_defs << "width=\"" << "\" "; @@ -376,7 +376,7 @@ SvgExport::getPattern( const VPattern & ) } void -SvgExport::getFill( const VFill& fill, QTextStream *stream ) +SvgExport::getFill( const VFill& fill, TQTextStream *stream ) { *stream << " fill=\""; if( fill.type() == VFill::none ) @@ -394,7 +394,7 @@ SvgExport::getFill( const VFill& fill, QTextStream *stream ) } void -SvgExport::getStroke( const VStroke& stroke, QTextStream *stream ) +SvgExport::getStroke( const VStroke& stroke, TQTextStream *stream ) { if( stroke.type() != m_gc.current()->stroke.type() ) { @@ -443,7 +443,7 @@ SvgExport::getStroke( const VStroke& stroke, QTextStream *stream ) *stream << " stroke-dashoffset=\"" << stroke.dashPattern().offset() << "\""; *stream << " stroke-dasharray=\" "; - QValueListConstIterator<float> itr; + TQValueListConstIterator<float> itr; for(itr = stroke.dashPattern().array().begin(); itr != stroke.dashPattern().array().end(); ++itr ) { *stream << *itr << " "; @@ -453,11 +453,11 @@ SvgExport::getStroke( const VStroke& stroke, QTextStream *stream ) } void -SvgExport::getHexColor( QTextStream *stream, const VColor& color ) +SvgExport::getHexColor( TQTextStream *stream, const VColor& color ) { // Convert the various color-spaces to hex - QString Output; + TQString Output; VColor copy( color ); copy.setColorSpace( VColor::rgb ); @@ -475,7 +475,7 @@ SvgExport::visitVText( VText& text ) m_trans->visitVPath( path ); - QString id = createUID(); + TQString id = createUID(); writePathToStream( path, " id=\""+ id + "\"", m_defs, m_indent2 ); printIndentation( m_body, m_indent++ ); @@ -490,9 +490,9 @@ SvgExport::visitVText( VText& text ) *m_body << " font-weight=\"bold\""; if( text.font().italic() ) *m_body << " font-style=\"italic\""; - if( text.alignment() == VText::Center ) + if( text.tqalignment() == VText::Center ) *m_body << " text-anchor=\"middle\""; - else if( text.alignment() == VText::Right ) + else if( text.tqalignment() == VText::Right ) *m_body << " text-anchor=\"end\""; *m_body << ">" << endl; diff --git a/filters/karbon/svg/svgexport.h b/filters/karbon/svg/svgexport.h index 8a4eab63..6a79fb07 100644 --- a/filters/karbon/svg/svgexport.h +++ b/filters/karbon/svg/svgexport.h @@ -27,9 +27,9 @@ #include "svggraphiccontext.h" -#include <qptrstack.h> +#include <tqptrstack.h> -class QTextStream; +class TQTextStream; class VColor; class VPath; class VDocument; @@ -46,12 +46,13 @@ class VTransformCmd; class SvgExport : public KoFilter, private VVisitor { Q_OBJECT + TQ_OBJECT public: - SvgExport( KoFilter* parent, const char* name, const QStringList& ); + SvgExport( KoFilter* tqparent, const char* name, const TQStringList& ); virtual ~SvgExport() {} - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); private: virtual void visitVPath( VPath& composite ); @@ -62,21 +63,21 @@ private: virtual void visitVSubpath( VSubpath& path ); virtual void visitVText( VText& text ); - void getStroke( const VStroke& stroke, QTextStream *stream ); - void getColorStops( const QPtrVector<VColorStop> &colorStops ); - void getFill( const VFill& fill, QTextStream *stream ); + void getStroke( const VStroke& stroke, TQTextStream *stream ); + void getColorStops( const TQPtrVector<VColorStop> &colorStops ); + void getFill( const VFill& fill, TQTextStream *stream ); void getGradient( const VGradient& grad ); void getPattern( const VPattern& patt ); - void getHexColor( QTextStream *, const VColor& color ); - QString getID( VObject *obj ); + void getHexColor( TQTextStream *, const VColor& color ); + TQString getID( VObject *obj ); - void writePathToStream( VPath &composite, const QString &id, QTextStream *stream, unsigned int indent ); + void writePathToStream( VPath &composite, const TQString &id, TQTextStream *stream, unsigned int indent ); - QTextStream* m_stream; - QTextStream* m_defs; - QTextStream* m_body; + TQTextStream* m_stream; + TQTextStream* m_defs; + TQTextStream* m_body; - QPtrStack<SvgGraphicsContext> m_gc; + TQPtrStack<SvgGraphicsContext> m_gc; unsigned int m_indent; unsigned int m_indent2; diff --git a/filters/karbon/svg/svggraphiccontext.h b/filters/karbon/svg/svggraphiccontext.h index 96737fd9..e9d5eb4b 100644 --- a/filters/karbon/svg/svggraphiccontext.h +++ b/filters/karbon/svg/svggraphiccontext.h @@ -33,16 +33,16 @@ public: stroke.setLineWidth( 1.0 ); stroke.setLineCap( VStroke::capButt ); stroke.setLineJoin( VStroke::joinMiter ); - fill.setColor( VColor( Qt::black ) ); + fill.setColor( VColor( TQt::black ) ); fillRule = winding; - color = Qt::black; + color = TQt::black; } VFill fill; VFillRule fillRule; VStroke stroke; - QWMatrix matrix; - QFont font; - QColor color; + TQWMatrix matrix; + TQFont font; + TQColor color; }; #endif diff --git a/filters/karbon/svg/svgimport.cc b/filters/karbon/svg/svgimport.cc index f97546c6..b8b580f7 100644 --- a/filters/karbon/svg/svgimport.cc +++ b/filters/karbon/svg/svgimport.cc @@ -35,15 +35,15 @@ #include <core/vgroup.h> #include <core/vimage.h> #include <core/vlayer.h> -#include <qcolor.h> -#include <qfile.h> -#include <qregexp.h> +#include <tqcolor.h> +#include <tqfile.h> +#include <tqregexp.h> #include <kfilterdev.h> typedef KGenericFactory<SvgImport, KoFilter> SvgImportFactory; K_EXPORT_COMPONENT_FACTORY( libkarbonsvgimport, SvgImportFactory( "kofficefilters" ) ) -SvgImport::SvgImport(KoFilter *, const char *, const QStringList&) : +SvgImport::SvgImport(KoFilter *, const char *, const TQStringList&) : KoFilter(), outdoc( "DOC" ) { @@ -54,20 +54,20 @@ SvgImport::~SvgImport() { } -KoFilter::ConversionStatus SvgImport::convert(const QCString& from, const QCString& to) +KoFilter::ConversiontqStatus SvgImport::convert(const TQCString& from, const TQCString& to) { // check for proper conversion if( to != "application/x-karbon" || from != "image/svg+xml" ) return KoFilter::NotImplemented; //Find the last extension - QString strExt; - QString fileIn ( m_chain->inputFile() ); - const int result=fileIn.findRev('.'); + TQString strExt; + TQString fileIn ( m_chain->inputFile() ); + const int result=fileIn.tqfindRev('.'); if (result>=0) strExt=fileIn.mid(result).lower(); - QString strMime; // Mime type of the compressor + TQString strMime; // Mime type of the compressor if ((strExt==".gz") //in case of .svg.gz (logical extension) ||(strExt==".svgz")) //in case of .svgz (extension used prioritary) strMime="application/x-gzip"; // Compressed with gzip @@ -78,7 +78,7 @@ KoFilter::ConversionStatus SvgImport::convert(const QCString& from, const QCStri /*kdDebug(30514) << "File extension: -" << strExt << "- Compression: " << strMime << endl;*/ - QIODevice* in = KFilterDev::deviceForFile(fileIn,strMime); + TQIODevice* in = KFilterDev::deviceForFile(fileIn,strMime); if (!in->open(IO_ReadOnly)) { @@ -88,7 +88,7 @@ KoFilter::ConversionStatus SvgImport::convert(const QCString& from, const QCStri } int line, col; - QString errormessage; + TQString errormessage; const bool parsed=inpdoc.setContent( in, &errormessage, &line, &col ); @@ -107,7 +107,7 @@ KoFilter::ConversionStatus SvgImport::convert(const QCString& from, const QCStri // Do the conversion! convert(); // add paper info, we always need custom for svg (Rob) - QDomElement paper = outdoc.createElement( "PAPER" ); + TQDomElement paper = outdoc.createElement( "PAPER" ); outdoc.documentElement().appendChild( paper ); paper.setAttribute( "format", PG_CUSTOM ); paper.setAttribute( "width", m_document.width() ); @@ -119,7 +119,7 @@ KoFilter::ConversionStatus SvgImport::convert(const QCString& from, const QCStri kdError(30514) << "Unable to open output file!" << endl; return KoFilter::StorageCreationError; } - QCString cstring = outdoc.toCString(); // utf-8 already + TQCString cstring = outdoc.toCString(); // utf-8 already out->writeBlock( cstring.data(), cstring.length() ); return KoFilter::OK; // was successful @@ -128,7 +128,7 @@ KoFilter::ConversionStatus SvgImport::convert(const QCString& from, const QCStri void SvgImport::convert() { SvgGraphicsContext *gc = new SvgGraphicsContext; - QDomElement docElem = inpdoc.documentElement(); + TQDomElement docElem = inpdoc.documentElement(); KoRect bbox( 0, 0, 550.0, 841.0 ); double width = !docElem.attribute( "width" ).isEmpty() ? parseUnit( docElem.attribute( "width" ), true, false, bbox ) : 550.0; double height = !docElem.attribute( "height" ).isEmpty() ? parseUnit( docElem.attribute( "height" ), false, true, bbox ) : 841.0; @@ -138,12 +138,12 @@ void SvgImport::convert() m_outerRect = m_document.boundingBox(); // undo y-mirroring - //m_debug->append(QString("%1\tUndo Y-mirroring.").arg(m_time.elapsed())); + //m_debug->append(TQString("%1\tUndo Y-mirroring.").tqarg(m_time.elapsed())); if( !docElem.attribute( "viewBox" ).isEmpty() ) { // allow for viewbox def with ',' or whitespace - QString viewbox( docElem.attribute( "viewBox" ) ); - QStringList points = QStringList::split( ' ', viewbox.replace( ',', ' ').simplifyWhiteSpace() ); + TQString viewbox( docElem.attribute( "viewBox" ) ); + TQStringList points = TQStringList::split( ' ', viewbox.tqreplace( ',', ' ').simplifyWhiteSpace() ); gc->matrix.scale( width / points[2].toFloat() , height / points[3].toFloat() ); m_outerRect.setWidth( m_outerRect.width() * ( points[2].toFloat() / width ) ); @@ -153,7 +153,7 @@ void SvgImport::convert() m_gc.push( gc ); parseGroup( 0L, docElem ); - QWMatrix mat; + TQWMatrix mat; mat.scale( 1, -1 ); mat.translate( 0, -m_document.height() ); VTransformCmd trafo( 0L, mat ); @@ -166,7 +166,7 @@ void SvgImport::convert() // Helper functions // --------------------------------------------------------------------------------------- -double SvgImport::toPercentage( QString s ) +double SvgImport::toPercentage( TQString s ) { if( s.endsWith( "%" ) ) return s.remove( '%' ).toDouble(); @@ -174,7 +174,7 @@ double SvgImport::toPercentage( QString s ) return s.toDouble() * 100.0; } -double SvgImport::fromPercentage( QString s ) +double SvgImport::fromPercentage( TQString s ) { if( s.endsWith( "%" ) ) return s.remove( '%' ).toDouble() / 100.0; @@ -182,7 +182,7 @@ double SvgImport::fromPercentage( QString s ) return s.toDouble(); } -double SvgImport::getScalingFromMatrix( QWMatrix &matrix ) +double SvgImport::getScalingFromMatrix( TQWMatrix &matrix ) { double xscale = matrix.m11() + matrix.m12(); double yscale = matrix.m22() + matrix.m21(); @@ -258,15 +258,15 @@ void SvgImport::addGraphicContext() m_gc.push( gc ); } -void SvgImport::setupTransform( const QDomElement &e ) +void SvgImport::setupTransform( const TQDomElement &e ) { SvgGraphicsContext *gc = m_gc.current(); - QWMatrix mat = VPath::parseTransform( e.attribute( "transform" ) ); + TQWMatrix mat = VPath::parseTransform( e.attribute( "transform" ) ); gc->matrix = mat * gc->matrix; } -VObject* SvgImport::findObject( const QString &name, VGroup* group ) +VObject* SvgImport::findObject( const TQString &name, VGroup* group ) { if( ! group ) return 0L; @@ -290,9 +290,9 @@ VObject* SvgImport::findObject( const QString &name, VGroup* group ) return 0L; } -VObject* SvgImport::findObject( const QString &name ) +VObject* SvgImport::findObject( const TQString &name ) { - QPtrVector<VLayer> vector; + TQPtrVector<VLayer> vector; m_document.layers().toVector( &vector ); for( int i = vector.count() - 1; i >= 0; i-- ) { @@ -307,22 +307,22 @@ VObject* SvgImport::findObject( const QString &name ) return 0L; } -SvgImport::GradientHelper* SvgImport::findGradient( const QString &id, const QString &href) +SvgImport::GradientHelper* SvgImport::findGradient( const TQString &id, const TQString &href) { // check if gradient was already parsed, and return it - if( m_gradients.contains( id ) ) + if( m_gradients.tqcontains( id ) ) return &m_gradients[ id ]; // check if gradient was stored for later parsing - if( !m_defs.contains( id ) ) + if( !m_defs.tqcontains( id ) ) return 0L; - QDomElement e = m_defs[ id ]; + TQDomElement e = m_defs[ id ]; if(e.childNodes().count() == 0) { - QString mhref = e.attribute("xlink:href").mid(1); + TQString mhref = e.attribute("xlink:href").mid(1); - if(m_defs.contains(mhref)) + if(m_defs.tqcontains(mhref)) return findGradient(mhref, id); else return 0L; @@ -334,22 +334,22 @@ SvgImport::GradientHelper* SvgImport::findGradient( const QString &id, const QSt } // return successfully parsed gradient or NULL - QString n; + TQString n; if(href.isEmpty()) n = id; else n = href; - if( m_gradients.contains( n ) ) + if( m_gradients.tqcontains( n ) ) return &m_gradients[ n ]; else return 0L; } -QDomElement SvgImport::mergeStyles( const QDomElement &referencedBy, const QDomElement &referencedElement ) +TQDomElement SvgImport::mergeStyles( const TQDomElement &referencedBy, const TQDomElement &referencedElement ) { // First use all the style attributes of the element being referenced. - QDomElement e = referencedElement; + TQDomElement e = referencedElement; // Now go through the style attributes of the element that is referencing and substitute the original ones. if( !referencedBy.attribute( "color" ).isEmpty() ) @@ -388,7 +388,7 @@ QDomElement SvgImport::mergeStyles( const QDomElement &referencedBy, const QDomE // Parsing functions // --------------------------------------------------------------------------------------- -double SvgImport::parseUnit( const QString &unit, bool horiz, bool vert, KoRect bbox ) +double SvgImport::parseUnit( const TQString &unit, bool horiz, bool vert, KoRect bbox ) { // TODO : percentage? double value = 0; @@ -439,42 +439,42 @@ double SvgImport::parseUnit( const QString &unit, bool horiz, bool vert, KoRect return value; } -QColor SvgImport::parseColor( const QString &rgbColor ) +TQColor SvgImport::parseColor( const TQString &rgbColor ) { int r, g, b; keywordToRGB( rgbColor, r, g, b ); - return QColor( r, g, b ); + return TQColor( r, g, b ); } -void SvgImport::parseColor( VColor &color, const QString &s ) +void SvgImport::parseColor( VColor &color, const TQString &s ) { if( s.startsWith( "rgb(" ) ) { - QString parse = s.stripWhiteSpace(); - QStringList colors = QStringList::split( ',', parse ); - QString r = colors[0].right( ( colors[0].length() - 4 ) ); - QString g = colors[1]; - QString b = colors[2].left( ( colors[2].length() - 1 ) ); + TQString parse = s.stripWhiteSpace(); + TQStringList colors = TQStringList::split( ',', parse ); + TQString r = colors[0].right( ( colors[0].length() - 4 ) ); + TQString g = colors[1]; + TQString b = colors[2].left( ( colors[2].length() - 1 ) ); - if( r.contains( "%" ) ) + if( r.tqcontains( "%" ) ) { r = r.left( r.length() - 1 ); - r = QString::number( int( ( double( 255 * r.toDouble() ) / 100.0 ) ) ); + r = TQString::number( int( ( double( 255 * r.toDouble() ) / 100.0 ) ) ); } - if( g.contains( "%" ) ) + if( g.tqcontains( "%" ) ) { g = g.left( g.length() - 1 ); - g = QString::number( int( ( double( 255 * g.toDouble() ) / 100.0 ) ) ); + g = TQString::number( int( ( double( 255 * g.toDouble() ) / 100.0 ) ) ); } - if( b.contains( "%" ) ) + if( b.tqcontains( "%" ) ) { b = b.left( b.length() - 1 ); - b = QString::number( int( ( double( 255 * b.toDouble() ) / 100.0 ) ) ); + b = TQString::number( int( ( double( 255 * b.toDouble() ) / 100.0 ) ) ); } - QColor c( r.toInt(), g.toInt(), b.toInt() ); + TQColor c( r.toInt(), g.toInt(), b.toInt() ); color.set( c.red() / 255.0, c.green() / 255.0, c.blue() / 255.0 ); } else if( s == "currentColor" ) @@ -484,8 +484,8 @@ void SvgImport::parseColor( VColor &color, const QString &s ) } else { - QString rgbColor = s.stripWhiteSpace(); - QColor c; + TQString rgbColor = s.stripWhiteSpace(); + TQColor c; if( rgbColor.startsWith( "#" ) ) c.setNamedColor( rgbColor ); else @@ -494,17 +494,17 @@ void SvgImport::parseColor( VColor &color, const QString &s ) } } -void SvgImport::parseColorStops( VGradient *gradient, const QDomElement &e ) +void SvgImport::parseColorStops( VGradient *gradient, const TQDomElement &e ) { VColor c; - for( QDomNode n = e.firstChild(); !n.isNull(); n = n.nextSibling() ) + for( TQDomNode n = e.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement stop = n.toElement(); + TQDomElement stop = n.toElement(); if( stop.tagName() == "stop" ) { float offset; - QString temp = stop.attribute( "offset" ); - if( temp.contains( '%' ) ) + TQString temp = stop.attribute( "offset" ); + if( temp.tqcontains( '%' ) ) { temp = temp.left( temp.length() - 1 ); offset = temp.toFloat() / 100.0; @@ -517,13 +517,13 @@ void SvgImport::parseColorStops( VGradient *gradient, const QDomElement &e ) else { // try style attr - QString style = stop.attribute( "style" ).simplifyWhiteSpace(); - QStringList substyles = QStringList::split( ';', style ); - for( QStringList::Iterator it = substyles.begin(); it != substyles.end(); ++it ) + TQString style = stop.attribute( "style" ).simplifyWhiteSpace(); + TQStringList substyles = TQStringList::split( ';', style ); + for( TQStringList::Iterator it = substyles.begin(); it != substyles.end(); ++it ) { - QStringList substyle = QStringList::split( ':', (*it) ); - QString command = substyle[0].stripWhiteSpace(); - QString params = substyle[1].stripWhiteSpace(); + TQStringList substyle = TQStringList::split( ':', (*it) ); + TQString command = substyle[0].stripWhiteSpace(); + TQString params = substyle[1].stripWhiteSpace(); if( command == "stop-color" ) parseColor( c, params ); if( command == "stop-opacity" ) @@ -538,7 +538,7 @@ void SvgImport::parseColorStops( VGradient *gradient, const QDomElement &e ) } } -void SvgImport::parseGradient( const QDomElement &e , const QDomElement &referencedBy) +void SvgImport::parseGradient( const TQDomElement &e , const TQDomElement &referencedBy) { // IMPROVEMENTS: // - Store the parsed colorstops in some sort of a cache so they don't need to be parsed again. @@ -555,7 +555,7 @@ void SvgImport::parseGradient( const QDomElement &e , const QDomElement &referen if(e.childNodes().count() == 0) { - QString href = e.attribute("xlink:href").mid(1); + TQString href = e.attribute("xlink:href").mid(1); if(href.isEmpty()) { @@ -572,17 +572,17 @@ void SvgImport::parseGradient( const QDomElement &e , const QDomElement &referen } // Use the gradient that is referencing, or if there isn't one, the original gradient. - QDomElement b; + TQDomElement b; if( !referencedBy.isNull() ) b = referencedBy; else b = e; - QString id = b.attribute("id"); + TQString id = b.attribute("id"); if( !id.isEmpty() ) { // Copy existing gradient if it exists - if( m_gradients.find( id ) != m_gradients.end() ) + if( m_gradients.tqfind( id ) != m_gradients.end() ) gradhelper.gradient = m_gradients[ id ].gradient; } @@ -598,13 +598,13 @@ void SvgImport::parseGradient( const QDomElement &e , const QDomElement &referen else { // try style attr - QString style = b.attribute( "style" ).simplifyWhiteSpace(); - QStringList substyles = QStringList::split( ';', style ); - for( QStringList::Iterator it = substyles.begin(); it != substyles.end(); ++it ) + TQString style = b.attribute( "style" ).simplifyWhiteSpace(); + TQStringList substyles = TQStringList::split( ';', style ); + for( TQStringList::Iterator it = substyles.begin(); it != substyles.end(); ++it ) { - QStringList substyle = QStringList::split( ':', (*it) ); - QString command = substyle[0].stripWhiteSpace(); - QString params = substyle[1].stripWhiteSpace(); + TQStringList substyle = TQStringList::split( ':', (*it) ); + TQString command = substyle[0].stripWhiteSpace(); + TQString params = substyle[1].stripWhiteSpace(); if( command == "color" ) parseColor( c, params ); } @@ -642,7 +642,7 @@ void SvgImport::parseGradient( const QDomElement &e , const QDomElement &referen gradhelper.gradient.setType( VGradient::radial ); } // handle spread method - QString spreadMethod = b.attribute( "spreadMethod" ); + TQString spreadMethod = b.attribute( "spreadMethod" ); if( !spreadMethod.isEmpty() ) { if( spreadMethod == "reflect" ) @@ -663,7 +663,7 @@ void SvgImport::parseGradient( const QDomElement &e , const QDomElement &referen m_gradients.insert( b.attribute( "id" ), gradhelper ); } -void SvgImport::parsePA( VObject *obj, SvgGraphicsContext *gc, const QString &command, const QString ¶ms ) +void SvgImport::parsePA( VObject *obj, SvgGraphicsContext *gc, const TQString &command, const TQString ¶ms ) { VColor fillcolor = gc->fill.color(); VColor strokecolor = gc->stroke.color(); @@ -676,9 +676,9 @@ void SvgImport::parsePA( VObject *obj, SvgGraphicsContext *gc, const QString &co gc->fill.setType( VFill::none ); else if( params.startsWith( "url(" ) ) { - unsigned int start = params.find("#") + 1; - unsigned int end = params.findRev(")"); - QString key = params.mid( start, end - start ); + unsigned int start = params.tqfind("#") + 1; + unsigned int end = params.tqfindRev(")"); + TQString key = params.mid( start, end - start ); GradientHelper *gradHelper = findGradient( key ); if( gradHelper ) { @@ -692,17 +692,17 @@ void SvgImport::parsePA( VObject *obj, SvgGraphicsContext *gc, const QString &co //kdDebug() << "!!!!!!bbox y : " << bbox.y() << endl; //kdDebug() << gc->fill.gradient().origin().x() << endl; //kdDebug() << gc->fill.gradient().vector().x() << endl; - double offsetx = parseUnit( QString( "%1%" ).arg( gc->fill.gradient().origin().x() ), true, false, bbox ); - double offsety = parseUnit( QString( "%1%" ).arg( gc->fill.gradient().origin().y() ), false, true, bbox ); + double offsetx = parseUnit( TQString( "%1%" ).tqarg( gc->fill.gradient().origin().x() ), true, false, bbox ); + double offsety = parseUnit( TQString( "%1%" ).tqarg( gc->fill.gradient().origin().y() ), false, true, bbox ); gc->fill.gradient().setOrigin( KoPoint( bbox.x() + offsetx, bbox.y() + offsety ) ); if(gc->fill.gradient().type() == VGradient::radial) { - offsetx = parseUnit( QString( "%1%" ).arg( gc->fill.gradient().focalPoint().x() ), true, false, bbox ); - offsety = parseUnit( QString( "%1%" ).arg( gc->fill.gradient().focalPoint().y() ), false, true, bbox ); + offsetx = parseUnit( TQString( "%1%" ).tqarg( gc->fill.gradient().focalPoint().x() ), true, false, bbox ); + offsety = parseUnit( TQString( "%1%" ).tqarg( gc->fill.gradient().focalPoint().y() ), false, true, bbox ); gc->fill.gradient().setFocalPoint( KoPoint( bbox.x() + offsetx, bbox.y() + offsety ) ); } - offsetx = parseUnit( QString( "%1%" ).arg( gc->fill.gradient().vector().x() ), true, false, bbox ); - offsety = parseUnit( QString( "%1%" ).arg( gc->fill.gradient().vector().y() ), false, true, bbox ); + offsetx = parseUnit( TQString( "%1%" ).tqarg( gc->fill.gradient().vector().x() ), true, false, bbox ); + offsety = parseUnit( TQString( "%1%" ).tqarg( gc->fill.gradient().vector().y() ), false, true, bbox ); gc->fill.gradient().setVector( KoPoint( bbox.x() + offsetx, bbox.y() + offsety ) ); //kdDebug() << offsety << endl; //kdDebug() << gc->fill.gradient().origin().x() << endl; @@ -739,9 +739,9 @@ void SvgImport::parsePA( VObject *obj, SvgGraphicsContext *gc, const QString &co gc->stroke.setType( VStroke::none ); else if( params.startsWith( "url(" ) ) { - unsigned int start = params.find("#") + 1; - unsigned int end = params.findRev(")"); - QString key = params.mid( start, end - start ); + unsigned int start = params.tqfind("#") + 1; + unsigned int end = params.tqfindRev(")"); + TQString key = params.mid( start, end - start ); GradientHelper *gradHelper = findGradient( key ); if( gradHelper ) @@ -784,13 +784,13 @@ void SvgImport::parsePA( VObject *obj, SvgGraphicsContext *gc, const QString &co gc->stroke.setMiterLimit( params.toFloat() ); else if( command == "stroke-dasharray" ) { - QValueList<float> array; + TQValueList<float> array; if(params != "none") { // with "stroke-dasharray", the separator is a white space // inside style attribute, stroke-dasharray is separated by comma (,) - QStringList dashes = QStringList::split( QRegExp("[\\s,]"), params ); - for( QStringList::Iterator it = dashes.begin(); it != dashes.end(); ++it ) + TQStringList dashes = TQStringList::split( TQRegExp("[\\s,]"), params ); + for( TQStringList::Iterator it = dashes.begin(); it != dashes.end(); ++it ) array.append( (*it).toFloat() ); } gc->stroke.dashPattern().setArray( array ); @@ -809,8 +809,8 @@ void SvgImport::parsePA( VObject *obj, SvgGraphicsContext *gc, const QString &co } else if( command == "font-family" ) { - QString family = params; - family.replace( '\'' , ' ' ); + TQString family = params; + family.tqreplace( '\'' , ' ' ); gc->font.setFamily( family ); } else if( command == "font-size" ) @@ -820,7 +820,7 @@ void SvgImport::parsePA( VObject *obj, SvgGraphicsContext *gc, const QString &co } else if( command == "font-weight" ) { - int weight = QFont::Normal; + int weight = TQFont::Normal; // map svg weight to qt weight // svg value qt value @@ -831,7 +831,7 @@ void SvgImport::parsePA( VObject *obj, SvgGraphicsContext *gc, const QString &co // 800,900 87,99 if( params == "bold" ) - weight = QFont::Bold; + weight = TQFont::Bold; else if( params == "lighter" ) { weight = gc->font.weight(); @@ -915,7 +915,7 @@ void SvgImport::parsePA( VObject *obj, SvgGraphicsContext *gc, const QString &co gc->stroke.setColor( strokecolor ); } -void SvgImport::parseStyle( VObject *obj, const QDomElement &e ) +void SvgImport::parseStyle( VObject *obj, const TQDomElement &e ) { SvgGraphicsContext *gc = m_gc.current(); if( !gc ) return; @@ -949,13 +949,13 @@ void SvgImport::parseStyle( VObject *obj, const QDomElement &e ) parsePA( obj, gc, "opacity", e.attribute( "opacity" ) ); // try style attr - QString style = e.attribute( "style" ).simplifyWhiteSpace(); - QStringList substyles = QStringList::split( ';', style ); - for( QStringList::Iterator it = substyles.begin(); it != substyles.end(); ++it ) + TQString style = e.attribute( "style" ).simplifyWhiteSpace(); + TQStringList substyles = TQStringList::split( ';', style ); + for( TQStringList::Iterator it = substyles.begin(); it != substyles.end(); ++it ) { - QStringList substyle = QStringList::split( ':', (*it) ); - QString command = substyle[0].stripWhiteSpace(); - QString params = substyle[1].stripWhiteSpace(); + TQStringList substyle = TQStringList::split( ':', (*it) ); + TQString command = substyle[0].stripWhiteSpace(); + TQString params = substyle[1].stripWhiteSpace(); parsePA( obj, gc, command, params ); } @@ -972,7 +972,7 @@ void SvgImport::parseStyle( VObject *obj, const QDomElement &e ) gc->stroke.setLineWidth( lineWidth ); } -void SvgImport::parseFont( const QDomElement &e ) +void SvgImport::parseFont( const TQDomElement &e ) { SvgGraphicsContext *gc = m_gc.current(); if( !gc ) return; @@ -987,16 +987,16 @@ void SvgImport::parseFont( const QDomElement &e ) parsePA( 0L, m_gc.current(), "text-decoration", e.attribute( "text-decoration" ) ); } -void SvgImport::parseUse( VGroup *grp, const QDomElement &e ) +void SvgImport::parseUse( VGroup *grp, const TQDomElement &e ) { - QString id = e.attribute( "xlink:href" ); + TQString id = e.attribute( "xlink:href" ); if( !id.isEmpty() ) { addGraphicContext(); setupTransform( e ); - QString key = id.mid( 1 ); + TQString key = id.mid( 1 ); if( !e.attribute( "x" ).isEmpty() && !e.attribute( "y" ).isEmpty() ) { @@ -1006,9 +1006,9 @@ void SvgImport::parseUse( VGroup *grp, const QDomElement &e ) m_gc.current()->matrix.translate(tx,ty); } - if(m_defs.contains(key)) + if(m_defs.tqcontains(key)) { - QDomElement a = m_defs[key]; + TQDomElement a = m_defs[key]; if(a.tagName() == "g" || a.tagName() == "a") parseGroup( grp, a); else @@ -1023,11 +1023,11 @@ void SvgImport::parseUse( VGroup *grp, const QDomElement &e ) } } -void SvgImport::parseGroup( VGroup *grp, const QDomElement &e ) +void SvgImport::parseGroup( VGroup *grp, const TQDomElement &e ) { - for( QDomNode n = e.firstChild(); !n.isNull(); n = n.nextSibling() ) + for( TQDomNode n = e.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement b = n.toElement(); + TQDomElement b = n.toElement(); if( b.isNull() ) continue; // treat svg link <a> as group so we don't miss its child elements @@ -1090,17 +1090,17 @@ void SvgImport::parseGroup( VGroup *grp, const QDomElement &e ) } } -void SvgImport::parseDefs( const QDomElement &e ) +void SvgImport::parseDefs( const TQDomElement &e ) { - for( QDomNode n = e.firstChild(); !n.isNull(); n = n.nextSibling() ) + for( TQDomNode n = e.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement b = n.toElement(); + TQDomElement b = n.toElement(); if( b.isNull() ) continue; - QString definition = b.attribute( "id" ); + TQString definition = b.attribute( "id" ); if( !definition.isEmpty() ) { - if( !m_defs.contains( definition ) ) + if( !m_defs.tqcontains( definition ) ) m_defs.insert( definition, b ); } } @@ -1110,13 +1110,13 @@ void SvgImport::parseDefs( const QDomElement &e ) // Creating functions // --------------------------------------------------------------------------------------- -void SvgImport::createText( VGroup *grp, const QDomElement &b ) +void SvgImport::createText( VGroup *grp, const TQDomElement &b ) { const double pathLength = 10.0; VText *text = 0L; - QString content; - QString anchor; + TQString content; + TQString anchor; VSubpath base( 0L ); VPath *path = 0L; double offset = 0.0; @@ -1139,9 +1139,9 @@ void SvgImport::createText( VGroup *grp, const QDomElement &b ) base.lineTo( KoPoint( x + pathLength, y ) ); } - for( QDomNode n = b.firstChild(); !n.isNull(); n = n.nextSibling() ) + for( TQDomNode n = b.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if( e.isNull() ) { content += n.toCharacterData().data(); @@ -1151,8 +1151,8 @@ void SvgImport::createText( VGroup *grp, const QDomElement &b ) if( e.attribute( "xlink:href" ).isEmpty() ) continue; - QString key = e.attribute( "xlink:href" ).mid( 1 ); - if( ! m_defs.contains(key) ) + TQString key = e.attribute( "xlink:href" ).mid( 1 ); + if( ! m_defs.tqcontains(key) ) { // try to find referenced object in document VObject* obj = findObject( key ); @@ -1164,7 +1164,7 @@ void SvgImport::createText( VGroup *grp, const QDomElement &b ) } else { - QDomElement p = m_defs[key]; + TQDomElement p = m_defs[key]; createObject( grp, p, VObject::deleted); } if( ! path ) @@ -1174,7 +1174,7 @@ void SvgImport::createText( VGroup *grp, const QDomElement &b ) if( ! e.attribute( "startOffset" ).isEmpty() ) { - QString start = e.attribute( "startOffset" ); + TQString start = e.attribute( "startOffset" ); if( start.endsWith( "%" ) ) offset = 0.01 * start.remove( '%' ).toDouble(); else @@ -1197,8 +1197,8 @@ void SvgImport::createText( VGroup *grp, const QDomElement &b ) content += e.text(); if( base.isEmpty() && ! e.attribute( "x" ).isEmpty() && ! e.attribute( "y" ).isEmpty() ) { - QStringList posX = QStringList::split( ", ", e.attribute( "x" ) ); - QStringList posY = QStringList::split( ", ", e.attribute( "y" ) ); + TQStringList posX = TQStringList::split( ", ", e.attribute( "x" ) ); + TQStringList posY = TQStringList::split( ", ", e.attribute( "y" ) ); if( posX.count() && posY.count() ) { double x = parseUnit( posX.first() ); @@ -1213,8 +1213,8 @@ void SvgImport::createText( VGroup *grp, const QDomElement &b ) if( e.attribute( "xlink:href" ).isEmpty() ) continue; - QString key = e.attribute( "xlink:href" ).mid( 1 ); - if( ! m_defs.contains(key) ) + TQString key = e.attribute( "xlink:href" ).mid( 1 ); + if( ! m_defs.tqcontains(key) ) { // try to find referenced object in document VObject* obj = findObject( key ); @@ -1226,7 +1226,7 @@ void SvgImport::createText( VGroup *grp, const QDomElement &b ) } else { - QDomElement p = m_defs[key]; + TQDomElement p = m_defs[key]; content += p.text(); } } @@ -1263,9 +1263,9 @@ void SvgImport::createText( VGroup *grp, const QDomElement &b ) text->setName( b.attribute("id") ); if( anchor == "middle" ) - text->setAlignment( VText::Center ); + text->tqsetAlignment( VText::Center ); else if( anchor == "end" ) - text->setAlignment( VText::Right ); + text->tqsetAlignment( VText::Right ); if( offset > 0.0 ) text->setOffset( offset ); @@ -1279,7 +1279,7 @@ void SvgImport::createText( VGroup *grp, const QDomElement &b ) delete( m_gc.pop() ); } -void SvgImport::createObject( VGroup *grp, const QDomElement &b, const VObject::VState state, const QDomElement &style ) +void SvgImport::createObject( VGroup *grp, const TQDomElement &b, const VObject::VState state, const TQDomElement &style ) { VObject *obj = 0L; @@ -1327,12 +1327,12 @@ void SvgImport::createObject( VGroup *grp, const QDomElement &b, const VObject:: VPath *path = new VPath( &m_document ); bool bFirst = true; - QString points = b.attribute( "points" ).simplifyWhiteSpace(); - points.replace( ',', ' ' ); + TQString points = b.attribute( "points" ).simplifyWhiteSpace(); + points.tqreplace( ',', ' ' ); points.remove( '\r' ); points.remove( '\n' ); - QStringList pointList = QStringList::split( ' ', points ); - for( QStringList::Iterator it = pointList.begin(); it != pointList.end(); ++it) + TQStringList pointList = TQStringList::split( ' ', points ); + for( TQStringList::Iterator it = pointList.begin(); it != pointList.end(); ++it) { KoPoint point; point.setX( (*it).toDouble() ); @@ -1357,7 +1357,7 @@ void SvgImport::createObject( VGroup *grp, const QDomElement &b, const VObject:: } else if( b.tagName() == "image" ) { - QString fname = b.attribute("xlink:href"); + TQString fname = b.attribute("xlink:href"); obj = new VImage( 0L, fname ); } diff --git a/filters/karbon/svg/svgimport.h b/filters/karbon/svg/svgimport.h index a558c1fc..24857b65 100644 --- a/filters/karbon/svg/svgimport.h +++ b/filters/karbon/svg/svgimport.h @@ -21,9 +21,9 @@ #define __SVGIMPORT_H__ #include <KoFilter.h> -#include <qdom.h> -#include <qmap.h> -#include <qptrstack.h> +#include <tqdom.h> +#include <tqmap.h> +#include <tqptrstack.h> #include <core/vdocument.h> #include <core/vgradient.h> #include <core/vfill.h> @@ -39,12 +39,13 @@ class VPath; class SvgImport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - SvgImport(KoFilter *parent, const char *name, const QStringList&); + SvgImport(KoFilter *tqparent, const char *name, const TQStringList&); virtual ~SvgImport(); - virtual KoFilter::ConversionStatus convert(const QCString& from, const QCString& to); + virtual KoFilter::ConversiontqStatus convert(const TQCString& from, const TQCString& to); protected: class GradientHelper @@ -56,46 +57,46 @@ protected: } VGradient gradient; bool bbox; - QWMatrix gradientTransform; + TQWMatrix gradientTransform; }; - void parseGroup( VGroup *, const QDomElement & ); - void parseDefs( const QDomElement & ); - void parseUse( VGroup *, const QDomElement & ); - void parseStyle( VObject *, const QDomElement & ); - void parsePA( VObject *, SvgGraphicsContext *, const QString &, const QString & ); - void parseGradient( const QDomElement &, const QDomElement &referencedBy = QDomElement() ); - void parseColorStops( VGradient *, const QDomElement & ); - double parseUnit( const QString &, bool horiz = false, bool vert = false, KoRect bbox = KoRect() ); - void parseColor( VColor &, const QString & ); - QColor parseColor( const QString & ); - double toPercentage( QString ); - double fromPercentage( QString ); - void setupTransform( const QDomElement & ); + void parseGroup( VGroup *, const TQDomElement & ); + void parseDefs( const TQDomElement & ); + void parseUse( VGroup *, const TQDomElement & ); + void parseStyle( VObject *, const TQDomElement & ); + void parsePA( VObject *, SvgGraphicsContext *, const TQString &, const TQString & ); + void parseGradient( const TQDomElement &, const TQDomElement &referencedBy = TQDomElement() ); + void parseColorStops( VGradient *, const TQDomElement & ); + double parseUnit( const TQString &, bool horiz = false, bool vert = false, KoRect bbox = KoRect() ); + void parseColor( VColor &, const TQString & ); + TQColor parseColor( const TQString & ); + double toPercentage( TQString ); + double fromPercentage( TQString ); + void setupTransform( const TQDomElement & ); void addGraphicContext(); - QDomDocument inpdoc; - QDomDocument outdoc; + TQDomDocument inpdoc; + TQDomDocument outdoc; void convert(); - void createObject( VGroup *grp, const QDomElement &, VObject::VState state = VObject::normal, const QDomElement &style = QDomElement() ); - void createText( VGroup *, const QDomElement & ); - void parseFont( const QDomElement & ); + void createObject( VGroup *grp, const TQDomElement &, VObject::VState state = VObject::normal, const TQDomElement &style = TQDomElement() ); + void createText( VGroup *, const TQDomElement & ); + void parseFont( const TQDomElement & ); // find object with given id in document - VObject* findObject( const QString &name ); + VObject* findObject( const TQString &name ); // find object with given id in given group - VObject* findObject( const QString &name, VGroup * ); + VObject* findObject( const TQString &name, VGroup * ); // find gradient with given id in gradient map - GradientHelper* findGradient( const QString &id, const QString &href = 0 ); + GradientHelper* findGradient( const TQString &id, const TQString &href = 0 ); // Determine scaling factor from given matrix - double getScalingFromMatrix( QWMatrix &matrix ); + double getScalingFromMatrix( TQWMatrix &matrix ); - QDomElement mergeStyles( const QDomElement &, const QDomElement & ); + TQDomElement mergeStyles( const TQDomElement &, const TQDomElement & ); private: VDocument m_document; - QPtrStack<SvgGraphicsContext> m_gc; - QMap<QString, GradientHelper> m_gradients; - QMap<QString, QDomElement> m_defs; + TQPtrStack<SvgGraphicsContext> m_gc; + TQMap<TQString, GradientHelper> m_gradients; + TQMap<TQString, TQDomElement> m_defs; KoRect m_outerRect; }; diff --git a/filters/karbon/wmf/wmfexport.cc b/filters/karbon/wmf/wmfexport.cc index 5f1e94d7..a04dfc11 100644 --- a/filters/karbon/wmf/wmfexport.cc +++ b/filters/karbon/wmf/wmfexport.cc @@ -17,8 +17,8 @@ */ #include <config.h> -#include <qdom.h> -#include <qcstring.h> +#include <tqdom.h> +#include <tqcstring.h> #include <kdebug.h> #include <kgenericfactory.h> #include <KoFilterChain.h> @@ -48,7 +48,7 @@ typedef KGenericFactory<WmfExport, KoFilter> WmfExportFactory; K_EXPORT_COMPONENT_FACTORY( libwmfexport, WmfExportFactory( "kofficefilters" ) ) -WmfExport::WmfExport( KoFilter *, const char *, const QStringList&) : +WmfExport::WmfExport( KoFilter *, const char *, const TQStringList&) : KoFilter() { } @@ -57,7 +57,7 @@ WmfExport::~WmfExport() { } -KoFilter::ConversionStatus WmfExport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus WmfExport::convert( const TQCString& from, const TQCString& to ) { if( to != "image/x-wmf" || from != "application/x-karbon" ) { return KoFilter::NotImplemented; @@ -76,9 +76,9 @@ KoFilter::ConversionStatus WmfExport::convert( const QCString& from, const QCStr return KoFilter::WrongFormat; } - QDomDocument domIn; + TQDomDocument domIn; domIn.setContent( storeIn ); - QDomElement docNode = domIn.documentElement(); + TQDomElement docNode = domIn.documentElement(); // Load the document. mDoc = new VDocument; @@ -123,8 +123,8 @@ void WmfExport::visitVDocument( VDocument& document ) { void WmfExport::visitVPath( VPath& composite ) { - QPen pen; - QBrush brush; + TQPen pen; + TQBrush brush; getPen( pen, composite.stroke() ); getBrush( brush, composite.fill() ); @@ -133,7 +133,7 @@ void WmfExport::visitVPath( VPath& composite ) { if ( mListPa.count() > 0 ) { mWmf->setPen( pen ); - if( (brush.style() == Qt::NoBrush) + if( (brush.style() == TQt::NoBrush) && (mListPa.count() == 1) ) { mWmf->drawPolyline( *mListPa.first() ); } @@ -158,7 +158,7 @@ void WmfExport::visitVSubpath( VSubpath& path ) { VSubpath *newPath; VSubpathIterator itr( path ); VFlattenCmd cmd( 0L, INCH_TO_POINT(0.3 / (double)mDpi) ); - QPointArray *pa = new QPointArray( path.count() ); + TQPointArray *pa = new TQPointArray( path.count() ); int nbrPoint=0; // number of points in the path for( ; itr.current(); ++itr ) { @@ -221,7 +221,7 @@ void WmfExport::visitVText( VText& text ) { } -void WmfExport::getBrush( QBrush& brush, const VFill *fill ) { +void WmfExport::getBrush( TQBrush& brush, const VFill *fill ) { if( (fill->type() == VFill::solid) || (fill->type() == VFill::grad) || (fill->type() == VFill::patt) ) { if ( fill->color().opacity() < 0.1 ) { @@ -238,7 +238,7 @@ void WmfExport::getBrush( QBrush& brush, const VFill *fill ) { } -void WmfExport::getPen( QPen& pen, const VStroke *stroke ) { +void WmfExport::getPen( TQPen& pen, const VStroke *stroke ) { if( (stroke->type() == VStroke::solid) || (stroke->type() == VStroke::grad) || (stroke->type() == VStroke::patt) ) { // TODO : Dash pattern. diff --git a/filters/karbon/wmf/wmfexport.h b/filters/karbon/wmf/wmfexport.h index 8f107ee0..9d7bf9cb 100644 --- a/filters/karbon/wmf/wmfexport.h +++ b/filters/karbon/wmf/wmfexport.h @@ -19,10 +19,10 @@ #ifndef WMFEXPORT_H #define WMFEXPORT_H -#include <qpen.h> -#include <qbrush.h> -#include <qptrlist.h> -#include <qpointarray.h> +#include <tqpen.h> +#include <tqbrush.h> +#include <tqptrlist.h> +#include <tqpointarray.h> #include <KoFilter.h> #include "vvisitor.h" @@ -35,20 +35,21 @@ class VText; class WmfExport : public KoFilter, private VVisitor { Q_OBJECT + TQ_OBJECT public: - WmfExport( KoFilter *parent, const char *name, const QStringList&); + WmfExport( KoFilter *tqparent, const char *name, const TQStringList&); virtual ~WmfExport(); - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); private: void visitVPath( VPath& composite ); void visitVDocument( VDocument& document ); void visitVSubpath( VSubpath& path ); void visitVText( VText& text ); - void getBrush( QBrush& brush, const VFill *fill ); - void getPen( QPen& pen, const VStroke *stroke ); + void getBrush( TQBrush& brush, const VFill *fill ); + void getPen( TQPen& pen, const VStroke *stroke ); // coordinate transformation // translate origin from (left,bottom) to (left,top) -> scale to wmf size @@ -65,7 +66,7 @@ private: int mDpi; double mScaleX; double mScaleY; - QPtrList<QPointArray> mListPa; + TQPtrList<TQPointArray> mListPa; }; #endif diff --git a/filters/karbon/wmf/wmfimport.cc b/filters/karbon/wmf/wmfimport.cc index eadad26b..23eaaa12 100644 --- a/filters/karbon/wmf/wmfimport.cc +++ b/filters/karbon/wmf/wmfimport.cc @@ -21,8 +21,8 @@ DESCRIPTION */ #include <config.h> -#include <qdom.h> -#include <qcstring.h> +#include <tqdom.h> +#include <tqcstring.h> #include <kdebug.h> #include <kgenericfactory.h> #include <KoFilterChain.h> @@ -36,7 +36,7 @@ typedef KGenericFactory<WMFImport, KoFilter> WMFImportFactory; K_EXPORT_COMPONENT_FACTORY( libwmfimport, WMFImportFactory( "kofficefilters" ) ) -WMFImport::WMFImport( KoFilter *, const char *, const QStringList&) : +WMFImport::WMFImport( KoFilter *, const char *, const TQStringList&) : KoFilter() { } @@ -45,7 +45,7 @@ WMFImport::~WMFImport() { } -KoFilter::ConversionStatus WMFImport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus WMFImport::convert( const TQCString& from, const TQCString& to ) { if( to != "application/x-karbon" || from != "image/x-wmf" ) return KoFilter::NotImplemented; @@ -66,8 +66,8 @@ KoFilter::ConversionStatus WMFImport::convert( const QCString& from, const QCStr kdError(3800) << "Unable to open output file!" << endl; return KoFilter::StorageCreationError; } - QDomDocument outdoc = document.saveXML(); - QCString content = outdoc.toCString(); + TQDomDocument outdoc = document.saveXML(); + TQCString content = outdoc.toCString(); // kdDebug() << " content : " << content << endl; out->writeBlock( content , content.length() ); diff --git a/filters/karbon/wmf/wmfimport.h b/filters/karbon/wmf/wmfimport.h index e1290422..45ddefec 100644 --- a/filters/karbon/wmf/wmfimport.h +++ b/filters/karbon/wmf/wmfimport.h @@ -30,12 +30,13 @@ DESCRIPTION class WMFImport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - WMFImport( KoFilter *parent, const char *name, const QStringList&); + WMFImport( KoFilter *tqparent, const char *name, const TQStringList&); virtual ~WMFImport(); - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); }; diff --git a/filters/karbon/wmf/wmfimportparser.cc b/filters/karbon/wmf/wmfimportparser.cc index 2eb380a4..275490fe 100644 --- a/filters/karbon/wmf/wmfimportparser.cc +++ b/filters/karbon/wmf/wmfimportparser.cc @@ -47,7 +47,7 @@ bool WMFImportParser::play( VDocument& doc ) // Virtual Painter bool WMFImportParser::begin() { - QRect bounding = boundingRect(); + TQRect bounding = boundingRect(); mBackgroundMode = Qt::TransparentMode; mCurrentOrg.setX( bounding.left() ); @@ -87,26 +87,26 @@ void WMFImportParser::restore() { } -void WMFImportParser::setFont( const QFont & ) { +void WMFImportParser::setFont( const TQFont & ) { } -void WMFImportParser::setPen( const QPen &pen ) { +void WMFImportParser::setPen( const TQPen &pen ) { mPen = pen; } -const QPen &WMFImportParser::pen() const { +const TQPen &WMFImportParser::pen() const { return mPen; } -void WMFImportParser::setBrush( const QBrush &brush ) { +void WMFImportParser::setBrush( const TQBrush &brush ) { mBrush = brush; } -void WMFImportParser::setBackgroundColor( const QColor &c ) { +void WMFImportParser::setBackgroundColor( const TQColor &c ) { mBackgroundColor = c; } @@ -116,7 +116,7 @@ void WMFImportParser::setBackgroundMode( Qt::BGMode mode ) { } -void WMFImportParser::setRasterOp( Qt::RasterOp ) { +void WMFImportParser::setRasterOp( TQt::RasterOp ) { } @@ -135,15 +135,15 @@ void WMFImportParser::setWindowExt( int width, int height ) { } -void WMFImportParser::setWorldMatrix( const QWMatrix &, bool ) { +void WMFImportParser::setWorldMatrix( const TQWMatrix &, bool ) { } -void WMFImportParser::setClipRegion( const QRegion & ) { +void WMFImportParser::setClipRegion( const TQRegion & ) { } -QRegion WMFImportParser::clipRegion() { +TQRegion WMFImportParser::clipRegion() { return mClippingRegion; } @@ -241,7 +241,7 @@ void WMFImportParser::drawChord( int x, int y, int w, int h, int aStart, int aLe } -void WMFImportParser::drawPolyline( const QPointArray &pa ) { +void WMFImportParser::drawPolyline( const TQPointArray &pa ) { VPath *polyline = new VPath( mDoc ); appendPen( *polyline ); appendPoints( *polyline, pa ); @@ -250,7 +250,7 @@ void WMFImportParser::drawPolyline( const QPointArray &pa ) { } -void WMFImportParser::drawPolygon( const QPointArray &pa, bool ) { +void WMFImportParser::drawPolygon( const TQPointArray &pa, bool ) { VPath *polygon = new VPath( mDoc ); appendPen( *polygon ); appendBrush( *polygon ); @@ -261,7 +261,7 @@ void WMFImportParser::drawPolygon( const QPointArray &pa, bool ) { } -void WMFImportParser::drawPolyPolygon( QPtrList<QPointArray>& listPa, bool ) { +void WMFImportParser::drawPolyPolygon( TQPtrList<TQPointArray>& listPa, bool ) { VPath *path = new VPath( mDoc ); if ( listPa.count() > 0 ) { @@ -282,10 +282,10 @@ void WMFImportParser::drawPolyPolygon( QPtrList<QPointArray>& listPa, bool ) { } -void WMFImportParser::drawImage( int , int , const QImage &, int , int , int , int ) {} +void WMFImportParser::drawImage( int , int , const TQImage &, int , int , int , int ) {} -void WMFImportParser::drawText( int , int , int , int , int , const QString& , double ) {} +void WMFImportParser::drawText( int , int , int , int , int , const TQString& , double ) {} //----------------------------------------------------------------------------- @@ -296,30 +296,30 @@ void WMFImportParser::appendPen( VObject& obj ) VStroke stroke( mDoc ); stroke.setLineCap( VStroke::capRound ); - if ( mPen.style() == Qt::NoPen ) { + if ( mPen.style() == TQt::NoPen ) { stroke.setType( VStroke::none ); } else { - QValueList<float> dashes; + TQValueList<float> dashes; stroke.setType( VStroke::solid ); switch ( mPen.style() ) { - case Qt::DashLine : + case TQt::DashLine : stroke.dashPattern().setArray( dashes << MM_TO_POINT(3) << MM_TO_POINT(2) ); break; - case Qt::DotLine : + case TQt::DotLine : stroke.dashPattern().setArray( dashes << MM_TO_POINT(1) << MM_TO_POINT(1) ); break; - case Qt::DashDotLine : + case TQt::DashDotLine : stroke.dashPattern().setArray( dashes << MM_TO_POINT(3) << MM_TO_POINT(1) << MM_TO_POINT(1) << MM_TO_POINT(1) ); break; - case Qt::DashDotDotLine : + case TQt::DashDotDotLine : stroke.dashPattern().setArray( dashes << MM_TO_POINT(3) << MM_TO_POINT(1) << MM_TO_POINT(1) << MM_TO_POINT(1) << MM_TO_POINT(1) << MM_TO_POINT(1) ); break; default: break; } } - stroke.setColor( mPen.color() ); + stroke.setColor( TQColor(mPen.color()) ); double width = mPen.width() * mScaleX; stroke.setLineWidth( ((width < 0.99) ? 1 : width) ); obj.setStroke( stroke ); @@ -329,23 +329,23 @@ void WMFImportParser::appendPen( VObject& obj ) void WMFImportParser::appendBrush( VObject& obj ) { VFill fill( mBackgroundColor ); - fill.setColor( mBrush.color() ); + fill.setColor( TQColor(mBrush.color()) ); switch ( mBrush.style() ) { - case Qt::NoBrush : + case TQt::NoBrush : fill.setType( VFill::none ); break; - case Qt::SolidPattern : + case TQt::SolidPattern : fill.setType( VFill::solid ); break; - case Qt::CustomPattern : + case TQt::CustomPattern : // TODO: bitmap pattern brush fill.setType( VFill::solid ); //fill.pattern(). break; default : // TODO: pattern brush - if ( mBackgroundMode == Qt::OpaqueMode ) { + if ( mBackgroundMode == TQt::OpaqueMode ) { fill.setColor( mBackgroundColor ); fill.setType( VFill::solid ); } @@ -358,7 +358,7 @@ void WMFImportParser::appendBrush( VObject& obj ) } -void WMFImportParser::appendPoints(VPath &path, const QPointArray& pa) +void WMFImportParser::appendPoints(VPath &path, const TQPointArray& pa) { // list of point array if ( pa.size() > 0 ) { diff --git a/filters/karbon/wmf/wmfimportparser.h b/filters/karbon/wmf/wmfimportparser.h index fcb1fbe2..4e904d7f 100644 --- a/filters/karbon/wmf/wmfimportparser.h +++ b/filters/karbon/wmf/wmfimportparser.h @@ -18,8 +18,8 @@ #ifndef _WMFIMPORTPARSER_H_ #define _WMFIMPORTPARSER_H_ -#include <qpainter.h> -#include <qdom.h> +#include <tqpainter.h> +#include <tqdom.h> #include <core/vdocument.h> #include <core/vcomposite.h> #include <kowmfread.h> @@ -45,23 +45,23 @@ public: private: // ------------------------------------------------------------------------- - // A virtual QPainter + // A virtual TQPainter bool begin(); bool end(); void save(); void restore(); // Drawing tools - void setFont( const QFont &font ); + void setFont( const TQFont &font ); // the pen : the width of the pen is in logical coordinate - void setPen( const QPen &pen ); - const QPen &pen() const; - void setBrush( const QBrush &brush ); + void setPen( const TQPen &pen ); + const TQPen &pen() const; + void setBrush( const TQBrush &brush ); // Drawing attributes/modes - void setBackgroundColor( const QColor &c ); + void setBackgroundColor( const TQColor &c ); void setBackgroundMode( Qt::BGMode mode ); - void setRasterOp( Qt::RasterOp op ); + void setRasterOp( TQt::RasterOp op ); /** * Change logical Coordinate @@ -75,8 +75,8 @@ private: // Clipping // the 'CoordinateMode' is ommitted : always CoordPainter in wmf // setClipRegion() is often used with save() and restore() => implement all or none - void setClipRegion( const QRegion &rec ); - QRegion clipRegion(); + void setClipRegion( const TQRegion &rec ); + TQRegion clipRegion(); // Graphics drawing functions void moveTo( int x, int y ); @@ -87,29 +87,29 @@ private: void drawArc( int x, int y, int w, int h, int a, int alen ); void drawPie( int x, int y, int w, int h, int a, int alen ); void drawChord( int x, int y, int w, int h, int a, int alen ); - void drawPolyline( const QPointArray &pa ); - void drawPolygon( const QPointArray &pa, bool winding=FALSE ); + void drawPolyline( const TQPointArray &pa ); + void drawPolygon( const TQPointArray &pa, bool winding=FALSE ); /** * drawPolyPolygon draw the XOR of a list of polygons * listPa : list of polygons */ - void drawPolyPolygon( QPtrList<QPointArray>& listPa, bool winding=FALSE ); - void drawImage( int x, int y, const QImage &, int sx = 0, int sy = 0, int sw = -1, int sh = -1 ); + void drawPolyPolygon( TQPtrList<TQPointArray>& listPa, bool winding=FALSE ); + void drawImage( int x, int y, const TQImage &, int sx = 0, int sy = 0, int sw = -1, int sh = -1 ); // Text drawing // rotation = the degrees of rotation in counterclockwise // not yet implemented in KWinMetaFile - void drawText( int x, int y, int w, int h, int flags, const QString &s, double rotation ); + void drawText( int x, int y, int w, int h, int flags, const TQString &s, double rotation ); // matrix transformation : only used in some bitmap manipulation - void setWorldMatrix( const QWMatrix &, bool combine=FALSE ); + void setWorldMatrix( const TQWMatrix &, bool combine=FALSE ); //----------------------------------------------------------------------------- // Utilities // Add pen, brush and points to a path void appendPen( VObject& obj ); void appendBrush( VObject& obj ); - void appendPoints(VPath& path, const QPointArray& pa); + void appendPoints(VPath& path, const TQPointArray& pa); // coordinate transformation // translate wmf to (0,0) -> scale to document size -> translate to karbon (0,0) // Wmf origin is (left,top) corner @@ -125,17 +125,17 @@ private: private: VDocument *mDoc; - QRegion mClippingRegion; - QPen mPen; - QBrush mBrush; + TQRegion mClippingRegion; + TQPen mPen; + TQBrush mBrush; Qt::BGMode mBackgroundMode; - QColor mBackgroundColor; + TQColor mBackgroundColor; // current origin of WMF logical coordinate - QPoint mCurrentOrg; + TQPoint mCurrentOrg; double mScaleX; double mScaleY; // current position in WMF coordinate (INT16) - QPoint mCurrentPoint; + TQPoint mCurrentPoint; }; #endif diff --git a/filters/karbon/xaml/color.h b/filters/karbon/xaml/color.h index bfdc93c6..49bc2e52 100644 --- a/filters/karbon/xaml/color.h +++ b/filters/karbon/xaml/color.h @@ -6,7 +6,7 @@ g = green; \ } -void keywordToRGB( QString rgbColor, int &r, int &g, int &b ) +void keywordToRGB( TQString rgbColor, int &r, int &g, int &b ) { if( rgbColor == "aliceblue" ) TORGB( 240, 248, 255) @@ -206,7 +206,7 @@ void keywordToRGB( QString rgbColor, int &r, int &g, int &b ) TORGB( 245, 255, 250 ) else if( rgbColor == "mistyrose" ) TORGB( 255, 228, 225 ) - else if( rgbColor == "moccasin" ) + else if( rgbColor == "tqmoccasin" ) TORGB( 255, 228, 181 ) else if( rgbColor == "navajowhite" ) TORGB( 255, 222, 173 ) diff --git a/filters/karbon/xaml/xamlexport.cc b/filters/karbon/xaml/xamlexport.cc index c4ccb467..09dda268 100644 --- a/filters/karbon/xaml/xamlexport.cc +++ b/filters/karbon/xaml/xamlexport.cc @@ -20,11 +20,11 @@ // based on the SVG exporter. Not intended for public release // Microsoft WVG renamed to XAML Graphics. Worry about that later. -#include <qcstring.h> -#include <qdom.h> -#include <qfile.h> -#include <qstring.h> -#include <qvaluelist.h> +#include <tqcstring.h> +#include <tqdom.h> +#include <tqfile.h> +#include <tqstring.h> +#include <tqvaluelist.h> #include <kgenericfactory.h> #include <KoFilter.h> @@ -54,14 +54,14 @@ typedef KGenericFactory<XAMLExport, KoFilter> XAMLExportFactory; K_EXPORT_COMPONENT_FACTORY( libkarbonxamlexport, XAMLExportFactory( "kofficefilters" ) ) -XAMLExport::XAMLExport( KoFilter*, const char*, const QStringList& ) +XAMLExport::XAMLExport( KoFilter*, const char*, const TQStringList& ) : KoFilter() { m_gc.setAutoDelete( true ); } -KoFilter::ConversionStatus -XAMLExport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus +XAMLExport::convert( const TQCString& from, const TQCString& to ) { // TODO: ??? if ( to != "image/wvg+xml" || from != "application/x-karbon" ) @@ -73,22 +73,22 @@ XAMLExport::convert( const QCString& from, const QCString& to ) if( !storeIn ) return KoFilter::StupidError; - QFile fileOut( m_chain->outputFile() ); + TQFile fileOut( m_chain->outputFile() ); if( !fileOut.open( IO_WriteOnly ) ) { delete storeIn; return KoFilter::StupidError; } - QDomDocument domIn; + TQDomDocument domIn; domIn.setContent( storeIn ); - QDomElement docNode = domIn.documentElement(); + TQDomElement docNode = domIn.documentElement(); - m_stream = new QTextStream( &fileOut ); - QString body; - m_body = new QTextStream( &body, IO_ReadWrite ); - QString defs; - m_defs = new QTextStream( &defs, IO_ReadWrite ); + m_stream = new TQTextStream( &fileOut ); + TQString body; + m_body = new TQTextStream( &body, IO_ReadWrite ); + TQString defs; + m_defs = new TQTextStream( &defs, IO_ReadWrite ); // load the document and export it: @@ -157,12 +157,12 @@ XAMLExport::visitVDocument( VDocument& document ) *m_body << "</Canvas>" << endl; } -QString +TQString XAMLExport::getID( VObject *obj ) { if( obj && !obj->name().isEmpty() ) - return QString( " Name=\"%1\"" ).arg( obj->name() ); - return QString(); + return TQString( " Name=\"%1\"" ).tqarg( obj->name() ); + return TQString(); } // which markup to use? Group or Canvas? @@ -185,7 +185,7 @@ XAMLExport::visitVPath( VPath& composite ) getFill( *( composite.fill() ) ); getStroke( *( composite.stroke() ) ); - QString d; + TQString d; composite.saveSvgPath( d ); *m_body << " Data=\"" << d << "\" "; @@ -205,22 +205,22 @@ XAMLExport::visitVSubpath( VSubpath& ) { } -QString createUID() +TQString createUID() { static unsigned int nr = 0; - return "defitem" + QString().setNum( nr++ ); + return "defitem" + TQString().setNum( nr++ ); } void -XAMLExport::getColorStops( const QPtrVector<VColorStop> &colorStops ) +XAMLExport::getColorStops( const TQPtrVector<VColorStop> &colorStops ) { for( unsigned int i = 0; i < colorStops.count() ; i++ ) { *m_defs << "<GradientStop Color=\""; getHexColor( m_defs, colorStops.at( i )->color ); - *m_defs << "\" Offset=\"" << QString().setNum( colorStops.at( i )->rampPoint ); - // XAML uses ARGB values and other methods such as masks for Transparency/Opacity # aa rrggbb + *m_defs << "\" Offset=\"" << TQString().setNum( colorStops.at( i )->rampPoint ); + // XAML uses ARGB values and other methods such as tqmasks for Transparency/Opacity # aa rrggbb // *m_defs << "\" stop-opacity=\"" << colorStops.at( i )->color.opacity() << "\"" << " />" << endl; // Maybe this only applies to gradients, need to check. } @@ -229,7 +229,7 @@ XAMLExport::getColorStops( const QPtrVector<VColorStop> &colorStops ) void XAMLExport::getGradient( const VGradient& grad ) { - QString uid = createUID(); + TQString uid = createUID(); if( grad.type() == VGradient::linear ) { // do linear grad @@ -262,7 +262,7 @@ XAMLExport::getGradient( const VGradient& grad ) *m_defs << "GradientOrigin=\"" << grad.focalPoint().x() << ","; *m_defs << grad.focalPoint().y() << "\" "; double r = sqrt( pow( grad.vector().x() - grad.origin().x(), 2 ) + pow( grad.vector().y() - grad.origin().y(), 2 ) ); - *m_defs << "Radius=\"" << QString().setNum( r ) << "\" "; + *m_defs << "Radius=\"" << TQString().setNum( r ) << "\" "; if( grad.repeatMethod() == VGradient::reflect ) *m_defs << "SpreadMethod=\"Reflect\" "; else if( grad.repeatMethod() == VGradient::repeat ) @@ -343,7 +343,7 @@ XAMLExport::getStroke( const VStroke& stroke ) *m_body << " StrokeDashOffset=\"" << stroke.dashPattern().offset() << "\""; *m_body << " StrokeDashArray=\" "; - QValueListConstIterator<float> itr; + TQValueListConstIterator<float> itr; for(itr = stroke.dashPattern().array().begin(); itr != stroke.dashPattern().array().end(); ++itr ) { *m_body << *itr << " "; @@ -353,11 +353,11 @@ XAMLExport::getStroke( const VStroke& stroke ) } void -XAMLExport::getHexColor( QTextStream *stream, const VColor& color ) +XAMLExport::getHexColor( TQTextStream *stream, const VColor& color ) { // Convert the various color-spaces to hex - QString Output; + TQString Output; VColor copy( color ); copy.setColorSpace( VColor::rgb ); diff --git a/filters/karbon/xaml/xamlexport.h b/filters/karbon/xaml/xamlexport.h index 3d2701c6..cb762a8d 100644 --- a/filters/karbon/xaml/xamlexport.h +++ b/filters/karbon/xaml/xamlexport.h @@ -27,9 +27,9 @@ #include "xamlgraphiccontext.h" -#include <qptrstack.h> +#include <tqptrstack.h> -class QTextStream; +class TQTextStream; class VColor; class VPath; class VDocument; @@ -44,12 +44,13 @@ class VText; class XAMLExport : public KoFilter, private VVisitor { Q_OBJECT + TQ_OBJECT public: - XAMLExport( KoFilter* parent, const char* name, const QStringList& ); + XAMLExport( KoFilter* tqparent, const char* name, const TQStringList& ); virtual ~XAMLExport() {} - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); private: virtual void visitVPath( VPath& composite ); @@ -59,17 +60,17 @@ private: //virtual void visitVText( VText& text ); void getStroke( const VStroke& stroke ); - void getColorStops( const QPtrVector<VColorStop> &colorStops ); + void getColorStops( const TQPtrVector<VColorStop> &colorStops ); void getFill( const VFill& fill ); void getGradient( const VGradient& grad ); - void getHexColor( QTextStream *, const VColor& color ); - QString getID( VObject *obj ); + void getHexColor( TQTextStream *, const VColor& color ); + TQString getID( VObject *obj ); - QTextStream* m_stream; - QTextStream* m_defs; - QTextStream* m_body; + TQTextStream* m_stream; + TQTextStream* m_defs; + TQTextStream* m_body; - QPtrStack<XAMLGraphicsContext> m_gc; + TQPtrStack<XAMLGraphicsContext> m_gc; }; #endif diff --git a/filters/karbon/xaml/xamlgraphiccontext.h b/filters/karbon/xaml/xamlgraphiccontext.h index db4a8363..8f298138 100644 --- a/filters/karbon/xaml/xamlgraphiccontext.h +++ b/filters/karbon/xaml/xamlgraphiccontext.h @@ -33,14 +33,14 @@ public: stroke.setLineWidth( 1.0 ); stroke.setLineCap( VStroke::capButt ); stroke.setLineJoin( VStroke::joinMiter ); - fill.setColor( VColor( Qt::black ) ); + fill.setColor( VColor( TQt::black ) ); fillRule = winding; } VFill fill; VFillRule fillRule; VStroke stroke; - QWMatrix matrix; - QFont font; + TQWMatrix matrix; + TQFont font; }; #endif diff --git a/filters/karbon/xaml/xamlimport.cc b/filters/karbon/xaml/xamlimport.cc index 297ff68d..b7f68bbb 100644 --- a/filters/karbon/xaml/xamlimport.cc +++ b/filters/karbon/xaml/xamlimport.cc @@ -24,9 +24,9 @@ #include <kdebug.h> #include <KoUnit.h> #include <KoGlobal.h> -#include <shapes/vellipse.h> -#include <shapes/vrectangle.h> -#include <shapes/vpolygon.h> +#include <tqshapes/vellipse.h> +#include <tqshapes/vrectangle.h> +#include <tqshapes/vpolygon.h> #include <commands/vtransformcmd.h> #include <core/vsegment.h> #include <core/vtext.h> @@ -34,14 +34,14 @@ #include <core/vgroup.h> #include <core/vimage.h> #include <core/vlayer.h> -#include <qcolor.h> -#include <qfile.h> +#include <tqcolor.h> +#include <tqfile.h> #include <kfilterdev.h> typedef KGenericFactory<XAMLImport, KoFilter> XAMLImportFactory; K_EXPORT_COMPONENT_FACTORY( libkarbonxamlimport, XAMLImportFactory( "kofficefilters" ) ) -XAMLImport::XAMLImport(KoFilter *, const char *, const QStringList&) : +XAMLImport::XAMLImport(KoFilter *, const char *, const TQStringList&) : KoFilter(), outdoc( "DOC" ) { @@ -52,22 +52,22 @@ XAMLImport::~XAMLImport() { } -KoFilter::ConversionStatus XAMLImport::convert(const QCString& from, const QCString& to) +KoFilter::ConversiontqStatus XAMLImport::convert(const TQCString& from, const TQCString& to) { // check for proper conversion if( to != "application/x-karbon" || from != "image/wvg+xml" ) return KoFilter::NotImplemented; //Find the last extension - QString strExt; - QString fileIn ( m_chain->inputFile() ); - const int result=fileIn.findRev('.'); + TQString strExt; + TQString fileIn ( m_chain->inputFile() ); + const int result=fileIn.tqfindRev('.'); if (result>=0) { strExt=fileIn.mid(result).lower(); } - QString strMime; // Mime type of the compressor + TQString strMime; // Mime type of the compressor if ((strExt==".gz") //in case of .svg.gz (logical extension) ||(strExt==".wvgz")) //in case of .svgz (extension used prioritary) strMime="application/x-gzip"; // Compressed with gzip @@ -78,7 +78,7 @@ KoFilter::ConversionStatus XAMLImport::convert(const QCString& from, const QCStr kdDebug(30514) << "File extension: -" << strExt << "- Compression: " << strMime << endl; - QIODevice* in = KFilterDev::deviceForFile(fileIn,strMime); + TQIODevice* in = KFilterDev::deviceForFile(fileIn,strMime); if (!in->open(IO_ReadOnly)) { @@ -88,7 +88,7 @@ KoFilter::ConversionStatus XAMLImport::convert(const QCString& from, const QCStr } int line, col; - QString errormessage; + TQString errormessage; const bool parsed=inpdoc.setContent( in, &errormessage, &line, &col ); in->close(); delete in; @@ -110,7 +110,7 @@ KoFilter::ConversionStatus XAMLImport::convert(const QCString& from, const QCStr kdError(30514) << "Unable to open output file!" << endl; return KoFilter::StorageCreationError; } - QCString cstring = outdoc.toCString(); // utf-8 already + TQCString cstring = outdoc.toCString(); // utf-8 already out->writeBlock( cstring.data(), cstring.length() ); return KoFilter::OK; // was successful @@ -120,7 +120,7 @@ void XAMLImport::convert() { XAMLGraphicsContext *gc = new XAMLGraphicsContext; - QDomElement docElem = inpdoc.documentElement(); + TQDomElement docElem = inpdoc.documentElement(); KoRect bbox( 0, 0, 550.0, 841.0 ); double width = !docElem.attribute( "width" ).isEmpty() ? parseUnit( docElem.attribute( "width" ), true, false, bbox ) : 550.0; double height = !docElem.attribute( "height" ).isEmpty() ? parseUnit( docElem.attribute( "height" ), false, true, bbox ) : 841.0; @@ -132,8 +132,8 @@ XAMLImport::convert() if( !docElem.attribute( "viewBox" ).isEmpty() ) { // allow for viewbox def with ',' or whitespace - QString viewbox( docElem.attribute( "viewBox" ) ); - QStringList points = QStringList::split( ' ', viewbox.replace( ',', ' ').simplifyWhiteSpace() ); + TQString viewbox( docElem.attribute( "viewBox" ) ); + TQStringList points = TQStringList::split( ' ', viewbox.tqreplace( ',', ' ').simplifyWhiteSpace() ); gc->matrix.scale( width / points[2].toFloat() , height / points[3].toFloat() ); m_outerRect.setWidth( m_outerRect.width() * ( points[2].toFloat() / width ) ); @@ -142,7 +142,7 @@ XAMLImport::convert() m_gc.push( gc ); parseGroup( 0L, docElem ); - QWMatrix mat; + TQWMatrix mat; mat.scale( 1, -1 ); mat.translate( 0, -m_document.height() ); VTransformCmd trafo( 0L, mat ); @@ -153,7 +153,7 @@ XAMLImport::convert() #define DPI 90 double -XAMLImport::toPercentage( QString s ) +XAMLImport::toPercentage( TQString s ) { if( s.endsWith( "%" ) ) return s.remove( '%' ).toDouble(); @@ -162,7 +162,7 @@ XAMLImport::toPercentage( QString s ) } double -XAMLImport::fromPercentage( QString s ) +XAMLImport::fromPercentage( TQString s ) { if( s.endsWith( "%" ) ) return s.remove( '%' ).toDouble() / 100.0; @@ -233,7 +233,7 @@ getNumber( const char *ptr, double &number ) double -XAMLImport::parseUnit( const QString &unit, bool horiz, bool vert, KoRect bbox ) +XAMLImport::parseUnit( const TQString &unit, bool horiz, bool vert, KoRect bbox ) { // TODO : percentage? double value = 0; @@ -284,50 +284,50 @@ XAMLImport::parseUnit( const QString &unit, bool horiz, bool vert, KoRect bbox ) return value; } -QColor -XAMLImport::parseColor( const QString &rgbColor ) +TQColor +XAMLImport::parseColor( const TQString &rgbColor ) { int r, g, b; keywordToRGB( rgbColor, r, g, b ); - return QColor( r, g, b ); + return TQColor( r, g, b ); } void -XAMLImport::parseColor( VColor &color, const QString &s ) +XAMLImport::parseColor( VColor &color, const TQString &s ) { if( s.startsWith( "rgb(" ) ) { - QString parse = s.stripWhiteSpace(); - QStringList colors = QStringList::split( ',', parse ); - QString r = colors[0].right( ( colors[0].length() - 4 ) ); - QString g = colors[1]; - QString b = colors[2].left( ( colors[2].length() - 1 ) ); + TQString parse = s.stripWhiteSpace(); + TQStringList colors = TQStringList::split( ',', parse ); + TQString r = colors[0].right( ( colors[0].length() - 4 ) ); + TQString g = colors[1]; + TQString b = colors[2].left( ( colors[2].length() - 1 ) ); - if( r.contains( "%" ) ) + if( r.tqcontains( "%" ) ) { r = r.left( r.length() - 1 ); - r = QString::number( int( ( double( 255 * r.toDouble() ) / 100.0 ) ) ); + r = TQString::number( int( ( double( 255 * r.toDouble() ) / 100.0 ) ) ); } - if( g.contains( "%" ) ) + if( g.tqcontains( "%" ) ) { g = g.left( g.length() - 1 ); - g = QString::number( int( ( double( 255 * g.toDouble() ) / 100.0 ) ) ); + g = TQString::number( int( ( double( 255 * g.toDouble() ) / 100.0 ) ) ); } - if( b.contains( "%" ) ) + if( b.tqcontains( "%" ) ) { b = b.left( b.length() - 1 ); - b = QString::number( int( ( double( 255 * b.toDouble() ) / 100.0 ) ) ); + b = TQString::number( int( ( double( 255 * b.toDouble() ) / 100.0 ) ) ); } - QColor c( r.toInt(), g.toInt(), b.toInt() ); + TQColor c( r.toInt(), g.toInt(), b.toInt() ); color.set( c.red() / 255.0, c.green() / 255.0, c.blue() / 255.0 ); } else { - QString rgbColor = s.stripWhiteSpace(); - QColor c; + TQString rgbColor = s.stripWhiteSpace(); + TQColor c; if( rgbColor.startsWith( "#" ) ) c.setNamedColor( rgbColor ); else @@ -337,17 +337,17 @@ XAMLImport::parseColor( VColor &color, const QString &s ) } void -XAMLImport::parseColorStops( VGradient *gradient, const QDomElement &e ) +XAMLImport::parseColorStops( VGradient *gradient, const TQDomElement &e ) { VColor c; - for( QDomNode n = e.firstChild(); !n.isNull(); n = n.nextSibling() ) + for( TQDomNode n = e.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement stop = n.toElement(); + TQDomElement stop = n.toElement(); if( stop.tagName() == "stop" ) { float offset; - QString temp = stop.attribute( "offset" ); - if( temp.contains( '%' ) ) + TQString temp = stop.attribute( "offset" ); + if( temp.tqcontains( '%' ) ) { temp = temp.left( temp.length() - 1 ); offset = temp.toFloat() / 100.0; @@ -360,13 +360,13 @@ XAMLImport::parseColorStops( VGradient *gradient, const QDomElement &e ) else { // try style attr - QString style = stop.attribute( "style" ).simplifyWhiteSpace(); - QStringList substyles = QStringList::split( ';', style ); - for( QStringList::Iterator it = substyles.begin(); it != substyles.end(); ++it ) + TQString style = stop.attribute( "style" ).simplifyWhiteSpace(); + TQStringList substyles = TQStringList::split( ';', style ); + for( TQStringList::Iterator it = substyles.begin(); it != substyles.end(); ++it ) { - QStringList substyle = QStringList::split( ':', (*it) ); - QString command = substyle[0].stripWhiteSpace(); - QString params = substyle[1].stripWhiteSpace(); + TQStringList substyle = TQStringList::split( ':', (*it) ); + TQString command = substyle[0].stripWhiteSpace(); + TQString params = substyle[1].stripWhiteSpace(); if( command == "stop-color" ) parseColor( c, params ); if( command == "stop-opacity" ) @@ -382,13 +382,13 @@ XAMLImport::parseColorStops( VGradient *gradient, const QDomElement &e ) } void -XAMLImport::parseGradient( const QDomElement &e ) +XAMLImport::parseGradient( const TQDomElement &e ) { GradientHelper gradhelper; gradhelper.gradient.clearStops(); gradhelper.gradient.setRepeatMethod( VGradient::none ); - QString href = e.attribute( "xlink:href" ).mid( 1 ); + TQString href = e.attribute( "xlink:href" ).mid( 1 ); if( !href.isEmpty() ) { //kdDebug() << "Indexing with href : " << href.latin1() << endl; @@ -428,7 +428,7 @@ XAMLImport::parseGradient( const QDomElement &e ) gradhelper.gradient.setType( VGradient::radial ); } // handle spread method - QString spreadMethod = e.attribute( "spreadMethod" ); + TQString spreadMethod = e.attribute( "spreadMethod" ); if( !spreadMethod.isEmpty() ) { if( spreadMethod == "reflect" ) @@ -443,7 +443,7 @@ XAMLImport::parseGradient( const QDomElement &e ) } void -XAMLImport::parsePA( VObject *obj, XAMLGraphicsContext *gc, const QString &command, const QString ¶ms ) +XAMLImport::parsePA( VObject *obj, XAMLGraphicsContext *gc, const TQString &command, const TQString ¶ms ) { VColor fillcolor = gc->fill.color(); VColor strokecolor = gc->stroke.color(); @@ -454,9 +454,9 @@ XAMLImport::parsePA( VObject *obj, XAMLGraphicsContext *gc, const QString &comma gc->fill.setType( VFill::none ); else if( params.startsWith( "url(" ) ) { - unsigned int start = params.find("#") + 1; - unsigned int end = params.findRev(")"); - QString key = params.mid( start, end - start ); + unsigned int start = params.tqfind("#") + 1; + unsigned int end = params.tqfindRev(")"); + TQString key = params.mid( start, end - start ); gc->fill.gradient() = m_gradients[ key ].gradient; if( m_gradients[ key ].bbox ) { @@ -466,14 +466,14 @@ XAMLImport::parsePA( VObject *obj, XAMLGraphicsContext *gc, const QString &comma //kdDebug() << "!!!!!!bbox y : " << bbox.y() << endl; //kdDebug() << gc->fill.gradient().origin().x() << endl; //kdDebug() << gc->fill.gradient().vector().x() << endl; - double offsetx = parseUnit( QString( "%1%" ).arg( gc->fill.gradient().origin().x() ), true, false, bbox ); - double offsety = parseUnit( QString( "%1%" ).arg( gc->fill.gradient().origin().y() ), false, true, bbox ); + double offsetx = parseUnit( TQString( "%1%" ).tqarg( gc->fill.gradient().origin().x() ), true, false, bbox ); + double offsety = parseUnit( TQString( "%1%" ).tqarg( gc->fill.gradient().origin().y() ), false, true, bbox ); gc->fill.gradient().setOrigin( KoPoint( bbox.x() + offsetx, bbox.y() + offsety ) ); - offsetx = parseUnit( QString( "%1%" ).arg( gc->fill.gradient().focalPoint().x() ), true, false, bbox ); - offsety = parseUnit( QString( "%1%" ).arg( gc->fill.gradient().focalPoint().y() ), false, true, bbox ); + offsetx = parseUnit( TQString( "%1%" ).tqarg( gc->fill.gradient().focalPoint().x() ), true, false, bbox ); + offsety = parseUnit( TQString( "%1%" ).tqarg( gc->fill.gradient().focalPoint().y() ), false, true, bbox ); gc->fill.gradient().setFocalPoint( KoPoint( bbox.x() + offsetx, bbox.y() + offsety ) ); - offsetx = parseUnit( QString( "%1%" ).arg( gc->fill.gradient().vector().x() ), true, false, bbox ); - offsety = parseUnit( QString( "%1%" ).arg( gc->fill.gradient().vector().y() ), false, true, bbox ); + offsetx = parseUnit( TQString( "%1%" ).tqarg( gc->fill.gradient().vector().x() ), true, false, bbox ); + offsety = parseUnit( TQString( "%1%" ).tqarg( gc->fill.gradient().vector().y() ), false, true, bbox ); gc->fill.gradient().setVector( KoPoint( bbox.x() + offsetx, bbox.y() + offsety ) ); //kdDebug() << offsety << endl; //kdDebug() << gc->fill.gradient().origin().x() << endl; @@ -505,9 +505,9 @@ XAMLImport::parsePA( VObject *obj, XAMLGraphicsContext *gc, const QString &comma gc->stroke.setType( VStroke::none ); else if( params.startsWith( "url(" ) ) { - unsigned int start = params.find("#") + 1; - unsigned int end = params.findRev(")"); - QString key = params.mid( start, end - start ); + unsigned int start = params.tqfind("#") + 1; + unsigned int end = params.tqfindRev(")"); + TQString key = params.mid( start, end - start ); gc->stroke.gradient() = m_gradients[ key ].gradient; gc->stroke.gradient().transform( m_gradients[ key ].gradientTransform ); gc->stroke.gradient().transform( gc->matrix ); @@ -543,11 +543,11 @@ XAMLImport::parsePA( VObject *obj, XAMLGraphicsContext *gc, const QString &comma gc->stroke.setMiterLimit( params.toFloat() ); else if( command == "stroke-dasharray" ) { - QValueList<float> array; + TQValueList<float> array; if(params != "none") { - QStringList dashes = QStringList::split( ' ', params ); - for( QStringList::Iterator it = dashes.begin(); it != dashes.end(); ++it ) + TQStringList dashes = TQStringList::split( ' ', params ); + for( TQStringList::Iterator it = dashes.begin(); it != dashes.end(); ++it ) array.append( (*it).toFloat() ); } gc->stroke.dashPattern().setArray( array ); @@ -566,8 +566,8 @@ XAMLImport::parsePA( VObject *obj, XAMLGraphicsContext *gc, const QString &comma } else if( command == "font-family" ) { - QString family = params; - family.replace( '\'' , ' ' ); + TQString family = params; + family.tqreplace( '\'' , ' ' ); gc->font.setFamily( family ); } else if( command == "font-size" ) @@ -600,16 +600,16 @@ XAMLImport::addGraphicContext() } void -XAMLImport::setupTransform( const QDomElement &e ) +XAMLImport::setupTransform( const TQDomElement &e ) { XAMLGraphicsContext *gc = m_gc.current(); - QWMatrix mat = VPath::parseTransform( e.attribute( "transform" ) ); + TQWMatrix mat = VPath::parseTransform( e.attribute( "transform" ) ); gc->matrix = mat * gc->matrix; } void -XAMLImport::parseStyle( VObject *obj, const QDomElement &e ) +XAMLImport::parseStyle( VObject *obj, const TQDomElement &e ) { XAMLGraphicsContext *gc = m_gc.current(); if( !gc ) return; @@ -641,13 +641,13 @@ XAMLImport::parseStyle( VObject *obj, const QDomElement &e ) parsePA( obj, gc, "opacity", e.attribute( "opacity" ) ); // try style attr - QString style = e.attribute( "style" ).simplifyWhiteSpace(); - QStringList substyles = QStringList::split( ';', style ); - for( QStringList::Iterator it = substyles.begin(); it != substyles.end(); ++it ) + TQString style = e.attribute( "style" ).simplifyWhiteSpace(); + TQStringList substyles = TQStringList::split( ';', style ); + for( TQStringList::Iterator it = substyles.begin(); it != substyles.end(); ++it ) { - QStringList substyle = QStringList::split( ':', (*it) ); - QString command = substyle[0].stripWhiteSpace(); - QString params = substyle[1].stripWhiteSpace(); + TQStringList substyle = TQStringList::split( ':', (*it) ); + TQString command = substyle[0].stripWhiteSpace(); + TQString params = substyle[1].stripWhiteSpace(); parsePA( obj, gc, command, params ); } @@ -662,7 +662,7 @@ XAMLImport::parseStyle( VObject *obj, const QDomElement &e ) } void -XAMLImport::parseFont( const QDomElement &e ) +XAMLImport::parseFont( const TQDomElement &e ) { XAMLGraphicsContext *gc = m_gc.current(); if( !gc ) return; @@ -676,15 +676,15 @@ XAMLImport::parseFont( const QDomElement &e ) } void -XAMLImport::parseGroup( VGroup *grp, const QDomElement &e ) +XAMLImport::parseGroup( VGroup *grp, const TQDomElement &e ) { bool isDef = false; if( e.tagName() == "defs" ) isDef = true; - for( QDomNode n = e.firstChild(); !n.isNull(); n = n.nextSibling() ) + for( TQDomNode n = e.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement b = n.toElement(); + TQDomElement b = n.toElement(); if( b.isNull() ) continue; VObject *obj = 0L; if( b.tagName() == "g" ) @@ -749,13 +749,13 @@ XAMLImport::parseGroup( VGroup *grp, const QDomElement &e ) if( !b.attribute( "xlink:href" ).isEmpty() ) { - QString params = b.attribute( "xlink:href" ); - unsigned int start = params.find("#") + 1; - unsigned int end = params.findRev(")"); - QString key = params.mid( start, end - start ); - if(m_paths.contains(key)) + TQString params = b.attribute( "xlink:href" ); + unsigned int start = params.tqfind("#") + 1; + unsigned int end = params.tqfindRev(")"); + TQString key = params.mid( start, end - start ); + if(m_paths.tqcontains(key)) { - QDomElement a = m_paths[key]; + TQDomElement a = m_paths[key]; obj = createObject( a ); m_gc.current()->matrix.translate(tx,ty); parsePA( grp, m_gc.current(), "fill", b.attribute( "fill" ) ); @@ -777,7 +777,7 @@ XAMLImport::parseGroup( VGroup *grp, const QDomElement &e ) } } -VObject* XAMLImport::findObject( const QString &name, VGroup* group ) +VObject* XAMLImport::findObject( const TQString &name, VGroup* group ) { if( ! group ) return 0L; @@ -801,9 +801,9 @@ VObject* XAMLImport::findObject( const QString &name, VGroup* group ) return 0L; } -VObject* XAMLImport::findObject( const QString &name ) +VObject* XAMLImport::findObject( const TQString &name ) { - QPtrVector<VLayer> vector; + TQPtrVector<VLayer> vector; m_document.layers().toVector( &vector ); for( int i = vector.count() - 1; i >= 0; i-- ) { @@ -818,10 +818,10 @@ VObject* XAMLImport::findObject( const QString &name ) return 0L; } -void XAMLImport::createText( VGroup *grp, const QDomElement &b ) +void XAMLImport::createText( VGroup *grp, const TQDomElement &b ) { VText *text = 0L; - QString content; + TQString content; VSubpath base( 0L ); VPath *path = 0L; @@ -841,9 +841,9 @@ void XAMLImport::createText( VGroup *grp, const QDomElement &b ) base.lineTo( KoPoint( x + 10, y ) ); } - for( QDomNode n = b.firstChild(); !n.isNull(); n = n.nextSibling() ) + for( TQDomNode n = b.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if( e.isNull() ) { content += n.toCharacterData().data(); @@ -853,11 +853,11 @@ void XAMLImport::createText( VGroup *grp, const QDomElement &b ) if( e.attribute( "xlink:href" ).isEmpty() ) continue; - QString uri = e.attribute( "xlink:href" ); - unsigned int start = uri.find("#") + 1; - unsigned int end = uri.findRev(")"); - QString key = uri.mid( start, end - start ); - if( ! m_paths.contains(key) ) + TQString uri = e.attribute( "xlink:href" ); + unsigned int start = uri.tqfind("#") + 1; + unsigned int end = uri.tqfindRev(")"); + TQString key = uri.mid( start, end - start ); + if( ! m_paths.tqcontains(key) ) { VObject* obj = findObject( key ); if( obj ) @@ -865,7 +865,7 @@ void XAMLImport::createText( VGroup *grp, const QDomElement &b ) } else { - QDomElement p = m_paths[key]; + TQDomElement p = m_paths[key]; path = dynamic_cast<VPath*>( createObject( p ) ); if( path ) path->setState( VObject::deleted ); @@ -882,8 +882,8 @@ void XAMLImport::createText( VGroup *grp, const QDomElement &b ) content += e.text(); if( base.isEmpty() && ! e.attribute( "x" ).isEmpty() && ! e.attribute( "y" ).isEmpty() ) { - QStringList posX = QStringList::split( ", ", e.attribute( "x" ) ); - QStringList posY = QStringList::split( ", ", e.attribute( "y" ) ); + TQStringList posX = TQStringList::split( ", ", e.attribute( "x" ) ); + TQStringList posY = TQStringList::split( ", ", e.attribute( "y" ) ); if( posX.count() && posY.count() ) { double x = parseUnit( posX.first() ); @@ -898,12 +898,12 @@ void XAMLImport::createText( VGroup *grp, const QDomElement &b ) if( e.attribute( "xlink:href" ).isEmpty() ) continue; - QString uri = e.attribute( "xlink:href" ); - unsigned int start = uri.find("#") + 1; - unsigned int end = uri.findRev(")"); - QString key = uri.mid( start, end - start ); + TQString uri = e.attribute( "xlink:href" ); + unsigned int start = uri.tqfind("#") + 1; + unsigned int end = uri.tqfindRev(")"); + TQString key = uri.mid( start, end - start ); - if( ! m_paths.contains(key) ) + if( ! m_paths.tqcontains(key) ) { VObject* obj = findObject( key ); if( obj ) @@ -911,7 +911,7 @@ void XAMLImport::createText( VGroup *grp, const QDomElement &b ) } else { - QDomElement p = m_paths[key]; + TQDomElement p = m_paths[key]; content += p.text(); } } @@ -948,7 +948,7 @@ void XAMLImport::createText( VGroup *grp, const QDomElement &b ) delete( m_gc.pop() ); } -VObject* XAMLImport::createObject( const QDomElement &b ) +VObject* XAMLImport::createObject( const TQDomElement &b ) { if( b.tagName() == "rect" ) { @@ -999,12 +999,12 @@ VObject* XAMLImport::createObject( const QDomElement &b ) VPath *path = new VPath( &m_document ); bool bFirst = true; - QString points = b.attribute( "points" ).simplifyWhiteSpace(); - points.replace( ',', ' ' ); + TQString points = b.attribute( "points" ).simplifyWhiteSpace(); + points.tqreplace( ',', ' ' ); points.remove( '\r' ); points.remove( '\n' ); - QStringList pointList = QStringList::split( ' ', points ); - for( QStringList::Iterator it = pointList.begin(); it != pointList.end(); ++it) + TQStringList pointList = TQStringList::split( ' ', points ); + for( TQStringList::Iterator it = pointList.begin(); it != pointList.end(); ++it) { KoPoint point; point.setX( (*it).toDouble() ); @@ -1032,7 +1032,7 @@ VObject* XAMLImport::createObject( const QDomElement &b ) { addGraphicContext(); setupTransform( b ); - QString fname = b.attribute("xlink:href"); + TQString fname = b.attribute("xlink:href"); return new VImage( 0L, fname ); } diff --git a/filters/karbon/xaml/xamlimport.h b/filters/karbon/xaml/xamlimport.h index 05763419..83f11fc8 100644 --- a/filters/karbon/xaml/xamlimport.h +++ b/filters/karbon/xaml/xamlimport.h @@ -21,9 +21,9 @@ #define __XAMLIMPORT_H__ #include <KoFilter.h> -#include <qdom.h> -#include <qmap.h> -#include <qptrstack.h> +#include <tqdom.h> +#include <tqmap.h> +#include <tqptrstack.h> #include <core/vdocument.h> #include <core/vgradient.h> #include <core/vfill.h> @@ -37,12 +37,13 @@ class VPath; class XAMLImport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - XAMLImport(KoFilter *parent, const char *name, const QStringList&); + XAMLImport(KoFilter *tqparent, const char *name, const TQStringList&); virtual ~XAMLImport(); - virtual KoFilter::ConversionStatus convert(const QCString& from, const QCString& to); + virtual KoFilter::ConversiontqStatus convert(const TQCString& from, const TQCString& to); protected: class GradientHelper @@ -54,37 +55,37 @@ protected: } VGradient gradient; bool bbox; - QWMatrix gradientTransform; + TQWMatrix gradientTransform; }; - void parseGroup( VGroup *, const QDomElement & ); - void parseStyle( VObject *, const QDomElement & ); - void parsePA( VObject *, XAMLGraphicsContext *, const QString &, const QString & ); - void parseGradient( const QDomElement & ); - void parseColorStops( VGradient *, const QDomElement & ); - double parseUnit( const QString &, bool horiz = false, bool vert = false, KoRect bbox = KoRect() ); - void parseColor( VColor &, const QString & ); - QColor parseColor( const QString & ); - double toPercentage( QString ); - double fromPercentage( QString ); - void setupTransform( const QDomElement & ); + void parseGroup( VGroup *, const TQDomElement & ); + void parseStyle( VObject *, const TQDomElement & ); + void parsePA( VObject *, XAMLGraphicsContext *, const TQString &, const TQString & ); + void parseGradient( const TQDomElement & ); + void parseColorStops( VGradient *, const TQDomElement & ); + double parseUnit( const TQString &, bool horiz = false, bool vert = false, KoRect bbox = KoRect() ); + void parseColor( VColor &, const TQString & ); + TQColor parseColor( const TQString & ); + double toPercentage( TQString ); + double fromPercentage( TQString ); + void setupTransform( const TQDomElement & ); void addGraphicContext(); - QDomDocument inpdoc; - QDomDocument outdoc; + TQDomDocument inpdoc; + TQDomDocument outdoc; void convert(); - VObject* createObject( const QDomElement & ); - void createText( VGroup *, const QDomElement & ); - void parseFont( const QDomElement & ); + VObject* createObject( const TQDomElement & ); + void createText( VGroup *, const TQDomElement & ); + void parseFont( const TQDomElement & ); // find object with given id in document - VObject* findObject( const QString &name ); + VObject* findObject( const TQString &name ); // find object with given id in given group - VObject* findObject( const QString &name, VGroup * ); + VObject* findObject( const TQString &name, VGroup * ); private: VDocument m_document; - QPtrStack<XAMLGraphicsContext> m_gc; - QMap<QString, GradientHelper> m_gradients; - QMap<QString, QDomElement> m_paths; + TQPtrStack<XAMLGraphicsContext> m_gc; + TQMap<TQString, GradientHelper> m_gradients; + TQMap<TQString, TQDomElement> m_paths; KoRect m_outerRect; }; diff --git a/filters/karbon/xcf/xcfexport.cc b/filters/karbon/xcf/xcfexport.cc index fde8bbd5..d5a0c71b 100644 --- a/filters/karbon/xcf/xcfexport.cc +++ b/filters/karbon/xcf/xcfexport.cc @@ -17,12 +17,12 @@ * Boston, MA 02110-1301, USA. */ -#include <qcstring.h> -#include <qdatastream.h> -#include <qdom.h> -#include <qfile.h> -#include <qstring.h> -#include <qvaluelist.h> +#include <tqcstring.h> +#include <tqdatastream.h> +#include <tqdom.h> +#include <tqfile.h> +#include <tqstring.h> +#include <tqvaluelist.h> #include <kgenericfactory.h> #include <KoFilter.h> @@ -45,15 +45,15 @@ typedef KGenericFactory<XcfExport, KoFilter> XcfExportFactory; K_EXPORT_COMPONENT_FACTORY( libkarbonxcfexport, XcfExportFactory( "kofficefilters" ) ) -XcfExport::XcfExport( KoFilter*, const char*, const QStringList& ) +XcfExport::XcfExport( KoFilter*, const char*, const TQStringList& ) : KoFilter() { m_zoomX = 1.0; m_zoomY = 1.0; } -KoFilter::ConversionStatus -XcfExport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus +XcfExport::convert( const TQCString& from, const TQCString& to ) { if( to != "image/x-xcf-gimp" || from != "application/x-karbon" ) { @@ -67,17 +67,17 @@ XcfExport::convert( const QCString& from, const QCString& to ) return KoFilter::StupidError; - QFile fileOut( m_chain->outputFile() ); + TQFile fileOut( m_chain->outputFile() ); if( !fileOut.open( IO_WriteOnly ) ) return KoFilter::StupidError; - QDomDocument domIn; + TQDomDocument domIn; domIn.setContent( storeIn ); - QDomElement docNode = domIn.documentElement(); + TQDomElement docNode = domIn.documentElement(); - m_stream = new QDataStream( &fileOut ); + m_stream = new TQDataStream( &fileOut ); // Load the document. @@ -98,9 +98,9 @@ void XcfExport::visitVDocument( VDocument& document ) { // Offsets. - QIODevice::Offset current = 0; - QIODevice::Offset start = 0; - QIODevice::Offset end = 0; + TQIODevice::Offset current = 0; + TQIODevice::Offset start = 0; + TQIODevice::Offset end = 0; // Save width and height for layer saving. m_width = static_cast<unsigned>( document.width() * m_zoomX ); @@ -111,27 +111,27 @@ XcfExport::visitVDocument( VDocument& document ) m_stream->writeRawBytes( "gimp xcf file", 14 ); // Image width. - *m_stream << static_cast<Q_UINT32>( m_width ); + *m_stream << static_cast<TQ_UINT32>( m_width ); // Image height. - *m_stream << static_cast<Q_UINT32>( m_height ); + *m_stream << static_cast<TQ_UINT32>( m_height ); // Image type = RGB. - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( 0 ); // Do not save any properties currently. *m_stream // "END". - << static_cast<Q_UINT32>( 0 ) + << static_cast<TQ_UINT32>( 0 ) // Property size in bytes. - << static_cast<Q_UINT32>( 0 ); + << static_cast<TQ_UINT32>( 0 ); // Save current offset. - current = m_stream->device()->at(); + current = m_stream->tqdevice()->at(); // Leave space for layer and channel offsets. - m_stream->device()->at( + m_stream->tqdevice()->at( // current position + (number layers + number channels + 2) * 4. current + ( document.layers().count() + 3 + 2 ) * 4 ); @@ -142,7 +142,7 @@ XcfExport::visitVDocument( VDocument& document ) for( ; itr.current(); ++itr ) { // Save start offset. - start = m_stream->device()->at(); + start = m_stream->tqdevice()->at(); // Write layer. @@ -150,142 +150,142 @@ XcfExport::visitVDocument( VDocument& document ) // Save end offset. - end = m_stream->device()->at(); + end = m_stream->tqdevice()->at(); // Return to current offset. - m_stream->device()->at( current ); + m_stream->tqdevice()->at( current ); // Save layer offset. *m_stream << start; // Increment offset. - current = m_stream->device()->at(); + current = m_stream->tqdevice()->at(); // Return to end offset. - m_stream->device()->at( end ); + m_stream->tqdevice()->at( end ); } // Return to current offset. - m_stream->device()->at( current ); + m_stream->tqdevice()->at( current ); // Append a zero offset to indicate end of layer offsets. - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( 0 ); // Return to end offset. - m_stream->device()->at( end ); + m_stream->tqdevice()->at( end ); // Append a zero offset to indicate end of channel offsets. - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( 0 ); } void XcfExport::visitVLayer( VLayer& layer ) { // Layer width = image width. - *m_stream << static_cast<Q_UINT32>( m_width ); + *m_stream << static_cast<TQ_UINT32>( m_width ); // Layer height = image height. - *m_stream << static_cast<Q_UINT32>( m_height ); + *m_stream << static_cast<TQ_UINT32>( m_height ); // Layer type = RGBA. - *m_stream << static_cast<Q_UINT32>( 1 ); + *m_stream << static_cast<TQ_UINT32>( 1 ); // Layer name. *m_stream << layer.name().latin1(); // Layer opacity. - *m_stream << static_cast<Q_UINT32>( 6 ); + *m_stream << static_cast<TQ_UINT32>( 6 ); // Property size in bytes. - *m_stream << static_cast<Q_UINT32>( 4 ); + *m_stream << static_cast<TQ_UINT32>( 4 ); // Fully opaque = 255. - *m_stream << static_cast<Q_UINT32>( 255 ); + *m_stream << static_cast<TQ_UINT32>( 255 ); // Layer visible? - *m_stream << static_cast<Q_UINT32>( 8 ); + *m_stream << static_cast<TQ_UINT32>( 8 ); // Property size in bytes. - *m_stream << static_cast<Q_UINT32>( 4 ); + *m_stream << static_cast<TQ_UINT32>( 4 ); // True. - *m_stream << static_cast<Q_UINT32>( 1 ); + *m_stream << static_cast<TQ_UINT32>( 1 ); // Layer linked? - *m_stream << static_cast<Q_UINT32>( 9 ); + *m_stream << static_cast<TQ_UINT32>( 9 ); // Property size in bytes. - *m_stream << static_cast<Q_UINT32>( 4 ); + *m_stream << static_cast<TQ_UINT32>( 4 ); // False. - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( 0 ); // Preserve transparency? - *m_stream << static_cast<Q_UINT32>( 10 ); + *m_stream << static_cast<TQ_UINT32>( 10 ); // Property size in bytes. - *m_stream << static_cast<Q_UINT32>( 4 ); + *m_stream << static_cast<TQ_UINT32>( 4 ); // False. - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( 0 ); - // Apply mask? - *m_stream << static_cast<Q_UINT32>( 11 ); + // Apply tqmask? + *m_stream << static_cast<TQ_UINT32>( 11 ); // Property size in bytes. - *m_stream << static_cast<Q_UINT32>( 4 ); + *m_stream << static_cast<TQ_UINT32>( 4 ); // False. - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( 0 ); - // Edit mask? - *m_stream << static_cast<Q_UINT32>( 12 ); + // Edit tqmask? + *m_stream << static_cast<TQ_UINT32>( 12 ); // Property size in bytes. - *m_stream << static_cast<Q_UINT32>( 4 ); + *m_stream << static_cast<TQ_UINT32>( 4 ); // False. - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( 0 ); - // Show mask? - *m_stream << static_cast<Q_UINT32>( 13 ); + // Show tqmask? + *m_stream << static_cast<TQ_UINT32>( 13 ); // Property size in bytes. - *m_stream << static_cast<Q_UINT32>( 4 ); + *m_stream << static_cast<TQ_UINT32>( 4 ); // False. - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( 0 ); // Layer offsets. - *m_stream << static_cast<Q_UINT32>( 15 ); + *m_stream << static_cast<TQ_UINT32>( 15 ); // Property size in bytes. - *m_stream << static_cast<Q_UINT32>( 8 ); + *m_stream << static_cast<TQ_UINT32>( 8 ); // X-Offset. - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( 0 ); // Y-Offset. - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( 0 ); // Layer mode. - *m_stream << static_cast<Q_UINT32>( 7 ); + *m_stream << static_cast<TQ_UINT32>( 7 ); // Property size in bytes. - *m_stream << static_cast<Q_UINT32>( 4 ); + *m_stream << static_cast<TQ_UINT32>( 4 ); // Normal mode. - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( 0 ); // TODO: Tattoo. - *m_stream << static_cast<Q_UINT32>( 20 ); + *m_stream << static_cast<TQ_UINT32>( 20 ); // Property size in bytes. - *m_stream << static_cast<Q_UINT32>( 4 ); + *m_stream << static_cast<TQ_UINT32>( 4 ); // False. - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( 0 ); // Layer properties end. - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( 0 ); // Property size in bytes. - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( 0 ); // Offsets. - QIODevice::Offset current = 0; - QIODevice::Offset start = 0; - QIODevice::Offset end = 0; + TQIODevice::Offset current = 0; + TQIODevice::Offset start = 0; + TQIODevice::Offset end = 0; // Save current offset. - current = m_stream->device()->at(); + current = m_stream->tqdevice()->at(); // Leave space for hierarchy offsets. - m_stream->device()->at( current + 8 ); + m_stream->tqdevice()->at( current + 8 ); // Save start offset. - start = m_stream->device()->at(); + start = m_stream->tqdevice()->at(); // Write hierarchy. @@ -293,26 +293,26 @@ XcfExport::visitVLayer( VLayer& layer ) // Save end offset. - end = m_stream->device()->at(); + end = m_stream->tqdevice()->at(); // Return to current offset. - m_stream->device()->at( current ); + m_stream->tqdevice()->at( current ); // Save hierarchy offset. *m_stream << start; - // Append a zero offset to indicate end of layer mask offsets. - *m_stream << static_cast<Q_UINT32>( 0 ); + // Append a zero offset to indicate end of layer tqmask offsets. + *m_stream << static_cast<TQ_UINT32>( 0 ); } void XcfExport::writeHierarchy() { // Offsets. - QIODevice::Offset current = 0; - QIODevice::Offset start = 0; - QIODevice::Offset end = 0; + TQIODevice::Offset current = 0; + TQIODevice::Offset start = 0; + TQIODevice::Offset end = 0; // Width (again?). *m_stream << m_width; @@ -321,27 +321,27 @@ XcfExport::writeHierarchy() *m_stream << m_height; // Color depth. - *m_stream << static_cast<Q_UINT32>( 3 ); + *m_stream << static_cast<TQ_UINT32>( 3 ); // Calculate level number. int levX = levels( m_width, m_tileWidth ); int levY = levels( m_height, m_tileHeight ); - int levels = QMAX( levX, levY ); + int levels = TQMAX( levX, levY ); int width = m_width; int height = m_height; // Save current offset. - current = m_stream->device()->at(); + current = m_stream->tqdevice()->at(); // Leave space for level offsets. - m_stream->device()->at( current + ( levels + 1 ) * 4 ); + m_stream->tqdevice()->at( current + ( levels + 1 ) * 4 ); for( int i = 0; i < levels; ++i ) { // Save start offset. - start = m_stream->device()->at(); + start = m_stream->tqdevice()->at(); if( i == 0 ) { @@ -354,90 +354,90 @@ XcfExport::writeHierarchy() width /= 2; height /= 2; - *m_stream << static_cast<Q_UINT32>( width ); - *m_stream << static_cast<Q_UINT32>( height ); - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( width ); + *m_stream << static_cast<TQ_UINT32>( height ); + *m_stream << static_cast<TQ_UINT32>( 0 ); } // Save end offset. - end = m_stream->device()->at(); + end = m_stream->tqdevice()->at(); // Return to current offset. - m_stream->device()->at( current ); + m_stream->tqdevice()->at( current ); // Save level offset. *m_stream << start; // Increment offset. - current = m_stream->device()->at(); + current = m_stream->tqdevice()->at(); // Return to end offset. - m_stream->device()->at( end ); + m_stream->tqdevice()->at( end ); } // Return to current offset. - m_stream->device()->at( current ); + m_stream->tqdevice()->at( current ); // Append a zero offset to indicate end of level offsets. - *m_stream << static_cast<Q_UINT32>( 0 ); + *m_stream << static_cast<TQ_UINT32>( 0 ); } void XcfExport::writeLevel() { // Offsets. - QIODevice::Offset current = 0; - QIODevice::Offset start = 0; - QIODevice::Offset end = 0; + TQIODevice::Offset current = 0; + TQIODevice::Offset start = 0; + TQIODevice::Offset end = 0; - *m_stream << static_cast<Q_UINT32>( m_width ); - *m_stream << static_cast<Q_UINT32>( m_height ); + *m_stream << static_cast<TQ_UINT32>( m_width ); + *m_stream << static_cast<TQ_UINT32>( m_height ); int rows = ( m_height + m_tileHeight - 1 ) / m_tileHeight; int cols = ( m_width + m_tileWidth - 1 ) / m_tileWidth; int tiles = rows * cols; // Save current offset. - current = m_stream->device()->at(); + current = m_stream->tqdevice()->at(); // Leave space for tile offsets. - m_stream->device()->at( current + ( tiles + 1 ) * 4 ); + m_stream->tqdevice()->at( current + ( tiles + 1 ) * 4 ); for( int i = 0; i < tiles; ++i ) { // Save start offset. - start = m_stream->device()->at(); + start = m_stream->tqdevice()->at(); // TODO: Save tile. - *m_stream << static_cast<Q_UINT8>( 1 ); - *m_stream << static_cast<Q_UINT8>( 1 ); - *m_stream << static_cast<Q_UINT8>( 1 ); - *m_stream << static_cast<Q_UINT8>( 1 ); - *m_stream << static_cast<Q_UINT8>( 1 ); - *m_stream << static_cast<Q_UINT8>( 1 ); - *m_stream << static_cast<Q_UINT8>( 1 ); - *m_stream << static_cast<Q_UINT8>( 1 ); - *m_stream << static_cast<Q_UINT8>( 1 ); - *m_stream << static_cast<Q_UINT8>( 1 ); - *m_stream << static_cast<Q_UINT8>( 1 ); - *m_stream << static_cast<Q_UINT8>( 1 ); + *m_stream << static_cast<TQ_UINT8>( 1 ); + *m_stream << static_cast<TQ_UINT8>( 1 ); + *m_stream << static_cast<TQ_UINT8>( 1 ); + *m_stream << static_cast<TQ_UINT8>( 1 ); + *m_stream << static_cast<TQ_UINT8>( 1 ); + *m_stream << static_cast<TQ_UINT8>( 1 ); + *m_stream << static_cast<TQ_UINT8>( 1 ); + *m_stream << static_cast<TQ_UINT8>( 1 ); + *m_stream << static_cast<TQ_UINT8>( 1 ); + *m_stream << static_cast<TQ_UINT8>( 1 ); + *m_stream << static_cast<TQ_UINT8>( 1 ); + *m_stream << static_cast<TQ_UINT8>( 1 ); // Save end offset. - end = m_stream->device()->at(); + end = m_stream->tqdevice()->at(); // Return to current offset. - m_stream->device()->at( current ); + m_stream->tqdevice()->at( current ); // Save tile offset. *m_stream << start; // Increment offset. - current = m_stream->device()->at(); + current = m_stream->tqdevice()->at(); // Return to end offset. - m_stream->device()->at( end ); + m_stream->tqdevice()->at( end ); } } diff --git a/filters/karbon/xcf/xcfexport.h b/filters/karbon/xcf/xcfexport.h index 92913cb4..0c60dd4e 100644 --- a/filters/karbon/xcf/xcfexport.h +++ b/filters/karbon/xcf/xcfexport.h @@ -26,7 +26,7 @@ #include "vvisitor.h" -class QDataStream; +class TQDataStream; class VDocument; class VLayer; @@ -34,12 +34,13 @@ class VLayer; class XcfExport : public KoFilter, private VVisitor { Q_OBJECT + TQ_OBJECT public: - XcfExport( KoFilter* parent, const char* name, const QStringList& ); + XcfExport( KoFilter* tqparent, const char* name, const TQStringList& ); virtual ~XcfExport() {} - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); virtual void visitVDocument( VDocument& document ); virtual void visitVLayer( VLayer& layer ); @@ -70,7 +71,7 @@ private: /** * Output stream. */ - QDataStream* m_stream; + TQDataStream* m_stream; /** * Image width. diff --git a/filters/karbon/xfig/xfigimport.cc b/filters/karbon/xfig/xfigimport.cc index 06301e01..2932e05c 100644 --- a/filters/karbon/xfig/xfigimport.cc +++ b/filters/karbon/xfig/xfigimport.cc @@ -37,7 +37,7 @@ DESCRIPTION #include <xfigimport.h> #include <xfigimport.moc> -#include <qtl.h> +#include <tqtl.h> #include <kdebug.h> #include <core/vdocument.h> @@ -79,44 +79,44 @@ int arrow_ids[] = { struct PSFont { const char* family; - QFont::Weight weight; + TQFont::Weight weight; bool italic; } psFontTable[] = { - { "times", QFont::Normal, false }, // Times Roman - { "times", QFont::Normal, true }, // Times Italic - { "times", QFont::Bold, false }, // Times Bold - { "times", QFont::Bold, true }, // Times Bold Italic - { "avantgarde", QFont::Normal, false }, // AvantGarde Book - { "avantgarde", QFont::Normal, true }, // AvantGarde Book Oblique - { "avantgarde", QFont::DemiBold, false }, // AvantGarde Demi - { "avantgarde", QFont::DemiBold, true }, // AvantGarde Demi Oblique - { "bookman", QFont::Light, false }, // Bookman Light - { "bookman", QFont::Light, true }, // Bookman Light Italic - { "bookman", QFont::DemiBold, false }, // Bookman Demi - { "bookman", QFont::DemiBold, true }, // Bookman Demi Italic - { "courier", QFont::Normal, false }, // Courier - { "courier", QFont::Normal, true }, // Courier Oblique - { "courier", QFont::Bold, false }, // Courier Bold - { "courier", QFont::Bold, true }, // Courier Bold Oblique - { "helvetica", QFont::Normal, false }, // Helvetica - { "helvetica", QFont::Normal, true }, // Helvetica Oblique - { "helvetica", QFont::Bold, false }, // Helvetica Bold - { "helvetica", QFont::Bold, true }, // Helvetica Bold Oblique - { "helvetica", QFont::Normal, false }, // Helvetica Narrow - { "helvetica", QFont::Normal, true }, // Helvetica Narrow Oblique - { "helvetica", QFont::Bold, false }, // Helvetica Narrow Bold - { "helvetica", QFont::Bold, true }, // Helvetica Narrow Bold Oblique - { "newcenturyschoolbook", QFont::Normal, false },// New Century Schoolbook - { "newcenturyschoolbook", QFont::Normal, true }, // New Century Italic - { "newcenturyschoolbook", QFont::Bold, false }, // New Century Bold - { "newcenturyschoolbook", QFont::Bold, true }, // New Century Bold Italic - { "palatino", QFont::Normal, false }, // Palatino Roman - { "palatino", QFont::Normal, true }, // Palatino Italic - { "palatino", QFont::Bold, false }, // Palatino Bold - { "palatino", QFont::Bold, true }, // Palatino Bold Italic - { "symbol", QFont::Normal, false }, // Symbol - { "zapfchancery", QFont::Normal, false }, // Zapf Chancery Medium Italic - { "zapfdingbats", QFont::Normal, false }, // Zapf Dingbats + { "times", TQFont::Normal, false }, // Times Roman + { "times", TQFont::Normal, true }, // Times Italic + { "times", TQFont::Bold, false }, // Times Bold + { "times", TQFont::Bold, true }, // Times Bold Italic + { "avantgarde", TQFont::Normal, false }, // AvantGarde Book + { "avantgarde", TQFont::Normal, true }, // AvantGarde Book Oblique + { "avantgarde", TQFont::DemiBold, false }, // AvantGarde Demi + { "avantgarde", TQFont::DemiBold, true }, // AvantGarde Demi Oblique + { "bookman", TQFont::Light, false }, // Bookman Light + { "bookman", TQFont::Light, true }, // Bookman Light Italic + { "bookman", TQFont::DemiBold, false }, // Bookman Demi + { "bookman", TQFont::DemiBold, true }, // Bookman Demi Italic + { "courier", TQFont::Normal, false }, // Courier + { "courier", TQFont::Normal, true }, // Courier Oblique + { "courier", TQFont::Bold, false }, // Courier Bold + { "courier", TQFont::Bold, true }, // Courier Bold Oblique + { "helvetica", TQFont::Normal, false }, // Helvetica + { "helvetica", TQFont::Normal, true }, // Helvetica Oblique + { "helvetica", TQFont::Bold, false }, // Helvetica Bold + { "helvetica", TQFont::Bold, true }, // Helvetica Bold Oblique + { "helvetica", TQFont::Normal, false }, // Helvetica Narrow + { "helvetica", TQFont::Normal, true }, // Helvetica Narrow Oblique + { "helvetica", TQFont::Bold, false }, // Helvetica Narrow Bold + { "helvetica", TQFont::Bold, true }, // Helvetica Narrow Bold Oblique + { "newcenturyschoolbook", TQFont::Normal, false },// New Century Schoolbook + { "newcenturyschoolbook", TQFont::Normal, true }, // New Century Italic + { "newcenturyschoolbook", TQFont::Bold, false }, // New Century Bold + { "newcenturyschoolbook", TQFont::Bold, true }, // New Century Bold Italic + { "palatino", TQFont::Normal, false }, // Palatino Roman + { "palatino", TQFont::Normal, true }, // Palatino Italic + { "palatino", TQFont::Bold, false }, // Palatino Bold + { "palatino", TQFont::Bold, true }, // Palatino Bold Italic + { "symbol", TQFont::Normal, false }, // Symbol + { "zapfchancery", TQFont::Normal, false }, // Zapf Chancery Medium Italic + { "zapfdingbats", TQFont::Normal, false }, // Zapf Dingbats }; int hexstrToInt (const char *str) { @@ -134,22 +134,22 @@ int hexstrToInt (const char *str) { return value; } -XFIGImport::XFIGImport( KoFilter *parent, const char *name ) : KoFilter(parent, name) +XFIGImport::XFIGImport( KoFilter *tqparent, const char *name ) : KoFilter(tqparent, name) { fig_resolution = 1200.0 / 72.0; coordinate_system = 2; - colorTable.insert (0, new QColor (Qt::black)); - colorTable.insert (1, new QColor (Qt::blue)); - colorTable.insert (2, new QColor (Qt::green)); - colorTable.insert (3, new QColor (Qt::cyan)); - colorTable.insert (4, new QColor (Qt::red)); - colorTable.insert (5, new QColor (Qt::magenta)); - colorTable.insert (6, new QColor (Qt::yellow)); - colorTable.insert (7, new QColor (Qt::white)); + colorTable.insert (0, new TQColor (TQt::black)); + colorTable.insert (1, new TQColor (TQt::blue)); + colorTable.insert (2, new TQColor (TQt::green)); + colorTable.insert (3, new TQColor (TQt::cyan)); + colorTable.insert (4, new TQColor (TQt::red)); + colorTable.insert (5, new TQColor (TQt::magenta)); + colorTable.insert (6, new TQColor (TQt::yellow)); + colorTable.insert (7, new TQColor (TQt::white)); for (int i = 0; i <= 23; i++) - colorTable.insert (i + 8, new QColor (colors[i])); + colorTable.insert (i + 8, new TQColor (colors[i])); objList.clear (); } @@ -158,16 +158,16 @@ XFIGImport::~XFIGImport() { } -bool XFIGImport::filterImport( const QString &file, KoDocument *doc, - const QString &from, const QString &to, - const QString & ) { +bool XFIGImport::filterImport( const TQString &file, KoDocument *doc, + const TQString &from, const TQString &to, + const TQString & ) { if( to != "application/x-karbon" || from != "image/x-xfig" ) return false; char buf[255]; int value; - KoPageLayout layout; + KoPageLayout tqlayout; ifstream fin( file.local8Bit() ); if (! fin) @@ -177,7 +177,7 @@ bool XFIGImport::filterImport( const QString &file, KoDocument *doc, GDocument *gdoc = kidoc->gdoc(); //GPage *activePage = gdoc->activePage(); - layout = gdoc->activePage()->pageLayout (); + tqlayout = gdoc->activePage()->pageLayout (); fin.getline (buf, 255); if (::strncmp (buf, "#FIG 3", 6)) { @@ -203,9 +203,9 @@ bool XFIGImport::filterImport( const QString &file, KoDocument *doc, // orientation fin.getline (buf, 255); if (::strcmp (buf, "Landscape") == 0) - layout.orientation = PG_LANDSCAPE; + tqlayout.orientation = PG_LANDSCAPE; else if (::strcmp (buf, "Portrait") == 0) - layout.orientation = PG_PORTRAIT; + tqlayout.orientation = PG_PORTRAIT; else kdDebug() << "ERROR: invalid orientation" << endl; @@ -215,9 +215,9 @@ bool XFIGImport::filterImport( const QString &file, KoDocument *doc, // units fin.getline (buf, 255); if (::strcmp (buf, "Metric") == 0) - layout.unit = PG_MM; + tqlayout.unit = PG_MM; else if (::strcmp (buf, "Inches") == 0) - layout.unit = PG_INCH; + tqlayout.unit = PG_INCH; else kdDebug() << "ERROR: invalid units" << endl; @@ -310,7 +310,7 @@ void XFIGImport::parseColorObject (istream& fin) { green = hexstrToInt (green_str); blue = hexstrToInt (blue_str); - colorTable.insert (number, new QColor (red, green, blue)); + colorTable.insert (number, new TQColor (red, green, blue)); } void XFIGImport::parseArc (istream& fin, GDocument* doc) { @@ -473,7 +473,7 @@ void XFIGImport::parsePolyline (istream& fin, GDocument* doc) { int arrow_type, arrow_style; float arrow_thickness, arrow_width, arrow_height; GObject::OutlineInfo oinfo; - oinfo.mask = GObject::OutlineInfo::Custom; + oinfo.tqmask = GObject::OutlineInfo::Custom; oinfo.startArrowId = oinfo.endArrowId = 0; if (forward_arrow > 0) { @@ -537,7 +537,7 @@ void XFIGImport::parseSpline (istream& fin, GDocument* doc) int arrow_type, arrow_style; float arrow_thickness, arrow_width, arrow_height; GObject::OutlineInfo oinfo; - oinfo.mask = GObject::OutlineInfo::Custom; + oinfo.tqmask = GObject::OutlineInfo::Custom; oinfo.startArrowId = oinfo.endArrowId = 0; if (forward_arrow > 0) { @@ -599,8 +599,8 @@ void XFIGImport::parseText (istream& fin, GDocument* doc) char c; char ocode[4]; bool finished = false; - QString text; - QFont qfont; + TQString text; + TQFont qfont; fin >> sub_type >> color >> depth >> pen_style >> font >> font_size >> angle >> font_flags >> height >> length >> x >> y; @@ -609,7 +609,7 @@ void XFIGImport::parseText (istream& fin, GDocument* doc) // PostScript font if (font == -1) font = 0; - qfont = QFont (psFontTable[font].family, qRound (font_size), + qfont = TQFont (psFontTable[font].family, tqRound (font_size), psFontTable[font].weight, psFontTable[font].italic); } else { @@ -634,7 +634,7 @@ void XFIGImport::parseText (istream& fin, GDocument* doc) break; } } - qfont.setPointSize (qRound (font_size)); + qfont.setPointSize (tqRound (font_size)); obj->setFont (qfont); while (! finished) { @@ -670,7 +670,7 @@ void XFIGImport::parseText (istream& fin, GDocument* doc) if (angle != 0) { // rotate the text float nangle = angle * RAD_FACTOR; - QWMatrix m1, m2, m3; + TQWMatrix m1, m2, m3; Coord rotCenter; if (sub_type == 0) { @@ -713,7 +713,7 @@ void XFIGImport::buildDocument (GDocument *doc) { qBubbleSort(objList); // Now all we need to do is insert them in the document, in that order - QValueList<GObjectListItem>::Iterator it=objList.begin(); + TQValueList<GObjectListItem>::Iterator it=objList.begin(); for ( ; it != objList.end() ; ++it ) { //kdDebug() << "Inserting object with depth=" << (*it).depth << endl; @@ -731,11 +731,11 @@ void XFIGImport::setProperties (GObject* obj, int pen_color, int style, obj->setOutlineColor (*colorTable[pen_color]); if (style < 1) - obj->setOutlineStyle (Qt::SolidLine); + obj->setOutlineStyle (TQt::SolidLine); else if (style == 1) - obj->setOutlineStyle (Qt::DashLine); + obj->setOutlineStyle (TQt::DashLine); else if (style == 2) - obj->setOutlineStyle (Qt::DotLine); + obj->setOutlineStyle (TQt::DotLine); obj->setOutlineWidth (thickness * 72.0 / 80.0); @@ -745,13 +745,13 @@ void XFIGImport::setProperties (GObject* obj, int pen_color, int style, obj->setFillStyle (GObject::FillInfo::SolidFill); if (fill_color < 1) { // for BLACK or DEFAULT color - int val = qRound ((20 - area_fill) * 255.0 / 20.0); - obj->setFillColor (QColor (val, val, val)); + int val = tqRound ((20 - area_fill) * 255.0 / 20.0); + obj->setFillColor (TQColor (val, val, val)); } else if (fill_color == 7) { // for WHITE color - int val = qRound ( area_fill * 255.0 / 20.0); - obj->setFillColor (QColor (val, val, val)); + int val = tqRound ( area_fill * 255.0 / 20.0); + obj->setFillColor (TQColor (val, val, val)); } else obj->setFillColor (*colorTable[fill_color]); diff --git a/filters/karbon/xfig/xfigimport.h b/filters/karbon/xfig/xfigimport.h index bf959315..5cf9dddf 100644 --- a/filters/karbon/xfig/xfigimport.h +++ b/filters/karbon/xfig/xfigimport.h @@ -25,29 +25,30 @@ DESCRIPTION #ifndef XFIGIMPORT_H #define XFIGIMPORT_H -#include <qintdict.h> -#include <qvaluelist.h> +#include <tqintdict.h> +#include <tqvaluelist.h> #include <iostream.h> class GDocument; class GObject; -class QColor; +class TQColor; #include <KoFilter.h> -#include <qobject.h> -#include <qstring.h> +#include <tqobject.h> +#include <tqstring.h> class XFIGImport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - XFIGImport( KoFilter *parent, const char *name ); + XFIGImport( KoFilter *tqparent, const char *name ); virtual ~XFIGImport(); - virtual bool filterImport( const QString &file, KoDocument *, - const QString &from, const QString &to, - const QString &config=QString::null ); + virtual bool filterImport( const TQString &file, KoDocument *, + const TQString &from, const TQString &to, + const TQString &config=TQString() ); private: void parseColorObject (istream& fin); @@ -65,13 +66,13 @@ private: float fig_resolution; int coordinate_system; int version; - QIntDict<QColor> colorTable; + TQIntDict<TQColor> colorTable; // An object and the depth. Used for sorting objects // in the object list struct GObjectListItem { - GObjectListItem() : object(0L) {} // for QValueList + GObjectListItem() : object(0L) {} // for TQValueList GObjectListItem( int d, GObject * obj ) : object(obj), depth(d) {} @@ -88,7 +89,7 @@ private: return depth == item.depth; } }; - QValueList<GObjectListItem> objList; + TQValueList<GObjectListItem> objList; }; #endif diff --git a/filters/karbon/xfig/xfigimport_factory.cc b/filters/karbon/xfig/xfigimport_factory.cc index 7783072d..79fb695c 100644 --- a/filters/karbon/xfig/xfigimport_factory.cc +++ b/filters/karbon/xfig/xfigimport_factory.cc @@ -33,9 +33,9 @@ K_EXPORT_COMPONENT_FACTORY( libxfigimport, XFIGImportFactory ) KInstance *XFIGImportFactory::s_global = 0; XFIGImportFactory::XFIGImportFactory( - QObject *parent, + TQObject *tqparent, const char *name) : - KLibFactory(parent, name) + KLibFactory(tqparent, name) { s_global = new KInstance("xfigimport"); } @@ -46,18 +46,18 @@ XFIGImportFactory::~XFIGImportFactory() s_global = 0L; } -QObject *XFIGImportFactory::createObject( - QObject *parent, +TQObject *XFIGImportFactory::createObject( + TQObject *tqparent, const char *name, const char*, - const QStringList &) + const TQStringList &) { - if (parent && !parent->inherits("KoFilter")) + if (tqparent && !tqparent->inherits("KoFilter")) { - kdDebug(30502) << "XFIGImportFactory: parent does not inherit KoFilter" << endl; + kdDebug(30502) << "XFIGImportFactory: tqparent does not inherit KoFilter" << endl; return 0L; } - XFIGImport *f = new XFIGImport((KoFilter*)parent, name); + XFIGImport *f = new XFIGImport((KoFilter*)tqparent, name); return f; } diff --git a/filters/karbon/xfig/xfigimport_factory.h b/filters/karbon/xfig/xfigimport_factory.h index 8da70040..b4fe1bac 100644 --- a/filters/karbon/xfig/xfigimport_factory.h +++ b/filters/karbon/xfig/xfigimport_factory.h @@ -32,11 +32,12 @@ class XFIGImportFactory : public KLibFactory { Q_OBJECT + TQ_OBJECT public: - XFIGImportFactory(QObject* parent = 0, const char* name = 0); + XFIGImportFactory(TQObject* tqparent = 0, const char* name = 0); virtual ~XFIGImportFactory(); - virtual QObject* createObject(QObject* parent = 0, const char* name = 0, const char* classname = "QObject", const QStringList &args = QStringList()); + virtual TQObject* createObject(TQObject* tqparent = 0, const char* name = 0, const char* classname = TQOBJECT_OBJECT_NAME_STRING, const TQStringList &args = TQStringList()); static KInstance* global(); |