diff options
Diffstat (limited to 'client/crystalclient.cc')
-rw-r--r-- | client/crystalclient.cc | 408 |
1 files changed, 204 insertions, 204 deletions
diff --git a/client/crystalclient.cc b/client/crystalclient.cc index 5e8e533..d81db20 100644 --- a/client/crystalclient.cc +++ b/client/crystalclient.cc @@ -25,13 +25,13 @@ #include <klocale.h> #include <kdebug.h> -#include <qbitmap.h> -#include <qlabel.h> -#include <qpainter.h> -#include <qtooltip.h> -#include <qapplication.h> -#include <qimage.h> -#include <qpopupmenu.h> +#include <tqbitmap.h> +#include <tqlabel.h> +#include <tqpainter.h> +#include <tqtooltip.h> +#include <tqapplication.h> +#include <tqimage.h> +#include <tqpopupmenu.h> #include <kwin.h> #include <kprocess.h> @@ -48,7 +48,7 @@ CrystalFactory* factory=NULL; bool CrystalFactory::initialized_ = false; -Qt::AlignmentFlags CrystalFactory::titlealign_ = Qt::AlignHCenter; +TQt::AlignmentFlags CrystalFactory::titlealign_ = TQt::AlignHCenter; extern "C" KDecorationFactory* create_factory() @@ -60,17 +60,17 @@ extern "C" KDecorationFactory* create_factory() /***************** * Tooltip class for the titlebar **/ -class CCrystalTooltip:public QToolTip +class CCrystalTooltip:public TQToolTip { private: CrystalClient *client; public: - CCrystalTooltip(QWidget *widget,CrystalClient *vc):QToolTip(widget),client(vc) {} - virtual void maybeTip(const QPoint& p) + CCrystalTooltip(TQWidget *widget,CrystalClient *vc):TQToolTip(widget),client(vc) {} + virtual void maybeTip(const TQPoint& p) { - if (client->titlebar_->geometry().contains(p)) + if (client->titlebar_->tqgeometry().tqcontains(p)) { - tip(client->titlebar_->geometry(),client->caption()); + tip(client->titlebar_->tqgeometry(),client->caption()); } } }; @@ -87,7 +87,7 @@ CrystalFactory::CrystalFactory() readConfig(); initialized_ = true; - if (transparency)image_holder=new QImageHolder(active.userdefinedPicture,inactive.userdefinedPicture); + if (transparency)image_holder=new TQImageHolder(active.userdefinedPicture,inactive.userdefinedPicture); else image_holder=NULL; CreateButtonImages(); } @@ -117,9 +117,9 @@ bool CrystalFactory::reset(unsigned long /*changed*/) if (transparency) { - if (!image_holder)image_holder=new QImageHolder(active.userdefinedPicture,inactive.userdefinedPicture); + if (!image_holder)image_holder=new TQImageHolder(active.userdefinedPicture,inactive.userdefinedPicture); image_holder->setUserdefinedPictures(active.userdefinedPicture,inactive.userdefinedPicture); - image_holder->repaint(true); + image_holder->tqrepaint(true); }else{ if (image_holder)delete image_holder; image_holder=NULL; @@ -141,7 +141,7 @@ bool CrystalFactory::supports(Ability ability) } } -void setupOverlay(WND_CONFIG *cfg,int mode,QString filename) +void setupOverlay(WND_CONFIG *cfg,int mode,TQString filename) { cfg->overlay.resize(0,0); switch(mode) @@ -149,27 +149,27 @@ void setupOverlay(WND_CONFIG *cfg,int mode,QString filename) case 0: break; case 1:{ cfg->overlay.resize(0,0); - QImage img=QImage((uchar*)lighting_overlay_data,1,60,32,NULL,0,QImage::LittleEndian); + TQImage img=TQImage((uchar*)lighting_overlay_data,1,60,32,NULL,0,TQImage::LittleEndian); img.setAlphaBuffer(true); cfg->overlay.convertFromImage(img.smoothScale(256,::factory->titlesize)); break; } case 2:{ cfg->overlay.resize(0,0); - QImage img=QImage((uchar*)glass_overlay_data,20,64,32,NULL,0,QImage::LittleEndian); + TQImage img=TQImage((uchar*)glass_overlay_data,20,64,32,NULL,0,TQImage::LittleEndian); img.setAlphaBuffer(true); cfg->overlay.convertFromImage(img.smoothScale(256,::factory->titlesize)); break; } case 3:{ cfg->overlay.resize(0,0); - QImage img=QImage((uchar*)steel_overlay_data,28,64,32,NULL,0,QImage::LittleEndian); + TQImage img=TQImage((uchar*)steel_overlay_data,28,64,32,NULL,0,TQImage::LittleEndian); img.setAlphaBuffer(true); cfg->overlay.convertFromImage(img.smoothScale(256,::factory->titlesize)); break; } case 4:{ - QImage img; + TQImage img; if (img.load(filename)) { img.setAlphaBuffer(true); @@ -185,12 +185,12 @@ bool CrystalFactory::readConfig() // create a config object KConfig config("kwincrystalrc"); config.setGroup("General"); - QColor c; + TQColor c; - QString value = config.readEntry("TitleAlignment", "AlignHCenter"); - if (value == "AlignLeft") titlealign_ = Qt::AlignLeft; - else if (value == "AlignHCenter") titlealign_ = Qt::AlignHCenter; - else if (value == "AlignRight") titlealign_ = Qt::AlignRight; + TQString value = config.readEntry("TitleAlignment", "AlignHCenter"); + if (value == "AlignLeft") titlealign_ = TQt::AlignLeft; + else if (value == "AlignHCenter") titlealign_ = TQt::AlignHCenter; + else if (value == "AlignRight") titlealign_ = TQt::AlignRight; drawcaption=(bool)config.readBoolEntry("DrawCaption",true); textshadow=(bool)config.readBoolEntry("TextShadow",true); @@ -205,23 +205,23 @@ bool CrystalFactory::readConfig() inactive.amount=(double)config.readNumEntry("InactiveShade",-30)/100.0; active.outlineMode=(int)config.readNumEntry("ActiveFrame",1); inactive.outlineMode=(int)config.readNumEntry("InactiveFrame",1); - c=QColor(160,160,160); + c=TQColor(160,160,160); active.frameColor=config.readColorEntry("FrameColor1",&c); - c=QColor(128,128,128); + c=TQColor(128,128,128); inactive.frameColor=config.readColorEntry("FrameColor2",&c); active.inlineMode=(int)config.readNumEntry("ActiveInline",0); inactive.inlineMode=(int)config.readNumEntry("InactiveInline",0); - c=QColor(160,160,160); + c=TQColor(160,160,160); active.inlineColor=config.readColorEntry("InlineColor1",&c); - c=QColor(160,160,160); + c=TQColor(160,160,160); inactive.inlineColor=config.readColorEntry("InlineColor2",&c); active.blur=config.readNumEntry("ActiveBlur",0); inactive.blur=config.readNumEntry("InactiveBlur",0); - active.userdefinedPicture=QImage(); - inactive.userdefinedPicture=QImage(); + active.userdefinedPicture=TQImage(); + inactive.userdefinedPicture=TQImage(); if ((bool)config.readBoolEntry("ActiveUserdefined",false)) { active.userdefinedPicture.load(config.readEntry("ActiveUserdefinedPicture")); @@ -234,19 +234,19 @@ bool CrystalFactory::readConfig() borderwidth=config.readNumEntry("Borderwidth",5); titlesize=config.readNumEntry("Titlebarheight",21); - buttonColor_normal=QColor(255,255,255); + buttonColor_normal=TQColor(255,255,255); buttonColor_normal=config.readColorEntry("ButtonColor",&buttonColor_normal); buttonColor_hovered=config.readColorEntry("ButtonColor2",&buttonColor_normal); buttonColor_pressed=config.readColorEntry("ButtonColor3",&buttonColor_normal); - minColor_normal=QColor(255,255,255); + minColor_normal=TQColor(255,255,255); minColor_normal=config.readColorEntry("MinColor",&buttonColor_normal); minColor_hovered=config.readColorEntry("MinColor2",&buttonColor_normal); minColor_pressed=config.readColorEntry("MinColor3",&buttonColor_normal); - maxColor_normal=QColor(255,255,255); + maxColor_normal=TQColor(255,255,255); maxColor_normal=config.readColorEntry("MaxColor",&buttonColor_normal); maxColor_hovered=config.readColorEntry("MaxColor2",&buttonColor_normal); maxColor_pressed=config.readColorEntry("MaxColor3",&buttonColor_normal); - closeColor_normal=QColor(255,255,255); + closeColor_normal=TQColor(255,255,255); closeColor_normal=config.readColorEntry("CloseColor",&closeColor_normal); closeColor_hovered=config.readColorEntry("CloseColor2",&closeColor_normal); closeColor_pressed=config.readColorEntry("CloseColor3",&closeColor_normal); @@ -257,8 +257,8 @@ bool CrystalFactory::readConfig() animateHover=config.readBoolEntry("AnimateHover",true); tintButtons=config.readBoolEntry("TintButtons",false); menuImage=config.readBoolEntry("MenuImage",true); - repaintMode=config.readNumEntry("RepaintMode",1); - repaintTime=config.readNumEntry("RepaintTime",200); + tqrepaintMode=config.readNumEntry("RepaintMode",1); + tqrepaintTime=config.readNumEntry("RepaintTime",200); buttontheme=config.readNumEntry("ButtonTheme",8); @@ -269,7 +269,7 @@ bool CrystalFactory::readConfig() logoStretch=config.readNumEntry("LogoStretch",0); logoActive=config.readBoolEntry("LogoActive",0); logoDistance=config.readNumEntry("LogoDistance",0); - QString filename=config.readEntry("LogoFile",""); + TQString filename=config.readEntry("LogoFile",""); if (!filename.isNull() && logoEnabled!=1) { if (logo.load(filename)) @@ -289,7 +289,7 @@ void CrystalFactory::CreateButtonImages() { if (buttonImages[i])buttonImages[i]->reset(); else buttonImages[i]=new ButtonImage; - if (!tintButtons)buttonImages[i]->setColors(Qt::white,Qt::white,Qt::white); + if (!tintButtons)buttonImages[i]->setColors(TQt::white,TQt::white,TQt::white); else switch(i) { case ButtonImageMin: @@ -759,50 +759,50 @@ void CrystalClient::init() // for flicker-free redraws widget()->setBackgroundMode(NoBackground); - // setup layout - mainlayout = new QGridLayout(widget(), 4, 3); // 4x3 grid - titlelayout = new QHBoxLayout(); - titlebar_ = new QSpacerItem(1, ::factory->titlesize-1, QSizePolicy::Expanding, - QSizePolicy::Fixed); + // setup tqlayout + maintqlayout = new TQGridLayout(widget(), 4, 3); // 4x3 grid + titletqlayout = new TQHBoxLayout(); + titlebar_ = new TQSpacerItem(1, ::factory->titlesize-1, TQSizePolicy::Expanding, + TQSizePolicy::Fixed); - mainlayout->setResizeMode(QLayout::FreeResize); - mainlayout->setRowSpacing(0, (::factory->buttontheme==5)?0:1); - mainlayout->setRowSpacing(3, ::factory->borderwidth*1); + maintqlayout->setResizeMode(TQLayout::FreeResize); + maintqlayout->setRowSpacing(0, (::factory->buttontheme==5)?0:1); + maintqlayout->setRowSpacing(3, ::factory->borderwidth*1); - mainlayout->setColSpacing(2,borderSpacing()); - mainlayout->setColSpacing(0,borderSpacing()); - mainlayout->addLayout(titlelayout, 1, 1); + maintqlayout->setColSpacing(2,borderSpacing()); + maintqlayout->setColSpacing(0,borderSpacing()); + maintqlayout->addLayout(titletqlayout, 1, 1); if (isPreview()) { char c[512]; sprintf(c,"<center><b>Crystal %s Preview</b><br>Built: %s</center>",VERSION,__DATE__); - mainlayout->addItem(new QSpacerItem(1, 1,QSizePolicy::Expanding,QSizePolicy::Fixed), 0, 1); - mainlayout->addItem(new QSpacerItem(1, ::factory->borderwidth,QSizePolicy::Expanding,QSizePolicy::Expanding), 3, 1); - mainlayout->addWidget(new QLabel(i18n(c),widget()), 2, 1); + maintqlayout->addItem(new TQSpacerItem(1, 1,TQSizePolicy::Expanding,TQSizePolicy::Fixed), 0, 1); + maintqlayout->addItem(new TQSpacerItem(1, ::factory->borderwidth,TQSizePolicy::Expanding,TQSizePolicy::Expanding), 3, 1); + maintqlayout->addWidget(new TQLabel(i18n(c),widget()), 2, 1); } else { - mainlayout->addItem(new QSpacerItem(0, 0), 2, 1); + maintqlayout->addItem(new TQSpacerItem(0, 0), 2, 1); } - mainlayout->setRowStretch(2, 10); - mainlayout->setColStretch(1, 10); + maintqlayout->setRowStretch(2, 10); + maintqlayout->setColStretch(1, 10); updateMask(); for (int n=0; n<ButtonTypeCount; n++) button[n] = 0; - addButtons(titlelayout, options()->titleButtonsLeft()); - titlelayout->addItem(titlebar_); + addButtons(titletqlayout, options()->titleButtonsLeft()); + titletqlayout->addItem(titlebar_); { - CrystalButton* lastbutton=addButtons(titlelayout, options()->titleButtonsRight()); + CrystalButton* lastbutton=addButtons(titletqlayout, options()->titleButtonsRight()); if (lastbutton)lastbutton->setFirstLast(false,true); } if (::factory->captiontooltip) new CCrystalTooltip(widget(),this); - 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 ))); - if (::factory->transparency)connect ( ::factory->image_holder,SIGNAL(repaintNeeded()),this,SLOT(Repaint())); - if (::factory->transparency)connect ( &timer,SIGNAL(timeout()),this,SLOT(Repaint())); + if (::factory->transparency)connect ( ::factory->image_holder,TQT_SIGNAL(tqrepaintNeeded()),this,TQT_SLOT(Repaint())); + if (::factory->transparency)connect ( &timer,TQT_SIGNAL(timeout()),this,TQT_SLOT(Repaint())); updateLayout(); } @@ -811,53 +811,53 @@ void CrystalClient::updateMask() { if ((::factory->roundCorners==0)|| (!options()->moveResizeMaximizedWindows() && maximizeMode() & MaximizeFull ) ) { - setMask(QRegion(widget()->rect())); + setMask(TQRegion(widget()->rect())); return; } int cornersFlag = ::factory->roundCorners; int r(width()); int b(height()); - QRegion mask; + TQRegion tqmask; - mask=QRegion(widget()->rect()); + tqmask=TQRegion(widget()->rect()); // Remove top-left corner. if(cornersFlag & TOP_LEFT) { - mask -= QRegion(0, 0, 5, 1); - mask -= QRegion(0, 1, 3, 1); - mask -= QRegion(0, 2, 2, 1); - mask -= QRegion(0, 3, 1, 2); + tqmask -= TQRegion(0, 0, 5, 1); + tqmask -= TQRegion(0, 1, 3, 1); + tqmask -= TQRegion(0, 2, 2, 1); + tqmask -= TQRegion(0, 3, 1, 2); } // Remove top-right corner. if(cornersFlag & TOP_RIGHT) { - 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); + tqmask -= TQRegion(r - 5, 0, 5, 1); + tqmask -= TQRegion(r - 3, 1, 3, 1); + tqmask -= TQRegion(r - 2, 2, 2, 1); + tqmask -= TQRegion(r - 1, 3, 1, 2); } // Remove bottom-left corner. if(cornersFlag & BOT_LEFT) { - 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); + tqmask -= TQRegion(0, b - 5, 1, 3); + tqmask -= TQRegion(0, b - 3, 2, 1); + tqmask -= TQRegion(0, b - 2, 3, 1); + tqmask -= TQRegion(0, b - 1, 5, 1); } // Remove bottom-right corner. if(cornersFlag & BOT_RIGHT) { - 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); + tqmask -= TQRegion(r - 5, b - 1, 5, 1); + tqmask -= TQRegion(r - 3, b - 2, 3, 1); + tqmask -= TQRegion(r - 2, b - 3, 2, 1); + tqmask -= TQRegion(r - 1, b - 5, 1, 2); } - setMask(mask); + setMask(tqmask); } -CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s) +CrystalButton* CrystalClient::addButtons(TQBoxLayout *tqlayout, const TQString& s) { ButtonImage *bitmap; - QString tip; + TQString tip; CrystalButton *lastone=NULL; if (s.length() > 0) @@ -869,7 +869,7 @@ CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s) case 'M': // Menu button if (!button[ButtonMenu]) { button[ButtonMenu] = current = new CrystalButton(this, "menu", i18n("Menu"), ButtonMenu, ::factory->buttonImages[ButtonImageMenu]); - connect(button[ButtonMenu], SIGNAL(pressed()), this, SLOT(menuButtonPressed())); + connect(button[ButtonMenu], TQT_SIGNAL(pressed()), this, TQT_SLOT(menuButtonPressed())); } break; @@ -883,7 +883,7 @@ CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s) tip = i18n("On All Desktops"); } button[ButtonSticky] =current=new CrystalButton(this, "sticky", tip,ButtonSticky, bitmap); - connect(button[ButtonSticky], SIGNAL(clicked()),this, SLOT(toggleOnAllDesktops())); + connect(button[ButtonSticky], TQT_SIGNAL(clicked()),this, TQT_SLOT(toggleOnAllDesktops())); } break; @@ -891,7 +891,7 @@ CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s) if (providesContextHelp()) { button[ButtonHelp] =current= new CrystalButton(this, "help", i18n("Help"),ButtonHelp, ::factory->buttonImages[ButtonImageHelp]); - connect(button[ButtonHelp], SIGNAL(clicked()),this, SLOT(showContextHelp())); + connect(button[ButtonHelp], TQT_SIGNAL(clicked()),this, TQT_SLOT(showContextHelp())); } break; @@ -899,7 +899,7 @@ CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s) if ((!button[ButtonMin]) && isMinimizable()) { button[ButtonMin] =current= new CrystalButton(this, "iconify", i18n("Minimize"),ButtonMin, ::factory->buttonImages[ButtonImageMin]); - connect(button[ButtonMin], SIGNAL(clicked()),this, SLOT(minButtonPressed())); + connect(button[ButtonMin], TQT_SIGNAL(clicked()),this, TQT_SLOT(minButtonPressed())); } break; @@ -907,7 +907,7 @@ CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s) if (!button[ButtonAbove]) { button[ButtonAbove] =current= new CrystalButton(this, "above", i18n("Keep Above Others"),ButtonAbove, ::factory->buttonImages[keepAbove()?ButtonImageUnAbove:ButtonImageAbove]); - connect(button[ButtonAbove], SIGNAL(clicked()),this, SLOT(aboveButtonPressed())); + connect(button[ButtonAbove], TQT_SIGNAL(clicked()),this, TQT_SLOT(aboveButtonPressed())); } break; @@ -915,7 +915,7 @@ CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s) if ((!button[ButtonBelow])) { button[ButtonBelow] =current= new CrystalButton(this, "below", i18n("Keep Below Others"),ButtonBelow, ::factory->buttonImages[keepBelow()?ButtonImageUnBelow:ButtonImageBelow]); - connect(button[ButtonBelow], SIGNAL(clicked()),this, SLOT(belowButtonPressed())); + connect(button[ButtonBelow], TQT_SIGNAL(clicked()),this, TQT_SLOT(belowButtonPressed())); } break; @@ -923,7 +923,7 @@ CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s) if ((!button[ButtonShade]) && isShadeable()) { button[ButtonShade] =current= new CrystalButton(this, "shade", i18n("Shade"),ButtonShade, ::factory->buttonImages[ButtonImageShade]); - connect(button[ButtonShade], SIGNAL(clicked()),this, SLOT(shadeButtonPressed())); + connect(button[ButtonShade], TQT_SIGNAL(clicked()),this, TQT_SLOT(shadeButtonPressed())); } break; @@ -940,7 +940,7 @@ CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s) } button[ButtonMax] =current= new CrystalButton(this, "maximize", tip,ButtonMax, bitmap); - connect(button[ButtonMax], SIGNAL(clicked()),this, SLOT(maxButtonPressed())); + connect(button[ButtonMax], TQT_SIGNAL(clicked()),this, TQT_SLOT(maxButtonPressed())); } break; @@ -948,20 +948,20 @@ CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s) if (isCloseable()) { button[ButtonClose] =current= new CrystalButton(this, "close", i18n("Close"),ButtonClose, ::factory->buttonImages[ButtonImageClose]); - connect(button[ButtonClose], SIGNAL(clicked()),this, SLOT(closeButtonPressed())); + connect(button[ButtonClose], TQT_SIGNAL(clicked()),this, TQT_SLOT(closeButtonPressed())); } break; case '_': // Spacer item - layout->addSpacing(4); + tqlayout->addSpacing(4); current=NULL; break; } if (current) { - layout->addWidget(current); - if (layout->findWidget(current)==0)current->setFirstLast(true,false); + tqlayout->addWidget(current); + if (tqlayout->tqfindWidget(current)==0)current->setFirstLast(true,false); } lastone=current; } @@ -972,12 +972,12 @@ CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s) void CrystalClient::activeChange() { Repaint(); - if (isActive()) ::factory->clients.at(::factory->clients.find(this)); + if (isActive()) ::factory->clients.at(::factory->clients.tqfind(this)); } void CrystalClient::captionChange() { - if (::factory->drawcaption) widget()->repaint(titlebar_->geometry(), false); + if (::factory->drawcaption) widget()->tqrepaint(titlebar_->tqgeometry(), false); } void CrystalClient::desktopChange() @@ -985,8 +985,8 @@ void CrystalClient::desktopChange() bool d = isOnAllDesktops(); if (button[ButtonSticky]) { button[ButtonSticky]->setBitmap(::factory->buttonImages[d ? ButtonImageSticky : ButtonImageUnSticky ]); - QToolTip::remove(button[ButtonSticky]); - QToolTip::add(button[ButtonSticky], d ? i18n("Not on all desktops") : i18n("On All Desktops")); + TQToolTip::remove(button[ButtonSticky]); + TQToolTip::add(button[ButtonSticky], d ? i18n("Not on all desktops") : i18n("On All Desktops")); } } @@ -1002,8 +1002,8 @@ void CrystalClient::maximizeChange() bool m = (maximizeMode() == MaximizeFull); if (button[ButtonMax]) { button[ButtonMax]->setBitmap(::factory->buttonImages[ m ? ButtonImageRestore : ButtonImageMax ]); - QToolTip::remove(button[ButtonMax]); - QToolTip::add(button[ButtonMax], m ? i18n("Restore") : i18n("Maximize")); + TQToolTip::remove(button[ButtonMax]); + TQToolTip::add(button[ButtonMax], m ? i18n("Restore") : i18n("Maximize")); } if (!options()->moveResizeMaximizedWindows()) @@ -1018,17 +1018,17 @@ void CrystalClient::updateLayout() { if (FullMax) { - mainlayout->setColSpacing(0,0); - mainlayout->setColSpacing(2,0); + maintqlayout->setColSpacing(0,0); + maintqlayout->setColSpacing(2,0); }else{ - mainlayout->setColSpacing(2,borderSpacing()); - mainlayout->setColSpacing(0,borderSpacing()); + maintqlayout->setColSpacing(2,borderSpacing()); + maintqlayout->setColSpacing(0,borderSpacing()); } - mainlayout->setRowSpacing(0, (FullMax||::factory->buttontheme==5)?0:1); + maintqlayout->setRowSpacing(0, (FullMax||::factory->buttontheme==5)?0:1); for (int i=0;i<ButtonTypeCount;i++)if (button[i]) button[i]->resetSize(FullMax); - widget()->layout()->activate(); + widget()->tqlayout()->activate(); } int CrystalClient::borderSpacing() @@ -1067,17 +1067,17 @@ void CrystalClient::borders(int &l, int &r, int &t, int &b) const } } -void CrystalClient::resize(const QSize &size) +void CrystalClient::resize(const TQSize &size) { widget()->resize(size); } -QSize CrystalClient::minimumSize() const +TQSize CrystalClient::tqminimumSize() const { - return widget()->minimumSize(); + return widget()->tqminimumSize(); } -KDecoration::Position CrystalClient::mousePosition(const QPoint &point) const +KDecoration::Position CrystalClient::mousePosition(const TQPoint &point) const { const int corner = 20; Position pos; @@ -1111,33 +1111,33 @@ KDecoration::Position CrystalClient::mousePosition(const QPoint &point) const return pos; } -bool CrystalClient::eventFilter(QObject *obj, QEvent *e) +bool CrystalClient::eventFilter(TQObject *obj, TQEvent *e) { - if (obj != widget()) return false; + if (TQT_BASE_OBJECT(obj) != TQT_BASE_OBJECT(widget())) return false; switch (e->type()) { - case QEvent::MouseButtonDblClick: - mouseDoubleClickEvent(static_cast<QMouseEvent *>(e)); + case TQEvent::MouseButtonDblClick: + mouseDoubleClickEvent(TQT_TQMOUSEEVENT(e)); return true; - case QEvent::MouseButtonPress: - processMousePressEvent(static_cast<QMouseEvent *>(e)); + case TQEvent::MouseButtonPress: + processMousePressEvent(TQT_TQMOUSEEVENT(e)); return true; - case QEvent::Paint: - paintEvent(static_cast<QPaintEvent *>(e)); + case TQEvent::Paint: + paintEvent(TQT_TQPAINTEVENT(e)); return true; - case QEvent::Wheel: - mouseWheelEvent(static_cast<QWheelEvent *>(e)); + case TQEvent::Wheel: + mouseWheelEvent(TQT_TQWHEELEVENT(e)); return true; - case QEvent::Resize: - resizeEvent(static_cast<QResizeEvent *>(e)); + case TQEvent::Resize: + resizeEvent(TQT_TQRESIZEEVENT(e)); return true; - case QEvent::Show: - showEvent(static_cast<QShowEvent *>(e)); + case TQEvent::Show: + showEvent(TQT_TQSHOWEVENT(e)); return true; - case QEvent::Move: - moveEvent(static_cast<QMoveEvent *>(e)); + case TQEvent::Move: + moveEvent(TQT_TQMOVEEVENT(e)); return true; default:return false; } @@ -1147,53 +1147,53 @@ bool CrystalClient::eventFilter(QObject *obj, QEvent *e) void CrystalClient::ClientWindows(Window* v_frame,Window* v_wrapper,Window *v_client) { - Window root=0,frame=0,wrapper=0,client=0,parent=0,*children=NULL; + Window root=0,frame=0,wrapper=0,client=0,tqparent=0,*tqchildren=NULL; uint numc; if (v_frame) *v_frame=0; if (v_wrapper) *v_wrapper=0; if (v_client) *v_client=0; - // Our Deco is the child of a frame, get our parent - if (XQueryTree(qt_xdisplay(),widget()->winId(),&root,&frame,&children,&numc) == 0) + // Our Deco is the child of a frame, get our tqparent + if (XQueryTree(qt_xdisplay(),widget()->winId(),&root,&frame,&tqchildren,&numc) == 0) return; - if (children!=NULL)XFree(children); - children=NULL; + if (tqchildren!=NULL)XFree(tqchildren); + tqchildren=NULL; - // frame has two children, us and a wrapper, get the wrapper - if (XQueryTree(qt_xdisplay(),frame,&root,&parent,&children,&numc)==0) + // frame has two tqchildren, us and a wrapper, get the wrapper + if (XQueryTree(qt_xdisplay(),frame,&root,&tqparent,&tqchildren,&numc)==0) return; for (uint i=0;i<numc;i++) { - if (children[i]!=widget()->winId())wrapper=children[i]; + if (tqchildren[i]!=widget()->winId())wrapper=tqchildren[i]; } - if (children!=NULL)XFree(children); - children=NULL; + if (tqchildren!=NULL)XFree(tqchildren); + tqchildren=NULL; // wrapper has only one child, which is the client. We want this!! - if (XQueryTree(qt_xdisplay(),wrapper,&root,&parent,&children,&numc)==0) + if (XQueryTree(qt_xdisplay(),wrapper,&root,&tqparent,&tqchildren,&numc)==0) return; - if (numc==1)client=children[0]; - if (children!=NULL)XFree(children); - children=NULL; + if (numc==1)client=tqchildren[0]; + if (tqchildren!=NULL)XFree(tqchildren); + tqchildren=NULL; if (v_client) *v_client=client; if (v_wrapper) *v_wrapper=wrapper; if (v_frame) *v_frame=frame; } -void CrystalClient::mouseDoubleClickEvent(QMouseEvent *e) +void CrystalClient::mouseDoubleClickEvent(TQMouseEvent *e) { - if (/*(titlebar_->geometry().contains(e->pos()))&&*/(e->button()==LeftButton)) titlebarDblClickOperation(); + if (/*(titlebar_->tqgeometry().tqcontains(e->pos()))&&*/(e->button()==Qt::LeftButton)) titlebarDblClickOperation(); else { - QMouseEvent me(QEvent::MouseButtonPress,e->pos(),e->button(),e->state()); + TQMouseEvent me(TQEvent::MouseButtonPress,e->pos(),e->button(),e->state()); processMousePressEvent(&me); } } -void CrystalClient::mouseWheelEvent(QWheelEvent *e) +void CrystalClient::mouseWheelEvent(TQWheelEvent *e) { if (::factory->wheelTask) { - QPtrList <CrystalClient> *l=&(::factory->clients); + TQPtrList <CrystalClient> *l=&(::factory->clients); if (l->current()==NULL) for (unsigned int i=0;i<l->count();i++) if ((l->at(i))->isActive()) break; @@ -1229,34 +1229,34 @@ void CrystalClient::mouseWheelEvent(QWheelEvent *e) } } -void CrystalClient::paintEvent(QPaintEvent*) +void CrystalClient::paintEvent(TQPaintEvent*) { if (!CrystalFactory::initialized()) return; - QColorGroup group; - QPainter painter(widget()); + TQColorGroup group; + TQPainter painter(widget()); // draw the titlebar - group = options()->colorGroup(KDecoration::ColorTitleBar, isActive()); + group = options()->tqcolorGroup(KDecoration::ColorTitleBar, isActive()); WND_CONFIG* wndcfg=(isActive()?&::factory->active:&::factory->inactive); if (::factory->transparency && ::factory->trackdesktop) - ::factory->image_holder->repaint(false); // If other desktop than the last, regrab the root image - QPixmap *background=::factory->transparency?::factory->image_holder->image(isActive()):NULL; + ::factory->image_holder->tqrepaint(false); // If other desktop than the last, regrab the root image + TQPixmap *background=::factory->transparency?::factory->image_holder->image(isActive()):NULL; int drawFrame; { - QRect r; - QPoint p=widget()->mapToGlobal(QPoint(0,0)); + TQRect r; + TQPoint p=widget()->mapToGlobal(TQPoint(0,0)); int bl,br,bt,bb; borders(bl,br,bt,bb); - QPixmap pufferPixmap; + TQPixmap pufferPixmap; pufferPixmap.resize(widget()->width(), bt); - QPainter pufferPainter(&pufferPixmap); + TQPainter pufferPainter(&pufferPixmap); - r=QRect(p.x(),p.y(),widget()->width(),bt); - if (background && !background->isNull())pufferPainter.drawPixmap(QPoint(0,0),*background,r); + r=TQRect(p.x(),p.y(),widget()->width(),bt); + if (background && !background->isNull())pufferPainter.drawPixmap(TQPoint(0,0),*background,r); else { pufferPainter.fillRect(widget()->rect(),group.background()); @@ -1271,8 +1271,8 @@ void CrystalClient::paintEvent(QPaintEvent*) // draw title text pufferPainter.setFont(options()->font(isActive(), false)); - QColor color=options()->color(KDecoration::ColorFont, isActive()); - r=titlebar_->geometry(); + TQColor color=options()->color(KDecoration::ColorFont, isActive()); + r=titlebar_->tqgeometry(); r.moveBy(0,-1); int logowidth=::factory->logo.width()+::factory->logoDistance; if (::factory->logoEnabled!=1 && (isActive()||!::factory->logoActive)) @@ -1280,7 +1280,7 @@ void CrystalClient::paintEvent(QPaintEvent*) r.setWidth(r.width()-logowidth); if (::factory->logoEnabled==0)r.moveLeft(r.left()+logowidth); } - QFontMetrics metrics(options()->font(isActive(), false)); + TQFontMetrics metrics(options()->font(isActive(), false)); int textwidth=metrics.width(caption()); int textalign=CrystalFactory::titleAlign(); if (textwidth>r.width()) @@ -1313,7 +1313,7 @@ void CrystalClient::paintEvent(QPaintEvent*) } }else if (::factory->logoEnabled!=1 && (isActive()||!::factory->logoActive)) { int x=0; - r=titlebar_->geometry(); + r=titlebar_->tqgeometry(); if (::factory->logoEnabled==0) x=r.left(); if (::factory->logoEnabled==2) x=r.right()-::factory->logo.width(); pufferPainter.drawPixmap(x,(::factory->titlesize-::factory->logo.height())/2,::factory->logo); @@ -1332,24 +1332,24 @@ void CrystalClient::paintEvent(QPaintEvent*) if (background && !background->isNull()) { // Draw the side and bottom of the window with transparency // Left - r=QRect(p.x()+drawFrame,p.y()+bt,bl-drawFrame,widget()->height()-bt-drawFrame); - painter.drawPixmap(QPoint(drawFrame,bt),*background,r); + r=TQRect(p.x()+drawFrame,p.y()+bt,bl-drawFrame,widget()->height()-bt-drawFrame); + painter.drawPixmap(TQPoint(drawFrame,bt),*background,r); // Right - r=QRect(widget()->width()-br+p.x(),p.y()+bt,br-drawFrame,widget()->height()-bt-drawFrame); - painter.drawPixmap(QPoint(widget()->width()-br,bt),*background,r); + r=TQRect(widget()->width()-br+p.x(),p.y()+bt,br-drawFrame,widget()->height()-bt-drawFrame); + painter.drawPixmap(TQPoint(widget()->width()-br,bt),*background,r); // Bottom - r=QRect(p.x()+bl,p.y()+widget()->height()-bb,widget()->width()-bl-br,bb-drawFrame); - painter.drawPixmap(QPoint(bl,widget()->height()-bb),*background,r); + r=TQRect(p.x()+bl,p.y()+widget()->height()-bb,widget()->width()-bl-br,bb-drawFrame); + painter.drawPixmap(TQPoint(bl,widget()->height()-bb),*background,r); }else{ - r=QRect(drawFrame,bt,bl-drawFrame,widget()->height()-bt-drawFrame); + r=TQRect(drawFrame,bt,bl-drawFrame,widget()->height()-bt-drawFrame); painter.fillRect(r,group.background()); - r=QRect(widget()->width()-br,bt,br-drawFrame,widget()->height()-bt-drawFrame); + r=TQRect(widget()->width()-br,bt,br-drawFrame,widget()->height()-bt-drawFrame); painter.fillRect(r,group.background()); - r=QRect(bl,widget()->height()-bb,widget()->width()-bl-br,bb-drawFrame); + r=TQRect(bl,widget()->height()-bb,widget()->width()-bl-br,bb-drawFrame); painter.fillRect(r,group.background()); } } @@ -1383,14 +1383,14 @@ void CrystalClient::paintEvent(QPaintEvent*) // And notify image_holder that we need an update asap if (::factory)if (::factory->image_holder) // UnInit image_holder, on next Repaint it will be Init'ed again. - QTimer::singleShot(500,::factory->image_holder,SLOT(CheckSanity())); + TQTimer::singleShot(500,::factory->image_holder,TQT_SLOT(CheckSanity())); } if (drawFrame) { // outline the frame - QRect r=widget()->rect(); - QColor c1,c2; + TQRect r=widget()->rect(); + TQColor c1,c2; c1=c2=wndcfg->frameColor; if (wndcfg->outlineMode==2)c1=c1.dark(140),c2=c2.light(140); if (wndcfg->outlineMode==3)c1=c1.light(140),c2=c2.dark(140); @@ -1409,7 +1409,7 @@ void CrystalClient::paintEvent(QPaintEvent*) int r=(width()); int b=(height()); - // Draw edge of top-left corner inside the area removed by the mask. + // Draw edge of top-left corner inside the area removed by the tqmask. if(cornersFlag & TOP_LEFT) { painter.setPen(c1); painter.drawPoint(3, 1); @@ -1419,7 +1419,7 @@ void CrystalClient::paintEvent(QPaintEvent*) painter.drawPoint(1, 4); } - // Draw edge of top-right corner inside the area removed by the mask. + // Draw edge of top-right corner inside the area removed by the tqmask. if(cornersFlag & TOP_RIGHT) { painter.setPen(c1); painter.drawPoint(r - 5, 1); @@ -1429,7 +1429,7 @@ void CrystalClient::paintEvent(QPaintEvent*) painter.drawPoint(r - 2, 4); } - // Draw edge of bottom-left corner inside the area removed by the mask. + // Draw edge of bottom-left corner inside the area removed by the tqmask. if(cornersFlag & BOT_LEFT) { painter.setPen(c2); painter.drawPoint(1, b - 5); @@ -1439,7 +1439,7 @@ void CrystalClient::paintEvent(QPaintEvent*) painter.drawPoint(4, b - 2); } - // Draw edge of bottom-right corner inside the area removed by the mask. + // Draw edge of bottom-right corner inside the area removed by the tqmask. if(cornersFlag & BOT_RIGHT) { painter.setPen(c2); painter.drawPoint(r - 2, b - 5); @@ -1452,23 +1452,23 @@ void CrystalClient::paintEvent(QPaintEvent*) } } -void CrystalClient::resizeEvent(QResizeEvent *e) +void CrystalClient::resizeEvent(TQResizeEvent *e) { if (widget()->isShown()) { if (!::factory->transparency) ; - else if (::factory->repaintMode==1) + else if (::factory->tqrepaintMode==1) { if (!timer.isActive())timer.start(0,true); // Repaint(); } - // repaint only every xxx ms - else if (::factory->repaintMode==3 || !timer.isActive()) + // tqrepaint only every xxx ms + else if (::factory->tqrepaintMode==3 || !timer.isActive()) { // Repaint only, when mode!=fade || amount<100 WND_CONFIG* wnd=isActive()?&::factory->active:&::factory->inactive; if (wnd->mode!=0 || wnd->amount<100) - timer.start(::factory->repaintTime,true); + timer.start(::factory->tqrepaintTime,true); } } if (e->size()!=e->oldSize()) @@ -1477,27 +1477,27 @@ void CrystalClient::resizeEvent(QResizeEvent *e) } } -void CrystalClient::moveEvent(QMoveEvent *) +void CrystalClient::moveEvent(TQMoveEvent *) { if (widget()->isShown()) { if (!::factory->transparency) return; - else if (::factory->repaintMode==1) + else if (::factory->tqrepaintMode==1) { Repaint(); } - // repaint every xxx ms, so constant moving does not take too much CPU - else if (::factory->repaintMode==3 || !timer.isActive()) + // tqrepaint every xxx ms, so constant moving does not take too much CPU + else if (::factory->tqrepaintMode==3 || !timer.isActive()) { // Repaint only, when mode!=fade || value<100, because otherwise it is a plain color WND_CONFIG* wnd=isActive()?&::factory->active:&::factory->inactive; if (wnd->mode!=0 || wnd->amount<100) - timer.start(::factory->repaintTime,true); + timer.start(::factory->tqrepaintTime,true); } } } -void CrystalClient::showEvent(QShowEvent *) +void CrystalClient::showEvent(TQShowEvent *) { if (widget()->isShown()) Repaint(); @@ -1505,7 +1505,7 @@ void CrystalClient::showEvent(QShowEvent *) void CrystalClient::Repaint() { - widget()->repaint(false); + widget()->tqrepaint(false); for (int n=0; n<ButtonTypeCount; n++) if (button[n]) button[n]->reset(); } @@ -1516,10 +1516,10 @@ void CrystalClient::maxButtonPressed() { switch (button[ButtonMax]->lastMousePress()) { - case MidButton: + case Qt::MidButton: maximize(maximizeMode() ^ MaximizeVertical); break; - case RightButton: + case Qt::RightButton: maximize(maximizeMode() ^ MaximizeHorizontal); break; default: @@ -1532,11 +1532,11 @@ void CrystalClient::minButtonPressed() { if (button[ButtonMin]) { switch (button[ButtonMin]->lastMousePress()) { - case MidButton:{ + case Qt::MidButton:{ performWindowOperation(LowerOp); break; } - case RightButton: + case Qt::RightButton: if (isShadeable()) setShade(!isShade()); break; default: @@ -1575,7 +1575,7 @@ void CrystalClient::closeButtonPressed() { if (button[ButtonClose]) switch (button[ButtonClose]->lastMousePress()) { - case RightButton: + case Qt::RightButton: { Window frame,wrapper,client; char param[20]; @@ -1600,8 +1600,8 @@ void CrystalClient::shadeButtonPressed() { if (button[ButtonShade]) { switch (button[ButtonShade]->lastMousePress()) { - case MidButton: - case RightButton: + case Qt::MidButton: + case Qt::RightButton: break; default: if (isShadeable()) setShade(!isShade()); @@ -1613,11 +1613,11 @@ void CrystalClient::menuButtonPressed() { if (!button[ButtonMenu])return; - static QTime* t = 0; + static TQTime* t = 0; static CrystalClient* lastClient = 0; if (t == 0) - t = new QTime; - bool dbl = (lastClient == this && t->elapsed() <= QApplication::doubleClickInterval()); + t = new TQTime; + bool dbl = (lastClient == this && t->elapsed() <= TQApplication::doubleClickInterval()); lastClient = this; t->start(); @@ -1632,7 +1632,7 @@ void CrystalClient::menuButtonPressed() void CrystalClient::menuPopUp() { - QPoint p(button[ButtonMenu]->rect().bottomLeft().x(), + TQPoint p(button[ButtonMenu]->rect().bottomLeft().x(), button[ButtonMenu]->rect().bottomLeft().y()+2); KDecorationFactory* f = factory(); showWindowMenu(button[ButtonMenu]->mapToGlobal(p)); |