From c663b6440964f6ac48027143ac9e63298991f9d0 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:33:34 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1157639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kwin/clients/b2/b2client.cpp | 334 ++++++++++++------------ kwin/clients/b2/b2client.h | 90 +++---- kwin/clients/b2/config/config.cpp | 46 ++-- kwin/clients/b2/config/config.h | 22 +- kwin/clients/default/config/config.cpp | 42 +-- kwin/clients/default/config/config.h | 20 +- kwin/clients/default/kdedefault.cpp | 134 +++++----- kwin/clients/default/kdedefault.h | 32 +-- kwin/clients/keramik/config/config.cpp | 18 +- kwin/clients/keramik/config/config.h | 2 +- kwin/clients/keramik/embedtool.cpp | 56 ++-- kwin/clients/keramik/keramik.cpp | 376 +++++++++++++-------------- kwin/clients/keramik/keramik.h | 72 ++--- kwin/clients/kwmtheme/cli_installer/main.cpp | 26 +- kwin/clients/kwmtheme/kwmthemeclient.cpp | 182 ++++++------- kwin/clients/kwmtheme/kwmthemeclient.h | 34 +-- kwin/clients/laptop/laptopclient.cpp | 100 +++---- kwin/clients/laptop/laptopclient.h | 20 +- kwin/clients/modernsystem/config/config.cpp | 44 ++-- kwin/clients/modernsystem/config/config.h | 18 +- kwin/clients/modernsystem/modernsys.cpp | 142 +++++----- kwin/clients/modernsystem/modernsys.h | 26 +- kwin/clients/plastik/config/config.cpp | 50 ++-- kwin/clients/plastik/config/config.h | 4 +- kwin/clients/plastik/misc.cpp | 18 +- kwin/clients/plastik/misc.h | 6 +- kwin/clients/plastik/plastik.cpp | 90 +++---- kwin/clients/plastik/plastik.h | 26 +- kwin/clients/plastik/plastikbutton.cpp | 60 ++--- kwin/clients/plastik/plastikbutton.h | 18 +- kwin/clients/plastik/plastikclient.cpp | 98 +++---- kwin/clients/plastik/plastikclient.h | 24 +- kwin/clients/quartz/config/config.cpp | 24 +- kwin/clients/quartz/config/config.h | 12 +- kwin/clients/quartz/quartz.cpp | 76 +++--- kwin/clients/quartz/quartz.h | 20 +- kwin/clients/redmond/redmond.cpp | 84 +++--- kwin/clients/redmond/redmond.h | 24 +- kwin/clients/test/test.cpp | 54 ++-- kwin/clients/test/test.h | 12 +- kwin/clients/web/Web.cpp | 56 ++-- kwin/clients/web/Web.h | 14 +- kwin/clients/web/WebButton.cpp | 30 +-- kwin/clients/web/WebButton.h | 12 +- 44 files changed, 1324 insertions(+), 1324 deletions(-) (limited to 'kwin/clients') diff --git a/kwin/clients/b2/b2client.cpp b/kwin/clients/b2/b2client.cpp index 6a5d821b2..97d049ffb 100644 --- a/kwin/clients/b2/b2client.cpp +++ b/kwin/clients/b2/b2client.cpp @@ -11,9 +11,9 @@ */ #include "b2client.h" -#include -#include -#include +#include +#include +#include #include #include #include @@ -21,9 +21,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include @@ -99,7 +99,7 @@ static void read_config(B2ClientFactory *f) { // Force button size to be in a reasonable range. // If the frame width is large, the button size must be large too. - buttonSize = (QFontMetrics(options()->font(true)).height() + 1) & 0x3e; + buttonSize = (TQFontMetrics(options()->font(true)).height() + 1) & 0x3e; if (buttonSize < 16) buttonSize = 16; KConfig conf("kwinb2rc"); @@ -108,7 +108,7 @@ static void read_config(B2ClientFactory *f) do_draw_handle = conf.readBoolEntry("DrawGrabHandle", true); drawSmallBorders = !options()->moveResizeMaximizedWindows(); - QString opString = conf.readEntry("MenuButtonDoubleClickOperation", "NoOp"); + TQString opString = conf.readEntry("MenuButtonDoubleClickOperation", "NoOp"); if (opString == "Close") { menu_dbl_click_op = B2::CloseOp; } else if (opString == "Minimize") { @@ -140,15 +140,15 @@ static void read_config(B2ClientFactory *f) } } -static void drawB2Rect(KPixmap *pix, const QColor &primary, bool down) +static void drawB2Rect(KPixmap *pix, const TQColor &primary, bool down) { - QPainter p(pix); - QColor hColor = primary.light(150); - QColor lColor = primary.dark(150); + TQPainter p(pix); + TQColor hColor = primary.light(150); + TQColor lColor = primary.dark(150); if (down) qSwap(hColor, lColor); - if (QPixmap::defaultDepth() > 8) { + if (TQPixmap::defaultDepth() > 8) { KPixmapEffect::gradient(*pix, hColor, lColor, KPixmapEffect::DiagonalGradient); } @@ -166,7 +166,7 @@ static void drawB2Rect(KPixmap *pix, const QColor &primary, bool down) } -QPixmap* kwin_get_menu_pix_hack() +TQPixmap* kwin_get_menu_pix_hack() { //return menu_pix; FIXME return PIXMAP_A(P_MENU); @@ -200,27 +200,27 @@ static void create_pixmaps() // there seems to be no way to load X bitmaps from data properly, so // we need to create new ones for each mask :P - QBitmap pinupMask(16, 16, pinup_mask_bits, true); + TQBitmap pinupMask(16, 16, pinup_mask_bits, true); PIXMAP_A(P_PINUP)->setMask(pinupMask); PIXMAP_I(P_PINUP)->setMask(pinupMask); - QBitmap pindownMask(16, 16, pindown_mask_bits, true); + TQBitmap pindownMask(16, 16, pindown_mask_bits, true); PIXMAP_AD(P_PINUP)->setMask(pindownMask); PIXMAP_ID(P_PINUP)->setMask(pindownMask); - QBitmap menuMask(16, 16, menu_mask_bits, true); + TQBitmap menuMask(16, 16, menu_mask_bits, true); for (i = 0; i < NumStates; i++) pixmap[P_MENU * NumStates + i]->setMask(menuMask); - QBitmap helpMask(16, 16, help_mask_bits, true); + TQBitmap helpMask(16, 16, help_mask_bits, true); for (i = 0; i < NumStates; i++) pixmap[P_HELP * NumStates + i]->setMask(helpMask); - QBitmap normalizeMask(16, 16, true); + TQBitmap normalizeMask(16, 16, true); // draw normalize icon mask - QPainter mask; + TQPainter mask; mask.begin(&normalizeMask); - QBrush one(Qt::color1); + TQBrush one(Qt::color1); mask.fillRect(normalizeMask.width() - 12, normalizeMask.height() - 12, 12, 12, one); mask.fillRect(0, 0, 10, 10, one); @@ -229,7 +229,7 @@ static void create_pixmaps() for (i = 0; i < NumStates; i++) pixmap[P_NORMALIZE * NumStates + i]->setMask(normalizeMask); - QBitmap shadeMask(bsize, bsize, true); + TQBitmap shadeMask(bsize, bsize, true); mask.begin(&shadeMask); mask.fillRect(0, 0, bsize, 6, one); mask.end(); @@ -311,10 +311,10 @@ bool B2ClientFactory::supports( Ability ability ) }; } -QValueList< B2ClientFactory::BorderSize > B2ClientFactory::borderSizes() const +TQValueList< B2ClientFactory::BorderSize > B2ClientFactory::borderSizes() const { // the list must be sorted - return QValueList< BorderSize >() << BorderTiny << BorderNormal << + return TQValueList< BorderSize >() << BorderTiny << BorderNormal << BorderLarge << BorderVeryLarge << BorderHuge; } @@ -342,7 +342,7 @@ B2Client::B2Client(KDecorationBridge *b, KDecorationFactory *f) void B2Client::init() { - const QString tips[] = { + const TQString tips[] = { i18n("Menu"), isOnAllDesktops() ? i18n("Not on all desktops") : i18n("On all desktops"), @@ -364,35 +364,35 @@ void B2Client::init() for (int i = 0; i < BtnCount; i++) button[i] = NULL; - g = new QGridLayout(widget(), 3, 3); + g = new TQGridLayout(widget(), 3, 3); // Left and right border width - leftSpacer = new QSpacerItem(thickness, 16, - QSizePolicy::Fixed, QSizePolicy::Expanding); - rightSpacer = new QSpacerItem(thickness, 16, - QSizePolicy::Fixed, QSizePolicy::Expanding); + leftSpacer = new TQSpacerItem(thickness, 16, + TQSizePolicy::Fixed, TQSizePolicy::Expanding); + rightSpacer = new TQSpacerItem(thickness, 16, + TQSizePolicy::Fixed, TQSizePolicy::Expanding); g->addItem(leftSpacer, 1, 0); g->addItem(rightSpacer, 1, 2); // Top border height - topSpacer = new QSpacerItem(10, buttonSize + 4, - QSizePolicy::Expanding, QSizePolicy::Fixed); + topSpacer = new TQSpacerItem(10, buttonSize + 4, + TQSizePolicy::Expanding, TQSizePolicy::Fixed); g->addItem(topSpacer, 0, 1); // Bottom border height. - bottomSpacer = new QSpacerItem(10, + bottomSpacer = new TQSpacerItem(10, thickness + (mustDrawHandle() ? 4 : 0), - QSizePolicy::Expanding, QSizePolicy::Fixed); + TQSizePolicy::Expanding, TQSizePolicy::Fixed); g->addItem(bottomSpacer, 2, 1); if (isPreview()) { - QLabel *previewLabel = new QLabel( + TQLabel *previewLabel = new TQLabel( i18n("
B II preview
"), widget()); g->addWidget(previewLabel, 1, 1); } else { - g->addItem(new QSpacerItem(0, 0), 1, 1); + g->addItem(new TQSpacerItem(0, 0), 1, 1); } // titlebar @@ -402,8 +402,8 @@ void B2Client::init() titlebar->setMinimumWidth(buttonSize + 4); titlebar->setFixedHeight(buttonSize + 4); - QBoxLayout *titleLayout = new QBoxLayout(titlebar, - QBoxLayout::LeftToRight, 0, 1, 0); + TQBoxLayout *titleLayout = new TQBoxLayout(titlebar, + TQBoxLayout::LeftToRight, 0, 1, 0); titleLayout->addSpacing(3); if (options()->customButtonPositions()) { @@ -418,8 +418,8 @@ void B2Client::init() titleLayout->addSpacing(3); - QColor c = options()->colorGroup(KDecoration::ColorTitleBar, isActive()). - color(QColorGroup::Button); + TQColor c = options()->colorGroup(KDecoration::ColorTitleBar, isActive()). + color(TQColorGroup::Button); for (int i = 0; i < BtnCount; i++) { if (button[i]) @@ -432,8 +432,8 @@ void B2Client::init() titlebar->installEventFilter(this); } -void B2Client::addButtons(const QString& s, const QString tips[], - B2Titlebar* tb, QBoxLayout* titleLayout) +void B2Client::addButtons(const TQString& s, const TQString tips[], + B2Titlebar* tb, TQBoxLayout* titleLayout) { if (s.length() <= 0) return; @@ -446,8 +446,8 @@ void B2Client::addButtons(const QString& s, const QString tips[], LeftButton | RightButton); button[BtnMenu]->setPixmaps(P_MENU); button[BtnMenu]->setUseMiniIcon(); - connect(button[BtnMenu], SIGNAL(pressed()), - this, SLOT(menuButtonPressed())); + connect(button[BtnMenu], TQT_SIGNAL(pressed()), + this, TQT_SLOT(menuButtonPressed())); titleLayout->addWidget(button[BtnMenu]); } break; @@ -457,8 +457,8 @@ void B2Client::addButtons(const QString& s, const QString tips[], button[BtnSticky]->setPixmaps(P_PINUP); button[BtnSticky]->setToggle(); button[BtnSticky]->setDown(isOnAllDesktops()); - connect(button[BtnSticky], SIGNAL(clicked()), - this, SLOT(toggleOnAllDesktops())); + connect(button[BtnSticky], TQT_SIGNAL(clicked()), + this, TQT_SLOT(toggleOnAllDesktops())); titleLayout->addWidget(button[BtnSticky]); } break; @@ -466,8 +466,8 @@ void B2Client::addButtons(const QString& s, const QString tips[], if (providesContextHelp() && (!button[BtnHelp])) { button[BtnHelp] = new B2Button(this, tb, tips[BtnHelp]); button[BtnHelp]->setPixmaps(P_HELP); - connect(button[BtnHelp], SIGNAL(clicked()), - this, SLOT(showContextHelp())); + connect(button[BtnHelp], TQT_SIGNAL(clicked()), + this, TQT_SLOT(showContextHelp())); titleLayout->addWidget(button[BtnHelp]); } break; @@ -475,8 +475,8 @@ void B2Client::addButtons(const QString& s, const QString tips[], if (isMinimizable() && (!button[BtnIconify])) { button[BtnIconify] = new B2Button(this, tb,tips[BtnIconify]); button[BtnIconify]->setPixmaps(P_ICONIFY); - connect(button[BtnIconify], SIGNAL(clicked()), - this, SLOT(minimize())); + connect(button[BtnIconify], TQT_SIGNAL(clicked()), + this, TQT_SLOT(minimize())); titleLayout->addWidget(button[BtnIconify]); } break; @@ -486,8 +486,8 @@ void B2Client::addButtons(const QString& s, const QString tips[], LeftButton | MidButton | RightButton); button[BtnMax]->setPixmaps(maximizeMode() == MaximizeFull ? P_NORMALIZE : P_MAX); - connect(button[BtnMax], SIGNAL(clicked()), - this, SLOT(maxButtonClicked())); + connect(button[BtnMax], TQT_SIGNAL(clicked()), + this, TQT_SLOT(maxButtonClicked())); titleLayout->addWidget(button[BtnMax]); } break; @@ -495,8 +495,8 @@ void B2Client::addButtons(const QString& s, const QString tips[], if (isCloseable() && !button[BtnClose]) { button[BtnClose] = new B2Button(this, tb, tips[BtnClose]); button[BtnClose]->setPixmaps(P_CLOSE); - connect(button[BtnClose], SIGNAL(clicked()), - this, SLOT(closeWindow())); + connect(button[BtnClose], TQT_SIGNAL(clicked()), + this, TQT_SLOT(closeWindow())); titleLayout->addWidget(button[BtnClose]); } break; @@ -504,8 +504,8 @@ void B2Client::addButtons(const QString& s, const QString tips[], if (isShadeable() && !button[BtnShade]) { button[BtnShade] = new B2Button(this, tb, tips[BtnShade]); button[BtnShade]->setPixmaps(P_SHADE); - connect(button[BtnShade], SIGNAL(clicked()), - this, SLOT(shadeButtonClicked())); + connect(button[BtnShade], TQT_SIGNAL(clicked()), + this, TQT_SLOT(shadeButtonClicked())); titleLayout->addWidget(button[BtnShade]); } break; @@ -513,8 +513,8 @@ void B2Client::addButtons(const QString& s, const QString tips[], if (resizable && !button[BtnResize]) { button[BtnResize] = new B2Button(this, tb, tips[BtnResize]); button[BtnResize]->setPixmaps(P_RESIZE); - connect(button[BtnResize], SIGNAL(pressed()), - this, SLOT(resizeButtonPressed())); + connect(button[BtnResize], TQT_SIGNAL(pressed()), + this, TQT_SLOT(resizeButtonPressed())); titleLayout->addWidget(button[BtnResize]); } break; @@ -575,7 +575,7 @@ void B2Client::calcHiddenButtons() } } -void B2Client::resizeEvent(QResizeEvent * /*e*/) +void B2Client::resizeEvent(TQResizeEvent * /*e*/) { calcHiddenButtons(); titlebar->layout()->activate(); @@ -598,14 +598,14 @@ void B2Client::captionChange() titlebar->repaint(false); } -void B2Client::paintEvent(QPaintEvent* e) +void B2Client::paintEvent(TQPaintEvent* e) { - QPainter p(widget()); + TQPainter p(widget()); KDecoration::ColorType frameColorGroup = colored_frame ? KDecoration::ColorTitleBar : KDecoration::ColorFrame; - QRect t = titlebar->geometry(); + TQRect t = titlebar->geometry(); // Frame height, this is used a lot of times int fHeight = height() - t.height(); @@ -614,8 +614,8 @@ void B2Client::paintEvent(QPaintEvent* e) int bb = mustDrawHandle() ? 4 : 0; int bDepth = thickness + bb; - QColorGroup fillColor = options()->colorGroup(frameColorGroup, isActive()); - QBrush fillBrush(options()->color(frameColorGroup, isActive())); + TQColorGroup fillColor = options()->colorGroup(frameColorGroup, isActive()); + TQBrush fillBrush(options()->color(frameColorGroup, isActive())); // outer frame rect p.drawRect(0, t.bottom() - thickness + 1, @@ -690,7 +690,7 @@ void B2Client::paintEvent(QPaintEvent* e) */ if (titlebar->isFullyObscured()) { /* We first see, if our repaint contained the titlebar area */ - QRegion reg(QRect(0, 0, width(), buttonSize + 4)); + TQRegion reg(TQRect(0, 0, width(), buttonSize + 4)); reg = reg.intersect(e->region()); if (!reg.isEmpty()) unobscureTitlebar(); @@ -699,49 +699,49 @@ void B2Client::paintEvent(QPaintEvent* e) void B2Client::doShape() { - QRect t = titlebar->geometry(); - QRegion mask(widget()->rect()); + TQRect t = titlebar->geometry(); + TQRegion mask(widget()->rect()); // top to the tilebar right if (bar_x_ofs) { // left from bar - mask -= QRect(0, 0, bar_x_ofs, t.height() - thickness); + mask -= TQRect(0, 0, bar_x_ofs, t.height() - thickness); // top left point - mask -= QRect(0, t.height() - thickness, 1, 1); + mask -= TQRect(0, t.height() - thickness, 1, 1); } if (t.right() < width() - 1) { - mask -= QRect(width() - 1, + mask -= TQRect(width() - 1, t.height() - thickness, 1, 1); //top right point - mask -= QRect(t.right() + 1, 0, + mask -= TQRect(t.right() + 1, 0, width() - t.right() - 1, t.height() - thickness); } // bottom right point - mask -= QRect(width() - 1, height() - 1, 1, 1); + mask -= TQRect(width() - 1, height() - 1, 1, 1); if (mustDrawHandle()) { // bottom left point - mask -= QRect(0, height() - 5, 1, 1); + mask -= TQRect(0, height() - 5, 1, 1); // handle left point - mask -= QRect(width() - 40, height() - 1, 1, 1); + mask -= TQRect(width() - 40, height() - 1, 1, 1); // bottom left - mask -= QRect(0, height() - 4, width() - 40, 4); + mask -= TQRect(0, height() - 4, width() - 40, 4); } else { // bottom left point - mask -= QRect(0, height() - 1, 1, 1); + mask -= TQRect(0, height() - 1, 1, 1); } setMask(mask); } -void B2Client::showEvent(QShowEvent *) +void B2Client::showEvent(TQShowEvent *) { calcHiddenButtons(); positionButtons(); doShape(); } -KDecoration::Position B2Client::mousePosition(const QPoint& p) const +KDecoration::Position B2Client::mousePosition(const TQPoint& p) const { const int range = 16; - QRect t = titlebar->geometry(); + TQRect t = titlebar->geometry(); t.setHeight(buttonSize + 4 - thickness); int ly = t.bottom(); int lx = t.right(); @@ -809,8 +809,8 @@ void B2Client::desktopChange() bool on = isOnAllDesktops(); if (B2Button *b = button[BtnSticky]) { b->setDown(on); - QToolTip::remove(b); - QToolTip::add(b, + TQToolTip::remove(b); + TQToolTip::add(b, on ? i18n("Not on all desktops") : i18n("On all desktops")); } } @@ -821,12 +821,12 @@ void B2Client::maximizeChange() if (button[BtnMax]) { button[BtnMax]->setPixmaps(m ? P_NORMALIZE : P_MAX); button[BtnMax]->repaint(); - QToolTip::remove(button[BtnMax]); - QToolTip::add(button[BtnMax], + TQToolTip::remove(button[BtnMax]); + TQToolTip::add(button[BtnMax], m ? i18n("Restore") : i18n("Maximize")); } bottomSpacer->changeSize(10, thickness + (mustDrawHandle() ? 4 : 0), - QSizePolicy::Expanding, QSizePolicy::Minimum); + TQSizePolicy::Expanding, TQSizePolicy::Minimum); g->activate(); doShape(); @@ -838,8 +838,8 @@ void B2Client::activeChange() widget()->repaint(false); titlebar->repaint(false); - QColor c = options()->colorGroup( - KDecoration::ColorTitleBar, isActive()).color(QColorGroup::Button); + TQColor c = options()->colorGroup( + KDecoration::ColorTitleBar, isActive()).color(TQColorGroup::Button); for (int i = 0; i < BtnCount; i++) if (button[i]) { @@ -851,23 +851,23 @@ void B2Client::activeChange() void B2Client::shadeChange() { bottomSpacer->changeSize(10, thickness + (mustDrawHandle() ? 4 : 0), - QSizePolicy::Expanding, QSizePolicy::Minimum); + TQSizePolicy::Expanding, TQSizePolicy::Minimum); g->activate(); doShape(); if (B2Button *b = button[BtnShade]) { - QToolTip::remove(b); - QToolTip::add(b, isSetShade() ? i18n("Unshade") : i18n("Shade")); + TQToolTip::remove(b); + TQToolTip::add(b, isSetShade() ? i18n("Unshade") : i18n("Shade")); } } -QSize B2Client::minimumSize() const +TQSize B2Client::minimumSize() const { int left, right, top, bottom; borders(left, right, top, bottom); - return QSize(left + right + 2 * buttonSize, top + bottom); + return TQSize(left + right + 2 * buttonSize, top + bottom); } -void B2Client::resize(const QSize& s) +void B2Client::resize(const TQSize& s) { widget()->resize(s); } @@ -884,15 +884,15 @@ void B2Client::menuButtonPressed() static B2Client *lastClient = NULL; bool dbl = (lastClient == this && - time.elapsed() <= QApplication::doubleClickInterval()); + time.elapsed() <= TQApplication::doubleClickInterval()); lastClient = this; time.start(); if (!dbl) { KDecorationFactory* f = factory(); - QRect menuRect = button[BtnMenu]->rect(); - QPoint menuTop = button[BtnMenu]->mapToGlobal(menuRect.topLeft()); - QPoint menuBottom = button[BtnMenu]->mapToGlobal(menuRect.bottomRight()); - showWindowMenu(QRect(menuTop, menuBottom)); + TQRect menuRect = button[BtnMenu]->rect(); + TQPoint menuTop = button[BtnMenu]->mapToGlobal(menuRect.topLeft()); + TQPoint menuBottom = button[BtnMenu]->mapToGlobal(menuRect.bottomRight()); + showWindowMenu(TQRect(menuTop, menuBottom)); if (!f->exists(this)) // 'this' was destroyed return; button[BtnMenu]->setDown(false); @@ -924,7 +924,7 @@ void B2Client::unobscureTitlebar() return; } in_unobs = 1; - QRegion reg(QRect(0,0,width(), buttonSize + 4)); + TQRegion reg(TQRect(0,0,width(), buttonSize + 4)); reg = unobscuredRegion(reg); if (!reg.isEmpty()) { // there is at least _one_ pixel from our title area, which is not @@ -939,8 +939,8 @@ void B2Client::unobscureTitlebar() static void redraw_pixmaps() { int i; - QColorGroup aGrp = options()->colorGroup(KDecoration::ColorButtonBg, true); - QColorGroup iGrp = options()->colorGroup(KDecoration::ColorButtonBg, false); + TQColorGroup aGrp = options()->colorGroup(KDecoration::ColorButtonBg, true); + TQColorGroup iGrp = options()->colorGroup(KDecoration::ColorButtonBg, false); // close drawB2Rect(PIXMAP_A(P_CLOSE), aGrp.button(), false); @@ -958,7 +958,7 @@ static void redraw_pixmaps() bool is_act = (i < 2); bool is_down = ((i & 1) == 1); KPixmap *pix = pixmap[P_SHADE * NumStates + i]; - QColor color = is_act ? aGrp.button() : iGrp.button(); + TQColor color = is_act ? aGrp.button() : iGrp.button(); drawB2Rect(&thinBox, color, is_down); pix->fill(Qt::black); bitBlt(pix, 0, 0, &thinBox, @@ -1004,7 +1004,7 @@ static void redraw_pixmaps() } - QPainter p; + TQPainter p; // x for close + menu + help for (int j = 0; j < 3; j++) { int pix; @@ -1043,7 +1043,7 @@ static void redraw_pixmaps() // Apply the hilight effect to the 'Hover' icons KIconEffect ie; - QPixmap hilighted; + TQPixmap hilighted; for (i = 0; i < P_NUM_BUTTON_TYPES; i++) { int offset = i * NumStates; hilighted = ie.apply(*pixmap[offset + Norm], @@ -1057,8 +1057,8 @@ static void redraw_pixmaps() // Create the titlebar gradients - if (QPixmap::defaultDepth() > 8) { - QColor titleColor[4] = { + if (TQPixmap::defaultDepth() > 8) { + TQColor titleColor[4] = { options()->color(KDecoration::ColorTitleBar, true), options()->color(KDecoration::ColorFrame, true), @@ -1090,13 +1090,13 @@ static void redraw_pixmaps() void B2Client::positionButtons() { - QFontMetrics fm(options()->font(isActive())); - QString cap = caption(); + TQFontMetrics fm(options()->font(isActive())); + TQString cap = caption(); if (cap.length() < 5) // make sure the titlebar has sufficiently wide cap = "XXXXX"; // area for dragging the window int textLen = fm.width(cap); - QRect t = titlebar->captionSpacer->geometry(); + TQRect t = titlebar->captionSpacer->geometry(); int titleWidth = titlebar->width() - t.width() + textLen + 2; if (titleWidth > width()) titleWidth = width(); @@ -1106,24 +1106,24 @@ void B2Client::positionButtons() // Transparent bound stuff. -static QRect *visible_bound; -static QPointArray bound_shape; +static TQRect *visible_bound; +static TQPointArray bound_shape; -bool B2Client::drawbound(const QRect& geom, bool clear) +bool B2Client::drawbound(const TQRect& geom, bool clear) { if (clear) { if (!visible_bound) return true; } if (!visible_bound) { - visible_bound = new QRect(geom); - QRect t = titlebar->geometry(); + visible_bound = new TQRect(geom); + TQRect t = titlebar->geometry(); int frameTop = geom.top() + t.bottom(); int barLeft = geom.left() + bar_x_ofs; int barRight = barLeft + t.width() - 1; if (barRight > geom.right()) barRight = geom.right(); // line width is 5 pixels, so compensate for the 2 outer pixels (#88657) - QRect g = geom; + TQRect g = geom; g.setLeft( g.left() + 2 ); g.setTop( g.top() + 2 ); g.setRight( g.right() - 2 ); @@ -1144,8 +1144,8 @@ bool B2Client::drawbound(const QRect& geom, bool clear) } else { *visible_bound = geom; } - QPainter p(workspaceWidget()); - p.setPen(QPen(Qt::white, 5)); + TQPainter p(workspaceWidget()); + p.setPen(TQPen(Qt::white, 5)); p.setRasterOp(Qt::XorROP); p.drawPolygon(bound_shape); @@ -1156,28 +1156,28 @@ bool B2Client::drawbound(const QRect& geom, bool clear) return true; } -bool B2Client::eventFilter(QObject *o, QEvent *e) +bool B2Client::eventFilter(TQObject *o, TQEvent *e) { if (o != widget()) return false; switch (e->type()) { - case QEvent::Resize: - resizeEvent(static_cast< QResizeEvent* >(e)); + case TQEvent::Resize: + resizeEvent(static_cast< TQResizeEvent* >(e)); return true; - case QEvent::Paint: - paintEvent(static_cast< QPaintEvent* >(e)); + case TQEvent::Paint: + paintEvent(static_cast< TQPaintEvent* >(e)); return true; - case QEvent::MouseButtonDblClick: - titlebar->mouseDoubleClickEvent(static_cast< QMouseEvent* >(e)); + case TQEvent::MouseButtonDblClick: + titlebar->mouseDoubleClickEvent(static_cast< TQMouseEvent* >(e)); return true; - case QEvent::Wheel: - titlebar->wheelEvent(static_cast< QWheelEvent* >(e)); + case TQEvent::Wheel: + titlebar->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: - showEvent(static_cast< QShowEvent* >(e)); + case TQEvent::Show: + showEvent(static_cast< TQShowEvent* >(e)); return true; default: break; @@ -1187,9 +1187,9 @@ bool B2Client::eventFilter(QObject *o, QEvent *e) // ===================================== -B2Button::B2Button(B2Client *_client, QWidget *parent, - const QString& tip, const int realizeBtns) - : QButton(parent, 0), hover(false) +B2Button::B2Button(B2Client *_client, TQWidget *parent, + const TQString& tip, const int realizeBtns) + : TQButton(parent, 0), hover(false) { setBackgroundMode(NoBackground); setCursor(arrowCursor); @@ -1197,21 +1197,21 @@ B2Button::B2Button(B2Client *_client, QWidget *parent, client = _client; useMiniIcon = false; setFixedSize(buttonSize, buttonSize); - QToolTip::add(this, tip); + TQToolTip::add(this, tip); } -QSize B2Button::sizeHint() const +TQSize B2Button::sizeHint() const { - return QSize(buttonSize, buttonSize); + return TQSize(buttonSize, buttonSize); } -QSizePolicy B2Button::sizePolicy() const +TQSizePolicy B2Button::sizePolicy() const { - return(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); + return(TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed)); } -void B2Button::drawButton(QPainter *p) +void B2Button::drawButton(TQPainter *p) { KPixmap* gradient = titleGradient[client->isActive() ? 0 : 1]; if (gradient) { @@ -1220,8 +1220,8 @@ void B2Button::drawButton(QPainter *p) p->fillRect(rect(), bg); } if (useMiniIcon) { - QPixmap miniIcon = client->icon().pixmap(QIconSet::Small, - client->isActive() ? QIconSet::Normal : QIconSet::Disabled); + TQPixmap miniIcon = client->icon().pixmap(TQIconSet::Small, + client->isActive() ? TQIconSet::Normal : TQIconSet::Disabled); p->drawPixmap((width() - miniIcon.width()) / 2, (height() - miniIcon.height()) / 2, miniIcon); } else { @@ -1255,48 +1255,48 @@ void B2Button::setPixmaps(int button_id) repaint(false); } -void B2Button::mousePressEvent(QMouseEvent * e) +void B2Button::mousePressEvent(TQMouseEvent * e) { last_button = e->button(); - QMouseEvent me(e->type(), e->pos(), e->globalPos(), + TQMouseEvent me(e->type(), e->pos(), e->globalPos(), (e->button() & realizeButtons) ? LeftButton : NoButton, e->state()); - QButton::mousePressEvent(&me); + TQButton::mousePressEvent(&me); } -void B2Button::mouseReleaseEvent(QMouseEvent * e) +void B2Button::mouseReleaseEvent(TQMouseEvent * e) { last_button = e->button(); - QMouseEvent me(e->type(), e->pos(), e->globalPos(), + TQMouseEvent me(e->type(), e->pos(), e->globalPos(), (e->button() & realizeButtons) ? LeftButton : NoButton, e->state()); - QButton::mouseReleaseEvent(&me); + TQButton::mouseReleaseEvent(&me); } -void B2Button::enterEvent(QEvent *e) +void B2Button::enterEvent(TQEvent *e) { hover = true; repaint(false); - QButton::enterEvent(e); + TQButton::enterEvent(e); } -void B2Button::leaveEvent(QEvent *e) +void B2Button::leaveEvent(TQEvent *e) { hover = false; repaint(false); - QButton::leaveEvent(e); + TQButton::leaveEvent(e); } // ===================================== B2Titlebar::B2Titlebar(B2Client *parent) - : QWidget(parent->widget(), 0, WStyle_Customize | WRepaintNoErase), + : TQWidget(parent->widget(), 0, WStyle_Customize | WRepaintNoErase), client(parent), set_x11mask(false), isfullyobscured(false), shift_move(false) { setBackgroundMode(NoBackground); - captionSpacer = new QSpacerItem(buttonSize, buttonSize + 4, - QSizePolicy::Expanding, QSizePolicy::Fixed); + captionSpacer = new TQSpacerItem(buttonSize, buttonSize + 4, + TQSizePolicy::Expanding, TQSizePolicy::Fixed); } bool B2Titlebar::x11Event(XEvent *e) @@ -1326,14 +1326,14 @@ bool B2Titlebar::x11Event(XEvent *e) default: break; } - return QWidget::x11Event(e); + return TQWidget::x11Event(e); } -void B2Titlebar::drawTitlebar(QPainter &p, bool state) +void B2Titlebar::drawTitlebar(TQPainter &p, bool state) { KPixmap* gradient = titleGradient[state ? 0 : 1]; - QRect t = rect(); + TQRect t = rect(); // black titlebar frame p.setPen(Qt::black); p.drawLine(0, 0, 0, t.bottom()); @@ -1341,9 +1341,9 @@ void B2Titlebar::drawTitlebar(QPainter &p, bool state) p.drawLine(t.right(), 0, t.right(), t.bottom()); // titlebar fill - const QColorGroup cg = + const TQColorGroup cg = options()->colorGroup(KDecoration::ColorTitleBar, state); - QBrush brush(cg.background()); + TQBrush brush(cg.background()); if (gradient) brush.setPixmap(*gradient); qDrawShadeRect(&p, 1, 1, t.right() - 1, t.height() - 1, cg, false, 1, 0, &brush); @@ -1359,43 +1359,43 @@ void B2Titlebar::recalcBuffer() { titleBuffer.resize(width(), height()); - QPainter p(&titleBuffer); + TQPainter p(&titleBuffer); drawTitlebar(p, true); oldTitle = caption(); } -void B2Titlebar::resizeEvent(QResizeEvent *) +void B2Titlebar::resizeEvent(TQResizeEvent *) { recalcBuffer(); repaint(false); } -void B2Titlebar::paintEvent(QPaintEvent *) +void B2Titlebar::paintEvent(TQPaintEvent *) { if(client->isActive()) bitBlt(this, 0, 0, &titleBuffer, 0, 0, titleBuffer.width(), titleBuffer.height(), Qt::CopyROP, true); else { - QPainter p(this); + TQPainter p(this); drawTitlebar(p, false); } } -void B2Titlebar::mouseDoubleClickEvent(QMouseEvent *e) +void B2Titlebar::mouseDoubleClickEvent(TQMouseEvent *e) { if (e->button() == LeftButton && e->y() < height()) { client->titlebarDblClickOperation(); } } -void B2Titlebar::wheelEvent(QWheelEvent *e) +void B2Titlebar::wheelEvent(TQWheelEvent *e) { if (client->isSetShade() || rect().contains(e->pos())) client->titlebarMouseWheelOperation( e->delta()); } -void B2Titlebar::mousePressEvent(QMouseEvent * e) +void B2Titlebar::mousePressEvent(TQMouseEvent * e) { shift_move = e->state() & ShiftButton; if (shift_move) { @@ -1405,13 +1405,13 @@ void B2Titlebar::mousePressEvent(QMouseEvent * e) } } -void B2Titlebar::mouseReleaseEvent(QMouseEvent * e) +void B2Titlebar::mouseReleaseEvent(TQMouseEvent * e) { if (shift_move) shift_move = false; else e->ignore(); } -void B2Titlebar::mouseMoveEvent(QMouseEvent * e) +void B2Titlebar::mouseMoveEvent(TQMouseEvent * e) { if (shift_move) { int oldx = mapFromGlobal(moveOffset).x(); diff --git a/kwin/clients/b2/b2client.h b/kwin/clients/b2/b2client.h index 008b65af3..7df9a2f7d 100644 --- a/kwin/clients/b2/b2client.h +++ b/kwin/clients/b2/b2client.h @@ -9,10 +9,10 @@ #ifndef __B2CLIENT_H #define __B2CLIENT_H -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include @@ -28,31 +28,31 @@ class B2Client; class B2Button : public QButton { public: - B2Button(B2Client *_client=0, QWidget *parent=0, const QString& tip=NULL, const int realizeBtns = LeftButton); + B2Button(B2Client *_client=0, TQWidget *parent=0, const TQString& tip=NULL, const int realizeBtns = LeftButton); ~B2Button() {}; - void setBg(const QColor &c){bg = c;} + void setBg(const TQColor &c){bg = c;} void setPixmaps(KPixmap *pix, KPixmap *pixDown, KPixmap *iPix, KPixmap *iPixDown); void setPixmaps(int button_id); void setToggle(){setToggleType(Toggle);} void setActive(bool on){setOn(on);} void setUseMiniIcon(){useMiniIcon = true;} - QSize sizeHint() const; - QSizePolicy sizePolicy() const; + TQSize sizeHint() const; + TQSizePolicy sizePolicy() const; protected: - virtual void drawButton(QPainter *p); - void drawButtonLabel(QPainter *){;} + virtual void drawButton(TQPainter *p); + void drawButtonLabel(TQPainter *){;} - void mousePressEvent( QMouseEvent* e ); - void mouseReleaseEvent( QMouseEvent* e ); + void mousePressEvent( TQMouseEvent* e ); + void mouseReleaseEvent( TQMouseEvent* e ); private: - void enterEvent(QEvent *e); - void leaveEvent(QEvent *e); + void enterEvent(TQEvent *e); + void leaveEvent(TQEvent *e); bool useMiniIcon; KPixmap *icon[6]; - QColor bg; //only use one color (the rest is pixmap) so forget QPalette ;) + TQColor bg; //only use one color (the rest is pixmap) so forget TQPalette ;) public: B2Client* client; @@ -69,23 +69,23 @@ public: ~B2Titlebar(){;} bool isFullyObscured() const {return isfullyobscured;} void recalcBuffer(); - QSpacerItem *captionSpacer; + TQSpacerItem *captionSpacer; protected: - void paintEvent( QPaintEvent* ); + void paintEvent( TQPaintEvent* ); bool x11Event(XEvent *e); - void mouseDoubleClickEvent( QMouseEvent * ); - void wheelEvent(QWheelEvent *); - void mousePressEvent( QMouseEvent * ); - void mouseReleaseEvent( QMouseEvent * ); - void mouseMoveEvent(QMouseEvent *); - void resizeEvent(QResizeEvent *ev); + void mouseDoubleClickEvent( TQMouseEvent * ); + void wheelEvent(TQWheelEvent *); + void mousePressEvent( TQMouseEvent * ); + void mouseReleaseEvent( TQMouseEvent * ); + void mouseMoveEvent(TQMouseEvent *); + void resizeEvent(TQResizeEvent *ev); private: - void drawTitlebar(QPainter &p, bool state); + void drawTitlebar(TQPainter &p, bool state); B2Client *client; - QString oldTitle; + TQString oldTitle; KPixmap titleBuffer; - QPoint moveOffset; + TQPoint moveOffset; bool set_x11mask; bool isfullyobscured; bool shift_move; @@ -103,12 +103,12 @@ public: void titleMoveAbs(int new_ofs); void titleMoveRel(int xdiff); // transparent stuff - virtual bool drawbound(const QRect& geom, bool clear); + virtual bool drawbound(const TQRect& geom, bool clear); protected: - void resizeEvent( QResizeEvent* ); - void paintEvent( QPaintEvent* ); - void showEvent( QShowEvent* ); - void windowWrapperShowEvent( QShowEvent* ); + void resizeEvent( TQResizeEvent* ); + void paintEvent( TQPaintEvent* ); + void showEvent( TQShowEvent* ); + void windowWrapperShowEvent( TQShowEvent* ); void captionChange(); void desktopChange(); void shadeChange(); @@ -116,11 +116,11 @@ protected: void maximizeChange(); void iconChange(); void doShape(); - Position mousePosition( const QPoint& p ) const; - void resize(const QSize&); + Position mousePosition( const TQPoint& p ) const; + void resize(const TQSize&); void borders(int &, int &, int &, int &) const; - QSize minimumSize() const; - bool eventFilter(QObject *, QEvent *); + TQSize minimumSize() const; + bool eventFilter(TQObject *, TQEvent *); private slots: void menuButtonPressed(); //void slotReset(); @@ -128,8 +128,8 @@ private slots: void shadeButtonClicked(); void resizeButtonPressed(); private: - void addButtons(const QString& s, const QString tips[], - B2Titlebar* tb, QBoxLayout* titleLayout); + void addButtons(const TQString& s, const TQString tips[], + B2Titlebar* tb, TQBoxLayout* titleLayout); void positionButtons(); void calcHiddenButtons(); bool mustDrawHandle() const; @@ -137,20 +137,20 @@ private: enum ButtonType{BtnMenu=0, BtnSticky, BtnIconify, BtnMax, BtnClose, BtnHelp, BtnShade, BtnResize, BtnCount}; B2Button* button[BtnCount]; - QGridLayout *g; + TQGridLayout *g; // Border spacers - QSpacerItem *topSpacer; - QSpacerItem *bottomSpacer; - QSpacerItem *leftSpacer; - QSpacerItem *rightSpacer; + TQSpacerItem *topSpacer; + TQSpacerItem *bottomSpacer; + TQSpacerItem *leftSpacer; + TQSpacerItem *rightSpacer; B2Titlebar *titlebar; int bar_x_ofs; int in_unobs; - QTime time; + TQTime time; bool resizable; }; -class B2ClientFactory : public QObject, public KDecorationFactory +class B2ClientFactory : public TQObject, public KDecorationFactory { public: B2ClientFactory(); @@ -158,7 +158,7 @@ public: virtual KDecoration *createDecoration(KDecorationBridge *); virtual bool reset(unsigned long changed); virtual bool supports( Ability ability ); - QValueList< B2ClientFactory::BorderSize > borderSizes() const; + TQValueList< B2ClientFactory::BorderSize > borderSizes() const; }; } diff --git a/kwin/clients/b2/config/config.cpp b/kwin/clients/b2/config/config.cpp index d16a90307..ca1dccc65 100644 --- a/kwin/clients/b2/config/config.cpp +++ b/kwin/clients/b2/config/config.cpp @@ -8,14 +8,14 @@ #include "config.h" #include -#include -#include +#include +#include #include extern "C" { - KDE_EXPORT QObject* allocate_config( KConfig* conf, QWidget* parent ) + KDE_EXPORT TQObject* allocate_config( KConfig* conf, TQWidget* parent ) { return(new B2Config(conf, parent)); } @@ -26,43 +26,43 @@ extern "C" * 'conf' is a pointer to the kwindecoration modules open kwin config, * and is by default set to the "Style" group. * - * 'parent' is the parent of the QObject, which is a VBox inside the + * 'parent' is the parent of the TQObject, which is a VBox inside the * Configure tab in kwindecoration */ -B2Config::B2Config( KConfig* conf, QWidget* parent ) - : QObject( parent ) +B2Config::B2Config( KConfig* conf, TQWidget* parent ) + : TQObject( parent ) { KGlobal::locale()->insertCatalogue("kwin_b2_config"); b2Config = new KConfig("kwinb2rc"); - gb = new QVBox(parent); + gb = new TQVBox(parent); - cbColorBorder = new QCheckBox( + cbColorBorder = new TQCheckBox( i18n("Draw window frames using &titlebar colors"), gb); - QWhatsThis::add(cbColorBorder, + TQWhatsThis::add(cbColorBorder, i18n("When selected, the window borders " "are drawn using the titlebar colors; otherwise, they are " "drawn using normal border colors.")); // Grab Handle - showGrabHandleCb = new QCheckBox( + showGrabHandleCb = new TQCheckBox( i18n("Draw &resize handle"), gb); - QWhatsThis::add(showGrabHandleCb, + TQWhatsThis::add(showGrabHandleCb, i18n("When selected, decorations are drawn with a \"grab handle\" " "in the bottom right corner of the windows; " "otherwise, no grab handle is drawn.")); // Double click menu option support - actionsGB = new QHGroupBox(i18n("Actions Settings"), gb); - QLabel *menuDblClickLabel = new QLabel(actionsGB); + actionsGB = new TQHGroupBox(i18n("Actions Settings"), gb); + TQLabel *menuDblClickLabel = new TQLabel(actionsGB); menuDblClickLabel->setText(i18n("Double click on menu button:")); - menuDblClickOp = new QComboBox(actionsGB); + menuDblClickOp = new TQComboBox(actionsGB); menuDblClickOp->insertItem(i18n("Do Nothing")); menuDblClickOp->insertItem(i18n("Minimize Window")); menuDblClickOp->insertItem(i18n("Shade Window")); menuDblClickOp->insertItem(i18n("Close Window")); - QWhatsThis::add(menuDblClickOp, + TQWhatsThis::add(menuDblClickOp, i18n("An action can be associated to a double click " "of the menu button. Leave it to none if in doubt.")); @@ -70,12 +70,12 @@ B2Config::B2Config( KConfig* conf, QWidget* parent ) load(conf); // Ensure we track user changes properly - connect(cbColorBorder, SIGNAL(clicked()), - this, SLOT(slotSelectionChanged())); - connect(showGrabHandleCb, SIGNAL(clicked()), - this, SLOT(slotSelectionChanged())); - connect(menuDblClickOp, SIGNAL(activated(int)), - this, SLOT(slotSelectionChanged())); + connect(cbColorBorder, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotSelectionChanged())); + connect(showGrabHandleCb, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotSelectionChanged())); + connect(menuDblClickOp, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(slotSelectionChanged())); // Make the widgets visible in kwindecoration gb->show(); } @@ -106,7 +106,7 @@ void B2Config::load(KConfig * /*conf*/) override = b2Config->readBoolEntry( "DrawGrabHandle", true ); showGrabHandleCb->setChecked(override); - QString returnString = b2Config->readEntry( + TQString returnString = b2Config->readEntry( "MenuButtonDoubleClickOperation", "NoOp"); int op; @@ -124,7 +124,7 @@ void B2Config::load(KConfig * /*conf*/) } -static QString opToString(int op) +static TQString opToString(int op) { switch (op) { case 1: diff --git a/kwin/clients/b2/config/config.h b/kwin/clients/b2/config/config.h index 9985f3f4f..92c255ae6 100644 --- a/kwin/clients/b2/config/config.h +++ b/kwin/clients/b2/config/config.h @@ -9,11 +9,11 @@ #ifndef _KDE_B2CONFIG_H #define _KDE_B2CONFIG_H -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include class B2Config: public QObject @@ -21,7 +21,7 @@ class B2Config: public QObject Q_OBJECT public: - B2Config( KConfig* conf, QWidget* parent ); + B2Config( KConfig* conf, TQWidget* parent ); ~B2Config(); // These public signals/slots work similar to KCM modules @@ -38,11 +38,11 @@ class B2Config: public QObject private: KConfig* b2Config; - QCheckBox* cbColorBorder; - QCheckBox* showGrabHandleCb; - QHGroupBox* actionsGB; - QComboBox* menuDblClickOp; - QWidget* gb; + TQCheckBox* cbColorBorder; + TQCheckBox* showGrabHandleCb; + TQHGroupBox* actionsGB; + TQComboBox* menuDblClickOp; + TQWidget* gb; }; #endif diff --git a/kwin/clients/default/config/config.cpp b/kwin/clients/default/config/config.cpp index 2ad494fa9..c98fb1366 100644 --- a/kwin/clients/default/config/config.cpp +++ b/kwin/clients/default/config/config.cpp @@ -9,15 +9,15 @@ #include "config.h" #include -#include +#include #include #include -#include -#include +#include +#include extern "C" { - KDE_EXPORT QObject* allocate_config( KConfig* conf, QWidget* parent ) + KDE_EXPORT TQObject* allocate_config( KConfig* conf, TQWidget* parent ) { return(new KDEDefaultConfig(conf, parent)); } @@ -26,33 +26,33 @@ extern "C" // NOTE: // 'conf' is a pointer to the kwindecoration modules open kwin config, // and is by default set to the "Style" group. -// 'parent' is the parent of the QObject, which is a VBox inside the +// 'parent' is the parent of the TQObject, which is a VBox inside the // Configure tab in kwindecoration -KDEDefaultConfig::KDEDefaultConfig( KConfig* conf, QWidget* parent ) - : QObject( parent ) +KDEDefaultConfig::KDEDefaultConfig( KConfig* conf, TQWidget* parent ) + : TQObject( parent ) { KGlobal::locale()->insertCatalogue("kwin_clients"); - highcolor = QPixmap::defaultDepth() > 8; - gb = new QVBox( parent ); + highcolor = TQPixmap::defaultDepth() > 8; + gb = new TQVBox( parent ); gb->setSpacing( KDialog::spacingHint() ); - cbShowStipple = new QCheckBox( i18n("Draw titlebar &stipple effect"), gb ); - QWhatsThis::add( cbShowStipple, + cbShowStipple = new TQCheckBox( i18n("Draw titlebar &stipple effect"), gb ); + TQWhatsThis::add( cbShowStipple, i18n("When selected, active titlebars are drawn " "with a stipple (dotted) effect; otherwise, they are " "drawn without the stipple.")); - cbShowGrabBar = new QCheckBox( i18n("Draw g&rab bar below windows"), gb ); - QWhatsThis::add( cbShowGrabBar, + cbShowGrabBar = new TQCheckBox( i18n("Draw g&rab bar below windows"), gb ); + TQWhatsThis::add( cbShowGrabBar, i18n("When selected, decorations are drawn with a \"grab bar\" " "below windows; otherwise, no grab bar is drawn.")); // Only show the gradient checkbox for highcolor displays if (highcolor) { - cbUseGradients = new QCheckBox( i18n("Draw &gradients"), gb ); - QWhatsThis::add( cbUseGradients, + cbUseGradients = new TQCheckBox( i18n("Draw &gradients"), gb ); + TQWhatsThis::add( cbUseGradients, i18n("When selected, decorations are drawn with gradients " "for high-color displays; otherwise, no gradients are drawn.") ); } @@ -61,13 +61,13 @@ KDEDefaultConfig::KDEDefaultConfig( KConfig* conf, QWidget* parent ) load( conf ); // Ensure we track user changes properly - connect( cbShowStipple, SIGNAL(clicked()), - this, SLOT(slotSelectionChanged()) ); - connect( cbShowGrabBar, SIGNAL(clicked()), - this, SLOT(slotSelectionChanged()) ); + connect( cbShowStipple, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotSelectionChanged()) ); + connect( cbShowGrabBar, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotSelectionChanged()) ); if (highcolor) - connect( cbUseGradients, SIGNAL(clicked()), - this, SLOT(slotSelectionChanged()) ); + connect( cbUseGradients, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotSelectionChanged()) ); // Make the widgets visible in kwindecoration gb->show(); diff --git a/kwin/clients/default/config/config.h b/kwin/clients/default/config/config.h index 248d851df..5857910b1 100644 --- a/kwin/clients/default/config/config.h +++ b/kwin/clients/default/config/config.h @@ -10,19 +10,19 @@ #ifndef _KDE_DEFAULT_CONFIG_H #define _KDE_DEFAULT_CONFIG_H -#include -#include +#include +#include #include -#include -#include -#include +#include +#include +#include class KDEDefaultConfig: public QObject { Q_OBJECT public: - KDEDefaultConfig( KConfig* conf, QWidget* parent ); + KDEDefaultConfig( KConfig* conf, TQWidget* parent ); ~KDEDefaultConfig(); // These public signals/slots work similar to KCM modules @@ -38,10 +38,10 @@ class KDEDefaultConfig: public QObject void slotSelectionChanged(); // Internal use private: - QCheckBox* cbShowStipple; - QCheckBox* cbShowGrabBar; - QCheckBox* cbUseGradients; - QVBox* gb; + TQCheckBox* cbShowStipple; + TQCheckBox* cbShowGrabBar; + TQCheckBox* cbUseGradients; + TQVBox* gb; bool highcolor; }; diff --git a/kwin/clients/default/kdedefault.cpp b/kwin/clients/default/kdedefault.cpp index aeb1b2065..d91ccf56b 100644 --- a/kwin/clients/default/kdedefault.cpp +++ b/kwin/clients/default/kdedefault.cpp @@ -18,13 +18,13 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include namespace Default @@ -116,7 +116,7 @@ static const unsigned char pinup_mask_bits[] = { // =========================================================================== -static QPixmap* titlePix; +static TQPixmap* titlePix; static KPixmap* titleBuffer; static KPixmap* aUpperGradient; static KPixmap* iUpperGradient; @@ -198,8 +198,8 @@ unsigned long KDEDefaultHandler::readConfig( bool update ) bool new_showGrabBar = conf->readBoolEntry("ShowGrabBar", true); bool new_showTitleBarStipple = conf->readBoolEntry("ShowTitleBarStipple", true); bool new_useGradients = conf->readBoolEntry("UseGradients", true); - int new_titleHeight = QFontMetrics(options()->font(true)).height(); - int new_toolTitleHeight = QFontMetrics(options()->font(true, true)).height()-2; + int new_titleHeight = TQFontMetrics(options()->font(true)).height(); + int new_toolTitleHeight = TQFontMetrics(options()->font(true, true)).height()-2; int new_borderWidth; switch(options()->preferredBorderSize(this)) { @@ -257,16 +257,16 @@ unsigned long KDEDefaultHandler::readConfig( bool update ) // This paints the button pixmaps upon loading the style. void KDEDefaultHandler::createPixmaps() { - bool highcolor = useGradients && (QPixmap::defaultDepth() > 8); + bool highcolor = useGradients && (TQPixmap::defaultDepth() > 8); // Make the titlebar stipple optional if (showTitleBarStipple) { - QPainter p; - QPainter maskPainter; + TQPainter p; + TQPainter maskPainter; int i, x, y; - titlePix = new QPixmap(132, normalTitleHeight+2); - QBitmap mask(132, normalTitleHeight+2); + titlePix = new TQPixmap(132, normalTitleHeight+2); + TQBitmap mask(132, normalTitleHeight+2); mask.fill(Qt::color0); p.begin(titlePix); @@ -288,11 +288,11 @@ void KDEDefaultHandler::createPixmaps() } else titlePix = NULL; - QColor activeTitleColor1(options()->color(ColorTitleBar, true)); - QColor activeTitleColor2(options()->color(ColorTitleBlend, true)); + TQColor activeTitleColor1(options()->color(ColorTitleBar, true)); + TQColor activeTitleColor2(options()->color(ColorTitleBlend, true)); - QColor inactiveTitleColor1(options()->color(ColorTitleBar, false)); - QColor inactiveTitleColor2(options()->color(ColorTitleBlend, false)); + TQColor inactiveTitleColor1(options()->color(ColorTitleBar, false)); + TQColor inactiveTitleColor2(options()->color(ColorTitleBlend, false)); // Create titlebar gradient images if required aUpperGradient = NULL; @@ -324,8 +324,8 @@ void KDEDefaultHandler::createPixmaps() } // Set the sticky pin pixmaps; - QColorGroup g; - QPainter p; + TQColorGroup g; + TQPainter p; // Active pins g = options()->colorGroup( ColorButtonBg, true ); @@ -335,7 +335,7 @@ void KDEDefaultHandler::createPixmaps() kColorBitmaps( &p, g, 0, 0, 16, 16, true, pinup_white_bits, pinup_gray_bits, NULL, NULL, pinup_dgray_bits, NULL ); p.end(); - pinUpPix->setMask( QBitmap(16, 16, pinup_mask_bits, true) ); + pinUpPix->setMask( TQBitmap(16, 16, pinup_mask_bits, true) ); pinDownPix = new KPixmap(); pinDownPix->resize(16, 16); @@ -343,7 +343,7 @@ void KDEDefaultHandler::createPixmaps() kColorBitmaps( &p, g, 0, 0, 16, 16, true, pindown_white_bits, pindown_gray_bits, NULL, NULL, pindown_dgray_bits, NULL ); p.end(); - pinDownPix->setMask( QBitmap(16, 16, pindown_mask_bits, true) ); + pinDownPix->setMask( TQBitmap(16, 16, pindown_mask_bits, true) ); // Inactive pins g = options()->colorGroup( ColorButtonBg, false ); @@ -353,7 +353,7 @@ void KDEDefaultHandler::createPixmaps() kColorBitmaps( &p, g, 0, 0, 16, 16, true, pinup_white_bits, pinup_gray_bits, NULL, NULL, pinup_dgray_bits, NULL ); p.end(); - ipinUpPix->setMask( QBitmap(16, 16, pinup_mask_bits, true) ); + ipinUpPix->setMask( TQBitmap(16, 16, pinup_mask_bits, true) ); ipinDownPix = new KPixmap(); ipinDownPix->resize(16, 16); @@ -361,7 +361,7 @@ void KDEDefaultHandler::createPixmaps() kColorBitmaps( &p, g, 0, 0, 16, 16, true, pindown_white_bits, pindown_gray_bits, NULL, NULL, pindown_dgray_bits, NULL ); p.end(); - ipinDownPix->setMask( QBitmap(16, 16, pindown_mask_bits, true) ); + ipinDownPix->setMask( TQBitmap(16, 16, pindown_mask_bits, true) ); // Create a title buffer for flicker-free painting titleBuffer = new KPixmap(); @@ -492,16 +492,16 @@ void KDEDefaultHandler::freePixmaps() void KDEDefaultHandler::drawButtonBackground(KPixmap *pix, - const QColorGroup &g, bool sunken) + const TQColorGroup &g, bool sunken) { - QPainter p; + TQPainter p; int w = pix->width(); int h = pix->height(); int x2 = w-1; int y2 = h-1; - bool highcolor = useGradients && (QPixmap::defaultDepth() > 8); - QColor c = g.background(); + bool highcolor = useGradients && (TQPixmap::defaultDepth() > 8); + TQColor c = g.background(); // Fill the background with a gradient if possible if (highcolor) @@ -528,9 +528,9 @@ void KDEDefaultHandler::drawButtonBackground(KPixmap *pix, p.drawLine(2, x2-2, y2-2, x2-2); } -QValueList< KDEDefaultHandler::BorderSize > KDEDefaultHandler::borderSizes() const +TQValueList< KDEDefaultHandler::BorderSize > KDEDefaultHandler::borderSizes() const { // the list must be sorted - return QValueList< BorderSize >() << BorderNormal << BorderLarge << + return TQValueList< BorderSize >() << BorderNormal << BorderLarge << BorderVeryLarge << BorderHuge << BorderVeryHuge << BorderOversized; } @@ -560,7 +560,7 @@ bool KDEDefaultHandler::supports( Ability ability ) KDEDefaultButton::KDEDefaultButton(ButtonType type, KDEDefaultClient *parent, const char *name) : KCommonDecorationButton(type, parent, name) { - setBackgroundMode( QWidget::NoBackground ); + setBackgroundMode( TQWidget::NoBackground ); isMouseOver = false; deco = NULL; @@ -619,13 +619,13 @@ void KDEDefaultButton::setBitmap(const unsigned char *bitmap) deco = 0; if (bitmap) { - deco = new QBitmap(10, 10, bitmap, true); + deco = new TQBitmap(10, 10, bitmap, true); deco->setMask( *deco ); } } -void KDEDefaultButton::drawButton(QPainter *p) +void KDEDefaultButton::drawButton(TQPainter *p) { if (!KDEDefault_initialized) return; @@ -660,14 +660,14 @@ void KDEDefaultButton::drawButton(QPainter *p) // This is for sticky and menu buttons KPixmap* grad = active ? aUpperGradient : iUpperGradient; if (!grad) { - QColor c = KDecoration::options()->color(KDecoration::ColorTitleBar, active); + TQColor c = KDecoration::options()->color(KDecoration::ColorTitleBar, active); p->fillRect(0, 0, width(), height(), c ); } else p->drawPixmap( 0, 0, *grad, 0,1, width(), height() ); } else { // Draw a plain background for menus or sticky buttons on RHS - QColor c = KDecoration::options()->color(KDecoration::ColorFrame, active); + TQColor c = KDecoration::options()->color(KDecoration::ColorFrame, active); p->fillRect(0, 0, width(), height(), c); } @@ -698,7 +698,7 @@ void KDEDefaultButton::drawButton(QPainter *p) else btnpix = isOn() ? *ipinDownPix : *ipinUpPix; } else - btnpix = decoration()->icon().pixmap( QIconSet::Small, QIconSet::Normal ); + btnpix = decoration()->icon().pixmap( TQIconSet::Small, TQIconSet::Normal ); // Intensify the image if required if (isMouseOver) { @@ -717,19 +717,19 @@ void KDEDefaultButton::drawButton(QPainter *p) } -void KDEDefaultButton::enterEvent(QEvent *e) +void KDEDefaultButton::enterEvent(TQEvent *e) { isMouseOver=true; repaint(false); - QButton::enterEvent(e); + TQButton::enterEvent(e); } -void KDEDefaultButton::leaveEvent(QEvent *e) +void KDEDefaultButton::leaveEvent(TQEvent *e) { isMouseOver=false; repaint(false); - QButton::leaveEvent(e); + TQButton::leaveEvent(e); } @@ -741,17 +741,17 @@ KDEDefaultClient::KDEDefaultClient( KDecorationBridge* b, KDecorationFactory* f { } -QString KDEDefaultClient::visibleName() const +TQString KDEDefaultClient::visibleName() const { return i18n("KDE2"); } -QString KDEDefaultClient::defaultButtonsLeft() const +TQString KDEDefaultClient::defaultButtonsLeft() const { return "MS"; } -QString KDEDefaultClient::defaultButtonsRight() const +TQString KDEDefaultClient::defaultButtonsRight() const { return "HIAX"; } @@ -871,20 +871,20 @@ bool KDEDefaultClient::mustDrawHandle() const } } -void KDEDefaultClient::paintEvent( QPaintEvent* ) +void KDEDefaultClient::paintEvent( TQPaintEvent* ) { if (!KDEDefault_initialized) return; - QColorGroup g; + TQColorGroup g; int offset; KPixmap* upperGradient = isActive() ? aUpperGradient : iUpperGradient; - QPainter p(widget()); + TQPainter p(widget()); // Obtain widget bounds. - QRect r(widget()->rect()); + TQRect r(widget()->rect()); int x = r.x(); int y = r.y(); int x2 = r.width() - 1; @@ -938,8 +938,8 @@ void KDEDefaultClient::paintEvent( QPaintEvent* ) p.drawLine(x+1, y2-1, x2-1, y2-1); p.setPen(options()->color(ColorFrame, isActive())); - QPointArray a; - QBrush brush( options()->color(ColorFrame, isActive()), Qt::SolidPattern ); + TQPointArray a; + TQBrush brush( options()->color(ColorFrame, isActive()), Qt::SolidPattern ); p.setBrush( brush ); // use solid, yellow brush a.setPoints( 4, x+2, leftFrameStart+borderWidth-4, x+borderWidth-2, leftFrameStart, @@ -956,18 +956,18 @@ void KDEDefaultClient::paintEvent( QPaintEvent* ) if(w > 50) { qDrawShadePanel(&p, x+1, y2-grabBorderWidth+2, 2*borderWidth+12, grabBorderWidth-2, - g, false, 1, &g.brush(QColorGroup::Mid)); + g, false, 1, &g.brush(TQColorGroup::Mid)); qDrawShadePanel(&p, x+2*borderWidth+13, y2-grabBorderWidth+2, w-4*borderWidth-26, grabBorderWidth-2, g, false, 1, isActive() ? - &g.brush(QColorGroup::Background) : - &g.brush(QColorGroup::Mid)); + &g.brush(TQColorGroup::Background) : + &g.brush(TQColorGroup::Mid)); qDrawShadePanel(&p, x2-2*borderWidth-12, y2-grabBorderWidth+2, 2*borderWidth+12, grabBorderWidth-2, - g, false, 1, &g.brush(QColorGroup::Mid)); + g, false, 1, &g.brush(TQColorGroup::Mid)); } else qDrawShadePanel(&p, x+1, y2-grabBorderWidth+2, w-2, grabBorderWidth-2, g, false, 1, isActive() ? - &g.brush(QColorGroup::Background) : - &g.brush(QColorGroup::Mid)); + &g.brush(TQColorGroup::Background) : + &g.brush(TQColorGroup::Mid)); offset = grabBorderWidth; } else { @@ -984,13 +984,13 @@ void KDEDefaultClient::paintEvent( QPaintEvent* ) r = titleRect(); // Obtain titlebar blend colours - QColor c1 = options()->color(ColorTitleBar, isActive() ); - QColor c2 = options()->color(ColorFrame, isActive() ); + TQColor c1 = options()->color(ColorTitleBar, isActive() ); + TQColor c2 = options()->color(ColorFrame, isActive() ); // Fill with frame color behind RHS buttons p.fillRect( rightOffset, y+2, x2-rightOffset-1, titleHeight+1, c2); - QPainter p2( titleBuffer, this ); + TQPainter p2( titleBuffer, this ); // Draw the titlebar gradient if (upperGradient) @@ -1000,7 +1000,7 @@ void KDEDefaultClient::paintEvent( QPaintEvent* ) // Draw the title text on the pixmap, and with a smaller font // for toolwindows than the default. - QFont fnt = options()->font(true); + TQFont fnt = options()->font(true); if ( isToolWindow() ) fnt.setPointSize( fnt.pointSize()-2 ); // Shrink font by 2pt @@ -1010,7 +1010,7 @@ void KDEDefaultClient::paintEvent( QPaintEvent* ) // Draw the titlebar stipple if active and available if (isActive() && titlePix) { - QFontMetrics fm(fnt); + TQFontMetrics fm(fnt); int captionWidth = fm.width(caption()); if (caption().isRightToLeft()) p2.drawTiledPixmap( r.x(), 0, r.width()-captionWidth-4, @@ -1037,23 +1037,23 @@ void KDEDefaultClient::paintEvent( QPaintEvent* ) #endif } -QRegion KDEDefaultClient::cornerShape(WindowCorner corner) +TQRegion KDEDefaultClient::cornerShape(WindowCorner corner) { switch (corner) { case WC_TopLeft: - return QRect(0, 0, 1, 1); + return TQRect(0, 0, 1, 1); case WC_TopRight: - return QRect(width()-1, 0, 1, 1); + return TQRect(width()-1, 0, 1, 1); case WC_BottomLeft: - return QRect(0, height()-1, 1, 1); + return TQRect(0, height()-1, 1, 1); case WC_BottomRight: - return QRect(width()-1, height()-1, 1, 1); + return TQRect(width()-1, height()-1, 1, 1); default: - return QRegion(); + return TQRegion(); } } diff --git a/kwin/clients/default/kdedefault.h b/kwin/clients/default/kdedefault.h index 53ad23fa2..6e09025f1 100644 --- a/kwin/clients/default/kdedefault.h +++ b/kwin/clients/default/kdedefault.h @@ -13,9 +13,9 @@ #ifndef _KDE_DEFAULT_H #define _KDE_DEFAULT_H -#include -#include -#include +#include +#include +#include #include #include #include @@ -35,7 +35,7 @@ class KDEDefaultHandler: public KDecorationFactory ~KDEDefaultHandler(); KDecoration* createDecoration( KDecorationBridge* b ); bool reset( unsigned long changed ); - virtual QValueList< BorderSize > borderSizes() const; + virtual TQValueList< BorderSize > borderSizes() const; virtual bool supports( Ability ability ); private: @@ -43,11 +43,11 @@ class KDEDefaultHandler: public KDecorationFactory void createPixmaps(); void freePixmaps(); void drawButtonBackground(KPixmap *pix, - const QColorGroup &g, bool sunken); + const TQColorGroup &g, bool sunken); }; -// class KDEDefaultButton : public QButton, public KDecorationDefines +// class KDEDefaultButton : public TQButton, public KDecorationDefines class KDEDefaultButton : public KCommonDecorationButton { public: @@ -59,12 +59,12 @@ class KDEDefaultButton : public KCommonDecorationButton void setBitmap(const unsigned char *bitmap); protected: - void enterEvent(QEvent *); - void leaveEvent(QEvent *); - void drawButton(QPainter *p); - void drawButtonLabel(QPainter*) {;} + void enterEvent(TQEvent *); + void leaveEvent(TQEvent *); + void drawButton(TQPainter *p); + void drawButtonLabel(TQPainter*) {;} - QBitmap* deco; + TQBitmap* deco; bool large; bool isMouseOver; }; @@ -76,20 +76,20 @@ class KDEDefaultClient : public KCommonDecoration KDEDefaultClient( KDecorationBridge* b, KDecorationFactory* f ); ~KDEDefaultClient() {;} - 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 bool decorationBehaviour(DecorationBehaviour behaviour) const; virtual int layoutMetric(LayoutMetric lm, bool respectWindowState = true, const KCommonDecorationButton * = 0) const; virtual KCommonDecorationButton *createButton(ButtonType type); - virtual QRegion cornerShape(WindowCorner corner); + virtual TQRegion cornerShape(WindowCorner corner); void init(); void reset( unsigned long changed ); protected: - void paintEvent( QPaintEvent* ); + void paintEvent( TQPaintEvent* ); private: bool mustDrawHandle() const; diff --git a/kwin/clients/keramik/config/config.cpp b/kwin/clients/keramik/config/config.cpp index c548ca184..b4b6ced9b 100644 --- a/kwin/clients/keramik/config/config.cpp +++ b/kwin/clients/keramik/config/config.cpp @@ -26,14 +26,14 @@ #include #include -#include +#include #include "config.h" #include "config.moc" extern "C" { - KDE_EXPORT QObject* allocate_config( KConfig* conf, QWidget* parent ) + KDE_EXPORT TQObject* allocate_config( KConfig* conf, TQWidget* parent ) { return ( new KeramikConfig( conf, parent ) ); } @@ -44,21 +44,21 @@ extern "C" * 'conf' is a pointer to the kwindecoration modules open kwin config, * and is by default set to the "Style" group. * - * 'parent' is the parent of the QObject, which is a VBox inside the + * 'parent' is the parent of the TQObject, which is a VBox inside the * Configure tab in kwindecoration */ -KeramikConfig::KeramikConfig( KConfig* conf, QWidget* parent ) - : QObject( parent ) +KeramikConfig::KeramikConfig( KConfig* conf, TQWidget* parent ) + : TQObject( parent ) { KGlobal::locale()->insertCatalogue("kwin_clients"); c = new KConfig( "kwinkeramikrc" ); ui = new KeramikConfigUI( parent ); - connect( ui->showAppIcons, SIGNAL(clicked()), SIGNAL(changed()) ); - connect( ui->smallCaptions, SIGNAL(clicked()), SIGNAL(changed()) ); - connect( ui->largeGrabBars, SIGNAL(clicked()), SIGNAL(changed()) ); - connect( ui->useShadowedText, SIGNAL(clicked()), SIGNAL(changed()) ); + connect( ui->showAppIcons, TQT_SIGNAL(clicked()), TQT_SIGNAL(changed()) ); + connect( ui->smallCaptions, TQT_SIGNAL(clicked()), TQT_SIGNAL(changed()) ); + connect( ui->largeGrabBars, TQT_SIGNAL(clicked()), TQT_SIGNAL(changed()) ); + connect( ui->useShadowedText, TQT_SIGNAL(clicked()), TQT_SIGNAL(changed()) ); load( conf ); ui->show(); diff --git a/kwin/clients/keramik/config/config.h b/kwin/clients/keramik/config/config.h index 71090531d..4207424c7 100644 --- a/kwin/clients/keramik/config/config.h +++ b/kwin/clients/keramik/config/config.h @@ -34,7 +34,7 @@ class KeramikConfig: public QObject Q_OBJECT public: - KeramikConfig( KConfig* conf, QWidget* parent ); + KeramikConfig( KConfig* conf, TQWidget* parent ); ~KeramikConfig(); // These public signals/slots work similar to KCM modules diff --git a/kwin/clients/keramik/embedtool.cpp b/kwin/clients/keramik/embedtool.cpp index b0e5f1c72..4f5135a3f 100644 --- a/kwin/clients/keramik/embedtool.cpp +++ b/kwin/clients/keramik/embedtool.cpp @@ -19,12 +19,12 @@ * Boston, MA 02110-1301, USA. */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include @@ -37,11 +37,11 @@ static int primes[] = { }; struct EmbedImage { - QString string; + TQString string; int width; int height; bool alpha; - QString name; + TQString name; }; class KeramikEmbedder { @@ -53,17 +53,17 @@ public: void writeIndex(); private: - QFile *file; - QPtrList *index; - QTextStream stream; + TQFile *file; + TQPtrList *index; + TQTextStream stream; }; KeramikEmbedder::KeramikEmbedder() { - QDateTime date( QDateTime::currentDateTime() ); - QString datestring( date.toString() ); + TQDateTime date( TQDateTime::currentDateTime() ); + TQString datestring( date.toString() ); - file = new QFile( "tiles.h" ); + file = new TQFile( "tiles.h" ); file->open( IO_WriteOnly | IO_Truncate ); stream.setDevice( file ); @@ -74,11 +74,11 @@ KeramikEmbedder::KeramikEmbedder() stream << "#ifndef __TILES_H\n"; stream << "#define __TILES_H\n\n"; - stream << "#include \n"; - stream << "#include \n\n"; + stream << "#include \n"; + stream << "#include \n\n"; stream << "namespace Keramik {\n\n"; - index = new QPtrList; + index = new TQPtrList; index->setAutoDelete( true ); } @@ -95,15 +95,15 @@ KeramikEmbedder::~KeramikEmbedder() void KeramikEmbedder::embed( const char *name ) { - QFileInfo fileinfo( name ); - QString basename( fileinfo.baseName() ); - QString codename( basename ); - QImage image( name ); + TQFileInfo fileinfo( name ); + TQString basename( fileinfo.baseName() ); + TQString codename( basename ); + TQImage image( name ); - codename = codename.replace( QRegExp("[^a-zA-Z0-9]"), "_" ); + codename = codename.replace( TQRegExp("[^a-zA-Z0-9]"), "_" ); stream << "\tstatic const QRgb " << codename << "_data[] = {" << endl << "\t\t"; - stream.setf( QTextStream::hex | QTextStream::right ); + stream.setf( TQTextStream::hex | TQTextStream::right ); stream.fill( '0' ); int pixels = image.width() * image.height(); @@ -174,14 +174,14 @@ void KeramikEmbedder::writeIndex() stream << "\tclass KeramikImageDb {\n"; stream << "\tprivate:\n"; stream << "\t\tstatic KeramikImageDb *m_inst;\n"; - stream << "\t\tQDict *db;\n\n"; + stream << "\t\tQDict *db;\n\n"; stream << "\t\tKeramikImageDb() {\n"; - stream << "\t\t\tdb = new QDict( " << prime << " );\n"; + stream << "\t\t\tdb = new TQDict( " << prime << " );\n"; stream << "\t\t\tdb->setAutoDelete( true );\n\n"; stream << "\t\t\tfor ( int i = 0; i < " << index->count() << "; i++ ) {\n"; - stream << "\t\t\t\tQImage *img = new QImage( (uchar*)image_db[i].data,\n"; + stream << "\t\t\t\tQImage *img = new TQImage( (uchar*)image_db[i].data,\n"; stream << "\t\t\t\t\t\timage_db[i].width, image_db[i].height,\n"; - stream << "\t\t\t\t\t\t32, NULL, 0, QImage::LittleEndian );\n\n"; + stream << "\t\t\t\t\t\t32, NULL, 0, TQImage::LittleEndian );\n\n"; stream << "\t\t\t\tif ( image_db[i].alpha )\n"; stream << "\t\t\t\t\timg->setAlphaBuffer( true );\n\n"; stream << "\t\t\t\tdb->insert( image_db[i].name, img );\n"; @@ -199,7 +199,7 @@ void KeramikEmbedder::writeIndex() stream << "\t\t\tif ( m_inst ) delete m_inst;\n"; stream << "\t\t\tm_inst = NULL;\n"; stream << "\t\t}\n\n"; - stream << "\t\tQImage *image( const QString &name ) const {\n"; + stream << "\t\tQImage *image( const TQString &name ) const {\n"; stream << "\t\t\treturn db->find( name );\n"; stream << "\t\t}\n\n"; stream << "\t}; // class KeramikImageDb\n\n"; diff --git a/kwin/clients/keramik/keramik.cpp b/kwin/clients/keramik/keramik.cpp index 57a51bce1..48a187098 100644 --- a/kwin/clients/keramik/keramik.cpp +++ b/kwin/clients/keramik/keramik.cpp @@ -24,13 +24,13 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include @@ -41,16 +41,16 @@ // ------------------------------------------------------------------------------------------- -static void flip( QPixmap *&pix ) +static void flip( TQPixmap *&pix ) { - QPixmap *tmp = new QPixmap( pix->xForm( QWMatrix(-1,0,0,1,pix->width(),0) ) ); + TQPixmap *tmp = new TQPixmap( pix->xForm( TQWMatrix(-1,0,0,1,pix->width(),0) ) ); delete pix; pix = tmp; } -static void flip( QBitmap *&pix ) +static void flip( TQBitmap *&pix ) { - QBitmap *tmp = new QBitmap( pix->xForm( QWMatrix(-1,0,0,1,pix->width(),0) ) ); + TQBitmap *tmp = new TQBitmap( pix->xForm( TQWMatrix(-1,0,0,1,pix->width(),0) ) ); delete pix; pix = tmp; } @@ -186,27 +186,27 @@ KeramikHandler::KeramikHandler() imageDb = KeramikImageDb::instance(); // Create the button deco bitmaps - buttonDecos[ Menu ] = new QBitmap( 17, 17, menu_bits, true ); - buttonDecos[ OnAllDesktops ] = new QBitmap( 17, 17, on_all_desktops_bits, true ); - buttonDecos[ NotOnAllDesktops ] = new QBitmap( 17, 17, not_on_all_desktops_bits, true ); - buttonDecos[ Help ] = new QBitmap( 17, 17, help_bits, true ); - buttonDecos[ Minimize ] = new QBitmap( 17, 17, minimize_bits, true ); - buttonDecos[ Maximize ] = new QBitmap( 17, 17, maximize_bits, true ); - buttonDecos[ Restore ] = new QBitmap( 17, 17, restore_bits, true ); - buttonDecos[ Close ] = new QBitmap( 17, 17, close_bits, true ); - buttonDecos[ AboveOn ] = new QBitmap( 17, 17, above_on_bits, true ); - buttonDecos[ AboveOff ] = new QBitmap( 17, 17, above_off_bits, true ); - buttonDecos[ BelowOn ] = new QBitmap( 17, 17, below_on_bits, true ); - buttonDecos[ BelowOff ] = new QBitmap( 17, 17, below_off_bits, true ); - buttonDecos[ ShadeOn ] = new QBitmap( 17, 17, shade_on_bits, true ); - buttonDecos[ ShadeOff ] = new QBitmap( 17, 17, shade_off_bits, true ); + buttonDecos[ Menu ] = new TQBitmap( 17, 17, menu_bits, true ); + buttonDecos[ OnAllDesktops ] = new TQBitmap( 17, 17, on_all_desktops_bits, true ); + buttonDecos[ NotOnAllDesktops ] = new TQBitmap( 17, 17, not_on_all_desktops_bits, true ); + buttonDecos[ Help ] = new TQBitmap( 17, 17, help_bits, true ); + buttonDecos[ Minimize ] = new TQBitmap( 17, 17, minimize_bits, true ); + buttonDecos[ Maximize ] = new TQBitmap( 17, 17, maximize_bits, true ); + buttonDecos[ Restore ] = new TQBitmap( 17, 17, restore_bits, true ); + buttonDecos[ Close ] = new TQBitmap( 17, 17, close_bits, true ); + buttonDecos[ AboveOn ] = new TQBitmap( 17, 17, above_on_bits, true ); + buttonDecos[ AboveOff ] = new TQBitmap( 17, 17, above_off_bits, true ); + buttonDecos[ BelowOn ] = new TQBitmap( 17, 17, below_on_bits, true ); + buttonDecos[ BelowOff ] = new TQBitmap( 17, 17, below_off_bits, true ); + buttonDecos[ ShadeOn ] = new TQBitmap( 17, 17, shade_on_bits, true ); + buttonDecos[ ShadeOff ] = new TQBitmap( 17, 17, shade_off_bits, true ); // Selfmask the bitmaps for ( int i = 0; i < NumButtonDecos; i++ ) buttonDecos[i]->setMask( *buttonDecos[i] ); // Flip the bitmaps horizontally in right-to-left mode - if ( QApplication::reverseLayout() ) { + if ( TQApplication::reverseLayout() ) { for ( int i = 0; i < Help; ++i ) ::flip( buttonDecos[i] ); @@ -268,14 +268,14 @@ void KeramikHandler::createPixmaps() widthOffset = 0; heightOffset = 0; } - int fontHeight = QFontMetrics(options()->font(true)).height(); + int fontHeight = TQFontMetrics(options()->font(true)).height(); if (fontHeight > heightOffset + 20) heightOffset = fontHeight - 20; - QString size = (heightOffset < 8) ? "" : (heightOffset < 20) ? "-large" : "-huge"; + TQString size = (heightOffset < 8) ? "" : (heightOffset < 20) ? "-large" : "-huge"; - QColor titleColor, captionColor, buttonColor; - QImage *titleCenter = NULL, *captionLeft = NULL, + TQColor titleColor, captionColor, buttonColor; + TQImage *titleCenter = NULL, *captionLeft = NULL, *captionRight = NULL, *captionCenter = NULL; @@ -320,7 +320,7 @@ void KeramikHandler::createPixmaps() delete captionCenter; // Create the titlebar center tile - activeTiles[ TitleCenter ] = new QPixmap( *titleCenter ); + activeTiles[ TitleCenter ] = new TQPixmap( *titleCenter ); delete titleCenter; @@ -361,7 +361,7 @@ void KeramikHandler::createPixmaps() delete captionRight; delete captionCenter; - inactiveTiles[ TitleCenter ] = new QPixmap( *titleCenter ); + inactiveTiles[ TitleCenter ] = new TQPixmap( *titleCenter ); delete titleCenter; @@ -380,7 +380,7 @@ void KeramikHandler::createPixmaps() // Buttons // ------------------------------------------------------------------------- - buttonColor = QColor(); //KDecoration::options()->color( ButtonBg, true ); + buttonColor = TQColor(); //KDecoration::options()->color( ButtonBg, true ); titleButtonRound = loadPixmap( "titlebutton-round"+size, buttonColor ); titleButtonSquare = loadPixmap( "titlebutton-square"+size, buttonColor ); @@ -388,7 +388,7 @@ void KeramikHandler::createPixmaps() // Prepare the tiles for use // ------------------------------------------------------------------------- - if ( QApplication::reverseLayout() ) { + if ( TQApplication::reverseLayout() ) { // Fix lighting flip( activeTiles[CaptionSmallLeft], activeTiles[CaptionSmallRight] ); @@ -476,13 +476,13 @@ void KeramikHandler::destroyPixmaps() } -void KeramikHandler::addWidth (int width, QPixmap *&pix, bool left, QPixmap *bottomPix) { +void KeramikHandler::addWidth (int width, TQPixmap *&pix, bool left, TQPixmap *bottomPix) { int w = pix->width()+width; int h = pix->height(); - QPixmap *tmp = new QPixmap (w, h); + TQPixmap *tmp = new TQPixmap (w, h); tmp->fill (); - QPainter p; + TQPainter p; p.begin (tmp); for (int i = 0; i < h; i++) @@ -500,12 +500,12 @@ void KeramikHandler::addWidth (int width, QPixmap *&pix, bool left, QPixmap *bot } -void KeramikHandler::addHeight (int height, QPixmap *&pix) { +void KeramikHandler::addHeight (int height, TQPixmap *&pix) { int w = pix->width(); int h = pix->height()+height; - QPixmap *tmp = new QPixmap (w, h); - QPainter p; + TQPixmap *tmp = new TQPixmap (w, h); + TQPainter p; p.begin (tmp); if (pix->height() > 10) { p.drawPixmap(0, 0, *pix, 0, 0, w, 11); @@ -527,28 +527,28 @@ void KeramikHandler::addHeight (int height, QPixmap *&pix) { } -void KeramikHandler::flip( QPixmap *&pix1, QPixmap *&pix2 ) +void KeramikHandler::flip( TQPixmap *&pix1, TQPixmap *&pix2 ) { // Flip the pixmaps horizontally - QPixmap *tmp = new QPixmap( pix1->xForm( QWMatrix(-1,0,0,1,pix1->width(),0) ) ); + TQPixmap *tmp = new TQPixmap( pix1->xForm( TQWMatrix(-1,0,0,1,pix1->width(),0) ) ); delete pix1; - pix1 = new QPixmap( pix2->xForm( QWMatrix(-1,0,0,1,pix2->width(),0) ) ); + pix1 = new TQPixmap( pix2->xForm( TQWMatrix(-1,0,0,1,pix2->width(),0) ) ); delete pix2; pix2 = tmp; } -void KeramikHandler::pretile( QPixmap *&pix, int size, Qt::Orientation dir ) +void KeramikHandler::pretile( TQPixmap *&pix, int size, Qt::Orientation dir ) { - QPixmap *newpix; - QPainter p; + TQPixmap *newpix; + TQPainter p; if ( dir == Qt::Horizontal ) - newpix = new QPixmap( size, pix->height() ); + newpix = new TQPixmap( size, pix->height() ); else - newpix = new QPixmap( pix->width(), size ); + newpix = new TQPixmap( pix->width(), size ); p.begin( newpix ); p.drawTiledPixmap( newpix->rect(), *pix ) ; @@ -579,9 +579,9 @@ void KeramikHandler::readConfig() } -QPixmap *KeramikHandler::composite( QImage *over, QImage *under ) +TQPixmap *KeramikHandler::composite( TQImage *over, TQImage *under ) { - QImage dest( over->width(), over->height(), 32 ); + TQImage dest( over->width(), over->height(), 32 ); int width = over->width(), height = over->height(); // Clear the destination image @@ -624,25 +624,25 @@ QPixmap *KeramikHandler::composite( QImage *over, QImage *under ) } // Create the final pixmap and return it - return new QPixmap( dest ); + return new TQPixmap( dest ); } -QImage *KeramikHandler::loadImage( const QString &name, const QColor &col ) +TQImage *KeramikHandler::loadImage( const TQString &name, const TQColor &col ) { if ( col.isValid() ) { - QImage *img = new QImage( imageDb->image(name)->copy() ); + TQImage *img = new TQImage( imageDb->image(name)->copy() ); KIconEffect::colorize( *img, col, 1.0 ); return img; } else - return new QImage( imageDb->image(name)->copy() ); + return new TQImage( imageDb->image(name)->copy() ); } -QPixmap *KeramikHandler::loadPixmap( const QString &name, const QColor &col ) +TQPixmap *KeramikHandler::loadPixmap( const TQString &name, const TQColor &col ) { - QImage *img = loadImage( name, col ); - QPixmap *pix = new QPixmap( *img ); + TQImage *img = loadImage( name, col ); + TQPixmap *pix = new TQPixmap( *img ); delete img; return pix; @@ -735,7 +735,7 @@ bool KeramikHandler::supports( Ability ability ) } -const QPixmap *KeramikHandler::tile( TilePixmap tilePix, bool active ) const +const TQPixmap *KeramikHandler::tile( TilePixmap tilePix, bool active ) const { return ( active ? activeTiles[ tilePix ] : inactiveTiles[ tilePix ] ); } @@ -745,9 +745,9 @@ KDecoration* KeramikHandler::createDecoration( KDecorationBridge* bridge ) return new KeramikClient( bridge, this ); } -QValueList< KeramikHandler::BorderSize > KeramikHandler::borderSizes() const +TQValueList< KeramikHandler::BorderSize > KeramikHandler::borderSizes() const { // the list must be sorted - return QValueList< BorderSize >() << BorderNormal << BorderLarge << + return TQValueList< BorderSize >() << BorderNormal << BorderLarge << BorderVeryLarge << BorderHuge << BorderVeryHuge << BorderOversized; } @@ -756,13 +756,13 @@ QValueList< KeramikHandler::BorderSize > KeramikHandler::borderSizes() const -KeramikButton::KeramikButton( KeramikClient* c, const char *name, Button btn, const QString &tip, const int realizeBtns ) - : QButton( c->widget(), name ), +KeramikButton::KeramikButton( KeramikClient* c, const char *name, Button btn, const TQString &tip, const int realizeBtns ) + : TQButton( c->widget(), name ), client( c ), button( btn ), hover( false ), lastbutton( NoButton ) { realizeButtons = realizeBtns; - QToolTip::add( this, tip ); // FRAME + TQToolTip::add( this, tip ); // FRAME setBackgroundMode( NoBackground ); setCursor( arrowCursor ); int size = clientHandler->roundButton()->height(); @@ -778,44 +778,44 @@ KeramikButton::~KeramikButton() } -void KeramikButton::enterEvent( QEvent *e ) +void KeramikButton::enterEvent( TQEvent *e ) { - QButton::enterEvent( e ); + TQButton::enterEvent( e ); hover = true; repaint( false ); } -void KeramikButton::leaveEvent( QEvent *e ) +void KeramikButton::leaveEvent( TQEvent *e ) { - QButton::leaveEvent( e ); + TQButton::leaveEvent( e ); hover = false; repaint( false ); } -void KeramikButton::mousePressEvent( QMouseEvent *e ) +void KeramikButton::mousePressEvent( TQMouseEvent *e ) { lastbutton = e->button(); - QMouseEvent me( e->type(), e->pos(), e->globalPos(), (e->button()&realizeButtons)?LeftButton:NoButton, e->state() ); - QButton::mousePressEvent( &me ); + TQMouseEvent me( e->type(), e->pos(), e->globalPos(), (e->button()&realizeButtons)?LeftButton:NoButton, e->state() ); + TQButton::mousePressEvent( &me ); } -void KeramikButton::mouseReleaseEvent( QMouseEvent *e ) +void KeramikButton::mouseReleaseEvent( TQMouseEvent *e ) { lastbutton = e->button(); - QMouseEvent me( e->type(), e->pos(), e->globalPos(), (e->button()&realizeButtons)?LeftButton:NoButton, e->state() ); - QButton::mouseReleaseEvent( &me ); + TQMouseEvent me( e->type(), e->pos(), e->globalPos(), (e->button()&realizeButtons)?LeftButton:NoButton, e->state() ); + TQButton::mouseReleaseEvent( &me ); } -void KeramikButton::drawButton( QPainter *p ) +void KeramikButton::drawButton( TQPainter *p ) { - const QPixmap *pix; - const QBitmap *deco; + const TQPixmap *pix; + const TQBitmap *deco; int size = clientHandler->roundButton()->height(); // Get the bevel from the client handler @@ -825,20 +825,20 @@ void KeramikButton::drawButton( QPainter *p ) pix = clientHandler->squareButton(); // Draw the button background - const QPixmap *background = clientHandler->tile( TitleCenter, client->isActive() ); + const TQPixmap *background = clientHandler->tile( TitleCenter, client->isActive() ); p->drawPixmap( 0, 0, *background, 0, (background->height()-size+1)/2, size, size ); if ( isDown() ) { // Pressed - p->drawPixmap( QPoint(), *pix, QStyle::visualRect( QRect(2*size, 0, size, size), pix->rect() ) ); - p->translate( QApplication::reverseLayout() ? -1 : 1, 1 ); + p->drawPixmap( TQPoint(), *pix, TQStyle::visualRect( TQRect(2*size, 0, size, size), pix->rect() ) ); + p->translate( TQApplication::reverseLayout() ? -1 : 1, 1 ); } else if ( hover ) // Mouse over - p->drawPixmap( QPoint(), *pix, QStyle::visualRect( QRect(size, 0, size, size), pix->rect() ) ); + p->drawPixmap( TQPoint(), *pix, TQStyle::visualRect( TQRect(size, 0, size, size), pix->rect() ) ); else // Normal - p->drawPixmap( QPoint(), *pix, QStyle::visualRect( QRect(0, 0, size, size), pix->rect() ) ); + p->drawPixmap( TQPoint(), *pix, TQStyle::visualRect( TQRect(0, 0, size, size), pix->rect() ) ); // Draw the button deco on the bevel @@ -856,7 +856,7 @@ void KeramikButton::drawButton( QPainter *p ) // The '?' won't be flipped around in the ctor, so we need to // shift it to the right to compensate for the button shadow // being on the left side of the button in RTL mode. - if ( QApplication::reverseLayout() ) + if ( TQApplication::reverseLayout() ) p->translate( 2, 0 ); break; @@ -906,8 +906,8 @@ KeramikClient::KeramikClient( KDecorationBridge* bridge, KDecorationFactory* fac void KeramikClient::init() { - connect( this, SIGNAL( keepAboveChanged( bool )), SLOT( keepAboveChange( bool ))); - connect( this, SIGNAL( keepBelowChanged( bool )), SLOT( keepBelowChange( bool ))); + connect( this, TQT_SIGNAL( keepAboveChanged( bool )), TQT_SLOT( keepAboveChange( bool ))); + connect( this, TQT_SIGNAL( keepBelowChanged( bool )), TQT_SLOT( keepBelowChange( bool ))); createMainWidget( WStaticContents | WResizeNoErase | WRepaintNoErase ); widget()->installEventFilter( this ); @@ -924,9 +924,9 @@ void KeramikClient::init() void KeramikClient::createLayout() { - QVBoxLayout *mainLayout = new QVBoxLayout( widget() ); - QBoxLayout *titleLayout = new QBoxLayout( 0, QBoxLayout::LeftToRight, 0, 0, 0 ); - QHBoxLayout *windowLayout = new QHBoxLayout(); + TQVBoxLayout *mainLayout = new TQVBoxLayout( widget() ); + TQBoxLayout *titleLayout = new TQBoxLayout( 0, TQBoxLayout::LeftToRight, 0, 0, 0 ); + TQHBoxLayout *windowLayout = new TQHBoxLayout(); largeTitlebar = ( !maximizedVertical() && clientHandler->largeCaptionBubbles() ); largeCaption = ( isActive() && largeTitlebar ); @@ -935,8 +935,8 @@ void KeramikClient::createLayout() int topSpacing = ( largeTitlebar ? 4 : 1 ); int leftBorderWidth = clientHandler->tile( BorderLeft, true )->width(); int rightBorderWidth = clientHandler->tile( BorderRight, true )->width(); - topSpacer = new QSpacerItem( 10, topSpacing, - QSizePolicy::Expanding, QSizePolicy::Minimum ); + topSpacer = new TQSpacerItem( 10, topSpacing, + TQSizePolicy::Expanding, TQSizePolicy::Minimum ); mainLayout->addItem( topSpacer ); @@ -948,22 +948,22 @@ void KeramikClient::createLayout() titleLayout->addSpacing( buttonMargin ); // Left button margin addButtons( titleLayout, options()->customButtonPositions() ? - options()->titleButtonsLeft() : QString(default_left) ); + options()->titleButtonsLeft() : TQString(default_left) ); - titlebar = new QSpacerItem( 10, clientHandler->titleBarHeight(largeTitlebar) - - topSpacing, QSizePolicy::Expanding, QSizePolicy::Minimum ); + titlebar = new TQSpacerItem( 10, clientHandler->titleBarHeight(largeTitlebar) + - topSpacing, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); titleLayout->addItem( titlebar ); titleLayout->addSpacing( buttonSpacing ); addButtons( titleLayout, options()->customButtonPositions() ? - options()->titleButtonsRight() : QString(default_right) ); + options()->titleButtonsRight() : TQString(default_right) ); titleLayout->addSpacing( buttonMargin - 1 ); // Right button margin windowLayout->addSpacing( leftBorderWidth ); // Left border if( isPreview()) - windowLayout->addWidget( new QLabel( i18n( "
Keramik preview
" ), widget())); + windowLayout->addWidget( new TQLabel( i18n( "
Keramik preview
" ), widget())); else - windowLayout->addItem( new QSpacerItem( 0, 0 )); //no widget in the middle + windowLayout->addItem( new TQSpacerItem( 0, 0 )); //no widget in the middle windowLayout->addSpacing( rightBorderWidth ); // Right border } @@ -983,7 +983,7 @@ void KeramikClient::reset( unsigned long ) { // We're switching from small caption bubbles to large if ( !maximizedVertical() ) { - topSpacer->changeSize( 10, 4, QSizePolicy::Expanding, QSizePolicy::Minimum ); + topSpacer->changeSize( 10, 4, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); largeTitlebar = true; largeCaption = isActive(); @@ -999,7 +999,7 @@ void KeramikClient::reset( unsigned long ) else if ( !clientHandler->largeCaptionBubbles() && largeTitlebar ) { // We're switching from large caption bubbles to small - topSpacer->changeSize( 10, 1, QSizePolicy::Expanding, QSizePolicy::Minimum ); + topSpacer->changeSize( 10, 1, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); largeTitlebar = largeCaption = false; widget()->layout()->activate(); @@ -1024,7 +1024,7 @@ void KeramikClient::reset( unsigned long ) } -void KeramikClient::addButtons( QBoxLayout *layout, const QString &s ) +void KeramikClient::addButtons( TQBoxLayout *layout, const TQString &s ) { for ( uint i=0; i < s.length(); i++ ) { @@ -1034,7 +1034,7 @@ void KeramikClient::addButtons( QBoxLayout *layout, const QString &s ) case 'M' : if ( !button[MenuButton] ) { button[MenuButton] = new KeramikButton( this, "menu", MenuButton, i18n("Menu"), LeftButton|RightButton ); - connect( button[MenuButton], SIGNAL( pressed() ), SLOT( menuButtonPressed() ) ); + connect( button[MenuButton], TQT_SIGNAL( pressed() ), TQT_SLOT( menuButtonPressed() ) ); layout->addWidget( button[MenuButton] ); } break; @@ -1046,7 +1046,7 @@ void KeramikClient::addButtons( QBoxLayout *layout, const QString &s ) OnAllDesktopsButton, isOnAllDesktops()?i18n("Not on all desktops"):i18n("On all desktops") ); if(isOnAllDesktops()) button[OnAllDesktopsButton]->toggle(); - connect( button[OnAllDesktopsButton], SIGNAL( clicked() ), SLOT( toggleOnAllDesktops() ) ); + connect( button[OnAllDesktopsButton], TQT_SIGNAL( clicked() ), TQT_SLOT( toggleOnAllDesktops() ) ); layout->addWidget( button[OnAllDesktopsButton] ); } break; @@ -1055,7 +1055,7 @@ void KeramikClient::addButtons( QBoxLayout *layout, const QString &s ) case 'H' : if ( !button[HelpButton] && providesContextHelp() ) { button[HelpButton] = new KeramikButton( this, "help", HelpButton, i18n("Help") ); - connect( button[HelpButton], SIGNAL( clicked() ), SLOT( showContextHelp() ) ); + connect( button[HelpButton], TQT_SIGNAL( clicked() ), TQT_SLOT( showContextHelp() ) ); layout->addWidget( button[HelpButton] ); } break; @@ -1064,7 +1064,7 @@ void KeramikClient::addButtons( QBoxLayout *layout, const QString &s ) case 'I' : if ( !button[MinButton] && isMinimizable() ) { button[MinButton] = new KeramikButton( this, "minimize", MinButton, i18n("Minimize") ); - connect( button[MinButton], SIGNAL( clicked() ), SLOT( minimize() ) ); + connect( button[MinButton], TQT_SIGNAL( clicked() ), TQT_SLOT( minimize() ) ); layout->addWidget( button[MinButton] ); } break; @@ -1073,7 +1073,7 @@ void KeramikClient::addButtons( QBoxLayout *layout, const QString &s ) case 'A' : if ( !button[MaxButton] && isMaximizable() ) { button[MaxButton] = new KeramikButton( this, "maximize", MaxButton, i18n("Maximize"), LeftButton|MidButton|RightButton ); - connect( button[MaxButton], SIGNAL( clicked() ), SLOT( slotMaximize() ) ); + connect( button[MaxButton], TQT_SIGNAL( clicked() ), TQT_SLOT( slotMaximize() ) ); layout->addWidget( button[MaxButton] ); } break; @@ -1082,7 +1082,7 @@ void KeramikClient::addButtons( QBoxLayout *layout, const QString &s ) case 'X' : if ( !button[CloseButton] && isCloseable() ) { button[CloseButton] = new KeramikButton( this, "close", CloseButton, i18n("Close") ); - connect( button[CloseButton], SIGNAL( clicked() ), SLOT( closeWindow() ) ); + connect( button[CloseButton], TQT_SIGNAL( clicked() ), TQT_SLOT( closeWindow() ) ); layout->addWidget( button[CloseButton] ); } break; @@ -1091,7 +1091,7 @@ void KeramikClient::addButtons( QBoxLayout *layout, const QString &s ) case 'F' : if ( !button[AboveButton]) { button[AboveButton] = new KeramikButton( this, "above", AboveButton, i18n("Keep Above Others") ); - connect( button[AboveButton], SIGNAL( clicked() ), SLOT( slotAbove() ) ); + connect( button[AboveButton], TQT_SIGNAL( clicked() ), TQT_SLOT( slotAbove() ) ); layout->addWidget( button[AboveButton] ); } break; @@ -1100,7 +1100,7 @@ void KeramikClient::addButtons( QBoxLayout *layout, const QString &s ) case 'B' : if ( !button[BelowButton]) { button[BelowButton] = new KeramikButton( this, "below", BelowButton, i18n("Keep Below Others") ); - connect( button[BelowButton], SIGNAL( clicked() ), SLOT( slotBelow() ) ); + connect( button[BelowButton], TQT_SIGNAL( clicked() ), TQT_SLOT( slotBelow() ) ); layout->addWidget( button[BelowButton] ); } break; @@ -1110,7 +1110,7 @@ void KeramikClient::addButtons( QBoxLayout *layout, const QString &s ) if ( !button[ShadeButton] && isShadeable() ) { button[ShadeButton] = new KeramikButton( this, "shade", ShadeButton, isSetShade() ? i18n("Unshade") : i18n( "Shade" )); - connect( button[ShadeButton], SIGNAL( clicked() ), SLOT( slotShade() ) ); + connect( button[ShadeButton], TQT_SIGNAL( clicked() ), TQT_SLOT( slotShade() ) ); layout->addWidget( button[ShadeButton] ); } break; @@ -1134,19 +1134,19 @@ void KeramikClient::updateMask() // pixmap, paint the mask on it and then have the X server iterate // over the pixels to compute the bounding rects from it. - QRegion r; + TQRegion r; register int w, y = 0; int nrects; - if ( QApplication::reverseLayout() ) { + if ( TQApplication::reverseLayout() ) { // If the caption bubble is visible and extends above the titlebar if ( largeCaption && captionRect.width() >= 25 ) { register int x = captionRect.left(); w = captionRect.width(); - r += QRegion( x + 11, y++, w - 19, 1 ); - r += QRegion( x + 9, y++, w - 15, 1 ); - r += QRegion( x + 7, y++, w - 12, 1 ); + r += TQRegion( x + 11, y++, w - 19, 1 ); + r += TQRegion( x + 9, y++, w - 15, 1 ); + r += TQRegion( x + 7, y++, w - 12, 1 ); } else { nrects = 8; @@ -1160,13 +1160,13 @@ void KeramikClient::updateMask() w = width(); // FRAME // The rounded titlebar corners - r += QRegion( 9, y++, w - 17, 1 ); - r += QRegion( 7, y++, w - 13, 1 ); - r += QRegion( 5, y++, w - 9, 1 ); - r += QRegion( 4, y++, w - 7, 1 ); - r += QRegion( 3, y++, w - 5, 1 ); - r += QRegion( 2, y++, w - 4, 1 ); - r += QRegion( 1, y++, w - 2, 2 ); + r += TQRegion( 9, y++, w - 17, 1 ); + r += TQRegion( 7, y++, w - 13, 1 ); + r += TQRegion( 5, y++, w - 9, 1 ); + r += TQRegion( 4, y++, w - 7, 1 ); + r += TQRegion( 3, y++, w - 5, 1 ); + r += TQRegion( 2, y++, w - 4, 1 ); + r += TQRegion( 1, y++, w - 2, 2 ); } else { // If the caption bubble is visible and extends above the titlebar @@ -1174,9 +1174,9 @@ void KeramikClient::updateMask() nrects = 11; register int x = captionRect.left(); w = captionRect.width(); - r += QRegion( x + 8, y++, w - 19, 1 ); - r += QRegion( x + 6, y++, w - 15, 1 ); - r += QRegion( x + 5, y++, w - 12, 1 ); + r += TQRegion( x + 8, y++, w - 19, 1 ); + r += TQRegion( x + 6, y++, w - 15, 1 ); + r += TQRegion( x + 5, y++, w - 12, 1 ); } else { nrects = 8; @@ -1190,19 +1190,19 @@ void KeramikClient::updateMask() w = width(); // FRAME // The rounded titlebar corners - r += QRegion( 8, y++, w - 17, 1 ); - r += QRegion( 6, y++, w - 13, 1 ); - r += QRegion( 4, y++, w - 9, 1 ); - r += QRegion( 3, y++, w - 7, 1 ); - r += QRegion( 2, y++, w - 5, 1 ); - r += QRegion( 2, y++, w - 4, 1 ); - r += QRegion( 1, y++, w - 2, 2 ); + r += TQRegion( 8, y++, w - 17, 1 ); + r += TQRegion( 6, y++, w - 13, 1 ); + r += TQRegion( 4, y++, w - 9, 1 ); + r += TQRegion( 3, y++, w - 7, 1 ); + r += TQRegion( 2, y++, w - 5, 1 ); + r += TQRegion( 2, y++, w - 4, 1 ); + r += TQRegion( 1, y++, w - 2, 2 ); } y++; // The part of the window below the titlebar - r += QRegion( 0, y, w, height() - y ); + r += TQRegion( 0, y, w, height() - y ); setMask( r, YXBanded ); @@ -1216,7 +1216,7 @@ void KeramikClient::updateCaptionBuffer() return; bool active = isActive(); - QPixmap *icon = NULL; + TQPixmap *icon = NULL; if ( captionBuffer.size() != captionRect.size() ) captionBuffer.resize( captionRect.size() ); @@ -1224,7 +1224,7 @@ void KeramikClient::updateCaptionBuffer() if ( captionBuffer.isNull() ) return; - QPainter p( &captionBuffer ); + TQPainter p( &captionBuffer ); // Draw the caption bubble if ( active && largeCaption ) { @@ -1243,13 +1243,13 @@ void KeramikClient::updateCaptionBuffer() { if ( active ) { if ( ! activeIcon ) - activeIcon = new QPixmap( this->icon().pixmap( QIconSet::Small, QIconSet::Normal )); // FRAME + activeIcon = new TQPixmap( this->icon().pixmap( TQIconSet::Small, TQIconSet::Normal )); // FRAME icon = activeIcon; } else { if ( ! inactiveIcon ) { - QImage img = this->icon().pixmap( QIconSet::Small, QIconSet::Normal ).convertToImage(); + TQImage img = this->icon().pixmap( TQIconSet::Small, TQIconSet::Normal ).convertToImage(); KIconEffect::semiTransparent( img ); - inactiveIcon = new QPixmap( img ); + inactiveIcon = new TQPixmap( img ); } icon = inactiveIcon; } @@ -1260,7 +1260,7 @@ void KeramikClient::updateCaptionBuffer() ( clientHandler->showAppIcons() ? 16 + iconSpacing : 0 ); int xpos = QMAX( (captionRect.width() - tw) / 3, 8 ); - QRect tr = QStyle::visualRect( QRect(xpos, 1, captionRect.width() - xpos - 10, + TQRect tr = TQStyle::visualRect( TQRect(xpos, 1, captionRect.width() - xpos - 10, captionRect.height() - 4), captionBuffer.rect() ); //p.setPen( Qt::red ); // debug @@ -1269,17 +1269,17 @@ void KeramikClient::updateCaptionBuffer() // Application icon if ( clientHandler->showAppIcons() ) { - QRect iconRect = QStyle::visualRect( QRect(tr.x(), + TQRect iconRect = TQStyle::visualRect( TQRect(tr.x(), 1 + (captionRect.height() - 4 - 16) / 2, 16, 16), tr ); - QRect r( icon->rect() ); + TQRect r( icon->rect() ); r.moveCenter( iconRect.center() ); if ( tr.width() > 16 ) { p.drawPixmap( r, *icon ); } else { - QRect sr( 0, 0, icon->width(), icon->height() ); + TQRect sr( 0, 0, icon->width(), icon->height() ); - if ( QApplication::reverseLayout() ) + if ( TQApplication::reverseLayout() ) sr.addCoords( icon->width() - tr.width(), 0, 0, 0 ); else sr.addCoords( 0, 0, -( icon->width() - tr.width() ), 0 ); @@ -1290,7 +1290,7 @@ void KeramikClient::updateCaptionBuffer() //p.drawRect( r ); // debug - if ( QApplication::reverseLayout() ) + if ( TQApplication::reverseLayout() ) tr.addCoords( 0, 0, -(16 + iconSpacing), 0 ); else tr.addCoords( (16 + iconSpacing), 0, 0, 0 ); @@ -1298,18 +1298,18 @@ void KeramikClient::updateCaptionBuffer() // Draw the titlebar text int flags = AlignVCenter | SingleLine; - flags |= ( QApplication::reverseLayout() ? AlignRight : AlignLeft ); + flags |= ( TQApplication::reverseLayout() ? AlignRight : AlignLeft ); if ( clientHandler->useShadowedText() ) { - p.translate( QApplication::reverseLayout() ? -1 : 1, 1 ); + p.translate( TQApplication::reverseLayout() ? -1 : 1, 1 ); //p.setPen( options()->color(ColorTitleBar, active).dark() ); if (qGray(options()->color(ColorFont, active).rgb()) < 100) - p.setPen( QColor(200,200,200) ); + p.setPen( TQColor(200,200,200) ); else p.setPen( black ); p.drawText( tr, flags, caption() ); - p.translate( QApplication::reverseLayout() ? 1 : -1, -1 ); + p.translate( TQApplication::reverseLayout() ? 1 : -1, -1 ); } p.setPen( options()->color( ColorFont, active ) ); @@ -1321,7 +1321,7 @@ void KeramikClient::updateCaptionBuffer() void KeramikClient::calculateCaptionRect() { - QFontMetrics fm( options()->font(isActive()) ); + TQFontMetrics fm( options()->font(isActive()) ); int cw = fm.width( caption() ) + 95; int titleBaseY = ( largeTitlebar ? 3 : 0 ); @@ -1329,7 +1329,7 @@ void KeramikClient::calculateCaptionRect() cw += 16 + 4; // icon width + space cw = QMIN( cw, titlebar->geometry().width() ); - captionRect = QStyle::visualRect( QRect(titlebar->geometry().x(), (largeCaption ? 0 : titleBaseY), + captionRect = TQStyle::visualRect( TQRect(titlebar->geometry().x(), (largeCaption ? 0 : titleBaseY), cw, clientHandler->titleBarHeight(largeCaption) ), titlebar->geometry() ); } @@ -1337,7 +1337,7 @@ void KeramikClient::calculateCaptionRect() void KeramikClient::captionChange() { - QRect r( captionRect ); + TQRect r( captionRect ); calculateCaptionRect(); if ( r.size() != captionRect.size() ) @@ -1393,7 +1393,7 @@ void KeramikClient::maximizeChange() { if ( maximizeMode() & MaximizeVertical ) { // We've been maximized - shrink the titlebar by 3 pixels - topSpacer->changeSize( 10, 1, QSizePolicy::Expanding, QSizePolicy::Minimum ); + topSpacer->changeSize( 10, 1, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); largeCaption = largeTitlebar = false; calculateCaptionRect(); @@ -1403,7 +1403,7 @@ void KeramikClient::maximizeChange() widget()->repaint( false ); } else if (( maximizeMode() & MaximizeVertical ) == 0 && !largeTitlebar ) { // We've been restored - enlarge the titlebar by 3 pixels - topSpacer->changeSize( 10, 4, QSizePolicy::Expanding, QSizePolicy::Minimum ); + topSpacer->changeSize( 10, 4, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); largeCaption = largeTitlebar = true; calculateCaptionRect(); @@ -1415,8 +1415,8 @@ void KeramikClient::maximizeChange() } if ( button[ MaxButton ] ) { - QToolTip::remove( button[ MaxButton ] ); - QToolTip::add( button[ MaxButton ], maximizeMode() == MaximizeFull ? i18n("Restore") : i18n("Maximize") ); + TQToolTip::remove( button[ MaxButton ] ); + TQToolTip::add( button[ MaxButton ], maximizeMode() == MaximizeFull ? i18n("Restore") : i18n("Maximize") ); button[ MaxButton ]->repaint(); } } @@ -1427,8 +1427,8 @@ void KeramikClient::desktopChange() if ( button[ OnAllDesktopsButton ] ) { button[ OnAllDesktopsButton ]->repaint( true ); - QToolTip::remove( button[ OnAllDesktopsButton ] ); - QToolTip::add( button[ OnAllDesktopsButton ], isOnAllDesktops() ? i18n("Not on all desktops") : i18n("On all desktops") ); + TQToolTip::remove( button[ OnAllDesktopsButton ] ); + TQToolTip::add( button[ OnAllDesktopsButton ], isOnAllDesktops() ? i18n("Not on all desktops") : i18n("On all desktops") ); } } @@ -1438,8 +1438,8 @@ void KeramikClient::shadeChange() if ( button[ ShadeButton ] ) { button[ ShadeButton ]->repaint( true ); - QToolTip::remove( button[ ShadeButton ] ); - QToolTip::add( button[ ShadeButton ], isSetShade() ? i18n("Unshade") : i18n("Shade") ); + TQToolTip::remove( button[ ShadeButton ] ); + TQToolTip::add( button[ ShadeButton ], isSetShade() ? i18n("Unshade") : i18n("Shade") ); } } @@ -1460,12 +1460,12 @@ void KeramikClient::keepBelowChange( bool ) void KeramikClient::menuButtonPressed() { - QPoint menuTop ( button[MenuButton]->rect().topLeft() ); - QPoint menuBottom ( button[MenuButton]->rect().bottomRight() ); - menuTop += QPoint(-6, -3); - menuBottom += QPoint(6, 3); + TQPoint menuTop ( button[MenuButton]->rect().topLeft() ); + TQPoint menuBottom ( button[MenuButton]->rect().bottomRight() ); + menuTop += TQPoint(-6, -3); + menuBottom += TQPoint(6, 3); KDecorationFactory* f = factory(); - showWindowMenu( QRect( button[MenuButton]->mapToGlobal( menuTop ), + showWindowMenu( TQRect( button[MenuButton]->mapToGlobal( menuTop ), button[MenuButton]->mapToGlobal( menuBottom )) ); if( !f->exists( this )) // 'this' was destroyed return; @@ -1500,13 +1500,13 @@ void KeramikClient::slotShade() } -void KeramikClient::paintEvent( QPaintEvent *e ) +void KeramikClient::paintEvent( TQPaintEvent *e ) { if ( !keramik_initialized ) return; - QPainter p( widget()); - QRect updateRect( e->rect() ); + TQPainter p( widget()); + TQRect updateRect( e->rect() ); bool active = isActive(); int titleBaseY = ( largeTitlebar ? 3 : 0 ); @@ -1607,18 +1607,18 @@ void KeramikClient::paintEvent( QPaintEvent *e ) *clientHandler->tile( GrabBarRight, active ) ); } - // Extra drawline for the 1 pixel empty space QLayout leaves when a window is shaded. + // Extra drawline for the 1 pixel empty space TQLayout leaves when a window is shaded. p.setPen( options()->color( ColorTitleBlend, active ) ); p.drawLine( leftBorderWidth, height() - grabBarHeight - 1, width() - rightBorderWidth - 1, height() - grabBarHeight - 1 ); } -void KeramikClient::resizeEvent( QResizeEvent *e ) +void KeramikClient::resizeEvent( TQResizeEvent *e ) { // FRAME Client::resizeEvent( e ); - QRect r( captionRect ); + TQRect r( captionRect ); calculateCaptionRect(); if ( r.size() != captionRect.size() ) @@ -1644,31 +1644,31 @@ void KeramikClient::resizeEvent( QResizeEvent *e ) if ( dx ) { widget()->update( width() - dx + 1, 0, dx, height() ); - widget()->update( QRect( QPoint(4,4), titlebar->geometry().bottomLeft() - QPoint(1,0) ) ); - widget()->update( QRect( titlebar->geometry().topRight(), QPoint( width() - 4, + widget()->update( TQRect( TQPoint(4,4), titlebar->geometry().bottomLeft() - TQPoint(1,0) ) ); + widget()->update( TQRect( titlebar->geometry().topRight(), TQPoint( width() - 4, titlebar->geometry().bottom() ) ) ); // Titlebar needs no paint event - QApplication::postEvent( this, new QPaintEvent( titlebar->geometry(), FALSE ) ); + TQApplication::postEvent( this, new TQPaintEvent( titlebar->geometry(), FALSE ) ); } } } -void KeramikClient::mouseDoubleClickEvent( QMouseEvent *e ) +void KeramikClient::mouseDoubleClickEvent( TQMouseEvent *e ) { if ( e->button() == LeftButton - && QRect( 0, 0, width(), clientHandler->titleBarHeight( largeTitlebar ) ).contains( e->pos() ) ) + && TQRect( 0, 0, width(), clientHandler->titleBarHeight( largeTitlebar ) ).contains( e->pos() ) ) titlebarDblClickOperation(); } -void KeramikClient::wheelEvent( QWheelEvent *e ) +void KeramikClient::wheelEvent( TQWheelEvent *e ) { if (isSetShade() - || QRect( 0, 0, width(), clientHandler->titleBarHeight( largeTitlebar ) ).contains( e->pos() ) ) + || TQRect( 0, 0, width(), clientHandler->titleBarHeight( largeTitlebar ) ).contains( e->pos() ) ) titlebarMouseWheelOperation( e->delta()); } -KeramikClient::Position KeramikClient::mousePosition( const QPoint &p ) const +KeramikClient::Position KeramikClient::mousePosition( const TQPoint &p ) const { int titleBaseY = (largeTitlebar ? 3 : 0); @@ -1745,7 +1745,7 @@ KeramikClient::Position KeramikClient::mousePosition( const QPoint &p ) const } -void KeramikClient::resize( const QSize& s ) +void KeramikClient::resize( const TQSize& s ) { widget()->resize( s ); } @@ -1774,37 +1774,37 @@ void KeramikClient::borders( int& left, int& right, int& top, int& bottom ) cons } -QSize KeramikClient::minimumSize() const +TQSize KeramikClient::minimumSize() const { return widget()->minimumSize(); } -bool KeramikClient::eventFilter( QObject* o, QEvent* e ) +bool KeramikClient::eventFilter( TQObject* o, TQEvent* e ) { if ( o != widget() ) return false; switch ( e->type() ) { - case QEvent::Resize: - resizeEvent( static_cast< QResizeEvent* >( e ) ); + case TQEvent::Resize: + resizeEvent( static_cast< TQResizeEvent* >( e ) ); return true; - 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::MouseButtonPress: - processMousePressEvent( static_cast< QMouseEvent* >( e ) ); + case TQEvent::MouseButtonPress: + processMousePressEvent( static_cast< TQMouseEvent* >( e ) ); return true; - case QEvent::Wheel: - wheelEvent( static_cast< QWheelEvent* >( e )); + case TQEvent::Wheel: + wheelEvent( static_cast< TQWheelEvent* >( e )); return true; default: diff --git a/kwin/clients/keramik/keramik.h b/kwin/clients/keramik/keramik.h index 40a24a058..6f5a4a6e4 100644 --- a/kwin/clients/keramik/keramik.h +++ b/kwin/clients/keramik/keramik.h @@ -24,7 +24,7 @@ #ifndef __KERAMIK_H #define __KERAMIK_H -#include +#include #include #include @@ -60,7 +60,7 @@ namespace Keramik { KeramikHandler(); ~KeramikHandler(); - virtual QValueList< BorderSize > borderSizes() const; + virtual TQValueList< BorderSize > borderSizes() const; virtual bool reset( unsigned long changed ); virtual KDecoration* createDecoration( KDecorationBridge* ); virtual bool supports( Ability ability ); @@ -77,36 +77,36 @@ namespace Keramik { int grabBarHeight() const { return activeTiles[GrabBarCenter]->height(); } - const QPixmap *roundButton() const { return titleButtonRound; } - const QPixmap *squareButton() const { return titleButtonSquare; } - const QBitmap *buttonDeco( ButtonDeco deco ) const + const TQPixmap *roundButton() const { return titleButtonRound; } + const TQPixmap *squareButton() const { return titleButtonSquare; } + const TQBitmap *buttonDeco( ButtonDeco deco ) const { return buttonDecos[ deco ]; } - inline const QPixmap *tile( TilePixmap tilePix, bool active ) const; + inline const TQPixmap *tile( TilePixmap tilePix, bool active ) const; private: void readConfig(); void createPixmaps(); void destroyPixmaps(); - void addWidth (int width, QPixmap *&pix, bool left, QPixmap *bottomPix); - void addHeight (int height, QPixmap *&pix); - void flip( QPixmap *&, QPixmap *& ); - void pretile( QPixmap *&, int, Qt::Orientation ); - QPixmap *composite( QImage *, QImage * ); - QImage *loadImage( const QString &, const QColor & ); - QPixmap *loadPixmap( const QString &, const QColor & ); + void addWidth (int width, TQPixmap *&pix, bool left, TQPixmap *bottomPix); + void addHeight (int height, TQPixmap *&pix); + void flip( TQPixmap *&, TQPixmap *& ); + void pretile( TQPixmap *&, int, Qt::Orientation ); + TQPixmap *composite( TQImage *, TQImage * ); + TQImage *loadImage( const TQString &, const TQColor & ); + TQPixmap *loadPixmap( const TQString &, const TQColor & ); bool showIcons:1, shadowedText:1, smallCaptionBubbles:1, largeGrabBars:1; SettingsCache *settings_cache; KeramikImageDb *imageDb; - QPixmap *activeTiles[ NumTiles ]; - QPixmap *inactiveTiles[ NumTiles ]; - QBitmap *buttonDecos[ NumButtonDecos ]; + TQPixmap *activeTiles[ NumTiles ]; + TQPixmap *inactiveTiles[ NumTiles ]; + TQBitmap *buttonDecos[ NumButtonDecos ]; - QPixmap *titleButtonRound, *titleButtonSquare; + TQPixmap *titleButtonRound, *titleButtonSquare; }; // class KeramikHandler @@ -114,17 +114,17 @@ namespace Keramik { class KeramikButton : public QButton { public: - KeramikButton( KeramikClient *, const char *, Button, const QString &, const int realizeBtns = LeftButton ); + KeramikButton( KeramikClient *, const char *, Button, const TQString &, const int realizeBtns = LeftButton ); ~KeramikButton(); ButtonState lastButton() const { return lastbutton; } private: - void enterEvent( QEvent * ); - void leaveEvent( QEvent * ); - void mousePressEvent( QMouseEvent * ); - void mouseReleaseEvent( QMouseEvent * ); - void drawButton( QPainter * ); + void enterEvent( TQEvent * ); + void leaveEvent( TQEvent * ); + void mousePressEvent( TQMouseEvent * ); + void mouseReleaseEvent( TQMouseEvent * ); + void drawButton( TQPainter * ); private: KeramikClient *client; @@ -145,11 +145,11 @@ namespace Keramik { ~KeramikClient(); virtual void init(); virtual void reset( unsigned long changed ); - virtual Position mousePosition( const QPoint& p ) const; + virtual Position mousePosition( const TQPoint& p ) const; virtual void borders( int& left, int& right, int& top, int& bottom ) const; - virtual void resize( const QSize& s ); - virtual QSize minimumSize() const; - virtual bool eventFilter( QObject* o, QEvent* e ); + virtual void resize( const TQSize& s ); + virtual TQSize minimumSize() const; + virtual bool eventFilter( TQObject* o, TQEvent* e ); virtual void activeChange(); virtual void captionChange(); virtual void maximizeChange(); @@ -158,14 +158,14 @@ namespace Keramik { private: void createLayout(); - void addButtons( QBoxLayout*, const QString & ); + void addButtons( TQBoxLayout*, const TQString & ); void updateMask(); // FRAME void updateCaptionBuffer(); void iconChange(); - void resizeEvent( QResizeEvent *); // FRAME - void paintEvent( QPaintEvent *); // FRAME - void mouseDoubleClickEvent( QMouseEvent * ); // FRAME - void wheelEvent( QWheelEvent *); //FRAME + void resizeEvent( TQResizeEvent *); // FRAME + void paintEvent( TQPaintEvent *); // FRAME + void mouseDoubleClickEvent( TQMouseEvent * ); // FRAME + void wheelEvent( TQWheelEvent *); //FRAME int width() const { return widget()->width(); } int height() const { return widget()->height(); } @@ -185,11 +185,11 @@ namespace Keramik { void keepBelowChange( bool ); private: - QSpacerItem *topSpacer, *titlebar; + TQSpacerItem *topSpacer, *titlebar; KeramikButton *button[ NumButtons ]; - QRect captionRect; - QPixmap captionBuffer; - QPixmap *activeIcon, *inactiveIcon; + TQRect captionRect; + TQPixmap captionBuffer; + TQPixmap *activeIcon, *inactiveIcon; bool captionBufferDirty:1, maskDirty:1; bool largeCaption:1, largeTitlebar:1; }; // class KeramikClient diff --git a/kwin/clients/kwmtheme/cli_installer/main.cpp b/kwin/clients/kwmtheme/cli_installer/main.cpp index bdc04a1de..abf2bad3d 100644 --- a/kwin/clients/kwmtheme/cli_installer/main.cpp +++ b/kwin/clients/kwmtheme/cli_installer/main.cpp @@ -1,5 +1,5 @@ -#include -#include +#include +#include #include #include #include @@ -17,10 +17,10 @@ static KCmdLineOptions options[] = KCmdLineLastOption }; -void copy(const QString &src, const QString &dest) +void copy(const TQString &src, const TQString &dest) { - QFile copyInput(src); - QFile copyOutput(dest); + TQFile copyInput(src); + TQFile copyOutput(dest); if(!copyInput.open(IO_ReadOnly)){ kdWarning() << "Couldn't open " << src << endl; return; @@ -48,25 +48,25 @@ int main(int argc, char **argv) return(1); } - QString srcStr = QString(QFile::decodeName(args->arg(0))); - QFile f(srcStr); - QString tmpStr; + TQString srcStr = TQString(TQFile::decodeName(args->arg(0))); + TQFile f(srcStr); + TQString tmpStr; if(!f.exists()){ kdWarning() << "Specified theme config file doesn't exist!" << endl; return(2); } - QStringList appDirs = KGlobal::dirs()->findDirs("data", "kwin"); - QString localDirStr = *(appDirs.end()); + TQStringList appDirs = KGlobal::dirs()->findDirs("data", "kwin"); + TQString localDirStr = *(appDirs.end()); if(localDirStr.isEmpty()){ localDirStr = KGlobal::dirs()->saveLocation("data", "kwin"); } localDirStr += "/pics/"; - if(!QFile::exists(localDirStr)) - QDir().mkdir(localDirStr); + if(!TQFile::exists(localDirStr)) + TQDir().mkdir(localDirStr); - QFileInfo fi(f); + TQFileInfo fi(f); KSimpleConfig input(fi.absFilePath()); srcStr = fi.dirPath(true) + "/"; KConfig *output = KGlobal::config(); diff --git a/kwin/clients/kwmtheme/kwmthemeclient.cpp b/kwin/clients/kwmtheme/kwmthemeclient.cpp index a422f31fb..89dc6a564 100644 --- a/kwin/clients/kwmtheme/kwmthemeclient.cpp +++ b/kwin/clients/kwmtheme/kwmthemeclient.cpp @@ -1,26 +1,26 @@ #include #include "kwmthemeclient.h" #include -#include -#include -#include +#include +#include +#include #include #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include namespace KWMTheme { -/* static QPixmap stretchPixmap(QPixmap& src, bool stretchVert){ - QPixmap dest; - QBitmap *srcMask, *destMask; +/* static TQPixmap stretchPixmap(TQPixmap& src, bool stretchVert){ + TQPixmap dest; + TQBitmap *srcMask, *destMask; int w, h, w2, h2; - QPainter p; + TQPainter p; if (src.isNull()) return src; @@ -46,9 +46,9 @@ namespace KWMTheme { p.drawTiledPixmap(0, 0, w2, h2, src); p.end(); - srcMask = (QBitmap*)src.mask(); + srcMask = (TQBitmap*)src.mask(); if (srcMask){ - destMask = (QBitmap*)dest.mask(); + destMask = (TQBitmap*)dest.mask(); p.begin(destMask); p.drawTiledPixmap(0, 0, w2, h2, *srcMask); p.end(); @@ -62,8 +62,8 @@ inline const KDecorationOptions* options() { return KDecoration::options(); } enum FramePixmap{FrameTop=0, FrameBottom, FrameLeft, FrameRight, FrameTopLeft, FrameTopRight, FrameBottomLeft, FrameBottomRight}; -static QPixmap *framePixmaps[8]; -static QPixmap *menuPix, *iconifyPix, *closePix, *maxPix, *minmaxPix, +static TQPixmap *framePixmaps[8]; +static TQPixmap *menuPix, *iconifyPix, *closePix, *maxPix, *minmaxPix, *pinupPix, *pindownPix; static KPixmap *aTitlePix = 0; static KPixmap *iTitlePix = 0; @@ -85,11 +85,11 @@ static void create_pixmaps() KConfig *config = KGlobal::config(); config->setGroup("General"); - QString tmpStr; + TQString tmpStr; for(int i=0; i < 8; ++i) { - framePixmaps[i] = new QPixmap(locate("data", + framePixmaps[i] = new TQPixmap(locate("data", "kwin/pics/"+config->readEntry(keys[i], " "))); if(framePixmaps[i]->isNull()) kdWarning() << "Unable to load frame pixmap for " << keys[i] << endl; @@ -110,19 +110,19 @@ static void create_pixmaps() maxExtent++; - menuPix = new QPixmap(locate("data", + menuPix = new TQPixmap(locate("data", "kwin/pics/"+config->readEntry("menu", " "))); - iconifyPix = new QPixmap(locate("data", + iconifyPix = new TQPixmap(locate("data", "kwin/pics/"+config->readEntry("iconify", " "))); - maxPix = new QPixmap(locate("appdata", + maxPix = new TQPixmap(locate("appdata", "pics/"+config->readEntry("maximize", " "))); - minmaxPix = new QPixmap(locate("data", + minmaxPix = new TQPixmap(locate("data", "kwin/pics/"+config->readEntry("maximizedown", " "))); - closePix = new QPixmap(locate("data", + closePix = new TQPixmap(locate("data", "kwin/pics/"+config->readEntry("close", " "))); - pinupPix = new QPixmap(locate("data", + pinupPix = new TQPixmap(locate("data", "kwin/pics/"+config->readEntry("pinup", " "))); - pindownPix = new QPixmap(locate("data", + pindownPix = new TQPixmap(locate("data", "kwin/pics/"+config->readEntry("pindown", " "))); if(menuPix->isNull()) menuPix->load(locate("data", "kwin/pics/menu.png")); @@ -222,7 +222,7 @@ static void delete_pixmaps() titleSunken = false; } -void MyButton::drawButtonLabel(QPainter *p) +void MyButton::drawButtonLabel(TQPainter *p) { if(pixmap()){ // If we have a theme who's button covers the entire width or @@ -230,9 +230,9 @@ void MyButton::drawButtonLabel(QPainter *p) // some visual notification of button presses. i.e. for MGBriezh int offset = (isDown() && ((pixmap()->width() >= width()) || (pixmap()->height() >= height()))) ? 1 : 0; - style().drawItem(p, QRect( offset, offset, width(), height() ), + style().drawItem(p, TQRect( offset, offset, width(), height() ), AlignCenter, colorGroup(), - true, pixmap(), QString::null); + true, pixmap(), TQString::null); } } @@ -247,32 +247,32 @@ void KWMThemeClient::init() widget()->installEventFilter( this ); stickyBtn = maxBtn = mnuBtn = 0; - layout = new QGridLayout(widget()); + layout = new TQGridLayout(widget()); layout->addColSpacing(0, maxExtent); layout->addColSpacing(2, maxExtent); layout->addRowSpacing(0, maxExtent); - layout->addItem(new QSpacerItem(1, 1, QSizePolicy::Fixed, - QSizePolicy::Expanding)); + layout->addItem(new TQSpacerItem(1, 1, TQSizePolicy::Fixed, + TQSizePolicy::Expanding)); if( isPreview()) - layout->addWidget( new QLabel( i18n( "
KWMTheme
" ), widget()), 2, 1); + layout->addWidget( new TQLabel( i18n( "
KWMTheme
" ), widget()), 2, 1); else - layout->addItem( new QSpacerItem( 0, 0 ), 2, 1); + layout->addItem( new TQSpacerItem( 0, 0 ), 2, 1); // Without the next line, shading flickers - layout->addItem( new QSpacerItem(0, 0, QSizePolicy::Fixed, QSizePolicy::Expanding) ); + layout->addItem( new TQSpacerItem(0, 0, TQSizePolicy::Fixed, TQSizePolicy::Expanding) ); layout->addRowSpacing(3, maxExtent); layout->setRowStretch(2, 10); layout->setColStretch(1, 10); - QBoxLayout* hb = new QBoxLayout(0, QBoxLayout::LeftToRight, 0, 0, 0); + TQBoxLayout* hb = new TQBoxLayout(0, TQBoxLayout::LeftToRight, 0, 0, 0); layout->addLayout( hb, 1, 1 ); KConfig *config = KGlobal::config(); config->setGroup("Buttons"); - QString val; + TQString val; MyButton *btn; int i; static const char *defaultButtons[]={"Menu","Sticky","Off","Iconify", @@ -280,54 +280,54 @@ void KWMThemeClient::init() static const char keyOffsets[]={"ABCDEF"}; for(i=0; i < 6; ++i){ if(i == 3){ - titlebar = new QSpacerItem(10, 20, QSizePolicy::Expanding, - QSizePolicy::Minimum ); + titlebar = new TQSpacerItem(10, 20, TQSizePolicy::Expanding, + TQSizePolicy::Minimum ); hb->addItem( titlebar ); } - QString key("Button"); - key += QChar(keyOffsets[i]); + TQString key("Button"); + key += TQChar(keyOffsets[i]); val = config->readEntry(key, defaultButtons[i]); if(val == "Menu"){ mnuBtn = new MyButton(widget(), "menu"); - QToolTip::add( mnuBtn, i18n("Menu")); + TQToolTip::add( mnuBtn, i18n("Menu")); iconChange(); hb->addWidget(mnuBtn); mnuBtn->setFixedSize(20, 20); - connect(mnuBtn, SIGNAL(pressed()), this, - SLOT(menuButtonPressed())); + connect(mnuBtn, TQT_SIGNAL(pressed()), this, + TQT_SLOT(menuButtonPressed())); } else if(val == "Sticky"){ stickyBtn = new MyButton(widget(), "sticky"); - QToolTip::add( stickyBtn, i18n("Sticky")); + TQToolTip::add( stickyBtn, i18n("Sticky")); if (isOnAllDesktops()) stickyBtn->setPixmap(*pindownPix); else stickyBtn->setPixmap(*pinupPix); - connect(stickyBtn, SIGNAL( clicked() ), this, SLOT(toggleOnAllDesktops())); + connect(stickyBtn, TQT_SIGNAL( clicked() ), this, TQT_SLOT(toggleOnAllDesktops())); hb->addWidget(stickyBtn); stickyBtn->setFixedSize(20, 20); } else if((val == "Iconify") && isMinimizable()){ btn = new MyButton(widget(), "iconify"); - QToolTip::add( btn, i18n("Minimize")); + TQToolTip::add( btn, i18n("Minimize")); btn->setPixmap(*iconifyPix); - connect(btn, SIGNAL(clicked()), this, SLOT(minimize())); + connect(btn, TQT_SIGNAL(clicked()), this, TQT_SLOT(minimize())); hb->addWidget(btn); btn->setFixedSize(20, 20); } else if((val == "Maximize") && isMaximizable()){ maxBtn = new MyButton(widget(), "max"); - QToolTip::add( maxBtn, i18n("Maximize")); + TQToolTip::add( maxBtn, i18n("Maximize")); maxBtn->setPixmap(*maxPix); - connect(maxBtn, SIGNAL(clicked()), this, SLOT(maximize())); + connect(maxBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(maximize())); hb->addWidget(maxBtn); maxBtn->setFixedSize(20, 20); } else if((val == "Close") && isCloseable()){ btn = new MyButton(widget(), "close"); - QToolTip::add( btn, i18n("Close")); + TQToolTip::add( btn, i18n("Close")); btn->setPixmap(*closePix); - connect(btn, SIGNAL(clicked()), this, SLOT(closeWindow())); + connect(btn, TQT_SIGNAL(clicked()), this, TQT_SLOT(closeWindow())); hb->addWidget(btn); btn->setFixedSize(20, 20); } @@ -350,17 +350,17 @@ void KWMThemeClient::init() widget()->setBackgroundMode(NoBackground); } -void KWMThemeClient::drawTitle(QPainter &dest) +void KWMThemeClient::drawTitle(TQPainter &dest) { - QRect titleRect = titlebar->geometry(); - QRect r(0, 0, titleRect.width(), titleRect.height()); - QPixmap buffer; + TQRect titleRect = titlebar->geometry(); + TQRect r(0, 0, titleRect.width(), titleRect.height()); + TQPixmap buffer; if(buffer.width() == r.width()) return; buffer.resize(r.size()); - QPainter p; + TQPainter p; p.begin(&buffer); if(titleSunken){ @@ -385,7 +385,7 @@ void KWMThemeClient::drawTitle(QPainter &dest) } else{ p.fillRect(r, options()->colorGroup(KDecorationOptions::ColorTitleBar, isActive()). - brush(QColorGroup::Button)); + brush(TQColorGroup::Button)); } p.setFont(options()->font(isActive())); p.setPen(options()->color(KDecorationOptions::ColorFont, isActive())); @@ -399,7 +399,7 @@ void KWMThemeClient::drawTitle(QPainter &dest) } -void KWMThemeClient::resizeEvent( QResizeEvent* ) +void KWMThemeClient::resizeEvent( TQResizeEvent* ) { doShape(); widget()->repaint(); @@ -410,9 +410,9 @@ void KWMThemeClient::captionChange() widget()->repaint( titlebar->geometry(), false ); } -void KWMThemeClient::paintEvent( QPaintEvent *) +void KWMThemeClient::paintEvent( TQPaintEvent *) { - QPainter p; + TQPainter p; p.begin(widget()); int x,y; // first the corners @@ -445,8 +445,8 @@ void KWMThemeClient::paintEvent( QPaintEvent *) framePixmaps[FrameBottomRight]->height()-h4, w4, h4); - QPixmap pm; - QWMatrix m; + TQPixmap pm; + TQWMatrix m; int n,s,w; //top pm = *framePixmaps[FrameTop]; @@ -557,7 +557,7 @@ void KWMThemeClient::paintEvent( QPaintEvent *) } drawTitle(p); - QColor c = widget()->colorGroup().background(); + TQColor c = widget()->colorGroup().background(); // KWM evidently had a 1 pixel border around the client window. We // emulate it here, but should be removed at some point in order to @@ -568,7 +568,7 @@ void KWMThemeClient::paintEvent( QPaintEvent *) // We fill the area behind the wrapped widget to ensure that // shading animation is drawn as smoothly as possible - QRect r(layout->cellGeometry(2, 1)); + TQRect r(layout->cellGeometry(2, 1)); p.fillRect( r.x(), r.y(), r.width(), r.height(), c); p.end(); } @@ -576,9 +576,9 @@ void KWMThemeClient::paintEvent( QPaintEvent *) void KWMThemeClient::doShape() { - QBitmap shapemask(width(), height()); + TQBitmap shapemask(width(), height()); shapemask.fill(color0); - QPainter p; + TQPainter p; p.begin(&shapemask); p.setBrush(color1); p.setPen(color1); @@ -625,8 +625,8 @@ void KWMThemeClient::doShape() else p.fillRect(width()-w4,height()-h4,w4,h4,color1); - QPixmap pm; - QWMatrix m; + TQPixmap pm; + TQWMatrix m; int n,s,w; //top if (framePixmaps[FrameTop]->mask()) @@ -744,13 +744,13 @@ void KWMThemeClient::doShape() } -void KWMThemeClient::showEvent(QShowEvent *) +void KWMThemeClient::showEvent(TQShowEvent *) { doShape(); widget()->repaint(false); } -void KWMThemeClient::mouseDoubleClickEvent( QMouseEvent * e ) +void KWMThemeClient::mouseDoubleClickEvent( TQMouseEvent * e ) { if (e->button() == LeftButton && titlebar->geometry().contains( e->pos() ) ) titlebarDblClickOperation(); @@ -761,8 +761,8 @@ void KWMThemeClient::desktopChange() if (stickyBtn) { bool on = isOnAllDesktops(); stickyBtn->setPixmap(on ? *pindownPix : *pinupPix); - QToolTip::remove( stickyBtn ); - QToolTip::add( stickyBtn, on ? i18n("Unsticky") : i18n("Sticky") ); + TQToolTip::remove( stickyBtn ); + TQToolTip::add( stickyBtn, on ? i18n("Unsticky") : i18n("Sticky") ); } } @@ -771,8 +771,8 @@ void KWMThemeClient::maximizeChange() if (maxBtn) { bool m = maximizeMode() == MaximizeFull; maxBtn->setPixmap(m ? *minmaxPix : *maxPix); - QToolTip::remove( maxBtn ); - QToolTip::add( maxBtn, m ? i18n("Restore") : i18n("Maximize")); + TQToolTip::remove( maxBtn ); + TQToolTip::add( maxBtn, m ? i18n("Restore") : i18n("Maximize")); } } @@ -786,7 +786,7 @@ void KWMThemeClient::activeChange() widget()->update(); } -KDecoration::Position KWMThemeClient::mousePosition(const QPoint &p) const +KDecoration::Position KWMThemeClient::mousePosition(const TQPoint &p) const { Position m = KDecoration::mousePosition(p); // corners @@ -820,47 +820,47 @@ KDecoration::Position KWMThemeClient::mousePosition(const QPoint &p) const void KWMThemeClient::menuButtonPressed() { mnuBtn->setDown(false); // will stay down if I don't do this - QPoint pos = mnuBtn->mapToGlobal(mnuBtn->rect().bottomLeft()); + TQPoint pos = mnuBtn->mapToGlobal(mnuBtn->rect().bottomLeft()); showWindowMenu( pos ); } void KWMThemeClient::iconChange() { if(mnuBtn){ - if( icon().pixmap( QIconSet::Small, QIconSet::Normal ).isNull()){ + if( icon().pixmap( TQIconSet::Small, TQIconSet::Normal ).isNull()){ mnuBtn->setPixmap(*menuPix); } else{ - mnuBtn->setPixmap(icon().pixmap( QIconSet::Small, QIconSet::Normal )); + mnuBtn->setPixmap(icon().pixmap( TQIconSet::Small, TQIconSet::Normal )); } } } -bool KWMThemeClient::eventFilter( QObject* o, QEvent* e ) +bool KWMThemeClient::eventFilter( TQObject* o, TQEvent* e ) { if ( o != widget() ) return false; switch ( e->type() ) { - case QEvent::Resize: - resizeEvent( static_cast< QResizeEvent* >( e ) ); + case TQEvent::Resize: + resizeEvent( static_cast< TQResizeEvent* >( e ) ); return true; - 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::MouseButtonPress: - processMousePressEvent( static_cast< QMouseEvent* >( e ) ); + case TQEvent::MouseButtonPress: + processMousePressEvent( static_cast< TQMouseEvent* >( e ) ); return true; - case QEvent::Show: - showEvent( static_cast< QShowEvent* >( e ) ); + case TQEvent::Show: + showEvent( static_cast< TQShowEvent* >( e ) ); return true; default: @@ -868,12 +868,12 @@ bool KWMThemeClient::eventFilter( QObject* o, QEvent* e ) } } -QSize KWMThemeClient::minimumSize() const +TQSize KWMThemeClient::minimumSize() const { - return widget()->minimumSize().expandedTo( QSize( 100, 50 )); + return widget()->minimumSize().expandedTo( TQSize( 100, 50 )); } -void KWMThemeClient::resize( const QSize& s ) +void KWMThemeClient::resize( const TQSize& s ) { widget()->resize( s ); } diff --git a/kwin/clients/kwmtheme/kwmthemeclient.h b/kwin/clients/kwmtheme/kwmthemeclient.h index b1d623965..7357f6c26 100644 --- a/kwin/clients/kwmtheme/kwmthemeclient.h +++ b/kwin/clients/kwmtheme/kwmthemeclient.h @@ -1,8 +1,8 @@ #ifndef __KWMTHEMECLIENT_H #define __KWMTHEMECLIENT_H -#include -#include +#include +#include #include #include #include @@ -16,10 +16,10 @@ namespace KWMTheme { class MyButton : public QToolButton { public: - MyButton(QWidget *parent=0, const char *name=0) - : QToolButton(parent, name){setAutoRaise(true);setCursor( arrowCursor ); } + MyButton(TQWidget *parent=0, const char *name=0) + : TQToolButton(parent, name){setAutoRaise(true);setCursor( arrowCursor ); } protected: - void drawButtonLabel(QPainter *p); + void drawButtonLabel(TQPainter *p); }; class KWMThemeClient : public KDecoration @@ -29,34 +29,34 @@ public: KWMThemeClient( KDecorationBridge* b, KDecorationFactory* f ); ~KWMThemeClient(){;} void init(); - void resize( const QSize& s ); - QSize minimumSize() const; + void resize( const TQSize& s ); + TQSize minimumSize() const; void borders( int& left, int& right, int& top, int& bottom ) const; protected: void doShape(); - void drawTitle(QPainter &p); - void resizeEvent( QResizeEvent* ); - void paintEvent( QPaintEvent* ); - void showEvent( QShowEvent* ); - void mouseDoubleClickEvent( QMouseEvent * ); - bool eventFilter( QObject* o, QEvent* e ); + void drawTitle(TQPainter &p); + void resizeEvent( TQResizeEvent* ); + void paintEvent( TQPaintEvent* ); + void showEvent( TQShowEvent* ); + void mouseDoubleClickEvent( TQMouseEvent * ); + bool eventFilter( TQObject* o, TQEvent* e ); void captionChange(); void desktopChange(); void maximizeChange(); void iconChange(); void activeChange(); void shadeChange() {}; - Position mousePosition(const QPoint &) const; + Position mousePosition(const TQPoint &) const; protected slots: //void slotReset(); void menuButtonPressed(); void slotMaximize(); private: - QPixmap buffer; + TQPixmap buffer; KPixmap *aGradient, *iGradient; MyButton *maxBtn, *stickyBtn, *mnuBtn; - QSpacerItem *titlebar; - QGridLayout* layout; + TQSpacerItem *titlebar; + TQGridLayout* layout; }; class KWMThemeFactory : public KDecorationFactory diff --git a/kwin/clients/laptop/laptopclient.cpp b/kwin/clients/laptop/laptopclient.cpp index 4d959ff8c..db91cf15d 100644 --- a/kwin/clients/laptop/laptopclient.cpp +++ b/kwin/clients/laptop/laptopclient.cpp @@ -8,12 +8,12 @@ #include // up here to avoid X11 header conflict :P #include "laptopclient.h" -#include +#include #include #include #include #include -#include +#include namespace Laptop { @@ -41,7 +41,7 @@ static const unsigned char unsticky_bits[] = { static const unsigned char sticky_bits[] = { 0x3c, 0x42, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3c}; -static QPixmap *titlePix; +static TQPixmap *titlePix; static KPixmap *aUpperGradient; static KPixmap *iUpperGradient; // buttons active, inactive, up, down, and 2 sizes :P @@ -53,7 +53,7 @@ static KPixmap *btnPix2; static KPixmap *btnDownPix2; static KPixmap *iBtnPix2; static KPixmap *iBtnDownPix2; -static QColor btnForeground; +static TQColor btnForeground; static int titleHeight = 14; static int btnWidth1 = 17; @@ -77,9 +77,9 @@ static inline const KDecorationOptions* options() return KDecoration::options(); } -static void drawButtonFrame(KPixmap *pix, const QColorGroup &g, bool sunken) +static void drawButtonFrame(KPixmap *pix, const TQColorGroup &g, bool sunken) { - QPainter p; + TQPainter p; int w = pix->width(); int h = pix->height(); int x2 = w-1; @@ -107,7 +107,7 @@ static void create_pixmaps() return; pixmaps_created = true; - titleHeight = QFontMetrics(options()->font(true)).height() + 2; + titleHeight = TQFontMetrics(options()->font(true)).height() + 2; if (titleHeight < handleSize) titleHeight = handleSize; titleHeight &= ~1; // Make title height even if (titleHeight < 14) titleHeight = 14; @@ -116,11 +116,11 @@ static void create_pixmaps() btnWidth2 = 3*titleHeight/2 + 6; // titlebar - QPainter p; - QPainter maskPainter; + TQPainter p; + TQPainter maskPainter; int i, x, y; - titlePix = new QPixmap(33, 12); - QBitmap mask(33, 12); + titlePix = new TQPixmap(33, 12); + TQBitmap mask(33, 12); mask.fill(Qt::color0); p.begin(titlePix); @@ -140,12 +140,12 @@ static void create_pixmaps() maskPainter.end(); titlePix->setMask(mask); - if(QPixmap::defaultDepth() > 8){ + if(TQPixmap::defaultDepth() > 8){ aUpperGradient = new KPixmap; aUpperGradient->resize(32, titleHeight+2); iUpperGradient = new KPixmap; iUpperGradient->resize(32, titleHeight+2); - QColor bgColor = options()->color(KDecoration::ColorTitleBar, true); + TQColor bgColor = options()->color(KDecoration::ColorTitleBar, true); KPixmapEffect::gradient(*aUpperGradient, bgColor.light(120), bgColor.dark(120), @@ -157,8 +157,8 @@ static void create_pixmaps() KPixmapEffect::VerticalGradient); } // buttons (active/inactive, sunken/unsunken, 2 sizes each) - QColorGroup g = options()->colorGroup(KDecoration::ColorButtonBg, true); - QColor c = g.background(); + TQColorGroup g = options()->colorGroup(KDecoration::ColorButtonBg, true); + TQColor c = g.background(); btnPix1 = new KPixmap; btnPix1->resize(btnWidth1, titleHeight); btnDownPix1 = new KPixmap; @@ -175,7 +175,7 @@ static void create_pixmaps() iBtnPix2->resize(btnWidth2, titleHeight); iBtnDownPix2 = new KPixmap; iBtnDownPix2->resize(btnWidth2, titleHeight); - if(QPixmap::defaultDepth() > 8){ + if(TQPixmap::defaultDepth() > 8){ KPixmapEffect::gradient(*btnPix1, c.light(120), c.dark(130), KPixmapEffect::DiagonalGradient); KPixmapEffect::gradient(*btnDownPix1, c.dark(130), c.light(120), @@ -249,7 +249,7 @@ static void delete_pixmaps() LaptopButton::LaptopButton(ButtonType type, LaptopClient *parent, const char *name) : KCommonDecorationButton(type, parent, name) { - setBackgroundMode(QWidget::NoBackground); + setBackgroundMode(TQWidget::NoBackground); } void LaptopButton::reset(unsigned long changed) @@ -287,16 +287,16 @@ void LaptopButton::reset(unsigned long changed) void LaptopButton::setBitmap(const unsigned char *bitmap) { if (bitmap) - deco = QBitmap(8, 8, bitmap, true); + deco = TQBitmap(8, 8, bitmap, true); else { - deco = QBitmap(8,8); + deco = TQBitmap(8,8); deco.fill(Qt::color0); } deco.setMask(deco); repaint(); } -void LaptopButton::drawButton(QPainter *p) +void LaptopButton::drawButton(TQPainter *p) { bool smallBtn = width() == btnWidth1; if(btnPix1){ @@ -314,7 +314,7 @@ void LaptopButton::drawButton(QPainter *p) } } else{ - QColorGroup g = options()->colorGroup(KDecoration::ColorButtonBg, decoration()->isActive()); + TQColorGroup g = options()->colorGroup(KDecoration::ColorButtonBg, decoration()->isActive()); int w = width(); int h = height(); p->fillRect(1, 1, w-2, h-2, isDown() ? g.mid() : g.button()); @@ -348,17 +348,17 @@ LaptopClient::~LaptopClient() { } -QString LaptopClient::visibleName() const +TQString LaptopClient::visibleName() const { return i18n("Laptop"); } -QString LaptopClient::defaultButtonsLeft() const +TQString LaptopClient::defaultButtonsLeft() const { return "X"; } -QString LaptopClient::defaultButtonsRight() const +TQString LaptopClient::defaultButtonsRight() const { return "HSIA"; } @@ -466,12 +466,12 @@ void LaptopClient::captionChange() KCommonDecoration::captionChange(); } -void LaptopClient::paintEvent( QPaintEvent* ) +void LaptopClient::paintEvent( TQPaintEvent* ) { - QPainter p(widget()); - QColorGroup g = options()->colorGroup(KDecoration::ColorFrame, isActive()); + TQPainter p(widget()); + TQColorGroup g = options()->colorGroup(KDecoration::ColorFrame, isActive()); - QRect r(widget()->rect()); + TQRect r(widget()->rect()); p.setPen(Qt::black); p.drawRect(r); @@ -511,18 +511,18 @@ void LaptopClient::paintEvent( QPaintEvent* ) if (r.width() > 3*handleSize + 20) { int range = 8 + 3*handleSize/2; qDrawShadePanel(&p, r.x() + 1, r.bottom() - bs, range, - handleSize - 2, g, false, 1, &g.brush(QColorGroup::Mid)); + handleSize - 2, g, false, 1, &g.brush(TQColorGroup::Mid)); qDrawShadePanel(&p, r.x() + range + 1, r.bottom() - bs, r.width() - 2*range - 2, handleSize - 2, g, false, 1, - isActive() ? &g.brush(QColorGroup::Background) : - &g.brush(QColorGroup::Mid)); + isActive() ? &g.brush(TQColorGroup::Background) : + &g.brush(TQColorGroup::Mid)); qDrawShadePanel(&p, r.right() - range, r.bottom() - bs, - range, bs, g, false, 1, &g.brush(QColorGroup::Mid)); + range, bs, g, false, 1, &g.brush(TQColorGroup::Mid)); } else { qDrawShadePanel(&p, r.x() + 1, r.bottom() - bs, r.width() - 2, bs, g, false, 1, - isActive() ? &g.brush(QColorGroup::Background) : - &g.brush(QColorGroup::Mid)); + isActive() ? &g.brush(TQColorGroup::Background) : + &g.brush(TQColorGroup::Mid)); } } @@ -545,7 +545,7 @@ void LaptopClient::paintEvent( QPaintEvent* ) options()->color(KDecoration::ColorTitleBar, false)); p.setFont(options()->font(false, isToolWindow() )); - QFontMetrics fm(options()->font(false)); + TQFontMetrics fm(options()->font(false)); g = options()->colorGroup(KDecoration::ColorTitleBar, false); if(iUpperGradient) p.drawTiledPixmap(r.x()+((r.width()-fm.width(caption()))/2)-4, @@ -554,7 +554,7 @@ void LaptopClient::paintEvent( QPaintEvent* ) else p.fillRect(r.x()+((r.width()-fm.width(caption()))/2)-4, r.y(), fm.width(caption())+8, r.height()-1, - g.brush(QColorGroup::Background)); + g.brush(TQColorGroup::Background)); p.setPen(g.mid()); p.drawLine(r.x(), r.y(), r.right(), r.y()); p.drawLine(r.x(), r.y(), r.x(), r.bottom()); @@ -572,23 +572,23 @@ void LaptopClient::paintEvent( QPaintEvent* ) } } -QRegion LaptopClient::cornerShape(WindowCorner corner) +TQRegion LaptopClient::cornerShape(WindowCorner corner) { switch (corner) { case WC_TopLeft: - return QRect(0, 0, 1, 1); + return TQRect(0, 0, 1, 1); case WC_TopRight: - return QRect(width()-1, 0, 1, 1); + return TQRect(width()-1, 0, 1, 1); case WC_BottomLeft: - return QRect(0, height()-1, 1, 1); + return TQRect(0, height()-1, 1, 1); case WC_BottomRight: - return QRect(width()-1, height()-1, 1, 1); + return TQRect(width()-1, height()-1, 1, 1); default: - return QRegion(); + return TQRegion(); } } @@ -605,7 +605,7 @@ bool LaptopClient::mustDrawHandle() const void LaptopClient::updateActiveBuffer( ) { - QRect rTitle = titleRect(); + TQRect rTitle = titleRect(); if( !bufferDirty && (lastBufferWidth == rTitle.width())) return; if ( rTitle.width() <= 0 || rTitle.height() <= 0 ) @@ -615,8 +615,8 @@ void LaptopClient::updateActiveBuffer( ) activeBuffer.resize(rTitle.width(), rTitle.height()); - QPainter p; - QRect r(0, 0, activeBuffer.width(), activeBuffer.height()); + TQPainter p; + TQRect r(0, 0, activeBuffer.width(), activeBuffer.height()); p.begin(&activeBuffer); if(aUpperGradient){ p.drawTiledPixmap(r, *aUpperGradient); @@ -628,8 +628,8 @@ void LaptopClient::updateActiveBuffer( ) p.drawTiledPixmap(r, *titlePix); p.setFont(options()->font(true, isToolWindow() )); - QFontMetrics fm(options()->font(true)); - QColorGroup g = options()->colorGroup(KDecoration::ColorTitleBar, true); + TQFontMetrics fm(options()->font(true)); + TQColorGroup g = options()->colorGroup(KDecoration::ColorTitleBar, true); if(aUpperGradient) p.drawTiledPixmap(r.x()+((r.width()-fm.width(caption()))/2)-4, r.y(), fm.width(caption())+8, r.height()-1, @@ -637,7 +637,7 @@ void LaptopClient::updateActiveBuffer( ) else p.fillRect(r.x()+((r.width()-fm.width(caption()))/2)-4, 0, fm.width(caption())+8, r.height(), - g.brush(QColorGroup::Background)); + g.brush(TQColorGroup::Background)); p.setPen(g.mid()); p.drawLine(r.x(), r.y(), r.right(), r.y()); p.drawLine(r.x(), r.y(), r.x(), r.bottom()); @@ -723,11 +723,11 @@ bool LaptopClientFactory::supports( Ability ability ) }; } -QValueList< LaptopClientFactory::BorderSize > +TQValueList< LaptopClientFactory::BorderSize > LaptopClientFactory::borderSizes() const { // the list must be sorted - return QValueList< BorderSize >() << BorderNormal << BorderLarge << + return TQValueList< BorderSize >() << BorderNormal << BorderLarge << BorderVeryLarge << BorderHuge << BorderVeryHuge << BorderOversized; } diff --git a/kwin/clients/laptop/laptopclient.h b/kwin/clients/laptop/laptopclient.h index b2e8c3555..3413b490a 100644 --- a/kwin/clients/laptop/laptopclient.h +++ b/kwin/clients/laptop/laptopclient.h @@ -7,7 +7,7 @@ #ifndef __KDECLIENT_H #define __KDECLIENT_H -#include +#include #include #include #include @@ -24,8 +24,8 @@ public: virtual void reset(unsigned long changed); protected: - virtual void drawButton(QPainter *p); - QBitmap deco; + virtual void drawButton(TQPainter *p); + TQBitmap deco; }; class LaptopClient : public KCommonDecoration @@ -34,18 +34,18 @@ public: LaptopClient( KDecorationBridge* b, KDecorationFactory* f ); ~LaptopClient(); - 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 bool decorationBehaviour(DecorationBehaviour behaviour) const; virtual int layoutMetric(LayoutMetric lm, bool respectWindowState = true, const KCommonDecorationButton * = 0) const; virtual KCommonDecorationButton *createButton(ButtonType type); - virtual QRegion cornerShape(WindowCorner corner); + virtual TQRegion cornerShape(WindowCorner corner); void init(); protected: - void paintEvent( QPaintEvent* ); + void paintEvent( TQPaintEvent* ); void reset( unsigned long ); void updateActiveBuffer(); void captionChange(); @@ -58,7 +58,7 @@ private: bool bufferDirty; }; -class LaptopClientFactory : public QObject, public KDecorationFactory +class LaptopClientFactory : public TQObject, public KDecorationFactory { public: LaptopClientFactory(); @@ -66,7 +66,7 @@ public: virtual KDecoration* createDecoration( KDecorationBridge* ); virtual bool reset( unsigned long changed ); virtual bool supports( Ability ability ); - virtual QValueList< BorderSize > borderSizes() const; + virtual TQValueList< BorderSize > borderSizes() const; private: void findPreferredHandleSize(); }; diff --git a/kwin/clients/modernsystem/config/config.cpp b/kwin/clients/modernsystem/config/config.cpp index 542494d28..8a94c1748 100644 --- a/kwin/clients/modernsystem/config/config.cpp +++ b/kwin/clients/modernsystem/config/config.cpp @@ -5,14 +5,14 @@ #include #include #include -#include -#include +#include +#include #include "config.h" extern "C" { - KDE_EXPORT QObject* allocate_config(KConfig* conf, QWidget* parent) + KDE_EXPORT TQObject* allocate_config(KConfig* conf, TQWidget* parent) { return(new ModernSysConfig(conf, parent)); } @@ -22,54 +22,54 @@ extern "C" // 'conf' is a pointer to the kwindecoration modules open kwin config, // and is by default set to the "Style" group. // -// 'parent' is the parent of the QObject, which is a VBox inside the +// 'parent' is the parent of the TQObject, which is a VBox inside the // Configure tab in kwindecoration -ModernSysConfig::ModernSysConfig(KConfig* conf, QWidget* parent) : QObject(parent) +ModernSysConfig::ModernSysConfig(KConfig* conf, TQWidget* parent) : TQObject(parent) { clientrc = new KConfig("kwinmodernsysrc"); KGlobal::locale()->insertCatalogue("kwin_clients"); - mainw = new QWidget(parent); - vbox = new QVBoxLayout(mainw); + mainw = new TQWidget(parent); + vbox = new TQVBoxLayout(mainw); vbox->setSpacing(6); vbox->setMargin(0); - handleBox = new QWidget(mainw); - QGridLayout* layout = new QGridLayout(handleBox, 0, KDialog::spacingHint()); + handleBox = new TQWidget(mainw); + TQGridLayout* layout = new TQGridLayout(handleBox, 0, KDialog::spacingHint()); - cbShowHandle = new QCheckBox(i18n("&Show window resize handle"), handleBox); - QWhatsThis::add(cbShowHandle, + cbShowHandle = new TQCheckBox(i18n("&Show window resize handle"), handleBox); + TQWhatsThis::add(cbShowHandle, i18n("When selected, all windows are drawn with a resize " "handle at the lower right corner. This makes window resizing " "easier, especially for trackballs and other mouse replacements " "on laptops.")); layout->addMultiCellWidget(cbShowHandle, 0, 0, 0, 1); - connect(cbShowHandle, SIGNAL(clicked()), this, SLOT(slotSelectionChanged())); + connect(cbShowHandle, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSelectionChanged())); - sliderBox = new QVBox(handleBox); - handleSizeSlider = new QSlider(0, 4, 1, 0, QSlider::Horizontal, sliderBox); - QWhatsThis::add(handleSizeSlider, + sliderBox = new TQVBox(handleBox); + handleSizeSlider = new TQSlider(0, 4, 1, 0, TQSlider::Horizontal, sliderBox); + TQWhatsThis::add(handleSizeSlider, i18n("Here you can change the size of the resize handle.")); handleSizeSlider->setTickInterval(1); - handleSizeSlider->setTickmarks(QSlider::Below); - connect(handleSizeSlider, SIGNAL(valueChanged(int)), this, SLOT(slotSelectionChanged())); + handleSizeSlider->setTickmarks(TQSlider::Below); + connect(handleSizeSlider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotSelectionChanged())); - hbox = new QHBox(sliderBox); + hbox = new TQHBox(sliderBox); hbox->setSpacing(6); bool rtl = kapp->reverseLayout(); - label1 = new QLabel(i18n("Small"), hbox); + label1 = new TQLabel(i18n("Small"), hbox); label1->setAlignment(rtl ? AlignRight : AlignLeft); - label2 = new QLabel(i18n("Medium"), hbox); + label2 = new TQLabel(i18n("Medium"), hbox); label2->setAlignment(AlignHCenter); - label3 = new QLabel(i18n("Large"), hbox); + label3 = new TQLabel(i18n("Large"), hbox); label3->setAlignment(rtl ? AlignLeft : AlignRight); vbox->addWidget(handleBox); vbox->addStretch(1); // layout->setColSpacing(0, 30); - layout->addItem(new QSpacerItem(30, 10, QSizePolicy::Fixed, QSizePolicy::Fixed), 1, 0); + layout->addItem(new TQSpacerItem(30, 10, TQSizePolicy::Fixed, TQSizePolicy::Fixed), 1, 0); layout->addWidget(sliderBox, 1, 1); load(conf); diff --git a/kwin/clients/modernsystem/config/config.h b/kwin/clients/modernsystem/config/config.h index 4f4b97123..dcf4a588f 100644 --- a/kwin/clients/modernsystem/config/config.h +++ b/kwin/clients/modernsystem/config/config.h @@ -1,19 +1,19 @@ #ifndef __KDE_MODSYSTEMCONFIG_H #define __KDE_MODSYSTEMCONFIG_H -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include class ModernSysConfig : public QObject { Q_OBJECT public: - ModernSysConfig(KConfig* conf, QWidget* parent); + ModernSysConfig(KConfig* conf, TQWidget* parent); ~ModernSysConfig(); // These public signals/slots work similar to KCM modules @@ -32,8 +32,8 @@ class ModernSysConfig : public QObject KConfig *clientrc; QWidget *mainw; QVBoxLayout *vbox; - QWidget *handleBox; - QCheckBox *cbShowHandle; + TQWidget *handleBox; + TQCheckBox *cbShowHandle; QVBox *sliderBox; QSlider *handleSizeSlider; QHBox *hbox; diff --git a/kwin/clients/modernsystem/modernsys.cpp b/kwin/clients/modernsystem/modernsys.cpp index d75816343..ce7545cdf 100644 --- a/kwin/clients/modernsystem/modernsys.cpp +++ b/kwin/clients/modernsystem/modernsys.cpp @@ -4,19 +4,19 @@ #include #include #include -#include -#include +#include +#include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "modernsys.h" #include "buttondata.h" #include "btnhighcolor.h" -#include +#include namespace ModernSystem { @@ -73,19 +73,19 @@ static unsigned char btnhighcolor_mask_bits[] = { static KPixmap *aUpperGradient=0; static KPixmap *iUpperGradient=0; -static QPixmap *buttonPix=0; -static QPixmap *buttonPixDown=0; -static QPixmap *iButtonPix=0; -static QPixmap *iButtonPixDown=0; +static TQPixmap *buttonPix=0; +static TQPixmap *buttonPixDown=0; +static TQPixmap *iButtonPix=0; +static TQPixmap *iButtonPixDown=0; -static QColor *buttonFg; +static TQColor *buttonFg; static bool pixmaps_created = false; -static QBitmap *lcDark1; -static QBitmap *lcDark2; -static QBitmap *lcDark3; -static QBitmap *lcLight1; -static QImage *btnSource; +static TQBitmap *lcDark1; +static TQBitmap *lcDark2; +static TQBitmap *lcDark3; +static TQBitmap *lcLight1; +static TQImage *btnSource; static bool show_handle; static int handle_size; @@ -98,25 +98,25 @@ static inline const KDecorationOptions* options() return KDecoration::options(); } -static void make_button_fx(const QColorGroup &g, QPixmap *pix, bool light=false) +static void make_button_fx(const TQColorGroup &g, TQPixmap *pix, bool light=false) { pix->fill(g.background()); - QPainter p(pix); + TQPainter p(pix); - if(QPixmap::defaultDepth() > 8){ + if(TQPixmap::defaultDepth() > 8){ int i, destH, destS, destV, srcH, srcS, srcV; - QColor btnColor = g.background(); + TQColor btnColor = g.background(); if(btnSource->depth() < 32) *btnSource = btnSource->convertDepth(32); if(light) btnColor = btnColor.light(120); btnColor.hsv(&destH, &destS, &destV); - QImage btnDest(14, 15, 32); + TQImage btnDest(14, 15, 32); unsigned int *srcData = (unsigned int *)btnSource->bits(); unsigned int *destData = (unsigned int *)btnDest.bits(); - QColor srcColor; + TQColor srcColor; for(i=0; i < btnSource->width()*btnSource->height(); ++i){ srcColor.setRgb(srcData[i]); srcColor.hsv(&srcH, &srcS, &srcV); @@ -150,13 +150,13 @@ static void create_pixmaps() return; pixmaps_created = true; - lcDark1 = new QBitmap(14, 15, lowcolor_6a696a_bits, true); - lcDark2 = new QBitmap(14, 15, lowcolor_949194_bits, true); - lcDark3 = new QBitmap(14, 15, lowcolor_b4b6b4_bits, true); - lcLight1 = new QBitmap(14, 15, lowcolor_e6e6e6_bits, true); - btnSource = new QImage(btnhighcolor_xpm); + lcDark1 = new TQBitmap(14, 15, lowcolor_6a696a_bits, true); + lcDark2 = new TQBitmap(14, 15, lowcolor_949194_bits, true); + lcDark3 = new TQBitmap(14, 15, lowcolor_b4b6b4_bits, true); + lcLight1 = new TQBitmap(14, 15, lowcolor_e6e6e6_bits, true); + btnSource = new TQImage(btnhighcolor_xpm); - if(QPixmap::defaultDepth() > 8){ + if(TQPixmap::defaultDepth() > 8){ aUpperGradient = new KPixmap; aUpperGradient->resize(32, title_height+2); iUpperGradient = new KPixmap; @@ -171,23 +171,23 @@ static void create_pixmaps() KPixmapEffect::VerticalGradient); } // buttons - QColorGroup btnColor(options()->colorGroup(KDecoration::ColorButtonBg, true)); - buttonPix = new QPixmap(14, 15); + TQColorGroup btnColor(options()->colorGroup(KDecoration::ColorButtonBg, true)); + buttonPix = new TQPixmap(14, 15); make_button_fx(btnColor, buttonPix); - buttonPixDown = new QPixmap(14, 15); + buttonPixDown = new TQPixmap(14, 15); make_button_fx(btnColor, buttonPixDown, true); btnColor = options()->colorGroup(KDecoration::ColorButtonBg, false); - iButtonPix = new QPixmap(14, 15); + iButtonPix = new TQPixmap(14, 15); make_button_fx(btnColor, iButtonPix); - iButtonPixDown = new QPixmap(14, 15); + iButtonPixDown = new TQPixmap(14, 15); make_button_fx(btnColor, iButtonPixDown, true); if(qGray(btnColor.background().rgb()) < 150) - buttonFg = new QColor(Qt::white); + buttonFg = new TQColor(Qt::white); else - buttonFg = new QColor(Qt::black); + buttonFg = new TQColor(Qt::black); delete lcDark1; delete lcDark2; @@ -263,7 +263,7 @@ void ModernSysFactory::read_config() bwidth = 4; } - theight = QFontMetrics(options()->font(true)).height() + 2; + theight = TQFontMetrics(options()->font(true)).height() + 2; if (theight < 16) theight = 16; if (theight < bwidth) @@ -276,9 +276,9 @@ void ModernSysFactory::read_config() title_height = theight; } -QValueList< ModernSysFactory::BorderSize > ModernSysFactory::borderSizes() const +TQValueList< ModernSysFactory::BorderSize > ModernSysFactory::borderSizes() const { // the list must be sorted - return QValueList< BorderSize >() << BorderNormal << BorderLarge << + return TQValueList< BorderSize >() << BorderNormal << BorderLarge << BorderVeryLarge << BorderHuge; // as long as the buttons don't scale don't offer the largest two sizes. // BorderVeryLarge << BorderHuge << BorderVeryHuge << BorderOversized; @@ -289,7 +289,7 @@ ModernButton::ModernButton(ButtonType type, ModernSys *parent, const char *name) { setBackgroundMode( NoBackground ); - QBitmap mask(14, 15, QPixmap::defaultDepth() > 8 ? + TQBitmap mask(14, 15, TQPixmap::defaultDepth() > 8 ? btnhighcolor_mask_bits : lowcolor_mask_bits, true); resize(14, 15); @@ -339,15 +339,15 @@ void ModernButton::reset(unsigned long changed) void ModernButton::setBitmap(const unsigned char *bitmap) { if (bitmap) - deco = QBitmap(8, 8, bitmap, true); + deco = TQBitmap(8, 8, bitmap, true); else { - deco = QBitmap(8,8); + deco = TQBitmap(8,8); deco.fill(Qt::color0); } deco.setMask(deco); } -void ModernButton::drawButton(QPainter *p) +void ModernButton::drawButton(TQPainter *p) { if(decoration()->isActive()){ if(buttonPix) @@ -378,17 +378,17 @@ ModernSys::ModernSys( KDecorationBridge* b, KDecorationFactory* f ) { } -QString ModernSys::visibleName() const +TQString ModernSys::visibleName() const { return i18n("Modern System"); } -QString ModernSys::defaultButtonsLeft() const +TQString ModernSys::defaultButtonsLeft() const { return "X"; } -QString ModernSys::defaultButtonsRight() const +TQString ModernSys::defaultButtonsRight() const { return "HSIA"; } @@ -495,7 +495,7 @@ KCommonDecorationButton *ModernSys::createButton(ButtonType type) void ModernSys::init() { - reverse = QApplication::reverseLayout(); + reverse = TQApplication::reverseLayout(); KCommonDecoration::init(); @@ -507,24 +507,24 @@ void ModernSys::recalcTitleBuffer() if(oldTitle == caption() && width() == titleBuffer.width()) return; - QFontMetrics fm(options()->font(true)); + TQFontMetrics fm(options()->font(true)); titleBuffer.resize(width(), title_height+2); - QPainter p; + TQPainter p; p.begin(&titleBuffer); if(aUpperGradient) p.drawTiledPixmap(0, 0, width(), title_height+2, *aUpperGradient); else p.fillRect(0, 0, width(), title_height+2, options()->colorGroup(ColorTitleBar, true). - brush(QColorGroup::Button)); + brush(TQColorGroup::Button)); - QRect t = titleRect(); // titlebar->geometry(); + TQRect t = titleRect(); // titlebar->geometry(); t.setTop( 2 ); t.setLeft( t.left() ); t.setRight( t.right() - 2 ); - QRegion r(t.x(), 0, t.width(), title_height+2); - r -= QRect(t.x()+((t.width()-fm.width(caption()))/2)-4, + TQRegion r(t.x(), 0, t.width(), title_height+2); + r -= TQRect(t.x()+((t.width()-fm.width(caption()))/2)-4, 0, fm.width(caption())+8, title_height+2); p.setClipRegion(r); int i, ly; @@ -551,14 +551,14 @@ void ModernSys::updateCaption() widget()->update(titleRect() ); } -void ModernSys::drawRoundFrame(QPainter &p, int x, int y, int w, int h) +void ModernSys::drawRoundFrame(TQPainter &p, int x, int y, int w, int h) { kDrawRoundButton(&p, x, y, w, h, options()->colorGroup(ColorFrame, isActive()), false); } -void ModernSys::paintEvent( QPaintEvent* ) +void ModernSys::paintEvent( TQPaintEvent* ) { // update title buffer... if (oldTitle != caption() || width() != titleBuffer.width() ) @@ -567,13 +567,13 @@ void ModernSys::paintEvent( QPaintEvent* ) int hs = handle_size; int hw = handle_width; - QPainter p( widget() ); - QRect t = titleRect(); // titlebar->geometry(); + TQPainter p( widget() ); + TQRect t = titleRect(); // titlebar->geometry(); - QBrush fillBrush(widget()->colorGroup().brush(QColorGroup::Background).pixmap() ? - widget()->colorGroup().brush(QColorGroup::Background) : + TQBrush fillBrush(widget()->colorGroup().brush(TQColorGroup::Background).pixmap() ? + widget()->colorGroup().brush(TQColorGroup::Background) : options()->colorGroup(ColorFrame, isActive()). - brush(QColorGroup::Button)); + brush(TQColorGroup::Button)); p.fillRect(1, title_height+3, width()-2, height()-(title_height+3), fillBrush); p.fillRect(width()-6, 0, width()-1, height(), fillBrush); @@ -586,7 +586,7 @@ void ModernSys::paintEvent( QPaintEvent* ) int h = height() - hw; // titlebar - QColorGroup g = options()->colorGroup(ColorTitleBar, isActive()); + TQColorGroup g = options()->colorGroup(ColorTitleBar, isActive()); if(isActive()){ p.drawPixmap(1, 1, titleBuffer, 0, 0, w-2, title_height+2); } @@ -649,20 +649,20 @@ void ModernSys::updateWindowShape() { int hs = handle_size; int hw = handle_width; - QRegion mask; - mask += QRect(0, 0, width()-hw, height()-hw); + TQRegion mask; + mask += TQRect(0, 0, width()-hw, height()-hw); //single points - mask -= QRect(0, 0, 1, 1); - mask -= QRect(width()-hw-1, 0, 1, 1); - mask -= QRect(0, height()-hw-1, 1, 1); + mask -= TQRect(0, 0, 1, 1); + mask -= TQRect(width()-hw-1, 0, 1, 1); + mask -= TQRect(0, height()-hw-1, 1, 1); if (show_handle) { - mask += QRect(width()-hs, height()-hs, hs-1, hs-1); - mask -= QRect(width()-2, height()-2, 1, 1); - mask -= QRect(width()-2, height()-hs, 1, 1); - mask -= QRect(width()-hs, height()-2, 1, 1); + mask += TQRect(width()-hs, height()-hs, hs-1, hs-1); + mask -= TQRect(width()-2, height()-2, 1, 1); + mask -= TQRect(width()-2, height()-hs, 1, 1); + mask -= TQRect(width()-hs, height()-2, 1, 1); } else - mask -= QRect(width()-1, height()-1, 1, 1); + mask -= TQRect(width()-1, height()-1, 1, 1); setMask(mask); } diff --git a/kwin/clients/modernsystem/modernsys.h b/kwin/clients/modernsystem/modernsys.h index d185be048..2606d8786 100644 --- a/kwin/clients/modernsystem/modernsys.h +++ b/kwin/clients/modernsystem/modernsys.h @@ -1,7 +1,7 @@ #ifndef __MODSYSTEMCLIENT_H #define __MODSYSTEMCLIENT_H -#include +#include #include #include #include @@ -21,9 +21,9 @@ public: virtual void reset(unsigned long changed); protected: - virtual void drawButton(QPainter *p); - void drawButtonLabel(QPainter *){;} - QBitmap deco; + virtual void drawButton(TQPainter *p); + void drawButtonLabel(TQPainter *){;} + TQBitmap deco; }; class ModernSys : public KCommonDecoration @@ -32,9 +32,9 @@ public: ModernSys( KDecorationBridge* b, KDecorationFactory* f ); ~ModernSys(){;} - 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 bool decorationBehaviour(DecorationBehaviour behaviour) const; virtual int layoutMetric(LayoutMetric lm, bool respectWindowState = true, const KCommonDecorationButton * = 0) const; virtual KCommonDecorationButton *createButton(ButtonType type); @@ -44,17 +44,17 @@ public: void init(); protected: - void drawRoundFrame(QPainter &p, int x, int y, int w, int h); - void paintEvent( QPaintEvent* ); + void drawRoundFrame(TQPainter &p, int x, int y, int w, int h); + void paintEvent( TQPaintEvent* ); void recalcTitleBuffer(); void reset( unsigned long ); private: - QPixmap titleBuffer; - QString oldTitle; + TQPixmap titleBuffer; + TQString oldTitle; bool reverse; }; -class ModernSysFactory : public QObject, public KDecorationFactory +class ModernSysFactory : public TQObject, public KDecorationFactory { public: ModernSysFactory(); @@ -62,7 +62,7 @@ public: virtual KDecoration* createDecoration( KDecorationBridge* ); virtual bool reset( unsigned long changed ); virtual bool supports( Ability ability ); - QValueList< BorderSize > borderSizes() const; + TQValueList< BorderSize > borderSizes() const; private: void read_config(); }; diff --git a/kwin/clients/plastik/config/config.cpp b/kwin/clients/plastik/config/config.cpp index 91ec501d0..0352bff91 100644 --- a/kwin/clients/plastik/config/config.cpp +++ b/kwin/clients/plastik/config/config.cpp @@ -20,12 +20,12 @@ Boston, MA 02110-1301, USA. */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -34,8 +34,8 @@ #include "config.h" #include "configdialog.h" -PlastikConfig::PlastikConfig(KConfig* config, QWidget* parent) - : QObject(parent), m_config(0), m_dialog(0) +PlastikConfig::PlastikConfig(KConfig* config, TQWidget* parent) + : TQObject(parent), m_config(0), m_dialog(0) { // create the configuration object m_config = new KConfig("kwinplastikrc"); @@ -49,16 +49,16 @@ PlastikConfig::PlastikConfig(KConfig* config, QWidget* parent) load(config); // setup the connections - connect(m_dialog->titleAlign, SIGNAL(clicked(int)), - this, SIGNAL(changed())); - connect(m_dialog->animateButtons, SIGNAL(toggled(bool)), - this, SIGNAL(changed())); - connect(m_dialog->menuClose, SIGNAL(toggled(bool)), - this, SIGNAL(changed())); - connect(m_dialog->titleShadow, SIGNAL(toggled(bool)), - this, SIGNAL(changed())); - connect(m_dialog->coloredBorder, SIGNAL(toggled(bool)), - this, SIGNAL(changed())); + connect(m_dialog->titleAlign, TQT_SIGNAL(clicked(int)), + this, TQT_SIGNAL(changed())); + connect(m_dialog->animateButtons, TQT_SIGNAL(toggled(bool)), + this, TQT_SIGNAL(changed())); + connect(m_dialog->menuClose, TQT_SIGNAL(toggled(bool)), + this, TQT_SIGNAL(changed())); + connect(m_dialog->titleShadow, TQT_SIGNAL(toggled(bool)), + this, TQT_SIGNAL(changed())); + connect(m_dialog->coloredBorder, TQT_SIGNAL(toggled(bool)), + this, TQT_SIGNAL(changed())); } PlastikConfig::~PlastikConfig() @@ -72,8 +72,8 @@ void PlastikConfig::load(KConfig*) m_config->setGroup("General"); - QString value = m_config->readEntry("TitleAlignment", "AlignLeft"); - QRadioButton *button = (QRadioButton*)m_dialog->titleAlign->child(value.latin1()); + TQString value = m_config->readEntry("TitleAlignment", "AlignLeft"); + TQRadioButton *button = (TQRadioButton*)m_dialog->titleAlign->child(value.latin1()); if (button) button->setChecked(true); bool animateButtons = m_config->readBoolEntry("AnimateButtons", true); m_dialog->animateButtons->setChecked(animateButtons); @@ -89,8 +89,8 @@ void PlastikConfig::save(KConfig*) { m_config->setGroup("General"); - QRadioButton *button = (QRadioButton*)m_dialog->titleAlign->selected(); - if (button) m_config->writeEntry("TitleAlignment", QString(button->name())); + TQRadioButton *button = (TQRadioButton*)m_dialog->titleAlign->selected(); + if (button) m_config->writeEntry("TitleAlignment", TQString(button->name())); m_config->writeEntry("AnimateButtons", m_dialog->animateButtons->isChecked() ); m_config->writeEntry("CloseOnMenuDoubleClick", m_dialog->menuClose->isChecked() ); m_config->writeEntry("TitleShadow", m_dialog->titleShadow->isChecked() ); @@ -100,8 +100,8 @@ void PlastikConfig::save(KConfig*) void PlastikConfig::defaults() { - QRadioButton *button = - (QRadioButton*)m_dialog->titleAlign->child("AlignLeft"); + TQRadioButton *button = + (TQRadioButton*)m_dialog->titleAlign->child("AlignLeft"); if (button) button->setChecked(true); m_dialog->animateButtons->setChecked(true); m_dialog->menuClose->setChecked(false); @@ -115,7 +115,7 @@ void PlastikConfig::defaults() extern "C" { - KDE_EXPORT QObject* allocate_config(KConfig* config, QWidget* parent) { + KDE_EXPORT TQObject* allocate_config(KConfig* config, TQWidget* parent) { return (new PlastikConfig(config, parent)); } } diff --git a/kwin/clients/plastik/config/config.h b/kwin/clients/plastik/config/config.h index 540a27cda..249f5f7dd 100644 --- a/kwin/clients/plastik/config/config.h +++ b/kwin/clients/plastik/config/config.h @@ -23,7 +23,7 @@ #ifndef KNIFTYCONFIG_H #define KNIFTYCONFIG_H -#include +#include class QButtonGroup; class QGroupBox; @@ -34,7 +34,7 @@ class PlastikConfig : public QObject { Q_OBJECT public: - PlastikConfig(KConfig* config, QWidget* parent); + PlastikConfig(KConfig* config, TQWidget* parent); ~PlastikConfig(); signals: diff --git a/kwin/clients/plastik/misc.cpp b/kwin/clients/plastik/misc.cpp index da491b2ba..43786fe46 100644 --- a/kwin/clients/plastik/misc.cpp +++ b/kwin/clients/plastik/misc.cpp @@ -23,13 +23,13 @@ #include #include -#include -#include -#include +#include +#include +#include #include "misc.h" -QColor hsvRelative(const QColor& baseColor, int relativeH, int relativeS, int relativeV) +TQColor hsvRelative(const TQColor& baseColor, int relativeH, int relativeS, int relativeV) { int h, s, v; baseColor.hsv(&h, &s, &v); @@ -45,12 +45,12 @@ QColor hsvRelative(const QColor& baseColor, int relativeH, int relativeS, int re 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... @@ -61,15 +61,15 @@ QColor alphaBlendColors(const QColor &bgColor, const QColor &fgColor, const int if(alpha<0) alpha = 0; int inv_alpha = 255 - alpha; - QColor result = QColor( qRgb(qRed(rgb_b)*inv_alpha/255 + qRed(rgb)*alpha/255, + TQColor result = TQColor( 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) ); 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++) { diff --git a/kwin/clients/plastik/misc.h b/kwin/clients/plastik/misc.h index 6c06b282b..985b405e8 100644 --- a/kwin/clients/plastik/misc.h +++ b/kwin/clients/plastik/misc.h @@ -23,8 +23,8 @@ #ifndef MISC_H #define MISC_H -QColor hsvRelative(const 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(const 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/kwin/clients/plastik/plastik.cpp b/kwin/clients/plastik/plastik.cpp index 25e6d2563..a6313cd1c 100644 --- a/kwin/clients/plastik/plastik.cpp +++ b/kwin/clients/plastik/plastik.cpp @@ -20,9 +20,9 @@ Boston, MA 02110-1301, USA. */ -#include -#include -#include +#include +#include +#include #include #include @@ -39,8 +39,8 @@ namespace KWinPlastik PlastikHandler::PlastikHandler() { - memset(m_pixmaps, 0, sizeof(QPixmap*)*NumPixmaps*2*2); // set elements to 0 - memset(m_bitmaps, 0, sizeof(QBitmap*)*NumButtonIcons*2); + memset(m_pixmaps, 0, sizeof(TQPixmap*)*NumPixmaps*2*2); // set elements to 0 + memset(m_bitmaps, 0, sizeof(TQBitmap*)*NumButtonIcons*2); reset(0); } @@ -88,7 +88,7 @@ bool PlastikHandler::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(); @@ -168,7 +168,7 @@ void PlastikHandler::readConfig() // grab settings m_titleShadow = config.readBoolEntry("TitleShadow", true); - QFontMetrics fm(m_titleFont); // active font = inactive font + TQFontMetrics fm(m_titleFont); // active font = inactive font int titleHeightMin = config.readNumEntry("MinTitleHeight", 16); // The title should strech with bigger font sizes! m_titleHeight = QMAX(titleHeightMin, fm.height() + 4); // 4 px for the shadow etc. @@ -176,7 +176,7 @@ void PlastikHandler::readConfig() if ( m_titleHeight%2 == 0) m_titleHeight++; - fm = QFontMetrics(m_titleFontTool); // active font = inactive font + fm = TQFontMetrics(m_titleFontTool); // active font = inactive font int titleHeightToolMin = config.readNumEntry("MinTitleHeightTool", 13); // The title should strech with bigger font sizes! m_titleHeightTool = QMAX(titleHeightToolMin, fm.height() ); // don't care about the shadow etc. @@ -184,7 +184,7 @@ void PlastikHandler::readConfig() if ( m_titleHeightTool%2 == 0) m_titleHeightTool++; - QString value = config.readEntry("TitleAlignment", "AlignLeft"); + TQString value = config.readEntry("TitleAlignment", "AlignLeft"); if (value == "AlignLeft") m_titleAlign = Qt::AlignLeft; else if (value == "AlignHCenter") m_titleAlign = Qt::AlignHCenter; else if (value == "AlignRight") m_titleAlign = Qt::AlignRight; @@ -194,7 +194,7 @@ void PlastikHandler::readConfig() m_menuClose = config.readBoolEntry("CloseOnMenuDoubleClick", true); } -QColor PlastikHandler::getColor(KWinPlastik::ColorType type, const bool active) +TQColor PlastikHandler::getColor(KWinPlastik::ColorType type, const bool active) { switch (type) { case WindowContour: @@ -225,15 +225,15 @@ QColor PlastikHandler::getColor(KWinPlastik::ColorType type, const bool active) } } -void PlastikHandler::pretile( QPixmap *&pix, int size, Qt::Orientation dir ) const +void PlastikHandler::pretile( TQPixmap *&pix, int size, Qt::Orientation dir ) const { - QPixmap *newpix; - QPainter p; + TQPixmap *newpix; + TQPainter p; if ( dir == Qt::Horizontal ) - newpix = new QPixmap( size, pix->height() ); + newpix = new TQPixmap( size, pix->height() ); else - newpix = new QPixmap( pix->width(), size ); + newpix = new TQPixmap( pix->width(), size ); p.begin( newpix ); p.drawTiledPixmap( newpix->rect(), *pix ) ; @@ -243,12 +243,12 @@ void PlastikHandler::pretile( QPixmap *&pix, int size, Qt::Orientation dir ) con pix = newpix; } -const QPixmap &PlastikHandler::pixmap(Pixmaps type, bool active, bool toolWindow) +const TQPixmap &PlastikHandler::pixmap(Pixmaps type, bool active, bool toolWindow) { if (m_pixmaps[toolWindow][active][type]) return *m_pixmaps[toolWindow][active][type]; - QPixmap *pm = 0; + TQPixmap *pm = 0; switch (type) { case TitleBarTileTop: @@ -257,8 +257,8 @@ const QPixmap &PlastikHandler::pixmap(Pixmaps type, bool active, bool toolWindow const int titleBarTileHeight = (toolWindow ? m_titleHeightTool : m_titleHeight) + 2; // gradient used as well in TitleBarTileTop as TitleBarTile const int gradientHeight = 2 + titleBarTileHeight-1; - QPixmap gradient(1, gradientHeight); - QPainter painter(&gradient); + TQPixmap gradient(1, gradientHeight); + TQPainter painter(&gradient); KPixmap tempPixmap; tempPixmap.resize(1, 4); KPixmapEffect::gradient(tempPixmap, @@ -276,7 +276,7 @@ const QPixmap &PlastikHandler::pixmap(Pixmaps type, bool active, bool toolWindow // actual titlebar tiles if (type == TitleBarTileTop) { - pm = new QPixmap(1, 4); + pm = new TQPixmap(1, 4); painter.begin(pm); // contour painter.setPen(getColor(WindowContour, active) ); @@ -288,7 +288,7 @@ const QPixmap &PlastikHandler::pixmap(Pixmaps type, bool active, bool toolWindow painter.drawPixmap(0, 2, gradient); painter.end(); } else { - pm = new QPixmap(1, titleBarTileHeight); + pm = new TQPixmap(1, titleBarTileHeight); painter.begin(pm); painter.drawPixmap(0, 0, gradient, 0,2); if (m_coloredBorder) { @@ -310,8 +310,8 @@ const QPixmap &PlastikHandler::pixmap(Pixmaps type, bool active, bool toolWindow const int w = m_borderSize; const int h = 4 + (toolWindow ? m_titleHeightTool : m_titleHeight) + 2; - pm = new QPixmap(w, h); - QPainter painter(pm); + pm = new TQPixmap(w, h); + TQPainter painter(pm); painter.drawTiledPixmap(0,0, w, 4, pixmap(TitleBarTileTop, active, toolWindow) ); painter.drawTiledPixmap(0,4, w, h-4, pixmap(TitleBarTile, active, toolWindow) ); @@ -320,7 +320,7 @@ const QPixmap &PlastikHandler::pixmap(Pixmaps type, bool active, bool toolWindow painter.drawLine(0,0, 0,h); painter.drawPoint(1,1); - const QColor highlightTitleLeft = getColor(ShadeTitleLight, active); + const TQColor highlightTitleLeft = getColor(ShadeTitleLight, active); painter.setPen(highlightTitleLeft); painter.drawLine(1,2, 1,h); @@ -330,7 +330,7 @@ const QPixmap &PlastikHandler::pixmap(Pixmaps type, bool active, bool toolWindow } // outside the region normally masked by doShape - painter.setPen(QColor(0,0,0) ); + painter.setPen(TQColor(0,0,0) ); painter.drawLine(0, 0, 1, 0 ); painter.drawPoint(0, 1); @@ -342,8 +342,8 @@ const QPixmap &PlastikHandler::pixmap(Pixmaps type, bool active, bool toolWindow const int w = m_borderSize; const int h = 4 + (toolWindow ? m_titleHeightTool : m_titleHeight) + 2; - pm = new QPixmap(w, h); - QPainter painter(pm); + pm = new TQPixmap(w, h); + TQPainter painter(pm); painter.drawTiledPixmap(0,0, w, 4, pixmap(TitleBarTileTop, active, toolWindow) ); painter.drawTiledPixmap(0,4, w, h-4, pixmap(TitleBarTile, active, toolWindow) ); @@ -352,7 +352,7 @@ const QPixmap &PlastikHandler::pixmap(Pixmaps type, bool active, bool toolWindow painter.drawLine(w-1,0, w-1,h); painter.drawPoint(w-2,1); - const QColor highlightTitleRight = getColor(ShadeTitleDark, active); + const TQColor highlightTitleRight = getColor(ShadeTitleDark, active); painter.setPen(highlightTitleRight); painter.drawLine(w-2,2, w-2,h); @@ -362,7 +362,7 @@ const QPixmap &PlastikHandler::pixmap(Pixmaps type, bool active, bool toolWindow } // outside the region normally masked by doShape - painter.setPen(QColor(0,0,0) ); + painter.setPen(TQColor(0,0,0) ); painter.drawLine(w-2, 0, w-1, 0 ); painter.drawPoint(w-1, 1); @@ -373,8 +373,8 @@ const QPixmap &PlastikHandler::pixmap(Pixmaps type, bool active, bool toolWindow { const int w = m_borderSize; - pm = new QPixmap(w, 1); - QPainter painter(pm); + pm = new TQPixmap(w, 1); + TQPainter painter(pm); if (m_coloredBorder) { painter.setPen(getColor(WindowContour, active) ); painter.drawPoint(0, 0); @@ -408,8 +408,8 @@ const QPixmap &PlastikHandler::pixmap(Pixmaps type, bool active, bool toolWindow { const int w = m_borderSize; - pm = new QPixmap(w, 1); - QPainter painter(pm); + pm = new TQPixmap(w, 1); + TQPainter painter(pm); if (m_coloredBorder) { painter.setPen(getColor(TitleGradient3, active).dark(110) ); painter.drawPoint(0,0); @@ -443,8 +443,8 @@ const QPixmap &PlastikHandler::pixmap(Pixmaps type, bool active, bool toolWindow const int w = m_borderSize; const int h = m_borderSize; - pm = new QPixmap(w, h); - QPainter painter(pm); + pm = new TQPixmap(w, h); + TQPainter painter(pm); painter.drawTiledPixmap(0,0,w,h, pixmap(BorderBottomTile, active, toolWindow) ); painter.setPen(getColor(WindowContour, active) ); painter.drawLine(0,0, 0,h); @@ -473,8 +473,8 @@ const QPixmap &PlastikHandler::pixmap(Pixmaps type, bool active, bool toolWindow const int w = m_borderSize; const int h = m_borderSize; - pm = new QPixmap(w, h); - QPainter painter(pm); + pm = new TQPixmap(w, h); + TQPainter painter(pm); painter.drawTiledPixmap(0,0,w,h, pixmap(BorderBottomTile, active, toolWindow) ); painter.setPen(getColor(WindowContour, active) ); painter.drawLine(w-1,0, w-1,h); @@ -501,8 +501,8 @@ const QPixmap &PlastikHandler::pixmap(Pixmaps type, bool active, bool toolWindow { const int h = m_borderSize; - pm = new QPixmap(1, m_borderSize); - QPainter painter(pm); + pm = new TQPixmap(1, m_borderSize); + TQPainter painter(pm); if (m_coloredBorder) { painter.setPen(getColor(TitleGradient3, active).dark(110) ); @@ -533,7 +533,7 @@ const QPixmap &PlastikHandler::pixmap(Pixmaps type, bool active, bool toolWindow return *pm; } -const QBitmap &PlastikHandler::buttonBitmap(ButtonIcon type, const QSize &size, bool toolWindow) +const TQBitmap &PlastikHandler::buttonBitmap(ButtonIcon type, const TQSize &size, bool toolWindow) { int typeIndex = type; @@ -552,7 +552,7 @@ const QBitmap &PlastikHandler::buttonBitmap(ButtonIcon type, const QSize &size, int w = size.width() - reduceW; int h = size.height() - reduceH; - if (m_bitmaps[toolWindow][typeIndex] && m_bitmaps[toolWindow][typeIndex]->size()==QSize(w,h) ) + if (m_bitmaps[toolWindow][typeIndex] && m_bitmaps[toolWindow][typeIndex]->size()==TQSize(w,h) ) return *m_bitmaps[toolWindow][typeIndex]; // no matching pixmap found, create a new one... @@ -560,17 +560,17 @@ const QBitmap &PlastikHandler::buttonBitmap(ButtonIcon type, const QSize &size, delete m_bitmaps[toolWindow][typeIndex]; m_bitmaps[toolWindow][typeIndex] = 0; - QBitmap bmp = IconEngine::icon(type /*icon*/, QMIN(w,h) ); - QBitmap *bitmap = new QBitmap(bmp); + TQBitmap bmp = IconEngine::icon(type /*icon*/, QMIN(w,h) ); + TQBitmap *bitmap = new TQBitmap(bmp); m_bitmaps[toolWindow][typeIndex] = bitmap; return *bitmap; } -QValueList< PlastikHandler::BorderSize > +TQValueList< PlastikHandler::BorderSize > PlastikHandler::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/kwin/clients/plastik/plastik.h b/kwin/clients/plastik/plastik.h index 16972c9ac..974df622b 100644 --- a/kwin/clients/plastik/plastik.h +++ b/kwin/clients/plastik/plastik.h @@ -23,7 +23,7 @@ #ifndef PLASTIK_H #define PLASTIK_H -#include +#include #include #include @@ -71,7 +71,7 @@ enum ButtonIcon { NumButtonIcons }; -class PlastikHandler: public QObject, public KDecorationFactory +class PlastikHandler: public TQObject, public KDecorationFactory { Q_OBJECT public: @@ -82,26 +82,26 @@ public: virtual KDecoration* createDecoration( KDecorationBridge* ); virtual bool supports( Ability ability ); - const QPixmap &pixmap(Pixmaps type, bool active, bool toolWindow); - const QBitmap &buttonBitmap(ButtonIcon type, const QSize &size, bool toolWindow); + const TQPixmap &pixmap(Pixmaps type, bool active, bool toolWindow); + const TQBitmap &buttonBitmap(ButtonIcon type, const TQSize &size, bool toolWindow); int titleHeight() { return m_titleHeight; } int titleHeightTool() { return m_titleHeightTool; } - const QFont &titleFont() { return m_titleFont; } - const QFont &titleFontTool() { return m_titleFontTool; } + const TQFont &titleFont() { return m_titleFont; } + const TQFont &titleFontTool() { return m_titleFontTool; } bool titleShadow() { return m_titleShadow; } int borderSize() { return m_borderSize; } bool animateButtons() { return m_animateButtons; } bool menuClose() { return m_menuClose; } Qt::AlignmentFlags titleAlign() { return m_titleAlign; } bool reverseLayout() { return m_reverse; } - QColor getColor(KWinPlastik::ColorType type, const bool active = true); + TQColor getColor(KWinPlastik::ColorType type, const bool active = true); - QValueList< PlastikHandler::BorderSize > borderSizes() const; + TQValueList< PlastikHandler::BorderSize > borderSizes() const; private: void readConfig(); - void pretile(QPixmap *&pix, int size, Qt::Orientation dir) const; + void pretile(TQPixmap *&pix, int size, Qt::Orientation dir) const; bool m_coloredBorder; bool m_titleShadow; @@ -111,13 +111,13 @@ private: int m_borderSize; int m_titleHeight; int m_titleHeightTool; - QFont m_titleFont; - QFont m_titleFontTool; + TQFont m_titleFont; + TQFont m_titleFontTool; Qt::AlignmentFlags m_titleAlign; // pixmap cache - QPixmap *m_pixmaps[2][2][NumPixmaps]; // button pixmaps have normal+pressed state... - QBitmap *m_bitmaps[2][NumButtonIcons]; + TQPixmap *m_pixmaps[2][2][NumPixmaps]; // button pixmaps have normal+pressed state... + TQBitmap *m_bitmaps[2][NumButtonIcons]; }; PlastikHandler* Handler(); diff --git a/kwin/clients/plastik/plastikbutton.cpp b/kwin/clients/plastik/plastikbutton.cpp index 5917465ab..27a3eb127 100644 --- a/kwin/clients/plastik/plastikbutton.cpp +++ b/kwin/clients/plastik/plastikbutton.cpp @@ -22,12 +22,12 @@ // #include -#include -#include -#include +#include +#include +#include #include #include -#include +#include #include "plastikbutton.h" #include "plastikbutton.moc" @@ -50,8 +50,8 @@ PlastikButton::PlastikButton(ButtonType type, PlastikClient *parent, const char // no need to reset here as the button will be resetted on first resize. - animTmr = new QTimer(this); - connect(animTmr, SIGNAL(timeout() ), this, SLOT(animate() ) ); + animTmr = new TQTimer(this); + connect(animTmr, TQT_SIGNAL(timeout() ), this, TQT_SLOT(animate() ) ); animProgress = 0; } @@ -143,43 +143,43 @@ void PlastikButton::animate() repaint(false); } -void PlastikButton::enterEvent(QEvent *e) +void PlastikButton::enterEvent(TQEvent *e) { - QButton::enterEvent(e); + TQButton::enterEvent(e); hover = true; animate(); } -void PlastikButton::leaveEvent(QEvent *e) +void PlastikButton::leaveEvent(TQEvent *e) { - QButton::leaveEvent(e); + TQButton::leaveEvent(e); hover = false; animate(); } -void PlastikButton::drawButton(QPainter *painter) +void PlastikButton::drawButton(TQPainter *painter) { - QRect r(0,0,width(),height()); + TQRect r(0,0,width(),height()); bool active = m_client->isActive(); KPixmap tempKPixmap; - QColor highlightColor; + TQColor highlightColor; if(type() == CloseButton) { - highlightColor = QColor(255,64,0); + highlightColor = TQColor(255,64,0); } else { highlightColor = Qt::white; } - QColor contourTop = alphaBlendColors(Handler()->getColor(TitleGradient2, active), + TQColor contourTop = alphaBlendColors(Handler()->getColor(TitleGradient2, active), Qt::black, 215); - QColor contourBottom = alphaBlendColors(Handler()->getColor(TitleGradient3, active), + TQColor contourBottom = alphaBlendColors(Handler()->getColor(TitleGradient3, active), Qt::black, 215); - QColor sourfaceTop = alphaBlendColors(Handler()->getColor(TitleGradient2, active), + TQColor sourfaceTop = alphaBlendColors(Handler()->getColor(TitleGradient2, active), Qt::white, 210); - QColor sourfaceBottom = alphaBlendColors(Handler()->getColor(TitleGradient3, active), + TQColor sourfaceBottom = alphaBlendColors(Handler()->getColor(TitleGradient3, active), Qt::white, 210); int highlightAlpha = static_cast(255-((60/static_cast(ANIMATIONSTEPS))* @@ -196,9 +196,9 @@ void PlastikButton::drawButton(QPainter *painter) sourfaceBottom = alphaBlendColors(sourfaceBottom, Qt::black, 200); } - QPixmap buffer; + TQPixmap buffer; buffer.resize(width(), height()); - QPainter bP(&buffer); + TQPainter bP(&buffer); // fake the titlebar background bP.drawTiledPixmap(0, 0, width(), width(), m_client->getTitleBarTile(active) ); @@ -251,7 +251,7 @@ void PlastikButton::drawButton(QPainter *painter) if (type() == MenuButton) { - QPixmap menuIcon(m_client->icon().pixmap( QIconSet::Small, QIconSet::Normal)); + TQPixmap menuIcon(m_client->icon().pixmap( TQIconSet::Small, TQIconSet::Normal)); if (width() < menuIcon.width() || height() < menuIcon.height() ) { menuIcon.convertFromImage( menuIcon.convertToImage().smoothScale(width(), height())); } @@ -260,7 +260,7 @@ void PlastikButton::drawButton(QPainter *painter) else { int dX,dY; - const QBitmap &icon = Handler()->buttonBitmap(m_iconType, size(), decoration()->isToolWindow() ); + const TQBitmap &icon = Handler()->buttonBitmap(m_iconType, size(), decoration()->isToolWindow() ); dX = r.x()+(r.width()-icon.width())/2; dY = r.y()+(r.height()-icon.height())/2; if (isDown() ) { @@ -268,11 +268,11 @@ void PlastikButton::drawButton(QPainter *painter) } if(!isDown() && Handler()->titleShadow() ) { - QColor shadowColor; + TQColor shadowColor; if (qGray(Handler()->getColor(TitleFont,active).rgb()) < 100) - shadowColor = QColor(255, 255, 255); + shadowColor = TQColor(255, 255, 255); else - shadowColor = QColor(0,0,0); + shadowColor = TQColor(0,0,0); bP.setPen(alphaBlendColors(sourfaceTop, shadowColor, 180) ); bP.drawPixmap(dX+1, dY+1, icon); } @@ -285,18 +285,18 @@ void PlastikButton::drawButton(QPainter *painter) painter->drawPixmap(0, 0, buffer); } -QBitmap IconEngine::icon(ButtonIcon icon, int size) +TQBitmap IconEngine::icon(ButtonIcon icon, int size) { if (size%2 == 0) --size; - QBitmap bitmap(size,size); + TQBitmap bitmap(size,size); bitmap.fill(Qt::color0); - QPainter p(&bitmap); + TQPainter p(&bitmap); p.setPen(Qt::color1); - QRect r = bitmap.rect(); + TQRect r = bitmap.rect(); // line widths int lwTitleBar = 1; @@ -554,7 +554,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/kwin/clients/plastik/plastikbutton.h b/kwin/clients/plastik/plastikbutton.h index 0be8dddea..69ba6d8e0 100644 --- a/kwin/clients/plastik/plastikbutton.h +++ b/kwin/clients/plastik/plastikbutton.h @@ -23,8 +23,8 @@ #ifndef PLASTIKBUTTON_H #define PLASTIKBUTTON_H -#include -#include +#include +#include #include "plastik.h" #include @@ -49,30 +49,30 @@ protected slots: void animate(); private: - void enterEvent(QEvent *e); - void leaveEvent(QEvent *e); - void drawButton(QPainter *painter); + void enterEvent(TQEvent *e); + void leaveEvent(TQEvent *e); + void drawButton(TQPainter *painter); private: PlastikClient *m_client; ButtonIcon m_iconType; bool hover; - QTimer *animTmr; + TQTimer *animTmr; uint animProgress; }; /** * 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->QImage->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 { @@ -82,7 +82,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 KWinPlastik diff --git a/kwin/clients/plastik/plastikclient.cpp b/kwin/clients/plastik/plastikclient.cpp index 722761a5f..604c66641 100644 --- a/kwin/clients/plastik/plastikclient.cpp +++ b/kwin/clients/plastik/plastikclient.cpp @@ -22,15 +22,15 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "plastikclient.h" #include "plastikbutton.h" @@ -41,9 +41,9 @@ namespace KWinPlastik PlastikClient::PlastikClient(KDecorationBridge* bridge, KDecorationFactory* factory) : KCommonDecoration (bridge, factory), - s_titleFont(QFont() ) + s_titleFont(TQFont() ) { - memset(m_captionPixmaps, 0, sizeof(QPixmap*)*2); + memset(m_captionPixmaps, 0, sizeof(TQPixmap*)*2); } PlastikClient::~PlastikClient() @@ -51,17 +51,17 @@ PlastikClient::~PlastikClient() clearCaptionPixmaps(); } -QString PlastikClient::visibleName() const +TQString PlastikClient::visibleName() const { return i18n("Plastik"); } -QString PlastikClient::defaultButtonsLeft() const +TQString PlastikClient::defaultButtonsLeft() const { return "M"; } -QString PlastikClient::defaultButtonsRight() const +TQString PlastikClient::defaultButtonsRight() const { return "HIAX"; } @@ -197,7 +197,7 @@ void PlastikClient::init() KCommonDecoration::init(); } -QRegion PlastikClient::cornerShape(WindowCorner corner) +TQRegion PlastikClient::cornerShape(WindowCorner corner) { int w = widget()->width(); int h = widget()->height(); @@ -205,37 +205,37 @@ QRegion PlastikClient::cornerShape(WindowCorner corner) switch (corner) { case WC_TopLeft: if (layoutMetric(LM_TitleEdgeLeft) > 0) - return QRegion(0, 0, 1, 2) + QRegion(1, 0, 1, 1); + return TQRegion(0, 0, 1, 2) + TQRegion(1, 0, 1, 1); else - return QRegion(); + return TQRegion(); case WC_TopRight: if (layoutMetric(LM_TitleEdgeRight) > 0) - return QRegion(w-1, 0, 1, 2) + QRegion(w-2, 0, 1, 1); + return TQRegion(w-1, 0, 1, 2) + TQRegion(w-2, 0, 1, 1); else - return QRegion(); + return TQRegion(); case WC_BottomLeft: if (layoutMetric(LM_BorderBottom) > 0) - return QRegion(0, h-1, 1, 1); + return TQRegion(0, h-1, 1, 1); else - return QRegion(); + return TQRegion(); case WC_BottomRight: if (layoutMetric(LM_BorderBottom) > 0) - return QRegion(w-1, h-1, 1, 1); + return TQRegion(w-1, h-1, 1, 1); else - return QRegion(); + return TQRegion(); default: - return QRegion(); + return TQRegion(); } } -void PlastikClient::paintEvent(QPaintEvent *e) +void PlastikClient::paintEvent(TQPaintEvent *e) { - QRegion region = e->region(); + TQRegion region = e->region(); PlastikHandler *handler = Handler(); @@ -245,10 +245,10 @@ void PlastikClient::paintEvent(QPaintEvent *e) bool active = isActive(); bool toolWindow = isToolWindow(); - QPainter painter(widget() ); + TQPainter painter(widget() ); // often needed coordinates - QRect r = widget()->rect(); + TQRect r = widget()->rect(); int r_w = r.width(); // int r_h = r.height(); @@ -270,11 +270,11 @@ void PlastikClient::paintEvent(QPaintEvent *e) const int sideHeight = borderBottomTop-titleEdgeBottomBottom-1; - QRect Rtitle = QRect(r_x+titleEdgeLeft+buttonsLeftWidth(), r_y+titleEdgeTop, + TQRect Rtitle = TQRect(r_x+titleEdgeLeft+buttonsLeftWidth(), r_y+titleEdgeTop, r_x2-titleEdgeRight-buttonsRightWidth()-(r_x+titleEdgeLeft+buttonsLeftWidth()), titleEdgeBottomBottom-(r_y+titleEdgeTop) ); - QRect tempRect; + TQRect tempRect; // topSpacer if(titleEdgeTop > 0) @@ -308,7 +308,7 @@ void PlastikClient::paintEvent(QPaintEvent *e) } // titleSpacer - const QPixmap &caption = captionPixmap(); + const TQPixmap &caption = captionPixmap(); if(Rtitle.width() > 0) { m_captionRect = captionRect(); // also update m_captionRect! @@ -376,10 +376,10 @@ void PlastikClient::paintEvent(QPaintEvent *e) } } -QRect PlastikClient::captionRect() const +TQRect PlastikClient::captionRect() const { - const QPixmap &caption = captionPixmap(); - QRect r = widget()->rect(); + const TQPixmap &caption = captionPixmap(); + TQRect r = widget()->rect(); const int titleHeight = layoutMetric(LM_TitleHeight); const int titleEdgeBottom = layoutMetric(LM_TitleEdgeBottom); @@ -413,12 +413,12 @@ QRect PlastikClient::captionRect() const tX = titleLeft+titleWidth-caption.width(); } - return QRect(tX, r.top()+titleEdgeTop, tW, titleHeight+titleEdgeBottom); + return TQRect(tX, r.top()+titleEdgeTop, tW, titleHeight+titleEdgeBottom); } void PlastikClient::updateCaption() { - QRect oldCaptionRect = m_captionRect; + TQRect oldCaptionRect = m_captionRect; if (oldCaption != caption() ) clearCaptionPixmaps(); @@ -453,12 +453,12 @@ void PlastikClient::reset( unsigned long changed ) KCommonDecoration::reset(changed); } -const QPixmap &PlastikClient::getTitleBarTile(bool active) const +const TQPixmap &PlastikClient::getTitleBarTile(bool active) const { return Handler()->pixmap(TitleBarTile, active, isToolWindow() ); } -const QPixmap &PlastikClient::captionPixmap() const +const TQPixmap &PlastikClient::captionPixmap() const { bool active = isActive(); @@ -469,44 +469,44 @@ const QPixmap &PlastikClient::captionPixmap() const // not found, create new pixmap... const uint maxCaptionLength = 300; // truncate captions longer than this! - QString c(caption() ); + TQString c(caption() ); if (c.length() > maxCaptionLength) { c.truncate(maxCaptionLength); c.append(" [...]"); } - QFontMetrics fm(s_titleFont); + TQFontMetrics fm(s_titleFont); int captionWidth = fm.width(c); int captionHeight = fm.height(); const int th = layoutMetric(LM_TitleHeight, false) + layoutMetric(LM_TitleEdgeBottom, false); - QPainter painter; + TQPainter painter; const int thickness = 2; - QPixmap *captionPixmap = new QPixmap(captionWidth+2*thickness, th); + TQPixmap *captionPixmap = new TQPixmap(captionWidth+2*thickness, th); painter.begin(captionPixmap); painter.drawTiledPixmap(captionPixmap->rect(), Handler()->pixmap(TitleBarTile, active, isToolWindow()) ); painter.setFont(s_titleFont); - QPoint tp(1, captionHeight-1); + TQPoint tp(1, captionHeight-1); if(Handler()->titleShadow()) { - QColor shadowColor; + TQColor shadowColor; if (qGray(Handler()->getColor(TitleFont,active).rgb()) < 100) - shadowColor = QColor(255, 255, 255); + shadowColor = TQColor(255, 255, 255); else - shadowColor = QColor(0,0,0); + shadowColor = TQColor(0,0,0); painter.setPen(alphaBlendColors(options()->color(ColorTitleBar, active), shadowColor, 205) ); - painter.drawText(tp+QPoint(1,2), c); + painter.drawText(tp+TQPoint(1,2), c); painter.setPen(alphaBlendColors(options()->color(ColorTitleBar, active), shadowColor, 225) ); - painter.drawText(tp+QPoint(2,2), c); + painter.drawText(tp+TQPoint(2,2), c); painter.setPen(alphaBlendColors(options()->color(ColorTitleBar, active), shadowColor, 165) ); - painter.drawText(tp+QPoint(1,1), c); + painter.drawText(tp+TQPoint(1,1), c); } painter.setPen(Handler()->getColor(TitleFont,active) ); painter.drawText(tp, c ); diff --git a/kwin/clients/plastik/plastikclient.h b/kwin/clients/plastik/plastikclient.h index 28b611b8e..e83bf75a5 100644 --- a/kwin/clients/plastik/plastikclient.h +++ b/kwin/clients/plastik/plastikclient.h @@ -37,35 +37,35 @@ public: PlastikClient(KDecorationBridge* bridge, KDecorationFactory* factory); ~PlastikClient(); - 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 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 KCommonDecorationButton *createButton(ButtonType type); virtual void init(); virtual void reset( unsigned long changed ); - virtual void paintEvent(QPaintEvent *e); + virtual void paintEvent(TQPaintEvent *e); virtual void updateCaption(); - const QPixmap &getTitleBarTile(bool active) const; + const TQPixmap &getTitleBarTile(bool active) const; private: - QRect captionRect() const; + TQRect captionRect() const; - const QPixmap &captionPixmap() const; + const TQPixmap &captionPixmap() const; void clearCaptionPixmaps(); - mutable QPixmap *m_captionPixmaps[2]; + mutable TQPixmap *m_captionPixmaps[2]; - QRect m_captionRect; - QString oldCaption; + TQRect m_captionRect; + TQString oldCaption; // settings... - QFont s_titleFont; + TQFont s_titleFont; }; } // KWinPlastik diff --git a/kwin/clients/quartz/config/config.cpp b/kwin/clients/quartz/config/config.cpp index 8c7070b9d..d15eb4da1 100644 --- a/kwin/clients/quartz/config/config.cpp +++ b/kwin/clients/quartz/config/config.cpp @@ -9,13 +9,13 @@ #include "config.h" #include -#include +#include #include extern "C" { - KDE_EXPORT QObject* allocate_config( KConfig* conf, QWidget* parent ) + KDE_EXPORT TQObject* allocate_config( KConfig* conf, TQWidget* parent ) { return(new QuartzConfig(conf, parent)); } @@ -26,31 +26,31 @@ extern "C" * 'conf' is a pointer to the kwindecoration modules open kwin config, * and is by default set to the "Style" group. * - * 'parent' is the parent of the QObject, which is a VBox inside the + * 'parent' is the parent of the TQObject, which is a VBox inside the * Configure tab in kwindecoration */ -QuartzConfig::QuartzConfig( KConfig* conf, QWidget* parent ) - : QObject( parent ) +QuartzConfig::QuartzConfig( KConfig* conf, TQWidget* parent ) + : TQObject( parent ) { quartzConfig = new KConfig("kwinquartzrc"); KGlobal::locale()->insertCatalogue("kwin_clients"); - gb = new QVBox( parent ); - cbColorBorder = new QCheckBox( + gb = new TQVBox( parent ); + cbColorBorder = new TQCheckBox( i18n("Draw window frames using &titlebar colors"), gb ); - QWhatsThis::add( cbColorBorder, + TQWhatsThis::add( cbColorBorder, i18n("When selected, the window decoration borders " "are drawn using the titlebar colors; otherwise, they are " "drawn using normal border colors instead.") ); - cbExtraSmall = new QCheckBox( i18n("Quartz &extra slim"), gb ); - QWhatsThis::add( cbExtraSmall, + cbExtraSmall = new TQCheckBox( i18n("Quartz &extra slim"), gb ); + TQWhatsThis::add( cbExtraSmall, i18n("Quartz window decorations with extra-small title bar.") ); // Load configuration options load( conf ); // Ensure we track user changes properly - connect( cbColorBorder, SIGNAL(clicked()), this, SLOT(slotSelectionChanged()) ); - connect( cbExtraSmall, SIGNAL(clicked()), this, SLOT(slotSelectionChanged()) ); + connect( cbColorBorder, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSelectionChanged()) ); + connect( cbExtraSmall, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSelectionChanged()) ); // Make the widgets visible in kwindecoration gb->show(); diff --git a/kwin/clients/quartz/config/config.h b/kwin/clients/quartz/config/config.h index 815cc9644..0a952c4e9 100644 --- a/kwin/clients/quartz/config/config.h +++ b/kwin/clients/quartz/config/config.h @@ -10,8 +10,8 @@ #ifndef __KDE_QUARTZCONFIG_H #define __KDE_QUARTZCONFIG_H -#include -#include +#include +#include #include class QuartzConfig: public QObject @@ -19,7 +19,7 @@ class QuartzConfig: public QObject Q_OBJECT public: - QuartzConfig( KConfig* conf, QWidget* parent ); + QuartzConfig( KConfig* conf, TQWidget* parent ); ~QuartzConfig(); // These public signals/slots work similar to KCM modules @@ -36,9 +36,9 @@ class QuartzConfig: public QObject private: KConfig* quartzConfig; - QCheckBox* cbColorBorder; - QCheckBox* cbExtraSmall; - QVBox* gb; + TQCheckBox* cbColorBorder; + TQCheckBox* cbExtraSmall; + TQVBox* gb; }; diff --git a/kwin/clients/quartz/quartz.cpp b/kwin/clients/quartz/quartz.cpp index 857971780..82caabb45 100644 --- a/kwin/clients/quartz/quartz.cpp +++ b/kwin/clients/quartz/quartz.cpp @@ -19,10 +19,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "quartz.h" @@ -208,7 +208,7 @@ void QuartzHandler::readConfig() // A small hack to make the on all desktops button look nicer onAllDesktopsButtonOnLeft = KDecoration::options()->titleButtonsLeft().contains( 'S' ); - if ( QApplication::reverseLayout() ) + if ( TQApplication::reverseLayout() ) onAllDesktopsButtonOnLeft = !onAllDesktopsButtonOnLeft; switch(options()->preferredBorderSize(this)) { case BorderLarge: @@ -232,13 +232,13 @@ void QuartzHandler::readConfig() borderWidth = extraSlim?2:4; } - normalTitleHeight = QFontMetrics(options()->font(true)).height(); + normalTitleHeight = TQFontMetrics(options()->font(true)).height(); int nTH_limit=extraSlim?14:18; - normalTitleHeight = QFontMetrics(options()->font(true)).height()-(extraSlim?1:0); + normalTitleHeight = TQFontMetrics(options()->font(true)).height()-(extraSlim?1:0); if (normalTitleHeight < nTH_limit) normalTitleHeight = nTH_limit; if (normalTitleHeight < borderWidth) normalTitleHeight = borderWidth; - toolTitleHeight = QFontMetrics(options()->font(true, true)).height(); + toolTitleHeight = TQFontMetrics(options()->font(true, true)).height(); if (toolTitleHeight < 12) toolTitleHeight = 12; if (toolTitleHeight < borderWidth) toolTitleHeight = borderWidth; } @@ -246,9 +246,9 @@ void QuartzHandler::readConfig() // This does the colour transition magic. (You say "Oh, is that it?") // This may be made configurable at a later stage -void QuartzHandler::drawBlocks( KPixmap *pi, KPixmap &p, const QColor &c1, const QColor &c2 ) +void QuartzHandler::drawBlocks( KPixmap *pi, KPixmap &p, const TQColor &c1, const TQColor &c2 ) { - QPainter px; + TQPainter px; px.begin( pi ); @@ -291,10 +291,10 @@ void QuartzHandler::drawBlocks( KPixmap *pi, KPixmap &p, const QColor &c1, const void QuartzHandler::createPixmaps() { // Obtain titlebar blend colours, and create the block stuff on pixmaps. - QColorGroup g2 = options()->colorGroup(ColorTitleBlend, true); - QColor c2 = g2.background(); + TQColorGroup g2 = options()->colorGroup(ColorTitleBlend, true); + TQColor c2 = g2.background(); g2 = options()->colorGroup(ColorTitleBar, true ); - QColor c = g2.background().light(130); + TQColor c = g2.background().light(130); titleBlocks = new KPixmap(); titleBlocks->resize( normalTitleHeight*25/18, normalTitleHeight ); @@ -310,8 +310,8 @@ void QuartzHandler::createPixmaps() drawBlocks( ititleBlocks, *ititleBlocks, c, c2 ); // Set the on all desktops pin pixmaps; - QColorGroup g; - QPainter p; + TQColorGroup g; + TQPainter p; g = options()->colorGroup( onAllDesktopsButtonOnLeft ? ColorTitleBar : ColorTitleBlend, true ); c = onAllDesktopsButtonOnLeft ? g.background().light(130) : g.background(); @@ -370,9 +370,9 @@ void QuartzHandler::freePixmaps() } -QValueList< QuartzHandler::BorderSize > QuartzHandler::borderSizes() const +TQValueList< QuartzHandler::BorderSize > QuartzHandler::borderSizes() const { // the list must be sorted - return QValueList< BorderSize >() << BorderNormal << BorderLarge << + return TQValueList< BorderSize >() << BorderNormal << BorderLarge << BorderVeryLarge << BorderHuge << BorderVeryHuge << BorderOversized; } @@ -381,7 +381,7 @@ QuartzButton::QuartzButton(ButtonType type, QuartzClient *parent, const char *na : KCommonDecorationButton(type, parent, name) { // Eliminate any possible background flicker - setBackgroundMode( QWidget::NoBackground ); + setBackgroundMode( TQWidget::NoBackground ); deco = 0; } @@ -435,19 +435,19 @@ void QuartzButton::setBitmap(const unsigned char *bitmap) deco = 0; if (bitmap) { - deco = new QBitmap(10, 10, bitmap, true); + deco = new TQBitmap(10, 10, bitmap, true); deco->setMask( *deco ); repaint( false ); } } -void QuartzButton::drawButton(QPainter *p) +void QuartzButton::drawButton(TQPainter *p) { // Never paint if the pixmaps have not been created if (!quartz_initialized) return; - QColor c; + TQColor c; if (isLeft() ) c = KDecoration::options()->color(KDecoration::ColorTitleBar, decoration()->isActive()).light(130); @@ -469,7 +469,7 @@ void QuartzButton::drawButton(QPainter *p) p->drawPixmap(isDown() ? xOff+1: xOff, isDown() ? yOff+1 : yOff, *deco); } else { - QPixmap btnpix; + TQPixmap btnpix; int Offset = 0; if (type() == OnAllDesktopsButton) @@ -484,12 +484,12 @@ void QuartzButton::drawButton(QPainter *p) btnpix = isOn() ? *ipinDownPix : *ipinUpPix; } else - btnpix = decoration()->icon().pixmap( QIconSet::Small, QIconSet::Normal); + btnpix = decoration()->icon().pixmap( TQIconSet::Small, TQIconSet::Normal); // Shrink the miniIcon for tiny titlebars. if ( height() < 16) { - QPixmap tmpPix; + TQPixmap tmpPix; // Smooth scale the image tmpPix.convertFromImage( btnpix.convertToImage().smoothScale(height(), height())); @@ -508,17 +508,17 @@ QuartzClient::QuartzClient(KDecorationBridge* bridge, KDecorationFactory* factor { } -QString QuartzClient::visibleName() const +TQString QuartzClient::visibleName() const { return i18n("Quartz"); } -QString QuartzClient::defaultButtonsLeft() const +TQString QuartzClient::defaultButtonsLeft() const { return "M"; } -QString QuartzClient::defaultButtonsRight() const +TQString QuartzClient::defaultButtonsRight() const { return "HIAX"; } @@ -652,7 +652,7 @@ void QuartzClient::reset( unsigned long changed ) // Quartz Paint magic goes here. -void QuartzClient::paintEvent( QPaintEvent* ) +void QuartzClient::paintEvent( TQPaintEvent* ) { // Never paint if the pixmaps have not been created if (!quartz_initialized) @@ -660,11 +660,11 @@ void QuartzClient::paintEvent( QPaintEvent* ) const bool maxFull = (maximizeMode()==MaximizeFull) && !options()->moveResizeMaximizedWindows(); - QColorGroup g; - QPainter p(widget()); + TQColorGroup g; + TQPainter p(widget()); // Obtain widget bounds. - QRect r(widget()->rect()); + TQRect r(widget()->rect()); int x = r.x(); int y = r.y(); int x2 = r.width() - 1; @@ -688,7 +688,7 @@ void QuartzClient::paintEvent( QPaintEvent* ) p.drawLine( x, y2, x2, y2 ); // Fill out the border edges - QColor frameColor; + TQColor frameColor; if ( coloredFrame) frameColor = g.background().light(130); else @@ -730,19 +730,19 @@ void QuartzClient::paintEvent( QPaintEvent* ) const int titleEdgeBottom = layoutMetric(LM_TitleEdgeBottom); const int ttlHeight = layoutMetric(LM_TitleHeight); const int titleEdgeBottomBottom = r_y+titleEdgeTop+ttlHeight+titleEdgeBottom-1; - r = QRect(r_x+titleEdgeLeft+buttonsLeftWidth(), r_y+titleEdgeTop, + r = TQRect(r_x+titleEdgeLeft+buttonsLeftWidth(), r_y+titleEdgeTop, r_x2-titleEdgeRight-buttonsRightWidth()-(r_x+titleEdgeLeft+buttonsLeftWidth()), titleEdgeBottomBottom-(r_y+titleEdgeTop) ); // Obtain titlebar blend colours - QColor c1 = options()->color(ColorTitleBar, isActive() ).light(130); - QColor c2 = options()->color(ColorTitleBlend, isActive() ); + TQColor c1 = options()->color(ColorTitleBar, isActive() ).light(130); + TQColor c2 = options()->color(ColorTitleBlend, isActive() ); // Create a disposable pixmap buffer for the titlebar KPixmap* titleBuffer = new KPixmap; titleBuffer->resize( maxFull?w-2:(w-2*(borderSize-1)), titleHeight ); - QPainter p2( titleBuffer, this ); + TQPainter p2( titleBuffer, this ); // subtract titleBlocks pixmap width and some int rightoffset = r.x()+r.width()-titleBlocks->width()-borderSize; @@ -758,12 +758,12 @@ void QuartzClient::paintEvent( QPaintEvent* ) // Draw the title text on the pixmap, and with a smaller font // for toolwindows than the default. - QFont fnt; + TQFont fnt; if ( largeButtons ) { fnt = options()->font(true, false); // font not small } else { fnt = options()->font(true, true); // font small - fnt.setWeight( QFont::Normal ); // and disable bold + fnt.setWeight( TQFont::Normal ); // and disable bold } p2.setFont( fnt ); diff --git a/kwin/clients/quartz/quartz.h b/kwin/clients/quartz/quartz.h index 37f3dff6e..1133a7ae4 100644 --- a/kwin/clients/quartz/quartz.h +++ b/kwin/clients/quartz/quartz.h @@ -16,7 +16,7 @@ #ifndef __KDEGALLIUM_QUARTZ_H #define __KDEGALLIUM_QUARTZ_H -#include +#include #include #include "../../lib/kcommondecoration.h" #include "../../lib/kdecorationfactory.h" @@ -28,7 +28,7 @@ namespace Quartz { class QuartzClient; -class QuartzHandler: public QObject, public KDecorationFactory +class QuartzHandler: public TQObject, public KDecorationFactory { Q_OBJECT public: @@ -38,13 +38,13 @@ class QuartzHandler: public QObject, public KDecorationFactory virtual KDecoration* createDecoration( KDecorationBridge* ); virtual bool reset(unsigned long changed); virtual bool supports( Ability ability ); - virtual QValueList< BorderSize > borderSizes() const; + virtual TQValueList< BorderSize > borderSizes() const; private: void readConfig(); void createPixmaps(); void freePixmaps(); - void drawBlocks(KPixmap* pi, KPixmap &p, const QColor &c1, const QColor &c2); + void drawBlocks(KPixmap* pi, KPixmap &p, const TQColor &c1, const TQColor &c2); }; @@ -58,9 +58,9 @@ class QuartzButton : public KCommonDecorationButton void reset(unsigned long changed); protected: - void drawButton(QPainter *p); + void drawButton(TQPainter *p); - QBitmap* deco; + TQBitmap* deco; }; @@ -70,9 +70,9 @@ class QuartzClient : public KCommonDecoration QuartzClient(KDecorationBridge* bridge, KDecorationFactory* factory); ~QuartzClient() {;} - 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 bool decorationBehaviour(DecorationBehaviour behaviour) const; virtual int layoutMetric(LayoutMetric lm, bool respectWindowState = true, const KCommonDecorationButton * = 0) const; virtual KCommonDecorationButton *createButton(ButtonType type); @@ -81,7 +81,7 @@ class QuartzClient : public KCommonDecoration protected: virtual void reset( unsigned long changed ); - void paintEvent( QPaintEvent* ); + void paintEvent( TQPaintEvent* ); private: int titleHeight, borderSize; diff --git a/kwin/clients/redmond/redmond.cpp b/kwin/clients/redmond/redmond.cpp index e41eb6353..7f74479ed 100644 --- a/kwin/clients/redmond/redmond.cpp +++ b/kwin/clients/redmond/redmond.cpp @@ -14,16 +14,16 @@ #include "redmond.h" -#include -#include +#include +#include #include #include #include #include -#include -#include -#include +#include +#include +#include namespace Redmond { @@ -87,8 +87,8 @@ static KPixmap *iMiniBtnPix1; static KPixmap *miniBtnDownPix1; static KPixmap *iMiniBtnDownPix1; -static QPixmap *defaultMenuPix; -static QColor *btnForeground; +static TQPixmap *defaultMenuPix; +static TQColor *btnForeground; static bool pixmaps_created = false; static int toolTitleHeight; @@ -100,9 +100,9 @@ static inline const KDecorationOptions *options() return KDecoration::options(); } -static void drawButtonFrame( KPixmap *pix, const QColorGroup &g, bool sunken ) +static void drawButtonFrame( KPixmap *pix, const TQColorGroup &g, bool sunken ) { - QPainter p; + TQPainter p; int x2 = pix->width() - 1; int y2 = pix->height() - 1; p.begin(pix); @@ -136,7 +136,7 @@ static void create_pixmaps () pixmaps_created = true; - bool highcolor = QPixmap::defaultDepth() > 8; + bool highcolor = TQPixmap::defaultDepth() > 8; btnPix1 = new KPixmap; btnDownPix1 = new KPixmap; @@ -146,11 +146,11 @@ static void create_pixmaps () miniBtnDownPix1 = new KPixmap; iMiniBtnPix1 = new KPixmap; iMiniBtnDownPix1 = new KPixmap; - defaultMenuPix = new QPixmap(kdelogo); + defaultMenuPix = new TQPixmap(kdelogo); // buttons (active/inactive, sunken/unsunken) - QColorGroup g = options()->colorGroup(KDecoration::ColorButtonBg, true); - QColor c = g.background(); + TQColorGroup g = options()->colorGroup(KDecoration::ColorButtonBg, true); + TQColor c = g.background(); btnPix1->resize(normalTitleHeight, normalTitleHeight-2); btnDownPix1->resize(normalTitleHeight, normalTitleHeight-2); iBtnPix1->resize(normalTitleHeight, normalTitleHeight-2); @@ -210,9 +210,9 @@ static void create_pixmaps () // Make sure button pixmaps contrast with the current colour scheme. if (qGray(options()->color(KDecoration::ColorButtonBg, true).rgb()) > 127) - btnForeground = new QColor(Qt::black); + btnForeground = new TQColor(Qt::black); else - btnForeground = new QColor(Qt::white); + btnForeground = new TQColor(Qt::white); } void delete_pixmaps() @@ -257,7 +257,7 @@ void RedmondButton::reset(unsigned long changed) break; case MenuButton: { - QPixmap miniIcon = decoration()->icon().pixmap(QIconSet::Small, QIconSet::Normal); + TQPixmap miniIcon = decoration()->icon().pixmap(TQIconSet::Small, TQIconSet::Normal); if (!miniIcon.isNull()) { setPixmap(miniIcon); } else { @@ -280,16 +280,16 @@ void RedmondButton::setBitmap(const unsigned char *bitmap) pix.resize(0, 0); if (bitmap) - deco = QBitmap(10, 10, bitmap, true); + deco = TQBitmap(10, 10, bitmap, true); else { - deco = QBitmap(10,10); + deco = TQBitmap(10,10); deco.fill(Qt::color0); } deco.setMask(deco); } -void RedmondButton::setPixmap( const QPixmap &p ) +void RedmondButton::setPixmap( const TQPixmap &p ) { deco.resize(0, 0); pix = p; @@ -298,7 +298,7 @@ void RedmondButton::setPixmap( const QPixmap &p ) } -void RedmondButton::drawButton(QPainter *p) +void RedmondButton::drawButton(TQPainter *p) { if ( pix.isNull() ) { if ( decoration()->isActive() ) { @@ -327,7 +327,7 @@ void RedmondButton::drawButton(QPainter *p) } if ( type()==MenuButton && height() < 16) { - QPixmap tmpPix; + TQPixmap tmpPix; // Smooth scale the menu button pixmap tmpPix.convertFromImage( @@ -348,17 +348,17 @@ RedmondDeco::RedmondDeco(KDecorationBridge *b, KDecorationFactory *f) { } -QString RedmondDeco::visibleName() const +TQString RedmondDeco::visibleName() const { return i18n("Redmond"); } -QString RedmondDeco::defaultButtonsLeft() const +TQString RedmondDeco::defaultButtonsLeft() const { return "M"; } -QString RedmondDeco::defaultButtonsRight() const +TQString RedmondDeco::defaultButtonsRight() const { return "HIA_X"; } @@ -463,19 +463,19 @@ void RedmondDeco::reset( unsigned long changed ) KCommonDecoration::reset(changed); } -void RedmondDeco::paintEvent( QPaintEvent* ) +void RedmondDeco::paintEvent( TQPaintEvent* ) { - bool hicolor = QPixmap::defaultDepth() > 8; + bool hicolor = TQPixmap::defaultDepth() > 8; int fontoffset = 1; // Modify borderWith used by titlebar to 0, when maximized and not move or resize able bool border = !(maximizeMode()==MaximizeFull && !options()->moveResizeMaximizedWindows()); int modBorderWidth = border ? borderWidth : 0; - QPainter p(widget()); + TQPainter p(widget()); // Obtain widget bounds. - QRect r(widget()->rect()); + TQRect r(widget()->rect()); int x = r.x(); int y = r.y(); int x2 = r.width()-1; @@ -485,7 +485,7 @@ void RedmondDeco::paintEvent( QPaintEvent* ) // Draw part of the frame that is the frame color // ============================================== - QColorGroup g = options()->colorGroup(KDecoration::ColorFrame, isActive()); + TQColorGroup g = options()->colorGroup(KDecoration::ColorFrame, isActive()); p.setPen( g.background() ); p.drawLine( x, y, x2-1, y ); p.drawLine( x, y, x, y2-1 ); @@ -520,15 +520,15 @@ void RedmondDeco::paintEvent( QPaintEvent* ) // Draw the title bar. // =================== r = titleRect(); -// QFontMetrics fm(options()->font(true)); +// TQFontMetrics fm(options()->font(true)); // Obtain blend colours. - QColor c1 = options()->color(KDecoration::ColorTitleBar, isActive() ); - QColor c2 = options()->color(KDecoration::ColorTitleBlend, isActive() ); + TQColor c1 = options()->color(KDecoration::ColorTitleBar, isActive() ); + TQColor c2 = options()->color(KDecoration::ColorTitleBlend, isActive() ); - QFont fnt = options()->font(true, isToolWindow() ); + TQFont fnt = options()->font(true, isToolWindow() ); if (isToolWindow() ) { - fnt.setWeight( QFont::Normal ); + fnt.setWeight( TQFont::Normal ); fontoffset = 0; } @@ -547,13 +547,13 @@ void RedmondDeco::paintEvent( QPaintEvent* ) } else { // This enables dithering on 15 and 16bit displays, preventing // some pretty horrible banding effects - QImage image = KImageEffect::gradient(titleBuffer->size(), c1, c2, + TQImage image = KImageEffect::gradient(titleBuffer->size(), c1, c2, KImageEffect::HorizontalGradient); titleBuffer->convertFromImage(image, Qt::OrderedDither); } - QPainter p2( titleBuffer, this ); + TQPainter p2( titleBuffer, this ); // Since drawing the gradient is (relatively) slow, it is best // to draw the title text on the pixmap. @@ -583,10 +583,10 @@ void RedmondDeco::paintEvent( QPaintEvent* ) } void RedmondDecoFactory::readConfig() { - normalTitleHeight = QFontMetrics(options()->font(true)).height(); - QFont toolFont = options()->font(true, true); - toolFont.setWeight(QFont::Normal); - toolTitleHeight = QFontMetrics(toolFont).height(); + normalTitleHeight = TQFontMetrics(options()->font(true)).height(); + TQFont toolFont = options()->font(true, true); + toolFont.setWeight(TQFont::Normal); + toolTitleHeight = TQFontMetrics(toolFont).height(); switch(options()->preferredBorderSize(this)) { case BorderLarge: borderWidth = 8; @@ -670,9 +670,9 @@ bool RedmondDecoFactory::supports( Ability ability ) } } -QValueList< RedmondDecoFactory::BorderSize > RedmondDecoFactory::borderSizes() const +TQValueList< RedmondDecoFactory::BorderSize > RedmondDecoFactory::borderSizes() const { // the list must be sorted - return QValueList< BorderSize >() << BorderNormal << BorderLarge << + return TQValueList< BorderSize >() << BorderNormal << BorderLarge << BorderVeryLarge << BorderHuge << BorderVeryHuge << BorderOversized; } diff --git a/kwin/clients/redmond/redmond.h b/kwin/clients/redmond/redmond.h index 340fdd1b0..fdc5047bc 100644 --- a/kwin/clients/redmond/redmond.h +++ b/kwin/clients/redmond/redmond.h @@ -18,7 +18,7 @@ #ifndef __KDE_REDMOND_H #define __KDE_REDMOND_H -#include +#include #include #include #include @@ -33,15 +33,15 @@ class RedmondButton : public KCommonDecorationButton public: RedmondButton(ButtonType type, RedmondDeco *parent, const char *name); void setBitmap(const unsigned char *bitmap); - void setPixmap(const QPixmap &p); + void setPixmap(const TQPixmap &p); void reset(unsigned long changed); protected: - virtual void drawButton(QPainter *p); - void drawButtonLabel(QPainter *){;} + virtual void drawButton(TQPainter *p); + void drawButtonLabel(TQPainter *){;} - QBitmap deco; - QPixmap pix; + TQBitmap deco; + TQPixmap pix; bool miniBtn; }; @@ -52,9 +52,9 @@ public: RedmondDeco(KDecorationBridge *, KDecorationFactory *); ~RedmondDeco() {;} - 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 bool decorationBehaviour(DecorationBehaviour behaviour) const; virtual int layoutMetric(LayoutMetric lm, bool respectWindowState = true, const KCommonDecorationButton * = 0) const; virtual KCommonDecorationButton *createButton(ButtonType type); @@ -64,13 +64,13 @@ public: protected: virtual void reset( unsigned long changed ); - void paintEvent(QPaintEvent*); + void paintEvent(TQPaintEvent*); private: int titleHeight; }; -class RedmondDecoFactory : public QObject, public KDecorationFactory +class RedmondDecoFactory : public TQObject, public KDecorationFactory { Q_OBJECT public: @@ -79,7 +79,7 @@ public: virtual KDecoration *createDecoration(KDecorationBridge *); virtual bool reset(unsigned long); virtual bool supports( Ability ability ); - virtual QValueList< BorderSize > borderSizes() const; + virtual TQValueList< BorderSize > borderSizes() const; private: void readConfig(); }; diff --git a/kwin/clients/test/test.cpp b/kwin/clients/test/test.cpp index abac77e64..a04437067 100644 --- a/kwin/clients/test/test.cpp +++ b/kwin/clients/test/test.cpp @@ -1,6 +1,6 @@ #include "test.h" -#include +#include #include #include @@ -20,16 +20,16 @@ void Decoration::init() widget()->installEventFilter( this ); if( isCloseable()) { - button = new QPushButton( widget()); + button = new TQPushButton( widget()); button->show(); button->setCursor( arrowCursor ); button->move( 0, 0 ); - connect( button, SIGNAL( clicked()), SLOT( closeWindow())); - QToolTip::add( button, "Zelva Mana" ); + connect( button, TQT_SIGNAL( clicked()), TQT_SLOT( closeWindow())); + TQToolTip::add( button, "Zelva Mana" ); } } -Decoration::MousePosition Decoration::mousePosition( const QPoint& p ) const +Decoration::MousePosition Decoration::mousePosition( const TQPoint& p ) const { const int range = 16; const int border = 4; @@ -88,30 +88,30 @@ void Decoration::reset( unsigned long ) { } -void Decoration::resize( const QSize& s ) +void Decoration::resize( const TQSize& s ) { widget()->resize( s ); } -QSize Decoration::minimumSize() const +TQSize Decoration::minimumSize() const { - return QSize( 100, 50 ); + return TQSize( 100, 50 ); } -bool Decoration::eventFilter( QObject* o, QEvent* e ) +bool Decoration::eventFilter( TQObject* o, TQEvent* e ) { if( o == widget()) { switch( e->type()) { - case QEvent::MouseButtonPress: + case TQEvent::MouseButtonPress: { // FRAME - processMousePressEvent( static_cast< QMouseEvent* >( e )); + processMousePressEvent( static_cast< TQMouseEvent* >( e )); return true; } - case QEvent::Show: + case TQEvent::Show: break; - case QEvent::Hide: + case TQEvent::Hide: break; default: break; @@ -121,8 +121,8 @@ bool Decoration::eventFilter( QObject* o, QEvent* e ) } } -#include -#include +#include +#include #include #include #include @@ -146,7 +146,7 @@ bool Decoration::animateMinimize(bool iconify) helperShowHide( false ); qApp->syncX(); - QRect r = iconGeometry(); + TQRect r = iconGeometry(); if (!r.isValid()) return true; @@ -178,7 +178,7 @@ bool Decoration::animateMinimize(bool iconify) double delta = finalAngle / steps; - QPainter p( workspaceWidget()); + TQPainter p( workspaceWidget()); p.setRasterOp(Qt::NotROP); for (double angle = 0; ; angle += delta) { @@ -190,10 +190,10 @@ bool Decoration::animateMinimize(bool iconify) double dch = (ch / 2) * cos(angle); double midy = cy + (ch / 2); - QPoint p1(int(cx + dx), int(midy - dch)); - QPoint p2(int(cx + cw - dx), p1.y()); - QPoint p3(int(cx + dw + dx), int(midy + dch)); - QPoint p4(int(cx - dx), p3.y()); + TQPoint p1(int(cx + dx), int(midy - dch)); + TQPoint p2(int(cx + cw - dx), p1.y()); + TQPoint p3(int(cx + dw + dx), int(midy + dch)); + TQPoint p4(int(cx - dx), p3.y()); grabXServer(); @@ -240,12 +240,12 @@ bool Decoration::animateMinimize(bool iconify) int stepCount = 12; - QRect r(geometry()); + TQRect r(geometry()); int dx = r.width() / (stepCount * 2); int dy = r.height() / (stepCount * 2); - QPainter p( workspaceWidget()); + TQPainter p( workspaceWidget()); p.setRasterOp(Qt::NotROP); for (int step = 0; step < stepCount; step++) { @@ -271,21 +271,21 @@ bool Decoration::animateMinimize(bool iconify) default: { - QRect icongeom = iconGeometry(); + TQRect icongeom = iconGeometry(); if (!icongeom.isValid()) return true; - QRect wingeom = geometry(); + TQRect wingeom = geometry(); - QPainter p( workspaceWidget()); + TQPainter p( workspaceWidget()); p.setRasterOp(Qt::NotROP); #if 0 if (iconify) p.setClipRegion( - QRegion( workspaceWidget()->rect()) - wingeom + TQRegion( workspaceWidget()->rect()) - wingeom ); #endif diff --git a/kwin/clients/test/test.h b/kwin/clients/test/test.h index 56e21dbc0..bfe36fa7c 100644 --- a/kwin/clients/test/test.h +++ b/kwin/clients/test/test.h @@ -3,7 +3,7 @@ #include #include -#include +#include namespace KWinTest { @@ -19,21 +19,21 @@ class Decoration public: Decoration( KDecorationBridge* bridge, KDecorationFactory* factory ); virtual void init(); - virtual MousePosition mousePosition( const QPoint& p ) const; + virtual MousePosition mousePosition( const TQPoint& p ) const; virtual void borders( int& left, int& right, int& top, int& bottom ) const; - virtual void resize( const QSize& s ); - virtual QSize minimumSize() const; + virtual void resize( const TQSize& s ); + virtual TQSize minimumSize() const; virtual void activeChange() {}; virtual void captionChange() {}; virtual void maximizeChange() {}; virtual void desktopChange() {}; virtual void shadeChange() {}; virtual void iconChange() {}; - virtual bool eventFilter( QObject* o, QEvent* e ); + virtual bool eventFilter( TQObject* o, TQEvent* e ); virtual void reset( unsigned long changed ); virtual bool animateMinimize( bool minimize ); private: - QPushButton* button; + TQPushButton* button; }; class Factory diff --git a/kwin/clients/web/Web.cpp b/kwin/clients/web/Web.cpp index 7d63b7d72..43d1b9f42 100644 --- a/kwin/clients/web/Web.cpp +++ b/kwin/clients/web/Web.cpp @@ -20,7 +20,7 @@ Boston, MA 02110-1301, USA. */ -#include +#include #include @@ -48,17 +48,17 @@ WebClient::~WebClient() // Empty. } -QString WebClient::visibleName() const +TQString WebClient::visibleName() const { return i18n("Web"); } -QString WebClient::defaultButtonsLeft() const +TQString WebClient::defaultButtonsLeft() const { return "S"; } -QString WebClient::defaultButtonsRight() const +TQString WebClient::defaultButtonsRight() const { return "HIAX"; } @@ -156,7 +156,7 @@ WebClient::init() { // title height const int textVMargin = 2; - QFontMetrics fm(options()->font(isActive(), isToolWindow())); + TQFontMetrics fm(options()->font(isActive(), isToolWindow())); // border size switch(options()->preferredBorderSize( factory())) { @@ -201,7 +201,7 @@ WebClient::reset( unsigned long changed ) // font has changed -- update title height // title height const int textVMargin = 2; - QFontMetrics fm(options()->font(isActive(), isToolWindow())); + TQFontMetrics fm(options()->font(isActive(), isToolWindow())); titleHeight_ = QMAX(QMAX(14, fm.height() + textVMargin * 2), borderSize_); if (0 != titleHeight_ % 2) titleHeight_ += 1; @@ -213,7 +213,7 @@ WebClient::reset( unsigned long changed ) } void -WebClient::paintEvent(QPaintEvent * pe) +WebClient::paintEvent(TQPaintEvent * pe) { int r_x, r_y, r_x2, r_y2; widget()->rect().coords(&r_x, &r_y, &r_x2, &r_y2); @@ -223,12 +223,12 @@ WebClient::paintEvent(QPaintEvent * pe) const int titleEdgeBottom = layoutMetric(LM_TitleEdgeBottom); const int ttlHeight = layoutMetric(LM_TitleHeight); const int titleEdgeBottomBottom = r_y+titleEdgeTop+ttlHeight+titleEdgeBottom-1; - QRect titleRect = QRect(r_x+titleEdgeLeft+buttonsLeftWidth(), r_y+titleEdgeTop, + TQRect titleRect = TQRect(r_x+titleEdgeLeft+buttonsLeftWidth(), r_y+titleEdgeTop, r_x2-titleEdgeRight-buttonsRightWidth()-(r_x+titleEdgeLeft+buttonsLeftWidth()), titleEdgeBottomBottom-(r_y+titleEdgeTop) ); titleRect.setTop(1); - QPainter p(widget()); + TQPainter p(widget()); p.setPen(Qt::black); p.setBrush(options()->colorGroup(ColorFrame, isActive()).background()); @@ -291,38 +291,38 @@ void WebClient::updateWindowShape() if (!shape_) return; - QRegion mask(0, 0, width(), height()); + TQRegion mask(0, 0, width(), height()); int r(width()); int b(height()); // Remove top-left corner. - mask -= QRegion(0, 0, 5, 1); - mask -= QRegion(0, 1, 3, 1); - mask -= QRegion(0, 2, 2, 1); - mask -= QRegion(0, 3, 1, 2); + mask -= TQRegion(0, 0, 5, 1); + mask -= TQRegion(0, 1, 3, 1); + mask -= TQRegion(0, 2, 2, 1); + mask -= TQRegion(0, 3, 1, 2); // Remove top-right corner. - mask -= QRegion(r - 5, 0, 5, 1); - mask -= QRegion(r - 3, 1, 3, 1); - mask -= QRegion(r - 2, 2, 2, 1); - mask -= QRegion(r - 1, 3, 1, 2); + mask -= TQRegion(r - 5, 0, 5, 1); + mask -= TQRegion(r - 3, 1, 3, 1); + mask -= TQRegion(r - 2, 2, 2, 1); + mask -= TQRegion(r - 1, 3, 1, 2); // Remove bottom-left corner. - mask -= QRegion(0, b - 5, 1, 3); - mask -= QRegion(0, b - 3, 2, 1); - mask -= QRegion(0, b - 2, 3, 1); - mask -= QRegion(0, b - 1, 5, 1); + mask -= TQRegion(0, b - 5, 1, 3); + mask -= TQRegion(0, b - 3, 2, 1); + mask -= TQRegion(0, b - 2, 3, 1); + mask -= TQRegion(0, b - 1, 5, 1); // Remove bottom-right corner. - mask -= QRegion(r - 5, b - 1, 5, 1); - mask -= QRegion(r - 3, b - 2, 3, 1); - mask -= QRegion(r - 2, b - 3, 2, 1); - mask -= QRegion(r - 1, b - 5, 1, 2); + mask -= TQRegion(r - 5, b - 1, 5, 1); + mask -= TQRegion(r - 3, b - 2, 3, 1); + mask -= TQRegion(r - 2, b - 3, 2, 1); + mask -= TQRegion(r - 1, b - 5, 1, 2); setMask(mask); } @@ -372,9 +372,9 @@ bool WebFactory::supports( Ability ability ) }; } -QValueList< WebFactory::BorderSize > WebFactory::borderSizes() const +TQValueList< WebFactory::BorderSize > WebFactory::borderSizes() const { // the list must be sorted - return QValueList< BorderSize >() << BorderNormal << BorderLarge << + return TQValueList< BorderSize >() << BorderNormal << BorderLarge << BorderVeryLarge << BorderHuge << BorderVeryHuge << BorderOversized; } diff --git a/kwin/clients/web/Web.h b/kwin/clients/web/Web.h index 183829e8d..7d7d53bfb 100644 --- a/kwin/clients/web/Web.h +++ b/kwin/clients/web/Web.h @@ -42,9 +42,9 @@ namespace Web WebClient(KDecorationBridge* bridge, KDecorationFactory* factory); ~WebClient(); - 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 bool decorationBehaviour(DecorationBehaviour behaviour) const; virtual int layoutMetric(LayoutMetric lm, bool respectWindowState = true, const KCommonDecorationButton * = 0) const; virtual KCommonDecorationButton *createButton(ButtonType type); @@ -56,7 +56,7 @@ namespace Web protected: virtual void reset( unsigned long changed ); - virtual void paintEvent(QPaintEvent *); + virtual void paintEvent(TQPaintEvent *); private: @@ -64,10 +64,10 @@ namespace Web bool shape_; - QBitmap _buttonBitmap(ButtonType t) const; + TQBitmap _buttonBitmap(ButtonType t) const; }; - class WebFactory : public QObject, public KDecorationFactory + class WebFactory : public TQObject, public KDecorationFactory { Q_OBJECT @@ -78,7 +78,7 @@ namespace Web virtual KDecoration* createDecoration( KDecorationBridge* ); virtual bool reset( unsigned long changed ); virtual bool supports( Ability ability ); - virtual QValueList< BorderSize > borderSizes() const; + virtual TQValueList< BorderSize > borderSizes() const; }; } diff --git a/kwin/clients/web/WebButton.cpp b/kwin/clients/web/WebButton.cpp index 66bedc19f..61811accc 100644 --- a/kwin/clients/web/WebButton.cpp +++ b/kwin/clients/web/WebButton.cpp @@ -19,7 +19,7 @@ Boston, MA 02110-1301, USA. */ -#include +#include #include "WebButton.h" #include "Web.h" @@ -124,35 +124,35 @@ void WebButton::reset(unsigned long changed) } void -WebButton::enterEvent(QEvent * e) +WebButton::enterEvent(TQEvent * e) { mouseOver_ = true; repaint(); - QButton::enterEvent(e); + TQButton::enterEvent(e); } void -WebButton::leaveEvent(QEvent * e) +WebButton::leaveEvent(TQEvent * e) { mouseOver_ = false; repaint(); - QButton::leaveEvent(e); + TQButton::leaveEvent(e); } void -WebButton::drawButton(QPainter *p) +WebButton::drawButton(TQPainter *p) { - QPen highlightPen; + TQPen highlightPen; if (isDown() ) - highlightPen = QPen(colorGroup().light()); + highlightPen = TQPen(colorGroup().light()); else { if (mouseOver_) - highlightPen = QPen(colorGroup().highlight()); + highlightPen = TQPen(colorGroup().highlight()); else - highlightPen = QPen(NoPen); + highlightPen = TQPen(NoPen); } p->fillRect(rect(), colorGroup().background()); @@ -188,7 +188,7 @@ WebButton::drawButton(QPainter *p) p->setPen(highlightPen); if (shape_) - p->setClipRegion(QRegion(rect()) - QRect(0, 0, 6, 6)); + p->setClipRegion(TQRegion(rect()) - TQRect(0, 0, 6, 6)); p->drawRect(2, 2, width() - 4, height() - 4); if (shape_) @@ -224,7 +224,7 @@ WebButton::drawButton(QPainter *p) p->setPen(highlightPen); if (shape_) - p->setClipRegion(QRegion(rect()) - QRect(width() - 6, 0, 6, 6)); + p->setClipRegion(TQRegion(rect()) - TQRect(width() - 6, 0, 6, 6)); p->drawRect(2, 2, width() - 4, height() - 4); if (shape_) @@ -260,7 +260,7 @@ WebButton::drawButton(QPainter *p) // Draw icon. - QPoint center(rect().center()); + TQPoint center(rect().center()); int bwby2(bitmap_.width() / 2); // Bitmap Width BY 2 int bhby2(bitmap_.height() / 2); // Bitmap Height BY 2 @@ -275,9 +275,9 @@ WebButton::drawButton(QPainter *p) WebButton::setBitmap(const unsigned char *bitmap) { if (bitmap) - bitmap_ = QBitmap(8,8, bitmap, true); + bitmap_ = TQBitmap(8,8, bitmap, true); else - bitmap_ = QBitmap(8,8); + bitmap_ = TQBitmap(8,8); bitmap_.setMask(bitmap_); } diff --git a/kwin/clients/web/WebButton.h b/kwin/clients/web/WebButton.h index 6c1530f42..da94ea3f7 100644 --- a/kwin/clients/web/WebButton.h +++ b/kwin/clients/web/WebButton.h @@ -22,8 +22,8 @@ #ifndef KWIN_WEB_BUTTON_H #define KWIN_WEB_BUTTON_H -#include -#include +#include +#include #include #include "../../lib/kcommondecoration.h" @@ -50,12 +50,12 @@ namespace Web protected: void setBitmap(const unsigned char *bitmap); - void enterEvent(QEvent *); - void leaveEvent(QEvent *); - void drawButton(QPainter *p); + void enterEvent(TQEvent *); + void leaveEvent(TQEvent *); + void drawButton(TQPainter *p); private: - QBitmap bitmap_; + TQBitmap bitmap_; bool mouseOver_; -- cgit v1.2.1