diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2016-04-08 03:06:39 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2016-04-08 03:06:39 +0200 |
commit | 96603e8acb744f86139b900e45d030ad684b6a4d (patch) | |
tree | bc983a53582ffe8f32e3fa9320eff557f239ea01 /client/dominoclient.cpp | |
parent | 5d3112684ba2b692a07b0328ad308c402276e51e (diff) | |
download | tde-style-domino-96603e8acb744f86139b900e45d030ad684b6a4d.tar.gz tde-style-domino-96603e8acb744f86139b900e45d030ad684b6a4d.zip |
Initial TQt conversion
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'client/dominoclient.cpp')
-rw-r--r-- | client/dominoclient.cpp | 446 |
1 files changed, 223 insertions, 223 deletions
diff --git a/client/dominoclient.cpp b/client/dominoclient.cpp index 4fee0cd..c8b0c49 100644 --- a/client/dominoclient.cpp +++ b/client/dominoclient.cpp @@ -25,16 +25,16 @@ #include <kconfig.h> #include <kglobal.h> -#include <qlayout.h> -#include <qbitmap.h> -#include <qimage.h> -#include <qapplication.h> -#include <qlabel.h> -#include <qpixmap.h> +#include <tqlayout.h> +#include <tqbitmap.h> +#include <tqimage.h> +#include <tqapplication.h> +#include <tqlabel.h> +#include <tqpixmap.h> #include <X11/extensions/shape.h> -#include <qwmatrix.h> -#include <qpainter.h> -#include <qsettings.h> +#include <tqwmatrix.h> +#include <tqpainter.h> +#include <tqsettings.h> namespace Domino @@ -46,53 +46,53 @@ const int titleEdgeTop = 3; const int titleEdgeBottom = 1; static int titleHeight; -static QPixmap* buttonPix; -static QPixmap* buttonHidePix; -static QPixmap* titleBarPix; -static QPixmap* borderTopLeftPix; -static QPixmap* borderTopRightPix; -static QPixmap* borderBottomPix; -static QPixmap* borderBottomLeftPix; -static QPixmap* borderBottomRightPix; -static QPixmap* borderLeftPix; -static QPixmap* borderRightPix; - - -static QPixmap* closeButtonIcon; -static QPixmap* minButtonIcon; -static QPixmap* maxButtonIcon; -static QPixmap* helpButtonIcon; -static QPixmap* onAllDesktopsButtonIcon; -static QPixmap* shadeButtonIcon; -static QPixmap* aboveButtonIcon; -static QPixmap* belowButtonIcon; - -static QPixmap* pressedCloseButtonIcon; -static QPixmap* pressedMinButtonIcon; -static QPixmap* pressedMaxButtonIcon; -static QPixmap* pressedHelpButtonIcon; -static QPixmap* pressedOnAllDesktopsButtonIcon; -static QPixmap* pressedShadeButtonIcon; -static QPixmap* pressedAboveButtonIcon; -static QPixmap* pressedBelowButtonIcon; - -static QPixmap* mouseOverCloseButtonIcon; -static QPixmap* mouseOverMinButtonIcon; -static QPixmap* mouseOverMaxButtonIcon; -static QPixmap* mouseOverHelpButtonIcon; -static QPixmap* mouseOverOnAllDesktopsButtonIcon; -static QPixmap* mouseOverShadeButtonIcon; -static QPixmap* mouseOverAboveButtonIcon; -static QPixmap* mouseOverBelowButtonIcon; +static TQPixmap* buttonPix; +static TQPixmap* buttonHidePix; +static TQPixmap* titleBarPix; +static TQPixmap* borderTopLeftPix; +static TQPixmap* borderTopRightPix; +static TQPixmap* borderBottomPix; +static TQPixmap* borderBottomLeftPix; +static TQPixmap* borderBottomRightPix; +static TQPixmap* borderLeftPix; +static TQPixmap* borderRightPix; + + +static TQPixmap* closeButtonIcon; +static TQPixmap* minButtonIcon; +static TQPixmap* maxButtonIcon; +static TQPixmap* helpButtonIcon; +static TQPixmap* onAllDesktopsButtonIcon; +static TQPixmap* shadeButtonIcon; +static TQPixmap* aboveButtonIcon; +static TQPixmap* belowButtonIcon; + +static TQPixmap* pressedCloseButtonIcon; +static TQPixmap* pressedMinButtonIcon; +static TQPixmap* pressedMaxButtonIcon; +static TQPixmap* pressedHelpButtonIcon; +static TQPixmap* pressedOnAllDesktopsButtonIcon; +static TQPixmap* pressedShadeButtonIcon; +static TQPixmap* pressedAboveButtonIcon; +static TQPixmap* pressedBelowButtonIcon; + +static TQPixmap* mouseOverCloseButtonIcon; +static TQPixmap* mouseOverMinButtonIcon; +static TQPixmap* mouseOverMaxButtonIcon; +static TQPixmap* mouseOverHelpButtonIcon; +static TQPixmap* mouseOverOnAllDesktopsButtonIcon; +static TQPixmap* mouseOverShadeButtonIcon; +static TQPixmap* mouseOverAboveButtonIcon; +static TQPixmap* mouseOverBelowButtonIcon; static bool buttonInputShape; -static QBitmap* buttonShapeBitmap; +static TQBitmap* buttonShapeBitmap; -static QColor background; -static QColor topGradientColor; -static QColor bottomGradientColor; -static QColor topBorderGradientColor; -static QColor bottomBorderGradientColor; +static TQColor background; +static TQColor topGradientColor; +static TQColor bottomGradientColor; +static TQColor topBorderGradientColor; +static TQColor bottomBorderGradientColor; static bool showButtonIcons; static bool showInactiveButtons; @@ -106,8 +106,8 @@ DominoHandler::DominoHandler() { int ignore, maj, min; - if(XShapeQueryExtension(qt_xdisplay(), &ignore, &ignore) && - XShapeQueryVersion(qt_xdisplay(), &maj, &min) && + if(XShapeQueryExtension(tqt_xdisplay(), &ignore, &ignore) && + XShapeQueryVersion(tqt_xdisplay(), &maj, &min) && maj >= 1 && min >= 1) { buttonInputShape = true; @@ -159,8 +159,8 @@ unsigned long DominoHandler::readConfig( bool update ) KConfig conf("kwindominorc"); conf.setGroup("General"); - titleHeight = QMAX(QFontMetrics(options()->font(true)).height(), 16); - background = qApp->palette().active().background(); + titleHeight = TQMAX(TQFontMetrics(options()->font(true)).height(), 16); + background = tqApp->palette().active().background(); customBorderColor = conf.readBoolEntry("customBorderColor", true); borderColor = customBorderColor ? conf.readEntry("borderColor", "#777B7F") : background; @@ -174,10 +174,10 @@ unsigned long DominoHandler::readConfig( bool update ) darkLines = conf.readBoolEntry("darkFrame", false); if(!conf.readBoolEntry( "customGradientColors", false)) { - topGradientColor = alphaBlendColors(background, Qt::white, 180); - bottomGradientColor = alphaBlendColors(background, Qt::black, 230); - topBorderGradientColor = alphaBlendColors(borderColor, Qt::white, 180); - bottomBorderGradientColor = alphaBlendColors(borderColor, Qt::black, 230); + topGradientColor = alphaBlendColors(background, TQt::white, 180); + bottomGradientColor = alphaBlendColors(background, TQt::black, 230); + topBorderGradientColor = alphaBlendColors(borderColor, TQt::white, 180); + bottomBorderGradientColor = alphaBlendColors(borderColor, TQt::black, 230); } else { topGradientColor = conf.readEntry("topGradientColor", "#ffffff"); @@ -191,7 +191,7 @@ unsigned long DominoHandler::readConfig( bool update ) } if(conf.readBoolEntry("useDominoStyleContourColors", true)) { - QSettings s; + TQSettings s; buttonContourColor = s.readEntry("/domino/Settings/buttonContourColor", background.dark(250).name()); buttonMouseOverContourColor = s.readEntry("/domino/Settings/buttonMouseOverContourColor", background.dark(250).name()); buttonPressedContourColor = s.readEntry("/domino/Settings/buttonPressedContourColor", background.dark(250).name()); @@ -210,10 +210,10 @@ unsigned long DominoHandler::readConfig( bool update ) void DominoHandler::createPixmaps() { - QImage edges; - QImage topLines; - QImage rightLines; - QImage bottomLines; + TQImage edges; + TQImage topLines; + TQImage rightLines; + TQImage bottomLines; if(darkLines) { edges = qembed_findImage("client_edges_dark"); @@ -232,14 +232,14 @@ void DominoHandler::createPixmaps() int titleBarHeight = titleHeight+titleEdgeTop+titleEdgeBottom; - QWMatrix m; + TQWMatrix m; m.rotate(180); - titleBarPix = new QPixmap(QSize(10, titleBarHeight)); + titleBarPix = new TQPixmap(TQSize(10, titleBarHeight)); titleBarPix->fill(background); - QRect r(titleBarPix->rect()); - QPainter p(titleBarPix); - QRect rect(r.x(), r.y(), r.width(), titleGradientHeight); + TQRect r(titleBarPix->rect()); + TQPainter p(titleBarPix); + TQRect rect(r.x(), r.y(), r.width(), titleGradientHeight); renderGradient(&p, rect, topGradientColor, background, "titleBar"); p.drawPixmap(0, 0, topLines); p.end(); @@ -248,23 +248,23 @@ void DominoHandler::createPixmaps() ///////// borders // sides - QPixmap sideLinesRight = rightLines; + TQPixmap sideLinesRight = rightLines; - borderRightPix = new QPixmap(5, 10); + borderRightPix = new TQPixmap(5, 10); borderRightPix->fill(borderColor); p.begin(borderRightPix); p.drawPixmap(3, 0, sideLinesRight); p.end(); - borderLeftPix = new QPixmap(borderRightPix->xForm(m)); + borderLeftPix = new TQPixmap(borderRightPix->xForm(m)); // edges - borderTopLeftPix = new QPixmap(QSize(5, titleBarHeight)); + borderTopLeftPix = new TQPixmap(TQSize(5, titleBarHeight)); borderTopLeftPix->fill(borderColor); p.begin(borderTopLeftPix); - r = QRect(0, 0, 5, titleGradientHeight); + r = TQRect(0, 0, 5, titleGradientHeight); // if the gradient color is equal to the background color, we make the border also flat. renderGradient(&p, r, topGradientColor == background ? borderColor : topBorderGradientColor, borderColor, "borderTopLeftPix"); - borderTopRightPix = new QPixmap(*borderTopLeftPix); + borderTopRightPix = new TQPixmap(*borderTopLeftPix); p.drawPixmap(0, 1, edges, 0, 0, 5, 6); p.drawTiledPixmap(0, 7, 2, titleBarHeight, sideLinesRight.xForm(m)); p.end(); @@ -274,12 +274,12 @@ void DominoHandler::createPixmaps() p.end(); - borderBottomRightPix = new QPixmap(QSize(5, bottomBorderHeight)); + borderBottomRightPix = new TQPixmap(TQSize(5, bottomBorderHeight)); borderBottomRightPix->fill(borderColor); p.begin(borderBottomRightPix); - r = QRect(0, bottomBorderHeight-6, 5, 6); + r = TQRect(0, bottomBorderHeight-6, 5, 6); renderGradient(&p, r, borderColor, bottomGradientColor == background ? borderColor : bottomBorderGradientColor, "borderBottomRightPix"); - borderBottomLeftPix = new QPixmap(*borderBottomRightPix); + borderBottomLeftPix = new TQPixmap(*borderBottomRightPix); p.drawPixmap(0, bottomBorderHeight-7, edges, 5, 6, 5, 6); p.drawPixmap(3, 0, sideLinesRight, 0, 0, 2, borderBottomLeftPix->height()-7); p.end(); @@ -290,10 +290,10 @@ void DominoHandler::createPixmaps() p.drawPixmap(0, 0, sideLinesRight.xForm(m), 0, 0, 2, borderBottomLeftPix->height()-7); p.end(); - borderBottomPix = new QPixmap(QSize(10, bottomBorderHeight)); + borderBottomPix = new TQPixmap(TQSize(10, bottomBorderHeight)); borderBottomPix->fill(background); p.begin(borderBottomPix); - r = QRect(0, bottomBorderHeight-6, 10, 6); + r = TQRect(0, bottomBorderHeight-6, 10, 6); renderGradient(&p, r, background, bottomGradientColor, "borderBottom"); p.drawPixmap(0, bottomBorderHeight-2, bottomLines); p.end(); @@ -304,42 +304,42 @@ void DominoHandler::createPixmaps() //////////////////////////////////////////////////////////////////////// if(buttonInputShape) { - QRegion buttonClip(6,2,6,1); - buttonClip += QRegion(5,3,8,1); - buttonClip += QRegion(4,4,10,1); - buttonClip += QRegion(3,5,12,1); - buttonClip += QRegion(2,6,14,6); - buttonClip += QRegion(3,12,12,1); - buttonClip += QRegion(4,13,10,1); - buttonClip += QRegion(5,14,8,1); - buttonClip += QRegion(6,15,6,1); + TQRegion buttonClip(6,2,6,1); + buttonClip += TQRegion(5,3,8,1); + buttonClip += TQRegion(4,4,10,1); + buttonClip += TQRegion(3,5,12,1); + buttonClip += TQRegion(2,6,14,6); + buttonClip += TQRegion(3,12,12,1); + buttonClip += TQRegion(4,13,10,1); + buttonClip += TQRegion(5,14,8,1); + buttonClip += TQRegion(6,15,6,1); - buttonShapeBitmap = new QBitmap(16, titleBarHeight, true); - QPainter p(buttonShapeBitmap); + buttonShapeBitmap = new TQBitmap(16, titleBarHeight, true); + TQPainter p(buttonShapeBitmap); p.setClipRegion(buttonClip); - p.fillRect(QRect(0, 0, 16, titleBarHeight), Qt::color1); + p.fillRect(TQRect(0, 0, 16, titleBarHeight), TQt::color1); } - QPixmap* buttonShadow = new QPixmap(qembed_findImage("clientButtonShadow")); - QPixmap* buttonPressed = new QPixmap(qembed_findImage("clientButtonPressed")); + TQPixmap* buttonShadow = new TQPixmap(qembed_findImage("clientButtonShadow")); + TQPixmap* buttonPressed = new TQPixmap(qembed_findImage("clientButtonPressed")); - buttonPix = new QPixmap(QSize(16, titleBarHeight)); + buttonPix = new TQPixmap(TQSize(16, titleBarHeight)); p.begin(buttonPix); p.drawTiledPixmap(0, 0, titleBarHeight, titleBarHeight, *titleBarPix, 0, titleEdgeTop); //////////// custom color - r = QRect(buttonPix->rect()); - QRegion buttonClip(5,2,6,1); - buttonClip += QRegion(4,3,8,1); - buttonClip += QRegion(3,4,10,1); - buttonClip += QRegion(2,5,12,6); - buttonClip += QRegion(3,11,10,1); - buttonClip += QRegion(4,12,8,1); - buttonClip += QRegion(5,13,6,1); + r = TQRect(buttonPix->rect()); + TQRegion buttonClip(5,2,6,1); + buttonClip += TQRegion(4,3,8,1); + buttonClip += TQRegion(3,4,10,1); + buttonClip += TQRegion(2,5,12,6); + buttonClip += TQRegion(3,11,10,1); + buttonClip += TQRegion(4,12,8,1); + buttonClip += TQRegion(5,13,6,1); p.setClipRegion(buttonClip); - p.fillRect(QRect(0, 0, r.width(), r.height()), buttonColor); - QRect gr(0, -3, r.width(), titleGradientHeight); + p.fillRect(TQRect(0, 0, r.width(), r.height()), buttonColor); + TQRect gr(0, -3, r.width(), titleGradientHeight); renderGradient(&p, gr, topGradientColor, buttonColor, "titleBar"); p.setClipping(false); /////////// @@ -347,14 +347,14 @@ void DominoHandler::createPixmaps() p.end(); - QPixmap* pressedButtonPix = new QPixmap(*buttonPix); + TQPixmap* pressedButtonPix = new TQPixmap(*buttonPix); p.begin(pressedButtonPix); p.drawPixmap(0, 0, tintImage(qembed_findImage("clientButtonContour"), buttonPressedContourColor)); p.drawPixmap(0, 0, *buttonPressed); p.end(); - QPixmap* mouseOverButtonPix = new QPixmap(*buttonPix); + TQPixmap* mouseOverButtonPix = new TQPixmap(*buttonPix); p.begin(mouseOverButtonPix); p.drawPixmap(0, 0, tintImage(qembed_findImage("clientButtonContour"), buttonMouseOverContourColor)); p.end(); @@ -365,7 +365,7 @@ void DominoHandler::createPixmaps() p.end(); - buttonHidePix = new QPixmap(QSize(buttonPix->width(), titleBarHeight)); + buttonHidePix = new TQPixmap(TQSize(buttonPix->width(), titleBarHeight)); p.begin(buttonHidePix); p.drawTiledPixmap(0, 0, buttonHidePix->width(), buttonHidePix->height(), *titleBarPix, 0, titleEdgeTop); p.end(); @@ -376,75 +376,75 @@ void DominoHandler::createPixmaps() ///////// icons /////////////////////////////////////////////////////////////////////// - QPixmap* icon = new QPixmap(customButtonIconColor ? tintImage(qembed_findImage("closeButtonIcon"), buttonIconColor) : qembed_findImage("closeButtonIcon")); - closeButtonIcon = new QPixmap(*buttonPix); + TQPixmap* icon = new TQPixmap(customButtonIconColor ? tintImage(qembed_findImage("closeButtonIcon"), buttonIconColor) : qembed_findImage("closeButtonIcon")); + closeButtonIcon = new TQPixmap(*buttonPix); bitBlt(closeButtonIcon, 5, 5, icon); - pressedCloseButtonIcon = new QPixmap(*pressedButtonPix); + pressedCloseButtonIcon = new TQPixmap(*pressedButtonPix); bitBlt(pressedCloseButtonIcon, 5, 5, icon); - mouseOverCloseButtonIcon = new QPixmap(*mouseOverButtonPix); + mouseOverCloseButtonIcon = new TQPixmap(*mouseOverButtonPix); bitBlt(mouseOverCloseButtonIcon, 5, 5, icon); delete icon; - icon = new QPixmap(customButtonIconColor ? tintImage(qembed_findImage("maxButtonIcon"), buttonIconColor) : qembed_findImage("maxButtonIcon")); - maxButtonIcon = new QPixmap(*buttonPix); + icon = new TQPixmap(customButtonIconColor ? tintImage(qembed_findImage("maxButtonIcon"), buttonIconColor) : qembed_findImage("maxButtonIcon")); + maxButtonIcon = new TQPixmap(*buttonPix); bitBlt(maxButtonIcon, 4, 4, icon); - pressedMaxButtonIcon = new QPixmap(*pressedButtonPix); + pressedMaxButtonIcon = new TQPixmap(*pressedButtonPix); bitBlt(pressedMaxButtonIcon, 4, 4, icon); - mouseOverMaxButtonIcon = new QPixmap(*mouseOverButtonPix); + mouseOverMaxButtonIcon = new TQPixmap(*mouseOverButtonPix); bitBlt(mouseOverMaxButtonIcon, 4, 4, icon); delete icon; - icon = new QPixmap(customButtonIconColor ? tintImage(qembed_findImage("minButtonIcon"), buttonIconColor) : qembed_findImage("minButtonIcon")); - minButtonIcon = new QPixmap(*buttonPix); + icon = new TQPixmap(customButtonIconColor ? tintImage(qembed_findImage("minButtonIcon"), buttonIconColor) : qembed_findImage("minButtonIcon")); + minButtonIcon = new TQPixmap(*buttonPix); bitBlt(minButtonIcon, 5, 9, icon); - pressedMinButtonIcon = new QPixmap(*pressedButtonPix); + pressedMinButtonIcon = new TQPixmap(*pressedButtonPix); bitBlt(pressedMinButtonIcon, 5, 9, icon); - mouseOverMinButtonIcon = new QPixmap(*mouseOverButtonPix); + mouseOverMinButtonIcon = new TQPixmap(*mouseOverButtonPix); bitBlt(mouseOverMinButtonIcon, 5, 9, icon); delete icon; - icon = new QPixmap(customButtonIconColor ? tintImage(qembed_findImage("helpButtonIcon"), buttonIconColor) : qembed_findImage("helpButtonIcon")); - helpButtonIcon = new QPixmap(*buttonPix); + icon = new TQPixmap(customButtonIconColor ? tintImage(qembed_findImage("helpButtonIcon"), buttonIconColor) : qembed_findImage("helpButtonIcon")); + helpButtonIcon = new TQPixmap(*buttonPix); bitBlt(helpButtonIcon, 5, 4, icon); - pressedHelpButtonIcon = new QPixmap(*pressedButtonPix); + pressedHelpButtonIcon = new TQPixmap(*pressedButtonPix); bitBlt(pressedHelpButtonIcon, 5, 4, icon); - mouseOverHelpButtonIcon = new QPixmap(*mouseOverButtonPix); + mouseOverHelpButtonIcon = new TQPixmap(*mouseOverButtonPix); bitBlt(mouseOverHelpButtonIcon, 5, 4, icon); delete icon; - icon = new QPixmap(customButtonIconColor ? tintImage(qembed_findImage("onAllDesktopsButtonIcon"), buttonIconColor) : qembed_findImage("onAllDesktopsButtonIcon")); - onAllDesktopsButtonIcon = new QPixmap(*buttonPix); + icon = new TQPixmap(customButtonIconColor ? tintImage(qembed_findImage("onAllDesktopsButtonIcon"), buttonIconColor) : qembed_findImage("onAllDesktopsButtonIcon")); + onAllDesktopsButtonIcon = new TQPixmap(*buttonPix); bitBlt(onAllDesktopsButtonIcon, 6, 6, icon); - pressedOnAllDesktopsButtonIcon = new QPixmap(*pressedButtonPix); + pressedOnAllDesktopsButtonIcon = new TQPixmap(*pressedButtonPix); bitBlt(pressedOnAllDesktopsButtonIcon, 6, 6, icon); - mouseOverOnAllDesktopsButtonIcon = new QPixmap(*mouseOverButtonPix); + mouseOverOnAllDesktopsButtonIcon = new TQPixmap(*mouseOverButtonPix); bitBlt(mouseOverOnAllDesktopsButtonIcon, 6, 6, icon); delete icon; - icon = new QPixmap(customButtonIconColor ? tintImage(qembed_findImage("aboveButtonIcon"), buttonIconColor) : qembed_findImage("aboveButtonIcon")); - aboveButtonIcon = new QPixmap(*buttonPix); + icon = new TQPixmap(customButtonIconColor ? tintImage(qembed_findImage("aboveButtonIcon"), buttonIconColor) : qembed_findImage("aboveButtonIcon")); + aboveButtonIcon = new TQPixmap(*buttonPix); bitBlt(aboveButtonIcon, 5, 4, icon); - pressedAboveButtonIcon = new QPixmap(*pressedButtonPix); + pressedAboveButtonIcon = new TQPixmap(*pressedButtonPix); bitBlt(pressedAboveButtonIcon, 5, 4, icon); - mouseOverAboveButtonIcon = new QPixmap(*mouseOverButtonPix); + mouseOverAboveButtonIcon = new TQPixmap(*mouseOverButtonPix); bitBlt(mouseOverAboveButtonIcon, 5, 4, icon); delete icon; - icon = new QPixmap(customButtonIconColor ? tintImage(qembed_findImage("aboveButtonIcon").xForm(m), buttonIconColor) : qembed_findImage("aboveButtonIcon").xForm(m)); - belowButtonIcon = new QPixmap(*buttonPix); + icon = new TQPixmap(customButtonIconColor ? tintImage(qembed_findImage("aboveButtonIcon").xForm(m), buttonIconColor) : qembed_findImage("aboveButtonIcon").xForm(m)); + belowButtonIcon = new TQPixmap(*buttonPix); bitBlt(belowButtonIcon, 5, 4, icon); - pressedBelowButtonIcon = new QPixmap(*pressedButtonPix); + pressedBelowButtonIcon = new TQPixmap(*pressedButtonPix); bitBlt(pressedBelowButtonIcon, 5, 4, icon); - mouseOverBelowButtonIcon = new QPixmap(*mouseOverButtonPix); + mouseOverBelowButtonIcon = new TQPixmap(*mouseOverButtonPix); bitBlt(mouseOverBelowButtonIcon, 5, 4, icon); delete icon; - icon = new QPixmap(customButtonIconColor ? tintImage(qembed_findImage("minButtonIcon"), buttonIconColor) : qembed_findImage("minButtonIcon")); - shadeButtonIcon = new QPixmap(*buttonPix); + icon = new TQPixmap(customButtonIconColor ? tintImage(qembed_findImage("minButtonIcon"), buttonIconColor) : qembed_findImage("minButtonIcon")); + shadeButtonIcon = new TQPixmap(*buttonPix); bitBlt(shadeButtonIcon, 5, 5, icon); - pressedShadeButtonIcon = new QPixmap(*pressedButtonPix); + pressedShadeButtonIcon = new TQPixmap(*pressedButtonPix); bitBlt(pressedShadeButtonIcon, 5, 5, icon); - mouseOverShadeButtonIcon = new QPixmap(*mouseOverButtonPix); + mouseOverShadeButtonIcon = new TQPixmap(*mouseOverButtonPix); bitBlt(mouseOverShadeButtonIcon, 5, 5, icon); delete icon; @@ -531,7 +531,7 @@ DominoButton::DominoButton(ButtonType type, DominoClient *parent, const char *na client = parent; #ifdef ShapeInput if(buttonInputShape && buttonShapeBitmap ) { - XShapeCombineMask (qt_xdisplay(), + XShapeCombineMask (tqt_xdisplay(), winId(), ShapeInput, 0, @@ -551,7 +551,7 @@ DominoButton::~DominoButton() void DominoButton::reset(unsigned long changed) { if (changed&SizeChange || changed&ManualReset) { - setBackgroundOrigin(QWidget::WidgetOrigin); + setBackgroundOrigin(TQWidget::WidgetOrigin); setErasePixmap(showInactiveButtons ? *buttonPix : *buttonHidePix); } @@ -564,7 +564,7 @@ void DominoButton::reset(unsigned long changed) } -void DominoButton::drawButton(QPainter *p) +void DominoButton::drawButton(TQPainter *p) { if (!Domino_initialized) return; @@ -610,7 +610,7 @@ void DominoButton::drawButton(QPainter *p) -void DominoButton::enterEvent(QEvent */*e*/) +void DominoButton::enterEvent(TQEvent */*e*/) { if(!client->isActive() && !showInactiveButtons) @@ -621,7 +621,7 @@ void DominoButton::enterEvent(QEvent */*e*/) } -void DominoButton::leaveEvent(QEvent */*e*/) +void DominoButton::leaveEvent(TQEvent */*e*/) { isMouseOver=false; repaint(false); @@ -649,17 +649,17 @@ DominoClient::~DominoClient() delete borderBottom; } -QString DominoClient::visibleName() const +TQString DominoClient::visibleName() const { return "Domino"; } -QString DominoClient::defaultButtonsLeft() const +TQString DominoClient::defaultButtonsLeft() const { return "MF"; } -QString DominoClient::defaultButtonsRight() const +TQString DominoClient::defaultButtonsRight() const { return "HIAX"; } @@ -776,7 +776,7 @@ void DominoClient::init() menuButton = 0; globalMouseTracking = false; titleBarMouseOver = false; - QWidget* w = new QWidget(KDecoration::initialParentWidget(), "clientMainWidget", WNoAutoErase|WStaticContents); + TQWidget* w = new TQWidget(KDecoration::initialParentWidget(), "clientMainWidget", WNoAutoErase|WStaticContents); setMainWidget(w); widget()->setBackgroundMode(NoBackground); @@ -794,48 +794,48 @@ void DominoClient::createLayout() int titleBarHeight = titleHeight+titleEdgeTop+titleEdgeBottom; - mainlayout = new QGridLayout(widget(), 3, 3, 0); + mainlayout = new TQGridLayout(widget(), 3, 3, 0); titleBar = new TitleBar(widget(), "titlebar"); titleBar->client = this; titleBar->setMouseTracking(true); - borderTopLeft = new QWidget(widget(), "borderTopLeft", Qt::WNoAutoErase); + borderTopLeft = new TQWidget(widget(), "borderTopLeft", TQt::WNoAutoErase); borderTopLeft->setMouseTracking(true); - borderTopRight = new QWidget(widget(), "borderTopRight", Qt::WNoAutoErase); + borderTopRight = new TQWidget(widget(), "borderTopRight", TQt::WNoAutoErase); borderTopRight->setMouseTracking(true); - borderBottomLeft = new QWidget(widget(), "borderBottomLeft", Qt::WNoAutoErase); + borderBottomLeft = new TQWidget(widget(), "borderBottomLeft", TQt::WNoAutoErase); borderBottomLeft->setMouseTracking(true); - borderBottomRight = new QWidget(widget(), "borderBottomRight", Qt::WNoAutoErase); + borderBottomRight = new TQWidget(widget(), "borderBottomRight", TQt::WNoAutoErase); borderBottomRight->setMouseTracking(true); - borderLeft = new QWidget(widget(), "borderLeft", Qt::WNoAutoErase); + borderLeft = new TQWidget(widget(), "borderLeft", TQt::WNoAutoErase); borderLeft->setMouseTracking(true); - borderRight = new QWidget(widget(), "borderRight", Qt::WNoAutoErase); + borderRight = new TQWidget(widget(), "borderRight", TQt::WNoAutoErase); borderRight->setMouseTracking(true); - borderBottom = new QWidget(widget(), "borderBottom", Qt::WNoAutoErase); + borderBottom = new TQWidget(widget(), "borderBottom", TQt::WNoAutoErase); borderBottom->setMouseTracking(true); titleBar->setFixedHeight(titleBarHeight); - titleBar->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + titleBar->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Fixed); borderTopLeft->setFixedSize(borderWidth, titleBarHeight); borderTopRight->setFixedSize(borderWidth, titleBarHeight); borderLeft->setFixedWidth(borderWidth); - borderLeft->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); + borderLeft->setSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Expanding); borderRight->setFixedWidth(borderWidth); - borderRight->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); + borderRight->setSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Expanding); borderBottomLeft->setFixedSize(borderWidth, bottomBorderHeight); borderBottomRight->setFixedSize(borderWidth, bottomBorderHeight); borderBottom->setFixedHeight(bottomBorderHeight); - borderBottom->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + borderBottom->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Fixed); mainlayout->addWidget(titleBar, 0,1); mainlayout->addWidget(borderTopLeft, 0,0); mainlayout->addWidget(borderTopRight, 0,2); mainlayout->addWidget(borderLeft, 1,0); - mainlayout->addItem(new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Expanding)); + mainlayout->addItem(new TQSpacerItem(1, 1, TQSizePolicy::Expanding, TQSizePolicy::Expanding)); mainlayout->addWidget(borderRight, 1,2); mainlayout->addWidget(borderBottomLeft, 2,0); @@ -883,38 +883,38 @@ void DominoClient::updateMask() clearMask(); return; } - QRect r(widget()->rect()); + TQRect r(widget()->rect()); - QRegion mask(r.x()+5, r.y(), r.width()-10, r.height()); - mask += QRect(r.x()+3, r.y()+1, r.width()-6, r.height()-2); - mask += QRect(r.x()+2, r.y()+2, r.width()-4, r.height()-4); - mask += QRect(r.x()+1, r.y()+3, r.width()-2, r.height()-6); - mask += QRect(r.x(), r.y()+5, r.width(), r.height()-10); + TQRegion mask(r.x()+5, r.y(), r.width()-10, r.height()); + mask += TQRect(r.x()+3, r.y()+1, r.width()-6, r.height()-2); + mask += TQRect(r.x()+2, r.y()+2, r.width()-4, r.height()-4); + mask += TQRect(r.x()+1, r.y()+3, r.width()-2, r.height()-6); + mask += TQRect(r.x(), r.y()+5, r.width(), r.height()-10); setMask(mask); } void DominoClient::updateCaption() { - QRect r(titleBar->rect()); + TQRect r(titleBar->rect()); - QPixmap* titleBar_pix = new QPixmap(r.size()); - QPainter painter(titleBar_pix); + TQPixmap* titleBar_pix = new TQPixmap(r.size()); + TQPainter painter(titleBar_pix); painter.drawTiledPixmap(0, 0, r.width(), r.height(), *titleBarPix); int lw = buttonsLeftWidth()+3; int rw = buttonsRightWidth(); painter.setFont(options()->font(true,false)); - QFontMetrics fm = painter.fontMetrics(); + TQFontMetrics fm = painter.fontMetrics(); int captionWidth = fm.width(caption()); int titleWidth = titleBar->width()-(lw+rw); - QRect re(titleWidth > captionWidth ? (titleWidth-captionWidth)/2+lw : lw, 0, titleWidth, r.height()); + TQRect re(titleWidth > captionWidth ? (titleWidth-captionWidth)/2+lw : lw, 0, titleWidth, r.height()); painter.setClipRect(re); painter.setPen(options()->color(KDecorationDefines::ColorFont, isActive())); - painter.drawText(QRect(lw, r.y(), r.width()-(rw+lw), r.height()), titleWidth > captionWidth ? Qt::AlignCenter : Qt::AlignLeft|Qt::AlignVCenter, caption()); + painter.drawText(TQRect(lw, r.y(), r.width()-(rw+lw), r.height()), titleWidth > captionWidth ? TQt::AlignCenter : TQt::AlignLeft|TQt::AlignVCenter, caption()); painter.end(); titleBar->setErasePixmap(*titleBar_pix); @@ -931,10 +931,10 @@ void DominoClient::activeChange() void DominoClient::iconChange() { if(menuButton) { - QPixmap pix(*buttonHidePix); - QPixmap icon = KDecoration::icon().pixmap(QIconSet::Small, QIconSet::Normal); + TQPixmap pix(*buttonHidePix); + TQPixmap icon = KDecoration::icon().pixmap(TQIconSet::Small, TQIconSet::Normal); if(!icon.isNull()) - bitBlt(&pix, 0, 0, &icon, 0, 0, -1, -1, Qt::CopyROP); + bitBlt(&pix, 0, 0, &icon, 0, 0, -1, -1, TQt::CopyROP); menuButton->setErasePixmap(pix); } @@ -982,7 +982,7 @@ void DominoClient::shadeChange() } -void DominoClient::resize( const QSize& s ) +void DominoClient::resize( const TQSize& s ) { widget()->resize( s ); if(maximizeMode() == MaximizeFull && !options()->moveResizeMaximizedWindows()) { @@ -1004,7 +1004,7 @@ void DominoClient::resize( const QSize& s ) } -void DominoClient::resizeEvent( QResizeEvent* ev ) +void DominoClient::resizeEvent( TQResizeEvent* ev ) { if (!Domino_initialized || ev->size() == ev->oldSize()) @@ -1018,45 +1018,45 @@ void DominoClient::updateWindowShape() { } -void DominoClient::showEvent(QShowEvent *) +void DominoClient::showEvent(TQShowEvent *) { } -void DominoClient::paintEvent( QPaintEvent* ) +void DominoClient::paintEvent( TQPaintEvent* ) { } -bool DominoClient::eventFilter(QObject*, QEvent* e) +bool DominoClient::eventFilter(TQObject*, TQEvent* e) { switch(e->type()) { - case QEvent::Resize: - resizeEvent(static_cast<QResizeEvent*>(e)); + case TQEvent::Resize: + resizeEvent(static_cast<TQResizeEvent*>(e)); return true; - case QEvent::ApplicationPaletteChange: + case TQEvent::ApplicationPaletteChange: return false; - case QEvent::Paint: - paintEvent(static_cast<QPaintEvent*>(e)); + case TQEvent::Paint: + paintEvent(static_cast<TQPaintEvent*>(e)); return true; - case QEvent::MouseButtonDblClick: - mouseDoubleClickEvent(static_cast<QMouseEvent*>(e)); + case TQEvent::MouseButtonDblClick: + mouseDoubleClickEvent(static_cast<TQMouseEvent*>(e)); return true; - case QEvent::Wheel: + case TQEvent::Wheel: if(titleBar->hasMouse() || isSetShade()) - wheelEvent(static_cast<QWheelEvent*>(e)); + wheelEvent(static_cast<TQWheelEvent*>(e)); return true; - case QEvent::MouseButtonPress: - processMousePressEvent(static_cast<QMouseEvent*>(e)); + case TQEvent::MouseButtonPress: + processMousePressEvent(static_cast<TQMouseEvent*>(e)); return true; - case QEvent::Show: + case TQEvent::Show: return true; - case QEvent::Enter: + case TQEvent::Enter: updateButtons(); return true; - case QEvent::Leave: + case TQEvent::Leave: if(globalMouseTracking && !showInactiveButtons) { globalMouseTracking = false; - qApp->setGlobalMouseTracking( false ); - qApp->removeEventFilter(titleBar); + tqApp->setGlobalMouseTracking( false ); + tqApp->removeEventFilter(titleBar); titleBarMouseOver = false; } updateButtons(); @@ -1068,13 +1068,13 @@ bool DominoClient::eventFilter(QObject*, QEvent* e) } -void TitleBar::enterEvent(QEvent*) +void TitleBar::enterEvent(TQEvent*) { if(!client->isActive() && !showInactiveButtons) { if(!client->globalMouseTracking) { client->globalMouseTracking = true; - qApp->setGlobalMouseTracking( true ); - qApp->installEventFilter(this); + tqApp->setGlobalMouseTracking( true ); + tqApp->installEventFilter(this); client->titleBarMouseOver = true; client->updateButtons(); } @@ -1082,11 +1082,11 @@ void TitleBar::enterEvent(QEvent*) } -bool TitleBar::eventFilter(QObject*o, QEvent* e) { +bool TitleBar::eventFilter(TQObject*o, TQEvent* e) { - if(e->type() == QEvent::MouseMove && !showInactiveButtons && !client->isActive()) { - QPoint pos = ((QMouseEvent*)e)->pos(); - if((dynamic_cast<QWidget*>(o) && geometry().contains(pos)) || dynamic_cast<QButton*>(o)) { + if(e->type() == TQEvent::MouseMove && !showInactiveButtons && !client->isActive()) { + TQPoint pos = ((TQMouseEvent*)e)->pos(); + if((dynamic_cast<TQWidget*>(o) && geometry().contains(pos)) || dynamic_cast<TQButton*>(o)) { client->titleBarMouseOver = true; } else { @@ -1101,16 +1101,16 @@ bool TitleBar::eventFilter(QObject*o, QEvent* e) { ///////////// -void renderGradient(QPainter *painter, QRect &rect, - QColor &c1, QColor &c2, const char* /*name*/) +void renderGradient(TQPainter *painter, TQRect &rect, + TQColor &c1, TQColor &c2, const char* /*name*/) { if((rect.width() <= 0)||(rect.height() <= 0)) return; - QPixmap *result; + TQPixmap *result; - result = new QPixmap(10, rect.height()); - QPainter p(result); + result = new TQPixmap(10, rect.height()); + TQPainter p(result); int r_h = result->rect().height(); int r_x, r_y, r_x2, r_y2; @@ -1138,7 +1138,7 @@ void renderGradient(QPainter *painter, QRect &rect, rl += rdelta; gl += gdelta; bl += bdelta; - p.setPen(QColor(rl>>16, gl>>16, bl>>16)); + p.setPen(TQColor(rl>>16, gl>>16, bl>>16)); p.drawLine(r_x, r_y+y, r_x2, r_y+y); } p.end(); @@ -1149,34 +1149,34 @@ void renderGradient(QPainter *painter, QRect &rect, } -QColor alphaBlendColors(const QColor &bgColor, const QColor &fgColor, const int a) +TQColor alphaBlendColors(const TQColor &bgColor, const TQColor &fgColor, const int a) { - QRgb rgb = bgColor.rgb(); - QRgb rgb_b = fgColor.rgb(); + TQRgb rgb = bgColor.rgb(); + TQRgb rgb_b = fgColor.rgb(); int alpha = a; if(alpha>255) alpha = 255; if(alpha<0) alpha = 0; int inv_alpha = 255 - alpha; - QColor result = QColor( qRgb(qRed(rgb_b)*inv_alpha/255 + qRed(rgb)*alpha/255, - qGreen(rgb_b)*inv_alpha/255 + qGreen(rgb)*alpha/255, - qBlue(rgb_b)*inv_alpha/255 + qBlue(rgb)*alpha/255) ); + TQColor result = TQColor( tqRgb(tqRed(rgb_b)*inv_alpha/255 + tqRed(rgb)*alpha/255, + tqGreen(rgb_b)*inv_alpha/255 + tqGreen(rgb)*alpha/255, + tqBlue(rgb_b)*inv_alpha/255 + tqBlue(rgb)*alpha/255) ); return result; } -QImage tintImage(const QImage &img, const QColor &tintColor) { +TQImage tintImage(const TQImage &img, const TQColor &tintColor) { - QImage *result = new QImage(img.width(), img.height(), 32, 0, QImage::IgnoreEndian); + TQImage *result = new TQImage(img.width(), img.height(), 32, 0, TQImage::IgnoreEndian); unsigned int *data = (unsigned int*) img.bits(); unsigned int *resultData = (unsigned int*) result->bits(); result->setAlphaBuffer( true ); int alpha; int total = img.width()*img.height(); for ( int current = 0 ; current < total ; ++current ) { - alpha = qAlpha( data[ current ] ); - resultData[ current ] = qRgba( tintColor.red(), tintColor.green(), tintColor.blue(), alpha ); + alpha = tqAlpha( data[ current ] ); + resultData[ current ] = tqRgba( tintColor.red(), tintColor.green(), tintColor.blue(), alpha ); } return *result; } |