From 21a1d3cffb820b001b0901f8e82d4c8bfc5e1683 Mon Sep 17 00:00:00 2001 From: tpearson Date: Fri, 1 Jul 2011 21:17:46 +0000 Subject: [PATCH] TQt4 port kwin-style-crystal This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kwin-style-crystal@1239032 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- client/buttonimage.cpp | 98 ++++---- client/buttonimage.h | 28 +-- client/config/configdialog.ui | 208 ++++++++--------- client/config/crystalconfig.cc | 194 ++++++++-------- client/config/crystalconfig.h | 13 +- client/config/infodialog.ui | 36 +-- client/crystalbutton.cpp | 126 +++++----- client/crystalbutton.h | 27 +-- client/crystalclient.cc | 408 ++++++++++++++++----------------- client/crystalclient.h | 69 +++--- client/imageholder.cpp | 58 ++--- client/imageholder.h | 21 +- client/myrootpixmap.cc | 66 +++--- client/myrootpixmap.h | 41 ++-- pics/embedtool.cpp | 70 +++--- 15 files changed, 734 insertions(+), 729 deletions(-) diff --git a/client/buttonimage.cpp b/client/buttonimage.cpp index c195eed..a55d29e 100644 --- a/client/buttonimage.cpp +++ b/client/buttonimage.cpp @@ -19,7 +19,7 @@ ***************************************************************************/ -#include +#include #include #include @@ -29,14 +29,14 @@ -ButtonImage::ButtonImage(const QRgb *d_normal,int w,int h) +ButtonImage::ButtonImage(const TQRgb *d_normal,int w,int h) { normal=hovered=pressed=animated=NULL; image_width=w; image_height=h; normal_data=hovered_data=animated_data=pressed_data=NULL; org_normal_data=org_hovered_data=NULL; - normal_color=hovered_color=pressed_color=QColor(255,255,255); + normal_color=hovered_color=pressed_color=TQColor(255,255,255); reset(); if (d_normal)SetNormal(d_normal,w,h); } @@ -55,10 +55,10 @@ ButtonImage::~ButtonImage() if (org_hovered_data)delete[] org_hovered_data; } -QImage ButtonImage::CreateImage(QRgb *data,QColor color) +TQImage ButtonImage::CreateImage(TQRgb *data,TQColor color) { tint(data,color); - QImage img=QImage((uchar*)data,image_width,image_height,32,NULL,0,QImage::LittleEndian),img2; + TQImage img=TQImage((uchar*)data,image_width,image_height,32,NULL,0,TQImage::LittleEndian),img2; img.setAlphaBuffer(true); return img; @@ -86,7 +86,7 @@ void ButtonImage::reset() drawMode=0; } -void ButtonImage::SetNormal(const QRgb *d_normal,int w,int h) +void ButtonImage::SetNormal(const TQRgb *d_normal,int w,int h) { image_width=w; image_height=h; @@ -101,25 +101,25 @@ void ButtonImage::SetNormal(const QRgb *d_normal,int w,int h) pressed_data=NULL; if (normal_data)delete[] normal_data; - org_normal_data=new QRgb[image_width*image_height]; - memcpy(org_normal_data,d_normal,sizeof(QRgb)*image_width*image_height); - normal_data=new QRgb[image_width*image_height]; - memcpy(normal_data,d_normal,sizeof(QRgb)*image_width*image_height); - normal=new QImage(CreateImage(normal_data,normal_color)); + org_normal_data=new TQRgb[image_width*image_height]; + memcpy(org_normal_data,d_normal,sizeof(TQRgb)*image_width*image_height); + normal_data=new TQRgb[image_width*image_height]; + memcpy(normal_data,d_normal,sizeof(TQRgb)*image_width*image_height); + normal=new TQImage(CreateImage(normal_data,normal_color)); } -void ButtonImage::SetHovered(const QRgb *d_hovered) +void ButtonImage::SetHovered(const TQRgb *d_hovered) { if (hovered)delete hovered; if (hovered_data)delete[] hovered_data; if (org_hovered_data)delete[] org_hovered_data; if (d_hovered) { - org_hovered_data=new QRgb[image_width*image_height]; - hovered_data=new QRgb[image_width*image_height]; - memcpy(hovered_data,d_hovered,sizeof(QRgb)*image_width*image_height); - memcpy(org_hovered_data,d_hovered,sizeof(QRgb)*image_width*image_height); - hovered=new QImage(CreateImage(hovered_data,hovered_color)); + org_hovered_data=new TQRgb[image_width*image_height]; + hovered_data=new TQRgb[image_width*image_height]; + memcpy(hovered_data,d_hovered,sizeof(TQRgb)*image_width*image_height); + memcpy(org_hovered_data,d_hovered,sizeof(TQRgb)*image_width*image_height); + hovered=new TQImage(CreateImage(hovered_data,hovered_color)); }else{ hovered=NULL; hovered_data=NULL; @@ -127,15 +127,15 @@ void ButtonImage::SetHovered(const QRgb *d_hovered) } } -void ButtonImage::SetPressed(const QRgb *d_pressed) +void ButtonImage::SetPressed(const TQRgb *d_pressed) { if (pressed)delete pressed; if (pressed_data)delete[] pressed_data; if (d_pressed) { - pressed_data=new QRgb[image_width*image_height]; - memcpy(pressed_data,d_pressed,sizeof(QRgb)*image_width*image_height); - pressed=new QImage(CreateImage(pressed_data,pressed_color)); + pressed_data=new TQRgb[image_width*image_height]; + memcpy(pressed_data,d_pressed,sizeof(TQRgb)*image_width*image_height); + pressed=new TQImage(CreateImage(pressed_data,pressed_color)); }else{ pressed=NULL; pressed_data=NULL; @@ -156,22 +156,22 @@ void ButtonImage::finish() } if (!hovered_data){ - hovered_data=new QRgb[image_width*image_height]; + hovered_data=new TQRgb[image_width*image_height]; float faktor=::factory->hovereffect?0.5:1.0; for (int i=0;ihovereffect?0.5:0.4; - pressed_data=new QRgb[image_width*image_height]; + pressed_data=new TQRgb[image_width*image_height]; if (!org_hovered_data) { org_hovered_data=hovered_data; @@ -180,37 +180,37 @@ void ButtonImage::finish() for (int i=0;isetAlphaBuffer(true); } } -QImage* ButtonImage::getAnimated( float anim) +TQImage* ButtonImage::getAnimated( float anim) { if (!normal_data)return NULL; if (!animated_data)return NULL; for (int i=0;i +#include #include "crystalclient.h" #define DEFAULT_IMAGE_SIZE 14 @@ -32,35 +32,35 @@ class ButtonImage { public: - QImage *normal,*hovered,*pressed; + TQImage *normal,*hovered,*pressed; int image_width,image_height; int hSpace,vSpace; int drawMode; - QColor normal_color,hovered_color,pressed_color; + TQColor normal_color,hovered_color,pressed_color; - QImage *animated; - QRgb *normal_data,*hovered_data,*animated_data,*pressed_data; - QRgb *org_normal_data,*org_hovered_data; + TQImage *animated; + TQRgb *normal_data,*hovered_data,*animated_data,*pressed_data; + TQRgb *org_normal_data,*org_hovered_data; - ButtonImage(const QRgb *d_normal=NULL,int w=DEFAULT_IMAGE_SIZE,int h=DEFAULT_IMAGE_SIZE); + ButtonImage(const TQRgb *d_normal=NULL,int w=DEFAULT_IMAGE_SIZE,int h=DEFAULT_IMAGE_SIZE); virtual ~ButtonImage(); - void SetNormal(const QRgb *d_normal,int w=DEFAULT_IMAGE_SIZE,int h=DEFAULT_IMAGE_SIZE); - void SetHovered(const QRgb *d_hovered=NULL); - void SetPressed(const QRgb *d_pressed=NULL); + void SetNormal(const TQRgb *d_normal,int w=DEFAULT_IMAGE_SIZE,int h=DEFAULT_IMAGE_SIZE); + void SetHovered(const TQRgb *d_hovered=NULL); + void SetPressed(const TQRgb *d_pressed=NULL); void reset(); void finish(); bool initialized(); void setSpace(int hS,int vS) { hSpace=hS; vSpace=vS; } void setDrawMode(int dm) { drawMode=dm; } - void setColors(QColor n,QColor h,QColor p) { normal_color=n; hovered_color=h; pressed_color=p; } + void setColors(TQColor n,TQColor h,TQColor p) { normal_color=n; hovered_color=h; pressed_color=p; } - QImage* getAnimated(float anim); + TQImage* getAnimated(float anim); private: - QImage CreateImage(QRgb *data,QColor color); - void tint(QRgb *data,QColor color); + TQImage CreateImage(TQRgb *data,TQColor color); + void tint(TQRgb *data,TQColor color); }; #endif diff --git a/client/config/configdialog.ui b/client/config/configdialog.ui index 29025b8..5699b3a 100644 --- a/client/config/configdialog.ui +++ b/client/config/configdialog.ui @@ -1,6 +1,6 @@ ConfigDialog - + ConfigDialog @@ -22,14 +22,14 @@ 0 - + tabWidget2 Rounded - + tab @@ -40,7 +40,7 @@ unnamed - + tooltip @@ -64,14 +64,14 @@ Expanding - + 20 16 - + titlealign @@ -90,13 +90,13 @@ - Use these buttons to set the alignment of the window title + Use these buttons to set the tqalignment of the window title unnamed - + AlignLeft @@ -110,7 +110,7 @@ - + AlignHCenter @@ -127,7 +127,7 @@ - + AlignRight @@ -143,9 +143,9 @@ - + - repaintMode + tqrepaintMode @@ -156,13 +156,13 @@ - Moving &repaints window + Moving &tqrepaints window unnamed - + radioButton6 @@ -176,7 +176,7 @@ 3 - + radioButton4 @@ -190,7 +190,7 @@ 1 - + updateTime @@ -210,7 +210,7 @@ 200 - + radioButton5 @@ -229,14 +229,14 @@ - + roundCorners Round &Corners - + AlignHCenter @@ -253,14 +253,14 @@ Expanding - + 20 20 - + trc @@ -279,7 +279,7 @@ true - + blc @@ -305,14 +305,14 @@ Preferred - + 10 20 - + brc @@ -328,7 +328,7 @@ - + tlc @@ -357,7 +357,7 @@ Preferred - + 10 20 @@ -366,7 +366,7 @@ - + textLabel2_2 @@ -385,7 +385,7 @@ borderwidth - + textLabel2_2_2 @@ -404,7 +404,7 @@ titlebarheight - + borderwidth @@ -418,7 +418,7 @@ Width of the borders - + titlebarheight @@ -435,7 +435,7 @@ Height of the title par (independend to border width) - + textshadow @@ -449,7 +449,7 @@ Draws a nice shadowed title bar text to improve visibility. - + drawCaption @@ -463,7 +463,7 @@ true - + wheelTask @@ -485,7 +485,7 @@ Wheel on titlebar cycles through visible windows. Does NOT work in compiz. Overrides settings in KDE. - + infoButton @@ -497,7 +497,7 @@ 0 - + 80 0 @@ -512,7 +512,7 @@ - + tab @@ -523,7 +523,7 @@ unnamed - + animateHover @@ -548,7 +548,7 @@ Smoothly animate the hover effect of the buttons - + hover @@ -580,14 +580,14 @@ Expanding - + 20 20 - + tintButtons @@ -645,7 +645,7 @@ The semi transparent buttons of the titlebar will be shaded in this color - + textLabel1_3 @@ -653,7 +653,7 @@ Minimize Button - + textLabel5 @@ -777,7 +777,7 @@ The semi transparent buttons of the titlebar will be shaded in this color - + textLabel3 @@ -785,7 +785,7 @@ Hovered - + textLabel4_2 @@ -793,7 +793,7 @@ Pressed - + textLabel2_4 @@ -888,7 +888,7 @@ The semi transparent buttons of the titlebar will be shaded in this color - + textLabel1_4 @@ -925,7 +925,7 @@ The semi transparent buttons of the titlebar will be shaded in this color - + textLabel1 @@ -1022,7 +1022,7 @@ - + Crystal Default @@ -1118,7 +1118,7 @@ Select your favourite button theme here - + menuimage @@ -1137,7 +1137,7 @@ - + TabPage @@ -1148,11 +1148,11 @@ unnamed - + tabWidget4 - + tab @@ -1163,7 +1163,7 @@ unnamed - + frame3 @@ -1177,7 +1177,7 @@ unnamed - + shade1 @@ -1205,7 +1205,7 @@ Amount of effect - + textLabel1_2 @@ -1232,7 +1232,7 @@ The color of the outline frame - + userPicture1 @@ -1249,7 +1249,7 @@ Use userdefined picture for background instead of current wallpaper - + Fade @@ -1300,14 +1300,14 @@ Expanding - + 20 16 - + No outline @@ -1337,7 +1337,7 @@ - + frame4 @@ -1351,7 +1351,7 @@ unnamed - + textLabel1_5 @@ -1359,7 +1359,7 @@ Blur Image: - + active_blur @@ -1391,7 +1391,7 @@ The color of the inline frame - + No inline @@ -1429,7 +1429,7 @@ Expanding - + 20 50 @@ -1448,7 +1448,7 @@ - + tab @@ -1459,7 +1459,7 @@ unnamed - + frame3_2 @@ -1473,7 +1473,7 @@ unnamed - + Fade @@ -1533,7 +1533,7 @@ The color of the outline frame - + userPicture2 @@ -1550,7 +1550,7 @@ Use userdefined picture for background instead of current wallpaper - + shade2 @@ -1588,14 +1588,14 @@ Expanding - + 20 16 - + No outline @@ -1623,7 +1623,7 @@ Draw outline frame - + textLabel1_2_3 @@ -1633,7 +1633,7 @@ - + frame4_2 @@ -1647,7 +1647,7 @@ unnamed - + textLabel1_5_2 @@ -1655,7 +1655,7 @@ Blur Image: - + inactive_blur @@ -1697,14 +1697,14 @@ Expanding - + 20 20 - + No inline @@ -1745,7 +1745,7 @@ - + trackdesktop @@ -1770,7 +1770,7 @@ Check, if you have different wallpapers set on multiple desktops. Uncheck, when you just have one wallpaper for all desktops. - + enableTransparency @@ -1800,7 +1800,7 @@ - + TabPage @@ -1811,7 +1811,7 @@ unnamed - + logoEnabled @@ -1836,7 +1836,7 @@ unnamed - + radioButton13 @@ -1853,7 +1853,7 @@ true - + radioButton14_3 @@ -1864,7 +1864,7 @@ - + radioButton15 @@ -1877,7 +1877,7 @@ - + logoPreview @@ -1889,13 +1889,13 @@ 0 - + 30 30 - + 30 30 @@ -1914,7 +1914,7 @@ Little preview - + Stretch @@ -1939,7 +1939,7 @@ Expanding - + 20 30 @@ -1959,7 +1959,7 @@ - + textLabel1_6 @@ -1975,7 +1975,7 @@ Distance to the text: - + logoDistance @@ -1997,7 +1997,7 @@ 5 - + logoActive @@ -2021,7 +2021,7 @@ - + TabPage @@ -2032,7 +2032,7 @@ unnamed - + textLabel2 @@ -2047,11 +2047,11 @@ Lets you put an transparent image on top of the title bar. - + AlignCenter - + textLabel4 @@ -2066,7 +2066,7 @@ User defined should be a transparent png file, i.e. 1x64px - + AlignCenter @@ -2080,14 +2080,14 @@ Expanding - + 20 40 - + textLabel1_7 @@ -2095,7 +2095,7 @@ Overlay for active window: - + textLabel1_7_2 @@ -2103,7 +2103,7 @@ Overlay for inactive window: - + Disabled @@ -2149,7 +2149,7 @@ false - + Disabled @@ -2256,7 +2256,7 @@ enableTransparency toggled(bool) - repaintMode + tqrepaintMode setEnabled(bool) @@ -2380,7 +2380,7 @@ setEnabled(bool) - + kcolorbutton.h kcolorbutton.h diff --git a/client/config/crystalconfig.cc b/client/config/crystalconfig.cc index dedf8ec..9ccf5f5 100644 --- a/client/config/crystalconfig.cc +++ b/client/config/crystalconfig.cc @@ -21,22 +21,22 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include -#include +#include #include #include @@ -45,94 +45,94 @@ #include "crystalconfig.h" -CrystalConfig::CrystalConfig(KConfig*, QWidget* parent) - : QObject(parent), config_(0), dialog_(0) +CrystalConfig::CrystalConfig(KConfig*, TQWidget* tqparent) + : TQObject(tqparent), config_(0), dialog_(0) { config_ = new KConfig("kwincrystalrc"); - dialog_ = new ConfigDialog(parent); + dialog_ = new ConfigDialog(tqparent); dialog_->show(); - connect(dialog_->titlealign, SIGNAL(clicked(int)),this, SLOT(selectionChanged(int))); + connect(dialog_->titlealign, TQT_SIGNAL(clicked(int)),this, TQT_SLOT(selectionChanged(int))); - connect(dialog_->drawCaption, SIGNAL(stateChanged(int)),this,SLOT(selectionChanged(int))); - connect(dialog_->textshadow, SIGNAL(stateChanged(int)),this, SLOT(selectionChanged(int))); - connect(dialog_->tooltip,SIGNAL(stateChanged(int)),this,SLOT(selectionChanged(int))); - connect(dialog_->wheelTask,SIGNAL(stateChanged(int)),this,SLOT(selectionChanged(int))); + connect(dialog_->drawCaption, TQT_SIGNAL(stateChanged(int)),this,TQT_SLOT(selectionChanged(int))); + connect(dialog_->textshadow, TQT_SIGNAL(stateChanged(int)),this, TQT_SLOT(selectionChanged(int))); + connect(dialog_->tooltip,TQT_SIGNAL(stateChanged(int)),this,TQT_SLOT(selectionChanged(int))); + connect(dialog_->wheelTask,TQT_SIGNAL(stateChanged(int)),this,TQT_SLOT(selectionChanged(int))); - connect(dialog_->trackdesktop, SIGNAL(stateChanged(int)),this, SLOT(selectionChanged(int))); + connect(dialog_->trackdesktop, TQT_SIGNAL(stateChanged(int)),this, TQT_SLOT(selectionChanged(int))); - connect(dialog_->shade1, SIGNAL(valueChanged(int)),this, SLOT(selectionChanged(int))); - connect(dialog_->shade2, SIGNAL(valueChanged(int)),this, SLOT(selectionChanged(int))); + connect(dialog_->shade1, TQT_SIGNAL(valueChanged(int)),this, TQT_SLOT(selectionChanged(int))); + connect(dialog_->shade2, TQT_SIGNAL(valueChanged(int)),this, TQT_SLOT(selectionChanged(int))); - connect(dialog_->frame1, SIGNAL(activated(int)),this, SLOT(selectionChanged(int))); - connect(dialog_->frame2, SIGNAL(activated(int)),this, SLOT(selectionChanged(int))); - connect(dialog_->frameColor1, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); - connect(dialog_->frameColor2, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); + connect(dialog_->frame1, TQT_SIGNAL(activated(int)),this, TQT_SLOT(selectionChanged(int))); + connect(dialog_->frame2, TQT_SIGNAL(activated(int)),this, TQT_SLOT(selectionChanged(int))); + connect(dialog_->frameColor1, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&))); + connect(dialog_->frameColor2, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&))); - connect(dialog_->inline1, SIGNAL(activated(int)),this, SLOT(selectionChanged(int))); - connect(dialog_->inline2, SIGNAL(activated(int)),this, SLOT(selectionChanged(int))); - connect(dialog_->inlineColor1, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); - connect(dialog_->inlineColor2, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); + connect(dialog_->inline1, TQT_SIGNAL(activated(int)),this, TQT_SLOT(selectionChanged(int))); + connect(dialog_->inline2, TQT_SIGNAL(activated(int)),this, TQT_SLOT(selectionChanged(int))); + connect(dialog_->inlineColor1, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&))); + connect(dialog_->inlineColor2, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&))); - connect(dialog_->type1,SIGNAL(activated(int)),this,SLOT(selectionChanged(int))); - connect(dialog_->type2,SIGNAL(activated(int)),this,SLOT(selectionChanged(int))); + connect(dialog_->type1,TQT_SIGNAL(activated(int)),this,TQT_SLOT(selectionChanged(int))); + connect(dialog_->type2,TQT_SIGNAL(activated(int)),this,TQT_SLOT(selectionChanged(int))); - connect(dialog_->enableTransparency,SIGNAL(stateChanged(int)),this,SLOT(selectionChanged(int))); + connect(dialog_->enableTransparency,TQT_SIGNAL(stateChanged(int)),this,TQT_SLOT(selectionChanged(int))); - connect(dialog_->borderwidth, SIGNAL(valueChanged(int)),this, SLOT(selectionChanged(int))); - connect(dialog_->titlebarheight, SIGNAL(valueChanged(int)),this, SLOT(selectionChanged(int))); + connect(dialog_->borderwidth, TQT_SIGNAL(valueChanged(int)),this, TQT_SLOT(selectionChanged(int))); + connect(dialog_->titlebarheight, TQT_SIGNAL(valueChanged(int)),this, TQT_SLOT(selectionChanged(int))); - connect(dialog_->tlc, SIGNAL(stateChanged(int)),this,SLOT(selectionChanged(int))); - connect(dialog_->trc, SIGNAL(stateChanged(int)),this,SLOT(selectionChanged(int))); - connect(dialog_->blc, SIGNAL(stateChanged(int)),this,SLOT(selectionChanged(int))); - connect(dialog_->brc, SIGNAL(stateChanged(int)),this,SLOT(selectionChanged(int))); - connect(dialog_->buttonColor1, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); - connect(dialog_->buttonColor2, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); - connect(dialog_->buttonColor3, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); - connect(dialog_->minColor1, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); - connect(dialog_->minColor2, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); - connect(dialog_->minColor3, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); - connect(dialog_->maxColor1, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); - connect(dialog_->maxColor2, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); - connect(dialog_->maxColor3, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); - connect(dialog_->closeColor1, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); - connect(dialog_->closeColor2, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); - connect(dialog_->closeColor3, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); + connect(dialog_->tlc, TQT_SIGNAL(stateChanged(int)),this,TQT_SLOT(selectionChanged(int))); + connect(dialog_->trc, TQT_SIGNAL(stateChanged(int)),this,TQT_SLOT(selectionChanged(int))); + connect(dialog_->blc, TQT_SIGNAL(stateChanged(int)),this,TQT_SLOT(selectionChanged(int))); + connect(dialog_->brc, TQT_SIGNAL(stateChanged(int)),this,TQT_SLOT(selectionChanged(int))); + connect(dialog_->buttonColor1, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&))); + connect(dialog_->buttonColor2, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&))); + connect(dialog_->buttonColor3, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&))); + connect(dialog_->minColor1, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&))); + connect(dialog_->minColor2, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&))); + connect(dialog_->minColor3, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&))); + connect(dialog_->maxColor1, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&))); + connect(dialog_->maxColor2, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&))); + connect(dialog_->maxColor3, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&))); + connect(dialog_->closeColor1, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&))); + connect(dialog_->closeColor2, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&))); + connect(dialog_->closeColor3, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&))); - connect(dialog_->hover, SIGNAL(stateChanged(int)),this,SLOT(selectionChanged(int))); - connect(dialog_->animateHover, SIGNAL(stateChanged(int)),this,SLOT(selectionChanged(int))); - connect(dialog_->buttonTheme, SIGNAL(activated(int)),this,SLOT(selectionChanged(int))); - connect(dialog_->tintButtons, SIGNAL(toggled(bool)),this,SLOT(boolChanged(bool))); - connect(dialog_->menuimage, SIGNAL(stateChanged(int)),this,SLOT(selectionChanged(int))); + connect(dialog_->hover, TQT_SIGNAL(stateChanged(int)),this,TQT_SLOT(selectionChanged(int))); + connect(dialog_->animateHover, TQT_SIGNAL(stateChanged(int)),this,TQT_SLOT(selectionChanged(int))); + connect(dialog_->buttonTheme, TQT_SIGNAL(activated(int)),this,TQT_SLOT(selectionChanged(int))); + connect(dialog_->tintButtons, TQT_SIGNAL(toggled(bool)),this,TQT_SLOT(boolChanged(bool))); + connect(dialog_->menuimage, TQT_SIGNAL(stateChanged(int)),this,TQT_SLOT(selectionChanged(int))); - connect(dialog_->repaintMode, SIGNAL(clicked(int)),this, SLOT(selectionChanged(int))); + connect(dialog_->tqrepaintMode, TQT_SIGNAL(clicked(int)),this, TQT_SLOT(selectionChanged(int))); - connect(dialog_->updateTime, SIGNAL(valueChanged(int)),this, SLOT(selectionChanged(int))); + connect(dialog_->updateTime, TQT_SIGNAL(valueChanged(int)),this, TQT_SLOT(selectionChanged(int))); - connect(dialog_->infoButton, SIGNAL(clicked(void)),this,SLOT(infoDialog(void))); + connect(dialog_->infoButton, TQT_SIGNAL(clicked(void)),this,TQT_SLOT(infoDialog(void))); - connect(dialog_->active_blur, SIGNAL(valueChanged(int)),this,SLOT(selectionChanged(int))); - connect(dialog_->inactive_blur, SIGNAL(valueChanged(int)),this,SLOT(selectionChanged(int))); + connect(dialog_->active_blur, TQT_SIGNAL(valueChanged(int)),this,TQT_SLOT(selectionChanged(int))); + connect(dialog_->inactive_blur, TQT_SIGNAL(valueChanged(int)),this,TQT_SLOT(selectionChanged(int))); - connect(dialog_->userPicture1, SIGNAL(stateChanged(int)),this, SLOT(selectionChanged(int))); - connect(dialog_->userPicture2, SIGNAL(stateChanged(int)),this, SLOT(selectionChanged(int))); - connect(dialog_->activeFile,SIGNAL(textChanged(const QString&)),this,SLOT(textChanged( const QString& ))); - connect(dialog_->inactiveFile,SIGNAL(textChanged(const QString&)),this,SLOT(textChanged( const QString& ))); + connect(dialog_->userPicture1, TQT_SIGNAL(stateChanged(int)),this, TQT_SLOT(selectionChanged(int))); + connect(dialog_->userPicture2, TQT_SIGNAL(stateChanged(int)),this, TQT_SLOT(selectionChanged(int))); + connect(dialog_->activeFile,TQT_SIGNAL(textChanged(const TQString&)),this,TQT_SLOT(textChanged( const TQString& ))); + connect(dialog_->inactiveFile,TQT_SIGNAL(textChanged(const TQString&)),this,TQT_SLOT(textChanged( const TQString& ))); - connect(dialog_->overlay_active, SIGNAL(activated(int)),this, SLOT(overlay_active_changed(int))); - connect(dialog_->overlay_inactive, SIGNAL(activated(int)),this, SLOT(overlay_inactive_changed(int))); + connect(dialog_->overlay_active, TQT_SIGNAL(activated(int)),this, TQT_SLOT(overlay_active_changed(int))); + connect(dialog_->overlay_inactive, TQT_SIGNAL(activated(int)),this, TQT_SLOT(overlay_inactive_changed(int))); - connect(dialog_->overlay_active_file,SIGNAL(textChanged(const QString&)),this,SLOT(textChanged(const QString &))); - connect(dialog_->overlay_inactive_file,SIGNAL(textChanged(const QString&)),this,SLOT(textChanged(const QString &))); + connect(dialog_->overlay_active_file,TQT_SIGNAL(textChanged(const TQString&)),this,TQT_SLOT(textChanged(const TQString &))); + connect(dialog_->overlay_inactive_file,TQT_SIGNAL(textChanged(const TQString&)),this,TQT_SLOT(textChanged(const TQString &))); - connect(dialog_->logoEnabled, SIGNAL(clicked(int)),this, SLOT(selectionChanged(int))); - connect(dialog_->logoFile, SIGNAL(textChanged(const QString &)),this, SLOT(logoTextChanged(const QString&))); - connect(dialog_->logoStretch, SIGNAL(activated(int)),this, SLOT(selectionChanged(int))); - connect(dialog_->logoActive, SIGNAL(stateChanged(int)),this, SLOT(selectionChanged(int))); - connect(dialog_->logoDistance,SIGNAL(valueChanged(int)),this,SLOT(selectionChanged(int))); + connect(dialog_->logoEnabled, TQT_SIGNAL(clicked(int)),this, TQT_SLOT(selectionChanged(int))); + connect(dialog_->logoFile, TQT_SIGNAL(textChanged(const TQString &)),this, TQT_SLOT(logoTextChanged(const TQString&))); + connect(dialog_->logoStretch, TQT_SIGNAL(activated(int)),this, TQT_SLOT(selectionChanged(int))); + connect(dialog_->logoActive, TQT_SIGNAL(stateChanged(int)),this, TQT_SLOT(selectionChanged(int))); + connect(dialog_->logoDistance,TQT_SIGNAL(valueChanged(int)),this,TQT_SLOT(selectionChanged(int))); load(config_); } @@ -150,12 +150,12 @@ void CrystalConfig::selectionChanged(int) void CrystalConfig::load(KConfig*) { - QColor color(255,255,255); + TQColor color(255,255,255); config_->setGroup("General"); - QString value = config_->readEntry("TitleAlignment", "AlignHCenter"); - QRadioButton *button = (QRadioButton*)dialog_->titlealign->child(value); + TQString value = config_->readEntry("TitleAlignment", "AlignHCenter"); + TQRadioButton *button = (TQRadioButton*)dialog_->titlealign->child(value); if (button) button->setChecked(true); dialog_->drawCaption->setChecked(config_->readBoolEntry("DrawCaption",true)); @@ -167,17 +167,17 @@ void CrystalConfig::load(KConfig*) dialog_->trackdesktop->setChecked(config_->readBoolEntry("TrackDesktop",false)); dialog_->frame1->setCurrentItem(config_->readNumEntry("ActiveFrame",1)); - color=QColor(192,192,192); + color=TQColor(192,192,192); dialog_->frameColor1->setColor(config_->readColorEntry("FrameColor1",&color)); dialog_->frame2->setCurrentItem(config_->readNumEntry("InactiveFrame",1)); - color=QColor(192,192,192); + color=TQColor(192,192,192); dialog_->frameColor2->setColor(config_->readColorEntry("FrameColor2",&color)); dialog_->inline1->setCurrentItem(config_->readNumEntry("ActiveInline",0)); - color=QColor(192,192,192); + color=TQColor(192,192,192); dialog_->inlineColor1->setColor(config_->readColorEntry("InlineColor1",&color)); dialog_->inline2->setCurrentItem(config_->readNumEntry("InactiveInline",0)); - color=QColor(192,192,192); + color=TQColor(192,192,192); dialog_->inlineColor2->setColor(config_->readColorEntry("InlineColor2",&color)); @@ -203,7 +203,7 @@ void CrystalConfig::load(KConfig*) dialog_->animateHover->setChecked(config_->readBoolEntry("AnimateHover",true)); dialog_->menuimage->setChecked(config_->readBoolEntry("MenuImage",true)); - color=QColor(255,255,255); + color=TQColor(255,255,255); dialog_->buttonColor1->setColor(config_->readColorEntry("ButtonColor",&color)); dialog_->buttonColor2->setColor(config_->readColorEntry("ButtonColor2",&color)); dialog_->buttonColor3->setColor(config_->readColorEntry("ButtonColor3",&color)); @@ -217,12 +217,12 @@ void CrystalConfig::load(KConfig*) dialog_->closeColor2->setColor(config_->readColorEntry("CloseColor2",&color)); dialog_->closeColor3->setColor(config_->readColorEntry("CloseColor3",&color)); - dialog_->tintButtons->setChecked(config_->readBoolEntry("TintButtons",dialog_->buttonColor1->color()!=QColor(255,255,255))); + dialog_->tintButtons->setChecked(config_->readBoolEntry("TintButtons",dialog_->buttonColor1->color()!=TQColor(255,255,255))); dialog_->buttonTheme->setCurrentItem(config_->readNumEntry("ButtonTheme",8)); dialog_->updateTime->setValue(config_->readNumEntry("RepaintTime",200)); - button=(QRadioButton*)dialog_->repaintMode->find(config_->readNumEntry("RepaintMode",1)); + button=(TQRadioButton*)dialog_->tqrepaintMode->tqfind(config_->readNumEntry("RepaintMode",1)); if (button)button->setChecked(true); dialog_->active_blur->setValue(config_->readNumEntry("ActiveBlur",0)); @@ -255,8 +255,8 @@ void CrystalConfig::save(KConfig*) { config_->setGroup("General"); - QRadioButton *button = (QRadioButton*)dialog_->titlealign->selected(); - if (button) config_->writeEntry("TitleAlignment", QString(button->name())); + TQRadioButton *button = (TQRadioButton*)dialog_->titlealign->selected(); + if (button) config_->writeEntry("TitleAlignment", TQString(button->name())); config_->writeEntry("DrawCaption",dialog_->drawCaption->isChecked()); config_->writeEntry("TextShadow",dialog_->textshadow->isChecked()); config_->writeEntry("CaptionTooltip",dialog_->tooltip->isChecked()); @@ -308,7 +308,7 @@ void CrystalConfig::save(KConfig*) config_->writeEntry("MenuImage",dialog_->menuimage->isChecked()); config_->writeEntry("ButtonTheme",dialog_->buttonTheme->currentItem()); - config_->writeEntry("RepaintMode",dialog_->repaintMode->selectedId()); + config_->writeEntry("RepaintMode",dialog_->tqrepaintMode->selectedId()); config_->writeEntry("RepaintTime",dialog_->updateTime->value()); config_->writeEntry("ActiveBlur",dialog_->active_blur->value()); @@ -336,11 +336,11 @@ void CrystalConfig::save(KConfig*) void CrystalConfig::infoDialog() { InfoDialog d(dialog_); - connect((QLabel*)(d.kURLLabel1),SIGNAL(leftClickedURL(const QString&)),KApplication::kApplication(),SLOT(invokeBrowser(const QString &))); + connect((TQLabel*)(d.kURLLabel1),TQT_SIGNAL(leftClickedURL(const TQString&)),KApplication::kApplication(),TQT_SLOT(invokeBrowser(const TQString &))); d.exec(); } -void CrystalConfig::logoTextChanged(const QString&) +void CrystalConfig::logoTextChanged(const TQString&) { updateLogo(); emit changed(); @@ -360,15 +360,15 @@ void CrystalConfig::overlay_inactive_changed(int a) void CrystalConfig::updateLogo() { - QPixmap pic; + TQPixmap pic; pic.load(dialog_->logoFile->url()); dialog_->logoPreview->setPixmap(pic); } void CrystalConfig::defaults() { - QRadioButton *button = - (QRadioButton*)dialog_->titlealign->child("AlignHCenter"); + TQRadioButton *button = + (TQRadioButton*)dialog_->titlealign->child("AlignHCenter"); if (button) button->setChecked(true); dialog_->shade1->setValue(50); dialog_->shade2->setValue(50); @@ -376,8 +376,8 @@ void CrystalConfig::defaults() extern "C" { - QObject* allocate_config(KConfig* config, QWidget* parent) { - return (new CrystalConfig(config, parent)); + TQObject* allocate_config(KConfig* config, TQWidget* tqparent) { + return (new CrystalConfig(config, tqparent)); } } diff --git a/client/config/crystalconfig.h b/client/config/crystalconfig.h index 5bdc0fb..24e496e 100644 --- a/client/config/crystalconfig.h +++ b/client/config/crystalconfig.h @@ -22,7 +22,7 @@ #ifndef CRYSTALCONFIG_H #define CRYSTALCONFIG_H -#include +#include #define TOP_LEFT 1 #define TOP_RIGHT 2 @@ -32,11 +32,12 @@ class KConfig; class ConfigDialog; -class CrystalConfig : public QObject +class CrystalConfig : public TQObject { Q_OBJECT + TQ_OBJECT public: - CrystalConfig(KConfig* config, QWidget* parent); + CrystalConfig(KConfig* config, TQWidget* tqparent); ~CrystalConfig(); signals: @@ -53,9 +54,9 @@ protected slots: void overlay_active_changed(int); void overlay_inactive_changed(int); void boolChanged(bool) { selectionChanged(0); } - void colorChanged(const QColor&) { selectionChanged(0); } - void textChanged(const QString&) { selectionChanged(0); } - void logoTextChanged(const QString&); + void colorChanged(const TQColor&) { selectionChanged(0); } + void textChanged(const TQString&) { selectionChanged(0); } + void logoTextChanged(const TQString&); private: KConfig *config_; diff --git a/client/config/infodialog.ui b/client/config/infodialog.ui index f73a21c..eb7f13f 100644 --- a/client/config/infodialog.ui +++ b/client/config/infodialog.ui @@ -1,6 +1,6 @@ InfoDialog - + InfoDialog @@ -39,7 +39,7 @@ Minimum - + groupBox3 @@ -54,13 +54,13 @@ 0 - + 0 20 - + 32767 20 @@ -78,14 +78,14 @@ About: - + AlignCenter true - + textLabel1 @@ -109,11 +109,11 @@ You may look for the most recent version at kde-look.org: PlainText - + AlignTop|AlignLeft - + pixmapLabel2 @@ -143,7 +143,7 @@ You may look for the most recent version at kde-look.org: http://www.kde-look.org/content/show.php?content=13969 - + groupBox3_2 @@ -158,13 +158,13 @@ You may look for the most recent version at kde-look.org: 0 - + 0 20 - + 32767 20 @@ -182,14 +182,14 @@ You may look for the most recent version at kde-look.org: Usage: - + AlignCenter true - + textLabel1_2 @@ -216,7 +216,7 @@ You may look for the most recent version at kde-look.org: PlainText - + AlignVCenter|AlignLeft @@ -234,7 +234,7 @@ You may look for the most recent version at kde-look.org: Horizontal - + pushButton1 @@ -274,10 +274,10 @@ You may look for the most recent version at kde-look.org: close() - + kURLLabel1_leftURL() - - + + kurllabel.h diff --git a/client/crystalbutton.cpp b/client/crystalbutton.cpp index 8566e41..d38cbee 100644 --- a/client/crystalbutton.cpp +++ b/client/crystalbutton.cpp @@ -19,9 +19,9 @@ ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include "crystalclient.h" #include "crystalbutton.h" @@ -29,10 +29,10 @@ #include "imageholder.h" -CrystalButton::CrystalButton(CrystalClient *parent, const char *name, - const QString& tip, ButtonType type, +CrystalButton::CrystalButton(CrystalClient *tqparent, const char *name, + const TQString& tip, ButtonType type, ButtonImage *vimage) -: QButton(parent->widget(), name), client_(parent), type_(type), image(vimage), lastmouse_(0) +: TQButton(tqparent->widget(), name), client_(tqparent), type_(type), image(vimage), lastmouse_(0) { setBackgroundMode(NoBackground); resetSize(false); @@ -40,8 +40,8 @@ CrystalButton::CrystalButton(CrystalClient *parent, const char *name, hover=first=last=false; animation=0.0; - QToolTip::add(this, tip); - connect ( &animation_timer,SIGNAL(timeout()),this,SLOT(animate())); + TQToolTip::add(this, tip); + connect ( &animation_timer,TQT_SIGNAL(timeout()),this,TQT_SLOT(animate())); } CrystalButton::~CrystalButton() @@ -59,12 +59,12 @@ void CrystalButton::resetSize(bool FullSize) void CrystalButton::setBitmap(ButtonImage *newimage) { image=newimage; - repaint(false); + tqrepaint(false); } -QSize CrystalButton::sizeHint() const +TQSize CrystalButton::tqsizeHint() const { - return QSize(buttonSizeH(),buttonSizeV()); + return TQSize(buttonSizeH(),buttonSizeV()); } int CrystalButton::buttonSizeH() const @@ -85,105 +85,105 @@ int CrystalButton::buttonSizeV() const return (factory->titlesize-1-vS>h)?h:factory->titlesize-1-vS; } -void CrystalButton::enterEvent(QEvent *e) +void CrystalButton::enterEvent(TQEvent *e) { hover=true; - if (factory->hovereffect)repaint(false); + if (factory->hovereffect)tqrepaint(false); if (factory->animateHover)animation_timer.start(60); - QButton::enterEvent(e); + TQButton::enterEvent(e); } -void CrystalButton::leaveEvent(QEvent *e) +void CrystalButton::leaveEvent(TQEvent *e) { hover=false; - if (factory->hovereffect)repaint(false); + if (factory->hovereffect)tqrepaint(false); if (factory->animateHover)animation_timer.start(80); - QButton::leaveEvent(e); + TQButton::leaveEvent(e); } -void CrystalButton::mousePressEvent(QMouseEvent* e) +void CrystalButton::mousePressEvent(TQMouseEvent* e) { lastmouse_ = e->button(); int button; switch(e->button()) { - case LeftButton: - button=LeftButton; + case Qt::LeftButton: + button=Qt::LeftButton; break; - case RightButton: + case Qt::RightButton: if ((type_ == ButtonMax) || (type_ == ButtonMin) || (type_ == ButtonMenu) || (type_ == ButtonClose)) - button=LeftButton; else button=NoButton; + button=Qt::LeftButton; else button=Qt::NoButton; break; - case MidButton: + case Qt::MidButton: if ((type_ == ButtonMax) || (type_ == ButtonMin)) - button=LeftButton; else button=NoButton; + button=Qt::LeftButton; else button=Qt::NoButton; break; - default:button=NoButton; + default:button=Qt::NoButton; break; } - QMouseEvent me(e->type(), e->pos(), e->globalPos(),button, e->state()); - QButton::mousePressEvent(&me); + TQMouseEvent me(e->type(), e->pos(), e->globalPos(),button, e->state()); + TQButton::mousePressEvent(&me); } -void CrystalButton::mouseReleaseEvent(QMouseEvent* e) +void CrystalButton::mouseReleaseEvent(TQMouseEvent* e) { lastmouse_ = e->button(); int button; switch(e->button()) { - case LeftButton: - button=LeftButton; + case Qt::LeftButton: + button=Qt::LeftButton; break; - case RightButton: + case Qt::RightButton: if ((type_ == ButtonMax) || (type_ == ButtonMin) || (type_ == ButtonMenu) || (type_==ButtonClose)) - button=LeftButton; else button=NoButton; + button=Qt::LeftButton; else button=Qt::NoButton; break; - case MidButton: + case Qt::MidButton: if ((type_ == ButtonMax) || (type_ == ButtonMin)) - button=LeftButton; else button=NoButton; + button=Qt::LeftButton; else button=Qt::NoButton; break; - default:button=NoButton; + default:button=Qt::NoButton; break; } - QMouseEvent me(e->type(), e->pos(), e->globalPos(), button, e->state()); - QButton::mouseReleaseEvent(&me); + TQMouseEvent me(e->type(), e->pos(), e->globalPos(), button, e->state()); + TQButton::mouseReleaseEvent(&me); } -void CrystalButton::drawButton(QPainter *painter) +void CrystalButton::drawButton(TQPainter *painter) { if (!CrystalFactory::initialized()) return; - QColorGroup group; + TQColorGroup group; float dx, dy; int dm=0; - QPixmap pufferPixmap; + TQPixmap pufferPixmap; pufferPixmap.resize(width(), height()); - QPainter pufferPainter(&pufferPixmap); + TQPainter pufferPainter(&pufferPixmap); CrystalFactory *f=((CrystalFactory*)client_->factory()); - QPixmap *background; + TQPixmap *background; if (f->transparency)background=f->image_holder->image(client_->isActive()); else background=NULL; WND_CONFIG *wndcfg=client_->isActive()?&f->active:&f->inactive; if (background && !background->isNull()) { - QRect r=rect(); - QPoint p=mapToGlobal(QPoint(0,0)); + TQRect r=rect(); + TQPoint p=mapToGlobal(TQPoint(0,0)); r.moveBy(p.x(),p.y()); - pufferPainter.drawPixmap(QPoint(0,0),*background,r); + pufferPainter.drawPixmap(TQPoint(0,0),*background,r); }else{ - group = client_->options()->colorGroup(KDecoration::ColorTitleBar, client_->isActive()); + group = client_->options()->tqcolorGroup(KDecoration::ColorTitleBar, client_->isActive()); pufferPainter.fillRect(rect(), group.background()); } if (!wndcfg->overlay.isNull()) { - pufferPainter.drawTiledPixmap(rect(),wndcfg->overlay,QPoint(x(),y())); + pufferPainter.drawTiledPixmap(rect(),wndcfg->overlay,TQPoint(x(),y())); } dm=0; @@ -228,21 +228,21 @@ void CrystalButton::drawButton(QPainter *painter) if (dx<1 || dy<=1) { int m=(rect().width()-2icon().pixmap(QIconSet::Small, - QIconSet::Normal)); + pufferPainter.drawPixmap(r, client_->icon().pixmap(TQIconSet::Small, + TQIconSet::Normal)); }else{ // if (isDown()) { dx++; dy++; } - pufferPainter.drawPixmap((int)dx, (int)dy, client_->icon().pixmap(QIconSet::Small, - QIconSet::Normal)); + pufferPainter.drawPixmap((int)dx, (int)dy, client_->icon().pixmap(TQIconSet::Small, + TQIconSet::Normal)); } } else if (image && image->initialized()) { // otherwise we paint the deco dx = float(width() - image->image_width) / 2.0; dy = float(height() - image->image_height) / 2.0; - QImage *img=image->normal; + TQImage *img=image->normal; if (::factory->hovereffect) { @@ -274,17 +274,17 @@ void CrystalButton::drawButton(QPainter *painter) w=(int)((float)h*(float)image->image_width/(float)image->image_height); } - QRect r((rect().width()-w)/2,(rect().height()-h)/2,w,h); + TQRect r((rect().width()-w)/2,(rect().height()-h)/2,w,h); pufferPainter.drawImage(r,*img); if (type_ == ButtonMenu) drawMenuImage(&pufferPainter, r); }else{ // Otherwise we just paint it if (image->drawMode==1)dy=0; - pufferPainter.drawImage(QPoint((int)dx,(int)dy),*img); + pufferPainter.drawImage(TQPoint((int)dx,(int)dy),*img); if (type_ == ButtonMenu) drawMenuImage(&pufferPainter, - QRect((int)dx,(int)dy,image->image_width,image->image_height)); + TQRect((int)dx,(int)dy,image->image_width,image->image_height)); } } @@ -292,7 +292,7 @@ void CrystalButton::drawButton(QPainter *painter) painter->drawPixmap(0,0, pufferPixmap); } -void CrystalButton::drawMenuImage(QPainter* painter, QRect r) +void CrystalButton::drawMenuImage(TQPainter* painter, TQRect r) { if (type_ != ButtonMenu) return; // we paint the mini icon (which is 16 pixels high) @@ -304,12 +304,12 @@ void CrystalButton::drawMenuImage(QPainter* painter, QRect r) if (dx<1 || dy<=1) { int m=(r.width()-2drawPixmap(r2, client_->icon().pixmap(QIconSet::Small, - QIconSet::Normal)); + TQRect r2(r.left()+(r.width()-m)/2,r.top()+(r.height()-m)/2,m,m); + painter->drawPixmap(r2, client_->icon().pixmap(TQIconSet::Small, + TQIconSet::Normal)); }else{ - painter->drawPixmap(r.left()+(int)dx, r.top()+(int)dy, client_->icon().pixmap(QIconSet::Small, - QIconSet::Normal)); + painter->drawPixmap(r.left()+(int)dx, r.top()+(int)dy, client_->icon().pixmap(TQIconSet::Small, + TQIconSet::Normal)); } } @@ -331,7 +331,7 @@ void CrystalButton::animate() animation_timer.stop(); } } - repaint(false); + tqrepaint(false); } #include "crystalbutton.moc" diff --git a/client/crystalbutton.h b/client/crystalbutton.h index c1f55c5..ad2cb95 100644 --- a/client/crystalbutton.h +++ b/client/crystalbutton.h @@ -23,35 +23,36 @@ #ifndef _CRYSTALBUTTON_INCLUDED_ #define _CRYSTALBUTTON_INCLUDED_ -#include +#include class CrystalClient; class ButtonImage; -class CrystalButton : public QButton +class CrystalButton : public TQButton { Q_OBJECT + TQ_OBJECT public: - CrystalButton(CrystalClient *parent=0, const char *name=0, - const QString &tip=NULL, + CrystalButton(CrystalClient *tqparent=0, const char *name=0, + const TQString &tip=NULL, ButtonType type=ButtonHelp, ButtonImage *vimage=NULL); virtual ~CrystalButton(); void setBitmap(ButtonImage *newimage); - QSize sizeHint() const; + TQSize tqsizeHint() const; int lastMousePress() const { return lastmouse_; } - void reset() { repaint(false); } + void reset() { tqrepaint(false); } void setFirstLast(bool vfirst,bool vlast) { first|=vfirst; last|=vlast; } void resetSize(bool FullSize); private: - void enterEvent(QEvent *e); - void leaveEvent(QEvent *e); - void mousePressEvent(QMouseEvent *e); - void mouseReleaseEvent(QMouseEvent *e); - void drawButton(QPainter *painter); - void drawMenuImage(QPainter *painter, QRect r); + void enterEvent(TQEvent *e); + void leaveEvent(TQEvent *e); + void mousePressEvent(TQMouseEvent *e); + void mouseReleaseEvent(TQMouseEvent *e); + void drawButton(TQPainter *painter); + void drawMenuImage(TQPainter *painter, TQRect r); int buttonSizeH() const; int buttonSizeV() const; @@ -60,7 +61,7 @@ private slots: void animate(); private: - QTimer animation_timer; + TQTimer animation_timer; bool first,last; bool hover; float animation; 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 #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -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,"
Crystal %s Preview
Built: %s
",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; ntitleButtonsLeft()); - 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;iresetSize(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(e)); + case TQEvent::MouseButtonDblClick: + mouseDoubleClickEvent(TQT_TQMOUSEEVENT(e)); return true; - case QEvent::MouseButtonPress: - processMousePressEvent(static_cast(e)); + case TQEvent::MouseButtonPress: + processMousePressEvent(TQT_TQMOUSEEVENT(e)); return true; - case QEvent::Paint: - paintEvent(static_cast(e)); + case TQEvent::Paint: + paintEvent(TQT_TQPAINTEVENT(e)); return true; - case QEvent::Wheel: - mouseWheelEvent(static_cast(e)); + case TQEvent::Wheel: + mouseWheelEvent(TQT_TQWHEELEVENT(e)); return true; - case QEvent::Resize: - resizeEvent(static_cast(e)); + case TQEvent::Resize: + resizeEvent(TQT_TQRESIZEEVENT(e)); return true; - case QEvent::Show: - showEvent(static_cast(e)); + case TQEvent::Show: + showEvent(TQT_TQSHOWEVENT(e)); return true; - case QEvent::Move: - moveEvent(static_cast(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;iwinId())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 *l=&(::factory->clients); + TQPtrList *l=&(::factory->clients); if (l->current()==NULL) for (unsigned int i=0;icount();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; nreset(); } @@ -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)); diff --git a/client/crystalclient.h b/client/crystalclient.h index 12b2bab..403a22f 100644 --- a/client/crystalclient.h +++ b/client/crystalclient.h @@ -27,22 +27,22 @@ #ifndef CRYSTALCLIENT_H #define CRYSTALCLIENT_H -#include +#include #include #include -#include -#include +#include +#include #include -class QSpacerItem; -class QPoint; +class TQSpacerItem; +class TQPoint; class CrystalClient; class CrystalFactory; class CrystalButton; class CrystalTray; -class QImageHolder; +class TQImageHolder; class ButtonImage; extern CrystalFactory *factory; @@ -58,9 +58,9 @@ struct WND_CONFIG double amount; int outlineMode,inlineMode; - QColor frameColor,inlineColor; - QPixmap overlay; - QImage userdefinedPicture; // Userdefined background image, instead of wallpaper + TQColor frameColor,inlineColor; + TQPixmap overlay; + TQImage userdefinedPicture; // Userdefined background image, instead of wallpaper int blur; }; @@ -108,43 +108,44 @@ public: virtual bool supports(Ability ability); static bool initialized() { return initialized_; } - static Qt::AlignmentFlags titleAlign() { return titlealign_; } + static TQt::AlignmentFlags titleAlign() { return titlealign_; } public: - QImageHolder *image_holder; + TQImageHolder *image_holder; - QPixmap logo; + TQPixmap logo; int logoEnabled,logoStretch,logoActive,logoDistance; int titlesize; bool hovereffect,tintButtons,animateHover,menuImage,wheelTask; - QColor buttonColor_normal,buttonColor_hovered,buttonColor_pressed; - QColor minColor_normal,minColor_hovered,minColor_pressed; - QColor maxColor_normal,maxColor_hovered,maxColor_pressed; - QColor closeColor_normal,closeColor_hovered,closeColor_pressed; + TQColor buttonColor_normal,buttonColor_hovered,buttonColor_pressed; + TQColor minColor_normal,minColor_hovered,minColor_pressed; + TQColor maxColor_normal,maxColor_hovered,maxColor_pressed; + TQColor closeColor_normal,closeColor_hovered,closeColor_pressed; int borderwidth; bool drawcaption,textshadow,captiontooltip; bool trackdesktop,transparency; int roundCorners; - int repaintMode,repaintTime; + int tqrepaintMode,tqrepaintTime; WND_CONFIG active,inactive; int buttontheme; ButtonImage *buttonImages[ButtonImageCount]; - QPtrList clients; + TQPtrList clients; private: bool readConfig(); void CreateButtonImages(); private: static bool initialized_; - static Qt::AlignmentFlags titlealign_; + static TQt::AlignmentFlags titlealign_; }; class CrystalClient : public KDecoration { Q_OBJECT + TQ_OBJECT public: CrystalClient(KDecorationBridge *b,CrystalFactory *f); virtual ~CrystalClient(); @@ -159,24 +160,24 @@ public: virtual void shadeChange(); virtual void borders(int &l, int &r, int &t, int &b) const; - virtual void resize(const QSize &size); - virtual QSize minimumSize() const; - virtual Position mousePosition(const QPoint &point) const; + virtual void resize(const TQSize &size); + virtual TQSize tqminimumSize() const; + virtual Position mousePosition(const TQPoint &point) const; void ClientWindows(Window* frame,Window* wrapper,Window* client); private: - CrystalButton* addButtons(QBoxLayout* layout, const QString& buttons); + CrystalButton* addButtons(TQBoxLayout* tqlayout, const TQString& buttons); void updateMask(); int borderSpacing(); void updateLayout(); - bool eventFilter(QObject *obj, QEvent *e); - void mouseDoubleClickEvent(QMouseEvent *e); - void paintEvent(QPaintEvent *e); - void resizeEvent(QResizeEvent *); - void moveEvent(QMoveEvent *); - void showEvent(QShowEvent *); - void mouseWheelEvent(QWheelEvent *e); + bool eventFilter(TQObject *obj, TQEvent *e); + void mouseDoubleClickEvent(TQMouseEvent *e); + void paintEvent(TQPaintEvent *e); + void resizeEvent(TQResizeEvent *); + void moveEvent(TQMoveEvent *); + void showEvent(TQShowEvent *); + void mouseWheelEvent(TQWheelEvent *e); private slots: void Repaint(); @@ -193,12 +194,12 @@ private slots: void menuPopUp(); private: CrystalButton *button[ButtonTypeCount]; - QGridLayout *mainlayout; - QHBoxLayout *titlelayout; - QTimer timer; + TQGridLayout *maintqlayout; + TQHBoxLayout *titletqlayout; + TQTimer timer; public: bool FullMax; - QSpacerItem *titlebar_; + TQSpacerItem *titlebar_; }; #endif diff --git a/client/imageholder.cpp b/client/imageholder.cpp index c24844e..5b1007a 100644 --- a/client/imageholder.cpp +++ b/client/imageholder.cpp @@ -20,35 +20,35 @@ #include -#include +#include #include -#include -#include +#include +#include #include "imageholder.h" #include "crystalclient.h" -QImageHolder::QImageHolder(QImage act,QImage inact) +TQImageHolder::TQImageHolder(TQImage act,TQImage inact) :img_active(NULL),img_inactive(NULL) { rootpixmap=NULL; setUserdefinedPictures( act,inact); initialized=userdefinedActive && userdefinedInactive; - emit repaintNeeded(); + emit tqrepaintNeeded(); } -QImageHolder::~QImageHolder() +TQImageHolder::~TQImageHolder() { if (rootpixmap)delete rootpixmap; if (img_active && !userdefinedActive)delete img_active; if (img_inactive && !userdefinedInactive)delete img_inactive; } -void QImageHolder::setUserdefinedPictures( QImage act,QImage inact) +void TQImageHolder::setUserdefinedPictures( TQImage act,TQImage inact) { - int w=QApplication::desktop()->width(); - int h=QApplication::desktop()->height(); + int w=TQApplication::desktop()->width(); + int h=TQApplication::desktop()->height(); if (img_active && !userdefinedActive) { delete img_active; @@ -63,12 +63,12 @@ void QImageHolder::setUserdefinedPictures( QImage act,QImage inact) if (!act.isNull()) { act=act.smoothScale(w,h); - img_active=ApplyEffect(act,&::factory->active,factory->options()->colorGroup(KDecoration::ColorTitleBar, true)); + img_active=ApplyEffect(act,&::factory->active,factory->options()->tqcolorGroup(KDecoration::ColorTitleBar, true)); }else img_active=NULL; if (!inact.isNull()) { inact=inact.smoothScale(w,h); - img_inactive=ApplyEffect(inact,&::factory->inactive,factory->options()->colorGroup(KDecoration::ColorTitleBar, false)); + img_inactive=ApplyEffect(inact,&::factory->inactive,factory->options()->tqcolorGroup(KDecoration::ColorTitleBar, false)); }else img_inactive=NULL; userdefinedActive=(img_active!=NULL); @@ -77,31 +77,31 @@ void QImageHolder::setUserdefinedPictures( QImage act,QImage inact) CheckSanity(); } -void QImageHolder::Init() +void TQImageHolder::Init() { if (initialized)return; rootpixmap=new KMyRootPixmap(NULL/*,this*/); rootpixmap->start(); - rootpixmap->repaint(true); - connect( rootpixmap,SIGNAL(backgroundUpdated(const QImage*)),this, SLOT(BackgroundUpdated(const QImage*))); - connect(kapp, SIGNAL(backgroundChanged(int)),SLOT(handleDesktopChanged(int))); + rootpixmap->tqrepaint(true); + connect( rootpixmap,TQT_SIGNAL(backgroundUpdated(const TQImage*)),this, TQT_SLOT(BackgroundUpdated(const TQImage*))); + connect(kapp, TQT_SIGNAL(backgroundChanged(int)),TQT_SLOT(handleDesktopChanged(int))); initialized=true; } -void QImageHolder::repaint(bool force) +void TQImageHolder::tqrepaint(bool force) { Init(); - if (rootpixmap)rootpixmap->repaint(force); + if (rootpixmap)rootpixmap->tqrepaint(force); } -void QImageHolder::handleDesktopChanged(int) +void TQImageHolder::handleDesktopChanged(int) { - repaint(true); + tqrepaint(true); } -void QImageHolder::CheckSanity() +void TQImageHolder::CheckSanity() { if (!initialized)return; if (userdefinedActive && userdefinedInactive)return; @@ -114,13 +114,13 @@ void QImageHolder::CheckSanity() initialized=false; } -QPixmap* QImageHolder::ApplyEffect(QImage &src,WND_CONFIG* cfg,QColorGroup colorgroup) +TQPixmap* TQImageHolder::ApplyEffect(TQImage &src,WND_CONFIG* cfg,TQColorGroup colorgroup) { - QImage dst; + TQImage dst; switch(cfg->mode) { - case 0: if (cfg->amount>0.99)return new QPixmap(); + case 0: if (cfg->amount>0.99)return new TQPixmap(); dst=KImageEffect::fade(src, cfg->amount, colorgroup.background()); break; case 1:dst=KImageEffect::channelIntensity(src,cfg->amount,KImageEffect::All); @@ -139,10 +139,10 @@ QPixmap* QImageHolder::ApplyEffect(QImage &src,WND_CONFIG* cfg,QColorGroup color if (cfg->blur>0)dst=KImageEffect::blur(dst,0,cfg->blur); - return new QPixmap(dst); + return new TQPixmap(dst); } -void QImageHolder::BackgroundUpdated(const QImage *src) +void TQImageHolder::BackgroundUpdated(const TQImage *src) { if (img_active && !userdefinedActive) { @@ -157,15 +157,15 @@ void QImageHolder::BackgroundUpdated(const QImage *src) if (src && !src->isNull()) { - QImage tmp=src->copy(); + TQImage tmp=src->copy(); if (!userdefinedInactive) - img_inactive=ApplyEffect(tmp,&::factory->inactive,factory->options()->colorGroup(KDecoration::ColorTitleBar, false)); + img_inactive=ApplyEffect(tmp,&::factory->inactive,factory->options()->tqcolorGroup(KDecoration::ColorTitleBar, false)); tmp=src->copy(); if (!userdefinedActive) - img_active=ApplyEffect(tmp,&::factory->active,factory->options()->colorGroup(KDecoration::ColorTitleBar, true)); + img_active=ApplyEffect(tmp,&::factory->active,factory->options()->tqcolorGroup(KDecoration::ColorTitleBar, true)); } - emit repaintNeeded(); + emit tqrepaintNeeded(); } diff --git a/client/imageholder.h b/client/imageholder.h index b88ac87..e41e000 100644 --- a/client/imageholder.h +++ b/client/imageholder.h @@ -28,34 +28,35 @@ struct WND_CONFIG; -class QImageHolder:public QObject +class TQImageHolder:public TQObject { Q_OBJECT + TQ_OBJECT public: - QImageHolder(QImage act,QImage inact); - virtual ~QImageHolder(); + TQImageHolder(TQImage act,TQImage inact); + virtual ~TQImageHolder(); void Init(); - QPixmap *image(bool active) { Init(); return active?img_active:img_inactive; } - void repaint(bool force); + TQPixmap *image(bool active) { Init(); return active?img_active:img_inactive; } + void tqrepaint(bool force); - void setUserdefinedPictures(QImage act,QImage inact); + void setUserdefinedPictures(TQImage act,TQImage inact); private: bool initialized; KMyRootPixmap *rootpixmap; - QPixmap *img_active,*img_inactive; + TQPixmap *img_active,*img_inactive; bool userdefinedActive,userdefinedInactive; - QPixmap* ApplyEffect(QImage &src,WND_CONFIG* cfg,QColorGroup colorgroup); + TQPixmap* ApplyEffect(TQImage &src,WND_CONFIG* cfg,TQColorGroup colorgroup); public slots: - void BackgroundUpdated(const QImage *); + void BackgroundUpdated(const TQImage *); void handleDesktopChanged(int desk); void CheckSanity(); signals: - void repaintNeeded(); + void tqrepaintNeeded(); }; diff --git a/client/myrootpixmap.cc b/client/myrootpixmap.cc index 9412256..792e474 100644 --- a/client/myrootpixmap.cc +++ b/client/myrootpixmap.cc @@ -12,12 +12,12 @@ /* Modified by Sascha Hlusiak */ -#include -#include -#include -#include +#include +#include +#include +#include -#ifndef Q_WS_QWS //FIXME +#ifndef TQ_WS_TQWS //FIXME #include #include #include @@ -25,21 +25,21 @@ #include #include #include -#include +#include #include #include "myrootpixmap.h" -KMyRootPixmap::KMyRootPixmap( QWidget * widget, const char *name ) - : QObject(widget, name ? name : "KMyRootPixmap" ) +KMyRootPixmap::KMyRootPixmap( TQWidget * widget, const char *name ) + : TQObject(widget, name ? name : "KMyRootPixmap" ) { init(); } -KMyRootPixmap::KMyRootPixmap( QWidget *, QObject *parent, const char *name ) - : QObject( parent, name ? name : "KMyRootPixmap" ) +KMyRootPixmap::KMyRootPixmap( TQWidget *, TQObject *tqparent, const char *name ) + : TQObject( tqparent, name ? name : "KMyRootPixmap" ) { init(); } @@ -49,17 +49,17 @@ void KMyRootPixmap::init() // d = new KMyRootPixmapData; // m_Fade = 0; m_pPixmap = new KSharedPixmap; -// m_pTimer = new QTimer( this ); +// m_pTimer = new TQTimer( this ); m_bInit = false; m_bActive = false; m_Desk=-1; // m_bCustomPaint = false; -// connect(kapp, SIGNAL(backgroundChanged(int)), SLOT(slotBackgroundChanged(int))); - connect(m_pPixmap, SIGNAL(done(bool)), SLOT(slotDone(bool))); -// connect(m_pTimer, SIGNAL(timeout()), SLOT(repaint())); +// connect(kapp, TQT_SIGNAL(backgroundChanged(int)), TQT_SLOT(slotBackgroundChanged(int))); + connect(m_pPixmap, TQT_SIGNAL(done(bool)), TQT_SLOT(slotDone(bool))); +// connect(m_pTimer, TQT_SIGNAL(timeout()), TQT_SLOT(tqrepaint())); -// d->toplevel = m_pWidget->topLevelWidget(); +// d->toplevel = m_pWidget->tqtopLevelWidget(); // d->toplevel->installEventFilter(this); } @@ -85,7 +85,7 @@ void KMyRootPixmap::start() enableExports(); return; // if (m_bInit) -// repaint(true); +// tqrepaint(true); } void KMyRootPixmap::stop() @@ -95,14 +95,14 @@ void KMyRootPixmap::stop() } -void KMyRootPixmap::repaint() +void KMyRootPixmap::tqrepaint() { - repaint(false); + tqrepaint(false); } -void KMyRootPixmap::repaint(bool force) +void KMyRootPixmap::tqrepaint(bool force) { -// printf("KMyRootPixmap::repaint(%s)\n",force?"true":"false"); +// printf("KMyRootPixmap::tqrepaint(%s)\n",force?"true":"false"); if ((!force) && (m_Desk==currentDesktop()))return; m_Desk = currentDesktop(); @@ -122,14 +122,14 @@ bool KMyRootPixmap::isAvailable() return m_pPixmap->isAvailable(pixmapName(m_Desk)); } -QString KMyRootPixmap::pixmapName(int desk) +TQString KMyRootPixmap::pixmapName(int desk) { - QString pattern = QString("DESKTOP%1"); + TQString pattern = TQString("DESKTOP%1"); int screen_number = DefaultScreen(qt_xdisplay()); if (screen_number) { - pattern = QString("SCREEN%1-DESKTOP").arg(screen_number) + "%1"; + pattern = TQString("SCREEN%1-DESKTOP").tqarg(screen_number) + "%1"; } - return pattern.arg( desk ); + return pattern.tqarg( desk ); } @@ -139,11 +139,11 @@ void KMyRootPixmap::enableExports() DCOPClient *client = kapp->dcopClient(); if (!client->isAttached()) client->attach(); - QByteArray data; - QDataStream args( data, IO_WriteOnly ); + TQByteArray data; + TQDataStream args( data, IO_WriteOnly ); args << 1; - QCString appname( "kdesktop" ); + TQCString appname( "kdesktop" ); int screen_number = DefaultScreen(qt_xdisplay()); if ( screen_number ) appname.sprintf("kdesktop-screen-%d", screen_number ); @@ -169,29 +169,29 @@ void KMyRootPixmap::slotDone(bool success) void KMyRootPixmap::updateBackground( KSharedPixmap *spm ) { // printf("KMyRootPixmap::updateBackground(%p)\n",spm); - QPixmap *px=spm; + TQPixmap *px=spm; if (px->isNull() || px->width()==0 || px->height()==0) { // This is NOT an image, something went wrong, update to plain emit backgroundUpdated(NULL); return; } KPixmapIO io; - QSize desktopsize(QApplication::desktop()->width(),QApplication::desktop()->height()); + TQSize desktopsize(TQApplication::desktop()->width(),TQApplication::desktop()->height()); if (px->rect().size()==desktopsize) { // Image has already the right dimension, make a quick update - QImage img = io.convertToImage(*spm); + TQImage img = io.convertToImage(*spm); emit backgroundUpdated(&img); return; }else{ // we need to create a tiled pixmap and then the image to update - QPixmap pix(desktopsize,spm->depth()); - QPainter pufferPainter(&pix); + TQPixmap pix(desktopsize,spm->TQPixmap::depth()); + TQPainter pufferPainter(&pix); pufferPainter.drawTiledPixmap(pix.rect(),*spm); pufferPainter.end(); - QImage img=io.convertToImage(pix); + TQImage img=io.convertToImage(pix); emit backgroundUpdated(&img); } } diff --git a/client/myrootpixmap.h b/client/myrootpixmap.h index dc0b72c..9f3ac6f 100644 --- a/client/myrootpixmap.h +++ b/client/myrootpixmap.h @@ -14,25 +14,26 @@ #ifndef __KRootPixmap_h_Included__ #define __KRootPixmap_h_Included__ -#include -#include +#include +#include -#ifndef Q_WS_QWS //FIXME +#ifndef TQ_WS_TQWS //FIXME -class QRect; -class QWidget; -class QTimer; +class TQRect; +class TQWidget; +class TQTimer; class KSharedPixmap; class KMyRootPixmapData; -class KMyRootPixmap: public QObject +class KMyRootPixmap: public TQObject { Q_OBJECT + TQ_OBJECT public: - KMyRootPixmap( QWidget *target=NULL, const char *name=0 ); + KMyRootPixmap( TQWidget *target=NULL, const char *name=0 ); - KMyRootPixmap( QWidget *target, QObject *parent, const char *name=0 ); + KMyRootPixmap( TQWidget *target, TQObject *tqparent, const char *name=0 ); virtual ~KMyRootPixmap(); @@ -54,23 +55,23 @@ public slots: virtual void stop(); -// void setFadeEffect(double strength, const QColor &color); +// void setFadeEffect(double strength, const TQColor &color); - void repaint( bool force ); + void tqrepaint( bool force ); - void repaint(); + void tqrepaint(); // void setCustomPainting( bool enable ) { m_bCustomPaint = enable; } void enableExports(); - static QString pixmapName(int desk); + static TQString pixmapName(int desk); signals: - void backgroundUpdated( const QImage *pm ); + void backgroundUpdated( const TQImage *pm ); protected: -// virtual bool eventFilter(QObject *, QEvent *); +// virtual bool eventFilter(TQObject *, TQEvent *); virtual void updateBackground( KSharedPixmap * ); @@ -83,16 +84,16 @@ private: int m_Desk; // double m_Fade; -// QColor m_FadeColor; +// TQColor m_FadeColor; - QRect m_Rect; -// QWidget *m_pWidget; -// QTimer *m_pTimer; + TQRect m_Rect; +// TQWidget *m_pWidget; +// TQTimer *m_pTimer; KSharedPixmap *m_pPixmap; // KMyRootPixmapData *d; void init(); }; -#endif // ! Q_WS_QWS +#endif // ! TQ_WS_TQWS #endif // __KRootPixmap_h_Included__ diff --git a/pics/embedtool.cpp b/pics/embedtool.cpp index 9d3a53a..9549bbb 100644 --- a/pics/embedtool.cpp +++ b/pics/embedtool.cpp @@ -23,12 +23,12 @@ /* Taken from nVIDIA KWin sources and modified by Sascha Hlusiak, 2006 */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include @@ -41,11 +41,11 @@ static int primes[] = { }; struct EmbedImage { - QString string; + TQString string; int width; int height; bool alpha; - QString name; + TQString name; }; class nVIDIAEmbedder { @@ -57,21 +57,21 @@ public: void writeIndex(); private: - QFile *file; - QPtrList *index; - QTextStream stream; + TQFile *file; + TQPtrList *index; + TQTextStream stream; }; nVIDIAEmbedder::nVIDIAEmbedder() { - QDateTime date( QDateTime::currentDateTime() ); - QString datestring( date.toString() ); + TQDateTime date( TQDateTime::tqcurrentDateTime() ); + TQString datestring( date.toString() ); -// file = new QFile( "tiles.h" ); - file = new QFile(); +// file = new TQFile( "tiles.h" ); + file = new TQFile(); file->open( IO_WriteOnly | IO_Truncate ,stdout); - stream.setDevice( file ); + stream.setDevice( TQT_TQIODEVICE(file) ); #if (0) stream << "/*\n"; @@ -80,12 +80,12 @@ nVIDIAEmbedder::nVIDIAEmbedder() 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 nVIDIA {\n\n"; #endif - index = new QPtrList; + index = new TQPtrList; index->setAutoDelete( true ); } @@ -104,24 +104,24 @@ nVIDIAEmbedder::~nVIDIAEmbedder() void nVIDIAEmbedder::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.tqreplace( TQRegExp("[^a-zA-Z0-9]"), "_" ); - stream << "static const QRgb " << codename << "_data[] = {" << endl << "\t"; - stream.setf( QTextStream::hex | QTextStream::right ); + stream << "static const TQRgb " << codename << "_data[] = {" << endl << "\t"; + stream.setf( TQTextStream::hex | TQTextStream::right ); stream.fill( '0' ); int pixels = image.width() * image.height(); - Q_UINT32 *data = reinterpret_cast( image.bits() ); + TQ_UINT32 *data = reinterpret_cast( image.bits() ); bool hasAlpha = false; for ( int i = 0, j = 0; i < pixels; i++ ) { - if ( qAlpha( *data ) && qAlpha( *data ) != 0xff ) + if ( tqAlpha( *data ) && tqAlpha( *data ) != 0xff ) hasAlpha = true; stream << "0x" << qSetW(8) << *(data++); @@ -157,7 +157,7 @@ void nVIDIAEmbedder::writeIndex() stream << "\t\tint width;\n"; stream << "\t\tint height;\n"; stream << "\t\tbool alpha;\n"; - stream << "\t\tconst QRgb *data;\n"; + stream << "\t\tconst TQRgb *data;\n"; stream << "\t};\n\n"; uint i = 0; @@ -183,14 +183,14 @@ void nVIDIAEmbedder::writeIndex() stream << "\tclass nVIDIAImageDb {\n"; stream << "\tprivate:\n"; stream << "\t\tstatic nVIDIAImageDb *m_inst;\n"; - stream << "\t\tQDict *db;\n\n"; + stream << "\t\tTQDict *db;\n\n"; stream << "\t\tnVIDIAImageDb() {\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\tTQImage *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"; @@ -208,8 +208,8 @@ void nVIDIAEmbedder::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\t\treturn db->find( name );\n"; + stream << "\t\tTQImage *image( const TQString &name ) const {\n"; + stream << "\t\t\treturn db->tqfind( name );\n"; stream << "\t\t}\n\n"; stream << "\t}; // class nVIDIAImageDb\n\n"; stream << "\tnVIDIAImageDb *nVIDIAImageDb::m_inst = NULL;\n\n";