diff options
Diffstat (limited to 'src/svnfrontend/graphtree/drawparams.cpp')
-rw-r--r-- | src/svnfrontend/graphtree/drawparams.cpp | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/src/svnfrontend/graphtree/drawparams.cpp b/src/svnfrontend/graphtree/drawparams.cpp index ced7bd4..74e4953 100644 --- a/src/svnfrontend/graphtree/drawparams.cpp +++ b/src/svnfrontend/graphtree/drawparams.cpp @@ -19,16 +19,16 @@ /* * A Widget for visualizing hierarchical metrics as areas. - * The API is similar to QListView. + * The API is similar to TQListView. */ #include <math.h> -#include <qpainter.h> -#include <qtooltip.h> -#include <qregexp.h> -#include <qstyle.h> -#include <qpopupmenu.h> +#include <tqpainter.h> +#include <tqtooltip.h> +#include <tqregexp.h> +#include <tqstyle.h> +#include <tqpopupmenu.h> #include <klocale.h> #include <kconfig.h> @@ -52,12 +52,12 @@ StoredDrawParams::StoredDrawParams() _shaded = true; _rotated = false; - _backColor = Qt::white; + _backColor = TQt::white; // field array has size 0 } -StoredDrawParams::StoredDrawParams(QColor c, +StoredDrawParams::StoredDrawParams(TQColor c, bool selected, bool current) { _backColor = c; @@ -71,18 +71,18 @@ StoredDrawParams::StoredDrawParams(QColor c, // field array has size 0 } -QString StoredDrawParams::text(int f) const +TQString StoredDrawParams::text(int f) const { if ((f<0) || (f >= (int)_field.size())) - return QString::null; + return TQString(); return _field[f].text; } -QPixmap StoredDrawParams::pixmap(int f) const +TQPixmap StoredDrawParams::pixmap(int f) const { if ((f<0) || (f >= (int)_field.size())) - return QPixmap(); + return TQPixmap(); return _field[f].pix; } @@ -103,10 +103,10 @@ int StoredDrawParams::maxLines(int f) const return _field[f].maxLines; } -const QFont& StoredDrawParams::font() const +const TQFont& StoredDrawParams::font() const { - static QFont* f = 0; - if (!f) f = new QFont(QApplication::font()); + static TQFont* f = 0; + if (!f) f = new TQFont(TQApplication::font()); return *f; } @@ -126,7 +126,7 @@ void StoredDrawParams::ensureField(int f) } -void StoredDrawParams::setField(int f, QString t, QPixmap pm, +void StoredDrawParams::setField(int f, TQString t, TQPixmap pm, Position p, int maxLines) { if (f<0 || f>=MAX_FIELD) return; @@ -138,7 +138,7 @@ void StoredDrawParams::setField(int f, QString t, QPixmap pm, _field[f].maxLines = maxLines; } -void StoredDrawParams::setText(int f, QString t) +void StoredDrawParams::setText(int f, TQString t) { if (f<0 || f>=MAX_FIELD) return; ensureField(f); @@ -146,7 +146,7 @@ void StoredDrawParams::setText(int f, QString t) _field[f].text = t; } -void StoredDrawParams::setPixmap(int f, QPixmap pm) +void StoredDrawParams::setPixmap(int f, TQPixmap pm) { if (f<0 || f>=MAX_FIELD) return; ensureField(f); @@ -176,7 +176,7 @@ void StoredDrawParams::setMaxLines(int f, int m) // RectDrawing // -RectDrawing::RectDrawing(QRect r) +RectDrawing::RectDrawing(TQRect r) { _fm = 0; _dp = 0; @@ -205,7 +205,7 @@ void RectDrawing::setDrawParams(DrawParams* dp) _dp = dp; } -void RectDrawing::setRect(QRect r) +void RectDrawing::setRect(TQRect r) { _rect = r; @@ -219,7 +219,7 @@ void RectDrawing::setRect(QRect r) _fontHeight = 0; } -QRect RectDrawing::remainingRect(DrawParams* dp) +TQRect RectDrawing::remainingRect(DrawParams* dp) { if (!dp) dp = drawParams(); @@ -244,20 +244,20 @@ QRect RectDrawing::remainingRect(DrawParams* dp) } -void RectDrawing::drawBack(QPainter* p, DrawParams* dp) +void RectDrawing::drawBack(TQPainter* p, DrawParams* dp) { if (!dp) dp = drawParams(); if (_rect.width()<=0 || _rect.height()<=0) return; - QRect r = _rect; - QColor normal = dp->backColor(); + TQRect r = _rect; + TQColor normal = dp->backColor(); if (dp->selected()) normal = normal.light(); bool isCurrent = dp->current(); if (dp->drawFrame() || isCurrent) { // 3D raised/sunken frame effect... - QColor high = normal.light(); - QColor low = normal.dark(); + TQColor high = normal.light(); + TQColor low = normal.dark(); p->setPen( isCurrent ? low:high); p->drawLine(r.left(), r.top(), r.right(), r.top()); p->drawLine(r.left(), r.top(), r.left(), r.bottom()); @@ -270,10 +270,10 @@ void RectDrawing::drawBack(QPainter* p, DrawParams* dp) if (dp->shaded()) { // some shading - bool goDark = qGray(normal.rgb())>128; + bool goDark = tqGray(normal.rgb())>128; int rBase, gBase, bBase; normal.rgb(&rBase, &gBase, &bBase); - p->setBrush(QBrush::NoBrush); + p->setBrush(TQBrush::NoBrush); // shade parameters: int d = 7; @@ -294,7 +294,7 @@ void RectDrawing::drawBack(QPainter* p, DrawParams* dp) int gDiff = goDark ? -gBase/d : (255-gBase)/d; int bDiff = goDark ? -bBase/d : (255-bBase)/d; - QColor shadeColor; + TQColor shadeColor; while (factor<.95) { shadeColor.setRgb((int)(rBase+factor*rDiff+.5), (int)(gBase+factor*gDiff+.5), @@ -333,22 +333,22 @@ void RectDrawing::drawBack(QPainter* p, DrawParams* dp) } // fill inside - p->setPen(QPen::NoPen); + p->setPen(TQPen::NoPen); p->setBrush(normal); p->drawRect(r); } -bool RectDrawing::drawField(QPainter* p, int f, DrawParams* dp) +bool RectDrawing::drawField(TQPainter* p, int f, DrawParams* dp) { if (!dp) dp = drawParams(); if (!_fm) { - _fm = new QFontMetrics(dp->font()); + _fm = new TQFontMetrics(dp->font()); _fontHeight = _fm->height(); } - QRect r = _rect; + TQRect r = _rect; if (0) kdDebug(90100) << "DrawField: Rect " << r.x() << "/" << r.y() << " - " << r.width() << "x" << r.height() << endl; @@ -488,9 +488,9 @@ bool RectDrawing::drawField(QPainter* p, int f, DrawParams* dp) // get text and pixmap now, only if we need to, because it is possible // that they are calculated on demand (and this can take some time) - QString name = dp->text(f); + TQString name = dp->text(f); if (name.isEmpty()) return 0; - QPixmap pix = dp->pixmap(f); + TQPixmap pix = dp->pixmap(f); // check if pixmap can be drawn int pixW = pix.width(); @@ -529,7 +529,7 @@ bool RectDrawing::drawField(QPainter* p, int f, DrawParams* dp) } p->save(); - p->setPen( (qGray(dp->backColor().rgb())>100) ? Qt::black : Qt::white); + p->setPen( (tqGray(dp->backColor().rgb())>100) ? TQt::black : TQt::white); p->setFont(dp->font()); if (rotate) { //p->translate(r.x()+2, r.y()+r.height()); @@ -552,14 +552,14 @@ bool RectDrawing::drawField(QPainter* p, int f, DrawParams* dp) * If the text is to be written at the bottom, we start with the * end of the string (so everything is reverted) */ - QString remaining; + TQString remaining; int origLines = lines; while (lines>0) { if (w>width && lines>1) { int lastBreakPos = name.length(), lastWidth = w; int len = name.length(); - QChar::Category caOld, ca; + TQChar::Category caOld, ca; if (!isBottom) { // start with comparing categories of last 2 chars @@ -569,8 +569,8 @@ bool RectDrawing::drawField(QPainter* p, int f, DrawParams* dp) ca = name[len-1].category(); if (ca != caOld) { // "Aa" has no break between... - if (ca == QChar::Letter_Uppercase && - caOld == QChar::Letter_Lowercase) { + if (ca == TQChar::Letter_Uppercase && + caOld == TQChar::Letter_Lowercase) { caOld = ca; continue; } @@ -584,7 +584,7 @@ bool RectDrawing::drawField(QPainter* p, int f, DrawParams* dp) w = lastWidth; remaining = name.mid(lastBreakPos); // remove space on break point - if (name[lastBreakPos-1].category() == QChar::Separator_Space) + if (name[lastBreakPos-1].category() == TQChar::Separator_Space) name = name.left(lastBreakPos-1); else name = name.left(lastBreakPos); @@ -598,8 +598,8 @@ bool RectDrawing::drawField(QPainter* p, int f, DrawParams* dp) if (ca != caOld) { // "Aa" has no break between... - if (caOld == QChar::Letter_Uppercase && - ca == QChar::Letter_Lowercase) { + if (caOld == TQChar::Letter_Uppercase && + ca == TQChar::Letter_Lowercase) { caOld = ca; continue; } @@ -613,14 +613,14 @@ bool RectDrawing::drawField(QPainter* p, int f, DrawParams* dp) w = lastWidth; remaining = name.left(l-lastBreakPos); // remove space on break point - if (name[l-lastBreakPos].category() == QChar::Separator_Space) + if (name[l-lastBreakPos].category() == TQChar::Separator_Space) name = name.right(lastBreakPos-1); else name = name.right(lastBreakPos); } } else - remaining = QString::null; + remaining = TQString(); /* truncate and add ... if needed */ if (w>width) { @@ -659,7 +659,7 @@ bool RectDrawing::drawField(QPainter* p, int f, DrawParams* dp) p->drawText( x+pixW, y, width - pixW, h, - Qt::AlignLeft, name); + TQt::AlignLeft, name); y = isBottom ? (y-h) : (y+h); lines--; |