From ffe8a83e053396df448e9413828527613ca3bd46 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:46:43 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1157647 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- khtml/rendering/bidi.cpp | 408 +++++++++++++++++------------------ khtml/rendering/bidi.h | 18 +- khtml/rendering/break_lines.cpp | 14 +- khtml/rendering/break_lines.h | 22 +- khtml/rendering/enumerate.cpp | 186 ++++++++-------- khtml/rendering/enumerate.h | 46 ++-- khtml/rendering/font.cpp | 134 ++++++------ khtml/rendering/font.h | 36 ++-- khtml/rendering/render_applet.cpp | 22 +- khtml/rendering/render_applet.h | 8 +- khtml/rendering/render_block.cpp | 74 +++---- khtml/rendering/render_block.h | 8 +- khtml/rendering/render_body.cpp | 2 +- khtml/rendering/render_box.cpp | 40 ++-- khtml/rendering/render_box.h | 12 +- khtml/rendering/render_br.cpp | 2 +- khtml/rendering/render_canvas.cpp | 46 ++-- khtml/rendering/render_canvas.h | 6 +- khtml/rendering/render_flow.cpp | 4 +- khtml/rendering/render_form.cpp | 280 ++++++++++++------------ khtml/rendering/render_form.h | 58 ++--- khtml/rendering/render_frames.cpp | 106 ++++----- khtml/rendering/render_frames.h | 8 +- khtml/rendering/render_generated.cpp | 38 ++-- khtml/rendering/render_generated.h | 4 +- khtml/rendering/render_image.cpp | 68 +++--- khtml/rendering/render_image.h | 10 +- khtml/rendering/render_inline.cpp | 88 ++++---- khtml/rendering/render_inline.h | 4 +- khtml/rendering/render_layer.cpp | 158 +++++++------- khtml/rendering/render_layer.h | 60 +++--- khtml/rendering/render_line.cpp | 36 ++-- khtml/rendering/render_line.h | 4 +- khtml/rendering/render_list.cpp | 36 ++-- khtml/rendering/render_list.h | 4 +- khtml/rendering/render_object.cpp | 138 ++++++------ khtml/rendering/render_object.h | 58 ++--- khtml/rendering/render_replaced.cpp | 266 +++++++++++------------ khtml/rendering/render_replaced.h | 28 +-- khtml/rendering/render_style.cpp | 20 +- khtml/rendering/render_style.h | 72 +++---- khtml/rendering/render_table.cpp | 54 ++--- khtml/rendering/render_table.h | 28 +-- khtml/rendering/render_text.cpp | 108 +++++----- khtml/rendering/render_text.h | 18 +- khtml/rendering/table_layout.cpp | 2 +- khtml/rendering/table_layout.h | 8 +- 47 files changed, 1425 insertions(+), 1425 deletions(-) (limited to 'khtml/rendering') diff --git a/khtml/rendering/bidi.cpp b/khtml/rendering/bidi.cpp index a220641b2..19de828a0 100644 --- a/khtml/rendering/bidi.cpp +++ b/khtml/rendering/bidi.cpp @@ -31,8 +31,8 @@ #include "xml/dom_docimpl.h" #include "kdebug.h" -#include "qdatetime.h" -#include "qfontmetrics.h" +#include "tqdatetime.h" +#include "tqfontmetrics.h" #define BIDI_DEBUG 0 //#define DEBUG_LINEBREAKS @@ -51,8 +51,8 @@ struct BidiIterator bool atEnd() const; - const QChar ¤t() const; - QChar::Direction direction() const; + const TQChar ¤t() const; + TQChar::Direction direction() const; RenderBlock *par; RenderObject *obj; @@ -61,11 +61,11 @@ struct BidiIterator struct BidiStatus { - BidiStatus() : eor(QChar::DirON), lastStrong(QChar::DirON), last(QChar::DirON) {} + BidiStatus() : eor(TQChar::DirON), lastStrong(TQChar::DirON), last(TQChar::DirON) {} - QChar::Direction eor; - QChar::Direction lastStrong; - QChar::Direction last; + TQChar::Direction eor; + TQChar::Direction lastStrong; + TQChar::Direction last; }; struct BidiState { @@ -91,19 +91,19 @@ static bool sBuildingCompactRuns; // Midpoint globals. The goal is not to do any allocation when dealing with // these midpoints, so we just keep an array around and never clear it. We track // the number of items and position using the two other variables. -static QMemArray *smidpoints; +static TQMemArray *smidpoints; static uint sNumMidpoints; static uint sCurrMidpoint; static bool betweenMidpoints; static bool isLineEmpty = true; static bool previousLineBrokeAtBR = true; -static QChar::Direction dir; +static TQChar::Direction dir; static bool adjustEmbedding; static bool emptyRun = true; static int numSpaces; -static void embed( QChar::Direction d, BidiState &bidi ); +static void embed( TQChar::Direction d, BidiState &bidi ); static void appendRun( BidiState &bidi ); static int getBPMWidth(int childValue, Length cssUnit) @@ -197,7 +197,7 @@ static void deleteBidiRuns(RenderArena* arena) Each line of text caches the embedding level at the start of the line for faster relayouting */ -BidiContext::BidiContext(unsigned char l, QChar::Direction e, BidiContext *p, bool o) +BidiContext::BidiContext(unsigned char l, TQChar::Direction e, BidiContext *p, bool o) : level(l) , override(o), dir(e) { parent = p; @@ -255,8 +255,8 @@ static inline RenderObject *Bidinext(RenderObject *par, RenderObject *current, B EUnicodeBidi ub = next->style()->unicodeBidi(); if ( ub != UBNormal && !emptyRun ) { EDirection dir = next->style()->direction(); - QChar::Direction d = ( ub == Embed ? ( dir == RTL ? QChar::DirRLE : QChar::DirLRE ) - : ( dir == RTL ? QChar::DirRLO : QChar::DirLRO ) ); + TQChar::Direction d = ( ub == Embed ? ( dir == RTL ? TQChar::DirRLE : TQChar::DirLRE ) + : ( dir == RTL ? TQChar::DirRLO : TQChar::DirLRO ) ); embed( d, bidi ); } } @@ -266,7 +266,7 @@ static inline RenderObject *Bidinext(RenderObject *par, RenderObject *current, B next = current->nextSibling(); if (next) break; if ( adjustEmbedding && current->style()->unicodeBidi() != UBNormal && !emptyRun ) { - embed( QChar::DirPDF, bidi ); + embed( TQChar::DirPDF, bidi ); } current = current->parent(); } @@ -321,9 +321,9 @@ inline bool BidiIterator::atEnd() const return false; } -const QChar &BidiIterator::current() const +const TQChar &BidiIterator::current() const { - static QChar nonBreakingSpace(0xA0); + static TQChar nonBreakingSpace(0xA0); if (!obj || !obj->isText()) return nonBreakingSpace; @@ -335,13 +335,13 @@ const QChar &BidiIterator::current() const return text->text()[pos]; } -inline QChar::Direction BidiIterator::direction() const +inline TQChar::Direction BidiIterator::direction() const { - if(!obj || !obj->isText() ) return QChar::DirON; + if(!obj || !obj->isText() ) return TQChar::DirON; RenderText *renderTxt = static_cast( obj ); if ( pos >= renderTxt->stringLength() ) - return QChar::DirON; + return TQChar::DirON; return renderTxt->text()[pos].direction(); } @@ -363,8 +363,8 @@ static void addRun(BidiRun* bidiRun) RenderText* text = static_cast(bidiRun->obj); if (text->text()) { for (int i = bidiRun->start; i < bidiRun->stop; i++) { - const QChar c = text->text()[i]; - if (c.category() == QChar::Separator_Space || c == '\n') + const TQChar c = text->text()[i]; + if (c.category() == TQChar::Separator_Space || c == '\n') numSpaces++; } } @@ -539,19 +539,19 @@ static void appendRun( BidiState &bidi ) bidi.eor.increment( bidi ); bidi.sor = bidi.eor; - dir = QChar::DirON; - bidi.status.eor = QChar::DirON; + dir = TQChar::DirON; + bidi.status.eor = TQChar::DirON; adjustEmbedding = b; } -static void embed( QChar::Direction d, BidiState &bidi ) +static void embed( TQChar::Direction d, BidiState &bidi ) { #if BIDI_DEBUG > 1 qDebug("*** embed dir=%d emptyrun=%d", d, emptyRun ); #endif bool b = adjustEmbedding ; adjustEmbedding = false; - if ( d == QChar::DirPDF ) { + if ( d == TQChar::DirPDF ) { BidiContext *c = bidi.context->parent; if (c) { if ( bidi.eor != bidi.last ) { @@ -566,23 +566,23 @@ static void embed( QChar::Direction d, BidiState &bidi ) if(bidi.context->override) dir = bidi.context->dir; else - dir = QChar::DirON; + dir = TQChar::DirON; bidi.status.lastStrong = bidi.context->dir; } } else { - QChar::Direction runDir; - if( d == QChar::DirRLE || d == QChar::DirRLO ) - runDir = QChar::DirR; + TQChar::Direction runDir; + if( d == TQChar::DirRLE || d == TQChar::DirRLO ) + runDir = TQChar::DirR; else - runDir = QChar::DirL; + runDir = TQChar::DirL; bool override; - if( d == QChar::DirLRO || d == QChar::DirRLO ) + if( d == TQChar::DirLRO || d == TQChar::DirRLO ) override = true; else override = false; unsigned char level = bidi.context->level; - if ( runDir == QChar::DirR ) { + if ( runDir == TQChar::DirR ) { if(level%2) // we have an odd level level += 2; else @@ -728,7 +728,7 @@ void RenderBlock::computeHorizontalPositionsForLine(InlineFlowBox* lineBox, Bidi case TAAUTO: numSpaces = 0; // for right to left fall through to right aligned - if (bidi.context->basicDir == QChar::DirL) + if (bidi.context->basicDir == TQChar::DirL) break; case RIGHT: case KHTML_RIGHT: @@ -750,8 +750,8 @@ void RenderBlock::computeHorizontalPositionsForLine(InlineFlowBox* lineBox, Bidi // get the number of spaces in the run int spaces = 0; for ( int i = r->start; i < r->stop; i++ ) { - const QChar c = static_cast(r->obj)->text()[i]; - if (c.category() == QChar::Separator_Space || c == '\n') + const TQChar c = static_cast(r->obj)->text()[i]; + if (c.category() == TQChar::Separator_Space || c == '\n') spaces++; } @@ -904,7 +904,7 @@ void RenderBlock::bidiReorderLine(const BidiIterator &start, const BidiIterator // context->ref(); - dir = QChar::DirON; + dir = TQChar::DirON; emptyRun = true; numSpaces = 0; @@ -914,7 +914,7 @@ void RenderBlock::bidiReorderLine(const BidiIterator &start, const BidiIterator bool atEnd = false; while( 1 ) { - QChar::Direction dirCurrent; + TQChar::Direction dirCurrent; if (atEnd) { //kdDebug(6041) << "atEnd" << endl; BidiContext *c = bidi.context; @@ -935,105 +935,105 @@ void RenderBlock::bidiReorderLine(const BidiIterator &start, const BidiIterator switch(dirCurrent) { // embedding and overrides (X1-X9 in the Bidi specs) - case QChar::DirRLE: - case QChar::DirLRE: - case QChar::DirRLO: - case QChar::DirLRO: - case QChar::DirPDF: + case TQChar::DirRLE: + case TQChar::DirLRE: + case TQChar::DirRLO: + case TQChar::DirLRO: + case TQChar::DirPDF: embed( dirCurrent, bidi ); break; // strong types - case QChar::DirL: - if(dir == QChar::DirON) - dir = QChar::DirL; + case TQChar::DirL: + if(dir == TQChar::DirON) + dir = TQChar::DirL; switch(bidi.status.last) { - case QChar::DirL: - bidi.eor = bidi.current; bidi.status.eor = QChar::DirL; break; - case QChar::DirR: - case QChar::DirAL: - case QChar::DirEN: - case QChar::DirAN: + case TQChar::DirL: + bidi.eor = bidi.current; bidi.status.eor = TQChar::DirL; break; + case TQChar::DirR: + case TQChar::DirAL: + case TQChar::DirEN: + case TQChar::DirAN: appendRun( bidi ); break; - case QChar::DirES: - case QChar::DirET: - case QChar::DirCS: - case QChar::DirBN: - case QChar::DirB: - case QChar::DirS: - case QChar::DirWS: - case QChar::DirON: - if( bidi.status.eor != QChar::DirL ) { + case TQChar::DirES: + case TQChar::DirET: + case TQChar::DirCS: + case TQChar::DirBN: + case TQChar::DirB: + case TQChar::DirS: + case TQChar::DirWS: + case TQChar::DirON: + if( bidi.status.eor != TQChar::DirL ) { //last stuff takes embedding dir - if(bidi.context->dir == QChar::DirL || bidi.status.lastStrong == QChar::DirL) { - if ( bidi.status.eor != QChar::DirEN && bidi.status.eor != QChar::DirAN && bidi.status.eor != QChar::DirON ) + if(bidi.context->dir == TQChar::DirL || bidi.status.lastStrong == TQChar::DirL) { + if ( bidi.status.eor != TQChar::DirEN && bidi.status.eor != TQChar::DirAN && bidi.status.eor != TQChar::DirON ) appendRun( bidi ); - dir = QChar::DirL; + dir = TQChar::DirL; bidi.eor = bidi.current; - bidi.status.eor = QChar::DirL; + bidi.status.eor = TQChar::DirL; } else { - if ( bidi.status.eor == QChar::DirEN || bidi.status.eor == QChar::DirAN ) + if ( bidi.status.eor == TQChar::DirEN || bidi.status.eor == TQChar::DirAN ) { dir = bidi.status.eor; appendRun( bidi ); } - dir = QChar::DirR; + dir = TQChar::DirR; bidi.eor = bidi.last; appendRun( bidi ); - dir = QChar::DirL; - bidi.status.eor = QChar::DirL; + dir = TQChar::DirL; + bidi.status.eor = TQChar::DirL; } } else { - bidi.eor = bidi.current; bidi.status.eor = QChar::DirL; + bidi.eor = bidi.current; bidi.status.eor = TQChar::DirL; } default: break; } - bidi.status.lastStrong = QChar::DirL; + bidi.status.lastStrong = TQChar::DirL; break; - case QChar::DirAL: - case QChar::DirR: - if(dir == QChar::DirON) dir = QChar::DirR; + case TQChar::DirAL: + case TQChar::DirR: + if(dir == TQChar::DirON) dir = TQChar::DirR; switch(bidi.status.last) { - case QChar::DirR: - case QChar::DirAL: - bidi.eor = bidi.current; bidi.status.eor = QChar::DirR; break; - case QChar::DirL: - case QChar::DirEN: - case QChar::DirAN: + case TQChar::DirR: + case TQChar::DirAL: + bidi.eor = bidi.current; bidi.status.eor = TQChar::DirR; break; + case TQChar::DirL: + case TQChar::DirEN: + case TQChar::DirAN: appendRun( bidi ); - dir = QChar::DirR; + dir = TQChar::DirR; bidi.eor = bidi.current; - bidi.status.eor = QChar::DirR; + bidi.status.eor = TQChar::DirR; break; - case QChar::DirES: - case QChar::DirET: - case QChar::DirCS: - case QChar::DirBN: - case QChar::DirB: - case QChar::DirS: - case QChar::DirWS: - case QChar::DirON: - if( !(bidi.status.eor == QChar::DirR) && !(bidi.status.eor == QChar::DirAL) ) { + case TQChar::DirES: + case TQChar::DirET: + case TQChar::DirCS: + case TQChar::DirBN: + case TQChar::DirB: + case TQChar::DirS: + case TQChar::DirWS: + case TQChar::DirON: + if( !(bidi.status.eor == TQChar::DirR) && !(bidi.status.eor == TQChar::DirAL) ) { //last stuff takes embedding dir - if(bidi.context->dir == QChar::DirR || bidi.status.lastStrong == QChar::DirR - || bidi.status.lastStrong == QChar::DirAL) { + if(bidi.context->dir == TQChar::DirR || bidi.status.lastStrong == TQChar::DirR + || bidi.status.lastStrong == TQChar::DirAL) { appendRun( bidi ); - dir = QChar::DirR; + dir = TQChar::DirR; bidi.eor = bidi.current; - bidi.status.eor = QChar::DirR; + bidi.status.eor = TQChar::DirR; } else { - dir = QChar::DirL; + dir = TQChar::DirL; bidi.eor = bidi.last; appendRun( bidi ); - dir = QChar::DirR; - bidi.status.eor = QChar::DirR; + dir = TQChar::DirR; + bidi.status.eor = TQChar::DirR; } } else { - bidi.eor = bidi.current; bidi.status.eor = QChar::DirR; + bidi.eor = bidi.current; bidi.status.eor = TQChar::DirR; } default: break; @@ -1043,64 +1043,64 @@ void RenderBlock::bidiReorderLine(const BidiIterator &start, const BidiIterator // weak types: - case QChar::DirNSM: + case TQChar::DirNSM: // ### if @sor, set dir to dirSor break; - case QChar::DirEN: - if(!(bidi.status.lastStrong == QChar::DirAL)) { + case TQChar::DirEN: + if(!(bidi.status.lastStrong == TQChar::DirAL)) { // if last strong was AL change EN to AN - if(dir == QChar::DirON) { - dir = QChar::DirL; + if(dir == TQChar::DirON) { + dir = TQChar::DirL; } switch(bidi.status.last) { - case QChar::DirET: - if ( bidi.status.lastStrong == QChar::DirR || bidi.status.lastStrong == QChar::DirAL ) { + case TQChar::DirET: + if ( bidi.status.lastStrong == TQChar::DirR || bidi.status.lastStrong == TQChar::DirAL ) { appendRun( bidi ); - dir = QChar::DirEN; - bidi.status.eor = QChar::DirEN; + dir = TQChar::DirEN; + bidi.status.eor = TQChar::DirEN; } // fall through - case QChar::DirEN: - case QChar::DirL: + case TQChar::DirEN: + case TQChar::DirL: bidi.eor = bidi.current; bidi.status.eor = dirCurrent; break; - case QChar::DirR: - case QChar::DirAL: - case QChar::DirAN: + case TQChar::DirR: + case TQChar::DirAL: + case TQChar::DirAN: appendRun( bidi ); - bidi.status.eor = QChar::DirEN; - dir = QChar::DirEN; break; - case QChar::DirES: - case QChar::DirCS: - if(bidi.status.eor == QChar::DirEN) { + bidi.status.eor = TQChar::DirEN; + dir = TQChar::DirEN; break; + case TQChar::DirES: + case TQChar::DirCS: + if(bidi.status.eor == TQChar::DirEN) { bidi.eor = bidi.current; break; } - case QChar::DirBN: - case QChar::DirB: - case QChar::DirS: - case QChar::DirWS: - case QChar::DirON: - if(bidi.status.eor == QChar::DirR) { + case TQChar::DirBN: + case TQChar::DirB: + case TQChar::DirS: + case TQChar::DirWS: + case TQChar::DirON: + if(bidi.status.eor == TQChar::DirR) { // neutrals go to R bidi.eor = bidi.last; appendRun( bidi ); - dir = QChar::DirEN; - bidi.status.eor = QChar::DirEN; + dir = TQChar::DirEN; + bidi.status.eor = TQChar::DirEN; } - else if( bidi.status.eor == QChar::DirL || - (bidi.status.eor == QChar::DirEN && bidi.status.lastStrong == QChar::DirL)) { + else if( bidi.status.eor == TQChar::DirL || + (bidi.status.eor == TQChar::DirEN && bidi.status.lastStrong == TQChar::DirL)) { bidi.eor = bidi.current; bidi.status.eor = dirCurrent; } else { // numbers on both sides, neutrals get right to left direction - if(dir != QChar::DirL) { + if(dir != TQChar::DirL) { appendRun( bidi ); bidi.eor = bidi.last; - dir = QChar::DirR; + dir = TQChar::DirR; appendRun( bidi ); - dir = QChar::DirEN; - bidi.status.eor = QChar::DirEN; + dir = TQChar::DirEN; + bidi.status.eor = TQChar::DirEN; } else { bidi.eor = bidi.current; bidi.status.eor = dirCurrent; } @@ -1110,49 +1110,49 @@ void RenderBlock::bidiReorderLine(const BidiIterator &start, const BidiIterator } break; } - case QChar::DirAN: - dirCurrent = QChar::DirAN; - if(dir == QChar::DirON) dir = QChar::DirAN; + case TQChar::DirAN: + dirCurrent = TQChar::DirAN; + if(dir == TQChar::DirON) dir = TQChar::DirAN; switch(bidi.status.last) { - case QChar::DirL: - case QChar::DirAN: - bidi.eor = bidi.current; bidi.status.eor = QChar::DirAN; break; - case QChar::DirR: - case QChar::DirAL: - case QChar::DirEN: + case TQChar::DirL: + case TQChar::DirAN: + bidi.eor = bidi.current; bidi.status.eor = TQChar::DirAN; break; + case TQChar::DirR: + case TQChar::DirAL: + case TQChar::DirEN: appendRun( bidi ); - dir = QChar::DirAN; bidi.status.eor = QChar::DirAN; + dir = TQChar::DirAN; bidi.status.eor = TQChar::DirAN; break; - case QChar::DirCS: - if(bidi.status.eor == QChar::DirAN) { + case TQChar::DirCS: + if(bidi.status.eor == TQChar::DirAN) { bidi.eor = bidi.current; break; } - case QChar::DirES: - case QChar::DirET: - case QChar::DirBN: - case QChar::DirB: - case QChar::DirS: - case QChar::DirWS: - case QChar::DirON: - if(bidi.status.eor == QChar::DirR) { + case TQChar::DirES: + case TQChar::DirET: + case TQChar::DirBN: + case TQChar::DirB: + case TQChar::DirS: + case TQChar::DirWS: + case TQChar::DirON: + if(bidi.status.eor == TQChar::DirR) { // neutrals go to R bidi.eor = bidi.last; appendRun( bidi ); - dir = QChar::DirAN; - bidi.status.eor = QChar::DirAN; - } else if( bidi.status.eor == QChar::DirL || - (bidi.status.eor == QChar::DirEN && bidi.status.lastStrong == QChar::DirL)) { + dir = TQChar::DirAN; + bidi.status.eor = TQChar::DirAN; + } else if( bidi.status.eor == TQChar::DirL || + (bidi.status.eor == TQChar::DirEN && bidi.status.lastStrong == TQChar::DirL)) { bidi.eor = bidi.current; bidi.status.eor = dirCurrent; } else { // numbers on both sides, neutrals get right to left direction - if(dir != QChar::DirL) { + if(dir != TQChar::DirL) { appendRun( bidi ); bidi.eor = bidi.last; - dir = QChar::DirR; + dir = TQChar::DirR; appendRun( bidi ); - dir = QChar::DirAN; - bidi.status.eor = QChar::DirAN; + dir = TQChar::DirAN; + bidi.status.eor = TQChar::DirAN; } else { bidi.eor = bidi.current; bidi.status.eor = dirCurrent; } @@ -1161,30 +1161,30 @@ void RenderBlock::bidiReorderLine(const BidiIterator &start, const BidiIterator break; } break; - case QChar::DirES: - case QChar::DirCS: + case TQChar::DirES: + case TQChar::DirCS: break; - case QChar::DirET: - if(bidi.status.last == QChar::DirEN) { - dirCurrent = QChar::DirEN; + case TQChar::DirET: + if(bidi.status.last == TQChar::DirEN) { + dirCurrent = TQChar::DirEN; bidi.eor = bidi.current; bidi.status.eor = dirCurrent; break; } break; // boundary neutrals should be ignored - case QChar::DirBN: + case TQChar::DirBN: break; // neutrals - case QChar::DirB: + case TQChar::DirB: // ### what do we do with newline and paragraph seperators that come to here? break; - case QChar::DirS: + case TQChar::DirS: // ### implement rule L1 break; - case QChar::DirWS: + case TQChar::DirWS: break; - case QChar::DirON: + case TQChar::DirON: break; default: break; @@ -1197,31 +1197,31 @@ void RenderBlock::bidiReorderLine(const BidiIterator &start, const BidiIterator // set status.last as needed. switch(dirCurrent) { - case QChar::DirET: - case QChar::DirES: - case QChar::DirCS: - case QChar::DirS: - case QChar::DirWS: - case QChar::DirON: + case TQChar::DirET: + case TQChar::DirES: + case TQChar::DirCS: + case TQChar::DirS: + case TQChar::DirWS: + case TQChar::DirON: switch(bidi.status.last) { - case QChar::DirL: - case QChar::DirR: - case QChar::DirAL: - case QChar::DirEN: - case QChar::DirAN: + case TQChar::DirL: + case TQChar::DirR: + case TQChar::DirAL: + case TQChar::DirEN: + case TQChar::DirAN: bidi.status.last = dirCurrent; break; default: - bidi.status.last = QChar::DirON; + bidi.status.last = TQChar::DirON; } break; - case QChar::DirNSM: - case QChar::DirBN: + case TQChar::DirNSM: + case TQChar::DirBN: // ignore these break; - case QChar::DirEN: - if ( bidi.status.last == QChar::DirL ) { + case TQChar::DirEN: + if ( bidi.status.last == TQChar::DirL ) { break; } // fall through @@ -1285,7 +1285,7 @@ void RenderBlock::bidiReorderLine(const BidiIterator &start, const BidiIterator #if BIDI_DEBUG > 0 kdDebug(6041) << "lineLow = " << (uint)levelLow << ", lineHigh = " << (uint)levelHigh << endl; kdDebug(6041) << "logical order is:" << endl; - QPtrListIterator it2(runs); + TQPtrListIterator it2(runs); BidiRun *r2; for ( ; (r2 = it2.current()); ++it2 ) kdDebug(6041) << " " << r2 << " start=" << r2->start << " stop=" << r2->stop << " level=" << (uint)r2->level << endl; @@ -1369,7 +1369,7 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int breakBeforeLin invalidateVerticalPositions(); #ifdef DEBUG_LAYOUT - QTime qt; + TQTime qt; qt.start(); kdDebug( 6040 ) << renderName() << " layoutInlineChildren( " << this <<" )" << endl; #endif @@ -1423,16 +1423,16 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int breakBeforeLin BidiContext *startEmbed; if( style()->direction() == LTR ) { - startEmbed = new BidiContext( 0, QChar::DirL ); - bidi.status.eor = QChar::DirL; + startEmbed = new BidiContext( 0, TQChar::DirL ); + bidi.status.eor = TQChar::DirL; } else { - startEmbed = new BidiContext( 1, QChar::DirR ); - bidi.status.eor = QChar::DirR; + startEmbed = new BidiContext( 1, TQChar::DirR ); + bidi.status.eor = TQChar::DirR; } startEmbed->ref(); - bidi.status.lastStrong = QChar::DirON; - bidi.status.last = QChar::DirON; + bidi.status.lastStrong = TQChar::DirON; + bidi.status.last = TQChar::DirON; bidi.context = startEmbed; adjustEmbedding = true; @@ -1443,7 +1443,7 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int breakBeforeLin m_firstLine = true; if (!smidpoints) - smidpoints = new QMemArray; + smidpoints = new TQMemArray; sNumMidpoints = 0; sCurrMidpoint = 0; @@ -1528,7 +1528,7 @@ redo_linebreak: adjustEmbedding = true; end.increment(bidi); adjustEmbedding = false; - } else if (end.obj && end.obj->style()->preserveLF() && end.current() == QChar('\n')) { + } else if (end.obj && end.obj->style()->preserveLF() && end.current() == TQChar('\n')) { adjustEmbedding = true; end.increment(bidi); adjustEmbedding = false; @@ -1836,7 +1836,7 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi // item, then this is all moot. -dwh RenderObject* next = Bidinext( start.par, o, bidi ); if (!style()->preserveWS() && next && next->isText() && static_cast(next)->stringLength() > 0 && - (static_cast(next)->text()[0].category() == QChar::Separator_Space || + (static_cast(next)->text()[0].category() == TQChar::Separator_Space || static_cast(next)->text()[0] == '\n')) { currentCharacterIsSpace = true; ignoringSpaces = true; @@ -1848,7 +1848,7 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi RenderText *t = static_cast(o); int strlen = t->stringLength(); int len = strlen - pos; - QChar *str = t->text(); + TQChar *str = t->text(); const Font *f = t->htmlFont( m_firstLine ); // proportional font, needs a bit more work. @@ -1868,7 +1868,7 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi bool previousCharacterIsSpace = currentCharacterIsSpace; bool isSoftBreakable = nextIsSoftBreakable; nextIsSoftBreakable = false; - const QChar c = str[pos]; + const TQChar c = str[pos]; currentCharacterIsSpace = c == ' '; if (preserveWS || !currentCharacterIsSpace) @@ -1933,7 +1933,7 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi !t->containsOnlyWhitespace(pos+1, strlen-(pos+1))); #endif #ifdef DEBUG_LINEBREAKS - kdDebug(6041) << "found space at " << pos << " in string '" << QString( str, strlen ).latin1() << "' adding " << tmpW << " new width = " << w << endl; + kdDebug(6041) << "found space at " << pos << " in string '" << TQString( str, strlen ).latin1() << "' adding " << tmpW << " new width = " << w << endl; #endif if ( autoWrap && w + tmpW > width && w == 0 ) { int fb = nearestFloatBottom(m_height); @@ -2039,7 +2039,7 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi checkForBreak = false; RenderText* nextText = static_cast(next); if (nextText->stringLength() != 0) { - QChar c = nextText->text()[0]; + TQChar c = nextText->text()[0]; if (c == ' ' || c == '\t' || (c == '\n' && !next->style()->preserveLF())) { // If the next item on the line is text, and if we did not end with // a space, then the next text run continues our word (and so it needs to @@ -2191,7 +2191,7 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi if (lBreak.obj && lBreak.pos >= 2 && lBreak.obj->isText()) { // For soft hyphens on line breaks, we have to chop out the midpoints that made us // ignore the hyphen so that it will render at the end of the line. - QChar c = static_cast(lBreak.obj)->text()[lBreak.pos-1]; + TQChar c = static_cast(lBreak.obj)->text()[lBreak.pos-1]; if (c.unicode() == SOFT_HYPHEN) chopMidpointsAt(lBreak.obj, lBreak.pos-2); } @@ -2218,8 +2218,8 @@ void RenderBlock::deleteEllipsisLineBoxes() void RenderBlock::checkLinesForTextOverflow() { // Determine the width of the ellipsis using the current font. - QChar ellipsis = 0x2026; // FIXME: CSS3 says this is configurable, also need to use 0x002E (FULL STOP) if 0x2026 not renderable - static QString ellipsisStr(ellipsis); + TQChar ellipsis = 0x2026; // FIXME: CSS3 says this is configurable, also need to use 0x002E (FULL STOP) if 0x2026 not renderable + static TQString ellipsisStr(ellipsis); const Font& firstLineFont = style(true)->htmlFont(); const Font& font = style()->htmlFont(); int firstLineEllipsisWidth = firstLineFont.width(&ellipsis, 1, 0); diff --git a/khtml/rendering/bidi.h b/khtml/rendering/bidi.h index 4d6b6aaf1..15a9ab906 100644 --- a/khtml/rendering/bidi.h +++ b/khtml/rendering/bidi.h @@ -23,7 +23,7 @@ #ifndef BIDI_H #define BIDI_H -#include +#include namespace khtml { class RenderArena; @@ -33,7 +33,7 @@ namespace khtml { class BidiContext { public: - BidiContext(unsigned char level, QChar::Direction embedding, BidiContext *parent = 0, bool override = false); + BidiContext(unsigned char level, TQChar::Direction embedding, BidiContext *parent = 0, bool override = false); ~BidiContext(); void ref() const; @@ -41,8 +41,8 @@ namespace khtml { unsigned char level; bool override : 1; - QChar::Direction dir : 5; - QChar::Direction basicDir : 5; + TQChar::Direction dir : 5; + TQChar::Direction basicDir : 5; BidiContext *parent; @@ -52,21 +52,21 @@ namespace khtml { }; struct BidiRun { - BidiRun(int _start, int _stop, RenderObject *_obj, BidiContext *context, QChar::Direction dir) + BidiRun(int _start, int _stop, RenderObject *_obj, BidiContext *context, TQChar::Direction dir) : start( _start ), stop( _stop ), obj( _obj ), box(0), nextRun(0) { - if(dir == QChar::DirON) dir = context->dir; + if(dir == TQChar::DirON) dir = context->dir; level = context->level; // add level of run (cases I1 & I2) if( level % 2 ) { - if(dir == QChar::DirL || dir == QChar::DirAN || dir == QChar::DirEN) + if(dir == TQChar::DirL || dir == TQChar::DirAN || dir == TQChar::DirEN) level++; } else { - if( dir == QChar::DirR ) + if( dir == TQChar::DirR ) level++; - else if( dir == QChar::DirAN || dir == QChar::DirEN) + else if( dir == TQChar::DirAN || dir == TQChar::DirEN) level += 2; } } diff --git a/khtml/rendering/break_lines.cpp b/khtml/rendering/break_lines.cpp index 483455127..a0d314cee 100644 --- a/khtml/rendering/break_lines.cpp +++ b/khtml/rendering/break_lines.cpp @@ -1,8 +1,8 @@ #include #include -#include "qcstring.h" -#include -#include +#include "tqcstring.h" +#include +#include #include @@ -38,7 +38,7 @@ namespace khtml { free(isbreakable); if (library) library->unload(); } - const QChar *string; + const TQChar *string; int *wbrpos; int *isbreakable; int allocated; @@ -56,9 +56,9 @@ namespace khtml { #endif } - bool isBreakableThai( const QChar *string, const int pos, const int len) + bool isBreakableThai( const TQChar *string, const int pos, const int len) { - static QTextCodec *thaiCodec = QTextCodec::codecForMib(2259); + static TQTextCodec *thaiCodec = TQTextCodec::codecForMib(2259); //printf("Entering isBreakableThai with pos = %d\n", pos); #ifndef HAVE_LIBTHAI @@ -96,7 +96,7 @@ namespace khtml { // build up string of thai chars if ( string != cache->string ) { //fprintf(stderr,"new string found (not in cache), calling libthai\n"); - QCString cstr = thaiCodec->fromUnicode( QConstString(string,len).string()); + TQCString cstr = thaiCodec->fromUnicode( TQConstString(string,len).string()); //printf("About to call libthai::th_brk with str: %s",cstr.data()); cache->numwbrpos = th_brk((const unsigned char*) cstr.data(), cache->wbrpos, cache->allocated); diff --git a/khtml/rendering/break_lines.h b/khtml/rendering/break_lines.h index e33fce247..5176e5fb0 100644 --- a/khtml/rendering/break_lines.h +++ b/khtml/rendering/break_lines.h @@ -1,7 +1,7 @@ #ifndef BREAK_LINES_H #define BREAK_LINES_H -#include +#include namespace khtml { @@ -12,8 +12,8 @@ namespace khtml { Korean, Chinese ones should work as well */ /* - dontbreakbefore[] contains characters not covered by QChar::Punctuation_Close that shouldn't be broken before. - chars included in QChar::Punctuation_Close are listed below.(look at UAX #14) + dontbreakbefore[] contains characters not covered by TQChar::Punctuation_Close that shouldn't be broken before. + chars included in TQChar::Punctuation_Close are listed below.(look at UAX #14) - 3001 ideographic comma - 3002 ideographic full stop - FE50 small comma @@ -88,7 +88,7 @@ namespace khtml { 0xFF70 //halfwidth katakana-hiragana prolonged sound mark }; - // characters that aren't covered by QChar::Punctuation_Open + // characters that aren't covered by TQChar::Punctuation_Open const ushort dontbreakafter[] = { 0x3012, //postal mark 0xFF03, //full width pound mark @@ -116,12 +116,12 @@ namespace khtml { } } - bool isBreakableThai( const QChar *string, const int pos, const int len); + bool isBreakableThai( const TQChar *string, const int pos, const int len); void cleanup_thaibreaks(); - inline bool isBreakable( const QChar *str, const int pos, int len ) + inline bool isBreakable( const TQChar *str, const int pos, int len ) { - const QChar *c = str+pos; + const TQChar *c = str+pos; unsigned short ch = c->unicode(); if ( ch > 0xff ) { // not latin1, need to do more sophisticated checks for asian fonts @@ -140,10 +140,10 @@ namespace khtml { return false; // never break before first character // check for simple punctuation cases - QChar::Category cat = c->category(); - if ( cat == QChar::Punctuation_Close || - cat == QChar::Punctuation_Other || - (str+(pos-1))->category() == QChar::Punctuation_Open ) + TQChar::Category cat = c->category(); + if ( cat == TQChar::Punctuation_Close || + cat == TQChar::Punctuation_Other || + (str+(pos-1))->category() == TQChar::Punctuation_Open ) return false; // do binary search in dontbreak[] diff --git a/khtml/rendering/enumerate.cpp b/khtml/rendering/enumerate.cpp index 75af71465..9cfe149ad 100644 --- a/khtml/rendering/enumerate.cpp +++ b/khtml/rendering/enumerate.cpp @@ -25,20 +25,20 @@ #include "rendering/enumerate.h" -#include -#include +#include +#include namespace khtml { namespace Enumerate { -QString toRoman( int number, bool upper ) +TQString toRoman( int number, bool upper ) { - if (number < 1 || number > 3999) return QString::number(number); - QString roman; - static const QChar ldigits[] = { 'i', 'v', 'x', 'l', 'c', 'd', 'm' }; - static const QChar udigits[] = { 'I', 'V', 'X', 'L', 'C', 'D', 'M' }; - const QChar *digits = upper ? udigits : ldigits; + if (number < 1 || number > 3999) return TQString::number(number); + TQString roman; + static const TQChar ldigits[] = { 'i', 'v', 'x', 'l', 'c', 'd', 'm' }; + static const TQChar udigits[] = { 'I', 'V', 'X', 'L', 'C', 'D', 'M' }; + const TQChar *digits = upper ? udigits : ldigits; int i, d = 0; do @@ -66,20 +66,20 @@ QString toRoman( int number, bool upper ) return roman; } -QString toGeorgian( int number ) +TQString toGeorgian( int number ) { - QString georgian; - const QChar tenthousand = 0x10ef; - static const QChar thousands[9] = {0x10e8, 0x10e9, 0x10ea, 0x10eb, 0x10ec, + TQString georgian; + const TQChar tenthousand = 0x10ef; + static const TQChar thousands[9] = {0x10e8, 0x10e9, 0x10ea, 0x10eb, 0x10ec, 0x10ed, 0x10ee, 0x10f4, 0x10f5 }; - static const QChar hundreds[9] = {0x10e0, 0x10e1, 0x10e2, 0x10e3, 0x10f3, + static const TQChar hundreds[9] = {0x10e0, 0x10e1, 0x10e2, 0x10e3, 0x10f3, 0x10e4, 0x10e5, 0x10e6, 0x10e7 }; - static const QChar tens[9] = {0x10d8, 0x10d9, 0x10da, 0x10db, 0x10dc, + static const TQChar tens[9] = {0x10d8, 0x10d9, 0x10da, 0x10db, 0x10dc, 0x10f2, 0x10dd, 0x10de, 0x10df }; - static const QChar units[9] = {0x10d0, 0x10d1, 0x10d2, 0x10d3, 0x10d4, + static const TQChar units[9] = {0x10d0, 0x10d1, 0x10d2, 0x10d3, 0x10d4, 0x10d5, 0x10d6, 0x10f1, 0x10d7 }; - if (number < 1 || number > 19999) return QString::number(number); + if (number < 1 || number > 19999) return TQString::number(number); if (number >= 10000) { georgian.append(tenthousand); number = number - 10000; @@ -103,54 +103,54 @@ QString toGeorgian( int number ) return georgian; } -QString toArmenian( int number ) +TQString toArmenian( int number ) { - QString armenian; + TQString armenian; int onethousand = 0x57c; int hundreds = 0x572; int tens = 0x569; int units = 0x560; // The standard defines values over 1999, but 7000 is very hard to render - if (number < 1 || number > 1999) return QString::number(number); + if (number < 1 || number > 1999) return TQString::number(number); if (number >= 1000) { - armenian.append(QChar(onethousand)); + armenian.append(TQChar(onethousand)); number = number - 1000; } if (number >= 100) { - armenian.append(QChar(hundreds+number/100)); + armenian.append(TQChar(hundreds+number/100)); number = number % 100; } if (number >= 10) { - armenian.append(QChar(tens+number/10)); + armenian.append(TQChar(tens+number/10)); number = number % 10; } if (number >= 1) { - armenian.append(QChar(units+number)); + armenian.append(TQChar(units+number)); } return armenian; } -QString toHebrew( int number ) { - static const QChar tenDigit[] = {1497, 1499, 1500, 1502, 1504, 1505, 1506, 1508, 1510}; +TQString toHebrew( int number ) { + static const TQChar tenDigit[] = {1497, 1499, 1500, 1502, 1504, 1505, 1506, 1508, 1510}; - QString letter; - if (number < 1) return QString::number(number); + TQString letter; + if (number < 1) return TQString::number(number); if (number>999) { - letter = toHebrew(number/1000) + QString::fromLatin1("'"); + letter = toHebrew(number/1000) + TQString::fromLatin1("'"); number = number%1000; } int hunderts = (number/400); if (hunderts > 0) { for(int i=0; i letters; +static inline TQString toLatin( int number, int base ) { + if (number < 1) return TQString::number(number); + TQValueList letters; while(number > 0) { number--; // number 0 is letter a - QChar letter = (QChar) (base + (number % 26)); + TQChar letter = (TQChar) (base + (number % 26)); letters.prepend(letter); number /= 26; } - QString str; + TQString str; str.setLength(letters.size()); int i=0; while(!letters.isEmpty()) { @@ -188,24 +188,24 @@ static inline QString toLatin( int number, int base ) { return str; } -QString toLowerLatin( int number ) { +TQString toLowerLatin( int number ) { return toLatin( number, 'a' ); } -QString toUpperLatin( int number ) { +TQString toUpperLatin( int number ) { return toLatin( number, 'A' ); } -static inline QString toAlphabetic( int number, int base, const QChar alphabet[] ) { - if (number < 1) return QString::number(number); - QValueList letters; +static inline TQString toAlphabetic( int number, int base, const TQChar alphabet[] ) { + if (number < 1) return TQString::number(number); + TQValueList letters; while(number > 0) { number--; // number 0 is letter 1 - QChar letter = alphabet[number % base]; + TQChar letter = alphabet[number % base]; letters.prepend(letter); number /= base; } - QString str; + TQString str; str.setLength(letters.size()); int i=0; while(!letters.isEmpty()) { @@ -215,8 +215,8 @@ static inline QString toAlphabetic( int number, int base, const QChar alphabet[] return str; } -QString toHiragana( int number ) { - static const QChar hiragana[48] = {0x3042, 0x3044, 0x3046, 0x3048, 0x304A, 0x304B, 0x304D, +TQString toHiragana( int number ) { + static const TQChar hiragana[48] = {0x3042, 0x3044, 0x3046, 0x3048, 0x304A, 0x304B, 0x304D, 0x304F, 0x3051, 0x3053, 0x3055, 0x3057, 0x3059, 0x305B, 0x305D, 0x305F, 0x3061, 0x3064, 0x3066, 0x3068, 0x306A, 0x306B, 0x306C, 0x306D, 0x306E, 0x306F, 0x3072, 0x3075, 0x3078, @@ -226,8 +226,8 @@ QString toHiragana( int number ) { return toAlphabetic( number, 48, hiragana ); } -QString toHiraganaIroha( int number ) { - static const QChar hiragana[47] = {0x3044, 0x308D, 0x306F, 0x306B, 0x307B, 0x3078, 0x3068, +TQString toHiraganaIroha( int number ) { + static const TQChar hiragana[47] = {0x3044, 0x308D, 0x306F, 0x306B, 0x307B, 0x3078, 0x3068, 0x3061, 0x308A, 0x306C, 0x308B, 0x3092, 0x308F, 0x304B, 0x3088, 0x305F, 0x308C, 0x305D, 0x3064, 0x306D, 0x306A, 0x3089, 0x3080, 0x3046, 0x3090, 0x306E, 0x304A, 0x304F, 0x3084, @@ -237,8 +237,8 @@ QString toHiraganaIroha( int number ) { return toAlphabetic( number, 47, hiragana ); } -QString toKatakana( int number ) { - static const QChar katakana[48] = {0x30A2, 0x30A4, 0x30A6, 0x30A8, 0x30AA, 0x30AB, 0x30AD, +TQString toKatakana( int number ) { + static const TQChar katakana[48] = {0x30A2, 0x30A4, 0x30A6, 0x30A8, 0x30AA, 0x30AB, 0x30AD, 0x30AF, 0x30B1, 0x30B3, 0x30B5, 0x30B7, 0x30B9, 0x30BB, 0x30BD, 0x30BF, 0x30C1, 0x30C4, 0x30C6, 0x30C8, 0x30CA, 0x30CB, 0x30CC, 0x30CD, 0x30CE, 0x30CF, 0x30D2, 0x30D5, @@ -248,8 +248,8 @@ QString toKatakana( int number ) { return toAlphabetic( number, 48, katakana ); } -QString toKatakanaIroha( int number ) { - static const QChar katakana[47] = {0x30A4, 0x30ED, 0x30CF, 0x30CB, 0x30DB, 0x30D8, 0x30C8, +TQString toKatakanaIroha( int number ) { + static const TQChar katakana[47] = {0x30A4, 0x30ED, 0x30CF, 0x30CB, 0x30DB, 0x30D8, 0x30C8, 0x30C1, 0x30EA, 0x30CC, 0x30EB, 0x30F2, 0x30EF, 0x30AB, 0x30E8, 0x30BF, 0x30EC, 0x30ED, 0x30C4, 0x30CD, 0x30CA, 0x30E9, 0x30E0, 0x30A6, 0x30F0, 0x30CE, 0x30AA, 0x30AF, @@ -259,8 +259,8 @@ QString toKatakanaIroha( int number ) { return toAlphabetic( number, 47, katakana ); } -QString toLowerGreek( int number ) { - static const QChar greek[24] = { 0x3B1, 0x3B2, 0x3B3, 0x3B4, 0x3B5, 0x3B6, 0x3B7, +TQString toLowerGreek( int number ) { + static const TQChar greek[24] = { 0x3B1, 0x3B2, 0x3B3, 0x3B4, 0x3B5, 0x3B6, 0x3B7, 0x3B8, 0x3B9, 0x3BA, 0x3BB, 0x3BC, 0x3BD, 0x3BE, 0x3BF, 0x3C0, 0x3C1, 0x3C3, 0x3C4, 0x3C5, 0x3C6, 0x3C7, 0x3C8, 0x3C0}; @@ -268,52 +268,52 @@ QString toLowerGreek( int number ) { return toAlphabetic( number, 24, greek ); } -QString toUpperGreek( int number ) { +TQString toUpperGreek( int number ) { // The standard claims to be base 24, but only lists 19 letters. - static const QChar greek[19] = { 0x391, 0x392, 0x393, 0x394, 0x395, 0x396, 0x397, 0x398, + static const TQChar greek[19] = { 0x391, 0x392, 0x393, 0x394, 0x395, 0x396, 0x397, 0x398, 0x399, 0x39A, 0x39B, 0x39C, 0x39D, 0x39E, 0x39F, 0x3A0, 0x3A1, 0x3A3, 0x3A9}; return toAlphabetic( number, 19, greek ); } -static inline QString toNumeric( int number, int base ) { - QString letter = QString::number(number); +static inline TQString toNumeric( int number, int base ) { + TQString letter = TQString::number(number); for(unsigned int i = 0; i < letter.length(); i++) { if (letter[i].isDigit()) - letter[i] = QChar(letter[i].digitValue()+base); + letter[i] = TQChar(letter[i].digitValue()+base); } return letter; } -QString toArabicIndic( int number ) { +TQString toArabicIndic( int number ) { return toNumeric(number, 0x660); } -QString toPersianUrdu( int number ) { +TQString toPersianUrdu( int number ) { return toNumeric(number, 0x6F0); } -QString toLao( int number ) { +TQString toLao( int number ) { return toNumeric(number, 0xED0); } -QString toThai( int number ) { +TQString toThai( int number ) { return toNumeric(number, 0xE50); } -QString toTibetan( int number ) { +TQString toTibetan( int number ) { return toNumeric(number, 0xF20); } -static inline QString toIdeographic(int number, const QChar digits[], const QChar digitmarkers[]) { - if (number < 0 || number > 9999) return QString::number(number); +static inline TQString toIdeographic(int number, const TQChar digits[], const TQChar digitmarkers[]) { + if (number < 0 || number > 9999) return TQString::number(number); - QString grp = QString::number(number); + TQString grp = TQString::number(number); // ### Append group markers to handle numbers > 9999 - QString str; + TQString str; // special case if (number < 20 && number >= 10) { @@ -342,10 +342,10 @@ static inline QString toIdeographic(int number, const QChar digits[], const QCha return str; } -QString toTradChineseFormal( int number ) { -// static const QChar groupMarkers[3] = {0x4e07, 0x4ebf, 0x5146}; - static const QChar digitMarkers[3] = {0x4e07, 0x4ebf, 0x5146}; - static const QChar digits[10] = {0x96f6, 0x4e00, +TQString toTradChineseFormal( int number ) { +// static const TQChar groupMarkers[3] = {0x4e07, 0x4ebf, 0x5146}; + static const TQChar digitMarkers[3] = {0x4e07, 0x4ebf, 0x5146}; + static const TQChar digits[10] = {0x96f6, 0x4e00, 0x4ebc, 0x4e09, 0x56db, 0x4e94, 0x516d, 0x4e03, @@ -353,10 +353,10 @@ QString toTradChineseFormal( int number ) { return toIdeographic(number, digits, digitMarkers); } -QString toTradChineseInformal( int number ) { -// static const QChar groupMarkers[3] = {0x842c, 0x5104, 0x5146}; - static const QChar digitMarkers[3] = {0x842c, 0x5104, 0x5146}; - static const QChar digits[10] = {0x96f6, 0x4e00, +TQString toTradChineseInformal( int number ) { +// static const TQChar groupMarkers[3] = {0x842c, 0x5104, 0x5146}; + static const TQChar digitMarkers[3] = {0x842c, 0x5104, 0x5146}; + static const TQChar digits[10] = {0x96f6, 0x4e00, 0x4ebc, 0x4e09, 0x56db, 0x4e94, 0x516d, 0x4e03, @@ -364,10 +364,10 @@ QString toTradChineseInformal( int number ) { return toIdeographic(number, digits, digitMarkers); } -QString toSimpChineseFormal( int number ) { -// static const QChar groupMarkers[3] = {0x4e07, 0x5104, 0x5146}; - static const QChar digitMarkers[3] = {0x4e07, 0x4ebf, 0x5146}; - static const QChar digits[10] = {0x96f6, 0x58f9, +TQString toSimpChineseFormal( int number ) { +// static const TQChar groupMarkers[3] = {0x4e07, 0x5104, 0x5146}; + static const TQChar digitMarkers[3] = {0x4e07, 0x4ebf, 0x5146}; + static const TQChar digits[10] = {0x96f6, 0x58f9, 0x8cb3, 0x53c3, 0x8086, 0x4f0d, 0x9678, 0x67d2, @@ -375,10 +375,10 @@ QString toSimpChineseFormal( int number ) { return toIdeographic(number, digits, digitMarkers); } -QString toSimpChineseInformal( int number ) { -// static const QChar groupMarkers[3] = {0x842c, 0x5104, 0x5146}; - static const QChar digitMarkers[3] = {0x842c, 0x5104, 0x5146}; - static const QChar digits[10] = {0x96f6, 0x58f9, +TQString toSimpChineseInformal( int number ) { +// static const TQChar groupMarkers[3] = {0x842c, 0x5104, 0x5146}; + static const TQChar digitMarkers[3] = {0x842c, 0x5104, 0x5146}; + static const TQChar digits[10] = {0x96f6, 0x58f9, 0x8cb3, 0x53c3, 0x8086, 0x4f0d, 0x9678, 0x67d2, @@ -386,10 +386,10 @@ QString toSimpChineseInformal( int number ) { return toIdeographic(number, digits, digitMarkers); } -QString toJapaneseFormal( int number ) { -// static const QChar groupMarkers[3] = {0x4e07, 0x5104, 0x5146}; - static const QChar digitMarkers[3] = {0x62fe, 0x4f70, 0x4edf}; - static const QChar digits[10] = {0x96f6, 0x58f9, +TQString toJapaneseFormal( int number ) { +// static const TQChar groupMarkers[3] = {0x4e07, 0x5104, 0x5146}; + static const TQChar digitMarkers[3] = {0x62fe, 0x4f70, 0x4edf}; + static const TQChar digits[10] = {0x96f6, 0x58f9, 0x8cb3, 0x53c3, 0x8086, 0x4f0d, 0x9678, 0x67d2, @@ -397,10 +397,10 @@ QString toJapaneseFormal( int number ) { return toIdeographic(number, digits, digitMarkers); } -QString toJapaneseInformal( int number ) { -// static const QChar groupMarkers[3] = {0x842c, 0x5104, 0x5146}; - static const QChar digitMarkers[3] = {0x842c, 0x5104, 0x5146}; - static const QChar digits[10] = {0x96f6, 0x58f9, +TQString toJapaneseInformal( int number ) { +// static const TQChar groupMarkers[3] = {0x842c, 0x5104, 0x5146}; + static const TQChar digitMarkers[3] = {0x842c, 0x5104, 0x5146}; + static const TQChar digits[10] = {0x96f6, 0x58f9, 0x8d30, 0x53c1, 0x8086, 0x4f0d, 0x9646, 0x67d2, diff --git a/khtml/rendering/enumerate.h b/khtml/rendering/enumerate.h index 518a8e9d6..583a6171c 100644 --- a/khtml/rendering/enumerate.h +++ b/khtml/rendering/enumerate.h @@ -31,35 +31,35 @@ namespace khtml { namespace Enumerate { // Numeric - QString toArabicIndic( int number ); - QString toLao( int number ); - QString toPersianUrdu( int number ); - QString toThai( int number ); - QString toTibetan( int number ); + TQString toArabicIndic( int number ); + TQString toLao( int number ); + TQString toPersianUrdu( int number ); + TQString toThai( int number ); + TQString toTibetan( int number ); // Alphabetic - QString toLowerLatin( int number ); - QString toUpperLatin( int number ); - QString toLowerGreek( int number ); - QString toUpperGreek( int number ); - QString toHiragana( int number ); - QString toHiraganaIroha( int number ); - QString toKatakana( int number ); - QString toKatakanaIroha( int number ); + TQString toLowerLatin( int number ); + TQString toUpperLatin( int number ); + TQString toLowerGreek( int number ); + TQString toUpperGreek( int number ); + TQString toHiragana( int number ); + TQString toHiraganaIroha( int number ); + TQString toKatakana( int number ); + TQString toKatakanaIroha( int number ); // Algorithmic - QString toRoman( int number, bool upper ); - QString toHebrew( int number ); - QString toGeorgian( int number ); - QString toArmenian( int number ); + TQString toRoman( int number, bool upper ); + TQString toHebrew( int number ); + TQString toGeorgian( int number ); + TQString toArmenian( int number ); // Ideographic - QString toJapaneseFormal ( int number ); - QString toJapaneseInformal ( int number ); - QString toSimpChineseFormal ( int number ); - QString toSimpChineseInformal ( int number ); - QString toTradChineseFormal ( int number ); - QString toTradChineseInformal ( int number ); + TQString toJapaneseFormal ( int number ); + TQString toJapaneseInformal ( int number ); + TQString toSimpChineseFormal ( int number ); + TQString toSimpChineseInformal ( int number ); + TQString toTradChineseFormal ( int number ); + TQString toTradChineseInformal ( int number ); }} // namespaces diff --git a/khtml/rendering/font.cpp b/khtml/rendering/font.cpp index cdd580596..a33f0e082 100644 --- a/khtml/rendering/font.cpp +++ b/khtml/rendering/font.cpp @@ -35,9 +35,9 @@ #include #include -#include -#include -#include +#include +#include +#include using namespace khtml; @@ -51,12 +51,12 @@ using namespace khtml; * @return the width in pixels. May be 0 if @p wordStart and @p wordEnd were * equal. */ -inline int closeWordAndGetWidth(const QFontMetrics &fm, const QChar *str, int pos, +inline int closeWordAndGetWidth(const TQFontMetrics &fm, const TQChar *str, int pos, int wordStart, int wordEnd) { if (wordEnd <= wordStart) return 0; - QConstString s(str + pos + wordStart, wordEnd - wordStart); + TQConstString s(str + pos + wordStart, wordEnd - wordStart); return fm.width(s.string()); } @@ -75,41 +75,41 @@ inline int closeWordAndGetWidth(const QFontMetrics &fm, const QChar *str, int po * will be set to wordEnd after function * @param wordEnd relative index pointing one position after the word ended */ -inline void closeAndDrawWord(QPainter *p, QPainter::TextDirection d, - int &x, int y, const short widths[], const QChar *str, int pos, +inline void closeAndDrawWord(TQPainter *p, TQPainter::TextDirection d, + int &x, int y, const short widths[], const TQChar *str, int pos, int &wordStart, int wordEnd) { if (wordEnd <= wordStart) return; int width = widths[wordStart]; - if (d == QPainter::RTL) + if (d == TQPainter::RTL) x -= width; - QConstString s(str + pos + wordStart, wordEnd - wordStart); + TQConstString s(str + pos + wordStart, wordEnd - wordStart); p->drawText(x, y, s.string(), -1, d); - if (d != QPainter::RTL) + if (d != TQPainter::RTL) x += width; wordStart = wordEnd; } -void Font::drawText( QPainter *p, int x, int y, QChar *str, int slen, int pos, int len, - int toAdd, QPainter::TextDirection d, int from, int to, QColor bg, int uy, int h, int deco ) const +void Font::drawText( TQPainter *p, int x, int y, TQChar *str, int slen, int pos, int len, + int toAdd, TQPainter::TextDirection d, int from, int to, TQColor bg, int uy, int h, int deco ) const { if (!str) return; - QConstString cstr = QConstString(str, slen); - QString qstr = cstr.string(); + TQConstString cstr = TQConstString(str, slen); + TQString qstr = cstr.string(); // ### fixme for RTL if ( !scFont && !letterSpacing && !wordSpacing && !toAdd && from==-1 ) { // simply draw it - // Due to some unfounded cause QPainter::drawText traverses the + // Due to some unfounded cause TQPainter::drawText traverses the // *whole* string when painting, not only the specified // [pos, pos + len) segment. This makes painting *extremely* slow for // long render texts (in the order of several megabytes). // Hence, only hand over the piece of text of the actual inline text box - QConstString cstr = QConstString(str + pos, len); + TQConstString cstr = TQConstString(str + pos, len); p->drawText( x, y, cstr.string(), 0, len, d ); } else { if (from < 0) from = 0; @@ -118,20 +118,20 @@ void Font::drawText( QPainter *p, int x, int y, QChar *str, int slen, int pos, i int numSpaces = 0; if ( toAdd ) { for( int i = 0; i < len; ++i ) - if ( str[i+pos].category() == QChar::Separator_Space ) + if ( str[i+pos].category() == TQChar::Separator_Space ) ++numSpaces; } const int totWidth = width( str, slen, pos, len ); - if ( d == QPainter::RTL ) { + if ( d == TQPainter::RTL ) { x += totWidth + toAdd; } - QString upper = qstr; - QFontMetrics sc_fm = fm; + TQString upper = qstr; + TQFontMetrics sc_fm = fm; if ( scFont ) { // draw in small caps upper = qstr.upper(); - sc_fm = QFontMetrics( *scFont ); + sc_fm = TQFontMetrics( *scFont ); } // ### sc could be optimized by only painting uppercase letters extra, @@ -150,11 +150,11 @@ void Font::drawText( QPainter *p, int x, int y, QChar *str, int slen, int pos, i if (mode == Whole) { // most likely variant is treated extra if (to < 0) to = len; - const QConstString cstr(str + pos, len); - const QConstString segStr(str + pos + from, to - from); + const TQConstString cstr(str + pos, len); + const TQConstString segStr(str + pos + from, to - from); const int preSegmentWidth = fm.width(cstr.string(), from); const int segmentWidth = fm.width(segStr.string()); - const int eff_x = d == QPainter::RTL ? x - preSegmentWidth - segmentWidth + const int eff_x = d == TQPainter::RTL ? x - preSegmentWidth - segmentWidth : x + preSegmentWidth; // draw whole string segment, with optional background @@ -194,9 +194,9 @@ void Font::drawText( QPainter *p, int x, int y, QChar *str, int slen, int pos, i onSegment = true; } - const QChar ch = str[pos+i]; - bool lowercase = (ch.category() == QChar::Letter_Lowercase); - bool is_space = (ch.category() == QChar::Separator_Space); + const TQChar ch = str[pos+i]; + bool lowercase = (ch.category() == TQChar::Letter_Lowercase); + bool is_space = (ch.category() == TQChar::Separator_Space); int chw = 0; if ( letterSpacing ) chw += letterSpacing; @@ -235,10 +235,10 @@ void Font::drawText( QPainter *p, int x, int y, QChar *str, int slen, int pos, i widthList[lastWordBegin] = (short)width; } - if (d == QPainter::RTL) x -= preSegmentWidth; + if (d == TQPainter::RTL) x -= preSegmentWidth; else x += preSegmentWidth; - const int startx = d == QPainter::RTL ? x-segmentWidth : x; + const int startx = d == TQPainter::RTL ? x-segmentWidth : x; // optionally draw background if ( bg.isValid() ) @@ -247,9 +247,9 @@ void Font::drawText( QPainter *p, int x, int y, QChar *str, int slen, int pos, i // second pass: do the actual drawing lastWordBegin = from; for( int i = from; i < to; ++i ) { - const QChar ch = str[pos+i]; - bool lowercase = (ch.category() == QChar::Letter_Lowercase); - bool is_space = ch.category() == QChar::Separator_Space; + const TQChar ch = str[pos+i]; + bool lowercase = (ch.category() == TQChar::Letter_Lowercase); + bool is_space = ch.category() == TQChar::Separator_Space; if ( is_space ) { if (mode == WordWise) { closeAndDrawWord(p, d, x, y, widthList, str, pos, lastWordBegin, i); @@ -258,14 +258,14 @@ void Font::drawText( QPainter *p, int x, int y, QChar *str, int slen, int pos, i } if (is_space || mode == CharacterWise) { const int chw = widthList[i]; - if (d == QPainter::RTL) + if (d == TQPainter::RTL) x -= chw; if ( scFont ) p->setFont( lowercase ? *scFont : f ); p->drawText( x, y, (lowercase ? upper : qstr), pos+i, 1, d ); - if (d != QPainter::RTL) + if (d != TQPainter::RTL) x += chw; } @@ -285,18 +285,18 @@ void Font::drawText( QPainter *p, int x, int y, QChar *str, int slen, int pos, i } -int Font::width( QChar *chs, int, int pos, int len, int start, int end, int toAdd ) const +int Font::width( TQChar *chs, int, int pos, int len, int start, int end, int toAdd ) const { - const QConstString cstr(chs+pos, len); + const TQConstString cstr(chs+pos, len); int w = 0; - const QString qstr = cstr.string(); + const TQString qstr = cstr.string(); if ( scFont ) { - const QString upper = qstr.upper(); - const QChar *uc = qstr.unicode(); - const QFontMetrics sc_fm( *scFont ); + const TQString upper = qstr.upper(); + const TQChar *uc = qstr.unicode(); + const TQFontMetrics sc_fm( *scFont ); for ( int i = 0; i < len; ++i ) { - if ( (uc+i)->category() == QChar::Letter_Lowercase ) + if ( (uc+i)->category() == TQChar::Letter_Lowercase ) w += sc_fm.charWidth( upper, i ); else w += fm.charWidth( qstr, i ); @@ -312,7 +312,7 @@ int Font::width( QChar *chs, int, int pos, int len, int start, int end, int toAd if ( wordSpacing ) // add amount for( int i = 0; i < len; ++i ) { - if( chs[i+pos].category() == QChar::Separator_Space ) + if( chs[i+pos].category() == TQChar::Separator_Space ) w += wordSpacing; } @@ -320,12 +320,12 @@ int Font::width( QChar *chs, int, int pos, int len, int start, int end, int toAd // first gather count of spaces int numSpaces = 0; for( int i = start; i != end; ++i ) - if ( chs[i].category() == QChar::Separator_Space ) + if ( chs[i].category() == TQChar::Separator_Space ) ++numSpaces; // distribute pixels evenly among spaces, but count only those within // [pos, pos+len) for ( int i = start; numSpaces && i != pos + len; i++ ) - if ( chs[i].category() == QChar::Separator_Space ) { + if ( chs[i].category() == TQChar::Separator_Space ) { const int a = toAdd/numSpaces; if ( i >= pos ) w += a; toAdd -= a; @@ -336,21 +336,21 @@ int Font::width( QChar *chs, int, int pos, int len, int start, int end, int toAd return w; } -int Font::width( QChar *chs, int slen, int pos ) const +int Font::width( TQChar *chs, int slen, int pos ) const { int w; - if ( scFont && chs[pos].category() == QChar::Letter_Lowercase ) { - QString str( chs, slen ); + if ( scFont && chs[pos].category() == TQChar::Letter_Lowercase ) { + TQString str( chs, slen ); str[pos] = chs[pos].upper(); - w = QFontMetrics( *scFont ).charWidth( str, pos ); + w = TQFontMetrics( *scFont ).charWidth( str, pos ); } else { - const QConstString cstr( chs, slen ); + const TQConstString cstr( chs, slen ); w = fm.charWidth( cstr.string(), pos ); } if ( letterSpacing ) w += letterSpacing; - if ( wordSpacing && (chs+pos)->category() == QChar::Separator_Space ) + if ( wordSpacing && (chs+pos)->category() == TQChar::Separator_Space ) w += wordSpacing; return w; } @@ -358,11 +358,11 @@ int Font::width( QChar *chs, int slen, int pos ) const /** Querying QFontDB whether something is scalable is expensive, so we cache. */ struct Font::ScalKey { - QString family; + TQString family; int weight; int italic; - ScalKey(const QFont& font) : + ScalKey(const TQFont& font) : family(font.family()), weight(font.weight()), italic(font.italic()) {} @@ -389,13 +389,13 @@ struct Font::ScalKey } }; -QMap* Font::scalCache; -QMap >* Font::scalSizesCache; +TQMap* Font::scalCache; +TQMap >* Font::scalSizesCache; -bool Font::isFontScalable(QFontDatabase& db, const QFont& font) +bool Font::isFontScalable(TQFontDatabase& db, const TQFont& font) { if (!scalCache) - scalCache = new QMap; + scalCache = new TQMap; ScalKey key(font); @@ -406,7 +406,7 @@ bool Font::isFontScalable(QFontDatabase& db, const QFont& font) if (s == No) { /* Cache size info */ if (!scalSizesCache) - scalSizesCache = new QMap >; + scalSizesCache = new TQMap >; (*scalSizesCache)[key] = db.smoothSizes(font.family(), db.styleString(font)); } } @@ -415,13 +415,13 @@ bool Font::isFontScalable(QFontDatabase& db, const QFont& font) } -void Font::update( QPaintDeviceMetrics* devMetrics ) const +void Font::update( TQPaintDeviceMetrics* devMetrics ) const { f.setFamily( fontDef.family.isEmpty() ? KHTMLFactory::defaultHTMLSettings()->stdFontName() : fontDef.family ); f.setItalic( fontDef.italic ); f.setWeight( fontDef.weight ); - QFontDatabase db; + TQFontDatabase db; int size = fontDef.size; const int lDpiY = kMax(devMetrics->logicalDpiY(), 96); @@ -430,7 +430,7 @@ void Font::update( QPaintDeviceMetrics* devMetrics ) const // all other font properties should be set before this one!!!! if( !isFontScalable(db, f) ) { - const QValueList& pointSizes = (*scalSizesCache)[ScalKey(f)]; + const TQValueList& pointSizes = (*scalSizesCache)[ScalKey(f)]; // lets see if we find a nice looking font, which is not too far away // from the requested one. // kdDebug(6080) << "khtml::setFontSize family = " << f.family() << " size requested=" << size << endl; @@ -439,8 +439,8 @@ void Font::update( QPaintDeviceMetrics* devMetrics ) const float diff = 1; // ### 100% deviation float bestSize = 0; - QValueList::ConstIterator it = pointSizes.begin(); - const QValueList::ConstIterator itEnd = pointSizes.end(); + TQValueList::ConstIterator it = pointSizes.begin(); + const TQValueList::ConstIterator itEnd = pointSizes.end(); for( ; it != itEnd; ++it ) { @@ -459,7 +459,7 @@ void Font::update( QPaintDeviceMetrics* devMetrics ) const } // make sure we don't bust up X11 - // Also, Qt does not support sizing a QFont to zero. + // Also, Qt does not support sizing a TQFont to zero. size = kMax(1, kMin(255, size)); // qDebug("setting font to %s, italic=%d, weight=%d, size=%d", fontDef.family.latin1(), fontDef.italic, @@ -468,24 +468,24 @@ void Font::update( QPaintDeviceMetrics* devMetrics ) const f.setPixelSize( size ); - fm = QFontMetrics( f ); + fm = TQFontMetrics( f ); // small caps delete scFont; scFont = 0; if ( fontDef.smallCaps ) { - scFont = new QFont( f ); + scFont = new TQFont( f ); scFont->setPixelSize( kMax(1, f.pixelSize()*7/10) ); } } -void Font::drawDecoration(QPainter *pt, int _tx, int _ty, int baseline, int width, int height, int deco) const +void Font::drawDecoration(TQPainter *pt, int _tx, int _ty, int baseline, int width, int height, int deco) const { Q_UNUSED(height); // thick lines on small fonts look ugly const int thickness = fm.height() > 20 ? fm.lineWidth() : 1; - const QBrush brush = pt->pen().color(); + const TQBrush brush = pt->pen().color(); if (deco & UNDERLINE) { int underlineOffset = ( fm.height() + baseline ) / 2; if (underlineOffset <= baseline) underlineOffset = baseline+1; diff --git a/khtml/rendering/font.h b/khtml/rendering/font.h index c35ab53aa..248c07d15 100644 --- a/khtml/rendering/font.h +++ b/khtml/rendering/font.h @@ -25,10 +25,10 @@ #ifndef KHTMLFONT_H #define KHTMLFONT_H -#include -#include -#include -#include +#include +#include +#include +#include class QFontDatabase; class QPaintDeviceMetrics; @@ -51,7 +51,7 @@ public: weight == other.weight ); } - QString family; + TQString family; short int size; bool italic : 1; bool smallCaps : 1; @@ -70,7 +70,7 @@ public: : fontDef( fd ), f(), fm( f ), scFont( 0 ), letterSpacing( 0 ), wordSpacing( 0 ) {} Font(const Font& o) - : fontDef(o.fontDef), f(o.f), fm(o.fm), scFont(o.scFont), letterSpacing(o.letterSpacing), wordSpacing(o.wordSpacing) { if (o.scFont) scFont = new QFont(*o.scFont); } + : fontDef(o.fontDef), f(o.f), fm(o.fm), scFont(o.scFont), letterSpacing(o.letterSpacing), wordSpacing(o.wordSpacing) { if (o.scFont) scFont = new TQFont(*o.scFont); } ~Font() { delete scFont; } bool operator == ( const Font &other ) const { @@ -81,7 +81,7 @@ public: const FontDef& getFontDef() const { return fontDef; } - void update( QPaintDeviceMetrics *devMetrics ) const; + void update( TQPaintDeviceMetrics *devMetrics ) const; /** * Draws a piece from the given piece of text. @@ -107,8 +107,8 @@ public: * decoration painting * @param deco combined text decoration (see Decoration) */ - void drawText( QPainter *p, int x, int y, QChar *str, int slen, int pos, int len, int width, - QPainter::TextDirection d, int from=-1, int to=-1, QColor bg=QColor(), + void drawText( TQPainter *p, int x, int y, TQChar *str, int slen, int pos, int len, int width, + TQPainter::TextDirection d, int from=-1, int to=-1, TQColor bg=TQColor(), int uy=-1, int h=-1, int deco=0 ) const; /** returns the width of the given string chunk in pixels. @@ -126,7 +126,7 @@ public: * str. Note that toAdd applies to all spaces within str, but only those * within [pos, pos+len) are counted towards the width. */ - int width( QChar *str, int slen, int pos, int len, int start = 0, int end = 0, int toAdd = 0 ) const; + int width( TQChar *str, int slen, int pos, int len, int start = 0, int end = 0, int toAdd = 0 ) const; /** return the width of the given char in pixels. * * The method also considers various styles like text-align and font-variant @@ -134,7 +134,7 @@ public: * @param slen total length of string * @param pos zero-based position of char in string */ - int width( QChar *str, int slen, int pos) const; + int width( TQChar *str, int slen, int pos) const; /** Text decoration constants. * @@ -154,7 +154,7 @@ public: * @param deco decoration to be drawn (see Decoration). The enumeration * constants may be combined. */ - void drawDecoration(QPainter *p, int x, int y, int baseline, int width, int height, int deco) const; + void drawDecoration(TQPainter *p, int x, int y, int baseline, int width, int height, int deco) const; /** returns letter spacing */ @@ -165,9 +165,9 @@ public: private: mutable FontDef fontDef; - mutable QFont f; - mutable QFontMetrics fm; - mutable QFont *scFont; + mutable TQFont f; + mutable TQFontMetrics fm; + mutable TQFont *scFont; short letterSpacing; short wordSpacing; @@ -178,9 +178,9 @@ private: Yes }; - static QMap* scalCache; - static QMap >* scalSizesCache; - static bool isFontScalable(QFontDatabase& db, const QFont& font); + static TQMap* scalCache; + static TQMap >* scalSizesCache; + static bool isFontScalable(TQFontDatabase& db, const TQFont& font); }; } // namespace diff --git a/khtml/rendering/render_applet.cpp b/khtml/rendering/render_applet.cpp index f6ce1ebab..fce22f7c8 100644 --- a/khtml/rendering/render_applet.cpp +++ b/khtml/rendering/render_applet.cpp @@ -30,7 +30,7 @@ #include "khtmlview.h" #include "khtml_part.h" -#include +#include #ifndef Q_WS_QWS // We don't have Java in Qt Embedded @@ -41,7 +41,7 @@ using namespace khtml; using namespace DOM; -RenderApplet::RenderApplet(HTMLElementImpl *applet, const QMap &args ) +RenderApplet::RenderApplet(HTMLElementImpl *applet, const TQMap &args ) : RenderWidget(applet) { // init RenderObject attributes @@ -55,7 +55,7 @@ RenderApplet::RenderApplet(HTMLElementImpl *applet, const QMap } if ( context ) { - //kdDebug(6100) << "RenderApplet::RenderApplet, setting QWidget" << endl; + //kdDebug(6100) << "RenderApplet::RenderApplet, setting TQWidget" << endl; setQWidget( new KJavaAppletWidget(context, _view->viewport()) ); processArguments(args); } @@ -117,28 +117,28 @@ void RenderApplet::layout() setNeedsLayout(false); } -void RenderApplet::processArguments(const QMap &args) +void RenderApplet::processArguments(const TQMap &args) { KJavaAppletWidget *w = static_cast(m_widget); KJavaApplet* applet = w ? w->applet() : 0; if ( applet ) { - applet->setBaseURL( args[QString::fromLatin1("baseURL") ] ); - applet->setAppletClass( args[QString::fromLatin1("code") ] ); + applet->setBaseURL( args[TQString::fromLatin1("baseURL") ] ); + applet->setAppletClass( args[TQString::fromLatin1("code") ] ); - QString str = args[QString::fromLatin1("codeBase") ]; + TQString str = args[TQString::fromLatin1("codeBase") ]; if( !str.isEmpty() ) applet->setCodeBase( str ); - str = args[QString::fromLatin1("name") ]; + str = args[TQString::fromLatin1("name") ]; if( !str.isNull() ) applet->setAppletName( str ); else - applet->setAppletName( args[QString::fromLatin1("code") ] ); + applet->setAppletName( args[TQString::fromLatin1("code") ] ); - str = args[QString::fromLatin1("archive") ]; + str = args[TQString::fromLatin1("archive") ]; if( !str.isEmpty() ) - applet->setArchives( args[QString::fromLatin1("archive") ] ); + applet->setArchives( args[TQString::fromLatin1("archive") ] ); } } diff --git a/khtml/rendering/render_applet.h b/khtml/rendering/render_applet.h index 54af6f280..184697a7c 100644 --- a/khtml/rendering/render_applet.h +++ b/khtml/rendering/render_applet.h @@ -25,8 +25,8 @@ #include "rendering/render_replaced.h" #include "html/html_objectimpl.h" -#include -#include +#include +#include class KHTMLView; @@ -39,7 +39,7 @@ namespace khtml { class RenderApplet : public RenderWidget { public: - RenderApplet(DOM::HTMLElementImpl* node, const QMap &args); + RenderApplet(DOM::HTMLElementImpl* node, const TQMap &args); virtual ~RenderApplet(); virtual const char *renderName() const { return "RenderApplet"; } @@ -53,7 +53,7 @@ public: { return static_cast(RenderObject::element()); } private: - void processArguments( const QMap &args ); + void processArguments( const TQMap &args ); }; } diff --git a/khtml/rendering/render_block.cpp b/khtml/rendering/render_block.cpp index ba9645a62..d036b9d09 100644 --- a/khtml/rendering/render_block.cpp +++ b/khtml/rendering/render_block.cpp @@ -494,7 +494,7 @@ void RenderBlock::makePageBreakAvoidBlocks() // recurse into positioned block children as well. if (m_positionedObjects) { - QPtrListIterator it(*m_positionedObjects); + TQPtrListIterator it(*m_positionedObjects); for ( ; it.current(); ++it ) { if (it.current()->isRenderBlock() && !it.current()->childrenInline()) { static_cast(it.current())->makePageBreakAvoidBlocks(); @@ -504,7 +504,7 @@ void RenderBlock::makePageBreakAvoidBlocks() // recurse into floating block children. if (m_floatingObjects) { - QPtrListIterator it(*m_floatingObjects); + TQPtrListIterator it(*m_floatingObjects); for ( ; it.current(); ++it ) { if (it.current()->node->isRenderBlock() && !it.current()->node->childrenInline()) { static_cast(it.current()->node)->makePageBreakAvoidBlocks(); @@ -618,7 +618,7 @@ void RenderBlock::layoutBlock(bool relayoutChildren) return; } // kdDebug( 6040 ) << renderName() << " " << this << "::layoutBlock() start" << endl; - // QTime t; + // TQTime t; // t.start(); KHTMLAssert( needsLayout() ); KHTMLAssert( minMaxKnown() ); @@ -1577,7 +1577,7 @@ void RenderBlock::layoutPositionedObjects(bool relayoutChildren) if (m_positionedObjects) { //kdDebug( 6040 ) << renderName() << " " << this << "::layoutPositionedObjects() start" << endl; RenderObject* r; - QPtrListIterator it(*m_positionedObjects); + TQPtrListIterator it(*m_positionedObjects); for ( ; (r = it.current()); ++it ) { //kdDebug(6040) << " have a positioned object" << endl; if (r->markedForRepaint()) { @@ -1678,7 +1678,7 @@ void RenderBlock::paintFloats(PaintInfo& pI, int _tx, int _ty, bool paintSelecti return; FloatingObject* r; - QPtrListIterator it(*m_floatingObjects); + TQPtrListIterator it(*m_floatingObjects); for ( ; (r = it.current()); ++it) { // Only paint the object if our noPaint flag isn't set. if (r->node->isFloating() && !r->noPaint && !r->node->layer()) { @@ -1719,12 +1719,12 @@ void RenderBlock::insertPositionedObject(RenderObject *o) { // Create the list of special objects if we don't aleady have one if (!m_positionedObjects) { - m_positionedObjects = new QPtrList; + m_positionedObjects = new TQPtrList; m_positionedObjects->setAutoDelete(false); } else { // Don't insert the object again if it's already in the list - QPtrListIterator it(*m_positionedObjects); + TQPtrListIterator it(*m_positionedObjects); RenderObject* f; while ( (f = it.current()) ) { if (f == o) return; @@ -1740,7 +1740,7 @@ void RenderBlock::insertPositionedObject(RenderObject *o) void RenderBlock::removePositionedObject(RenderObject *o) { if (m_positionedObjects) { - QPtrListIterator it(*m_positionedObjects); + TQPtrListIterator it(*m_positionedObjects); while (it.current()) { if (it.current() == o) m_positionedObjects->removeRef(it.current()); @@ -1757,12 +1757,12 @@ void RenderBlock::insertFloatingObject(RenderObject *o) { // Create the list of special objects if we don't aleady have one if (!m_floatingObjects) { - m_floatingObjects = new QPtrList; + m_floatingObjects = new TQPtrList; m_floatingObjects->setAutoDelete(true); } else { // Don't insert the object again if it's already in the list - QPtrListIterator it(*m_floatingObjects); + TQPtrListIterator it(*m_floatingObjects); FloatingObject* f; while ( (f = it.current()) ) { if (f->node == o) return; @@ -1801,7 +1801,7 @@ void RenderBlock::insertFloatingObject(RenderObject *o) void RenderBlock::removeFloatingObject(RenderObject *o) { if (m_floatingObjects) { - QPtrListIterator it(*m_floatingObjects); + TQPtrListIterator it(*m_floatingObjects); while (it.current()) { if (it.current()->node == o) m_floatingObjects->removeRef(it.current()); @@ -1986,7 +1986,7 @@ RenderBlock::leftRelOffset(int y, int fixedOffset, bool applyTextIndent, int *he if (m_floatingObjects) { if ( heightRemaining ) *heightRemaining = 1; FloatingObject* r; - QPtrListIterator it(*m_floatingObjects); + TQPtrListIterator it(*m_floatingObjects); for ( ; (r = it.current()); ++it ) { //kdDebug( 6040 ) <<(void *)this << " left: sy, ey, x, w " << r->startY << "," << r->endY << "," << r->left << "," << r->width << " " << endl; @@ -2029,7 +2029,7 @@ RenderBlock::rightRelOffset(int y, int fixedOffset, bool applyTextIndent, int *h if (m_floatingObjects) { if (heightRemaining) *heightRemaining = 1; FloatingObject* r; - QPtrListIterator it(*m_floatingObjects); + TQPtrListIterator it(*m_floatingObjects); for ( ; (r = it.current()); ++it ) { //kdDebug( 6040 ) << "right: sy, ey, x, w " << r->startY << "," << r->endY << "," << r->left << "," << r->width << " " << endl; @@ -2075,7 +2075,7 @@ RenderBlock::nearestFloatBottom(int height) const if (!m_floatingObjects) return 0; int bottom = 0; FloatingObject* r; - QPtrListIterator it(*m_floatingObjects); + TQPtrListIterator it(*m_floatingObjects); for ( ; (r = it.current()); ++it ) if (r->endY>height && (r->endYendY; @@ -2087,7 +2087,7 @@ int RenderBlock::floatBottom() const if (!m_floatingObjects) return 0; int bottom=0; FloatingObject* r; - QPtrListIterator it(*m_floatingObjects); + TQPtrListIterator it(*m_floatingObjects); for ( ; (r = it.current()); ++it ) if (r->endY>bottom) bottom=r->endY; @@ -2104,7 +2104,7 @@ int RenderBlock::lowestPosition(bool includeOverflowInterior, bool includeSelf) if (m_floatingObjects) { FloatingObject* r; - QPtrListIterator it(*m_floatingObjects); + TQPtrListIterator it(*m_floatingObjects); for ( ; (r = it.current()); ++it ) { if (!r->noPaint) { int lp = r->startY + r->node->marginTop() + r->node->lowestPosition(false); @@ -2131,7 +2131,7 @@ int RenderBlock::lowestAbsolutePosition() const // part of the lowest position. int bottom = 0; RenderObject* r; - QPtrListIterator it(*m_positionedObjects); + TQPtrListIterator it(*m_positionedObjects); for ( ; (r = it.current()); ++it ) { if (r->style()->position() == FIXED) continue; @@ -2151,7 +2151,7 @@ int RenderBlock::rightmostPosition(bool includeOverflowInterior, bool includeSel if (m_floatingObjects) { FloatingObject* r; - QPtrListIterator it(*m_floatingObjects); + TQPtrListIterator it(*m_floatingObjects); for ( ; (r = it.current()); ++it ) { if (!r->noPaint) { int rp = r->left + r->node->marginLeft() + r->node->rightmostPosition(false); @@ -2177,7 +2177,7 @@ int RenderBlock::rightmostAbsolutePosition() const return 0; int right = 0; RenderObject* r; - QPtrListIterator it(*m_positionedObjects); + TQPtrListIterator it(*m_positionedObjects); for ( ; (r = it.current()); ++it ) { if (r->style()->position() == FIXED) continue; @@ -2198,7 +2198,7 @@ int RenderBlock::leftmostPosition(bool includeOverflowInterior, bool includeSelf if (m_floatingObjects) { FloatingObject* r; - QPtrListIterator it(*m_floatingObjects); + TQPtrListIterator it(*m_floatingObjects); for ( ; (r = it.current()); ++it ) { if (!r->noPaint) { int lp = r->left + r->node->marginLeft() + r->node->leftmostPosition(false); @@ -2222,7 +2222,7 @@ int RenderBlock::leftmostAbsolutePosition() const return 0; int left = 0; RenderObject* r; - QPtrListIterator it(*m_positionedObjects); + TQPtrListIterator it(*m_positionedObjects); for ( ; (r = it.current()); ++it ) { if (r->style()->position() == FIXED) continue; @@ -2243,7 +2243,7 @@ int RenderBlock::highestPosition(bool includeOverflowInterior, bool includeSelf) if (m_floatingObjects) { FloatingObject* r; - QPtrListIterator it(*m_floatingObjects); + TQPtrListIterator it(*m_floatingObjects); for ( ; (r = it.current()); ++it ) { if (!r->noPaint) { int hp = r->startY + r->node->marginTop() + r->node->highestPosition(false); @@ -2266,7 +2266,7 @@ int RenderBlock::highestAbsolutePosition() const return 0; int top = 0; RenderObject* r; - QPtrListIterator it(*m_positionedObjects); + TQPtrListIterator it(*m_positionedObjects); for ( ; (r = it.current()); ++it ) { if (r->style()->position() == FIXED) continue; @@ -2282,7 +2282,7 @@ RenderBlock::leftBottom() if (!m_floatingObjects) return 0; int bottom=0; FloatingObject* r; - QPtrListIterator it(*m_floatingObjects); + TQPtrListIterator it(*m_floatingObjects); for ( ; (r = it.current()); ++it ) if (r->endY>bottom && r->type == FloatingObject::FloatLeft) bottom=r->endY; @@ -2296,7 +2296,7 @@ RenderBlock::rightBottom() if (!m_floatingObjects) return 0; int bottom=0; FloatingObject* r; - QPtrListIterator it(*m_floatingObjects); + TQPtrListIterator it(*m_floatingObjects); for ( ; (r = it.current()); ++it ) if (r->endY>bottom && r->type == FloatingObject::FloatRight) bottom=r->endY; @@ -2373,7 +2373,7 @@ void RenderBlock::addOverHangingFloats( RenderBlock *flow, int xoff, int offset, return; } - QPtrListIterator it(*flow->m_floatingObjects); + TQPtrListIterator it(*flow->m_floatingObjects); FloatingObject *r; for ( ; (r = it.current()); ++it ) { @@ -2396,7 +2396,7 @@ void RenderBlock::addOverHangingFloats( RenderBlock *flow, int xoff, int offset, FloatingObject* f = 0; // don't insert it twice! if (m_floatingObjects) { - QPtrListIterator it(*m_floatingObjects); + TQPtrListIterator it(*m_floatingObjects); while ( (f = it.current()) ) { if (f->node == r->node) break; ++it; @@ -2426,7 +2426,7 @@ void RenderBlock::addOverHangingFloats( RenderBlock *flow, int xoff, int offset, floatingObj->width = r->width; floatingObj->node = r->node; if (!m_floatingObjects) { - m_floatingObjects = new QPtrList; + m_floatingObjects = new TQPtrList; m_floatingObjects->setAutoDelete(true); } m_floatingObjects->append(floatingObj); @@ -2441,7 +2441,7 @@ void RenderBlock::addOverHangingFloats( RenderBlock *flow, int xoff, int offset, bool RenderBlock::containsFloat(RenderObject* o) const { if (m_floatingObjects) { - QPtrListIterator it(*m_floatingObjects); + TQPtrListIterator it(*m_floatingObjects); while (it.current()) { if (it.current()->node == o) return true; @@ -2514,7 +2514,7 @@ bool RenderBlock::isPointInScrollbar(int _x, int _y, int _tx, int _ty) return false; if (m_layer->verticalScrollbarWidth()) { - QRect vertRect(_tx + width() - borderRight() - m_layer->verticalScrollbarWidth(), + TQRect vertRect(_tx + width() - borderRight() - m_layer->verticalScrollbarWidth(), _ty + borderTop() - borderTopExtra(), m_layer->verticalScrollbarWidth(), height() + borderTopExtra() + borderBottomExtra()-borderTop()-borderBottom()); @@ -2527,7 +2527,7 @@ bool RenderBlock::isPointInScrollbar(int _x, int _y, int _tx, int _ty) } if (m_layer->horizontalScrollbarHeight()) { - QRect horizRect(_tx + borderLeft(), + TQRect horizRect(_tx + borderLeft(), _ty + height() + borderTop() + borderBottomExtra() - borderBottom() - m_layer->horizontalScrollbarHeight(), width()-borderLeft()-borderRight(), m_layer->horizontalScrollbarHeight()); @@ -2554,7 +2554,7 @@ bool RenderBlock::nodeAtPoint(NodeInfo& info, int _x, int _y, int _tx, int _ty, if (hasOverflowClip() && m_layer) m_layer->subtractScrollOffset(stx, sty); FloatingObject* o; - QPtrListIterator it(*m_floatingObjects); + TQPtrListIterator it(*m_floatingObjects); for (it.toLast(); (o = it.current()); --it) if (!o->noPaint && !o->node->layer()) inBox |= o->node->nodeAtPoint(info, _x, _y, @@ -2727,7 +2727,7 @@ static void stripTrailingSpace(bool preserveWS, // Collapse away the trailing space at the end of a block. RenderText* t = static_cast(trailingSpaceChild); const Font *f = t->htmlFont( false ); - QChar space[1]; space[0] = ' '; + TQChar space[1]; space[0] = ' '; int spaceWidth = f->width(space, 1, 0); inlineMax -= spaceWidth; if (inlineMin > inlineMax) @@ -3172,11 +3172,11 @@ void RenderBlock::printTree(int indent) const if (m_floatingObjects) { - QPtrListIterator it(*m_floatingObjects); + TQPtrListIterator it(*m_floatingObjects); FloatingObject *r; for ( ; (r = it.current()); ++it ) { - QString s; + TQString s; s.fill(' ', indent); kdDebug() << s << renderName() << ": " << (r->type == FloatingObject::FloatLeft ? "FloatLeft" : "FloatRight" ) << @@ -3186,7 +3186,7 @@ void RenderBlock::printTree(int indent) const } } -void RenderBlock::dump(QTextStream &stream, const QString &ind) const +void RenderBlock::dump(TQTextStream &stream, const TQString &ind) const { RenderFlow::dump(stream,ind); @@ -3198,7 +3198,7 @@ void RenderBlock::dump(QTextStream &stream, const QString &ind) const if (m_floatingObjects && !m_floatingObjects->isEmpty()) { stream << " special("; - QPtrListIterator it(*m_floatingObjects); + TQPtrListIterator it(*m_floatingObjects); FloatingObject *r; bool first = true; for ( ; (r = it.current()); ++it ) diff --git a/khtml/rendering/render_block.h b/khtml/rendering/render_block.h index 112d331ca..2b0e49398 100644 --- a/khtml/rendering/render_block.h +++ b/khtml/rendering/render_block.h @@ -26,7 +26,7 @@ #ifndef RENDER_BLOCK_H #define RENDER_BLOCK_H -#include +#include #include "render_flow.h" @@ -188,7 +188,7 @@ public: #ifdef ENABLE_DUMP virtual void printTree(int indent=0) const; - virtual void dump(QTextStream &stream, const QString &ind) const; + virtual void dump(TQTextStream &stream, const TQString &ind) const; #endif protected: @@ -355,8 +355,8 @@ protected: int m_overflowLeft; private: - QPtrList* m_floatingObjects; - QPtrList* m_positionedObjects; + TQPtrList* m_floatingObjects; + TQPtrList* m_positionedObjects; bool m_childrenInline : 1; bool m_firstLine : 1; // used in inline layouting diff --git a/khtml/rendering/render_body.cpp b/khtml/rendering/render_body.cpp index e9da3c71c..930ec358c 100644 --- a/khtml/rendering/render_body.cpp +++ b/khtml/rendering/render_body.cpp @@ -56,7 +56,7 @@ void RenderBody::setStyle(RenderStyle* style) void RenderBody::paintBoxDecorations(PaintInfo& paintInfo, int _tx, int _ty) { //kdDebug( 6040 ) << renderName() << "::paintDecorations()" << endl; - QColor bgColor; + TQColor bgColor; const BackgroundLayer *bgLayer = 0; if( parent()->style()->hasBackground() ) { diff --git a/khtml/rendering/render_box.cpp b/khtml/rendering/render_box.cpp index 56a3109d5..e6742d54e 100644 --- a/khtml/rendering/render_box.cpp +++ b/khtml/rendering/render_box.cpp @@ -28,7 +28,7 @@ //#define CLIP_DEBUG -#include +#include #include "misc/loader.h" #include "rendering/render_replaced.h" @@ -330,7 +330,7 @@ void RenderBox::paintRootBoxDecorations(PaintInfo& paintInfo, int _tx, int _ty) { //kdDebug( 6040 ) << renderName() << "::paintRootBoxDecorations()" << _tx << "/" << _ty << endl; const BackgroundLayer* bgLayer = style()->backgroundLayers(); - QColor bgColor = style()->backgroundColor(); + TQColor bgColor = style()->backgroundColor(); if (document()->isHTMLDocument() && !style()->hasBackground()) { // Locate the element using the DOM. This is easier than trying // to crawl around a render tree with potential :before/:after content and @@ -346,7 +346,7 @@ void RenderBox::paintRootBoxDecorations(PaintInfo& paintInfo, int _tx, int _ty) } if( !bgColor.isValid() && canvas()->view()) - bgColor = canvas()->view()->palette().active().color(QColorGroup::Base); + bgColor = canvas()->view()->palette().active().color(TQColorGroup::Base); int w = width(); int h = height(); @@ -408,14 +408,14 @@ void RenderBox::paintBoxDecorations(PaintInfo& paintInfo, int _tx, int _ty) } } -void RenderBox::paintBackgrounds(QPainter *p, const QColor& c, const BackgroundLayer* bgLayer, int clipy, int cliph, int _tx, int _ty, int w, int height) +void RenderBox::paintBackgrounds(TQPainter *p, const TQColor& c, const BackgroundLayer* bgLayer, int clipy, int cliph, int _tx, int _ty, int w, int height) { if (!bgLayer) return; paintBackgrounds(p, c, bgLayer->next(), clipy, cliph, _tx, _ty, w, height); paintBackground(p, c, bgLayer, clipy, cliph, _tx, _ty, w, height); } -void RenderBox::paintBackground(QPainter *p, const QColor& c, const BackgroundLayer* bgLayer, int clipy, int cliph, int _tx, int _ty, int w, int height) +void RenderBox::paintBackground(TQPainter *p, const TQColor& c, const BackgroundLayer* bgLayer, int clipy, int cliph, int _tx, int _ty, int w, int height) { paintBackgroundExtended(p, c, bgLayer, clipy, cliph, _tx, _ty, w, height, borderLeft(), borderRight(), paddingLeft(), paddingRight()); @@ -467,7 +467,7 @@ static void calculateBackgroundSize(const BackgroundLayer* bgLayer, int& scaledW } } -void RenderBox::paintBackgroundExtended(QPainter *p, const QColor &c, const BackgroundLayer* bgLayer, int clipy, int cliph, +void RenderBox::paintBackgroundExtended(TQPainter *p, const TQColor &c, const BackgroundLayer* bgLayer, int clipy, int cliph, int _tx, int _ty, int w, int h, int bleft, int bright, int pleft, int pright) { @@ -482,12 +482,12 @@ void RenderBox::paintBackgroundExtended(QPainter *p, const QColor &c, const Back int width = w - bleft - bright - (includePadding ? pleft + pright : 0); int height = h - borderTop() - borderBottom() - (includePadding ? paddingTop() + paddingBottom() : 0); p->save(); - p->setClipRect(QRect(x, y, width, height), QPainter::CoordPainter); + p->setClipRect(TQRect(x, y, width, height), TQPainter::CoordPainter); } CachedImage* bg = bgLayer->backgroundImage(); bool shouldPaintBackgroundImage = bg && bg->pixmap_size() == bg->valid_rect().size() && !bg->isTransparent() && !bg->isErrorImage(); - QColor bgColor = c; + TQColor bgColor = c; // Paint the color first underneath all images. if (!bgLayer->next() && bgColor.isValid() && qAlpha(bgColor.rgb()) > 0) @@ -583,7 +583,7 @@ void RenderBox::paintBackgroundExtended(QPainter *p, const QColor &c, const Back else { //fixed - QRect vr = viewRect(); + TQRect vr = viewRect(); int pw = vr.width(); int ph = vr.height(); scaledImageWidth = pw; @@ -613,9 +613,9 @@ void RenderBox::paintBackgroundExtended(QPainter *p, const QColor &c, const Back sy = scaledImageHeight - yPosition % scaledImageHeight; } - QRect fix(cx, cy, cw, ch); - QRect ele(_tx, _ty, w, h); - QRect b = fix.intersect(ele); + TQRect fix(cx, cy, cw, ch); + TQRect ele(_tx, _ty, w, h); + TQRect b = fix.intersect(ele); //kdDebug() <<" ele is " << ele << " b is " << b << " fix is " << fix << endl; sx+=b.x()-cx; @@ -642,14 +642,14 @@ void RenderBox::paintBackgroundExtended(QPainter *p, const QColor &c, const Back } -void RenderBox::outlineBox(QPainter *p, int _tx, int _ty, const char *color) +void RenderBox::outlineBox(TQPainter *p, int _tx, int _ty, const char *color) { - p->setPen(QPen(QColor(color), 1, Qt::DotLine)); + p->setPen(TQPen(TQColor(color), 1, Qt::DotLine)); p->setBrush( Qt::NoBrush ); p->drawRect(_tx, _ty, m_width, m_height); } -QRect RenderBox::getOverflowClipRect(int tx, int ty) +TQRect RenderBox::getOverflowClipRect(int tx, int ty) { // XXX When overflow-clip (CSS3) is implemented, we'll obtain the property // here. @@ -665,10 +665,10 @@ QRect RenderBox::getOverflowClipRect(int tx, int ty) cliph -= m_layer->horizontalScrollbarHeight(); } - return QRect(clipx,clipy,clipw,cliph); + return TQRect(clipx,clipy,clipw,cliph); } -QRect RenderBox::getClipRect(int tx, int ty) +TQRect RenderBox::getClipRect(int tx, int ty) { int bl=borderLeft(),bt=borderTop(),bb=borderBottom(),br=borderRight(); // ### what about paddings? @@ -711,7 +711,7 @@ QRect RenderBox::getClipRect(int tx, int ty) //kdDebug( 6040 ) << "setting clip("<parent()->renderer()->style() : cb->style(); - const QFontMetrics &fm = s->fontMetrics(); + const TQFontMetrics &fm = s->fontMetrics(); height = fm.height(); bool rtl = s->direction() == RTL; @@ -2284,7 +2284,7 @@ void RenderBox::caretPos(int /*offset*/, int flags, int &_x, int &_y, int &width // Place caret inside the element } else { - const QFontMetrics &fm = style()->fontMetrics(); + const TQFontMetrics &fm = style()->fontMetrics(); height = fm.height(); RenderStyle *s = style(); diff --git a/khtml/rendering/render_box.h b/khtml/rendering/render_box.h index ad0a5b9fb..c0c618d5c 100644 --- a/khtml/rendering/render_box.h +++ b/khtml/rendering/render_box.h @@ -142,14 +142,14 @@ protected: virtual void paintBoxDecorations(PaintInfo& paintInfo, int _tx, int _ty); void paintRootBoxDecorations( PaintInfo& paintInfo, int _tx, int _ty); - void paintBackgrounds(QPainter *p, const QColor& c, const BackgroundLayer* bgLayer, int clipy, int cliph, int _tx, int _ty, int w, int h); - void paintBackground(QPainter *p, const QColor& c, const BackgroundLayer* bgLayer, int clipy, int cliph, int _tx, int _ty, int w, int h); + void paintBackgrounds(TQPainter *p, const TQColor& c, const BackgroundLayer* bgLayer, int clipy, int cliph, int _tx, int _ty, int w, int h); + void paintBackground(TQPainter *p, const TQColor& c, const BackgroundLayer* bgLayer, int clipy, int cliph, int _tx, int _ty, int w, int h); - virtual void paintBackgroundExtended(QPainter* /*p*/, const QColor& /*c*/, const BackgroundLayer* /*bgLayer*/, + virtual void paintBackgroundExtended(TQPainter* /*p*/, const TQColor& /*c*/, const BackgroundLayer* /*bgLayer*/, int /*clipy*/, int /*cliph*/, int /*_tx*/, int /*_ty*/, int /*w*/, int /*height*/, int /*bleft*/, int /*bright*/, int /*pleft*/, int /*pright*/ ); - void outlineBox(QPainter *p, int _tx, int _ty, const char *color = "red"); + void outlineBox(TQPainter *p, int _tx, int _ty, const char *color = "red"); void calcAbsoluteHorizontal(); void calcAbsoluteVertical(); @@ -165,8 +165,8 @@ protected: void calcAbsoluteVerticalReplaced(); void calcAbsoluteHorizontalReplaced(); - QRect getOverflowClipRect(int tx, int ty); - QRect getClipRect(int tx, int ty); + TQRect getOverflowClipRect(int tx, int ty); + TQRect getClipRect(int tx, int ty); void restructureParentFlow(); diff --git a/khtml/rendering/render_br.cpp b/khtml/rendering/render_br.cpp index 42709839a..69984b760 100644 --- a/khtml/rendering/render_br.cpp +++ b/khtml/rendering/render_br.cpp @@ -25,7 +25,7 @@ using namespace khtml; RenderBR::RenderBR(DOM::NodeImpl* node) - : RenderText(node, new DOM::DOMStringImpl(QChar('\n'))) + : RenderText(node, new DOM::DOMStringImpl(TQChar('\n'))) { m_hasReturn = true; } diff --git a/khtml/rendering/render_canvas.cpp b/khtml/rendering/render_canvas.cpp index 50cad914a..e8540eba6 100644 --- a/khtml/rendering/render_canvas.cpp +++ b/khtml/rendering/render_canvas.cpp @@ -166,7 +166,7 @@ void RenderCanvas::layout() } #ifdef SPEED_DEBUG - QTime qt; + TQTime qt; qt.start(); #endif @@ -212,7 +212,7 @@ void RenderCanvas::updateDocumentSize() bool vss = m_view->verticalScrollBar()->isShown(); bool hss = m_view->horizontalScrollBar()->isShown(); - QSize s = m_view->viewportSize(m_cachedDocWidth, m_cachedDocHeight); + TQSize s = m_view->viewportSize(m_cachedDocWidth, m_cachedDocHeight); // if we are about to show a scrollbar, and the document is sized to the viewport w or h, // then reserve the scrollbar space so that it doesn't trigger the _other_ scrollbar @@ -329,7 +329,7 @@ void RenderCanvas::paintBoxDecorations(PaintInfo& paintInfo, int /*_tx*/, int /* if ((firstChild() && firstChild()->style()->visibility() == VISIBLE) || !view()) return; - paintInfo.p->fillRect(paintInfo.r, view()->palette().active().color(QColorGroup::Base)); + paintInfo.p->fillRect(paintInfo.r, view()->palette().active().color(TQColorGroup::Base)); } void RenderCanvas::repaintRectangle(int x, int y, int w, int h, Priority p, bool f) @@ -345,8 +345,8 @@ void RenderCanvas::repaintRectangle(int x, int y, int w, int h, Priority p, bool y += m_view->contentsY(); } - QRect vr = viewRect(); - QRect ur(x, y, w, h); + TQRect vr = viewRect(); + TQRect ur(x, y, w, h); if (m_view && ur.intersects(vr)) { @@ -370,7 +370,7 @@ void RenderCanvas::deferredRepaint( RenderObject* o ) void RenderCanvas::scheduleDeferredRepaints() { if (!needsFullRepaint()) { - QValueList::const_iterator it; + TQValueList::const_iterator it; for ( it = m_dirtyChildren.begin(); it != m_dirtyChildren.end(); ++it ) (*it)->repaint(); } @@ -401,10 +401,10 @@ void RenderCanvas::repaint(Priority p) } } -static QRect enclosingPositionedRect (RenderObject *n) +static TQRect enclosingPositionedRect (RenderObject *n) { RenderObject *enclosingParent = n->containingBlock(); - QRect rect(0,0,0,0); + TQRect rect(0,0,0,0); if (enclosingParent) { int ox, oy; enclosingParent->absolutePosition(ox, oy); @@ -421,13 +421,13 @@ static QRect enclosingPositionedRect (RenderObject *n) return rect; } -QRect RenderCanvas::selectionRect() const +TQRect RenderCanvas::selectionRect() const { RenderObject *r = m_selectionStart; if (!r) - return QRect(); + return TQRect(); - QRect selectionRect = enclosingPositionedRect(r); + TQRect selectionRect = enclosingPositionedRect(r); while (r && r != m_selectionEnd) { @@ -475,8 +475,8 @@ void RenderCanvas::setSelection(RenderObject *s, int sp, RenderObject *e, int ep int oldStartPos = m_selectionStartPos; RenderObject *oldEnd = m_selectionEnd; int oldEndPos = m_selectionEndPos; - QPtrList oldSelectedInside; - QPtrList newSelectedInside; + TQPtrList oldSelectedInside; + TQPtrList newSelectedInside; RenderObject *os = oldStart; while (os && os != oldEnd) @@ -565,7 +565,7 @@ void RenderCanvas::setSelection(RenderObject *s, int sp, RenderObject *e, int ep newSelectedInside.removeRef(s); newSelectedInside.removeRef(e); - QRect updateRect; + TQRect updateRect; // Don't use repaint() because it will cause all rects to // be united (see khtmlview::scheduleRepaint()). Instead @@ -578,7 +578,7 @@ void RenderCanvas::setSelection(RenderObject *s, int sp, RenderObject *e, int ep // If so we have to draw them. // Could be faster by building list of non-intersecting rectangles rather // than unioning rectangles. - QPtrListIterator oldIterator(oldSelectedInside); + TQPtrListIterator oldIterator(oldSelectedInside); bool firstRect = true; for (; oldIterator.current(); ++oldIterator){ if (!newSelectedInside.containsRef(oldIterator.current())){ @@ -598,7 +598,7 @@ void RenderCanvas::setSelection(RenderObject *s, int sp, RenderObject *e, int ep // If so we have to draw them. // Could be faster by building list of non-intersecting rectangles rather // than unioning rectangles. - QPtrListIterator newIterator(newSelectedInside); + TQPtrListIterator newIterator(newSelectedInside); firstRect = true; for (; newIterator.current(); ++newIterator){ if (!oldSelectedInside.containsRef(newIterator.current())){ @@ -690,24 +690,24 @@ void RenderCanvas::selectionStartEnd(int& spos, int& epos) epos = m_selectionEndPos; } -QRect RenderCanvas::viewRect() const +TQRect RenderCanvas::viewRect() const { if (m_pagedMode) if (m_pageTop == m_pageBottom) { - kdDebug(6040) << "viewRect: " << QRect(0, m_pageTop, m_width, m_height) << endl; - return QRect(0, m_pageTop, m_width, m_height); + kdDebug(6040) << "viewRect: " << TQRect(0, m_pageTop, m_width, m_height) << endl; + return TQRect(0, m_pageTop, m_width, m_height); } else { - kdDebug(6040) << "viewRect: " << QRect(0, m_pageTop, m_width, m_pageBottom - m_pageTop) << endl; - return QRect(0, m_pageTop, m_width, m_pageBottom - m_pageTop); + kdDebug(6040) << "viewRect: " << TQRect(0, m_pageTop, m_width, m_pageBottom - m_pageTop) << endl; + return TQRect(0, m_pageTop, m_width, m_pageBottom - m_pageTop); } else if (m_view) - return QRect(m_view->contentsX(), + return TQRect(m_view->contentsX(), m_view->contentsY(), m_view->visibleWidth(), m_view->visibleHeight()); else - return QRect(0,0,m_rootWidth,m_rootHeight); + return TQRect(0,0,m_rootWidth,m_rootHeight); } int RenderCanvas::docHeight() const diff --git a/khtml/rendering/render_canvas.h b/khtml/rendering/render_canvas.h index 017bd02b2..76196bd24 100644 --- a/khtml/rendering/render_canvas.h +++ b/khtml/rendering/render_canvas.h @@ -123,7 +123,7 @@ public: RenderPage* page(); - QRect selectionRect() const; + TQRect selectionRect() const; void setMaximalOutlineSize(int o) { m_maximalOutlineSize = o; } int maximalOutlineSize() const { return m_maximalOutlineSize; } @@ -143,7 +143,7 @@ protected: virtual void selectionStartEnd(int& spos, int& epos); - virtual QRect viewRect() const; + virtual TQRect viewRect() const; KHTMLView *m_view; @@ -181,7 +181,7 @@ protected: RenderPage* m_page; int m_maximalOutlineSize; // Used to apply a fudge factor to dirty-rect checks on blocks/tables. - QValueList m_dirtyChildren; + TQValueList m_dirtyChildren; }; inline RenderCanvas* RenderObject::canvas() const diff --git a/khtml/rendering/render_flow.cpp b/khtml/rendering/render_flow.cpp index 88e06aab9..ae579bd46 100644 --- a/khtml/rendering/render_flow.cpp +++ b/khtml/rendering/render_flow.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include "rendering/render_flow.h" @@ -222,7 +222,7 @@ void RenderFlow::paintLines(PaintInfo& i, int _tx, int _ty) } if (i.phase == PaintActionOutline && i.outlineObjects) { - QValueList::iterator it;; + TQValueList::iterator it;; for( it = (*i.outlineObjects).begin(); it != (*i.outlineObjects).end(); ++it ) if ((*it)->isRenderInline()) static_cast(*it)->paintOutlines(i.p, _tx, _ty); diff --git a/khtml/rendering/render_form.cpp b/khtml/rendering/render_form.cpp index f8daba1e3..403295a8f 100644 --- a/khtml/rendering/render_form.cpp +++ b/khtml/rendering/render_form.cpp @@ -38,7 +38,7 @@ #include #include -#include +#include #include "misc/helper.h" #include "xml/dom2_eventsimpl.h" @@ -52,8 +52,8 @@ #include "khtml_ext.h" #include "xml/dom_docimpl.h" -#include -#include +#include +#include using namespace khtml; @@ -138,7 +138,7 @@ short RenderButton::baselinePosition( bool f ) const RenderCheckBox::RenderCheckBox(HTMLInputElementImpl *element) : RenderButton(element) { - QCheckBox* b = new QCheckBox(view()->viewport(), "__khtml"); + TQCheckBox* b = new TQCheckBox(view()->viewport(), "__khtml"); b->setAutoMask(true); b->setMouseTracking(true); setQWidget(b); @@ -146,7 +146,7 @@ RenderCheckBox::RenderCheckBox(HTMLInputElementImpl *element) // prevent firing toggled() signals on initialization b->setChecked(element->checked()); - connect(b,SIGNAL(stateChanged(int)),this,SLOT(slotStateChanged(int))); + connect(b,TQT_SIGNAL(stateChanged(int)),this,TQT_SLOT(slotStateChanged(int))); } @@ -154,9 +154,9 @@ void RenderCheckBox::calcMinMaxWidth() { KHTMLAssert( !minMaxKnown() ); - QCheckBox *cb = static_cast( m_widget ); - QSize s( cb->style().pixelMetric( QStyle::PM_IndicatorWidth ), - cb->style().pixelMetric( QStyle::PM_IndicatorHeight ) ); + TQCheckBox *cb = static_cast( m_widget ); + TQSize s( cb->style().pixelMetric( TQStyle::PM_IndicatorWidth ), + cb->style().pixelMetric( TQStyle::PM_IndicatorHeight ) ); setIntrinsicWidth( s.width() ); setIntrinsicHeight( s.height() ); @@ -172,8 +172,8 @@ void RenderCheckBox::updateFromElement() void RenderCheckBox::slotStateChanged(int state) { - element()->setChecked(state == QButton::On); - element()->setIndeterminate(state == QButton::NoChange); + element()->setChecked(state == TQButton::On); + element()->setIndeterminate(state == TQButton::NoChange); ref(); element()->onChange(); @@ -185,14 +185,14 @@ void RenderCheckBox::slotStateChanged(int state) RenderRadioButton::RenderRadioButton(HTMLInputElementImpl *element) : RenderButton(element) { - QRadioButton* b = new QRadioButton(view()->viewport(), "__khtml"); + TQRadioButton* b = new TQRadioButton(view()->viewport(), "__khtml"); b->setMouseTracking(true); setQWidget(b); // prevent firing toggled() signals on initialization b->setChecked(element->checked()); - connect(b,SIGNAL(toggled(bool)),this,SLOT(slotToggled(bool))); + connect(b,TQT_SIGNAL(toggled(bool)),this,TQT_SLOT(slotToggled(bool))); } void RenderRadioButton::updateFromElement() @@ -206,9 +206,9 @@ void RenderRadioButton::calcMinMaxWidth() { KHTMLAssert( !minMaxKnown() ); - QRadioButton *rb = static_cast( m_widget ); - QSize s( rb->style().pixelMetric( QStyle::PM_ExclusiveIndicatorWidth ), - rb->style().pixelMetric( QStyle::PM_ExclusiveIndicatorHeight ) ); + TQRadioButton *rb = static_cast( m_widget ); + TQSize s( rb->style().pixelMetric( TQStyle::PM_ExclusiveIndicatorWidth ), + rb->style().pixelMetric( TQStyle::PM_ExclusiveIndicatorHeight ) ); setIntrinsicWidth( s.width() ); setIntrinsicHeight( s.height() ); @@ -230,17 +230,17 @@ void RenderRadioButton::slotToggled(bool activated) RenderSubmitButton::RenderSubmitButton(HTMLInputElementImpl *element) : RenderButton(element) { - QPushButton* p = new QPushButton(view()->viewport(), "__khtml"); + TQPushButton* p = new TQPushButton(view()->viewport(), "__khtml"); setQWidget(p); p->setAutoMask(true); p->setMouseTracking(true); } -QString RenderSubmitButton::rawText() +TQString RenderSubmitButton::rawText() { - QString value = element()->valueWithDefault().string(); + TQString value = element()->valueWithDefault().string(); value = value.stripWhiteSpace(); - QString raw; + TQString raw; for(unsigned int i = 0; i < value.length(); i++) { raw += value[i]; if(value[i] == '&') @@ -253,29 +253,29 @@ void RenderSubmitButton::calcMinMaxWidth() { KHTMLAssert( !minMaxKnown() ); - QString raw = rawText(); - QPushButton* pb = static_cast(m_widget); + TQString raw = rawText(); + TQPushButton* pb = static_cast(m_widget); pb->setText(raw); pb->setFont(style()->font()); bool empty = raw.isEmpty(); if ( empty ) - raw = QString::fromLatin1("X"); - QFontMetrics fm = pb->fontMetrics(); - QSize ts = fm.size( ShowPrefix, raw); - QSize s(pb->style().sizeFromContents( QStyle::CT_PushButton, pb, ts ) - .expandedTo(QApplication::globalStrut())); - int margin = pb->style().pixelMetric( QStyle::PM_ButtonMargin, pb) + - pb->style().pixelMetric( QStyle::PM_DefaultFrameWidth, pb ) * 2; + raw = TQString::fromLatin1("X"); + TQFontMetrics fm = pb->fontMetrics(); + TQSize ts = fm.size( ShowPrefix, raw); + TQSize s(pb->style().sizeFromContents( TQStyle::CT_PushButton, pb, ts ) + .expandedTo(TQApplication::globalStrut())); + int margin = pb->style().pixelMetric( TQStyle::PM_ButtonMargin, pb) + + pb->style().pixelMetric( TQStyle::PM_DefaultFrameWidth, pb ) * 2; int w = ts.width() + margin; int h = s.height(); if (pb->isDefault() || pb->autoDefault()) { - int dbw = pb->style().pixelMetric( QStyle::PM_ButtonDefaultIndicator, pb ) * 2; + int dbw = pb->style().pixelMetric( TQStyle::PM_ButtonDefaultIndicator, pb ) * 2; w += dbw; } // add 30% margins to the width (heuristics to make it look similar to IE) - s = QSize( w*13/10, h ).expandedTo(QApplication::globalStrut()); + s = TQSize( w*13/10, h ).expandedTo(TQApplication::globalStrut()); setIntrinsicWidth( s.width() ); setIntrinsicHeight( s.height() ); @@ -285,9 +285,9 @@ void RenderSubmitButton::calcMinMaxWidth() void RenderSubmitButton::updateFromElement() { - QString oldText = static_cast(m_widget)->text(); - QString newText = rawText(); - static_cast(m_widget)->setText(newText); + TQString oldText = static_cast(m_widget)->text(); + TQString newText = rawText(); + static_cast(m_widget)->setText(newText); if ( oldText != newText ) setNeedsLayoutAndMinMaxRecalc(); RenderFormElement::updateFromElement(); @@ -307,12 +307,12 @@ RenderResetButton::RenderResetButton(HTMLInputElementImpl *element) // ------------------------------------------------------------------------------- -LineEditWidget::LineEditWidget(DOM::HTMLInputElementImpl* input, KHTMLView* view, QWidget* parent) +LineEditWidget::LineEditWidget(DOM::HTMLInputElementImpl* input, KHTMLView* view, TQWidget* parent) : KLineEdit(parent, "__khtml"), m_input(input), m_view(view), m_spell(0) { setMouseTracking(true); KActionCollection *ac = new KActionCollection(this); - m_spellAction = KStdAction::spelling( this, SLOT( slotCheckSpelling() ), ac ); + m_spellAction = KStdAction::spelling( this, TQT_SLOT( slotCheckSpelling() ), ac ); } LineEditWidget::~LineEditWidget() @@ -328,14 +328,14 @@ void LineEditWidget::slotCheckSpelling() } delete m_spell; - m_spell = new KSpell( this, i18n( "Spell Checking" ), this, SLOT( slotSpellCheckReady( KSpell *) ), 0, true, true); + m_spell = new KSpell( this, i18n( "Spell Checking" ), this, TQT_SLOT( slotSpellCheckReady( KSpell *) ), 0, true, true); - connect( m_spell, SIGNAL( death() ),this, SLOT( spellCheckerFinished() ) ); - connect( m_spell, SIGNAL( misspelling( const QString &, const QStringList &, unsigned int ) ),this, SLOT( spellCheckerMisspelling( const QString &, const QStringList &, unsigned int ) ) ); - connect( m_spell, SIGNAL( corrected( const QString &, const QString &, unsigned int ) ),this, SLOT( spellCheckerCorrected( const QString &, const QString &, unsigned int ) ) ); + connect( m_spell, TQT_SIGNAL( death() ),this, TQT_SLOT( spellCheckerFinished() ) ); + connect( m_spell, TQT_SIGNAL( misspelling( const TQString &, const TQStringList &, unsigned int ) ),this, TQT_SLOT( spellCheckerMisspelling( const TQString &, const TQStringList &, unsigned int ) ) ); + connect( m_spell, TQT_SIGNAL( corrected( const TQString &, const TQString &, unsigned int ) ),this, TQT_SLOT( spellCheckerCorrected( const TQString &, const TQString &, unsigned int ) ) ); } -void LineEditWidget::spellCheckerMisspelling( const QString &_text, const QStringList &, unsigned int pos) +void LineEditWidget::spellCheckerMisspelling( const TQString &_text, const TQStringList &, unsigned int pos) { highLightWord( _text.length(),pos ); } @@ -345,7 +345,7 @@ void LineEditWidget::highLightWord( unsigned int length, unsigned int pos ) setSelection ( pos, length ); } -void LineEditWidget::spellCheckerCorrected( const QString &old, const QString &corr, unsigned int pos ) +void LineEditWidget::spellCheckerCorrected( const TQString &old, const TQString &corr, unsigned int pos ) { if( old!= corr ) { @@ -362,26 +362,26 @@ void LineEditWidget::spellCheckerFinished() void LineEditWidget::slotSpellCheckReady( KSpell *s ) { s->check( text() ); - connect( s, SIGNAL( done( const QString & ) ), this, SLOT( slotSpellCheckDone( const QString & ) ) ); + connect( s, TQT_SIGNAL( done( const TQString & ) ), this, TQT_SLOT( slotSpellCheckDone( const TQString & ) ) ); } -void LineEditWidget::slotSpellCheckDone( const QString &s ) +void LineEditWidget::slotSpellCheckDone( const TQString &s ) { if( s != text() ) setText( s ); } -QPopupMenu *LineEditWidget::createPopupMenu() +TQPopupMenu *LineEditWidget::createPopupMenu() { - QPopupMenu *popup = KLineEdit::createPopupMenu(); + TQPopupMenu *popup = KLineEdit::createPopupMenu(); if ( !popup ) { return 0L; } - connect( popup, SIGNAL( activated( int ) ), - this, SLOT( extendedMenuActivated( int ) ) ); + connect( popup, TQT_SIGNAL( activated( int ) ), + this, TQT_SLOT( extendedMenuActivated( int ) ) ); if (m_input->autoComplete()) { popup->insertSeparator(); @@ -389,7 +389,7 @@ QPopupMenu *LineEditWidget::createPopupMenu() popup->setItemEnabled( id, (compObj() && !compObj()->isEmpty()) ); } - if (echoMode() == QLineEdit::Normal && + if (echoMode() == TQLineEdit::Normal && !isReadOnly()) { popup->insertSeparator(); @@ -414,13 +414,13 @@ void LineEditWidget::extendedMenuActivated( int id) } } -bool LineEditWidget::event( QEvent *e ) +bool LineEditWidget::event( TQEvent *e ) { if (KLineEdit::event(e)) return true; - if ( e->type() == QEvent::AccelAvailable && isReadOnly() ) { - QKeyEvent* ke = (QKeyEvent*) e; + if ( e->type() == TQEvent::AccelAvailable && isReadOnly() ) { + TQKeyEvent* ke = (TQKeyEvent*) e; if ( ke->state() & ControlButton ) { switch ( ke->key() ) { case Key_Left: @@ -438,7 +438,7 @@ bool LineEditWidget::event( QEvent *e ) return false; } -void LineEditWidget::mouseMoveEvent(QMouseEvent *e) +void LineEditWidget::mouseMoveEvent(TQMouseEvent *e) { // hack to prevent Qt from calling setCursor on the widget setDragEnabled(false); @@ -453,14 +453,14 @@ RenderLineEdit::RenderLineEdit(HTMLInputElementImpl *element) : RenderFormElement(element) { LineEditWidget *edit = new LineEditWidget(element, view(), view()->viewport()); - connect(edit,SIGNAL(returnPressed()), this, SLOT(slotReturnPressed())); - connect(edit,SIGNAL(textChanged(const QString &)),this,SLOT(slotTextChanged(const QString &))); + connect(edit,TQT_SIGNAL(returnPressed()), this, TQT_SLOT(slotReturnPressed())); + connect(edit,TQT_SIGNAL(textChanged(const TQString &)),this,TQT_SLOT(slotTextChanged(const TQString &))); if(element->inputType() == HTMLInputElementImpl::PASSWORD) - edit->setEchoMode( QLineEdit::Password ); + edit->setEchoMode( TQLineEdit::Password ); if ( element->autoComplete() ) { - QStringList completions = view()->formCompletionItems(element->name().string()); + TQStringList completions = view()->formCompletionItems(element->name().string()); if (completions.count()) { edit->completionObject()->setItems(completions); edit->setContextMenuEnabled(true); @@ -518,16 +518,16 @@ void RenderLineEdit::calcMinMaxWidth() { KHTMLAssert( !minMaxKnown() ); - const QFontMetrics &fm = style()->fontMetrics(); - QSize s; + const TQFontMetrics &fm = style()->fontMetrics(); + TQSize s; int size = element()->size(); int h = fm.lineSpacing(); int w = fm.width( 'x' ) * (size > 0 ? size+1 : 17); // "some" - s = QSize(w + 2 + 2*widget()->frameWidth(), + s = TQSize(w + 2 + 2*widget()->frameWidth(), kMax(h, 14) + 2 + 2*widget()->frameWidth()) - .expandedTo(QApplication::globalStrut()); + .expandedTo(TQApplication::globalStrut()); setIntrinsicWidth( s.width() ); setIntrinsicHeight( s.height() ); @@ -560,7 +560,7 @@ void RenderLineEdit::updateFromElement() RenderFormElement::updateFromElement(); } -void RenderLineEdit::slotTextChanged(const QString &string) +void RenderLineEdit::slotTextChanged(const TQString &string) { // don't use setValue here! element()->m_value = string; @@ -679,12 +679,12 @@ void RenderFieldset::paintBoxDecorations(PaintInfo& pI, int _tx, int _ty) paintBorderMinusLegend(pI.p, _tx, _ty, w, h, style(), legend->xPos(), legend->width()); } -void RenderFieldset::paintBorderMinusLegend(QPainter *p, int _tx, int _ty, int w, int h, +void RenderFieldset::paintBorderMinusLegend(TQPainter *p, int _tx, int _ty, int w, int h, const RenderStyle* style, int lx, int lw) { - const QColor& tc = style->borderTopColor(); - const QColor& bc = style->borderBottomColor(); + const TQColor& tc = style->borderTopColor(); + const TQColor& bc = style->borderBottomColor(); EBorderStyle ts = style->borderTopStyle(); EBorderStyle bs = style->borderBottomStyle(); @@ -710,7 +710,7 @@ void RenderFieldset::paintBorderMinusLegend(QPainter *p, int _tx, int _ty, int w if(render_l) { - const QColor& lc = style->borderLeftColor(); + const TQColor& lc = style->borderLeftColor(); bool ignore_top = (tc == lc) && @@ -729,7 +729,7 @@ void RenderFieldset::paintBorderMinusLegend(QPainter *p, int _tx, int _ty, int w if(render_r) { - const QColor& rc = style->borderRightColor(); + const TQColor& rc = style->borderRightColor(); bool ignore_top = (tc == rc) && @@ -769,9 +769,9 @@ RenderFileButton::RenderFileButton(HTMLInputElementImpl *element) w->setMode(KFile::File | KFile::ExistingOnly); w->completionObject()->setDir(KGlobalSettings::documentPath()); - connect(w->lineEdit(), SIGNAL(returnPressed()), this, SLOT(slotReturnPressed())); - connect(w->lineEdit(), SIGNAL(textChanged(const QString &)),this,SLOT(slotTextChanged(const QString &))); - connect(w, SIGNAL(urlSelected(const QString &)),this,SLOT(slotUrlSelected(const QString &))); + connect(w->lineEdit(), TQT_SIGNAL(returnPressed()), this, TQT_SLOT(slotReturnPressed())); + connect(w->lineEdit(), TQT_SIGNAL(textChanged(const TQString &)),this,TQT_SLOT(slotTextChanged(const TQString &))); + connect(w, TQT_SIGNAL(urlSelected(const TQString &)),this,TQT_SLOT(slotUrlSelected(const TQString &))); setQWidget(w); m_haveFocus = false; @@ -783,17 +783,17 @@ void RenderFileButton::calcMinMaxWidth() { KHTMLAssert( !minMaxKnown() ); - const QFontMetrics &fm = style()->fontMetrics(); + const TQFontMetrics &fm = style()->fontMetrics(); int size = element()->size(); int h = fm.lineSpacing(); int w = fm.width( 'x' ) * (size > 0 ? size+1 : 17); // "some" KLineEdit* edit = static_cast( m_widget )->lineEdit(); - QSize s = edit->style().sizeFromContents(QStyle::CT_LineEdit, + TQSize s = edit->style().sizeFromContents(TQStyle::CT_LineEdit, edit, - QSize(w + 2 + 2*edit->frameWidth(), kMax(h, 14) + 2 + 2*edit->frameWidth())) - .expandedTo(QApplication::globalStrut()); - QSize bs = static_cast( m_widget )->minimumSizeHint() - edit->minimumSizeHint(); + TQSize(w + 2 + 2*edit->frameWidth(), kMax(h, 14) + 2 + 2*edit->frameWidth())) + .expandedTo(TQApplication::globalStrut()); + TQSize bs = static_cast( m_widget )->minimumSizeHint() - edit->minimumSizeHint(); setIntrinsicWidth( s.width() + bs.width() ); setIntrinsicHeight( kMax(s.height(), bs.height()) ); @@ -828,12 +828,12 @@ void RenderFileButton::slotReturnPressed() element()->form()->submitFromKeyboard(); } -void RenderFileButton::slotTextChanged(const QString &/*string*/) +void RenderFileButton::slotTextChanged(const TQString &/*string*/) { element()->m_value = KURL( widget()->url() ).prettyURL( 0, KURL::StripFileProtocol ); } -void RenderFileButton::slotUrlSelected(const QString &) +void RenderFileButton::slotUrlSelected(const TQString &) { element()->onChange(); } @@ -860,7 +860,7 @@ RenderLegend::RenderLegend(HTMLGenericFormElementImpl *element) // ------------------------------------------------------------------------------- -ComboBoxWidget::ComboBoxWidget(QWidget *parent) +ComboBoxWidget::ComboBoxWidget(TQWidget *parent) : KComboBox(false, parent, "__khtml") { setAutoMask(true); @@ -868,13 +868,13 @@ ComboBoxWidget::ComboBoxWidget(QWidget *parent) setMouseTracking(true); } -bool ComboBoxWidget::event(QEvent *e) +bool ComboBoxWidget::event(TQEvent *e) { if (KComboBox::event(e)) return true; - if (e->type()==QEvent::KeyPress) + if (e->type()==TQEvent::KeyPress) { - QKeyEvent *ke = static_cast(e); + TQKeyEvent *ke = static_cast(e); switch(ke->key()) { case Key_Return: @@ -889,21 +889,21 @@ bool ComboBoxWidget::event(QEvent *e) return false; } -bool ComboBoxWidget::eventFilter(QObject *dest, QEvent *e) +bool ComboBoxWidget::eventFilter(TQObject *dest, TQEvent *e) { - if (dest==listBox() && e->type()==QEvent::KeyPress) + if (dest==listBox() && e->type()==TQEvent::KeyPress) { - QKeyEvent *ke = static_cast(e); + TQKeyEvent *ke = static_cast(e); bool forward = false; switch(ke->key()) { case Key_Tab: forward=true; case Key_BackTab: - // ugly hack. emulate popdownlistbox() (private in QComboBox) + // ugly hack. emulate popdownlistbox() (private in TQComboBox) // we re-use ke here to store the reference to the generated event. - ke = new QKeyEvent(QEvent::KeyPress, Key_Escape, 0, 0); - QApplication::sendEvent(dest,ke); + ke = new TQKeyEvent(TQEvent::KeyPress, Key_Escape, 0, 0); + TQApplication::sendEvent(dest,ke); focusNextPrevChild(forward); delete ke; return true; @@ -955,7 +955,7 @@ void RenderSelect::updateFromElement() } if (m_useListBox && oldMultiple != m_multiple) { - static_cast(m_widget)->setSelectionMode(m_multiple ? QListBox::Extended : QListBox::Single); + static_cast(m_widget)->setSelectionMode(m_multiple ? TQListBox::Extended : TQListBox::Single); } m_selectionChanged = true; m_optionsChanged = true; @@ -965,7 +965,7 @@ void RenderSelect::updateFromElement() if ( m_optionsChanged ) { if (element()->m_recalcListItems) element()->recalcListItems(); - QMemArray listItems = element()->listItems(); + TQMemArray listItems = element()->listItems(); int listIndex; if(m_useListBox) { @@ -982,27 +982,27 @@ void RenderSelect::updateFromElement() text = ""; if(m_useListBox) { - QListBoxText *item = new QListBoxText(QString(text.implementation()->s, text.implementation()->l)); + TQListBoxText *item = new TQListBoxText(TQString(text.implementation()->s, text.implementation()->l)); static_cast(m_widget) ->insertItem(item, listIndex); item->setSelectable(false); } else { static_cast(m_widget) - ->insertItem(QString(text.implementation()->s, text.implementation()->l), listIndex); + ->insertItem(TQString(text.implementation()->s, text.implementation()->l), listIndex); static_cast(m_widget)->listBox()->item(listIndex)->setSelectable(false); } } else if (listItems[listIndex]->id() == ID_OPTION) { HTMLOptionElementImpl* optElem = static_cast(listItems[listIndex]); - QString text = optElem->text().string(); + TQString text = optElem->text().string(); if (optElem->parentNode()->id() == ID_OPTGROUP) { // Prefer label if set DOMString label = optElem->getAttribute(ATTR_LABEL); if (!label.isEmpty()) text = label.string(); - text = QString::fromLatin1(" ")+text; + text = TQString::fromLatin1(" ")+text; } if(m_useListBox) { @@ -1020,7 +1020,7 @@ void RenderSelect::updateFromElement() m_selectionChanged = true; } - // QComboBox caches the size hint unless you call setFont (ref: TT docu) + // TQComboBox caches the size hint unless you call setFont (ref: TT docu) if(!m_useListBox) { KComboBox *that = static_cast(m_widget); that->setFont( that->font() ); @@ -1069,7 +1069,7 @@ void RenderSelect::layout( ) if(m_useListBox) { KListBox* w = static_cast(m_widget); - QListBoxItem* p = w->firstItem(); + TQListBoxItem* p = w->firstItem(); int width = 0; int height = 0; while(p) { @@ -1098,7 +1098,7 @@ void RenderSelect::layout( ) setIntrinsicHeight( height ); } else { - QSize s(m_widget->sizeHint()); + TQSize s(m_widget->sizeHint()); setIntrinsicWidth( s.width() ); setIntrinsicHeight( s.height() ); } @@ -1108,7 +1108,7 @@ void RenderSelect::layout( ) RenderFormElement::layout(); // and now disable the widget in case there is no