diff options
Diffstat (limited to 'src/kwin/iaoraclient.cpp')
-rw-r--r-- | src/kwin/iaoraclient.cpp | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/src/kwin/iaoraclient.cpp b/src/kwin/iaoraclient.cpp index 7c1af84..73f523f 100644 --- a/src/kwin/iaoraclient.cpp +++ b/src/kwin/iaoraclient.cpp @@ -24,15 +24,15 @@ #include <klocale.h> -#include <qbitmap.h> -#include <qdatetime.h> -#include <qfontmetrics.h> -#include <qimage.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qdesktopwidget.h> +#include <tqbitmap.h> +#include <tqdatetime.h> +#include <tqfontmetrics.h> +#include <tqimage.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqdesktopwidget.h> #include "iaoraclient.h" #include "iaorabutton.h" @@ -43,9 +43,9 @@ namespace KWinIaOra IaOraClient::IaOraClient(KDecorationBridge* bridge, KDecorationFactory* factory) : KCommonDecoration (bridge, factory), - s_titleFont(QFont() ) + s_titleFont(TQFont() ) { - memset(m_captionPixmaps, 0, sizeof(QPixmap*)*2); + memset(m_captionPixmaps, 0, sizeof(TQPixmap*)*2); } IaOraClient::~IaOraClient() @@ -53,17 +53,17 @@ IaOraClient::~IaOraClient() clearCaptionPixmaps(); } -QString IaOraClient::visibleName() const +TQString IaOraClient::visibleName() const { return i18n("Ia Ora"); } -QString IaOraClient::defaultButtonsLeft() const +TQString IaOraClient::defaultButtonsLeft() const { return "M"; } -QString IaOraClient::defaultButtonsRight() const +TQString IaOraClient::defaultButtonsRight() const { return "IAX"; } @@ -199,7 +199,7 @@ void IaOraClient::init() KCommonDecoration::init(); } -QRegion IaOraClient::cornerShape(WindowCorner corner) +TQRegion IaOraClient::cornerShape(WindowCorner corner) { int w = widget()->width(); int h = widget()->height(); @@ -207,37 +207,37 @@ QRegion IaOraClient::cornerShape(WindowCorner corner) switch (corner) { case WC_TopLeft: if (layoutMetric(LM_TitleEdgeLeft) > 0) - return QRegion(0, 0, 1, 1);// + QRegion(1, 0, 1, 1); + return TQRegion(0, 0, 1, 1);// + TQRegion(1, 0, 1, 1); else - return QRegion(); + return TQRegion(); case WC_TopRight: if (layoutMetric(LM_TitleEdgeRight) > 0) - return QRegion(w-1, 0, 1, 1);// + QRegion(w-2, 0, 1, 1); + return TQRegion(w-1, 0, 1, 1);// + TQRegion(w-2, 0, 1, 1); else - return QRegion(); + return TQRegion(); case WC_BottomLeft: if (layoutMetric(LM_BorderBottom) > 0) - return QRegion(0, h-1, 1, 1); + return TQRegion(0, h-1, 1, 1); else - return QRegion(); + return TQRegion(); case WC_BottomRight: if (layoutMetric(LM_BorderBottom) > 0) - return QRegion(w-1, h-1, 1, 1); + return TQRegion(w-1, h-1, 1, 1); else - return QRegion(); + return TQRegion(); default: - return QRegion(); + return TQRegion(); } } -void IaOraClient::paintEvent(QPaintEvent *e) +void IaOraClient::paintEvent(TQPaintEvent *e) { - QRegion region = e->region(); + TQRegion region = e->region(); IaOraHandler *handler = Handler(); @@ -247,10 +247,10 @@ void IaOraClient::paintEvent(QPaintEvent *e) bool active = isActive(); bool toolWindow = isToolWindow(); - QPainter painter(widget() ); + TQPainter painter(widget() ); // often needed coordinates - QRect r = widget()->rect(); + TQRect r = widget()->rect(); int r_w = r.width(); // int r_h = r.height(); @@ -272,11 +272,11 @@ void IaOraClient::paintEvent(QPaintEvent *e) const int sideHeight = borderBottomTop-titleEdgeBottomBottom-1; - QRect Rtitle = QRect(r_x+titleEdgeLeft+buttonsLeftWidth(), r_y+titleEdgeTop, + TQRect Rtitle = TQRect(r_x+titleEdgeLeft+buttonsLeftWidth(), r_y+titleEdgeTop, r_x2-titleEdgeRight-buttonsRightWidth()-(r_x+titleEdgeLeft+buttonsLeftWidth()), titleEdgeBottomBottom-(r_y+titleEdgeTop) ); - QRect tempRect; + TQRect tempRect; // topSpacer if(titleEdgeTop > 0) @@ -310,7 +310,7 @@ void IaOraClient::paintEvent(QPaintEvent *e) } // titleSpacer - const QPixmap &caption = captionPixmap(); + const TQPixmap &caption = captionPixmap(); if(Rtitle.width() > 0) { m_captionRect = captionRect(); // also update m_captionRect! @@ -378,10 +378,10 @@ void IaOraClient::paintEvent(QPaintEvent *e) } } -QRect IaOraClient::captionRect() const +TQRect IaOraClient::captionRect() const { - const QPixmap &caption = captionPixmap(); - QRect r = widget()->rect(); + const TQPixmap &caption = captionPixmap(); + TQRect r = widget()->rect(); const int titleHeight = layoutMetric(LM_TitleHeight); const int titleEdgeBottom = layoutMetric(LM_TitleEdgeBottom); @@ -408,12 +408,12 @@ QRect IaOraClient::captionRect() const } else tX = titleLeft+(titleWidth- caption.width() )/2; - return QRect(tX, r.top()+titleEdgeTop, tW, titleHeight+titleEdgeBottom); + return TQRect(tX, r.top()+titleEdgeTop, tW, titleHeight+titleEdgeBottom); } void IaOraClient::updateCaption() { - QRect oldCaptionRect = m_captionRect; + TQRect oldCaptionRect = m_captionRect; if (oldCaption != caption() ) clearCaptionPixmaps(); @@ -448,12 +448,12 @@ void IaOraClient::reset( unsigned long changed ) KCommonDecoration::reset(changed); } -const QPixmap &IaOraClient::getTitleBarTile(bool active) const +const TQPixmap &IaOraClient::getTitleBarTile(bool active) const { return Handler()->pixmap(TitleBarTile, active, isToolWindow() ); } -const QPixmap &IaOraClient::captionPixmap() const +const TQPixmap &IaOraClient::captionPixmap() const { bool active = isActive(); @@ -464,34 +464,34 @@ const QPixmap &IaOraClient::captionPixmap() const // not found, create new pixmap... const uint maxCaptionLength = 300; // truncate captions longer than this! - QString c(caption() ); + TQString c(caption() ); if (c.length() > maxCaptionLength) { c.truncate(maxCaptionLength); c.append(" [...]"); } - QFontMetrics fm(s_titleFont); + TQFontMetrics fm(s_titleFont); int captionWidth = fm.width(c); int captionHeight = fm.height(); const int th = layoutMetric(LM_TitleHeight, false) + layoutMetric(LM_TitleEdgeBottom, false); - QPainter painter; + TQPainter painter; const int thickness = 2; - QPixmap *captionPixmap = new QPixmap(captionWidth+2*thickness, th); + TQPixmap *captionPixmap = new TQPixmap(captionWidth+2*thickness, th); painter.begin(captionPixmap); painter.drawTiledPixmap(captionPixmap->rect(), Handler()->pixmap(TitleBarTile, active, isToolWindow()) ); painter.setFont(s_titleFont); - QPoint tp(1, captionHeight-1); + TQPoint tp(1, captionHeight-1); // if(Handler()->titleShadow()) // { // painter.setPen(Handler()->getShadowColor()); -// painter.drawText(tp+QPoint(2,2), c); +// painter.drawText(tp+TQPoint(2,2), c); // } painter.setPen(Handler()->getColor(TitleFont,active) ); painter.drawText(tp, c ); |