diff options
Diffstat (limited to 'lib/kformula')
117 files changed, 3857 insertions, 3846 deletions
diff --git a/lib/kformula/DESIGN b/lib/kformula/DESIGN index a6a7eccb..f060b897 100644 --- a/lib/kformula/DESIGN +++ b/lib/kformula/DESIGN @@ -19,21 +19,21 @@ objects from it. Responsebilities (This goes for every derived element and therefore for each one.) -- knows its children. Actually BasicElement doesn't have any. But it - already defines that children must be known by their parent. -- knows its bounding rectangle (its size.) The children are included - in this rect. (The position is relative to the parent.) -//- knows its middle line. (for alignment) -- knows it's zero point for midline (vertical alignment) and +- knows its tqchildren. Actually BasicElement doesn't have any. But it + already defines that tqchildren must be known by their tqparent. +- knows its bounding rectangle (its size.) The tqchildren are included + in this rect. (The position is relative to the tqparent.) +//- knows its middle line. (for tqalignment) +- knows it's zero point for midline (vertical tqalignment) and keep open the possibility of negative positions (out of bounding rect) -- draws itself (given a painter); children are drawn, too +- draws itself (given a painter); tqchildren are drawn, too - knows all positions where the cursor is allowed to be. (see below) -- knows its parent; The topmost element has no parent; there is a +- knows its tqparent; The topmost element has no tqparent; there is a implicit guaranty that the topmost element is always a SequenceElement. - can save and load itself. different formates. (see below) -- all children must be a SequenceElement. Except for SequenceElement's - children that might be of any type. +- all tqchildren must be a SequenceElement. Except for SequenceElement's + tqchildren that might be of any type. - might have its own color. - might have its own font size (see below). @@ -41,14 +41,14 @@ Responsebilities SequenceElement from BasicElement --------------- -Manages a list of children. The children are aligned horizontally at +Manages a list of tqchildren. The tqchildren are aligned horizontally at one middle line. No gaps, no overlaps. -Has no own look. It just draws all its children and is done. Except if +Has no own look. It just draws all its tqchildren and is done. Except if its empty. It looks like an empty space then (i.e. a little square) Has n+1 valid cursor positions where n is the number of -children. These are before, between and after the children. +tqchildren. These are before, between and after the tqchildren. May contain any (type of) element as child @@ -56,41 +56,41 @@ except SequenceElements if they contains a SequenceElement they merge it in the list They can handle splitting of the sequence to allow "select an put selected item -between parenthesis" i.e. as content child of a delimiterelement) +between tqparenthesis" i.e. as content child of a delimiterelement) FormulaElement from SequenceElement -------------- -The only element those parent is null. The root of the element object +The only element those tqparent is null. The root of the element object tree. This is the element that is created by the KFormulaDoc and that knows -about it. As every other element knows its parent and therefore the +about it. As every other element knows its tqparent and therefore the FormulaElement we get a chance to pass messages to the outside world. RootElement from BasicElement ----------- -contains two children. content and index. index is optional. +contains two tqchildren. content and index. index is optional. IndexElement from BasicElement ------------ -contains five children. content and four indexes. all indexes are +contains five tqchildren. content and four indexes. all indexes are optional. If there is no index the element might be replaced by its content. TextElement from BasicElement ----------- -contains one char and no children at all. +contains one char and no tqchildren at all. Might have its own font and size. But preferes to use a reasonalbe -font and size that are calculated from its parents font and a given +font and size that are calculated from its tqparents font and a given scheme (see below). @@ -104,7 +104,7 @@ choose with. FractionElement from BasicElement --------------- -2 children: numerator, denominator +2 tqchildren: numerator, denominator DecorationElement from BasicElement @@ -121,7 +121,7 @@ the other side of the decoration. SumIntegralElement from BasicElement //PrefixedElement ------------------ -draws all sorts of mathematical symbols with three children. Above, +draws all sorts of mathematical symbols with three tqchildren. Above, below (or whereever the indices and limits go)and to the right. @@ -129,7 +129,7 @@ GeometryElement from BasicElement --------------- One child. -Draw it at a fixed position relative to parent or absolute. +Draw it at a fixed position relative to tqparent or absolute. This is to do dirty things. This element must not be used, kformula will provide you everything @@ -142,7 +142,7 @@ typical of a math formula. MatrixElement from BasicElement ------------- -A matrix of children. +A matrix of tqchildren. With all align stuff, internal borders etc, matrix dots handling (i.e. those dots or lines that complete the matrix, not well handled in TeX), etc.. @@ -150,7 +150,7 @@ etc.. SpaceElement from BasicElement ------------ -No children at all. Provides the facility to insert horizontal spaces +No tqchildren at all. Provides the facility to insert horizontal spaces in the formula. (therefore it is similar to TextElement.) @@ -184,18 +184,18 @@ If the cursor points into an element this element is said to own the cursor. There are a few rules that describe how new cursor positions are calculated given the current key: -- An elements cursor positions are its children. The element might not -own the cursor except when it is owned by one of its children. The +- An elements cursor positions are its tqchildren. The element might not +own the cursor except when it is owned by one of its tqchildren. The only exception is SequenceElement which has valid cursor positions -before, between and after its children, too. +before, between and after its tqchildren, too. (Therefore the cursor is always owned by a SequenceElement.) -- Each element's children are ordered. If the cursor leaves one child +- Each element's tqchildren are ordered. If the cursor leaves one child the next child it. The direction depends on the key that moved the -cursor. If there is child left the cursor is passed to the parent. +cursor. If there is child left the cursor is passed to the tqparent. -- If the cursor comes from our parent the first or the last child gets +- If the cursor comes from our tqparent the first or the last child gets it. Depending on the direction in which the cursor moved. Please note that because each element knows its own cursor positions @@ -344,7 +344,7 @@ We want a formula to look different according to its surroundings. (Most obviosly according to the available height and/or width.) It would be great to get something like automatic operator -alignment. So if you type some formulas each on its own line the +tqalignment. So if you type some formulas each on its own line the assigment operators should be automatically in a column. (If the user turns this on.) @@ -353,7 +353,7 @@ turns this on.) Fonts and font size ################### -Each elements font size is calculated starting from its parents font +Each elements font size is calculated starting from its tqparents font size. It knows how it differs to those. The font size might also be used to choose the pen width and other diff --git a/lib/kformula/MatrixDialog.cc b/lib/kformula/MatrixDialog.cc index 7f8ee9d5..a0536c1d 100644 --- a/lib/kformula/MatrixDialog.cc +++ b/lib/kformula/MatrixDialog.cc @@ -18,11 +18,11 @@ */ #include "MatrixDialog.h" -#include <qpushbutton.h> -#include <qspinbox.h> -#include <qlabel.h> -#include <qcheckbox.h> -#include <qlayout.h> +#include <tqpushbutton.h> +#include <tqspinbox.h> +#include <tqlabel.h> +#include <tqcheckbox.h> +#include <tqlayout.h> #include <klocale.h> KFORMULA_NAMESPACE_BEGIN @@ -30,34 +30,34 @@ KFORMULA_NAMESPACE_BEGIN const int DEFAULT_SIZE = 3; const int MAX_SIZE = 200; -MatrixDialog::MatrixDialog( QWidget *parent, int _width, int _height ) - : KDialogBase(parent, "Matrix Dialog", true,i18n("Add Matrix"),Ok|Cancel) +MatrixDialog::MatrixDialog( TQWidget *tqparent, int _width, int _height ) + : KDialogBase(tqparent, "Matrix Dialog", true,i18n("Add Matrix"),Ok|Cancel) { w = _width; h = _height; - QLabel *rows, *columns; - QWidget *page = new QWidget( this ); + TQLabel *rows, *columns; + TQWidget *page = new TQWidget( this ); setMainWidget(page); - QGridLayout *grid = new QGridLayout(page, 4, 2, 10); + TQGridLayout *grid = new TQGridLayout(page, 4, 2, 10); - rows = new QLabel(i18n("Rows:"), page); - columns = new QLabel(i18n("Columns:"), page); + rows = new TQLabel(i18n("Rows:"), page); + columns = new TQLabel(i18n("Columns:"), page); grid->addWidget(rows, 0, 0); grid->addWidget(columns, 0, 1); - QSpinBox *width, *height; + TQSpinBox *width, *height; - height = new QSpinBox(1, MAX_SIZE, 1, page); + height = new TQSpinBox(1, MAX_SIZE, 1, page); grid->addWidget(height, 1, 0); height->setValue(h); - connect(height, SIGNAL(valueChanged(int)), SLOT(setHeight(int))); + connect(height, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(setHeight(int))); - width = new QSpinBox(1, MAX_SIZE, 1, page); + width = new TQSpinBox(1, MAX_SIZE, 1, page); grid->addWidget(width, 1, 1); width->setValue(w); - connect(width, SIGNAL(valueChanged(int)), SLOT(setWidth(int))); + connect(width, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(setWidth(int))); height->setFocus(); } diff --git a/lib/kformula/MatrixDialog.h b/lib/kformula/MatrixDialog.h index d8b728d3..06688b90 100644 --- a/lib/kformula/MatrixDialog.h +++ b/lib/kformula/MatrixDialog.h @@ -20,9 +20,9 @@ #ifndef MATRIXDIALOG_H_INCLUDED #define MATRIXDIALOG_H_INCLUDED -#include <qwidget.h> +#include <tqwidget.h> #include <kdialogbase.h> -#include <qvalidator.h> +#include <tqvalidator.h> #include "kformuladefs.h" @@ -34,13 +34,14 @@ KFORMULA_NAMESPACE_BEGIN class MatrixDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: int w; int h; - MatrixDialog( QWidget *parent, int width = 3, int height = 3 ); + MatrixDialog( TQWidget *tqparent, int width = 3, int height = 3 ); ~MatrixDialog() {} protected slots: diff --git a/lib/kformula/actionelement.cc b/lib/kformula/actionelement.cc index fdee73a5..5fa5a38e 100644 --- a/lib/kformula/actionelement.cc +++ b/lib/kformula/actionelement.cc @@ -22,19 +22,19 @@ KFORMULA_NAMESPACE_BEGIN -ActionElement::ActionElement( BasicElement* parent ) : SequenceElement( parent ), +ActionElement::ActionElement( BasicElement* tqparent ) : SequenceElement( tqparent ), m_selection( 0 ) { } -bool ActionElement::readAttributesFromMathMLDom(const QDomElement& element) +bool ActionElement::readAttributesFromMathMLDom(const TQDomElement& element) { if ( ! BasicElement::readAttributesFromMathMLDom( element ) ) { return false; } m_actionType = element.attribute( "actiontype" ); - QString selectionStr = element.attribute( "selection" ); + TQString selectionStr = element.attribute( "selection" ); if ( ! selectionStr.isNull() ) { bool ok; m_selection = selectionStr.toUInt( &ok ); @@ -44,12 +44,12 @@ bool ActionElement::readAttributesFromMathMLDom(const QDomElement& element) return true; } -int ActionElement::buildChildrenFromMathMLDom(QPtrList<BasicElement>& list, QDomNode n) +int ActionElement::buildChildrenFromMathMLDom(TQPtrList<BasicElement>& list, TQDomNode n) { if ( ! n.isElement() ) return -1; - QDomElement e = n.toElement(); - QString tag = e.tagName().lower(); + TQDomElement e = n.toElement(); + TQString tag = e.tagName().lower(); BasicElement* child = getCreationStrategy()->createElement( tag, e ); if ( child == 0 ) return -1; @@ -63,13 +63,13 @@ int ActionElement::buildChildrenFromMathMLDom(QPtrList<BasicElement>& list, QDom return 1; } -void ActionElement::writeMathMLAttributes( QDomElement& element ) const +void ActionElement::writeMathMLAttributes( TQDomElement& element ) const { if ( ! m_actionType.isNull() ) { element.setAttribute( "actiontype", m_actionType ); } if ( m_selection ) { - element.setAttribute( "selection", QString( "%1" ).arg( m_selection ) ); + element.setAttribute( "selection", TQString( "%1" ).tqarg( m_selection ) ); } } diff --git a/lib/kformula/actionelement.h b/lib/kformula/actionelement.h index d4a0906b..9c7342d5 100644 --- a/lib/kformula/actionelement.h +++ b/lib/kformula/actionelement.h @@ -32,15 +32,15 @@ KFORMULA_NAMESPACE_BEGIN class ActionElement : public SequenceElement { typedef SequenceElement inherited; public: - ActionElement( BasicElement* parent = 0 ); - virtual int buildChildrenFromMathMLDom(QPtrList<BasicElement>& list, QDomNode n); + ActionElement( BasicElement* tqparent = 0 ); + virtual int buildChildrenFromMathMLDom(TQPtrList<BasicElement>& list, TQDomNode n); private: - virtual bool readAttributesFromMathMLDom(const QDomElement& element); - virtual QString getElementName() const { return "maction"; } - virtual void writeMathMLAttributes( QDomElement& element ) const ; + virtual bool readAttributesFromMathMLDom(const TQDomElement& element); + virtual TQString getElementName() const { return "maction"; } + virtual void writeMathMLAttributes( TQDomElement& element ) const ; - QString m_actionType; + TQString m_actionType; uint m_selection; }; diff --git a/lib/kformula/basicelement.cc b/lib/kformula/basicelement.cc index 82913cec..bbe6f453 100644 --- a/lib/kformula/basicelement.cc +++ b/lib/kformula/basicelement.cc @@ -18,7 +18,7 @@ * Boston, MA 02110-1301, USA. */ -#include <qstring.h> +#include <tqstring.h> #include <kdebug.h> #include "contextstyle.h" @@ -34,7 +34,7 @@ using namespace std; int BasicElement::evilDestructionCount = 0; BasicElement::BasicElement( BasicElement* p ) - : parent( p ), m_baseline( 0 ), elementType( 0 ) + : tqparent( p ), m_baseline( 0 ), elementType( 0 ) { setX( 0 ); setY( 0 ); @@ -49,7 +49,7 @@ BasicElement::~BasicElement() } BasicElement::BasicElement( const BasicElement& other ) - : parent( 0 ), + : tqparent( 0 ), m_baseline( other.m_baseline ), elementType( other.elementType ) { @@ -63,14 +63,14 @@ BasicElement::BasicElement( const BasicElement& other ) bool BasicElement::readOnly( const BasicElement* /*child*/ ) const { - return parent->readOnly( this ); + return tqparent->readOnly( this ); } FormulaElement* BasicElement::formula() { - //if ( parent != 0 ) { - return parent->formula(); + //if ( tqparent != 0 ) { + return tqparent->formula(); //} //return 0; } @@ -80,11 +80,11 @@ FormulaElement* BasicElement::formula() * Returns the element the point is in. */ BasicElement* BasicElement::goToPos( FormulaCursor*, bool&, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ) + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ) { - luPixel x = point.x() - (parentOrigin.x() + getX()); + luPixel x = point.x() - (tqparentOrigin.x() + getX()); if ((x >= 0) && (x < getWidth())) { - luPixel y = point.y() - (parentOrigin.y() + getY()); + luPixel y = point.y() - (tqparentOrigin.y() + getY()); if ((y >= 0) && (y < getHeight())) { return this; } @@ -99,7 +99,7 @@ LuPixelPoint BasicElement::widgetPos() { luPixel x = 0; luPixel y = 0; - for (BasicElement* element = this; element != 0; element = element->parent) { + for (BasicElement* element = this; element != 0; element = element->tqparent) { x += element->getX(); y += element->getY(); } @@ -166,23 +166,23 @@ void BasicElement::normalize(FormulaCursor* cursor, Direction direction) } -QDomElement BasicElement::getElementDom( QDomDocument& doc) +TQDomElement BasicElement::getElementDom( TQDomDocument& doc) { - QDomElement de = doc.createElement(getTagName()); + TQDomElement de = doc.createElement(getTagName()); writeDom(de); return de; } -void BasicElement::writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat ) const +void BasicElement::writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat ) const { - QDomElement de = doc.createElement( oasisFormat ? "math:" + getElementName() : getElementName() ); + TQDomElement de = doc.createElement( oasisFormat ? "math:" + getElementName() : getElementName() ); writeMathMLAttributes( de ); writeMathMLContent( doc, de, oasisFormat ); - parent.appendChild( de ); + tqparent.appendChild( de ); } -bool BasicElement::buildFromDom(QDomElement element) +bool BasicElement::buildFromDom(TQDomElement element) { if (element.tagName() != getTagName()) { kdWarning( DEBUGID ) << "Wrong tag name " << element.tagName().latin1() << " for " << getTagName().latin1() << ".\n"; @@ -191,11 +191,11 @@ bool BasicElement::buildFromDom(QDomElement element) if (!readAttributesFromDom(element)) { return false; } - QDomNode node = element.firstChild(); + TQDomNode node = element.firstChild(); return readContentFromDom(node); } -int BasicElement::buildFromMathMLDom(QDomElement element) +int BasicElement::buildFromMathMLDom(TQDomElement element) {/* if (element.tagName() != getTagName()) { kdWarning( DEBUGID ) << "Wrong tag name " << element.tagName().latin1() << " for " << getTagName().latin1() << ".\n"; @@ -204,14 +204,14 @@ int BasicElement::buildFromMathMLDom(QDomElement element) if (!readAttributesFromMathMLDom(element)) { return -1; } - QDomNode node = element.firstChild(); + TQDomNode node = element.firstChild(); return readContentFromMathMLDom(node); } /** * Appends our attributes to the dom element. */ -void BasicElement::writeDom(QDomElement) +void BasicElement::writeDom(TQDomElement) { } @@ -219,7 +219,7 @@ void BasicElement::writeDom(QDomElement) * Reads our attributes from the element. * Returns false if it failed. */ -bool BasicElement::readAttributesFromDom(QDomElement) +bool BasicElement::readAttributesFromDom(TQDomElement) { return true; } @@ -229,7 +229,7 @@ bool BasicElement::readAttributesFromDom(QDomElement) * that needs to be read. * Returns false if it failed. */ -bool BasicElement::readContentFromDom(QDomNode&) +bool BasicElement::readContentFromDom(TQDomNode&) { return true; } @@ -238,14 +238,14 @@ bool BasicElement::readContentFromDom(QDomNode&) * Returns a SequenceElement constructed from the nodes first child * if the nodes name matches the given name. */ -bool BasicElement::buildChild( SequenceElement* child, QDomNode node, QString name ) +bool BasicElement::buildChild( SequenceElement* child, TQDomNode node, TQString name ) { if (node.isElement()) { - QDomElement e = node.toElement(); + TQDomElement e = node.toElement(); if (e.tagName().upper() == name) { - QDomNode nodeInner = e.firstChild(); + TQDomNode nodeInner = e.firstChild(); if (nodeInner.isElement()) { - QDomElement element = nodeInner.toElement(); + TQDomElement element = nodeInner.toElement(); return child->buildFromDom( element ); } } @@ -257,7 +257,7 @@ bool BasicElement::buildChild( SequenceElement* child, QDomNode node, QString na * Reads our attributes from the MathML element. * Returns false if it failed. */ -bool BasicElement::readAttributesFromMathMLDom(const QDomElement& ) +bool BasicElement::readAttributesFromMathMLDom(const TQDomElement& ) { return true; } @@ -267,12 +267,12 @@ bool BasicElement::readAttributesFromMathMLDom(const QDomElement& ) * that needs to be read. * Returns false if it failed. */ -int BasicElement::readContentFromMathMLDom(QDomNode&) +int BasicElement::readContentFromMathMLDom(TQDomNode&) { return 1; } -QString BasicElement::toLatex() +TQString BasicElement::toLatex() { return "{}"; } @@ -287,41 +287,41 @@ QString BasicElement::toLatex() * @param st size type container. It will be properly assigned to its size * type or NoSize if str is invalid */ -double BasicElement::getSize( const QString& str, SizeType* st ) +double BasicElement::getSize( const TQString& str, SizeType* st ) { - int index = str.find( "%" ); + int index = str.tqfind( "%" ); if ( index != -1 ) { return str2size( str, st, index, RelativeSize ) / 100.0; } - index = str.find( "pt", 0, false ); + index = str.tqfind( "pt", 0, false ); if ( index != -1 ) { return str2size( str, st, index, AbsoluteSize ); } - index = str.find( "mm", 0, false ); + index = str.tqfind( "mm", 0, false ); if ( index != -1 ) { return str2size( str, st, index, AbsoluteSize ) * 72.0 / 20.54; } - index = str.find( "cm", 0, false ); + index = str.tqfind( "cm", 0, false ); if ( index != -1 ) { return str2size( str, st, index, AbsoluteSize ) * 72.0 / 2.54; } - index = str.find( "in", 0, false ); + index = str.tqfind( "in", 0, false ); if ( index != -1 ) { return str2size( str, st, index, AbsoluteSize ) * 72.0; } - index = str.find( "em", 0, false ); + index = str.tqfind( "em", 0, false ); if ( index != -1 ) { return str2size( str, st, index, RelativeSize ); } - index = str.find( "ex", 0, false ); + index = str.tqfind( "ex", 0, false ); if ( index != -1 ) { return str2size( str, st, index, RelativeSize ); } - index = str.find( "pc", 0, false ); + index = str.tqfind( "pc", 0, false ); if ( index != -1 ) { return str2size( str, st, index, AbsoluteSize ) * 12.0; } - index = str.find( "px", 0, false ); + index = str.tqfind( "px", 0, false ); if ( index != -1 ) { return str2size( str, st, index, PixelSize ); } @@ -329,7 +329,7 @@ double BasicElement::getSize( const QString& str, SizeType* st ) return str2size( str, st, str.length(),AbsoluteSize ); } -SizeType BasicElement::getSpace( const QString& str ) +SizeType BasicElement::getSpace( const TQString& str ) { if ( str == "negativeveryverythinmathspace" ) { return NegativeVeryVeryThinMathSpace; @@ -380,9 +380,9 @@ SizeType BasicElement::getSpace( const QString& str ) /** * Used internally by getSize() */ -double BasicElement::str2size( const QString& str, SizeType *st, uint index, SizeType type ) +double BasicElement::str2size( const TQString& str, SizeType *st, uint index, SizeType type ) { - QString num = str.left( index ); + TQString num = str.left( index ); bool ok; double size = num.toDouble( &ok ); if ( ok ) { diff --git a/lib/kformula/basicelement.h b/lib/kformula/basicelement.h index ee9cffe0..d373fc6c 100644 --- a/lib/kformula/basicelement.h +++ b/lib/kformula/basicelement.h @@ -21,10 +21,10 @@ #ifndef BASICELEMENT_H #define BASICELEMENT_H -// Qt Include -#include <qdom.h> -#include <qptrlist.h> -#include <qstring.h> +// TQt Include +#include <tqdom.h> +#include <tqptrlist.h> +#include <tqstring.h> // KDE Include @@ -32,7 +32,7 @@ #include "contextstyle.h" #include "kformuladefs.h" -class QKeyEvent; +class TQKeyEvent; class KCommand; @@ -53,7 +53,7 @@ class StyleElement; * Basis of every formula element. An element is used basically by * other elements and by the @ref FormulaCursor . * - * Each element knows its size (a rect that includes all children) + * Each element knows its size (a rect that includes all tqchildren) * and how to draw itself. See @ref calcSizes and @ref draw . * * An element might contain valid cursor position. If the cursor @@ -63,11 +63,11 @@ class StyleElement; * cursor that tell how it wants to move. See @ref moveLeft , * @ref moveRight , @ref moveUp , @ref moveDown . * - * To build a tree an element must own children. If there are children + * To build a tree an element must own tqchildren. If there are tqchildren * there must be a main child. This is the child that might be used to * replace the element. See @ref getMainChild(). * - * If there can be children you might want to @ref insert and @ref remove + * If there can be tqchildren you might want to @ref insert and @ref remove * them. After a removal the element might be senseless. * (See @ref isSenseless ) * If it is it must be removed. @@ -81,13 +81,13 @@ class BasicElement public: /* - * Each element might contain children. Each child needs + * Each element might contain tqchildren. Each child needs * its own unique number. It is not guaranteed, however, * that the number stays the same all the time. - * (The SequenceElement's children are simply counted.) + * (The SequenceElement's tqchildren are simply counted.) */ - BasicElement(BasicElement* parent = 0); + BasicElement(BasicElement* tqparent = 0); virtual ~BasicElement(); // deep copy @@ -102,7 +102,7 @@ public: /** * @returns whether the child should be read-only. The idea is - * that a read-only parent has read-only children. + * that a read-only tqparent has read-only tqchildren. */ virtual bool readOnly( const BasicElement* child ) const; @@ -114,14 +114,14 @@ public: /** * Provide fast access to the rootElement for each child. */ - virtual const FormulaElement* formula() const { return parent->formula(); } + virtual const FormulaElement* formula() const { return tqparent->formula(); } /** * @returns the character that represents this element. Used for * parsing a sequence. - * This is guaranteed to be QChar::null for all non-text elements. + * This is guaranteed to be TQChar::null for all non-text elements. */ - virtual QChar getCharacter() const { return QChar::null; } + virtual TQChar getCharacter() const { return TQChar::null; } /** * @returns the type of this element. Used for @@ -141,7 +141,7 @@ public: * is allowed to set the cursor. */ virtual BasicElement* goToPos( FormulaCursor*, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ); + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ); /** * Returns our position inside the widget. @@ -158,7 +158,7 @@ public: /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -166,20 +166,20 @@ public: StyleAttributes& style ) = 0; /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ) = 0; + const LuPixelPoint& tqparentOrigin ) = 0; /** - * Dispatch this FontCommand to all our TextElement children. + * Dispatch this FontCommand to all our TextElement tqchildren. */ virtual void dispatchFontCommand( FontCommand* /*cmd*/ ) {} @@ -243,7 +243,7 @@ public: */ virtual void entered( SequenceElement* /*child*/ ); - // children + // tqchildren /** * Removes the child. If this was the main child this element might @@ -257,7 +257,7 @@ public: // main child // - // If an element has children one has to become the main one. + // If an element has tqchildren one has to become the main one. virtual SequenceElement* getMainChild() { return 0; } //virtual void setMainChild(SequenceElement*) {} @@ -265,21 +265,21 @@ public: // editing // - // Insert and remove children. + // Insert and remove tqchildren. /** - * Inserts all new children at the cursor position. Places the + * Inserts all new tqchildren at the cursor position. Places the * cursor according to the direction. * * The list will be emptied but stays the property of the caller. */ - virtual void insert(FormulaCursor*, QPtrList<BasicElement>&, Direction) {} + virtual void insert(FormulaCursor*, TQPtrList<BasicElement>&, Direction) {} /** - * Removes all selected children and returns them. Places the - * cursor to where the children have been. + * Removes all selected tqchildren and returns them. Places the + * cursor to where the tqchildren have been. */ - virtual void remove(FormulaCursor*, QPtrList<BasicElement>&, Direction) {} + virtual void remove(FormulaCursor*, TQPtrList<BasicElement>&, Direction) {} /** * Moves the cursor to a normal place where new elements @@ -290,7 +290,7 @@ public: /** * Returns wether the element has no more useful - * children (except its main child) and should therefore + * tqchildren (except its main child) and should therefore * be replaced by its main child's content. */ virtual bool isSenseless() { return false; } @@ -316,7 +316,7 @@ public: /** - * Callback for the tabs among our children. Needed for alignment. + * Callback for the tabs among our tqchildren. Needed for tqalignment. */ virtual void registerTab( BasicElement* /*tab*/ ) {} @@ -336,13 +336,13 @@ public: * new elements because it owns the undo stack. But only the * sequence knows what chars are allowed. */ - virtual KCommand* input( Container*, QKeyEvent* ) { return 0; } + virtual KCommand* input( Container*, TQKeyEvent* ) { return 0; } // basic support - const BasicElement* getParent() const { return parent; } - BasicElement* getParent() { return parent; } - void setParent(BasicElement* p) { parent = p; } + const BasicElement* getParent() const { return tqparent; } + BasicElement* getParent() { return tqparent; } + void setParent(BasicElement* p) { tqparent = p; } luPixel getX() const { return m_x; } luPixel getY() const { return m_y; } @@ -350,7 +350,7 @@ public: void setX( luPixel x ) { m_x = x; } void setY( luPixel y ) { m_y = y; } - //QSize getSize() { return size; } + //TQSize getSize() { return size; } luPixel getWidth() const { return m_width; } luPixel getHeight() const { return m_height; } @@ -367,36 +367,36 @@ public: return getBaseline() - style.axisHeight( tstyle, factor ); } /** - * @return a QDomElement that contain as DomChildren the - * children, and as attribute the attribute of this + * @return a TQDomElement that contain as DomChildren the + * tqchildren, and as attribute the attribute of this * element. */ - QDomElement getElementDom( QDomDocument& doc); + TQDomElement getElementDom( TQDomDocument& doc); /** * Same as above, just MathML. * It shouldn't be redefined but for exceptional cases, use the general writeMathML* API instead */ - virtual void writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat = false ) const ; + virtual void writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat = false ) const ; /** - * Set this element attribute, build children and + * Set this element attribute, build tqchildren and * call their buildFromDom. */ - bool buildFromDom(QDomElement element); + bool buildFromDom(TQDomElement element); /** - * Set this element attribute, build children and call + * Set this element attribute, build tqchildren and call * their builFromMathMLDom. * Returns the number of nodes processed or -1 if it failed. */ - int buildFromMathMLDom( QDomElement element ); + int buildFromMathMLDom( TQDomElement element ); // debug static int getEvilDestructionCount() { return evilDestructionCount; } /** - * @returns our type. This is an object from our parent's syntax tree + * @returns our type. This is an object from our tqparent's syntax tree * or 0 if there was a very bad parsing error. */ ElementType* getElementType() const { return elementType; } @@ -408,7 +408,7 @@ public: virtual void setStyle(StyleElement*) {} - virtual QString getElementName() const { return ""; }; + virtual TQString getElementName() const { return ""; }; protected: //Save/load support @@ -416,45 +416,45 @@ protected: /** * Returns the tag name of this element type. */ - virtual QString getTagName() const { return "BASIC"; } + virtual TQString getTagName() const { return "BASIC"; } /** * Appends our attributes to the dom element. */ - virtual void writeDom(QDomElement element); + virtual void writeDom(TQDomElement element); - virtual void writeMathMLAttributes( QDomElement& /*element*/ ) const {}; - virtual void writeMathMLContent( QDomDocument& /*doc*/, - QDomElement& /*element*/, + virtual void writeMathMLAttributes( TQDomElement& /*element*/ ) const {}; + virtual void writeMathMLContent( TQDomDocument& /*doc*/, + TQDomElement& /*element*/, bool /*oasisFormat*/ ) const {}; /** * Reads our attributes from the element. * Returns false if it failed. */ - virtual bool readAttributesFromDom(QDomElement element); + virtual bool readAttributesFromDom(TQDomElement element); /** * Reads our content from the node. Sets the node to the next node * that needs to be read. * Returns false if it failed. */ - virtual bool readContentFromDom(QDomNode& node); + virtual bool readContentFromDom(TQDomNode& node); /** * Returns if the SequenceElement could be constructed from the nodes first child. * The node name must match the given name. * - * This is a service for all subclasses that contain children. + * This is a service for all subclasses that contain tqchildren. */ - bool buildChild( SequenceElement* child, QDomNode node, QString name ); + bool buildChild( SequenceElement* child, TQDomNode node, TQString name ); /** * Reads our attributes from the MathML element. * Returns false if it failed. */ - virtual bool readAttributesFromMathMLDom(const QDomElement& element); + virtual bool readAttributesFromMathMLDom(const TQDomElement& element); /** * Reads our content from the MathML node. Sets the node to the next node @@ -462,16 +462,16 @@ protected: * (e. g. for fence operators). * Returns the number of nodes processed or -1 if it failed. */ - virtual int readContentFromMathMLDom(QDomNode& node); + virtual int readContentFromMathMLDom(TQDomNode& node); /** * @returns the latex representation of the element and - * of the element's children + * of the element's tqchildren */ - virtual QString toLatex(); + virtual TQString toLatex(); - virtual QString formulaString() { return ""; } + virtual TQString formulaString() { return ""; } /** * Utility function that sets the size type and returns the size value from @@ -483,33 +483,33 @@ protected: * @param st size type container. It will be properly assigned to its size * type or NoSize if str is invalid */ - double getSize( const QString& str, SizeType* st ); + double getSize( const TQString& str, SizeType* st ); - SizeType getSpace( const QString& str ); + SizeType getSpace( const TQString& str ); private: /** * Used internally by getSize() */ - double str2size( const QString& str, SizeType* st, uint index, SizeType type ); + double str2size( const TQString& str, SizeType* st, uint index, SizeType type ); /** - * Our parent. - * The parent might not be null except for the FormulaElement + * Our tqparent. + * The tqparent might not be null except for the FormulaElement * that is the top of the element tree. */ - BasicElement* parent; + BasicElement* tqparent; /** * This elements size. */ - //QSize size; + //TQSize size; luPixel m_width; luPixel m_height; /** - * Our position relative to our parent. + * Our position relative to our tqparent. */ //KoPoint position; luPixel m_x; @@ -521,7 +521,7 @@ private: * along this line. * * There are elements (like matrix) that don't have a base line. It is - * -1 in this case. The alignment is done using the middle line. + * -1 in this case. The tqalignment is done using the middle line. */ luPixel m_baseline; diff --git a/lib/kformula/bracketelement.cc b/lib/kformula/bracketelement.cc index 2e00af12..d95eac78 100644 --- a/lib/kformula/bracketelement.cc +++ b/lib/kformula/bracketelement.cc @@ -18,10 +18,10 @@ * Boston, MA 02110-1301, USA. */ -#include <qptrlist.h> -#include <qpainter.h> -#include <qpen.h> -#include <qpointarray.h> +#include <tqptrlist.h> +#include <tqpainter.h> +#include <tqpen.h> +#include <tqpointarray.h> #include <kdebug.h> #include <klocale.h> @@ -35,8 +35,8 @@ KFORMULA_NAMESPACE_BEGIN -SingleContentElement::SingleContentElement(BasicElement* parent ) - : BasicElement( parent ) +SingleContentElement::SingleContentElement(BasicElement* tqparent ) + : BasicElement( tqparent ) { content = new SequenceElement( this ); } @@ -56,10 +56,10 @@ SingleContentElement::~SingleContentElement() } -QChar SingleContentElement::getCharacter() const +TQChar SingleContentElement::getCharacter() const { // This is meant to make the SingleContentElement text only. - // This "fixes" the parenthesis problem (parenthesis too large). + // This "fixes" the tqparenthesis problem (tqparenthesis too large). // I'm not sure if we really want this. There should be better ways. if ( content->isTextOnly() ) { return '\\'; @@ -68,12 +68,12 @@ QChar SingleContentElement::getCharacter() const } BasicElement* SingleContentElement::goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ) + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ) { - BasicElement* e = BasicElement::goToPos(cursor, handled, point, parentOrigin); + BasicElement* e = BasicElement::goToPos(cursor, handled, point, tqparentOrigin); if (e != 0) { - LuPixelPoint myPos(parentOrigin.x() + getX(), - parentOrigin.y() + getY()); + LuPixelPoint myPos(tqparentOrigin.x() + getX(), + tqparentOrigin.y() + getY()); e = content->goToPos(cursor, handled, point, myPos); if (e != 0) { @@ -132,14 +132,14 @@ void SingleContentElement::moveDown(FormulaCursor* cursor, BasicElement* /*from* } void SingleContentElement::remove( FormulaCursor* cursor, - QPtrList<BasicElement>& removedChildren, + TQPtrList<BasicElement>& removedChildren, Direction direction ) { switch (cursor->getPos()) { case contentPos: - BasicElement* parent = getParent(); - parent->selectChild(cursor, this); - parent->remove(cursor, removedChildren, direction); + BasicElement* tqparent = getParent(); + tqparent->selectChild(cursor, this); + tqparent->remove(cursor, removedChildren, direction); } } @@ -165,18 +165,18 @@ void SingleContentElement::selectChild(FormulaCursor* cursor, BasicElement* chil } } -void SingleContentElement::writeDom(QDomElement element) +void SingleContentElement::writeDom(TQDomElement element) { BasicElement::writeDom(element); - QDomDocument doc = element.ownerDocument(); + TQDomDocument doc = element.ownerDocument(); - QDomElement con = doc.createElement("CONTENT"); + TQDomElement con = doc.createElement("CONTENT"); con.appendChild(content->getElementDom(doc)); element.appendChild(con); } -bool SingleContentElement::readContentFromDom(QDomNode& node) +bool SingleContentElement::readContentFromDom(TQDomNode& node) { if (!BasicElement::readContentFromDom(node)) { return false; @@ -191,7 +191,7 @@ bool SingleContentElement::readContentFromDom(QDomNode& node) return true; } -int SingleContentElement::readContentFromMathMLDom( QDomNode& node ) +int SingleContentElement::readContentFromMathMLDom( TQDomNode& node ) { if ( BasicElement::readContentFromMathMLDom( node ) == -1 ) { return -1; @@ -206,15 +206,15 @@ int SingleContentElement::readContentFromMathMLDom( QDomNode& node ) return nodeCounter; } -void SingleContentElement::writeMathMLContent( QDomDocument& doc, QDomElement& element, bool oasisFormat ) const +void SingleContentElement::writeMathMLContent( TQDomDocument& doc, TQDomElement& element, bool oasisFormat ) const { content->writeMathML( doc, element, oasisFormat ); } -BracketElement::BracketElement(SymbolType l, SymbolType r, BasicElement* parent) - : SingleContentElement(parent), +BracketElement::BracketElement(SymbolType l, SymbolType r, BasicElement* tqparent) + : SingleContentElement(tqparent), left( 0 ), right( 0 ), leftType( l ), rightType( r ), m_operator( false ), m_customLeft( false ), m_customRight( false ) @@ -252,12 +252,12 @@ void BracketElement::entered( SequenceElement* /*child*/ ) BasicElement* BracketElement::goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ) + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ) { - BasicElement* e = BasicElement::goToPos(cursor, handled, point, parentOrigin); + BasicElement* e = BasicElement::goToPos(cursor, handled, point, tqparentOrigin); if (e != 0) { - LuPixelPoint myPos(parentOrigin.x() + getX(), - parentOrigin.y() + getY()); + LuPixelPoint myPos(tqparentOrigin.x() + getX(), + tqparentOrigin.y() + getY()); e = getContent()->goToPos(cursor, handled, point, myPos); if (e != 0) { return e; @@ -281,7 +281,7 @@ BasicElement* BracketElement::goToPos( FormulaCursor* cursor, bool& handled, /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ void BracketElement::calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -303,28 +303,28 @@ void BracketElement::calcSizes( const ContextStyle& context, left->calcSizes(context, tstyle, factor); right->calcSizes(context, tstyle, factor); - setBaseline(QMAX(content->getBaseline(), - QMAX(left->getBaseline(), right->getBaseline()))); + setBaseline(TQMAX(content->getBaseline(), + TQMAX(left->getBaseline(), right->getBaseline()))); content->setY(getBaseline() - content->getBaseline()); left ->setY(getBaseline() - left ->getBaseline()); right ->setY(getBaseline() - right ->getBaseline()); //setMidline(content->getY() + content->getMidline()); - setHeight(QMAX(content->getY() + content->getHeight(), - QMAX(left ->getY() + left ->getHeight(), + setHeight(TQMAX(content->getY() + content->getHeight(), + TQMAX(left ->getY() + left ->getHeight(), right->getY() + right->getHeight()))); } else { //kdDebug( DEBUGID ) << "BracketElement::calcSizes " << content->axis( context, tstyle ) << " " << content->getHeight() << endl; - luPixel contentHeight = 2 * QMAX( content->axis( context, tstyle, factor ), + luPixel contentHeight = 2 * TQMAX( content->axis( context, tstyle, factor ), content->getHeight() - content->axis( context, tstyle, factor ) ); left->calcSizes( context, tstyle, factor, contentHeight ); right->calcSizes( context, tstyle, factor, contentHeight ); // height - setHeight(QMAX(contentHeight, - QMAX(left->getHeight(), right->getHeight()))); + setHeight(TQMAX(contentHeight, + TQMAX(left->getHeight(), right->getHeight()))); //setMidline(getHeight() / 2); content->setY(getHeight() / 2 - content->axis( context, tstyle, factor )); @@ -360,18 +360,18 @@ void BracketElement::calcSizes( const ContextStyle& context, /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ -void BracketElement::draw( QPainter& painter, const LuPixelRect& r, +void BracketElement::draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ) + const LuPixelPoint& tqparentOrigin ) { - LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); + LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) // return; @@ -384,7 +384,7 @@ void BracketElement::draw( QPainter& painter, const LuPixelRect& r, } else { double factor = style.sizeFactor(); - luPixel contentHeight = 2 * QMAX(content->axis( context, tstyle, factor ), + luPixel contentHeight = 2 * TQMAX(content->axis( context, tstyle, factor ), content->getHeight() - content->axis( context, tstyle, factor )); left->draw(painter, r, context, tstyle, style, contentHeight, myPos); right->draw(painter, r, context, tstyle, style, contentHeight, myPos); @@ -392,16 +392,16 @@ void BracketElement::draw( QPainter& painter, const LuPixelRect& r, // Debug #if 0 - painter.setBrush( Qt::NoBrush ); - painter.setPen( Qt::red ); - painter.drawRect( context.layoutUnitToPixelX( myPos.x()+left->getX() ), - context.layoutUnitToPixelY( myPos.y()+left->getY() ), - context.layoutUnitToPixelX( left->getWidth() ), - context.layoutUnitToPixelY( left->getHeight() ) ); - painter.drawRect( context.layoutUnitToPixelX( myPos.x()+right->getX() ), - context.layoutUnitToPixelY( myPos.y()+right->getY() ), - context.layoutUnitToPixelX( right->getWidth() ), - context.layoutUnitToPixelY( right->getHeight() ) ); + painter.setBrush( TQt::NoBrush ); + painter.setPen( TQt::red ); + painter.drawRect( context.tqlayoutUnitToPixelX( myPos.x()+left->getX() ), + context.tqlayoutUnitToPixelY( myPos.y()+left->getY() ), + context.tqlayoutUnitToPixelX( left->getWidth() ), + context.tqlayoutUnitToPixelY( left->getHeight() ) ); + painter.drawRect( context.tqlayoutUnitToPixelX( myPos.x()+right->getX() ), + context.tqlayoutUnitToPixelY( myPos.y()+right->getY() ), + context.tqlayoutUnitToPixelX( right->getWidth() ), + context.tqlayoutUnitToPixelY( right->getHeight() ) ); #endif } @@ -409,7 +409,7 @@ void BracketElement::draw( QPainter& painter, const LuPixelRect& r, /** * Appends our attributes to the dom element. */ -void BracketElement::writeDom(QDomElement element) +void BracketElement::writeDom(TQDomElement element) { SingleContentElement::writeDom(element); element.setAttribute("LEFT", leftType); @@ -420,16 +420,16 @@ void BracketElement::writeDom(QDomElement element) * Reads our attributes from the element. * Returns false if it failed. */ -bool BracketElement::readAttributesFromDom(QDomElement element) +bool BracketElement::readAttributesFromDom(TQDomElement element) { if (!BasicElement::readAttributesFromDom(element)) { return false; } - QString leftStr = element.attribute("LEFT"); + TQString leftStr = element.attribute("LEFT"); if(!leftStr.isNull()) { leftType = static_cast<SymbolType>(leftStr.toInt()); } - QString rightStr = element.attribute("RIGHT"); + TQString rightStr = element.attribute("RIGHT"); if(!rightStr.isNull()) { rightType = static_cast<SymbolType>(rightStr.toInt()); } @@ -440,7 +440,7 @@ bool BracketElement::readAttributesFromDom(QDomElement element) * Reads our attributes from the MathML element. * Returns false if it failed. */ -bool BracketElement::readAttributesFromMathMLDom(const QDomElement& element) +bool BracketElement::readAttributesFromMathMLDom(const TQDomElement& element) { if ( !BasicElement::readAttributesFromMathMLDom( element ) ) { return false; @@ -453,7 +453,7 @@ bool BracketElement::readAttributesFromMathMLDom(const QDomElement& element) else { // mfenced, see attributes in section 3.3.8.2 leftType = LeftRoundBracket; rightType = RightRoundBracket; - QString openStr = element.attribute( "open" ).stripWhiteSpace(); + TQString openStr = element.attribute( "open" ).stripWhiteSpace(); if ( !openStr.isNull() ) { m_customLeft = true; if ( openStr == "[" ) @@ -479,7 +479,7 @@ bool BracketElement::readAttributesFromMathMLDom(const QDomElement& element) else // TODO: Check for entity references leftType = LeftRoundBracket; } - QString closeStr = element.attribute( "close" ).stripWhiteSpace(); + TQString closeStr = element.attribute( "close" ).stripWhiteSpace(); if ( !closeStr.isNull() ) { m_customRight = true; if ( closeStr == "[" ) @@ -515,14 +515,14 @@ bool BracketElement::readAttributesFromMathMLDom(const QDomElement& element) * that needs to be read. * Returns false if it failed. */ -int BracketElement::readContentFromMathMLDom(QDomNode& node) +int BracketElement::readContentFromMathMLDom(TQDomNode& node) { bool empty = false; int nodeCounter = 0; if ( m_operator ) { - node = node.parentNode(); - QDomNode open = node; - QDomNode parent = node.parentNode(); + node = node.tqparentNode(); + TQDomNode open = node; + TQDomNode tqparent = node.tqparentNode(); if ( ! operatorType( node, true ) ) return -1; int nodeNum = searchOperator( node ); @@ -540,15 +540,15 @@ int BracketElement::readContentFromMathMLDom(QDomNode& node) else { // More than two elements inside, infer a mrow nodeCounter += nodeNum; kdWarning() << "NodeNum: " << nodeNum << endl; - QDomDocument doc = node.ownerDocument(); - QDomElement de = doc.createElement( "mrow" ); + TQDomDocument doc = node.ownerDocument(); + TQDomElement de = doc.createElement( "mrow" ); int i = 0; do { - QDomNode n = node.nextSibling(); + TQDomNode n = node.nextSibling(); de.appendChild( node.toElement() ); node = n; } while ( ++i < nodeNum ); - parent.insertAfter( de, open ); + tqparent.insertAfter( de, open ); node = de; kdWarning() << doc.toString() << endl; } @@ -558,22 +558,22 @@ int BracketElement::readContentFromMathMLDom(QDomNode& node) // See section 3.3.8 while ( ! node.isNull() && ! node.isElement() ) node = node.nextSibling(); - QDomNode next = node.nextSibling(); + TQDomNode next = node.nextSibling(); while ( ! next.isNull() && ! next.isElement() ) next = next.nextSibling(); if ( ! next.isNull()) { - QDomDocument doc = node.ownerDocument(); - QDomNode parent = node.parentNode(); - QString ns = parent.prefix(); - QDomElement de = doc.createElementNS( ns, "mrow" ); + TQDomDocument doc = node.ownerDocument(); + TQDomNode tqparent = node.tqparentNode(); + TQString ns = tqparent.prefix(); + TQDomElement de = doc.createElementNS( ns, "mrow" ); uint pos = 0; while ( ! node.isNull() ) { - QDomNode no = node.nextSibling(); + TQDomNode no = node.nextSibling(); while ( ! no.isNull() && ! no.isElement() ) no = no.nextSibling(); de.appendChild( node.toElement() ); if ( ! no.isNull() && ( m_separators.isNull() || ! m_separators.isEmpty() ) ) { - QDomElement sep = doc.createElementNS( ns, "mo" ); + TQDomElement sep = doc.createElementNS( ns, "mo" ); de.appendChild( sep ); if ( m_separators.isNull() ) { sep.appendChild( doc.createTextNode( "," ) ); @@ -582,7 +582,7 @@ int BracketElement::readContentFromMathMLDom(QDomNode& node) if ( m_separators.at( pos ).isSpace() ) { pos++; } - sep.appendChild( doc.createTextNode( QString ( m_separators.at( pos ) ) ) ); + sep.appendChild( doc.createTextNode( TQString ( m_separators.at( pos ) ) ) ); } if ( pos < m_separators.length() - 1 ) { pos++; @@ -590,8 +590,8 @@ int BracketElement::readContentFromMathMLDom(QDomNode& node) } node = no; } - parent.appendChild( de ); - node = parent.firstChild(); + tqparent.appendChild( de ); + node = tqparent.firstChild(); while ( ! node.isElement() ) node = node.nextSibling(); } @@ -619,9 +619,9 @@ int BracketElement::readContentFromMathMLDom(QDomNode& node) return nodeCounter; } -QString BracketElement::toLatex() +TQString BracketElement::toLatex() { - QString ls,rs,cs; + TQString ls,rs,cs; cs=getContent()->toLatex(); ls="\\left"+latexString(leftType) + " "; rs=" \\right"+latexString(rightType); @@ -629,7 +629,7 @@ QString BracketElement::toLatex() return ls+cs+rs; } -QString BracketElement::latexString(char type) +TQString BracketElement::latexString(char type) { switch (type) { case ']': @@ -658,12 +658,12 @@ QString BracketElement::latexString(char type) return "."; } -QString BracketElement::formulaString() +TQString BracketElement::formulaString() { return "(" + getContent()->formulaString() + ")"; } -int BracketElement::operatorType( QDomNode& node, bool open ) +int BracketElement::operatorType( TQDomNode& node, bool open ) { int counter = 1; SymbolType* type = open ? &leftType : &rightType; @@ -672,11 +672,11 @@ int BracketElement::operatorType( QDomNode& node, bool open ) counter++; } if ( node.isElement() ) { - QDomElement e = node.toElement(); - QDomNode child = e.firstChild(); + TQDomElement e = node.toElement(); + TQDomNode child = e.firstChild(); if ( child.isEntityReference() ) { kdWarning() << "Entity Reference\n"; - QString name = node.nodeName(); + TQString name = node.nodeName(); // TODO: To fully support these, SymbolType has to be extended, // and better Unicode support is a must // CloseCurlyDoubleQuote 0x201D @@ -704,10 +704,10 @@ int BracketElement::operatorType( QDomNode& node, bool open ) } } else { - QString s = e.text(); + TQString s = e.text(); if ( s.isNull() ) return -1; - *type = static_cast<SymbolType>( QString::number( s.at( 0 ).latin1() ).toInt() ); + *type = static_cast<SymbolType>( TQString::number( s.tqat( 0 ).latin1() ).toInt() ); } } else { @@ -716,21 +716,21 @@ int BracketElement::operatorType( QDomNode& node, bool open ) return counter; } -int BracketElement::searchOperator( const QDomNode& node ) +int BracketElement::searchOperator( const TQDomNode& node ) { - QDomNode n = node; + TQDomNode n = node; for ( int i = -2; ! n.isNull(); n = n.nextSibling() ) { if ( n.isElement() ) { i++; - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( e.tagName().lower() == "mo" ) { // Try to guess looking at attributes - QString form = e.attribute( "form" ); - QString f; + TQString form = e.attribute( "form" ); + TQString f; if ( ! form.isNull() ) { f = form.stripWhiteSpace().lower(); } - QString fence = e.attribute( "fence" ); + TQString fence = e.attribute( "fence" ); if ( ! fence.isNull() ) { if ( fence.stripWhiteSpace().lower() == "false" ) { continue; @@ -746,8 +746,8 @@ int BracketElement::searchOperator( const QDomNode& node ) } // Guess looking at contents - QDomNode child = e.firstChild(); - QString name; + TQDomNode child = e.firstChild(); + TQString name; if ( child.isText() ) name = child.toText().data().stripWhiteSpace(); else if ( child.isEntityReference() ) @@ -784,21 +784,21 @@ int BracketElement::searchOperator( const QDomNode& node ) } -void BracketElement::writeMathMLAttributes( QDomElement& element ) const +void BracketElement::writeMathMLAttributes( TQDomElement& element ) const { if ( left->getType() != LeftRoundBracket || right->getType() != RightRoundBracket ) { - element.setAttribute( "open", QString( QChar( leftType ) ) ); - element.setAttribute( "close", QString( QChar( rightType ) ) ); + element.setAttribute( "open", TQString( TQChar( leftType ) ) ); + element.setAttribute( "close", TQString( TQChar( rightType ) ) ); } if ( ! m_separators.isNull() ) { element.setAttribute( "separators", m_separators ); } } -OverlineElement::OverlineElement( BasicElement* parent ) - : SingleContentElement( parent ) +OverlineElement::OverlineElement( BasicElement* tqparent ) + : SingleContentElement( tqparent ) { } @@ -845,14 +845,14 @@ void OverlineElement::calcSizes( const ContextStyle& context, setBaseline(content->getBaseline() + content->getY()); } -void OverlineElement::draw( QPainter& painter, const LuPixelRect& r, +void OverlineElement::draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ) + const LuPixelPoint& tqparentOrigin ) { - LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); + LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) // return; @@ -867,40 +867,40 @@ void OverlineElement::draw( QPainter& painter, const LuPixelRect& r, luPixel distY = context.ptToPixelY( context.getThinSpace( tstyle, factor ) ); //luPixel unit = (content->getHeight() + distY)/ 3; - painter.setPen( QPen( context.getDefaultColor(), - context.layoutUnitToPixelY( context.getLineWidth( factor ) ) ) ); + painter.setPen( TQPen( context.getDefaultColor(), + context.tqlayoutUnitToPixelY( context.getLineWidth( factor ) ) ) ); - painter.drawLine( context.layoutUnitToPixelX( x ), - context.layoutUnitToPixelY( y+distY/3 ), - context.layoutUnitToPixelX( x+content->getWidth() ), - context.layoutUnitToPixelY( y+distY/3 ) ); + painter.drawLine( context.tqlayoutUnitToPixelX( x ), + context.tqlayoutUnitToPixelY( y+distY/3 ), + context.tqlayoutUnitToPixelX( x+content->getWidth() ), + context.tqlayoutUnitToPixelY( y+distY/3 ) ); } -QString OverlineElement::toLatex() +TQString OverlineElement::toLatex() { return "\\overline{" + getContent()->toLatex() + "}"; } -QString OverlineElement::formulaString() +TQString OverlineElement::formulaString() { return getContent()->formulaString(); } -void OverlineElement::writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat ) const +void OverlineElement::writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat ) const { - QDomElement de = doc.createElement( oasisFormat ? "math:mover" : "mover" ); + TQDomElement de = doc.createElement( oasisFormat ? "math:mover" : "mover" ); SingleContentElement::writeMathML( doc, de, oasisFormat ); - QDomElement op = doc.createElement( oasisFormat ? "math:mo" : "mo" ); + TQDomElement op = doc.createElement( oasisFormat ? "math:mo" : "mo" ); // is this the right entity? Mozilla renders it correctly. op.appendChild( doc.createEntityReference( "OverBar" ) ); de.appendChild( op ); - parent.appendChild( de ); + tqparent.appendChild( de ); } -UnderlineElement::UnderlineElement( BasicElement* parent ) - : SingleContentElement( parent ) +UnderlineElement::UnderlineElement( BasicElement* tqparent ) + : SingleContentElement( tqparent ) { } @@ -949,14 +949,14 @@ void UnderlineElement::calcSizes( const ContextStyle& context, setBaseline(content->getBaseline() + content->getY()); } -void UnderlineElement::draw( QPainter& painter, const LuPixelRect& r, +void UnderlineElement::draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ) + const LuPixelPoint& tqparentOrigin ) { - LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); + LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) // return; @@ -971,35 +971,35 @@ void UnderlineElement::draw( QPainter& painter, const LuPixelRect& r, //luPixel unit = (content->getHeight() + distY)/ 3; double factor = style.sizeFactor(); - painter.setPen( QPen( context.getDefaultColor(), - context.layoutUnitToPixelY( context.getLineWidth( factor ) ) ) ); + painter.setPen( TQPen( context.getDefaultColor(), + context.tqlayoutUnitToPixelY( context.getLineWidth( factor ) ) ) ); - painter.drawLine( context.layoutUnitToPixelX( x ), - context.layoutUnitToPixelY( y+getHeight()-context.getLineWidth( factor ) ), - context.layoutUnitToPixelX( x+content->getWidth() ), - context.layoutUnitToPixelY( y+getHeight()-context.getLineWidth( factor ) ) ); + painter.drawLine( context.tqlayoutUnitToPixelX( x ), + context.tqlayoutUnitToPixelY( y+getHeight()-context.getLineWidth( factor ) ), + context.tqlayoutUnitToPixelX( x+content->getWidth() ), + context.tqlayoutUnitToPixelY( y+getHeight()-context.getLineWidth( factor ) ) ); } -QString UnderlineElement::toLatex() +TQString UnderlineElement::toLatex() { return "\\underline{" + getContent()->toLatex() + "}"; } -QString UnderlineElement::formulaString() +TQString UnderlineElement::formulaString() { return getContent()->formulaString(); } -void UnderlineElement::writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat ) const +void UnderlineElement::writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat ) const { - QDomElement de = doc.createElement( oasisFormat ? "math:munder" : "munder" ); + TQDomElement de = doc.createElement( oasisFormat ? "math:munder" : "munder" ); SingleContentElement::writeMathML( doc, de, oasisFormat ); - QDomElement op = doc.createElement( oasisFormat ? "math:mo" : "mo" ); + TQDomElement op = doc.createElement( oasisFormat ? "math:mo" : "mo" ); // is this the right entity? Mozilla renders it correctly. op.appendChild( doc.createEntityReference( "UnderBar" ) ); de.appendChild( op ); - parent.appendChild( de ); + tqparent.appendChild( de ); } KFORMULA_NAMESPACE_END diff --git a/lib/kformula/bracketelement.h b/lib/kformula/bracketelement.h index a929c04b..98f515a1 100644 --- a/lib/kformula/bracketelement.h +++ b/lib/kformula/bracketelement.h @@ -21,8 +21,8 @@ #ifndef BRACKETELEMENT_H #define BRACKETELEMENT_H -#include <qpoint.h> -#include <qsize.h> +#include <tqpoint.h> +#include <tqsize.h> #include "basicelement.h" @@ -40,7 +40,7 @@ class SingleContentElement : public BasicElement { SingleContentElement& operator=( const SingleContentElement& ) { return *this; } public: - SingleContentElement(BasicElement* parent = 0); + SingleContentElement(BasicElement* tqparent = 0); ~SingleContentElement(); SingleContentElement( const SingleContentElement& ); @@ -48,9 +48,9 @@ public: /** * @returns the character that represents this element. Used for * parsing a sequence. - * This is guaranteed to be QChar::null for all non-text elements. + * This is guaranteed to be TQChar::null for all non-text elements. */ - virtual QChar getCharacter() const; + virtual TQChar getCharacter() const; /** * Sets the cursor and returns the element the point is in. @@ -59,10 +59,10 @@ public: * is allowed to set the cursor. */ virtual BasicElement* goToPos( FormulaCursor*, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ); + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ); /** - * Dispatch this FontCommand to all our TextElement children. + * Dispatch this FontCommand to all our TextElement tqchildren. */ virtual void dispatchFontCommand( FontCommand* cmd ); @@ -95,12 +95,12 @@ public: virtual void moveDown(FormulaCursor* cursor, BasicElement* from); /** - * Removes all selected children and returns them. Places the - * cursor to where the children have been. + * Removes all selected tqchildren and returns them. Places the + * cursor to where the tqchildren have been. * * We remove ourselve if we are requested to remove our content. */ - virtual void remove(FormulaCursor*, QPtrList<BasicElement>&, Direction); + virtual void remove(FormulaCursor*, TQPtrList<BasicElement>&, Direction); /** * Moves the cursor to a normal place where new elements @@ -110,7 +110,7 @@ public: // main child // - // If an element has children one has to become the main one. + // If an element has tqchildren one has to become the main one. virtual SequenceElement* getMainChild(); @@ -125,24 +125,24 @@ protected: /** * Appends our attributes to the dom element. */ - virtual void writeDom(QDomElement element); + virtual void writeDom(TQDomElement element); - virtual void writeMathMLContent( QDomDocument& doc, - QDomElement& element, + virtual void writeMathMLContent( TQDomDocument& doc, + TQDomElement& element, bool oasisFormat ) const; /** * Reads our content from the node. Sets the node to the next node * that needs to be read. * Returns false if it failed. */ - virtual bool readContentFromDom(QDomNode& node); + virtual bool readContentFromDom(TQDomNode& node); /** * Reads our content from the MathML node. Sets the node to the next node * that needs to be read. * Returns false if it failed. */ - virtual int readContentFromMathMLDom(QDomNode& node); + virtual int readContentFromMathMLDom(TQDomNode& node); SequenceElement* getContent() { return content; } @@ -166,7 +166,7 @@ public: enum { contentPos }; BracketElement(SymbolType left = EmptyBracket, SymbolType right = EmptyBracket, - BasicElement* parent = 0); + BasicElement* tqparent = 0); ~BracketElement(); BracketElement( const BracketElement& ); @@ -196,11 +196,11 @@ public: * is allowed to set the cursor. */ virtual BasicElement* goToPos( FormulaCursor*, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ); + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ); /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -208,16 +208,16 @@ public: StyleAttributes& style ); /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); protected: @@ -226,23 +226,23 @@ protected: /** * Returns the tag name of this element type. */ - virtual QString getTagName() const { return "BRACKET"; } + virtual TQString getTagName() const { return "BRACKET"; } /** * Reads our attributes from the element. * Returns false if it failed. */ - virtual bool readAttributesFromDom(QDomElement element); + virtual bool readAttributesFromDom(TQDomElement element); - virtual void writeDom(QDomElement element); + virtual void writeDom(TQDomElement element); - virtual QString getElementName() const { return "mfenced"; } - virtual void writeMathMLAttributes( QDomElement& element ) const; + virtual TQString getElementName() const { return "mfenced"; } + virtual void writeMathMLAttributes( TQDomElement& element ) const; /** * Reads our attributes from the MathML element. * Returns false if it failed. */ - virtual bool readAttributesFromMathMLDom(const QDomElement& element); + virtual bool readAttributesFromMathMLDom(const TQDomElement& element); /** * Reads our content from the MathML node. Sets the node to the next node @@ -250,35 +250,35 @@ protected: * (e. g. for fence operators). * Returns the number of nodes processed or -1 if it failed. */ - virtual int readContentFromMathMLDom(QDomNode& node); + virtual int readContentFromMathMLDom(TQDomNode& node); /** * @returns the latex representation of the element and - * of the element's children + * of the element's tqchildren */ - virtual QString toLatex(); + virtual TQString toLatex(); - virtual QString formulaString(); + virtual TQString formulaString(); private: /** * @return a LaTex string for the given symbol */ - QString latexString(char); + TQString latexString(char); /** * Set left and right types in operator fences * @param open if true set SymbolType for open (left) bracket, * otherwise set for close (right) bracket. */ - int operatorType( QDomNode& node, bool open ); + int operatorType( TQDomNode& node, bool open ); /** * Search through the nodes to find the close operator to match current * open bracket. */ - int searchOperator( const QDomNode& node ); + int searchOperator( const TQDomNode& node ); /** * The brackets we are showing. @@ -289,7 +289,7 @@ private: SymbolType leftType; SymbolType rightType; - QString m_separators; + TQString m_separators; bool m_operator; bool m_customLeft; bool m_customRight; @@ -303,7 +303,7 @@ class OverlineElement : public SingleContentElement { OverlineElement& operator=( const OverlineElement& ) { return *this; } public: - OverlineElement(BasicElement* parent = 0); + OverlineElement(BasicElement* tqparent = 0); ~OverlineElement(); OverlineElement( const OverlineElement& ); @@ -322,7 +322,7 @@ public: /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -330,26 +330,26 @@ public: StyleAttributes& style ); /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); /** * @returns the latex representation of the element and - * of the element's children + * of the element's tqchildren */ - virtual QString toLatex(); + virtual TQString toLatex(); - virtual QString formulaString(); + virtual TQString formulaString(); - virtual void writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat = false ) const; + virtual void writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat = false ) const; protected: @@ -358,7 +358,7 @@ protected: /** * Returns the tag name of this element type. */ - virtual QString getTagName() const { return "OVERLINE"; } + virtual TQString getTagName() const { return "OVERLINE"; } private: }; @@ -370,7 +370,7 @@ private: class UnderlineElement : public SingleContentElement { UnderlineElement& operator=( const UnderlineElement& ) { return *this; } public: - UnderlineElement(BasicElement* parent = 0); + UnderlineElement(BasicElement* tqparent = 0); ~UnderlineElement(); UnderlineElement( const UnderlineElement& ); @@ -389,7 +389,7 @@ public: /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -397,26 +397,26 @@ public: StyleAttributes& style ); /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); /** * @returns the latex representation of the element and - * of the element's children + * of the element's tqchildren */ - virtual QString toLatex(); + virtual TQString toLatex(); - virtual QString formulaString(); + virtual TQString formulaString(); - virtual void writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat = false ) const; + virtual void writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat = false ) const; protected: @@ -425,7 +425,7 @@ protected: /** * Returns the tag name of this element type. */ - virtual QString getTagName() const { return "UNDERLINE"; } + virtual TQString getTagName() const { return "UNDERLINE"; } private: }; diff --git a/lib/kformula/config/esstixeight.font b/lib/kformula/config/esstixeight.font index 37cbdfdb..88992333 100644 --- a/lib/kformula/config/esstixeight.font +++ b/lib/kformula/config/esstixeight.font @@ -3,7 +3,7 @@ # Unicode mapping for the esstixeight font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # 33, 0xE201 37, 0xE205 diff --git a/lib/kformula/config/esstixeleven.font b/lib/kformula/config/esstixeleven.font index d94bd375..41e9fbe1 100644 --- a/lib/kformula/config/esstixeleven.font +++ b/lib/kformula/config/esstixeleven.font @@ -3,5 +3,5 @@ # Unicode mapping for the esstixeleven font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # diff --git a/lib/kformula/config/esstixfifteen.font b/lib/kformula/config/esstixfifteen.font index 3df00e54..920be0c1 100644 --- a/lib/kformula/config/esstixfifteen.font +++ b/lib/kformula/config/esstixfifteen.font @@ -3,5 +3,5 @@ # Unicode mapping for the esstixfifteen font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # diff --git a/lib/kformula/config/esstixfive.font b/lib/kformula/config/esstixfive.font index 9f57fec2..62724a84 100644 --- a/lib/kformula/config/esstixfive.font +++ b/lib/kformula/config/esstixfive.font @@ -3,7 +3,7 @@ # Unicode mapping for the esstixfive font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # 52, 0x2295 53, 0x2297 diff --git a/lib/kformula/config/esstixfour.font b/lib/kformula/config/esstixfour.font index dc6844b9..411a138a 100644 --- a/lib/kformula/config/esstixfour.font +++ b/lib/kformula/config/esstixfour.font @@ -3,7 +3,7 @@ # Unicode mapping for the esstixfour font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # 56, 0x2291 77, 0x2290 diff --git a/lib/kformula/config/esstixfourteen.font b/lib/kformula/config/esstixfourteen.font index 802c47ec..723a4094 100644 --- a/lib/kformula/config/esstixfourteen.font +++ b/lib/kformula/config/esstixfourteen.font @@ -3,7 +3,7 @@ # Unicode mapping for the esstixfourteen font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # 99, 0x2138 97, 0x2135 diff --git a/lib/kformula/config/esstixnine.font b/lib/kformula/config/esstixnine.font index 4f4e6197..e294bd6d 100644 --- a/lib/kformula/config/esstixnine.font +++ b/lib/kformula/config/esstixnine.font @@ -3,5 +3,5 @@ # Unicode mapping for the esstixnine font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # diff --git a/lib/kformula/config/esstixone.font b/lib/kformula/config/esstixone.font index 9ff6cabf..df3e95ec 100644 --- a/lib/kformula/config/esstixone.font +++ b/lib/kformula/config/esstixone.font @@ -3,7 +3,7 @@ # Unicode mapping for the esstixone font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # 75, 0x219B 70, 0x219A diff --git a/lib/kformula/config/esstixseven.font b/lib/kformula/config/esstixseven.font index 25a7d01c..37650ee1 100644 --- a/lib/kformula/config/esstixseven.font +++ b/lib/kformula/config/esstixseven.font @@ -3,7 +3,7 @@ # Unicode mapping for the esstixseven font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # 61, 0x0028 62, 0x0029 diff --git a/lib/kformula/config/esstixseventeen.font b/lib/kformula/config/esstixseventeen.font index c3b8f311..00df77cd 100644 --- a/lib/kformula/config/esstixseventeen.font +++ b/lib/kformula/config/esstixseventeen.font @@ -3,5 +3,5 @@ # Unicode mapping for the esstixseventeen font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # diff --git a/lib/kformula/config/esstixsix.font b/lib/kformula/config/esstixsix.font index a6412a58..43e2752c 100644 --- a/lib/kformula/config/esstixsix.font +++ b/lib/kformula/config/esstixsix.font @@ -3,7 +3,7 @@ # Unicode mapping for the esstixsix font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # 46, 0x220F 35, 0x222E diff --git a/lib/kformula/config/esstixsixteen.font b/lib/kformula/config/esstixsixteen.font index c212e08d..2a96c0c1 100644 --- a/lib/kformula/config/esstixsixteen.font +++ b/lib/kformula/config/esstixsixteen.font @@ -3,5 +3,5 @@ # Unicode mapping for the esstixsixteen font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # diff --git a/lib/kformula/config/esstixten.font b/lib/kformula/config/esstixten.font index dd4c2b0f..fa9c5ee2 100644 --- a/lib/kformula/config/esstixten.font +++ b/lib/kformula/config/esstixten.font @@ -3,7 +3,7 @@ # Unicode mapping for the esstixten font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # 118, 0x2202 86, 0x2207 diff --git a/lib/kformula/config/esstixthirteen.font b/lib/kformula/config/esstixthirteen.font index fc13f891..cee5bf99 100644 --- a/lib/kformula/config/esstixthirteen.font +++ b/lib/kformula/config/esstixthirteen.font @@ -3,5 +3,5 @@ # Unicode mapping for the esstixthirteen font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # diff --git a/lib/kformula/config/esstixthree.font b/lib/kformula/config/esstixthree.font index c55acaeb..fe359c1f 100644 --- a/lib/kformula/config/esstixthree.font +++ b/lib/kformula/config/esstixthree.font @@ -3,7 +3,7 @@ # Unicode mapping for the esstixthree font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # 101, 0x2204 95, 0x227B diff --git a/lib/kformula/config/esstixtwelve.font b/lib/kformula/config/esstixtwelve.font index b82e5d7f..3a4b9d23 100644 --- a/lib/kformula/config/esstixtwelve.font +++ b/lib/kformula/config/esstixtwelve.font @@ -3,5 +3,5 @@ # Unicode mapping for the esstixtwelve font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # diff --git a/lib/kformula/config/esstixtwo.font b/lib/kformula/config/esstixtwo.font index ed83909f..201f95e1 100644 --- a/lib/kformula/config/esstixtwo.font +++ b/lib/kformula/config/esstixtwo.font @@ -3,7 +3,7 @@ # Unicode mapping for the esstixtwo font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its unicode value. +# Each line consist of a char position and its tqunicode value. # 100, 0x2203 99, 0x2200 diff --git a/lib/kformula/config/unicode.tbl b/lib/kformula/config/unicode.tbl index e3e27db8..d86b1df3 100644 --- a/lib/kformula/config/unicode.tbl +++ b/lib/kformula/config/unicode.tbl @@ -1,6 +1,6 @@ # -# KFormula unicode table -# Each line contains the unicode value, the char class +# KFormula tqunicode table +# Each line contains the tqunicode value, the char class # (ORDINARY, BINOP or RELATION) and optionally the # chars TeX name. # diff --git a/lib/kformula/contextstyle.cc b/lib/kformula/contextstyle.cc index 61e290f4..f358b62c 100644 --- a/lib/kformula/contextstyle.cc +++ b/lib/kformula/contextstyle.cc @@ -19,8 +19,8 @@ * Boston, MA 02110-1301, USA. */ -#include <qfontmetrics.h> -#include <qstring.h> +#include <tqfontmetrics.h> +#include <tqstring.h> #include <kdebug.h> #include <KoGlobal.h> @@ -34,9 +34,9 @@ KFORMULA_NAMESPACE_BEGIN ContextStyle::ContextStyle() : symbolFont( "Symbol" ), - defaultColor(Qt::black), numberColor(Qt::blue), - operatorColor(Qt::darkGreen), errorColor(Qt::darkRed), - emptyColor(Qt::blue), helpColor( Qt::gray ), m_sizeFactor( 0 ) + defaultColor(TQt::black), numberColor(TQt::blue), + operatorColor(TQt::darkGreen), errorColor(TQt::darkRed), + emptyColor(TQt::blue), helpColor( TQt::gray ), m_sizeFactor( 0 ) { // kdDebug() << "ContextStyle::ContextStyle" << endl // << "defaultFont: " << defaultFont.rawName() << endl @@ -74,7 +74,7 @@ void ContextStyle::init( bool init ) } -void ContextStyle::setFontStyle( const QString& fontStyle, bool init ) +void ContextStyle::setFontStyle( const TQString& fontStyle, bool init ) { delete m_fontStyle; m_fontStyleName = fontStyle; @@ -92,7 +92,7 @@ const SymbolTable& ContextStyle::symbolTable() const void ContextStyle::readConfig( KConfig* config, bool init ) { config->setGroup( "kformula Font" ); - QString fontName = config->readEntry( "defaultFont", "Times,12,-1,5,50,1,0,0,0,0" ); + TQString fontName = config->readEntry( "defaultFont", "Times,12,-1,5,50,1,0,0,0,0" ); defaultFont.fromString( fontName ); fontName = config->readEntry( "nameFont", "Times,12,-1,5,50,0,0,0,0,0" ); nameFont.fromString( fontName ); @@ -100,7 +100,7 @@ void ContextStyle::readConfig( KConfig* config, bool init ) numberFont.fromString( fontName ); fontName = config->readEntry( "operatorFont", "Times,12,-1,5,50,0,0,0,0,0" ); operatorFont.fromString( fontName ); - QString baseSize = config->readEntry( "baseSize", "20" ); + TQString baseSize = config->readEntry( "baseSize", "20" ); m_baseSize = baseSize.toInt(); if ( ! FontStyle::missingFonts( init ).isEmpty() ) { @@ -136,7 +136,7 @@ bool ContextStyle::setZoomAndResolution( int zoom, double zoomX, double zoomY, b return changes; } -QColor ContextStyle::getNumberColor() const +TQColor ContextStyle::getNumberColor() const { if ( edit() && syntaxHighlighting() ) { return numberColor; @@ -144,7 +144,7 @@ QColor ContextStyle::getNumberColor() const return getDefaultColor(); } -QColor ContextStyle::getOperatorColor() const +TQColor ContextStyle::getOperatorColor() const { if ( edit() && syntaxHighlighting() ) { return operatorColor; @@ -152,7 +152,7 @@ QColor ContextStyle::getOperatorColor() const return getDefaultColor(); } -QColor ContextStyle::getErrorColor() const +TQColor ContextStyle::getErrorColor() const { if ( edit() && syntaxHighlighting() ) { return errorColor; @@ -160,7 +160,7 @@ QColor ContextStyle::getErrorColor() const return getDefaultColor(); } -QColor ContextStyle::getEmptyColor() const +TQColor ContextStyle::getEmptyColor() const { if ( edit() && syntaxHighlighting() ) { return emptyColor; @@ -168,7 +168,7 @@ QColor ContextStyle::getEmptyColor() const return getDefaultColor(); } -QColor ContextStyle::getHelpColor() const +TQColor ContextStyle::getHelpColor() const { if ( edit() && syntaxHighlighting() ) { return helpColor; @@ -176,38 +176,38 @@ QColor ContextStyle::getHelpColor() const return getDefaultColor(); } -void ContextStyle::setDefaultColor( const QColor& color ) +void ContextStyle::setDefaultColor( const TQColor& color ) { defaultColor = color; } -void ContextStyle::setNumberColor( const QColor& color ) +void ContextStyle::setNumberColor( const TQColor& color ) { numberColor = color; } -void ContextStyle::setOperatorColor( const QColor& color ) +void ContextStyle::setOperatorColor( const TQColor& color ) { operatorColor = color; } -void ContextStyle::setErrorColor( const QColor& color ) +void ContextStyle::setErrorColor( const TQColor& color ) { errorColor = color; } -void ContextStyle::setEmptyColor( const QColor& color ) +void ContextStyle::setEmptyColor( const TQColor& color ) { emptyColor = color; } -void ContextStyle::setHelpColor( const QColor& color ) +void ContextStyle::setHelpColor( const TQColor& color ) { helpColor = color; } #if 0 -const QStringList& ContextStyle::requestedFonts() const +const TQStringList& ContextStyle::requestedFonts() const { return m_requestedFonts; } -void ContextStyle::setRequestedFonts( const QStringList& list ) +void ContextStyle::setRequestedFonts( const TQStringList& list ) { m_requestedFonts = list; //table.init( this ); @@ -221,7 +221,7 @@ double ContextStyle::getReductionFactor( TextStyle tstyle ) const luPt ContextStyle::getAdjustedSize( TextStyle tstyle, double factor ) const { - return qRound( ptToLayoutUnitPt( m_sizeFactor + return tqRound( ptToLayoutUnitPt( m_sizeFactor * m_baseSize * getReductionFactor( tstyle ) * factor @@ -235,7 +235,7 @@ luPixel ContextStyle::getSpace( TextStyle tstyle, SpaceWidth space, double facto case THIN: return getThinSpace( tstyle, factor ); case MEDIUM: return getMediumSpace( tstyle, factor ); case THICK: return getThickSpace( tstyle, factor ); - case QUAD: return getQuadSpace( tstyle, factor ); + case TQUAD: return getQuadSpace( tstyle, factor ); } return 0; } @@ -360,16 +360,16 @@ ContextStyle::TextStyle ContextStyle::convertTextStyleIndex( TextStyle tstyle ) void ContextStyle::setup() { luPt size = static_cast<luPt>( m_baseSize ); - QFont font = symbolFont; + TQFont font = symbolFont; font.setPointSize( size ); - QFontMetrics fm( font ); + TQFontMetrics fm( font ); // Or better the real space required? ( boundingRect ) quad = ptToLayoutUnitPt( fm.width( 'M' ) ); - font = QFont(defaultFont); + font = TQFont(defaultFont); font.setPointSize( size ); - QFontMetrics fm2( font ); + TQFontMetrics fm2( font ); //m_axisHeight = ptToLayoutUnitPt( fm2.strikeOutPos() ); //ptToLayoutUnitPixY //m_axisHeight = ptToLayoutUnitPt( pixelYToPt( fm2.strikeOutPos() ) ); @@ -412,29 +412,29 @@ CharFamily StyleAttributes::charFamily() const return m_charFamily.top(); } -QColor StyleAttributes::color() const +TQColor StyleAttributes::color() const { if ( m_color.empty() ) { // kdWarning( DEBUGID ) << "Color stack is empty.\n"; - return QColor( Qt::black ); + return TQColor( TQt::black ); //return getDefaultColor(); } return m_color.top(); } -QColor StyleAttributes::background() const +TQColor StyleAttributes::background() const { if ( m_background.empty() ) { // kdWarning( DEBUGID ) << "Background stack is empty.\n"; - return QColor( Qt::color0 ); + return TQColor( TQt::color0 ); } return m_background.top(); } -QFont StyleAttributes::font() const +TQFont StyleAttributes::font() const { if ( m_font.empty() ) { - return QFont(); + return TQFont(); } return m_font.top(); } diff --git a/lib/kformula/contextstyle.h b/lib/kformula/contextstyle.h index 811c580a..be4a8bcf 100644 --- a/lib/kformula/contextstyle.h +++ b/lib/kformula/contextstyle.h @@ -21,12 +21,12 @@ #ifndef CONTEXTSTYLE_H #define CONTEXTSTYLE_H -//Qt Include -#include <qcolor.h> -#include <qfont.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qvaluestack.h> +//TQt Include +#include <tqcolor.h> +#include <tqfont.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqvaluestack.h> //KDE Include #include <kconfig.h> @@ -117,45 +117,45 @@ public: bool syntaxHighlighting() const { return m_syntaxHighlighting; } void setSyntaxHighlighting( bool highlight ) { m_syntaxHighlighting = highlight; } - QColor getDefaultColor() const { return defaultColor; } - QColor getNumberColorPlain() const { return numberColor; } - QColor getOperatorColorPlain() const { return operatorColor; } - QColor getErrorColorPlain() const { return errorColor; } - QColor getEmptyColorPlain() const { return emptyColor; } - QColor getHelpColorPlain() const { return helpColor; } - QColor getNumberColor() const; - QColor getOperatorColor() const; - QColor getErrorColor() const; - QColor getEmptyColor() const; - QColor getHelpColor() const; - - void setDefaultColor( const QColor& ); - void setNumberColor( const QColor& ); - void setOperatorColor( const QColor& ); - void setErrorColor( const QColor& ); - void setEmptyColor( const QColor& ); - void setHelpColor( const QColor& ); - - QString getFontStyle() const { return m_fontStyleName; } - void setFontStyle( const QString& fontStyle, bool init = true ); - - QFont getMathFont() const { return mathFont; } - QFont getBracketFont() const { return bracketFont; } - QFont getDefaultFont() const { return defaultFont; } - QFont getNameFont() const { return nameFont; } - QFont getNumberFont() const { return numberFont; } - QFont getOperatorFont() const { return operatorFont; } - QFont getSymbolFont() const { return symbolFont; } - - void setMathFont( QFont f ) { defaultFont = f; } - void setBracketFont( QFont f ) { bracketFont = f; } - void setDefaultFont( QFont f ) { defaultFont = f; } - void setNameFont( QFont f ) { nameFont = f; } - void setNumberFont( QFont f ) { numberFont = f; } - void setOperatorFont( QFont f ) { operatorFont = f; } - - //const QStringList& requestedFonts() const; - //void setRequestedFonts( const QStringList& list ); + TQColor getDefaultColor() const { return defaultColor; } + TQColor getNumberColorPlain() const { return numberColor; } + TQColor getOperatorColorPlain() const { return operatorColor; } + TQColor getErrorColorPlain() const { return errorColor; } + TQColor getEmptyColorPlain() const { return emptyColor; } + TQColor getHelpColorPlain() const { return helpColor; } + TQColor getNumberColor() const; + TQColor getOperatorColor() const; + TQColor getErrorColor() const; + TQColor getEmptyColor() const; + TQColor getHelpColor() const; + + void setDefaultColor( const TQColor& ); + void setNumberColor( const TQColor& ); + void setOperatorColor( const TQColor& ); + void setErrorColor( const TQColor& ); + void setEmptyColor( const TQColor& ); + void setHelpColor( const TQColor& ); + + TQString getFontStyle() const { return m_fontStyleName; } + void setFontStyle( const TQString& fontStyle, bool init = true ); + + TQFont getMathFont() const { return mathFont; } + TQFont getBracketFont() const { return bracketFont; } + TQFont getDefaultFont() const { return defaultFont; } + TQFont getNameFont() const { return nameFont; } + TQFont getNumberFont() const { return numberFont; } + TQFont getOperatorFont() const { return operatorFont; } + TQFont getSymbolFont() const { return symbolFont; } + + void setMathFont( TQFont f ) { defaultFont = f; } + void setBracketFont( TQFont f ) { bracketFont = f; } + void setDefaultFont( TQFont f ) { defaultFont = f; } + void setNameFont( TQFont f ) { nameFont = f; } + void setNumberFont( TQFont f ) { numberFont = f; } + void setOperatorFont( TQFont f ) { operatorFont = f; } + + //const TQStringList& requestedFonts() const; + //void setRequestedFonts( const TQStringList& list ); double getReductionFactor( TextStyle tstyle ) const; @@ -256,22 +256,22 @@ private: TextStyleValues textStyleValues[ 4 ]; - QFont mathFont; - QFont bracketFont; - QFont defaultFont; - QFont nameFont; - QFont numberFont; - QFont operatorFont; - QFont symbolFont; + TQFont mathFont; + TQFont bracketFont; + TQFont defaultFont; + TQFont nameFont; + TQFont numberFont; + TQFont operatorFont; + TQFont symbolFont; - //QStringList m_requestedFonts; + //TQStringList m_requestedFonts; - QColor defaultColor; - QColor numberColor; - QColor operatorColor; - QColor errorColor; - QColor emptyColor; - QColor helpColor; + TQColor defaultColor; + TQColor numberColor; + TQColor operatorColor; + TQColor errorColor; + TQColor emptyColor; + TQColor helpColor; /** * The cursors movement style. You need to notify each cursor @@ -312,7 +312,7 @@ private: /** * true means to center the symbol between its indexes. - * false means alignment to the right. + * false means tqalignment to the right. */ bool centerSymbol; @@ -332,7 +332,7 @@ private: //SymbolTable table; FontStyle* m_fontStyle; - QString m_fontStyleName; + TQString m_fontStyleName; }; // Section 3.3.4.2, default values @@ -352,9 +352,9 @@ class StyleAttributes { bool customMathVariant() const ; CharStyle charStyle() const ; CharFamily charFamily() const ; - QColor color() const ; - QColor background() const ; - QFont font() const ; + TQColor color() const ; + TQColor background() const ; + TQFont font() const ; bool fontWeight() const ; bool customFontWeight() const ; bool fontStyle() const ; @@ -380,9 +380,9 @@ class StyleAttributes { void setCustomMathVariant( bool cmv ) { m_customMathVariant.push( cmv ); } void setCharStyle( CharStyle cs ) { m_charStyle.push( cs ); } void setCharFamily( CharFamily cf ) { m_charFamily.push( cf ); } - void setColor( const QColor& c ) { m_color.push( c ); } - void setBackground( const QColor& bg ) { m_background.push( bg ); } - void setFont( const QFont& f ) { m_font.push( f ); } + void setColor( const TQColor& c ) { m_color.push( c ); } + void setBackground( const TQColor& bg ) { m_background.push( bg ); } + void setFont( const TQFont& f ) { m_font.push( f ); } void setCustomFont( bool cf ) { m_customFontFamily.push ( cf ); } void setCustomFontWeight( bool cfw ) { m_customFontWeight.push( cfw ); } void setFontWeight( bool fw ) { m_fontWeight.push( fw ); } @@ -426,53 +426,53 @@ class StyleAttributes { private: // Size of the font in points (mathsize / fontsize) - QValueStack<double> m_size; + TQValueStack<double> m_size; // Whether a custom mathvariant attribute is in use - QValueStack<bool> m_customMathVariant; + TQValueStack<bool> m_customMathVariant; // Font style (mathvariant, fontweight, fontstyle) - QValueStack<CharStyle> m_charStyle; + TQValueStack<CharStyle> m_charStyle; // Font family (mathvariant) - QValueStack<CharFamily> m_charFamily; + TQValueStack<CharFamily> m_charFamily; // Foreground color (mathcolor, color) - QValueStack<QColor> m_color; + TQValueStack<TQColor> m_color; // Background color (mathbackground) - QValueStack<QColor> m_background; + TQValueStack<TQColor> m_background; // Font family (fontfamily) - QValueStack<QFont> m_font; + TQValueStack<TQFont> m_font; // Whether a custom fontfamily attribute is in use (instead of CharFamily) - QValueStack<bool> m_customFontFamily; + TQValueStack<bool> m_customFontFamily; // Font Weight (fontweight) - QValueStack<bool> m_fontWeight; + TQValueStack<bool> m_fontWeight; // Whether a custom fontweight attribute is in use - QValueStack<bool> m_customFontWeight; + TQValueStack<bool> m_customFontWeight; // Font Style (fontstyle) - QValueStack<bool> m_fontStyle; + TQValueStack<bool> m_fontStyle; // Whether a custom fontstyle attribute is in use - QValueStack<bool> m_customFontStyle; - - QValueStack<int> m_scriptLevel; - QValueStack<double> m_scriptSizeMultiplier; - QValueStack<double> m_scriptMinSize; - QValueStack<double> m_veryVeryThinMathSpace; - QValueStack<double> m_veryThinMathSpace; - QValueStack<double> m_thinMathSpace; - QValueStack<double> m_mediumMathSpace; - QValueStack<double> m_thickMathSpace; - QValueStack<double> m_veryThickMathSpace; - QValueStack<double> m_veryVeryThickMathSpace; - QValueStack<bool> m_displayStyle; - QValueStack<bool> m_customDisplayStyle; + TQValueStack<bool> m_customFontStyle; + + TQValueStack<int> m_scriptLevel; + TQValueStack<double> m_scriptSizeMultiplier; + TQValueStack<double> m_scriptMinSize; + TQValueStack<double> m_veryVeryThinMathSpace; + TQValueStack<double> m_veryThinMathSpace; + TQValueStack<double> m_thinMathSpace; + TQValueStack<double> m_mediumMathSpace; + TQValueStack<double> m_thickMathSpace; + TQValueStack<double> m_veryThickMathSpace; + TQValueStack<double> m_veryVeryThickMathSpace; + TQValueStack<bool> m_displayStyle; + TQValueStack<bool> m_customDisplayStyle; }; KFORMULA_NAMESPACE_END diff --git a/lib/kformula/creationstrategy.cc b/lib/kformula/creationstrategy.cc index 2a1a8aa1..592c744b 100644 --- a/lib/kformula/creationstrategy.cc +++ b/lib/kformula/creationstrategy.cc @@ -17,7 +17,7 @@ * Boston, MA 02110-1301, USA. */ -#include <qdom.h> +#include <tqdom.h> #include "bracketelement.h" #include "creationstrategy.h" @@ -36,7 +36,7 @@ KFORMULA_NAMESPACE_BEGIN -BasicElement* OrdinaryCreationStrategy::createElement( QString type, const QDomElement& ) +BasicElement* OrdinaryCreationStrategy::createElement( TQString type, const TQDomElement& ) { if ( type == "TEXT" ) return new TextElement(); else if ( type == "EMPTY" ) return new EmptyElement(); @@ -59,7 +59,7 @@ BasicElement* OrdinaryCreationStrategy::createElement( QString type, const QDomE } -TextElement* OrdinaryCreationStrategy::createTextElement( const QChar& ch, bool symbol ) +TextElement* OrdinaryCreationStrategy::createTextElement( const TQChar& ch, bool symbol ) { return new TextElement( ch, symbol ); } diff --git a/lib/kformula/creationstrategy.h b/lib/kformula/creationstrategy.h index c6599eed..a20322bd 100644 --- a/lib/kformula/creationstrategy.h +++ b/lib/kformula/creationstrategy.h @@ -22,8 +22,8 @@ #define CREATIONSTRATEGY_H -#include <qstring.h> -#include <qdom.h> +#include <tqstring.h> +#include <tqdom.h> #include "kformuladefs.h" @@ -55,10 +55,10 @@ class ElementCreationStrategy { public: virtual ~ElementCreationStrategy() {} - virtual BasicElement* createElement( QString type, const QDomElement& element ) = 0; + virtual BasicElement* createElement( TQString type, const TQDomElement& element ) = 0; /// there must always be a TextElement, so this can never return 0 - virtual TextElement* createTextElement( const QChar& ch, bool symbol=false ) = 0; + virtual TextElement* createTextElement( const TQChar& ch, bool symbol=false ) = 0; /// when this gets called the user has seen the matrix dialog and expects a matrix! virtual MatrixElement* createMatrixElement( uint rows, uint columns ) = 0; @@ -77,7 +77,7 @@ public: virtual IdentifierElement* createIdentifierElement() = 0; virtual OperatorElement* createOperatorElement() = 0; virtual NumberElement* createNumberElement() = 0; - virtual QString type() const = 0; + virtual TQString type() const = 0; }; @@ -86,9 +86,9 @@ public: */ class OrdinaryCreationStrategy : public ElementCreationStrategy { public: - virtual BasicElement* createElement( QString type, const QDomElement& element = 0 ); + virtual BasicElement* createElement( TQString type, const TQDomElement& element = 0 ); - virtual TextElement* createTextElement( const QChar& ch, bool symbol=false ); + virtual TextElement* createTextElement( const TQChar& ch, bool symbol=false ); virtual EmptyElement* createEmptyElement(); virtual NameSequence* createNameSequence(); virtual BracketElement* createBracketElement( SymbolType lhs, SymbolType rhs ); @@ -104,7 +104,7 @@ public: virtual IdentifierElement* createIdentifierElement(); virtual OperatorElement* createOperatorElement(); virtual NumberElement* createNumberElement(); - virtual QString type() const { return "Ordinary"; } + virtual TQString type() const { return "Ordinary"; } }; diff --git a/lib/kformula/elementtype.cc b/lib/kformula/elementtype.cc index 94ec0162..a2e44ee6 100644 --- a/lib/kformula/elementtype.cc +++ b/lib/kformula/elementtype.cc @@ -18,9 +18,9 @@ * Boston, MA 02110-1301, USA. */ -#include <qfont.h> -#include <qfontmetrics.h> -#include <qpainter.h> +#include <tqfont.h> +#include <tqfontmetrics.h> +#include <tqpainter.h> #include <kdebug.h> @@ -40,9 +40,9 @@ int ElementType::evilDestructionCount = 0; * Converts CharStyle and CharFamily to the MathML 'mathvariant' * attribute (see MathML spec 3.2.2). */ -QString format2variant( CharStyle style, CharFamily family ) +TQString format2variant( CharStyle style, CharFamily family ) { - QString result; + TQString result; switch( family ) { case normalFamily: @@ -90,9 +90,9 @@ ElementType::~ElementType() } -QString ElementType::text( SequenceElement* seq ) const +TQString ElementType::text( SequenceElement* seq ) const { - QString str; + TQString str; for ( uint i=start(); i<end(); ++i ) { str.append( seq->getChild( i )->getCharacter() ); } @@ -194,12 +194,12 @@ luPt ElementType::thickSpaceIfNotScript( const ContextStyle& context, } -QFont ElementType::getFont(const ContextStyle& context) +TQFont ElementType::getFont(const ContextStyle& context) { return context.getDefaultFont(); } -void ElementType::setUpPainter(const ContextStyle& context, QPainter& painter) +void ElementType::setUpPainter(const ContextStyle& context, TQPainter& painter) { painter.setPen(context.getDefaultColor()); } @@ -214,7 +214,7 @@ void ElementType::output() kdDebug( DEBUGID ) << start() << " - " << end() << endl; } -void ElementType::saveMathML( SequenceElement* se, QDomDocument& doc, QDomElement de, bool oasisFormat ) +void ElementType::saveMathML( SequenceElement* se, TQDomDocument& doc, TQDomElement de, bool oasisFormat ) { for ( uint i = from; i < to; ++i ) { se->getChild( i )->writeMathML( doc, de, oasisFormat ); @@ -304,13 +304,13 @@ TextType::TextType( SequenceParser* parser ) { } -void TextType::saveMathML( SequenceElement* se, QDomDocument& doc, QDomElement de, bool oasisFormat ) +void TextType::saveMathML( SequenceElement* se, TQDomDocument& doc, TQDomElement de, bool oasisFormat ) { for ( uint i = start(); i < end(); ++i ) { - QDomElement text = doc.createElement( oasisFormat ? "math:mi" : "mi" ); + TQDomElement text = doc.createElement( oasisFormat ? "math:mi" : "mi" ); BasicElement* be = se->getChild( i ); TextElement* te = static_cast<TextElement*>( be ); - QString mathvariant = format2variant( te->getCharStyle(), te->getCharFamily()); + TQString mathvariant = format2variant( te->getCharStyle(), te->getCharFamily()); if ( !mathvariant.isNull() ) text.setAttribute( "mathvariant", mathvariant ); @@ -318,7 +318,7 @@ void TextType::saveMathML( SequenceElement* se, QDomDocument& doc, QDomElement d de.appendChild( text ); if ( i != end() - 1 ) { - QDomElement op = doc.createElement( oasisFormat ? "math:mo" : "mo" ); + TQDomElement op = doc.createElement( oasisFormat ? "math:mo" : "mo" ); op.appendChild( doc.createEntityReference( "InvisibleTimes" ) ); de.appendChild( op ); } @@ -331,13 +331,13 @@ NameType::NameType( SequenceParser* parser ) { } -void NameType::saveMathML( SequenceElement* se, QDomDocument& doc, QDomElement de, bool oasisFormat ) +void NameType::saveMathML( SequenceElement* se, TQDomDocument& doc, TQDomElement de, bool oasisFormat ) { se->getChild( start() )->writeMathML( doc, de, oasisFormat ); /* - QDomElement name = doc.createElement( "mi" ); - QString value; + TQDomElement name = doc.createElement( "mi" ); + TQString value; for ( uint i = start(); i < end(); ++i ) { BasicElement* be = se->getChild( i ); //TextElement* te = static_cast<TextElement*>( be ); @@ -348,7 +348,7 @@ void NameType::saveMathML( SequenceElement* se, QDomDocument& doc, QDomElement d } -QFont NameType::getFont(const ContextStyle& context) +TQFont NameType::getFont(const ContextStyle& context) { return context.getNameFont(); } @@ -358,26 +358,26 @@ NumberType::NumberType( SequenceParser* parser ) { } -QFont NumberType::getFont(const ContextStyle& context) +TQFont NumberType::getFont(const ContextStyle& context) { return context.getNumberFont(); } -void NumberType::setUpPainter(const ContextStyle& context, QPainter& painter) +void NumberType::setUpPainter(const ContextStyle& context, TQPainter& painter) { painter.setPen(context.getNumberColor()); } -void NumberType::saveMathML( SequenceElement* se, QDomDocument& doc, QDomElement de, bool oasisFormat ) +void NumberType::saveMathML( SequenceElement* se, TQDomDocument& doc, TQDomElement de, bool oasisFormat ) { - QDomElement name = doc.createElement( oasisFormat ? "math:mn" : "mn" ); - QString value; + TQDomElement name = doc.createElement( oasisFormat ? "math:mn" : "mn" ); + TQString value; for ( uint i = start(); i < end(); ++i ) { BasicElement* be = se->getChild( i ); value += be->getCharacter(); } TextElement* te = static_cast<TextElement*>( se->getChild( start() ) ); - QString mathvariant = format2variant( te->getCharStyle(), te->getCharFamily() ); + TQString mathvariant = format2variant( te->getCharStyle(), te->getCharFamily() ); if ( !mathvariant.isNull() ) name.setAttribute( "mathvariant", mathvariant ); @@ -397,21 +397,21 @@ AbstractOperatorType::AbstractOperatorType( SequenceParser* parser ) { } -void AbstractOperatorType::saveMathML( SequenceElement* se, QDomDocument& doc, QDomElement de, bool oasisFormat ) +void AbstractOperatorType::saveMathML( SequenceElement* se, TQDomDocument& doc, TQDomElement de, bool oasisFormat ) { - QDomElement op = doc.createElement( oasisFormat ? "math:mo" : "mo" ); + TQDomElement op = doc.createElement( oasisFormat ? "math:mo" : "mo" ); BasicElement* be = se->getChild( start() ); if ( be->getCharacter().latin1() != 0 ) { // latin-1 char op.appendChild( doc.createTextNode( be->getCharacter() ) ); } else { - // unicode char - QString s; - op.appendChild( doc.createEntityReference( s.sprintf( "#x%05X", be->getCharacter().unicode() ) ) ); + // tqunicode char + TQString s; + op.appendChild( doc.createEntityReference( s.sprintf( "#x%05X", be->getCharacter().tqunicode() ) ) ); } TextElement* te = static_cast<TextElement*>( be ); - QString mathvariant = format2variant( te->getCharStyle(), te->getCharFamily() ); + TQString mathvariant = format2variant( te->getCharStyle(), te->getCharFamily() ); if ( !mathvariant.isNull() ) op.setAttribute( "mathvariant", mathvariant ); @@ -466,12 +466,12 @@ luPt OperatorType::getSpaceAfter( InnerElementType*, } -QFont OperatorType::getFont(const ContextStyle& context) +TQFont OperatorType::getFont(const ContextStyle& context) { return context.getOperatorFont(); } -void OperatorType::setUpPainter(const ContextStyle& context, QPainter& painter) +void OperatorType::setUpPainter(const ContextStyle& context, TQPainter& painter) { painter.setPen(context.getOperatorColor()); } @@ -524,12 +524,12 @@ luPt RelationType::getSpaceAfter( InnerElementType*, return thickSpaceIfNotScript( context, tstyle, factor ); } -QFont RelationType::getFont( const ContextStyle& context ) +TQFont RelationType::getFont( const ContextStyle& context ) { return context.getOperatorFont(); } -void RelationType::setUpPainter( const ContextStyle& context, QPainter& painter ) +void RelationType::setUpPainter( const ContextStyle& context, TQPainter& painter ) { painter.setPen(context.getOperatorColor()); } @@ -599,12 +599,12 @@ luPt PunctuationType::getSpaceAfter( InnerElementType*, return thinSpaceIfNotScript( context, tstyle, factor ); } -QFont PunctuationType::getFont( const ContextStyle& context ) +TQFont PunctuationType::getFont( const ContextStyle& context ) { return context.getOperatorFont(); } -void PunctuationType::setUpPainter( const ContextStyle& context, QPainter& painter ) +void PunctuationType::setUpPainter( const ContextStyle& context, TQPainter& painter ) { painter.setPen( context.getDefaultColor() ); } diff --git a/lib/kformula/elementtype.h b/lib/kformula/elementtype.h index 18c55f25..7fc44144 100644 --- a/lib/kformula/elementtype.h +++ b/lib/kformula/elementtype.h @@ -21,14 +21,14 @@ #ifndef ELEMENTTYPE_H #define ELEMENTTYPE_H -#include <qfont.h> -#include <qstring.h> -#include <qdom.h> +#include <tqfont.h> +#include <tqstring.h> +#include <tqdom.h> #include "contextstyle.h" #include "kformuladefs.h" -class QPainter; +class TQPainter; KFORMULA_NAMESPACE_BEGIN @@ -61,9 +61,9 @@ public: /** * @returns the spanned text. seq must be the original - * parent sequence. + * tqparent sequence. */ - virtual QString text( SequenceElement* seq ) const; + virtual TQString text( SequenceElement* seq ) const; /** * @returns the position of the first character @@ -114,12 +114,12 @@ public: /** * @returns the font to be used for this kind of element */ - virtual QFont getFont( const ContextStyle& context ); + virtual TQFont getFont( const ContextStyle& context ); /** * sets the painters pen to a appropriate value */ - virtual void setUpPainter( const ContextStyle& context, QPainter& painter ); + virtual void setUpPainter( const ContextStyle& context, TQPainter& painter ); // debug static int getEvilDestructionCount() { return evilDestructionCount; } @@ -133,7 +133,7 @@ public: ElementType* getPrev() const { return prev; } - virtual void saveMathML( SequenceElement* se, QDomDocument& doc, QDomElement de, bool oasisFormat = false ); + virtual void saveMathML( SequenceElement* se, TQDomDocument& doc, TQDomElement de, bool oasisFormat = false ); virtual bool multiElement() const { return false; } @@ -223,13 +223,13 @@ public: /** * @returns the spanned text. seq must be the original - * parent sequence. + * tqparent sequence. */ - virtual QString text( SequenceElement* /*seq*/ ) const { return m_text; } + virtual TQString text( SequenceElement* /*seq*/ ) const { return m_text; } private: - QString m_text; + TQString m_text; }; @@ -240,7 +240,7 @@ private: class TextType : public MultiElementType { public: TextType( SequenceParser* parser ); - virtual void saveMathML( SequenceElement* se, QDomDocument& doc, QDomElement de, bool oasisFormat = false ); + virtual void saveMathML( SequenceElement* se, TQDomDocument& doc, TQDomElement de, bool oasisFormat = false ); }; @@ -254,14 +254,14 @@ public: /** * @returns the font to be used for this kind of element */ - virtual QFont getFont(const ContextStyle& context); + virtual TQFont getFont(const ContextStyle& context); /** * sets the painters pen to a appropriate value */ - virtual void setUpPainter(const ContextStyle& context, QPainter& painter); + virtual void setUpPainter(const ContextStyle& context, TQPainter& painter); - virtual void saveMathML( SequenceElement* se, QDomDocument& doc, QDomElement de, bool oasisFormat = false ); + virtual void saveMathML( SequenceElement* se, TQDomDocument& doc, TQDomElement de, bool oasisFormat = false ); }; @@ -284,9 +284,9 @@ public: /** * @returns the font to be used for this kind of element */ - virtual QFont getFont( const ContextStyle& context ); + virtual TQFont getFont( const ContextStyle& context ); - virtual void saveMathML( SequenceElement* se, QDomDocument& doc, QDomElement de, bool oasisFormat = false ); + virtual void saveMathML( SequenceElement* se, TQDomDocument& doc, TQDomElement de, bool oasisFormat = false ); private: }; @@ -296,7 +296,7 @@ class AbstractOperatorType : public SingleElementType { public: AbstractOperatorType( SequenceParser* parser ); - void saveMathML( SequenceElement* se, QDomDocument& doc, QDomElement de, bool oasisFormat = false ); + void saveMathML( SequenceElement* se, TQDomDocument& doc, TQDomElement de, bool oasisFormat = false ); }; class OperatorType : public AbstractOperatorType { @@ -326,12 +326,12 @@ public: /** * @returns the font to be used for this kind of element */ - virtual QFont getFont(const ContextStyle& context); + virtual TQFont getFont(const ContextStyle& context); /** * sets the painters pen to a appropriate value */ - virtual void setUpPainter(const ContextStyle& context, QPainter& painter); + virtual void setUpPainter(const ContextStyle& context, TQPainter& painter); }; @@ -362,12 +362,12 @@ public: /** * @returns the font to be used for this kind of element */ - virtual QFont getFont( const ContextStyle& context ); + virtual TQFont getFont( const ContextStyle& context ); /** * sets the painters pen to a appropriate value */ - virtual void setUpPainter( const ContextStyle& context, QPainter& painter ); + virtual void setUpPainter( const ContextStyle& context, TQPainter& painter ); }; @@ -406,12 +406,12 @@ public: /** * @returns the font to be used for this kind of element */ - virtual QFont getFont( const ContextStyle& context ); + virtual TQFont getFont( const ContextStyle& context ); /** * sets the painters pen to a appropriate value */ - virtual void setUpPainter( const ContextStyle& context, QPainter& painter ); + virtual void setUpPainter( const ContextStyle& context, TQPainter& painter ); }; diff --git a/lib/kformula/encloseelement.cc b/lib/kformula/encloseelement.cc index 384f6b92..05617361 100644 --- a/lib/kformula/encloseelement.cc +++ b/lib/kformula/encloseelement.cc @@ -21,10 +21,10 @@ KFORMULA_NAMESPACE_BEGIN -EncloseElement::EncloseElement( BasicElement* parent ) : SequenceElement( parent ) { +EncloseElement::EncloseElement( BasicElement* tqparent ) : SequenceElement( tqparent ) { } -bool EncloseElement::readAttributesFromMathMLDom(const QDomElement& element) +bool EncloseElement::readAttributesFromMathMLDom(const TQDomElement& element) { if ( ! BasicElement::readAttributesFromMathMLDom( element ) ) { return false; @@ -34,7 +34,7 @@ bool EncloseElement::readAttributesFromMathMLDom(const QDomElement& element) return true; } -void EncloseElement::writeMathMLAttributes( QDomElement& element ) const +void EncloseElement::writeMathMLAttributes( TQDomElement& element ) const { if ( ! m_notation.isNull() ) { element.setAttribute( "notation", m_notation ); diff --git a/lib/kformula/encloseelement.h b/lib/kformula/encloseelement.h index 9bec85b0..b6b16a0d 100644 --- a/lib/kformula/encloseelement.h +++ b/lib/kformula/encloseelement.h @@ -27,14 +27,14 @@ KFORMULA_NAMESPACE_BEGIN class EncloseElement : public SequenceElement { typedef SequenceElement inherited; public: - EncloseElement( BasicElement* parent = 0 ); + EncloseElement( BasicElement* tqparent = 0 ); private: - virtual bool readAttributesFromMathMLDom(const QDomElement& element); - virtual QString getElementName() const { return "menclose"; } - virtual void writeMathMLAttributes( QDomElement& element ) const ; + virtual bool readAttributesFromMathMLDom(const TQDomElement& element); + virtual TQString getElementName() const { return "menclose"; } + virtual void writeMathMLAttributes( TQDomElement& element ) const ; - QString m_notation; + TQString m_notation; }; KFORMULA_NAMESPACE_END diff --git a/lib/kformula/entities.h b/lib/kformula/entities.h index 38a5a0e8..78e39315 100644 --- a/lib/kformula/entities.h +++ b/lib/kformula/entities.h @@ -38,7 +38,7 @@ struct entityMap { return strcmp( name, right ) < 0; } const char* name; - const uint unicode; + const uint tqunicode; }; extern const entityMap entities[]; diff --git a/lib/kformula/errorelement.cc b/lib/kformula/errorelement.cc index f6141c4f..0bf80237 100644 --- a/lib/kformula/errorelement.cc +++ b/lib/kformula/errorelement.cc @@ -17,35 +17,35 @@ * Boston, MA 02110-1301, USA. */ -#include <qpainter.h> +#include <tqpainter.h> #include "errorelement.h" KFORMULA_NAMESPACE_BEGIN -ErrorElement::ErrorElement( BasicElement* parent ) : SequenceElement( parent ) { +ErrorElement::ErrorElement( BasicElement* tqparent ) : SequenceElement( tqparent ) { } /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ -void ErrorElement::draw( QPainter& painter, const LuPixelRect& r, +void ErrorElement::draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ) + const LuPixelPoint& tqparentOrigin ) { - LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); + LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); - painter.fillRect( context.layoutUnitToPixelX( myPos.x() ), - context.layoutUnitToPixelY( myPos.y() ), - context.layoutUnitToPixelX( getWidth() ), - context.layoutUnitToPixelY( getHeight() ), + painter.fillRect( context.tqlayoutUnitToPixelX( myPos.x() ), + context.tqlayoutUnitToPixelY( myPos.y() ), + context.tqlayoutUnitToPixelX( getWidth() ), + context.tqlayoutUnitToPixelY( getHeight() ), context.getErrorColor() ); - inherited::draw( painter, r, context, tstyle, istyle, style, parentOrigin ); + inherited::draw( painter, r, context, tstyle, istyle, style, tqparentOrigin ); } KFORMULA_NAMESPACE_END diff --git a/lib/kformula/errorelement.h b/lib/kformula/errorelement.h index fa3b1e76..bc23b5e2 100644 --- a/lib/kformula/errorelement.h +++ b/lib/kformula/errorelement.h @@ -27,22 +27,22 @@ KFORMULA_NAMESPACE_BEGIN class ErrorElement : public SequenceElement { typedef SequenceElement inherited; public: - ErrorElement( BasicElement* parent = 0 ); + ErrorElement( BasicElement* tqparent = 0 ); /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); private: - virtual QString getElementName() const { return "merror"; } + virtual TQString getElementName() const { return "merror"; } }; diff --git a/lib/kformula/fontstyle.cc b/lib/kformula/fontstyle.cc index 3287120c..0d1792e0 100644 --- a/lib/kformula/fontstyle.cc +++ b/lib/kformula/fontstyle.cc @@ -18,10 +18,10 @@ * Boston, MA 02110-1301, USA. */ -#include <qpainter.h> -#include <qpen.h> -#include <qfontdatabase.h> -#include <qapplication.h> +#include <tqpainter.h> +#include <tqpen.h> +#include <tqfontdatabase.h> +#include <tqapplication.h> #include <kstaticdeleter.h> #include <klocale.h> @@ -48,19 +48,19 @@ bool FontStyle::init( ContextStyle* style, bool install ) return true; } -// Cache the family list from QFontDatabase after fixing it up (no foundry, lowercase) +// Cache the family list from TQFontDatabase after fixing it up (no foundry, lowercase) class FontList { public: FontList() { - QFontDatabase db; - const QStringList lst = db.families(); - for ( QStringList::const_iterator it = lst.begin(), end = lst.end() ; it != end ; ++it ) { - const QString name = *it; - int i = name.find('['); - QString family = name; + TQFontDatabase db; + const TQStringList lst = db.tqfamilies(); + for ( TQStringList::const_iterator it = lst.begin(), end = lst.end() ; it != end ; ++it ) { + const TQString name = *it; + int i = name.tqfind('['); + TQString family = name; // Remove foundry if ( i > -1 ) { - const int li = name.findRev(']'); + const int li = name.tqfindRev(']'); if (i < li) { if (name[i - 1] == ' ') i--; @@ -70,15 +70,15 @@ public: m_fontNames.append( family.lower() ); } } - bool hasFont( const QString& fontName ) const { - return m_fontNames.find( fontName ) != m_fontNames.end(); + bool hasFont( const TQString& fontName ) const { + return m_fontNames.tqfind( fontName ) != m_fontNames.end(); } - QStringList m_fontNames; + TQStringList m_fontNames; }; static FontList* s_fontList = 0; static KStaticDeleter<FontList> s_fontList_sd; -void FontStyle::testFont( QStringList& missing, const QString& fontName ) { +void FontStyle::testFont( TQStringList& missing, const TQString& fontName ) { if ( !s_fontList ) s_fontList_sd.setObject( s_fontList, new FontList() ); if ( !s_fontList->hasFont( fontName ) ) { @@ -88,18 +88,18 @@ void FontStyle::testFont( QStringList& missing, const QString& fontName ) { } -QStringList FontStyle::missingFonts( bool install ) +TQStringList FontStyle::missingFonts( bool install ) { if (!m_installed && install) installFonts(); - QStringList missing = missingFontsInternal(); + TQStringList missing = missingFontsInternal(); return missing; } -QStringList FontStyle::missingFontsInternal() +TQStringList FontStyle::missingFontsInternal() { - QStringList missing; + TQStringList missing; testFont( missing, "cmex10" ); testFont( missing, "arev sans"); @@ -111,11 +111,11 @@ void FontStyle::installFonts() { if (m_installed) return; - QStringList missing = missingFontsInternal(); + TQStringList missing = missingFontsInternal(); if (!missing.isEmpty()) { - QStringList urlList; - for (QStringList::iterator it = missing.begin(); it != missing.end(); ++it) + TQStringList urlList; + for (TQStringList::iterator it = missing.begin(); it != missing.end(); ++it) { if ( *it == "arev sans" ) { if (!KIO::NetAccess::exists("fonts:/Personal/Arev.ttf", true, NULL)) @@ -133,7 +133,7 @@ void FontStyle::installFonts() } } KIO::copy(urlList, "fonts:/Personal/", false); - KMessageBox::information(qApp->mainWidget(), + KMessageBox::information(tqApp->mainWidget(), i18n("Some fonts have been installed to assure that symbols in formulas are properly visualized. You must restart the application in order so that changes take effect")); } m_installed = true; @@ -146,45 +146,45 @@ Artwork* FontStyle::createArtwork( SymbolType type ) const // We claim that all chars come from the same font. // It's up to the font tables to ensure this. -const QChar leftRoundBracket[] = { +const TQChar leftRoundBracket[] = { 0x30, // uppercorner 0x40, // lowercorner 0x42 // line }; -const QChar leftSquareBracket[] = { +const TQChar leftSquareBracket[] = { 0x32, // uppercorner 0x34, // lowercorner 0x36 // line }; -const QChar leftCurlyBracket[] = { +const TQChar leftCurlyBracket[] = { 0x38, // uppercorner 0x3A, // lowercorner 0x3E, // line 0x3C // middle }; -const QChar leftLineBracket[] = { +const TQChar leftLineBracket[] = { 0x36, // line 0x36, // line 0x36 // line }; -const QChar rightLineBracket[] = { +const TQChar rightLineBracket[] = { 0x37, // line 0x37, // line 0x37 // line }; -const QChar rightRoundBracket[] = { +const TQChar rightRoundBracket[] = { 0x31, // uppercorner 0x41, // lowercorner 0x43 // line }; -const QChar rightSquareBracket[] = { +const TQChar rightSquareBracket[] = { 0x33, // uppercorner 0x35, // lowercorner 0x37 // line }; -const QChar rightCurlyBracket[] = { +const TQChar rightCurlyBracket[] = { 0x39, // uppercorner 0x3B, // lowercorner 0x3E, // line @@ -266,17 +266,17 @@ static short cmex_nextchar( short ch ) bool Artwork::calcCMDelimiterSize( const ContextStyle& context, uchar c, luPt fontSize, - luPt parentSize ) + luPt tqparentSize ) { - QFont f( "cmex10" ); - f.setPointSizeFloat( context.layoutUnitPtToPt( fontSize ) ); - QFontMetrics fm( f ); + TQFont f( "cmex10" ); + f.setPointSizeFloat( context.tqlayoutUnitPtToPt( fontSize ) ); + TQFontMetrics fm( f ); for ( char i=1; c != 0; ++i ) { LuPixelRect bound = fm.boundingRect( c ); luPt height = context.ptToLayoutUnitPt( bound.height() ); - if ( height >= parentSize ) { + if ( height >= tqparentSize ) { luPt width = context.ptToLayoutUnitPt( fm.width( c ) ); luPt baseline = context.ptToLayoutUnitPt( -bound.top() ); @@ -299,9 +299,9 @@ bool Artwork::calcCMDelimiterSize( const ContextStyle& context, void Artwork::calcLargest( const ContextStyle& context, uchar c, luPt fontSize ) { - QFont f( "cmex10" ); - f.setPointSizeFloat( context.layoutUnitPtToPt( fontSize ) ); - QFontMetrics fm( f ); + TQFont f( "cmex10" ); + f.setPointSizeFloat( context.tqlayoutUnitPtToPt( fontSize ) ); + TQFontMetrics fm( f ); cmChar = c; for ( ;; ) { @@ -324,26 +324,26 @@ void Artwork::calcLargest( const ContextStyle& context, } -void Artwork::drawCMDelimiter( QPainter& painter, const ContextStyle& style, +void Artwork::drawCMDelimiter( TQPainter& painter, const ContextStyle& style, luPixel x, luPixel y, luPt height ) { - QFont f( "cmex10" ); - f.setPointSizeFloat( style.layoutUnitToFontSize( height, false ) ); + TQFont f( "cmex10" ); + f.setPointSizeFloat( style.tqlayoutUnitToFontSize( height, false ) ); painter.setFont( f ); - painter.drawText( style.layoutUnitToPixelX( x ), - style.layoutUnitToPixelY( y + getBaseline() ), - QString( QChar( cmChar ) ) ); + painter.drawText( style.tqlayoutUnitToPixelX( x ), + style.tqlayoutUnitToPixelY( y + getBaseline() ), + TQString( TQChar( cmChar ) ) ); // Debug #if 0 - QFontMetrics fm( f ); + TQFontMetrics fm( f ); LuPixelRect bound = fm.boundingRect( cmChar ); - painter.setBrush(Qt::NoBrush); - painter.setPen(Qt::green); - painter.drawRect( style.layoutUnitToPixelX( x ), - style.layoutUnitToPixelY( y ), + painter.setBrush(TQt::NoBrush); + painter.setPen(TQt::green); + painter.drawRect( style.tqlayoutUnitToPixelX( x ), + style.tqlayoutUnitToPixelY( y ), fm.width( cmChar ), bound.height() ); #endif @@ -359,7 +359,7 @@ Artwork::Artwork(SymbolType t) void Artwork::calcSizes( const ContextStyle& style, ContextStyle::TextStyle tstyle, double factor, - luPt parentSize ) + luPt tqparentSize ) { setBaseline( -1 ); cmChar = -1; @@ -367,86 +367,86 @@ void Artwork::calcSizes( const ContextStyle& style, switch (getType()) { case LeftSquareBracket: if ( calcCMDelimiterSize( style, cmex_LeftSquareBracket, - mySize, parentSize ) ) { + mySize, tqparentSize ) ) { return; } - calcRoundBracket( style, leftSquareBracket, parentSize, mySize ); + calcRoundBracket( style, leftSquareBracket, tqparentSize, mySize ); break; case RightSquareBracket: if ( calcCMDelimiterSize( style, cmex_RightSquareBracket, - mySize, parentSize ) ) { + mySize, tqparentSize ) ) { return; } - calcRoundBracket( style, rightSquareBracket, parentSize, mySize ); + calcRoundBracket( style, rightSquareBracket, tqparentSize, mySize ); break; case LeftLineBracket: - calcRoundBracket( style, leftLineBracket, parentSize, mySize ); + calcRoundBracket( style, leftLineBracket, tqparentSize, mySize ); setWidth( getWidth()/2 ); break; case RightLineBracket: - calcRoundBracket( style, rightLineBracket, parentSize, mySize ); + calcRoundBracket( style, rightLineBracket, tqparentSize, mySize ); setWidth( getWidth()/2 ); break; case SlashBracket: if ( calcCMDelimiterSize( style, cmex_SlashBracket, - mySize, parentSize ) ) { + mySize, tqparentSize ) ) { return; } calcLargest( style, cmex_SlashBracket, mySize ); break; case BackSlashBracket: if ( calcCMDelimiterSize( style, cmex_BackSlashBracket, - mySize, parentSize ) ) { + mySize, tqparentSize ) ) { return; } calcLargest( style, cmex_BackSlashBracket, mySize ); break; case LeftCornerBracket: if ( calcCMDelimiterSize( style, cmex_LeftCornerBracket, - mySize, parentSize ) ) { + mySize, tqparentSize ) ) { return; } calcLargest( style, cmex_LeftCornerBracket, mySize ); break; case RightCornerBracket: if ( calcCMDelimiterSize( style, cmex_RightCornerBracket, - mySize, parentSize ) ) { + mySize, tqparentSize ) ) { return; } calcLargest( style, cmex_RightCornerBracket, mySize ); break; case LeftRoundBracket: if ( calcCMDelimiterSize( style, cmex_LeftRoundBracket, - mySize, parentSize ) ) { + mySize, tqparentSize ) ) { return; } - calcRoundBracket( style, leftRoundBracket, parentSize, mySize ); + calcRoundBracket( style, leftRoundBracket, tqparentSize, mySize ); break; case RightRoundBracket: if ( calcCMDelimiterSize( style, cmex_RightRoundBracket, - mySize, parentSize ) ) { + mySize, tqparentSize ) ) { return; } - calcRoundBracket( style, rightRoundBracket, parentSize, mySize ); + calcRoundBracket( style, rightRoundBracket, tqparentSize, mySize ); break; case EmptyBracket: - setHeight(parentSize); + setHeight(tqparentSize); //setWidth(style.getEmptyRectWidth()); setWidth(0); break; case LeftCurlyBracket: if ( calcCMDelimiterSize( style, cmex_LeftCurlyBracket, - mySize, parentSize ) ) { + mySize, tqparentSize ) ) { return; } - calcCurlyBracket( style, leftCurlyBracket, parentSize, mySize ); + calcCurlyBracket( style, leftCurlyBracket, tqparentSize, mySize ); break; case RightCurlyBracket: if ( calcCMDelimiterSize( style, cmex_RightCurlyBracket, - mySize, parentSize ) ) { + mySize, tqparentSize ) ) { return; } - calcCurlyBracket( style, rightCurlyBracket, parentSize, mySize ); + calcCurlyBracket( style, rightCurlyBracket, tqparentSize, mySize ); break; case Integral: calcCharSize( style, style.getBracketFont(), mySize, cmex_Int ); @@ -514,13 +514,13 @@ void Artwork::calcSizes( const ContextStyle& style, } -void Artwork::draw(QPainter& painter, const LuPixelRect& /*r*/, +void Artwork::draw(TQPainter& painter, const LuPixelRect& /*r*/, const ContextStyle& context, ContextStyle::TextStyle tstyle, - StyleAttributes& style, const LuPixelPoint& parentOrigin) + StyleAttributes& style, const LuPixelPoint& tqparentOrigin) { luPt mySize = context.getAdjustedSize( tstyle, style.sizeFactor() ); - luPixel myX = parentOrigin.x() + getX(); - luPixel myY = parentOrigin.y() + getY(); + luPixel myX = tqparentOrigin.x() + getX(); + luPixel myY = tqparentOrigin.y() + getY(); /* if ( !LuPixelRect( myX, myY, getWidth(), getHeight() ).intersects( r ) ) return; @@ -572,7 +572,7 @@ void Artwork::draw(QPainter& painter, const LuPixelRect& /*r*/, } } -void Artwork::draw(QPainter& painter, const LuPixelRect& , +void Artwork::draw(TQPainter& painter, const LuPixelRect& , const ContextStyle& context, ContextStyle::TextStyle tstyle, StyleAttributes& style, luPt , const LuPixelPoint& origin) { @@ -672,45 +672,45 @@ void Artwork::draw(QPainter& painter, const LuPixelRect& , case EmptyBracket: break; case Integral: - drawCharacter(painter, context, QFont( "cmex10" ), myX, myY, mySize, cmex_Int); + drawCharacter(painter, context, TQFont( "cmex10" ), myX, myY, mySize, cmex_Int); break; case Sum: - drawCharacter(painter, context, QFont( "cmex10" ), myX, myY, mySize, cmex_Sum); + drawCharacter(painter, context, TQFont( "cmex10" ), myX, myY, mySize, cmex_Sum); break; case Product: - drawCharacter(painter, context, QFont( "cmex10" ), myX, myY, mySize, cmex_Prod); + drawCharacter(painter, context, TQFont( "cmex10" ), myX, myY, mySize, cmex_Prod); break; } // debug -// painter.setBrush(Qt::NoBrush); -// painter.setPen(Qt::green); -// painter.drawRect( context.layoutUnitToPixelX( myX ), -// context.layoutUnitToPixelY( myY ), -// context.layoutUnitToPixelX( getWidth() ), -// context.layoutUnitToPixelY( getHeight() ) ); +// painter.setBrush(TQt::NoBrush); +// painter.setPen(TQt::green); +// painter.drawRect( context.tqlayoutUnitToPixelX( myX ), +// context.tqlayoutUnitToPixelY( myY ), +// context.tqlayoutUnitToPixelX( getWidth() ), +// context.tqlayoutUnitToPixelY( getHeight() ) ); } -void Artwork::calcCharSize( const ContextStyle& style, luPt height, QChar ch ) +void Artwork::calcCharSize( const ContextStyle& style, luPt height, TQChar ch ) { calcCharSize( style, style.getMathFont(), height, ch ); } -void Artwork::drawCharacter( QPainter& painter, const ContextStyle& style, +void Artwork::drawCharacter( TQPainter& painter, const ContextStyle& style, luPixel x, luPixel y, - luPt height, QChar ch ) + luPt height, TQChar ch ) { drawCharacter( painter, style, style.getMathFont(), x, y, height, ch ); } -void Artwork::calcCharSize( const ContextStyle& style, QFont f, - luPt height, QChar c ) +void Artwork::calcCharSize( const ContextStyle& style, TQFont f, + luPt height, TQChar c ) { - f.setPointSizeFloat( style.layoutUnitPtToPt( height ) ); + f.setPointSizeFloat( style.tqlayoutUnitPtToPt( height ) ); //f.setPointSize( height ); - QFontMetrics fm(f); + TQFontMetrics fm(f); setWidth( style.ptToLayoutUnitPt( fm.width( c ) ) ); LuPixelRect bound = fm.boundingRect( c ); setHeight( style.ptToLayoutUnitPt( bound.height() ) ); @@ -718,70 +718,70 @@ void Artwork::calcCharSize( const ContextStyle& style, QFont f, } -void Artwork::drawCharacter( QPainter& painter, const ContextStyle& style, - QFont f, +void Artwork::drawCharacter( TQPainter& painter, const ContextStyle& style, + TQFont f, luPixel x, luPixel y, luPt height, uchar c ) { - f.setPointSizeFloat( style.layoutUnitToFontSize( height, false ) ); + f.setPointSizeFloat( style.tqlayoutUnitToFontSize( height, false ) ); painter.setFont( f ); - painter.drawText( style.layoutUnitToPixelX( x ), - style.layoutUnitToPixelY( y+getBaseline() ), - QString( QChar( c ) ) ); + painter.drawText( style.tqlayoutUnitToPixelX( x ), + style.tqlayoutUnitToPixelY( y+getBaseline() ), + TQString( TQChar( c ) ) ); } -void Artwork::calcRoundBracket( const ContextStyle& style, const QChar chars[], +void Artwork::calcRoundBracket( const ContextStyle& style, const TQChar chars[], luPt height, luPt charHeight ) { uchar uppercorner = chars[0]; uchar lowercorner = chars[1]; //uchar line = style.symbolTable().character( chars[2] ); - QFont f = style.getBracketFont(); - f.setPointSizeFloat( style.layoutUnitPtToPt( charHeight ) ); - QFontMetrics fm( f ); + TQFont f = style.getBracketFont(); + f.setPointSizeFloat( style.tqlayoutUnitPtToPt( charHeight ) ); + TQFontMetrics fm( f ); LuPtRect upperBound = fm.boundingRect( uppercorner ); LuPtRect lowerBound = fm.boundingRect( lowercorner ); //LuPtRect lineBound = fm.boundingRect( line ); - setWidth( style.ptToLayoutUnitPt( fm.width( QChar( uppercorner ) ) ) ); + setWidth( style.ptToLayoutUnitPt( fm.width( TQChar( uppercorner ) ) ) ); luPt edgeHeight = style.ptToLayoutUnitPt( upperBound.height()+lowerBound.height() ); //luPt lineHeight = style.ptToLayoutUnitPt( lineBound.height() ); //setHeight( edgeHeight + ( ( height-edgeHeight-1 ) / lineHeight + 1 ) * lineHeight ); - setHeight( QMAX( edgeHeight, height ) ); + setHeight( TQMAX( edgeHeight, height ) ); } -void Artwork::drawBigRoundBracket( QPainter& p, const ContextStyle& style, const QChar chars[], +void Artwork::drawBigRoundBracket( TQPainter& p, const ContextStyle& style, const TQChar chars[], luPixel x, luPixel y, luPt charHeight ) { uchar uppercorner = chars[0]; uchar lowercorner = chars[1]; uchar line = chars[2]; - QFont f = style.getBracketFont(); - f.setPointSizeFloat( style.layoutUnitToFontSize( charHeight, false ) ); + TQFont f = style.getBracketFont(); + f.setPointSizeFloat( style.tqlayoutUnitToFontSize( charHeight, false ) ); p.setFont(f); - QFontMetrics fm(f); - QRect upperBound = fm.boundingRect(uppercorner); - QRect lowerBound = fm.boundingRect(lowercorner); - QRect lineBound = fm.boundingRect(line); + TQFontMetrics fm(f); + TQRect upperBound = fm.boundingRect(uppercorner); + TQRect lowerBound = fm.boundingRect(lowercorner); + TQRect lineBound = fm.boundingRect(line); - pixel ptX = style.layoutUnitToPixelX( x ); - pixel ptY = style.layoutUnitToPixelY( y ); - pixel height = style.layoutUnitToPixelY( getHeight() ); + pixel ptX = style.tqlayoutUnitToPixelX( x ); + pixel ptY = style.tqlayoutUnitToPixelY( y ); + pixel height = style.tqlayoutUnitToPixelY( getHeight() ); -// p.setPen( Qt::red ); +// p.setPen( TQt::red ); // //p.drawRect( ptX, ptY, upperBound.width(), upperBound.height() + lowerBound.height() ); -// p.drawRect( ptX, ptY, style.layoutUnitToPixelX( getWidth() ), -// style.layoutUnitToPixelY( getHeight() ) ); +// p.drawRect( ptX, ptY, style.tqlayoutUnitToPixelX( getWidth() ), +// style.tqlayoutUnitToPixelY( getHeight() ) ); -// p.setPen( Qt::black ); - p.drawText( ptX, ptY-upperBound.top(), QString( QChar( uppercorner ) ) ); +// p.setPen( TQt::black ); + p.drawText( ptX, ptY-upperBound.top(), TQString( TQChar( uppercorner ) ) ); p.drawText( ptX, ptY+height-lowerBound.top()-lowerBound.height(), - QString( QChar( lowercorner ) ) ); + TQString( TQChar( lowercorner ) ) ); // for printing //pt safety = lineBound.height() / 10.0; @@ -789,19 +789,19 @@ void Artwork::drawBigRoundBracket( QPainter& p, const ContextStyle& style, const pixel gap = height - upperBound.height() - lowerBound.height(); pixel lineHeight = lineBound.height() - safety; - int lineCount = qRound( static_cast<double>( gap ) / lineHeight ); + int lineCount = tqRound( static_cast<double>( gap ) / lineHeight ); pixel start = upperBound.height()-lineBound.top() - safety; for (int i = 0; i < lineCount; i++) { - p.drawText( ptX, ptY+start+i*lineHeight, QString(QChar(line))); + p.drawText( ptX, ptY+start+i*lineHeight, TQString(TQChar(line))); } pixel remaining = gap - lineCount*lineHeight; pixel dist = ( lineHeight - remaining ) / 2; p.drawText( ptX, ptY+height-upperBound.height()+dist-lineBound.height()-lineBound.top(), - QString( QChar( line ) ) ); + TQString( TQChar( line ) ) ); } -void Artwork::calcCurlyBracket( const ContextStyle& style, const QChar chars[], +void Artwork::calcCurlyBracket( const ContextStyle& style, const TQChar chars[], luPt height, luPt charHeight ) { uchar uppercorner = chars[0]; @@ -809,30 +809,30 @@ void Artwork::calcCurlyBracket( const ContextStyle& style, const QChar chars[], //uchar line = style.symbolTable().character( chars[2] ); uchar middle = chars[3]; - QFont f = style.getBracketFont(); - f.setPointSizeFloat( style.layoutUnitPtToPt( charHeight ) ); - QFontMetrics fm( f ); + TQFont f = style.getBracketFont(); + f.setPointSizeFloat( style.tqlayoutUnitPtToPt( charHeight ) ); + TQFontMetrics fm( f ); LuPtRect upperBound = fm.boundingRect( uppercorner ); LuPtRect lowerBound = fm.boundingRect( lowercorner ); //LuPtRect lineBound = fm.boundingRect( line ); LuPtRect middleBound = fm.boundingRect( middle ); - setWidth( style.ptToLayoutUnitPt( fm.width( QChar( uppercorner ) ) ) ); + setWidth( style.ptToLayoutUnitPt( fm.width( TQChar( uppercorner ) ) ) ); luPt edgeHeight = style.ptToLayoutUnitPt( upperBound.height()+ lowerBound.height()+ middleBound.height() ); //luPt lineHeight = style.ptToLayoutUnitPt( lineBound.height() ); //setHeight( edgeHeight + ( ( height-edgeHeight-1 ) / lineHeight + 1 ) * lineHeight ); - setHeight( QMAX( edgeHeight, height ) ); + setHeight( TQMAX( edgeHeight, height ) ); } -void Artwork::drawBigCurlyBracket( QPainter& p, const ContextStyle& style, const QChar chars[], +void Artwork::drawBigCurlyBracket( TQPainter& p, const ContextStyle& style, const TQChar chars[], luPixel x, luPixel y, luPt charHeight ) { - //QFont f = style.getSymbolFont(); - QFont f = style.getBracketFont(); - f.setPointSizeFloat( style.layoutUnitToFontSize( charHeight, false ) ); + //TQFont f = style.getSymbolFont(); + TQFont f = style.getBracketFont(); + f.setPointSizeFloat( style.tqlayoutUnitToFontSize( charHeight, false ) ); p.setFont(f); uchar uppercorner = chars[0]; @@ -840,24 +840,24 @@ void Artwork::drawBigCurlyBracket( QPainter& p, const ContextStyle& style, const uchar line = chars[2]; uchar middle = chars[3]; - QFontMetrics fm(p.fontMetrics()); - QRect upperBound = fm.boundingRect(uppercorner); - QRect lowerBound = fm.boundingRect(lowercorner); - QRect middleBound = fm.boundingRect(middle); - QRect lineBound = fm.boundingRect(line); + TQFontMetrics fm(p.fontMetrics()); + TQRect upperBound = fm.boundingRect(uppercorner); + TQRect lowerBound = fm.boundingRect(lowercorner); + TQRect middleBound = fm.boundingRect(middle); + TQRect lineBound = fm.boundingRect(line); - pixel ptX = style.layoutUnitToPixelX( x ); - pixel ptY = style.layoutUnitToPixelY( y ); - pixel height = style.layoutUnitToPixelY( getHeight() ); + pixel ptX = style.tqlayoutUnitToPixelX( x ); + pixel ptY = style.tqlayoutUnitToPixelY( y ); + pixel height = style.tqlayoutUnitToPixelY( getHeight() ); - //p.setPen(Qt::gray); + //p.setPen(TQt::gray); //p.drawRect(x, y, upperBound.width() + offset, height); - p.drawText( ptX, ptY-upperBound.top(), QString( QChar( uppercorner ) ) ); + p.drawText( ptX, ptY-upperBound.top(), TQString( TQChar( uppercorner ) ) ); p.drawText( ptX, ptY+(height-middleBound.height())/2-middleBound.top(), - QString( QChar( middle ) ) ); + TQString( TQChar( middle ) ) ); p.drawText( ptX, ptY+height-lowerBound.top()-lowerBound.height(), - QString( QChar( lowercorner ) ) ); + TQString( TQChar( lowercorner ) ) ); // for printing // If the world was perfect and the urw-symbol font correct @@ -869,19 +869,19 @@ void Artwork::drawBigCurlyBracket( QPainter& p, const ContextStyle& style, const pixel gap = height/2 - upperBound.height() - middleBound.height() / 2; if (gap > 0) { - QString ch = QString(QChar(line)); - int lineCount = qRound( gap / lineHeight ) + 1; + TQString ch = TQString(TQChar(line)); + int lineCount = tqRound( gap / lineHeight ) + 1; pixel start = (height - middleBound.height()) / 2 + safety; for (int i = 0; i < lineCount; i++) { - p.drawText( ptX, ptY-lineBound.top()+QMAX( start-(i+1)*lineHeight, + p.drawText( ptX, ptY-lineBound.top()+TQMAX( start-(i+1)*lineHeight, upperBound.width() ), ch ); } start = (height + middleBound.height()) / 2 - safety; for (int i = 0; i < lineCount; i++) { - p.drawText( ptX, ptY-lineBound.top()+QMIN( start+i*lineHeight, + p.drawText( ptX, ptY-lineBound.top()+TQMIN( start+i*lineHeight, height-upperBound.width()-lineBound.height() ), ch ); } diff --git a/lib/kformula/fontstyle.h b/lib/kformula/fontstyle.h index 52105821..72db8caf 100644 --- a/lib/kformula/fontstyle.h +++ b/lib/kformula/fontstyle.h @@ -21,8 +21,8 @@ #ifndef FONTSTYLE_H #define FONTSTYLE_H -#include <qstring.h> -#include <qfont.h> +#include <tqstring.h> +#include <tqfont.h> #include "contextstyle.h" #include "kformuladefs.h" @@ -48,56 +48,56 @@ public: */ bool init( ContextStyle* context, bool install = true ); - /// the table for ordinary symbols (those that have a unicode value) + /// the table for ordinary symbols (those that have a tqunicode value) const SymbolTable* symbolTable() const { return &m_symbolTable; } SymbolTable* symbolTable() { return &m_symbolTable; } Artwork* createArtwork(SymbolType type = EmptyBracket) const; - static QStringList missingFonts( bool install = true ); + static TQStringList missingFonts( bool install = true ); static bool m_installed; - static void testFont( QStringList& missing, const QString& fontName ); + static void testFont( TQStringList& missing, const TQString& fontName ); private: - static QStringList missingFontsInternal(); + static TQStringList missingFontsInternal(); static void installFonts(); SymbolTable m_symbolTable; }; -const QChar spaceChar = 0x0020; -const QChar leftParenthesisChar = 0x0028; -const QChar rightParenthesisChar = 0x0029; -const QChar leftSquareBracketChar = 0x005B; -const QChar rightSquareBracketChar = 0x005D; -const QChar leftCurlyBracketChar = 0x007B; -const QChar verticalLineChar = 0x007C; -const QChar rightCurlyBracketChar = 0x007D; -const QChar leftAngleBracketChar = 0x2329; -const QChar rightAngleBracketChar = 0x232A; -const QChar slashChar = 0x002F; -const QChar backSlashChar = 0x005C; -const QChar integralChar = 0x222B; -const QChar summationChar = 0x2211; -const QChar productChar = 0x220F; -const QChar applyFunctionChar = 0x2061; -const QChar invisibleTimes = 0x2062; -const QChar invisibleComma = 0x2063; - -extern const QChar leftRoundBracket[]; -extern const QChar leftSquareBracket[]; -extern const QChar leftCurlyBracket[]; - -extern const QChar leftLineBracket[]; -extern const QChar rightLineBracket[]; - -extern const QChar rightRoundBracket[]; -extern const QChar rightSquareBracket[]; -extern const QChar rightCurlyBracket[]; +const TQChar spaceChar = 0x0020; +const TQChar leftParenthesisChar = 0x0028; +const TQChar rightParenthesisChar = 0x0029; +const TQChar leftSquareBracketChar = 0x005B; +const TQChar rightSquareBracketChar = 0x005D; +const TQChar leftCurlyBracketChar = 0x007B; +const TQChar verticalLineChar = 0x007C; +const TQChar rightCurlyBracketChar = 0x007D; +const TQChar leftAngleBracketChar = 0x2329; +const TQChar rightAngleBracketChar = 0x232A; +const TQChar slashChar = 0x002F; +const TQChar backSlashChar = 0x005C; +const TQChar integralChar = 0x222B; +const TQChar summationChar = 0x2211; +const TQChar productChar = 0x220F; +const TQChar applyFunctionChar = 0x2061; +const TQChar invisibleTimes = 0x2062; +const TQChar invisibleComma = 0x2063; + +extern const TQChar leftRoundBracket[]; +extern const TQChar leftSquareBracket[]; +extern const TQChar leftCurlyBracket[]; + +extern const TQChar leftLineBracket[]; +extern const TQChar rightLineBracket[]; + +extern const TQChar rightRoundBracket[]; +extern const TQChar rightSquareBracket[]; +extern const TQChar rightCurlyBracket[]; /* * A piece of art that may be used by any element. @@ -111,21 +111,21 @@ public: virtual void calcSizes( const ContextStyle& style, ContextStyle::TextStyle tstyle, double factor, - luPt parentSize ); + luPt tqparentSize ); virtual void calcSizes( const ContextStyle& style, ContextStyle::TextStyle tstyle, double factor ); - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, StyleAttributes& style, - luPt parentSize, const LuPixelPoint& origin ); - virtual void draw( QPainter& painter, const LuPixelRect& r, + luPt tqparentSize, const LuPixelPoint& origin ); + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); luPixel getWidth() const { return size.width(); } luPixel getHeight() const { return size.height(); } @@ -151,20 +151,20 @@ public: protected: - void calcCharSize( const ContextStyle& style, luPt height, QChar ch ); - void drawCharacter( QPainter& painter, const ContextStyle& style, - luPixel x, luPixel y, luPt height, QChar ch ); + void calcCharSize( const ContextStyle& style, luPt height, TQChar ch ); + void drawCharacter( TQPainter& painter, const ContextStyle& style, + luPixel x, luPixel y, luPt height, TQChar ch ); - void calcCharSize( const ContextStyle& style, QFont f, luPt height, QChar c ); - void drawCharacter( QPainter& painter, const ContextStyle& style, - QFont f, + void calcCharSize( const ContextStyle& style, TQFont f, luPt height, TQChar c ); + void drawCharacter( TQPainter& painter, const ContextStyle& style, + TQFont f, luPixel x, luPixel y, luPt height, uchar c ); - void calcRoundBracket( const ContextStyle& style, const QChar chars[], luPt height, luPt charHeight ); - void calcCurlyBracket( const ContextStyle& style, const QChar chars[], luPt height, luPt charHeight ); + void calcRoundBracket( const ContextStyle& style, const TQChar chars[], luPt height, luPt charHeight ); + void calcCurlyBracket( const ContextStyle& style, const TQChar chars[], luPt height, luPt charHeight ); - void drawBigRoundBracket( QPainter& p, const ContextStyle& style, const QChar chars[], luPixel x, luPixel y, luPt charHeight ); - void drawBigCurlyBracket( QPainter& p, const ContextStyle& style, const QChar chars[], luPixel x, luPixel y, luPt charHeight ); + void drawBigRoundBracket( TQPainter& p, const ContextStyle& style, const TQChar chars[], luPixel x, luPixel y, luPt charHeight ); + void drawBigCurlyBracket( TQPainter& p, const ContextStyle& style, const TQChar chars[], luPixel x, luPixel y, luPt charHeight ); private: @@ -179,9 +179,9 @@ private: SymbolType type; bool calcCMDelimiterSize( const ContextStyle& context, uchar c, - luPt fontSize, luPt parentSize ); + luPt fontSize, luPt tqparentSize ); void calcLargest( const ContextStyle& context, uchar c, luPt fontSize ); - void drawCMDelimiter( QPainter& painter, const ContextStyle& style, + void drawCMDelimiter( TQPainter& painter, const ContextStyle& style, luPixel x, luPixel y, luPt height ); short cmChar; diff --git a/lib/kformula/formulacursor.cc b/lib/kformula/formulacursor.cc index 83b46e45..6545b18c 100644 --- a/lib/kformula/formulacursor.cc +++ b/lib/kformula/formulacursor.cc @@ -18,7 +18,7 @@ * Boston, MA 02110-1301, USA. */ -#include <qpainter.h> +#include <tqpainter.h> #include <kdebug.h> #include <assert.h> @@ -79,7 +79,7 @@ void FormulaCursor::calcCursorSize( const ContextStyle& context, bool smallCurso } } -void FormulaCursor::draw( QPainter& painter, const ContextStyle& context, +void FormulaCursor::draw( TQPainter& painter, const ContextStyle& context, StyleAttributes& style, bool smallCursor, bool activeCursor ) { //if (readOnly && !isSelection()) @@ -296,26 +296,26 @@ void FormulaCursor::normalize(Direction direction) */ void FormulaCursor::insert(BasicElement* child, Direction direction) { - QPtrList<BasicElement> list; + TQPtrList<BasicElement> list; list.append(child); insert(list, direction); } -void FormulaCursor::insert(QPtrList<BasicElement>& children, +void FormulaCursor::insert(TQPtrList<BasicElement>& tqchildren, Direction direction) { assert( !isReadOnly() ); BasicElement* element = getElement(); - element->insert(this, children, direction); + element->insert(this, tqchildren, direction); } /** - * Removes the current selected children and returns them. + * Removes the current selected tqchildren and returns them. * The cursor needs to be normal (that is be inside a SequenceElement) * for this to have any effect. */ -void FormulaCursor::remove(QPtrList<BasicElement>& children, +void FormulaCursor::remove(TQPtrList<BasicElement>& tqchildren, Direction direction) { assert( !isReadOnly() ); @@ -325,15 +325,15 @@ void FormulaCursor::remove(QPtrList<BasicElement>& children, // If there is no child to remove in the sequence // remove the sequence instead. if (sequence->countChildren() == 0) { - BasicElement* parent = sequence->getParent(); - if (parent != 0) { - parent->selectChild(this, sequence); - parent->remove(this, children, direction); + BasicElement* tqparent = sequence->getParent(); + if (tqparent != 0) { + tqparent->selectChild(this, sequence); + tqparent->remove(this, tqchildren, direction); return; } } else { - sequence->remove(this, children, direction); + sequence->remove(this, tqchildren, direction); } } } @@ -347,7 +347,7 @@ void FormulaCursor::replaceSelectionWith(BasicElement* element, Direction direction) { assert( !isReadOnly() ); - QPtrList<BasicElement> list; + TQPtrList<BasicElement> list; // we suppres deletion here to get an error if something // was left in the list. //list.setAutoDelete(true); @@ -363,12 +363,12 @@ void FormulaCursor::replaceSelectionWith(BasicElement* element, mainChild->goInside(this); insert(list); /* - BasicElement* parent = element->getParent(); + BasicElement* tqparent = element->getParent(); if (direction == beforeCursor) { - parent->moveRight(this, element); + tqparent->moveRight(this, element); } else { - parent->moveLeft(this, element); + tqparent->moveLeft(this, element); } */ element->selectChild(this, mainChild); @@ -383,18 +383,18 @@ void FormulaCursor::replaceSelectionWith(BasicElement* element, BasicElement* FormulaCursor::replaceByMainChildContent(Direction direction) { assert( !isReadOnly() ); - QPtrList<BasicElement> childrenList; - QPtrList<BasicElement> list; + TQPtrList<BasicElement> tqchildrenList; + TQPtrList<BasicElement> list; BasicElement* element = getElement(); SequenceElement* mainChild = element->getMainChild(); if ((mainChild != 0) && (mainChild->countChildren() > 0)) { mainChild->selectAllChildren(this); - remove(childrenList); + remove(tqchildrenList); } element->getParent()->selectChild(this, element); setSelection(false); remove(list); - insert(childrenList, direction); + insert(tqchildrenList, direction); if (list.count() > 0) { return list.take(0); } @@ -403,7 +403,7 @@ BasicElement* FormulaCursor::replaceByMainChildContent(Direction direction) /** - * Trys to find the element we are the main child of and replace + * Trys to find the element we are the main child of and tqreplace * it with our content. * * This is simply another form of replaceByMainChildContent. You @@ -412,10 +412,10 @@ BasicElement* FormulaCursor::replaceByMainChildContent(Direction direction) BasicElement* FormulaCursor::removeEnclosingElement(Direction direction) { assert( !isReadOnly() ); - BasicElement* parent = getElement()->getParent(); - if (parent != 0) { - if (getElement() == parent->getMainChild()) { - parent->selectChild(this, getElement()); + BasicElement* tqparent = getElement()->getParent(); + if (tqparent != 0) { + if (getElement() == tqparent->getMainChild()) { + tqparent->selectChild(this, getElement()); return replaceByMainChildContent(direction); } } @@ -582,7 +582,7 @@ MatrixElement* FormulaCursor::getActiveMatrixElement() } /** - * The element is going to leave the formula with and all its children. + * The element is going to leave the formula with and all its tqchildren. */ void FormulaCursor::elementWillVanish(BasicElement* element) { @@ -636,15 +636,15 @@ bool FormulaCursor::isReadOnly() const /** * Stores the currently selected elements inside a dom. */ -void FormulaCursor::copy( QDomDocument& doc ) +void FormulaCursor::copy( TQDomDocument& doc ) { if (isSelection()) { SequenceElement* sequence = normal(); if (sequence != 0) { - QDomElement root = doc.createElementNS( "http://www.w3.org/1998/Math/MathML", + TQDomElement root = doc.createElementNS( "http://www.w3.org/1998/Math/MathML", "math" ); doc.appendChild( root ); - QDomElement de = doc.createElement( "mrow" ); + TQDomElement de = doc.createElement( "mrow" ); root.appendChild( de ); sequence->getChildrenMathMLDom(doc, de, getSelectionStart(), getSelectionEnd()); } @@ -659,12 +659,12 @@ void FormulaCursor::copy( QDomDocument& doc ) * Inserts the elements that could be read from the dom into * the list. Returns true on success. */ -bool FormulaCursor::buildElementsFromDom( QDomElement root, QPtrList<BasicElement>& list ) +bool FormulaCursor::buildElementsFromDom( TQDomElement root, TQPtrList<BasicElement>& list ) { assert( !isReadOnly() ); SequenceElement* sequence = normal(); if (sequence != 0) { - QDomElement e = root.firstChild().toElement(); + TQDomElement e = root.firstChild().toElement(); if (sequence->buildChildrenFromDom(list, e.firstChild())) { return true; } @@ -676,12 +676,12 @@ bool FormulaCursor::buildElementsFromDom( QDomElement root, QPtrList<BasicElemen * Inserts the elements that could be read from the MathML dom into * the list. Returns true on success. */ -bool FormulaCursor::buildElementsFromMathMLDom( QDomElement root, QPtrList<BasicElement>& list ) +bool FormulaCursor::buildElementsFromMathMLDom( TQDomElement root, TQPtrList<BasicElement>& list ) { assert( !isReadOnly() ); SequenceElement* sequence = normal(); if (sequence != 0) { - QDomElement e = root.firstChild().toElement(); + TQDomElement e = root.firstChild().toElement(); if (sequence->buildChildrenFromMathMLDom(list, e.firstChild())) { return true; } diff --git a/lib/kformula/formulacursor.h b/lib/kformula/formulacursor.h index 72cfb178..1aa5d8bf 100644 --- a/lib/kformula/formulacursor.h +++ b/lib/kformula/formulacursor.h @@ -21,7 +21,7 @@ #ifndef FORMULACURSOR_H #define FORMULACURSOR_H -#include <qstring.h> +#include <tqstring.h> #include "basicelement.h" #include "kformuladefs.h" @@ -104,7 +104,7 @@ public: * Draws the cursor at its current position. * The cursor will always be drawn in xor mode. */ - void draw( QPainter&, const ContextStyle& context, StyleAttributes& style, + void draw( TQPainter&, const ContextStyle& context, StyleAttributes& style, bool smallCursor, bool activeCursor ); @@ -152,19 +152,19 @@ public: void insert(BasicElement*, Direction = beforeCursor); /** - * Inserts the listed children at the current position. + * Inserts the listed tqchildren at the current position. * Ignores the selection. * The list will be emptied. */ - void insert(QPtrList<BasicElement>&, + void insert(TQPtrList<BasicElement>&, Direction = beforeCursor); /** - * Removes the current selected children and returns them. + * Removes the current selected tqchildren and returns them. * The cursor needs to be normal (that is be inside a SequenceElement) * for this to have any effect. */ - void remove(QPtrList<BasicElement>&, + void remove(TQPtrList<BasicElement>&, Direction = beforeCursor); @@ -182,7 +182,7 @@ public: BasicElement* replaceByMainChildContent(Direction = beforeCursor); /** - * Trys to find the element we are the main child of and replace + * Trys to find the element we are the main child of and tqreplace * it with our content. * * This is simply another form of replaceByMainChildContent. You @@ -200,8 +200,8 @@ public: // The range that is selected. Makes no sense if there is // no selection. - int getSelectionStart() const { return QMIN(getPos(), getMark()); } - int getSelectionEnd() const { return QMAX(getPos(), getMark()); } + int getSelectionStart() const { return TQMIN(getPos(), getMark()); } + int getSelectionEnd() const { return TQMAX(getPos(), getMark()); } /** @@ -291,19 +291,19 @@ public: /** * Stores the currently selected elements inside a dom. */ - void copy( QDomDocument& doc ); + void copy( TQDomDocument& doc ); /** * Inserts the elements that could be read from the dom into * the list. Returns true on success. */ - bool buildElementsFromDom( QDomElement root, QPtrList<BasicElement>& list ); + bool buildElementsFromDom( TQDomElement root, TQPtrList<BasicElement>& list ); /** * Inserts the elements that could be read from the MathML dom into * the list. Returns true on success. */ - bool buildElementsFromMathMLDom( QDomElement root, QPtrList<BasicElement>& list ); + bool buildElementsFromMathMLDom( TQDomElement root, TQPtrList<BasicElement>& list ); // undo/redo support @@ -341,7 +341,7 @@ public: void setCursorData(CursorData* data); /** - * The element is going to leave the formula with and all its children. + * The element is going to leave the formula with and all its tqchildren. */ void elementWillVanish(BasicElement* element); @@ -409,7 +409,7 @@ private: /** * The position the cursor in on inside the element. - * Might be anything from 0 to current->children->size(). + * Might be anything from 0 to current->tqchildren->size(). * * This is where new elements are put in. */ diff --git a/lib/kformula/formulaelement.cc b/lib/kformula/formulaelement.cc index 39349fd1..84944150 100644 --- a/lib/kformula/formulaelement.cc +++ b/lib/kformula/formulaelement.cc @@ -19,7 +19,7 @@ */ #include <iostream> -#include <qpainter.h> +#include <tqpainter.h> #include <kdebug.h> @@ -101,7 +101,7 @@ void FormulaElement::moveOutAbove( FormulaCursor* cursor ) document->moveOutAbove( cursor ); } -void FormulaElement::tell( const QString& msg ) +void FormulaElement::tell( const TQString& msg ) { document->tell( msg ); } @@ -125,14 +125,14 @@ void FormulaElement::calcSizes( const ContextStyle& context, } -void FormulaElement::draw( QPainter& painter, const LuPixelRect& r, +void FormulaElement::draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ) + const LuPixelPoint& tqparentOrigin ) { - inherited::draw( painter, r, context, tstyle, istyle, style, parentOrigin ); + inherited::draw( painter, r, context, tstyle, istyle, style, tqparentOrigin ); } @@ -155,7 +155,7 @@ void FormulaElement::calcSizes( ContextStyle& context ) /** * Draws the whole thing. */ -void FormulaElement::draw( QPainter& painter, const LuPixelRect& r, +void FormulaElement::draw( TQPainter& painter, const LuPixelRect& r, ContextStyle& context ) { //kdDebug( DEBUGID ) << "FormulaElement::draw" << endl; @@ -187,9 +187,9 @@ const SymbolTable& FormulaElement::getSymbolTable() const } -QDomElement FormulaElement::emptyFormulaElement( QDomDocument& doc ) +TQDomElement FormulaElement::emptyFormulaElement( TQDomDocument& doc ) { - QDomElement element = doc.createElement( getTagName() ); + TQDomElement element = doc.createElement( getTagName() ); /* element.setAttribute( "VERSION", "6" ); if ( ownBaseSize ) { @@ -199,17 +199,17 @@ QDomElement FormulaElement::emptyFormulaElement( QDomDocument& doc ) return element; } -KCommand* FormulaElement::input( Container* container, QKeyEvent* event ) +KCommand* FormulaElement::input( Container* container, TQKeyEvent* event ) { - QChar ch = event->text().at( 0 ); + TQChar ch = event->text().at( 0 ); if ( !ch.isPrint() ) { int action = event->key(); //int state = event->state(); //MoveFlag flag = movementFlag(state); switch ( action ) { - case Qt::Key_Return: - case Qt::Key_Enter: { + case TQt::Key_Return: + case TQt::Key_Enter: { FormulaCursor* cursor = container->activeCursor(); insertFormula( cursor ); return 0; @@ -222,7 +222,7 @@ KCommand* FormulaElement::input( Container* container, QKeyEvent* event ) /** * Appends our attributes to the dom element. */ -void FormulaElement::writeDom(QDomElement element) +void FormulaElement::writeDom(TQDomElement element) { inherited::writeDom(element); element.setAttribute( "VERSION", "6" ); @@ -235,13 +235,13 @@ void FormulaElement::writeDom(QDomElement element) * Reads our attributes from the element. * Returns false if it failed. */ -bool FormulaElement::readAttributesFromDom(QDomElement element) +bool FormulaElement::readAttributesFromDom(TQDomElement element) { if (!inherited::readAttributesFromDom(element)) { return false; } int version = -1; - QString versionStr = element.attribute( "VERSION" ); + TQString versionStr = element.attribute( "VERSION" ); if ( !versionStr.isNull() ) { version = versionStr.toInt(); } @@ -252,7 +252,7 @@ bool FormulaElement::readAttributesFromDom(QDomElement element) convertNames( element ); } } - QString baseSizeStr = element.attribute( "BASESIZE" ); + TQString baseSizeStr = element.attribute( "BASESIZE" ); if ( !baseSizeStr.isNull() ) { ownBaseSize = true; baseSize = baseSizeStr.toInt(); @@ -268,26 +268,26 @@ bool FormulaElement::readAttributesFromDom(QDomElement element) * that needs to be read. * Returns false if it failed. */ -bool FormulaElement::readContentFromDom(QDomNode& node) +bool FormulaElement::readContentFromDom(TQDomNode& node) { return inherited::readContentFromDom(node); } -void FormulaElement::convertNames( QDomNode node ) +void FormulaElement::convertNames( TQDomNode node ) { if ( node.isElement() && ( node.nodeName().upper() == "TEXT" ) ) { - QDomNamedNodeMap attr = node.attributes(); - QDomAttr ch = attr.namedItem( "CHAR" ).toAttr(); + TQDomNamedNodeMap attr = node.attributes(); + TQDomAttr ch = attr.namedItem( "CHAR" ).toAttr(); if ( ch.value() == "\\" ) { - QDomNode sequence = node.parentNode(); - QDomDocument doc = sequence.ownerDocument(); - QDomElement nameseq = doc.createElement( "NAMESEQUENCE" ); - sequence.replaceChild( nameseq, node ); + TQDomNode sequence = node.tqparentNode(); + TQDomDocument doc = sequence.ownerDocument(); + TQDomElement nameseq = doc.createElement( "NAMESEQUENCE" ); + sequence.tqreplaceChild( nameseq, node ); bool inName = true; while ( inName ) { inName = false; - QDomNode n = nameseq.nextSibling(); + TQDomNode n = nameseq.nextSibling(); if ( n.isElement() && ( n.nodeName().upper() == "TEXT" ) ) { attr = n.attributes(); ch = attr.namedItem( "CHAR" ).toAttr(); @@ -300,7 +300,7 @@ void FormulaElement::convertNames( QDomNode node ) } } if ( node.hasChildNodes() ) { - QDomNode n = node.firstChild(); + TQDomNode n = node.firstChild(); while ( !n.isNull() ) { convertNames( n ); n = n.nextSibling(); @@ -308,23 +308,23 @@ void FormulaElement::convertNames( QDomNode node ) } } -QString FormulaElement::toLatex() +TQString FormulaElement::toLatex() { return inherited::toLatex(); //Consider $$ sorround } -void FormulaElement::writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat ) const +void FormulaElement::writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat ) const { - QDomElement de; + TQDomElement de; if ( !oasisFormat ) { de = doc.createElementNS( "http://www.w3.org/1998/Math/MathML", "math" ); - parent.appendChild( de ); + tqparent.appendChild( de ); } else { - QDomElement element = doc.createElement( "math:semantics" ); + TQDomElement element = doc.createElement( "math:semantics" ); de = doc.createElement( "math:mrow" ); - parent.appendChild( element ); + tqparent.appendChild( element ); element.appendChild( de ); } for ( uint i = 0; i < countChildren(); ++i ) { diff --git a/lib/kformula/formulaelement.h b/lib/kformula/formulaelement.h index fda89d79..831456a7 100644 --- a/lib/kformula/formulaelement.h +++ b/lib/kformula/formulaelement.h @@ -34,8 +34,8 @@ class SymbolTable; /** * The main element. - * A formula consists of a FormulaElement and its children. - * The only element that has no parent. + * A formula consists of a FormulaElement and its tqchildren. + * The only element that has no tqparent. */ class FormulaElement : public SequenceElement { typedef SequenceElement inherited; @@ -101,7 +101,7 @@ public: /** * Tell the user something has happened. */ - void tell( const QString& msg ); + void tell( const TQString& msg ); /** * Gets called when the formula wants to vanish. The one who @@ -113,7 +113,7 @@ public: /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -121,16 +121,16 @@ public: StyleAttributes& style ); /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); /** * Calculates the formulas sizes and positions. @@ -140,7 +140,7 @@ public: /** * Draws the whole thing. */ - void draw( QPainter& painter, const LuPixelRect& r, ContextStyle& context ); + void draw( TQPainter& painter, const LuPixelRect& r, ContextStyle& context ); /** * This is called by the container to get a command depending on @@ -159,28 +159,28 @@ public: /** * @returns the latex representation of the element and - * of the element's children + * of the element's tqchildren */ - virtual QString toLatex(); + virtual TQString toLatex(); int getBaseSize() const { return baseSize; } void setBaseSize( int size ); bool hasOwnBaseSize() const { return ownBaseSize; } - virtual KCommand* input( Container* container, QKeyEvent* event ); + virtual KCommand* input( Container* container, TQKeyEvent* event ); - virtual void writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat = false ) const ; + virtual void writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat = false ) const ; /** * Appends our attributes to the dom element. */ - virtual void writeDom(QDomElement element); + virtual void writeDom(TQDomElement element); /** * For copy&paste we need to create an empty XML element. */ - QDomElement emptyFormulaElement( QDomDocument& doc ); + TQDomElement emptyFormulaElement( TQDomDocument& doc ); protected: @@ -189,20 +189,20 @@ protected: /** * Returns the tag name of this element type. */ - virtual QString getTagName() const { return "FORMULA"; } + virtual TQString getTagName() const { return "FORMULA"; } /** * Reads our attributes from the element. * Returns false if it failed. */ - virtual bool readAttributesFromDom(QDomElement element); + virtual bool readAttributesFromDom(TQDomElement element); /** * Reads our content from the node. Sets the node to the next node * that needs to be read. * Returns false if it failed. */ - virtual bool readContentFromDom(QDomNode& node); + virtual bool readContentFromDom(TQDomNode& node); private: @@ -211,7 +211,7 @@ private: * The introduction of 'NameSequence' changed the DOM. * However, we need to read the old version. */ - void convertNames( QDomNode node ); + void convertNames( TQDomNode node ); /** * The document that owns (is) this formula. diff --git a/lib/kformula/fractionelement.cc b/lib/kformula/fractionelement.cc index 8652bf66..a8c1db9c 100644 --- a/lib/kformula/fractionelement.cc +++ b/lib/kformula/fractionelement.cc @@ -18,7 +18,7 @@ * Boston, MA 02110-1301, USA. */ -#include <qpainter.h> +#include <tqpainter.h> #include <kdebug.h> #include <klocale.h> @@ -32,7 +32,7 @@ KFORMULA_NAMESPACE_BEGIN using namespace std; -FractionElement::FractionElement(BasicElement* parent) : BasicElement(parent), +FractionElement::FractionElement(BasicElement* tqparent) : BasicElement(tqparent), m_lineThicknessType( NoSize ), m_numAlign( NoHorizontalAlign ), m_denomAlign( NoHorizontalAlign ), @@ -81,12 +81,12 @@ void FractionElement::entered( SequenceElement* child ) BasicElement* FractionElement::goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ) + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ) { - BasicElement* e = BasicElement::goToPos(cursor, handled, point, parentOrigin); + BasicElement* e = BasicElement::goToPos(cursor, handled, point, tqparentOrigin); if (e != 0) { - LuPixelPoint myPos(parentOrigin.x() + getX(), - parentOrigin.y() + getY()); + LuPixelPoint myPos(tqparentOrigin.x() + getX(), + tqparentOrigin.y() + getY()); e = numerator->goToPos(cursor, handled, point, myPos); if (e != 0) { return e; @@ -121,7 +121,7 @@ BasicElement* FractionElement::goToPos( FormulaCursor* cursor, bool& handled, /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ void FractionElement::calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -140,10 +140,10 @@ void FractionElement::calcSizes( const ContextStyle& context, double linethickness = lineThickness( context, factor ); - setWidth( QMAX( numerator->getWidth(), denominator->getWidth() ) ); + setWidth( TQMAX( numerator->getWidth(), denominator->getWidth() ) ); setHeight( numerator->getHeight() + denominator->getHeight() + 2*distY + linethickness ); - setBaseline( qRound( numerator->getHeight() + distY + .5*linethickness + setBaseline( tqRound( numerator->getHeight() + distY + .5*linethickness + context.axisHeight( tstyle, factor ) ) ); numerator->setX( ( getWidth() - numerator->getWidth() ) / 2 ); @@ -155,18 +155,18 @@ void FractionElement::calcSizes( const ContextStyle& context, /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ -void FractionElement::draw( QPainter& painter, const LuPixelRect& r, +void FractionElement::draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ) + const LuPixelPoint& tqparentOrigin ) { - LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); + LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) // return; @@ -184,12 +184,12 @@ void FractionElement::draw( QPainter& painter, const LuPixelRect& r, // TODO: thickness double factor = style.sizeFactor(); double linethickness = lineThickness( context, factor ); - painter.setPen( QPen( style.color(), - context.layoutUnitToPixelY( linethickness ) ) ); - painter.drawLine( context.layoutUnitToPixelX( myPos.x() ), - context.layoutUnitToPixelY( myPos.y() + axis( context, tstyle, factor ) ), - context.layoutUnitToPixelX( myPos.x() + getWidth() ), - context.layoutUnitToPixelY( myPos.y() + axis( context, tstyle, factor ) ) ); + painter.setPen( TQPen( style.color(), + context.tqlayoutUnitToPixelY( linethickness ) ) ); + painter.drawLine( context.tqlayoutUnitToPixelX( myPos.x() ), + context.tqlayoutUnitToPixelY( myPos.y() + axis( context, tstyle, factor ) ), + context.tqlayoutUnitToPixelX( myPos.x() + getWidth() ), + context.tqlayoutUnitToPixelY( myPos.y() + axis( context, tstyle, factor ) ) ); } } @@ -312,7 +312,7 @@ void FractionElement::moveDown(FormulaCursor* cursor, BasicElement* from) * Reinserts the denominator if it has been removed. */ void FractionElement::insert(FormulaCursor* cursor, - QPtrList<BasicElement>& newChildren, + TQPtrList<BasicElement>& newChildren, Direction direction) { if (cursor->getPos() == denominatorPos) { @@ -332,8 +332,8 @@ void FractionElement::insert(FormulaCursor* cursor, /** - * Removes all selected children and returns them. Places the - * cursor to where the children have been. + * Removes all selected tqchildren and returns them. Places the + * cursor to where the tqchildren have been. * * We remove ourselve if we are requested to remove our numerator. * @@ -341,7 +341,7 @@ void FractionElement::insert(FormulaCursor* cursor, * are senseless and the caller is required to replace us. */ void FractionElement::remove(FormulaCursor* cursor, - QPtrList<BasicElement>& removedChildren, + TQPtrList<BasicElement>& removedChildren, Direction direction) { switch (cursor->getPos()) { @@ -362,7 +362,7 @@ void FractionElement::remove(FormulaCursor* cursor, /** * Returns wether the element has no more useful - * children (except its main child) and should therefore + * tqchildren (except its main child) and should therefore * be replaced by its main child's content. */ bool FractionElement::isSenseless() @@ -373,7 +373,7 @@ bool FractionElement::isSenseless() // main child // -// If an element has children one has to become the main one. +// If an element has tqchildren one has to become the main one. SequenceElement* FractionElement::getMainChild() { @@ -407,18 +407,18 @@ void FractionElement::selectChild(FormulaCursor* cursor, BasicElement* child) /** * Appends our attributes to the dom element. */ -void FractionElement::writeDom(QDomElement element) +void FractionElement::writeDom(TQDomElement element) { BasicElement::writeDom(element); - QDomDocument doc = element.ownerDocument(); + TQDomDocument doc = element.ownerDocument(); if (!withLine()) element.setAttribute("NOLINE", 1); - QDomElement num = doc.createElement("NUMERATOR"); + TQDomElement num = doc.createElement("NUMERATOR"); num.appendChild(numerator->getElementDom(doc)); element.appendChild(num); - QDomElement den = doc.createElement("DENOMINATOR"); + TQDomElement den = doc.createElement("DENOMINATOR"); den.appendChild(denominator->getElementDom(doc)); element.appendChild(den); } @@ -427,12 +427,12 @@ void FractionElement::writeDom(QDomElement element) * Reads our attributes from the element. * Returns false if it failed. */ -bool FractionElement::readAttributesFromDom(QDomElement element) +bool FractionElement::readAttributesFromDom(TQDomElement element) { if (!BasicElement::readAttributesFromDom(element)) { return false; } - QString lineStr = element.attribute("NOLINE"); + TQString lineStr = element.attribute("NOLINE"); if(!lineStr.isNull()) { m_lineThicknessType = RelativeSize; m_lineThickness = lineStr.toInt(); @@ -444,12 +444,12 @@ bool FractionElement::readAttributesFromDom(QDomElement element) * Reads our attributes from the MathML element. * Returns false if it failed. */ -bool FractionElement::readAttributesFromMathMLDom(const QDomElement& element) +bool FractionElement::readAttributesFromMathMLDom(const TQDomElement& element) { if ( ! BasicElement::readAttributesFromMathMLDom( element ) ) { return false; } - QString linethicknessStr = element.attribute( "linethickness" ).lower(); + TQString linethicknessStr = element.attribute( "linethickness" ).lower(); if ( ! linethicknessStr.isNull() ) { if ( linethicknessStr == "thin" ) { m_lineThicknessType = RelativeSize; @@ -467,7 +467,7 @@ bool FractionElement::readAttributesFromMathMLDom(const QDomElement& element) m_lineThickness = getSize( linethicknessStr, &m_lineThicknessType ); } } - QString numalignStr = element.attribute( "numalign" ).lower(); + TQString numalignStr = element.attribute( "numalign" ).lower(); if ( ! numalignStr.isNull() ) { if ( numalignStr == "left" ) { m_numAlign = LeftHorizontalAlign; @@ -479,7 +479,7 @@ bool FractionElement::readAttributesFromMathMLDom(const QDomElement& element) m_numAlign = RightHorizontalAlign; } } - QString denomalignStr = element.attribute( "denomalign" ).lower(); + TQString denomalignStr = element.attribute( "denomalign" ).lower(); if ( ! denomalignStr.isNull() ) { if ( denomalignStr == "left" ) { m_denomAlign = LeftHorizontalAlign; @@ -491,7 +491,7 @@ bool FractionElement::readAttributesFromMathMLDom(const QDomElement& element) m_denomAlign = RightHorizontalAlign; } } - QString bevelledStr = element.attribute( "bevelled" ).lower(); + TQString bevelledStr = element.attribute( "bevelled" ).lower(); if ( ! bevelledStr.isNull() ) { m_customBevelled = true; if ( bevelledStr == "true" ) { @@ -510,7 +510,7 @@ bool FractionElement::readAttributesFromMathMLDom(const QDomElement& element) * that needs to be read. * Returns false if it failed. */ -bool FractionElement::readContentFromDom(QDomNode& node) +bool FractionElement::readContentFromDom(TQDomNode& node) { if (!BasicElement::readContentFromDom(node)) { return false; @@ -536,7 +536,7 @@ bool FractionElement::readContentFromDom(QDomNode& node) * that needs to be read. * Returns false if it failed. */ -int FractionElement::readContentFromMathMLDom(QDomNode& node) +int FractionElement::readContentFromMathMLDom(TQDomNode& node) { if ( BasicElement::readContentFromMathMLDom( node ) == -1 ) { return -1; @@ -562,7 +562,7 @@ int FractionElement::readContentFromMathMLDom(QDomNode& node) return 1; } -QString FractionElement::toLatex() +TQString FractionElement::toLatex() { if ( withLine() ) { return "\\frac{" + numerator->toLatex() +"}{" + denominator->toLatex() + "}"; @@ -572,22 +572,22 @@ QString FractionElement::toLatex() } } -QString FractionElement::formulaString() +TQString FractionElement::formulaString() { return "(" + numerator->formulaString() + ")/(" + denominator->formulaString() + ")"; } -void FractionElement::writeMathMLAttributes( QDomElement& element ) const +void FractionElement::writeMathMLAttributes( TQDomElement& element ) const { switch ( m_lineThicknessType ) { case AbsoluteSize: - element.setAttribute( "linethickness", QString( "%1pt" ).arg( m_lineThickness ) ); + element.setAttribute( "linethickness", TQString( "%1pt" ).tqarg( m_lineThickness ) ); break; case RelativeSize: - element.setAttribute( "linethickness", QString( "%1%" ).arg( m_lineThickness * 100.0 ) ); + element.setAttribute( "linethickness", TQString( "%1%" ).tqarg( m_lineThickness * 100.0 ) ); break; case PixelSize: - element.setAttribute( "linethickness", QString( "%1px" ).arg( m_lineThickness ) ); + element.setAttribute( "linethickness", TQString( "%1px" ).tqarg( m_lineThickness ) ); break; default: break; @@ -626,8 +626,8 @@ void FractionElement::writeMathMLAttributes( QDomElement& element ) const } } -void FractionElement::writeMathMLContent( QDomDocument& doc, - QDomElement& element, +void FractionElement::writeMathMLContent( TQDomDocument& doc, + TQDomElement& element, bool oasisFormat ) const { numerator->writeMathML( doc, element, oasisFormat ); diff --git a/lib/kformula/fractionelement.h b/lib/kformula/fractionelement.h index 8a49a719..c578ee5b 100644 --- a/lib/kformula/fractionelement.h +++ b/lib/kformula/fractionelement.h @@ -36,7 +36,7 @@ public: enum { numeratorPos, denominatorPos }; - FractionElement(BasicElement* parent = 0); + FractionElement(BasicElement* tqparent = 0); ~FractionElement(); FractionElement( const FractionElement& ); @@ -66,11 +66,11 @@ public: * is allowed to set the cursor. */ virtual BasicElement* goToPos( FormulaCursor*, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ); + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ); /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, @@ -78,19 +78,19 @@ public: StyleAttributes& style ); /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); /** - * Dispatch this FontCommand to all our TextElement children. + * Dispatch this FontCommand to all our TextElement tqchildren. */ virtual void dispatchFontCommand( FontCommand* cmd ); @@ -125,23 +125,23 @@ public: /** * Reinserts the denominator if it has been removed. */ - virtual void insert(FormulaCursor*, QPtrList<BasicElement>&, Direction); + virtual void insert(FormulaCursor*, TQPtrList<BasicElement>&, Direction); /** - * Removes all selected children and returns them. Places the - * cursor to where the children have been. + * Removes all selected tqchildren and returns them. Places the + * cursor to where the tqchildren have been. * * We remove ourselve if we are requested to remove our numerator. * * It is possible to remove the denominator. But after this we * are senseless and the caller is required to replace us. */ - virtual void remove(FormulaCursor*, QPtrList<BasicElement>&, Direction); + virtual void remove(FormulaCursor*, TQPtrList<BasicElement>&, Direction); // main child // - // If an element has children one has to become the main one. + // If an element has tqchildren one has to become the main one. virtual SequenceElement* getMainChild(); @@ -150,7 +150,7 @@ public: /** * Returns wether the element has no more useful - * children (except its main child) and should therefore + * tqchildren (except its main child) and should therefore * be replaced by its main child's content. */ virtual bool isSenseless(); @@ -182,11 +182,11 @@ public: /** * @returns the latex representation of the element and - * of the element's children + * of the element's tqchildren */ - virtual QString toLatex(); + virtual TQString toLatex(); - virtual QString formulaString(); + virtual TQString formulaString(); protected: @@ -195,44 +195,44 @@ protected: /** * Returns the tag name of this element type. */ - virtual QString getTagName() const { return "FRACTION"; } + virtual TQString getTagName() const { return "FRACTION"; } /** * Appends our attributes to the dom element. */ - virtual void writeDom(QDomElement element); + virtual void writeDom(TQDomElement element); /** * Reads our attributes from the element. * Returns false if it failed. */ - virtual bool readAttributesFromDom(QDomElement element); + virtual bool readAttributesFromDom(TQDomElement element); /** * Reads our content from the node. Sets the node to the next node * that needs to be read. * Returns false if it failed. */ - virtual bool readContentFromDom(QDomNode& node); + virtual bool readContentFromDom(TQDomNode& node); /** * Reads our attributes from the MathML element. * Returns false if it failed. */ - virtual bool readAttributesFromMathMLDom(const QDomElement& element); + virtual bool readAttributesFromMathMLDom(const TQDomElement& element); /** * Reads our content from the MathML node. Sets the node to the next node * that needs to be read. * Returns false if it failed. */ - virtual int readContentFromMathMLDom(QDomNode& node); + virtual int readContentFromMathMLDom(TQDomNode& node); private: - virtual QString getElementName() const { return "mfrac"; } - virtual void writeMathMLAttributes( QDomElement& element ) const ; - virtual void writeMathMLContent( QDomDocument& doc, - QDomElement& element, + virtual TQString getElementName() const { return "mfrac"; } + virtual void writeMathMLAttributes( TQDomElement& element ) const ; + virtual void writeMathMLContent( TQDomDocument& doc, + TQDomElement& element, bool oasisFormat ) const ; double lineThickness( const ContextStyle& context, double factor ); diff --git a/lib/kformula/glyphelement.cc b/lib/kformula/glyphelement.cc index 798621a2..381bbcf9 100644 --- a/lib/kformula/glyphelement.cc +++ b/lib/kformula/glyphelement.cc @@ -17,18 +17,18 @@ * Boston, MA 02110-1301, USA. */ -#include <qfontmetrics.h> -#include <qpainter.h> +#include <tqfontmetrics.h> +#include <tqpainter.h> #include "fontstyle.h" #include "glyphelement.h" KFORMULA_NAMESPACE_BEGIN -GlyphElement::GlyphElement( BasicElement* parent ) : TextElement( ' ', false, parent ) { +GlyphElement::GlyphElement( BasicElement* tqparent ) : TextElement( ' ', false, tqparent ) { } -bool GlyphElement::readAttributesFromMathMLDom( const QDomElement& element ) +bool GlyphElement::readAttributesFromMathMLDom( const TQDomElement& element ) { if ( !BasicElement::readAttributesFromMathMLDom( element ) ) { return false; @@ -40,7 +40,7 @@ bool GlyphElement::readAttributesFromMathMLDom( const QDomElement& element ) kdWarning( DEBUGID ) << "Required attribute fontfamily not found in glyph element\n"; return false; } - QString indexStr = element.attribute( "index" ); + TQString indexStr = element.attribute( "index" ); if ( indexStr.isNull() ) { kdWarning( DEBUGID ) << "Required attribute index not found in glyph element\n"; return false; @@ -51,7 +51,7 @@ bool GlyphElement::readAttributesFromMathMLDom( const QDomElement& element ) kdWarning( DEBUGID ) << "Invalid index value in glyph element\n"; return false; } - m_char = QChar( index ); + m_char = TQChar( index ); m_alt = element.attribute( "alt" ); if ( m_alt.isNull() ) { @@ -59,7 +59,7 @@ bool GlyphElement::readAttributesFromMathMLDom( const QDomElement& element ) return false; } - QStringList missing; + TQStringList missing; FontStyle::testFont( missing, m_fontFamily.lower() ); m_hasFont = missing.isEmpty(); @@ -69,7 +69,7 @@ bool GlyphElement::readAttributesFromMathMLDom( const QDomElement& element ) /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ void GlyphElement::calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -78,19 +78,19 @@ void GlyphElement::calcSizes( const ContextStyle& context, { double factor = style.sizeFactor(); luPt mySize = context.getAdjustedSize( tstyle, factor ); - QRect bound; + TQRect bound; if ( m_hasFont ) { - QFont font( m_fontFamily ); - font.setPointSizeFloat( context.layoutUnitPtToPt( mySize ) ); - QFontMetrics fm ( font ); + TQFont font( m_fontFamily ); + font.setPointSizeFloat( context.tqlayoutUnitPtToPt( mySize ) ); + TQFontMetrics fm ( font ); bound = fm.boundingRect( m_char ); setWidth( context.ptToLayoutUnitPt( fm.width( m_char ) ) ); } else { - QFont font( context.getDefaultFont() ); - font.setPointSizeFloat( context.layoutUnitPtToPt( mySize ) ); - QFontMetrics fm ( font ); + TQFont font( context.getDefaultFont() ); + font.setPointSizeFloat( context.tqlayoutUnitPtToPt( mySize ) ); + TQFontMetrics fm ( font ); bound = fm.boundingRect( m_alt ); setWidth( context.ptToLayoutUnitPt( fm.width( m_alt ) ) ); } @@ -105,36 +105,36 @@ void GlyphElement::calcSizes( const ContextStyle& context, } /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ -void GlyphElement::draw( QPainter& painter, const LuPixelRect& /*r*/, +void GlyphElement::draw( TQPainter& painter, const LuPixelRect& /*r*/, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle /*istyle*/, StyleAttributes& style, - const LuPixelPoint& parentOrigin ) + const LuPixelPoint& tqparentOrigin ) { - LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); + LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) // return; double factor = style.sizeFactor(); luPt mySize = context.getAdjustedSize( tstyle, factor ); - QFont font; - QString text; + TQFont font; + TQString text; if ( m_hasFont ) { painter.setPen( style.color() ); setCharStyle( style.charStyle() ); setCharFamily( style.charFamily() ); - font = QFont( m_fontFamily ); + font = TQFont( m_fontFamily ); text = m_char; - painter.fillRect( context.layoutUnitToPixelX( myPos.x() ), - context.layoutUnitToPixelY( myPos.y() ), - context.layoutUnitToPixelX( getWidth() ), - context.layoutUnitToPixelY( getHeight() ), + painter.fillRect( context.tqlayoutUnitToPixelX( myPos.x() ), + context.tqlayoutUnitToPixelY( myPos.y() ), + context.tqlayoutUnitToPixelX( getWidth() ), + context.tqlayoutUnitToPixelY( getHeight() ), style.background() ); } else { @@ -142,17 +142,17 @@ void GlyphElement::draw( QPainter& painter, const LuPixelRect& /*r*/, font = context.getDefaultFont(); text = m_alt; } - font.setPointSizeFloat( context.layoutUnitToFontSize( mySize, false ) ); + font.setPointSizeFloat( context.tqlayoutUnitToFontSize( mySize, false ) ); painter.setFont( font ); - painter.drawText( context.layoutUnitToPixelX( myPos.x() ), - context.layoutUnitToPixelY( myPos.y()+getBaseline() ), + painter.drawText( context.tqlayoutUnitToPixelX( myPos.x() ), + context.tqlayoutUnitToPixelY( myPos.y()+getBaseline() ), text ); } -void GlyphElement::writeMathMLAttributes( QDomElement& element ) const +void GlyphElement::writeMathMLAttributes( TQDomElement& element ) const { element.setAttribute( "fontfamily", m_fontFamily ); - element.setAttribute( "index", m_char.unicode() ); + element.setAttribute( "index", m_char.tqunicode() ); element.setAttribute( "alt", m_alt ); } diff --git a/lib/kformula/glyphelement.h b/lib/kformula/glyphelement.h index 425caf10..dd6c6e8c 100644 --- a/lib/kformula/glyphelement.h +++ b/lib/kformula/glyphelement.h @@ -27,11 +27,11 @@ KFORMULA_NAMESPACE_BEGIN class GlyphElement : public TextElement { typedef TextElement inherited; public: - GlyphElement( BasicElement* parent = 0 ); + GlyphElement( BasicElement* tqparent = 0 ); /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, @@ -39,27 +39,27 @@ public: StyleAttributes& style ); /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); protected: - virtual bool readAttributesFromMathMLDom( const QDomElement &element ); + virtual bool readAttributesFromMathMLDom( const TQDomElement &element ); private: - virtual QString getElementName() const { return "mglyph"; } - virtual void writeMathMLAttributes( QDomElement& element ) const ; + virtual TQString getElementName() const { return "mglyph"; } + virtual void writeMathMLAttributes( TQDomElement& element ) const ; - QChar m_char; // Char to be shown - QString m_fontFamily; // Font family to use - QString m_alt; // Alternative text if font family not found + TQChar m_char; // Char to be shown + TQString m_fontFamily; // Font family to use + TQString m_alt; // Alternative text if font family not found bool m_hasFont; // Whether required font is available }; diff --git a/lib/kformula/identifierelement.cc b/lib/kformula/identifierelement.cc index a457403a..324151d5 100644 --- a/lib/kformula/identifierelement.cc +++ b/lib/kformula/identifierelement.cc @@ -32,13 +32,13 @@ KFORMULA_NAMESPACE_BEGIN -IdentifierElement::IdentifierElement( BasicElement* parent ) : TokenElement( parent ) {} +IdentifierElement::IdentifierElement( BasicElement* tqparent ) : TokenElement( tqparent ) {} /* * Token elements' content has to be of homogeneous type. Every token element * must (TODO: check this) appear inside a non-token sequence, and thus, if * the command asks for a different content, a new element has to be created in - * parent sequence. + * tqparent sequence. */ KCommand* IdentifierElement::buildCommand( Container* container, Request* request ) { @@ -67,21 +67,21 @@ KCommand* IdentifierElement::buildCommand( Container* container, Request* reques } if ( countChildren() == 0 || cursor->getPos() == countChildren() ) { - // We are in the last position, so it's easy, call the parent to + // We are in the last position, so it's easy, call the tqparent to // create a new child - SequenceElement* parent = static_cast<SequenceElement*>( getParent() ); - if ( parent ) { - uint pos = parent->childPos( this ); - cursor->setTo( parent, pos + 1); - return parent->buildCommand( container, request ); + SequenceElement* tqparent = static_cast<SequenceElement*>( getParent() ); + if ( tqparent ) { + uint pos = tqparent->childPos( this ); + cursor->setTo( tqparent, pos + 1); + return tqparent->buildCommand( container, request ); } } if ( cursor->getPos() == 0 ) { - SequenceElement* parent = static_cast<SequenceElement*>( getParent() ); - if ( parent ) { - uint pos = parent->childPos( this ); - cursor->setTo( parent, pos ); - return parent->buildCommand( container, request ); + SequenceElement* tqparent = static_cast<SequenceElement*>( getParent() ); + if ( tqparent ) { + uint pos = tqparent->childPos( this ); + cursor->setTo( tqparent, pos ); + return tqparent->buildCommand( container, request ); } } @@ -89,7 +89,7 @@ KCommand* IdentifierElement::buildCommand( Container* container, Request* reques // a) Cut from mark to the end // b) Create a new token and add an element from key pressed // c) Create a new token and add elements cut previously - // d) Move cursor to parent so that it command execution works fine + // d) Move cursor to tqparent so that it command execution works fine switch( *request ) { case req_addOperator: { @@ -100,9 +100,9 @@ KCommand* IdentifierElement::buildCommand( Container* container, Request* reques command->addCursor( cursor ); command->addToken( op ); command->addContent( op, text ); - SequenceElement* parent = static_cast< SequenceElement* >( getParent() ); - if ( parent ) { - cursor->setTo( parent, parent->childPos( this ) + 1 ); + SequenceElement* tqparent = static_cast< SequenceElement* >( getParent() ); + if ( tqparent ) { + cursor->setTo( tqparent, tqparent->childPos( this ) + 1 ); } return command; } @@ -114,9 +114,9 @@ KCommand* IdentifierElement::buildCommand( Container* container, Request* reques command->addCursor( cursor ); command->addToken( num ); command->addContent( num, text ); - SequenceElement* parent = static_cast< SequenceElement* >( getParent() ); - if ( parent ) { - cursor->setTo( parent, parent->childPos( this ) + 1 ); + SequenceElement* tqparent = static_cast< SequenceElement* >( getParent() ); + if ( tqparent ) { + cursor->setTo( tqparent, tqparent->childPos( this ) + 1 ); } return command; } @@ -159,7 +159,7 @@ void IdentifierElement::setStyleVariant( StyleAttributes& style ) style.setCustomMathVariant( false ); if ( customFontFamily() ) { style.setCustomFont( true ); - style.setFont( QFont(fontFamily()) ); + style.setFont( TQFont(fontFamily()) ); } bool fontweight = false; diff --git a/lib/kformula/identifierelement.h b/lib/kformula/identifierelement.h index 9c84c2ab..485fc28e 100644 --- a/lib/kformula/identifierelement.h +++ b/lib/kformula/identifierelement.h @@ -27,7 +27,7 @@ KFORMULA_NAMESPACE_BEGIN class IdentifierElement : public TokenElement { typedef TokenElement inherited; public: - IdentifierElement( BasicElement* parent = 0 ); + IdentifierElement( BasicElement* tqparent = 0 ); /** * This is called by the container to get a command depending on @@ -39,7 +39,7 @@ public: */ virtual KCommand* buildCommand( Container*, Request* ); - virtual QString getElementName() const { return "mi"; } + virtual TQString getElementName() const { return "mi"; } protected: virtual void setStyleVariant( StyleAttributes& style ); diff --git a/lib/kformula/indexelement.cc b/lib/kformula/indexelement.cc index 76c25d28..5e2ee3e5 100644 --- a/lib/kformula/indexelement.cc +++ b/lib/kformula/indexelement.cc @@ -18,7 +18,7 @@ * Boston, MA 02110-1301, USA. */ -#include <qpainter.h> +#include <tqpainter.h> #include <kdebug.h> #include <klocale.h> @@ -38,7 +38,7 @@ class IndexSequenceElement : public SequenceElement { typedef SequenceElement inherited; public: - IndexSequenceElement( BasicElement* parent = 0 ) : SequenceElement( parent ) {} + IndexSequenceElement( BasicElement* tqparent = 0 ) : SequenceElement( tqparent ) {} virtual IndexSequenceElement* clone() { return new IndexSequenceElement( *this ); } @@ -90,8 +90,8 @@ KCommand* IndexSequenceElement::buildCommand( Container* container, Request* req } -IndexElement::IndexElement(BasicElement* parent) - : BasicElement(parent), +IndexElement::IndexElement(BasicElement* tqparent) + : BasicElement(tqparent), m_subScriptShiftType( NoSize ), m_superScriptShiftType( NoSize ), m_customAccentUnder( false ), @@ -184,29 +184,29 @@ bool IndexElement::accept( ElementVisitor* visitor ) } -QChar IndexElement::getCharacter() const +TQChar IndexElement::getCharacter() const { if ( !content->isTextOnly() ) { - return QChar::null; + return TQChar::null; } if ( hasUpperRight() && !upperRight->isTextOnly() ) { - return QChar::null; + return TQChar::null; } if ( hasUpperMiddle() && !upperMiddle->isTextOnly() ) { - return QChar::null; + return TQChar::null; } if ( hasUpperLeft() && !upperLeft->isTextOnly() ) { - return QChar::null; + return TQChar::null; } if ( hasLowerRight() && !lowerRight->isTextOnly() ) { - return QChar::null; + return TQChar::null; } if ( hasLowerMiddle() && !lowerMiddle->isTextOnly() ) { - return QChar::null; + return TQChar::null; } if ( hasLowerLeft() && !lowerLeft->isTextOnly() ) { - return QChar::null; + return TQChar::null; } return ' '; @@ -227,11 +227,11 @@ void IndexElement::entered( SequenceElement* child ) * Returns the element the point is in. */ BasicElement* IndexElement::goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ) + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ) { - BasicElement* e = BasicElement::goToPos(cursor, handled, point, parentOrigin); + BasicElement* e = BasicElement::goToPos(cursor, handled, point, tqparentOrigin); if (e != 0) { - LuPixelPoint myPos(parentOrigin.x()+getX(), parentOrigin.y()+getY()); + LuPixelPoint myPos(tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY()); e = content->goToPos(cursor, handled, point, myPos); if (e != 0) return e; @@ -341,7 +341,7 @@ void IndexElement::setMiddleX(int xOffset, int middleWidth) /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ void IndexElement::calcSizes(const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -406,7 +406,7 @@ void IndexElement::calcSizes(const ContextStyle& context, // get the contents size content->calcSizes( context, tstyle, istyle, style ); - luPixel width = QMAX(content->getWidth(), QMAX(umWidth, lmWidth)); + luPixel width = TQMAX(content->getWidth(), TQMAX(umWidth, lmWidth)); luPixel toMidline = content->axis( context, tstyle, factor ); luPixel fromMidline = content->getHeight() - toMidline; @@ -436,7 +436,7 @@ void IndexElement::calcSizes(const ContextStyle& context, if (hasLowerRight()) { lowerRight->setX(width); } - width += QMAX(urWidth, lrWidth); + width += TQMAX(urWidth, lrWidth); // calculate the y offsets luPixel ulOffset = 0; @@ -445,10 +445,10 @@ void IndexElement::calcSizes(const ContextStyle& context, luPixel lrOffset = 0; if (content->isTextOnly()) { luPt mySize = context.getAdjustedSize( tstyle, factor ); - QFont font = context.getDefaultFont(); - font.setPointSizeFloat( context.layoutUnitPtToPt( mySize ) ); + TQFont font = context.getDefaultFont(); + font.setPointSizeFloat( context.tqlayoutUnitPtToPt( mySize ) ); - QFontMetrics fm(font); + TQFontMetrics fm(font); LuPixelRect bound = fm.boundingRect('x'); luPixel exBaseline = context.ptToLayoutUnitPt( -bound.top() ); @@ -463,12 +463,12 @@ void IndexElement::calcSizes(const ContextStyle& context, else { // the upper half - ulOffset = QMAX(ulMidline, ulHeight-toMidline); - urOffset = QMAX(urMidline, urHeight-toMidline); + ulOffset = TQMAX(ulMidline, ulHeight-toMidline); + urOffset = TQMAX(urMidline, urHeight-toMidline); // the lower half - llOffset = QMAX(content->getHeight()-llMidline, toMidline); - lrOffset = QMAX(content->getHeight()-lrMidline, toMidline); + llOffset = TQMAX(content->getHeight()-llMidline, toMidline); + lrOffset = TQMAX(content->getHeight()-lrMidline, toMidline); } // Add more offset if defined in attributes @@ -500,7 +500,7 @@ void IndexElement::calcSizes(const ContextStyle& context, break; } - luPixel height = QMAX(umHeight, QMAX(ulOffset, urOffset)); + luPixel height = TQMAX(umHeight, TQMAX(ulOffset, urOffset)); // the upper half content->setY(height); @@ -526,7 +526,7 @@ void IndexElement::calcSizes(const ContextStyle& context, lowerRight->setY( height + lrOffset ); } - fromMidline += QMAX(QMAX(llHeight+llOffset, lrHeight+lrOffset) - content->getHeight(), lmHeight); + fromMidline += TQMAX(TQMAX(llHeight+llOffset, lrHeight+lrOffset) - content->getHeight(), lmHeight); // set the result setWidth(width); @@ -542,18 +542,18 @@ void IndexElement::calcSizes(const ContextStyle& context, } /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ -void IndexElement::draw( QPainter& painter, const LuPixelRect& r, +void IndexElement::draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ) + const LuPixelPoint& tqparentOrigin ) { - LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); + LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) // return; @@ -582,8 +582,8 @@ void IndexElement::draw( QPainter& painter, const LuPixelRect& r, } // Debug - //painter.setBrush(Qt::NoBrush); - //painter.setPen(Qt::red); + //painter.setBrush(TQt::NoBrush); + //painter.setPen(TQt::red); //painter.drawRect(myPos.x(), myPos.y(), getWidth(), getHeight()); //painter.drawLine(myPos.x(), myPos.y()+getMidline(), // myPos.x()+getWidth(), myPos.y()+getMidline()); @@ -645,7 +645,7 @@ int IndexElement::getFromPos(BasicElement* from) else if (from == upperLeft) { return upperLeftPos; } - return parentPos; + return tqparentPos; } /** @@ -680,7 +680,7 @@ void IndexElement::moveLeft(FormulaCursor* cursor, BasicElement* from) } } switch (fromPos) { - case parentPos: + case tqparentPos: if (hasLowerRight() && linear) { lowerRight->moveLeft(cursor, this); break; @@ -751,7 +751,7 @@ void IndexElement::moveRight(FormulaCursor* cursor, BasicElement* from) } } switch (fromPos) { - case parentPos: + case tqparentPos: if (hasUpperLeft() && linear) { upperLeft->moveRight(cursor, this); break; @@ -885,12 +885,12 @@ void IndexElement::moveDown(FormulaCursor* cursor, BasicElement* from) } -// children +// tqchildren // main child // -// If an element has children one has to become the main one. +// If an element has tqchildren one has to become the main one. // void IndexElement::setMainChild(SequenceElement* child) // { @@ -902,7 +902,7 @@ void IndexElement::moveDown(FormulaCursor* cursor, BasicElement* from) /** - * Inserts all new children at the cursor position. Places the + * Inserts all new tqchildren at the cursor position. Places the * cursor according to the direction. * * You only can insert one index at a time. So the list must contain @@ -912,7 +912,7 @@ void IndexElement::moveDown(FormulaCursor* cursor, BasicElement* from) * The list will be emptied but stays the property of the caller. */ void IndexElement::insert(FormulaCursor* cursor, - QPtrList<BasicElement>& newChildren, + TQPtrList<BasicElement>& newChildren, Direction direction) { SequenceElement* index = static_cast<SequenceElement*>(newChildren.take(0)); @@ -954,8 +954,8 @@ void IndexElement::insert(FormulaCursor* cursor, /** - * Removes all selected children and returns them. Places the - * cursor to where the children have been. + * Removes all selected tqchildren and returns them. Places the + * cursor to where the tqchildren have been. * * The cursor has to be inside one of our indexes which is supposed * to be empty. The index will be removed and the cursor will @@ -965,7 +965,7 @@ void IndexElement::insert(FormulaCursor* cursor, * The ownership of the list is passed to the caller. */ void IndexElement::remove(FormulaCursor* cursor, - QPtrList<BasicElement>& removedChildren, + TQPtrList<BasicElement>& removedChildren, Direction direction) { int pos = cursor->getPos(); @@ -983,9 +983,9 @@ void IndexElement::remove(FormulaCursor* cursor, setToLowerLeft(cursor); break; case contentPos: { - BasicElement* parent = getParent(); - parent->selectChild(cursor, this); - parent->remove(cursor, removedChildren, direction); + BasicElement* tqparent = getParent(); + tqparent->selectChild(cursor, this); + tqparent->remove(cursor, removedChildren, direction); break; } case upperMiddlePos: @@ -1032,7 +1032,7 @@ void IndexElement::normalize(FormulaCursor* cursor, Direction direction) /** * Returns wether the element has no more useful - * children (except its main child) and should therefore + * tqchildren (except its main child) and should therefore * be replaced by its main child's content. */ bool IndexElement::isSenseless() @@ -1227,43 +1227,43 @@ void IndexElement::moveToLowerRight(FormulaCursor* cursor, Direction direction) /** * Appends our attributes to the dom element. */ -void IndexElement::writeDom(QDomElement element) +void IndexElement::writeDom(TQDomElement element) { BasicElement::writeDom(element); - QDomDocument doc = element.ownerDocument(); + TQDomDocument doc = element.ownerDocument(); - QDomElement cont = doc.createElement("CONTENT"); + TQDomElement cont = doc.createElement("CONTENT"); cont.appendChild(content->getElementDom(doc)); element.appendChild(cont); if (hasUpperLeft()) { - QDomElement ind = doc.createElement("UPPERLEFT"); + TQDomElement ind = doc.createElement("UPPERLEFT"); ind.appendChild(upperLeft->getElementDom(doc)); element.appendChild(ind); } if (hasUpperMiddle()) { - QDomElement ind = doc.createElement("UPPERMIDDLE"); + TQDomElement ind = doc.createElement("UPPERMIDDLE"); ind.appendChild(upperMiddle->getElementDom(doc)); element.appendChild(ind); } if (hasUpperRight()) { - QDomElement ind = doc.createElement("UPPERRIGHT"); + TQDomElement ind = doc.createElement("UPPERRIGHT"); ind.appendChild(upperRight->getElementDom(doc)); element.appendChild(ind); } if (hasLowerLeft()) { - QDomElement ind = doc.createElement("LOWERLEFT"); + TQDomElement ind = doc.createElement("LOWERLEFT"); ind.appendChild(lowerLeft->getElementDom(doc)); element.appendChild(ind); } if (hasLowerMiddle()) { - QDomElement ind = doc.createElement("LOWERMIDDLE"); + TQDomElement ind = doc.createElement("LOWERMIDDLE"); ind.appendChild(lowerMiddle->getElementDom(doc)); element.appendChild(ind); } if (hasLowerRight()) { - QDomElement ind = doc.createElement("LOWERRIGHT"); + TQDomElement ind = doc.createElement("LOWERRIGHT"); ind.appendChild(lowerRight->getElementDom(doc)); element.appendChild(ind); } @@ -1273,7 +1273,7 @@ void IndexElement::writeDom(QDomElement element) * Reads our attributes from the element. * Returns false if it failed. */ -bool IndexElement::readAttributesFromDom(QDomElement element) +bool IndexElement::readAttributesFromDom(TQDomElement element) { if (!BasicElement::readAttributesFromDom(element)) { return false; @@ -1286,7 +1286,7 @@ bool IndexElement::readAttributesFromDom(QDomElement element) * that needs to be read. * Returns false if it failed. */ -bool IndexElement::readContentFromDom(QDomNode& node) +bool IndexElement::readContentFromDom(TQDomNode& node) { if (!BasicElement::readContentFromDom(node)) { return false; @@ -1345,28 +1345,28 @@ bool IndexElement::readContentFromDom(QDomNode& node) lowerLeftRead || lowerMiddleRead || lowerRightRead; } -bool IndexElement::readAttributesFromMathMLDom( const QDomElement& element ) +bool IndexElement::readAttributesFromMathMLDom( const TQDomElement& element ) { if ( !BasicElement::readAttributesFromMathMLDom( element ) ) { return false; } - QString tag = element.tagName().stripWhiteSpace().lower(); + TQString tag = element.tagName().stripWhiteSpace().lower(); if ( tag == "msub" || tag == "msubsup" ) { - QString subscriptshiftStr = element.attribute( "subscriptshift" ).stripWhiteSpace().lower(); + TQString subscriptshiftStr = element.attribute( "subscriptshift" ).stripWhiteSpace().lower(); if ( ! subscriptshiftStr.isNull() ) { m_subScriptShift = getSize( subscriptshiftStr, &m_subScriptShiftType ); } } if ( tag == "msup" || tag == "msubsup" ) { - QString superscriptshiftStr = element.attribute( "superscriptshift" ).stripWhiteSpace().lower(); + TQString superscriptshiftStr = element.attribute( "superscriptshift" ).stripWhiteSpace().lower(); if ( ! superscriptshiftStr.isNull() ) { m_superScriptShift = getSize( superscriptshiftStr, &m_superScriptShiftType ); } } if ( tag == "munder" || tag == "munderover" ) { - QString accentunderStr = element.attribute( "accentunder" ).stripWhiteSpace().lower(); + TQString accentunderStr = element.attribute( "accentunder" ).stripWhiteSpace().lower(); if ( ! accentunderStr.isNull() ) { if ( accentunderStr == "true" ) { m_customAccentUnder = true; @@ -1383,7 +1383,7 @@ bool IndexElement::readAttributesFromMathMLDom( const QDomElement& element ) } } if ( tag == "mover" || tag == "munderover" ) { - QString accentStr = element.attribute( "accent" ).stripWhiteSpace().lower(); + TQString accentStr = element.attribute( "accent" ).stripWhiteSpace().lower(); if ( ! accentStr.isNull() ) { if ( accentStr == "true" ) { m_customAccent = true; @@ -1408,7 +1408,7 @@ bool IndexElement::readAttributesFromMathMLDom( const QDomElement& element ) * (e. g. for fence operators). * Returns the number of nodes processed or -1 if it failed. */ -int IndexElement::readContentFromMathMLDom( QDomNode& node ) +int IndexElement::readContentFromMathMLDom( TQDomNode& node ) { if ( BasicElement::readContentFromMathMLDom( node ) == -1 ) { return -1; @@ -1426,7 +1426,7 @@ int IndexElement::readContentFromMathMLDom( QDomNode& node ) node = node.nextSibling(); } - QString indexType = node.parentNode().toElement().tagName().lower(); + TQString indexType = node.tqparentNode().toElement().tagName().lower(); if ( indexType == "msub" ) { lowerRight = new SequenceElement( this ); int lowerRightNumber = lowerRight->buildMathMLChild( node ); @@ -1580,9 +1580,9 @@ ElementIndexPtr IndexElement::getIndex( int position ) -QString IndexElement::toLatex() +TQString IndexElement::toLatex() { - QString index; + TQString index; if ( hasUpperMiddle() ) { index += "\\overset{" + upperMiddle->toLatex() + "}{"; @@ -1622,9 +1622,9 @@ QString IndexElement::toLatex() return index; } -QString IndexElement::formulaString() +TQString IndexElement::formulaString() { - QString index = "(" + content->formulaString() + ")"; + TQString index = "(" + content->formulaString() + ")"; if ( hasLowerRight() ) { index += "_(" + lowerRight->formulaString() + ")"; } @@ -1634,7 +1634,7 @@ QString IndexElement::formulaString() return index; } -QString IndexElement::getElementName() const +TQString IndexElement::getElementName() const { if ( hasUpperMiddle() && hasLowerMiddle() ) return "munderover"; @@ -1653,19 +1653,19 @@ QString IndexElement::getElementName() const return "msubsup"; } -void IndexElement::writeMathMLAttributes( QDomElement& element ) const +void IndexElement::writeMathMLAttributes( TQDomElement& element ) const { - QString tag = getElementName(); + TQString tag = getElementName(); if ( tag == "msub" || tag == "msubsup" ) { switch ( m_subScriptShiftType ) { case AbsoluteSize: - element.setAttribute( "subscriptshift", QString( "%1pt" ).arg( m_subScriptShift ) ); + element.setAttribute( "subscriptshift", TQString( "%1pt" ).tqarg( m_subScriptShift ) ); break; case RelativeSize: - element.setAttribute( "subscriptshift", QString( "%1%" ).arg( m_subScriptShift * 100.0 ) ); + element.setAttribute( "subscriptshift", TQString( "%1%" ).tqarg( m_subScriptShift * 100.0 ) ); break; case PixelSize: - element.setAttribute( "subscriptshift", QString( "%1px" ).arg( m_subScriptShift ) ); + element.setAttribute( "subscriptshift", TQString( "%1px" ).tqarg( m_subScriptShift ) ); break; default: break; @@ -1674,13 +1674,13 @@ void IndexElement::writeMathMLAttributes( QDomElement& element ) const if ( tag == "msup" || tag == "msubsup" ) { switch ( m_superScriptShiftType ) { case AbsoluteSize: - element.setAttribute( "superscriptshift", QString( "%1pt" ).arg( m_superScriptShift ) ); + element.setAttribute( "superscriptshift", TQString( "%1pt" ).tqarg( m_superScriptShift ) ); break; case RelativeSize: - element.setAttribute( "superscriptshift", QString( "%1%" ).arg( m_superScriptShift * 100.0 ) ); + element.setAttribute( "superscriptshift", TQString( "%1%" ).tqarg( m_superScriptShift * 100.0 ) ); break; case PixelSize: - element.setAttribute( "superscriptshift", QString( "%1px" ).arg( m_superScriptShift ) ); + element.setAttribute( "superscriptshift", TQString( "%1px" ).tqarg( m_superScriptShift ) ); break; default: break; @@ -1699,11 +1699,11 @@ void IndexElement::writeMathMLAttributes( QDomElement& element ) const } -void IndexElement::writeMathMLContent( QDomDocument& doc, - QDomElement& element, +void IndexElement::writeMathMLContent( TQDomDocument& doc, + TQDomElement& element, bool oasisFormat ) const { - QDomElement de; + TQDomElement de; content->writeMathML( doc, element, oasisFormat ); // base if ( hasUpperMiddle() && hasLowerMiddle() ) diff --git a/lib/kformula/indexelement.h b/lib/kformula/indexelement.h index 06aac43d..49b03bc7 100644 --- a/lib/kformula/indexelement.h +++ b/lib/kformula/indexelement.h @@ -35,7 +35,7 @@ class IndexElement : public BasicElement { IndexElement& operator=( const IndexElement& ) { return *this; } public: - IndexElement(BasicElement* parent = 0); + IndexElement(BasicElement* tqparent = 0); ~IndexElement(); IndexElement( const IndexElement& ); @@ -49,9 +49,9 @@ public: /** * @returns the character that represents this element. Used for * parsing a sequence. - * This is guaranteed to be QChar::null for all non-text elements. + * This is guaranteed to be TQChar::null for all non-text elements. */ - virtual QChar getCharacter() const; + virtual TQChar getCharacter() const; /** * The cursor has entered one of our child sequences. @@ -66,7 +66,7 @@ public: * is allowed to set the cursor. */ virtual BasicElement* goToPos( FormulaCursor*, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ); + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ); // drawing // @@ -77,7 +77,7 @@ public: /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, @@ -85,19 +85,19 @@ public: StyleAttributes& style ); /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); /** - * Dispatch this FontCommand to all our TextElement children. + * Dispatch this FontCommand to all our TextElement tqchildren. */ virtual void dispatchFontCommand( FontCommand* cmd ); @@ -137,7 +137,7 @@ public: */ virtual void moveDown(FormulaCursor* cursor, BasicElement* from); - // children + // tqchildren /** * Removes the child. If this was the main child this element might @@ -151,7 +151,7 @@ public: // main child // - // If an element has children one has to become the main one. + // If an element has tqchildren one has to become the main one. virtual SequenceElement* getMainChild() { return content; } //SequenceElement* upperLeft; @@ -163,7 +163,7 @@ public: /** - * Inserts all new children at the cursor position. Places the + * Inserts all new tqchildren at the cursor position. Places the * cursor according to the direction. * * You only can insert one index at a time. So the list must contain @@ -172,11 +172,11 @@ public: * * The list will be emptied but stays the property of the caller. */ - virtual void insert(FormulaCursor*, QPtrList<BasicElement>&, Direction); + virtual void insert(FormulaCursor*, TQPtrList<BasicElement>&, Direction); /** - * Removes all selected children and returns them. Places the - * cursor to where the children have been. + * Removes all selected tqchildren and returns them. Places the + * cursor to where the tqchildren have been. * * The cursor has to be inside one of our indexes which is supposed * to be empty. The index will be removed and the cursor will @@ -185,7 +185,7 @@ public: * * The ownership of the list is passed to the caller. */ - virtual void remove(FormulaCursor*, QPtrList<BasicElement>&, Direction); + virtual void remove(FormulaCursor*, TQPtrList<BasicElement>&, Direction); /** * Moves the cursor to a normal place where new elements @@ -212,7 +212,7 @@ public: /** * Returns wether the element has no more useful - * children (except its main child) and should therefore + * tqchildren (except its main child) and should therefore * be replaced by its main child's content. */ virtual bool isSenseless(); @@ -259,12 +259,12 @@ public: /** * @returns the latex representation of the element and - * of the element's children + * of the element's tqchildren */ - virtual QString toLatex(); + virtual TQString toLatex(); // the upper right index is the only one we show - virtual QString formulaString(); + virtual TQString formulaString(); protected: @@ -273,39 +273,39 @@ protected: /** * Returns the tag name of this element type. */ - virtual QString getTagName() const { return "INDEX"; } + virtual TQString getTagName() const { return "INDEX"; } /** * Appends our attributes to the dom element. */ - virtual void writeDom(QDomElement element); + virtual void writeDom(TQDomElement element); - virtual QString getElementName() const ; - virtual void writeMathMLAttributes( QDomElement& element ) const ; - virtual void writeMathMLContent( QDomDocument& doc, - QDomElement& element, + virtual TQString getElementName() const ; + virtual void writeMathMLAttributes( TQDomElement& element ) const ; + virtual void writeMathMLContent( TQDomDocument& doc, + TQDomElement& element, bool oasisFormat ) const ; /** * Reads our attributes from the element. * Returns false if it failed. */ - virtual bool readAttributesFromDom(QDomElement element); + virtual bool readAttributesFromDom(TQDomElement element); /** * Reads our content from the node. Sets the node to the next node * that needs to be read. * Returns false if it failed. */ - virtual bool readContentFromDom(QDomNode& node); + virtual bool readContentFromDom(TQDomNode& node); - virtual bool readAttributesFromMathMLDom( const QDomElement& element ); + virtual bool readAttributesFromMathMLDom( const TQDomElement& element ); /** * Reads our content from the MathML node. Sets the node to the next node * that needs to be read. It is sometimes needed to read more than one node * (e. g. for fence operators). * Returns the number of nodes processed or -1 if it failed. */ - virtual int readContentFromMathMLDom( QDomNode& node ); + virtual int readContentFromMathMLDom( TQDomNode& node ); private: @@ -314,78 +314,78 @@ private: */ class IndexElementIndex : public ElementIndex { public: - IndexElementIndex(IndexElement* p) : parent(p) {} - virtual IndexElement* getElement() { return parent; } + IndexElementIndex(IndexElement* p) : tqparent(p) {} + virtual IndexElement* getElement() { return tqparent; } protected: - IndexElement* parent; + IndexElement* tqparent; }; // We have a (very simple) type for every index. class UpperLeftIndex : public IndexElementIndex { public: - UpperLeftIndex(IndexElement* parent) : IndexElementIndex(parent) {} + UpperLeftIndex(IndexElement* tqparent) : IndexElementIndex(tqparent) {} virtual void moveToIndex(FormulaCursor* cursor, Direction direction) - { parent->moveToUpperLeft(cursor, direction); } + { tqparent->moveToUpperLeft(cursor, direction); } virtual void setToIndex(FormulaCursor* cursor) - { parent->setToUpperLeft(cursor); } + { tqparent->setToUpperLeft(cursor); } virtual bool hasIndex() const - { return parent->hasUpperLeft(); } + { return tqparent->hasUpperLeft(); } }; class LowerLeftIndex : public IndexElementIndex { public: - LowerLeftIndex(IndexElement* parent) : IndexElementIndex(parent) {} + LowerLeftIndex(IndexElement* tqparent) : IndexElementIndex(tqparent) {} virtual void moveToIndex(FormulaCursor* cursor, Direction direction) - { parent->moveToLowerLeft(cursor, direction); } + { tqparent->moveToLowerLeft(cursor, direction); } virtual void setToIndex(FormulaCursor* cursor) - { parent->setToLowerLeft(cursor); } + { tqparent->setToLowerLeft(cursor); } virtual bool hasIndex() const - { return parent->hasLowerLeft(); } + { return tqparent->hasLowerLeft(); } }; class UpperMiddleIndex : public IndexElementIndex { public: - UpperMiddleIndex(IndexElement* parent) : IndexElementIndex(parent) {} + UpperMiddleIndex(IndexElement* tqparent) : IndexElementIndex(tqparent) {} virtual void moveToIndex(FormulaCursor* cursor, Direction direction) - { parent->moveToUpperMiddle(cursor, direction); } + { tqparent->moveToUpperMiddle(cursor, direction); } virtual void setToIndex(FormulaCursor* cursor) - { parent->setToUpperMiddle(cursor); } + { tqparent->setToUpperMiddle(cursor); } virtual bool hasIndex() const - { return parent->hasUpperMiddle(); } + { return tqparent->hasUpperMiddle(); } }; class LowerMiddleIndex : public IndexElementIndex { public: - LowerMiddleIndex(IndexElement* parent) : IndexElementIndex(parent) {} + LowerMiddleIndex(IndexElement* tqparent) : IndexElementIndex(tqparent) {} virtual void moveToIndex(FormulaCursor* cursor, Direction direction) - { parent->moveToLowerMiddle(cursor, direction); } + { tqparent->moveToLowerMiddle(cursor, direction); } virtual void setToIndex(FormulaCursor* cursor) - { parent->setToLowerMiddle(cursor); } + { tqparent->setToLowerMiddle(cursor); } virtual bool hasIndex() const - { return parent->hasLowerMiddle(); } + { return tqparent->hasLowerMiddle(); } }; class UpperRightIndex : public IndexElementIndex { public: - UpperRightIndex(IndexElement* parent) : IndexElementIndex(parent) {} + UpperRightIndex(IndexElement* tqparent) : IndexElementIndex(tqparent) {} virtual void moveToIndex(FormulaCursor* cursor, Direction direction) - { parent->moveToUpperRight(cursor, direction); } + { tqparent->moveToUpperRight(cursor, direction); } virtual void setToIndex(FormulaCursor* cursor) - { parent->setToUpperRight(cursor); } + { tqparent->setToUpperRight(cursor); } virtual bool hasIndex() const - { return parent->hasUpperRight(); } + { return tqparent->hasUpperRight(); } }; class LowerRightIndex : public IndexElementIndex { public: - LowerRightIndex(IndexElement* parent) : IndexElementIndex(parent) {} + LowerRightIndex(IndexElement* tqparent) : IndexElementIndex(tqparent) {} virtual void moveToIndex(FormulaCursor* cursor, Direction direction) - { parent->moveToLowerRight(cursor, direction); } + { tqparent->moveToLowerRight(cursor, direction); } virtual void setToIndex(FormulaCursor* cursor) - { parent->setToLowerRight(cursor); } + { tqparent->setToLowerRight(cursor); } virtual bool hasIndex() const - { return parent->hasLowerRight(); } + { return tqparent->hasLowerRight(); } }; diff --git a/lib/kformula/kformulacommand.cc b/lib/kformula/kformulacommand.cc index 24d49019..804b66c6 100644 --- a/lib/kformula/kformulacommand.cc +++ b/lib/kformula/kformulacommand.cc @@ -20,7 +20,7 @@ #include <klocale.h> //This is for undo descriptions -#include <qvaluelist.h> +#include <tqvaluelist.h> #include "formulacursor.h" #include "formulaelement.h" @@ -36,7 +36,7 @@ KFORMULA_NAMESPACE_BEGIN int PlainCommand::evilDestructionCount = 0; -PlainCommand::PlainCommand( const QString& name ) +PlainCommand::PlainCommand( const TQString& name ) : KNamedCommand(name) { evilDestructionCount++; @@ -47,7 +47,7 @@ PlainCommand::~PlainCommand() evilDestructionCount--; } -Command::Command(const QString &name, Container* document) +Command::Command(const TQString &name, Container* document) : PlainCommand(name), cursordata(0), undocursor(0), doc(document) { } @@ -93,7 +93,7 @@ void Command::setUnexecuteCursor(FormulaCursor* cursor) // ****** Generic Add command -KFCAdd::KFCAdd(const QString &name, Container *document) +KFCAdd::KFCAdd(const TQString &name, Container *document) : Command(name, document) { addList.setAutoDelete( true ); @@ -148,7 +148,7 @@ void KFCRemoveSelection::unexecute() -KFCReplace::KFCReplace(const QString &name, Container* document) +KFCReplace::KFCReplace(const TQString &name, Container* document) : KFCAdd(name, document), removeSelection(0) { } @@ -180,15 +180,15 @@ void KFCReplace::unexecute() // ****** Token Add command -KFCAddToken::KFCAddToken(const QString &name, Container *document) +KFCAddToken::KFCAddToken(const TQString &name, Container *document) : Command(name, document) { } KFCAddToken::~KFCAddToken() { - QPtrDictIterator< QPtrList< BasicElement > > it( contentList ); - QPtrList< BasicElement >* list; + TQPtrDictIterator< TQPtrList< BasicElement > > it( contentList ); + TQPtrList< BasicElement >* list; while ( ( list = it.current() ) != 0 ) { delete list; ++it; @@ -199,15 +199,15 @@ void KFCAddToken::execute() { kdDebug( DEBUGID ) << k_funcinfo << endl; FormulaCursor* cursor = getExecuteCursor(); - QPtrList<BasicElement> tokenListTmp = tokenList; + TQPtrList<BasicElement> tokenListTmp = tokenList; cursor->insert( tokenList, beforeCursor ); tokenList = tokenListTmp; - QPtrListIterator< BasicElement > it( tokenList ); + TQPtrListIterator< BasicElement > it( tokenList ); BasicElement* element; BasicElement* current = cursor->getElement(); while ( (element = it.current()) != 0 ) { element->goInside( cursor ); - cursor->insert( *contentList.find( element ), beforeCursor ); + cursor->insert( *contentList.tqfind( element ), beforeCursor ); ++it; } setUnexecuteCursor( cursor ); @@ -220,20 +220,20 @@ void KFCAddToken::unexecute() { kdDebug( DEBUGID ) << k_funcinfo << endl; FormulaCursor* cursor = getUnexecuteCursor(); - SequenceElement* parent = static_cast<SequenceElement*>(cursor->getElement()->getParent()); + SequenceElement* tqparent = static_cast<SequenceElement*>(cursor->getElement()->getParent()); for ( int i = 0; i < tokenList.count(); i++ ) { SequenceElement* current = static_cast<SequenceElement*>(cursor->getElement()); - QPtrList< BasicElement > list; + TQPtrList< BasicElement > list; for ( uint i = 0; i < current->countChildren(); ++i ) { cursor->remove( list, beforeCursor ); } - if ( parent ) { - int pos = parent->childPos( current ); - cursor->setTo( parent, pos + 1); + if ( tqparent ) { + int pos = tqparent->childPos( current ); + cursor->setTo( tqparent, pos + 1); cursor->remove( list, beforeCursor ); if ( pos > 0 ) { - BasicElement* element = parent->getChild( pos - 1 ); + BasicElement* element = tqparent->getChild( pos - 1 ); if (element) element->moveEnd( cursor ); } @@ -248,11 +248,11 @@ void KFCAddToken::unexecute() void KFCAddToken::addToken( BasicElement* element ) { tokenList.append( element ); - contentList.insert( element, new QPtrList< BasicElement > ); - contentList.find( element )->setAutoDelete( true ); + contentList.insert( element, new TQPtrList< BasicElement > ); + contentList.tqfind( element )->setAutoDelete( true ); } -KFCReplaceToken::KFCReplaceToken(const QString &name, Container* document) +KFCReplaceToken::KFCReplaceToken(const TQString &name, Container* document) : KFCAddToken(name, document), removeSelection(0) { } @@ -284,7 +284,7 @@ void KFCReplaceToken::unexecute() } -KFCSplitToken::KFCSplitToken(const QString &name, Container* document) +KFCSplitToken::KFCSplitToken(const TQString &name, Container* document) : KFCAddToken(name, document), removeSelection(0) { splitList.setAutoDelete( true ); @@ -306,15 +306,15 @@ void KFCSplitToken::execute() removeSelection->execute(); } splitCursor = cursor->getCursorData(); - SequenceElement* parent = static_cast<SequenceElement*>( cursor->getElement() ); - if ( parent ) { - cursor->setMark( parent->countChildren() ); + SequenceElement* tqparent = static_cast<SequenceElement*>( cursor->getElement() ); + if ( tqparent ) { + cursor->setMark( tqparent->countChildren() ); cursor->setSelection( true ); } cursor->remove( splitList, afterCursor ); TokenElement *token = new TokenElement();// TODO addToken( token ); - QPtrListIterator< BasicElement > it ( splitList ); + TQPtrListIterator< BasicElement > it ( splitList ); BasicElement* element; while ( ( element = it.current() ) != 0 ) { addContent( token, element ); @@ -322,8 +322,8 @@ void KFCSplitToken::execute() } KFCAddToken::execute(); cursor = getExecuteCursor(); - if ( parent ) { - BasicElement* child = parent->getChild( cursor->getPos() ); + if ( tqparent ) { + BasicElement* child = tqparent->getChild( cursor->getPos() ); if ( child ) { child->moveEnd( cursor ); } @@ -425,7 +425,7 @@ void KFCRemoveEnclosing::unexecute() // ****** Add root, bracket etc command -KFCAddReplacing::KFCAddReplacing(const QString &name, Container* document) +KFCAddReplacing::KFCAddReplacing(const TQString &name, Container* document) : Command(name, document), element(0) { } @@ -496,7 +496,7 @@ void KFCAddIndex::unexecute() } -KFCChangeBaseSize::KFCChangeBaseSize( const QString& name, Container* document, +KFCChangeBaseSize::KFCChangeBaseSize( const TQString& name, Container* document, FormulaElement* formula, int size ) : PlainCommand( name ), m_document( document ), m_formula( formula ), m_size( size ) { @@ -516,7 +516,7 @@ void KFCChangeBaseSize::unexecute() } -FontCommand::FontCommand( const QString& name, Container* document ) +FontCommand::FontCommand( const TQString& name, Container* document ) : Command( name, document ) { list.setAutoDelete( false ); @@ -534,10 +534,10 @@ void FontCommand::collectChildren() } -void FontCommand::parseSequences( const QMap<SequenceElement*, int>& parents ) +void FontCommand::parseSequences( const TQMap<SequenceElement*, int>& tqparents ) { - QValueList<SequenceElement*> sequences = parents.keys(); - for ( QValueList<SequenceElement*>::iterator i = sequences.begin(); + TQValueList<SequenceElement*> sequences = tqparents.keys(); + for ( TQValueList<SequenceElement*>::iterator i = sequences.begin(); i != sequences.end(); ++i ) { ( *i )->parse(); @@ -545,7 +545,7 @@ void FontCommand::parseSequences( const QMap<SequenceElement*, int>& parents ) } -CharStyleCommand::CharStyleCommand( CharStyle cs, const QString& name, Container* document ) +CharStyleCommand::CharStyleCommand( CharStyle cs, const TQString& name, Container* document ) : FontCommand( name, document ), charStyle( cs ) { } @@ -553,37 +553,37 @@ CharStyleCommand::CharStyleCommand( CharStyle cs, const QString& name, Container void CharStyleCommand::execute() { collectChildren(); - QMap<SequenceElement*, int> parentCollector; + TQMap<SequenceElement*, int> tqparentCollector; styleList.clear(); - uint count = childrenList().count(); + uint count = tqchildrenList().count(); styleList.reserve( count ); for ( uint i=0; i<count; ++i ) { - TextElement* child = childrenList().at( i ); + TextElement* child = tqchildrenList().at( i ); styleList[i] = child->getCharStyle(); child->setCharStyle( charStyle ); - parentCollector[static_cast<SequenceElement*>( child->getParent() )] = 1; + tqparentCollector[static_cast<SequenceElement*>( child->getParent() )] = 1; } - parseSequences( parentCollector ); + parseSequences( tqparentCollector ); testDirty(); } void CharStyleCommand::unexecute() { - QMap<SequenceElement*, int> parentCollector; - uint count = childrenList().count(); + TQMap<SequenceElement*, int> tqparentCollector; + uint count = tqchildrenList().count(); //styleList.reserve( count ); for ( uint i=0; i<count; ++i ) { - TextElement* child = childrenList().at( i ); + TextElement* child = tqchildrenList().at( i ); child->setCharStyle( styleList[i] ); - parentCollector[static_cast<SequenceElement*>( child->getParent() )] = 1; + tqparentCollector[static_cast<SequenceElement*>( child->getParent() )] = 1; } - parseSequences( parentCollector ); + parseSequences( tqparentCollector ); testDirty(); } -CharFamilyCommand::CharFamilyCommand( CharFamily cf, const QString& name, Container* document ) +CharFamilyCommand::CharFamilyCommand( CharFamily cf, const TQString& name, Container* document ) : FontCommand( name, document ), charFamily( cf ) { } @@ -592,32 +592,32 @@ void CharFamilyCommand::execute() { collectChildren(); - QMap<SequenceElement*, int> parentCollector; + TQMap<SequenceElement*, int> tqparentCollector; familyList.clear(); - uint count = childrenList().count(); + uint count = tqchildrenList().count(); familyList.reserve( count ); for ( uint i=0; i<count; ++i ) { - TextElement* child = childrenList().at( i ); + TextElement* child = tqchildrenList().at( i ); familyList[i] = child->getCharFamily(); child->setCharFamily( charFamily ); - parentCollector[static_cast<SequenceElement*>( child->getParent() )] = 1; + tqparentCollector[static_cast<SequenceElement*>( child->getParent() )] = 1; } - parseSequences( parentCollector ); + parseSequences( tqparentCollector ); testDirty(); } void CharFamilyCommand::unexecute() { - QMap<SequenceElement*, int> parentCollector; - uint count = childrenList().count(); + TQMap<SequenceElement*, int> tqparentCollector; + uint count = tqchildrenList().count(); //familyList.reserve( count ); for ( uint i=0; i<count; ++i ) { - TextElement* child = childrenList().at( i ); + TextElement* child = tqchildrenList().at( i ); child->setCharFamily( familyList[i] ); - parentCollector[static_cast<SequenceElement*>( child->getParent() )] = 1; + tqparentCollector[static_cast<SequenceElement*>( child->getParent() )] = 1; } - parseSequences( parentCollector ); + parseSequences( tqparentCollector ); testDirty(); } diff --git a/lib/kformula/kformulacommand.h b/lib/kformula/kformulacommand.h index 0e13928e..ec014604 100644 --- a/lib/kformula/kformulacommand.h +++ b/lib/kformula/kformulacommand.h @@ -21,10 +21,10 @@ #ifndef KFORMULACOMMAND_H #define KFORMULACOMMAND_H -#include <qmap.h> -#include <qptrlist.h> -#include <qptrdict.h> -#include <qvaluevector.h> +#include <tqmap.h> +#include <tqptrlist.h> +#include <tqptrdict.h> +#include <tqvaluevector.h> #include <kcommand.h> @@ -61,7 +61,7 @@ public: * * @param name a description to be used as menu entry. */ - PlainCommand(const QString& name); + PlainCommand(const TQString& name); virtual ~PlainCommand(); /** @@ -89,7 +89,7 @@ public: * @param name a description to be used as menu entry. * @param document the container we are working for. */ - Command(const QString& name, Container* document); + Command(const TQString& name, Container* document); virtual ~Command(); protected: @@ -164,7 +164,7 @@ class KFCAdd : public Command { public: - KFCAdd(const QString &name, Container* document); + KFCAdd(const TQString &name, Container* document); virtual void execute(); virtual void unexecute(); @@ -180,7 +180,7 @@ private: * the list where all elements are stored that are removed * from the tree. */ - QPtrList<BasicElement> addList; + TQPtrList<BasicElement> addList; }; @@ -207,7 +207,7 @@ private: * the list where all elements are stored that are removed * from the tree. */ - QPtrList<BasicElement> removedList; + TQPtrList<BasicElement> removedList; Direction dir; }; @@ -221,7 +221,7 @@ class KFCReplace : public KFCAdd { public: - KFCReplace(const QString &name, Container* document); + KFCReplace(const TQString &name, Container* document); ~KFCReplace(); virtual void execute(); @@ -241,7 +241,7 @@ private: class KFCAddToken : public Command { public: - KFCAddToken( const QString &name, Container *document); + KFCAddToken( const TQString &name, Container *document); ~KFCAddToken(); virtual void execute(); @@ -256,7 +256,7 @@ public: * Collect content for each token */ void addContent( BasicElement* element, BasicElement* content ) { - contentList.find( element )->append( content ); + contentList.tqfind( element )->append( content ); } @@ -265,12 +265,12 @@ private: /** * List where all token elements are stored. */ - QPtrList< BasicElement > tokenList; + TQPtrList< BasicElement > tokenList; /** * Dictionary where all content elements are stored */ - QPtrDict< QPtrList< BasicElement > > contentList; + TQPtrDict< TQPtrList< BasicElement > > contentList; }; /** @@ -281,7 +281,7 @@ class KFCReplaceToken : public KFCAddToken { public: - KFCReplaceToken(const QString &name, Container* document); + KFCReplaceToken(const TQString &name, Container* document); ~KFCReplaceToken(); virtual void execute(); @@ -306,7 +306,7 @@ class KFCSplitToken : public KFCAddToken { public: - KFCSplitToken(const QString &name, Container* document); + KFCSplitToken(const TQString &name, Container* document); ~KFCSplitToken(); virtual void execute(); @@ -327,7 +327,7 @@ private: /** * The list of elements that are splited into another token */ - QPtrList< BasicElement > splitList; + TQPtrList< BasicElement > splitList; /** * Information about cursor position where the split is made. @@ -366,7 +366,7 @@ private: * the list where all elements are stored that are removed * from the tree. */ - QPtrList<BasicElement> removedList; + TQPtrList<BasicElement> removedList; /** * The element we might have extracted. @@ -385,7 +385,7 @@ private: /** - * Command to remove the parent element. + * Command to remove the tqparent element. */ class KFCRemoveEnclosing : public Command { @@ -410,7 +410,7 @@ private: class KFCAddReplacing : public Command { public: - KFCAddReplacing(const QString &name, Container* document); + KFCAddReplacing(const TQString &name, Container* document); ~KFCAddReplacing(); virtual void execute(); @@ -468,7 +468,7 @@ class FormulaElement; class KFCChangeBaseSize : public PlainCommand { public: - KFCChangeBaseSize( const QString& name, Container* document, FormulaElement* formula, int size ); + KFCChangeBaseSize( const TQString& name, Container* document, FormulaElement* formula, int size ); void execute(); void unexecute(); @@ -487,7 +487,7 @@ private: */ class FontCommand : public Command { public: - FontCommand( const QString& name, Container* document ); + FontCommand( const TQString& name, Container* document ); /** * Collects all elements that are to be modified. @@ -495,17 +495,17 @@ public: void addTextElement( TextElement* element ) { list.append(element); } /** - * Collects all parent elements those children are to be changend. + * Collects all tqparent elements those tqchildren are to be changend. */ void addElement( BasicElement* element ) { elementList.append( element ); } protected: - QPtrList<TextElement>& childrenList() { return list; } + TQPtrList<TextElement>& tqchildrenList() { return list; } void collectChildren(); - void parseSequences( const QMap<SequenceElement*, int>& parents ); + void parseSequences( const TQMap<SequenceElement*, int>& tqparents ); private: @@ -513,25 +513,25 @@ private: * the list where all elements are stored that are removed * from the tree. */ - QPtrList<TextElement> list; + TQPtrList<TextElement> list; - QPtrList<BasicElement> elementList; + TQPtrList<BasicElement> elementList; }; /** - * Changes the char style of a number of elements an their children. + * Changes the char style of a number of elements an their tqchildren. */ class CharStyleCommand : public FontCommand { public: - CharStyleCommand( CharStyle cs, const QString& name, Container* document ); + CharStyleCommand( CharStyle cs, const TQString& name, Container* document ); virtual void execute(); virtual void unexecute(); private: - typedef QValueVector<CharStyle> StyleList; + typedef TQValueVector<CharStyle> StyleList; StyleList styleList; CharStyle charStyle; @@ -539,18 +539,18 @@ private: /** - * Changes the char family of a number of elements an their children. + * Changes the char family of a number of elements an their tqchildren. */ class CharFamilyCommand : public FontCommand { public: - CharFamilyCommand( CharFamily cf, const QString& name, Container* document ); + CharFamilyCommand( CharFamily cf, const TQString& name, Container* document ); virtual void execute(); virtual void unexecute(); private: - typedef QValueVector<CharFamily> FamilyList; + typedef TQValueVector<CharFamily> FamilyList; FamilyList familyList; CharFamily charFamily; diff --git a/lib/kformula/kformulacompatibility.cc b/lib/kformula/kformulacompatibility.cc index 70f77ed9..434bd28b 100644 --- a/lib/kformula/kformulacompatibility.cc +++ b/lib/kformula/kformulacompatibility.cc @@ -20,7 +20,7 @@ * Boston, MA 02110-1301, USA. */ -#include <qvaluelist.h> +#include <tqvaluelist.h> #include <kdebug.h> #include "kformuladefs.h" @@ -45,7 +45,7 @@ const BoxType OF_SUB = '_' + UNUSED_OFFSET; const BoxType OF_LSUP = '6' + UNUSED_OFFSET; const BoxType OF_LSUB = '%' + UNUSED_OFFSET; //const BoxType PAREN = '('; -//const BoxType EQUAL = '='; +//const BoxType ETQUAL = '='; //const BoxType MORE = '>'; //const BoxType LESS = '<'; //const BoxType ABS = '|'; @@ -71,19 +71,19 @@ Compatibility::Compatibility() } -QDomDocument Compatibility::buildDOM(QString text) +TQDomDocument Compatibility::buildDOM(TQString text) { - QDomDocument doc("KFORMULA"); + TQDomDocument doc("KFORMULA"); pos = 0; formulaString = text; - QDomElement formula = readSequence(doc); + TQDomElement formula = readSequence(doc); formula.setTagName("FORMULA"); doc.appendChild(formula); return doc; } -void Compatibility::appendNextSequence(const QDomDocument& doc, QDomElement element) +void Compatibility::appendNextSequence(const TQDomDocument& doc, TQDomElement element) { if (hasNext() && nextToken() == '{') { element.appendChild(readSequence(doc)); @@ -95,16 +95,16 @@ void Compatibility::appendNextSequence(const QDomDocument& doc, QDomElement elem } -QDomElement Compatibility::getLastSequence(const QDomDocument& doc, QDomElement sequence) +TQDomElement Compatibility::getLastSequence(const TQDomDocument& doc, TQDomElement sequence) { if (sequence.lastChild().nodeName() == "SEQUENCE") { - QDomNode child = sequence.removeChild(sequence.lastChild()); + TQDomNode child = sequence.removeChild(sequence.lastChild()); return child.toElement(); } else { - QDomElement newSeq = doc.createElement("SEQUENCE"); + TQDomElement newSeq = doc.createElement("SEQUENCE"); if (!sequence.lastChild().isNull()) { - QDomNode child = sequence.removeChild(sequence.lastChild()); + TQDomNode child = sequence.removeChild(sequence.lastChild()); newSeq.appendChild(child); } return newSeq; @@ -112,15 +112,15 @@ QDomElement Compatibility::getLastSequence(const QDomDocument& doc, QDomElement } -QDomElement Compatibility::findIndexNode(const QDomDocument& doc, QDomElement sequence) +TQDomElement Compatibility::findIndexNode(const TQDomDocument& doc, TQDomElement sequence) { - QDomElement element; + TQDomElement element; if (sequence.lastChild().nodeName() == "INDEX") { element = sequence.lastChild().toElement(); } else { element = doc.createElement("INDEX"); - QDomElement con = doc.createElement("CONTENT"); + TQDomElement con = doc.createElement("CONTENT"); element.appendChild(con); con.appendChild(getLastSequence(doc, sequence)); sequence.appendChild(element); @@ -129,14 +129,14 @@ QDomElement Compatibility::findIndexNode(const QDomDocument& doc, QDomElement se } -void Compatibility::appendToSequence(QDomElement sequence, QDomElement element, int leftIndexSeen) +void Compatibility::appendToSequence(TQDomElement sequence, TQDomElement element, int leftIndexSeen) { if (leftIndexSeen > 0) { if (sequence.lastChild().nodeName() == "INDEX") { - QDomElement index = sequence.lastChild().toElement(); + TQDomElement index = sequence.lastChild().toElement(); if ((index.firstChild().nodeName() == "CONTENT") && (index.firstChild().firstChild().nodeName() == "SEQUENCE")) { - QDomElement seq = index.firstChild().firstChild().toElement(); + TQDomElement seq = index.firstChild().firstChild().toElement(); if (element.nodeName() == "SEQUENCE") { index.firstChild().replaceChild(element, seq); } @@ -151,9 +151,9 @@ void Compatibility::appendToSequence(QDomElement sequence, QDomElement element, } -QDomElement Compatibility::readMatrix(const QDomDocument& doc) +TQDomElement Compatibility::readMatrix(const TQDomDocument& doc) { - QDomElement element = doc.createElement("MATRIX"); + TQDomElement element = doc.createElement("MATRIX"); uint cols = nextToken(); nextToken(); @@ -163,11 +163,11 @@ QDomElement Compatibility::readMatrix(const QDomDocument& doc) element.setAttribute("COLUMNS", cols); if ((nextToken() == '}') && (nextToken() == OF_MATRIX) && (nextToken() == '{')) { - QValueList<QDomElement> matrix; + TQValueList<TQDomElement> matrix; for (uint c = 0; c < cols; c++) { for (uint r = 0; r < rows; r++) { if (hasNext() && (nextToken() == '{')) { - QDomElement tmp = readSequence(doc); + TQDomElement tmp = readSequence(doc); matrix.append(tmp); } if (hasNext() && (nextToken() != OF_SEPARATOR)) { @@ -195,7 +195,7 @@ QDomElement Compatibility::readMatrix(const QDomDocument& doc) } -QDomElement Compatibility::readSequence(const QDomDocument& doc) +TQDomElement Compatibility::readSequence(const TQDomDocument& doc) { // matrizes start with something that isn't a sequence if ((tokenLeft() > 6) && (lookAhead(1) == OF_SEPARATOR)) { @@ -203,7 +203,7 @@ QDomElement Compatibility::readSequence(const QDomDocument& doc) } int leftIndexSeen = 0; - QDomElement sequence = doc.createElement("SEQUENCE"); + TQDomElement sequence = doc.createElement("SEQUENCE"); while (hasNext()) { ushort ch = nextToken(); @@ -227,24 +227,24 @@ QDomElement Compatibility::readSequence(const QDomDocument& doc) sequence.removeChild(sequence.lastChild()); } - QDomElement element = doc.createElement("BRACKET"); + TQDomElement element = doc.createElement("BRACKET"); appendToSequence(sequence, element, leftIndexSeen); element.setAttribute("LEFT", ch); element.setAttribute("RIGHT", (ch=='(') ? ')' : ((ch=='[') ? ']' : '|')); - QDomElement con = doc.createElement("CONTENT"); + TQDomElement con = doc.createElement("CONTENT"); element.appendChild(con); appendNextSequence(doc, con); break; } case OF_DIVIDE: { - QDomElement element = doc.createElement("FRACTION"); + TQDomElement element = doc.createElement("FRACTION"); - QDomElement num = doc.createElement("NUMERATOR"); + TQDomElement num = doc.createElement("NUMERATOR"); element.appendChild(num); num.appendChild(getLastSequence(doc, sequence)); - QDomElement den = doc.createElement("DENOMINATOR"); + TQDomElement den = doc.createElement("DENOMINATOR"); element.appendChild(den); appendNextSequence(doc, den); @@ -252,12 +252,12 @@ QDomElement Compatibility::readSequence(const QDomDocument& doc) break; } case OF_SQRT: { - QDomElement element = doc.createElement("ROOT"); - QDomElement con = doc.createElement("CONTENT"); + TQDomElement element = doc.createElement("ROOT"); + TQDomElement con = doc.createElement("CONTENT"); element.appendChild(con); appendNextSequence(doc, con); - QDomElement ind = doc.createElement("INDEX"); + TQDomElement ind = doc.createElement("INDEX"); element.appendChild(ind); ind.appendChild(getLastSequence(doc, sequence)); @@ -265,31 +265,31 @@ QDomElement Compatibility::readSequence(const QDomDocument& doc) break; } case OF_POWER: { - QDomElement element = findIndexNode(doc, sequence); - QDomElement upperRight = doc.createElement("UPPERRIGHT"); + TQDomElement element = findIndexNode(doc, sequence); + TQDomElement upperRight = doc.createElement("UPPERRIGHT"); element.appendChild(upperRight); appendNextSequence(doc, upperRight); break; } case OF_SUB: { - QDomElement element = findIndexNode(doc, sequence); - QDomElement lowerRight = doc.createElement("LOWERRIGHT"); + TQDomElement element = findIndexNode(doc, sequence); + TQDomElement lowerRight = doc.createElement("LOWERRIGHT"); element.appendChild(lowerRight); appendNextSequence(doc, lowerRight); break; } case OF_LSUP: { - QDomElement upperLeft = doc.createElement("UPPERLEFT"); + TQDomElement upperLeft = doc.createElement("UPPERLEFT"); upperLeft.appendChild(getLastSequence(doc, sequence)); - QDomElement element; + TQDomElement element; if (sequence.lastChild().nodeName() == "INDEX") { element = sequence.lastChild().toElement(); } else { element = doc.createElement("INDEX"); - QDomElement con = doc.createElement("CONTENT"); + TQDomElement con = doc.createElement("CONTENT"); element.appendChild(con); - QDomElement seq = doc.createElement("SEQUENCE"); + TQDomElement seq = doc.createElement("SEQUENCE"); con.appendChild(seq); appendToSequence(sequence, element, leftIndexSeen); } @@ -298,17 +298,17 @@ QDomElement Compatibility::readSequence(const QDomDocument& doc) break; } case OF_LSUB: { - QDomElement lowerLeft = doc.createElement("LOWERLEFT"); + TQDomElement lowerLeft = doc.createElement("LOWERLEFT"); lowerLeft.appendChild(getLastSequence(doc, sequence)); - QDomElement element; + TQDomElement element; if (sequence.lastChild().nodeName() == "INDEX") { element = sequence.lastChild().toElement(); } else { element = doc.createElement("INDEX"); - QDomElement con = doc.createElement("CONTENT"); + TQDomElement con = doc.createElement("CONTENT"); element.appendChild(con); - QDomElement seq = doc.createElement("SEQUENCE"); + TQDomElement seq = doc.createElement("SEQUENCE"); con.appendChild(seq); appendToSequence(sequence, element, leftIndexSeen); } @@ -318,14 +318,14 @@ QDomElement Compatibility::readSequence(const QDomDocument& doc) } case OF_ABOVE: { if (sequence.lastChild().nodeName() == "SEQUENCE") { - QDomElement seq = sequence.lastChild().toElement(); + TQDomElement seq = sequence.lastChild().toElement(); if ((seq.childNodes().count() == 1) && ((seq.lastChild().nodeName() == "SYMBOL") || (seq.lastChild().nodeName() == "INDEX"))) { sequence.removeChild(seq); - QDomElement element = seq.lastChild().toElement(); - QDomElement upper = (element.nodeName() == "SYMBOL") ? + TQDomElement element = seq.lastChild().toElement(); + TQDomElement upper = (element.nodeName() == "SYMBOL") ? doc.createElement("UPPER") : doc.createElement("UPPERMIDDLE"); element.appendChild(upper); @@ -334,22 +334,22 @@ QDomElement Compatibility::readSequence(const QDomDocument& doc) break; } } - QDomElement element = findIndexNode(doc, sequence); - QDomElement upper = doc.createElement("UPPERMIDDLE"); + TQDomElement element = findIndexNode(doc, sequence); + TQDomElement upper = doc.createElement("UPPERMIDDLE"); element.appendChild(upper); appendNextSequence(doc, upper); break; } case OF_BELOW: { if (sequence.lastChild().nodeName() == "SEQUENCE") { - QDomElement seq = sequence.lastChild().toElement(); + TQDomElement seq = sequence.lastChild().toElement(); if ((seq.childNodes().count() == 1) && ((seq.lastChild().nodeName() == "SYMBOL") || (seq.lastChild().nodeName() == "INDEX"))) { sequence.removeChild(seq); - QDomElement element = seq.lastChild().toElement(); - QDomElement lower = (element.nodeName() == "SYMBOL") ? + TQDomElement element = seq.lastChild().toElement(); + TQDomElement lower = (element.nodeName() == "SYMBOL") ? doc.createElement("LOWER") : doc.createElement("LOWERMIDDLE"); element.appendChild(lower); @@ -358,8 +358,8 @@ QDomElement Compatibility::readSequence(const QDomDocument& doc) break; } } - QDomElement element = findIndexNode(doc, sequence); - QDomElement lower = doc.createElement("LOWERMIDDLE"); + TQDomElement element = findIndexNode(doc, sequence); + TQDomElement lower = doc.createElement("LOWERMIDDLE"); element.appendChild(lower); appendNextSequence(doc, lower); break; @@ -370,12 +370,12 @@ QDomElement Compatibility::readSequence(const QDomDocument& doc) case INTEGRAL: case SUM: case PRODUCT: { - QDomElement element = doc.createElement("SYMBOL"); + TQDomElement element = doc.createElement("SYMBOL"); element.setAttribute("TYPE", (ch==INTEGRAL) ? Integral : ((ch==SUM) ? Sum : Product)); - QDomElement con = doc.createElement("CONTENT"); + TQDomElement con = doc.createElement("CONTENT"); element.appendChild(con); con.appendChild(readSequence(doc)); pushback(); @@ -383,15 +383,15 @@ QDomElement Compatibility::readSequence(const QDomDocument& doc) break; } case ARROW: { - QDomElement element = doc.createElement("TEXT"); - element.setAttribute("CHAR", QString(QChar(static_cast<char>(174)))); + TQDomElement element = doc.createElement("TEXT"); + element.setAttribute("CHAR", TQString(TQChar(static_cast<char>(174)))); element.setAttribute("SYMBOL", "1"); appendToSequence(sequence, element, leftIndexSeen); break; } default: { - QDomElement element = doc.createElement("TEXT"); - element.setAttribute("CHAR", QString(formulaString[pos-1])); + TQDomElement element = doc.createElement("TEXT"); + element.setAttribute("CHAR", TQString(formulaString[pos-1])); appendToSequence(sequence, element, leftIndexSeen); } } diff --git a/lib/kformula/kformulacompatibility.h b/lib/kformula/kformulacompatibility.h index 98c268cc..9be5c7ba 100644 --- a/lib/kformula/kformulacompatibility.h +++ b/lib/kformula/kformulacompatibility.h @@ -20,8 +20,8 @@ #ifndef KFORMULACOMPATIBILITY_H #define KFORMULACOMPATIBILITY_H -#include <qdom.h> -#include <qstring.h> +#include <tqdom.h> +#include <tqstring.h> KFORMULA_NAMESPACE_BEGIN @@ -37,22 +37,22 @@ public: /** * Builds a kformula DOM from a old formula string. */ - QDomDocument buildDOM(QString text); + TQDomDocument buildDOM(TQString text); private: - QDomElement readSequence(const QDomDocument& doc); - QDomElement readMatrix(const QDomDocument& doc); + TQDomElement readSequence(const TQDomDocument& doc); + TQDomElement readMatrix(const TQDomDocument& doc); - void appendToSequence(QDomElement sequence, QDomElement element, int leftIndexSeen); + void appendToSequence(TQDomElement sequence, TQDomElement element, int leftIndexSeen); - void appendNextSequence(const QDomDocument& doc, QDomElement element); - QDomElement getLastSequence(const QDomDocument& doc, QDomElement sequence); + void appendNextSequence(const TQDomDocument& doc, TQDomElement element); + TQDomElement getLastSequence(const TQDomDocument& doc, TQDomElement sequence); - QDomElement findIndexNode(const QDomDocument& doc, QDomElement sequence); + TQDomElement findIndexNode(const TQDomDocument& doc, TQDomElement sequence); - ushort nextToken() { return formulaString[pos++].unicode(); } - ushort lookAhead(uint i) const { return formulaString[pos+i].unicode(); } + ushort nextToken() { return formulaString[pos++].tqunicode(); } + ushort lookAhead(uint i) const { return formulaString[pos+i].tqunicode(); } void pushback() { pos--; } bool hasNext() const { return pos < formulaString.length(); } @@ -61,7 +61,7 @@ private: /** * the string we read */ - QString formulaString; + TQString formulaString; /** * current pos diff --git a/lib/kformula/kformulaconfigpage.cc b/lib/kformula/kformulaconfigpage.cc index 8037192f..143ce49d 100644 --- a/lib/kformula/kformulaconfigpage.cc +++ b/lib/kformula/kformulaconfigpage.cc @@ -18,18 +18,18 @@ * Boston, MA 02110-1301, USA. */ -#include <qvariant.h> // first for gcc 2.7.2 -#include <qbuttongroup.h> -#include <qcheckbox.h> -#include <qgroupbox.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qmap.h> -#include <qradiobutton.h> -#include <qspinbox.h> -#include <qstringlist.h> -#include <qvbox.h> -#include <qwidget.h> +#include <tqvariant.h> // first for gcc 2.7.2 +#include <tqbuttongroup.h> +#include <tqcheckbox.h> +#include <tqgroupbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqmap.h> +#include <tqradiobutton.h> +#include <tqspinbox.h> +#include <tqstringlist.h> +#include <tqvbox.h> +#include <tqwidget.h> //#include <algorithm> @@ -53,17 +53,17 @@ KFORMULA_NAMESPACE_BEGIN -ConfigurePage::ConfigurePage( Document* document, QWidget* view, KConfig* config, QVBox* box, char* name ) - : QObject( box->parent(), name ), m_document( document ), m_view( view ), m_config( config ), m_changed( false ) +ConfigurePage::ConfigurePage( Document* document, TQWidget* view, KConfig* config, TQVBox* box, char* name ) + : TQObject( box->tqparent(), name ), m_document( document ), m_view( view ), m_config( config ), m_changed( false ) { const ContextStyle& contextStyle = document->getContextStyle( true ); // fonts - QGroupBox *gbox = new QGroupBox( i18n( "Fonts" ), box ); + TQGroupBox *gbox = new TQGroupBox( i18n( "Fonts" ), box ); gbox->setColumnLayout( 0, Qt::Horizontal ); - QGridLayout* grid = new QGridLayout( gbox->layout(), 5, 3 ); + TQGridLayout* grid = new TQGridLayout( gbox->tqlayout(), 5, 3 ); grid->setSpacing( KDialog::spacingHint() ); grid->setColStretch(1, 1); @@ -75,21 +75,21 @@ ConfigurePage::ConfigurePage( Document* document, QWidget* view, KConfig* config connect( buildFontLine( gbox, grid, 0, defaultFont, i18n( "Default font:" ), defaultFontName ), - SIGNAL( clicked() ), SLOT( selectNewDefaultFont() ) ); + TQT_SIGNAL( clicked() ), TQT_SLOT( selectNewDefaultFont() ) ); connect( buildFontLine( gbox, grid, 1, nameFont, i18n( "Name font:" ), nameFontName ), - SIGNAL( clicked() ), SLOT( selectNewNameFont() ) ); + TQT_SIGNAL( clicked() ), TQT_SLOT( selectNewNameFont() ) ); connect( buildFontLine( gbox, grid, 2, numberFont, i18n( "Number font:" ), numberFontName ), - SIGNAL( clicked() ), SLOT( selectNewNumberFont() ) ); + TQT_SIGNAL( clicked() ), TQT_SLOT( selectNewNumberFont() ) ); connect( buildFontLine( gbox, grid, 3, operatorFont, i18n( "Operator font:" ), operatorFontName ), - SIGNAL( clicked() ), SLOT( selectNewOperatorFont() ) ); + TQT_SIGNAL( clicked() ), TQT_SLOT( selectNewOperatorFont() ) ); - QLabel* sizeTitle = new QLabel( i18n( "Default base size:" ), gbox ); + TQLabel* sizeTitle = new TQLabel( i18n( "Default base size:" ), gbox ); grid->addWidget( sizeTitle, 4, 0 ); sizeSpin = new KIntNumInput( contextStyle.baseSize(), gbox ); @@ -97,21 +97,21 @@ ConfigurePage::ConfigurePage( Document* document, QWidget* view, KConfig* config grid->addMultiCellWidget( sizeSpin, 4, 4, 1, 2 ); - connect( sizeSpin, SIGNAL( valueChanged( int ) ), - SLOT( baseSizeChanged( int ) ) ); + connect( sizeSpin, TQT_SIGNAL( valueChanged( int ) ), + TQT_SLOT( baseSizeChanged( int ) ) ); // syntax highlighting - syntaxHighlighting = new QCheckBox( i18n( "Use syntax highlighting" ),box ); + syntaxHighlighting = new TQCheckBox( i18n( "Use syntax highlighting" ),box ); syntaxHighlighting->setChecked( contextStyle.syntaxHighlighting() ); -// hlBox = new QGroupBox( i18n( "Highlight Colors" ), box ); +// hlBox = new TQGroupBox( i18n( "Highlight Colors" ), box ); // hlBox->setColumnLayout( 0, Qt::Horizontal ); -// grid = new QGridLayout( hlBox->layout(), 5, 2 ); +// grid = new TQGridLayout( hlBox->tqlayout(), 5, 2 ); // grid->setSpacing( KDialog::spacingHint() ); -// QLabel* defaultLabel = new QLabel( hlBox, "defaultLabel" ); +// TQLabel* defaultLabel = new TQLabel( hlBox, "defaultLabel" ); // defaultLabel->setText( i18n( "Default color:" ) ); // grid->addWidget( defaultLabel, 0, 0 ); @@ -120,7 +120,7 @@ ConfigurePage::ConfigurePage( Document* document, QWidget* view, KConfig* config // grid->addWidget( defaultColorBtn, 0, 1 ); -// QLabel* numberLabel = new QLabel( hlBox, "numberLabel" ); +// TQLabel* numberLabel = new TQLabel( hlBox, "numberLabel" ); // numberLabel->setText( i18n( "Number color:" ) ); // grid->addWidget( numberLabel, 1, 0 ); @@ -129,7 +129,7 @@ ConfigurePage::ConfigurePage( Document* document, QWidget* view, KConfig* config // grid->addWidget( numberColorBtn, 1, 1 ); -// QLabel* operatorLabel = new QLabel( hlBox, "operatorLabel" ); +// TQLabel* operatorLabel = new TQLabel( hlBox, "operatorLabel" ); // operatorLabel->setText( i18n( "Operator color:" ) ); // grid->addWidget( operatorLabel, 2, 0 ); @@ -138,7 +138,7 @@ ConfigurePage::ConfigurePage( Document* document, QWidget* view, KConfig* config // grid->addWidget( operatorColorBtn, 2, 1 ); -// QLabel* emptyLabel = new QLabel( hlBox, "emptyLabel" ); +// TQLabel* emptyLabel = new TQLabel( hlBox, "emptyLabel" ); // emptyLabel->setText( i18n( "Empty color:" ) ); // grid->addWidget( emptyLabel, 3, 0 ); @@ -147,7 +147,7 @@ ConfigurePage::ConfigurePage( Document* document, QWidget* view, KConfig* config // grid->addWidget( emptyColorBtn, 3, 1 ); -// QLabel* errorLabel = new QLabel( hlBox, "errorLabel" ); +// TQLabel* errorLabel = new TQLabel( hlBox, "errorLabel" ); // errorLabel->setText( i18n( "Error color:" ) ); // grid->addWidget( errorLabel, 4, 0 ); @@ -155,34 +155,34 @@ ConfigurePage::ConfigurePage( Document* document, QWidget* view, KConfig* config // errorColorBtn->setColor( contextStyle.getErrorColorPlain() ); // grid->addWidget( errorColorBtn, 4, 1 ); - connect( syntaxHighlighting, SIGNAL( clicked() ), - SLOT( syntaxHighlightingClicked() ) ); + connect( syntaxHighlighting, TQT_SIGNAL( clicked() ), + TQT_SLOT( syntaxHighlightingClicked() ) ); syntaxHighlightingClicked(); - connect( syntaxHighlighting, SIGNAL( clicked() ), this, SLOT( slotChanged() ) ); - connect( sizeSpin, SIGNAL( valueChanged( int ) ), this, SLOT( slotChanged() ) ); + connect( syntaxHighlighting, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotChanged() ) ); + connect( sizeSpin, TQT_SIGNAL( valueChanged( int ) ), this, TQT_SLOT( slotChanged() ) ); Q_ASSERT( !m_changed ); } -QPushButton* ConfigurePage::buildFontLine( QWidget* parent, - QGridLayout* layout, int number, QFont font, QString name, - QLabel*& fontName ) +TQPushButton* ConfigurePage::buildFontLine( TQWidget* tqparent, + TQGridLayout* tqlayout, int number, TQFont font, TQString name, + TQLabel*& fontName ) { - QLabel* fontTitle = new QLabel( name, parent ); + TQLabel* fontTitle = new TQLabel( name, tqparent ); - QString labelName = font.family() + ' ' + QString::number( font.pointSize() ); - fontName = new QLabel( labelName, parent ); + TQString labelName = font.family() + ' ' + TQString::number( font.pointSize() ); + fontName = new TQLabel( labelName, tqparent ); fontName->setFont( font ); - fontName->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); + fontName->setFrameStyle(TQFrame::StyledPanel | TQFrame::Sunken); - QPushButton* chooseButton = new QPushButton( i18n( "Choose..." ), parent ); + TQPushButton* chooseButton = new TQPushButton( i18n( "Choose..." ), tqparent ); - layout->addWidget( fontTitle, number, 0 ); - layout->addWidget( fontName, number, 1 ); - layout->addWidget( chooseButton, number, 2 ); + tqlayout->addWidget( fontTitle, number, 0 ); + tqlayout->addWidget( fontName, number, 1 ); + tqlayout->addWidget( chooseButton, number, 2 ); return chooseButton; } @@ -209,11 +209,11 @@ void ConfigurePage::apply() // contextStyle.setErrorColor( errorColorBtn->color() ); m_config->setGroup( "kformula Font" ); - m_config->writeEntry( "defaultFont", defaultFont.toString() ); - m_config->writeEntry( "nameFont", nameFont.toString() ); - m_config->writeEntry( "numberFont", numberFont.toString() ); - m_config->writeEntry( "operatorFont", operatorFont.toString() ); - m_config->writeEntry( "baseSize", QString::number( sizeSpin->value() ) ); + m_config->writeEntry( "defaultFont", TQString(defaultFont.toString()) ); + m_config->writeEntry( "nameFont", TQString(nameFont.toString()) ); + m_config->writeEntry( "numberFont", TQString(numberFont.toString()) ); + m_config->writeEntry( "operatorFont", TQString(operatorFont.toString()) ); + m_config->writeEntry( "baseSize", TQString::number( sizeSpin->value() ) ); // m_config->setGroup( "kformula Color" ); // m_config->writeEntry( "syntaxHighlighting", syntaxHighlighting->isChecked() ); @@ -230,8 +230,8 @@ void ConfigurePage::apply() void ConfigurePage::slotDefault() { - defaultFont = QFont( "Times", 12, QFont::Normal, true ); - nameFont = QFont( "Times" ); + defaultFont = TQFont( "Times", 12, TQFont::Normal, true ); + nameFont = TQFont( "Times" ); numberFont = nameFont; operatorFont = nameFont; @@ -245,11 +245,11 @@ void ConfigurePage::slotDefault() syntaxHighlighting->setChecked( true ); syntaxHighlightingClicked(); -// defaultColorBtn->setColor( Qt::black ); -// numberColorBtn->setColor( Qt::blue ); -// operatorColorBtn->setColor( Qt::darkGreen ); -// emptyColorBtn->setColor( Qt::blue ); -// errorColorBtn->setColor( Qt::darkRed ); +// defaultColorBtn->setColor( TQt::black ); +// numberColorBtn->setColor( TQt::blue ); +// operatorColorBtn->setColor( TQt::darkGreen ); +// emptyColorBtn->setColor( TQt::blue ); +// errorColorBtn->setColor( TQt::darkRed ); slotChanged(); } @@ -283,9 +283,9 @@ void ConfigurePage::selectNewOperatorFont() updateFontLabel( operatorFont, operatorFontName ); } -bool ConfigurePage::selectFont( QFont & font ) +bool ConfigurePage::selectFont( TQFont & font ) { - QStringList list; + TQStringList list; KFontChooser::getFontList( list, KFontChooser::SmoothScalableFonts ); @@ -306,9 +306,9 @@ void ConfigurePage::baseSizeChanged( int /*value*/ ) { } -void ConfigurePage::updateFontLabel( QFont font, QLabel* label ) +void ConfigurePage::updateFontLabel( TQFont font, TQLabel* label ) { - label->setText( font.family() + ' ' + QString::number( font.pointSize() ) ); + label->setText( font.family() + ' ' + TQString::number( font.pointSize() ) ); label->setFont( font ); } @@ -319,19 +319,19 @@ void ConfigurePage::slotChanged() // class UsedFontItem : public KListViewItem { // public: -// UsedFontItem( MathFontsConfigurePage* page, QListView* parent, QString font ) -// : KListViewItem( parent, font ), m_page( page ) {} +// UsedFontItem( MathFontsConfigurePage* page, TQListView* tqparent, TQString font ) +// : KListViewItem( tqparent, font ), m_page( page ) {} -// int compare( QListViewItem* i, int col, bool ascending ) const; +// int compare( TQListViewItem* i, int col, bool ascending ) const; // private: // MathFontsConfigurePage* m_page; // }; -// int UsedFontItem::compare( QListViewItem* i, int, bool ) const +// int UsedFontItem::compare( TQListViewItem* i, int, bool ) const // { -// QValueVector<QString>::iterator lhsIt = m_page->findUsedFont( text( 0 ) ); -// QValueVector<QString>::iterator rhsIt = m_page->findUsedFont( i->text( 0 ) ); +// TQValueVector<TQString>::iterator lhsIt = m_page->findUsedFont( text( 0 ) ); +// TQValueVector<TQString>::iterator rhsIt = m_page->findUsedFont( i->text( 0 ) ); // if ( lhsIt < rhsIt ) { // return -1; // } @@ -341,21 +341,21 @@ void ConfigurePage::slotChanged() // return 0; // } -// MathFontsConfigurePage::MathFontsConfigurePage( Document* document, QWidget* view, -// KConfig* config, QVBox* box, char* name ) -// : QObject( box->parent(), name ), m_document( document ), m_view( view ), m_config( config ) +// MathFontsConfigurePage::MathFontsConfigurePage( Document* document, TQWidget* view, +// KConfig* config, TQVBox* box, char* name ) +// : TQObject( box->tqparent(), name ), m_document( document ), m_view( view ), m_config( config ) // { -// QWidget* fontWidget = new QWidget( box ); -// QGridLayout* fontLayout = new QGridLayout( fontWidget, 1, 1, KDialog::marginHint(), KDialog::spacingHint() ); +// TQWidget* fontWidget = new TQWidget( box ); +// TQGridLayout* fontLayout = new TQGridLayout( fontWidget, 1, 1, KDialog::marginHint(), KDialog::spacingHint() ); -// QHBoxLayout* hLayout = new QHBoxLayout( 0, 0, 6 ); +// TQHBoxLayout* hLayout = new TQHBoxLayout( 0, 0, 6 ); // availableFonts = new KListView( fontWidget ); // availableFonts->addColumn( i18n( "Available Fonts" ) ); // hLayout->addWidget( availableFonts ); -// QVBoxLayout* vLayout = new QVBoxLayout( 0, 0, 6 ); -// QSpacerItem* spacer1 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); +// TQVBoxLayout* vLayout = new TQVBoxLayout( 0, 0, 6 ); +// TQSpacerItem* spacer1 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); // vLayout->addItem( spacer1 ); // addFont = new KPushButton( fontWidget ); @@ -366,12 +366,12 @@ void ConfigurePage::slotChanged() // removeFont->setText( "<-" ); // vLayout->addWidget( removeFont ); -// QSpacerItem* spacer2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); +// TQSpacerItem* spacer2 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); // vLayout->addItem( spacer2 ); // hLayout->addLayout( vLayout ); -// vLayout = new QVBoxLayout( 0, 0, 6 ); +// vLayout = new TQVBoxLayout( 0, 0, 6 ); // moveUp = new KPushButton( fontWidget ); // moveUp->setText( i18n( "Up" ) ); @@ -389,20 +389,20 @@ void ConfigurePage::slotChanged() // fontLayout->addLayout( hLayout, 0, 0 ); -// // connect( availableFonts, SIGNAL( executed( QListViewItem* ) ), -// // this, SLOT( slotAddFont() ) ); -// // connect( requestedFonts, SIGNAL( executed( QListViewItem* ) ), -// // this, SLOT( slotRemoveFont() ) ); -// connect( addFont, SIGNAL( clicked() ), this, SLOT( slotAddFont() ) ); -// connect( removeFont, SIGNAL( clicked() ), this, SLOT( slotRemoveFont() ) ); -// connect( moveUp, SIGNAL( clicked() ), this, SLOT( slotMoveUp() ) ); -// connect( moveDown, SIGNAL( clicked() ), this, SLOT( slotMoveDown() ) ); +// // connect( availableFonts, TQT_SIGNAL( executed( TQListViewItem* ) ), +// // this, TQT_SLOT( slotAddFont() ) ); +// // connect( requestedFonts, TQT_SIGNAL( executed( TQListViewItem* ) ), +// // this, TQT_SLOT( slotRemoveFont() ) ); +// connect( addFont, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotAddFont() ) ); +// connect( removeFont, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotRemoveFont() ) ); +// connect( moveUp, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotMoveUp() ) ); +// connect( moveDown, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotMoveDown() ) ); // const ContextStyle& contextStyle = document->getContextStyle( true ); // const SymbolTable& symbolTable = contextStyle.symbolTable(); -// const QStringList& usedFonts = contextStyle.requestedFonts(); +// const TQStringList& usedFonts = contextStyle.requestedFonts(); -// QMap<QString, QString> fontMap; +// TQMap<TQString, TQString> fontMap; // // symbolTable.findAvailableFonts( &fontMap ); // setupLists( usedFonts ); @@ -410,7 +410,7 @@ void ConfigurePage::slotChanged() // void MathFontsConfigurePage::apply() // { -// QStringList strings; +// TQStringList strings; // std::copy( usedFontList.begin(), usedFontList.end(), std::back_inserter( strings ) ); // m_config->setGroup( "kformula Font" ); @@ -422,7 +422,7 @@ void ConfigurePage::slotChanged() // void MathFontsConfigurePage::slotDefault() // { -// QStringList usedFonts; +// TQStringList usedFonts; // usedFonts.push_back( "esstixone" ); // usedFonts.push_back( "esstixtwo" ); @@ -449,37 +449,37 @@ void ConfigurePage::slotChanged() // setupLists( usedFonts ); // } -// QValueVector<QString>::iterator MathFontsConfigurePage::findUsedFont( QString name ) +// TQValueVector<TQString>::iterator MathFontsConfigurePage::findUsedFont( TQString name ) // { -// return std::find( usedFontList.begin(), usedFontList.end(), name ); +// return std::tqfind( usedFontList.begin(), usedFontList.end(), name ); // } -// void MathFontsConfigurePage::setupLists( const QStringList& usedFonts ) +// void MathFontsConfigurePage::setupLists( const TQStringList& usedFonts ) // { // const ContextStyle& contextStyle = m_document->getContextStyle( true ); // const SymbolTable& symbolTable = contextStyle.symbolTable(); -// QMap<QString, QString> fontMap; +// TQMap<TQString, TQString> fontMap; // // symbolTable.findAvailableFonts( &fontMap ); -// for ( QStringList::const_iterator it = usedFonts.begin(); it != usedFonts.end(); ++it ) { -// QMap<QString, QString>::iterator font = fontMap.find( *it ); +// for ( TQStringList::const_iterator it = usedFonts.begin(); it != usedFonts.end(); ++it ) { +// TQMap<TQString, TQString>::iterator font = fontMap.tqfind( *it ); // if ( font != fontMap.end() ) { // fontMap.erase( font ); // new UsedFontItem( this, requestedFonts, *it ); // usedFontList.push_back( *it ); // } // } -// for ( QMap<QString, QString>::iterator it = fontMap.begin(); it != fontMap.end(); ++it ) { +// for ( TQMap<TQString, TQString>::iterator it = fontMap.begin(); it != fontMap.end(); ++it ) { // new KListViewItem( availableFonts, it.key() ); // } // } // void MathFontsConfigurePage::slotAddFont() // { -// QListViewItem* fontItem = availableFonts->selectedItem(); +// TQListViewItem* fontItem = availableFonts->selectedItem(); // if ( fontItem ) { -// QString fontName = fontItem->text( 0 ); +// TQString fontName = fontItem->text( 0 ); // //availableFonts->takeItem( fontItem ); // delete fontItem; @@ -490,10 +490,10 @@ void ConfigurePage::slotChanged() // void MathFontsConfigurePage::slotRemoveFont() // { -// QListViewItem* fontItem = requestedFonts->selectedItem(); +// TQListViewItem* fontItem = requestedFonts->selectedItem(); // if ( fontItem ) { -// QString fontName = fontItem->text( 0 ); -// QValueVector<QString>::iterator it = std::find( usedFontList.begin(), usedFontList.end(), fontName ); +// TQString fontName = fontItem->text( 0 ); +// TQValueVector<TQString>::iterator it = std::tqfind( usedFontList.begin(), usedFontList.end(), fontName ); // if ( it != usedFontList.end() ) { // usedFontList.erase( it ); // } @@ -505,14 +505,14 @@ void ConfigurePage::slotChanged() // void MathFontsConfigurePage::slotMoveUp() // { -// QListViewItem* fontItem = requestedFonts->selectedItem(); +// TQListViewItem* fontItem = requestedFonts->selectedItem(); // if ( fontItem ) { -// QString fontName = fontItem->text( 0 ); -// QValueVector<QString>::iterator it = std::find( usedFontList.begin(), usedFontList.end(), fontName ); +// TQString fontName = fontItem->text( 0 ); +// TQValueVector<TQString>::iterator it = std::tqfind( usedFontList.begin(), usedFontList.end(), fontName ); // if ( it != usedFontList.end() ) { // uint pos = it - usedFontList.begin(); // if ( pos > 0 ) { -// QValueVector<QString>::iterator before = it-1; +// TQValueVector<TQString>::iterator before = it-1; // std::swap( *it, *before ); // requestedFonts->sort(); // } @@ -522,14 +522,14 @@ void ConfigurePage::slotChanged() // void MathFontsConfigurePage::slotMoveDown() // { -// QListViewItem* fontItem = requestedFonts->selectedItem(); +// TQListViewItem* fontItem = requestedFonts->selectedItem(); // if ( fontItem ) { -// QString fontName = fontItem->text( 0 ); -// QValueVector<QString>::iterator it = std::find( usedFontList.begin(), usedFontList.end(), fontName ); +// TQString fontName = fontItem->text( 0 ); +// TQValueVector<TQString>::iterator it = std::tqfind( usedFontList.begin(), usedFontList.end(), fontName ); // if ( it != usedFontList.end() ) { // uint pos = it - usedFontList.begin(); // if ( pos < usedFontList.size()-1 ) { -// QValueVector<QString>::iterator after = it+1; +// TQValueVector<TQString>::iterator after = it+1; // std::swap( *it, *after ); // requestedFonts->sort(); // } diff --git a/lib/kformula/kformulaconfigpage.h b/lib/kformula/kformulaconfigpage.h index c5bc9b73..e3ff716a 100644 --- a/lib/kformula/kformulaconfigpage.h +++ b/lib/kformula/kformulaconfigpage.h @@ -21,22 +21,22 @@ #ifndef kfconfigpages_h #define kfconfigpages_h -#include <qfont.h> -#include <qvaluevector.h> +#include <tqfont.h> +#include <tqvaluevector.h> #include <kdialogbase.h> #include "kformuladefs.h" -class QButtonGroup; -class QCheckBox; -class QColor; -class QGridLayout; -class QLabel; -class QPushButton; -class QSpinBox; -class QStringList; -class QWidget; +class TQButtonGroup; +class TQCheckBox; +class TQColor; +class TQGridLayout; +class TQLabel; +class TQPushButton; +class TQSpinBox; +class TQStringList; +class TQWidget; class KColorButton; class KConfig; @@ -49,18 +49,19 @@ KFORMULA_NAMESPACE_BEGIN class Document; -class KOFORMULA_EXPORT ConfigurePage : public QObject +class KOFORMULA_EXPORT ConfigurePage : public TQObject { Q_OBJECT + TQ_OBJECT public: - ConfigurePage( Document* document, QWidget* view, KConfig* config, QVBox* box, char* name = 0 ); + ConfigurePage( Document* document, TQWidget* view, KConfig* config, TQVBox* box, char* name = 0 ); void apply(); void slotDefault(); protected: - bool selectFont( QFont & ); + bool selectFont( TQFont & ); protected slots: @@ -75,48 +76,49 @@ protected slots: private: - QPushButton* buildFontLine( QWidget* fontWidget, QGridLayout* layout, int number, - QFont font, QString name, QLabel*& fontName ); + TQPushButton* buildFontLine( TQWidget* fontWidget, TQGridLayout* tqlayout, int number, + TQFont font, TQString name, TQLabel*& fontName ); - void updateFontLabel( QFont font, QLabel* label ); + void updateFontLabel( TQFont font, TQLabel* label ); Document* m_document; - QWidget* m_view; + TQWidget* m_view; KConfig* m_config; - QFont defaultFont; - QFont nameFont; - QFont numberFont; - QFont operatorFont; + TQFont defaultFont; + TQFont nameFont; + TQFont numberFont; + TQFont operatorFont; KIntNumInput* sizeSpin; - QLabel* defaultFontName; - QLabel* nameFontName; - QLabel* numberFontName; - QLabel* operatorFontName; + TQLabel* defaultFontName; + TQLabel* nameFontName; + TQLabel* numberFontName; + TQLabel* operatorFontName; // KColorButton* defaultColorBtn; // KColorButton* numberColorBtn; // KColorButton* operatorColorBtn; // KColorButton* emptyColorBtn; // KColorButton* errorColorBtn; - QCheckBox* syntaxHighlighting; + TQCheckBox* syntaxHighlighting; bool m_changed; }; -// class MathFontsConfigurePage : public QObject +// class MathFontsConfigurePage : public TQObject // { // Q_OBJECT +// TQ_OBJECT // public: -// MathFontsConfigurePage( Document* document, QWidget* view, KConfig* config, QVBox* box, char* name = 0 ); +// MathFontsConfigurePage( Document* document, TQWidget* view, KConfig* config, TQVBox* box, char* name = 0 ); // void apply(); // void slotDefault(); -// QValueVector<QString>::iterator findUsedFont( QString name ); +// TQValueVector<TQString>::iterator findUsedFont( TQString name ); // protected slots: @@ -127,10 +129,10 @@ private: // private: -// void setupLists( const QStringList& usedFonts ); +// void setupLists( const TQStringList& usedFonts ); // Document* m_document; -// QWidget* m_view; +// TQWidget* m_view; // KConfig* m_config; // KListView* availableFonts; @@ -141,7 +143,7 @@ private: // KPushButton* moveUp; // KPushButton* moveDown; -// QValueVector<QString> usedFontList; +// TQValueVector<TQString> usedFontList; // }; diff --git a/lib/kformula/kformulacontainer.cc b/lib/kformula/kformulacontainer.cc index 84471e1b..a141aa50 100644 --- a/lib/kformula/kformulacontainer.cc +++ b/lib/kformula/kformulacontainer.cc @@ -18,14 +18,14 @@ * Boston, MA 02110-1301, USA. */ -#include <qapplication.h> -#include <qdom.h> -#include <qevent.h> -#include <qfile.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qstring.h> -#include <qtextstream.h> +#include <tqapplication.h> +#include <tqdom.h> +#include <tqevent.h> +#include <tqfile.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqstring.h> +#include <tqtextstream.h> #include <kdebug.h> #include <klocale.h> @@ -194,7 +194,7 @@ void Container::moveOutBelow( FormulaCursor* cursor ) emit leaveFormula( this, cursor, EXIT_BELOW ); } -void Container::tell( const QString& msg ) +void Container::tell( const TQString& msg ) { emit statusMsg( msg ); } @@ -273,10 +273,10 @@ void Container::recalc() ContextStyle& context = impl->document->getContextStyle(); rootElement()->calcSizes( context ); - emit formulaChanged( context.layoutUnitToPixelX( rootElement()->getWidth() ), - context.layoutUnitToPixelY( rootElement()->getHeight() ) ); - emit formulaChanged( context.layoutUnitPtToPt( context.pixelXToPt( rootElement()->getWidth() ) ), - context.layoutUnitPtToPt( context.pixelYToPt( rootElement()->getHeight() ) ) ); + emit formulaChanged( context.tqlayoutUnitToPixelX( rootElement()->getWidth() ), + context.tqlayoutUnitToPixelY( rootElement()->getHeight() ) ); + emit formulaChanged( context.tqlayoutUnitPtToPt( context.pixelXToPt( rootElement()->getWidth() ) ), + context.tqlayoutUnitPtToPt( context.pixelYToPt( rootElement()->getHeight() ) ) ); emit cursorMoved( activeCursor() ); } @@ -292,16 +292,16 @@ const SymbolTable& Container::getSymbolTable() const } -void Container::draw( QPainter& painter, const QRect& r, const QColorGroup& cg, bool edit ) +void Container::draw( TQPainter& painter, const TQRect& r, const TQColorGroup& cg, bool edit ) { painter.fillRect( r, cg.base() ); draw( painter, r, edit ); } -void Container::draw( QPainter& painter, const QRect& r, bool edit ) +void Container::draw( TQPainter& painter, const TQRect& r, bool edit ) { - //ContextStyle& context = document()->getContextStyle( painter.device()->devType() == QInternal::Printer ); + //ContextStyle& context = document()->getContextStyle( painter.device()->devType() == TQInternal::Printer ); ContextStyle& context = document()->getContextStyle( edit ); rootElement()->draw( painter, context.pixelToLayoutUnit( r ), context ); } @@ -315,7 +315,7 @@ void Container::checkCursor() } } -void Container::input( QKeyEvent* event ) +void Container::input( TQKeyEvent* event ) { //if ( !hasValidCursor() ) if ( impl->activeCursor == 0 ) { @@ -339,20 +339,20 @@ void Container::paste() { if (!hasValidCursor()) return; - QClipboard* clipboard = QApplication::clipboard(); - const QMimeSource* source = clipboard->data(); + TQClipboard* clipboard = TQApplication::tqclipboard(); + const TQMimeSource* source = clipboard->data(); if (source->provides( MimeSource::selectionMimeType() )) { - QByteArray data = source->encodedData( MimeSource::selectionMimeType() ); - QDomDocument formula; + TQByteArray data = source->tqencodedData( MimeSource::selectionMimeType() ); + TQDomDocument formula; formula.setContent(data); paste( formula, i18n("Paste") ); } } -void Container::paste( const QDomDocument& document, QString desc ) +void Container::paste( const TQDomDocument& document, TQString desc ) { FormulaCursor* cursor = activeCursor(); - QPtrList<BasicElement> list; + TQPtrList<BasicElement> list; list.setAutoDelete( true ); if ( cursor->buildElementsFromMathMLDom( document.documentElement(), list ) ) { uint count = list.count(); @@ -372,9 +372,9 @@ void Container::copy() // read-only cursors are fine for copying. FormulaCursor* cursor = activeCursor(); if (cursor != 0) { - QDomDocument formula = document()->createMathMLDomDocument(); + TQDomDocument formula = document()->createMathMLDomDocument(); cursor->copy( formula ); - QClipboard* clipboard = QApplication::clipboard(); + TQClipboard* clipboard = TQApplication::tqclipboard(); clipboard->setData(new MimeSource(document(), formula)); } } @@ -392,7 +392,7 @@ void Container::cut() } -void Container::emitErrorMsg( const QString& msg ) +void Container::emitErrorMsg( const TQString& msg ) { emit errorMsg( msg ); } @@ -405,28 +405,28 @@ void Container::execute(KCommand* command) } -QRect Container::boundingRect() const +TQRect Container::boundingRect() const { const ContextStyle& context = document()->getContextStyle(); - return QRect( context.layoutUnitToPixelX( rootElement()->getX() ), - context.layoutUnitToPixelY( rootElement()->getY() ), - context.layoutUnitToPixelX( rootElement()->getWidth() ), - context.layoutUnitToPixelY( rootElement()->getHeight() ) ); + return TQRect( context.tqlayoutUnitToPixelX( rootElement()->getX() ), + context.tqlayoutUnitToPixelY( rootElement()->getY() ), + context.tqlayoutUnitToPixelX( rootElement()->getWidth() ), + context.tqlayoutUnitToPixelY( rootElement()->getHeight() ) ); } -QRect Container::coveredRect() +TQRect Container::coveredRect() { if ( impl->activeCursor != 0 ) { const ContextStyle& context = document()->getContextStyle(); const LuPixelRect& cursorRect = impl->activeCursor->getCursorSize(); - return QRect( context.layoutUnitToPixelX( rootElement()->getX() ), - context.layoutUnitToPixelY( rootElement()->getY() ), - context.layoutUnitToPixelX( rootElement()->getWidth() ), - context.layoutUnitToPixelY( rootElement()->getHeight() ) ) | - QRect( context.layoutUnitToPixelX( cursorRect.x() ), - context.layoutUnitToPixelY( cursorRect.y() ), - context.layoutUnitToPixelX( cursorRect.width() ), - context.layoutUnitToPixelY( cursorRect.height() ) ); + return TQRect( context.tqlayoutUnitToPixelX( rootElement()->getX() ), + context.tqlayoutUnitToPixelY( rootElement()->getY() ), + context.tqlayoutUnitToPixelX( rootElement()->getWidth() ), + context.tqlayoutUnitToPixelY( rootElement()->getHeight() ) ) | + TQRect( context.tqlayoutUnitToPixelX( cursorRect.x() ), + context.tqlayoutUnitToPixelY( cursorRect.y() ), + context.tqlayoutUnitToPixelX( cursorRect.width() ), + context.tqlayoutUnitToPixelY( cursorRect.height() ) ); } return boundingRect(); } @@ -434,20 +434,20 @@ QRect Container::coveredRect() double Container::width() const { const ContextStyle& context = document()->getContextStyle(); - return context.layoutUnitPtToPt( context.pixelXToPt( rootElement()->getWidth() ) ); + return context.tqlayoutUnitPtToPt( context.pixelXToPt( rootElement()->getWidth() ) ); } double Container::height() const { const ContextStyle& context = document()->getContextStyle(); - return context.layoutUnitPtToPt( context.pixelYToPt( rootElement()->getHeight() ) ); + return context.tqlayoutUnitPtToPt( context.pixelYToPt( rootElement()->getHeight() ) ); } double Container::baseline() const { const ContextStyle& context = document()->getContextStyle(); - //return context.layoutUnitToPixelY( rootElement()->getBaseline() ); - return context.layoutUnitPtToPt( context.pixelYToPt( rootElement()->getBaseline() ) ); + //return context.tqlayoutUnitToPixelY( rootElement()->getBaseline() ); + return context.tqlayoutUnitPtToPt( context.pixelYToPt( rootElement()->getBaseline() ) ); } void Container::moveTo( int x, int y ) @@ -464,7 +464,7 @@ int Container::fontSize() const } else { const ContextStyle& context = document()->getContextStyle(); - return qRound( context.baseSize() ); + return tqRound( context.baseSize() ); } } @@ -490,9 +490,9 @@ void Container::updateMatrixActions() document()->wrapper()->enableMatrixActions( false ); } -void Container::save( QDomElement &root ) +void Container::save( TQDomElement &root ) { - QDomDocument ownerDoc = root.ownerDocument(); + TQDomDocument ownerDoc = root.ownerDocument(); root.appendChild(rootElement()->getElementDom(ownerDoc)); } @@ -500,7 +500,7 @@ void Container::save( QDomElement &root ) /** * Loads a formula from the document. */ -bool Container::load( const QDomElement &fe ) +bool Container::load( const TQDomElement &fe ) { if (!fe.isNull()) { FormulaElement* root = createMainSequence(); @@ -524,9 +524,9 @@ bool Container::load( const QDomElement &fe ) } -void Container::saveMathML( QTextStream& stream, bool oasisFormat ) +void Container::saveMathML( TQTextStream& stream, bool oasisFormat ) { - QDomDocument doc; + TQDomDocument doc; if ( !oasisFormat ) { doc = document()->createMathMLDomDocument(); } @@ -534,13 +534,13 @@ void Container::saveMathML( QTextStream& stream, bool oasisFormat ) stream << doc; } -bool Container::loadMathML( const QDomDocument &doc, bool oasisFormat ) +bool Container::loadMathML( const TQDomDocument &doc, bool oasisFormat ) { return loadMathML( doc.documentElement(), oasisFormat ); } /* -bool Container::loadMathML( const QDomElement &element, bool oasisFormat ) +bool Container::loadMathML( const TQDomElement &element, bool oasisFormat ) { const ContextStyle& context = document()->getContextStyle(); MathML2KFormula filter( element, context, oasisFormat ); @@ -557,7 +557,7 @@ bool Container::loadMathML( const QDomElement &element, bool oasisFormat ) } */ -bool Container::loadMathML( const QDomElement &fe, bool /*oasisFormat*/ ) +bool Container::loadMathML( const TQDomElement &fe, bool /*oasisFormat*/ ) { kdDebug( DEBUGID ) << "loadMathML" << endl; if (!fe.isNull()) { @@ -585,7 +585,7 @@ bool Container::loadMathML( const QDomElement &fe, bool /*oasisFormat*/ ) void Container::print(KPrinter& printer) { //printer.setFullPage(true); - QPainter painter; + TQPainter painter; if (painter.begin(&printer)) { rootElement()->draw( painter, LuPixelRect( rootElement()->getX(), rootElement()->getY(), @@ -595,31 +595,31 @@ void Container::print(KPrinter& printer) } } -QImage Container::drawImage( int width, int height ) +TQImage Container::drawImage( int width, int height ) { ContextStyle& context = document()->getContextStyle( false ); - QRect rect(impl->rootElement->getX(), impl->rootElement->getY(), + TQRect rect(impl->rootElement->getX(), impl->rootElement->getY(), impl->rootElement->getWidth(), impl->rootElement->getHeight()); - int realWidth = context.layoutUnitToPixelX( impl->rootElement->getWidth() ); - int realHeight = context.layoutUnitToPixelY( impl->rootElement->getHeight() ); + int realWidth = context.tqlayoutUnitToPixelX( impl->rootElement->getWidth() ); + int realHeight = context.tqlayoutUnitToPixelY( impl->rootElement->getHeight() ); - double f = QMAX( static_cast<double>( width )/static_cast<double>( realWidth ), + double f = TQMAX( static_cast<double>( width )/static_cast<double>( realWidth ), static_cast<double>( height )/static_cast<double>( realHeight ) ); int oldZoom = context.zoom(); - context.setZoomAndResolution( qRound( oldZoom*f ), KoGlobal::dpiX(), KoGlobal::dpiY() ); + context.setZoomAndResolution( tqRound( oldZoom*f ), KoGlobal::dpiX(), KoGlobal::dpiY() ); kdDebug( DEBUGID ) << "Container::drawImage " << "(" << width << " " << height << ")" - << "(" << context.layoutUnitToPixelX( impl->rootElement->getWidth() ) - << " " << context.layoutUnitToPixelY( impl->rootElement->getHeight() ) << ")" + << "(" << context.tqlayoutUnitToPixelX( impl->rootElement->getWidth() ) + << " " << context.tqlayoutUnitToPixelY( impl->rootElement->getHeight() ) << ")" << endl; - QPixmap pm( context.layoutUnitToPixelX( impl->rootElement->getWidth() ), - context.layoutUnitToPixelY( impl->rootElement->getHeight() ) ); + TQPixmap pm( context.tqlayoutUnitToPixelX( impl->rootElement->getWidth() ), + context.tqlayoutUnitToPixelY( impl->rootElement->getHeight() ) ); pm.fill(); - QPainter paint(&pm); + TQPainter paint(&pm); impl->rootElement->draw(paint, rect, context); paint.end(); context.setZoomAndResolution( oldZoom, KoGlobal::dpiX(), KoGlobal::dpiY() ); @@ -627,12 +627,12 @@ QImage Container::drawImage( int width, int height ) return pm.convertToImage(); } -QString Container::texString() +TQString Container::texString() { return rootElement()->toLatex(); } -QString Container::formulaString() +TQString Container::formulaString() { return rootElement()->formulaString(); } diff --git a/lib/kformula/kformulacontainer.h b/lib/kformula/kformulacontainer.h index 4d4254ab..d87e8184 100644 --- a/lib/kformula/kformulacontainer.h +++ b/lib/kformula/kformulacontainer.h @@ -21,22 +21,22 @@ #ifndef KFORMULACONTAINER_H #define KFORMULACONTAINER_H -#include <qclipboard.h> -#include <qdom.h> -#include <qimage.h> -#include <qptrlist.h> -#include <qobject.h> -#include <qptrstack.h> -#include <qstring.h> +#include <tqclipboard.h> +#include <tqdom.h> +#include <tqimage.h> +#include <tqptrlist.h> +#include <tqobject.h> +#include <tqptrstack.h> +#include <tqstring.h> #include <kcommand.h> //#include <KoCommandHistory.h> #include "KoCommandHistory.h" #include "kformuladefs.h" -class QColorGroup; -class QKeyEvent; -class QPainter; +class TQColorGroup; +class TQKeyEvent; +class TQPainter; class KCommand; class KPrinter; @@ -75,7 +75,7 @@ public: virtual void moveOutRight( FormulaCursor* ) {} virtual void moveOutAbove( FormulaCursor* ) {} virtual void moveOutBelow( FormulaCursor* ) {} - virtual void tell( const QString& /*msg*/ ) {} + virtual void tell( const TQString& /*msg*/ ) {} virtual void insertFormula( FormulaCursor* ) {} virtual void removeFormula( FormulaCursor* ) {} virtual void baseSizeChanged( int, bool ) {} @@ -87,9 +87,10 @@ public: * The document. Actually only one part of the whole. * Provides everything to edit the formula. */ -class KOFORMULA_EXPORT Container : public QObject, public FormulaDocument { +class KOFORMULA_EXPORT Container : public TQObject, public FormulaDocument { friend class MimeSource; Q_OBJECT + TQ_OBJECT // no copying Container( const Container& ); @@ -153,7 +154,7 @@ public: void moveOutRight( FormulaCursor* ); void moveOutAbove( FormulaCursor* ); void moveOutBelow( FormulaCursor* ); - void tell( const QString& msg ); + void tell( const TQString& msg ); void removeFormula( FormulaCursor* ); /** @@ -170,47 +171,47 @@ public: /** * Draws the whole thing. */ - void draw( QPainter& painter, const QRect& r, - const QColorGroup& cg, bool edit=false ); + void draw( TQPainter& painter, const TQRect& r, + const TQColorGroup& cg, bool edit=false ); /** * Draws the whole thing. */ - void draw( QPainter& painter, const QRect& r, bool edit=false ); + void draw( TQPainter& painter, const TQRect& r, bool edit=false ); /** * Saves the data into the document. */ - void save( QDomElement &root ); + void save( TQDomElement &root ); /** * Save formula as MathML. */ - void saveMathML( QTextStream& stream, bool oasisFormat = false ); + void saveMathML( TQTextStream& stream, bool oasisFormat = false ); /** * Load function. * Load the formula from the specified file containing MathML . */ - bool loadMathML( const QDomDocument &doc, bool oasisFormat = false ); + bool loadMathML( const TQDomDocument &doc, bool oasisFormat = false ); /** * Load function. * Load the formula from the specified file containing MathML . */ - bool loadMathML( const QDomElement &doc, bool oasisFormat = false ); + bool loadMathML( const TQDomElement &doc, bool oasisFormat = false ); /** * Loads a formula from the document. */ - bool load( const QDomElement &fe ); + bool load( const TQDomElement &fe ); /** * @returns Tex string for the formula */ - QString texString(); + TQString texString(); - QString formulaString(); + TQString formulaString(); /** * Prints the formula. @@ -220,7 +221,7 @@ public: /** * @returns an image that looks like out formula. */ - QImage drawImage( int width, int height ); + TQImage drawImage( int width, int height ); /** * @returns the cursor to be used for editing. @@ -239,12 +240,12 @@ public: /** * @returns the formula's size. */ - QRect boundingRect() const; + TQRect boundingRect() const; /** * @returns the formula's size including its active cursor. */ - QRect coveredRect(); + TQRect coveredRect(); double width() const; double height() const; @@ -338,15 +339,15 @@ signals: /** * A message that might be a useful hint. Meant for the statusbar. */ - void statusMsg( const QString& msg ); + void statusMsg( const TQString& msg ); /** * A message that describes an error. Meant for a message box. (?) */ - void errorMsg( const QString& ); + void errorMsg( const TQString& ); /** - * The element is going to leave the formula with and all its children. + * The element is going to leave the formula with and all its tqchildren. */ void elementWillVanish(BasicElement* element); @@ -365,7 +366,7 @@ public: /** * General input. */ - void input( QKeyEvent* event ); + void input( TQKeyEvent* event ); void performRequest( Request* request ); @@ -379,7 +380,7 @@ public: /** * Insert data from the document. */ - void paste( const QDomDocument& document, QString desc ); + void paste( const TQDomDocument& document, TQString desc ); /** * Copy the current selection to the clipboard. @@ -405,7 +406,7 @@ protected: */ virtual FormulaElement* createMainSequence(); - void emitErrorMsg( const QString& ); + void emitErrorMsg( const TQString& ); private: diff --git a/lib/kformula/kformuladefs.h b/lib/kformula/kformuladefs.h index d42d0b16..2e9d8a8b 100644 --- a/lib/kformula/kformuladefs.h +++ b/lib/kformula/kformuladefs.h @@ -23,9 +23,9 @@ #include <memory> -#include <qpoint.h> -#include <qrect.h> -#include <qstring.h> +#include <tqpoint.h> +#include <tqrect.h> +#include <tqstring.h> #include <KoPoint.h> #include <KoRect.h> @@ -54,23 +54,23 @@ typedef KoRect PtRect; * Pixels. At any zoom level. */ typedef int pixel; -typedef QPoint PixelPoint; -typedef QRect PixelRect; -//typedef QSize PixelSize; +typedef TQPoint PixelPoint; +typedef TQRect PixelRect; +//typedef TQSize PixelSize; /** * Layout Unit. That's the values we store to get * wysiwyg right. */ typedef int luPt; -typedef QPoint LuPtPoint; -typedef QRect LuPtRect; -typedef QSize LuPtSize; +typedef TQPoint LuPtPoint; +typedef TQRect LuPtRect; +typedef TQSize LuPtSize; typedef int luPixel; -typedef QPoint LuPixelPoint; -typedef QRect LuPixelRect; -typedef QSize LuPixelSize; +typedef TQPoint LuPixelPoint; +typedef TQRect LuPixelRect; +typedef TQSize LuPixelSize; /** @@ -106,9 +106,9 @@ enum MoveFlag { NormalMovement = 0, SelectMovement = 1, WordMovement = 2 }; inline MoveFlag movementFlag( int state ) { int flag = NormalMovement; - if ( state & Qt::ControlButton ) + if ( state & TQt::ControlButton ) flag |= WordMovement; - if ( state & Qt::ShiftButton ) + if ( state & TQt::ShiftButton ) flag |= SelectMovement; return static_cast<MoveFlag>( flag ); } @@ -163,8 +163,8 @@ enum TokenElementType { * The struct used to store static font data. */ struct InternFontTable { - short unicode; - QChar pos; + short tqunicode; + TQChar pos; CharClass cl; CharStyle style; }; @@ -180,7 +180,7 @@ enum Direction { beforeCursor, afterCursor }; /** * The types of space we know. */ -enum SpaceWidth { THIN, MEDIUM, THICK, QUAD, NEGTHIN }; +enum SpaceWidth { THIN, MEDIUM, THICK, TQUAD, NEGTHIN }; /** * The types of MathML horizontal or vertical sizes we know @@ -235,7 +235,7 @@ enum IndexPosition { lowerMiddlePos, upperRightPos, lowerRightPos, - parentPos + tqparentPos }; @@ -364,33 +364,33 @@ public: }; class TextCharRequest : public Request { - QChar m_ch; + TQChar m_ch; bool m_isSymbol; public: - TextCharRequest( QChar ch, bool isSymbol=false ) : Request( req_addTextChar ), m_ch( ch ), m_isSymbol( isSymbol ) {} - QChar ch() const { return m_ch; } + TextCharRequest( TQChar ch, bool isSymbol=false ) : Request( req_addTextChar ), m_ch( ch ), m_isSymbol( isSymbol ) {} + TQChar ch() const { return m_ch; } bool isSymbol() const { return m_isSymbol; } }; class OperatorRequest: public Request { - QChar m_ch; + TQChar m_ch; public: - OperatorRequest( QChar ch ) : Request( req_addOperator ), m_ch( ch ) {} - QChar ch() const { return m_ch; } + OperatorRequest( TQChar ch ) : Request( req_addOperator ), m_ch( ch ) {} + TQChar ch() const { return m_ch; } }; class NumberRequest: public Request { - QChar m_ch; + TQChar m_ch; public: - NumberRequest( QChar ch ) : Request( req_addNumber ), m_ch( ch ) {} - QChar ch() const { return m_ch; } + NumberRequest( TQChar ch ) : Request( req_addNumber ), m_ch( ch ) {} + TQChar ch() const { return m_ch; } }; class TextRequest : public Request { - QString m_text; + TQString m_text; public: - TextRequest( QString text ) : Request( req_addText ), m_text( text ) {} - QString text() const { return m_text; } + TextRequest( TQString text ) : Request( req_addText ), m_text( text ) {} + TQString text() const { return m_text; } }; class MatrixRequest : public Request { diff --git a/lib/kformula/kformuladocument.cc b/lib/kformula/kformuladocument.cc index 57b5bc04..3a19ac70 100644 --- a/lib/kformula/kformuladocument.cc +++ b/lib/kformula/kformuladocument.cc @@ -18,8 +18,8 @@ * Boston, MA 02110-1301, USA. */ -#include <qptrlist.h> -#include <qstringlist.h> +#include <tqptrlist.h> +#include <tqstringlist.h> #include <kdebug.h> #include <kglobal.h> @@ -45,7 +45,7 @@ static const int CURRENT_SYNTAX_VERSION = 1; // Make sure an appropriate DTD is available in www/koffice/DTD if changing this value static const char * CURRENT_DTD_VERSION = "1.3"; -int FormulaList::compareItems( QPtrCollection::Item a, QPtrCollection::Item b ) +int FormulaList::compareItems( TQPtrCollection::Item a, TQPtrCollection::Item b ) { double ya = static_cast<Container*>( a )->getDocumentY(); double yb = static_cast<Container*>( b )->getDocumentY(); @@ -61,9 +61,9 @@ int FormulaList::compareItems( QPtrCollection::Item a, QPtrCollection::Item b ) } -Document::Document( QObject *parent, const char *name, - const QStringList &/*args*/ ) - : QObject( parent, name ), m_wrapper( 0 ), m_formula( 0 ), creationStrategy( 0 ) +Document::Document( TQObject *tqparent, const char *name, + const TQStringList &/*args*/ ) + : TQObject( tqparent, name ), m_wrapper( 0 ), m_formula( 0 ), creationStrategy( 0 ) { m_contextStyle = new ContextStyle; setCreationStrategy( "Oasis" ); @@ -98,15 +98,15 @@ Container* Document::createFormula( int pos, bool registerMe ) } -QPtrListIterator<Container> Document::formulas() +TQPtrListIterator<Container> Document::formulas() { - return QPtrListIterator<Container>( formulae ); + return TQPtrListIterator<Container>( formulae ); } int Document::formulaPos( Container* formula ) { - return formulae.find( formula ); + return formulae.tqfind( formula ); } @@ -122,12 +122,12 @@ int Document::formulaCount() } -bool Document::loadXML( const QDomDocument& doc ) +bool Document::loadXML( const TQDomDocument& doc ) { setCreationStrategy( "Ordinary" ); //clear(); - QDomElement root = doc.documentElement(); + TQDomElement root = doc.documentElement(); // backward compatibility if ( root.tagName() == "FORMULA" ) { @@ -135,9 +135,9 @@ bool Document::loadXML( const QDomDocument& doc ) return formula->load( root ); } - QDomNode node = root.firstChild(); + TQDomNode node = root.firstChild(); if ( node.isElement() ) { - QDomElement element = node.toElement(); + TQDomElement element = node.toElement(); if ( element.tagName() == "FORMULASETTINGS" ) { if ( !loadDocumentPart( element ) ) { return false; @@ -148,7 +148,7 @@ bool Document::loadXML( const QDomDocument& doc ) uint number = 0; while ( !node.isNull() ) { if ( node.isElement() ) { - QDomElement element = node.toElement(); + TQDomElement element = node.toElement(); Container* formula = newFormula( number ); if ( !formula->load( element ) ) { return false; @@ -160,7 +160,7 @@ bool Document::loadXML( const QDomDocument& doc ) return formulae.count() > 0; } -bool Document::loadOasis( const QDomDocument& doc ) +bool Document::loadOasis( const TQDomDocument& doc ) { // ### TODO: not finished! setCreationStrategy( "Oasis" ); @@ -168,15 +168,15 @@ bool Document::loadOasis( const QDomDocument& doc ) return formula->loadMathML( doc, true ); } -bool Document::loadDocumentPart( QDomElement /*node*/ ) +bool Document::loadDocumentPart( TQDomElement /*node*/ ) { return true; } -QDomDocument Document::saveXML() +TQDomDocument Document::saveXML() { - QDomDocument doc = createDomDocument(); - QDomElement root = doc.documentElement(); + TQDomDocument doc = createDomDocument(); + TQDomElement root = doc.documentElement(); root.appendChild( saveDocumentPart( doc ) ); uint count = formulae.count(); for ( uint i=0; i<count; ++i ) { @@ -186,30 +186,30 @@ QDomDocument Document::saveXML() } -QDomElement Document::saveDocumentPart( QDomDocument& doc ) +TQDomElement Document::saveDocumentPart( TQDomDocument& doc ) { - QDomElement settings = doc.createElement( "FORMULASETTINGS" ); + TQDomElement settings = doc.createElement( "FORMULASETTINGS" ); return settings; } -QDomDocument Document::createDomDocument() +TQDomDocument Document::createDomDocument() { return KoDocument::createDomDocument( "kformula", "KFORMULA", CURRENT_DTD_VERSION ); } /** - * Create a MathML Dom Document, deprecates KFO Dom Document for internal layout + * Create a MathML Dom Document, deprecates KFO Dom Document for internal tqlayout * TODO: Shouldn't this go to KoDocument ? */ -QDomDocument Document::createMathMLDomDocument() +TQDomDocument Document::createMathMLDomDocument() { - QDomDocumentType dt = - QDomImplementation().createDocumentType( "math", + TQDomDocumentType dt = + TQDomImplementation().createDocumentType( "math", "-//W3C//DTD MathML 2.0//EN", "http://www.w3.org/TR/MathML2/dtd/mathml2.dtd"); - QDomDocument doc( dt ); + TQDomDocument doc( dt ); doc.insertBefore( doc.createProcessingInstruction( "xml", "version=\"1.0\" encoding=\"UTF-8\"" ), doc.documentElement() ); @@ -222,7 +222,7 @@ QDomDocument Document::createMathMLDomDocument() * * @param strategy -- "Ordinary" for old Kformula, "Oasis" for MathML/ODF */ -void Document::setCreationStrategy( QString strategy ) +void Document::setCreationStrategy( TQString strategy ) { if ( !creationStrategy || creationStrategy->type() != strategy ) { delete creationStrategy; @@ -442,225 +442,225 @@ void DocumentWrapper::createActions( KActionCollection* collection ) m_addNegThinSpaceAction = new KAction( i18n( "Add Negative Thin Space" ), 0, - this, SLOT( addNegThinSpace() ), + this, TQT_SLOT( addNegThinSpace() ), collection, "formula_addnegthinspace") ; m_addThinSpaceAction = new KAction( i18n( "Add Thin Space" ), 0, - this, SLOT( addThinSpace() ), + this, TQT_SLOT( addThinSpace() ), collection, "formula_addthinspace") ; m_addMediumSpaceAction = new KAction( i18n( "Add Medium Space" ), 0, - this, SLOT( addMediumSpace() ), + this, TQT_SLOT( addMediumSpace() ), collection, "formula_addmediumspace" ); m_addThickSpaceAction = new KAction( i18n( "Add Thick Space" ), 0, - this, SLOT( addThickSpace() ), + this, TQT_SLOT( addThickSpace() ), collection, "formula_addthickspace" ); m_addQuadSpaceAction = new KAction( i18n( "Add Quad Space" ), 0, - this, SLOT( addQuadSpace() ), + this, TQT_SLOT( addQuadSpace() ), collection, "formula_addquadspace" ); m_addIntegralAction = new KAction(i18n("Add Integral"), "int", 0, - this, SLOT(addIntegral()), + this, TQT_SLOT(addIntegral()), collection, "formula_addintegral"); m_addSumAction = new KAction(i18n("Add Sum"), "sum", 0, - this, SLOT(addSum()), + this, TQT_SLOT(addSum()), collection, "formula_addsum"); m_addProductAction = new KAction(i18n("Add Product"), "prod", 0, - this, SLOT(addProduct()), + this, TQT_SLOT(addProduct()), collection, "formula_addproduct"); m_addRootAction = new KAction(i18n("Add Root"), "sqrt", 0, - this, SLOT(addRoot()), + this, TQT_SLOT(addRoot()), collection, "formula_addroot"); m_addFractionAction = new KAction(i18n("Add Fraction"), "frac", 0, - this, SLOT(addFraction()), + this, TQT_SLOT(addFraction()), collection, "formula_addfrac"); m_addBracketAction = new KAction(i18n("Add Bracket"), "paren", 0, - this, SLOT(addDefaultBracket()), + this, TQT_SLOT(addDefaultBracket()), collection,"formula_addbra"); m_addSBracketAction = new KAction(i18n("Add Square Bracket"), "brackets", 0, - this, SLOT(addSquareBracket()), + this, TQT_SLOT(addSquareBracket()), collection,"formula_addsqrbra"); m_addCBracketAction = new KAction(i18n("Add Curly Bracket"), "math_brace", 0, - this, SLOT(addCurlyBracket()), + this, TQT_SLOT(addCurlyBracket()), collection,"formula_addcurbra"); m_addAbsAction = new KAction(i18n("Add Abs"), "abs", 0, - this, SLOT(addLineBracket()), + this, TQT_SLOT(addLineBracket()), collection,"formula_addabsbra"); m_addMatrixAction = new KAction(i18n("Add Matrix..."), "matrix", 0, - this, SLOT(addMatrix()), + this, TQT_SLOT(addMatrix()), collection, "formula_addmatrix"); m_addOneByTwoMatrixAction = new KAction(i18n("Add 1x2 Matrix"), "onetwomatrix", 0, - this, SLOT(addOneByTwoMatrix()), + this, TQT_SLOT(addOneByTwoMatrix()), collection, "formula_add_one_by_two_matrix"); m_addUpperLeftAction = new KAction(i18n("Add Upper Left Index"), "lsup", 0, - this, SLOT(addUpperLeftIndex()), + this, TQT_SLOT(addUpperLeftIndex()), collection, "formula_addupperleft"); m_addLowerLeftAction = new KAction(i18n("Add Lower Left Index"), "lsub", 0, - this, SLOT(addLowerLeftIndex()), + this, TQT_SLOT(addLowerLeftIndex()), collection, "formula_addlowerleft"); m_addUpperRightAction = new KAction(i18n("Add Upper Right Index"), "rsup", 0, - this, SLOT(addUpperRightIndex()), + this, TQT_SLOT(addUpperRightIndex()), collection, "formula_addupperright"); m_addLowerRightAction = new KAction(i18n("Add Lower Right Index"), "rsub", 0, - this, SLOT(addLowerRightIndex()), + this, TQT_SLOT(addLowerRightIndex()), collection, "formula_addlowerright"); m_addGenericUpperAction = new KAction(i18n("Add Upper Index"), "gsup", /*CTRL + Key_U*/0, - this, SLOT(addGenericUpperIndex()), + this, TQT_SLOT(addGenericUpperIndex()), collection, "formula_addupperindex"); m_addGenericLowerAction = new KAction(i18n("Add Lower Index"), "gsub", 0, - this, SLOT(addGenericLowerIndex()), + this, TQT_SLOT(addGenericLowerIndex()), collection, "formula_addlowerindex"); m_addOverlineAction = new KAction(i18n("Add Overline"), "over", 0, - this, SLOT(addOverline()), + this, TQT_SLOT(addOverline()), collection, "formula_addoverline"); m_addUnderlineAction = new KAction(i18n("Add Underline"), "under", 0, - this, SLOT(addUnderline()), + this, TQT_SLOT(addUnderline()), collection, "formula_addunderline"); m_addMultilineAction = new KAction(i18n("Add Multiline"), "multiline", 0, - this, SLOT(addMultiline()), + this, TQT_SLOT(addMultiline()), collection, "formula_addmultiline"); m_removeEnclosingAction = new KAction(i18n("Remove Enclosing Element"), 0, - this, SLOT(removeEnclosing()), + this, TQT_SLOT(removeEnclosing()), collection, "formula_removeenclosing"); m_makeGreekAction = new KAction(i18n("Convert to Greek"), 0, - this, SLOT(makeGreek()), + this, TQT_SLOT(makeGreek()), collection, "formula_makegreek"); m_appendColumnAction = new KAction( i18n( "Append Column" ), "inscol", 0, - this, SLOT( appendColumn() ), + this, TQT_SLOT( appendColumn() ), collection, "formula_appendcolumn" ); m_insertColumnAction = new KAction( i18n( "Insert Column" ), "inscol", 0, - this, SLOT( insertColumn() ), + this, TQT_SLOT( insertColumn() ), collection, "formula_insertcolumn" ); m_removeColumnAction = new KAction( i18n( "Remove Column" ), "remcol", 0, - this, SLOT( removeColumn() ), + this, TQT_SLOT( removeColumn() ), collection, "formula_removecolumn" ); m_appendRowAction = new KAction( i18n( "Append Row" ), "insrow", 0, - this, SLOT( appendRow() ), + this, TQT_SLOT( appendRow() ), collection, "formula_appendrow" ); m_insertRowAction = new KAction( i18n( "Insert Row" ), "insrow", 0, - this, SLOT( insertRow() ), + this, TQT_SLOT( insertRow() ), collection, "formula_insertrow" ); m_removeRowAction = new KAction( i18n( "Remove Row" ), "remrow", 0, - this, SLOT( removeRow() ), + this, TQT_SLOT( removeRow() ), collection, "formula_removerow" ); m_syntaxHighlightingAction = new KToggleAction(i18n("Syntax Highlighting"), 0, - this, SLOT(toggleSyntaxHighlighting()), + this, TQT_SLOT(toggleSyntaxHighlighting()), collection, "formula_syntaxhighlighting"); //m_syntaxHighlightingAction->setChecked( m_contextStyle->syntaxHighlighting() ); m_formatBoldAction = new KToggleAction( i18n( "&Bold" ), "text_bold", 0, //CTRL + Key_B, - this, SLOT( textBold() ), + this, TQT_SLOT( textBold() ), collection, "formula_format_bold" ); m_formatItalicAction = new KToggleAction( i18n( "&Italic" ), "text_italic", 0, //CTRL + Key_I, - this, SLOT( textItalic() ), + this, TQT_SLOT( textItalic() ), collection, "formula_format_italic" ); m_formatBoldAction->setEnabled( false ); m_formatItalicAction->setEnabled( false ); - QStringList delimiter; - delimiter.append(QString("(")); - delimiter.append(QString("[")); - delimiter.append(QString("{")); - delimiter.append(QString("<")); - delimiter.append(QString("/")); - delimiter.append(QString("\\")); - delimiter.append(QString("|")); - delimiter.append(QString(" ")); - delimiter.append(QString(")")); - delimiter.append(QString("]")); - delimiter.append(QString("}")); - delimiter.append(QString(">")); + TQStringList delimiter; + delimiter.append(TQString("(")); + delimiter.append(TQString("[")); + delimiter.append(TQString("{")); + delimiter.append(TQString("<")); + delimiter.append(TQString("/")); + delimiter.append(TQString("\\")); + delimiter.append(TQString("|")); + delimiter.append(TQString(" ")); + delimiter.append(TQString(")")); + delimiter.append(TQString("]")); + delimiter.append(TQString("}")); + delimiter.append(TQString(">")); m_leftBracket = new KSelectAction(i18n("Left Delimiter"), - 0, this, SLOT(delimiterLeft()), + 0, this, TQT_SLOT(delimiterLeft()), collection, "formula_typeleft"); m_leftBracket->setItems(delimiter); //leftBracket->setCurrentItem(0); delimiter.clear(); - delimiter.append(QString(")")); - delimiter.append(QString("]")); - delimiter.append(QString("}")); - delimiter.append(QString(">")); - delimiter.append(QString("/")); - delimiter.append(QString("\\")); - delimiter.append(QString("|")); - delimiter.append(QString(" ")); - delimiter.append(QString("(")); - delimiter.append(QString("[")); - delimiter.append(QString("{")); - delimiter.append(QString("<")); + delimiter.append(TQString(")")); + delimiter.append(TQString("]")); + delimiter.append(TQString("}")); + delimiter.append(TQString(">")); + delimiter.append(TQString("/")); + delimiter.append(TQString("\\")); + delimiter.append(TQString("|")); + delimiter.append(TQString(" ")); + delimiter.append(TQString("(")); + delimiter.append(TQString("[")); + delimiter.append(TQString("{")); + delimiter.append(TQString("<")); m_rightBracket = new KSelectAction(i18n("Right Delimiter"), - 0, this, SLOT(delimiterRight()), + 0, this, TQT_SLOT(delimiterRight()), collection, "formula_typeright"); m_rightBracket->setItems(delimiter); //rightBracket->setCurrentItem(0); @@ -668,30 +668,30 @@ void DocumentWrapper::createActions( KActionCollection* collection ) m_insertSymbolAction = new KAction(i18n("Insert Symbol"), "key_enter", /*CTRL + Key_I*/0, - this, SLOT(insertSymbol()), + this, TQT_SLOT(insertSymbol()), collection, "formula_insertsymbol"); m_symbolNamesAction = new SymbolAction(i18n("Symbol Names"), - 0, this, SLOT(symbolNames()), + 0, this, TQT_SLOT(symbolNames()), collection, "formula_symbolnames"); - QStringList ff; + TQStringList ff; ff.append( i18n( "Normal" ) ); ff.append( i18n( "Script" ) ); ff.append( i18n( "Fraktur" ) ); ff.append( i18n( "Double Struck" ) ); m_fontFamily = new KSelectAction(i18n("Font Family"), - 0, this, SLOT(fontFamily()), + 0, this, TQT_SLOT(fontFamily()), collection, "formula_fontfamily"); m_fontFamily->setItems( ff ); m_fontFamily->setEnabled( false ); - QStringList et; + TQStringList et; et.append( i18n( "Identifier" ) ); et.append( i18n( "Operator" ) ); et.append( i18n( "Number" ) ); et.append( i18n( "Text" ) ); m_tokenElement = new KSelectAction( i18n( "Token Type" ), - 0, this, SLOT( tokenElement() ), + 0, this, TQT_SLOT( tokenElement() ), collection, "formula_tokenelement" ); m_tokenElement->setItems( et ); // m_tokenElements->setEnabled( true ); @@ -760,7 +760,7 @@ void DocumentWrapper::addThickSpace() void DocumentWrapper::addQuadSpace() { if (hasFormula()) { - SpaceRequest r( QUAD ); + SpaceRequest r( TQUAD ); formula()->performRequest( &r ); } } @@ -968,9 +968,9 @@ void DocumentWrapper::makeGreek() void DocumentWrapper::insertSymbol() { if ( hasFormula() && - m_document->m_contextStyle->symbolTable().contains( m_selectedName ) ) { - QChar ch = m_document->m_contextStyle->symbolTable().unicode( m_selectedName ); - if ( ch != QChar::null ) { + m_document->m_contextStyle->symbolTable().tqcontains( m_selectedName ) ) { + TQChar ch = m_document->m_contextStyle->symbolTable().tqunicode( m_selectedName ); + if ( ch != TQChar::null ) { TextCharRequest r( ch, true ); formula()->performRequest( &r ); } @@ -981,12 +981,12 @@ void DocumentWrapper::insertSymbol() } } -void DocumentWrapper::insertSymbol( QString name ) +void DocumentWrapper::insertSymbol( TQString name ) { if ( hasFormula() ) { - if ( m_document->m_contextStyle->symbolTable().contains( name ) ) { - QChar ch = m_document->m_contextStyle->symbolTable().unicode( name ); - if ( ch != QChar::null ) { + if ( m_document->m_contextStyle->symbolTable().tqcontains( name ) ) { + TQChar ch = m_document->m_contextStyle->symbolTable().tqunicode( name ); + if ( ch != TQChar::null ) { TextCharRequest r( ch, true ); formula()->performRequest( &r ); return; @@ -1074,8 +1074,8 @@ void DocumentWrapper::textItalic() void DocumentWrapper::delimiterLeft() { - QString left = m_leftBracket->currentText(); - switch ( left.at(0).latin1() ) { + TQString left = m_leftBracket->currentText(); + switch ( left.tqat(0).latin1() ) { case '[': case ']': case '{': @@ -1086,7 +1086,7 @@ void DocumentWrapper::delimiterLeft() case ')': case '/': case '\\': - m_leftBracketChar = static_cast<SymbolType>( left.at(0).latin1() ); + m_leftBracketChar = static_cast<SymbolType>( left.tqat(0).latin1() ); break; case '|': m_leftBracketChar = LeftLineBracket; @@ -1099,8 +1099,8 @@ void DocumentWrapper::delimiterLeft() void DocumentWrapper::delimiterRight() { - QString right = m_rightBracket->currentText(); - switch ( right.at(0).latin1() ) { + TQString right = m_rightBracket->currentText(); + switch ( right.tqat(0).latin1() ) { case '[': case ']': case '{': @@ -1111,7 +1111,7 @@ void DocumentWrapper::delimiterRight() case ')': case '/': case '\\': - m_rightBracketChar = static_cast<SymbolType>( right.at(0).latin1() ); + m_rightBracketChar = static_cast<SymbolType>( right.tqat(0).latin1() ); break; case '|': m_rightBracketChar = RightLineBracket; @@ -1166,15 +1166,15 @@ void DocumentWrapper::initSymbolNamesAction() { if ( m_hasActions ) { const SymbolTable& st = m_document->m_contextStyle->symbolTable(); - QStringList names = st.allNames(); - QFont font( m_document->m_contextStyle->getFontStyle() ); - QMemArray<QChar> chars( names.count() ); + TQStringList names = st.allNames(); + TQFont font( m_document->m_contextStyle->getFontStyle() ); + TQMemArray<TQChar> chars( names.count() ); uint i = 0; - for ( QStringList::Iterator it = names.begin(); + for ( TQStringList::Iterator it = names.begin(); it != names.end(); ++it, ++i ) { - chars[ i ] = st.unicode( *it ); + chars[ i ] = st.tqunicode( *it ); } m_symbolNamesAction->setSymbols( names, m_document->m_contextStyle->getMathFont(), chars ); m_selectedName = names[0]; diff --git a/lib/kformula/kformuladocument.h b/lib/kformula/kformuladocument.h index 26d6bdd7..62b2dab3 100644 --- a/lib/kformula/kformuladocument.h +++ b/lib/kformula/kformuladocument.h @@ -21,11 +21,11 @@ #ifndef KFORMULADOCUMENT_H #define KFORMULADOCUMENT_H -#include <qdom.h> -#include <qobject.h> -#include <qptrlist.h> -#include <qstring.h> -#include <qstringlist.h> +#include <tqdom.h> +#include <tqobject.h> +#include <tqptrlist.h> +#include <tqstring.h> +#include <tqstringlist.h> #include <kaction.h> #include <kcommand.h> @@ -48,10 +48,10 @@ class ElementCreationStrategy; * small utility class representing a sortable (by x,y position) list * of formulas you can use sort() and inSort(item) **/ -class FormulaList: public QPtrList<Container> +class FormulaList: public TQPtrList<Container> { protected: - virtual int compareItems( QPtrCollection::Item a, QPtrCollection::Item b ); + virtual int compareItems( TQPtrCollection::Item a, TQPtrCollection::Item b ); }; @@ -65,8 +65,9 @@ protected: * bother to ask the document. It's legal to directly create * or destroy a Container object. */ -class KOFORMULA_EXPORT Document : public QObject { +class KOFORMULA_EXPORT Document : public TQObject { Q_OBJECT + TQ_OBJECT friend class DocumentWrapper; friend class Container; @@ -76,8 +77,8 @@ public: /** * Creates a formula document. */ - Document( QObject *parent=0, const char *name=0, - const QStringList &args=QStringList() ); + Document( TQObject *tqparent=0, const char *name=0, + const TQStringList &args=TQStringList() ); ~Document(); /** @@ -108,28 +109,28 @@ public: * Load a kformula DomDocument with all its formulas. * This must only be called on a virgin document. */ - bool loadXML( const QDomDocument& doc ); + bool loadXML( const TQDomDocument& doc ); /** * Load a OASIS content.xml DomDocument * @since 1.4 */ - bool loadOasis( const QDomDocument& doc ); + bool loadOasis( const TQDomDocument& doc ); /** * Load the document settings. */ - bool loadDocumentPart( QDomElement node ); + bool loadDocumentPart( TQDomElement node ); /** * Save the document with all its formulae. */ - QDomDocument saveXML(); + TQDomDocument saveXML(); /** * Save the document settings. */ - QDomElement saveDocumentPart( QDomDocument& doc ); + TQDomElement saveDocumentPart( TQDomDocument& doc ); /** @@ -184,13 +185,13 @@ public: /** * Return a kformula DomDocument. */ - static QDomDocument createDomDocument(); + static TQDomDocument createDomDocument(); /** - * Create a MathML Dom Document, deprecates KFO Dom Document for internal layout + * Create a MathML Dom Document, deprecates KFO Dom Document for internal tqlayout * TODO: Shouldn't this go to KoDocument ? */ - QDomDocument createMathMLDomDocument(); + TQDomDocument createMathMLDomDocument(); /** * Set formula creation strategy: old KFormula or MathML/ODF. @@ -198,14 +199,14 @@ public: * * @param strategy -- "Ordinary" for old Kformula, "Oasis" for MathML/ODF */ - void setCreationStrategy( QString strategy ); + void setCreationStrategy( TQString strategy ); public: /** * @returns an iterator for the collection of formulas. */ - QPtrListIterator<Container> formulas(); + TQPtrListIterator<Container> formulas(); SymbolType leftBracketChar(); SymbolType rightBracketChar(); @@ -288,8 +289,9 @@ private: * A Wrapper that constracts the actions and must be given a real * document to work with. */ -class KOFORMULA_EXPORT DocumentWrapper : public QObject { +class KOFORMULA_EXPORT DocumentWrapper : public TQObject { Q_OBJECT + TQ_OBJECT public: @@ -412,7 +414,7 @@ public slots: void removeEnclosing(); void makeGreek(); void insertSymbol(); - void insertSymbol( QString name ); + void insertSymbol( TQString name ); void appendColumn(); void insertColumn(); @@ -491,7 +493,7 @@ private: SymbolType m_leftBracketChar; SymbolType m_rightBracketChar; - QString m_selectedName; + TQString m_selectedName; KConfig* m_config; KoCommandHistory* m_history; diff --git a/lib/kformula/kformulainputfilter.h b/lib/kformula/kformulainputfilter.h index f91efe8c..81b0625e 100644 --- a/lib/kformula/kformulainputfilter.h +++ b/lib/kformula/kformulainputfilter.h @@ -21,21 +21,22 @@ #ifndef KFORMULAINPUTFILTER_H #define KFORMULAINPUTFILTER_H -#include <qobject.h> -#include <qdom.h> +#include <tqobject.h> +#include <tqdom.h> #include "kformuladefs.h" KFORMULA_NAMESPACE_BEGIN -class KFInputFilter : public QObject +class KFInputFilter : public TQObject { Q_OBJECT + TQ_OBJECT public: /* * Get the just created DOM. */ - virtual QDomDocument getKFormulaDom() =0; + virtual TQDomDocument getKFormulaDom() =0; bool isDone() {return done; } diff --git a/lib/kformula/kformulamathmlread.cc b/lib/kformula/kformulamathmlread.cc index 1bee8550..f42e3ae1 100644 --- a/lib/kformula/kformulamathmlread.cc +++ b/lib/kformula/kformulamathmlread.cc @@ -19,8 +19,8 @@ */ #include <iostream> -#include <qstring.h> -#include <qfontmetrics.h> +#include <tqstring.h> +#include <tqfontmetrics.h> #include <klocale.h> #include <kmessagebox.h> @@ -40,53 +40,53 @@ class MathML2KFormulaPrivate public: MathML2KFormulaPrivate( MathML2KFormula* mml_filter, const ContextStyle& contextStyle, - const QDomDocument& formuladoc ); + const TQDomDocument& formuladoc ); ~MathML2KFormulaPrivate(); - void math( QDomElement element ); + void math( TQDomElement element ); // Token Elements - void mi( QDomElement element, QDomNode docnode ); - void mn( QDomElement element, QDomNode docnode ); - void mo( QDomElement element, QDomNode docnode ); - void mtext( QDomElement element, QDomNode docnode ); - void mspace( QDomElement element, QDomNode docnode ); - void ms( QDomElement element, QDomNode docnode ); + void mi( TQDomElement element, TQDomNode docnode ); + void mn( TQDomElement element, TQDomNode docnode ); + void mo( TQDomElement element, TQDomNode docnode ); + void mtext( TQDomElement element, TQDomNode docnode ); + void mspace( TQDomElement element, TQDomNode docnode ); + void ms( TQDomElement element, TQDomNode docnode ); // mglyph not supported // General Layout Schemata - void mrow( QDomElement element, QDomNode docnode ); - void mfrac( QDomElement element, QDomNode docnode ); - void msqrt( QDomElement element, QDomNode docnode ); - void mroot( QDomElement element, QDomNode docnode ); - void mstyle( QDomElement element, QDomNode docnode ); + void mrow( TQDomElement element, TQDomNode docnode ); + void mfrac( TQDomElement element, TQDomNode docnode ); + void msqrt( TQDomElement element, TQDomNode docnode ); + void mroot( TQDomElement element, TQDomNode docnode ); + void mstyle( TQDomElement element, TQDomNode docnode ); // merror not supported // mpadded not supported // mphantom not supported - void mfenced( QDomElement element, QDomNode docnode ); + void mfenced( TQDomElement element, TQDomNode docnode ); // menclose not supported // Script and Limit Schemata - void msub_msup( QDomElement element, QDomNode docnode ); - void msubsup( QDomElement element, QDomNode docnode ); - void munder( QDomElement element, QDomNode docnode, bool oasisFormat ); - void mover( QDomElement element, QDomNode docnode, bool oasisFormat ); - void munderover( QDomElement element, QDomNode docnode, bool oasisFormat ); + void msub_msup( TQDomElement element, TQDomNode docnode ); + void msubsup( TQDomElement element, TQDomNode docnode ); + void munder( TQDomElement element, TQDomNode docnode, bool oasisFormat ); + void mover( TQDomElement element, TQDomNode docnode, bool oasisFormat ); + void munderover( TQDomElement element, TQDomNode docnode, bool oasisFormat ); // mmultiscripts not supported // Tables and Matrices - void mtable( QDomElement element, QDomNode docnode ); + void mtable( TQDomElement element, TQDomNode docnode ); // not much supported // Enlivening Expressions // maction not supported protected: - void createTextElements( QString text, QDomNode docnode ); - void createNameSequence( QString text, QDomNode docnode ); - double convertToPoint( QString value, bool* ok ); - bool isEmbellishedOperator( QDomNode node, QDomElement* mo, bool oasisFormat ); - bool isSpaceLike( QDomNode node, bool oasisFormat ); + void createTextElements( TQString text, TQDomNode docnode ); + void createNameSequence( TQString text, TQDomNode docnode ); + double convertToPoint( TQString value, bool* ok ); + bool isEmbellishedOperator( TQDomNode node, TQDomElement* mo, bool oasisFormat ); + bool isSpaceLike( TQDomNode node, bool oasisFormat ); enum MathVariant { normal, @@ -132,7 +132,7 @@ protected: << endl; } - void setStyles( QDomElement element ) + void setStyles( TQDomElement element ) { if ( !useVariant ) return; @@ -189,7 +189,7 @@ protected: } } - void readStyles( QDomElement mmlElement ) + void readStyles( TQDomElement mmlElement ) { if ( mmlElement.hasAttribute( "mathvariant" ) ) { @@ -250,14 +250,14 @@ protected: }; MathStyle style; - QDomDocument doc; + TQDomDocument doc; private: const ContextStyle& context; MathML2KFormula* filter; }; -MathML2KFormulaPrivate::MathML2KFormulaPrivate( MathML2KFormula* mml_filter, const ContextStyle& cs, const QDomDocument& formuladoc ) +MathML2KFormulaPrivate::MathML2KFormulaPrivate( MathML2KFormula* mml_filter, const ContextStyle& cs, const TQDomDocument& formuladoc ) : doc( formuladoc ), context( cs ), filter( mml_filter ) { } @@ -266,12 +266,12 @@ MathML2KFormulaPrivate::~MathML2KFormulaPrivate() { } -void MathML2KFormulaPrivate::math( QDomElement element ) +void MathML2KFormulaPrivate::math( TQDomElement element ) { - QDomElement formula = doc.createElement( "FORMULA" ); - QDomNode n = element.firstChild(); + TQDomElement formula = doc.createElement( "FORMULA" ); + TQDomNode n = element.firstChild(); - QString display = element.attribute( "display" ); + TQString display = element.attribute( "display" ); if ( display == "block" ) { style.displaystyle = true; @@ -295,10 +295,10 @@ void MathML2KFormulaPrivate::math( QDomElement element ) doc.appendChild( formula ); } -void MathML2KFormulaPrivate::mi( QDomElement element, QDomNode docnode ) +void MathML2KFormulaPrivate::mi( TQDomElement element, TQDomNode docnode ) { MathStyle previousStyle( style ); - QString text = element.text().stripWhiteSpace(); + TQString text = element.text().stripWhiteSpace(); if ( text.length() == 1 ) { // Default italic, only when content is one char style.mathvariant = italic; style.useVariant = true; @@ -311,38 +311,38 @@ void MathML2KFormulaPrivate::mi( QDomElement element, QDomNode docnode ) style = previousStyle; } -void MathML2KFormulaPrivate::mo( QDomElement element, QDomNode docnode ) +void MathML2KFormulaPrivate::mo( TQDomElement element, TQDomNode docnode ) { MathStyle previousStyle( style ); style.readStyles( element ); - QString text = element.text().stripWhiteSpace(); + TQString text = element.text().stripWhiteSpace(); createTextElements( text, docnode ); style = previousStyle; } -void MathML2KFormulaPrivate::mn( QDomElement element, QDomNode docnode ) +void MathML2KFormulaPrivate::mn( TQDomElement element, TQDomNode docnode ) { MathStyle previousStyle( style ); style.readStyles( element ); - QString text = element.text().stripWhiteSpace(); + TQString text = element.text().stripWhiteSpace(); createTextElements( text, docnode ); style = previousStyle; } -void MathML2KFormulaPrivate::mtext( QDomElement element, QDomNode docnode ) +void MathML2KFormulaPrivate::mtext( TQDomElement element, TQDomNode docnode ) { MathStyle previousStyle( style ); style.readStyles( element ); - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); while ( !n.isNull() ) { if ( n.isText() ) { - QString text = n.toText().data().stripWhiteSpace(); + TQString text = n.toText().data().stripWhiteSpace(); createTextElements( text, docnode ); } else if ( n.isElement() ) { @@ -358,11 +358,11 @@ void MathML2KFormulaPrivate::mtext( QDomElement element, QDomNode docnode ) style = previousStyle; } -void MathML2KFormulaPrivate::ms( QDomElement element, QDomNode docnode ) +void MathML2KFormulaPrivate::ms( TQDomElement element, TQDomNode docnode ) { - QString lquote = element.attribute( "lquote", "\"" ); - QString rquote = element.attribute( "rquote", "\"" ); - QString text; + TQString lquote = element.attribute( "lquote", "\"" ); + TQString rquote = element.attribute( "rquote", "\"" ); + TQString text; text = lquote; text += element.text().stripWhiteSpace(); @@ -371,12 +371,12 @@ void MathML2KFormulaPrivate::ms( QDomElement element, QDomNode docnode ) createTextElements( text, docnode ); } -void MathML2KFormulaPrivate::mspace( QDomElement element, QDomNode docnode ) +void MathML2KFormulaPrivate::mspace( TQDomElement element, TQDomNode docnode ) { // we support only horizontal space - QString width = element.attribute( "width" ); + TQString width = element.attribute( "width" ); - QDomElement spaceelement = doc.createElement( "SPACE" ); + TQDomElement spaceelement = doc.createElement( "SPACE" ); // check for namedspace. We don't support much... if ( width == "veryverythinmathspace" ) { @@ -411,7 +411,7 @@ void MathML2KFormulaPrivate::mspace( QDomElement element, QDomNode docnode ) // See MathML specification, Appendix H w = context.getDefaultFont().pointSize(); if ( w == -1 ) { - QFontMetrics fm( context.getDefaultFont() ); + TQFontMetrics fm( context.getDefaultFont() ); w = fm.width( 'm' ); } w = w * width.remove( width.length() - 2, 2 ).toDouble( &ok ); @@ -461,12 +461,12 @@ void MathML2KFormulaPrivate::mspace( QDomElement element, QDomNode docnode ) docnode.appendChild( spaceelement ); } -void MathML2KFormulaPrivate::mrow( QDomElement element, QDomNode docnode ) +void MathML2KFormulaPrivate::mrow( TQDomElement element, TQDomNode docnode ) { - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); while ( !n.isNull() ) { if ( n.isElement () ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); // We do not allow sequence inside sequence filter->processElement( e, doc, docnode ); } @@ -477,10 +477,10 @@ void MathML2KFormulaPrivate::mrow( QDomElement element, QDomNode docnode ) } } -void MathML2KFormulaPrivate::mfrac( QDomElement element, QDomNode docnode ) +void MathML2KFormulaPrivate::mfrac( TQDomElement element, TQDomNode docnode ) { - QDomNode n = element.firstChild(); - QDomElement fraction = doc.createElement( "FRACTION" ); + TQDomNode n = element.firstChild(); + TQDomElement fraction = doc.createElement( "FRACTION" ); MathStyle previousStyle( style ); style.displaystyle ? style.displaystyle = false : style.scriptlevel += 1; @@ -491,21 +491,21 @@ void MathML2KFormulaPrivate::mfrac( QDomElement element, QDomNode docnode ) if ( n.isElement() ) { ++i; if ( i == 1 ) { //first is numerator - QDomElement numerator = + TQDomElement numerator = doc.createElement( "NUMERATOR" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); numerator.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); fraction.appendChild( numerator ); } else { - QDomElement denominator = + TQDomElement denominator = doc.createElement( "DENOMINATOR" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); denominator.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); fraction.appendChild( denominator ); @@ -521,20 +521,20 @@ void MathML2KFormulaPrivate::mfrac( QDomElement element, QDomNode docnode ) docnode.appendChild( fraction ); } -void MathML2KFormulaPrivate::mroot( QDomElement element, QDomNode docnode ) +void MathML2KFormulaPrivate::mroot( TQDomElement element, TQDomNode docnode ) { - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); int i = 0; - QDomElement root = doc.createElement( "ROOT" ); + TQDomElement root = doc.createElement( "ROOT" ); while ( !n.isNull() && i < 2 ) { if ( n.isElement() ) { ++i; if ( i == 1 ) { //first is content (base) - QDomElement content = doc.createElement( "CONTENT" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement content = doc.createElement( "CONTENT" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); content.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); root.appendChild(content); @@ -545,10 +545,10 @@ void MathML2KFormulaPrivate::mroot( QDomElement element, QDomNode docnode ) style.displaystyle = false; style.styleChange(); - QDomElement index = doc.createElement( "INDEX" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement index = doc.createElement( "INDEX" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); index.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); root.appendChild( index ); @@ -563,13 +563,13 @@ void MathML2KFormulaPrivate::mroot( QDomElement element, QDomNode docnode ) docnode.appendChild( root ); } -void MathML2KFormulaPrivate::msqrt( QDomElement element, QDomNode docnode ) +void MathML2KFormulaPrivate::msqrt( TQDomElement element, TQDomNode docnode ) { - QDomNode n = element.firstChild(); - QDomElement root = doc.createElement( "ROOT" ); + TQDomNode n = element.firstChild(); + TQDomElement root = doc.createElement( "ROOT" ); - QDomElement content = doc.createElement( "CONTENT" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement content = doc.createElement( "CONTENT" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); content.appendChild( sequence ); root.appendChild( content ); @@ -586,7 +586,7 @@ void MathML2KFormulaPrivate::msqrt( QDomElement element, QDomNode docnode ) docnode.appendChild( root ); } -void MathML2KFormulaPrivate::mstyle( QDomElement element, QDomNode docnode ) +void MathML2KFormulaPrivate::mstyle( TQDomElement element, TQDomNode docnode ) { bool ok; @@ -594,7 +594,7 @@ void MathML2KFormulaPrivate::mstyle( QDomElement element, QDomNode docnode ) style.readStyles( element ); if ( element.hasAttribute( "scriptlevel" ) ) { - QString scriptlevel = element.attribute( "scriptlevel" ); + TQString scriptlevel = element.attribute( "scriptlevel" ); if ( scriptlevel.startsWith( "+" ) || scriptlevel.startsWith( "-" ) ) style.scriptlevel += scriptlevel.toInt( &ok ); else @@ -603,7 +603,7 @@ void MathML2KFormulaPrivate::mstyle( QDomElement element, QDomNode docnode ) style.scriptlevel = previousStyle.scriptlevel; } if ( element.hasAttribute( "displaystyle" ) ) { - QString displaystyle = element.attribute( "displaystyle" ); + TQString displaystyle = element.attribute( "displaystyle" ); if ( displaystyle == "true" ) style.displaystyle = true; else if ( displaystyle == "false" ) @@ -616,50 +616,50 @@ void MathML2KFormulaPrivate::mstyle( QDomElement element, QDomNode docnode ) style.scriptsizemultiplier = previousStyle.scriptsizemultiplier; } if ( element.hasAttribute( "scriptminsize" ) ) { - QString scriptminsize = element.attribute( "scriptminsize" ); + TQString scriptminsize = element.attribute( "scriptminsize" ); style.scriptminsize = convertToPoint( scriptminsize, &ok ); if ( !ok ) style.scriptminsize = previousStyle.scriptminsize; } if ( element.hasAttribute( "veryverythinmathspace" ) ) { - QString vvthinmspace = element.attribute( "veryverythinmathspace" ); + TQString vvthinmspace = element.attribute( "veryverythinmathspace" ); style.veryverythinmathspace = convertToPoint( vvthinmspace, &ok ); if ( !ok ) style.veryverythinmathspace = previousStyle.veryverythinmathspace; } if ( element.hasAttribute( "verythinmathspace" ) ) { - QString vthinmspace = element.attribute( "verythinmathspace" ); + TQString vthinmspace = element.attribute( "verythinmathspace" ); style.verythinmathspace = convertToPoint( vthinmspace, &ok ); if ( !ok ) style.verythinmathspace = previousStyle.verythinmathspace; } if ( element.hasAttribute( "thinmathspace" ) ) { - QString thinmathspace = element.attribute( "thinmathspace" ); + TQString thinmathspace = element.attribute( "thinmathspace" ); style.thinmathspace = convertToPoint( thinmathspace, &ok ); if ( !ok ) style.thinmathspace = previousStyle.thinmathspace; } if ( element.hasAttribute( "mediummathspace" ) ) { - QString mediummathspace = element.attribute( "mediummathspace" ); + TQString mediummathspace = element.attribute( "mediummathspace" ); style.mediummathspace = convertToPoint( mediummathspace, &ok ); if ( !ok ) style.mediummathspace = previousStyle.mediummathspace; } if ( element.hasAttribute( "thickmathspace" ) ) { - QString thickmathspace = element.attribute( "thickmathspace" ); + TQString thickmathspace = element.attribute( "thickmathspace" ); style.thickmathspace = convertToPoint( thickmathspace, &ok ); if ( !ok ) style.thickmathspace = previousStyle.thickmathspace; } if ( element.hasAttribute( "verythickmathspace" ) ) { - QString vthickmspace = element.attribute( "verythickmathspace" ); + TQString vthickmspace = element.attribute( "verythickmathspace" ); style.verythickmathspace = convertToPoint( vthickmspace, &ok ); if ( !ok ) style.verythickmathspace = previousStyle.verythickmathspace; } if ( element.hasAttribute( "veryverythickmathspace" ) ) { - QString vvthickmspace = element.attribute( "veryverythickmathspace" ); + TQString vvthickmspace = element.attribute( "veryverythickmathspace" ); style.veryverythickmathspace = convertToPoint( vvthickmspace, &ok ); if ( !ok ) style.veryverythickmathspace = @@ -668,7 +668,7 @@ void MathML2KFormulaPrivate::mstyle( QDomElement element, QDomNode docnode ) style.styleChange(); - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); while ( !n.isNull() ) { filter->processElement( n, doc, docnode ); n = n.nextSibling(); @@ -677,34 +677,34 @@ void MathML2KFormulaPrivate::mstyle( QDomElement element, QDomNode docnode ) style = previousStyle; } -void MathML2KFormulaPrivate::mfenced( QDomElement element, QDomNode docnode ) +void MathML2KFormulaPrivate::mfenced( TQDomElement element, TQDomNode docnode ) { - QDomElement bracket = doc.createElement( "BRACKET" ); - QString value = element.attribute( "open", "(" ); - bracket.setAttribute( "LEFT", QString::number( value.at( 0 ).latin1() ) ); + TQDomElement bracket = doc.createElement( "BRACKET" ); + TQString value = element.attribute( "open", "(" ); + bracket.setAttribute( "LEFT", TQString::number( value.at( 0 ).latin1() ) ); value = element.attribute( "close", ")" ); - bracket.setAttribute( "RIGHT", QString::number( value.at( 0 ).latin1() ) ); + bracket.setAttribute( "RIGHT", TQString::number( value.at( 0 ).latin1() ) ); - QDomElement content = doc.createElement( "CONTENT" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement content = doc.createElement( "CONTENT" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); content.appendChild( sequence ); - QString separators = element.attribute( "separators", "," ); + TQString separators = element.attribute( "separators", "," ); - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); uint i = 0; while ( !n.isNull() ) { if ( n.isElement() ) { if ( i != 0 && !separators.isEmpty() ) { - QDomElement textelement = doc.createElement( "TEXT" ); + TQDomElement textelement = doc.createElement( "TEXT" ); if ( i > separators.length() ) i = separators.length(); - textelement.setAttribute( "CHAR", QString( separators.at( i - 1 ) ) ); + textelement.setAttribute( "CHAR", TQString( separators.at( i - 1 ) ) ); //style.setStyles( textelement ); sequence.appendChild( textelement ); } ++i; - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); } else { @@ -716,10 +716,10 @@ void MathML2KFormulaPrivate::mfenced( QDomElement element, QDomNode docnode ) docnode.appendChild( bracket ); } -void MathML2KFormulaPrivate::mtable( QDomElement element, QDomNode docnode ) +void MathML2KFormulaPrivate::mtable( TQDomElement element, TQDomNode docnode ) { MathStyle previousStyle( style ); - QString displaystyle = element.attribute( "displaystyle", "false" ); + TQString displaystyle = element.attribute( "displaystyle", "false" ); if ( displaystyle == "true" ) { style.displaystyle = true; } @@ -729,13 +729,13 @@ void MathML2KFormulaPrivate::mtable( QDomElement element, QDomNode docnode ) } style.styleChange(); - QString subtag; + TQString subtag; int rows = 0; int cols = 0; - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); while ( !n.isNull() ) { if ( n.isElement() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); subtag = e.tagName(); if (subtag == "mtr") { @@ -743,7 +743,7 @@ void MathML2KFormulaPrivate::mtable( QDomElement element, QDomNode docnode ) /* Determins the number of columns */ - QDomNode cellnode = e.firstChild(); + TQDomNode cellnode = e.firstChild(); int cc = 0; while ( !cellnode.isNull() ) { @@ -767,22 +767,22 @@ void MathML2KFormulaPrivate::mtable( QDomElement element, QDomNode docnode ) of rows and cols to leave empty spaces */ n = element.firstChild(); - QDomElement matrix = doc.createElement( "MATRIX" ); + TQDomElement matrix = doc.createElement( "MATRIX" ); matrix.setAttribute( "COLUMNS", cols ); matrix.setAttribute( "ROWS", rows ); while ( !n.isNull() ) { if ( n.isElement() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); subtag = e.tagName(); if ( subtag == "mtr" ) { - QDomNode cellnode = e.firstChild(); + TQDomNode cellnode = e.firstChild(); int cc = 0; while ( !cellnode.isNull() ) { if ( cellnode.isElement() ) { ++cc; - QDomElement cell = doc.createElement( "SEQUENCE" ); - QDomElement cellelement = cellnode.toElement(); + TQDomElement cell = doc.createElement( "SEQUENCE" ); + TQDomElement cellelement = cellnode.toElement(); filter->processElement( cellelement, doc, cell ); matrix.appendChild( cell ); } @@ -791,7 +791,7 @@ void MathML2KFormulaPrivate::mtable( QDomElement element, QDomNode docnode ) /* Add empty elements */ for(; cc < cols; cc++ ) { - QDomElement cell = doc.createElement( "SEQUENCE" ); + TQDomElement cell = doc.createElement( "SEQUENCE" ); matrix.appendChild( cell ); } } @@ -803,26 +803,26 @@ void MathML2KFormulaPrivate::mtable( QDomElement element, QDomNode docnode ) docnode.appendChild(matrix); } -void MathML2KFormulaPrivate::msub_msup( QDomElement element, QDomNode docnode ) +void MathML2KFormulaPrivate::msub_msup( TQDomElement element, TQDomNode docnode ) { - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); int i = 0; - QDomElement root = doc.createElement( "INDEX" ); + TQDomElement root = doc.createElement( "INDEX" ); while ( !n.isNull() && i < 2 ) { if ( n.isElement() ) { ++i; if ( i == 1 ) { // first is content (base) - QDomElement content = doc.createElement( "CONTENT" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement content = doc.createElement( "CONTENT" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); content.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); root.appendChild( content ); } else { - QDomElement index; + TQDomElement index; if ( element.tagName() == "msup" ) index = doc.createElement( "UPPERRIGHT" ); else @@ -833,9 +833,9 @@ void MathML2KFormulaPrivate::msub_msup( QDomElement element, QDomNode docnode ) style.displaystyle = false; style.styleChange(); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); index.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); root.appendChild( index ); @@ -851,11 +851,11 @@ void MathML2KFormulaPrivate::msub_msup( QDomElement element, QDomNode docnode ) docnode.appendChild( root ); } -void MathML2KFormulaPrivate::munder( QDomElement element, QDomNode docnode, bool oasisFormat ) +void MathML2KFormulaPrivate::munder( TQDomElement element, TQDomNode docnode, bool oasisFormat ) { bool accentunder; - QString au = element.attribute( "accentunder" ); + TQString au = element.attribute( "accentunder" ); if ( au == "true" ) accentunder = true; else if ( au == "false" ) @@ -863,7 +863,7 @@ void MathML2KFormulaPrivate::munder( QDomElement element, QDomNode docnode, bool else { // use default - QDomElement mo; + TQDomElement mo; // is underscript an embellished operator? if ( isEmbellishedOperator( element.childNodes().item( 1 ), &mo, oasisFormat ) ) { if ( mo.attribute( "accent" ) == "true" ) @@ -875,18 +875,18 @@ void MathML2KFormulaPrivate::munder( QDomElement element, QDomNode docnode, bool accentunder = false; } - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); int i = 0; - QDomElement root = doc.createElement( "INDEX" ); + TQDomElement root = doc.createElement( "INDEX" ); while ( !n.isNull() && i < 2 ) { if ( n.isElement() ) { ++i; if ( i == 1 ) { // first is content (base) - QDomElement content = doc.createElement( "CONTENT" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement content = doc.createElement( "CONTENT" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); content.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); root.appendChild( content ); @@ -899,7 +899,7 @@ void MathML2KFormulaPrivate::munder( QDomElement element, QDomNode docnode, bool style.styleChange(); } - QDomElement mo; QDomElement index; + TQDomElement mo; TQDomElement index; if ( isEmbellishedOperator( n.previousSibling(), &mo, oasisFormat ) && !previousStyle.displaystyle && mo.attribute( "movablelimits" ) == "true" ) @@ -910,9 +910,9 @@ void MathML2KFormulaPrivate::munder( QDomElement element, QDomNode docnode, bool index = doc.createElement( "LOWERMIDDLE" ); } - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); index.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); root.appendChild( index ); @@ -929,11 +929,11 @@ void MathML2KFormulaPrivate::munder( QDomElement element, QDomNode docnode, bool docnode.appendChild( root ); } -void MathML2KFormulaPrivate::mover( QDomElement element, QDomNode docnode, bool oasisFormat ) +void MathML2KFormulaPrivate::mover( TQDomElement element, TQDomNode docnode, bool oasisFormat ) { bool accent; - QString ac = element.attribute( "accent" ); + TQString ac = element.attribute( "accent" ); if ( ac == "true" ) accent = true; else if ( ac == "false" ) @@ -941,7 +941,7 @@ void MathML2KFormulaPrivate::mover( QDomElement element, QDomNode docnode, bool else { // use default - QDomElement mo; + TQDomElement mo; // is overscript an embellished operator? if ( isEmbellishedOperator( element.childNodes().item( 1 ), &mo, oasisFormat ) ) { if ( mo.attribute( "accent" ) == "true" ) @@ -953,18 +953,18 @@ void MathML2KFormulaPrivate::mover( QDomElement element, QDomNode docnode, bool accent = false; } - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); int i = 0; - QDomElement root = doc.createElement( "INDEX" ); + TQDomElement root = doc.createElement( "INDEX" ); while ( !n.isNull() && i < 2 ) { if ( n.isElement() ) { ++i; if ( i == 1 ) { // first is content (base) - QDomElement content = doc.createElement( "CONTENT" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement content = doc.createElement( "CONTENT" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); content.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); root.appendChild( content ); @@ -977,7 +977,7 @@ void MathML2KFormulaPrivate::mover( QDomElement element, QDomNode docnode, bool style.styleChange(); } - QDomElement mo; QDomElement index; + TQDomElement mo; TQDomElement index; if ( isEmbellishedOperator( n.previousSibling(), &mo, oasisFormat ) && !previousStyle.displaystyle && mo.attribute( "movablelimits" ) == "true" ) @@ -988,9 +988,9 @@ void MathML2KFormulaPrivate::mover( QDomElement element, QDomNode docnode, bool index = doc.createElement( "UPPERMIDDLE" ); } - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); index.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); root.appendChild( index ); @@ -1007,12 +1007,12 @@ void MathML2KFormulaPrivate::mover( QDomElement element, QDomNode docnode, bool docnode.appendChild( root ); } -void MathML2KFormulaPrivate::munderover( QDomElement element, QDomNode docnode, bool oasisFormat ) +void MathML2KFormulaPrivate::munderover( TQDomElement element, TQDomNode docnode, bool oasisFormat ) { bool accent; bool accentunder; - QString value = element.attribute( "accentunder" ); + TQString value = element.attribute( "accentunder" ); if ( value == "true" ) accentunder = true; else if ( value == "false" ) @@ -1020,7 +1020,7 @@ void MathML2KFormulaPrivate::munderover( QDomElement element, QDomNode docnode, else { // use default - QDomElement mo; + TQDomElement mo; // is underscript an embellished operator? if ( isEmbellishedOperator( element.childNodes().item( 1 ), &mo, oasisFormat ) ) { if ( mo.attribute( "accent" ) == "true" ) @@ -1039,7 +1039,7 @@ void MathML2KFormulaPrivate::munderover( QDomElement element, QDomNode docnode, else { // use default - QDomElement mo; + TQDomElement mo; // is overscript an embellished operator? if ( isEmbellishedOperator( element.childNodes().item( 2 ), &mo,oasisFormat ) ) { kdDebug( DEBUGID ) << "embellished operator" << endl; @@ -1054,18 +1054,18 @@ void MathML2KFormulaPrivate::munderover( QDomElement element, QDomNode docnode, kdDebug( DEBUGID ) << "munderover:\n accentunder = " << accentunder << "\n accent = " << accent << endl; - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); int i = 0; - QDomElement root = doc.createElement( "INDEX" ); + TQDomElement root = doc.createElement( "INDEX" ); while ( !n.isNull() && i < 3 ) { if ( n.isElement() ) { ++i; if ( i == 1 ) { // base - QDomElement content = doc.createElement( "CONTENT" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement content = doc.createElement( "CONTENT" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); content.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); root.appendChild( content ); @@ -1078,7 +1078,7 @@ void MathML2KFormulaPrivate::munderover( QDomElement element, QDomNode docnode, style.styleChange(); } - QDomElement mo; QDomElement index; + TQDomElement mo; TQDomElement index; // is the base an embellished operator? if ( isEmbellishedOperator( element.firstChild(), &mo, oasisFormat ) && !previousStyle.displaystyle && @@ -1090,9 +1090,9 @@ void MathML2KFormulaPrivate::munderover( QDomElement element, QDomNode docnode, index = doc.createElement( "LOWERMIDDLE" ); } - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); index.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); root.appendChild( index ); @@ -1106,7 +1106,7 @@ void MathML2KFormulaPrivate::munderover( QDomElement element, QDomNode docnode, style.styleChange(); } - QDomElement mo; QDomElement index; + TQDomElement mo; TQDomElement index; if ( isEmbellishedOperator( element.firstChild(), &mo, oasisFormat ) && !previousStyle.displaystyle && mo.attribute( "movablelimits" ) == "true" ) @@ -1117,9 +1117,9 @@ void MathML2KFormulaPrivate::munderover( QDomElement element, QDomNode docnode, index = doc.createElement( "UPPERMIDDLE" ); } - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); index.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); root.appendChild( index ); @@ -1136,21 +1136,21 @@ void MathML2KFormulaPrivate::munderover( QDomElement element, QDomNode docnode, docnode.appendChild( root ); } -void MathML2KFormulaPrivate::msubsup( QDomElement element, QDomNode docnode ) +void MathML2KFormulaPrivate::msubsup( TQDomElement element, TQDomNode docnode ) { - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); int i = 0; - QDomElement root = doc.createElement("INDEX"); + TQDomElement root = doc.createElement("INDEX"); MathStyle previousStyle( style ); while ( !n.isNull() && i < 2 ) { if ( n.isElement() ) { ++i; if ( i == 1 ) { // base - QDomElement content = doc.createElement( "CONTENT" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement content = doc.createElement( "CONTENT" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); content.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); root.appendChild( content ); @@ -1160,22 +1160,22 @@ void MathML2KFormulaPrivate::msubsup( QDomElement element, QDomNode docnode ) style.displaystyle = false; style.styleChange(); - QDomElement index; + TQDomElement index; index = doc.createElement( "LOWERRIGHT" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); index.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); root.appendChild( index ); } else { // superscript - QDomElement index; + TQDomElement index; index = doc.createElement( "UPPERRIGHT" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); index.appendChild( sequence ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); filter->processElement( e, doc, sequence ); root.appendChild( index ); @@ -1191,11 +1191,11 @@ void MathML2KFormulaPrivate::msubsup( QDomElement element, QDomNode docnode ) docnode.appendChild( root ); } -void MathML2KFormulaPrivate::createTextElements( QString text, QDomNode docnode ) +void MathML2KFormulaPrivate::createTextElements( TQString text, TQDomNode docnode ) { for ( uint i = 0; i < text.length(); ++i ) { - QDomElement textelement = doc.createElement( "TEXT" ); - textelement.setAttribute( "CHAR", QString( text.at( i ) ) ); + TQDomElement textelement = doc.createElement( "TEXT" ); + textelement.setAttribute( "CHAR", TQString( text.at( i ) ) ); style.setStyles( textelement ); if ( context.symbolTable().inTable( text.at( i ) ) ) { // The element is a symbol. @@ -1205,12 +1205,12 @@ void MathML2KFormulaPrivate::createTextElements( QString text, QDomNode docnode } } -void MathML2KFormulaPrivate::createNameSequence( QString text, QDomNode docnode ) +void MathML2KFormulaPrivate::createNameSequence( TQString text, TQDomNode docnode ) { - QDomElement namesequence = doc.createElement( "NAMESEQUENCE" ); + TQDomElement namesequence = doc.createElement( "NAMESEQUENCE" ); for ( uint i = 0; i < text.length(); ++i ) { - QDomElement textelement = doc.createElement( "TEXT" ); - textelement.setAttribute( "CHAR", QString( text.at( i ) ) ); + TQDomElement textelement = doc.createElement( "TEXT" ); + textelement.setAttribute( "CHAR", TQString( text.at( i ) ) ); style.setStyles( textelement ); if ( context.symbolTable().inTable( text.at( i ) ) ) { // The element is a symbol. @@ -1221,7 +1221,7 @@ void MathML2KFormulaPrivate::createNameSequence( QString text, QDomNode docnode docnode.appendChild( namesequence ); } -double MathML2KFormulaPrivate::convertToPoint( QString value, bool* ok ) +double MathML2KFormulaPrivate::convertToPoint( TQString value, bool* ok ) { double pt = 0; @@ -1229,14 +1229,14 @@ double MathML2KFormulaPrivate::convertToPoint( QString value, bool* ok ) // See MathML specification, Appendix H pt = context.getDefaultFont().pointSize(); if ( pt == -1 ) { - QFontMetrics fm( context.getDefaultFont() ); + TQFontMetrics fm( context.getDefaultFont() ); pt = fm.width( 'M' ); // PIXELS! } pt = pt * value.remove( value.length() - 2, 2 ).toDouble( ok ); } else if ( value.endsWith( "ex" ) ) { - QFontMetrics fm( context.getDefaultFont() ); + TQFontMetrics fm( context.getDefaultFont() ); pt = fm.height(); // PIXELS, and totally wrong! } @@ -1270,16 +1270,16 @@ double MathML2KFormulaPrivate::convertToPoint( QString value, bool* ok ) return pt; } -bool MathML2KFormulaPrivate::isEmbellishedOperator( QDomNode node, - QDomElement* mo, bool oasisFormat ) +bool MathML2KFormulaPrivate::isEmbellishedOperator( TQDomNode node, + TQDomElement* mo, bool oasisFormat ) { // See MathML 2.0 specification: 3.2.5.7 if ( !node.isElement() ) return false; - QDomElement element = node.toElement(); - QString tag = element.tagName(); + TQDomElement element = node.toElement(); + TQString tag = element.tagName(); if ( tag == "mo" ) { @@ -1297,7 +1297,7 @@ bool MathML2KFormulaPrivate::isEmbellishedOperator( QDomNode node, return false; // not supported } if ( tag == "mrow" || tag == "mstyle" || tag == "mphantom" || tag == "mpadded" ) { - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); int i = 0; while ( !n.isNull() ) { @@ -1315,22 +1315,22 @@ bool MathML2KFormulaPrivate::isEmbellishedOperator( QDomNode node, return false; } -bool MathML2KFormulaPrivate::isSpaceLike( QDomNode node, bool oasisFormat ) +bool MathML2KFormulaPrivate::isSpaceLike( TQDomNode node, bool oasisFormat ) { // See MathML 2.0 specification: 3.2.7.3 if ( !node.isElement() ) return false; - QDomElement element = node.toElement(); - QString tag = element.tagName(); + TQDomElement element = node.toElement(); + TQString tag = element.tagName(); if ( tag == "mtext" || tag == "mspace" || tag == "maligngroup" || tag == "malignmark" ) { return true; } if ( tag == "mstyle" || tag == "mphantom" || tag == "mpadded" || tag == "mrow" ) { - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); while ( !n.isNull() ) { if ( isSpaceLike( n,oasisFormat ) ) n = n.nextSibling(); @@ -1347,20 +1347,20 @@ bool MathML2KFormulaPrivate::isSpaceLike( QDomNode node, bool oasisFormat ) } -MathML2KFormula::MathML2KFormula( const QDomDocument& mmldoc, const ContextStyle &contextStyle, bool _oasisFormat ) +MathML2KFormula::MathML2KFormula( const TQDomDocument& mmldoc, const ContextStyle &contextStyle, bool _oasisFormat ) : m_error( false ), oasisFormat( _oasisFormat ), context( contextStyle ) { orig_element = mmldoc.documentElement(); done = false; } -MathML2KFormula::MathML2KFormula( const QDomElement& mmlelm, const ContextStyle &contextStyle, bool _oasisFormat ) +MathML2KFormula::MathML2KFormula( const TQDomElement& mmlelm, const ContextStyle &contextStyle, bool _oasisFormat ) : m_error( false ), orig_element( mmlelm ), oasisFormat( _oasisFormat ), context( contextStyle ) { done = false; } -QDomDocument MathML2KFormula::getKFormulaDom() +TQDomDocument MathML2KFormula::getKFormulaDom() { return formuladoc; } @@ -1372,7 +1372,7 @@ void MathML2KFormula::startConversion() //TODO:let it be async //kdDebug() << origdoc.toString() << endl; done = false; - formuladoc = QDomDocument( "KFORMULA" ); + formuladoc = TQDomDocument( "KFORMULA" ); impl = new MathML2KFormulaPrivate( this, context, formuladoc ); if ( orig_element.tagName() == "math" ) { impl->math( orig_element ); @@ -1386,15 +1386,15 @@ void MathML2KFormula::startConversion() done = true; } -bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode docnode ) +bool MathML2KFormula::processElement( TQDomNode node, TQDomDocument& doc, TQDomNode docnode ) { - //QDomElement *element; + //TQDomElement *element; Type type = UNKNOWN; if ( node.isElement() ) { - QDomElement element = node.toElement(); - QString tag = element.tagName(); + TQDomElement element = node.toElement(); + TQString tag = element.tagName(); if ( tag == "mi" ) { type = TOKEN; @@ -1472,16 +1472,16 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode // content markup (not yet complete) else if ( tag == "apply" ) { type = CONTENT; - QDomNode n = element.firstChild(); - QDomElement op = n.toElement(); + TQDomNode n = element.firstChild(); + TQDomElement op = n.toElement(); uint count = element.childNodes().count(); - //adding explicit brackets to replace "apply"s implicit ones - QDomElement brackets = doc.createElement("BRACKET"); + //adding explicit brackets to tqreplace "apply"s implicit ones + TQDomElement brackets = doc.createElement("BRACKET"); brackets.setAttribute("RIGHT", "41"); brackets.setAttribute("LEFT", "40"); - QDomElement content = doc.createElement("CONTENT"); + TQDomElement content = doc.createElement("CONTENT"); brackets.appendChild(content); - QDomElement base = doc.createElement("SEQUENCE"); + TQDomElement base = doc.createElement("SEQUENCE"); content.appendChild(base); docnode.appendChild(brackets); //Arithmetic, Algebra and Logic operators status @@ -1523,8 +1523,8 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode while ( !n.isNull() ) { if ( n.isElement() ) { if ( !first ) { - QDomElement text = doc.createElement( "TEXT" ); - QString value; + TQDomElement text = doc.createElement( "TEXT" ); + TQString value; if ( op.tagName() == "plus" ) value = "+"; @@ -1541,7 +1541,7 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode base.appendChild( text ); } first = false; - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); processElement( e, doc, base ); } n = n.nextSibling(); @@ -1549,7 +1549,7 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode } else if ( op.tagName() == "factorial" ) { - QDomElement e = n.nextSibling().toElement(); + TQDomElement e = n.nextSibling().toElement(); processElement( e, doc, docnode ); impl->createTextElements( "!", base ); } @@ -1557,11 +1557,11 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode n = n.nextSibling(); if ( count == 2 ) { // unary impl->createTextElements( "-", base ); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); processElement( e, doc, base ); } else if ( count == 3 ) { // binary - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); processElement( e, doc, base ); impl->createTextElements( "-", base ); n = n.nextSibling(); @@ -1572,7 +1572,7 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode else if ( op.tagName() == "divide" && count == 3 ) { n = n.nextSibling(); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); processElement( e, doc, base ); impl->createTextElements("/", base); n = n.nextSibling(); @@ -1582,15 +1582,15 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode else if ( op.tagName() == "power" && count == 3 ) { //code duplication of msub_sup(), but I can't find a way to cleanly call it n = n.nextSibling(); - QDomElement e = n.toElement(); - QDomElement index = doc.createElement("INDEX"); + TQDomElement e = n.toElement(); + TQDomElement index = doc.createElement("INDEX"); base.appendChild(index); - QDomElement content = doc.createElement("CONTENT"); + TQDomElement content = doc.createElement("CONTENT"); index.appendChild(content); - QDomElement sequence = doc.createElement("SEQUENCE"); + TQDomElement sequence = doc.createElement("SEQUENCE"); content.appendChild(sequence); processElement(e, doc, sequence); - QDomElement upper = doc.createElement("UPPERRIGHT"); + TQDomElement upper = doc.createElement("UPPERRIGHT"); index.appendChild(upper); sequence = doc.createElement("SEQUENCE"); upper.appendChild(sequence); @@ -1600,28 +1600,28 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode } else if ( op.tagName() == "abs" && count == 2) { n = n.nextSibling(); - QDomElement e = n.toElement(); - QDomElement bracket = doc.createElement("BRACKET"); + TQDomElement e = n.toElement(); + TQDomElement bracket = doc.createElement("BRACKET"); bracket.setAttribute("RIGHT", "257"); bracket.setAttribute("LEFT", "256"); base.appendChild(bracket); - QDomElement content = doc.createElement("CONTENT"); + TQDomElement content = doc.createElement("CONTENT"); bracket.appendChild(content); - QDomElement sequence = doc.createElement("SEQUENCE"); + TQDomElement sequence = doc.createElement("SEQUENCE"); content.appendChild(sequence); processElement(e, doc, sequence); } else if ( op.tagName() == "not" && count == 2) { n = n.nextSibling(); - QDomElement e = n.toElement(); - impl->createTextElements(QString(QChar(0xAC)), base); + TQDomElement e = n.toElement(); + impl->createTextElements(TQString(TQChar(0xAC)), base); processElement(e, doc, base); } else if ( op.tagName() == "implies" && count == 3 ) { n = n.nextSibling(); - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); processElement( e, doc, base ); - impl->createTextElements(QString(QChar(0x21D2)), base); + impl->createTextElements(TQString(TQChar(0x21D2)), base); n = n.nextSibling(); e = n.toElement(); processElement( e, doc, base ); @@ -1632,28 +1632,28 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode else if ( tag == "cn" ) { type = CONTENT; - QString type = element.attribute( "type", "real" ); + TQString type = element.attribute( "type", "real" ); if ( type == "real" || type == "constant" ) { impl->createTextElements( element.text().stripWhiteSpace(), docnode ); } else if ( type == "integer" ) { - QString base = element.attribute( "base" ); + TQString base = element.attribute( "base" ); if ( !base ) { impl->createTextElements( element.text().stripWhiteSpace(), docnode ); } else { - QDomElement index = doc.createElement( "INDEX" ); - QDomElement content = doc.createElement( "CONTENT" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement index = doc.createElement( "INDEX" ); + TQDomElement content = doc.createElement( "CONTENT" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); impl->createTextElements( element.text().stripWhiteSpace(), sequence ); content.appendChild( sequence ); index.appendChild( content ); - QDomElement lowerright = doc.createElement( "LOWERRIGHT" ); + TQDomElement lowerright = doc.createElement( "LOWERRIGHT" ); sequence = doc.createElement( "SEQUENCE" ); impl->createTextElements( base, sequence ); @@ -1665,7 +1665,7 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode } } else if ( type == "rational" ) { - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); impl->createTextElements( n.toText().data().stripWhiteSpace(), docnode ); @@ -1677,7 +1677,7 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode docnode ); } else if ( type == "complex-cartesian" ) { - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); impl->createTextElements( n.toText().data().stripWhiteSpace(), docnode ); @@ -1692,21 +1692,21 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode } else if ( type == "complex-polar" ) { - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); impl->createTextElements( n.toText().data().stripWhiteSpace(), docnode ); n = n.nextSibling(); // <sep/> - QDomElement index = doc.createElement( "INDEX" ); - QDomElement content = doc.createElement( "CONTENT" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); - QDomElement textelement = doc.createElement( "TEXT" ); + TQDomElement index = doc.createElement( "INDEX" ); + TQDomElement content = doc.createElement( "CONTENT" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement textelement = doc.createElement( "TEXT" ); textelement.setAttribute( "CHAR", "e" ); sequence.appendChild( textelement ); content.appendChild( sequence ); index.appendChild( content ); - QDomElement upperright = doc.createElement( "UPPERRIGHT" ); + TQDomElement upperright = doc.createElement( "UPPERRIGHT" ); sequence = doc.createElement( "SEQUENCE" ); textelement = doc.createElement( "TEXT" ); textelement.setAttribute( "CHAR", "i" ); @@ -1725,14 +1725,14 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode else if ( tag == "ci" ) { type = CONTENT; - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); if ( n.isText() ) { impl->createTextElements( n.toText().data().stripWhiteSpace(), docnode ); } else if ( n.isElement() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); processElement( e, doc, docnode ); } else if ( n.isEntityReference() ) { @@ -1746,25 +1746,25 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode else if ( tag == "list" ) { type = CONTENT; - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); - QDomElement bracket = doc.createElement( "BRACKET" ); + TQDomElement bracket = doc.createElement( "BRACKET" ); bracket.setAttribute( "LEFT", 91 ); // [ bracket.setAttribute( "RIGHT", 93 ); // ] - QDomElement content = doc.createElement( "CONTENT" ); - QDomElement sequence = doc.createElement( "SEQUENCE" ); + TQDomElement content = doc.createElement( "CONTENT" ); + TQDomElement sequence = doc.createElement( "SEQUENCE" ); bool first = true; while ( !n.isNull() ) { if ( n.isElement() ) { if ( !first ) { - QDomElement textelement = doc.createElement( "TEXT" ); + TQDomElement textelement = doc.createElement( "TEXT" ); textelement.setAttribute( "CHAR", "," ); sequence.appendChild( textelement ); } first = false; - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); processElement( e, doc, sequence ); } n = n.nextSibling(); @@ -1776,9 +1776,9 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode } } - if ( type == UNKNOWN && node.nodeType() != QDomNode::AttributeNode ) { + if ( type == UNKNOWN && node.nodeType() != TQDomNode::AttributeNode ) { kdDebug() << "Not an element: " << node.nodeName() << endl; - QDomNode n = node.firstChild(); + TQDomNode n = node.firstChild(); while ( !n.isNull() ) { processElement( n, doc, docnode ); n = n.nextSibling(); diff --git a/lib/kformula/kformulamathmlread.h b/lib/kformula/kformulamathmlread.h index 2a3cb2a5..2aad4d68 100644 --- a/lib/kformula/kformulamathmlread.h +++ b/lib/kformula/kformulamathmlread.h @@ -21,8 +21,8 @@ #ifndef KFORMULAMATHMLREAD_H #define KFORMULAMATHMLREAD_H -#include <qobject.h> -#include <qdom.h> +#include <tqobject.h> +#include <tqdom.h> #include "kformulainputfilter.h" #include "contextstyle.h" @@ -37,6 +37,7 @@ class MathML2KFormulaPrivate; class MathML2KFormula : public KFInputFilter { Q_OBJECT + TQ_OBJECT friend class MathML2KFormulaPrivate; @@ -48,18 +49,18 @@ public: * a conversionFinished() signal, then call * getKFormulaDom() to get the converted DOM */ - MathML2KFormula( const QDomDocument& mmldoc, const ContextStyle &contextStyle, bool oasisFormat = false ); + MathML2KFormula( const TQDomDocument& mmldoc, const ContextStyle &contextStyle, bool oasisFormat = false ); /** * Build a MathML 2 KFormula converter. * A DOM Element is required instead of a full Document, useful for embedded MathML */ - MathML2KFormula( const QDomElement& mmelm, const ContextStyle &contextStyle, bool oasisFormat = false ); + MathML2KFormula( const TQDomElement& mmelm, const ContextStyle &contextStyle, bool oasisFormat = false ); /* * Get the just created DOM. */ - virtual QDomDocument getKFormulaDom(); + virtual TQDomDocument getKFormulaDom(); public slots: @@ -71,11 +72,11 @@ public: private: - bool processElement( QDomNode node, QDomDocument& doc, - QDomNode docnode ); + bool processElement( TQDomNode node, TQDomDocument& doc, + TQDomNode docnode ); - QDomElement orig_element; - QDomDocument formuladoc; + TQDomElement orig_element; + TQDomDocument formuladoc; bool oasisFormat; const ContextStyle& context; diff --git a/lib/kformula/kformulamimesource.cc b/lib/kformula/kformulamimesource.cc index a0438e5e..af727959 100644 --- a/lib/kformula/kformulamimesource.cc +++ b/lib/kformula/kformulamimesource.cc @@ -20,12 +20,12 @@ #include <iostream> -#include <qpopupmenu.h> -#include <qbuffer.h> -#include <qcolor.h> -#include <qimage.h> -#include <qpainter.h> -#include <qpixmap.h> +#include <tqpopupmenu.h> +#include <tqbuffer.h> +#include <tqcolor.h> +#include <tqimage.h> +#include <tqpainter.h> +#include <tqpixmap.h> #include <kcommand.h> @@ -39,7 +39,7 @@ KFORMULA_NAMESPACE_BEGIN using namespace std; -MimeSource::MimeSource(Document* doc, const QDomDocument& formula) +MimeSource::MimeSource(Document* doc, const TQDomDocument& formula) : formulaDocument( doc ), document(formula) { // The query for text/plain comes very often. So make sure @@ -48,7 +48,7 @@ MimeSource::MimeSource(Document* doc, const QDomDocument& formula) rootElement = new FormulaElement(this); FormulaCursor cursor(rootElement); - QPtrList<BasicElement> list; + TQPtrList<BasicElement> list; list.setAutoDelete(true); if ( cursor.buildElementsFromDom( document.documentElement(), list ) ) { cursor.insert(list); @@ -87,27 +87,27 @@ const char* MimeSource::format( int n ) const bool MimeSource::provides( const char * format) const { //This is not completed - if(QString(format)==selectionMimeType()) + if(TQString(format)==selectionMimeType()) return true; - else if(QString(format)=="image/ppm") + else if(TQString(format)=="image/ppm") return true; - else if(QString(format)=="text/plain") + else if(TQString(format)=="text/plain") return true; - else if(QString(format)=="text/x-tex") + else if(TQString(format)=="text/x-tex") return true; else return false; } -QByteArray MimeSource::encodedData ( const char *format ) const +TQByteArray MimeSource::tqencodedData ( const char *format ) const { - QString fmt=format; //case sensitive? + TQString fmt=format; //case sensitive? if ((fmt=="text/plain") || (fmt=="text/x-tex")) return latexString; if (fmt==selectionMimeType()) { - QByteArray d=document.toCString(); + TQByteArray d=document.toCString(); d.truncate(d.size()-1); return d; } @@ -119,31 +119,31 @@ QByteArray MimeSource::encodedData ( const char *format ) const //context.setResolution(5, 5); rootElement->calcSizes(context); - QRect rect(rootElement->getX(), rootElement->getY(), + TQRect rect(rootElement->getX(), rootElement->getY(), rootElement->getWidth(), rootElement->getHeight()); - QPixmap pm( context.layoutUnitToPixelX( rootElement->getWidth() ), - context.layoutUnitToPixelY( rootElement->getHeight() ) ); + TQPixmap pm( context.tqlayoutUnitToPixelX( rootElement->getWidth() ), + context.tqlayoutUnitToPixelY( rootElement->getHeight() ) ); pm.fill(); - QPainter paint(&pm); + TQPainter paint(&pm); rootElement->draw(paint, rect, context); paint.end(); - QByteArray d; - QBuffer buff(d); + TQByteArray d; + TQBuffer buff(d); buff.open(IO_WriteOnly); - QImageIO io(&buff,"PPM"); - QImage ima=pm.convertToImage(); + TQImageIO io(&buff,"PPM"); + TQImage ima=pm.convertToImage(); ima.detach(); io.setImage(ima); if(!io.write()) - return QByteArray(); + return TQByteArray(); buff.close(); return d; } - return QByteArray(); + return TQByteArray(); } const SymbolTable& MimeSource::getSymbolTable() const diff --git a/lib/kformula/kformulamimesource.h b/lib/kformula/kformulamimesource.h index 5619e43b..a58255eb 100644 --- a/lib/kformula/kformulamimesource.h +++ b/lib/kformula/kformulamimesource.h @@ -21,8 +21,8 @@ #ifndef KFORMULAMIMESOURCE_H #define KFORMULAMIMESOURCE_H -#include <qmime.h> -#include <qdom.h> +#include <tqmime.h> +#include <tqdom.h> #include "kformulacontainer.h" #include <koffice_export.h> @@ -31,15 +31,15 @@ KFORMULA_NAMESPACE_BEGIN class FormulaElement; -class KOFORMULA_EXPORT MimeSource : public QMimeSource, public FormulaDocument +class KOFORMULA_EXPORT MimeSource : public TQMimeSource, public FormulaDocument { public: - MimeSource(Document* doc, const QDomDocument& formula); + MimeSource(Document* doc, const TQDomDocument& formula); ~MimeSource(); virtual const char* format ( int n = 0 ) const; virtual bool provides ( const char * ) const; - virtual QByteArray encodedData ( const char * ) const; + virtual TQByteArray tqencodedData ( const char * ) const; virtual const SymbolTable& getSymbolTable() const; @@ -49,8 +49,8 @@ private: Document* formulaDocument; - QDomDocument document; - QByteArray latexString; + TQDomDocument document; + TQByteArray latexString; FormulaElement* rootElement; }; diff --git a/lib/kformula/kformulaview.cc b/lib/kformula/kformulaview.cc index 543bc727..8099f633 100644 --- a/lib/kformula/kformulaview.cc +++ b/lib/kformula/kformulaview.cc @@ -20,8 +20,8 @@ #include <iostream> -#include <qpainter.h> -#include <qtimer.h> +#include <tqpainter.h> +#include <tqtimer.h> #include <kapplication.h> #include <kdebug.h> @@ -41,25 +41,25 @@ struct View::View_Impl { : smallCursor(false), activeCursor(true), cursorHasChanged(true), document(doc) { - connect(document, SIGNAL(elementWillVanish(BasicElement*)), - view, SLOT(slotElementWillVanish(BasicElement*))); - connect(document, SIGNAL(formulaLoaded(FormulaElement*)), - view, SLOT(slotFormulaLoaded(FormulaElement*))); - connect(document, SIGNAL(cursorMoved(FormulaCursor*)), - view, SLOT(slotCursorMoved(FormulaCursor*))); + connect(document, TQT_SIGNAL(elementWillVanish(BasicElement*)), + view, TQT_SLOT(slotElementWillVanish(BasicElement*))); + connect(document, TQT_SIGNAL(formulaLoaded(FormulaElement*)), + view, TQT_SLOT(slotFormulaLoaded(FormulaElement*))); + connect(document, TQT_SIGNAL(cursorMoved(FormulaCursor*)), + view, TQT_SLOT(slotCursorMoved(FormulaCursor*))); cursor = document->createCursor(); - blinkTimer = new QTimer( view ); - connect( blinkTimer, SIGNAL( timeout() ), - view, SLOT( slotBlinkCursor() ) ); - if ( QApplication::cursorFlashTime() > 0 ) - blinkTimer->start( QApplication::cursorFlashTime() / 2 ); + blinkTimer = new TQTimer( view ); + connect( blinkTimer, TQT_SIGNAL( timeout() ), + view, TQT_SLOT( slotBlinkCursor() ) ); + if ( TQApplication::cursorFlashTime() > 0 ) + blinkTimer->start( TQApplication::cursorFlashTime() / 2 ); } void startTimer() { - if ( QApplication::cursorFlashTime() > 0 ) - blinkTimer->start( QApplication::cursorFlashTime() / 2 ); + if ( TQApplication::cursorFlashTime() > 0 ) + blinkTimer->start( TQApplication::cursorFlashTime() / 2 ); } void stopTimer() @@ -95,7 +95,7 @@ struct View::View_Impl { /** * Timer for cursor blinking */ - QTimer *blinkTimer; + TQTimer *blinkTimer; /** * The formula we show. @@ -130,9 +130,9 @@ View::~View() } -QPoint View::getCursorPoint() const +TQPoint View::getCursorPoint() const { - return contextStyle().layoutUnitToPixel( cursor()->getCursorPoint() ); + return contextStyle().tqlayoutUnitToPixel( cursor()->getCursorPoint() ); } void View::setReadOnly(bool ro) @@ -147,7 +147,7 @@ void View::calcCursor() } -void View::draw(QPainter& painter, const QRect& rect, const QColorGroup& cg) +void View::draw(TQPainter& painter, const TQRect& rect, const TQColorGroup& cg) { // kdDebug( DEBUGID ) << "View::draw: " << rect.x() << " " << rect.y() << " " // << rect.width() << " " << rect.height() << endl; @@ -158,7 +158,7 @@ void View::draw(QPainter& painter, const QRect& rect, const QColorGroup& cg) } } -void View::draw(QPainter& painter, const QRect& rect) +void View::draw(TQPainter& painter, const TQRect& rect) { container()->draw( painter, rect, true ); if ( cursorVisible() ) { @@ -167,13 +167,13 @@ void View::draw(QPainter& painter, const QRect& rect) } } -void View::keyPressEvent( QKeyEvent* event ) +void View::keyPressEvent( TQKeyEvent* event ) { container()->input( event ); } -void View::focusInEvent(QFocusEvent*) +void View::focusInEvent(TQFocusEvent*) { //cursor()->calcCursorSize( contextStyle(), smallCursor() ); container()->setActiveCursor(cursor()); @@ -183,7 +183,7 @@ void View::focusInEvent(QFocusEvent*) emitCursorChanged(); } -void View::focusOutEvent(QFocusEvent*) +void View::focusOutEvent(TQFocusEvent*) { //container()->setActiveCursor(0); activeCursor() = false; @@ -192,96 +192,96 @@ void View::focusOutEvent(QFocusEvent*) emitCursorChanged(); } -void View::mousePressEvent( QMouseEvent* event ) +void View::mousePressEvent( TQMouseEvent* event ) { const ContextStyle& context = contextStyle(); mousePressEvent( event, context.pixelToLayoutUnit( event->pos() ) ); } -void View::mouseReleaseEvent( QMouseEvent* event ) +void View::mouseReleaseEvent( TQMouseEvent* event ) { const ContextStyle& context = contextStyle(); mouseReleaseEvent( event, context.pixelToLayoutUnit( event->pos() ) ); } -void View::mouseDoubleClickEvent( QMouseEvent* event ) +void View::mouseDoubleClickEvent( TQMouseEvent* event ) { const ContextStyle& context = contextStyle(); mouseDoubleClickEvent( event, context.pixelToLayoutUnit( event->pos() ) ); } -void View::mouseMoveEvent( QMouseEvent* event ) +void View::mouseMoveEvent( TQMouseEvent* event ) { const ContextStyle& context = contextStyle(); mouseMoveEvent( event, context.pixelToLayoutUnit( event->pos() ) ); } -void View::wheelEvent( QWheelEvent* event ) +void View::wheelEvent( TQWheelEvent* event ) { const ContextStyle& context = contextStyle(); wheelEvent( event, context.pixelToLayoutUnit( event->pos() ) ); } -void View::mousePressEvent( QMouseEvent* event, const PtPoint& pos ) +void View::mousePressEvent( TQMouseEvent* event, const PtPoint& pos ) { const ContextStyle& context = contextStyle(); mousePressEvent( event, context.ptToLayoutUnitPix( pos ) ); } -void View::mouseReleaseEvent( QMouseEvent* event, const PtPoint& pos ) +void View::mouseReleaseEvent( TQMouseEvent* event, const PtPoint& pos ) { const ContextStyle& context = contextStyle(); mouseReleaseEvent( event, context.ptToLayoutUnitPix( pos ) ); } -void View::mouseDoubleClickEvent( QMouseEvent* event, const PtPoint& pos ) +void View::mouseDoubleClickEvent( TQMouseEvent* event, const PtPoint& pos ) { const ContextStyle& context = contextStyle(); mouseDoubleClickEvent( event, context.ptToLayoutUnitPix( pos ) ); } -void View::mouseMoveEvent( QMouseEvent* event, const PtPoint& pos ) +void View::mouseMoveEvent( TQMouseEvent* event, const PtPoint& pos ) { const ContextStyle& context = contextStyle(); mouseMoveEvent( event, context.ptToLayoutUnitPix( pos ) ); } -void View::wheelEvent( QWheelEvent* event, const PtPoint& pos ) +void View::wheelEvent( TQWheelEvent* event, const PtPoint& pos ) { const ContextStyle& context = contextStyle(); wheelEvent( event, context.ptToLayoutUnitPix( pos ) ); } -void View::mousePressEvent( QMouseEvent* event, const LuPixelPoint& pos ) +void View::mousePressEvent( TQMouseEvent* event, const LuPixelPoint& pos ) { int flags = movementFlag( event->state() ); cursor()->mousePress( pos, flags ); emitCursorChanged(); } -void View::mouseReleaseEvent( QMouseEvent* event, const LuPixelPoint& pos ) +void View::mouseReleaseEvent( TQMouseEvent* event, const LuPixelPoint& pos ) { int flags = movementFlag( event->state() ); cursor()->mouseRelease( pos, flags ); emitCursorChanged(); } -void View::mouseDoubleClickEvent( QMouseEvent*, const LuPixelPoint& ) +void View::mouseDoubleClickEvent( TQMouseEvent*, const LuPixelPoint& ) { cursor()->moveRight( WordMovement ); cursor()->moveLeft( SelectMovement | WordMovement ); emitCursorChanged(); } -void View::mouseMoveEvent( QMouseEvent* event, const LuPixelPoint& pos ) +void View::mouseMoveEvent( TQMouseEvent* event, const LuPixelPoint& pos ) { int flags = movementFlag( event->state() ); cursor()->mouseMove( pos, flags ); emitCursorChanged(); } -void View::wheelEvent( QWheelEvent*, const LuPixelPoint& ) +void View::wheelEvent( TQWheelEvent*, const LuPixelPoint& ) { } @@ -378,7 +378,7 @@ void View::eraseSelection( Direction direction ) container()->performRequest( &r ); } -void View::addText( QString str ) +void View::addText( TQString str ) { TextRequest r( str ); container()->performRequest( &r ); diff --git a/lib/kformula/kformulaview.h b/lib/kformula/kformulaview.h index f93b491f..9562bbfe 100644 --- a/lib/kformula/kformulaview.h +++ b/lib/kformula/kformulaview.h @@ -21,14 +21,14 @@ #ifndef KFORMULAVIEW_H #define KFORMULAVIEW_H -#include <qevent.h> -#include <qobject.h> -#include <qrect.h> +#include <tqevent.h> +#include <tqobject.h> +#include <tqrect.h> #include "kformuladefs.h" #include "contextstyle.h" -class QColorGroup; +class TQColorGroup; KFORMULA_NAMESPACE_BEGIN @@ -47,8 +47,9 @@ class Container; * to be used alone if there is a bigger widget the formula * is to be drawn into. */ -class KOFORMULA_EXPORT View : public QObject { +class KOFORMULA_EXPORT View : public TQObject { Q_OBJECT + TQ_OBJECT public: @@ -58,41 +59,41 @@ public: /** * @returns the point inside the formula view where the cursor is. */ - QPoint getCursorPoint() const; + TQPoint getCursorPoint() const; /** * Puts the widget in read only mode. */ void setReadOnly(bool ro); - void mousePressEvent(QMouseEvent* event); - void mouseReleaseEvent(QMouseEvent* event); - void mouseDoubleClickEvent(QMouseEvent* event); - void mouseMoveEvent(QMouseEvent* event); - void wheelEvent(QWheelEvent* event); + void mousePressEvent(TQMouseEvent* event); + void mouseReleaseEvent(TQMouseEvent* event); + void mouseDoubleClickEvent(TQMouseEvent* event); + void mouseMoveEvent(TQMouseEvent* event); + void wheelEvent(TQWheelEvent* event); // the mouse event happened at a certain point - void mousePressEvent( QMouseEvent* event, const PtPoint& pos ); - void mouseReleaseEvent( QMouseEvent* event, const PtPoint& pos ); - void mouseDoubleClickEvent( QMouseEvent* event, const PtPoint& pos ); - void mouseMoveEvent( QMouseEvent* event, const PtPoint& pos ); - void wheelEvent( QWheelEvent* event, const PtPoint& pos ); + void mousePressEvent( TQMouseEvent* event, const PtPoint& pos ); + void mouseReleaseEvent( TQMouseEvent* event, const PtPoint& pos ); + void mouseDoubleClickEvent( TQMouseEvent* event, const PtPoint& pos ); + void mouseMoveEvent( TQMouseEvent* event, const PtPoint& pos ); + void wheelEvent( TQWheelEvent* event, const PtPoint& pos ); // the mouse event happened at a certain point - void mousePressEvent( QMouseEvent* event, const LuPixelPoint& pos ); - void mouseReleaseEvent( QMouseEvent* event, const LuPixelPoint& pos ); - void mouseDoubleClickEvent( QMouseEvent* event, const LuPixelPoint& pos ); - void mouseMoveEvent( QMouseEvent* event, const LuPixelPoint& pos ); - void wheelEvent( QWheelEvent* event, const LuPixelPoint& pos ); + void mousePressEvent( TQMouseEvent* event, const LuPixelPoint& pos ); + void mouseReleaseEvent( TQMouseEvent* event, const LuPixelPoint& pos ); + void mouseDoubleClickEvent( TQMouseEvent* event, const LuPixelPoint& pos ); + void mouseMoveEvent( TQMouseEvent* event, const LuPixelPoint& pos ); + void wheelEvent( TQWheelEvent* event, const LuPixelPoint& pos ); - void keyPressEvent(QKeyEvent* event); - virtual void focusInEvent(QFocusEvent* event); - virtual void focusOutEvent(QFocusEvent* event); + void keyPressEvent(TQKeyEvent* event); + virtual void focusInEvent(TQFocusEvent* event); + virtual void focusOutEvent(TQFocusEvent* event); void calcCursor(); - void draw(QPainter& painter, const QRect& rect, const QColorGroup& cg); - void draw(QPainter& painter, const QRect& rect); + void draw(TQPainter& painter, const TQRect& rect, const TQColorGroup& cg); + void draw(TQPainter& painter, const TQRect& rect); /** * The document we show. @@ -123,7 +124,7 @@ public: bool isEnd() const; void eraseSelection( Direction direction = beforeCursor ); - void addText( QString str ); + void addText( TQString str ); signals: @@ -140,7 +141,7 @@ protected slots: /** * The cursor has been moved by the container. - * We need to repaint if it was ours. + * We need to tqrepaint if it was ours. */ void slotCursorMoved(FormulaCursor* cursor); diff --git a/lib/kformula/kformulawidget.cc b/lib/kformula/kformulawidget.cc index 15295392..0de1ad7c 100644 --- a/lib/kformula/kformulawidget.cc +++ b/lib/kformula/kformulawidget.cc @@ -20,7 +20,7 @@ #include <iostream> -#include <qpainter.h> +#include <tqpainter.h> #include <kapplication.h> #include <kdebug.h> @@ -35,19 +35,19 @@ #include "kformulawidget.h" -KFormulaWidget::KFormulaWidget(Container* doc, QWidget* parent, const char* name, WFlags f) - : QWidget(parent, name, f | WRepaintNoErase | WResizeNoErase), +KFormulaWidget::KFormulaWidget(Container* doc, TQWidget* tqparent, const char* name, WFlags f) + : TQWidget(tqparent, name, f | WRepaintNoErase | WResizeNoErase), formulaView(doc) { - connect(doc, SIGNAL(formulaChanged(int, int)), - this, SLOT(slotFormulaChanged(int, int))); - connect(&formulaView, SIGNAL(cursorChanged(bool, bool)), - this, SLOT(slotCursorChanged(bool, bool))); + connect(doc, TQT_SIGNAL(formulaChanged(int, int)), + this, TQT_SLOT(slotFormulaChanged(int, int))); + connect(&formulaView, TQT_SIGNAL(cursorChanged(bool, bool)), + this, TQT_SLOT(slotCursorChanged(bool, bool))); - setFocusPolicy(QWidget::StrongFocus); - setBackgroundMode(NoBackground/*QWidget::PaletteBase*/); + setFocusPolicy(TQ_StrongFocus); + setBackgroundMode(NoBackground/*TQWidget::PaletteBase*/); - QRect rect = doc->boundingRect(); + TQRect rect = doc->boundingRect(); slotFormulaChanged(rect.width(), rect.height()); } @@ -56,7 +56,7 @@ KFormulaWidget::~KFormulaWidget() } -QPoint KFormulaWidget::getCursorPoint() const +TQPoint KFormulaWidget::getCursorPoint() const { return formulaView.getCursorPoint(); } @@ -67,58 +67,58 @@ void KFormulaWidget::setReadOnly(bool ro) } -void KFormulaWidget::paintEvent(QPaintEvent* event) +void KFormulaWidget::paintEvent(TQPaintEvent* event) { - // Always repaint the buffer. This is not so much more work - // than it seems to be as each cursor movement requires a repaint. - QPainter p( &buffer ); + // Always tqrepaint the buffer. This is not so much more work + // than it seems to be as each cursor movement requires a tqrepaint. + TQPainter p( &buffer ); //p.translate( -fr.x(), -fr.y() ); - formulaView.draw( p, event->rect(), colorGroup() ); + formulaView.draw( p, event->rect(), tqcolorGroup() ); - QPainter painter; + TQPainter painter; painter.begin(this); painter.drawPixmap( event->rect().x(), event->rect().y(), buffer, event->rect().x(), event->rect().y(), event->rect().width(), event->rect().height() ); painter.end(); } -void KFormulaWidget::keyPressEvent(QKeyEvent* event) +void KFormulaWidget::keyPressEvent(TQKeyEvent* event) { formulaView.keyPressEvent(event); } -void KFormulaWidget::focusInEvent(QFocusEvent* event) +void KFormulaWidget::focusInEvent(TQFocusEvent* event) { formulaView.focusInEvent(event); } -void KFormulaWidget::focusOutEvent(QFocusEvent* event) +void KFormulaWidget::focusOutEvent(TQFocusEvent* event) { formulaView.focusOutEvent(event); } -void KFormulaWidget::mousePressEvent(QMouseEvent* event) +void KFormulaWidget::mousePressEvent(TQMouseEvent* event) { formulaView.mousePressEvent(event); } -void KFormulaWidget::mouseReleaseEvent(QMouseEvent* event) +void KFormulaWidget::mouseReleaseEvent(TQMouseEvent* event) { formulaView.mouseReleaseEvent(event); } -void KFormulaWidget::mouseDoubleClickEvent(QMouseEvent* event) +void KFormulaWidget::mouseDoubleClickEvent(TQMouseEvent* event) { formulaView.mouseDoubleClickEvent(event); } -void KFormulaWidget::mouseMoveEvent(QMouseEvent* event) +void KFormulaWidget::mouseMoveEvent(TQMouseEvent* event) { formulaView.mouseMoveEvent(event); } -void KFormulaWidget::wheelEvent(QWheelEvent* event) +void KFormulaWidget::wheelEvent(TQWheelEvent* event) { formulaView.wheelEvent(event); } @@ -128,7 +128,7 @@ void KFormulaWidget::slotFormulaChanged(int width, int height) // Magic numbers just to see the cursor. resize(width + 5, height + 5); buffer.resize(width + 5, height + 5); - // repaint is needed even if the size doesn't change. + // tqrepaint is needed even if the size doesn't change. //update(); } diff --git a/lib/kformula/kformulawidget.h b/lib/kformula/kformulawidget.h index 99079e1d..ead28ddc 100644 --- a/lib/kformula/kformulawidget.h +++ b/lib/kformula/kformulawidget.h @@ -21,10 +21,10 @@ #ifndef KFORMULAWIDGET_H #define KFORMULAWIDGET_H -#include <qdom.h> -#include <qpixmap.h> -#include <qpoint.h> -#include <qwidget.h> +#include <tqdom.h> +#include <tqpixmap.h> +#include <tqpoint.h> +#include <tqwidget.h> #include "kformuladefs.h" #include "kformulaview.h" @@ -45,18 +45,19 @@ using namespace KFormula; * The view. A widget that shows the formula. There are methods * to move the cursor around. To edit the formula use the document. */ -class KFormulaWidget : public QWidget { +class KFormulaWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: - KFormulaWidget(Container*, QWidget* parent=0, const char* name=0, WFlags f=0); + KFormulaWidget(Container*, TQWidget* tqparent=0, const char* name=0, WFlags f=0); ~KFormulaWidget(); /** * @returns the point inside the formula widget where the cursor is. */ - QPoint getCursorPoint() const; + TQPoint getCursorPoint() const; /** * Puts the widget in read only mode. @@ -85,16 +86,16 @@ protected slots: protected: - virtual void mousePressEvent(QMouseEvent* event); - virtual void mouseReleaseEvent(QMouseEvent* event); - virtual void mouseDoubleClickEvent(QMouseEvent* event); - virtual void mouseMoveEvent(QMouseEvent* event); - virtual void wheelEvent(QWheelEvent* event); + virtual void mousePressEvent(TQMouseEvent* event); + virtual void mouseReleaseEvent(TQMouseEvent* event); + virtual void mouseDoubleClickEvent(TQMouseEvent* event); + virtual void mouseMoveEvent(TQMouseEvent* event); + virtual void wheelEvent(TQWheelEvent* event); - virtual void paintEvent(QPaintEvent* event); - virtual void keyPressEvent(QKeyEvent* event); - virtual void focusInEvent(QFocusEvent* event); - virtual void focusOutEvent(QFocusEvent* event); + virtual void paintEvent(TQPaintEvent* event); + virtual void keyPressEvent(TQKeyEvent* event); + virtual void focusInEvent(TQFocusEvent* event); + virtual void focusOutEvent(TQFocusEvent* event); /** * The document we show. @@ -113,7 +114,7 @@ private: */ View formulaView; - QPixmap buffer; + TQPixmap buffer; }; #endif // KFORMULAWIDGET_H diff --git a/lib/kformula/main.cc b/lib/kformula/main.cc index bbab2bbb..dde69731 100644 --- a/lib/kformula/main.cc +++ b/lib/kformula/main.cc @@ -2,17 +2,17 @@ #include <iostream> #include <memory> -#include <qaccel.h> -#include <qdom.h> -#include <qfile.h> -#include <qlayout.h> -#include <qptrlist.h> -#include <qmainwindow.h> -#include <qpainter.h> -#include <qstring.h> -#include <qtextstream.h> -#include <qwidget.h> -#include <qfileinfo.h> +#include <tqaccel.h> +#include <tqdom.h> +#include <tqfile.h> +#include <tqlayout.h> +#include <tqptrlist.h> +#include <tqmainwindow.h> +#include <tqpainter.h> +#include <tqstring.h> +#include <tqtextstream.h> +#include <tqwidget.h> +#include <tqfileinfo.h> #include <kapplication.h> #include <kaboutdata.h> @@ -33,44 +33,44 @@ using namespace KFormula; class TestWidget : public KFormulaWidget { public: - TestWidget(Container* doc, QWidget* parent=0, const char* name=0, WFlags f=0) - : KFormulaWidget(doc, parent, name, f) {} + TestWidget(Container* doc, TQWidget* tqparent=0, const char* name=0, WFlags f=0) + : KFormulaWidget(doc, tqparent, name, f) {} protected: - virtual void keyPressEvent(QKeyEvent* event); + virtual void keyPressEvent(TQKeyEvent* event); private: }; -void save( const QString &filename, const QDomDocument& doc ) +void save( const TQString &filename, const TQDomDocument& doc ) { - QFile f( filename ); + TQFile f( filename ); if(!f.open(IO_Truncate | IO_ReadWrite)) { kdWarning( DEBUGID ) << "Error opening file " << filename.latin1() << endl; return; } - QTextStream stream(&f); - stream.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream stream(&f); + stream.setEncoding(TQTextStream::UnicodeUTF8); doc.save(stream, 2); f.close(); } -void load( KFormula::Document* document, const QString &filename ) +void load( KFormula::Document* document, const TQString &filename ) { - QFile f(filename); + TQFile f(filename); if (!f.open(IO_ReadOnly)) { kdWarning( DEBUGID ) << "Error opening file " << filename.latin1() << endl; return; } - QTextStream stream(&f); - stream.setEncoding(QTextStream::UnicodeUTF8); - QString content = stream.read(); + TQTextStream stream(&f); + stream.setEncoding(TQTextStream::UnicodeUTF8); + TQString content = stream.read(); f.close(); //kdDebug( DEBUGID ) << content << endl; - QDomDocument doc; + TQDomDocument doc; if ( !doc.setContent( content ) ) { return; } @@ -80,34 +80,34 @@ void load( KFormula::Document* document, const QString &filename ) } -void saveMathML( KFormula::Container* formula, const QString &filename, bool oasisFormat ) +void saveMathML( KFormula::Container* formula, const TQString &filename, bool oasisFormat ) { - QFile f( filename ); + TQFile f( filename ); if ( !f.open( IO_Truncate | IO_ReadWrite ) ) { kdWarning( DEBUGID ) << "Error opening file " << filename.latin1() << endl; return; } - QTextStream stream( &f ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream stream( &f ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); formula->saveMathML( stream, oasisFormat ); f.close(); } -void loadMathML( KFormula::Container* formula, const QString &filename ) +void loadMathML( KFormula::Container* formula, const TQString &filename ) { - QFile f( filename ); + TQFile f( filename ); if ( !f.open( IO_ReadOnly ) ) { kdWarning( DEBUGID ) << "Error opening file " << filename.latin1() << endl; return; } - QTextStream stream( &f ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); - QString content = stream.read(); + TQTextStream stream( &f ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); + TQString content = stream.read(); - QDomDocument doc; - QString errorMsg; + TQDomDocument doc; + TQString errorMsg; int errorLine; int errorColumn; if ( !doc.setContent( content, true, @@ -129,7 +129,7 @@ void loadMathML( KFormula::Container* formula, const QString &filename ) } -void TestWidget::keyPressEvent(QKeyEvent* event) +void TestWidget::keyPressEvent(TQKeyEvent* event) { Container* document = getDocument(); @@ -137,19 +137,19 @@ void TestWidget::keyPressEvent(QKeyEvent* event) int state = event->state(); //MoveFlag flag = movementFlag(state); - if ( ( state & Qt::ShiftButton ) && ( state & Qt::ControlButton ) ) { + if ( ( state & TQt::ShiftButton ) && ( state & TQt::ControlButton ) ) { switch (event->key()) { - case Qt::Key_B: document->document()->wrapper()->appendColumn(); return; - case Qt::Key_I: document->document()->wrapper()->insertColumn(); return; - case Qt::Key_R: document->document()->wrapper()->removeColumn(); return; - case Qt::Key_Z: document->document()->wrapper()->redo(); return; - case Qt::Key_F: saveMathML( document, "test.mml", true/*save to oasis format*/ ); return; - case Qt::Key_M: saveMathML( document, "test.mml", false ); return; - case Qt::Key_O: { - QString file = KFileDialog::getOpenFileName(); + case TQt::Key_B: document->document()->wrapper()->appendColumn(); return; + case TQt::Key_I: document->document()->wrapper()->insertColumn(); return; + case TQt::Key_R: document->document()->wrapper()->removeColumn(); return; + case TQt::Key_Z: document->document()->wrapper()->redo(); return; + case TQt::Key_F: saveMathML( document, "test.mml", true/*save to oasis format*/ ); return; + case TQt::Key_M: saveMathML( document, "test.mml", false ); return; + case TQt::Key_O: { + TQString file = KFileDialog::getOpenFileName(); kdDebug( DEBUGID ) << file << endl; if( !file.isEmpty() ) { - QFileInfo fi( file ); + TQFileInfo fi( file ); if ( fi.extension() == "mml" ) { loadMathML( document, file ); } @@ -161,35 +161,35 @@ void TestWidget::keyPressEvent(QKeyEvent* event) } } } - else if (state & Qt::ControlButton) { + else if (state & TQt::ControlButton) { switch (event->key()) { - case Qt::Key_1: document->document()->wrapper()->addSum(); return; - case Qt::Key_2: document->document()->wrapper()->addProduct(); return; - case Qt::Key_3: document->document()->wrapper()->addIntegral(); return; - case Qt::Key_4: document->document()->wrapper()->addRoot(); return; - case Qt::Key_5: document->document()->wrapper()->addFraction(); return; - case Qt::Key_6: document->document()->wrapper()->addMatrix(); return; - case Qt::Key_7: document->document()->wrapper()->addOneByTwoMatrix(); return; - case Qt::Key_8: document->document()->wrapper()->addOverline(); return; - case Qt::Key_9: document->document()->wrapper()->addUnderline(); return; - case Qt::Key_A: slotSelectAll(); return; - case Qt::Key_B: document->document()->wrapper()->appendRow(); return; - case Qt::Key_C: document->document()->wrapper()->copy(); return; - case Qt::Key_D: document->document()->wrapper()->removeEnclosing(); return; - case Qt::Key_G: document->document()->wrapper()->makeGreek(); return; - case Qt::Key_I: document->document()->wrapper()->insertRow(); return; - case Qt::Key_R: document->document()->wrapper()->removeRow(); return; - case Qt::Key_K: document->document()->wrapper()->addMultiline(); return; - case Qt::Key_L: document->document()->wrapper()->addGenericLowerIndex(); return; - case Qt::Key_M: loadMathML( document, "test.mml" ); return; - case Qt::Key_O: load( document->document(), "test.xml" ); return; - case Qt::Key_Q: kapp->quit(); return; - case Qt::Key_S: save( "test.xml", document->document()->saveXML() ); return; - case Qt::Key_T: std::cout << document->texString().latin1() << std::endl; return; - case Qt::Key_U: document->document()->wrapper()->addGenericUpperIndex(); return; - case Qt::Key_V: document->document()->wrapper()->paste(); return; - case Qt::Key_X: document->document()->wrapper()->cut(); return; - case Qt::Key_Z: document->document()->wrapper()->undo(); return; + case TQt::Key_1: document->document()->wrapper()->addSum(); return; + case TQt::Key_2: document->document()->wrapper()->addProduct(); return; + case TQt::Key_3: document->document()->wrapper()->addIntegral(); return; + case TQt::Key_4: document->document()->wrapper()->addRoot(); return; + case TQt::Key_5: document->document()->wrapper()->addFraction(); return; + case TQt::Key_6: document->document()->wrapper()->addMatrix(); return; + case TQt::Key_7: document->document()->wrapper()->addOneByTwoMatrix(); return; + case TQt::Key_8: document->document()->wrapper()->addOverline(); return; + case TQt::Key_9: document->document()->wrapper()->addUnderline(); return; + case TQt::Key_A: slotSelectAll(); return; + case TQt::Key_B: document->document()->wrapper()->appendRow(); return; + case TQt::Key_C: document->document()->wrapper()->copy(); return; + case TQt::Key_D: document->document()->wrapper()->removeEnclosing(); return; + case TQt::Key_G: document->document()->wrapper()->makeGreek(); return; + case TQt::Key_I: document->document()->wrapper()->insertRow(); return; + case TQt::Key_R: document->document()->wrapper()->removeRow(); return; + case TQt::Key_K: document->document()->wrapper()->addMultiline(); return; + case TQt::Key_L: document->document()->wrapper()->addGenericLowerIndex(); return; + case TQt::Key_M: loadMathML( document, "test.mml" ); return; + case TQt::Key_O: load( document->document(), "test.xml" ); return; + case TQt::Key_Q: kapp->quit(); return; + case TQt::Key_S: save( "test.xml", document->document()->saveXML() ); return; + case TQt::Key_T: std::cout << document->texString().latin1() << std::endl; return; + case TQt::Key_U: document->document()->wrapper()->addGenericUpperIndex(); return; + case TQt::Key_V: document->document()->wrapper()->paste(); return; + case TQt::Key_X: document->document()->wrapper()->cut(); return; + case TQt::Key_Z: document->document()->wrapper()->undo(); return; default: //std::cerr << "Key: " << event->key() << std::endl; break; @@ -201,19 +201,19 @@ void TestWidget::keyPressEvent(QKeyEvent* event) ScrollView::ScrollView() - : QScrollView(), child(0) + : TQScrollView(), child(0) { } void ScrollView::addChild(KFormulaWidget* c, int x, int y) { - QScrollView::addChild(c, x, y); + TQScrollView::addChild(c, x, y); child = c; - connect(child, SIGNAL(cursorChanged(bool, bool)), - this, SLOT(cursorChanged(bool, bool))); + connect(child, TQT_SIGNAL(cursorChanged(bool, bool)), + this, TQT_SLOT(cursorChanged(bool, bool))); } -void ScrollView::focusInEvent(QFocusEvent*) +void ScrollView::focusInEvent(TQFocusEvent*) { if (child != 0) child->setFocus(); } @@ -246,7 +246,7 @@ int main(int argc, char** argv) KApplication app; - app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit())); + app.connect(&app, TQT_SIGNAL(lastWindowClosed()), &app, TQT_SLOT(quit())); DocumentWrapper* wrapper = new DocumentWrapper( kapp->config(), 0 ); Document* document = new Document; @@ -263,7 +263,7 @@ int main(int argc, char** argv) KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); for ( int i = 0; i < args->count(); ++i ) { - QFileInfo fi( args->url( i ).path() ); + TQFileInfo fi( args->url( i ).path() ); if ( fi.extension() == "mml" ) loadMathML( container1, args->url( i ).path() ); else if ( fi.extension() == "xml" ) @@ -277,7 +277,7 @@ int main(int argc, char** argv) // Make sure there are no elements in the clipboard. // Okey for a debug app. - QApplication::clipboard()->clear(); + TQApplication::tqclipboard()->clear(); int destruct = BasicElement::getEvilDestructionCount(); if (destruct != 0) { diff --git a/lib/kformula/matrixelement.cc b/lib/kformula/matrixelement.cc index 88a59081..b8abd22b 100644 --- a/lib/kformula/matrixelement.cc +++ b/lib/kformula/matrixelement.cc @@ -18,9 +18,9 @@ * Boston, MA 02110-1301, USA. */ -#include <qmemarray.h> -#include <qpainter.h> -#include <qptrlist.h> +#include <tqmemarray.h> +#include <tqpainter.h> +#include <tqptrlist.h> #include <kdebug.h> #include <klocale.h> @@ -43,7 +43,7 @@ class MatrixSequenceElement : public SequenceElement { typedef SequenceElement inherited; public: - MatrixSequenceElement( BasicElement* parent = 0 ) : SequenceElement( parent ) {} + MatrixSequenceElement( BasicElement* tqparent = 0 ) : SequenceElement( tqparent ) {} virtual MatrixSequenceElement* clone() { return new MatrixSequenceElement( *this ); } @@ -62,7 +62,7 @@ public: class KFCRemoveRow : public Command { public: - KFCRemoveRow( const QString& name, Container* document, MatrixElement* m, uint r, uint c ); + KFCRemoveRow( const TQString& name, Container* document, MatrixElement* m, uint r, uint c ); ~KFCRemoveRow(); virtual void execute(); @@ -73,13 +73,13 @@ protected: uint rowPos; uint colPos; - QPtrList<MatrixSequenceElement>* row; + TQPtrList<MatrixSequenceElement>* row; }; class KFCInsertRow : public KFCRemoveRow { public: - KFCInsertRow( const QString& name, Container* document, MatrixElement* m, uint r, uint c ); + KFCInsertRow( const TQString& name, Container* document, MatrixElement* m, uint r, uint c ); virtual void execute() { KFCRemoveRow::unexecute(); } virtual void unexecute() { KFCRemoveRow::execute(); } @@ -88,7 +88,7 @@ public: class KFCRemoveColumn : public Command { public: - KFCRemoveColumn( const QString& name, Container* document, MatrixElement* m, uint r, uint c ); + KFCRemoveColumn( const TQString& name, Container* document, MatrixElement* m, uint r, uint c ); ~KFCRemoveColumn(); virtual void execute(); @@ -99,13 +99,13 @@ protected: uint rowPos; uint colPos; - QPtrList<MatrixSequenceElement>* column; + TQPtrList<MatrixSequenceElement>* column; }; class KFCInsertColumn : public KFCRemoveColumn { public: - KFCInsertColumn( const QString& name, Container* document, MatrixElement* m, uint r, uint c ); + KFCInsertColumn( const TQString& name, Container* document, MatrixElement* m, uint r, uint c ); virtual void execute() { KFCRemoveColumn::unexecute(); } virtual void unexecute() { KFCRemoveColumn::execute(); } @@ -166,7 +166,7 @@ KCommand* MatrixSequenceElement::buildCommand( Container* container, Request* re } -KFCRemoveRow::KFCRemoveRow( const QString& name, Container* document, MatrixElement* m, uint r, uint c ) +KFCRemoveRow::KFCRemoveRow( const TQString& name, Container* document, MatrixElement* m, uint r, uint c ) : Command( name, document ), matrix( m ), rowPos( r ), colPos( c ), row( 0 ) { } @@ -206,10 +206,10 @@ void KFCRemoveRow::unexecute() } -KFCInsertRow::KFCInsertRow( const QString& name, Container* document, MatrixElement* m, uint r, uint c ) +KFCInsertRow::KFCInsertRow( const TQString& name, Container* document, MatrixElement* m, uint r, uint c ) : KFCRemoveRow( name, document, m, r, c ) { - row = new QPtrList< MatrixSequenceElement >; + row = new TQPtrList< MatrixSequenceElement >; row->setAutoDelete( true ); for ( uint i = 0; i < matrix->getColumns(); i++ ) { row->append( new MatrixSequenceElement( matrix ) ); @@ -217,10 +217,10 @@ KFCInsertRow::KFCInsertRow( const QString& name, Container* document, MatrixElem } -KFCRemoveColumn::KFCRemoveColumn( const QString& name, Container* document, MatrixElement* m, uint r, uint c ) +KFCRemoveColumn::KFCRemoveColumn( const TQString& name, Container* document, MatrixElement* m, uint r, uint c ) : Command( name, document ), matrix( m ), rowPos( r ), colPos( c ) { - column = new QPtrList< MatrixSequenceElement >; + column = new TQPtrList< MatrixSequenceElement >; column->setAutoDelete( true ); } @@ -260,7 +260,7 @@ void KFCRemoveColumn::unexecute() } -KFCInsertColumn::KFCInsertColumn( const QString& name, Container* document, MatrixElement* m, uint r, uint c ) +KFCInsertColumn::KFCInsertColumn( const TQString& name, Container* document, MatrixElement* m, uint r, uint c ) : KFCRemoveColumn( name, document, m, r, c ) { for ( uint i = 0; i < matrix->getRows(); i++ ) { @@ -269,8 +269,8 @@ KFCInsertColumn::KFCInsertColumn( const QString& name, Container* document, Matr } -MatrixElement::MatrixElement(uint rows, uint columns, BasicElement* parent) - : BasicElement(parent), +MatrixElement::MatrixElement(uint rows, uint columns, BasicElement* tqparent) + : BasicElement(tqparent), m_rowNumber( 0 ), m_align( NoAlign ), m_widthType( NoSize ), @@ -284,7 +284,7 @@ MatrixElement::MatrixElement(uint rows, uint columns, BasicElement* parent) m_customDisplayStyle( false ) { for (uint r = 0; r < rows; r++) { - QPtrList< MatrixSequenceElement >* list = new QPtrList< MatrixSequenceElement >; + TQPtrList< MatrixSequenceElement >* list = new TQPtrList< MatrixSequenceElement >; list->setAutoDelete(true); for (uint c = 0; c < columns; c++) { list->append(new MatrixSequenceElement(this)); @@ -305,12 +305,12 @@ MatrixElement::MatrixElement( const MatrixElement& other ) uint rows = other.getRows(); uint columns = other.getColumns(); - QPtrListIterator< QPtrList< MatrixSequenceElement > > rowIter( other.content ); + TQPtrListIterator< TQPtrList< MatrixSequenceElement > > rowIter( other.content ); for (uint r = 0; r < rows; r++) { ++rowIter; - QPtrListIterator< MatrixSequenceElement > colIter( *rowIter.current() ); + TQPtrListIterator< MatrixSequenceElement > colIter( *rowIter.current() ); - QPtrList< MatrixSequenceElement >* list = new QPtrList< MatrixSequenceElement >; + TQPtrList< MatrixSequenceElement >* list = new TQPtrList< MatrixSequenceElement >; list->setAutoDelete(true); for (uint c = 0; c < columns; c++) { ++colIter; @@ -339,12 +339,12 @@ void MatrixElement::entered( SequenceElement* /*child*/ ) BasicElement* MatrixElement::goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ) + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ) { - BasicElement* e = BasicElement::goToPos(cursor, handled, point, parentOrigin); + BasicElement* e = BasicElement::goToPos(cursor, handled, point, tqparentOrigin); if (e != 0) { - LuPixelPoint myPos(parentOrigin.x() + getX(), - parentOrigin.y() + getY()); + LuPixelPoint myPos(tqparentOrigin.x() + getX(), + tqparentOrigin.y() + getY()); uint rows = getRows(); uint columns = getColumns(); @@ -430,16 +430,16 @@ BasicElement* MatrixElement::goToPos( FormulaCursor* cursor, bool& handled, /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ void MatrixElement::calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style ) { - QMemArray<luPixel> toMidlines(getRows()); - QMemArray<luPixel> fromMidlines(getRows()); - QMemArray<luPixel> widths(getColumns()); + TQMemArray<luPixel> toMidlines(getRows()); + TQMemArray<luPixel> fromMidlines(getRows()); + TQMemArray<luPixel> widths(getColumns()); toMidlines.fill(0); fromMidlines.fill(0); @@ -453,14 +453,14 @@ void MatrixElement::calcSizes( const ContextStyle& context, double factor = style.sizeFactor(); for (uint r = 0; r < rows; r++) { - QPtrList< MatrixSequenceElement >* list = content.at(r); + TQPtrList< MatrixSequenceElement >* list = content.at(r); for (uint c = 0; c < columns; c++) { SequenceElement* element = list->at(c); element->calcSizes( context, i_tstyle, i_istyle, style ); - toMidlines[r] = QMAX(toMidlines[r], element->axis( context, i_tstyle, factor )); - fromMidlines[r] = QMAX(fromMidlines[r], + toMidlines[r] = TQMAX(toMidlines[r], element->axis( context, i_tstyle, factor )); + fromMidlines[r] = TQMAX(fromMidlines[r], element->getHeight()-element->axis( context, i_tstyle, factor )); - widths[c] = QMAX(widths[c], element->getWidth()); + widths[c] = TQMAX(widths[c], element->getWidth()); } } @@ -469,7 +469,7 @@ void MatrixElement::calcSizes( const ContextStyle& context, luPixel yPos = 0; for (uint r = 0; r < rows; r++) { - QPtrList< MatrixSequenceElement >* list = content.at(r); + TQPtrList< MatrixSequenceElement >* list = content.at(r); luPixel xPos = 0; yPos += toMidlines[r]; for (uint c = 0; c < columns; c++) { @@ -508,18 +508,18 @@ void MatrixElement::calcSizes( const ContextStyle& context, } /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ -void MatrixElement::draw( QPainter& painter, const LuPixelRect& rect, +void MatrixElement::draw( TQPainter& painter, const LuPixelRect& rect, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ) + const LuPixelPoint& tqparentOrigin ) { - LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); + LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( rect ) ) // return; @@ -537,7 +537,7 @@ void MatrixElement::draw( QPainter& painter, const LuPixelRect& rect, } // Debug - //painter.setPen(Qt::red); + //painter.setPen(TQt::red); //painter.drawRect(myPos.x(), myPos.y(), getWidth(), getHeight()); } @@ -730,12 +730,12 @@ void MatrixElement::selectChild(FormulaCursor* cursor, BasicElement* child) const MatrixSequenceElement* MatrixElement::getElement( uint row, uint column ) const { - QPtrListIterator< QPtrList < MatrixSequenceElement > > rows( content ); + TQPtrListIterator< TQPtrList < MatrixSequenceElement > > rows( content ); rows += row; if ( ! rows.current() ) return 0; - QPtrListIterator< MatrixSequenceElement > cols ( *rows.current() ); + TQPtrListIterator< MatrixSequenceElement > cols ( *rows.current() ); cols += column; return cols.current(); } @@ -761,7 +761,7 @@ bool MatrixElement::searchElement(BasicElement* element, uint& row, uint& column /** * Appends our attributes to the dom element. */ -void MatrixElement::writeDom(QDomElement element) +void MatrixElement::writeDom(TQDomElement element) { BasicElement::writeDom(element); @@ -771,11 +771,11 @@ void MatrixElement::writeDom(QDomElement element) element.setAttribute("ROWS", rows); element.setAttribute("COLUMNS", cols); - QDomDocument doc = element.ownerDocument(); + TQDomDocument doc = element.ownerDocument(); for (uint r = 0; r < rows; r++) { for (uint c = 0; c < cols; c++) { - QDomElement tmp = getElement(r,c)->getElementDom(doc); + TQDomElement tmp = getElement(r,c)->getElementDom(doc); element.appendChild(tmp); } element.appendChild(doc.createComment("end of row")); @@ -786,13 +786,13 @@ void MatrixElement::writeDom(QDomElement element) * Reads our attributes from the element. * Returns false if it failed. */ -bool MatrixElement::readAttributesFromDom(QDomElement element) +bool MatrixElement::readAttributesFromDom(TQDomElement element) { if (!BasicElement::readAttributesFromDom(element)) { return false; } uint rows = 0; - QString rowStr = element.attribute("ROWS"); + TQString rowStr = element.attribute("ROWS"); if(!rowStr.isNull()) { rows = rowStr.toInt(); } @@ -801,7 +801,7 @@ bool MatrixElement::readAttributesFromDom(QDomElement element) return false; } - QString columnStr = element.attribute("COLUMNS"); + TQString columnStr = element.attribute("COLUMNS"); uint cols = 0; if(!columnStr.isNull()) { cols = columnStr.toInt(); @@ -813,7 +813,7 @@ bool MatrixElement::readAttributesFromDom(QDomElement element) content.clear(); for (uint r = 0; r < rows; r++) { - QPtrList< MatrixSequenceElement >* list = new QPtrList< MatrixSequenceElement >; + TQPtrList< MatrixSequenceElement >* list = new TQPtrList< MatrixSequenceElement >; list->setAutoDelete(true); content.append(list); for (uint c = 0; c < cols; c++) { @@ -829,7 +829,7 @@ bool MatrixElement::readAttributesFromDom(QDomElement element) * that needs to be read. * Returns false if it failed. */ -bool MatrixElement::readContentFromDom(QDomNode& node) +bool MatrixElement::readContentFromDom(TQDomNode& node) { if (!BasicElement::readContentFromDom(node)) { return false; @@ -843,7 +843,7 @@ bool MatrixElement::readContentFromDom(QDomNode& node) while ( !node.isNull() && r < rows ) { if ( node.isElement() ) { SequenceElement* element = getElement( r, c ); - QDomElement e = node.toElement(); + TQDomElement e = node.toElement(); if ( !element->buildFromDom( e ) ) { return false; } @@ -858,38 +858,38 @@ bool MatrixElement::readContentFromDom(QDomNode& node) return true; } -bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) +bool MatrixElement::readAttributesFromMathMLDom( const TQDomElement& element ) { if ( ! BasicElement::readAttributesFromMathMLDom( element ) ) { return false; } - QString alignStr = element.attribute( "align" ).lower(); + TQString alignStr = element.attribute( "align" ).lower(); if ( ! alignStr.isNull() ) { - if ( alignStr.find( "top" ) != -1 ) { + if ( alignStr.tqfind( "top" ) != -1 ) { m_align = TopAlign; } - else if ( alignStr.find( "bottom" ) != -1 ) { + else if ( alignStr.tqfind( "bottom" ) != -1 ) { m_align = BottomAlign; } - else if ( alignStr.find( "center" ) != -1 ) { + else if ( alignStr.tqfind( "center" ) != -1 ) { m_align = CenterAlign; } - else if ( alignStr.find( "baseline" ) != -1 ) { + else if ( alignStr.tqfind( "baseline" ) != -1 ) { m_align = BaselineAlign; } - else if ( alignStr.find( "axis" ) != -1 ) { + else if ( alignStr.tqfind( "axis" ) != -1 ) { m_align = AxisAlign; } - int index = alignStr.findRev( ' ' ); + int index = alignStr.tqfindRev( ' ' ); if ( index != -1 ) { m_rowNumber = alignStr.right( index + 1 ).toInt(); } } - QString rowalignStr = element.attribute( "rowalign" ).lower(); + TQString rowalignStr = element.attribute( "rowalign" ).lower(); if ( ! rowalignStr.isNull() ) { - QStringList list = QStringList::split( ' ', rowalignStr ); - for ( QStringList::iterator it = list.begin(); it != list.end(); it++ ) { + TQStringList list = TQStringList::split( ' ', rowalignStr ); + for ( TQStringList::iterator it = list.begin(); it != list.end(); it++ ) { if ( *it == "top" ) { m_rowAlign.append( TopAlign ); } @@ -907,10 +907,10 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) } } } - QString columnalignStr = element.attribute( "columnalign" ).lower(); + TQString columnalignStr = element.attribute( "columnalign" ).lower(); if ( ! columnalignStr.isNull() ) { - QStringList list = QStringList::split( ' ', columnalignStr ); - for ( QStringList::iterator it = list.begin(); it != list.end(); it++ ) { + TQStringList list = TQStringList::split( ' ', columnalignStr ); + for ( TQStringList::iterator it = list.begin(); it != list.end(); it++ ) { if ( *it == "left" ) { m_columnAlign.append( LeftHorizontalAlign ); } @@ -922,22 +922,22 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) } } } - QString alignmentscopeStr = element.attribute( "alignmentscope" ).lower(); - if ( ! alignmentscopeStr.isNull() ) { - QStringList list = QStringList::split( ' ', alignmentscopeStr ); - for ( QStringList::iterator it = list.begin(); it != list.end(); it++ ) { + TQString tqalignmentscopeStr = element.attribute( "tqalignmentscope" ).lower(); + if ( ! tqalignmentscopeStr.isNull() ) { + TQStringList list = TQStringList::split( ' ', tqalignmentscopeStr ); + for ( TQStringList::iterator it = list.begin(); it != list.end(); it++ ) { if ( *it == "true" ) { - m_alignmentScope.append( true ); + m_tqalignmentScope.append( true ); } else if ( *it == "false" ) { - m_alignmentScope.append( false ); + m_tqalignmentScope.append( false ); } } } - QString columnwidthStr = element.attribute( "columnwidth" ).lower(); + TQString columnwidthStr = element.attribute( "columnwidth" ).lower(); if ( columnwidthStr.isNull() ) { - QStringList list = QStringList::split( ' ', columnwidthStr ); - for ( QStringList::iterator it = list.begin(); it != list.end(); it++ ) { + TQStringList list = TQStringList::split( ' ', columnwidthStr ); + for ( TQStringList::iterator it = list.begin(); it != list.end(); it++ ) { SizeType type = NoSize; double length; if ( *it == "auto" ) { @@ -960,7 +960,7 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) } } } - QString widthStr = element.attribute( "width" ).lower(); + TQString widthStr = element.attribute( "width" ).lower(); if ( ! widthStr.isNull() ) { if ( widthStr == "auto" ) { m_widthType = AutoSize; @@ -969,10 +969,10 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) m_width = getSize( widthStr, &m_widthType ); } } - QString rowspacingStr = element.attribute( "rowspacing" ).lower(); + TQString rowspacingStr = element.attribute( "rowspacing" ).lower(); if ( ! rowspacingStr.isNull() ) { - QStringList list = QStringList::split( ' ', rowspacingStr ); - for ( QStringList::iterator it = list.begin(); it != list.end(); it++ ) { + TQStringList list = TQStringList::split( ' ', rowspacingStr ); + for ( TQStringList::iterator it = list.begin(); it != list.end(); it++ ) { SizeType type; double length = getSize( *it, &type ); if ( type != NoSize ) { @@ -981,10 +981,10 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) } } } - QString columnspacingStr = element.attribute( "columnspacing" ).lower(); + TQString columnspacingStr = element.attribute( "columnspacing" ).lower(); if ( ! columnspacingStr.isNull() ) { - QStringList list = QStringList::split( ' ', columnspacingStr ); - for ( QStringList::iterator it = list.begin(); it != list.end(); it++ ) { + TQStringList list = TQStringList::split( ' ', columnspacingStr ); + for ( TQStringList::iterator it = list.begin(); it != list.end(); it++ ) { SizeType type; double length = getSize( *it, &type ); if ( type == NoSize ) { @@ -998,10 +998,10 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) } } } - QString rowlinesStr = element.attribute( "rowlines" ).lower(); + TQString rowlinesStr = element.attribute( "rowlines" ).lower(); if ( ! rowlinesStr.isNull() ) { - QStringList list = QStringList::split( ' ', rowlinesStr ); - for ( QStringList::iterator it = list.begin(); it != list.end(); it++ ) { + TQStringList list = TQStringList::split( ' ', rowlinesStr ); + for ( TQStringList::iterator it = list.begin(); it != list.end(); it++ ) { if ( *it == "none" ) { m_rowLines.append( NoneLine ); } @@ -1013,10 +1013,10 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) } } } - QString columnlinesStr = element.attribute( "columnlines" ).lower(); + TQString columnlinesStr = element.attribute( "columnlines" ).lower(); if ( ! columnlinesStr.isNull() ) { - QStringList list = QStringList::split( ' ', columnlinesStr ); - for ( QStringList::iterator it = list.begin(); it != list.end(); it++ ) { + TQStringList list = TQStringList::split( ' ', columnlinesStr ); + for ( TQStringList::iterator it = list.begin(); it != list.end(); it++ ) { if ( *it == "none" ) { m_columnLines.append( NoneLine ); } @@ -1028,7 +1028,7 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) } } } - QString frameStr = element.attribute( "frame" ).stripWhiteSpace().lower(); + TQString frameStr = element.attribute( "frame" ).stripWhiteSpace().lower(); if ( ! frameStr.isNull() ) { if ( frameStr == "none" ) { m_frame = NoneLine; @@ -1040,9 +1040,9 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) m_frame = DashedLine; } } - QString framespacingStr = element.attribute( "framespacing" ); + TQString framespacingStr = element.attribute( "framespacing" ); if ( ! framespacingStr.isNull() ) { - QStringList list = QStringList::split( ' ', framespacingStr ); + TQStringList list = TQStringList::split( ' ', framespacingStr ); m_frameHSpacing = getSize( list[0], &m_frameHSpacingType ); if ( m_frameHSpacingType == NoSize ) { m_frameHSpacingType = getSpace( list[0] ); @@ -1054,7 +1054,7 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) } } } - QString equalrowsStr = element.attribute( "equalrows" ).stripWhiteSpace().lower(); + TQString equalrowsStr = element.attribute( "equalrows" ).stripWhiteSpace().lower(); if ( ! equalrowsStr.isNull() ) { m_customEqualRows = true; if ( equalrowsStr == "false" ) { @@ -1064,7 +1064,7 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) m_equalRows = true; } } - QString equalcolumnsStr = element.attribute( "equalcolumns" ).stripWhiteSpace().lower(); + TQString equalcolumnsStr = element.attribute( "equalcolumns" ).stripWhiteSpace().lower(); if ( ! equalcolumnsStr.isNull() ) { m_customEqualColumns = true; if ( equalcolumnsStr == "false" ) { @@ -1074,7 +1074,7 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) m_equalColumns = true; } } - QString displaystyleStr = element.attribute( "displaystyle" ).stripWhiteSpace().lower(); + TQString displaystyleStr = element.attribute( "displaystyle" ).stripWhiteSpace().lower(); if ( ! displaystyleStr.isNull() ) { m_customDisplayStyle = true; if ( displaystyleStr == "false" ) { @@ -1084,7 +1084,7 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) m_displayStyle = true; } } - QString sideStr = element.attribute( "side" ).stripWhiteSpace().lower(); + TQString sideStr = element.attribute( "side" ).stripWhiteSpace().lower(); if ( ! sideStr.isNull() ) { if ( sideStr == "left" ) { m_side = LeftSide; @@ -1099,7 +1099,7 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) m_side = RightOverlapSide; } } - QString minlabelspacingStr = element.attribute( "minlabelspacing" ).stripWhiteSpace().lower(); + TQString minlabelspacingStr = element.attribute( "minlabelspacing" ).stripWhiteSpace().lower(); if ( ! minlabelspacingStr.isNull() ) { m_minLabelSpacing = getSize( minlabelspacingStr, &m_minLabelSpacingType ); if ( m_minLabelSpacingType == NoSize ) { @@ -1115,7 +1115,7 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) * (e. g. for fence operators). * Returns the number of nodes processed or -1 if it failed. */ -int MatrixElement::readContentFromMathMLDom( QDomNode& node ) +int MatrixElement::readContentFromMathMLDom( TQDomNode& node ) { // We have twice, since there may be empty elements and we need to know how // many of them we have. So, first pass, get number of rows and columns @@ -1126,16 +1126,16 @@ int MatrixElement::readContentFromMathMLDom( QDomNode& node ) uint rows = 0; uint cols = 0; - QDomNode n = node; + TQDomNode n = node; while ( !n.isNull() ) { if ( n.isElement() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( e.tagName().lower() == "mtr" || e.tagName().lower() == "mlabeledtr" ) { rows++; /* Determins the number of columns */ - QDomNode cellnode = e.firstChild(); + TQDomNode cellnode = e.firstChild(); int cc = 0; while ( !cellnode.isNull() ) { @@ -1155,7 +1155,7 @@ int MatrixElement::readContentFromMathMLDom( QDomNode& node ) // Create elements content.clear(); for (uint r = 0; r < rows; r++) { - QPtrList< MatrixSequenceElement >* list = new QPtrList< MatrixSequenceElement >; + TQPtrList< MatrixSequenceElement >* list = new TQPtrList< MatrixSequenceElement >; list->setAutoDelete(true); content.append(list); for (uint c = 0; c < cols; c++) { @@ -1169,9 +1169,9 @@ int MatrixElement::readContentFromMathMLDom( QDomNode& node ) uint c = 0; while ( !node.isNull() ) { if ( node.isElement() ) { - QDomElement e = node.toElement(); + TQDomElement e = node.toElement(); if ( e.tagName().lower() == "mtr" || e.tagName().lower() == "mlabeledtr" ) { - QDomNode cellnode = e.firstChild(); + TQDomNode cellnode = e.firstChild(); if ( e.tagName().lower() == "mlabeledtr" ) { while ( ! cellnode.isNull() && ! cellnode.isElement() ) cellnode = cellnode.nextSibling(); @@ -1180,7 +1180,7 @@ int MatrixElement::readContentFromMathMLDom( QDomNode& node ) } while ( !cellnode.isNull() ) { if ( cellnode.isElement() ) { - QDomElement cellelement = cellnode.toElement(); + TQDomElement cellelement = cellnode.toElement(); if ( cellelement.tagName().lower() != "mtd" ) { // TODO: Inferred mtd. Deprecated in MathML 2.0 kdWarning( DEBUGID ) << "Unsupported tag " @@ -1205,11 +1205,11 @@ int MatrixElement::readContentFromMathMLDom( QDomNode& node ) return 1; } -QString MatrixElement::toLatex() +TQString MatrixElement::toLatex() { //All the border handling must be implemented here too - QString matrix; + TQString matrix; uint cols=getColumns(); uint rows=getRows(); @@ -1232,9 +1232,9 @@ QString MatrixElement::toLatex() return matrix; } -QString MatrixElement::formulaString() +TQString MatrixElement::formulaString() { - QString matrix = "["; + TQString matrix = "["; uint cols=getColumns(); uint rows=getRows(); for (uint r = 0; r < rows; r++) { @@ -1256,11 +1256,11 @@ SequenceElement* MatrixElement::elementAt(uint row, uint column) return getElement( row, column ); } -void MatrixElement::writeMathMLAttributes( QDomElement& element ) const +void MatrixElement::writeMathMLAttributes( TQDomElement& element ) const { - QString rownumber; + TQString rownumber; if ( m_rowNumber ) { - rownumber = QString( " %1" ).arg( m_rowNumber ); + rownumber = TQString( " %1" ).tqarg( m_rowNumber ); } switch ( m_align ) { case TopAlign: @@ -1281,8 +1281,8 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const default: break; } - QString rowalign; - for ( QValueList< VerticalAlign >::const_iterator it = m_rowAlign.begin(); it != m_rowAlign.end(); it++ ) + TQString rowalign; + for ( TQValueList<VerticalAlign >::const_iterator it = m_rowAlign.begin(); it != m_rowAlign.end(); it++ ) { switch ( *it ) { case TopAlign: @@ -1307,8 +1307,8 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const if ( ! rowalign.isNull() ) { element.setAttribute( "rowalign", rowalign.stripWhiteSpace() ); } - QString columnalign; - for ( QValueList< HorizontalAlign >::const_iterator it = m_columnAlign.begin(); it != m_columnAlign.end(); it++ ) + TQString columnalign; + for ( TQValueList<HorizontalAlign >::const_iterator it = m_columnAlign.begin(); it != m_columnAlign.end(); it++ ) { switch ( *it ) { case LeftHorizontalAlign: @@ -1327,22 +1327,22 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const if ( ! columnalign.isNull() ) { element.setAttribute( "columnalign", columnalign.stripWhiteSpace() ); } - QString alignmentscope; - for ( QValueList< bool >::const_iterator it = m_alignmentScope.begin(); it != m_alignmentScope.end(); it++ ) + TQString tqalignmentscope; + for ( TQValueList< bool >::const_iterator it = m_tqalignmentScope.begin(); it != m_tqalignmentScope.end(); it++ ) { if ( *it ) { - alignmentscope.append( "true " ); + tqalignmentscope.append( "true " ); } else { - alignmentscope.append( "false " ); + tqalignmentscope.append( "false " ); } } - if ( ! alignmentscope.isNull() ) { - element.setAttribute( "alignmentscope", alignmentscope.stripWhiteSpace() ); + if ( ! tqalignmentscope.isNull() ) { + element.setAttribute( "tqalignmentscope", tqalignmentscope.stripWhiteSpace() ); } - QString columnwidth; - QValueList< double >::const_iterator lengthIt = m_columnWidth.begin(); - for ( QValueList< SizeType >::const_iterator typeIt = m_columnWidthType.begin(); + TQString columnwidth; + TQValueList< double >::const_iterator lengthIt = m_columnWidth.begin(); + for ( TQValueList< SizeType >::const_iterator typeIt = m_columnWidthType.begin(); typeIt != m_columnWidthType.end(); typeIt ++ ) { switch ( *typeIt ) { case AutoSize: @@ -1352,15 +1352,15 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const columnwidth.append( "fit " ); break; case AbsoluteSize: - columnwidth.append( QString( "%1pt " ).arg( *lengthIt ) ); + columnwidth.append( TQString( "%1pt " ).tqarg( *lengthIt ) ); lengthIt++; break; case RelativeSize: - columnwidth.append( QString( "%1% " ).arg( *lengthIt * 100.0 ) ); + columnwidth.append( TQString( "%1% " ).tqarg( *lengthIt * 100.0 ) ); lengthIt++; break; case PixelSize: - columnwidth.append( QString( "%1px " ).arg( *lengthIt ) ); + columnwidth.append( TQString( "%1px " ).tqarg( *lengthIt ) ); lengthIt++; break; case NegativeVeryVeryThinMathSpace: @@ -1417,30 +1417,30 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const element.setAttribute( "width", "auto" ); break; case AbsoluteSize: - element.setAttribute( "width", QString( "%1pt" ).arg( m_width ) ); + element.setAttribute( "width", TQString( "%1pt" ).tqarg( m_width ) ); break; case RelativeSize: - element.setAttribute( "width", QString( "%1% " ).arg( m_width * 100.0 ) ); + element.setAttribute( "width", TQString( "%1% " ).tqarg( m_width * 100.0 ) ); break; case PixelSize: - element.setAttribute( "width", QString( "%1px " ).arg( m_width ) ); + element.setAttribute( "width", TQString( "%1px " ).tqarg( m_width ) ); break; default: break; } - QString rowspacing; + TQString rowspacing; lengthIt = m_rowSpacing.begin(); - for ( QValueList< SizeType >::const_iterator typeIt = m_rowSpacingType.begin(); + for ( TQValueList< SizeType >::const_iterator typeIt = m_rowSpacingType.begin(); typeIt != m_rowSpacingType.end(); typeIt++, lengthIt++ ) { switch ( *typeIt ) { case AbsoluteSize: - rowspacing.append( QString( "%1pt " ).arg( *lengthIt ) ); + rowspacing.append( TQString( "%1pt " ).tqarg( *lengthIt ) ); break; case RelativeSize: - rowspacing.append( QString( "%1% " ).arg( *lengthIt * 100.0 ) ); + rowspacing.append( TQString( "%1% " ).tqarg( *lengthIt * 100.0 ) ); break; case PixelSize: - rowspacing.append( QString( "%1px " ).arg( *lengthIt ) ); + rowspacing.append( TQString( "%1px " ).tqarg( *lengthIt ) ); break; default: break; @@ -1449,21 +1449,21 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const if ( ! rowspacing.isNull() ) { element.setAttribute( "rowspacing", rowspacing.stripWhiteSpace() ); } - QString columnspacing; + TQString columnspacing; lengthIt = m_columnSpacing.begin(); - for ( QValueList< SizeType >::const_iterator typeIt = m_columnSpacingType.begin(); + for ( TQValueList< SizeType >::const_iterator typeIt = m_columnSpacingType.begin(); typeIt != m_columnSpacingType.end(); typeIt++ ) { switch ( *typeIt ) { case AbsoluteSize: - columnspacing.append( QString( "%1pt " ).arg( *lengthIt ) ); + columnspacing.append( TQString( "%1pt " ).tqarg( *lengthIt ) ); lengthIt++; break; case RelativeSize: - columnspacing.append( QString( "%1% " ).arg( *lengthIt * 100.0 ) ); + columnspacing.append( TQString( "%1% " ).tqarg( *lengthIt * 100.0 ) ); lengthIt++; break; case PixelSize: - columnspacing.append( QString( "%1px " ).arg( *lengthIt ) ); + columnspacing.append( TQString( "%1px " ).tqarg( *lengthIt ) ); lengthIt++; break; case NegativeVeryVeryThinMathSpace: @@ -1515,8 +1515,8 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const if ( ! rowspacing.isNull() ) { element.setAttribute( "rowspacing", rowspacing.stripWhiteSpace() ); } - QString rowlines; - for ( QValueList< LineType >::const_iterator it = m_rowLines.begin(); it != m_rowLines.end(); it++ ) + TQString rowlines; + for ( TQValueList< LineType >::const_iterator it = m_rowLines.begin(); it != m_rowLines.end(); it++ ) { switch ( *it ) { case NoneLine: @@ -1535,8 +1535,8 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const if ( ! rowlines.isNull() ) { element.setAttribute( "rowlines", rowlines.stripWhiteSpace() ); } - QString columnlines; - for ( QValueList< LineType >::const_iterator it = m_columnLines.begin(); it != m_columnLines.end(); it++ ) + TQString columnlines; + for ( TQValueList< LineType >::const_iterator it = m_columnLines.begin(); it != m_columnLines.end(); it++ ) { switch ( *it ) { case NoneLine: @@ -1568,16 +1568,16 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const default: break; } - QString framespacing; + TQString framespacing; switch ( m_frameHSpacingType ) { case AbsoluteSize: - framespacing.append( QString( "%1pt " ).arg( m_frameHSpacing ) ); + framespacing.append( TQString( "%1pt " ).tqarg( m_frameHSpacing ) ); break; case RelativeSize: - framespacing.append( QString( "%1% " ).arg( m_frameHSpacing * 100.0 ) ); + framespacing.append( TQString( "%1% " ).tqarg( m_frameHSpacing * 100.0 ) ); break; case PixelSize: - framespacing.append( QString( "%1px " ).arg( m_frameHSpacing ) ); + framespacing.append( TQString( "%1px " ).tqarg( m_frameHSpacing ) ); break; case NegativeVeryVeryThinMathSpace: framespacing.append( "negativeveryverythinmathspace " ); @@ -1626,13 +1626,13 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const } switch ( m_frameVSpacingType ) { case AbsoluteSize: - framespacing.append( QString( "%1pt " ).arg( m_frameVSpacing ) ); + framespacing.append( TQString( "%1pt " ).tqarg( m_frameVSpacing ) ); break; case RelativeSize: - framespacing.append( QString( "%1% " ).arg( m_frameVSpacing * 100.0 ) ); + framespacing.append( TQString( "%1% " ).tqarg( m_frameVSpacing * 100.0 ) ); break; case PixelSize: - framespacing.append( QString( "%1px " ).arg( m_frameVSpacing ) ); + framespacing.append( TQString( "%1px " ).tqarg( m_frameVSpacing ) ); break; case NegativeVeryVeryThinMathSpace: framespacing.append( "negativeveryverythinmathspace " ); @@ -1709,13 +1709,13 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const } switch ( m_minLabelSpacingType ) { case AbsoluteSize: - element.setAttribute( "minlabelspacing", QString( "%1pt" ).arg( m_minLabelSpacing ) ); + element.setAttribute( "minlabelspacing", TQString( "%1pt" ).tqarg( m_minLabelSpacing ) ); break; case RelativeSize: - element.setAttribute( "minlabelspacing", QString( "%1%" ).arg( m_minLabelSpacing * 100.0 ) ); + element.setAttribute( "minlabelspacing", TQString( "%1%" ).tqarg( m_minLabelSpacing * 100.0 ) ); break; case PixelSize: - element.setAttribute( "minlabelspacing", QString( "%1px" ).arg( m_minLabelSpacing ) ); + element.setAttribute( "minlabelspacing", TQString( "%1px" ).tqarg( m_minLabelSpacing ) ); break; case NegativeVeryVeryThinMathSpace: element.setAttribute( "minlabelspacing", "negativeveryverythinmathspace" ); @@ -1764,12 +1764,12 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const } } -void MatrixElement::writeMathMLContent( QDomDocument& doc, - QDomElement& element, +void MatrixElement::writeMathMLContent( TQDomDocument& doc, + TQDomElement& element, bool oasisFormat ) const { - QDomElement row; - QDomElement cell; + TQDomElement row; + TQDomElement cell; uint rows = getRows(); uint cols = getColumns(); @@ -1799,18 +1799,18 @@ class MultilineSequenceElement : public SequenceElement { typedef SequenceElement inherited; public: - MultilineSequenceElement( BasicElement* parent = 0 ); + MultilineSequenceElement( BasicElement* tqparent = 0 ); virtual MultilineSequenceElement* clone() { return new MultilineSequenceElement( *this ); } virtual BasicElement* goToPos( FormulaCursor*, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ); + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ); /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -1829,9 +1829,9 @@ public: */ virtual KCommand* buildCommand( Container*, Request* ); - virtual KCommand* input( Container* container, QKeyEvent* event ); + virtual KCommand* input( Container* container, TQKeyEvent* event ); - virtual KCommand* input( Container* container, QChar ch ); + virtual KCommand* input( Container* container, TQChar ch ); uint tabCount() const { return tabs.count(); } @@ -1846,18 +1846,18 @@ public: /// Return the position of tab i. int tabPos( uint i ); - virtual void writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat = false ) const ; + virtual void writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat = false ) const ; private: - QPtrList<BasicElement> tabs; + TQPtrList<BasicElement> tabs; }; // Split the line at position pos. class KFCNewLine : public Command { public: - KFCNewLine( const QString& name, Container* document, + KFCNewLine( const TQString& name, Container* document, MultilineSequenceElement* line, uint pos ); virtual ~KFCNewLine(); @@ -1872,7 +1872,7 @@ private: }; -KFCNewLine::KFCNewLine( const QString& name, Container* document, +KFCNewLine::KFCNewLine( const TQString& name, Container* document, MultilineSequenceElement* line, uint pos ) : Command( name, document ), m_line( line ), m_pos( pos ) @@ -1890,17 +1890,17 @@ KFCNewLine::~KFCNewLine() void KFCNewLine::execute() { FormulaCursor* cursor = getExecuteCursor(); - MultilineElement* parent = static_cast<MultilineElement*>( m_line->getParent() ); - int linePos = parent->content.find( m_line ); - parent->content.insert( linePos+1, m_newline ); + MultilineElement* tqparent = static_cast<MultilineElement*>( m_line->getParent() ); + int linePos = tqparent->content.tqfind( m_line ); + tqparent->content.insert( linePos+1, m_newline ); - // If there are children to be moved. + // If there are tqchildren to be moved. if ( m_line->countChildren() > static_cast<int>( m_pos ) ) { // Remove anything after position pos from the current line m_line->selectAllChildren( cursor ); cursor->setMark( m_pos ); - QPtrList<BasicElement> elementList; + TQPtrList<BasicElement> elementList; m_line->remove( cursor, elementList, beforeCursor ); // Insert the removed stuff into the new line @@ -1925,22 +1925,22 @@ void KFCNewLine::execute() void KFCNewLine::unexecute() { FormulaCursor* cursor = getExecuteCursor(); - MultilineElement* parent = static_cast<MultilineElement*>( m_line->getParent() ); - int linePos = parent->content.find( m_line ); + MultilineElement* tqparent = static_cast<MultilineElement*>( m_line->getParent() ); + int linePos = tqparent->content.tqfind( m_line ); // Now the command owns the new line again. - m_newline = parent->content.at( linePos+1 ); + m_newline = tqparent->content.at( linePos+1 ); // Tell all cursors to leave this sequence FormulaElement* formula = m_line->formula(); formula->elementRemoval( m_newline ); - // If there are children to be moved. + // If there are tqchildren to be moved. if ( m_newline->countChildren() > 0 ) { // Remove anything from the line to be deleted m_newline->selectAllChildren( cursor ); - QPtrList<BasicElement> elementList; + TQPtrList<BasicElement> elementList; m_newline->remove( cursor, elementList, beforeCursor ); // Insert the removed stuff into the previous line @@ -1951,7 +1951,7 @@ void KFCNewLine::unexecute() else { m_line->moveEnd( cursor ); } - parent->content.take( linePos+1 ); + tqparent->content.take( linePos+1 ); // Tell that something changed formula->changed(); @@ -1959,19 +1959,19 @@ void KFCNewLine::unexecute() } -MultilineSequenceElement::MultilineSequenceElement( BasicElement* parent ) - : SequenceElement( parent ) +MultilineSequenceElement::MultilineSequenceElement( BasicElement* tqparent ) + : SequenceElement( tqparent ) { tabs.setAutoDelete( false ); } BasicElement* MultilineSequenceElement::goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ) + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ) { - //LuPixelPoint myPos(parentOrigin.x() + getX(), - // parentOrigin.y() + getY()); - BasicElement* e = inherited::goToPos(cursor, handled, point, parentOrigin); + //LuPixelPoint myPos(tqparentOrigin.x() + getX(), + // tqparentOrigin.y() + getY()); + BasicElement* e = inherited::goToPos(cursor, handled, point, tqparentOrigin); if (e == 0) { // If the mouse was behind this line put the cursor to the last position. @@ -2033,19 +2033,19 @@ KCommand* MultilineSequenceElement::buildCommand( Container* container, Request* } -KCommand* MultilineSequenceElement::input( Container* container, QKeyEvent* event ) +KCommand* MultilineSequenceElement::input( Container* container, TQKeyEvent* event ) { int action = event->key(); //int state = event->state(); //MoveFlag flag = movementFlag(state); switch ( action ) { - case Qt::Key_Enter: - case Qt::Key_Return: { + case TQt::Key_Enter: + case TQt::Key_Return: { Request newline( req_addNewline ); return buildCommand( container, &newline ); } - case Qt::Key_Tab: { + case TQt::Key_Tab: { Request r( req_addTabMark ); return buildCommand( container, &r ); } @@ -2054,7 +2054,7 @@ KCommand* MultilineSequenceElement::input( Container* container, QKeyEvent* even } -KCommand* MultilineSequenceElement::input( Container* container, QChar ch ) +KCommand* MultilineSequenceElement::input( Container* container, TQChar ch ) { int latin1 = ch.latin1(); switch (latin1) { @@ -2110,12 +2110,12 @@ int MultilineSequenceElement::tabPos( uint i ) } -void MultilineSequenceElement::writeMathML( QDomDocument& doc, - QDomNode& parent, bool oasisFormat ) const +void MultilineSequenceElement::writeMathML( TQDomDocument& doc, + TQDomNode& tqparent, bool oasisFormat ) const { - // parent is required to be a <mtr> tag + // tqparent is required to be a <mtr> tag - QDomElement tmp = doc.createElement( "TMP" ); + TQDomElement tmp = doc.createElement( "TMP" ); inherited::writeMathML( doc, tmp, oasisFormat ); @@ -2124,14 +2124,14 @@ void MultilineSequenceElement::writeMathML( QDomDocument& doc, * end of a <mtd> tag. */ - QDomElement mtd = doc.createElement( oasisFormat ? "math:mtd" : "mtd" ); + TQDomElement mtd = doc.createElement( oasisFormat ? "math:mtd" : "mtd" ); // The mrow, if it exists. - QDomNode n = tmp.firstChild().firstChild(); + TQDomNode n = tmp.firstChild().firstChild(); while ( !n.isNull() ) { - // the illegal TabMarkers are children of the mrow, child of tmp. + // the illegal TabMarkers are tqchildren of the mrow, child of tmp. if ( n.isElement() && n.toElement().tagName() == "TAB" ) { - parent.appendChild( mtd ); + tqparent.appendChild( mtd ); mtd = doc.createElement( oasisFormat ? "math:mtd" : "mtd" ); } else { @@ -2140,12 +2140,12 @@ void MultilineSequenceElement::writeMathML( QDomDocument& doc, n = n.nextSibling(); } - parent.appendChild( mtd ); + tqparent.appendChild( mtd ); } -MultilineElement::MultilineElement( BasicElement* parent ) - : BasicElement( parent ) +MultilineElement::MultilineElement( BasicElement* tqparent ) + : BasicElement( tqparent ) { content.setAutoDelete( true ); content.append( new MultilineSequenceElement( this ) ); @@ -2184,12 +2184,12 @@ void MultilineElement::entered( SequenceElement* /*child*/ ) * Returns the element the point is in. */ BasicElement* MultilineElement::goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ) + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ) { - BasicElement* e = inherited::goToPos(cursor, handled, point, parentOrigin); + BasicElement* e = inherited::goToPos(cursor, handled, point, tqparentOrigin); if ( e != 0 ) { - LuPixelPoint myPos(parentOrigin.x() + getX(), - parentOrigin.y() + getY()); + LuPixelPoint myPos(tqparentOrigin.x() + getX(), + tqparentOrigin.y() + getY()); uint count = content.count(); for ( uint i = 0; i < count; ++i ) { @@ -2217,15 +2217,15 @@ void MultilineElement::moveLeft( FormulaCursor* cursor, BasicElement* from ) getParent()->moveLeft(cursor, this); } else { - // Coming from the parent (sequence) we go to + // Coming from the tqparent (sequence) we go to // the very last position if (from == getParent()) { content.at( content.count()-1 )->moveLeft(cursor, this); } else { // Coming from one of the lines we go to the previous line - // or to the parent if there is none. - int pos = content.find( static_cast<MultilineSequenceElement*>( from ) ); + // or to the tqparent if there is none. + int pos = content.tqfind( static_cast<MultilineSequenceElement*>( from ) ); if ( pos > -1 ) { if ( pos > 0 ) { content.at( pos-1 )->moveLeft( cursor, this ); @@ -2252,7 +2252,7 @@ void MultilineElement::moveRight( FormulaCursor* cursor, BasicElement* from ) content.at( 0 )->moveRight(cursor, this); } else { - int pos = content.find( static_cast<MultilineSequenceElement*>( from ) ); + int pos = content.tqfind( static_cast<MultilineSequenceElement*>( from ) ); if ( pos > -1 ) { uint upos = pos; if ( upos < content.count() ) { @@ -2279,15 +2279,15 @@ void MultilineElement::moveUp( FormulaCursor* cursor, BasicElement* from ) getParent()->moveLeft(cursor, this); } else { - // Coming from the parent (sequence) we go to + // Coming from the tqparent (sequence) we go to // the very last position if (from == getParent()) { content.at( content.count()-1 )->moveLeft(cursor, this); } else { // Coming from one of the lines we go to the previous line - // or to the parent if there is none. - int pos = content.find( static_cast<MultilineSequenceElement*>( from ) ); + // or to the tqparent if there is none. + int pos = content.tqfind( static_cast<MultilineSequenceElement*>( from ) ); if ( pos > -1 ) { if ( pos > 0 ) { //content.at( pos-1 )->moveLeft( cursor, this ); @@ -2304,7 +2304,7 @@ void MultilineElement::moveUp( FormulaCursor* cursor, BasicElement* from ) cursorPos += newTabPos-oldTabPos; int nextNewTabPos = newLine->tabPos( tabNum+1 ); if ( nextNewTabPos > -1 ) { - cursorPos = QMIN( cursorPos, nextNewTabPos ); + cursorPos = TQMIN( cursorPos, nextNewTabPos ); } } else { @@ -2314,11 +2314,11 @@ void MultilineElement::moveUp( FormulaCursor* cursor, BasicElement* from ) else { int nextNewTabPos = newLine->tabPos( 0 ); if ( nextNewTabPos > -1 ) { - cursorPos = QMIN( cursorPos, nextNewTabPos ); + cursorPos = TQMIN( cursorPos, nextNewTabPos ); } } cursor->setTo( newLine, - QMIN( cursorPos, + TQMIN( cursorPos, newLine->countChildren() ) ); } else { @@ -2343,7 +2343,7 @@ void MultilineElement::moveDown( FormulaCursor* cursor, BasicElement* from ) content.at( 0 )->moveRight(cursor, this); } else { - int pos = content.find( static_cast<MultilineSequenceElement*>( from ) ); + int pos = content.tqfind( static_cast<MultilineSequenceElement*>( from ) ); if ( pos > -1 ) { uint upos = pos; if ( upos < content.count() ) { @@ -2362,7 +2362,7 @@ void MultilineElement::moveDown( FormulaCursor* cursor, BasicElement* from ) cursorPos += newTabPos-oldTabPos; int nextNewTabPos = newLine->tabPos( tabNum+1 ); if ( nextNewTabPos > -1 ) { - cursorPos = QMIN( cursorPos, nextNewTabPos ); + cursorPos = TQMIN( cursorPos, nextNewTabPos ); } } else { @@ -2372,11 +2372,11 @@ void MultilineElement::moveDown( FormulaCursor* cursor, BasicElement* from ) else { int nextNewTabPos = newLine->tabPos( 0 ); if ( nextNewTabPos > -1 ) { - cursorPos = QMIN( cursorPos, nextNewTabPos ); + cursorPos = TQMIN( cursorPos, nextNewTabPos ); } } cursor->setTo( newLine, - QMIN( cursorPos, + TQMIN( cursorPos, newLine->countChildren() ) ); } else { @@ -2399,9 +2399,9 @@ void MultilineElement::calcSizes( const ContextStyle& context, { double factor = style.sizeFactor(); luPt mySize = context.getAdjustedSize( tstyle, factor ); - QFont font = context.getDefaultFont(); - font.setPointSizeFloat( context.layoutUnitPtToPt( mySize ) ); - QFontMetrics fm( font ); + TQFont font = context.getDefaultFont(); + font.setPointSizeFloat( context.tqlayoutUnitPtToPt( mySize ) ); + TQFontMetrics fm( font ); luPixel leading = context.ptToLayoutUnitPt( fm.leading() ); luPixel distY = context.ptToPixelY( context.getThinSpace( tstyle, factor ) ); @@ -2412,13 +2412,13 @@ void MultilineElement::calcSizes( const ContextStyle& context, for ( uint i = 0; i < count; ++i ) { MultilineSequenceElement* line = content.at(i); line->calcSizes( context, tstyle, istyle, style ); - tabCount = QMAX( tabCount, line->tabCount() ); + tabCount = TQMAX( tabCount, line->tabCount() ); height += leading; line->setX( 0 ); line->setY( height ); height += line->getHeight() + distY; - width = QMAX( line->getWidth(), width ); + width = TQMAX( line->getWidth(), width ); } // calculate the tab positions @@ -2427,17 +2427,17 @@ void MultilineElement::calcSizes( const ContextStyle& context, for ( uint i = 0; i < count; ++i ) { MultilineSequenceElement* line = content.at(i); if ( t < line->tabCount() ) { - pos = QMAX( pos, line->tab( t )->getX() ); + pos = TQMAX( pos, line->tab( t )->getX() ); } else { - pos = QMAX( pos, line->getWidth() ); + pos = TQMAX( pos, line->getWidth() ); } } for ( uint i = 0; i < count; ++i ) { MultilineSequenceElement* line = content.at(i); if ( t < line->tabCount() ) { line->moveTabTo( t, pos ); - width = QMAX( width, line->getWidth() ); + width = TQMAX( width, line->getWidth() ); } } } @@ -2453,14 +2453,14 @@ void MultilineElement::calcSizes( const ContextStyle& context, } } -void MultilineElement::draw( QPainter& painter, const LuPixelRect& r, +void MultilineElement::draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ) + const LuPixelPoint& tqparentOrigin ) { - LuPixelPoint myPos( parentOrigin.x() + getX(), parentOrigin.y() + getY() ); + LuPixelPoint myPos( tqparentOrigin.x() + getX(), tqparentOrigin.y() + getY() ); uint count = content.count(); if ( context.edit() ) { @@ -2471,10 +2471,10 @@ void MultilineElement::draw( QPainter& painter, const LuPixelRect& r, if ( tabCount < line->tabCount() ) { for ( uint t = tabCount; t < line->tabCount(); ++t ) { BasicElement* marker = line->tab( t ); - painter.drawLine( context.layoutUnitToPixelX( myPos.x()+marker->getX() ), - context.layoutUnitToPixelY( myPos.y() ), - context.layoutUnitToPixelX( myPos.x()+marker->getX() ), - context.layoutUnitToPixelY( myPos.y()+getHeight() ) ); + painter.drawLine( context.tqlayoutUnitToPixelX( myPos.x()+marker->getX() ), + context.tqlayoutUnitToPixelY( myPos.y() ), + context.tqlayoutUnitToPixelX( myPos.x()+marker->getX() ), + context.tqlayoutUnitToPixelY( myPos.y()+getHeight() ) ); } tabCount = line->tabCount(); } @@ -2498,7 +2498,7 @@ void MultilineElement::dispatchFontCommand( FontCommand* cmd ) } void MultilineElement::insert( FormulaCursor* cursor, - QPtrList<BasicElement>& newChildren, + TQPtrList<BasicElement>& newChildren, Direction direction ) { MultilineSequenceElement* e = static_cast<MultilineSequenceElement*>(newChildren.take(0)); @@ -2516,7 +2516,7 @@ void MultilineElement::insert( FormulaCursor* cursor, } void MultilineElement::remove( FormulaCursor* cursor, - QPtrList<BasicElement>& removedChildren, + TQPtrList<BasicElement>& removedChildren, Direction direction ) { if ( content.count() == 1 ) { //&& ( cursor->getPos() == 0 ) ) { @@ -2566,7 +2566,7 @@ SequenceElement* MultilineElement::getMainChild() void MultilineElement::selectChild(FormulaCursor* cursor, BasicElement* child) { - int pos = content.find( dynamic_cast<MultilineSequenceElement*>( child ) ); + int pos = content.tqfind( dynamic_cast<MultilineSequenceElement*>( child ) ); if ( pos > -1 ) { cursor->setTo( this, pos ); //content.at( pos )->moveRight( cursor, this ); @@ -2577,26 +2577,26 @@ void MultilineElement::selectChild(FormulaCursor* cursor, BasicElement* child) /** * Appends our attributes to the dom element. */ -void MultilineElement::writeDom(QDomElement element) +void MultilineElement::writeDom(TQDomElement element) { BasicElement::writeDom(element); uint lineCount = content.count(); element.setAttribute( "LINES", lineCount ); - QDomDocument doc = element.ownerDocument(); + TQDomDocument doc = element.ownerDocument(); for ( uint i = 0; i < lineCount; ++i ) { - QDomElement tmp = content.at( i )->getElementDom(doc); + TQDomElement tmp = content.at( i )->getElementDom(doc); element.appendChild(tmp); } } -void MultilineElement::writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat ) const +void MultilineElement::writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat ) const { - QDomElement de = doc.createElement( oasisFormat ? "math:mtable" : "mtable" ); - QDomElement row; QDomElement cell; + TQDomElement de = doc.createElement( oasisFormat ? "math:mtable" : "mtable" ); + TQDomElement row; TQDomElement cell; - for ( QPtrListIterator < MultilineSequenceElement > it( content ); it.current(); ++it ) { + for ( TQPtrListIterator < MultilineSequenceElement > it( content ); it.current(); ++it ) { row = doc.createElement( oasisFormat ? "math:mtr" : "mtr" ); de.appendChild( row ); //cell = doc.createElement( "mtd" ); @@ -2606,20 +2606,20 @@ void MultilineElement::writeMathML( QDomDocument& doc, QDomNode& parent, bool oa it.current()->writeMathML( doc, row, oasisFormat ); } - parent.appendChild( de ); + tqparent.appendChild( de ); } /** * Reads our attributes from the element. * Returns false if it failed. */ -bool MultilineElement::readAttributesFromDom(QDomElement element) +bool MultilineElement::readAttributesFromDom(TQDomElement element) { if (!BasicElement::readAttributesFromDom(element)) { return false; } uint lineCount = 0; - QString lineCountStr = element.attribute("LINES"); + TQString lineCountStr = element.attribute("LINES"); if(!lineCountStr.isNull()) { lineCount = lineCountStr.toInt(); } @@ -2641,7 +2641,7 @@ bool MultilineElement::readAttributesFromDom(QDomElement element) * that needs to be read. * Returns false if it failed. */ -bool MultilineElement::readContentFromDom(QDomNode& node) +bool MultilineElement::readContentFromDom(TQDomNode& node) { if (!BasicElement::readContentFromDom(node)) { return false; @@ -2652,7 +2652,7 @@ bool MultilineElement::readContentFromDom(QDomNode& node) while ( !node.isNull() && i < lineCount ) { if ( node.isElement() ) { SequenceElement* element = content.at( i ); - QDomElement e = node.toElement(); + TQDomElement e = node.toElement(); if ( !element->buildFromDom( e ) ) { return false; } @@ -2663,10 +2663,10 @@ bool MultilineElement::readContentFromDom(QDomNode& node) return true; } -QString MultilineElement::toLatex() +TQString MultilineElement::toLatex() { uint lineCount = content.count(); - QString muliline = "\\begin{split} "; + TQString muliline = "\\begin{split} "; for ( uint i = 0; i < lineCount; ++i ) { muliline += content.at( i )->toLatex(); muliline += " \\\\ "; @@ -2676,10 +2676,10 @@ QString MultilineElement::toLatex() } // Does this make any sense at all? -QString MultilineElement::formulaString() +TQString MultilineElement::formulaString() { uint lineCount = content.count(); - QString muliline = ""; + TQString muliline = ""; for ( uint i = 0; i < lineCount; ++i ) { muliline += content.at( i )->formulaString(); muliline += "\n"; diff --git a/lib/kformula/matrixelement.h b/lib/kformula/matrixelement.h index 5f7eec4d..ede10114 100644 --- a/lib/kformula/matrixelement.h +++ b/lib/kformula/matrixelement.h @@ -22,7 +22,7 @@ #ifndef MATRIXELEMENT_H #define MATRIXELEMENT_H -#include <qptrlist.h> +#include <tqptrlist.h> #include "basicelement.h" @@ -45,7 +45,7 @@ class MatrixElement : public BasicElement { enum SideType { NoSide, LeftSide, RightSide, LeftOverlapSide, RightOverlapSide }; MatrixElement& operator=( const MatrixElement& ) { return *this; } public: - MatrixElement(uint rows = 1, uint columns = 1, BasicElement* parent = 0); + MatrixElement(uint rows = 1, uint columns = 1, BasicElement* tqparent = 0); ~MatrixElement(); MatrixElement( const MatrixElement& ); @@ -69,7 +69,7 @@ public: * is allowed to set the cursor. */ virtual BasicElement* goToPos( FormulaCursor*, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ); + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ); // drawing // @@ -80,7 +80,7 @@ public: /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, @@ -88,19 +88,19 @@ public: StyleAttributes& style ); /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); /** - * Dispatch this FontCommand to all our TextElement children. + * Dispatch this FontCommand to all our TextElement tqchildren. */ virtual void dispatchFontCommand( FontCommand* cmd ); @@ -153,16 +153,16 @@ public: virtual SequenceElement* getMainChild(); /** - * Inserts all new children at the cursor position. Places the + * Inserts all new tqchildren at the cursor position. Places the * cursor according to the direction. */ - //virtual void insert(FormulaCursor*, QPtrList<BasicElement>&, Direction); + //virtual void insert(FormulaCursor*, TQPtrList<BasicElement>&, Direction); /** - * Removes all selected children and returns them. Places the - * cursor to where the children have been. + * Removes all selected tqchildren and returns them. Places the + * cursor to where the tqchildren have been. */ - //virtual void remove(FormulaCursor*, QPtrList<BasicElement>&, Direction); + //virtual void remove(FormulaCursor*, TQPtrList<BasicElement>&, Direction); /** * Moves the cursor to a normal place where new elements @@ -184,18 +184,18 @@ public: /** * Returns wether the element has no more useful - * children (except its main child) and should therefore + * tqchildren (except its main child) and should therefore * be replaced by its main child's content. */ //virtual bool isSenseless(); /** * @returns the latex representation of the element and - * of the element's children + * of the element's tqchildren */ - virtual QString toLatex(); + virtual TQString toLatex(); - virtual QString formulaString(); + virtual TQString formulaString(); uint getRows() const { return content.count(); } uint getColumns() const { return content.getFirst()->count(); } @@ -209,32 +209,32 @@ protected: /** * Returns the tag name of this element type. */ - virtual QString getTagName() const { return "MATRIX"; } + virtual TQString getTagName() const { return "MATRIX"; } /** * Appends our attributes to the dom element. */ - virtual void writeDom(QDomElement element); + virtual void writeDom(TQDomElement element); - virtual QString getElementName() const { return "mtable"; } - virtual void writeMathMLAttributes( QDomElement& element ) const; - virtual void writeMathMLContent( QDomDocument& doc, - QDomElement& element, + virtual TQString getElementName() const { return "mtable"; } + virtual void writeMathMLAttributes( TQDomElement& element ) const; + virtual void writeMathMLContent( TQDomDocument& doc, + TQDomElement& element, bool oasisFormat ) const; /** * Reads our attributes from the element. * Returns false if it failed. */ - virtual bool readAttributesFromDom(QDomElement element); + virtual bool readAttributesFromDom(TQDomElement element); /** * Reads our content from the node. Sets the node to the next node * that needs to be read. * Returns false if it failed. */ - virtual bool readContentFromDom(QDomNode& node); + virtual bool readContentFromDom(TQDomNode& node); - virtual bool readAttributesFromMathMLDom( const QDomElement& element ); + virtual bool readAttributesFromMathMLDom( const TQDomElement& element ); /** * Reads our content from the MathML node. Sets the node to the next node @@ -242,10 +242,10 @@ protected: * (e. g. for fence operators). * Returns the number of nodes processed or -1 if it failed. */ - virtual int readContentFromMathMLDom(QDomNode& node); + virtual int readContentFromMathMLDom(TQDomNode& node); private: - void writeMathMLAttributes( QDomElement& element ); + void writeMathMLAttributes( TQDomElement& element ); MatrixSequenceElement* getElement(uint row, uint column) { return content.at(row)->at(column); } @@ -262,26 +262,26 @@ private: /** * The elements we contain. */ - QPtrList< QPtrList< MatrixSequenceElement > > content; + TQPtrList< TQPtrList< MatrixSequenceElement > > content; /** * MathML Attributes. See Section 3.5.1.2 */ int m_rowNumber; VerticalAlign m_align; - QValueList< VerticalAlign > m_rowAlign; - QValueList< HorizontalAlign > m_columnAlign; - QValueList< bool > m_alignmentScope; - QValueList< SizeType > m_columnWidthType; - QValueList< double > m_columnWidth; + TQValueList< VerticalAlign > m_rowAlign; + TQValueList< HorizontalAlign > m_columnAlign; + TQValueList< bool > m_tqalignmentScope; + TQValueList< SizeType > m_columnWidthType; + TQValueList< double > m_columnWidth; SizeType m_widthType; double m_width; - QValueList< SizeType > m_rowSpacingType; - QValueList< double > m_rowSpacing; - QValueList< SizeType > m_columnSpacingType; - QValueList< double > m_columnSpacing; - QValueList< LineType > m_rowLines; - QValueList< LineType > m_columnLines; + TQValueList< SizeType > m_rowSpacingType; + TQValueList< double > m_rowSpacing; + TQValueList< SizeType > m_columnSpacingType; + TQValueList< double > m_columnSpacing; + TQValueList< LineType > m_rowLines; + TQValueList< LineType > m_columnLines; LineType m_frame; SizeType m_frameHSpacingType; double m_frameHSpacing; @@ -316,7 +316,7 @@ public: * The container this FormulaElement belongs to must not be 0, * except you really know what you are doing. */ - MultilineElement( BasicElement* parent = 0 ); + MultilineElement( BasicElement* tqparent = 0 ); ~MultilineElement(); MultilineElement( const MultilineElement& ); @@ -337,7 +337,7 @@ public: * Returns the element the point is in. */ BasicElement* goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ); + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ); /** * Sets the cursor inside this element to its start position. @@ -375,7 +375,7 @@ public: /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, @@ -383,24 +383,24 @@ public: StyleAttributes& style ); /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); /** - * Dispatch this FontCommand to all our TextElement children. + * Dispatch this FontCommand to all our TextElement tqchildren. */ virtual void dispatchFontCommand( FontCommand* cmd ); - virtual void insert(FormulaCursor*, QPtrList<BasicElement>&, Direction); - virtual void remove(FormulaCursor*, QPtrList<BasicElement>&, Direction); + virtual void insert(FormulaCursor*, TQPtrList<BasicElement>&, Direction); + virtual void remove(FormulaCursor*, TQPtrList<BasicElement>&, Direction); virtual void normalize(FormulaCursor*, Direction); @@ -414,13 +414,13 @@ public: /** * @returns the latex representation of the element and - * of the element's children + * of the element's tqchildren */ - virtual QString toLatex(); + virtual TQString toLatex(); - virtual QString formulaString(); + virtual TQString formulaString(); - virtual void writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat = false ) const ; + virtual void writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat = false ) const ; protected: @@ -429,25 +429,25 @@ protected: /** * Returns the tag name of this element type. */ - virtual QString getTagName() const { return "MULTILINE"; } + virtual TQString getTagName() const { return "MULTILINE"; } /** * Appends our attributes to the dom element. */ - virtual void writeDom(QDomElement element); + virtual void writeDom(TQDomElement element); /** * Reads our attributes from the element. * Returns false if it failed. */ - virtual bool readAttributesFromDom(QDomElement element); + virtual bool readAttributesFromDom(TQDomElement element); /** * Reads our content from the node. Sets the node to the next node * that needs to be read. * Returns false if it failed. */ - virtual bool readContentFromDom(QDomNode& node); + virtual bool readContentFromDom(TQDomNode& node); private: @@ -455,7 +455,7 @@ private: /** * The list of sequences. Each one is a line. */ - QPtrList< MultilineSequenceElement > content; + TQPtrList< MultilineSequenceElement > content; }; diff --git a/lib/kformula/numberelement.cc b/lib/kformula/numberelement.cc index 41ddc179..4532d259 100644 --- a/lib/kformula/numberelement.cc +++ b/lib/kformula/numberelement.cc @@ -31,13 +31,13 @@ KFORMULA_NAMESPACE_BEGIN -NumberElement::NumberElement( BasicElement* parent ) : TokenElement( parent ) {} +NumberElement::NumberElement( BasicElement* tqparent ) : TokenElement( tqparent ) {} /* * Token elements' content has to be of homogeneous type. Every token element * must (TODO: check this) appear inside a non-token sequence, and thus, if * the command asks for a different content, a new element has to be created in - * parent sequence. + * tqparent sequence. */ KCommand* NumberElement::buildCommand( Container* container, Request* request ) { @@ -56,21 +56,21 @@ KCommand* NumberElement::buildCommand( Container* container, Request* request ) } if ( countChildren() == 0 || cursor->getPos() == countChildren() ) { - // We are in the last position, so it's easy, call the parent to + // We are in the last position, so it's easy, call the tqparent to // create a new child - SequenceElement* parent = static_cast<SequenceElement*>( getParent() ); - if ( parent ) { - uint pos = parent->childPos( this ); - cursor->setTo( parent, pos + 1); - return parent->buildCommand( container, request ); + SequenceElement* tqparent = static_cast<SequenceElement*>( getParent() ); + if ( tqparent ) { + uint pos = tqparent->childPos( this ); + cursor->setTo( tqparent, pos + 1); + return tqparent->buildCommand( container, request ); } } if ( cursor->getPos() == 0 ) { - SequenceElement* parent = static_cast<SequenceElement*>( getParent() ); - if ( parent ) { - uint pos = parent->childPos( this ); - cursor->setTo( parent, pos ); - return parent->buildCommand( container, request ); + SequenceElement* tqparent = static_cast<SequenceElement*>( getParent() ); + if ( tqparent ) { + uint pos = tqparent->childPos( this ); + cursor->setTo( tqparent, pos ); + return tqparent->buildCommand( container, request ); } } @@ -78,7 +78,7 @@ KCommand* NumberElement::buildCommand( Container* container, Request* request ) // a) Cut from mark to the end // b) Create a new token and add an element from key pressed // c) Create a new token and add elements cut previously - // d) Move cursor to parent so that it command execution works fine + // d) Move cursor to tqparent so that it command execution works fine switch( *request ) { case req_addTextChar: { @@ -89,9 +89,9 @@ KCommand* NumberElement::buildCommand( Container* container, Request* request ) command->addCursor( cursor ); command->addToken( id ); command->addContent( id, text ); - SequenceElement* parent = static_cast< SequenceElement* >( getParent() ); - if ( parent ) { - cursor->setTo( parent, parent->childPos( this ) + 1 ); + SequenceElement* tqparent = static_cast< SequenceElement* >( getParent() ); + if ( tqparent ) { + cursor->setTo( tqparent, tqparent->childPos( this ) + 1 ); } return command; } @@ -106,9 +106,9 @@ KCommand* NumberElement::buildCommand( Container* container, Request* request ) TextElement* text = creationStrategy->createTextElement( tr->text()[i] ); command->addContent( id, text ); } - SequenceElement* parent = static_cast< SequenceElement* >( getParent() ); - if ( parent ) { - cursor->setTo( parent, parent->childPos( this ) + 1 ); + SequenceElement* tqparent = static_cast< SequenceElement* >( getParent() ); + if ( tqparent ) { + cursor->setTo( tqparent, tqparent->childPos( this ) + 1 ); } return command; } @@ -121,9 +121,9 @@ KCommand* NumberElement::buildCommand( Container* container, Request* request ) command->addCursor( cursor ); command->addToken( op ); command->addContent( op, text ); - SequenceElement* parent = static_cast< SequenceElement* >( getParent() ); - if ( parent ) { - cursor->setTo( parent, parent->childPos( this ) + 1 ); + SequenceElement* tqparent = static_cast< SequenceElement* >( getParent() ); + if ( tqparent ) { + cursor->setTo( tqparent, tqparent->childPos( this ) + 1 ); } return command; } @@ -136,11 +136,11 @@ KCommand* NumberElement::buildCommand( Container* container, Request* request ) case req_addSymbol: case req_addOneByTwoMatrix: case req_addMatrix: { - SequenceElement* parent = static_cast<SequenceElement*>( getParent() ); - if ( parent ) { - uint pos = parent->childPos( this ); - cursor->setTo( parent, pos + 1); - return parent->buildCommand( container, request ); + SequenceElement* tqparent = static_cast<SequenceElement*>( getParent() ); + if ( tqparent ) { + uint pos = tqparent->childPos( this ); + cursor->setTo( tqparent, pos + 1); + return tqparent->buildCommand( container, request ); } } default: diff --git a/lib/kformula/numberelement.h b/lib/kformula/numberelement.h index 21342fe2..fe6d92e4 100644 --- a/lib/kformula/numberelement.h +++ b/lib/kformula/numberelement.h @@ -27,7 +27,7 @@ KFORMULA_NAMESPACE_BEGIN class NumberElement : public TokenElement { typedef TokenElement inherited; public: - NumberElement( BasicElement* parent = 0 ); + NumberElement( BasicElement* tqparent = 0 ); /** * This is called by the container to get a command depending on @@ -39,7 +39,7 @@ public: */ virtual KCommand* buildCommand( Container*, Request* ); - virtual QString getElementName() const { return "mn"; } + virtual TQString getElementName() const { return "mn"; } }; KFORMULA_NAMESPACE_END diff --git a/lib/kformula/oasiscreationstrategy.cc b/lib/kformula/oasiscreationstrategy.cc index 637bd695..9f7949cb 100644 --- a/lib/kformula/oasiscreationstrategy.cc +++ b/lib/kformula/oasiscreationstrategy.cc @@ -17,7 +17,7 @@ * Boston, MA 02110-1301, USA. */ -#include <qdom.h> +#include <tqdom.h> #include "bracketelement.h" #include "elementtype.h" @@ -45,7 +45,7 @@ KFORMULA_NAMESPACE_BEGIN -BasicElement* OasisCreationStrategy::createElement( QString type, const QDomElement& element ) +BasicElement* OasisCreationStrategy::createElement( TQString type, const TQDomElement& element ) { // TODO @@ -95,7 +95,7 @@ BasicElement* OasisCreationStrategy::createElement( QString type, const QDomElem } -TextElement* OasisCreationStrategy::createTextElement( const QChar& ch, bool symbol ) +TextElement* OasisCreationStrategy::createTextElement( const TQChar& ch, bool symbol ) { return new TextElement( ch, symbol ); } @@ -160,13 +160,13 @@ IndexElement* OasisCreationStrategy::createIndexElement() return new IndexElement; } -BasicElement* OasisCreationStrategy::createOperatorElement( const QDomElement& element ) +BasicElement* OasisCreationStrategy::createOperatorElement( const TQDomElement& element ) { - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); if ( n.isNull() ) return 0; if ( n.isEntityReference() ) { - QString name = n.nodeName(); + TQString name = n.nodeName(); if ( name == "CloseCurlyDoubleQuote" || name == "CloseCurlyQuote" || name == "LeftAngleBracket" @@ -184,8 +184,8 @@ BasicElement* OasisCreationStrategy::createOperatorElement( const QDomElement& e return new OperatorElement(); } if ( n.isText() ) { - QString text = n.toText().data(); - if ( text.length() == 1 && QString("()[]{}").contains(text[0]) ) { + TQString text = n.toText().data(); + if ( text.length() == 1 && TQString("()[]{}").tqcontains(text[0]) ) { return new BracketElement(); } } diff --git a/lib/kformula/oasiscreationstrategy.h b/lib/kformula/oasiscreationstrategy.h index 276749f0..d8603a23 100644 --- a/lib/kformula/oasiscreationstrategy.h +++ b/lib/kformula/oasiscreationstrategy.h @@ -22,7 +22,7 @@ #define OASISCREATIONSTRATEGY_H -#include <qstring.h> +#include <tqstring.h> #include "kformuladefs.h" #include "creationstrategy.h" @@ -49,9 +49,9 @@ class UnderlineElement; */ class OasisCreationStrategy : public ElementCreationStrategy { public: - virtual BasicElement* createElement( QString type, const QDomElement& element ); + virtual BasicElement* createElement( TQString type, const TQDomElement& element ); - virtual TextElement* createTextElement( const QChar& ch, bool symbol=false ); + virtual TextElement* createTextElement( const TQChar& ch, bool symbol=false ); virtual EmptyElement* createEmptyElement(); virtual NameSequence* createNameSequence(); virtual BracketElement* createBracketElement( SymbolType lhs, SymbolType rhs ); @@ -67,9 +67,9 @@ public: virtual IdentifierElement* createIdentifierElement(); virtual OperatorElement* createOperatorElement(); virtual NumberElement* createNumberElement(); - virtual QString type() const { return "Oasis"; } + virtual TQString type() const { return "Oasis"; } - BasicElement* createOperatorElement( const QDomElement& element ); + BasicElement* createOperatorElement( const TQDomElement& element ); }; KFORMULA_NAMESPACE_END diff --git a/lib/kformula/operatorelement.cc b/lib/kformula/operatorelement.cc index 534c093e..a9deab3c 100644 --- a/lib/kformula/operatorelement.cc +++ b/lib/kformula/operatorelement.cc @@ -19,7 +19,7 @@ #include <algorithm> -#include <qpainter.h> +#include <tqpainter.h> #include <klocale.h> @@ -39,7 +39,7 @@ KFORMULA_NAMESPACE_BEGIN -OperatorElement::OperatorElement( BasicElement* parent ) : TokenElement( parent ), +OperatorElement::OperatorElement( BasicElement* tqparent ) : TokenElement( tqparent ), m_form( NoForm ), m_lspaceType( ThickMathSpace ), m_rspaceType( ThickMathSpace ), @@ -77,11 +77,11 @@ void OperatorElement::setForm( FormType type ) if ( ! isTextOnly() ) { // Only text content can be dictionary keys return; } - QString text; + TQString text; for ( uint i = 0; i < countChildren(); i++ ) { text.append( getChild( i )->getCharacter() ); } - QString form; + TQString form; switch ( m_form ) { case PrefixForm: form = "prefix"; @@ -159,7 +159,7 @@ void OperatorElement::setForm( FormType type ) * Token elements' content has to be of homogeneous type. Every token element * must (TODO: check this) appear inside a non-token sequence, and thus, if * the command asks for a different content, a new element has to be created in - * parent sequence. + * tqparent sequence. */ KCommand* OperatorElement::buildCommand( Container* container, Request* request ) { @@ -178,21 +178,21 @@ KCommand* OperatorElement::buildCommand( Container* container, Request* request } if ( countChildren() == 0 || cursor->getPos() == countChildren() ) { - // We are in the last position, so it's easy, call the parent to + // We are in the last position, so it's easy, call the tqparent to // create a new child - SequenceElement* parent = static_cast<SequenceElement*>( getParent() ); - if ( parent ) { - uint pos = parent->childPos( this ); - cursor->setTo( parent, pos + 1); - return parent->buildCommand( container, request ); + SequenceElement* tqparent = static_cast<SequenceElement*>( getParent() ); + if ( tqparent ) { + uint pos = tqparent->childPos( this ); + cursor->setTo( tqparent, pos + 1); + return tqparent->buildCommand( container, request ); } } if ( cursor->getPos() == 0 ) { - SequenceElement* parent = static_cast<SequenceElement*>( getParent() ); - if ( parent ) { - uint pos = parent->childPos( this ); - cursor->setTo( parent, pos ); - return parent->buildCommand( container, request ); + SequenceElement* tqparent = static_cast<SequenceElement*>( getParent() ); + if ( tqparent ) { + uint pos = tqparent->childPos( this ); + cursor->setTo( tqparent, pos ); + return tqparent->buildCommand( container, request ); } } @@ -200,7 +200,7 @@ KCommand* OperatorElement::buildCommand( Container* container, Request* request // a) Cut from mark to the end // b) Create a new token and add an element from key pressed // c) Create a new token and add elements cut previously - // d) Move cursor to parent so that it command execution works fine + // d) Move cursor to tqparent so that it command execution works fine switch( *request ) { case req_addTextChar: { @@ -211,9 +211,9 @@ KCommand* OperatorElement::buildCommand( Container* container, Request* request command->addCursor( cursor ); command->addToken( id ); command->addContent( id, text ); - SequenceElement* parent = static_cast< SequenceElement* >( getParent() ); - if ( parent ) { - cursor->setTo( parent, parent->childPos( this ) + 1 ); + SequenceElement* tqparent = static_cast< SequenceElement* >( getParent() ); + if ( tqparent ) { + cursor->setTo( tqparent, tqparent->childPos( this ) + 1 ); } return command; } @@ -228,9 +228,9 @@ KCommand* OperatorElement::buildCommand( Container* container, Request* request TextElement* text = creationStrategy->createTextElement( tr->text()[i] ); command->addContent( id, text ); } - SequenceElement* parent = static_cast< SequenceElement* >( getParent() ); - if ( parent ) { - cursor->setTo( parent, parent->childPos( this ) + 1 ); + SequenceElement* tqparent = static_cast< SequenceElement* >( getParent() ); + if ( tqparent ) { + cursor->setTo( tqparent, tqparent->childPos( this ) + 1 ); } return command; } @@ -243,9 +243,9 @@ KCommand* OperatorElement::buildCommand( Container* container, Request* request command->addCursor( cursor ); command->addToken( num ); command->addContent( num, text ); - SequenceElement* parent = static_cast< SequenceElement* >( getParent() ); - if ( parent ) { - cursor->setTo( parent, parent->childPos( this ) + 1 ); + SequenceElement* tqparent = static_cast< SequenceElement* >( getParent() ); + if ( tqparent ) { + cursor->setTo( tqparent, tqparent->childPos( this ) + 1 ); } return command; } @@ -269,13 +269,13 @@ KCommand* OperatorElement::buildCommand( Container* container, Request* request } -bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element ) +bool OperatorElement::readAttributesFromMathMLDom( const TQDomElement &element ) { if ( ! BasicElement::readAttributesFromMathMLDom( element ) ) { return false; } - QString formStr = element.attribute( "form" ).stripWhiteSpace().lower(); + TQString formStr = element.attribute( "form" ).stripWhiteSpace().lower(); if ( ! formStr.isNull() ) { m_customForm = true; if ( formStr == "prefix" ) { @@ -292,7 +292,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element ) m_customForm = false; } } - QString fenceStr = element.attribute( "fence" ).stripWhiteSpace().lower(); + TQString fenceStr = element.attribute( "fence" ).stripWhiteSpace().lower(); if ( ! fenceStr.isNull() ) { m_customFence = true; if ( fenceStr == "true" ) { @@ -306,7 +306,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element ) m_customFence = false; } } - QString separatorStr = element.attribute( "separator" ).stripWhiteSpace().lower(); + TQString separatorStr = element.attribute( "separator" ).stripWhiteSpace().lower(); if ( ! separatorStr.isNull() ) { m_customSeparator = true; if ( separatorStr == "true" ) { @@ -320,7 +320,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element ) m_customSeparator = false; } } - QString lspaceStr = element.attribute( "lspace" ).stripWhiteSpace().lower(); + TQString lspaceStr = element.attribute( "lspace" ).stripWhiteSpace().lower(); if ( ! lspaceStr.isNull() ) { m_customLSpace = true; m_lspace = getSize( lspaceStr, &m_lspaceType ); @@ -328,7 +328,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element ) m_lspaceType = getSpace( lspaceStr ); } } - QString rspaceStr = element.attribute( "rspace" ).stripWhiteSpace().lower(); + TQString rspaceStr = element.attribute( "rspace" ).stripWhiteSpace().lower(); if ( ! rspaceStr.isNull() ) { m_customRSpace = true; m_rspace = getSize( rspaceStr, &m_rspaceType ); @@ -336,7 +336,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element ) m_rspaceType = getSpace( rspaceStr ); } } - QString stretchyStr = element.attribute( "stretchy" ).stripWhiteSpace().lower(); + TQString stretchyStr = element.attribute( "stretchy" ).stripWhiteSpace().lower(); if ( ! stretchyStr.isNull() ) { m_customStretchy = true; if ( stretchyStr == "true" ) { @@ -350,7 +350,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element ) m_customStretchy = false; } } - QString symmetricStr = element.attribute( "symmetric" ).stripWhiteSpace().lower(); + TQString symmetricStr = element.attribute( "symmetric" ).stripWhiteSpace().lower(); if ( ! symmetricStr.isNull() ) { m_customSymmetric = true; if ( symmetricStr == "true" ) { @@ -364,7 +364,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element ) m_customSymmetric = false; } } - QString maxsizeStr = element.attribute( "maxsize" ).stripWhiteSpace().lower(); + TQString maxsizeStr = element.attribute( "maxsize" ).stripWhiteSpace().lower(); if ( ! maxsizeStr.isNull() ) { m_customMaxSize = true; if ( maxsizeStr == "infinity" ) { @@ -377,7 +377,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element ) } } } - QString minsizeStr = element.attribute( "minsize" ).stripWhiteSpace().lower(); + TQString minsizeStr = element.attribute( "minsize" ).stripWhiteSpace().lower(); if ( ! minsizeStr.isNull() ) { m_customMinSize = true; m_minSize = getSize( minsizeStr, &m_minSizeType ); @@ -385,7 +385,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element ) m_minSizeType = getSpace( minsizeStr ); } } - QString largeopStr = element.attribute( "largeop" ).stripWhiteSpace().lower(); + TQString largeopStr = element.attribute( "largeop" ).stripWhiteSpace().lower(); if ( ! largeopStr.isNull() ) { m_customLargeOp = true; if ( largeopStr == "true" ) { @@ -399,7 +399,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element ) m_customLargeOp = false; } } - QString movablelimitsStr = element.attribute( "movablelimits" ).stripWhiteSpace().lower(); + TQString movablelimitsStr = element.attribute( "movablelimits" ).stripWhiteSpace().lower(); if ( ! movablelimitsStr.isNull() ) { m_customMovableLimits = true; if ( movablelimitsStr == "true" ) { @@ -413,7 +413,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element ) m_customMovableLimits = false; } } - QString accentStr = element.attribute( "accent" ).stripWhiteSpace().lower(); + TQString accentStr = element.attribute( "accent" ).stripWhiteSpace().lower(); if ( ! accentStr.isNull() ) { m_customAccent = true; if ( accentStr == "true" ) { @@ -430,7 +430,7 @@ bool OperatorElement::readAttributesFromMathMLDom( const QDomElement &element ) return true; } -void OperatorElement::writeMathMLAttributes( QDomElement& element ) const +void OperatorElement::writeMathMLAttributes( TQDomElement& element ) const { if ( m_customForm ) { switch ( m_form ) { @@ -481,20 +481,20 @@ void OperatorElement::writeMathMLAttributes( QDomElement& element ) const } } -void OperatorElement::writeSizeAttribute( QDomElement& element, const QString &attr, SizeType type, double length ) const +void OperatorElement::writeSizeAttribute( TQDomElement& element, const TQString &attr, SizeType type, double length ) const { switch ( type ) { case InfinitySize: element.setAttribute( attr, "infinity" ); break; case AbsoluteSize: - element.setAttribute( attr, QString( "%1pt" ).arg( length ) ); + element.setAttribute( attr, TQString( "%1pt" ).tqarg( length ) ); break; case RelativeSize: - element.setAttribute( attr, QString( "%1% " ).arg( length * 100.0 ) ); + element.setAttribute( attr, TQString( "%1% " ).tqarg( length * 100.0 ) ); break; case PixelSize: - element.setAttribute( attr, QString( "%1px " ).arg( length ) ); + element.setAttribute( attr, TQString( "%1px " ).tqarg( length ) ); break; case NegativeVeryVeryThinMathSpace: element.setAttribute( attr, "negativeveryverythinmathspace" ); diff --git a/lib/kformula/operatorelement.h b/lib/kformula/operatorelement.h index 476b6e99..52c35537 100644 --- a/lib/kformula/operatorelement.h +++ b/lib/kformula/operatorelement.h @@ -27,7 +27,7 @@ KFORMULA_NAMESPACE_BEGIN class OperatorElement : public TokenElement { typedef TokenElement inherited; public: - OperatorElement( BasicElement* parent = 0 ); + OperatorElement( BasicElement* tqparent = 0 ); void setForm( FormType type ); /** @@ -40,11 +40,11 @@ public: */ virtual KCommand* buildCommand( Container*, Request* ); - virtual QString getElementName() const { return "mo"; } + virtual TQString getElementName() const { return "mo"; } private: - virtual bool readAttributesFromMathMLDom( const QDomElement &element ); - void writeMathMLAttributes( QDomElement& element ) const ; - void writeSizeAttribute( QDomElement& element, const QString &attr, SizeType type, double length ) const ; + virtual bool readAttributesFromMathMLDom( const TQDomElement &element ); + void writeMathMLAttributes( TQDomElement& element ) const ; + void writeSizeAttribute( TQDomElement& element, const TQString &attr, SizeType type, double length ) const ; FormType m_form; SizeType m_lspaceType; diff --git a/lib/kformula/paddedelement.cc b/lib/kformula/paddedelement.cc index f48d4503..f79e6789 100644 --- a/lib/kformula/paddedelement.cc +++ b/lib/kformula/paddedelement.cc @@ -22,7 +22,7 @@ KFORMULA_NAMESPACE_BEGIN -PaddedElement::PaddedElement( BasicElement* parent ) : SequenceElement( parent ), +PaddedElement::PaddedElement( BasicElement* tqparent ) : SequenceElement( tqparent ), m_widthType( NoSize ), m_lspaceType( NoSize ), m_heightType( NoSize ), @@ -36,7 +36,7 @@ PaddedElement::PaddedElement( BasicElement* parent ) : SequenceElement( parent ) /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ void PaddedElement::calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -60,13 +60,13 @@ void PaddedElement::calcSizes( const ContextStyle& context, width += it->getWidth() + spaceBefore; luPixel baseline = it->getBaseline(); if ( baseline > -1 ) { - height = QMAX( height, baseline ); - depth = QMAX( depth, it->getHeight() - baseline ); + height = TQMAX( height, baseline ); + depth = TQMAX( depth, it->getHeight() - baseline ); } else { luPixel bl = it->getHeight()/2 + context.axisHeight( tstyle, factor ); - height = QMAX( height, bl ); - depth = QMAX( depth, it->getHeight() - bl ); + height = TQMAX( height, bl ); + depth = TQMAX( depth, it->getHeight() - bl ); } } } @@ -110,25 +110,25 @@ void PaddedElement::calcSizes( const ContextStyle& context, } } -bool PaddedElement::readAttributesFromMathMLDom(const QDomElement& element) +bool PaddedElement::readAttributesFromMathMLDom(const TQDomElement& element) { if ( ! BasicElement::readAttributesFromMathMLDom( element ) ) { return false; } - QString widthStr = element.attribute( "width" ).stripWhiteSpace().lower(); + TQString widthStr = element.attribute( "width" ).stripWhiteSpace().lower(); if ( ! widthStr.isNull() ) { m_width = readSizeAttribute( widthStr, &m_widthType, &m_widthRelative ); } - QString lspaceStr = element.attribute( "lspace" ).stripWhiteSpace().lower(); + TQString lspaceStr = element.attribute( "lspace" ).stripWhiteSpace().lower(); if ( ! lspaceStr.isNull() ) { m_lspace = readSizeAttribute( lspaceStr, &m_lspaceType, &m_lspaceRelative ); } - QString heightStr = element.attribute( "height" ).stripWhiteSpace().lower(); + TQString heightStr = element.attribute( "height" ).stripWhiteSpace().lower(); if ( ! heightStr.isNull() ) { m_height = readSizeAttribute( heightStr, &m_heightType, &m_heightRelative ); } - QString depthStr = element.attribute( "depth" ).stripWhiteSpace().lower(); + TQString depthStr = element.attribute( "depth" ).stripWhiteSpace().lower(); if ( ! depthStr.isNull() ) { m_depth = readSizeAttribute( depthStr, &m_depthType, &m_depthRelative ); } @@ -136,7 +136,7 @@ bool PaddedElement::readAttributesFromMathMLDom(const QDomElement& element) return true; } -void PaddedElement::writeMathMLAttributes( QDomElement& element ) const +void PaddedElement::writeMathMLAttributes( TQDomElement& element ) const { writeSizeAttribute( element, "width", m_widthType, m_width, m_widthRelative ); writeSizeAttribute( element, "lspace", m_lspaceType, m_lspace, m_lspaceRelative ); @@ -144,7 +144,7 @@ void PaddedElement::writeMathMLAttributes( QDomElement& element ) const writeSizeAttribute( element, "depth", m_depthType, m_depth, m_depthRelative ); } -double PaddedElement::readSizeAttribute( const QString& str, SizeType* st, bool* relative ) +double PaddedElement::readSizeAttribute( const TQString& str, SizeType* st, bool* relative ) { if ( st == 0 ){ return -1; @@ -152,55 +152,55 @@ double PaddedElement::readSizeAttribute( const QString& str, SizeType* st, bool* if ( str[0] == '+' || str[0] == '-' ) { *relative = true; } - int index = str.find( "width" ); + int index = str.tqfind( "width" ); if ( index != -1 ) { - int index2 = str.find( "%" ); + int index2 = str.tqfind( "%" ); if ( index2 != -1 ) { return str2size( str.left( index2 ).stripWhiteSpace(), st, WidthRelativeSize ) / 100.0; } return str2size( str.left( index ).stripWhiteSpace(), st, WidthRelativeSize ); } - index = str.find( "height" ); + index = str.tqfind( "height" ); if ( index != -1 ) { - int index2 = str.find( "%" ); + int index2 = str.tqfind( "%" ); if ( index2 != -1 ) { return str2size( str.left( index2 ).stripWhiteSpace(), st, HeightRelativeSize ) / 100.0; } return str2size( str.left( index ).stripWhiteSpace(), st, HeightRelativeSize ); } - index = str.find( "%" ); + index = str.tqfind( "%" ); if ( index != -1 ) { return str2size( str.left( index ).stripWhiteSpace(), st, RelativeSize ) / 100.0; } - index = str.find( "pt", 0, false ); + index = str.tqfind( "pt", 0, false ); if ( index != -1 ) { return str2size( str.left( index ).stripWhiteSpace(), st, AbsoluteSize ); } - index = str.find( "mm", 0, false ); + index = str.tqfind( "mm", 0, false ); if ( index != -1 ) { return str2size( str.left( index ).stripWhiteSpace(), st, AbsoluteSize ) * 72.0 / 20.54; } - index = str.find( "cm", 0, false ); + index = str.tqfind( "cm", 0, false ); if ( index != -1 ) { return str2size( str.left( index ).stripWhiteSpace(), st, AbsoluteSize ) * 72.0 / 2.54; } - index = str.find( "in", 0, false ); + index = str.tqfind( "in", 0, false ); if ( index != -1 ) { return str2size( str.left( index ).stripWhiteSpace(), st, AbsoluteSize ) * 72.0; } - index = str.find( "em", 0, false ); + index = str.tqfind( "em", 0, false ); if ( index != -1 ) { return str2size( str.left( index ).stripWhiteSpace(), st, RelativeSize ); } - index = str.find( "ex", 0, false ); + index = str.tqfind( "ex", 0, false ); if ( index != -1 ) { return str2size( str.left( index ).stripWhiteSpace(), st, RelativeSize ); } - index = str.find( "pc", 0, false ); + index = str.tqfind( "pc", 0, false ); if ( index != -1 ) { return str2size( str.left( index ).stripWhiteSpace(), st, AbsoluteSize ) * 12.0; } - index = str.find( "px", 0, false ); + index = str.tqfind( "px", 0, false ); if ( index != -1 ) { return str2size( str.left( index ).stripWhiteSpace(), st, PixelSize ); } @@ -208,7 +208,7 @@ double PaddedElement::readSizeAttribute( const QString& str, SizeType* st, bool* return str2size( str, st, AbsoluteSize ); } -double PaddedElement::str2size( const QString& str, SizeType *st, SizeType type ) +double PaddedElement::str2size( const TQString& str, SizeType *st, SizeType type ) { bool ok; double size = str.toDouble( &ok ); @@ -224,27 +224,27 @@ double PaddedElement::str2size( const QString& str, SizeType *st, SizeType type return -1; } -void PaddedElement::writeSizeAttribute( QDomElement element, const QString& str, +void PaddedElement::writeSizeAttribute( TQDomElement element, const TQString& str, SizeType st, bool relative, double s ) const { - QString prefix; + TQString prefix; if ( relative ) { s < 0 ? prefix = "-" : prefix = "+" ; } switch ( st ) { case WidthRelativeSize: - element.setAttribute( str, prefix + QString( "%1 width" ).arg( s ) ); + element.setAttribute( str, prefix + TQString( "%1 width" ).tqarg( s ) ); break; case HeightRelativeSize: - element.setAttribute( str, prefix + QString( "%1 height" ).arg( s ) ); + element.setAttribute( str, prefix + TQString( "%1 height" ).tqarg( s ) ); case AbsoluteSize: - element.setAttribute( str, prefix + QString( "%1pt" ).arg( s ) ); + element.setAttribute( str, prefix + TQString( "%1pt" ).tqarg( s ) ); break; case RelativeSize: - element.setAttribute( str, prefix + QString( "%1%" ).arg( s * 100.0 ) ); + element.setAttribute( str, prefix + TQString( "%1%" ).tqarg( s * 100.0 ) ); break; case PixelSize: - element.setAttribute( str, prefix + QString( "%1px" ).arg( s ) ); + element.setAttribute( str, prefix + TQString( "%1px" ).tqarg( s ) ); break; default: break; diff --git a/lib/kformula/paddedelement.h b/lib/kformula/paddedelement.h index 591f87bf..6d552837 100644 --- a/lib/kformula/paddedelement.h +++ b/lib/kformula/paddedelement.h @@ -28,11 +28,11 @@ class PaddedElement : public SequenceElement { typedef SequenceElement inherited; enum SizeType { NoSize, RelativeSize, AbsoluteSize, PixelSize, WidthRelativeSize, HeightRelativeSize }; public: - PaddedElement( BasicElement* parent = 0 ); + PaddedElement( BasicElement* tqparent = 0 ); /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, @@ -40,16 +40,16 @@ public: StyleAttributes& style ); protected: - virtual bool readAttributesFromMathMLDom(const QDomElement& element); + virtual bool readAttributesFromMathMLDom(const TQDomElement& element); private: - virtual QString getElementName() const { return "mpadded"; } - virtual void writeMathMLAttributes( QDomElement& element ) const ; + virtual TQString getElementName() const { return "mpadded"; } + virtual void writeMathMLAttributes( TQDomElement& element ) const ; - double readSizeAttribute( const QString& str, SizeType* st, bool* relative ); - double getSize( const QString& str, SizeType* st ); - double str2size( const QString& str, SizeType* st, SizeType type ); - void writeSizeAttribute( QDomElement element, const QString& str, + double readSizeAttribute( const TQString& str, SizeType* st, bool* relative ); + double getSize( const TQString& str, SizeType* st ); + double str2size( const TQString& str, SizeType* st, SizeType type ); + void writeSizeAttribute( TQDomElement element, const TQString& str, SizeType st, bool relative, double s ) const ; luPixel calcSize( const ContextStyle& context, SizeType type, bool relative, double length, luPixel width, diff --git a/lib/kformula/phantomelement.cc b/lib/kformula/phantomelement.cc index 2aff0dcd..662ec53d 100644 --- a/lib/kformula/phantomelement.cc +++ b/lib/kformula/phantomelement.cc @@ -21,16 +21,16 @@ KFORMULA_NAMESPACE_BEGIN -PhantomElement::PhantomElement( BasicElement* parent ) : SequenceElement( parent ) +PhantomElement::PhantomElement( BasicElement* tqparent ) : SequenceElement( tqparent ) { } /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ -void PhantomElement::draw( QPainter&, const LuPixelRect&, const ContextStyle&, +void PhantomElement::draw( TQPainter&, const LuPixelRect&, const ContextStyle&, ContextStyle::TextStyle, ContextStyle::IndexStyle, StyleAttributes&, const LuPixelPoint& ) { diff --git a/lib/kformula/phantomelement.h b/lib/kformula/phantomelement.h index 01880d7b..885a9651 100644 --- a/lib/kformula/phantomelement.h +++ b/lib/kformula/phantomelement.h @@ -27,22 +27,22 @@ KFORMULA_NAMESPACE_BEGIN class PhantomElement : public SequenceElement { typedef SequenceElement inherited; public: - PhantomElement( BasicElement* parent = 0 ); + PhantomElement( BasicElement* tqparent = 0 ); /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); private: - virtual QString getElementName() const { return "mphantom"; } + virtual TQString getElementName() const { return "mphantom"; } }; diff --git a/lib/kformula/prototype/engine.py b/lib/kformula/prototype/engine.py index f1391069..0ce870cf 100644 --- a/lib/kformula/prototype/engine.py +++ b/lib/kformula/prototype/engine.py @@ -24,8 +24,8 @@ from qt import * class BasicElement: """The interface for every element.""" - def __init__(self, parent): - self.parent = parent + def __init__(self, tqparent): + self.tqparent = tqparent self.size = QSize() self.pos = QPoint() @@ -47,7 +47,7 @@ class BasicElement: while element != None: x += element.x() y += element.y() - element = element.parent + element = element.tqparent return QPoint(x, y) def elementAt(self, point, startPoint): @@ -79,19 +79,19 @@ class BasicElement: def formula(self): """Returns the FormulaElement we are a child of.""" - return self.parent.formula() + return self.tqparent.formula() def draw(self, painter, styleContext, startPoint): - """Draws the whole thing. Including its children.""" + """Draws the whole thing. Including its tqchildren.""" pass def calcSizes(self, styleContext): """Recalculates the size. - position (relative our to parent), width and height + position (relative our to tqparent), width and height will be stored in self.size, the midline offset in self.midline. - Please note: It's up to a parent to store its children's position.""" + Please note: It's up to a tqparent to store its tqchildren's position.""" pass def mainChild(self): @@ -116,22 +116,22 @@ class BasicElement: class SequenceElement (BasicElement): - """The element that contains a number of children. - The children are aligned in one line.""" + """The element that contains a number of tqchildren. + The tqchildren are aligned in one line.""" - def __init__(self, parent): - BasicElement.__init__(self, parent) - self.children = [] + def __init__(self, tqparent): + BasicElement.__init__(self, tqparent) + self.tqchildren = [] def elementAtCursor(self, cursor): """Returns the element before the cursor.""" if cursor.pos() > 0: - return self.children[cursor.pos()-1] + return self.tqchildren[cursor.pos()-1] def elementAt(self, point, startPoint): r = BasicElement.elementAt(self, point, startPoint) if r != None: - for child in self.children: + for child in self.tqchildren: r = child.elementAt(point, QPoint(startPoint.x()+child.x(), startPoint.y()+child.y())) if r != None: @@ -141,9 +141,9 @@ class SequenceElement (BasicElement): def moveLeft(self, cursor, fromElement): - # Our parent asks us for a cursor position. Found. - if fromElement == self.parent: - cursor.set(self, len(self.children)) + # Our tqparent asks us for a cursor position. Found. + if fromElement == self.tqparent: + cursor.set(self, len(self.tqchildren)) # We already owned the cursor. Ask next child then. elif fromElement == self: @@ -151,16 +151,16 @@ class SequenceElement (BasicElement): if cursor.isSelection(): cursor.set (self, cursor.pos()-1) else: - self.children[cursor.pos()-1].moveLeft(cursor, self) + self.tqchildren[cursor.pos()-1].moveLeft(cursor, self) else: # Needed because FormulaElement derives this. - if self.parent != None: - self.parent.moveLeft(cursor, self) + if self.tqparent != None: + self.tqparent.moveLeft(cursor, self) - # The cursor came from one of our children or + # The cursor came from one of our tqchildren or # something is wrong. else: - fromPos = self.children.index(fromElement) + fromPos = self.tqchildren.index(fromElement) cursor.set(self, fromPos) if cursor.isSelection(): if not cursor.mouseMark(): @@ -169,26 +169,26 @@ class SequenceElement (BasicElement): def moveRight(self, cursor, fromElement): - # Our parent asks us for a cursor position. Found. - if fromElement == self.parent: + # Our tqparent asks us for a cursor position. Found. + if fromElement == self.tqparent: cursor.set(self, 0) # We already owned the cursor. Ask next child then. elif fromElement == self: - if cursor.pos() < len(self.children): + if cursor.pos() < len(self.tqchildren): if cursor.isSelection(): cursor.set (self, cursor.pos()+1) else: - self.children[cursor.pos()].moveRight(cursor, self) + self.tqchildren[cursor.pos()].moveRight(cursor, self) else: # Needed because FormulaElement derives this. - if self.parent != None: - self.parent.moveRight(cursor, self) + if self.tqparent != None: + self.tqparent.moveRight(cursor, self) - # The cursor came from one of our children or + # The cursor came from one of our tqchildren or # something is wrong. else: - fromPos = self.children.index(fromElement) + fromPos = self.tqchildren.index(fromElement) cursor.set(self, fromPos+1) if cursor.isSelection(): if not cursor.mouseMark(): @@ -196,44 +196,44 @@ class SequenceElement (BasicElement): def moveUp(self, cursor, fromElement): - if fromElement == self.parent: + if fromElement == self.tqparent: self.moveRight(cursor, self) else: - if self.parent != None: - self.parent.moveUp(cursor, self) + if self.tqparent != None: + self.tqparent.moveUp(cursor, self) def moveDown(self, cursor, fromElement): - if fromElement == self.parent: + if fromElement == self.tqparent: self.moveRight(cursor, self) else: - if self.parent != None: - self.parent.moveDown(cursor, self) + if self.tqparent != None: + self.tqparent.moveDown(cursor, self) def moveHome(self, cursor): if cursor.isSelection(): element = cursor.element() if element != self: - while element.parent != self: - element = element.parent - cursor.setMarkPos(self.children.index(element)+1) + while element.tqparent != self: + element = element.tqparent + cursor.setMarkPos(self.tqchildren.index(element)+1) cursor.set(self, 0) def moveEnd(self, cursor): if cursor.isSelection(): element = cursor.element() if element != self: - while element.parent != self: - element = element.parent - cursor.setMarkPos(self.children.index(element)) - cursor.set(self, len(self.children)) + while element.tqparent != self: + element = element.tqparent + cursor.setMarkPos(self.tqchildren.index(element)) + cursor.set(self, len(self.tqchildren)) def draw(self, painter, styleContext, startPoint): x, y = startPoint.x(), startPoint.y() - if len(self.children) > 0: - for child in self.children: + if len(self.tqchildren) > 0: + for child in self.tqchildren: cX = child.x() cY = child.y() child.draw(painter, styleContext, QPoint(x+cX, y+cY)) @@ -246,11 +246,11 @@ class SequenceElement (BasicElement): painter.drawRect(x, y, self.width(), self.height()) def calcSizes(self, styleContext): - if len(self.children) > 0: + if len(self.tqchildren) > 0: x = self.x() y = self.y() width = toMidline = fromMidline = 0 - for child in self.children: + for child in self.tqchildren: child.calcSizes(styleContext) child.setX(width) width += child.width() @@ -263,7 +263,7 @@ class SequenceElement (BasicElement): self.setHeight(toMidline+fromMidline) self.midline = toMidline - for child in self.children: + for child in self.tqchildren: child.setY(self.midline - child.midline) else: @@ -272,14 +272,14 @@ class SequenceElement (BasicElement): self.midline = 5 def mainChild(self): - if len(self.children) > 0: - return self.children[0] + if len(self.tqchildren) > 0: + return self.tqchildren[0] return None def setMainChild(self, sequenceElement): - if len(self.children) > 0: - self.children[0] = sequenceElement - sequenceElement.parent = self + if len(self.tqchildren) > 0: + self.tqchildren[0] = sequenceElement + sequenceElement.tqparent = self else: self.addChild(sequenceElement) @@ -292,23 +292,23 @@ class SequenceElement (BasicElement): the cursor) with the given element. The replaced sequence becomes the main child of the new element.""" - # it is essential to set up the parent pointer for + # it is essential to set up the tqparent pointer for # the notification to work. - element.parent = self + element.tqparent = self seq = element.makeSequence() if cursor.isSelection(): f = min(cursor.pos(), cursor.markPos()) t = max(cursor.pos(), cursor.markPos()) for i in range(f, t): - child = self.children.pop(f) + child = self.tqchildren.pop(f) self.formula().elementRemoved(child) seq.addChild(child) - self.children.insert(f, element) + self.tqchildren.insert(f, element) cursor.setMarkPos(-1) cursor.set(self, f+1) elif cursor.pos() > 0: - seq.addChild(self.children[cursor.pos()-1]) + seq.addChild(self.tqchildren[cursor.pos()-1]) self.replaceChild(cursor, element) else: self.insertChild(cursor, element) @@ -319,48 +319,48 @@ class SequenceElement (BasicElement): def replaceElementByMainChild(self, cursor, element): """Replaces the given element with the content of its main child. (The main child is always a SequenceElement.)""" - assert element.parent == self + assert element.tqparent == self self.formula().elementRemoved(element) seq = element.mainChild() - pos = self.children.index(element) - self.children.remove(element) - for child in seq.children: - self.children.insert(pos, child) - child.parent = self + pos = self.tqchildren.index(element) + self.tqchildren.remove(element) + for child in seq.tqchildren: + self.tqchildren.insert(pos, child) + child.tqparent = self pos += 1 cursor.set(self, pos) self.formula().changed() def addChild(self, element): - self.children.append(element) - element.parent = self + self.tqchildren.append(element) + element.tqparent = self self.formula().changed() def insertChild(self, cursor, element): """Inserts the new element at the cursor position. The cursor is placed behind the new element.""" pos = cursor.pos() - self.children.insert(pos, element) - element.parent = self + self.tqchildren.insert(pos, element) + element.tqparent = self cursor.set(self, pos+1) self.formula().changed() def replaceChild(self, cursor, element): """Replaces the element before the cursor with the new one. No range checking. Be careful.""" - self.children[cursor.pos()-1] = element - element.parent = self + self.tqchildren[cursor.pos()-1] = element + element.tqparent = self self.formula().changed() def removeChild(self, cursor, element): self.formula().elementRemoved(element) - cursor.set(self, self.children.index(element)) - self.children.remove(element) - if len(self.children) == 0: - if self.parent != None: - self.parent.removeChild(cursor, self) + cursor.set(self, self.tqchildren.index(element)) + self.tqchildren.remove(element) + if len(self.tqchildren) == 0: + if self.tqparent != None: + self.tqparent.removeChild(cursor, self) return self.formula().changed() @@ -370,18 +370,18 @@ class SequenceElement (BasicElement): f = min(cursor.pos(), cursor.markPos()) t = max(cursor.pos(), cursor.markPos()) for i in range(f, t): - child = self.children.pop(f) + child = self.tqchildren.pop(f) self.formula().elementRemoved(child) cursor.setMarkPos(-1) cursor.set(self, f) self.formula().changed() - elif pos < len(self.children): - self.children.pop(pos) + elif pos < len(self.tqchildren): + self.tqchildren.pop(pos) self.formula().changed() else: - if len(self.children) == 0: - if self.parent != None: - self.parent.removeChild(cursor, self) + if len(self.tqchildren) == 0: + if self.tqparent != None: + self.tqparent.removeChild(cursor, self) def removeChildBefore(self, cursor): pos = cursor.pos()-1 @@ -389,29 +389,29 @@ class SequenceElement (BasicElement): f = min(cursor.pos(), cursor.markPos()) t = max(cursor.pos(), cursor.markPos()) for i in range(f, t): - child = self.children.pop(f) + child = self.tqchildren.pop(f) self.formula().elementRemoved(child) cursor.setMarkPos(-1) cursor.set(self, f) self.formula().changed() elif pos >= 0: - self.children.pop(pos) + self.tqchildren.pop(pos) cursor.set(self, pos) self.formula().changed() else: - if len(self.children) == 0: - if self.parent != None: - self.parent.removeChild(cursor, self) + if len(self.tqchildren) == 0: + if self.tqparent != None: + self.tqparent.removeChild(cursor, self) def globalCursorPos(self, pos): """Returns the position after the child at the position in global Coords.""" point = self.globalPos() - if pos < len(self.children): - d = self.children[pos].x() + if pos < len(self.tqchildren): + d = self.tqchildren[pos].x() else: - if len(self.children) > 0: + if len(self.tqchildren) > 0: d = self.width() else: d = 2 @@ -420,13 +420,13 @@ class SequenceElement (BasicElement): return point def countChildren(self): - return len(self.children) + return len(self.tqchildren) class FormulaElement (SequenceElement): """The main element. - A formula consists of a FormulaElement and its children. - The only element that has no parent.""" + A formula consists of a FormulaElement and its tqchildren. + The only element that has no tqparent.""" def __init__(self, document): SequenceElement.__init__(self, None) @@ -436,7 +436,7 @@ class FormulaElement (SequenceElement): return self def changed(self): - """Is called by its children if the formula changed in any way.""" + """Is called by its tqchildren if the formula changed in any way.""" self.document.changed() def elementRemoved(self, element): @@ -452,15 +452,15 @@ class FormulaElement (SequenceElement): class TextElement (BasicElement): """One char.""" - def __init__(self, parent, char): - BasicElement.__init__(self, parent) + def __init__(self, tqparent, char): + BasicElement.__init__(self, tqparent) self.char = char def moveLeft(self, cursor, fromElement): - self.parent.moveLeft(cursor, self) + self.tqparent.moveLeft(cursor, self) def moveRight(self, cursor, fromElement): - self.parent.moveRight(cursor, self) + self.tqparent.moveRight(cursor, self) def draw(self, painter, styleContext, startPoint): styleContext.setupPainter(painter) @@ -480,8 +480,8 @@ class IndexElement (BasicElement): def __init__(self, contentElement): if contentElement != None: - BasicElement.__init__(self, contentElement.parent) - contentElement.parent = self + BasicElement.__init__(self, contentElement.tqparent) + contentElement.tqparent = self else: BasicElement.__init__(self, None) @@ -525,9 +525,9 @@ class IndexElement (BasicElement): assert fromElement != None if cursor.isSelection(): - self.parent.moveLeft(cursor, self) + self.tqparent.moveLeft(cursor, self) - elif fromElement == self.parent: + elif fromElement == self.tqparent: if self.lowerRight != None: self.lowerRight.moveLeft(cursor, self) elif self.upperRight != None: @@ -550,25 +550,25 @@ class IndexElement (BasicElement): elif self.upperLeft != None: self.upperLeft.moveLeft(cursor, self) else: - self.parent.moveLeft(cursor, self) + self.tqparent.moveLeft(cursor, self) elif fromElement == self.lowerLeft: if self.upperLeft != None: self.upperLeft.moveLeft(cursor, self) else: - self.parent.moveLeft(cursor, self) + self.tqparent.moveLeft(cursor, self) else: - self.parent.moveLeft(cursor, self) + self.tqparent.moveLeft(cursor, self) def moveRight(self, cursor, fromElement): assert fromElement != None if cursor.isSelection(): - self.parent.moveRight(cursor, self) + self.tqparent.moveRight(cursor, self) - elif fromElement == self.parent: + elif fromElement == self.tqparent: if self.upperLeft != None: self.upperLeft.moveRight(cursor, self) elif self.lowerLeft != None: @@ -591,26 +591,26 @@ class IndexElement (BasicElement): elif self.lowerRight != None: self.lowerRight.moveRight(cursor, self) else: - self.parent.moveRight(cursor, self) + self.tqparent.moveRight(cursor, self) elif fromElement == self.upperRight: if self.lowerRight != None: self.lowerRight.moveRight(cursor, self) else: - self.parent.moveRight(cursor, self) + self.tqparent.moveRight(cursor, self) else: - self.parent.moveRight(cursor, self) + self.tqparent.moveRight(cursor, self) def moveUp(self, cursor, fromElement): assert fromElement != None - if fromElement == self.parent: + if fromElement == self.tqparent: self.content.moveRight(cursor, self) elif fromElement == self.upperLeft or fromElement == self.upperRight: - self.parent.moveUp(cursor, self) + self.tqparent.moveUp(cursor, self) elif fromElement == self.content: if self.upperRight != None: @@ -619,7 +619,7 @@ class IndexElement (BasicElement): #self.upperLeft.moveRight(cursor, self) self.upperLeft.moveLeft(cursor, self) else: - self.parent.moveUp(cursor, self) + self.tqparent.moveUp(cursor, self) elif fromElement == self.lowerLeft: self.content.moveRight(cursor, self) @@ -628,17 +628,17 @@ class IndexElement (BasicElement): self.content.moveLeft(cursor, self) else: # should never happen. - self.parent.moveUp(cursor, self) + self.tqparent.moveUp(cursor, self) def moveDown(self, cursor, fromElement): assert fromElement != None - if fromElement == self.parent: + if fromElement == self.tqparent: self.content.moveRight(cursor, self) elif fromElement == self.lowerLeft or fromElement == self.lowerRight: - self.parent.moveDown(cursor, fromElement) + self.tqparent.moveDown(cursor, fromElement) elif fromElement == self.content: if self.lowerRight != None: @@ -647,7 +647,7 @@ class IndexElement (BasicElement): #self.lowerLeft.moveRight(cursor, self) self.lowerLeft.moveLeft(cursor, self) else: - self.parent.moveDown(cursor, self) + self.tqparent.moveDown(cursor, self) elif fromElement == self.upperLeft: self.content.moveRight(cursor, self) @@ -656,7 +656,7 @@ class IndexElement (BasicElement): self.content.moveLeft(cursor, self) else: # should never happen. - self.parent.moveDown(cursor, self) + self.tqparent.moveDown(cursor, self) def draw(self, painter, styleContext, startPoint): @@ -783,7 +783,7 @@ class IndexElement (BasicElement): def setMainChild(self, sequenceElement): self.content = sequenceElement - self.content.parent = self + self.content.tqparent = self self.formula().changed() def removeChild(self, cursor, element): @@ -804,12 +804,12 @@ class IndexElement (BasicElement): self.content.moveLeft(cursor, self) self.lowerRight = None elif element == self.content: - self.parent.removeChild(cursor, self) + self.tqparent.removeChild(cursor, self) return if self.upperLeft == None and self.lowerLeft == None and \ self.upperRight == None and self.lowerRight == None: - self.parent.replaceElementByMainChild(cursor, self) + self.tqparent.replaceElementByMainChild(cursor, self) else: self.formula().changed() @@ -876,7 +876,7 @@ class Cursor: return self.currentMarkPos def setMarkPos(self, markPos): - """Gets called by elements if the cursor moves up to the parent.""" + """Gets called by elements if the cursor moves up to the tqparent.""" self.selectionFlag = (markPos != -1) self.currentMarkPos = markPos @@ -916,10 +916,10 @@ class Cursor: if isinstance(element, IndexElement): return element if self.pos() == self.sequenceElement.countChildren(): - parent = self.sequenceElement.parent - if isinstance(parent, IndexElement): - if self.sequenceElement == parent.mainChild(): - return parent + tqparent = self.sequenceElement.tqparent + if isinstance(tqparent, IndexElement): + if self.sequenceElement == tqparent.mainChild(): + return tqparent def addUpperRightIndex(self): @@ -929,7 +929,7 @@ class Cursor: self.sequenceElement.replaceCurrentSelection(self, indexElement) index = indexElement.requireUpperRight() - index.moveRight(self, index.parent) + index.moveRight(self, index.tqparent) def addLowerRightIndex(self): @@ -939,7 +939,7 @@ class Cursor: self.sequenceElement.replaceCurrentSelection(self, indexElement) index = indexElement.requireLowerRight() - index.moveRight(self, index.parent) + index.moveRight(self, index.tqparent) def addTextElement(self, char): @@ -1018,8 +1018,8 @@ class Cursor: formula = self.sequenceElement.formula() element = formula.elementAt(mouseEvent.pos(), QPoint(0, 0)) if element != None: - if element.parent != None: - element.moveLeft(self, element.parent) + if element.tqparent != None: + element.moveLeft(self, element.tqparent) self.selectionFlag = 0 self.mouseMarkFlag = 1 self.setMarkPos(self.pos()) @@ -1034,8 +1034,8 @@ class Cursor: formula = self.sequenceElement.formula() element = formula.elementAt(mouseEvent.pos(), QPoint(0, 0)) if element != None: - if element.parent != None: - element.parent.moveLeft(self, element) + if element.tqparent != None: + element.tqparent.moveLeft(self, element) def elementRemoved(self, element): @@ -1046,10 +1046,10 @@ class Cursor: if e == element: # This is meant to catch all cursors that did not # cause the deletion. - e.parent.moveRight(self, e) + e.tqparent.moveRight(self, e) self.sequenceElement.moveHome(self) return - e = e.parent + e = e.tqparent class StyleContext: diff --git a/lib/kformula/prototype/gensymbolfontmap.py b/lib/kformula/prototype/gensymbolfontmap.py index a1373815..c06376d8 100644 --- a/lib/kformula/prototype/gensymbolfontmap.py +++ b/lib/kformula/prototype/gensymbolfontmap.py @@ -3,7 +3,7 @@ import time from xml.sax import saxutils, handler, make_parser -unicodetable = { "normal":{}, "bold":{}, "italic":{}, +tqunicodetable = { "normal":{}, "bold":{}, "italic":{}, "slant":{}, "boldItalic":{} } fonttable = {} @@ -14,7 +14,7 @@ class ContentGenerator(handler.ContentHandler): self.font = None def startElement(self, name, attrs): - if name == 'unicodetable': + if name == 'tqunicodetable': self.font = None for (name, value) in attrs.items(): if name == "font" and value: @@ -31,7 +31,7 @@ class ContentGenerator(handler.ContentHandler): elif name == "style": style = value if number != '': - unicodetable[style][number] = (latexName, charClass) + tqunicodetable[style][number] = (latexName, charClass) fonttable[self.font].append((key, number, style)) def fontkey(font, style, number): @@ -43,9 +43,9 @@ def fontkey(font, style, number): def writeFontTable(fontname, f): f.write('\n\nstatic InternFontTable ' + fontname + 'Map[] = {\n') - for style in unicodetable: - for key in unicodetable[style]: - latexName, charClass = unicodetable[style][key] + for style in tqunicodetable: + for key in tqunicodetable[style]: + latexName, charClass = tqunicodetable[style][key] pos = fontkey(fontname, style, key) if pos: f.write(' { ' + key + ', ' + hex(pos) + ', ' + charClass + ', ' + style + 'Char },\n') @@ -107,14 +107,14 @@ def main(): writeFontTable(fn, f) f.close() - f = open('../unicodenames.cc', 'w') + f = open('../tqunicodenames.cc', 'w') write_header(f) - print >>f, 'struct UnicodeNameTable { short unicode; const char* name; };' + print >>f, 'struct UnicodeNameTable { short tqunicode; const char* name; };' print >>f, 'static UnicodeNameTable nameTable[] = {' nameDir = {} table = {} - for style in unicodetable: - table.update(unicodetable[style]) + for style in tqunicodetable: + table.update(tqunicodetable[style]) for key in table: latexName, charClass = table[key] @@ -128,10 +128,10 @@ def main(): -def make_unicode_table(): +def make_tqunicode_table(): header = [] codes = {} - f = open('../config/unicode.tbl', 'r') + f = open('../config/tqunicode.tbl', 'r') for line in f.xreadlines(): if line[0] == '#': header.append(line.strip()) @@ -142,14 +142,14 @@ def make_unicode_table(): codes[line.split(',')[0].strip()] = line f.close() - for key in unicodetable: - latexName, charClass = unicodetable[key] + for key in tqunicodetable: + latexName, charClass = tqunicodetable[key] if len(latexName) > 0: - codes[key] = key + ', ' + charClass + ', ' + latexName.replace('\\', '') + codes[key] = key + ', ' + charClass + ', ' + latexName.tqreplace('\\', '') else: codes[key] = key + ', ' + charClass - f = open('../config/unicode.tbl', 'w') + f = open('../config/tqunicode.tbl', 'w') for line in header: print >> f, line for key in codes: @@ -174,8 +174,8 @@ def make_font_table(font): ## for line in header: ## print >> f, line #print >> f, "name = " + font - for key in unicodetable: - latexName, charClass = unicodetable[key] + for key in tqunicodetable: + latexName, charClass = tqunicodetable[key] pos = fontkey(font, key) if pos: print >> f, str(pos), key, charClass, latexName @@ -186,30 +186,30 @@ def make_all_font_tables(): make_font_table(font) -def symbol_entry(pos, unicode, charClass, name): +def symbol_entry(pos, tqunicode, charClass, name): return ' <entry key="%d" number="%s" name="%s" class="%s"/>' % \ - (pos, unicode, name, charClass) + (pos, tqunicode, name, charClass) def compare_font(font): for line in file(font+".font"): list = line.split() pos = int(list[0]) - unicode = list[1] + tqunicode = list[1] charClass = list[2] if len(list)>3: name = list[3] else: name = "" - if (pos, unicode) not in fonttable[font]: - print "not in font", font, (pos, unicode) - print symbol_entry(pos, unicode, charClass, name) - if unicode not in unicodetable: - print font, unicode, (name, charClass) - print symbol_entry(pos, unicode, charClass, name) - elif unicodetable[unicode] != (name, charClass): - print font, unicode, pos, unicodetable[unicode], "!=", (name, charClass) + if (pos, tqunicode) not in fonttable[font]: + print "not in font", font, (pos, tqunicode) + print symbol_entry(pos, tqunicode, charClass, name) + if tqunicode not in tqunicodetable: + print font, tqunicode, (name, charClass) + print symbol_entry(pos, tqunicode, charClass, name) + elif tqunicodetable[tqunicode] != (name, charClass): + print font, tqunicode, pos, tqunicodetable[tqunicode], "!=", (name, charClass) def compare(): fontnames = [ "symbol", @@ -241,10 +241,10 @@ if __name__ == '__main__': parser.parse("symbol.xml") #print fonttable - #print unicodetable + #print tqunicodetable #compare() main() - #make_unicode_table() + #make_tqunicode_table() #make_all_font_tables() diff --git a/lib/kformula/prototype/unicode.py b/lib/kformula/prototype/unicode.py index 3559711d..5f5f2138 100755 --- a/lib/kformula/prototype/unicode.py +++ b/lib/kformula/prototype/unicode.py @@ -5,8 +5,8 @@ from qt import * from xml.sax import saxutils, handler, make_parser class Form1(QWidget): - def __init__(self,parent = None,name = None,fl = 0): - QWidget.__init__(self,parent,name,fl) + def __init__(self,tqparent = None,name = None,fl = 0): + QWidget.__init__(self,tqparent,name,fl) if name == None: self.setName('Form1') @@ -48,7 +48,7 @@ class Form1(QWidget): return list def setFont(self, fontName, font): - fontName = fontName.replace("%20", " ") + fontName = fontName.tqreplace("%20", " ") self.fontName = fontName for i in self.chars: charLabel, number, latexName, charClass = self.chars[i] @@ -130,7 +130,7 @@ class Widget(QWidget): print >> f, '<?xml version="1.0" encoding="iso-8859-1"?>' print >> f, '<table>' for font in self.fonts: - print >> f, ' <unicodetable font="' + font + '">' + print >> f, ' <tqunicodetable font="' + font + '">' for (key, number, latexName, charClass) in self.fonts[font]: if not charClass or charClass == '': charClass = 'ORDINARY' @@ -140,7 +140,7 @@ class Widget(QWidget): '" class="' + str(charClass) + \ '"/>' - print >> f, ' </unicodetable>' + print >> f, ' </tqunicodetable>' print >> f, '</table>' f.close() @@ -152,7 +152,7 @@ class ContentGenerator(handler.ContentHandler): self.currentFont = None def startElement(self, name, attrs): - if name == 'unicodetable': + if name == 'tqunicodetable': for (name, value) in attrs.items(): if name == "font": self.currentFont = value diff --git a/lib/kformula/rootelement.cc b/lib/kformula/rootelement.cc index 08a738f2..098d069f 100644 --- a/lib/kformula/rootelement.cc +++ b/lib/kformula/rootelement.cc @@ -18,8 +18,8 @@ * Boston, MA 02110-1301, USA. */ -#include <qpainter.h> -#include <qpen.h> +#include <tqpainter.h> +#include <tqpen.h> #include <kdebug.h> #include <klocale.h> @@ -38,7 +38,7 @@ class RootSequenceElement : public SequenceElement { typedef SequenceElement inherited; public: - RootSequenceElement( BasicElement* parent = 0 ) : SequenceElement( parent ) {} + RootSequenceElement( BasicElement* tqparent = 0 ) : SequenceElement( tqparent ) {} virtual RootSequenceElement* clone() { return new RootSequenceElement( *this ); } @@ -92,8 +92,8 @@ KCommand* RootSequenceElement::buildCommand( Container* container, Request* requ } -RootElement::RootElement(BasicElement* parent) - : BasicElement(parent) +RootElement::RootElement(BasicElement* tqparent) + : BasicElement(tqparent) { content = new RootSequenceElement( this ); index = 0; @@ -138,12 +138,12 @@ void RootElement::entered( SequenceElement* child ) BasicElement* RootElement::goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin) + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin) { - BasicElement* e = BasicElement::goToPos(cursor, handled, point, parentOrigin); + BasicElement* e = BasicElement::goToPos(cursor, handled, point, tqparentOrigin); if (e != 0) { - LuPixelPoint myPos(parentOrigin.x() + getX(), - parentOrigin.y() + getY()); + LuPixelPoint myPos(tqparentOrigin.x() + getX(), + tqparentOrigin.y() + getY()); e = content->goToPos(cursor, handled, point, myPos); if (e != 0) { @@ -176,7 +176,7 @@ BasicElement* RootElement::goToPos( FormulaCursor* cursor, bool& handled, /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ void RootElement::calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -234,18 +234,18 @@ void RootElement::calcSizes( const ContextStyle& context, } /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ -void RootElement::draw( QPainter& painter, const LuPixelRect& r, +void RootElement::draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ) + const LuPixelPoint& tqparentOrigin ) { - LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); + LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) // return; @@ -264,28 +264,28 @@ void RootElement::draw( QPainter& painter, const LuPixelRect& r, luPixel distY = context.ptToPixelY( context.getThinSpace( tstyle, factor ) ); luPixel unit = (content->getHeight() + distY)/ 3; - painter.setPen( QPen( style.color(), - context.layoutUnitToPixelX( 2*context.getLineWidth( factor ) ) ) ); - painter.drawLine( context.layoutUnitToPixelX( x+unit/3 ), - context.layoutUnitToPixelY( y+unit+distY/3 ), - context.layoutUnitToPixelX( x+unit/2+unit/3 ), - context.layoutUnitToPixelY( myPos.y()+getHeight() ) ); - - painter.setPen( QPen( style.color(), - context.layoutUnitToPixelY( context.getLineWidth( factor ) ) ) ); - - painter.drawLine( context.layoutUnitToPixelX( x+unit+unit/3 ), - context.layoutUnitToPixelY( y+distY/3 ), - context.layoutUnitToPixelX( x+unit/2+unit/3 ), - context.layoutUnitToPixelY( myPos.y()+getHeight() ) ); - painter.drawLine( context.layoutUnitToPixelX( x+unit+unit/3 ), - context.layoutUnitToPixelY( y+distY/3 ), - context.layoutUnitToPixelX( x+unit+unit/3+content->getWidth() ), - context.layoutUnitToPixelY( y+distY/3 ) ); - painter.drawLine( context.layoutUnitToPixelX( x+unit/3 ), - context.layoutUnitToPixelY( y+unit+distY/2 ), - context.layoutUnitToPixelX( x ), - context.layoutUnitToPixelY( y+unit+unit/2 ) ); + painter.setPen( TQPen( style.color(), + context.tqlayoutUnitToPixelX( 2*context.getLineWidth( factor ) ) ) ); + painter.drawLine( context.tqlayoutUnitToPixelX( x+unit/3 ), + context.tqlayoutUnitToPixelY( y+unit+distY/3 ), + context.tqlayoutUnitToPixelX( x+unit/2+unit/3 ), + context.tqlayoutUnitToPixelY( myPos.y()+getHeight() ) ); + + painter.setPen( TQPen( style.color(), + context.tqlayoutUnitToPixelY( context.getLineWidth( factor ) ) ) ); + + painter.drawLine( context.tqlayoutUnitToPixelX( x+unit+unit/3 ), + context.tqlayoutUnitToPixelY( y+distY/3 ), + context.tqlayoutUnitToPixelX( x+unit/2+unit/3 ), + context.tqlayoutUnitToPixelY( myPos.y()+getHeight() ) ); + painter.drawLine( context.tqlayoutUnitToPixelX( x+unit+unit/3 ), + context.tqlayoutUnitToPixelY( y+distY/3 ), + context.tqlayoutUnitToPixelX( x+unit+unit/3+content->getWidth() ), + context.tqlayoutUnitToPixelY( y+distY/3 ) ); + painter.drawLine( context.tqlayoutUnitToPixelX( x+unit/3 ), + context.tqlayoutUnitToPixelY( y+unit+distY/2 ), + context.tqlayoutUnitToPixelX( x ), + context.tqlayoutUnitToPixelY( y+unit+unit/2 ) ); } @@ -415,7 +415,7 @@ void RootElement::moveDown(FormulaCursor* cursor, BasicElement* from) * Reinserts the index if it has been removed. */ void RootElement::insert(FormulaCursor* cursor, - QPtrList<BasicElement>& newChildren, + TQPtrList<BasicElement>& newChildren, Direction direction) { if (cursor->getPos() == upperLeftPos) { @@ -434,13 +434,13 @@ void RootElement::insert(FormulaCursor* cursor, } /** - * Removes all selected children and returns them. Places the - * cursor to where the children have been. + * Removes all selected tqchildren and returns them. Places the + * cursor to where the tqchildren have been. * * We remove ourselve if we are requested to remove our content. */ void RootElement::remove(FormulaCursor* cursor, - QPtrList<BasicElement>& removedChildren, + TQPtrList<BasicElement>& removedChildren, Direction direction) { switch (cursor->getPos()) { @@ -476,7 +476,7 @@ void RootElement::normalize(FormulaCursor* cursor, Direction direction) // main child // -// If an element has children one has to become the main one. +// If an element has tqchildren one has to become the main one. SequenceElement* RootElement::getMainChild() { @@ -528,18 +528,18 @@ void RootElement::setToIndex(FormulaCursor* cursor) /** * Appends our attributes to the dom element. */ -void RootElement::writeDom(QDomElement element) +void RootElement::writeDom(TQDomElement element) { BasicElement::writeDom(element); - QDomDocument doc = element.ownerDocument(); + TQDomDocument doc = element.ownerDocument(); - QDomElement con = doc.createElement("CONTENT"); + TQDomElement con = doc.createElement("CONTENT"); con.appendChild(content->getElementDom(doc)); element.appendChild(con); if(hasIndex()) { - QDomElement ind = doc.createElement("ROOTINDEX"); + TQDomElement ind = doc.createElement("ROOTINDEX"); ind.appendChild(index->getElementDom(doc)); element.appendChild(ind); } @@ -549,7 +549,7 @@ void RootElement::writeDom(QDomElement element) * Reads our attributes from the element. * Returns false if it failed. */ -bool RootElement::readAttributesFromDom(QDomElement element) +bool RootElement::readAttributesFromDom(TQDomElement element) { return BasicElement::readAttributesFromDom(element); } @@ -559,7 +559,7 @@ bool RootElement::readAttributesFromDom(QDomElement element) * that needs to be read. * Returns false if it failed. */ -bool RootElement::readContentFromDom(QDomNode& node) +bool RootElement::readContentFromDom(TQDomNode& node) { if (!BasicElement::readContentFromDom(node)) { return false; @@ -592,7 +592,7 @@ bool RootElement::readContentFromDom(QDomNode& node) * Also checks whether it's a msqrt or mroot. * Returns false if it failed. */ -bool RootElement::readAttributesFromMathMLDom(const QDomElement& element) +bool RootElement::readAttributesFromMathMLDom(const TQDomElement& element) { if ( element.tagName().lower() == "mroot" ) square = false; @@ -607,7 +607,7 @@ bool RootElement::readAttributesFromMathMLDom(const QDomElement& element) * that needs to be read. * Returns false if it failed. */ -int RootElement::readContentFromMathMLDom(QDomNode& node) +int RootElement::readContentFromMathMLDom(TQDomNode& node) { if ( BasicElement::readContentFromMathMLDom( node ) == -1 ) { return -1; @@ -644,9 +644,9 @@ int RootElement::readContentFromMathMLDom(QDomNode& node) return 1; } -QString RootElement::toLatex() +TQString RootElement::toLatex() { - QString root; + TQString root; root="\\sqrt"; if(hasIndex()) { root+="["; @@ -660,7 +660,7 @@ QString RootElement::toLatex() return root; } -QString RootElement::formulaString() +TQString RootElement::formulaString() { if ( hasIndex() ) { return "(" + content->formulaString() + ")**(1.0/(" + index->formulaString() + "))"; @@ -668,7 +668,7 @@ QString RootElement::formulaString() return "sqrt(" + content->formulaString() + ")"; } -void RootElement::writeMathMLContent( QDomDocument& doc, QDomElement& element, bool oasisFormat ) const +void RootElement::writeMathMLContent( TQDomDocument& doc, TQDomElement& element, bool oasisFormat ) const { content->writeMathML( doc, element, oasisFormat ); if( hasIndex() ) diff --git a/lib/kformula/rootelement.h b/lib/kformula/rootelement.h index 0d579fd8..b836228e 100644 --- a/lib/kformula/rootelement.h +++ b/lib/kformula/rootelement.h @@ -21,7 +21,7 @@ #ifndef ROOTELEMENT_H #define ROOTELEMENT_H -#include <qpoint.h> +#include <tqpoint.h> #include "basicelement.h" @@ -38,7 +38,7 @@ public: //enum { contentPos, indexPos }; - RootElement(BasicElement* parent = 0); + RootElement(BasicElement* tqparent = 0); ~RootElement(); RootElement( const RootElement& ); @@ -62,11 +62,11 @@ public: * is allowed to set the cursor. */ virtual BasicElement* goToPos( FormulaCursor*, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ); + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ); /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, @@ -74,19 +74,19 @@ public: StyleAttributes& style ); /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); /** - * Dispatch this FontCommand to all our TextElement children. + * Dispatch this FontCommand to all our TextElement tqchildren. */ virtual void dispatchFontCommand( FontCommand* cmd ); @@ -121,15 +121,15 @@ public: /** * Reinserts the index if it has been removed. */ - virtual void insert(FormulaCursor*, QPtrList<BasicElement>&, Direction); + virtual void insert(FormulaCursor*, TQPtrList<BasicElement>&, Direction); /** - * Removes all selected children and returns them. Places the - * cursor to where the children have been. + * Removes all selected tqchildren and returns them. Places the + * cursor to where the tqchildren have been. * * We remove ourselve if we are requested to remove our content. */ - virtual void remove(FormulaCursor*, QPtrList<BasicElement>&, Direction); + virtual void remove(FormulaCursor*, TQPtrList<BasicElement>&, Direction); /** * Moves the cursor to a normal place where new elements @@ -139,7 +139,7 @@ public: // main child // - // If an element has children one has to become the main one. + // If an element has tqchildren one has to become the main one. virtual SequenceElement* getMainChild(); SequenceElement* getRadiant() { return index; } @@ -170,16 +170,16 @@ public: ElementIndexPtr getIndex() { return ElementIndexPtr( new RootElementIndex( this ) ); } // Save&load - //virtual QDomElement getElementDom(QDomDocument *doc); - //virtual bool buildFromDom(QDomElement *elem); + //virtual TQDomElement getElementDom(TQDomDocument *doc); + //virtual bool buildFromDom(TQDomElement *elem); /** * @returns the latex representation of the element and - * of the element's children + * of the element's tqchildren */ - virtual QString toLatex(); + virtual TQString toLatex(); - virtual QString formulaString(); + virtual TQString formulaString(); protected: @@ -188,59 +188,59 @@ protected: /** * Returns the tag name of this element type. */ - virtual QString getTagName() const { return "ROOT"; } + virtual TQString getTagName() const { return "ROOT"; } /** * Appends our attributes to the dom element. */ - virtual void writeDom(QDomElement element); + virtual void writeDom(TQDomElement element); /** * Reads our attributes from the element. * Returns false if it failed. */ - virtual bool readAttributesFromDom(QDomElement element); + virtual bool readAttributesFromDom(TQDomElement element); /** * Reads our content from the node. Sets the node to the next node * that needs to be read. * Returns false if it failed. */ - virtual bool readContentFromDom(QDomNode& node); + virtual bool readContentFromDom(TQDomNode& node); /** * Reads our attributes from the MathML element. * Also checks whether it's a msqrt or mroot. * Returns false if it failed. */ - virtual bool readAttributesFromMathMLDom(const QDomElement& element); + virtual bool readAttributesFromMathMLDom(const TQDomElement& element); /** * Reads our content from the MathML node. Sets the node to the next node * that needs to be read. * Returns false if it failed. */ - virtual int readContentFromMathMLDom(QDomNode& node); + virtual int readContentFromMathMLDom(TQDomNode& node); private: - virtual QString getElementName() const { return hasIndex() ? "mroot" : "msqrt"; } - virtual void writeMathMLContent( QDomDocument& doc, - QDomElement& element, + virtual TQString getElementName() const { return hasIndex() ? "mroot" : "msqrt"; } + virtual void writeMathMLContent( TQDomDocument& doc, + TQDomElement& element, bool oasisFormat ) const ; class RootElementIndex : public ElementIndex { public: - RootElementIndex(RootElement* p) : parent(p) {} + RootElementIndex(RootElement* p) : tqparent(p) {} virtual void moveToIndex(FormulaCursor* cursor, Direction direction) - { parent->moveToIndex(cursor, direction); } + { tqparent->moveToIndex(cursor, direction); } virtual void setToIndex(FormulaCursor* cursor) - { parent->setToIndex(cursor); } + { tqparent->setToIndex(cursor); } virtual bool hasIndex() const - { return parent->hasIndex(); } - virtual RootElement* getElement() { return parent; } + { return tqparent->hasIndex(); } + virtual RootElement* getElement() { return tqparent; } protected: - RootElement* parent; + RootElement* tqparent; }; diff --git a/lib/kformula/scripts/bycodes.py b/lib/kformula/scripts/bycodes.py index 16d71959..f5da0ae0 100755 --- a/lib/kformula/scripts/bycodes.py +++ b/lib/kformula/scripts/bycodes.py @@ -23,35 +23,35 @@ import string import qt def decode( fd, font, line ): - begin = string.find( line, '"' ) - end = string.find( line, '"', begin + 1) - unicode = line[begin + 2:end] # Remove 'U' from string aswell + begin = string.tqfind( line, '"' ) + end = string.tqfind( line, '"', begin + 1) + tqunicode = line[begin + 2:end] # Remove 'U' from string aswell char_list = [] - separation = string.find( unicode, '-' ) + separation = string.tqfind( tqunicode, '-' ) if separation != -1: - second = unicode + second = tqunicode while separation != -1: first = second[0:separation] second = second[separation + 2:] char_list.append( string.atoi( first, 16 ) ) - separation = string.find( second, '-' ) + separation = string.tqfind( second, '-' ) if separation == -1: char_list.append( string.atoi( second, 16 ) ) else: - char_list.append( string.atoi ( unicode, 16 ) ) + char_list.append( string.atoi ( tqunicode, 16 ) ) fm = qt.QFontMetrics( qt.QFont( font ) ) in_font = True for c in char_list: if not fm.inFont( qt.QChar( c ) ): in_font = False - fd.write( unicode + ' ' + str( in_font ) + '\n') + fd.write( tqunicode + ' ' + str( in_font ) + '\n') def parse( file, font ): fd = open( file ) fd2 = open( 'mathml.list', 'w' ) line = fd.readline() while line != "": - if string.find( line, 'name' ) != -1: + if string.tqfind( line, 'name' ) != -1: decode( fd2, font, line ) line = fd.readline() diff --git a/lib/kformula/scripts/bynames.py b/lib/kformula/scripts/bynames.py index afb9ece5..50fac994 100755 --- a/lib/kformula/scripts/bynames.py +++ b/lib/kformula/scripts/bynames.py @@ -66,7 +66,7 @@ struct entityMap { return qstrcmp( name, right ) < 0; } const char* name; - const uint unicode; + const uint tqunicode; }; extern const entityMap entities[]; @@ -109,14 +109,14 @@ def name_cmp( a, b ): def parse( fr, fw ): line = fr.readline() - while line != "" and string.find( line, '<pre>' ) == -1: + while line != "" and string.tqfind( line, '<pre>' ) == -1: line = fr.readline() - pos = string.find( line, '<pre>' ) ### Ad-hoc detection + pos = string.tqfind( line, '<pre>' ) ### Ad-hoc detection if pos == -1: return line = line[pos + len('<pre>'):].strip() ### Ad-hoc detection entries = [] - while line != "" and string.find( line, ',' ) != -1: + while line != "" and string.tqfind( line, ',' ) != -1: fields = line.split(',') name = fields[0].strip() number = fields[1].strip() @@ -124,7 +124,7 @@ def parse( fr, fw ): # TODO: Support multicharacter entities, should also be supported by # application. The best solution would probably to map to a single # character provided by the font in the private area of Unicode - if string.find( number, '-' ) == -1: + if string.tqfind( number, '-' ) == -1: entries.append( [name, '0x' + number[1:]] ) line = fr.readline().strip() diff --git a/lib/kformula/scripts/oper-dict.py b/lib/kformula/scripts/oper-dict.py index 49191ef6..a91a7971 100755 --- a/lib/kformula/scripts/oper-dict.py +++ b/lib/kformula/scripts/oper-dict.py @@ -190,12 +190,12 @@ def parse( fr, fw, entities ): attr_list[10]: '"false"' } fields = line.split() - name = string.replace( fields[0], '&', '&' ) + name = string.tqreplace( fields[0], '&', '&' ) fields.pop(0) # Remove name entities_found = True while True: - begin = string.find( name, '&' ) - end = string.find( name, ';' ) + begin = string.tqfind( name, '&' ) + end = string.tqfind( name, ';' ) if begin == -1 or end == -1: break ### @@ -204,7 +204,7 @@ def parse( fr, fw, entities ): # character provided by the font in the private area of Unicode entity_name = name[begin + 1:end] if entities.has_key( entity_name ) : - name = name.replace( '&' + entity_name + ';', unichr(entities[entity_name])); + name = name.tqreplace( '&' + entity_name + ';', unichr(entities[entity_name])); else: entities_found = False break diff --git a/lib/kformula/scrollview.h b/lib/kformula/scrollview.h index 200ade2a..3ed2bbcb 100644 --- a/lib/kformula/scrollview.h +++ b/lib/kformula/scrollview.h @@ -2,7 +2,7 @@ #ifndef SCROLLVIEW_H #define SCROLLVIEW_H -#include <qscrollview.h> +#include <tqscrollview.h> #include "kformuladefs.h" @@ -11,15 +11,16 @@ class KFormulaWidget; using namespace KFormula; -class ScrollView : public QScrollView { +class ScrollView : public TQScrollView { Q_OBJECT + TQ_OBJECT public: ScrollView(); virtual void addChild(KFormulaWidget* c, int x=0, int y=0); protected: - virtual void focusInEvent(QFocusEvent* event); + virtual void focusInEvent(TQFocusEvent* event); protected slots: diff --git a/lib/kformula/sequenceelement.cc b/lib/kformula/sequenceelement.cc index b57125bd..eb64a13e 100644 --- a/lib/kformula/sequenceelement.cc +++ b/lib/kformula/sequenceelement.cc @@ -21,9 +21,9 @@ #include <stdlib.h> #include <math.h> -#include <qpainter.h> -#include <qpaintdevice.h> -#include <qvaluestack.h> +#include <tqpainter.h> +#include <tqpaintdevice.h> +#include <tqvaluestack.h> #include <kcommand.h> #include <kdebug.h> @@ -72,11 +72,11 @@ void SequenceElement::setStyle( StyleElement *st ) style = st; } -SequenceElement::SequenceElement(BasicElement* parent) - : BasicElement(parent), parseTree(0), textSequence(true),singlePipe(true), style(0) +SequenceElement::SequenceElement(BasicElement* tqparent) + : BasicElement(tqparent), parseTree(0), textSequence(true),singlePipe(true), style(0) { assert( creationStrategy != 0 ); - children.setAutoDelete(true); + tqchildren.setAutoDelete(true); } @@ -88,12 +88,12 @@ SequenceElement::~SequenceElement() SequenceElement::SequenceElement( const SequenceElement& other ) : BasicElement( other ) { - children.setAutoDelete(true); - uint count = other.children.count(); + tqchildren.setAutoDelete(true); + uint count = other.tqchildren.count(); for (uint i = 0; i < count; i++) { - BasicElement* child = children.at(i)->clone(); + BasicElement* child = tqchildren.at(i)->clone(); child->setParent( this ); - children.append( child ); + tqchildren.append( child ); } } @@ -114,25 +114,25 @@ bool SequenceElement::readOnly( const FormulaCursor* ) const * Returns the element the point is in. */ BasicElement* SequenceElement::goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ) + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ) { - BasicElement* e = BasicElement::goToPos(cursor, handled, point, parentOrigin); + BasicElement* e = BasicElement::goToPos(cursor, handled, point, tqparentOrigin); if (e != 0) { - LuPixelPoint myPos(parentOrigin.x() + getX(), - parentOrigin.y() + getY()); + LuPixelPoint myPos(tqparentOrigin.x() + getX(), + tqparentOrigin.y() + getY()); - uint count = children.count(); + uint count = tqchildren.count(); for (uint i = 0; i < count; i++) { - BasicElement* child = children.at(i); + BasicElement* child = tqchildren.at(i); e = child->goToPos(cursor, handled, point, myPos); if (e != 0) { if (!handled) { handled = true; if ((point.x() - myPos.x()) < (e->getX() + e->getWidth()*2/3)) { - cursor->setTo(this, children.find(e)); + cursor->setTo(this, tqchildren.tqfind(e)); } else { - cursor->setTo(this, children.find(e)+1); + cursor->setTo(this, tqchildren.tqfind(e)+1); } } return e; @@ -143,11 +143,11 @@ BasicElement* SequenceElement::goToPos( FormulaCursor* cursor, bool& handled, //int dy = point.y() - myPos.y(); for (uint i = 0; i < count; i++) { - BasicElement* child = children.at(i); + BasicElement* child = tqchildren.at(i); if (dx < child->getX()) { cursor->setTo( this, i ); handled = true; - return children.at( i ); + return tqchildren.at( i ); } } @@ -161,9 +161,9 @@ BasicElement* SequenceElement::goToPos( FormulaCursor* cursor, bool& handled, bool SequenceElement::isEmpty() { - uint count = children.count(); + uint count = tqchildren.count(); for (uint i = 0; i < count; i++) { - BasicElement* child = children.at(i); + BasicElement* child = tqchildren.at(i); if (!child->isInvisible()) { return false; } @@ -174,7 +174,7 @@ bool SequenceElement::isEmpty() /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ void SequenceElement::calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -190,7 +190,7 @@ void SequenceElement::calcSizes( const ContextStyle& context, width += context.ptToPixelX( getSpaceBefore( context, tstyle, factor ) ); // Let's do all normal elements that have a base line. - QPtrListIterator<BasicElement> it( children ); + TQPtrListIterator<BasicElement> it( tqchildren ); for ( ; it.current(); ++it ) { BasicElement* child = it.current(); @@ -201,14 +201,14 @@ void SequenceElement::calcSizes( const ContextStyle& context, luPixel childBaseline = child->getBaseline(); if ( childBaseline > -1 ) { - toBaseline = QMAX( toBaseline, childBaseline ); - fromBaseline = QMAX( fromBaseline, + toBaseline = TQMAX( toBaseline, childBaseline ); + fromBaseline = TQMAX( fromBaseline, child->getHeight() - childBaseline ); } else { luPixel bl = child->getHeight()/2 + context.axisHeight( tstyle, factor ); - toBaseline = QMAX( toBaseline, bl ); - fromBaseline = QMAX( fromBaseline, child->getHeight() - bl ); + toBaseline = TQMAX( toBaseline, bl ); + fromBaseline = TQMAX( fromBaseline, child->getHeight() - bl ); } } else { @@ -237,7 +237,7 @@ void SequenceElement::calcSizes( const ContextStyle& context, void SequenceElement::setChildrenPositions() { - QPtrListIterator<BasicElement> it( children ); + TQPtrListIterator<BasicElement> it( tqchildren ); for ( ; it.current(); ++it ) { BasicElement* child = it.current(); child->setY(getBaseline() - child->getBaseline()); @@ -246,25 +246,25 @@ void SequenceElement::setChildrenPositions() /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ -void SequenceElement::draw( QPainter& painter, const LuPixelRect& r, +void SequenceElement::draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ) + const LuPixelPoint& tqparentOrigin ) { - LuPixelPoint myPos( parentOrigin.x() + getX(), parentOrigin.y() + getY() ); + LuPixelPoint myPos( tqparentOrigin.x() + getX(), tqparentOrigin.y() + getY() ); // There might be zero sized elements that still want to be drawn at least // in edit mode. (EmptyElement) //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) // return; if (!isEmpty()) { - QPtrListIterator<BasicElement> it( children ); + TQPtrListIterator<BasicElement> it( tqchildren ); for (int i = 0 ; it.current(); i++) { BasicElement* child = it.current(); if (!child->isInvisible()) { @@ -291,24 +291,24 @@ void SequenceElement::draw( QPainter& painter, const LuPixelRect& r, drawEmptyRect( painter, context, style.sizeFactor(), myPos ); } // Debug - //painter.setPen(Qt::green); - //painter.drawRect(parentOrigin.x() + getX(), parentOrigin.y() + getY(), + //painter.setPen(TQt::green); + //painter.drawRect(tqparentOrigin.x() + getX(), tqparentOrigin.y() + getY(), // getWidth(), getHeight()); -// painter.drawLine( context.layoutUnitToPixelX( parentOrigin.x() + getX() ), -// context.layoutUnitToPixelY( parentOrigin.y() + getY() + axis( context, tstyle ) ), -// context.layoutUnitToPixelX( parentOrigin.x() + getX() + getWidth() ), -// context.layoutUnitToPixelY( parentOrigin.y() + getY() + axis( context, tstyle ) ) ); -// painter.setPen(Qt::red); -// painter.drawLine( context.layoutUnitToPixelX( parentOrigin.x() + getX() ), -// context.layoutUnitToPixelY( parentOrigin.y() + getY() + getBaseline() ), -// context.layoutUnitToPixelX( parentOrigin.x() + getX() + getWidth() ), -// context.layoutUnitToPixelY( parentOrigin.y() + getY() + getBaseline() ) ); +// painter.drawLine( context.tqlayoutUnitToPixelX( tqparentOrigin.x() + getX() ), +// context.tqlayoutUnitToPixelY( tqparentOrigin.y() + getY() + axis( context, tstyle ) ), +// context.tqlayoutUnitToPixelX( tqparentOrigin.x() + getX() + getWidth() ), +// context.tqlayoutUnitToPixelY( tqparentOrigin.y() + getY() + axis( context, tstyle ) ) ); +// painter.setPen(TQt::red); +// painter.drawLine( context.tqlayoutUnitToPixelX( tqparentOrigin.x() + getX() ), +// context.tqlayoutUnitToPixelY( tqparentOrigin.y() + getY() + getBaseline() ), +// context.tqlayoutUnitToPixelX( tqparentOrigin.x() + getX() + getWidth() ), +// context.tqlayoutUnitToPixelY( tqparentOrigin.y() + getY() + getBaseline() ) ); } void SequenceElement::dispatchFontCommand( FontCommand* cmd ) { - QPtrListIterator<BasicElement> it( children ); + TQPtrListIterator<BasicElement> it( tqchildren ); for ( ; it.current(); ++it ) { BasicElement* child = it.current(); child->dispatchFontCommand( cmd ); @@ -316,17 +316,17 @@ void SequenceElement::dispatchFontCommand( FontCommand* cmd ) } -void SequenceElement::drawEmptyRect( QPainter& painter, const ContextStyle& context, +void SequenceElement::drawEmptyRect( TQPainter& painter, const ContextStyle& context, double factor, const LuPixelPoint& upperLeft ) { if ( context.edit() ) { - painter.setBrush(Qt::NoBrush); - painter.setPen( QPen( context.getEmptyColor(), - context.layoutUnitToPixelX( context.getLineWidth( factor ) ) ) ); - painter.drawRect( context.layoutUnitToPixelX( upperLeft.x() ), - context.layoutUnitToPixelY( upperLeft.y() ), - context.layoutUnitToPixelX( getWidth() ), - context.layoutUnitToPixelY( getHeight() ) ); + painter.setBrush(TQt::NoBrush); + painter.setPen( TQPen( context.getEmptyColor(), + context.tqlayoutUnitToPixelX( context.getLineWidth( factor ) ) ) ); + painter.drawRect( context.tqlayoutUnitToPixelX( upperLeft.x() ), + context.tqlayoutUnitToPixelY( upperLeft.y() ), + context.tqlayoutUnitToPixelX( getWidth() ), + context.tqlayoutUnitToPixelY( getHeight() ) ); } } @@ -347,7 +347,7 @@ void SequenceElement::calcCursorSize( const ContextStyle& context, if ( cursor->isSelection() ) { uint mark = cursor->getMark(); luPixel markX = getChildPosition( context, mark ); - luPixel x = QMIN(posX, markX); + luPixel x = TQMIN(posX, markX); luPixel width = abs(posX - markX); if ( smallCursor ) { @@ -377,21 +377,21 @@ void SequenceElement::calcCursorSize( const ContextStyle& context, /** * If the cursor is inside a sequence it needs to be drawn. */ -void SequenceElement::drawCursor( QPainter& painter, const ContextStyle& context, +void SequenceElement::drawCursor( TQPainter& painter, const ContextStyle& context, StyleAttributes& style, FormulaCursor* cursor, bool smallCursor, bool activeCursor ) { - painter.setRasterOp( Qt::XorROP ); + painter.setRasterOp( TQt::XorROP ); if ( cursor->isSelection() ) { const LuPixelRect& r = cursor->cursorSize; - painter.fillRect( context.layoutUnitToPixelX( r.x() ), - context.layoutUnitToPixelY( r.y() ), - context.layoutUnitToPixelX( r.width() ), - context.layoutUnitToPixelY( r.height() ), - Qt::white ); - } - painter.setPen( QPen( Qt::white, - context.layoutUnitToPixelX( context.getLineWidth( style.sizeFactor() )/2 ) ) ); + painter.fillRect( context.tqlayoutUnitToPixelX( r.x() ), + context.tqlayoutUnitToPixelY( r.y() ), + context.tqlayoutUnitToPixelX( r.width() ), + context.tqlayoutUnitToPixelY( r.height() ), + TQt::white ); + } + painter.setPen( TQPen( TQt::white, + context.tqlayoutUnitToPixelX( context.getLineWidth( style.sizeFactor() )/2 ) ) ); const LuPixelPoint& point = cursor->getCursorPoint(); const LuPixelRect& size = cursor->getCursorSize(); if ( activeCursor ) @@ -399,33 +399,33 @@ void SequenceElement::drawCursor( QPainter& painter, const ContextStyle& context int offset = 0; if ( cursor->isSelection() && cursor->getPos() > cursor->getMark() ) offset = -1; - painter.drawLine( context.layoutUnitToPixelX( point.x() ) + offset, - context.layoutUnitToPixelY( size.top() ), - context.layoutUnitToPixelX( point.x() ) + offset, - context.layoutUnitToPixelY( size.bottom() )-1 ); - painter.drawLine( context.layoutUnitToPixelX( point.x() ) + offset + 1, - context.layoutUnitToPixelY( size.top() ), - context.layoutUnitToPixelX( point.x() ) + offset + 1, - context.layoutUnitToPixelY( size.bottom() )-1 ); + painter.drawLine( context.tqlayoutUnitToPixelX( point.x() ) + offset, + context.tqlayoutUnitToPixelY( size.top() ), + context.tqlayoutUnitToPixelX( point.x() ) + offset, + context.tqlayoutUnitToPixelY( size.bottom() )-1 ); + painter.drawLine( context.tqlayoutUnitToPixelX( point.x() ) + offset + 1, + context.tqlayoutUnitToPixelY( size.top() ), + context.tqlayoutUnitToPixelX( point.x() ) + offset + 1, + context.tqlayoutUnitToPixelY( size.bottom() )-1 ); } if ( !smallCursor && !cursor->isSelection() ) - painter.drawLine( context.layoutUnitToPixelX( size.left() ), - context.layoutUnitToPixelY( size.bottom() )-1, - context.layoutUnitToPixelX( size.right() )-1, - context.layoutUnitToPixelY( size.bottom() )-1 ); + painter.drawLine( context.tqlayoutUnitToPixelX( size.left() ), + context.tqlayoutUnitToPixelY( size.bottom() )-1, + context.tqlayoutUnitToPixelX( size.right() )-1, + context.tqlayoutUnitToPixelY( size.bottom() )-1 ); // This might be wrong but probably isn't. - painter.setRasterOp( Qt::CopyROP ); + painter.setRasterOp( TQt::CopyROP ); } luPixel SequenceElement::getChildPosition( const ContextStyle& context, uint child ) { - if (child < children.count()) { - return children.at(child)->getX(); + if (child < tqchildren.count()) { + return tqchildren.at(child)->getX(); } else { - if (children.count() > 0) { - return children.at(child-1)->getX() + children.at(child-1)->getWidth(); + if (tqchildren.count() > 0) { + return tqchildren.at(child-1)->getX() + tqchildren.at(child-1)->getWidth(); } else { return context.ptToLayoutUnitPixX( 2 ); @@ -449,11 +449,11 @@ luPixel SequenceElement::getChildPosition( const ContextStyle& context, uint chi */ void SequenceElement::moveLeft(FormulaCursor* cursor, BasicElement* from) { - // Our parent asks us for a cursor position. Found. + // Our tqparent asks us for a cursor position. Found. if (from == getParent()) { - cursor->setTo(this, children.count()); + cursor->setTo(this, tqchildren.count()); if ( cursor->isSelectionMode() ) { - cursor->setMark( children.count() ); + cursor->setMark( tqchildren.count() ); } from->entered( this ); } @@ -464,7 +464,7 @@ void SequenceElement::moveLeft(FormulaCursor* cursor, BasicElement* from) cursor->setTo(this, cursor->getPos()-1); // invisible elements are not visible so we move on. - if (children.at(cursor->getPos())->isInvisible()) { + if (tqchildren.at(cursor->getPos())->isInvisible()) { moveLeft(cursor, this); } } @@ -479,12 +479,12 @@ void SequenceElement::moveLeft(FormulaCursor* cursor, BasicElement* from) } } - // The cursor came from one of our children or + // The cursor came from one of our tqchildren or // something is wrong. else { - int fromPos = children.find(from); + int fromPos = tqchildren.tqfind(from); if ( fromPos > 0 ) { - children.at( fromPos - 1)->moveLeft( cursor, this ); + tqchildren.at( fromPos - 1)->moveLeft( cursor, this ); } // invisible elements are not visible so we move on. @@ -502,7 +502,7 @@ void SequenceElement::moveLeft(FormulaCursor* cursor, BasicElement* from) */ void SequenceElement::moveRight(FormulaCursor* cursor, BasicElement* from) { - // Our parent asks us for a cursor position. Found. + // Our tqparent asks us for a cursor position. Found. if (from == getParent()) { cursor->setTo(this, 0); from->entered( this ); @@ -511,11 +511,11 @@ void SequenceElement::moveRight(FormulaCursor* cursor, BasicElement* from) // We already owned the cursor. Ask next child then. else if (from == this) { uint pos = cursor->getPos(); - if (pos < children.count()) { + if (pos < tqchildren.count()) { cursor->setTo(this, pos+1); // invisible elements are not visible so we move on. - if (children.at(pos)->isInvisible()) { + if (tqchildren.at(pos)->isInvisible()) { moveRight(cursor, this); } } @@ -530,12 +530,12 @@ void SequenceElement::moveRight(FormulaCursor* cursor, BasicElement* from) } } - // The cursor came from one of our children or + // The cursor came from one of our tqchildren or // something is wrong. else { - int fromPos = children.find(from); - if ( fromPos < children.count() - 1 ) { - children.at( fromPos + 1 )->moveDown( cursor, this ); + int fromPos = tqchildren.tqfind(from); + if ( fromPos < tqchildren.count() - 1 ) { + tqchildren.at( fromPos + 1 )->moveDown( cursor, this ); } else { cursor->setTo(this, fromPos+1); @@ -557,7 +557,7 @@ void SequenceElement::moveWordLeft(FormulaCursor* cursor) { uint pos = cursor->getPos(); if (pos > 0) { - ElementType* type = children.at(pos-1)->getElementType(); + ElementType* type = tqchildren.at(pos-1)->getElementType(); if (type != 0) { cursor->setTo(this, type->start()); } @@ -571,8 +571,8 @@ void SequenceElement::moveWordLeft(FormulaCursor* cursor) void SequenceElement::moveWordRight(FormulaCursor* cursor) { uint pos = cursor->getPos(); - if (pos < children.count()) { - ElementType* type = children.at(pos)->getElementType(); + if (pos < tqchildren.count()) { + ElementType* type = tqchildren.at(pos)->getElementType(); if (type != 0) { cursor->setTo(this, type->end()); } @@ -596,7 +596,7 @@ void SequenceElement::moveUp(FormulaCursor* cursor, BasicElement* from) else if ( from == this ) { if ( getParent() != 0 ) { uint pos = cursor->getPos(); - if ( pos < (children.count() - 1) / 2 ) { + if ( pos < (tqchildren.count() - 1) / 2 ) { getParent()->moveLeft( cursor, this ); } else { @@ -630,8 +630,8 @@ void SequenceElement::moveDown(FormulaCursor* cursor, BasicElement* from) } else if (from == this) { uint pos = cursor->getPos(); - if (pos < children.count()) { - children.at(pos)->moveDown(cursor, this); + if (pos < tqchildren.count()) { + tqchildren.at(pos)->moveDown(cursor, this); } } else { @@ -639,7 +639,7 @@ void SequenceElement::moveDown(FormulaCursor* cursor, BasicElement* from) getParent()->moveDown(cursor, this); } else { - cursor->setTo( this, children.count() ); + cursor->setTo( this, tqchildren.count() ); from->entered( this ); // formula()->moveOutBelow( cursor ); } @@ -658,7 +658,7 @@ void SequenceElement::moveHome(FormulaCursor* cursor) while (element->getParent() != this) { element = element->getParent(); } - cursor->setMark(children.find(element)+1); + cursor->setMark(tqchildren.tqfind(element)+1); } } cursor->setTo(this, 0); @@ -676,16 +676,16 @@ void SequenceElement::moveEnd(FormulaCursor* cursor) while (element->getParent() != this) { element = element->getParent(); if (element == 0) { - cursor->setMark(children.count()); + cursor->setMark(tqchildren.count()); break; } } if (element != 0) { - cursor->setMark(children.find(element)); + cursor->setMark(tqchildren.tqfind(element)); } } } - cursor->setTo(this, children.count()); + cursor->setTo(this, tqchildren.count()); } /** @@ -705,11 +705,11 @@ void SequenceElement::goInside(FormulaCursor* cursor) void SequenceElement::goInsideLast(FormulaCursor* cursor) { cursor->setSelection(false); - cursor->setTo(this, children.count()); + cursor->setTo(this, tqchildren.count()); } -// children +// tqchildren /** * Insert a new child in the sequence @@ -723,7 +723,7 @@ void SequenceElement::goInsideLast(FormulaCursor* cursor) bool SequenceElement::insert( uint index, BasicElement *child ) { - return children.insert( index, child ); + return tqchildren.insert( index, child ); } /** @@ -735,14 +735,14 @@ bool SequenceElement::insert( uint index, BasicElement *child ) */ // void SequenceElement::removeChild(FormulaCursor* cursor, BasicElement* child) // { -// int pos = children.find(child); +// int pos = tqchildren.tqfind(child); // formula()->elementRemoval(child, pos); // cursor->setTo(this, pos); -// children.remove(pos); +// tqchildren.remove(pos); // /* -// if len(self.children) == 0: -// if self.parent != None: -// self.parent.removeChild(cursor, self) +// if len(self.tqchildren) == 0: +// if self.tqparent != None: +// self.tqparent.removeChild(cursor, self) // return // */ // formula()->changed(); @@ -750,14 +750,14 @@ bool SequenceElement::insert( uint index, BasicElement *child ) /** - * Inserts all new children at the cursor position. Places the + * Inserts all new tqchildren at the cursor position. Places the * cursor according to the direction. The inserted elements will * be selected. * * The list will be emptied but stays the property of the caller. */ void SequenceElement::insert(FormulaCursor* cursor, - QPtrList<BasicElement>& newChildren, + TQPtrList<BasicElement>& newChildren, Direction direction) { int pos = cursor->getPos(); @@ -765,7 +765,7 @@ void SequenceElement::insert(FormulaCursor* cursor, for (uint i = 0; i < count; i++) { BasicElement* child = newChildren.take(0); child->setParent(this); - children.insert(pos+i, child); + tqchildren.insert(pos+i, child); } if (direction == beforeCursor) { cursor->setTo(this, pos+count, pos); @@ -780,13 +780,13 @@ void SequenceElement::insert(FormulaCursor* cursor, /** - * Removes all selected children and returns them. Places the - * cursor to where the children have been. + * Removes all selected tqchildren and returns them. Places the + * cursor to where the tqchildren have been. * * The ownership of the list is passed to the caller. */ void SequenceElement::remove(FormulaCursor* cursor, - QPtrList<BasicElement>& removedChildren, + TQPtrList<BasicElement>& removedChildren, Direction direction) { if (cursor->isSelection()) { @@ -803,9 +803,9 @@ void SequenceElement::remove(FormulaCursor* cursor, int pos = cursor->getPos() - 1; if (pos >= 0) { while (pos >= 0) { - BasicElement* child = children.at(pos); + BasicElement* child = tqchildren.at(pos); formula()->elementRemoval(child); - children.take(pos); + tqchildren.take(pos); removedChildren.prepend(child); if (!child->isInvisible()) { break; @@ -818,11 +818,11 @@ void SequenceElement::remove(FormulaCursor* cursor, } else { uint pos = cursor->getPos(); - if (pos < children.count()) { - while (pos < children.count()) { - BasicElement* child = children.at(pos); + if (pos < tqchildren.count()) { + while (pos < tqchildren.count()) { + BasicElement* child = tqchildren.at(pos); formula()->elementRemoval(child); - children.take(pos); + tqchildren.take(pos); removedChildren.append(child); if (!child->isInvisible()) { break; @@ -841,13 +841,13 @@ void SequenceElement::remove(FormulaCursor* cursor, /** - * Removes the children at pos and appends it to the list. + * Removes the tqchildren at pos and appends it to the list. */ -void SequenceElement::removeChild(QPtrList<BasicElement>& removedChildren, int pos) +void SequenceElement::removeChild(TQPtrList<BasicElement>& removedChildren, int pos) { - BasicElement* child = children.at(pos); + BasicElement* child = tqchildren.at(pos); formula()->elementRemoval(child); - children.take(pos); + tqchildren.take(pos); removedChildren.append(child); //cerr << *removedChildren.at(0) << endl; formula()->changed(); @@ -872,12 +872,12 @@ BasicElement* SequenceElement::getChild( FormulaCursor* cursor, Direction direct { if ( direction == beforeCursor ) { if ( cursor->getPos() > 0 ) { - return children.at( cursor->getPos() - 1 ); + return tqchildren.at( cursor->getPos() - 1 ); } } else { - if ( cursor->getPos() < qRound( children.count() ) ) { - return children.at( cursor->getPos() ); + if ( cursor->getPos() < tqRound( tqchildren.count() ) ) { + return tqchildren.at( cursor->getPos() ); } } return 0; @@ -890,7 +890,7 @@ BasicElement* SequenceElement::getChild( FormulaCursor* cursor, Direction direct */ void SequenceElement::selectChild(FormulaCursor* cursor, BasicElement* child) { - int pos = children.find(child); + int pos = tqchildren.tqfind(child); if (pos > -1) { cursor->setTo(this, pos+1, pos); } @@ -898,7 +898,7 @@ void SequenceElement::selectChild(FormulaCursor* cursor, BasicElement* child) void SequenceElement::childWillVanish(FormulaCursor* cursor, BasicElement* child) { - int childPos = children.find(child); + int childPos = tqchildren.tqfind(child); if (childPos > -1) { int pos = cursor->getPos(); if (pos > childPos) { @@ -914,21 +914,21 @@ void SequenceElement::childWillVanish(FormulaCursor* cursor, BasicElement* child /** - * Selects all children. The cursor is put behind, the mark before them. + * Selects all tqchildren. The cursor is put behind, the mark before them. */ void SequenceElement::selectAllChildren(FormulaCursor* cursor) { - cursor->setTo(this, children.count(), 0); + cursor->setTo(this, tqchildren.count(), 0); } bool SequenceElement::onlyTextSelected( FormulaCursor* cursor ) { if ( cursor->isSelection() ) { - uint from = QMIN( cursor->getPos(), cursor->getMark() ); - uint to = QMAX( cursor->getPos(), cursor->getMark() ); + uint from = TQMIN( cursor->getPos(), cursor->getMark() ); + uint to = TQMAX( cursor->getPos(), cursor->getMark() ); for ( uint i = from; i < to; i++ ) { BasicElement* element = getChild( i ); - if ( element->getCharacter() == QChar::null ) { + if ( element->getCharacter() == TQChar::null ) { return false; } } @@ -1116,7 +1116,7 @@ KCommand* SequenceElement::buildCommand( Container* container, Request* request case req_addIndex: { if ( cursor->getPos() > 0 && !cursor->isSelection() ) { IndexElement* element = - dynamic_cast<IndexElement*>( children.at( cursor->getPos()-1 ) ); + dynamic_cast<IndexElement*>( tqchildren.at( cursor->getPos()-1 ) ); if ( element != 0 ) { element->goInside( cursor ); return element->buildCommand( container, request ); @@ -1182,9 +1182,9 @@ KCommand* SequenceElement::buildCommand( Container* container, Request* request if ((element != 0) && !element->isSymbol()) { cursor->selectActiveElement(); const SymbolTable& table = container->document()->getSymbolTable(); - if (table.greekLetters().find(element->getCharacter()) != -1) { + if (table.greekLetters().tqfind(element->getCharacter()) != -1) { KFCReplace* command = new KFCReplace( i18n( "Change Char to Symbol" ), container ); - TextElement* symbol = creationStrategy->createTextElement( table.unicodeFromSymbolFont( element->getCharacter() ), true ); + TextElement* symbol = creationStrategy->createTextElement( table.tqunicodeFromSymbolFont( element->getCharacter() ), true ); command->addElement( symbol ); return command; } @@ -1206,7 +1206,7 @@ KCommand* SequenceElement::buildCommand( Container* container, Request* request CharStyleCommand* cmd = new CharStyleCommand( cs, i18n( "Change Char Style" ), container ); int end = cursor->getSelectionEnd(); for ( int i = cursor->getSelectionStart(); i<end; ++i ) { - cmd->addElement( children.at( i ) ); + cmd->addElement( tqchildren.at( i ) ); } return cmd; } @@ -1219,7 +1219,7 @@ KCommand* SequenceElement::buildCommand( Container* container, Request* request CharFamilyCommand* cmd = new CharFamilyCommand( cf, i18n( "Change Char Family" ), container ); int end = cursor->getSelectionEnd(); for ( int i = cursor->getSelectionStart(); i<end; ++i ) { - cmd->addElement( children.at( i ) ); + cmd->addElement( tqchildren.at( i ) ); } return cmd; } @@ -1232,9 +1232,9 @@ KCommand* SequenceElement::buildCommand( Container* container, Request* request } -KCommand* SequenceElement::input( Container* container, QKeyEvent* event ) +KCommand* SequenceElement::input( Container* container, TQKeyEvent* event ) { - QChar ch = event->text().at( 0 ); + TQChar ch = event->text().at( 0 ); if ( ch.isPrint() ) { return input( container, ch ); } @@ -1244,58 +1244,58 @@ KCommand* SequenceElement::input( Container* container, QKeyEvent* event ) MoveFlag flag = movementFlag(state); switch ( action ) { - case Qt::Key_BackSpace: { + case TQt::Key_BackSpace: { DirectedRemove r( req_remove, beforeCursor ); return buildCommand( container, &r ); } - case Qt::Key_Delete: { + case TQt::Key_Delete: { DirectedRemove r( req_remove, afterCursor ); return buildCommand( container, &r ); } - case Qt::Key_Left: { + case TQt::Key_Left: { FormulaCursor* cursor = container->activeCursor(); cursor->moveLeft( flag ); formula()->cursorHasMoved( cursor ); break; } - case Qt::Key_Right: { + case TQt::Key_Right: { FormulaCursor* cursor = container->activeCursor(); cursor->moveRight( flag ); formula()->cursorHasMoved( cursor ); break; } - case Qt::Key_Up: { + case TQt::Key_Up: { FormulaCursor* cursor = container->activeCursor(); cursor->moveUp( flag ); formula()->cursorHasMoved( cursor ); break; } - case Qt::Key_Down: { + case TQt::Key_Down: { FormulaCursor* cursor = container->activeCursor(); cursor->moveDown( flag ); formula()->cursorHasMoved( cursor ); break; } - case Qt::Key_Home: { + case TQt::Key_Home: { FormulaCursor* cursor = container->activeCursor(); cursor->moveHome( flag ); formula()->cursorHasMoved( cursor ); break; } - case Qt::Key_End: { + case TQt::Key_End: { FormulaCursor* cursor = container->activeCursor(); cursor->moveEnd( flag ); formula()->cursorHasMoved( cursor ); break; } default: - if ( state & Qt::ControlButton ) { + if ( state & TQt::ControlButton ) { switch ( event->key() ) { - case Qt::Key_AsciiCircum: { + case TQt::Key_AsciiCircum: { IndexRequest r( upperLeftPos ); return buildCommand( container, &r ); } - case Qt::Key_Underscore: { + case TQt::Key_Underscore: { IndexRequest r( lowerLeftPos ); return buildCommand( container, &r ); } @@ -1309,10 +1309,10 @@ KCommand* SequenceElement::input( Container* container, QKeyEvent* event ) } -KCommand* SequenceElement::input( Container* container, QChar ch ) +KCommand* SequenceElement::input( Container* container, TQChar ch ) { - int unicode = ch.unicode(); - switch (unicode) { + int tqunicode = ch.tqunicode(); + switch (tqunicode) { case '(': { BracketRequest r( container->document()->leftBracketChar(), container->document()->rightBracketChar() ); @@ -1397,25 +1397,25 @@ KCommand* SequenceElement::input( Container* container, QChar ch ) } /** - * Stores the given childrens dom in the element. + * Stores the given tqchildrens dom in the element. */ -void SequenceElement::getChildrenDom( QDomDocument& doc, QDomElement elem, +void SequenceElement::getChildrenDom( TQDomDocument& doc, TQDomElement elem, uint from, uint to) { for (uint i = from; i < to; i++) { - QDomElement tmpEleDom=children.at(i)->getElementDom(doc); + TQDomElement tmpEleDom=tqchildren.at(i)->getElementDom(doc); elem.appendChild(tmpEleDom); } } /** - * Stores the given childrens MathML dom in the element. + * Stores the given tqchildrens MathML dom in the element. */ -void SequenceElement::getChildrenMathMLDom( QDomDocument& doc, QDomNode& parent, +void SequenceElement::getChildrenMathMLDom( TQDomDocument& doc, TQDomNode& tqparent, uint from, uint to) { for ( uint i = from; i < to; i++ ) { - children.at( i )->writeMathML( doc, parent, false ); + tqchildren.at( i )->writeMathML( doc, tqparent, false ); } } @@ -1425,13 +1425,13 @@ void SequenceElement::getChildrenMathMLDom( QDomDocument& doc, QDomNode& parent, * puts them into the list. * Returns false if an error occures. */ -bool SequenceElement::buildChildrenFromDom(QPtrList<BasicElement>& list, QDomNode n) +bool SequenceElement::buildChildrenFromDom(TQPtrList<BasicElement>& list, TQDomNode n) { while (!n.isNull()) { if (n.isElement()) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); BasicElement* child = 0; - QString tag = e.tagName().upper(); + TQString tag = e.tagName().upper(); child = createElement(tag, e); if (child != 0) { @@ -1455,7 +1455,7 @@ bool SequenceElement::buildChildrenFromDom(QPtrList<BasicElement>& list, QDomNod } -BasicElement* SequenceElement::createElement( QString type, const QDomElement& element ) +BasicElement* SequenceElement::createElement( TQString type, const TQDomElement& element ) { return creationStrategy->createElement( type, element ); } @@ -1463,12 +1463,12 @@ BasicElement* SequenceElement::createElement( QString type, const QDomElement& e /** * Appends our attributes to the dom element. */ -void SequenceElement::writeDom(QDomElement element) +void SequenceElement::writeDom(TQDomElement element) { BasicElement::writeDom(element); - uint count = children.count(); - QDomDocument doc = element.ownerDocument(); + uint count = tqchildren.count(); + TQDomDocument doc = element.ownerDocument(); getChildrenDom(doc, element, 0, count); } @@ -1476,7 +1476,7 @@ void SequenceElement::writeDom(QDomElement element) * Reads our attributes from the element. * Returns false if it failed. */ -bool SequenceElement::readAttributesFromDom(QDomElement element) +bool SequenceElement::readAttributesFromDom(TQDomElement element) { if (!BasicElement::readAttributesFromDom(element)) { return false; @@ -1489,13 +1489,13 @@ bool SequenceElement::readAttributesFromDom(QDomElement element) * that needs to be read. * Returns false if it failed. */ -bool SequenceElement::readContentFromDom(QDomNode& node) +bool SequenceElement::readContentFromDom(TQDomNode& node) { if (!BasicElement::readContentFromDom(node)) { return false; } - return buildChildrenFromDom(children, node); + return buildChildrenFromDom(tqchildren, node); } @@ -1504,9 +1504,9 @@ void SequenceElement::parse() delete parseTree; textSequence = true; - for (BasicElement* element = children.first(); + for (BasicElement* element = tqchildren.first(); element != 0; - element = children.next()) { + element = tqchildren.next()) { // Those types are gone. Make sure they won't // be used. @@ -1519,10 +1519,10 @@ void SequenceElement::parse() const SymbolTable& symbols = formula()->getSymbolTable(); SequenceParser parser(symbols); - parseTree = parser.parse(children); + parseTree = parser.parse(tqchildren); // With the IndexElement dynamically changing its text/non-text - // behaviour we need to reparse your parent, too. Hacky! + // behaviour we need to reparse your tqparent, too. Hacky! BasicElement* p = getParent(); if ( p != 0 ) { SequenceElement* seq = dynamic_cast<SequenceElement*>( p->getParent() ); @@ -1541,12 +1541,12 @@ bool SequenceElement::isFirstOfToken( BasicElement* child ) } -QString SequenceElement::toLatex() +TQString SequenceElement::toLatex() { - QString content; - uint count = children.count(); + TQString content; + uint count = tqchildren.count(); for ( uint i = 0; i < count; i++ ) { - BasicElement* child = children.at( i ); + BasicElement* child = tqchildren.at( i ); // if ( isFirstOfToken( child ) ) { // content += ""; // } @@ -1556,12 +1556,12 @@ QString SequenceElement::toLatex() } -QString SequenceElement::formulaString() +TQString SequenceElement::formulaString() { - QString content; - uint count = children.count(); + TQString content; + uint count = tqchildren.count(); for ( uint i = 0; i < count; i++ ) { - BasicElement* child = children.at( i ); + BasicElement* child = tqchildren.at( i ); //if ( isFirstOfToken( child ) ) { // content += " "; //} @@ -1571,9 +1571,9 @@ QString SequenceElement::formulaString() } -void SequenceElement::writeMathMLContent( QDomDocument& doc, QDomElement& element, bool oasisFormat ) const +void SequenceElement::writeMathMLContent( TQDomDocument& doc, TQDomElement& element, bool oasisFormat ) const { - for ( QPtrListIterator<BasicElement> it( children ); it.current(); ++it ) { + for ( TQPtrListIterator<BasicElement> it( tqchildren ); it.current(); ++it ) { it.current()->writeMathML( doc, element, oasisFormat ); } } @@ -1581,7 +1581,7 @@ void SequenceElement::writeMathMLContent( QDomDocument& doc, QDomElement& elemen const BasicElement* SequenceElement::getChild( uint i ) const { - QPtrListIterator<BasicElement> it( children ); + TQPtrListIterator<BasicElement> it( tqchildren ); it += i; return it.current(); } @@ -1589,7 +1589,7 @@ const BasicElement* SequenceElement::getChild( uint i ) const int SequenceElement::childPos( const BasicElement* child ) const { - QPtrListIterator<BasicElement> it( children ); + TQPtrListIterator<BasicElement> it( tqchildren ); uint count = it.count(); for ( uint i=0; i<count; ++i, ++it ) { if ( it.current() == child ) { @@ -1600,8 +1600,8 @@ int SequenceElement::childPos( const BasicElement* child ) const } -NameSequence::NameSequence( BasicElement* parent ) - : SequenceElement( parent ) +NameSequence::NameSequence( BasicElement* tqparent ) + : SequenceElement( tqparent ) { } @@ -1623,19 +1623,19 @@ void NameSequence::calcCursorSize( const ContextStyle& context, getWidth()+2*unitX, getHeight()+2*unitY ) ); } -void NameSequence::drawCursor( QPainter& painter, const ContextStyle& context, +void NameSequence::drawCursor( TQPainter& painter, const ContextStyle& context, StyleAttributes& style, FormulaCursor* cursor, bool smallCursor, bool activeCursor ) { LuPixelPoint point = widgetPos(); - painter.setPen( QPen( context.getEmptyColor(), - context.layoutUnitToPixelX( context.getLineWidth( style.sizeFactor() )/2 ) ) ); + painter.setPen( TQPen( context.getEmptyColor(), + context.tqlayoutUnitToPixelX( context.getLineWidth( style.sizeFactor() )/2 ) ) ); luPixel unitX = context.ptToLayoutUnitPixX( 1 ); luPixel unitY = context.ptToLayoutUnitPixY( 1 ); - painter.drawRect( context.layoutUnitToPixelX( point.x()-unitX ), - context.layoutUnitToPixelY( point.y()-unitY ), - context.layoutUnitToPixelX( getWidth()+2*unitX ), - context.layoutUnitToPixelY( getHeight()+2*unitY ) ); + painter.drawRect( context.tqlayoutUnitToPixelX( point.x()-unitX ), + context.tqlayoutUnitToPixelY( point.y()-unitY ), + context.tqlayoutUnitToPixelX( getWidth()+2*unitX ), + context.tqlayoutUnitToPixelY( getHeight()+2*unitY ) ); inherited::drawCursor( painter, context, style, cursor, smallCursor, activeCursor ); } @@ -1698,10 +1698,10 @@ KCommand* NameSequence::buildCommand( Container* container, Request* request ) } -KCommand* NameSequence::input( Container* container, QChar ch ) +KCommand* NameSequence::input( Container* container, TQChar ch ) { - int unicode = ch.unicode(); - switch (unicode) { + int tqunicode = ch.tqunicode(); + switch (tqunicode) { case '(': case '[': case '|': @@ -1745,13 +1745,13 @@ void NameSequence::setElementType( ElementType* t ) BasicElement* NameSequence::replaceElement( const SymbolTable& table ) { - QString name = buildName(); - QChar ch = table.unicode( name ); + TQString name = buildName(); + TQChar ch = table.tqunicode( name ); if ( !ch.isNull() ) { return new TextElement( ch, true ); } else { - ch = table.unicode( i18n( name.latin1() ) ); + ch = table.tqunicode( i18n( name.latin1() ) ); if ( !ch.isNull() ) { return new TextElement( ch, true ); } @@ -1761,7 +1761,7 @@ BasicElement* NameSequence::replaceElement( const SymbolTable& table ) if ( name == "," ) return new SpaceElement( THIN ); if ( name == ">" ) return new SpaceElement( MEDIUM ); if ( name == ";" ) return new SpaceElement( THICK ); - if ( name == "quad" ) return new SpaceElement( QUAD ); + if ( name == "quad" ) return new SpaceElement( TQUAD ); if ( name == "frac" ) return new FractionElement(); if ( name == "atop" ) { @@ -1774,7 +1774,7 @@ BasicElement* NameSequence::replaceElement( const SymbolTable& table ) return 0; } -BasicElement* NameSequence::createElement( QString type ) +BasicElement* NameSequence::createElement( TQString type ) { if ( type == "TEXT" ) return new TextElement(); return 0; @@ -1782,16 +1782,16 @@ BasicElement* NameSequence::createElement( QString type ) // void NameSequence::parse() // { -// // A name sequence is known as name and so are its children. +// // A name sequence is known as name and so are its tqchildren. // // Caution: this is fake! // for ( int i = 0; i < countChildren(); i++ ) { // getChild( i )->setElementType( getElementType() ); // } // } -QString NameSequence::buildName() +TQString NameSequence::buildName() { - QString name; + TQString name; for ( uint i = 0; i < countChildren(); i++ ) { name += getChild( i )->getCharacter(); } @@ -1807,18 +1807,18 @@ bool NameSequence::isValidSelection( FormulaCursor* cursor ) return sequence->onlyTextSelected( cursor ); } -int SequenceElement::buildChildrenFromMathMLDom(QPtrList<BasicElement>& list, QDomNode n) +int SequenceElement::buildChildrenFromMathMLDom(TQPtrList<BasicElement>& list, TQDomNode n) { while (!n.isNull()) { int nodeNumber = 1; if (n.isElement()) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); BasicElement* child = 0; - QString tag = e.tagName().lower(); + TQString tag = e.tagName().lower(); kdDebug( DEBUGID ) << "Sequence Tag: " << tag << endl; if ( tag == "semantics" ) { // Special case, just pick the first child - QDomNode node = e.firstChild(); + TQDomNode node = e.firstChild(); while( ! node.isElement() ) { node = node.nextSibling(); if ( node.isNull() ) { @@ -1885,16 +1885,16 @@ int SequenceElement::buildChildrenFromMathMLDom(QPtrList<BasicElement>& list, QD /** */ -int SequenceElement::readContentFromMathMLDom(QDomNode& node) +int SequenceElement::readContentFromMathMLDom(TQDomNode& node) { if ( BasicElement::readContentFromMathMLDom(node) == -1 ) { return -1; } - return buildChildrenFromMathMLDom(children, node); + return buildChildrenFromMathMLDom(tqchildren, node); } -int SequenceElement::buildMathMLChild( QDomNode node ) +int SequenceElement::buildMathMLChild( TQDomNode node ) { int nodeCounter = 1; while ( ! node.isElement() ) { @@ -1904,9 +1904,9 @@ int SequenceElement::buildMathMLChild( QDomNode node ) return -1; } } - QDomElement e = node.toElement(); + TQDomElement e = node.toElement(); BasicElement* child = 0; - QString tag = e.tagName().lower(); + TQString tag = e.tagName().lower(); child = creationStrategy->createElement(tag, e); if (child != 0) { @@ -1915,7 +1915,7 @@ int SequenceElement::buildMathMLChild( QDomNode node ) child->setStyle(style); } if (child->buildFromMathMLDom(e) != -1) { - children.append(child); + tqchildren.append(child); } else { delete child; diff --git a/lib/kformula/sequenceelement.h b/lib/kformula/sequenceelement.h index 9bc3c500..167c1ae3 100644 --- a/lib/kformula/sequenceelement.h +++ b/lib/kformula/sequenceelement.h @@ -21,12 +21,12 @@ #ifndef SEQUENCEELEMENT_H #define SEQUENCEELEMENT_H -#include <qptrlist.h> -#include <qstring.h> +#include <tqptrlist.h> +#include <tqstring.h> #include "basicelement.h" -class QKeyEvent; +class TQKeyEvent; KFORMULA_NAMESPACE_BEGIN @@ -34,14 +34,14 @@ class SymbolTable; class ElementCreationStrategy; /** - * The element that contains a number of children. - * The children are aligned in one line. + * The element that contains a number of tqchildren. + * The tqchildren are aligned in one line. */ class SequenceElement : public BasicElement { SequenceElement& operator=( const SequenceElement& ) { return *this; } public: - SequenceElement(BasicElement* parent = 0); + SequenceElement(BasicElement* tqparent = 0); ~SequenceElement(); SequenceElement( const SequenceElement& ); @@ -70,7 +70,7 @@ public: */ virtual BasicElement* goToPos( FormulaCursor*, bool& handled, const LuPixelPoint& point, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); // drawing // @@ -92,7 +92,7 @@ public: /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, @@ -100,23 +100,23 @@ public: StyleAttributes& style ); /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); /** - * Dispatch this FontCommand to all our TextElement children. + * Dispatch this FontCommand to all our TextElement tqchildren. */ virtual void dispatchFontCommand( FontCommand* cmd ); - virtual void drawEmptyRect( QPainter& painter, const ContextStyle& context, + virtual void drawEmptyRect( TQPainter& painter, const ContextStyle& context, double factor, const LuPixelPoint& upperLeft ); virtual void calcCursorSize( const ContextStyle& context, @@ -125,7 +125,7 @@ public: /** * If the cursor is inside a sequence it needs to be drawn. */ - virtual void drawCursor( QPainter& painter, const ContextStyle& context, + virtual void drawCursor( TQPainter& painter, const ContextStyle& context, StyleAttributes& style, FormulaCursor* cursor, bool smallCursor, bool activeCursor ); @@ -202,22 +202,22 @@ public: virtual void goInsideLast(FormulaCursor* cursor); - // children + // tqchildren /** - * Inserts all new children at the cursor position. Places the + * Inserts all new tqchildren at the cursor position. Places the * cursor according to the direction. The inserted elements will * be selected. * * The list will be emptied but stays the property of the caller. */ - virtual void insert(FormulaCursor*, QPtrList<BasicElement>&, Direction); + virtual void insert(FormulaCursor*, TQPtrList<BasicElement>&, Direction); /** - * Removes all selected children and returns them. Places the - * cursor to where the children have been. + * Removes all selected tqchildren and returns them. Places the + * cursor to where the tqchildren have been. */ - virtual void remove(FormulaCursor*, QPtrList<BasicElement>&, Direction); + virtual void remove(FormulaCursor*, TQPtrList<BasicElement>&, Direction); /** * Moves the cursor to a normal place where new elements @@ -244,18 +244,18 @@ public: virtual void childWillVanish(FormulaCursor* cursor, BasicElement* child); /** - * @returns the number of children we have. + * @returns the number of tqchildren we have. */ - uint countChildren() const { return children.count(); } + uint countChildren() const { return tqchildren.count(); } /** * @returns whether the child has the given number. */ bool isChildNumber( uint pos, BasicElement* child ) - { return children.at( pos ) == child; } + { return tqchildren.at( pos ) == child; } /** - * Selects all children. The cursor is put behind, the mark before them. + * Selects all tqchildren. The cursor is put behind, the mark before them. */ void selectAllChildren(FormulaCursor* cursor); @@ -278,8 +278,8 @@ public: * new elements because it owns the undo stack. But only the * sequence knows what chars are allowed. */ - virtual KCommand* input( Container* container, QChar ch ); - virtual KCommand* input( Container* container, QKeyEvent* event ); + virtual KCommand* input( Container* container, TQChar ch ); + virtual KCommand* input( Container* container, TQKeyEvent* event ); /** * Parses the sequence and generates a new syntax tree. @@ -288,37 +288,37 @@ public: virtual void parse(); /** - * Stores the given childrens dom in the element. + * Stores the given tqchildrens dom in the element. */ - void getChildrenDom( QDomDocument& doc, QDomElement elem, uint from, uint to); + void getChildrenDom( TQDomDocument& doc, TQDomElement elem, uint from, uint to); /** - * Stores the given childrens MathML dom in the element. + * Stores the given tqchildrens MathML dom in the element. */ - void getChildrenMathMLDom( QDomDocument& doc, QDomNode& elem, uint from, uint to ); + void getChildrenMathMLDom( TQDomDocument& doc, TQDomNode& elem, uint from, uint to ); /** * Builds elements from the given node and its siblings and * puts them into the list. * Returns false if an error occures. */ - bool buildChildrenFromDom(QPtrList<BasicElement>& list, QDomNode n); + bool buildChildrenFromDom(TQPtrList<BasicElement>& list, TQDomNode n); /** * @returns the latex representation of the element and - * of the element's children + * of the element's tqchildren */ - virtual QString toLatex(); + virtual TQString toLatex(); - virtual QString formulaString(); + virtual TQString formulaString(); /** * @returns the child at position i. */ - BasicElement* getChild(uint i) { return children.at(i); } + BasicElement* getChild(uint i) { return tqchildren.at(i); } const BasicElement* getChild(uint i) const; - int childPos( BasicElement* child ) { return children.find( child ); } + int childPos( BasicElement* child ) { return tqchildren.tqfind( child ); } int childPos( const BasicElement* child ) const; class ChildIterator { @@ -371,9 +371,9 @@ public: static void setCreationStrategy( ElementCreationStrategy* strategy ); virtual void setStyle(StyleElement *style); - virtual int buildChildrenFromMathMLDom(QPtrList<BasicElement>& list, QDomNode n); - virtual int readContentFromMathMLDom(QDomNode& node); - int buildMathMLChild( QDomNode node ); + virtual int buildChildrenFromMathMLDom(TQPtrList<BasicElement>& list, TQDomNode n); + virtual int readContentFromMathMLDom(TQDomNode& node); + int buildMathMLChild( TQDomNode node ); protected: @@ -382,32 +382,32 @@ protected: /** * Returns the tag name of this element type. */ - virtual QString getTagName() const { return "SEQUENCE"; } + virtual TQString getTagName() const { return "SEQUENCE"; } /** * Appends our attributes to the dom element. */ - virtual void writeDom(QDomElement element); + virtual void writeDom(TQDomElement element); - virtual QString getElementName() const { return "mrow"; } - virtual void writeMathMLContent( QDomDocument& doc, - QDomElement& element, + virtual TQString getElementName() const { return "mrow"; } + virtual void writeMathMLContent( TQDomDocument& doc, + TQDomElement& element, bool oasisFormat ) const; /** * Reads our attributes from the element. * Returns false if it failed. */ - virtual bool readAttributesFromDom(QDomElement element); + virtual bool readAttributesFromDom(TQDomElement element); /** * Reads our content from the node. Sets the node to the next node * that needs to be read. * Returns false if it failed. */ - virtual bool readContentFromDom(QDomNode& node); + virtual bool readContentFromDom(TQDomNode& node); /** - * Sets the childrens' positions after their size has been + * Sets the tqchildrens' positions after their size has been * calculated. * * @see #calcSizes @@ -419,7 +419,7 @@ protected: * * @param type the desired type of the element */ - virtual BasicElement* createElement(QString type, const QDomElement &element); + virtual BasicElement* createElement(TQString type, const TQDomElement &element); /** * @returns the position where the child starts. @@ -458,16 +458,16 @@ protected: private: /** - * Removes the children at pos and appends it to the list. + * Removes the tqchildren at pos and appends it to the list. */ - void removeChild(QPtrList<BasicElement>& removedChildren, int pos); + void removeChild(TQPtrList<BasicElement>& removedChildren, int pos); /** - * Our children. Be sure to notify the rootElement before + * Our tqchildren. Be sure to notify the rootElement before * you remove any. */ - QPtrList<BasicElement> children; + TQPtrList<BasicElement> tqchildren; /** * the syntax tree of the sequence @@ -493,7 +493,7 @@ class NameSequence : public SequenceElement { typedef SequenceElement inherited; public: - NameSequence( BasicElement* parent = 0 ); + NameSequence( BasicElement* tqparent = 0 ); virtual NameSequence* clone() { return new NameSequence( *this ); @@ -509,9 +509,9 @@ public: /** * @returns the character that represents this element. Used for * parsing a sequence. - * This is guaranteed to be QChar::null for all non-text elements. + * This is guaranteed to be TQChar::null for all non-text elements. */ - virtual QChar getCharacter() const { return '\\'; } + virtual TQChar getCharacter() const { return '\\'; } /** * @returns the type of this element. Used for @@ -530,7 +530,7 @@ public: /** * If the cursor is inside a sequence it needs to be drawn. */ - virtual void drawCursor( QPainter& painter, const ContextStyle& context, + virtual void drawCursor( TQPainter& painter, const ContextStyle& context, StyleAttributes& style, FormulaCursor* cursor, bool smallCursor, bool activeCursor ); @@ -562,7 +562,7 @@ public: * new elements because it owns the undo stack. But only the * sequence knows what chars are allowed. */ - virtual KCommand* input( Container* container, QChar ch ); + virtual KCommand* input( Container* container, TQChar ch ); /** * Sets a new type. This is done during parsing. @@ -585,15 +585,15 @@ protected: /** * Returns the tag name of this element type. */ - virtual QString getTagName() const { return "NAMESEQUENCE"; } + virtual TQString getTagName() const { return "NAMESEQUENCE"; } - virtual QString getElementName() const { return "mi"; } + virtual TQString getElementName() const { return "mi"; } /** * Creates a new element with the given type. * * @param type the desired type of the element */ - virtual BasicElement* createElement( QString type ); + virtual BasicElement* createElement( TQString type ); /** * Parses the sequence and generates a new syntax tree. @@ -603,7 +603,7 @@ protected: /** * @returns whether the child is the first element of its token. - * This can never happen here. Our children reuse our own + * This can never happen here. Our tqchildren reuse our own * element type. */ virtual bool isFirstOfToken( BasicElement* ) { return false; } @@ -612,7 +612,7 @@ private: KCommand* compactExpressionCmd( Container* container ); - QString buildName(); + TQString buildName(); }; KFORMULA_NAMESPACE_END diff --git a/lib/kformula/sequenceparser.cc b/lib/kformula/sequenceparser.cc index 55c8dec7..9a4ee8a2 100644 --- a/lib/kformula/sequenceparser.cc +++ b/lib/kformula/sequenceparser.cc @@ -41,7 +41,7 @@ void SequenceParser::setElementType( uint pos, ElementType* type ) } -ElementType* SequenceParser::parse( QPtrList<BasicElement>& elements ) +ElementType* SequenceParser::parse( TQPtrList<BasicElement>& elements ) { list = elements; return new SequenceType( this ); @@ -60,7 +60,7 @@ void SequenceParser::nextToken() type = element->getTokenType(); if ( type == SEPARATOR ) { if ( tokenEnd < list.count() ) { - QChar ch = getEndChar(); + TQChar ch = getEndChar(); switch ( ch ) { case ',': case '>': @@ -95,7 +95,7 @@ void SequenceParser::readNumber() type = NUMBER; readDigits(); if ( tokenEnd < list.count()-1 ) { - QChar ch = getEndChar(); + TQChar ch = getEndChar(); // Look for a dot. if ( ch == '.' ) { @@ -147,7 +147,7 @@ void SequenceParser::readNumber() void SequenceParser::readDigits() { for ( ; tokenEnd < list.count(); tokenEnd++ ) { - QChar ch = getEndChar(); + TQChar ch = getEndChar(); if ( !ch.isNumber() ) { break; } @@ -182,7 +182,7 @@ void SequenceParser::readText() } } -QChar SequenceParser::getEndChar() +TQChar SequenceParser::getEndChar() { BasicElement* element = list.at( tokenEnd ); return element->getCharacter(); @@ -195,8 +195,8 @@ ElementType* SequenceParser::getPrimitive() // << tokenStart << " " << tokenEnd << endl; switch ( type ) { case ORDINARY: { -// QString text = getText(); -// if ( table.contains( text ) || ( text == "\\quad" ) ) { +// TQString text = getText(); +// if ( table.tqcontains( text ) || ( text == "\\quad" ) ) { // return new NameType( this, text ); // } // else { @@ -228,9 +228,9 @@ ElementType* SequenceParser::getPrimitive() } -QString SequenceParser::text() +TQString SequenceParser::text() { - QString text; + TQString text; for ( uint i = tokenStart; i < tokenEnd; i++ ) { BasicElement* element = list.at( i ); text.append( element->getCharacter() ); diff --git a/lib/kformula/sequenceparser.h b/lib/kformula/sequenceparser.h index 1051ec12..f710e4cb 100644 --- a/lib/kformula/sequenceparser.h +++ b/lib/kformula/sequenceparser.h @@ -21,8 +21,8 @@ #ifndef SEQUENCEPARSER_H #define SEQUENCEPARSER_H -#include <qptrlist.h> -#include <qstring.h> +#include <tqptrlist.h> +#include <tqstring.h> #include "kformuladefs.h" @@ -43,7 +43,7 @@ public: /** * @returns a parse tree. */ - ElementType* parse(QPtrList<BasicElement>& elements); + ElementType* parse(TQPtrList<BasicElement>& elements); /** * Reads the next token. @@ -70,7 +70,7 @@ public: /** * @returns the current token's text */ - QString text(); + TQString text(); private: @@ -92,13 +92,13 @@ private: /** * @returns the char at tokenEnd. */ - QChar getEndChar(); + TQChar getEndChar(); /** * The elements we want to parse. The parser must not change * it! */ - QPtrList<BasicElement> list; + TQPtrList<BasicElement> list; /** * The position up to which we have read. The current diff --git a/lib/kformula/spaceelement.cc b/lib/kformula/spaceelement.cc index 1ff62da7..7bc21d24 100644 --- a/lib/kformula/spaceelement.cc +++ b/lib/kformula/spaceelement.cc @@ -19,8 +19,8 @@ * Boston, MA 02110-1301, USA. */ -#include <qfontmetrics.h> -#include <qpainter.h> +#include <tqfontmetrics.h> +#include <tqpainter.h> #include <kdebug.h> #include <kprinter.h> @@ -33,8 +33,8 @@ KFORMULA_NAMESPACE_BEGIN -SpaceElement::SpaceElement( SpaceWidth space, bool tab, BasicElement* parent ) - : BasicElement( parent ), +SpaceElement::SpaceElement( SpaceWidth space, bool tab, BasicElement* tqparent ) + : BasicElement( tqparent ), m_tab( tab ), m_widthType( NoSize ), m_heightType( NoSize ), @@ -55,7 +55,7 @@ SpaceElement::SpaceElement( SpaceWidth space, bool tab, BasicElement* parent ) case THICK: m_widthType = ThickMathSpace; break; - case QUAD: + case TQUAD: m_widthType = VeryVeryThickMathSpace; break; } @@ -88,35 +88,35 @@ void SpaceElement::calcSizes( const ContextStyle& context, { double factor = style.sizeFactor(); luPt mySize = context.getAdjustedSize( tstyle, factor ); - QFont font = context.getDefaultFont(); + TQFont font = context.getDefaultFont(); font.setPointSize( mySize ); - QFontMetrics fm( font ); - QChar w = 'M'; + TQFontMetrics fm( font ); + TQChar w = 'M'; LuPixelRect hbound = fm.boundingRect( w ); - QChar h = 'x'; + TQChar h = 'x'; LuPixelRect vbound = fm.boundingRect( h ); double width = style.getSpace( m_widthType, m_width ); if ( m_widthType == AbsoluteSize ) { - width = m_width / context.layoutUnitPtToPt( context.getBaseSize() ); + width = m_width / context.tqlayoutUnitPtToPt( context.getBaseSize() ); } else if ( m_widthType == PixelSize ) { - width = context.pixelYToPt( m_width ) / context.layoutUnitPtToPt( context.getBaseSize() ); + width = context.pixelYToPt( m_width ) / context.tqlayoutUnitPtToPt( context.getBaseSize() ); } double height = style.getSpace( m_heightType, m_height ); if ( m_heightType == AbsoluteSize ) { - height = m_height / context.layoutUnitPtToPt( context.getBaseSize() ); + height = m_height / context.tqlayoutUnitPtToPt( context.getBaseSize() ); } else if ( m_heightType == PixelSize ) { - height = context.pixelYToPt( m_height ) / context.layoutUnitPtToPt( context.getBaseSize() ); + height = context.pixelYToPt( m_height ) / context.tqlayoutUnitPtToPt( context.getBaseSize() ); } double depth = style.getSpace( m_depthType, m_depth ); if ( m_depthType == AbsoluteSize ) { - depth = m_depth / context.layoutUnitPtToPt( context.getBaseSize() ); + depth = m_depth / context.tqlayoutUnitPtToPt( context.getBaseSize() ); } else if ( m_depthType == PixelSize ) { - depth = context.pixelYToPt( m_depth ) / context.layoutUnitPtToPt( context.getBaseSize() ); + depth = context.pixelYToPt( m_depth ) / context.tqlayoutUnitPtToPt( context.getBaseSize() ); } setWidth( hbound.width() * width ); @@ -128,37 +128,37 @@ void SpaceElement::calcSizes( const ContextStyle& context, } } -void SpaceElement::draw( QPainter& painter, const LuPixelRect& /*r*/, +void SpaceElement::draw( TQPainter& painter, const LuPixelRect& /*r*/, const ContextStyle& context, ContextStyle::TextStyle /*tstyle*/, ContextStyle::IndexStyle /*istyle*/, StyleAttributes& /*style*/, - const LuPixelPoint& parentOrigin ) + const LuPixelPoint& tqparentOrigin ) { - LuPixelPoint myPos(parentOrigin.x()+getX(), parentOrigin.y()+getY()); + LuPixelPoint myPos(tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY()); // there is such a thing as negative space! //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) // return; if ( context.edit() ) { painter.setPen( context.getEmptyColor() ); - painter.drawLine( context.layoutUnitToPixelX( myPos.x() ), - context.layoutUnitToPixelY( myPos.y()+getHeight() ), - context.layoutUnitToPixelX( myPos.x()+getWidth()-1 ), - context.layoutUnitToPixelY( myPos.y()+getHeight() ) ); - painter.drawLine( context.layoutUnitToPixelX( myPos.x() ), - context.layoutUnitToPixelY( myPos.y()+getHeight() ), - context.layoutUnitToPixelX( myPos.x() ), - context.layoutUnitToPixelY( myPos.y()+getHeight()-getHeight()/5 ) ); - painter.drawLine( context.layoutUnitToPixelX( myPos.x()+getWidth()-1 ), - context.layoutUnitToPixelY( myPos.y()+getHeight() ), - context.layoutUnitToPixelX( myPos.x()+getWidth()-1 ), - context.layoutUnitToPixelY( myPos.y()+getHeight()-getHeight()/5 ) ); + painter.drawLine( context.tqlayoutUnitToPixelX( myPos.x() ), + context.tqlayoutUnitToPixelY( myPos.y()+getHeight() ), + context.tqlayoutUnitToPixelX( myPos.x()+getWidth()-1 ), + context.tqlayoutUnitToPixelY( myPos.y()+getHeight() ) ); + painter.drawLine( context.tqlayoutUnitToPixelX( myPos.x() ), + context.tqlayoutUnitToPixelY( myPos.y()+getHeight() ), + context.tqlayoutUnitToPixelX( myPos.x() ), + context.tqlayoutUnitToPixelY( myPos.y()+getHeight()-getHeight()/5 ) ); + painter.drawLine( context.tqlayoutUnitToPixelX( myPos.x()+getWidth()-1 ), + context.tqlayoutUnitToPixelY( myPos.y()+getHeight() ), + context.tqlayoutUnitToPixelX( myPos.x()+getWidth()-1 ), + context.tqlayoutUnitToPixelY( myPos.y()+getHeight()-getHeight()/5 ) ); } } -void SpaceElement::writeDom(QDomElement element) +void SpaceElement::writeDom(TQDomElement element) { BasicElement::writeDom(element); switch ( m_widthType ) { @@ -203,12 +203,12 @@ void SpaceElement::writeDom(QDomElement element) } } -bool SpaceElement::readAttributesFromDom( QDomElement element ) +bool SpaceElement::readAttributesFromDom( TQDomElement element ) { if ( !BasicElement::readAttributesFromDom( element ) ) { return false; } - QString widthStr = element.attribute( "WIDTH" ); + TQString widthStr = element.attribute( "WIDTH" ); if( !widthStr.isNull() ) { if ( widthStr.lower() == "quad" ) { m_widthType = VeryVeryThickMathSpace; @@ -229,38 +229,38 @@ bool SpaceElement::readAttributesFromDom( QDomElement element ) else { return false; } - QString tabStr = element.attribute( "TAB" ); + TQString tabStr = element.attribute( "TAB" ); m_tab = !tabStr.isNull(); return true; } -bool SpaceElement::readContentFromDom(QDomNode& node) +bool SpaceElement::readContentFromDom(TQDomNode& node) { return BasicElement::readContentFromDom( node ); } -bool SpaceElement::readAttributesFromMathMLDom(const QDomElement& element) +bool SpaceElement::readAttributesFromMathMLDom(const TQDomElement& element) { if ( ! BasicElement::readAttributesFromMathMLDom( element ) ) { return false; } - QString widthStr = element.attribute( "width" ).stripWhiteSpace().lower(); + TQString widthStr = element.attribute( "width" ).stripWhiteSpace().lower(); if ( ! widthStr.isNull() ) { m_width = getSize( widthStr, &m_widthType ); if ( m_widthType == NoSize ) { m_widthType = getSpace( widthStr ); } } - QString heightStr = element.attribute( "height" ).stripWhiteSpace().lower(); + TQString heightStr = element.attribute( "height" ).stripWhiteSpace().lower(); if ( ! heightStr.isNull() ) { m_height = getSize( heightStr, &m_heightType ); } - QString depthStr = element.attribute( "depth" ).stripWhiteSpace().lower(); + TQString depthStr = element.attribute( "depth" ).stripWhiteSpace().lower(); if ( ! depthStr.isNull() ) { m_depth = getSize( depthStr, &m_depthType ); } - QString linebreakStr = element.attribute( "linebreak" ).stripWhiteSpace().lower(); + TQString linebreakStr = element.attribute( "linebreak" ).stripWhiteSpace().lower(); if ( ! linebreakStr.isNull() ) { if ( linebreakStr == "auto" ) { m_lineBreak = AutoBreak; @@ -284,17 +284,17 @@ bool SpaceElement::readAttributesFromMathMLDom(const QDomElement& element) return true; } -void SpaceElement::writeMathMLAttributes( QDomElement& element ) const +void SpaceElement::writeMathMLAttributes( TQDomElement& element ) const { switch ( m_widthType ) { case AbsoluteSize: - element.setAttribute( "width", QString( "%1pt" ).arg( m_width ) ); + element.setAttribute( "width", TQString( "%1pt" ).tqarg( m_width ) ); break; case RelativeSize: - element.setAttribute( "width", QString( "%1%" ).arg( m_width * 100.0 ) ); + element.setAttribute( "width", TQString( "%1%" ).tqarg( m_width * 100.0 ) ); break; case PixelSize: - element.setAttribute( "width", QString( "%1px" ).arg( m_width ) ); + element.setAttribute( "width", TQString( "%1px" ).tqarg( m_width ) ); break; case NegativeVeryVeryThinMathSpace: element.setAttribute( "width", "negativeveryverythinmathspace" ); @@ -343,26 +343,26 @@ void SpaceElement::writeMathMLAttributes( QDomElement& element ) const } switch ( m_heightType ) { case AbsoluteSize: - element.setAttribute( "height", QString( "%1pt" ).arg( m_height ) ); + element.setAttribute( "height", TQString( "%1pt" ).tqarg( m_height ) ); break; case RelativeSize: - element.setAttribute( "height", QString( "%1%" ).arg( m_height * 100.0 ) ); + element.setAttribute( "height", TQString( "%1%" ).tqarg( m_height * 100.0 ) ); break; case PixelSize: - element.setAttribute( "height", QString( "%1px" ).arg( m_height ) ); + element.setAttribute( "height", TQString( "%1px" ).tqarg( m_height ) ); break; default: break; } switch ( m_depthType ) { case AbsoluteSize: - element.setAttribute( "depth", QString( "%1pt" ).arg( m_depth ) ); + element.setAttribute( "depth", TQString( "%1pt" ).tqarg( m_depth ) ); break; case RelativeSize: - element.setAttribute( "depth", QString( "%1%" ).arg( m_depth * 100.0 ) ); + element.setAttribute( "depth", TQString( "%1%" ).tqarg( m_depth * 100.0 ) ); break; case PixelSize: - element.setAttribute( "depth", QString( "%1px" ).arg( m_depth ) ); + element.setAttribute( "depth", TQString( "%1px" ).tqarg( m_depth ) ); break; default: break; @@ -391,7 +391,7 @@ void SpaceElement::writeMathMLAttributes( QDomElement& element ) const } } -QString SpaceElement::toLatex() +TQString SpaceElement::toLatex() { switch ( m_widthType ) { case NegativeVeryVeryThinMathSpace: diff --git a/lib/kformula/spaceelement.h b/lib/kformula/spaceelement.h index 52a666d1..0f5db35d 100644 --- a/lib/kformula/spaceelement.h +++ b/lib/kformula/spaceelement.h @@ -22,8 +22,8 @@ #ifndef SPACEELEMENT_H #define SPACEELEMENT_H -#include <qfont.h> -#include <qstring.h> +#include <tqfont.h> +#include <tqstring.h> #include "basicelement.h" @@ -48,7 +48,7 @@ class SpaceElement : public BasicElement { SpaceElement operator=( const SpaceElement& ) { return *this; } public: - SpaceElement( SpaceWidth space = THIN, bool tab=false, BasicElement* parent = 0 ); + SpaceElement( SpaceWidth space = THIN, bool tab=false, BasicElement* tqparent = 0 ); SpaceElement( const SpaceElement& ); virtual SpaceElement* clone() { @@ -67,7 +67,7 @@ public: * @returns the character that represents this element. Used for * parsing a sequence. */ - virtual QChar getCharacter() const { return ' '; } + virtual TQChar getCharacter() const { return ' '; } // drawing // @@ -78,7 +78,7 @@ public: /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, @@ -86,16 +86,16 @@ public: StyleAttributes& style ); /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); /** * Moves the cursor away from the given child. The cursor is @@ -105,9 +105,9 @@ public: /** * @returns the latex representation of the element and - * of the element's children + * of the element's tqchildren */ - virtual QString toLatex(); + virtual TQString toLatex(); protected: @@ -116,36 +116,36 @@ protected: /** * @returns the tag name of this element type. */ - virtual QString getTagName() const { return "SPACE"; } + virtual TQString getTagName() const { return "SPACE"; } /** * Appends our attributes to the dom element. */ - virtual void writeDom(QDomElement element); + virtual void writeDom(TQDomElement element); /** * Reads our attributes from the element. * Returns false if it failed. */ - virtual bool readAttributesFromDom(QDomElement element); + virtual bool readAttributesFromDom(TQDomElement element); /** * Reads our content from the node. Sets the node to the next node * that needs to be read. * Returns false if it failed. */ - virtual bool readContentFromDom(QDomNode& node); + virtual bool readContentFromDom(TQDomNode& node); /** * Reads our attributes from the MathML element. * Returns false if it failed. */ - virtual bool readAttributesFromMathMLDom(const QDomElement& element); + virtual bool readAttributesFromMathMLDom(const TQDomElement& element); private: - virtual QString getElementName() const { return "mspace"; } - virtual void writeMathMLAttributes( QDomElement& element ) const ; + virtual TQString getElementName() const { return "mspace"; } + virtual void writeMathMLAttributes( TQDomElement& element ) const ; /** * Whether this space behaves like a tab. diff --git a/lib/kformula/stringelement.cc b/lib/kformula/stringelement.cc index 8e7b54c4..2f13ad77 100644 --- a/lib/kformula/stringelement.cc +++ b/lib/kformula/stringelement.cc @@ -22,11 +22,11 @@ KFORMULA_NAMESPACE_BEGIN -StringElement::StringElement( BasicElement* parent ) : TokenElement( parent ) +StringElement::StringElement( BasicElement* tqparent ) : TokenElement( tqparent ) { } -bool StringElement::readAttributesFromMathMLDom(const QDomElement& element) +bool StringElement::readAttributesFromMathMLDom(const TQDomElement& element) { if ( ! BasicElement::readAttributesFromMathMLDom( element ) ) { return false; @@ -48,7 +48,7 @@ bool StringElement::readAttributesFromMathMLDom(const QDomElement& element) return true; } -int StringElement::buildChildrenFromMathMLDom(QPtrList<BasicElement>& list, QDomNode n) +int StringElement::buildChildrenFromMathMLDom(TQPtrList<BasicElement>& list, TQDomNode n) { int count = inherited::buildChildrenFromMathMLDom( list, n ); if ( count == -1 ) @@ -66,7 +66,7 @@ int StringElement::buildChildrenFromMathMLDom(QPtrList<BasicElement>& list, QDom return count; } -void StringElement::writeMathMLAttributes( QDomElement& element ) const +void StringElement::writeMathMLAttributes( TQDomElement& element ) const { inherited::writeMathMLAttributes( element ); if ( m_customLquote ) { @@ -77,7 +77,7 @@ void StringElement::writeMathMLAttributes( QDomElement& element ) const } } -void StringElement::writeMathMLContent( QDomDocument& doc, QDomElement& element, bool oasisFormat ) const +void StringElement::writeMathMLContent( TQDomDocument& doc, TQDomElement& element, bool oasisFormat ) const { for ( uint i = 1; i < countChildren() - 1; ++i ) { const BasicElement* e = getChild( i ); diff --git a/lib/kformula/stringelement.h b/lib/kformula/stringelement.h index e3542204..447895db 100644 --- a/lib/kformula/stringelement.h +++ b/lib/kformula/stringelement.h @@ -27,19 +27,19 @@ KFORMULA_NAMESPACE_BEGIN class StringElement : public TokenElement { typedef TokenElement inherited; public: - StringElement( BasicElement* parent = 0 ); - virtual int buildChildrenFromMathMLDom(QPtrList<BasicElement>& list, QDomNode n); + StringElement( BasicElement* tqparent = 0 ); + virtual int buildChildrenFromMathMLDom(TQPtrList<BasicElement>& list, TQDomNode n); protected: - virtual bool readAttributesFromMathMLDom(const QDomElement& element); + virtual bool readAttributesFromMathMLDom(const TQDomElement& element); private: - virtual QString getElementName() const { return "ms"; } - virtual void writeMathMLAttributes( QDomElement& element ) const ; - virtual void writeMathMLContent( QDomDocument& doc, QDomElement& element, bool oasisFormat ) const ; + virtual TQString getElementName() const { return "ms"; } + virtual void writeMathMLAttributes( TQDomElement& element ) const ; + virtual void writeMathMLContent( TQDomDocument& doc, TQDomElement& element, bool oasisFormat ) const ; - QString m_lquote; - QString m_rquote; + TQString m_lquote; + TQString m_rquote; bool m_customLquote; bool m_customRquote; }; diff --git a/lib/kformula/styleelement.cc b/lib/kformula/styleelement.cc index 8475a1da..1a8f20ae 100644 --- a/lib/kformula/styleelement.cc +++ b/lib/kformula/styleelement.cc @@ -22,7 +22,7 @@ KFORMULA_NAMESPACE_BEGIN -StyleElement::StyleElement( BasicElement* parent ) : TokenStyleElement( parent ), +StyleElement::StyleElement( BasicElement* tqparent ) : TokenStyleElement( tqparent ), m_scriptMinSizeType( NoSize ), m_veryVeryThinMathSpaceType( NoSize ), m_veryThinMathSpaceType( NoSize ), @@ -39,13 +39,13 @@ StyleElement::StyleElement( BasicElement* parent ) : TokenStyleElement( parent ) { } -bool StyleElement::readAttributesFromMathMLDom( const QDomElement& element ) +bool StyleElement::readAttributesFromMathMLDom( const TQDomElement& element ) { if ( !BasicElement::readAttributesFromMathMLDom( element ) ) { return false; } - QString scriptlevelStr = element.attribute( "scriptlevel" ); + TQString scriptlevelStr = element.attribute( "scriptlevel" ); if ( ! scriptlevelStr.isNull() ) { if ( scriptlevelStr[0] == '+' || scriptlevelStr[0] == '-' ) { m_relativeScriptLevel = true; @@ -60,7 +60,7 @@ bool StyleElement::readAttributesFromMathMLDom( const QDomElement& element ) m_customScriptLevel = true; } } - QString displaystyleStr = element.attribute( "displaystyle" ); + TQString displaystyleStr = element.attribute( "displaystyle" ); if ( ! displaystyleStr.isNull() ) { if ( displaystyleStr.lower() == "true" ) { m_displayStyle = true; @@ -70,7 +70,7 @@ bool StyleElement::readAttributesFromMathMLDom( const QDomElement& element ) } m_customDisplayStyle = true; } - QString scriptsizemultiplierStr = element.attribute( "scriptsizemultiplier" ); + TQString scriptsizemultiplierStr = element.attribute( "scriptsizemultiplier" ); if ( ! scriptsizemultiplierStr.isNull() ) { bool ok; m_scriptSizeMultiplier = scriptsizemultiplierStr.toDouble( &ok ); @@ -82,66 +82,66 @@ bool StyleElement::readAttributesFromMathMLDom( const QDomElement& element ) m_customScriptSizeMultiplier = true; } } - QString scriptminsizeStr = element.attribute( "scriptminsize" ); + TQString scriptminsizeStr = element.attribute( "scriptminsize" ); if ( ! scriptminsizeStr.isNull() ) { readSizeAttribute( scriptminsizeStr, &m_scriptMinSizeType, &m_scriptMinSize ); } - QString backgroundStr = element.attribute( "background" ); + TQString backgroundStr = element.attribute( "background" ); if ( ! backgroundStr.isNull() ) { - // TODO: tranparent background + // TODO: trantqparent background m_customBackground = true; if ( backgroundStr[0] != '#' ) { - m_background = QColor( getHtmlColor( backgroundStr ) ); + m_background = TQColor( getHtmlColor( backgroundStr ) ); } else { - m_background = QColor( backgroundStr ); + m_background = TQColor( backgroundStr ); } } - QString veryverythinmathspaceStr = element.attribute( "veryverythinmathspace" ); + TQString veryverythinmathspaceStr = element.attribute( "veryverythinmathspace" ); if ( ! veryverythinmathspaceStr.isNull() ) { readSizeAttribute( veryverythinmathspaceStr, &m_veryVeryThinMathSpaceType, &m_veryVeryThinMathSpace ); } - QString verythinmathspaceStr = element.attribute( "verythinmathspace" ); + TQString verythinmathspaceStr = element.attribute( "verythinmathspace" ); if ( ! verythinmathspaceStr.isNull() ) { readSizeAttribute( verythinmathspaceStr, &m_veryThinMathSpaceType, &m_veryThinMathSpace ); } - QString thinmathspaceStr = element.attribute( "thinmathspace" ); + TQString thinmathspaceStr = element.attribute( "thinmathspace" ); if ( ! thinmathspaceStr.isNull() ) { readSizeAttribute( thinmathspaceStr, &m_thinMathSpaceType, &m_thinMathSpace ); } - QString mediummathspaceStr = element.attribute( "mediummathspace" ); + TQString mediummathspaceStr = element.attribute( "mediummathspace" ); if ( ! mediummathspaceStr.isNull() ) { readSizeAttribute( mediummathspaceStr, &m_mediumMathSpaceType, &m_mediumMathSpace ); } - QString thickmathspaceStr = element.attribute( "thickmathspace" ); + TQString thickmathspaceStr = element.attribute( "thickmathspace" ); if ( ! thickmathspaceStr.isNull() ) { readSizeAttribute( thickmathspaceStr, &m_thickMathSpaceType, &m_thickMathSpace ); } - QString verythickmathspaceStr = element.attribute( "verythickmathspace" ); + TQString verythickmathspaceStr = element.attribute( "verythickmathspace" ); if ( ! verythickmathspaceStr.isNull() ) { readSizeAttribute( verythickmathspaceStr, &m_veryThickMathSpaceType, &m_veryThickMathSpace ); } - QString veryverythickmathspaceStr = element.attribute( "veryverythickmathspace" ); + TQString veryverythickmathspaceStr = element.attribute( "veryverythickmathspace" ); if ( ! veryverythickmathspaceStr.isNull() ) { readSizeAttribute( veryverythickmathspaceStr, &m_veryVeryThickMathSpaceType, &m_veryVeryThickMathSpace ); } return inherited::readAttributesFromMathMLDom( element ); } -void StyleElement::writeMathMLAttributes( QDomElement& element ) const +void StyleElement::writeMathMLAttributes( TQDomElement& element ) const { if ( m_customScriptLevel ) { - QString prefix; + TQString prefix; if ( m_relativeScriptLevel && m_scriptLevel >= 0 ) { prefix = "+"; } - element.setAttribute( "scriptlevel", prefix + QString( "%1" ).arg( m_scriptLevel ) ); + element.setAttribute( "scriptlevel", prefix + TQString( "%1" ).tqarg( m_scriptLevel ) ); } if ( m_customDisplayStyle ) { element.setAttribute( "displaystyle", m_displayStyle ? "true" : "false" ); } if ( m_customScriptSizeMultiplier ) { - element.setAttribute( "scriptsizemultiplier", QString( "%1" ).arg( m_scriptSizeMultiplier ) ); + element.setAttribute( "scriptsizemultiplier", TQString( "%1" ).tqarg( m_scriptSizeMultiplier ) ); } writeSizeAttribute( element, "scriptminsize", m_scriptMinSizeType, m_scriptMinSize ); if ( m_customBackground ) { @@ -193,7 +193,7 @@ void StyleElement::setStyleSize( const ContextStyle& context, StyleAttributes& s // Get scriptminsize attribute in absolute units, so we don't depend on // context to get the default value - double basesize = context.layoutUnitPtToPt( context.getBaseSize() ); + double basesize = context.tqlayoutUnitPtToPt( context.getBaseSize() ); double size = style.scriptMinSize(); switch ( m_scriptMinSizeType ) { case AbsoluteSize: @@ -236,7 +236,7 @@ void StyleElement::setStyleSize( const ContextStyle& context, StyleAttributes& s double StyleElement::sizeFactor( const ContextStyle& context, SizeType st, double length, double defvalue ) { - double basesize = context.layoutUnitPtToPt( context.getBaseSize() ); + double basesize = context.tqlayoutUnitPtToPt( context.getBaseSize() ); switch ( st ) { case AbsoluteSize: return length / basesize; @@ -270,7 +270,7 @@ void StyleElement::setStyleVariant( StyleAttributes& style ) style.setCustomMathVariant( false ); if ( customFontFamily() ) { style.setCustomFont( true ); - style.setFont( QFont(fontFamily()) ); + style.setFont( TQFont(fontFamily()) ); } bool fontweight = false; @@ -347,7 +347,7 @@ void StyleElement::resetStyle( StyleAttributes& style ) style.resetDisplayStyle(); } -void StyleElement::readSizeAttribute( const QString& str, SizeType* st, double* s ) +void StyleElement::readSizeAttribute( const TQString& str, SizeType* st, double* s ) { if ( st == 0 || s == 0 ){ return; @@ -369,17 +369,17 @@ void StyleElement::readSizeAttribute( const QString& str, SizeType* st, double* } } -void StyleElement::writeSizeAttribute( QDomElement element, const QString& str, SizeType st, double s ) const +void StyleElement::writeSizeAttribute( TQDomElement element, const TQString& str, SizeType st, double s ) const { switch ( st ) { case AbsoluteSize: - element.setAttribute( str, QString( "%1pt" ).arg( s ) ); + element.setAttribute( str, TQString( "%1pt" ).tqarg( s ) ); break; case RelativeSize: - element.setAttribute( str, QString( "%1%" ).arg( s * 100.0 ) ); + element.setAttribute( str, TQString( "%1%" ).tqarg( s * 100.0 ) ); break; case PixelSize: - element.setAttribute( str, QString( "%1px" ).arg( s ) ); + element.setAttribute( str, TQString( "%1px" ).tqarg( s ) ); break; default: break; diff --git a/lib/kformula/styleelement.h b/lib/kformula/styleelement.h index b497a241..7751a19a 100644 --- a/lib/kformula/styleelement.h +++ b/lib/kformula/styleelement.h @@ -29,11 +29,11 @@ class StyleElement : public TokenStyleElement { typedef TokenStyleElement inherited; public: - StyleElement( BasicElement* parent = 0 ); + StyleElement( BasicElement* tqparent = 0 ); protected: - virtual bool readAttributesFromMathMLDom( const QDomElement &element ); + virtual bool readAttributesFromMathMLDom( const TQDomElement &element ); virtual void setStyleSize( const ContextStyle& context, StyleAttributes& style ); virtual void setStyleVariant( StyleAttributes& style ); @@ -41,11 +41,11 @@ protected: virtual void resetStyle( StyleAttributes& style ); private: - virtual QString getElementName() const { return "mstyle"; } - virtual void writeMathMLAttributes( QDomElement& element ) const ; + virtual TQString getElementName() const { return "mstyle"; } + virtual void writeMathMLAttributes( TQDomElement& element ) const ; - void readSizeAttribute( const QString& str, SizeType* st, double* s ); - void writeSizeAttribute( QDomElement element, const QString& str, SizeType st, double s ) const ; + void readSizeAttribute( const TQString& str, SizeType* st, double* s ); + void writeSizeAttribute( TQDomElement element, const TQString& str, SizeType st, double s ) const ; double sizeFactor( const ContextStyle& context, SizeType st, double length, double defvalue ); @@ -53,7 +53,7 @@ private: SizeType m_scriptMinSizeType; double m_scriptSizeMultiplier; double m_scriptMinSize; - QColor m_background; + TQColor m_background; SizeType m_veryVeryThinMathSpaceType; double m_veryVeryThinMathSpace; SizeType m_veryThinMathSpaceType; diff --git a/lib/kformula/symbolaction.cc b/lib/kformula/symbolaction.cc index 7939f231..6a80eeec 100644 --- a/lib/kformula/symbolaction.cc +++ b/lib/kformula/symbolaction.cc @@ -17,8 +17,8 @@ * Boston, MA 02110-1301, USA. */ -#include <qlistbox.h> -#include <qpainter.h> +#include <tqlistbox.h> +#include <tqpainter.h> #include <kapplication.h> #include <kcombobox.h> @@ -34,64 +34,64 @@ KFORMULA_NAMESPACE_BEGIN -class SymbolComboItem : public QListBoxItem +class SymbolComboItem : public TQListBoxItem { public: - SymbolComboItem( const QString&, const QFont& , QChar, QComboBox* combo ); + SymbolComboItem( const TQString&, const TQFont& , TQChar, TQComboBox* combo ); virtual ~SymbolComboItem(); - virtual int width( const QListBox* ) const; - virtual int height( const QListBox* ) const; + virtual int width( const TQListBox* ) const; + virtual int height( const TQListBox* ) const; protected: - virtual void paint( QPainter *p ); + virtual void paint( TQPainter *p ); private: - QComboBox *m_combo; - QString m_name; - QFont m_font; - QChar m_symbol; + TQComboBox *m_combo; + TQString m_name; + TQFont m_font; + TQChar m_symbol; static int widest; }; int SymbolComboItem::widest = 0; -SymbolComboItem::SymbolComboItem( const QString &name, const QFont& font, - QChar symbol, QComboBox *combo ) - : QListBoxItem( combo->listBox() ), +SymbolComboItem::SymbolComboItem( const TQString &name, const TQFont& font, + TQChar symbol, TQComboBox *combo ) + : TQListBoxItem( combo->listBox() ), m_combo( combo ), m_name( name ), m_font( font ), m_symbol( symbol ) { setText( name ); - int charWidth = QFontMetrics( m_font ).width( QChar( m_symbol ) ); - widest = QMAX( widest, charWidth ); + int charWidth = TQFontMetrics( m_font ).width( TQChar( m_symbol ) ); + widest = TQMAX( widest, charWidth ); } SymbolComboItem::~SymbolComboItem() { } -int SymbolComboItem::width( const QListBox * /*lb*/ ) const +int SymbolComboItem::width( const TQListBox * /*lb*/ ) const { - return widest + QFontMetrics( KGlobalSettings::generalFont() ).width( text() ) + 12; + return widest + TQFontMetrics( KGlobalSettings::generalFont() ).width( text() ) + 12; } -int SymbolComboItem::height( const QListBox * /*lb*/ ) const +int SymbolComboItem::height( const TQListBox * /*lb*/ ) const { - int generalHeight = QFontMetrics( KGlobalSettings::generalFont() ).lineSpacing(); - int fontHeight = QFontMetrics( m_font ).lineSpacing(); - return QMAX( generalHeight, fontHeight ) + 2; + int generalHeight = TQFontMetrics( KGlobalSettings::generalFont() ).lineSpacing(); + int fontHeight = TQFontMetrics( m_font ).lineSpacing(); + return TQMAX( generalHeight, fontHeight ) + 2; } -void SymbolComboItem::paint( QPainter *p ) +void SymbolComboItem::paint( TQPainter *p ) { p->setFont( m_font ); - QFontMetrics fm( p->fontMetrics() ); + TQFontMetrics fm( p->fontMetrics() ); p->drawText( 3, fm.ascent() + fm.leading() / 2, - QString( "%1" ).arg( QChar( m_symbol ) ) ); + TQString( "%1" ).tqarg( TQChar( m_symbol ) ) ); p->setFont( KGlobalSettings::generalFont() ); fm = p->fontMetrics(); @@ -101,21 +101,21 @@ void SymbolComboItem::paint( QPainter *p ) /* * The symbol action * */ -SymbolAction::SymbolAction( QObject* parent, const char* name ) - : KSelectAction( parent, name ) +SymbolAction::SymbolAction( TQObject* tqparent, const char* name ) + : KSelectAction( tqparent, name ) { setEditable( FALSE ); } -SymbolAction::SymbolAction( const QString& text, const KShortcut& cut, - const QObject* receiver, const char* slot, - QObject* parent, const char* name ) - : KSelectAction( text, cut, receiver, slot, parent, name ) +SymbolAction::SymbolAction( const TQString& text, const KShortcut& cut, + const TQObject* receiver, const char* slot, + TQObject* tqparent, const char* name ) + : KSelectAction( text, cut, receiver, slot, tqparent, name ) { setEditable( FALSE ); } -int SymbolAction::plug( QWidget* w, int index ) +int SymbolAction::plug( TQWidget* w, int index ) { if (kapp && !kapp->authorizeKAction(name())) return -1; @@ -124,15 +124,15 @@ int SymbolAction::plug( QWidget* w, int index ) KToolBar* bar = static_cast<KToolBar*>( w ); int id_ = KAction::getToolButtonID(); KComboBox *cb = new KComboBox( bar ); - connect( cb, SIGNAL( activated( const QString & ) ), - SLOT( slotActivated( const QString & ) ) ); + connect( cb, TQT_SIGNAL( activated( const TQString & ) ), + TQT_SLOT( slotActivated( const TQString & ) ) ); cb->setEnabled( isEnabled() ); bar->insertWidget( id_, comboWidth(), cb, index ); - cb->setMinimumWidth( cb->sizeHint().width() ); + cb->setMinimumWidth( cb->tqsizeHint().width() ); addContainer( bar, id_ ); - connect( bar, SIGNAL( destroyed() ), this, SLOT( slotDestroyed() ) ); + connect( bar, TQT_SIGNAL( destroyed() ), this, TQT_SLOT( slotDestroyed() ) ); updateItems( containerCount() - 1 ); @@ -141,9 +141,9 @@ int SymbolAction::plug( QWidget* w, int index ) else return KSelectAction::plug( w, index ); } -void SymbolAction::setSymbols( const QStringList &names, - const QFont& font, - const QMemArray<QChar>& chars ) +void SymbolAction::setSymbols( const TQStringList &names, + const TQFont& font, + const TQMemArray<TQChar>& chars ) { m_chars = chars; m_font = font; @@ -156,17 +156,17 @@ void SymbolAction::setSymbols( const QStringList &names, void SymbolAction::updateItems( int id ) { - QWidget *w = container( id ); + TQWidget *w = container( id ); if ( w->inherits( "KToolBar" ) ) { - QWidget *r = static_cast<KToolBar*>( w )->getWidget( itemId( id ) ); - if ( r->inherits( "QComboBox" ) ) { - QComboBox *cb = static_cast<QComboBox*>( r ); + TQWidget *r = static_cast<KToolBar*>( w )->getWidget( itemId( id ) ); + if ( r->inherits( TQCOMBOBOX_OBJECT_NAME_STRING ) ) { + TQComboBox *cb = static_cast<TQComboBox*>( r ); cb->clear(); for( uint i = 0; i < items().count(); ++i ) { new SymbolComboItem( *items().at( i ), m_font, m_chars.at( i ), cb ); } - cb->setMinimumWidth( cb->sizeHint().width() ); + cb->setMinimumWidth( cb->tqsizeHint().width() ); } } } diff --git a/lib/kformula/symbolaction.h b/lib/kformula/symbolaction.h index 704afa2e..a8e7eadf 100644 --- a/lib/kformula/symbolaction.h +++ b/lib/kformula/symbolaction.h @@ -21,9 +21,9 @@ #define _SYMBOLACTION_H_ #include <kaction.h> -#include <qvaluelist.h> -#include <qstringlist.h> -#include <qmemarray.h> +#include <tqvaluelist.h> +#include <tqstringlist.h> +#include <tqmemarray.h> #include "kformuladefs.h" @@ -32,19 +32,19 @@ KFORMULA_NAMESPACE_BEGIN class SymbolAction : public KSelectAction { public: - SymbolAction( QObject* parent = 0, const char* name = 0 ); - SymbolAction( const QString& text, const KShortcut& cut, - const QObject* receiver, const char* slot, QObject* parent, + SymbolAction( TQObject* tqparent = 0, const char* name = 0 ); + SymbolAction( const TQString& text, const KShortcut& cut, + const TQObject* receiver, const char* slot, TQObject* tqparent, const char* name = 0 ); - int plug( QWidget*, int index = -1 ); - void setSymbols( const QStringList&, const QFont& font, const QMemArray<QChar>& ); + int plug( TQWidget*, int index = -1 ); + void setSymbols( const TQStringList&, const TQFont& font, const TQMemArray<TQChar>& ); void updateItems( int ); private: - QValueList<QFont> m_fonts; - QMemArray<QChar> m_chars; - QFont m_font; + TQValueList<TQFont> m_fonts; + TQMemArray<TQChar> m_chars; + TQFont m_font; }; KFORMULA_NAMESPACE_END diff --git a/lib/kformula/symbolelement.cc b/lib/kformula/symbolelement.cc index 49932bee..518fba2f 100644 --- a/lib/kformula/symbolelement.cc +++ b/lib/kformula/symbolelement.cc @@ -18,7 +18,7 @@ * Boston, MA 02110-1301, USA. */ -#include <qpainter.h> +#include <tqpainter.h> #include <kdebug.h> @@ -36,7 +36,7 @@ class SymbolSequenceElement : public SequenceElement { typedef SequenceElement inherited; public: - SymbolSequenceElement( BasicElement* parent = 0 ) : SequenceElement( parent ) {} + SymbolSequenceElement( BasicElement* tqparent = 0 ) : SequenceElement( tqparent ) {} /** * This is called by the container to get a command depending on @@ -87,8 +87,8 @@ KCommand* SymbolSequenceElement::buildCommand( Container* container, Request* re } -SymbolElement::SymbolElement(SymbolType type, BasicElement* parent) - : BasicElement(parent), symbol( 0 ), symbolType( type ) +SymbolElement::SymbolElement(SymbolType type, BasicElement* tqparent) + : BasicElement(tqparent), symbol( 0 ), symbolType( type ) { content = new SymbolSequenceElement( this ); upper = 0; @@ -134,12 +134,12 @@ bool SymbolElement::accept( ElementVisitor* visitor ) BasicElement* SymbolElement::goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ) + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ) { - BasicElement* e = BasicElement::goToPos(cursor, handled, point, parentOrigin); + BasicElement* e = BasicElement::goToPos(cursor, handled, point, tqparentOrigin); if (e != 0) { - LuPixelPoint myPos(parentOrigin.x() + getX(), - parentOrigin.y() + getY()); + LuPixelPoint myPos(tqparentOrigin.x() + getX(), + tqparentOrigin.y() + getY()); e = content->goToPos(cursor, handled, point, myPos); if (e != 0) { @@ -192,7 +192,7 @@ BasicElement* SymbolElement::goToPos( FormulaCursor* cursor, bool& handled, /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ void SymbolElement::calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -212,7 +212,7 @@ void SymbolElement::calcSizes( const ContextStyle& context, symbol->calcSizes(context, tstyle, factor, mySize); content->calcSizes( context, tstyle, istyle, style ); - //symbol->scale(((double)parentSize)/symbol->getHeight()*2); + //symbol->scale(((double)tqparentSize)/symbol->getHeight()*2); luPixel upperWidth = 0; luPixel upperHeight = 0; @@ -233,7 +233,7 @@ void SymbolElement::calcSizes( const ContextStyle& context, } // widths - luPixel xOffset = QMAX(symbol->getWidth(), QMAX(upperWidth, lowerWidth)); + luPixel xOffset = TQMAX(symbol->getWidth(), TQMAX(upperWidth, lowerWidth)); if (context.getCenterSymbol()) { symbol->setX((xOffset - symbol->getWidth()) / 2); } @@ -245,15 +245,15 @@ void SymbolElement::calcSizes( const ContextStyle& context, static_cast<luPixel>( symbol->slant()*symbol->getHeight()/2 ) + distX/2); - setWidth(QMAX(content->getX() + content->getWidth(), - QMAX(upperWidth, lowerWidth))); + setWidth(TQMAX(content->getX() + content->getWidth(), + TQMAX(upperWidth, lowerWidth))); // heights - //int toMidline = QMAX(content->getHeight() / 2, - luPixel toMidline = QMAX(content->axis( context, tstyle, factor ), + //int toMidline = TQMAX(content->getHeight() / 2, + luPixel toMidline = TQMAX(content->axis( context, tstyle, factor ), upperHeight + symbol->getHeight()/2); - //int fromMidline = QMAX(content->getHeight() / 2, - luPixel fromMidline = QMAX(content->getHeight() - content->axis( context, tstyle, factor ), + //int fromMidline = TQMAX(content->getHeight() / 2, + luPixel fromMidline = TQMAX(content->getHeight() - content->axis( context, tstyle, factor ), lowerHeight + symbol->getHeight()/2); setHeight(toMidline + fromMidline); //setMidline(toMidline); @@ -299,18 +299,18 @@ void SymbolElement::calcSizes( const ContextStyle& context, } /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ -void SymbolElement::draw( QPainter& painter, const LuPixelRect& r, +void SymbolElement::draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ) + const LuPixelPoint& tqparentOrigin ) { - LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); + LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) // return; @@ -328,21 +328,21 @@ void SymbolElement::draw( QPainter& painter, const LuPixelRect& r, // Debug #if 0 - painter.setBrush(Qt::NoBrush); - painter.setPen(Qt::red); -// painter.drawRect( context.layoutUnitToPixelX( myPos.x() ), -// context.layoutUnitToPixelY( myPos.y() ), -// context.layoutUnitToPixelX( getWidth() ), -// context.layoutUnitToPixelY( getHeight() ) ); - painter.drawRect( context.layoutUnitToPixelX( myPos.x()+symbol->getX() ), - context.layoutUnitToPixelY( myPos.y()+symbol->getY() ), - context.layoutUnitToPixelX( symbol->getWidth() ), - context.layoutUnitToPixelY( symbol->getHeight() ) ); - painter.setPen(Qt::green); - painter.drawLine( context.layoutUnitToPixelX( myPos.x() ), - context.layoutUnitToPixelY( myPos.y()+axis(context, tstyle) ), - context.layoutUnitToPixelX( myPos.x()+getWidth() ), - context.layoutUnitToPixelY( myPos.y()+axis(context, tstyle) ) ); + painter.setBrush(TQt::NoBrush); + painter.setPen(TQt::red); +// painter.drawRect( context.tqlayoutUnitToPixelX( myPos.x() ), +// context.tqlayoutUnitToPixelY( myPos.y() ), +// context.tqlayoutUnitToPixelX( getWidth() ), +// context.tqlayoutUnitToPixelY( getHeight() ) ); + painter.drawRect( context.tqlayoutUnitToPixelX( myPos.x()+symbol->getX() ), + context.tqlayoutUnitToPixelY( myPos.y()+symbol->getY() ), + context.tqlayoutUnitToPixelX( symbol->getWidth() ), + context.tqlayoutUnitToPixelY( symbol->getHeight() ) ); + painter.setPen(TQt::green); + painter.drawLine( context.tqlayoutUnitToPixelX( myPos.x() ), + context.tqlayoutUnitToPixelY( myPos.y()+axis(context, tstyle) ), + context.tqlayoutUnitToPixelX( myPos.x()+getWidth() ), + context.tqlayoutUnitToPixelY( myPos.y()+axis(context, tstyle) ) ); #endif } @@ -502,11 +502,11 @@ void SymbolElement::moveDown(FormulaCursor* cursor, BasicElement* from) } } -// children +// tqchildren // main child // -// If an element has children one has to become the main one. +// If an element has tqchildren one has to become the main one. // void SymbolElement::setMainChild(SequenceElement* child) // { @@ -518,7 +518,7 @@ void SymbolElement::moveDown(FormulaCursor* cursor, BasicElement* from) /** - * Inserts all new children at the cursor position. Places the + * Inserts all new tqchildren at the cursor position. Places the * cursor according to the direction. * * You only can insert one index at a time. So the list must contain @@ -528,7 +528,7 @@ void SymbolElement::moveDown(FormulaCursor* cursor, BasicElement* from) * The list will be emptied but stays the property of the caller. */ void SymbolElement::insert(FormulaCursor* cursor, - QPtrList<BasicElement>& newChildren, + TQPtrList<BasicElement>& newChildren, Direction direction) { SequenceElement* index = static_cast<SequenceElement*>(newChildren.take(0)); @@ -557,8 +557,8 @@ void SymbolElement::insert(FormulaCursor* cursor, } /** - * Removes all selected children and returns them. Places the - * cursor to where the children have been. + * Removes all selected tqchildren and returns them. Places the + * cursor to where the tqchildren have been. * * The cursor has to be inside one of our indexes which is supposed * to be empty. The index will be removed and the cursor will @@ -568,7 +568,7 @@ void SymbolElement::insert(FormulaCursor* cursor, * The ownership of the list is passed to the caller. */ void SymbolElement::remove(FormulaCursor* cursor, - QPtrList<BasicElement>& removedChildren, + TQPtrList<BasicElement>& removedChildren, Direction direction) { int pos = cursor->getPos(); @@ -586,9 +586,9 @@ void SymbolElement::remove(FormulaCursor* cursor, setToLower(cursor); break; case contentPos: { - BasicElement* parent = getParent(); - parent->selectChild(cursor, this); - parent->remove(cursor, removedChildren, direction); + BasicElement* tqparent = getParent(); + tqparent->selectChild(cursor, this); + tqparent->remove(cursor, removedChildren, direction); break; } } @@ -705,25 +705,25 @@ ElementIndexPtr SymbolElement::getIndex( int position ) /** * Appends our attributes to the dom element. */ -void SymbolElement::writeDom(QDomElement element) +void SymbolElement::writeDom(TQDomElement element) { BasicElement::writeDom(element); element.setAttribute("TYPE", symbolType); - QDomDocument doc = element.ownerDocument(); + TQDomDocument doc = element.ownerDocument(); - QDomElement con = doc.createElement("CONTENT"); + TQDomElement con = doc.createElement("CONTENT"); con.appendChild(content->getElementDom(doc)); element.appendChild(con); if(hasLower()) { - QDomElement ind = doc.createElement("LOWER"); + TQDomElement ind = doc.createElement("LOWER"); ind.appendChild(lower->getElementDom(doc)); element.appendChild(ind); } if(hasUpper()) { - QDomElement ind = doc.createElement("UPPER"); + TQDomElement ind = doc.createElement("UPPER"); ind.appendChild(upper->getElementDom(doc)); element.appendChild(ind); } @@ -733,13 +733,13 @@ void SymbolElement::writeDom(QDomElement element) * Reads our attributes from the element. * Returns false if it failed. */ -bool SymbolElement::readAttributesFromDom(QDomElement element) +bool SymbolElement::readAttributesFromDom(TQDomElement element) { if (!BasicElement::readAttributesFromDom(element)) { return false; } - QString typeStr = element.attribute("TYPE"); + TQString typeStr = element.attribute("TYPE"); if(!typeStr.isNull()) { symbolType = static_cast<SymbolType>(typeStr.toInt()); } @@ -752,7 +752,7 @@ bool SymbolElement::readAttributesFromDom(QDomElement element) * that needs to be read. * Returns false if it failed. */ -bool SymbolElement::readContentFromDom(QDomNode& node) +bool SymbolElement::readContentFromDom(TQDomNode& node) { if (!BasicElement::readContentFromDom(node)) { return false; @@ -784,9 +784,9 @@ bool SymbolElement::readContentFromDom(QDomNode& node) return true; } -QString SymbolElement::toLatex() +TQString SymbolElement::toLatex() { - QString sym; + TQString sym; switch(symbolType) { @@ -826,9 +826,9 @@ QString SymbolElement::toLatex() return sym; } -QString SymbolElement::formulaString() +TQString SymbolElement::formulaString() { - QString sym; + TQString sym; switch ( symbolType ) { case 1001: sym="int("; @@ -852,12 +852,12 @@ QString SymbolElement::formulaString() return sym + ")"; } -void SymbolElement::writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat ) const +void SymbolElement::writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat ) const { - QDomElement de = doc.createElement( oasisFormat ? "math:mrow" : "mrow" ); - QDomElement mo = doc.createElement( oasisFormat ? "math:mo" : "mo" ); + TQDomElement de = doc.createElement( oasisFormat ? "math:mrow" : "mrow" ); + TQDomElement mo = doc.createElement( oasisFormat ? "math:mo" : "mo" ); - QString value; + TQString value; switch( symbolType ) { @@ -871,10 +871,10 @@ void SymbolElement::writeMathML( QDomDocument& doc, QDomNode& parent, bool oasis case Product: mo.appendChild( doc.createEntityReference( "prod" ) ); break; default: - mo.appendChild( doc.createTextNode( QChar( symbolType ) ) ); + mo.appendChild( doc.createTextNode( TQChar( symbolType ) ) ); } - QDomElement between; + TQDomElement between; if ( hasUpper() && hasLower() ) { between = doc.createElement( oasisFormat ? "math:msubsup" : "msubsup" ); @@ -900,7 +900,7 @@ void SymbolElement::writeMathML( QDomDocument& doc, QDomNode& parent, bool oasis de.appendChild( between ); content->writeMathML( doc, de, oasisFormat ); - parent.appendChild( de ); + tqparent.appendChild( de ); } KFORMULA_NAMESPACE_END diff --git a/lib/kformula/symbolelement.h b/lib/kformula/symbolelement.h index cb908034..799703a6 100644 --- a/lib/kformula/symbolelement.h +++ b/lib/kformula/symbolelement.h @@ -36,7 +36,7 @@ public: //enum { contentPos, upperPos, lowerPos }; - SymbolElement(SymbolType type = EmptyBracket, BasicElement* parent = 0); + SymbolElement(SymbolType type = EmptyBracket, BasicElement* tqparent = 0); ~SymbolElement(); SymbolElement( const SymbolElement& ); @@ -54,7 +54,7 @@ public: * is allowed to set the cursor. */ virtual BasicElement* goToPos( FormulaCursor*, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ); + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ); // drawing // @@ -65,7 +65,7 @@ public: /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, @@ -73,19 +73,19 @@ public: StyleAttributes& style ); /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); /** - * Dispatch this FontCommand to all our TextElement children. + * Dispatch this FontCommand to all our TextElement tqchildren. */ virtual void dispatchFontCommand( FontCommand* cmd ); @@ -125,7 +125,7 @@ public: */ virtual void moveDown(FormulaCursor* cursor, BasicElement* from); - // children + // tqchildren /** * Removes the child. If this was the main child this element might @@ -139,14 +139,14 @@ public: // main child // - // If an element has children one has to become the main one. + // If an element has tqchildren one has to become the main one. virtual SequenceElement* getMainChild() { return content; } //virtual void setMainChild(SequenceElement*); /** - * Inserts all new children at the cursor position. Places the + * Inserts all new tqchildren at the cursor position. Places the * cursor according to the direction. * * You only can insert one index at a time. So the list must contain @@ -155,11 +155,11 @@ public: * * The list will be emptied but stays the property of the caller. */ - virtual void insert(FormulaCursor*, QPtrList<BasicElement>&, Direction); + virtual void insert(FormulaCursor*, TQPtrList<BasicElement>&, Direction); /** - * Removes all selected children and returns them. Places the - * cursor to where the children have been. + * Removes all selected tqchildren and returns them. Places the + * cursor to where the tqchildren have been. * * The cursor has to be inside one of our indexes which is supposed * to be empty. The index will be removed and the cursor will @@ -168,7 +168,7 @@ public: * * The ownership of the list is passed to the caller. */ - virtual void remove(FormulaCursor*, QPtrList<BasicElement>&, Direction); + virtual void remove(FormulaCursor*, TQPtrList<BasicElement>&, Direction); /** * Moves the cursor to a normal place where new elements @@ -216,18 +216,18 @@ public: ElementIndexPtr getIndex( int position ); // Save&load - //virtual QDomElement getElementDom(QDomDocument *doc); - //virtual bool buildFromDom(QDomElement *elem); + //virtual TQDomElement getElementDom(TQDomDocument *doc); + //virtual bool buildFromDom(TQDomElement *elem); /** * @returns the latex representation of the element and - * of the element's children + * of the element's tqchildren */ - virtual QString toLatex(); + virtual TQString toLatex(); - virtual QString formulaString(); + virtual TQString formulaString(); - virtual void writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat = false ) const ; + virtual void writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat = false ) const ; protected: @@ -236,25 +236,25 @@ protected: /** * Returns the tag name of this element type. */ - virtual QString getTagName() const { return "SYMBOL"; } + virtual TQString getTagName() const { return "SYMBOL"; } /** * Appends our attributes to the dom element. */ - virtual void writeDom(QDomElement element); + virtual void writeDom(TQDomElement element); /** * Reads our attributes from the element. * Returns false if it failed. */ - virtual bool readAttributesFromDom(QDomElement element); + virtual bool readAttributesFromDom(TQDomElement element); /** * Reads our content from the node. Sets the node to the next node * that needs to be read. * Returns false if it failed. */ - virtual bool readContentFromDom(QDomNode& node); + virtual bool readContentFromDom(TQDomNode& node); private: @@ -263,34 +263,34 @@ private: */ class SymbolElementIndex : public ElementIndex { public: - SymbolElementIndex(SymbolElement* p) : parent(p) {} - virtual SymbolElement* getElement() { return parent; } + SymbolElementIndex(SymbolElement* p) : tqparent(p) {} + virtual SymbolElement* getElement() { return tqparent; } protected: - SymbolElement* parent; + SymbolElement* tqparent; }; // We have a (very simple) type for every index. class UpperIndex : public SymbolElementIndex { public: - UpperIndex(SymbolElement* parent) : SymbolElementIndex(parent) {} + UpperIndex(SymbolElement* tqparent) : SymbolElementIndex(tqparent) {} virtual void moveToIndex(FormulaCursor* cursor, Direction direction) - { parent->moveToUpper(cursor, direction); } + { tqparent->moveToUpper(cursor, direction); } virtual void setToIndex(FormulaCursor* cursor) - { parent->setToUpper(cursor); } + { tqparent->setToUpper(cursor); } virtual bool hasIndex() const - { return parent->hasUpper(); } + { return tqparent->hasUpper(); } }; class LowerIndex : public SymbolElementIndex { public: - LowerIndex(SymbolElement* parent) : SymbolElementIndex(parent) {} + LowerIndex(SymbolElement* tqparent) : SymbolElementIndex(tqparent) {} virtual void moveToIndex(FormulaCursor* cursor, Direction direction) - { parent->moveToLower(cursor, direction); } + { tqparent->moveToLower(cursor, direction); } virtual void setToIndex(FormulaCursor* cursor) - { parent->setToLower(cursor); } + { tqparent->setToLower(cursor); } virtual bool hasIndex() const - { return parent->hasLower(); } + { return tqparent->hasLower(); } }; diff --git a/lib/kformula/symboltable.cc b/lib/kformula/symboltable.cc index 0a444519..74f160e6 100644 --- a/lib/kformula/symboltable.cc +++ b/lib/kformula/symboltable.cc @@ -19,12 +19,12 @@ * Boston, MA 02110-1301, USA. */ -#include <qfile.h> -#include <qregexp.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qtextstream.h> -#include <qfontmetrics.h> +#include <tqfile.h> +#include <tqregexp.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqtextstream.h> +#include <tqfontmetrics.h> #include <kconfig.h> #include <kdebug.h> @@ -42,19 +42,19 @@ KFORMULA_NAMESPACE_BEGIN #include "symbolfontmapping.cc" SymbolFontHelper::SymbolFontHelper() - : greek("abgdezhqiklmnxpvrstufjcywGDQLXPSUFYVW") + : greek("abgdezhqiklmnxpvrstufjcywGDTQLXPSUFYVW") { - for ( uint i = 0; symbolMap[ i ].unicode != 0; i++ ) { - compatibility[ symbolMap[ i ].pos ] = symbolMap[ i ].unicode; + for ( uint i = 0; symbolMap[ i ].tqunicode != 0; i++ ) { + compatibility[ symbolMap[ i ].pos ] = symbolMap[ i ].tqunicode; } } -QChar SymbolFontHelper::unicodeFromSymbolFont( QChar pos ) const +TQChar SymbolFontHelper::tqunicodeFromSymbolFont( TQChar pos ) const { - if ( compatibility.contains( pos ) ) { + if ( compatibility.tqcontains( pos ) ) { return compatibility[ pos.latin1() ]; } - return QChar::null; + return TQChar::null; } @@ -63,48 +63,48 @@ SymbolTable::SymbolTable() } -void SymbolTable::init( const QFont& font ) +void SymbolTable::init( const TQFont& font ) { backupFont = font; - for ( int i=0; operatorTable[i].unicode != 0; ++i ) { - names[QChar( operatorTable[i].unicode )] = get_name( operatorTable[i] ); - entries[get_name( operatorTable[i] )] = QChar( operatorTable[i].unicode ); + for ( int i=0; operatorTable[i].tqunicode != 0; ++i ) { + names[TQChar( operatorTable[i].tqunicode )] = get_name( operatorTable[i] ); + entries[get_name( operatorTable[i] )] = TQChar( operatorTable[i].tqunicode ); } - for ( int i=0; arrowTable[i].unicode != 0; ++i ) { - names[QChar( arrowTable[i].unicode )] = get_name( arrowTable[i] ); - entries[get_name( arrowTable[i] )] = QChar( arrowTable[i].unicode ); + for ( int i=0; arrowTable[i].tqunicode != 0; ++i ) { + names[TQChar( arrowTable[i].tqunicode )] = get_name( arrowTable[i] ); + entries[get_name( arrowTable[i] )] = TQChar( arrowTable[i].tqunicode ); } - for ( int i=0; greekTable[i].unicode != 0; ++i ) { - names[QChar( greekTable[i].unicode )] = get_name( greekTable[i] ); - entries[get_name( greekTable[i] )] = QChar( greekTable[i].unicode ); + for ( int i=0; greekTable[i].tqunicode != 0; ++i ) { + names[TQChar( greekTable[i].tqunicode )] = get_name( greekTable[i] ); + entries[get_name( greekTable[i] )] = TQChar( greekTable[i].tqunicode ); } } -bool SymbolTable::contains(QString name) const +bool SymbolTable::tqcontains(TQString name) const { - return entries.find( name ) != entries.end(); + return entries.tqfind( name ) != entries.end(); } -QChar SymbolTable::unicode(QString name) const +TQChar SymbolTable::tqunicode(TQString name) const { return entries[ name ]; } -QString SymbolTable::name( QChar symbol ) const +TQString SymbolTable::name( TQChar symbol ) const { return names[symbol]; } -QFont SymbolTable::font( QChar symbol, const QFont& f ) const { - QFontMetrics fm( f ); +TQFont SymbolTable::font( TQChar symbol, const TQFont& f ) const { + TQFontMetrics fm( f ); if ( fm.inFont( symbol ) ) { return f; } - return QFont("Arev Sans"); + return TQFont("Arev Sans"); } -CharClass SymbolTable::charClass( QChar symbol ) const +CharClass SymbolTable::charClass( TQChar symbol ) const { return ORDINARY; // FIXME @@ -112,39 +112,39 @@ CharClass SymbolTable::charClass( QChar symbol ) const } -QChar SymbolTable::unicodeFromSymbolFont( QChar pos ) const +TQChar SymbolTable::tqunicodeFromSymbolFont( TQChar pos ) const { - return symbolFontHelper.unicodeFromSymbolFont( pos ); + return symbolFontHelper.tqunicodeFromSymbolFont( pos ); } -QString SymbolTable::greekLetters() const +TQString SymbolTable::greekLetters() const { return symbolFontHelper.greekLetters(); } -QStringList SymbolTable::allNames() const +TQStringList SymbolTable::allNames() const { - QStringList list; + TQStringList list; - for ( int i=0; operatorTable[i].unicode != 0; ++i ) { + for ( int i=0; operatorTable[i].tqunicode != 0; ++i ) { list.append( get_name( operatorTable[i] )); } - for ( int i=0; arrowTable[i].unicode != 0; ++i ) { + for ( int i=0; arrowTable[i].tqunicode != 0; ++i ) { list.append( get_name( arrowTable[i] )); } - for ( int i=0; greekTable[i].unicode != 0; ++i ) { + for ( int i=0; greekTable[i].tqunicode != 0; ++i ) { list.append( get_name( greekTable[i] ) ); } return list; } -QString SymbolTable::get_name( struct UnicodeNameTable entry ) const +TQString SymbolTable::get_name( struct UnicodeNameTable entry ) const { if ( !*entry.name ) { - return "U" + QString( "%1" ).arg( entry.unicode, 4, 16 ).upper(); + return "U" + TQString( "%1" ).tqarg( entry.tqunicode, 4, 16 ).upper(); } return entry.name; } diff --git a/lib/kformula/symboltable.h b/lib/kformula/symboltable.h index 9218e6b4..a7776adc 100644 --- a/lib/kformula/symboltable.h +++ b/lib/kformula/symboltable.h @@ -22,11 +22,11 @@ #ifndef SYMBOLTABLE_H #define SYMBOLTABLE_H -#include <qfont.h> -#include <qmap.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qvaluevector.h> +#include <tqfont.h> +#include <tqmap.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqvaluevector.h> #include "kformuladefs.h" @@ -48,24 +48,24 @@ public: /** * @returns a string with all greek letters. */ - QString greekLetters() const { return greek; } + TQString greekLetters() const { return greek; } /** - * @returns the unicode value of the symbol font char. + * @returns the tqunicode value of the symbol font char. */ - QChar unicodeFromSymbolFont( QChar pos ) const; + TQChar tqunicodeFromSymbolFont( TQChar pos ) const; private: /** - * symbol font char -> unicode mapping. + * symbol font char -> tqunicode mapping. */ - QMap<QChar, QChar> compatibility; + TQMap<TQChar, TQChar> compatibility; /** * All greek letters that are known. */ - QString greek; + TQString greek; }; @@ -83,50 +83,50 @@ public: * lazy init support. Needs to be run before anything else. * @param install if true fonts may be installed if needed */ - void init( const QFont& font ); + void init( const TQFont& font ); - bool contains( QString name ) const; + bool tqcontains( TQString name ) const; /** * @returns the char in the symbol font that belongs to * the given name. */ - QChar unicode( QString name ) const; - QString name( QChar symbol ) const; + TQChar tqunicode( TQString name ) const; + TQString name( TQChar symbol ) const; - QFont font( QChar symbol, const QFont& f ) const; + TQFont font( TQChar symbol, const TQFont& f ) const; - CharClass charClass( QChar symbol ) const; + CharClass charClass( TQChar symbol ) const; /** * @returns a string with all greek letters. */ - QString greekLetters() const; + TQString greekLetters() const; /** - * @returns the unicode value of the symbol font char. + * @returns the tqunicode value of the symbol font char. */ - QChar unicodeFromSymbolFont( QChar pos ) const; + TQChar tqunicodeFromSymbolFont( TQChar pos ) const; /** * @returns all known names as strings. */ - QStringList allNames() const; + TQStringList allNames() const; - typedef QMap<QChar, QString> NameTable; - typedef QMap<QString, QChar> EntryTable; + typedef TQMap<TQChar, TQString> NameTable; + typedef TQMap<TQString, TQChar> EntryTable; private: - QString get_name( UnicodeNameTable entry ) const; + TQString get_name( UnicodeNameTable entry ) const; /** - * unicode -> name mapping. + * tqunicode -> name mapping. */ NameTable names; /** - * Name -> unicode mapping. + * Name -> tqunicode mapping. */ EntryTable entries; @@ -140,7 +140,7 @@ private: * this table is present in this font. If user selected font doesn't have * the needed glyph this font will be used instead. */ - QFont backupFont; + TQFont backupFont; }; KFORMULA_NAMESPACE_END diff --git a/lib/kformula/textelement.cc b/lib/kformula/textelement.cc index 7526acb6..24eae2d8 100644 --- a/lib/kformula/textelement.cc +++ b/lib/kformula/textelement.cc @@ -18,8 +18,8 @@ * Boston, MA 02110-1301, USA. */ -#include <qfontmetrics.h> -#include <qpainter.h> +#include <tqfontmetrics.h> +#include <tqpainter.h> #include <kdebug.h> @@ -37,8 +37,8 @@ KFORMULA_NAMESPACE_BEGIN -TextElement::TextElement(QChar ch, bool beSymbol, BasicElement* parent) - : BasicElement(parent), character(ch), symbol(beSymbol) +TextElement::TextElement(TQChar ch, bool beSymbol, BasicElement* tqparent) + : BasicElement(tqparent), character(ch), symbol(beSymbol) { charStyle( anyChar ); charFamily( anyFamily ); @@ -66,7 +66,7 @@ TokenType TextElement::getTokenType() const return getSymbolTable().charClass( character ); } - switch ( character.unicode() ) { + switch ( character.tqunicode() ) { case '+': case '-': case '*': @@ -106,7 +106,7 @@ bool TextElement::isInvisible() const /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ void TextElement::calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -119,27 +119,27 @@ void TextElement::calcSizes( const ContextStyle& context, setCharStyle( style.charStyle() ); setCharFamily( style.charFamily() ); - QFont font = getFont( context, style ); - double fontsize = context.layoutUnitPtToPt( mySize ); + TQFont font = getFont( context, style ); + double fontsize = context.tqlayoutUnitPtToPt( mySize ); double scriptsize = pow( style.scriptSizeMultiplier(), style.scriptLevel() ); double size = fontsize * scriptsize; font.setPointSizeFloat( size < style.scriptMinSize() ? style.scriptMinSize() : size ); - QFontMetrics fm( font ); + TQFontMetrics fm( font ); if ( character == applyFunctionChar || character == invisibleTimes || character == invisibleComma ) { setWidth( 0 ); setHeight( 0 ); setBaseline( getHeight() ); } else { - QChar ch = getRealCharacter(context); - if ( ch == QChar::null ) { - setWidth( qRound( context.getEmptyRectWidth( factor ) * 2./3. ) ); - setHeight( qRound( context.getEmptyRectHeight( factor ) * 2./3. ) ); + TQChar ch = getRealCharacter(context); + if ( ch == TQChar::null ) { + setWidth( tqRound( context.getEmptyRectWidth( factor ) * 2./3. ) ); + setHeight( tqRound( context.getEmptyRectHeight( factor ) * 2./3. ) ); setBaseline( getHeight() ); } else { - QRect bound = fm.boundingRect( ch ); + TQRect bound = fm.boundingRect( ch ); setWidth( context.ptToLayoutUnitPt( fm.width( ch ) ) ); setHeight( context.ptToLayoutUnitPt( bound.height() ) ); setBaseline( context.ptToLayoutUnitPt( -bound.top() ) ); @@ -155,22 +155,22 @@ void TextElement::calcSizes( const ContextStyle& context, } /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ -void TextElement::draw( QPainter& painter, const LuPixelRect& /*r*/, +void TextElement::draw( TQPainter& painter, const LuPixelRect& /*r*/, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle /*istyle*/, StyleAttributes& style, - const LuPixelPoint& parentOrigin ) + const LuPixelPoint& tqparentOrigin ) { if ( character == applyFunctionChar || character == invisibleTimes || character == invisibleComma ) { return; } - LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); + LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) // return; @@ -183,8 +183,8 @@ void TextElement::draw( QPainter& painter, const LuPixelRect& /*r*/, double factor = style.sizeFactor(); luPt mySize = context.getAdjustedSize( tstyle, factor ); - QFont font = getFont( context, style ); - double fontsize = context.layoutUnitPtToPt( mySize ); + TQFont font = getFont( context, style ); + double fontsize = context.tqlayoutUnitPtToPt( mySize ); double scriptsize = pow( style.scriptSizeMultiplier(), style.scriptLevel() ); double size = fontsize * scriptsize; font.setPointSizeFloat( size < style.scriptMinSize() ? style.scriptMinSize() : size ); @@ -192,7 +192,7 @@ void TextElement::draw( QPainter& painter, const LuPixelRect& /*r*/, //kdDebug( DEBUGID ) << "TextElement::draw font=" << font.rawName() << endl; //kdDebug( DEBUGID ) << "TextElement::draw size=" << mySize << endl; - //kdDebug( DEBUGID ) << "TextElement::draw size=" << context.layoutUnitToFontSize( mySize, false ) << endl; + //kdDebug( DEBUGID ) << "TextElement::draw size=" << context.tqlayoutUnitToFontSize( mySize, false ) << endl; //kdDebug( DEBUGID ) << "TextElement::draw height: " << getHeight() << endl; //kdDebug( DEBUGID ) << "TextElement::draw width: " << getWidth() << endl; //kdDebug( DEBUGID ) << endl; @@ -201,23 +201,23 @@ void TextElement::draw( QPainter& painter, const LuPixelRect& /*r*/, /* ElementType* token = getElementType(); if ( ( token != 0 ) && !symbol ) { - QString text = token->text( static_cast<SequenceElement*>( getParent() ) ); -// kdDebug() << "draw text: " << text[0].unicode() + TQString text = token->text( static_cast<SequenceElement*>( getParent() ) ); +// kdDebug() << "draw text: " << text[0].tqunicode() // << " " << painter.font().family().latin1() // << endl; - painter.fillRect( context.layoutUnitToPixelX( parentOrigin.x() ), - context.layoutUnitToPixelY( parentOrigin.y() ), - context.layoutUnitToPixelX( getParent()->getWidth() ), - context.layoutUnitToPixelY( getParent()->getHeight() ), + painter.fillRect( context.tqlayoutUnitToPixelX( tqparentOrigin.x() ), + context.tqlayoutUnitToPixelY( tqparentOrigin.y() ), + context.tqlayoutUnitToPixelX( getParent()->getWidth() ), + context.tqlayoutUnitToPixelY( getParent()->getHeight() ), style.background() ); - painter.drawText( context.layoutUnitToPixelX( myPos.x() ), - context.layoutUnitToPixelY( myPos.y()+getBaseline() ), + painter.drawText( context.tqlayoutUnitToPixelX( myPos.x() ), + context.tqlayoutUnitToPixelY( myPos.y()+getBaseline() ), text ); } else { */ - QChar ch = getRealCharacter(context); - if ( ch != QChar::null ) { + TQChar ch = getRealCharacter(context); + if ( ch != TQChar::null ) { luPixel bl = getBaseline(); if ( bl == -1 ) { // That's quite hacky and actually not the way it's @@ -226,29 +226,29 @@ void TextElement::draw( QPainter& painter, const LuPixelRect& /*r*/, // baseline==0 glyphs without yet another flag. bl = -( getHeight()/2 + context.axisHeight( tstyle, factor ) ); } - painter.drawText( context.layoutUnitToPixelX( myPos.x() ), - context.layoutUnitToPixelY( myPos.y()+bl ), - ch ); + painter.drawText( context.tqlayoutUnitToPixelX( myPos.x() ), + context.tqlayoutUnitToPixelY( myPos.y()+bl ), + TQString(ch) ); } else { - painter.setPen( QPen( context.getErrorColor(), - context.layoutUnitToPixelX( context.getLineWidth( factor ) ) ) ); - painter.drawRect( context.layoutUnitToPixelX( myPos.x() ), - context.layoutUnitToPixelY( myPos.y() ), - context.layoutUnitToPixelX( getWidth() ), - context.layoutUnitToPixelY( getHeight() ) ); + painter.setPen( TQPen( context.getErrorColor(), + context.tqlayoutUnitToPixelX( context.getLineWidth( factor ) ) ) ); + painter.drawRect( context.tqlayoutUnitToPixelX( myPos.x() ), + context.tqlayoutUnitToPixelY( myPos.y() ), + context.tqlayoutUnitToPixelX( getWidth() ), + context.tqlayoutUnitToPixelY( getHeight() ) ); } // } // Debug - //painter.setBrush(Qt::NoBrush); + //painter.setBrush(TQt::NoBrush); // if ( isSymbol() ) { -// painter.setPen( Qt::red ); -// painter.drawRect( context.layoutUnitToPixelX( myPos.x() ), -// context.layoutUnitToPixelX( myPos.y() ), -// context.layoutUnitToPixelX( getWidth() ), -// context.layoutUnitToPixelX( getHeight() ) ); -// painter.setPen(Qt::green); +// painter.setPen( TQt::red ); +// painter.drawRect( context.tqlayoutUnitToPixelX( myPos.x() ), +// context.tqlayoutUnitToPixelX( myPos.y() ), +// context.tqlayoutUnitToPixelX( getWidth() ), +// context.tqlayoutUnitToPixelX( getHeight() ) ); +// painter.setPen(TQt::green); // painter.drawLine(myPos.x(), myPos.y()+axis( context, tstyle ), // myPos.x()+getWidth(), myPos.y()+axis( context, tstyle )); // } @@ -272,7 +272,7 @@ void TextElement::setCharFamily( CharFamily cf ) formula()->changed(); } -QChar TextElement::getRealCharacter(const ContextStyle& context) +TQChar TextElement::getRealCharacter(const ContextStyle& context) { return character; /* @@ -296,10 +296,10 @@ QChar TextElement::getRealCharacter(const ContextStyle& context) } -QFont TextElement::getFont(const ContextStyle& context, const StyleAttributes& style) +TQFont TextElement::getFont(const ContextStyle& context, const StyleAttributes& style) { const FontStyle& fontStyle = context.fontStyle(); - QFont font; + TQFont font; if ( style.customFont() ) { font = style.font(); } @@ -335,13 +335,13 @@ QFont TextElement::getFont(const ContextStyle& context, const StyleAttributes& s } -void TextElement::setUpPainter(const ContextStyle& context, QPainter& painter) +void TextElement::setUpPainter(const ContextStyle& context, TQPainter& painter) { if (getElementType() != 0) { getElementType()->setUpPainter(context, painter); } else { - painter.setPen(Qt::red); + painter.setPen(TQt::red); } } @@ -351,19 +351,19 @@ const SymbolTable& TextElement::getSymbolTable() const } -void TextElement::writeMathML( QDomDocument& doc, QDomNode& parent, bool ) const +void TextElement::writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool ) const { - parent.appendChild( doc.createTextNode( getCharacter() ) ); + tqparent.appendChild( doc.createTextNode( getCharacter() ) ); } /** * Appends our attributes to the dom element. */ -void TextElement::writeDom(QDomElement element) +void TextElement::writeDom(TQDomElement element) { BasicElement::writeDom(element); - element.setAttribute("CHAR", QString(character)); - //QString s; + element.setAttribute("CHAR", TQString(character)); + //TQString s; //element.setAttribute("CHAR", s.sprintf( "#x%05X", character ) ); if (symbol) element.setAttribute("SYMBOL", "3"); @@ -388,23 +388,23 @@ void TextElement::writeDom(QDomElement element) * Reads our attributes from the element. * Returns false if it failed. */ -bool TextElement::readAttributesFromDom(QDomElement element) +bool TextElement::readAttributesFromDom(TQDomElement element) { if (!BasicElement::readAttributesFromDom(element)) { return false; } - QString charStr = element.attribute("CHAR"); + TQString charStr = element.attribute("CHAR"); if(!charStr.isNull()) { character = charStr.at(0); } - QString symbolStr = element.attribute("SYMBOL"); + TQString symbolStr = element.attribute("SYMBOL"); if(!symbolStr.isNull()) { int symbolInt = symbolStr.toInt(); if ( symbolInt == 1 ) { - character = getSymbolTable().unicodeFromSymbolFont(character); + character = getSymbolTable().tqunicodeFromSymbolFont(character); } if ( symbolInt == 2 ) { - switch ( character.unicode() ) { + switch ( character.tqunicode() ) { case 0x03D5: character = 0x03C6; break; case 0x03C6: character = 0x03D5; break; case 0x03Ba: character = 0x03BA; break; @@ -423,7 +423,7 @@ bool TextElement::readAttributesFromDom(QDomElement element) symbol = symbolInt != 0; } - QString styleStr = element.attribute("STYLE"); + TQString styleStr = element.attribute("STYLE"); if ( styleStr == "normal" ) { charStyle( normalChar ); } @@ -440,7 +440,7 @@ bool TextElement::readAttributesFromDom(QDomElement element) charStyle( anyChar ); } - QString familyStr = element.attribute( "FAMILY" ); + TQString familyStr = element.attribute( "FAMILY" ); if ( familyStr == "normal" ) { charFamily( normalFamily ); } @@ -469,28 +469,28 @@ bool TextElement::readAttributesFromDom(QDomElement element) * that needs to be read. * Returns false if it failed. */ -bool TextElement::readContentFromDom(QDomNode& node) +bool TextElement::readContentFromDom(TQDomNode& node) { return BasicElement::readContentFromDom(node); } -QString TextElement::toLatex() +TQString TextElement::toLatex() { if ( isSymbol() ) { - QString texName = getSymbolTable().name( character ); + TQString texName = getSymbolTable().name( character ); if ( !texName.isNull() ) return " \\" + texName + " "; return " ? "; } else { - return QString(character); + return TQString(character); } } -QString TextElement::formulaString() +TQString TextElement::formulaString() { if ( isSymbol() ) { - QString texName = getSymbolTable().name( character ); + TQString texName = getSymbolTable().name( character ); if ( !texName.isNull() ) return " " + texName + " "; return " ? "; @@ -501,8 +501,8 @@ QString TextElement::formulaString() } -EmptyElement::EmptyElement( BasicElement* parent ) - : BasicElement( parent ) +EmptyElement::EmptyElement( BasicElement* tqparent ) + : BasicElement( tqparent ) { } @@ -526,25 +526,25 @@ void EmptyElement::calcSizes( const ContextStyle& context, luPt mySize = context.getAdjustedSize( tstyle, style.sizeFactor() ); //kdDebug( DEBUGID ) << "TextElement::calcSizes size=" << mySize << endl; - QFont font = context.getDefaultFont(); - font.setPointSizeFloat( context.layoutUnitPtToPt( mySize ) ); + TQFont font = context.getDefaultFont(); + font.setPointSizeFloat( context.tqlayoutUnitPtToPt( mySize ) ); - QFontMetrics fm( font ); - QChar ch = 'A'; - QRect bound = fm.boundingRect( ch ); + TQFontMetrics fm( font ); + TQChar ch = 'A'; + TQRect bound = fm.boundingRect( ch ); setWidth( 0 ); setHeight( context.ptToLayoutUnitPt( bound.height() ) ); setBaseline( context.ptToLayoutUnitPt( -bound.top() ) ); } -void EmptyElement::draw( QPainter& painter, const LuPixelRect& /*r*/, +void EmptyElement::draw( TQPainter& painter, const LuPixelRect& /*r*/, const ContextStyle& context, ContextStyle::TextStyle /*tstyle*/, ContextStyle::IndexStyle /*istyle*/, StyleAttributes& /*style*/ , - const LuPixelPoint& parentOrigin ) + const LuPixelPoint& tqparentOrigin ) { - LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); + LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); /* if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) return; @@ -552,14 +552,14 @@ void EmptyElement::draw( QPainter& painter, const LuPixelRect& /*r*/, if ( context.edit() ) { painter.setPen( context.getHelpColor() ); - painter.drawLine( context.layoutUnitToPixelX( myPos.x() ), - context.layoutUnitToPixelY( myPos.y() ), - context.layoutUnitToPixelX( myPos.x() ), - context.layoutUnitToPixelY( myPos.y()+getHeight() ) ); + painter.drawLine( context.tqlayoutUnitToPixelX( myPos.x() ), + context.tqlayoutUnitToPixelY( myPos.y() ), + context.tqlayoutUnitToPixelX( myPos.x() ), + context.tqlayoutUnitToPixelY( myPos.y()+getHeight() ) ); } } -QString EmptyElement::toLatex() +TQString EmptyElement::toLatex() { return "{}"; } diff --git a/lib/kformula/textelement.h b/lib/kformula/textelement.h index bac10acc..0b97f441 100644 --- a/lib/kformula/textelement.h +++ b/lib/kformula/textelement.h @@ -21,8 +21,8 @@ #ifndef TEXTELEMENT_H #define TEXTELEMENT_H -#include <qfont.h> -#include <qstring.h> +#include <tqfont.h> +#include <tqstring.h> #include "basicelement.h" @@ -38,7 +38,7 @@ class TextElement : public BasicElement { TextElement operator=( const TextElement& ) { return *this; } public: - TextElement(QChar ch = ' ', bool beSymbol = false, BasicElement* parent = 0); + TextElement(TQChar ch = ' ', bool beSymbol = false, BasicElement* tqparent = 0); TextElement( const TextElement& ); virtual TextElement* clone() { @@ -62,7 +62,7 @@ public: * @returns the character that represents this element. Used for * parsing a sequence. */ - virtual QChar getCharacter() const { return character; } + virtual TQChar getCharacter() const { return character; } // drawing // @@ -73,7 +73,7 @@ public: /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, @@ -81,26 +81,26 @@ public: StyleAttributes& style ); /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); /** - * Dispatch this FontCommand to all our TextElement children. + * Dispatch this FontCommand to all our TextElement tqchildren. */ virtual void dispatchFontCommand( FontCommand* cmd ); /** * Set the color to use to display */ - void setColor( QColor c ) { color = c; } + void setColor( TQColor c ) { color = c; } CharStyle getCharStyle() const { return charStyle(); } void setCharStyle( CharStyle cs ); @@ -123,13 +123,13 @@ public: /** * @returns the latex representation of the element and - * of the element's children + * of the element's tqchildren */ - virtual QString toLatex(); + virtual TQString toLatex(); - virtual QString formulaString(); + virtual TQString formulaString(); - virtual void writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat = false ) const ; + virtual void writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat = false ) const ; protected: @@ -138,40 +138,40 @@ protected: /** * @returns the tag name of this element type. */ - virtual QString getTagName() const { return "TEXT"; } + virtual TQString getTagName() const { return "TEXT"; } /** * Appends our attributes to the dom element. */ - virtual void writeDom(QDomElement element); + virtual void writeDom(TQDomElement element); /** * Reads our attributes from the element. * Returns false if it failed. */ - virtual bool readAttributesFromDom(QDomElement element); + virtual bool readAttributesFromDom(TQDomElement element); /** * Reads our content from the node. Sets the node to the next node * that needs to be read. * Returns false if it failed. */ - virtual bool readContentFromDom(QDomNode& node); + virtual bool readContentFromDom(TQDomNode& node); /** * @returns the char that is used to draw with the given font. */ - QChar getRealCharacter(const ContextStyle& context); + TQChar getRealCharacter(const ContextStyle& context); /** * @returns the font to be used for the element. */ - QFont getFont(const ContextStyle& context, const StyleAttributes& style); + TQFont getFont(const ContextStyle& context, const StyleAttributes& style); /** * Sets up the painter to be used for drawing. */ - void setUpPainter(const ContextStyle& context, QPainter& painter); + void setUpPainter(const ContextStyle& context, TQPainter& painter); const SymbolTable& getSymbolTable() const; @@ -180,7 +180,7 @@ private: /** * Our content. */ - QChar character; + TQChar character; /** * Whether this character is a symbol. @@ -190,7 +190,7 @@ private: /** * Color to display. Set by container. */ - QColor color; + TQColor color; /** * The attribute of the char. "anyChar" means leave the default. @@ -226,7 +226,7 @@ class EmptyElement : public BasicElement { EmptyElement& operator=( const EmptyElement& ) { return *this; } public: - EmptyElement( BasicElement* parent = 0 ); + EmptyElement( BasicElement* tqparent = 0 ); EmptyElement( const EmptyElement& ); virtual EmptyElement* clone() { @@ -240,11 +240,11 @@ public: * parsing a sequence. * Here we use a dummy so an EmptyElement pretends to be a letter. */ - virtual QChar getCharacter() const { return 'A'; } + virtual TQChar getCharacter() const { return 'A'; } /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, @@ -252,23 +252,23 @@ public: StyleAttributes& style ); /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); /** * @returns the latex representation of the element and - * of the element's children + * of the element's tqchildren */ - virtual QString toLatex(); + virtual TQString toLatex(); protected: @@ -277,7 +277,7 @@ protected: /** * @returns the tag name of this element type. */ - virtual QString getTagName() const { return "EMPTY"; } + virtual TQString getTagName() const { return "EMPTY"; } }; diff --git a/lib/kformula/tokenelement.cc b/lib/kformula/tokenelement.cc index 6c849e9c..bb63c05f 100644 --- a/lib/kformula/tokenelement.cc +++ b/lib/kformula/tokenelement.cc @@ -19,7 +19,7 @@ #include <algorithm> -#include <qpainter.h> +#include <tqpainter.h> #include <klocale.h> @@ -38,16 +38,16 @@ KFORMULA_NAMESPACE_BEGIN -TokenElement::TokenElement( BasicElement* parent ) : TokenStyleElement( parent ), +TokenElement::TokenElement( BasicElement* tqparent ) : TokenStyleElement( tqparent ), m_textOnly( true ) { } -int TokenElement::buildChildrenFromMathMLDom(QPtrList<BasicElement>& list, QDomNode n) +int TokenElement::buildChildrenFromMathMLDom(TQPtrList<BasicElement>& list, TQDomNode n) { while ( ! n.isNull() ) { if ( n.isText() ) { - QString textelements = n.toText().data(); + TQString textelements = n.toText().data(); textelements = textelements.stripWhiteSpace(); for (uint i = 0; i < textelements.length(); i++) { @@ -59,15 +59,15 @@ int TokenElement::buildChildrenFromMathMLDom(QPtrList<BasicElement>& list, QDomN } } else if ( n.isEntityReference() ) { - QString entity = n.toEntityReference().nodeName(); + TQString entity = n.toEntityReference().nodeName(); const entityMap* begin = entities; const entityMap* end = entities + entityMap::size(); const entityMap* pos = std::lower_bound( begin, end, entity.ascii() ); - if ( pos == end || QString( pos->name ) != entity ) { + if ( pos == end || TQString( pos->name ) != entity ) { kdWarning() << "Invalid entity refererence: " << entity << endl; } else { - TextElement* child = new TextElement( QChar( pos->unicode ) ); + TextElement* child = new TextElement( TQChar( pos->tqunicode ) ); child->setParent(this); child->setCharFamily( charFamily() ); child->setCharStyle( charStyle() ); @@ -77,7 +77,7 @@ int TokenElement::buildChildrenFromMathMLDom(QPtrList<BasicElement>& list, QDomN else if ( n.isElement() ) { m_textOnly = false; // Only mglyph element is allowed - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( e.tagName().lower() != "mglyph" ) { kdWarning( DEBUGID ) << "Invalid element inside Token Element\n"; return -1; @@ -97,7 +97,7 @@ int TokenElement::buildChildrenFromMathMLDom(QPtrList<BasicElement>& list, QDomN n = n.nextSibling(); } // parse(); - kdWarning() << "Num of children " << list.count() << endl; + kdWarning() << "Num of tqchildren " << list.count() << endl; return 1; } diff --git a/lib/kformula/tokenelement.h b/lib/kformula/tokenelement.h index 8a64bb99..9982225b 100644 --- a/lib/kformula/tokenelement.h +++ b/lib/kformula/tokenelement.h @@ -30,13 +30,13 @@ KFORMULA_NAMESPACE_BEGIN class TokenElement : public TokenStyleElement { typedef TokenStyleElement inherited; public: - TokenElement( BasicElement* parent = 0 ); + TokenElement( BasicElement* tqparent = 0 ); - virtual int buildChildrenFromMathMLDom(QPtrList<BasicElement>& list, QDomNode n); + virtual int buildChildrenFromMathMLDom(TQPtrList<BasicElement>& list, TQDomNode n); - virtual QString getElementName() const { return "mtext"; } + virtual TQString getElementName() const { return "mtext"; } protected: - QString getCharFromEntity( const QString& entity ); + TQString getCharFromEntity( const TQString& entity ); /** * @returns true if the sequence contains only text. diff --git a/lib/kformula/tokenstyleelement.cc b/lib/kformula/tokenstyleelement.cc index d205f70d..43731425 100644 --- a/lib/kformula/tokenstyleelement.cc +++ b/lib/kformula/tokenstyleelement.cc @@ -17,14 +17,14 @@ * Boston, MA 02110-1301, USA. */ -#include <qpainter.h> +#include <tqpainter.h> #include "basicelement.h" #include "tokenstyleelement.h" KFORMULA_NAMESPACE_BEGIN -TokenStyleElement::TokenStyleElement( BasicElement* parent ) : SequenceElement( parent ), +TokenStyleElement::TokenStyleElement( BasicElement* tqparent ) : SequenceElement( tqparent ), m_mathSizeType ( NoSize ), m_charStyle( anyChar ), m_charFamily( anyFamily ), @@ -54,36 +54,36 @@ void TokenStyleElement::calcSizes( const ContextStyle& context, resetStyle( style ); } -void TokenStyleElement::draw( QPainter& painter, const LuPixelRect& r, +void TokenStyleElement::draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ) + const LuPixelPoint& tqparentOrigin ) { setStyleSize( context, style ); setStyleVariant( style ); setStyleColor( style ); setStyleBackground( style ); - if ( style.background() != Qt::color0 ) { - painter.fillRect( context.layoutUnitToPixelX( parentOrigin.x() + getX() ), - context.layoutUnitToPixelY( parentOrigin.y() + getY() ), - context.layoutUnitToPixelX( getWidth() ), - context.layoutUnitToPixelY( getHeight() ), + if ( style.background() != TQt::color0 ) { + painter.fillRect( context.tqlayoutUnitToPixelX( tqparentOrigin.x() + getX() ), + context.tqlayoutUnitToPixelY( tqparentOrigin.y() + getY() ), + context.tqlayoutUnitToPixelX( getWidth() ), + context.tqlayoutUnitToPixelY( getHeight() ), style.background() ); } - inherited::draw( painter, r, context, tstyle, istyle, style, parentOrigin ); + inherited::draw( painter, r, context, tstyle, istyle, style, tqparentOrigin ); resetStyle( style ); } -bool TokenStyleElement::readAttributesFromMathMLDom( const QDomElement& element ) +bool TokenStyleElement::readAttributesFromMathMLDom( const TQDomElement& element ) { if ( !BasicElement::readAttributesFromMathMLDom( element ) ) { return false; } // MathML Section 3.2.2 - QString variantStr = element.attribute( "mathvariant" ); + TQString variantStr = element.attribute( "mathvariant" ); if ( !variantStr.isNull() ) { if ( variantStr == "normal" ) { setCharStyle( normalChar ); @@ -143,7 +143,7 @@ bool TokenStyleElement::readAttributesFromMathMLDom( const QDomElement& element } } - QString sizeStr = element.attribute( "mathsize" ); + TQString sizeStr = element.attribute( "mathsize" ); if ( !sizeStr.isNull() ) { if ( sizeStr == "small" ) { setRelativeSize( 0.8 ); // ### Arbitrary size @@ -172,22 +172,22 @@ bool TokenStyleElement::readAttributesFromMathMLDom( const QDomElement& element } } - QString colorStr = element.attribute( "mathcolor" ); + TQString colorStr = element.attribute( "mathcolor" ); if ( !colorStr.isNull() ) { if ( colorStr[0] != '#' ) { - setMathColor( QColor( getHtmlColor( colorStr ) ) ); + setMathColor( TQColor( getHtmlColor( colorStr ) ) ); } else { - setMathColor( QColor( colorStr ) ); + setMathColor( TQColor( colorStr ) ); } } - QString backgroundStr = element.attribute( "mathbackground" ); + TQString backgroundStr = element.attribute( "mathbackground" ); if ( !backgroundStr.isNull() ) { if ( backgroundStr[0] != '#' ) { - setMathBackground( QColor( getHtmlColor( backgroundStr ) ) ); + setMathBackground( TQColor( getHtmlColor( backgroundStr ) ) ); } else { - setMathBackground( QColor( backgroundStr ) ); + setMathBackground( TQColor( backgroundStr ) ); } } @@ -222,7 +222,7 @@ bool TokenStyleElement::readAttributesFromMathMLDom( const QDomElement& element } } - QString styleStr = element.attribute( "fontstyle" ); + TQString styleStr = element.attribute( "fontstyle" ); if ( ! styleStr.isNull() ) { if ( styleStr.lower() == "italic" ) { setFontStyle( true ); @@ -232,7 +232,7 @@ bool TokenStyleElement::readAttributesFromMathMLDom( const QDomElement& element } } - QString weightStr = element.attribute( "fontweight" ); + TQString weightStr = element.attribute( "fontweight" ); if ( ! weightStr.isNull() ) { if ( weightStr.lower() == "bold" ) { setFontWeight( true ); @@ -242,7 +242,7 @@ bool TokenStyleElement::readAttributesFromMathMLDom( const QDomElement& element } } - QString familyStr = element.attribute( "fontfamily" ); + TQString familyStr = element.attribute( "fontfamily" ); if ( ! familyStr.isNull() ) { setFontFamily( familyStr ); } @@ -250,17 +250,17 @@ bool TokenStyleElement::readAttributesFromMathMLDom( const QDomElement& element colorStr = element.attribute( "color" ); if ( ! colorStr.isNull() ) { if ( colorStr[0] != '#' ) { - setColor( QColor( getHtmlColor( colorStr ) ) ); + setColor( TQColor( getHtmlColor( colorStr ) ) ); } else { - setColor( QColor( colorStr ) ); + setColor( TQColor( colorStr ) ); } } return true; } -void TokenStyleElement::writeMathMLAttributes( QDomElement& element ) const +void TokenStyleElement::writeMathMLAttributes( TQDomElement& element ) const { // mathvariant attribute if ( customMathVariant() ) { @@ -344,13 +344,13 @@ void TokenStyleElement::writeMathMLAttributes( QDomElement& element ) const // mathsize attribute switch ( m_mathSizeType ) { case AbsoluteSize: - element.setAttribute( "mathsize", QString( "%1pt" ).arg( m_mathSize ) ); + element.setAttribute( "mathsize", TQString( "%1pt" ).tqarg( m_mathSize ) ); break; case RelativeSize: - element.setAttribute( "mathsize", QString( "%1%" ).arg( m_mathSize * 100.0 ) ); + element.setAttribute( "mathsize", TQString( "%1%" ).tqarg( m_mathSize * 100.0 ) ); break; case PixelSize: - element.setAttribute( "mathsize", QString( "%1px" ).arg( m_mathSize ) ); + element.setAttribute( "mathsize", TQString( "%1px" ).tqarg( m_mathSize ) ); break; default: break; @@ -370,13 +370,13 @@ void TokenStyleElement::writeMathMLAttributes( QDomElement& element ) const // fontsize attribute switch ( m_fontSizeType ) { case AbsoluteSize: - element.setAttribute( "fontsize", QString( "%1pt" ).arg( m_fontSize ) ); + element.setAttribute( "fontsize", TQString( "%1pt" ).tqarg( m_fontSize ) ); break; case RelativeSize: - element.setAttribute( "fontsize", QString( "%1%" ).arg( m_fontSize * 100.0 ) ); + element.setAttribute( "fontsize", TQString( "%1%" ).tqarg( m_fontSize * 100.0 ) ); break; case PixelSize: - element.setAttribute( "fontsize", QString( "%3px" ).arg( m_fontSize ) ); + element.setAttribute( "fontsize", TQString( "%3px" ).tqarg( m_fontSize ) ); break; default: break; @@ -467,7 +467,7 @@ void TokenStyleElement::setStyleVariant( StyleAttributes& style ) style.setCustomMathVariant( false ); if ( customFontFamily() ) { style.setCustomFont( true ); - style.setFont( QFont(fontFamily()) ); + style.setFont( TQFont(fontFamily()) ); } bool fontweight = false; @@ -550,7 +550,7 @@ void TokenStyleElement::resetStyle( StyleAttributes& style ) double TokenStyleElement::sizeFactor( const ContextStyle& context, double factor ) { - double basesize = context.layoutUnitPtToPt( context.getBaseSize() ); + double basesize = context.tqlayoutUnitPtToPt( context.getBaseSize() ); switch ( m_mathSizeType ) { case AbsoluteSize: return m_mathSize / basesize; @@ -580,9 +580,9 @@ double TokenStyleElement::sizeFactor( const ContextStyle& context, double factor /** * Return RGB string from HTML Colors. See HTML Spec, section 6.5 */ -QString TokenStyleElement::getHtmlColor( const QString& colorStr ){ +TQString TokenStyleElement::getHtmlColor( const TQString& colorStr ){ - QString colorname = colorStr.lower(); + TQString colorname = colorStr.lower(); if ( colorname == "black" ) return "#000000"; diff --git a/lib/kformula/tokenstyleelement.h b/lib/kformula/tokenstyleelement.h index 9f17b19c..db7d14f6 100644 --- a/lib/kformula/tokenstyleelement.h +++ b/lib/kformula/tokenstyleelement.h @@ -36,23 +36,23 @@ class TokenStyleElement : public SequenceElement { typedef SequenceElement inherited; public: - TokenStyleElement( BasicElement* parent = 0 ); + TokenStyleElement( BasicElement* tqparent = 0 ); virtual void calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style ); - virtual void draw( QPainter& painter, const LuPixelRect& r, + virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ); + const LuPixelPoint& tqparentOrigin ); protected: - virtual bool readAttributesFromMathMLDom( const QDomElement &element ); - virtual void writeMathMLAttributes( QDomElement& element ) const ; + virtual bool readAttributesFromMathMLDom( const TQDomElement &element ); + virtual void writeMathMLAttributes( TQDomElement& element ) const ; void setAbsoluteSize( double s, bool fontsize = false ); void setRelativeSize( double s, bool fontsize = false ); @@ -70,17 +70,17 @@ protected: } CharFamily charFamily() const { return m_charFamily; } - void setMathColor( const QColor& c ) { + void setMathColor( const TQColor& c ) { m_mathColor = c; m_customMathColor = true; } - QColor mathColor() const { return m_mathColor; } + TQColor mathColor() const { return m_mathColor; } - void setMathBackground( const QColor& bg ) { + void setMathBackground( const TQColor& bg ) { m_mathBackground = bg; m_customMathBackground = true; } - QColor mathBackground() const { return m_mathBackground; } + TQColor mathBackground() const { return m_mathBackground; } void setFontWeight( bool w ) { m_fontWeight = w; @@ -94,17 +94,17 @@ protected: } bool fontStyle() const { return m_fontStyle; } - void setFontFamily( const QString& s ) { + void setFontFamily( const TQString& s ) { m_fontFamily = s; m_customFontFamily = true; } - QString fontFamily() const { return m_fontFamily; } + TQString fontFamily() const { return m_fontFamily; } - void setColor( const QColor& c ) { + void setColor( const TQColor& c ) { m_color = c; m_customColor = true; } - QColor color() const { return m_color; } + TQColor color() const { return m_color; } bool customMathVariant() const { return m_customMathVariant; } bool customMathColor() const { return m_customMathColor; } @@ -129,7 +129,7 @@ protected: /** * Return RGB string from HTML Colors. See HTML Spec, section 6.5 */ - QString getHtmlColor( const QString& colorStr ); + TQString getHtmlColor( const TQString& colorStr ); private: @@ -140,14 +140,14 @@ private: double m_mathSize; CharStyle m_charStyle; CharFamily m_charFamily; - QColor m_mathColor; - QColor m_mathBackground; + TQColor m_mathColor; + TQColor m_mathBackground; // Deprecated MathML 1.01 attributes SizeType m_fontSizeType; double m_fontSize; - QString m_fontFamily; - QColor m_color; + TQString m_fontFamily; + TQColor m_color; bool m_fontWeight; bool m_fontStyle; diff --git a/lib/kformula/unicodetable.cc b/lib/kformula/unicodetable.cc index 23dc8636..ad9a7f74 100644 --- a/lib/kformula/unicodetable.cc +++ b/lib/kformula/unicodetable.cc @@ -19,7 +19,7 @@ KFORMULA_NAMESPACE_BEGIN -struct UnicodeNameTable { short unicode; const char* name; }; +struct UnicodeNameTable { short tqunicode; const char* name; }; static UnicodeNameTable greekTable[] = { { 0x03B1, "alpha" }, |