diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/SUSE2.cpp | 66 | ||||
-rw-r--r-- | src/SUSE2.h | 32 | ||||
-rw-r--r-- | src/SUSE2button.cpp | 184 | ||||
-rw-r--r-- | src/SUSE2button.h | 34 | ||||
-rw-r--r-- | src/SUSE2client.cpp | 158 | ||||
-rw-r--r-- | src/SUSE2client.h | 22 | ||||
-rw-r--r-- | src/config/Makefile.in | 2 | ||||
-rw-r--r-- | src/config/config.cpp | 92 | ||||
-rw-r--r-- | src/config/config.h | 14 | ||||
-rw-r--r-- | src/config/configdialog.ui | 86 | ||||
-rw-r--r-- | src/misc.cpp | 30 | ||||
-rw-r--r-- | src/misc.h | 6 | ||||
-rw-r--r-- | src/shadow.cpp | 14 | ||||
-rw-r--r-- | src/shadow.h | 10 |
14 files changed, 375 insertions, 375 deletions
diff --git a/src/SUSE2.cpp b/src/SUSE2.cpp index 971d146..570309b 100644 --- a/src/SUSE2.cpp +++ b/src/SUSE2.cpp @@ -24,8 +24,8 @@ //#include <kdebug.h> -#include <qpainter.h> -#include <qbitmap.h> +#include <tqpainter.h> +#include <tqbitmap.h> #include <kconfig.h> #include <klocale.h> @@ -45,7 +45,7 @@ namespace KWinSUSE2 SUSE2Handler::SUSE2Handler() { - memset(m_pixmaps, 0, sizeof(QPixmap *) * NumButtonStatus * NumButtonIcons); // set elements to 0 + memset(m_pixmaps, 0, sizeof(TQPixmap *) * NumButtonStatus * NumButtonIcons); // set elements to 0 KGlobal::locale()->insertCatalogue("kwin_clients"); KGlobal::locale()->insertCatalogue("kwin_SUSE2"); @@ -92,7 +92,7 @@ bool SUSE2Handler::reset(unsigned long /*changed*/) } // check if we are in reverse layout mode - m_reverse = QApplication::reverseLayout(); + m_reverse = TQApplication::reverseLayout(); // read in the configuration readConfig(); @@ -144,12 +144,12 @@ void SUSE2Handler::readConfig() config.setGroup("General"); // grab settings - QString alignValue = config.readEntry("TitleAlignment", "AlignLeft"); - if (alignValue == "AlignLeft") m_titleAlign = Qt::AlignLeft; - else if (alignValue == "AlignHCenter") m_titleAlign = Qt::AlignHCenter; - else if (alignValue == "AlignRight") m_titleAlign = Qt::AlignRight; + TQString alignValue = config.readEntry("TitleAlignment", "AlignLeft"); + if (alignValue == "AlignLeft") m_titleAlign = TQt::AlignLeft; + else if (alignValue == "AlignHCenter") m_titleAlign = TQt::AlignHCenter; + else if (alignValue == "AlignRight") m_titleAlign = TQt::AlignRight; - QString roundValue = config.readEntry("RoundCorners", "NotMaximized"); + TQString roundValue = config.readEntry("RoundCorners", "NotMaximized"); if (roundValue == "RoundAlways") m_roundCorners = 1; else if (roundValue == "NotMaximized") m_roundCorners = 2; else if (roundValue == "RoundNever") m_roundCorners = 3; @@ -157,13 +157,13 @@ void SUSE2Handler::readConfig() m_menuClose = config.readBoolEntry("CloseOnMenuDoubleClick", true); m_titleShadow = config.readBoolEntry("TitleShadow", true); - QFontMetrics fm(m_titleFont); // active font = inactive font + TQFontMetrics fm(m_titleFont); // active font = inactive font int addSpace = config.readNumEntry("AddSpace", 4); // The title should stretch with bigger font sizes! - m_titleHeight = QMAX(16, fm.height() + addSpace); + m_titleHeight = TQMAX(16, fm.height() + addSpace); - fm = QFontMetrics(m_titleFontTool); // active font = inactive font - m_titleHeightTool = QMAX(13, fm.height() ); // don't care about the shadow etc. + fm = TQFontMetrics(m_titleFontTool); // active font = inactive font + m_titleHeightTool = TQMAX(13, fm.height() ); // don't care about the shadow etc. m_titlebarStyle = config.readNumEntry("TitleBarStyle", 0); @@ -174,13 +174,13 @@ void SUSE2Handler::readConfig() m_redCloseButton = config.readBoolEntry("RedCloseButton", false); m_iconSize = (config.readNumEntry("IconSize", 45))/100.0; m_customIconColors = config.readBoolEntry("CustomIconColors", false); - QColor afgcolor = QColor(10, 20, 40); + TQColor afgcolor = TQColor(10, 20, 40); m_aFgColor = config.readColorEntry("AFgColor", &afgcolor); - QColor abgcolor = QColor(210, 220, 240); + TQColor abgcolor = TQColor(210, 220, 240); m_aBgColor = config.readColorEntry("ABgColor", &abgcolor); - QColor ifgcolor = QColor(40, 40, 40); + TQColor ifgcolor = TQColor(40, 40, 40); m_iFgColor = config.readColorEntry("IFgColor", &ifgcolor); - QColor ibgcolor = QColor(240, 240, 240); + TQColor ibgcolor = TQColor(240, 240, 240); m_iBgColor = config.readColorEntry("IBgColor", &ibgcolor); m_iconShadow = config.readBoolEntry("IconShadow", false); @@ -189,7 +189,7 @@ void SUSE2Handler::readConfig() m_titleLogoURL = config.readEntry("TitleBarLogoURL", locate("data", "kwin/pics/titlebar_decor.png")); } -QColor SUSE2Handler::getColor(KWinSUSE2::ColorType type, const bool active) const +TQColor SUSE2Handler::getColor(KWinSUSE2::ColorType type, const bool active) const { switch (type) { case TitleGradientFrom: @@ -209,16 +209,16 @@ QColor SUSE2Handler::getColor(KWinSUSE2::ColorType type, const bool active) cons return KDecoration::options()->color(ColorButtonBg, active); break; default: - return Qt::black; + return TQt::black; } } const KPixmap &SUSE2Handler::buttonPixmap(ButtonIcon type, int size, ButtonStatus status) { if (m_pixmaps[status][type]) { - if (status != Shadow && m_pixmaps[status][type]->size() == QSize(size, size)) + if (status != Shadow && m_pixmaps[status][type]->size() == TQSize(size, size)) return *m_pixmaps[status][type]; - else if (status == Shadow && m_pixmaps[status][type]->size() == QSize(size+4, size+4)) + else if (status == Shadow && m_pixmaps[status][type]->size() == TQSize(size+4, size+4)) return *m_pixmaps[status][type]; } @@ -227,10 +227,10 @@ const KPixmap &SUSE2Handler::buttonPixmap(ButtonIcon type, int size, ButtonStatu delete m_pixmaps[status][type]; m_pixmaps[status][type] = 0; - QColor aDecoFgDark = alphaBlendColors(getColor(TitleGradientTo, true), Qt::black, 50); - QColor aDecoFgLight = alphaBlendColors(getColor(TitleGradientTo, true), Qt::white, 50); - QColor iDecoFgDark = alphaBlendColors(getColor(TitleGradientTo, false), Qt::black, 50); - QColor iDecoFgLight = alphaBlendColors(getColor(TitleGradientTo, false), Qt::white, 50); + TQColor aDecoFgDark = alphaBlendColors(getColor(TitleGradientTo, true), TQt::black, 50); + TQColor aDecoFgLight = alphaBlendColors(getColor(TitleGradientTo, true), TQt::white, 50); + TQColor iDecoFgDark = alphaBlendColors(getColor(TitleGradientTo, false), TQt::black, 50); + TQColor iDecoFgLight = alphaBlendColors(getColor(TitleGradientTo, false), TQt::white, 50); if (m_customIconColors && !m_useTitleProps) { aDecoFgDark = m_aFgColor; @@ -240,12 +240,12 @@ const KPixmap &SUSE2Handler::buttonPixmap(ButtonIcon type, int size, ButtonStatu } KPixmap icon = IconEngine::icon(type, size); - QImage img = icon.convertToImage(); + TQImage img = icon.convertToImage(); KPixmap *pixmap; - QImage tmpImage; + TQImage tmpImage; ShadowEngine se; - QPainter painter; + TQPainter painter; KPixmap tmpShadow; switch (status) { case ActiveUp: @@ -282,14 +282,14 @@ const KPixmap &SUSE2Handler::buttonPixmap(ButtonIcon type, int size, ButtonStatu break; case Shadow: // prepare shadow - tmpShadow = QPixmap(icon.width()+4, icon.height()+4); - tmpShadow.fill(QColor(0,0,0)); + tmpShadow = TQPixmap(icon.width()+4, icon.height()+4); + tmpShadow.fill(TQColor(0,0,0)); tmpShadow.setMask(tmpShadow.createHeuristicMask(true)); painter.begin(&tmpShadow); painter.setPen(white); painter.drawPixmap(0,0, icon); painter.end(); - tmpImage = se.makeShadow(tmpShadow, QColor(0, 0, 0)); + tmpImage = se.makeShadow(tmpShadow, TQColor(0, 0, 0)); pixmap = new KPixmap(tmpImage); break; default: @@ -300,11 +300,11 @@ const KPixmap &SUSE2Handler::buttonPixmap(ButtonIcon type, int size, ButtonStatu return *pixmap; } -QValueList< SUSE2Handler::BorderSize > +TQValueList< SUSE2Handler::BorderSize > SUSE2Handler::borderSizes() const { // the list must be sorted - return QValueList< BorderSize >() << BorderTiny << BorderNormal << + return TQValueList< BorderSize >() << BorderTiny << BorderNormal << BorderLarge << BorderVeryLarge << BorderHuge << BorderVeryHuge << BorderOversized; } diff --git a/src/SUSE2.h b/src/SUSE2.h index 463f1ce..b249455 100644 --- a/src/SUSE2.h +++ b/src/SUSE2.h @@ -24,7 +24,7 @@ #ifndef SUSE2_H #define SUSE2_H -#include <qfont.h> +#include <tqfont.h> #include <kdecoration.h> #include <kdecorationfactory.h> @@ -66,7 +66,7 @@ enum ColorType { BtnBg }; -class SUSE2Handler: public QObject, public KDecorationFactory +class SUSE2Handler: public TQObject, public KDecorationFactory { Q_OBJECT public: @@ -81,11 +81,11 @@ public: int titleHeight() const { return m_titleHeight; } int titleHeightTool() const { return m_titleHeightTool; } - QFont titleFont() const { return m_titleFont; } - QFont titleFontTool() const { return m_titleFontTool; } + TQFont titleFont() const { return m_titleFont; } + TQFont titleFontTool() const { return m_titleFontTool; } bool titleLogo() const { return m_titleLogo; } int titleLogoOffset() const { return m_titleLogoOffset; } - QString titleLogoURL() const { return m_titleLogoURL; } + TQString titleLogoURL() const { return m_titleLogoURL; } bool titleShadow() const { return m_titleShadow; } int borderSize() const { return m_borderSize; } int titlebarStyle() const { return m_titlebarStyle; } @@ -97,11 +97,11 @@ public: float iconSize() const { return m_iconSize; } bool iconShadow() const { return m_iconShadow; } bool menuClose() const { return m_menuClose; } - Qt::AlignmentFlags titleAlign() const { return m_titleAlign; } + TQt::AlignmentFlags titleAlign() const { return m_titleAlign; } int roundCorners() const { return m_roundCorners; } bool reverseLayout() const { return m_reverse; } - QColor getColor(KWinSUSE2::ColorType type, const bool active = true) const; - QValueList< SUSE2Handler::BorderSize > borderSizes() const; + TQColor getColor(KWinSUSE2::ColorType type, const bool active = true) const; + TQValueList< SUSE2Handler::BorderSize > borderSizes() const; private: void readConfig(); @@ -114,10 +114,10 @@ private: float m_iconSize; int m_titlebarStyle; bool m_customIconColors; - QColor m_aFgColor; - QColor m_aBgColor; - QColor m_iFgColor; - QColor m_iBgColor; + TQColor m_aFgColor; + TQColor m_aBgColor; + TQColor m_iFgColor; + TQColor m_iBgColor; bool m_iconShadow; bool m_animateButtons; bool m_redCloseButton; @@ -126,12 +126,12 @@ private: int m_borderSize; int m_titleHeight; int m_titleHeightTool; - QFont m_titleFont; - QFont m_titleFontTool; - Qt::AlignmentFlags m_titleAlign; + TQFont m_titleFont; + TQFont m_titleFontTool; + TQt::AlignmentFlags m_titleAlign; int m_roundCorners; int m_titleLogoOffset; - QString m_titleLogoURL; + TQString m_titleLogoURL; bool m_useTitleProps; KPixmap *m_pixmaps[NumButtonStatus][NumButtonIcons]; diff --git a/src/SUSE2button.cpp b/src/SUSE2button.cpp index 8665ff2..0bbeaad 100644 --- a/src/SUSE2button.cpp +++ b/src/SUSE2button.cpp @@ -26,13 +26,13 @@ #include <math.h> -#include <qbitmap.h> -#include <qcursor.h> -#include <qimage.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qtooltip.h> -#include <qtimer.h> +#include <tqbitmap.h> +#include <tqcursor.h> +#include <tqimage.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqtooltip.h> +#include <tqtimer.h> #include <kpixmap.h> #include <kpixmapeffect.h> @@ -59,11 +59,11 @@ SUSE2Button::SUSE2Button(ButtonType type, SUSE2Client *parent, const char *name) m_iconType(NumButtonIcons), hover(false) { - memset(lipstikCache, 0, sizeof(QPixmap*)*(8 + 3*(ANIMATIONSTEPS+1))*2); // set elements to 0 + memset(lipstikCache, 0, sizeof(TQPixmap*)*(8 + 3*(ANIMATIONSTEPS+1))*2); // set elements to 0 setBackgroundMode(NoBackground); - animTmr = new QTimer(this); + animTmr = new TQTimer(this); connect(animTmr, SIGNAL(timeout() ), this, SLOT(animate() ) ); animProgress = 0; } @@ -168,25 +168,25 @@ void SUSE2Button::animate() repaint(false); } -void SUSE2Button::enterEvent(QEvent *e) +void SUSE2Button::enterEvent(TQEvent *e) { - QButton::enterEvent(e); + TQButton::enterEvent(e); hover = true; animate(); // repaint(false); } -void SUSE2Button::leaveEvent(QEvent *e) +void SUSE2Button::leaveEvent(TQEvent *e) { - QButton::leaveEvent(e); + TQButton::leaveEvent(e); hover = false; animate(); // repaint(false); } -void SUSE2Button::drawButton(QPainter *painter) +void SUSE2Button::drawButton(TQPainter *painter) { int type = Handler()->buttonType(); @@ -206,42 +206,42 @@ void SUSE2Button::drawButton(QPainter *painter) } } -void SUSE2Button::drawPlastikBtn(QPainter *painter) +void SUSE2Button::drawPlastikBtn(TQPainter *painter) { - QRect r(0, 0, width(), height()); + TQRect r(0, 0, width(), height()); bool active = m_client->isActive(); bool down = isDown(); KPixmap backgroundTile = m_client->getTitleBarTile(active); KPixmap tempKPixmap; - QColor highlightColor; + TQColor highlightColor; if(type() == CloseButton) { - highlightColor = QColor(255,64,0); + highlightColor = TQColor(255,64,0); } else { - highlightColor = Qt::white; + highlightColor = TQt::white; } - QColor contourTop = alphaBlendColors(Handler()->getColor(TitleGradientFrom, active), - Qt::black, 220); - QColor contourBottom = alphaBlendColors(Handler()->getColor(TitleGradientTo, active), - Qt::black, 220); - QColor surfaceTop = alphaBlendColors(Handler()->getColor(TitleGradientFrom, active), - Qt::white, 220); - QColor surfaceBottom = alphaBlendColors(Handler()->getColor(TitleGradientTo, active), - Qt::white, 220); + TQColor contourTop = alphaBlendColors(Handler()->getColor(TitleGradientFrom, active), + TQt::black, 220); + TQColor contourBottom = alphaBlendColors(Handler()->getColor(TitleGradientTo, active), + TQt::black, 220); + TQColor surfaceTop = alphaBlendColors(Handler()->getColor(TitleGradientFrom, active), + TQt::white, 220); + TQColor surfaceBottom = alphaBlendColors(Handler()->getColor(TitleGradientTo, active), + TQt::white, 220); if (type() == CloseButton && active && Handler()->redCloseButton()) { - contourTop = QColor(170,70,70); - contourBottom = QColor(120,50,50); - surfaceTop = QColor(255,70,70); - surfaceBottom = QColor(170,50,50); - highlightColor = QColor(140,10,10); + contourTop = TQColor(170,70,70); + contourBottom = TQColor(120,50,50); + surfaceTop = TQColor(255,70,70); + surfaceBottom = TQColor(170,50,50); + highlightColor = TQColor(140,10,10); } else if (Handler()->customColors()) { - contourTop = alphaBlendColors(Handler()->getColor(BtnBg, active), Qt::black, 185); - contourBottom = alphaBlendColors(Handler()->getColor(BtnBg, active), Qt::black, 135); + contourTop = alphaBlendColors(Handler()->getColor(BtnBg, active), TQt::black, 185); + contourBottom = alphaBlendColors(Handler()->getColor(BtnBg, active), TQt::black, 135); surfaceTop = Handler()->getColor(BtnBg, active); - surfaceBottom = alphaBlendColors(Handler()->getColor(BtnBg, active), Qt::black, 185); + surfaceBottom = alphaBlendColors(Handler()->getColor(BtnBg, active), TQt::black, 185); } @@ -253,26 +253,26 @@ void SUSE2Button::drawPlastikBtn(QPainter *painter) surfaceBottom = alphaBlendColors(surfaceBottom, highlightColor, highlightAlpha); if (down) { - contourTop = alphaBlendColors(contourTop, Qt::black, 200); - contourBottom = alphaBlendColors(contourBottom, Qt::black, 200); - surfaceTop = alphaBlendColors(surfaceTop, Qt::black, 200); - surfaceBottom = alphaBlendColors(surfaceBottom, Qt::black, 200); + contourTop = alphaBlendColors(contourTop, TQt::black, 200); + contourBottom = alphaBlendColors(contourBottom, TQt::black, 200); + surfaceTop = alphaBlendColors(surfaceTop, TQt::black, 200); + surfaceBottom = alphaBlendColors(surfaceBottom, TQt::black, 200); } KPixmap buffer; buffer.resize(width(), height()); - QPainter bP(&buffer); + TQPainter bP(&buffer); // fill with the titlebar background bP.drawTiledPixmap(0, 0, width(), width(), backgroundTile, 0, TOPMARGIN); if (type() == MenuButton) { - KPixmap menuIcon(m_client->icon().pixmap( QIconSet::Small, QIconSet::Normal)); + KPixmap menuIcon(m_client->icon().pixmap( TQIconSet::Small, TQIconSet::Normal)); if (width() < menuIcon.width() || height() < menuIcon.height() ) { menuIcon.convertFromImage( menuIcon.convertToImage().smoothScale(width(), height())); } double fade = animProgress * 0.09; - KPixmapEffect::fade(menuIcon, fade, QColor(240, 240, 240)); + KPixmapEffect::fade(menuIcon, fade, TQColor(240, 240, 240)); bP.drawPixmap((width()-menuIcon.width())/2, (height()-menuIcon.height())/2, menuIcon); } else { // contour @@ -368,9 +368,9 @@ void SUSE2Button::drawPlastikBtn(QPainter *painter) painter->drawPixmap(0, 0, buffer); } -void SUSE2Button::drawLipstikBtn(QPainter *painter) +void SUSE2Button::drawLipstikBtn(TQPainter *painter) { - QRect r(0, 0, width(), height()); + TQRect r(0, 0, width(), height()); bool active = m_client->isActive(); bool down = isDown(); @@ -378,30 +378,30 @@ void SUSE2Button::drawLipstikBtn(QPainter *painter) KPixmap buffer; buffer.resize(width(), height()); - QPainter bP(&buffer); + TQPainter bP(&buffer); // fill with the titlebar background bP.drawTiledPixmap(0, 0, width(), width(), backgroundTile, 0, TOPMARGIN); if (type() == MenuButton) { - KPixmap menuIcon(m_client->icon().pixmap( QIconSet::Small, QIconSet::Normal)); + KPixmap menuIcon(m_client->icon().pixmap( TQIconSet::Small, TQIconSet::Normal)); if (width() < menuIcon.width() || height() < menuIcon.height() ) { menuIcon.convertFromImage( menuIcon.convertToImage().smoothScale(width(), height())); } double fade = animProgress * 0.09; - KPixmapEffect::fade(menuIcon, fade, QColor(240, 240, 240)); + KPixmapEffect::fade(menuIcon, fade, TQColor(240, 240, 240)); bP.drawPixmap((width()-menuIcon.width())/2, (height()-menuIcon.height())/2, menuIcon); } else { renderBtnContour(&bP, r); if (down) { - QColor downColor; + TQColor downColor; if (type() == CloseButton && active && Handler()->redCloseButton()) { - downColor = QColor(220,65,65).dark(115); + downColor = TQColor(220,65,65).dark(115); } else if (Handler()->customColors()) { downColor = Handler()->getColor(BtnBg, active).dark(115); } else { - downColor = alphaBlendColors(Handler()->getColor(TitleGradientFrom, active), Qt::black, 220).dark(115); + downColor = alphaBlendColors(Handler()->getColor(TitleGradientFrom, active), TQt::black, 220).dark(115); } bP.fillRect(r.left()+1, r.top()+2, r.width()-2, r.height()-4, downColor); bP.setPen(downColor); @@ -412,7 +412,7 @@ void SUSE2Button::drawLipstikBtn(QPainter *painter) bP.drawLine(r.left()+2, r.bottom()-1, r.right()-2, r.bottom()-1); bP.drawLine(r.right()-1, r.top()+2, r.right()-1, r.bottom()-2); } else { - renderBtnSurface(&bP, QRect(r.left()+1, r.top()+1, r.width()-2, r.height()-2)); + renderBtnSurface(&bP, TQRect(r.left()+1, r.top()+1, r.width()-2, r.height()-2)); } int dX,dY; @@ -444,23 +444,23 @@ void SUSE2Button::drawLipstikBtn(QPainter *painter) painter->drawPixmap(0, 0, buffer); } -void SUSE2Button::renderBtnContour(QPainter *p, const QRect &r) +void SUSE2Button::renderBtnContour(TQPainter *p, const TQRect &r) { if((r.width() <= 0)||(r.height() <= 0)) return; bool active = m_client->isActive(); - QColor backgroundColor; + TQColor backgroundColor; if (type() == CloseButton && active && Handler()->redCloseButton()) { - backgroundColor = QColor(220,65,65); + backgroundColor = TQColor(220,65,65); } else if (Handler()->customColors()) { backgroundColor = Handler()->getColor(BtnBg, active); } else { - backgroundColor = alphaBlendColors(Handler()->getColor(TitleGradientFrom, active), Qt::black, 220); + backgroundColor = alphaBlendColors(Handler()->getColor(TitleGradientFrom, active), TQt::black, 220); } - QColor contourColor = backgroundColor.dark(135); + TQColor contourColor = backgroundColor.dark(135); // sides p->setPen(contourColor); @@ -484,26 +484,26 @@ void SUSE2Button::renderBtnContour(QPainter *p, const QRect &r) // third part... anti-aliasing... int intActive = active ? 0 : 1; - renderPixel(p,QPoint(r.left()+1,r.top()),alphaAA,contourColor, 0, intActive); - renderPixel(p,QPoint(r.left(),r.top()+1),alphaAA,contourColor, 1, intActive); - renderPixel(p,QPoint(r.left()+1,r.bottom()),alphaAA,contourColor, 2, intActive); - renderPixel(p,QPoint(r.left(),r.bottom()-1),alphaAA,contourColor, 3, intActive); - renderPixel(p,QPoint(r.right()-1,r.top()),alphaAA,contourColor, 4, intActive); - renderPixel(p,QPoint(r.right(),r.top()+1),alphaAA,contourColor, 5, intActive); - renderPixel(p,QPoint(r.right()-1,r.bottom()),alphaAA,contourColor, 6, intActive); - renderPixel(p,QPoint(r.right(),r.bottom()-1),alphaAA,contourColor, 7, intActive); + renderPixel(p,TQPoint(r.left()+1,r.top()),alphaAA,contourColor, 0, intActive); + renderPixel(p,TQPoint(r.left(),r.top()+1),alphaAA,contourColor, 1, intActive); + renderPixel(p,TQPoint(r.left()+1,r.bottom()),alphaAA,contourColor, 2, intActive); + renderPixel(p,TQPoint(r.left(),r.bottom()-1),alphaAA,contourColor, 3, intActive); + renderPixel(p,TQPoint(r.right()-1,r.top()),alphaAA,contourColor, 4, intActive); + renderPixel(p,TQPoint(r.right(),r.top()+1),alphaAA,contourColor, 5, intActive); + renderPixel(p,TQPoint(r.right()-1,r.bottom()),alphaAA,contourColor, 6, intActive); + renderPixel(p,TQPoint(r.right(),r.bottom()-1),alphaAA,contourColor, 7, intActive); } -void SUSE2Button::renderBtnSurface(QPainter *p, const QRect &r) +void SUSE2Button::renderBtnSurface(TQPainter *p, const TQRect &r) { if((r.width() <= 0)||(r.height() <= 0)) return; bool active = m_client->isActive(); - QColor backgroundColor; + TQColor backgroundColor; if (type() == CloseButton && active && Handler()->redCloseButton()) { - backgroundColor = QColor(220,65,65); + backgroundColor = TQColor(220,65,65); } else if (Handler()->customColors()) { backgroundColor = Handler()->getColor(BtnBg, active); } else { @@ -511,20 +511,20 @@ void SUSE2Button::renderBtnSurface(QPainter *p, const QRect &r) if (!active) backgroundColor = alphaBlendColors(backgroundColor, Handler()->getColor(TitleGradientTo, active), 128); - backgroundColor = alphaBlendColors(backgroundColor, Qt::black, 220); + backgroundColor = alphaBlendColors(backgroundColor, TQt::black, 220); } - QColor highlightColor; + TQColor highlightColor; if(type() == CloseButton) { - highlightColor = QColor(255,0,0); + highlightColor = TQColor(255,0,0); } else { - highlightColor = Qt::white; + highlightColor = TQt::white; } int highlightAlpha = static_cast<int>(255-((60/static_cast<double>(ANIMATIONSTEPS)) * static_cast<double>(animProgress) ) ); - QColor buttonColor, bottomColor, topLineColor, bottomLineColor; + TQColor buttonColor, bottomColor, topLineColor, bottomLineColor; if (Handler()->buttonType() == LIPSTIK_3D) { // Lipstik buttonColor = backgroundColor; @@ -547,9 +547,9 @@ void SUSE2Button::renderBtnSurface(QPainter *p, const QRect &r) // sides,left int height = r.height() - 2; - renderGradient(p, QRect(r.left(), r.top()+1, 1, height), bottomColor, buttonColor, 8+animProgress, intActive); + renderGradient(p, TQRect(r.left(), r.top()+1, 1, height), bottomColor, buttonColor, 8+animProgress, intActive); //right - renderGradient(p, QRect(r.right(), r.top()+1, 1, height), bottomColor, buttonColor, 9+ANIMATIONSTEPS+animProgress, intActive); + renderGradient(p, TQRect(r.right(), r.top()+1, 1, height), bottomColor, buttonColor, 9+ANIMATIONSTEPS+animProgress, intActive); //top p->setPen(topLineColor); p->drawLine(r.left()+1, r.top(), r.right()-1, r.top() ); @@ -562,21 +562,21 @@ void SUSE2Button::renderBtnSurface(QPainter *p, const QRect &r) height = r.height(); width-=2; height-=2; - renderGradient(p, QRect(r.left()+1, r.top()+1, width, height), bottomColor, buttonColor, + renderGradient(p, TQRect(r.left()+1, r.top()+1, width, height), bottomColor, buttonColor, 10 + 2 * ANIMATIONSTEPS+animProgress, intActive); } -void SUSE2Button::renderPixel(QPainter *p, const QPoint &pos, const int alpha, const QColor &color, +void SUSE2Button::renderPixel(TQPainter *p, const TQPoint &pos, const int alpha, const TQColor &color, const int pixelPos, const int active) { if (lipstikCache[pixelPos][active]) { p->drawPixmap(pos, *(lipstikCache[pixelPos][active])); } else { - QRgb rgb = color.rgb(); - QImage aImg(1,1,32); // 1x1 + TQRgb rgb = color.rgb(); + TQImage aImg(1,1,32); // 1x1 aImg.setAlphaBuffer(true); - aImg.setPixel(0,0,qRgba(qRed(rgb),qGreen(rgb),qBlue(rgb),alpha)); - QPixmap *result = new QPixmap(aImg); + aImg.setPixel(0,0,tqRgba(tqRed(rgb),tqGreen(rgb),tqBlue(rgb),alpha)); + TQPixmap *result = new TQPixmap(aImg); p->drawPixmap(pos, *result); @@ -585,7 +585,7 @@ void SUSE2Button::renderPixel(QPainter *p, const QPoint &pos, const int alpha, c } } -void SUSE2Button::renderGradient(QPainter *painter, const QRect &rect, const QColor &c1, const QColor &c2, +void SUSE2Button::renderGradient(TQPainter *painter, const TQRect &rect, const TQColor &c1, const TQColor &c2, const int gradient, const int active) { if((rect.width() <= 0)||(rect.height() <= 0)) @@ -595,8 +595,8 @@ void SUSE2Button::renderGradient(QPainter *painter, const QRect &rect, const QCo painter->drawTiledPixmap(rect, *(lipstikCache[gradient][active])); } else { // there wasn't anything matching in the cache, create the pixmap now... - QPixmap *result = new QPixmap(10, rect.height()); - QPainter p(result); + TQPixmap *result = new TQPixmap(10, rect.height()); + TQPainter p(result); int r_h = result->rect().height(); int r_x, r_y, r_x2, r_y2; @@ -626,7 +626,7 @@ void SUSE2Button::renderGradient(QPainter *painter, const QRect &rect, const QCo 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); } @@ -640,15 +640,15 @@ void SUSE2Button::renderGradient(QPainter *painter, const QRect &rect, const QCo } } -QBitmap IconEngine::icon(ButtonIcon icon, int size) +TQBitmap IconEngine::icon(ButtonIcon icon, int size) { - QBitmap bitmap(size,size); - bitmap.fill(Qt::color0); - QPainter p(&bitmap); + TQBitmap bitmap(size,size); + bitmap.fill(TQt::color0); + TQPainter p(&bitmap); - p.setPen(Qt::color1); + p.setPen(TQt::color1); - QRect r = bitmap.rect(); + TQRect r = bitmap.rect(); // line widths int lwTitleBar = 1; @@ -883,7 +883,7 @@ QBitmap IconEngine::icon(ButtonIcon icon, int size) lw2 = 1; } - int h = QMAX( (r.width()/2), (lw1+2*lw2) ); + int h = TQMAX( (r.width()/2), (lw1+2*lw2) ); // horizontal bars drawObject(p, HorizontalLine, r.x(), r.y(), r.width(), lw1); @@ -906,7 +906,7 @@ QBitmap IconEngine::icon(ButtonIcon icon, int size) return bitmap; } -void IconEngine::drawObject(QPainter &p, Object object, int x, int y, int length, int lineWidth) +void IconEngine::drawObject(TQPainter &p, Object object, int x, int y, int length, int lineWidth) { switch(object) { case DiagonalLine: diff --git a/src/SUSE2button.h b/src/SUSE2button.h index 08b2305..df83533 100644 --- a/src/SUSE2button.h +++ b/src/SUSE2button.h @@ -24,14 +24,14 @@ #ifndef SUSE2BUTTON_H #define SUSE2BUTTON_H -#include <qbutton.h> -#include <qpixmap.h> +#include <tqbutton.h> +#include <tqpixmap.h> #include <kcommondecoration.h> #include "SUSE2.h" -class QTimer; +class TQTimer; namespace KWinSUSE2 { @@ -54,16 +54,16 @@ protected slots: void animate(); private: - void enterEvent(QEvent *e); - void leaveEvent(QEvent *e); - void drawButton(QPainter *painter); - void drawPlastikBtn(QPainter *painter); - void drawLipstikBtn(QPainter *painter); - void renderBtnContour(QPainter *p, const QRect &r); - void renderBtnSurface(QPainter *p, const QRect &r); - void renderPixel(QPainter *p, const QPoint &pos, const int alpha, const QColor &color, + void enterEvent(TQEvent *e); + void leaveEvent(TQEvent *e); + void drawButton(TQPainter *painter); + void drawPlastikBtn(TQPainter *painter); + void drawLipstikBtn(TQPainter *painter); + void renderBtnContour(TQPainter *p, const TQRect &r); + void renderBtnSurface(TQPainter *p, const TQRect &r); + void renderPixel(TQPainter *p, const TQPoint &pos, const int alpha, const TQColor &color, const int pixelPos, const int active); - void renderGradient(QPainter *p, const QRect &r, const QColor &c1, const QColor &c2, + void renderGradient(TQPainter *p, const TQRect &r, const TQColor &c1, const TQColor &c2, const int gradient, const int active); @@ -73,23 +73,23 @@ private: ButtonIcon m_iconType; bool hover; - QTimer *animTmr; + TQTimer *animTmr; uint animProgress; - QPixmap *lipstikCache[8+3*(ANIMATIONSTEPS+1)][2]; + TQPixmap *lipstikCache[8+3*(ANIMATIONSTEPS+1)][2]; }; /** * This class creates bitmaps which can be used as icons on buttons. The icons * are "hardcoded". - * Over the previous "Gimp->xpm->QImage->recolor->SmoothScale->QPixmap" solution + * Over the previous "Gimp->xpm->TQImage->recolor->SmoothScale->TQPixmap" solution * it has the important advantage that icons are more scalable and at the same * time sharp and not blurred. */ class IconEngine { public: - static QBitmap icon(ButtonIcon icon, int size); + static TQBitmap icon(ButtonIcon icon, int size); private: enum Object { @@ -99,7 +99,7 @@ class IconEngine CrossDiagonalLine }; - static void drawObject(QPainter &p, Object object, int x, int y, int length, int lineWidth); + static void drawObject(TQPainter &p, Object object, int x, int y, int length, int lineWidth); }; } // namespace KWinSUSE2 diff --git a/src/SUSE2client.cpp b/src/SUSE2client.cpp index 7d92417..ee443c5 100644 --- a/src/SUSE2client.cpp +++ b/src/SUSE2client.cpp @@ -29,15 +29,15 @@ #include <kstandarddirs.h> #include <kdecoration.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 <qimage.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 <tqimage.h> #include "SUSE2client.h" #include "SUSE2button.h" @@ -52,7 +52,7 @@ SUSE2Client::SUSE2Client(KDecorationBridge* bridge, KDecorationFactory* factory) aTitleBarTile(0), iTitleBarTile(0), pixmaps_created(false), captionBufferDirty(true), - s_titleFont(QFont()) + s_titleFont(TQFont()) {} SUSE2Client::~SUSE2Client() @@ -64,17 +64,17 @@ SUSE2Client::~SUSE2Client() } // pure virtual methods from KCommonDecoration -QString SUSE2Client::visibleName() const +TQString SUSE2Client::visibleName() const { return i18n("SUSE2 (Version %1)").arg("0.4.1"); } -QString SUSE2Client::defaultButtonsLeft() const +TQString SUSE2Client::defaultButtonsLeft() const { return "M"; } -QString SUSE2Client::defaultButtonsRight() const +TQString SUSE2Client::defaultButtonsRight() const { return "HIA___X"; } @@ -197,14 +197,14 @@ void SUSE2Client::init() create_pixmaps(); - aCaptionBuffer = new QPixmap(); - iCaptionBuffer = new QPixmap(); + aCaptionBuffer = new TQPixmap(); + iCaptionBuffer = new TQPixmap(); captionBufferDirty = true; KCommonDecoration::init(); } -QRegion SUSE2Client::cornerShape(WindowCorner corner) +TQRegion SUSE2Client::cornerShape(WindowCorner corner) { int w = widget()->width(); int h = widget()->height(); @@ -214,58 +214,58 @@ QRegion SUSE2Client::cornerShape(WindowCorner corner) if (layoutMetric(LM_TitleEdgeLeft) > 0 && (Handler()->roundCorners() == 1 || (Handler()->roundCorners() == 2 && maximizeMode() != MaximizeFull))) { - return QRegion(0, 0, 1, 5) + QRegion(0, 0, 2, 3) + QRegion(0, 0, 3, 2) + QRegion(0, 0, 5, 1); + return TQRegion(0, 0, 1, 5) + TQRegion(0, 0, 2, 3) + TQRegion(0, 0, 3, 2) + TQRegion(0, 0, 5, 1); } else { - return QRegion(0, 0, 1, 1); + return TQRegion(0, 0, 1, 1); } case WC_TopRight: if (layoutMetric(LM_TitleEdgeRight) > 0 && (Handler()->roundCorners() == 1 || (Handler()->roundCorners() == 2 && maximizeMode() != MaximizeFull))) { - return QRegion(w-1, 0, 1, 5) + QRegion(w-2, 0, 2, 3) + QRegion(w-3, 0, 3, 2) + QRegion(w-5, 0, 5, 1); + return TQRegion(w-1, 0, 1, 5) + TQRegion(w-2, 0, 2, 3) + TQRegion(w-3, 0, 3, 2) + TQRegion(w-5, 0, 5, 1); } else { - return QRegion(w-1, 0, 1, 1); + return TQRegion(w-1, 0, 1, 1); } case WC_BottomLeft: if (layoutMetric(LM_BorderLeft) > 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_BorderRight) > 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 SUSE2Client::paintEvent(QPaintEvent *e) +void SUSE2Client::paintEvent(TQPaintEvent *e) { - QRegion region = e->region(); + TQRegion region = e->region(); if (captionBufferDirty) update_captionBuffer(); bool active = isActive(); - QPainter painter(widget()); + TQPainter painter(widget()); // colors... - const QColor windowContour = Handler()->getColor(WindowContour, active); - const QColor innerWindowContour = Handler()->getColor(TitleGradientTo, active); - const QColor deco = Handler()->getColor(TitleGradientTo, active); - const QColor aBorder = Handler()->getColor(Border, active); - const QColor darkAntiAlias = alphaBlendColors(innerWindowContour, active ? aAntialiasBase : iAntialiasBase, 140); - const QColor midAntiAlias = alphaBlendColors(innerWindowContour, active ? aAntialiasBase : iAntialiasBase, 120); - const QColor brightAntiAlias = alphaBlendColors(innerWindowContour, active ? aAntialiasBase : iAntialiasBase, 80); - const QColor innerAntiAlias = alphaBlendColors(innerWindowContour, active ? aAntialiasBase : iAntialiasBase, 170); + const TQColor windowContour = Handler()->getColor(WindowContour, active); + const TQColor innerWindowContour = Handler()->getColor(TitleGradientTo, active); + const TQColor deco = Handler()->getColor(TitleGradientTo, active); + const TQColor aBorder = Handler()->getColor(Border, active); + const TQColor darkAntiAlias = alphaBlendColors(innerWindowContour, active ? aAntialiasBase : iAntialiasBase, 140); + const TQColor midAntiAlias = alphaBlendColors(innerWindowContour, active ? aAntialiasBase : iAntialiasBase, 120); + const TQColor brightAntiAlias = alphaBlendColors(innerWindowContour, active ? aAntialiasBase : iAntialiasBase, 80); + const TQColor innerAntiAlias = alphaBlendColors(innerWindowContour, active ? aAntialiasBase : iAntialiasBase, 170); - QRect r = widget()->rect(); + TQRect r = widget()->rect(); int r_w = r.width(); int r_x, r_y, r_x2, r_y2; @@ -299,11 +299,11 @@ void SUSE2Client::paintEvent(QPaintEvent *e) active ? *aTitleBarTile : *iTitleBarTile); } - 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 tmpRect; + TQRect tmpRect; // topSpacer if(titleEdgeTop > 0) { @@ -419,13 +419,13 @@ void SUSE2Client::paintEvent(QPaintEvent *e) } // titleSpacer - QPixmap *titleBfrPtr = active ? aCaptionBuffer : iCaptionBuffer; + TQPixmap *titleBfrPtr = active ? aCaptionBuffer : iCaptionBuffer; if (Rtitle.width() > 0 && titleBfrPtr != 0) { int tX, tW; switch (Handler()->titleAlign()) { // AlignCenter - case Qt::AlignHCenter: + case TQt::AlignHCenter: tX = (titleBfrPtr->width() > Rtitle.width()-2 * titleMargin) ? (Rtitle.left()+titleMargin) : Rtitle.left()+(Rtitle.width()- titleBfrPtr->width())/2; @@ -434,7 +434,7 @@ void SUSE2Client::paintEvent(QPaintEvent *e) : titleBfrPtr->width(); break; // AlignRight - case Qt::AlignRight: + case TQt::AlignRight: tX = (titleBfrPtr->width() > Rtitle.width()-2 * titleMargin) ? (Rtitle.left()+titleMargin) : Rtitle.right()-titleMargin-titleBfrPtr->width(); @@ -452,13 +452,13 @@ void SUSE2Client::paintEvent(QPaintEvent *e) if(tW > 0) { if (titleBfrPtr->width()+2*titleMargin > Rtitle.width()) { - QPixmap *tmp = new QPixmap(30, Rtitle.height()); - QPainter fade; + TQPixmap *tmp = new TQPixmap(30, Rtitle.height()); + TQPainter fade; fade.begin(tmp); fade.drawPixmap(0, 0, *titleBfrPtr, Rtitle.right()-30-2*titleMargin-Rtitle.left(), 0); - QImage background = (active ? *aTitleBarTile : *iTitleBarTile).convertToImage(); - QImage tmpImg = tmp->convertToImage(); - QImage blended = KImageEffect::blend(tmpImg, background, gradient, KImageEffect::Red); + TQImage background = (active ? *aTitleBarTile : *iTitleBarTile).convertToImage(); + TQImage tmpImg = tmp->convertToImage(); + TQImage blended = KImageEffect::blend(tmpImg, background, gradient, KImageEffect::Red); painter.drawPixmap(tX, Rtitle.top() - TOPMARGIN + btnMarginTop+2, *titleBfrPtr, 0, 2, tW - 2* titleMargin, -1); @@ -562,7 +562,7 @@ void SUSE2Client::updateCaption() const int marginLeft = layoutMetric(LM_TitleBorderLeft); const int marginRight = layoutMetric(LM_TitleBorderRight); - QRect g = QRect(titleEdgeLeft, titleEdgeTop, (widget()->rect()).width()-marginLeft-marginRight, titleHeight + titleEdgeBottom); + TQRect g = TQRect(titleEdgeLeft, titleEdgeTop, (widget()->rect()).width()-marginLeft-marginRight, titleHeight + titleEdgeBottom); widget()->update(g); } @@ -597,7 +597,7 @@ void SUSE2Client::create_pixmaps() return; KPixmap tempPixmap; - QPainter painter; + TQPainter painter; const int titleHeight = layoutMetric(LM_TitleHeight); @@ -607,32 +607,32 @@ void SUSE2Client::create_pixmaps() Handler()->getColor(TitleGradientFrom, true), Handler()->getColor(TitleGradientTo, true), KPixmapEffect::VerticalGradient); - aTitleBarTile = new QPixmap(30, titleHeight + TOPMARGIN + DECOHEIGHT); + aTitleBarTile = new TQPixmap(30, titleHeight + TOPMARGIN + DECOHEIGHT); painter.begin(aTitleBarTile); painter.drawPixmap(0, 0, tempPixmap); - QImage t; + TQImage t; if (Handler()->titlebarStyle() == 0) { // new, Toplight - t = QImage(30, (titleHeight + TOPMARGIN + DECOHEIGHT)/3 + 1, 32 ); - t = KImageEffect::gradient(QSize(30, t.height()), + t = TQImage(30, (titleHeight + TOPMARGIN + DECOHEIGHT)/3 + 1, 32 ); + t = KImageEffect::gradient(TQSize(30, t.height()), Handler()->getColor(TitleGradientFrom, true).light(130), Handler()->getColor(TitleGradientTo, true), KImageEffect::VerticalGradient/*, 100, 100*/); painter.drawImage(0, 2, t, 0, 0, -1, tempPixmap.height()-2); t.create(t.width(), t.height()*2, t.depth()); - t = KImageEffect::unbalancedGradient(QSize(30, t.height()), + t = KImageEffect::unbalancedGradient(TQSize(30, t.height()), Handler()->getColor(TitleGradientTo, true), Handler()->getColor(TitleGradientFrom, true), KImageEffect::VerticalGradient, 100, 100); painter.drawImage(0, t.height()/2, t, 0, 0, -1, t.height()); } else { // older, Balanced - t = QImage(30, (titleHeight + TOPMARGIN + DECOHEIGHT)/2 + 1, 32 ); - t = KImageEffect::gradient(QSize(30, t.height()), + t = TQImage(30, (titleHeight + TOPMARGIN + DECOHEIGHT)/2 + 1, 32 ); + t = KImageEffect::gradient(TQSize(30, t.height()), Handler()->getColor(TitleGradientFrom, true).light(150), Handler()->getColor(TitleGradientTo, true).light(110), KImageEffect::VerticalGradient); painter.drawImage(0, 2, t, 0, 0, -1, tempPixmap.height()-2); - t = KImageEffect::gradient(QSize(30, t.height()), + t = KImageEffect::gradient(TQSize(30, t.height()), Handler()->getColor(TitleGradientTo, true), Handler()->getColor(TitleGradientFrom, true), KImageEffect::VerticalGradient); @@ -647,22 +647,22 @@ void SUSE2Client::create_pixmaps() Handler()->getColor(TitleGradientFrom, false), Handler()->getColor(TitleGradientTo, false), KPixmapEffect::VerticalGradient); - iTitleBarTile = new QPixmap(30, titleHeight + TOPMARGIN + DECOHEIGHT); + iTitleBarTile = new TQPixmap(30, titleHeight + TOPMARGIN + DECOHEIGHT); painter.begin(iTitleBarTile); painter.drawPixmap(0, 0, tempPixmap); painter.end(); - QImage aTempImage = aTitleBarTile->convertToImage(); - aGradientBottom = QColor::QColor(aTempImage.pixel(0, aTempImage.height()-1)); - aAntialiasBase = QColor::QColor(aTempImage.pixel(0, 2)); - QImage iTempImage = iTitleBarTile->convertToImage(); - iGradientBottom = QColor::QColor(iTempImage.pixel(0, iTempImage.height()-1)); - iAntialiasBase = QColor::QColor(iTempImage.pixel(0, 2)); + TQImage aTempImage = aTitleBarTile->convertToImage(); + aGradientBottom = TQColor::TQColor(aTempImage.pixel(0, aTempImage.height()-1)); + aAntialiasBase = TQColor::TQColor(aTempImage.pixel(0, 2)); + TQImage iTempImage = iTitleBarTile->convertToImage(); + iGradientBottom = TQColor::TQColor(iTempImage.pixel(0, iTempImage.height()-1)); + iAntialiasBase = TQColor::TQColor(iTempImage.pixel(0, 2)); // the gradient for the fade out effect - gradient = KImageEffect::gradient(QSize(30, titleHeight + TOPMARGIN + DECOHEIGHT), - QColor(255,255,255), - QColor(0,0,0), + gradient = KImageEffect::gradient(TQSize(30, titleHeight + TOPMARGIN + DECOHEIGHT), + TQColor(255,255,255), + TQColor(0,0,0), KImageEffect::HorizontalGradient); pixmaps_created = true; @@ -682,16 +682,16 @@ void SUSE2Client::delete_pixmaps() void SUSE2Client::update_captionBuffer() { const uint maxCaptionLength = 110; // truncate captions longer than this! - QString c(caption()); + TQString c(caption()); if (c.length() > maxCaptionLength) { - QString tmpLeft = c.left(50); - QString tmpRight = c.right(50); - c = tmpLeft + QString::fromUtf8("[...]") + tmpRight; + TQString tmpLeft = c.left(50); + TQString tmpRight = c.right(50); + c = tmpLeft + TQString::fromUtf8("[...]") + tmpRight; } - QImage logo(Handler()->titleLogoURL()); + TQImage logo(Handler()->titleLogoURL()); int logoOffset = Handler()->titleLogoOffset(); - QFontMetrics fm(s_titleFont); + TQFontMetrics fm(s_titleFont); int captionWidth = fm.width(c); int logoWidth = 0; @@ -705,12 +705,12 @@ void SUSE2Client::update_captionBuffer() const int titleEdgeTop = layoutMetric(LM_TitleEdgeTop); const int titleEdgeBottom = layoutMetric(LM_TitleEdgeBottom); const int titleHeight = layoutMetric(LM_TitleHeight); - QPixmap textPixmap; - QPainter painter; + TQPixmap textPixmap; + TQPainter painter; if(Handler()->titleShadow()) { // prepare the shadow - textPixmap = QPixmap(captionWidth+4, titleHeight + TOPMARGIN + DECOHEIGHT); // 4 px shadow space - textPixmap.fill(QColor(0,0,0)); + textPixmap = TQPixmap(captionWidth+4, titleHeight + TOPMARGIN + DECOHEIGHT); // 4 px shadow space + textPixmap.fill(TQColor(0,0,0)); textPixmap.setMask(textPixmap.createHeuristicMask(true)); painter.begin(&textPixmap); painter.setFont(s_titleFont); @@ -728,7 +728,7 @@ void SUSE2Client::update_captionBuffer() painter.end(); } - QImage shadow; + TQImage shadow; ShadowEngine se; // active @@ -736,7 +736,7 @@ void SUSE2Client::update_captionBuffer() painter.begin(aCaptionBuffer); painter.drawTiledPixmap(aCaptionBuffer->rect(), *aTitleBarTile); if(Handler()->titleShadow()) { - shadow = se.makeShadow(textPixmap, QColor(0, 0, 0)); + shadow = se.makeShadow(textPixmap, TQColor(0, 0, 0)); painter.drawImage(1, 1, shadow); } painter.setFont(s_titleFont); diff --git a/src/SUSE2client.h b/src/SUSE2client.h index ad62a1c..f13311c 100644 --- a/src/SUSE2client.h +++ b/src/SUSE2client.h @@ -44,34 +44,34 @@ public: ~SUSE2Client(); // pure virtual methods from KCommonDecoration - virtual QString visibleName() const; - virtual QString defaultButtonsLeft() const; - virtual QString defaultButtonsRight() const; + virtual TQString visibleName() const; + virtual TQString defaultButtonsLeft() const; + virtual TQString defaultButtonsRight() const; virtual KCommonDecorationButton *createButton(ButtonType type); virtual bool decorationBehaviour(DecorationBehaviour behaviour) const; virtual int layoutMetric(LayoutMetric lm, bool respectWindowState = true, const KCommonDecorationButton * = 0) const; - virtual QRegion cornerShape(WindowCorner corner); + virtual TQRegion cornerShape(WindowCorner corner); virtual void updateCaption(); virtual void init(); - const QPixmap &getTitleBarTile(bool active) const + const TQPixmap &getTitleBarTile(bool active) const { return active ? *aTitleBarTile : *iTitleBarTile; } protected: - virtual void paintEvent(QPaintEvent *e); + virtual void paintEvent(TQPaintEvent *e); virtual void reset(unsigned long changed); private: - QPixmap *aCaptionBuffer, *iCaptionBuffer; + TQPixmap *aCaptionBuffer, *iCaptionBuffer; void update_captionBuffer(); - QPixmap *aTitleBarTile, *iTitleBarTile; - QImage gradient; - QColor aGradientBottom, iGradientBottom, aAntialiasBase, iAntialiasBase; + TQPixmap *aTitleBarTile, *iTitleBarTile; + TQImage gradient; + TQColor aGradientBottom, iGradientBottom, aAntialiasBase, iAntialiasBase; bool pixmaps_created; void create_pixmaps(); void delete_pixmaps(); @@ -79,7 +79,7 @@ private: bool captionBufferDirty; // settings... - QFont s_titleFont; + TQFont s_titleFont; }; } // KWinSUSE2 diff --git a/src/config/Makefile.in b/src/config/Makefile.in index 35d4251..bce9800 100644 --- a/src/config/Makefile.in +++ b/src/config/Makefile.in @@ -778,6 +778,6 @@ configdialog.cpp: $(srcdir)/configdialog.ui configdialog.h configdialog.moc configdialog.h: $(srcdir)/configdialog.ui rm -rf configdialog.h; - $(UIC) $(srcdir)/configdialog.ui | $(PERL) -pi -e "s,public QWizard,public KWizard,g; s,#include <qwizard.h>,#include <kwizard.h>,g" >> configdialog.h ; + $(UIC) $(srcdir)/configdialog.ui | $(PERL) -pi -e "s,public QWizard,public KWizard,g; s,#include <tqwizard.h>,#include <kwizard.h>,g" >> configdialog.h ; configdialog.moc: configdialog.h $(MOC) configdialog.h -o configdialog.moc diff --git a/src/config/config.cpp b/src/config/config.cpp index bc70aa6..7ff53f7 100644 --- a/src/config/config.cpp +++ b/src/config/config.cpp @@ -25,15 +25,15 @@ //#include <kdebug.h> -#include <qbuttongroup.h> -#include <qcheckbox.h> -#include <qradiobutton.h> -#include <qslider.h> -#include <qspinbox.h> -#include <qwhatsthis.h> -#include <qimage.h> -#include <qlabel.h> -#include <qcombobox.h> +#include <tqbuttongroup.h> +#include <tqcheckbox.h> +#include <tqradiobutton.h> +#include <tqslider.h> +#include <tqspinbox.h> +#include <tqwhatsthis.h> +#include <tqimage.h> +#include <tqlabel.h> +#include <tqcombobox.h> #include <kdeversion.h> #include <kconfig.h> @@ -50,8 +50,8 @@ #include "config.h" #include "configdialog.h" -SUSE2Config::SUSE2Config(KConfig *config, QWidget *parent) - : QObject(parent), m_config(0), m_dialog(0) +SUSE2Config::SUSE2Config(KConfig *config, TQWidget *parent) + : TQObject(parent), m_config(0), m_dialog(0) { m_parent = parent; // create the configuration object @@ -83,10 +83,10 @@ SUSE2Config::SUSE2Config(KConfig *config, QWidget *parent) connect(m_dialog->redCloseButton, SIGNAL(toggled(bool)), SIGNAL(changed())); connect(m_dialog->iconSize, SIGNAL(valueChanged(int)), SIGNAL(changed())); connect(m_dialog->customIconColors, SIGNAL(toggled(bool)), SIGNAL(changed())); - connect(m_dialog->activeFgColor, SIGNAL(changed(const QColor &)), SIGNAL(changed())); - connect(m_dialog->activeBgColor, SIGNAL(changed(const QColor &)), SIGNAL(changed())); - connect(m_dialog->inactiveFgColor, SIGNAL(changed(const QColor &)), SIGNAL(changed())); - connect(m_dialog->inactiveBgColor, SIGNAL(changed(const QColor &)), SIGNAL(changed())); + connect(m_dialog->activeFgColor, SIGNAL(changed(const TQColor &)), SIGNAL(changed())); + connect(m_dialog->activeBgColor, SIGNAL(changed(const TQColor &)), SIGNAL(changed())); + connect(m_dialog->inactiveFgColor, SIGNAL(changed(const TQColor &)), SIGNAL(changed())); + connect(m_dialog->inactiveBgColor, SIGNAL(changed(const TQColor &)), SIGNAL(changed())); connect(m_dialog->iconShadow, SIGNAL(toggled(bool)), SIGNAL(changed())); connect(m_dialog->titleBarLogo, SIGNAL(toggled(bool)), SIGNAL(changed())); @@ -106,12 +106,12 @@ void SUSE2Config::load(KConfig *) { m_config->setGroup("General"); - QString alignValue = m_config->readEntry("TitleAlignment", "AlignLeft"); - QRadioButton *alignButton = (QRadioButton*)m_dialog->titleAlign->child(alignValue.latin1()); + TQString alignValue = m_config->readEntry("TitleAlignment", "AlignLeft"); + TQRadioButton *alignButton = (TQRadioButton*)m_dialog->titleAlign->child(alignValue.latin1()); if (alignButton) alignButton->setChecked(true); - QString roundValue = m_config->readEntry("RoundCorners", "NotMaximized"); - QRadioButton *roundButton = (QRadioButton*)m_dialog->roundCorners->child(roundValue.latin1()); + TQString roundValue = m_config->readEntry("RoundCorners", "NotMaximized"); + TQRadioButton *roundButton = (TQRadioButton*)m_dialog->roundCorners->child(roundValue.latin1()); if (roundButton) roundButton->setChecked(true); bool menuClose = m_config->readBoolEntry("CloseOnMenuDoubleClick", false); @@ -147,20 +147,20 @@ void SUSE2Config::load(KConfig *) bool customIconColors = m_config->readBoolEntry("CustomIconColors", false); m_dialog->customIconColors->setChecked(customIconColors); - QColor afgcolor = QColor(10, 20, 40); - QColor aFgColor = m_config->readColorEntry("AFgColor", &afgcolor); + TQColor afgcolor = TQColor(10, 20, 40); + TQColor aFgColor = m_config->readColorEntry("AFgColor", &afgcolor); m_dialog->activeFgColor->setColor(aFgColor); - QColor abgcolor = QColor(210, 220, 240); - QColor aBgColor = m_config->readColorEntry("ABgColor", &abgcolor); + TQColor abgcolor = TQColor(210, 220, 240); + TQColor aBgColor = m_config->readColorEntry("ABgColor", &abgcolor); m_dialog->activeBgColor->setColor(aBgColor); - QColor ifgcolor = QColor(40, 40, 40); - QColor iFgColor = m_config->readColorEntry("IFgColor", &ifgcolor); + TQColor ifgcolor = TQColor(40, 40, 40); + TQColor iFgColor = m_config->readColorEntry("IFgColor", &ifgcolor); m_dialog->inactiveFgColor->setColor(iFgColor); - QColor ibgcolor = QColor(240, 240, 240); - QColor iBgColor = m_config->readColorEntry("AFgColor", &ibgcolor); + TQColor ibgcolor = TQColor(240, 240, 240); + TQColor iBgColor = m_config->readColorEntry("AFgColor", &ibgcolor); m_dialog->inactiveBgColor->setColor(iBgColor); bool iconShadow = m_config->readBoolEntry("IconShadow", true); @@ -172,10 +172,10 @@ void SUSE2Config::load(KConfig *) int titleBarLogoOffset = m_config->readNumEntry("TitleBarLogoOffset", 3); m_dialog->titleBarLogoOffset->setValue(titleBarLogoOffset); - QString titleBarImage = locate("data", "kwin/pics/titlebar_decor.png"); + TQString titleBarImage = locate("data", "kwin/pics/titlebar_decor.png"); titlebarLogoURL = m_config->readEntry("TitleBarLogoURL", titleBarImage); - QImage tmpLogo = QImage::QImage(titlebarLogoURL); - m_dialog->logoImage->setPixmap(QPixmap(tmpLogo.smoothScale(120, 20, QImage::ScaleMin))); + TQImage tmpLogo = TQImage::TQImage(titlebarLogoURL); + m_dialog->logoImage->setPixmap(TQPixmap(tmpLogo.smoothScale(120, 20, TQImage::ScaleMin))); } @@ -183,10 +183,10 @@ void SUSE2Config::save(KConfig *) const { m_config->setGroup("General"); - QRadioButton *alignButton = (QRadioButton*)m_dialog->titleAlign->selected(); - if (alignButton) m_config->writeEntry("TitleAlignment", QString(alignButton->name())); - QRadioButton *roundButton = (QRadioButton*)m_dialog->roundCorners->selected(); - if (roundButton) m_config->writeEntry("RoundCorners", QString(roundButton->name())); + TQRadioButton *alignButton = (TQRadioButton*)m_dialog->titleAlign->selected(); + if (alignButton) m_config->writeEntry("TitleAlignment", TQString(alignButton->name())); + TQRadioButton *roundButton = (TQRadioButton*)m_dialog->roundCorners->selected(); + if (roundButton) m_config->writeEntry("RoundCorners", TQString(roundButton->name())); m_config->writeEntry("CloseOnMenuDoubleClick", m_dialog->menuClose->isChecked()); m_config->writeEntry("TitleShadow", m_dialog->titleShadow->isChecked()); m_config->writeEntry("AddSpace", m_dialog->addSpace->value()); @@ -207,15 +207,15 @@ void SUSE2Config::save(KConfig *) const m_config->writeEntry("TitleBarLogo", m_dialog->titleBarLogo->isChecked()); m_config->writeEntry("TitleBarLogoOffset", m_dialog->titleBarLogoOffset->value()); - m_config->writeEntry("TitleBarLogoURL", QString(titlebarLogoURL)); + m_config->writeEntry("TitleBarLogoURL", TQString(titlebarLogoURL)); m_config->sync(); } void SUSE2Config::defaults() { - QRadioButton *alignButton = (QRadioButton*)m_dialog->titleAlign->child("AlignLeft"); + TQRadioButton *alignButton = (TQRadioButton*)m_dialog->titleAlign->child("AlignLeft"); if (alignButton) alignButton->setChecked(true); - QRadioButton *roundButton = (QRadioButton*)m_dialog->roundCorners->child("NotMaximized"); + TQRadioButton *roundButton = (TQRadioButton*)m_dialog->roundCorners->child("NotMaximized"); if (roundButton) roundButton->setChecked(true); m_dialog->menuClose->setChecked(false); m_dialog->titleShadow->setChecked(true); @@ -229,17 +229,17 @@ void SUSE2Config::defaults() m_dialog->redCloseButton->setChecked(false); m_dialog->iconSize->setValue(45); m_dialog->customIconColors->setChecked(false); - m_dialog->activeFgColor->setColor(QColor(10, 20, 40)); - m_dialog->activeBgColor->setColor(QColor(210, 220, 240)); - m_dialog->inactiveFgColor->setColor(QColor(40, 40, 40)); - m_dialog->inactiveBgColor->setColor(QColor(240, 240, 240)); + m_dialog->activeFgColor->setColor(TQColor(10, 20, 40)); + m_dialog->activeBgColor->setColor(TQColor(210, 220, 240)); + m_dialog->inactiveFgColor->setColor(TQColor(40, 40, 40)); + m_dialog->inactiveBgColor->setColor(TQColor(240, 240, 240)); m_dialog->iconShadow->setChecked(true); m_dialog->titleBarLogo->setChecked(false); m_dialog->titleBarLogoOffset->setValue(3); titlebarLogoURL = locate("data", "kwin/pics/titlebar_decor.png"); - QImage tmpLogo = QImage::QImage(titlebarLogoURL); - m_dialog->logoImage->setPixmap(QPixmap(tmpLogo.smoothScale(120, 20, QImage::ScaleMin))); + TQImage tmpLogo = TQImage::TQImage(titlebarLogoURL); + m_dialog->logoImage->setPixmap(TQPixmap(tmpLogo.smoothScale(120, 20, TQImage::ScaleMin))); } void SUSE2Config::toggleIconSettings(bool checked) const @@ -262,8 +262,8 @@ void SUSE2Config::selectImage() KFileItem tmpFileItem = KFileItem(KFileItem::Unknown, KFileItem::Unknown, logoURL); if (!logoURL.isEmpty() && tmpFileItem.isFile() && tmpFileItem.isReadable()) { titlebarLogoURL = logoURL.path(); - QImage tmpLogo = QImage::QImage(titlebarLogoURL); - m_dialog->logoImage->setPixmap(QPixmap(tmpLogo.smoothScale(120, 20, QImage::ScaleMin))); + TQImage tmpLogo = TQImage::TQImage(titlebarLogoURL); + m_dialog->logoImage->setPixmap(TQPixmap(tmpLogo.smoothScale(120, 20, TQImage::ScaleMin))); emit changed(); } } @@ -274,7 +274,7 @@ void SUSE2Config::selectImage() extern "C" { - KDE_EXPORT QObject *allocate_config(KConfig *config, QWidget *parent) { + KDE_EXPORT TQObject *allocate_config(KConfig *config, TQWidget *parent) { return (new SUSE2Config(config, parent)); } } diff --git a/src/config/config.h b/src/config/config.h index 8d05f72..704f38e 100644 --- a/src/config/config.h +++ b/src/config/config.h @@ -24,19 +24,19 @@ #ifndef CONFIG_H #define CONFIG_H -#include <qobject.h> +#include <tqobject.h> -class QButtonGroup; -class QGroupBox; +class TQButtonGroup; +class TQGroupBox; class KConfig; class ConfigDialog; -class SUSE2Config : public QObject +class SUSE2Config : public TQObject { Q_OBJECT public: - SUSE2Config(KConfig *config, QWidget *parent); + SUSE2Config(KConfig *config, TQWidget *parent); ~SUSE2Config(); signals: @@ -48,10 +48,10 @@ public slots: void defaults(); private: - QWidget *m_parent; + TQWidget *m_parent; KConfig *m_config; ConfigDialog *m_dialog; - QString titlebarLogoURL; + TQString titlebarLogoURL; private slots: void toggleIconSettings(bool) const; diff --git a/src/config/configdialog.ui b/src/config/configdialog.ui index 7efee62..5ae84a5 100644 --- a/src/config/configdialog.ui +++ b/src/config/configdialog.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>ConfigDialog</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>ConfigDialog</cstring> </property> @@ -22,11 +22,11 @@ <property name="margin"> <number>0</number> </property> - <widget class="QTabWidget" row="0" column="0"> + <widget class="TQTabWidget" row="0" column="0"> <property name="name"> <cstring>tabWidget2</cstring> </property> - <widget class="QWidget"> + <widget class="TQWidget"> <property name="name"> <cstring>tab</cstring> </property> @@ -37,7 +37,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QButtonGroup" row="0" column="0"> + <widget class="TQButtonGroup" row="0" column="0"> <property name="name"> <cstring>titleAlign</cstring> </property> @@ -48,7 +48,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>AlignLeft</cstring> </property> @@ -59,7 +59,7 @@ <string>Align the title left.</string> </property> </widget> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>AlignHCenter</cstring> </property> @@ -70,7 +70,7 @@ <string>Center the title.</string> </property> </widget> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>AlignRight</cstring> </property> @@ -83,7 +83,7 @@ </widget> </hbox> </widget> - <widget class="QButtonGroup" row="1" column="0"> + <widget class="TQButtonGroup" row="1" column="0"> <property name="name"> <cstring>roundCorners</cstring> </property> @@ -94,7 +94,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>RoundAlways</cstring> </property> @@ -108,7 +108,7 @@ <string>Always draw rounded window top corners.</string> </property> </widget> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>NotMaximized</cstring> </property> @@ -122,7 +122,7 @@ <string>Draw rounded top corners if the window is not maximized.</string> </property> </widget> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>RoundNever</cstring> </property> @@ -138,7 +138,7 @@ </widget> </hbox> </widget> - <widget class="QCheckBox" row="2" column="0"> + <widget class="TQCheckBox" row="2" column="0"> <property name="name"> <cstring>menuClose</cstring> </property> @@ -149,7 +149,7 @@ <string>Check this option if you want windows to be closed when you double click the menu button, similar to Microsoft Windows.</string> </property> </widget> - <widget class="QCheckBox" row="3" column="0"> + <widget class="TQCheckBox" row="3" column="0"> <property name="name"> <cstring>titleShadow</cstring> </property> @@ -160,7 +160,7 @@ <string>Check this option if you want the titlebar text to have a 3D look with a shadow behind it.</string> </property> </widget> - <widget class="QLayoutWidget" row="4" column="0"> + <widget class="TQLayoutWidget" row="4" column="0"> <property name="name"> <cstring>layout6</cstring> </property> @@ -182,7 +182,7 @@ <string>Here you can set some additional space for the titlebar height.</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_4</cstring> </property> @@ -217,7 +217,7 @@ </spacer> </hbox> </widget> - <widget class="QLayoutWidget" row="5" column="0"> + <widget class="TQLayoutWidget" row="5" column="0"> <property name="name"> <cstring>layout7</cstring> </property> @@ -225,7 +225,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_5</cstring> </property> @@ -241,7 +241,7 @@ <string>Titlebarstyle:</string> </property> </widget> - <widget class="QComboBox"> + <widget class="TQComboBox"> <item> <property name="text"> <string>Toplight</string> @@ -280,7 +280,7 @@ </widget> </grid> </widget> - <widget class="QWidget"> + <widget class="TQWidget"> <property name="name"> <cstring>tab</cstring> </property> @@ -291,7 +291,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget" row="0" column="0"> + <widget class="TQLayoutWidget" row="0" column="0"> <property name="name"> <cstring>layout5</cstring> </property> @@ -299,7 +299,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_2</cstring> </property> @@ -315,7 +315,7 @@ <string>Buttontype:</string> </property> </widget> - <widget class="QComboBox"> + <widget class="TQComboBox"> <item> <property name="text"> <string>Plastik flat</string> @@ -384,7 +384,7 @@ </size> </property> </spacer> - <widget class="QCheckBox" row="1" column="0"> + <widget class="TQCheckBox" row="1" column="0"> <property name="name"> <cstring>customColors</cstring> </property> @@ -395,7 +395,7 @@ <string>Allow custom colors for the button background. The colors for the buttonbackground from the colorscheme are used then.</string> </property> </widget> - <widget class="QCheckBox" row="2" column="0"> + <widget class="TQCheckBox" row="2" column="0"> <property name="name"> <cstring>useTitleProps</cstring> </property> @@ -406,7 +406,7 @@ <string>Use the titlefont settings (color, shadow) for the button icons. Overrides the custom color settings.</string> </property> </widget> - <widget class="QCheckBox" row="3" column="0"> + <widget class="TQCheckBox" row="3" column="0"> <property name="name"> <cstring>animateButtons</cstring> </property> @@ -417,7 +417,7 @@ <string>Check this option if you want the buttons to fade in when the mouse pointer hovers over them and fade out again when it moves away.</string> </property> </widget> - <widget class="QLayoutWidget" row="5" column="0"> + <widget class="TQLayoutWidget" row="5" column="0"> <property name="name"> <cstring>layout5</cstring> </property> @@ -425,7 +425,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_3</cstring> </property> @@ -477,7 +477,7 @@ </spacer> </hbox> </widget> - <widget class="QCheckBox" row="4" column="0"> + <widget class="TQCheckBox" row="4" column="0"> <property name="name"> <cstring>redCloseButton</cstring> </property> @@ -488,7 +488,7 @@ <string>Paint the icon of the closebutton in red (this overrides all other colorsettings).</string> </property> </widget> - <widget class="QCheckBox" row="0" column="1"> + <widget class="TQCheckBox" row="0" column="1"> <property name="name"> <cstring>customIconColors</cstring> </property> @@ -516,7 +516,7 @@ </size> </property> </spacer> - <widget class="QLayoutWidget" row="1" column="1" rowspan="4" colspan="1"> + <widget class="TQLayoutWidget" row="1" column="1" rowspan="4" colspan="1"> <property name="name"> <cstring>layout13</cstring> </property> @@ -524,7 +524,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> <cstring>layout11</cstring> </property> @@ -532,7 +532,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>activeLbl</cstring> </property> @@ -540,7 +540,7 @@ <string>Active:</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>activeDownLbl</cstring> </property> @@ -548,7 +548,7 @@ <string>Active down:</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>inactiveLbl</cstring> </property> @@ -556,7 +556,7 @@ <string>Inactive:</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>inactiveDownLbl</cstring> </property> @@ -566,7 +566,7 @@ </widget> </vbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> <cstring>layout12</cstring> </property> @@ -622,7 +622,7 @@ </widget> </hbox> </widget> - <widget class="QCheckBox" row="5" column="1"> + <widget class="TQCheckBox" row="5" column="1"> <property name="name"> <cstring>iconShadow</cstring> </property> @@ -635,7 +635,7 @@ </widget> </grid> </widget> - <widget class="QWidget"> + <widget class="TQWidget"> <property name="name"> <cstring>TabPage</cstring> </property> @@ -663,7 +663,7 @@ </size> </property> </spacer> - <widget class="QLabel" row="2" column="0"> + <widget class="TQLabel" row="2" column="0"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -679,7 +679,7 @@ <string>Logo preview:</string> </property> </widget> - <widget class="QLabel" row="2" column="1" rowspan="1" colspan="2"> + <widget class="TQLabel" row="2" column="1" rowspan="1" colspan="2"> <property name="name"> <cstring>logoImage</cstring> </property> @@ -713,7 +713,7 @@ <string></string> </property> </widget> - <widget class="QLabel" row="1" column="0" rowspan="1" colspan="2"> + <widget class="TQLabel" row="1" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -768,7 +768,7 @@ </size> </property> </spacer> - <widget class="QPushButton" row="2" column="3"> + <widget class="TQPushButton" row="2" column="3"> <property name="name"> <cstring>selectButton</cstring> </property> @@ -796,7 +796,7 @@ </size> </property> </spacer> - <widget class="QCheckBox" row="0" column="0" rowspan="1" colspan="5"> + <widget class="TQCheckBox" row="0" column="0" rowspan="1" colspan="5"> <property name="name"> <cstring>titleBarLogo</cstring> </property> diff --git a/src/misc.cpp b/src/misc.cpp index 966f7b1..9963407 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -24,13 +24,13 @@ #include <kpixmap.h> #include <kpixmapeffect.h> -#include <qcolor.h> -#include <qimage.h> -#include <qpainter.h> +#include <tqcolor.h> +#include <tqimage.h> +#include <tqpainter.h> #include "misc.h" -QColor hsvRelative(QColor& baseColor, int relativeH, int relativeS, int relativeV) +TQColor hsvRelative(TQColor& baseColor, int relativeH, int relativeS, int relativeV) { int h, s, v; baseColor.hsv(&h, &s, &v); @@ -46,38 +46,38 @@ QColor hsvRelative(QColor& baseColor, int relativeH, int relativeS, int relative if(v < 0) { v = 0; } else if(v > 255) { v = 255; } - QColor c; + TQColor c; c.setHsv( h, s, v ); return c; } -QColor alphaBlendColors(const QColor &bgColor, const QColor &fgColor, const int a) +TQColor alphaBlendColors(const TQColor &bgColor, const TQColor &fgColor, const int a) { // normal button... - 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 recolorImage(QImage *img, QColor color) { - QImage destImg(img->width(),img->height(),32); +TQImage recolorImage(TQImage *img, TQColor color) { + TQImage destImg(img->width(),img->height(),32); destImg.setAlphaBuffer(true); for (int x = 0; x < img->width(); x++) { for (int y = 0; y < img->height(); y++) { - if(img->pixel(x,y) == qRgb(0,0,0)) { + if(img->pixel(x,y) == tqRgb(0,0,0)) { destImg.setPixel(x,y,color.rgb() ); // set to the new color } else { - destImg.setPixel(x,y,qRgba(0,0,0,0) ); // set transparent... + destImg.setPixel(x,y,tqRgba(0,0,0,0) ); // set transparent... } } } @@ -23,8 +23,8 @@ #ifndef MISC_H #define MISC_H -QColor hsvRelative(QColor& baseColor, int relativeH, int relativeS = 0, int relativeV = 0); -QColor alphaBlendColors(const QColor &backgroundColor, const QColor &foregroundColor, const int alpha); -QImage recolorImage(QImage *img, QColor color); +TQColor hsvRelative(TQColor& baseColor, int relativeH, int relativeS = 0, int relativeV = 0); +TQColor alphaBlendColors(const TQColor &backgroundColor, const TQColor &foregroundColor, const int alpha); +TQImage recolorImage(TQImage *img, TQColor color); #endif // MISC_H diff --git a/src/shadow.cpp b/src/shadow.cpp index 1362679..99a424f 100644 --- a/src/shadow.cpp +++ b/src/shadow.cpp @@ -28,7 +28,7 @@ */ #include "shadow.h" -#include <qcolor.h> +#include <tqcolor.h> ShadowEngine::ShadowEngine() { @@ -40,9 +40,9 @@ ShadowEngine::~ShadowEngine() { } -QImage ShadowEngine::makeShadow(const QPixmap& textPixmap, const QColor &bgColor) +TQImage ShadowEngine::makeShadow(const TQPixmap& textPixmap, const TQColor &bgColor) { - QImage result; + TQImage result; // create a new image for for the shaddow int w = textPixmap.width(); @@ -58,7 +58,7 @@ QImage ShadowEngine::makeShadow(const QPixmap& textPixmap, const QColor &bgColor /* * This is the source pixmap */ - QImage img = textPixmap.convertToImage().convertDepth(32); + TQImage img = textPixmap.convertToImage().convertDepth(32); /* * Resize the image if necessary @@ -78,14 +78,14 @@ QImage ShadowEngine::makeShadow(const QPixmap& textPixmap, const QColor &bgColor alphaShadow = decay(img, i, j); alphaShadow = (alphaShadow > 180.0) ? 180.0 : alphaShadow; // update the shadow's i,j pixel. - result.setPixel(i,j, qRgba(bgRed, bgGreen , bgBlue, (int) alphaShadow)); + result.setPixel(i,j, tqRgba(bgRed, bgGreen , bgBlue, (int) alphaShadow)); } } return result; } -float ShadowEngine::decay(QImage& source, int i, int j) +float ShadowEngine::decay(TQImage& source, int i, int j) { // create a new image for the shadow int w = source.width(); @@ -117,7 +117,7 @@ float ShadowEngine::decay(QImage& source, int i, int j) else sy = j + m; - opacity += qGray(source.pixel(sx, sy)); + opacity += tqGray(source.pixel(sx, sy)); } } alphaShadow += opacity / multiplicationFactor_; diff --git a/src/shadow.h b/src/shadow.h index 04facb0..d8814ff 100644 --- a/src/shadow.h +++ b/src/shadow.h @@ -30,9 +30,9 @@ #ifndef __FX_SHADOW #define __FX_SHADOW -#include <qpixmap.h> -#include <qimage.h> -#include <qcolor.h> +#include <tqpixmap.h> +#include <tqimage.h> +#include <tqcolor.h> class ShadowEngine { @@ -41,9 +41,9 @@ class ShadowEngine ~ShadowEngine(); void setThickness(int thickness) { thickness_ = thickness; } void setMultiplicationFactor(float factor) { multiplicationFactor_ = factor; } - QImage makeShadow(const QPixmap& textPixmap, const QColor &bgColor); + TQImage makeShadow(const TQPixmap& textPixmap, const TQColor &bgColor); private: - float decay(QImage& source, int x, int y); + float decay(TQImage& source, int x, int y); int thickness_; float multiplicationFactor_; |