diff options
120 files changed, 3910 insertions, 3910 deletions
diff --git a/kscreensaver/kdesavers/Euphoria.cpp b/kscreensaver/kdesavers/Euphoria.cpp index 740e957c..dacc60e5 100644 --- a/kscreensaver/kdesavers/Euphoria.cpp +++ b/kscreensaver/kdesavers/Euphoria.cpp @@ -28,7 +28,7 @@ #include <stdlib.h> #include <math.h> #include <time.h> -#include <qtimer.h> +#include <tqtimer.h> #include "Euphoria.h" #include "Euphoria.moc" #include "EuphoriaTexture.h" @@ -457,15 +457,15 @@ void wisp::drawAsBackground() //---------------------------------------------------------------------------- -EuphoriaWidget::EuphoriaWidget( QWidget* parent, const char* name ) - : QGLWidget(parent, name), texName(0), _wisps(0), _backwisps(0), +EuphoriaWidget::EuphoriaWidget( TQWidget* parent, const char* name ) + : TQGLWidget(parent, name), texName(0), _wisps(0), _backwisps(0), feedbackmap(0), feedbacktex(0) { setDefaults( Regular ); _frameTime = 1000 / 60; - _timer = new QTimer( this ); - connect( _timer, SIGNAL(timeout()), this, SLOT(nextFrame()) ); + _timer = new TQTimer( this ); + connect( _timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(nextFrame()) ); } @@ -636,7 +636,7 @@ void EuphoriaWidget::initializeGL() #ifdef UNIT_TEST -void EuphoriaWidget::keyPressEvent( QKeyEvent* e ) +void EuphoriaWidget::keyPressEvent( TQKeyEvent* e ) { if( e->key() == Qt::Key_0 ) { setDefaults( 0 ); updateParameters(); } if( e->key() == Qt::Key_1 ) { setDefaults( 1 ); updateParameters(); } @@ -905,7 +905,7 @@ extern "C" return new KEuphoriaScreenSaver( id ); } - KDE_EXPORT QDialog* kss_setup() + KDE_EXPORT TQDialog* kss_setup() { return new KEuphoriaSetup; } @@ -966,9 +966,9 @@ void KEuphoriaScreenSaver::setMode( int id ) //---------------------------------------------------------------------------- -#include <qlayout.h> -#include <qlabel.h> -#include <qcombobox.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqcombobox.h> #include <kmessagebox.h> @@ -988,22 +988,22 @@ static const char* defaultText[] = }; -KEuphoriaSetup::KEuphoriaSetup( QWidget* parent, const char* name ) +KEuphoriaSetup::KEuphoriaSetup( TQWidget* parent, const char* name ) : KDialogBase( parent, name, true, i18n("Setup Euphoria Screen Saver"), Ok|Cancel|Help, Ok, true ) { setButtonText( Help, i18n( "A&bout" ) ); - QWidget *main = makeMainWidget(); + TQWidget *main = makeMainWidget(); - QHBoxLayout* top = new QHBoxLayout(main, 0, spacingHint()); - QVBoxLayout* leftCol = new QVBoxLayout; + TQHBoxLayout* top = new TQHBoxLayout(main, 0, spacingHint()); + TQVBoxLayout* leftCol = new QVBoxLayout; top->addLayout( leftCol ); - QLabel* label = new QLabel( i18n("Mode:"), main ); + TQLabel* label = new TQLabel( i18n("Mode:"), main ); leftCol->addWidget( label ); - modeW = new QComboBox( main ); + modeW = new TQComboBox( main ); int i = 0; while (defaultText[i]) modeW->insertItem( i18n(defaultText[i++]) ); @@ -1012,8 +1012,8 @@ KEuphoriaSetup::KEuphoriaSetup( QWidget* parent, const char* name ) leftCol->addStretch(); // Preview - QWidget* preview; - preview = new QWidget( main ); + TQWidget* preview; + preview = new TQWidget( main ); preview->setFixedSize( 220, 170 ); preview->setBackgroundColor( black ); preview->show(); // otherwise saver does not get correct size @@ -1022,7 +1022,7 @@ KEuphoriaSetup::KEuphoriaSetup( QWidget* parent, const char* name ) // Now that we have _saver... modeW->setCurrentItem( _saver->mode() ); // set before we connect - connect( modeW, SIGNAL(activated(int)), _saver, SLOT(setMode(int)) ); + connect( modeW, TQT_SIGNAL(activated(int)), _saver, TQT_SLOT(setMode(int)) ); setMinimumSize( sizeHint() ); } @@ -1038,7 +1038,7 @@ void KEuphoriaSetup::slotHelp() { KMessageBox::about(this, i18n("<h3>Euphoria 1.0</h3>\n<p>Copyright (c) 2002 Terence M. Welsh<br>\n<a href=\"http://www.reallyslick.com/\">http://www.reallyslick.com/</a></p>\n\n<p>Ported to KDE by Karl Robillard</p>"), - QString::null, KMessageBox::AllowLink); + TQString::null, KMessageBox::AllowLink); } @@ -1050,7 +1050,7 @@ void KEuphoriaSetup::slotOk() KConfig* config = KGlobal::config(); config->setGroup("Settings"); - QString val; + TQString val; val.setNum( modeW->currentItem() ); config->writeEntry("Mode", val ); @@ -1065,11 +1065,11 @@ void KEuphoriaSetup::slotOk() // moc Euphoria.h -o Euphoria.moc // g++ -g -DUNIT_TEST Euphoria.cpp -I/usr/lib/qt3/include -lqt -L/usr/lib/qt3/lib -lGLU -lGL -#include <qapplication.h> +#include <tqapplication.h> int main( int argc, char** argv ) { - QApplication app( argc, argv ); + TQApplication app( argc, argv ); EuphoriaWidget w; w.setDefaults( EuphoriaWidget::UHFTEM ); diff --git a/kscreensaver/kdesavers/Euphoria.h b/kscreensaver/kdesavers/Euphoria.h index b7de2677..c2a8112a 100644 --- a/kscreensaver/kdesavers/Euphoria.h +++ b/kscreensaver/kdesavers/Euphoria.h @@ -10,7 +10,7 @@ //============================================================================ -#include <qgl.h> +#include <tqgl.h> #include <kdialogbase.h> @@ -37,7 +37,7 @@ public: DefaultModes }; - EuphoriaWidget( QWidget* parent=0, const char* name=0 ); + EuphoriaWidget( TQWidget* parent=0, const char* name=0 ); ~EuphoriaWidget(); void updateParameters(); @@ -49,7 +49,7 @@ protected: void resizeGL( int w, int h ); void initializeGL(); #ifdef UNIT_TEST - void keyPressEvent( QKeyEvent* ); + void keyPressEvent( TQKeyEvent* ); #endif private slots: @@ -93,10 +93,10 @@ private: int dPriority; - // Using QTimer rather than timerEvent() to avoid getting locked out of - // the QEvent loop on lower-end systems. Ian Geiser <[email protected]> + // Using TQTimer rather than timerEvent() to avoid getting locked out of + // the TQEvent loop on lower-end systems. Ian Geiser <[email protected]> // says this is the way to go. - QTimer* _timer; + TQTimer* _timer; int _frameTime; friend class wisp; @@ -104,7 +104,7 @@ private: #ifndef UNIT_TEST -#include <qdialog.h> +#include <tqdialog.h> #include <kscreensaver.h> @@ -139,7 +139,7 @@ class KEuphoriaSetup : public KDialogBase Q_OBJECT public: - KEuphoriaSetup( QWidget* parent = 0, const char* name = 0 ); + KEuphoriaSetup( TQWidget* parent = 0, const char* name = 0 ); ~KEuphoriaSetup(); private slots: @@ -147,7 +147,7 @@ private slots: void slotOk(); private: - QComboBox* modeW; + TQComboBox* modeW; KEuphoriaScreenSaver* _saver; }; #endif diff --git a/kscreensaver/kdesavers/Flux.cpp b/kscreensaver/kdesavers/Flux.cpp index 403c07b6..43cdd2a5 100644 --- a/kscreensaver/kdesavers/Flux.cpp +++ b/kscreensaver/kdesavers/Flux.cpp @@ -36,7 +36,7 @@ #include <stdlib.h> #include <math.h> #include <time.h> -#include <qtimer.h> +#include <tqtimer.h> #include "Flux.h" #include "Flux.moc" @@ -429,14 +429,14 @@ void flux::update() //---------------------------------------------------------------------------- -FluxWidget::FluxWidget( QWidget* parent, const char* name ) - : QGLWidget(parent, name), _fluxes(0) +FluxWidget::FluxWidget( TQWidget* parent, const char* name ) + : TQGLWidget(parent, name), _fluxes(0) { setDefaults( Regular ); _frameTime = 1000 / 60; - _timer = new QTimer( this ); - connect( _timer, SIGNAL(timeout()), this, SLOT(nextFrame()) ); + _timer = new TQTimer( this ); + connect( _timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(nextFrame()) ); } @@ -544,7 +544,7 @@ void FluxWidget::initializeGL() #ifdef UNIT_TEST -void FluxWidget::keyPressEvent( QKeyEvent* e ) +void FluxWidget::keyPressEvent( TQKeyEvent* e ) { if( e->key() == Qt::Key_0 ) { setDefaults( 0 ); updateParameters(); } if( e->key() == Qt::Key_1 ) { setDefaults( 1 ); updateParameters(); } @@ -789,7 +789,7 @@ extern "C" return new KFluxScreenSaver( id ); } - KDE_EXPORT QDialog* kss_setup() + KDE_EXPORT TQDialog* kss_setup() { return new KFluxSetup; } @@ -850,10 +850,10 @@ void KFluxScreenSaver::setMode( int id ) //---------------------------------------------------------------------------- -#include <qlayout.h> -#include <qpushbutton.h> -#include <qlabel.h> -#include <qcombobox.h> +#include <tqlayout.h> +#include <tqpushbutton.h> +#include <tqlabel.h> +#include <tqcombobox.h> #include <kbuttonbox.h> #include <kmessagebox.h> @@ -871,22 +871,22 @@ static const char* defaultText[] = }; -KFluxSetup::KFluxSetup( QWidget* parent, const char* name ) +KFluxSetup::KFluxSetup( TQWidget* parent, const char* name ) : KDialogBase( parent, name, true, i18n( "Setup Flux Screen Saver" ), Ok|Cancel|Help, Ok, true ) { setButtonText( Help, i18n( "A&bout" ) ); - QWidget *main = makeMainWidget(); + TQWidget *main = makeMainWidget(); - QHBoxLayout* top = new QHBoxLayout( main, 0, spacingHint() ); - QVBoxLayout* leftCol = new QVBoxLayout; + TQHBoxLayout* top = new TQHBoxLayout( main, 0, spacingHint() ); + TQVBoxLayout* leftCol = new QVBoxLayout; top->addLayout( leftCol ); // Parameters - QLabel* label = new QLabel( i18n("Mode:"), main ); + TQLabel* label = new TQLabel( i18n("Mode:"), main ); leftCol->addWidget( label ); - modeW = new QComboBox( main ); + modeW = new TQComboBox( main ); int i = 0; while (defaultText[i]) modeW->insertItem( i18n(defaultText[i++]) ); @@ -895,8 +895,8 @@ KFluxSetup::KFluxSetup( QWidget* parent, const char* name ) leftCol->addStretch(); // Preview - QWidget* preview; - preview = new QWidget( main ); + TQWidget* preview; + preview = new TQWidget( main ); preview->setFixedSize( 220, 165 ); preview->setBackgroundColor( black ); preview->show(); // otherwise saver does not get correct size @@ -905,7 +905,7 @@ KFluxSetup::KFluxSetup( QWidget* parent, const char* name ) // Now that we have _saver... modeW->setCurrentItem( _saver->mode() ); // set before we connect - connect( modeW, SIGNAL(activated(int)), _saver, SLOT(setMode(int)) ); + connect( modeW, TQT_SIGNAL(activated(int)), _saver, TQT_SLOT(setMode(int)) ); } @@ -919,7 +919,7 @@ void KFluxSetup::slotHelp() { KMessageBox::about(this, i18n("<h3>Flux 1.0</h3>\n<p>Copyright (c) 2002 Terence M. Welsh<br>\n<a href=\"http://www.reallyslick.com/\">http://www.reallyslick.com/</a></p>\n\n<p>Ported to KDE by Karl Robillard</p>"), - QString::null, KMessageBox::AllowLink); + TQString::null, KMessageBox::AllowLink); } @@ -931,7 +931,7 @@ void KFluxSetup::slotOk() KConfig* config = KGlobal::config(); config->setGroup("Settings"); - QString val; + TQString val; val.setNum( modeW->currentItem() ); config->writeEntry("Mode", val ); @@ -948,11 +948,11 @@ void KFluxSetup::slotOk() // moc Flux.h -o Flux.moc // g++ -g -DUNIT_TEST Flux.cpp -I/usr/lib/qt3/include -lqt -L/usr/lib/qt3/lib -lGLU -lGL -#include <qapplication.h> +#include <tqapplication.h> int main( int argc, char** argv ) { - QApplication app( argc, argv ); + TQApplication app( argc, argv ); FluxWidget w; w.setDefaults( FluxWidget::Sparklers ); diff --git a/kscreensaver/kdesavers/Flux.h b/kscreensaver/kdesavers/Flux.h index 7fe20172..638e9cd3 100644 --- a/kscreensaver/kdesavers/Flux.h +++ b/kscreensaver/kdesavers/Flux.h @@ -10,7 +10,7 @@ //============================================================================ -#include <qgl.h> +#include <tqgl.h> #define LIGHTSIZE 64 @@ -37,7 +37,7 @@ public: DefaultModes }; - FluxWidget( QWidget* parent=0, const char* name=0 ); + FluxWidget( TQWidget* parent=0, const char* name=0 ); ~FluxWidget(); void setDefaults( int which ); @@ -49,7 +49,7 @@ protected: void resizeGL( int w, int h ); void initializeGL(); #ifdef UNIT_TEST - void keyPressEvent( QKeyEvent* ); + void keyPressEvent( TQKeyEvent* ); #endif private slots: @@ -80,10 +80,10 @@ private: flux* _fluxes; - // Using QTimer rather than timerEvent() to avoid getting locked out of - // the QEvent loop on lower-end systems. Ian Geiser <[email protected]> + // Using TQTimer rather than timerEvent() to avoid getting locked out of + // the TQEvent loop on lower-end systems. Ian Geiser <[email protected]> // says this is the way to go. - QTimer* _timer; + TQTimer* _timer; int _frameTime; friend class flux; @@ -128,7 +128,7 @@ class KFluxSetup : public KDialogBase public: - KFluxSetup( QWidget* parent = 0, const char* name = 0 ); + KFluxSetup( TQWidget* parent = 0, const char* name = 0 ); ~KFluxSetup(); private slots: @@ -138,7 +138,7 @@ private slots: private: - QComboBox* modeW; + TQComboBox* modeW; KFluxScreenSaver* _saver; }; #endif diff --git a/kscreensaver/kdesavers/SolarWinds.cpp b/kscreensaver/kdesavers/SolarWinds.cpp index ee3743c0..7220f1d6 100644 --- a/kscreensaver/kdesavers/SolarWinds.cpp +++ b/kscreensaver/kdesavers/SolarWinds.cpp @@ -28,7 +28,7 @@ #include <math.h> #include <stdlib.h> #include <time.h> -#include <qtimer.h> +#include <tqtimer.h> #include "SolarWinds.h" #include "SolarWinds.moc" @@ -310,14 +310,14 @@ void wind::update() //---------------------------------------------------------------------------- -SWindsWidget::SWindsWidget( QWidget* parent, const char* name ) - : QGLWidget(parent, name), _winds(0) +SWindsWidget::SWindsWidget( TQWidget* parent, const char* name ) + : TQGLWidget(parent, name), _winds(0) { setDefaults( Regular ); _frameTime = 1000 / 60; - _timer = new QTimer( this ); - connect( _timer, SIGNAL(timeout()), this, SLOT(nextFrame()) ); + _timer = new TQTimer( this ); + connect( _timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(nextFrame()) ); } @@ -397,7 +397,7 @@ void SWindsWidget::initializeGL() #ifdef UNIT_TEST -void SWindsWidget::keyPressEvent( QKeyEvent* e ) +void SWindsWidget::keyPressEvent( TQKeyEvent* e ) { if( e->key() == Qt::Key_0 ) { setDefaults( 0 ); updateParameters(); } if( e->key() == Qt::Key_1 ) { setDefaults( 1 ); updateParameters(); } @@ -603,7 +603,7 @@ extern "C" return new KSWindsScreenSaver( id ); } - KDE_EXPORT QDialog* kss_setup() + KDE_EXPORT TQDialog* kss_setup() { return new KSWindsSetup; } @@ -664,9 +664,9 @@ void KSWindsScreenSaver::setMode( int id ) //---------------------------------------------------------------------------- -#include <qlayout.h> -#include <qlabel.h> -#include <qcombobox.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqcombobox.h> #include <kmessagebox.h> @@ -683,22 +683,22 @@ static const char* defaultText[] = }; -KSWindsSetup::KSWindsSetup( QWidget* parent, const char* name ) +KSWindsSetup::KSWindsSetup( TQWidget* parent, const char* name ) : KDialogBase( parent, name, true, i18n( "Setup Solar Wind" ), Ok|Cancel|Help, Ok, true ) { setButtonText( Help, i18n( "A&bout" ) ); - QWidget *main = makeMainWidget(); + TQWidget *main = makeMainWidget(); - QHBoxLayout* top = new QHBoxLayout( main, 0, spacingHint() ); + TQHBoxLayout* top = new TQHBoxLayout( main, 0, spacingHint() ); - QVBoxLayout* leftCol = new QVBoxLayout; + TQVBoxLayout* leftCol = new QVBoxLayout; top->addLayout( leftCol ); - QLabel* label = new QLabel( i18n("Mode:"), main ); + TQLabel* label = new TQLabel( i18n("Mode:"), main ); leftCol->addWidget( label ); - modeW = new QComboBox( main ); + modeW = new TQComboBox( main ); int i = 0; while (defaultText[i]) modeW->insertItem( i18n(defaultText[i++]) ); @@ -707,8 +707,8 @@ KSWindsSetup::KSWindsSetup( QWidget* parent, const char* name ) leftCol->addStretch(); // Preview - QWidget* preview; - preview = new QWidget( main ); + TQWidget* preview; + preview = new TQWidget( main ); preview->setFixedSize( 220, 165 ); preview->setBackgroundColor( black ); preview->show(); // otherwise saver does not get correct size @@ -717,7 +717,7 @@ KSWindsSetup::KSWindsSetup( QWidget* parent, const char* name ) // Now that we have _saver... modeW->setCurrentItem( _saver->mode() ); // set before we connect - connect( modeW, SIGNAL(activated(int)), _saver, SLOT(setMode(int)) ); + connect( modeW, TQT_SIGNAL(activated(int)), _saver, TQT_SLOT(setMode(int)) ); } @@ -731,7 +731,7 @@ void KSWindsSetup::slotHelp() { KMessageBox::about(this, i18n("<h3>Solar Winds 1.0</h3>\n<p>Copyright (c) 2002 Terence M. Welsh<br>\n<a href=\"http://www.reallyslick.com/\">http://www.reallyslick.com/</a></p>\n\n<p>Ported to KDE by Karl Robillard</p>"), - QString::null, KMessageBox::AllowLink); + TQString::null, KMessageBox::AllowLink); } @@ -743,7 +743,7 @@ void KSWindsSetup::slotOk() KConfig* config = KGlobal::config(); config->setGroup("Settings"); - QString val; + TQString val; val.setNum( modeW->currentItem() ); config->writeEntry("Mode", val ); @@ -760,11 +760,11 @@ void KSWindsSetup::slotOk() // moc SolarWinds.h -o SolarWinds.moc // g++ -g -DUNIT_TEST SolarWinds.cpp -I/usr/lib/qt3/include -lqt -L/usr/lib/qt3/lib -lGLU -lGL -#include <qapplication.h> +#include <tqapplication.h> int main( int argc, char** argv ) { - QApplication app( argc, argv ); + TQApplication app( argc, argv ); SWindsWidget w; app.setMainWidget( &w ); diff --git a/kscreensaver/kdesavers/SolarWinds.h b/kscreensaver/kdesavers/SolarWinds.h index 8831c015..a5646715 100644 --- a/kscreensaver/kdesavers/SolarWinds.h +++ b/kscreensaver/kdesavers/SolarWinds.h @@ -10,7 +10,7 @@ //============================================================================ -#include <qgl.h> +#include <tqgl.h> #define LIGHTSIZE 64 @@ -37,7 +37,7 @@ public: DefaultModes }; - SWindsWidget( QWidget* parent=0, const char* name=0 ); + SWindsWidget( TQWidget* parent=0, const char* name=0 ); ~SWindsWidget(); void updateParameters(); @@ -49,7 +49,7 @@ protected: void resizeGL( int w, int h ); void initializeGL(); #ifdef UNIT_TEST - void keyPressEvent( QKeyEvent* ); + void keyPressEvent( TQKeyEvent* ); #endif private slots: @@ -72,10 +72,10 @@ private: int dBlur; - // Using QTimer rather than timerEvent() to avoid getting locked out of - // the QEvent loop on lower-end systems. Ian Geiser <[email protected]> + // Using TQTimer rather than timerEvent() to avoid getting locked out of + // the TQEvent loop on lower-end systems. Ian Geiser <[email protected]> // says this is the way to go. - QTimer* _timer; + TQTimer* _timer; int _frameTime; friend class wind; @@ -119,7 +119,7 @@ class KSWindsSetup : public KDialogBase public: - KSWindsSetup( QWidget* parent = 0, const char* name = 0 ); + KSWindsSetup( TQWidget* parent = 0, const char* name = 0 ); ~KSWindsSetup(); private slots: @@ -129,7 +129,7 @@ private slots: private: - QComboBox* modeW; + TQComboBox* modeW; KSWindsScreenSaver* _saver; }; #endif diff --git a/kscreensaver/kdesavers/banner.cpp b/kscreensaver/kdesavers/banner.cpp index 5309c05a..e3322dc5 100644 --- a/kscreensaver/kdesavers/banner.cpp +++ b/kscreensaver/kdesavers/banner.cpp @@ -14,16 +14,16 @@ // 2003/09/06 Converted to use KDialogBase - Nadeem Hasan <[email protected]> #include <stdlib.h> -#include <qlabel.h> -#include <qlineedit.h> -#include <qcombobox.h> -#include <qcheckbox.h> -#include <qgroupbox.h> -#include <qslider.h> -#include <qlayout.h> -#include <qdatetime.h> -#include <qfontdatabase.h> -#include <qpainter.h> +#include <tqlabel.h> +#include <tqlineedit.h> +#include <tqcombobox.h> +#include <tqcheckbox.h> +#include <tqgroupbox.h> +#include <tqslider.h> +#include <tqlayout.h> +#include <tqdatetime.h> +#include <tqfontdatabase.h> +#include <tqpainter.h> #include <kapplication.h> #include <krandomsequence.h> @@ -49,7 +49,7 @@ extern "C" return new KBannerSaver( id ); } - KDE_EXPORT QDialog *kss_setup() + KDE_EXPORT TQDialog *kss_setup() { return new KBannerSetup(); } @@ -57,71 +57,71 @@ extern "C" //----------------------------------------------------------------------------- -KBannerSetup::KBannerSetup( QWidget *parent, const char *name ) +KBannerSetup::KBannerSetup( TQWidget *parent, const char *name ) : KDialogBase( parent, name, true, i18n( "Setup Banner Screen Saver" ), Ok|Cancel|Help, Ok, true ), saver( 0 ), ed(0), speed( 50 ) { setButtonText( Help, i18n( "A&bout" ) ); readSettings(); - QWidget *main = makeMainWidget(); + TQWidget *main = makeMainWidget(); - QLabel *label; + TQLabel *label; - QVBoxLayout *tl = new QVBoxLayout(main, 0, spacingHint()); - QHBoxLayout *tl1 = new QHBoxLayout( 0, 0, spacingHint() ); + TQVBoxLayout *tl = new TQVBoxLayout(main, 0, spacingHint()); + TQHBoxLayout *tl1 = new TQHBoxLayout( 0, 0, spacingHint() ); tl->addLayout(tl1); - QVBoxLayout *tl11 = new QVBoxLayout( 0, 0, spacingHint() ); + TQVBoxLayout *tl11 = new TQVBoxLayout( 0, 0, spacingHint() ); tl1->addLayout(tl11); - QGroupBox *group = new QGroupBox( 0, Vertical, i18n("Font"), main ); - QGridLayout *gl = new QGridLayout(group->layout(), 6, 2, spacingHint() ); + TQGroupBox *group = new TQGroupBox( 0, Vertical, i18n("Font"), main ); + TQGridLayout *gl = new TQGridLayout(group->layout(), 6, 2, spacingHint() ); - label = new QLabel( i18n("Family:"), group ); + label = new TQLabel( i18n("Family:"), group ); gl->addWidget(label, 1, 0); - KFontCombo* comboFonts = new KFontCombo( QFontDatabase().families(), group ); + KFontCombo* comboFonts = new KFontCombo( TQFontDatabase().families(), group ); comboFonts->setCurrentFont( fontFamily ); gl->addWidget(comboFonts, 1, 1); - connect( comboFonts, SIGNAL( activated( const QString& ) ), - SLOT( slotFamily( const QString& ) ) ); + connect( comboFonts, TQT_SIGNAL( activated( const TQString& ) ), + TQT_SLOT( slotFamily( const TQString& ) ) ); - label = new QLabel( i18n("Size:"), group ); + label = new TQLabel( i18n("Size:"), group ); gl->addWidget(label, 2, 0); - comboSizes = new QComboBox( TRUE, group ); + comboSizes = new TQComboBox( TRUE, group ); fillFontSizes(); gl->addWidget(comboSizes, 2, 1); - connect( comboSizes, SIGNAL( activated( int ) ), SLOT( slotSize( int ) ) ); - connect( comboSizes, SIGNAL( textChanged( const QString & ) ), - SLOT( slotSizeEdit( const QString & ) ) ); + connect( comboSizes, TQT_SIGNAL( activated( int ) ), TQT_SLOT( slotSize( int ) ) ); + connect( comboSizes, TQT_SIGNAL( textChanged( const TQString & ) ), + TQT_SLOT( slotSizeEdit( const TQString & ) ) ); - QCheckBox *cb = new QCheckBox( i18n("Bold"), + TQCheckBox *cb = new TQCheckBox( i18n("Bold"), group ); cb->setChecked( bold ); - connect( cb, SIGNAL( toggled( bool ) ), SLOT( slotBold( bool ) ) ); + connect( cb, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( slotBold( bool ) ) ); gl->addWidget(cb, 3, 0); - cb = new QCheckBox( i18n("Italic"), group ); + cb = new TQCheckBox( i18n("Italic"), group ); cb->setChecked( italic ); gl->addWidget(cb, 3, 1); - connect( cb, SIGNAL( toggled( bool ) ), SLOT( slotItalic( bool ) ) ); + connect( cb, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( slotItalic( bool ) ) ); - label = new QLabel( i18n("Color:"), group ); + label = new TQLabel( i18n("Color:"), group ); gl->addWidget(label, 4, 0); colorPush = new KColorButton( fontColor, group ); gl->addWidget(colorPush, 4, 1); - connect( colorPush, SIGNAL( changed(const QColor &) ), - SLOT( slotColor(const QColor &) ) ); + connect( colorPush, TQT_SIGNAL( changed(const TQColor &) ), + TQT_SLOT( slotColor(const TQColor &) ) ); - QCheckBox *cyclingColorCb=new QCheckBox(i18n("Cycling color"),group); + TQCheckBox *cyclingColorCb=new TQCheckBox(i18n("Cycling color"),group); cyclingColorCb->setMinimumSize(cyclingColorCb->sizeHint()); gl->addMultiCellWidget(cyclingColorCb,5,5,0,1); - connect(cyclingColorCb,SIGNAL(toggled(bool)),this,SLOT(slotCyclingColor(bool))); + connect(cyclingColorCb,TQT_SIGNAL(toggled(bool)),this,TQT_SLOT(slotCyclingColor(bool))); cyclingColorCb->setChecked(cyclingColor); - preview = new QWidget( main ); + preview = new TQWidget( main ); preview->setFixedSize( 220, 170 ); preview->setBackgroundColor( black ); preview->show(); // otherwise saver does not get correct size @@ -130,34 +130,34 @@ KBannerSetup::KBannerSetup( QWidget *parent, const char *name ) tl11->addWidget(group); - label = new QLabel( i18n("Speed:"), main ); + label = new TQLabel( i18n("Speed:"), main ); tl11->addStretch(1); tl11->addWidget(label); - QSlider *sb = new QSlider(0, 100, 10, speed, QSlider::Horizontal, main ); + TQSlider *sb = new TQSlider(0, 100, 10, speed, TQSlider::Horizontal, main ); sb->setMinimumWidth( 180); sb->setFixedHeight(20); - sb->setTickmarks(QSlider::Below); + sb->setTickmarks(TQSlider::Below); sb->setTickInterval(10); tl11->addWidget(sb); - connect( sb, SIGNAL( valueChanged( int ) ), SLOT( slotSpeed( int ) ) ); + connect( sb, TQT_SIGNAL( valueChanged( int ) ), TQT_SLOT( slotSpeed( int ) ) ); - QHBoxLayout *tl2 = new QHBoxLayout; + TQHBoxLayout *tl2 = new QHBoxLayout; tl->addLayout(tl2); - label = new QLabel( i18n("Message:"), main ); + label = new TQLabel( i18n("Message:"), main ); tl2->addWidget(label); - ed = new QLineEdit( main ); + ed = new TQLineEdit( main ); tl2->addWidget(ed); ed->setText( message ); - connect( ed, SIGNAL( textChanged( const QString & ) ), - SLOT( slotMessage( const QString & ) ) ); + connect( ed, TQT_SIGNAL( textChanged( const TQString & ) ), + TQT_SLOT( slotMessage( const TQString & ) ) ); - QCheckBox *timeCb=new QCheckBox( i18n("Show current time"), main); + TQCheckBox *timeCb=new TQCheckBox( i18n("Show current time"), main); timeCb->setFixedSize(timeCb->sizeHint()); tl->addWidget(timeCb,0,Qt::AlignLeft); - connect(timeCb,SIGNAL(toggled(bool)),this,SLOT(slotTimeToggled(bool))); + connect(timeCb,TQT_SIGNAL(toggled(bool)),this,TQT_SLOT(slotTimeToggled(bool))); timeCb->setChecked(showTime); tl->addStretch(); @@ -177,7 +177,7 @@ void KBannerSetup::readSettings() message=config->readEntry("Message","KDE"); showTime=config->readBoolEntry("ShowTime",FALSE); - fontFamily=config->readEntry("FontFamily",(QApplication::font()).family()); + fontFamily=config->readEntry("FontFamily",(TQApplication::font()).family()); fontSize=config->readNumEntry("FontSize",48); fontColor.setNamedColor(config->readEntry("FontColor","red")); cyclingColor=config->readBoolEntry("CyclingColor",FALSE); @@ -191,12 +191,12 @@ void KBannerSetup::fillFontSizes() comboSizes->blockSignals( true ); comboSizes->clear(); int i = 0; - sizes = QFontDatabase().pointSizes( fontFamily ); + sizes = TQFontDatabase().pointSizes( fontFamily ); sizes << 96 << 128 << 156 << 0; int current = 0; while ( sizes[i] ) { - QString num; + TQString num; num.setNum( sizes[i] ); comboSizes->insertItem( num, i ); if ( fontSize == sizes[i] ) // fontsize equals one of the defined ones @@ -209,7 +209,7 @@ void KBannerSetup::fillFontSizes() } if ( current == 0 ) // fontsize seems to be entered by hand { - QString fsize; + TQString fsize; fsize.setNum( fontSize ); comboSizes->setEditText(fsize); slotSizeEdit( fsize ); @@ -217,7 +217,7 @@ void KBannerSetup::fillFontSizes() comboSizes->blockSignals( block ); } -void KBannerSetup::slotFamily( const QString& fam ) +void KBannerSetup::slotFamily( const TQString& fam ) { fontFamily = fam; fillFontSizes(); // different font, different sizes @@ -232,7 +232,7 @@ void KBannerSetup::slotSize( int indx ) saver->setFont( fontFamily, fontSize, fontColor, bold, italic ); } -void KBannerSetup::slotSizeEdit( const QString& fs ) +void KBannerSetup::slotSizeEdit( const TQString& fs ) { bool ok; fontSize = fs.toInt( &ok, 10 ); @@ -241,7 +241,7 @@ void KBannerSetup::slotSizeEdit( const QString& fs ) saver->setFont( fontFamily, fontSize, fontColor, bold, italic ); } -void KBannerSetup::slotColor( const QColor &col ) +void KBannerSetup::slotColor( const TQColor &col ) { fontColor = col; if ( saver ) @@ -282,7 +282,7 @@ void KBannerSetup::slotSpeed( int num ) saver->setSpeed( speed ); } -void KBannerSetup::slotMessage( const QString &msg ) +void KBannerSetup::slotMessage( const TQString &msg ) { message = msg; if ( saver ) @@ -316,7 +316,7 @@ void KBannerSetup::slotOk() config->writeEntry( "ShowTime", showTime ); config->writeEntry( "FontFamily", fontFamily ); - QString fsize; + TQString fsize; if (fontSize == 0) // an non-number was entered in the font size combo { fontSize = 48; @@ -324,7 +324,7 @@ void KBannerSetup::slotOk() fsize.setNum( fontSize ); config->writeEntry( "FontSize", fsize ); - QString colName; + TQString colName; colName.sprintf( "#%02x%02x%02x", fontColor.red(), fontColor.green(), fontColor.blue() ); config->writeEntry( "FontColor", colName ); @@ -350,17 +350,17 @@ KBannerSaver::KBannerSaver( WId id ) : KScreenSaver( id ) krnd = new KRandomSequence(); readSettings(); initialize(); - colorContext = QColor::enterAllocContext(); + colorContext = TQColor::enterAllocContext(); needBlank = TRUE; timer.start( speed ); - connect( &timer, SIGNAL( timeout() ), SLOT( slotTimeout() ) ); + connect( &timer, TQT_SIGNAL( timeout() ), TQT_SLOT( slotTimeout() ) ); } KBannerSaver::~KBannerSaver() { timer.stop(); - QColor::leaveAllocContext(); - QColor::destroyAllocContext( colorContext ); + TQColor::leaveAllocContext(); + TQColor::destroyAllocContext( colorContext ); delete krnd; } @@ -372,7 +372,7 @@ void KBannerSaver::setSpeed( int spd ) timer.start( speed ); } -void KBannerSaver::setFont( const QString& family, int size, const QColor &color, +void KBannerSaver::setFont( const TQString& family, int size, const TQColor &color, bool b, bool i ) { fontFamily = family; @@ -384,7 +384,7 @@ void KBannerSaver::setFont( const QString& family, int size, const QColor &color initialize(); } -void KBannerSaver::setColor(QColor &color) +void KBannerSaver::setColor(TQColor &color) { fontColor = color; cyclingColor = FALSE; @@ -397,18 +397,18 @@ void KBannerSaver::setCyclingColor( bool on ) needUpdate = TRUE; } -void KBannerSaver::setMessage( const QString &msg ) +void KBannerSaver::setMessage( const TQString &msg ) { showTime = FALSE; message = msg; - pixmapSize = QSize(); + pixmapSize = TQSize(); needBlank = TRUE; } void KBannerSaver::setTimeDisplay() { showTime = TRUE; - pixmapSize = QSize(); + pixmapSize = TQSize(); needBlank = TRUE; } @@ -424,7 +424,7 @@ void KBannerSaver::readSettings() showTime=config->readBoolEntry("ShowTime",FALSE); - fontFamily=config->readEntry("FontFamily",(QApplication::font()).family()); + fontFamily=config->readEntry("FontFamily",(TQApplication::font()).family()); fontSize=config->readNumEntry("FontSize",48); @@ -445,16 +445,16 @@ void KBannerSaver::readSettings() // initialize font void KBannerSaver::initialize() { - fsize = fontSize * height() / QApplication::desktop()->height(); + fsize = fontSize * height() / TQApplication::desktop()->height(); - font = QFont( fontFamily, fsize, bold ? QFont::Bold : QFont::Normal, italic ); + font = TQFont( fontFamily, fsize, bold ? TQFont::Bold : TQFont::Normal, italic ); - pixmapSize = QSize(); + pixmapSize = TQSize(); needBlank = TRUE; xpos = width(); ypos = fsize + (int) ((double)(height()-fsize)*krnd->getDouble()); - step = 2 * width() / QApplication::desktop()->width(); // 6 -> 2 -hhjb- + step = 2 * width() / TQApplication::desktop()->width(); // 6 -> 2 -hhjb- if ( step == 0 ) step = 1; } @@ -470,22 +470,22 @@ void KBannerSaver::slotTimeout() } if (showTime) { - QString new_message = KGlobal::locale()->formatTime(QTime::currentTime(), true); + TQString new_message = KGlobal::locale()->formatTime(TQTime::currentTime(), true); if( new_message != message ) needUpdate = TRUE; message = new_message; } if ( !pixmapSize.isValid() || cyclingColor || needUpdate || needBlank ) { - QRect rect = QFontMetrics( font ).boundingRect( message ); + TQRect rect = TQFontMetrics( font ).boundingRect( message ); rect.setWidth( rect.width() + step ); if ( rect.width() > pixmapSize.width() ) pixmapSize.setWidth( rect.width() ); if ( rect.height() > pixmapSize.height() ) pixmapSize.setHeight( rect.height() ); - pixmap = QPixmap( pixmapSize ); + pixmap = TQPixmap( pixmapSize ); pixmap.fill( black ); - QPainter p( &pixmap ); + TQPainter p( &pixmap ); p.setFont( font ); p.setPen( fontColor ); p.drawText( -rect.x(), -rect.y(), message ); @@ -493,7 +493,7 @@ void KBannerSaver::slotTimeout() } xpos -= step; if ( xpos < -pixmapSize.width() ) { - QPainter p( this ); + TQPainter p( this ); p.fillRect( xpos + step, ypos, pixmapSize.width(), pixmapSize.height(), black ); xpos = width(); ypos = fsize + (int) ((double)(height()-2.0*fsize)*krnd->getDouble()); diff --git a/kscreensaver/kdesavers/banner.h b/kscreensaver/kdesavers/banner.h index 026b817d..1c1c57db 100644 --- a/kscreensaver/kdesavers/banner.h +++ b/kscreensaver/kdesavers/banner.h @@ -8,7 +8,7 @@ #ifndef __BANNER_H__ #define __BANNER_H__ -#include <qtimer.h> +#include <tqtimer.h> #include <kscreensaver.h> #include <kdialogbase.h> @@ -28,12 +28,12 @@ public: virtual ~KBannerSaver(); void setSpeed( int spd ); - void setFont( const QString &family, int size, const QColor &color, + void setFont( const TQString &family, int size, const TQColor &color, bool b, bool i ); - void setMessage( const QString &msg ); + void setMessage( const TQString &msg ); void setTimeDisplay(); void setCyclingColor(bool on); - void setColor( QColor &color); + void setColor( TQColor &color); private: void readSettings(); @@ -43,7 +43,7 @@ protected slots: void slotTimeout(); protected: - QFont font; + TQFont font; QTimer timer; QString fontFamily; int fontSize; @@ -69,43 +69,43 @@ class KBannerSetup : public KDialogBase { Q_OBJECT public: - KBannerSetup( QWidget *parent = NULL, const char *name = NULL ); + KBannerSetup( TQWidget *parent = NULL, const char *name = NULL ); protected: void readSettings(); void fillFontSizes(); private slots: - void slotFamily( const QString & ); + void slotFamily( const TQString & ); void slotSize( int ); - void slotSizeEdit(const QString &); - void slotColor(const QColor &); + void slotSizeEdit(const TQString &); + void slotColor(const TQColor &); void slotCyclingColor(bool on); void slotBold( bool ); void slotItalic( bool ); void slotSpeed( int ); - void slotMessage( const QString & ); + void slotMessage( const TQString & ); void slotOk(); void slotHelp(); void slotTimeToggled(bool on); private: - QWidget *preview; + TQWidget *preview; KColorButton *colorPush; KBannerSaver *saver; - QLineEdit *ed; - QComboBox* comboSizes; + TQLineEdit *ed; + TQComboBox* comboSizes; - QString message; + TQString message; bool showTime; - QString fontFamily; + TQString fontFamily; int fontSize; - QColor fontColor; + TQColor fontColor; bool cyclingColor; bool bold; bool italic; int speed; - QValueList<int> sizes; + TQValueList<int> sizes; }; #endif diff --git a/kscreensaver/kdesavers/blob.cpp b/kscreensaver/kdesavers/blob.cpp index e717c7ee..f258c149 100644 --- a/kscreensaver/kdesavers/blob.cpp +++ b/kscreensaver/kdesavers/blob.cpp @@ -22,13 +22,13 @@ #include <limits.h> #include <math.h> -#include <qcolor.h> -#include <qlabel.h> -#include <qlistbox.h> -#include <qlayout.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qimage.h> +#include <tqcolor.h> +#include <tqlabel.h> +#include <tqlistbox.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqimage.h> #include <kapplication.h> #include <kconfig.h> @@ -56,7 +56,7 @@ extern "C" return new KBlobSaver( id ); } - KDE_EXPORT QDialog *kss_setup() + KDE_EXPORT TQDialog *kss_setup() { return new KBlobSetup(); } @@ -64,7 +64,7 @@ extern "C" static KRandomSequence *rnd = 0; -QString alg_str[5]; +TQString alg_str[5]; void initAlg() { alg_str[0] = i18n("Random Linear"); @@ -82,26 +82,26 @@ KBlobSaver::KBlobSaver ( WId id) { rnd = new KRandomSequence(); initAlg(); - QColor color; + TQColor color; float ramp = (256.0-64.0)/(float)RAMP; - QString msg = + TQString msg = i18n("This screen saver requires a color display."); blank(); // needs colors to work this one - if (QPixmap::defaultDepth() < 8) + if (TQPixmap::defaultDepth() < 8) { - QPainter p(this); + TQPainter p(this); p.setPen( white ); p.drawText( width()/2, height()/2, msg ); return; } - colorContext = QColor::enterAllocContext(); + colorContext = TQColor::enterAllocContext(); // if 8-bit, create lookup table for color ramping further down - if (QPixmap::defaultDepth() == 8) + if (TQPixmap::defaultDepth() == 8) { memset(lookup, 0, 256*sizeof(uint)); int i; @@ -120,14 +120,14 @@ KBlobSaver::KBlobSaver ( WId id) // make special provision for preview mode if (height() < 400) { - if (QPixmap::defaultDepth() > 8 ) + if (TQPixmap::defaultDepth() > 8 ) setColorInc(7); else setColorInc(4); } else { - if (QPixmap::defaultDepth() > 8 ) + if (TQPixmap::defaultDepth() > 8 ) setColorInc(3); else setColorInc(2); @@ -169,15 +169,15 @@ KBlobSaver::KBlobSaver ( WId id) // start timer which will update blob painter timer.start(SPEED); - connect(&timer, SIGNAL(timeout()), SLOT(slotTimeout())); + connect(&timer, TQT_SIGNAL(timeout()), TQT_SLOT(slotTimeout())); } KBlobSaver::~KBlobSaver() { timer.stop(); - QColor::leaveAllocContext(); - QColor::destroyAllocContext(colorContext); + TQColor::leaveAllocContext(); + TQColor::destroyAllocContext(colorContext); delete rnd; rnd = 0; } @@ -369,7 +369,7 @@ void KBlobSaver::box ( int x, int y ) y = 0; // get the box region from the display to upgrade - QImage img = QPixmap::grabWindow(winId(), x, y, dim, dim).convertToImage(); + TQImage img = TQPixmap::grabWindow(winId(), x, y, dim, dim).convertToImage(); // depending on the depth of the display, use either lookup table for // next rgb val ( 8-bit ) or ramp the color directly for other displays @@ -400,7 +400,7 @@ void KBlobSaver::box ( int x, int y ) } // put the image back onto the screen - QPainter p(this); + TQPainter p(this); p.drawImage( x, y, img ); } @@ -432,7 +432,7 @@ void KBlobSaver::readSettings() // KBlobSetup::KBlobSetup ( - QWidget *parent, + TQWidget *parent, const char *name ) : KDialogBase( parent, name, true, i18n( "Setup Blob Screen Saver" ), @@ -445,23 +445,23 @@ KBlobSetup::KBlobSetup readSettings(); setButtonText( Help, i18n( "A&bout" ) ); - QWidget *main = makeMainWidget(); + TQWidget *main = makeMainWidget(); - QHBoxLayout *tl = new QHBoxLayout( main, 0, spacingHint() ); + TQHBoxLayout *tl = new TQHBoxLayout( main, 0, spacingHint() ); - QVBoxLayout *vbox = new QVBoxLayout; + TQVBoxLayout *vbox = new QVBoxLayout; tl->addLayout(vbox); // seconds to generate on a frame - QLabel *label = new QLabel(i18n("Frame duration:"), main); + TQLabel *label = new TQLabel(i18n("Frame duration:"), main); stime = new KIntNumInput( showtime, main ); stime->setSuffix( i18n( " sec" ) ); vbox->addWidget(label); vbox->addWidget(stime); // available algorithms - label = new QLabel(i18n("Algorithm:"), main); - algs = new QListBox(main); + label = new TQLabel(i18n("Algorithm:"), main); + algs = new TQListBox(main); algs->setMinimumSize(150, 105); for (int i = 0; i <= ALG_RANDOM; i++) algs->insertItem(alg_str[i]); @@ -470,14 +470,14 @@ KBlobSetup::KBlobSetup vbox->addWidget(algs); // preview window - QWidget *preview = new QWidget( main ); + TQWidget *preview = new TQWidget( main ); preview->setFixedSize(220, 170); preview->setBackgroundColor(black); preview->show(); tl->addWidget(preview); saver = new KBlobSaver(preview->winId()); saver->setDimension(3); - if (QPixmap::defaultDepth() > 8) + if (TQPixmap::defaultDepth() > 8) saver->setColorInc(7); else saver->setColorInc(4); @@ -485,8 +485,8 @@ KBlobSetup::KBlobSetup tl->addStretch(); // so selecting an algorithm will start previewing that alg - connect(algs, SIGNAL(highlighted(int)), saver, - SLOT(setAlgorithm(int))); + connect(algs, TQT_SIGNAL(highlighted(int)), saver, + TQT_SLOT(setAlgorithm(int))); } void KBlobSetup::readSettings() diff --git a/kscreensaver/kdesavers/blob.h b/kscreensaver/kdesavers/blob.h index 93a02998..290f7fbc 100644 --- a/kscreensaver/kdesavers/blob.h +++ b/kscreensaver/kdesavers/blob.h @@ -8,8 +8,8 @@ #ifndef __BLOB_H__ #define __BLOB_H__ -#include <qtimer.h> -#include <qptrlist.h> +#include <tqtimer.h> +#include <tqptrlist.h> #include <kdialogbase.h> #include <kscreensaver.h> @@ -47,7 +47,7 @@ public: typedef void (KBlobSaver::*AlgFunc)(); struct KBSAlg { - QString Name; + TQString Name; AlgFunc Init; AlgFunc NextFrame; }; @@ -96,11 +96,11 @@ class KBlobSetup : public KDialogBase int showtime; int alg; - QListBox *algs; + TQListBox *algs; KIntNumInput *stime; public: - KBlobSetup( QWidget *parent = NULL, const char *name = NULL ); + KBlobSetup( TQWidget *parent = NULL, const char *name = NULL ); protected: void readSettings(); diff --git a/kscreensaver/kdesavers/firesaver.cpp b/kscreensaver/kdesavers/firesaver.cpp index fff07dde..c8b605fc 100644 --- a/kscreensaver/kdesavers/firesaver.cpp +++ b/kscreensaver/kdesavers/firesaver.cpp @@ -69,7 +69,7 @@ class KFireSaverKSS : public KScreenSaver class KFireSaverSetupKDB : public KDialogBase { public: - KFireSaverSetupKDB( QWidget* parent = 0, const char* name = 0 ) + KFireSaverSetupKDB( TQWidget* parent = 0, const char* name = 0 ) : KDialogBase( parent, name, true, i18n("Setup Screen Saver"), Ok | Cancel | Help, Ok, true ) { @@ -104,7 +104,7 @@ extern "C" return new KFireSaverKSS( id ); } - KDE_EXPORT QDialog *kss_setup() + KDE_EXPORT TQDialog *kss_setup() { return new KFireSaverSetupKDB; } @@ -114,8 +114,8 @@ extern "C" \* Factory code for KScreensaver ends *here* */ -KFireSaver :: KFireSaver( QWidget *parent, const char *name ) - : QGLWidget( parent, name ) +KFireSaver :: KFireSaver( TQWidget *parent, const char *name ) + : TQGLWidget( parent, name ) { // set random seed to initialize drand48() calls timeval tv; @@ -518,7 +518,7 @@ void KFireSaver :: paintGL () { int chance = (int) (1000.0 * DRAND); if ( !chance ) { - static const QString someStrings[] = { + static const TQString someStrings[] = { i18n("www.kde.org"), i18n("My KDE, please!"), i18n("KoNqUeR the World"), @@ -801,7 +801,7 @@ void KFireSaver :: explodeFirework(Particle* leaderParticle) } } -void KFireSaver :: timerEvent(QTimerEvent*) +void KFireSaver :: timerEvent(TQTimerEvent*) { timeval tv; gettimeofday(&tv,NULL); @@ -888,7 +888,7 @@ void KFireSaver :: timerEvent(QTimerEvent*) updateGL(); } -void KFireSaver :: burnLogo(QImage * image) +void KFireSaver :: burnLogo(TQImage * image) { if (!image || image->isNull()) return; @@ -935,7 +935,7 @@ void KFireSaver :: burnLogo(QImage * image) playSound(sound_debris); } -void KFireSaver :: playSound(QString file) +void KFireSaver :: playSound(TQString file) { //flush inactive players KPlayObject * playObject = playObjectList.first(); @@ -954,7 +954,7 @@ void KFireSaver :: playSound(QString file) return; // not needed when all of the files are in the distribution - //if (!QFile::exists(file)) + //if (!TQFile::exists(file)) //return; KPlayObjectFactory factory(artsServer.server()); @@ -967,18 +967,18 @@ void KFireSaver :: playSound(QString file) } } -bool KFireSaver :: loadTexture( QString fileName, unsigned int & textureID ) +bool KFireSaver :: loadTexture( TQString fileName, unsigned int & textureID ) { //reset texture ID to the default EMPTY value textureID = 0; //load image - QImage tmp; + TQImage tmp; if ( !tmp.load( fileName ) ) return false; //convert it to suitable format (flipped RGBA) - QImage texture = QGLWidget::convertToGLFormat( tmp ); + TQImage texture = TQGLWidget::convertToGLFormat( tmp ); if ( texture.isNull() ) return false; @@ -1019,7 +1019,7 @@ void KFireSaver :: readConfig () parameters.particleSize = 5; if ( parameters.enableBottomFire = config.readBoolEntry( "enable-BottomFire", true ) ) { - QColor blue = Qt::darkBlue; + TQColor blue = Qt::darkBlue; parameters.bottomFireColor = config.readColorEntry( "BottomFireColor", &blue ); } parameters.enableSound = config.readBoolEntry( "enable-Sounds", false ); @@ -1083,21 +1083,21 @@ void KFireSaver :: readConfig () config.setGroup( "Specials" ); if ( parameters.enableLogos = config.readBoolEntry( "enable-Logos", true ) ) { - QImage tempImage; + TQImage tempImage; tempImage.setAlphaBuffer( true ); if ( config.readBoolEntry( "LogosTux", true ) ) if ( tempImage.load(locate("data","kfiresaver/kfs_tux.png")) ) - imageList.append( new QImage(tempImage) ); + imageList.append( new TQImage(tempImage) ); if ( config.readBoolEntry( "LogosKonqui", true ) ) if ( tempImage.load(locate("data","kfiresaver/kfs_kde.png")) ) - imageList.append( new QImage(tempImage) ); + imageList.append( new TQImage(tempImage) ); if ( config.readBoolEntry( "LogosKDEIcons", true ) ) { - const QString icons[] = { + const TQString icons[] = { "3floppy_unmount", "cdrom_unmount", "hdd_mount", "kmix", "network", "my-computer", "folder_home", "konqueror", "kmail", "penguin", "personal" }; for ( int i = 0; i < 11; i++ ) - imageList.append( new QImage(DesktopIcon(icons[i],64).convertToImage()) ); + imageList.append( new TQImage(DesktopIcon(icons[i],64).convertToImage()) ); } parameters.enableReduceLogo = config.readBoolEntry( "LogosReduceDetail", true ); parameters.logoFrequency = 11 - config.readNumEntry( "LogosFrequency", 4 ); diff --git a/kscreensaver/kdesavers/firesaver.h b/kscreensaver/kdesavers/firesaver.h index 3757b64b..dfc713b0 100644 --- a/kscreensaver/kdesavers/firesaver.h +++ b/kscreensaver/kdesavers/firesaver.h @@ -30,11 +30,11 @@ #define FIELDW_2 (FIELDWIDTH/2.0) #define FIELDW_4 (FIELDWIDTH/4.0) -#include <qgl.h> -#include <qptrlist.h> -#include <qimage.h> -#include <qstring.h> -#include <qcolor.h> +#include <tqgl.h> +#include <tqptrlist.h> +#include <tqimage.h> +#include <tqstring.h> +#include <tqcolor.h> #include <arts/kplayobject.h> #include <arts/kartsserver.h> @@ -46,14 +46,14 @@ class Writer; class KFireSaver : public QGLWidget { public: - KFireSaver( QWidget *parent=0, const char *name=0 ); + KFireSaver( TQWidget *parent=0, const char *name=0 ); ~KFireSaver(); protected: void initializeGL(); void resizeGL( int, int ); void paintGL(); - void timerEvent( class QTimerEvent * ); + void timerEvent( class TQTimerEvent * ); private: enum enumFireworkType @@ -72,19 +72,19 @@ class KFireSaver : public QGLWidget inline enumFireworkType pickType(); inline int pickColour(); void explodeFirework(Particle* fireWorkLeaderParticle); - void burnLogo(QImage * image); - void playSound(QString file); - bool loadTexture(QString file, unsigned int & textureID); + void burnLogo(TQImage * image); + void playSound(TQString file); + bool loadTexture(TQString file, unsigned int & textureID); void freeTexture(unsigned int & textureID); void readConfig(); //list of particles and stars - QPtrList<Particle> + TQPtrList<Particle> particleList, starList; //stuff for 'exploding' pixmaps (kde, tux, icons..) - QPtrList<QImage> + TQPtrList<TQImage> imageList; //texture stuff @@ -98,7 +98,7 @@ class KFireSaver : public QGLWidget //sound stuff KArtsDispatcher artsDispatcher; KArtsServer artsServer; - QPtrList<KPlayObject> playObjectList; + TQPtrList<KPlayObject> playObjectList; QString sound_explosion, sound_debris; diff --git a/kscreensaver/kdesavers/firesaverparticle.h b/kscreensaver/kdesavers/firesaverparticle.h index de8d9ac2..e539adec 100644 --- a/kscreensaver/kdesavers/firesaverparticle.h +++ b/kscreensaver/kdesavers/firesaverparticle.h @@ -21,7 +21,7 @@ #ifndef KFIRESAVER_PARTICLE_H #define KFIRESAVER_PARTICLE_H -#include <qgl.h> +#include <tqgl.h> #define FLICKER_FRAMES_DELAY 8 #define DRAND ((float)rand() / (float)RAND_MAX) /*random float between 0 and 1*/ diff --git a/kscreensaver/kdesavers/firesaversetup.ui.h b/kscreensaver/kdesavers/firesaversetup.ui.h index 8cf478e2..09480126 100644 --- a/kscreensaver/kdesavers/firesaversetup.ui.h +++ b/kscreensaver/kdesavers/firesaversetup.ui.h @@ -11,8 +11,8 @@ #ifndef KFIRESAVER_SETUP_H #define KFIRESAVER_SETUP_H -#include <qcolor.h> -#include <qtimer.h> +#include <tqcolor.h> +#include <tqtimer.h> #include <kconfig.h> @@ -137,7 +137,7 @@ void KFireSaverSetup::readConfig() fireworksSlider->setValue(config.readNumEntry( "FireworksFrequency", 7 )); particlesSlider->setValue(config.readNumEntry( "ParticlesSize", 0 )); bottomfireBox->setChecked(config.readBoolEntry( "enable-BottomFire", true )); - QColor blue = Qt::darkBlue; + TQColor blue = Qt::darkBlue; bottomfireColorButton->setColor(config.readColorEntry( "BottomFireColor", &blue )); soundsBox->setChecked(config.readBoolEntry( "enable-Sounds", false )); overheadBox->setChecked(config.readBoolEntry( "enable-NoOverhead", true )); diff --git a/kscreensaver/kdesavers/firesaverwriter.cpp b/kscreensaver/kdesavers/firesaverwriter.cpp index 07209884..4f98ae60 100644 --- a/kscreensaver/kdesavers/firesaverwriter.cpp +++ b/kscreensaver/kdesavers/firesaverwriter.cpp @@ -11,10 +11,10 @@ #include <math.h> #include <stdlib.h> -#include <qimage.h> -#include <qgl.h> -#include <qfile.h> -#include <qstring.h> +#include <tqimage.h> +#include <tqgl.h> +#include <tqfile.h> +#include <tqstring.h> #include <kdebug.h> #include <kstandarddirs.h> #include <kdeversion.h> @@ -24,7 +24,7 @@ /* Word: SINGLE WORD */ -Word::Word( const char * _text, QMap<char, Symbol *> * sMap, float _scale ) +Word::Word( const char * _text, TQMap<char, Symbol *> * sMap, float _scale ) : width(0), scale(_scale), cX(0), cY(0), vScale(0), vX(0), vY(0), activateTime(0.0), lifeTime(2), currentTime(0) { @@ -86,7 +86,7 @@ inline bool Word::isDead() /* Writer: engine that spawns and manages words */ -Writer::Writer( QString descFileName ) +Writer::Writer( TQString descFileName ) : numTextures(0) { wordList.setAutoDelete( true ); @@ -94,7 +94,7 @@ Writer::Writer( QString descFileName ) if ( !loadMap( descFileName ) ) return; - QString welcomeString = i18n("Welcome to KDE %1.%2.%3") + TQString welcomeString = i18n("Welcome to KDE %1.%2.%3") .arg(KDE_VERSION_MAJOR) .arg(KDE_VERSION_MINOR) .arg(KDE_VERSION_RELEASE); @@ -105,21 +105,21 @@ Writer::~ Writer() { glDeleteTextures( numTextures, texArray ); wordList.clear(); - QMap<char, Symbol *>::Iterator it = symbolMap.begin(); + TQMap<char, Symbol *>::Iterator it = symbolMap.begin(); for ( ; it != symbolMap.end(); ++it ) delete (Symbol *)it.data(); } -void Writer::spawnWords( QString phrase, effectType fX ) +void Writer::spawnWords( TQString phrase, effectType fX ) { int wordCount = 0; float xCenter = 0, yCenter = drand48()*40 - 20, wordsWidth = 0; - QPtrList<Word> localWords; + TQPtrList<Word> localWords; while ( phrase.length() > 0 ) { - QString letters = phrase.section(" ",0,0); + TQString letters = phrase.section(" ",0,0); Word * word = new Word( letters.latin1(), &symbolMap ); wordList.append( word ); localWords.append( word ); @@ -184,9 +184,9 @@ void Writer::render( double dT ) * parses the description file to create the internal symbols map. * This map is then used when building words. **/ -bool Writer::loadMap( QString descFile ) +bool Writer::loadMap( TQString descFile ) { - QFile desc( locate("data","kfiresaver/"+descFile) ); + TQFile desc( locate("data","kfiresaver/"+descFile) ); if ( !desc.open( IO_ReadOnly ) ) return false; @@ -196,7 +196,7 @@ bool Writer::loadMap( QString descFile ) while ( !desc.atEnd() ) { - QString line; + TQString line; int count = desc.readLine( line, 100 ); //skip comments / invalid lines if ( count < 6 || line.at(0) == '#') @@ -205,8 +205,8 @@ bool Writer::loadMap( QString descFile ) if ( line.at(0) == '"' && numTextures < 15 ) { //load and generate texture - QString fileName = line.section("\"", 1,1 ); - QImage tmp; + TQString fileName = line.section("\"", 1,1 ); + TQImage tmp; if ( !tmp.load( locate("data","kfiresaver/"+fileName) ) ) { kdWarning() << "can't load filename:" << fileName << endl; generatedFirst = false; @@ -217,7 +217,7 @@ bool Writer::loadMap( QString descFile ) glBindTexture(GL_TEXTURE_2D, currentNumber); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); - QImage texture = QGLWidget::convertToGLFormat( tmp ); + TQImage texture = TQGLWidget::convertToGLFormat( tmp ); xres = (float)texture.width(); yres = (float)texture.height(); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, (int)xres, (int)yres, 0, diff --git a/kscreensaver/kdesavers/firesaverwriter.h b/kscreensaver/kdesavers/firesaverwriter.h index b7bd2e78..e93f65be 100644 --- a/kscreensaver/kdesavers/firesaverwriter.h +++ b/kscreensaver/kdesavers/firesaverwriter.h @@ -12,10 +12,10 @@ #ifndef FIRESAVER_WRITER_H #define FIRESAVER_WRITER_H -#include <qgl.h> -#include <qptrlist.h> -#include <qmap.h> -#include <qstring.h> +#include <tqgl.h> +#include <tqptrlist.h> +#include <tqmap.h> +#include <tqstring.h> class Symbol { @@ -60,7 +60,7 @@ class Word { friend class Writer; public: - Word( const char * text, QMap<char, Symbol *> * map, float scale = 1.0 ); + Word( const char * text, TQMap<char, Symbol *> * map, float scale = 1.0 ); inline void renderWord( double dT ); inline bool isDead(); @@ -70,7 +70,7 @@ class Word float vScale, vX, vY; float activateTime, lifeTime, currentTime; float color[4]; - QPtrList<Symbol> symbolList; + TQPtrList<Symbol> symbolList; }; @@ -80,14 +80,14 @@ class Word class Writer { public: - Writer( QString descFileName ); + Writer( TQString descFileName ); ~Writer(); //types of effects implemented enum effectType { NoEffect = 0, Sequence, Fun1, Fun2 }; //call this function to add a sentence to the renderer - void spawnWords( QString phrase, effectType fx = NoEffect ); + void spawnWords( TQString phrase, effectType fx = NoEffect ); //called to get the words on screen using OpenGL //Note: the context must be set up. Words are drawn on XY plane @@ -96,15 +96,15 @@ class Writer private: //misc utility functions - bool loadMap( QString ); + bool loadMap( TQString ); //texture 'references' used by GL to delete allocated textures int numTextures; unsigned int texArray[16]; //list of words and map of symbols - QPtrList<Word> wordList; - QMap<char, Symbol *> symbolMap; + TQPtrList<Word> wordList; + TQMap<char, Symbol *> symbolMap; //disables standard constructor Writer(); diff --git a/kscreensaver/kdesavers/fountain.cpp b/kscreensaver/kdesavers/fountain.cpp index 51d88343..2149b53d 100644 --- a/kscreensaver/kdesavers/fountain.cpp +++ b/kscreensaver/kdesavers/fountain.cpp @@ -8,8 +8,8 @@ // Nick Betcher <[email protected]> 2001 // #include <stdlib.h> -#include <qlabel.h> -#include <qlayout.h> +#include <tqlabel.h> +#include <tqlayout.h> #include <kapplication.h> #include <klocale.h> #include <kconfig.h> @@ -26,11 +26,11 @@ #include <GL/glu.h> #include <GL/gl.h> #endif -#include <qimage.h> +#include <tqimage.h> #include <kdebug.h> -#include <qpainter.h> -#include <qradiobutton.h> -#include <qspinbox.h> +#include <tqpainter.h> +#include <tqradiobutton.h> +#include <tqspinbox.h> #include <kstandarddirs.h> #include <math.h> #include <kmessagebox.h> @@ -46,7 +46,7 @@ extern "C" return new KFountainSaver( id ); } - KDE_EXPORT QDialog *kss_setup() + KDE_EXPORT TQDialog *kss_setup() { return new KFountainSetup(); } @@ -55,27 +55,27 @@ extern "C" //----------------------------------------------------------------------------- // dialog to setup screen saver parameters // -KFountainSetup::KFountainSetup( QWidget *parent, const char *name ) +KFountainSetup::KFountainSetup( TQWidget *parent, const char *name ) : SetupUi( parent, name, TRUE ) { readSettings(); - //QLabel *label; - //QPushButton *button; + //TQLabel *label; + //TQPushButton *button; //setCaption( i18n("Setup Particle Fountain") ); - //QVBoxLayout *tl = new QVBoxLayout(this, 10); - //QHBoxLayout *tl1 = new QHBoxLayout; + //TQVBoxLayout *tl = new TQVBoxLayout(this, 10); + //TQHBoxLayout *tl1 = new QHBoxLayout; //tl->addLayout(tl1); - //QVBoxLayout *tl11 = new QVBoxLayout(5); + //TQVBoxLayout *tl11 = new TQVBoxLayout(5); //tl1->addLayout(tl11); - //label = new QLabel( i18n("No options here yet...:"), this ); + //label = new TQLabel( i18n("No options here yet...:"), this ); ///tl11->addWidget(label);; - //preview = new QWidget( this ); + //preview = new TQWidget( this ); preview->setFixedSize( 220, 170 ); preview->setBackgroundColor( black ); preview->show(); // otherwise saver does not get correct size @@ -85,11 +85,11 @@ KFountainSetup::KFountainSetup( QWidget *parent, const char *name ) //KButtonBox *bbox = new KButtonBox(this); //bbox->addStretch(1); ; - connect( PushButton1, SIGNAL( clicked() ), SLOT( slotOkPressed() ) ); - connect( PushButton2, SIGNAL( clicked() ), SLOT( reject() ) ); - connect( PushButton3, SIGNAL( clicked() ), SLOT( aboutPressed() ) ); - connect( SpinBox1, SIGNAL( valueChanged(int)), saver, SLOT( updateSize(int))); - connect( RadioButton1, SIGNAL( toggled(bool)), saver, SLOT( doStars(bool))); + connect( PushButton1, TQT_SIGNAL( clicked() ), TQT_SLOT( slotOkPressed() ) ); + connect( PushButton2, TQT_SIGNAL( clicked() ), TQT_SLOT( reject() ) ); + connect( PushButton3, TQT_SIGNAL( clicked() ), TQT_SLOT( aboutPressed() ) ); + connect( SpinBox1, TQT_SIGNAL( valueChanged(int)), saver, TQT_SLOT( updateSize(int))); + connect( RadioButton1, TQT_SIGNAL( toggled(bool)), saver, TQT_SLOT( doStars(bool))); } @@ -99,7 +99,7 @@ void KFountainSetup::readSettings() KConfig config("kssfountainrc", false, false); config.setGroup( "Settings" ); - QString boolval = config.readEntry( "Stars", "false" ); + TQString boolval = config.readEntry( "Stars", "false" ); if (boolval == "true") { RadioButton1->setDown(true); RadioButton1_2->setDown(false); @@ -111,7 +111,7 @@ void KFountainSetup::readSettings() } } - QString starammount = config.readEntry("StarSize", "75"); + TQString starammount = config.readEntry("StarSize", "75"); SpinBox1->setValue(starammount.toInt()); } @@ -131,7 +131,7 @@ void KFountainSetup::slotOkPressed() config.writeEntry( "Stars", "false" ); } } - config.writeEntry( "StarSize", QString::number(SpinBox1->value()) ); + config.writeEntry( "StarSize", TQString::number(SpinBox1->value()) ); config.sync(); @@ -151,14 +151,14 @@ KFountainSaver::KFountainSaver( WId id ) : KScreenSaver( id ) kdDebug() << "Blank" << endl; - timer = new QTimer( this ); + timer = new TQTimer( this ); timer->start( 25, TRUE ); setBackgroundColor( black ); erase(); fountain = new Fountain(); embed(fountain); fountain->show(); - connect( timer, SIGNAL(timeout()), this, SLOT(blank()) ); + connect( timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(blank()) ); } KFountainSaver::~KFountainSaver() @@ -181,7 +181,7 @@ void KFountainSaver::blank() timer->start( 25, TRUE ); } -Fountain::Fountain( QWidget * parent, const char * name) : QGLWidget (parent,name) +Fountain::Fountain( TQWidget * parent, const char * name) : TQGLWidget (parent,name) { rainbow=true; slowdown=2.0f; @@ -193,7 +193,7 @@ Fountain::Fountain( QWidget * parent, const char * name) : QGLWidget (parent,nam // This has to be here because you can't update the fountain until 'fountain' is created! KConfig config("kssfountainrc", false, false); config.setGroup( "Settings" ); - QString boolval = config.readEntry( "Stars", "false" ); + TQString boolval = config.readEntry( "Stars", "false" ); if (boolval == "true") { setStars(true); } else { @@ -203,7 +203,7 @@ Fountain::Fountain( QWidget * parent, const char * name) : QGLWidget (parent,nam } } - QString starammount = config.readEntry("StarSize", "75"); + TQString starammount = config.readEntry("StarSize", "75"); float passvalue = (starammount.toInt() / 100.0); setSize(passvalue); @@ -220,7 +220,7 @@ bool Fountain::loadParticle() { /* Status indicator */ bool Status = TRUE; - QImage buf; + TQImage buf; kdDebug() << "Loading: " << locate("data", "kscreensaver/particle.png") << endl; if (buf.load( locate("data", "kscreensaver/particle.png") ) ) @@ -231,7 +231,7 @@ bool Fountain::loadParticle() } else { - QImage dummy( 32, 32, 32 ); + TQImage dummy( 32, 32, 32 ); dummy.fill( Qt::white.rgb() ); buf = dummy; tex = convertToGLFormat( buf ); diff --git a/kscreensaver/kdesavers/fountain.h b/kscreensaver/kdesavers/fountain.h index fa89e6f8..1a31f99e 100644 --- a/kscreensaver/kdesavers/fountain.h +++ b/kscreensaver/kdesavers/fountain.h @@ -14,8 +14,8 @@ #ifndef __FOUNTAIN_H__ #define __FOUNTAIN_H__ -#include <qdialog.h> -#include <qgl.h> +#include <tqdialog.h> +#include <tqgl.h> #ifdef Q_WS_MACX #include <OpenGL/gl.h> #include <OpenGL/glu.h> @@ -24,12 +24,12 @@ #include <GL/gl.h> #endif #include <kscreensaver.h> -#include <qtimer.h> -#include <qimage.h> +#include <tqtimer.h> +#include <tqimage.h> #include "fountaincfg.h" #include <kinstance.h> -#include <qfile.h> -#include <qtextstream.h> +#include <tqfile.h> +#include <tqtextstream.h> #define MAX_PARTICLES 1000 @@ -59,7 +59,7 @@ Q_OBJECT }; public: - Fountain( QWidget * parent=0, const char * name=0 ); + Fountain( TQWidget * parent=0, const char * name=0 ); ~Fountain(); void setSize( float newSize ); void setStars( bool doStars ); @@ -93,7 +93,7 @@ private: GLuint col; // Current Color Selection GLuint delay; // Rainbow Effect Delay GLuint texture[1]; - QImage tex; + TQImage tex; float index; float transIndex; GLfloat scale; @@ -114,14 +114,14 @@ public slots: // void loadTextures(bool textures); private: Fountain *fountain; - QTimer *timer; + TQTimer *timer; }; class KFountainSetup : public SetupUi { Q_OBJECT public: - KFountainSetup( QWidget *parent = NULL, const char *name = NULL ); + KFountainSetup( TQWidget *parent = NULL, const char *name = NULL ); protected: void readSettings(); diff --git a/kscreensaver/kdesavers/gravity.cpp b/kscreensaver/kdesavers/gravity.cpp index d9f9bbd1..c8415e49 100644 --- a/kscreensaver/kdesavers/gravity.cpp +++ b/kscreensaver/kdesavers/gravity.cpp @@ -8,8 +8,8 @@ // Nick Betcher <[email protected]> 2001 // #include <stdlib.h> -#include <qlabel.h> -#include <qlayout.h> +#include <tqlabel.h> +#include <tqlayout.h> #include <kapplication.h> #include <klocale.h> #include <kconfig.h> @@ -25,11 +25,11 @@ #include <GL/glu.h> #include <GL/gl.h> #endif -#include <qimage.h> +#include <tqimage.h> #include <kdebug.h> -#include <qpainter.h> -#include <qradiobutton.h> -#include <qspinbox.h> +#include <tqpainter.h> +#include <tqradiobutton.h> +#include <tqspinbox.h> #include <kstandarddirs.h> #include <math.h> #include <kmessagebox.h> @@ -45,7 +45,7 @@ extern "C" return new KGravitySaver( id ); } - KDE_EXPORT QDialog *kss_setup() + KDE_EXPORT TQDialog *kss_setup() { return new KGravitySetup(); } @@ -54,7 +54,7 @@ extern "C" //----------------------------------------------------------------------------- // dialog to setup screen saver parameters // -KGravitySetup::KGravitySetup( QWidget *parent, const char *name ) +KGravitySetup::KGravitySetup( TQWidget *parent, const char *name ) : SetupUi( parent, name, TRUE ) { readSettings(); @@ -66,11 +66,11 @@ KGravitySetup::KGravitySetup( QWidget *parent, const char *name ) #endif saver = new KGravitySaver( preview->winId() ); ; - connect( PushButton1, SIGNAL( clicked() ), SLOT( slotOkPressed() ) ); - connect( PushButton2, SIGNAL( clicked() ), SLOT( reject() ) ); - connect( PushButton3, SIGNAL( clicked() ), SLOT( aboutPressed() ) ); - connect( SpinBox1, SIGNAL( valueChanged(int)), saver, SLOT( updateSize(int))); - connect( RadioButton1, SIGNAL( toggled(bool)), saver, SLOT( doStars(bool))); + connect( PushButton1, TQT_SIGNAL( clicked() ), TQT_SLOT( slotOkPressed() ) ); + connect( PushButton2, TQT_SIGNAL( clicked() ), TQT_SLOT( reject() ) ); + connect( PushButton3, TQT_SIGNAL( clicked() ), TQT_SLOT( aboutPressed() ) ); + connect( SpinBox1, TQT_SIGNAL( valueChanged(int)), saver, TQT_SLOT( updateSize(int))); + connect( RadioButton1, TQT_SIGNAL( toggled(bool)), saver, TQT_SLOT( doStars(bool))); } @@ -85,7 +85,7 @@ void KGravitySetup::readSettings() KConfig config("kssgravityrc", false, false); config.setGroup( "Settings" ); - QString boolval = config.readEntry( "Stars", "false" ); + TQString boolval = config.readEntry( "Stars", "false" ); if (boolval == "true") { RadioButton1->setDown(true); RadioButton1_2->setDown(false); @@ -97,7 +97,7 @@ void KGravitySetup::readSettings() } } - QString starammount = config.readEntry("StarSize", "75"); + TQString starammount = config.readEntry("StarSize", "75"); SpinBox1->setValue(starammount.toInt()); } @@ -117,7 +117,7 @@ void KGravitySetup::slotOkPressed() config.writeEntry( "Stars", "false" ); } } - config.writeEntry( "StarSize", QString::number(SpinBox1->value()) ); + config.writeEntry( "StarSize", TQString::number(SpinBox1->value()) ); config.sync(); @@ -137,7 +137,7 @@ KGravitySaver::KGravitySaver( WId id ) : KScreenSaver( id ) kdDebug() << "Blank" << endl; - timer = new QTimer( this ); + timer = new TQTimer( this ); timer->start( 25, TRUE ); setBackgroundColor( black ); erase(); @@ -146,7 +146,7 @@ KGravitySaver::KGravitySaver( WId id ) : KScreenSaver( id ) #ifdef Q_WS_X11 gravity->show(); #endif - connect( timer, SIGNAL(timeout()), this, SLOT(blank()) ); + connect( timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(blank()) ); } KGravitySaver::~KGravitySaver() @@ -169,7 +169,7 @@ void KGravitySaver::blank() timer->start( 25, TRUE ); } -Gravity::Gravity( QWidget * parent, const char * name) : QGLWidget (parent,name) +Gravity::Gravity( TQWidget * parent, const char * name) : TQGLWidget (parent,name) { rainbow=true; slowdown=2.0f; @@ -181,7 +181,7 @@ Gravity::Gravity( QWidget * parent, const char * name) : QGLWidget (parent,name) // This has to be here because you can't update the gravity until 'gravity' is created! KConfig config("kssgravityrc", false, false); config.setGroup( "Settings" ); - QString boolval = config.readEntry( "Stars", "false" ); + TQString boolval = config.readEntry( "Stars", "false" ); if (boolval == "true") { setStars(true); } else { @@ -191,7 +191,7 @@ Gravity::Gravity( QWidget * parent, const char * name) : QGLWidget (parent,name) } } - QString starammount = config.readEntry("StarSize", "75"); + TQString starammount = config.readEntry("StarSize", "75"); float passvalue = (starammount.toInt() / 100.0); setSize(passvalue); @@ -208,7 +208,7 @@ bool Gravity::loadParticle() { /* Status indicator */ bool Status = TRUE; - QImage buf; + TQImage buf; kdDebug() << "Loading: " << locate("data", "kscreensaver/particle.png") << endl; if (buf.load( locate("data", "kscreensaver/particle.png") ) ) @@ -219,7 +219,7 @@ bool Gravity::loadParticle() } else { - QImage dummy( 32, 32, 32 ); + TQImage dummy( 32, 32, 32 ); dummy.fill( Qt::white.rgb() ); buf = dummy; tex = convertToGLFormat( buf ); diff --git a/kscreensaver/kdesavers/gravity.h b/kscreensaver/kdesavers/gravity.h index 2cd7080f..53d60a25 100644 --- a/kscreensaver/kdesavers/gravity.h +++ b/kscreensaver/kdesavers/gravity.h @@ -14,8 +14,8 @@ #ifndef __GRAVITY_H__ #define __GRAVITY_H__ -#include <qdialog.h> -#include <qgl.h> +#include <tqdialog.h> +#include <tqgl.h> #ifdef Q_WS_MACX #include <OpenGL/glu.h> #include <OpenGL/gl.h> @@ -24,12 +24,12 @@ #include <GL/gl.h> #endif #include <kscreensaver.h> -#include <qtimer.h> -#include <qimage.h> +#include <tqtimer.h> +#include <tqimage.h> #include "gravitycfg.h" #include <kinstance.h> -#include <qfile.h> -#include <qtextstream.h> +#include <tqfile.h> +#include <tqtextstream.h> #define MAX_PARTICLES 100 @@ -58,7 +58,7 @@ Q_OBJECT }; public: - Gravity( QWidget * parent=0, const char * name=0 ); + Gravity( TQWidget * parent=0, const char * name=0 ); ~Gravity(); void setSize( float newSize ); void setStars( bool doStars ); @@ -91,7 +91,7 @@ private: GLuint col; // Current Color Selection GLuint delay; // Rainbow Effect Delay GLuint texture[1]; - QImage tex; + TQImage tex; float index; float transIndex; GLfloat scale; @@ -112,14 +112,14 @@ public slots: // void loadTextures(bool textures); private: Gravity *gravity; - QTimer *timer; + TQTimer *timer; }; class KGravitySetup : public SetupUi { Q_OBJECT public: - KGravitySetup( QWidget *parent = NULL, const char *name = NULL ); + KGravitySetup( TQWidget *parent = NULL, const char *name = NULL ); ~KGravitySetup(); protected: diff --git a/kscreensaver/kdesavers/kclock.cpp b/kscreensaver/kdesavers/kclock.cpp index ac24c4b1..2f3ab178 100644 --- a/kscreensaver/kdesavers/kclock.cpp +++ b/kscreensaver/kdesavers/kclock.cpp @@ -10,16 +10,16 @@ #include <stdlib.h> #include <string.h> -#include <qcheckbox.h> -#include <qcolor.h> -#include <qdatetime.h> -#include <qgroupbox.h> -#include <qhbox.h> -#include <qimage.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qpainter.h> -#include <qslider.h> +#include <tqcheckbox.h> +#include <tqcolor.h> +#include <tqdatetime.h> +#include <tqgroupbox.h> +#include <tqhbox.h> +#include <tqimage.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqslider.h> #include <kapplication.h> #include <kcolorbutton.h> @@ -58,7 +58,7 @@ extern "C" { return new KClockSaver(id); } - KDE_EXPORT QDialog *kss_setup() { + KDE_EXPORT TQDialog *kss_setup() { return new KClockSetup(); } } @@ -68,7 +68,7 @@ extern "C" { //----------------------------------------------------------------------------- -KClockSetup::KClockSetup(QWidget *parent, const char *name) +KClockSetup::KClockSetup(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n( "Setup Clock Screen Saver" ), Ok|Cancel|Help, Ok, true), m_saver(0) @@ -76,93 +76,93 @@ KClockSetup::KClockSetup(QWidget *parent, const char *name) readSettings(); setButtonText( Help, i18n( "A&bout" ) ); - QWidget *main = makeMainWidget(); + TQWidget *main = makeMainWidget(); - QVBoxLayout *top = new QVBoxLayout(main, 0, spacingHint()); + TQVBoxLayout *top = new TQVBoxLayout(main, 0, spacingHint()); - QHBoxLayout *hbox = new QHBoxLayout; + TQHBoxLayout *hbox = new QHBoxLayout; top->addLayout( hbox ); - QGroupBox *colgroup = new QGroupBox(i18n("Colors"), main); + TQGroupBox *colgroup = new TQGroupBox(i18n("Colors"), main); colgroup->setColumnLayout( 0, Horizontal ); - QGridLayout *grid = new QGridLayout( colgroup->layout(), + TQGridLayout *grid = new TQGridLayout( colgroup->layout(), 5, 2, spacingHint() ); - QLabel *label = new QLabel(i18n("&Hour-hand:"), colgroup); + TQLabel *label = new TQLabel(i18n("&Hour-hand:"), colgroup); KColorButton *colorButton = new KColorButton(m_hourColor, colgroup); colorButton->setFixedWidth(COLOR_BUTTON_WIDTH); label->setBuddy(colorButton); - connect(colorButton, SIGNAL(changed(const QColor &)), - SLOT(slotHourColor(const QColor &))); + connect(colorButton, TQT_SIGNAL(changed(const TQColor &)), + TQT_SLOT(slotHourColor(const TQColor &))); grid->addWidget( label, 1, 1 ); grid->addWidget( colorButton, 1, 2 ); - label = new QLabel(i18n("&Minute-hand:"), colgroup); + label = new TQLabel(i18n("&Minute-hand:"), colgroup); colorButton = new KColorButton(m_minColor, colgroup); colorButton->setFixedWidth(COLOR_BUTTON_WIDTH); label->setBuddy(colorButton); - connect(colorButton, SIGNAL(changed(const QColor &)), - SLOT(slotMinColor(const QColor &))); + connect(colorButton, TQT_SIGNAL(changed(const TQColor &)), + TQT_SLOT(slotMinColor(const TQColor &))); grid->addWidget( label, 2, 1 ); grid->addWidget( colorButton, 2, 2 ); - label = new QLabel(i18n("&Second-hand:"), colgroup); + label = new TQLabel(i18n("&Second-hand:"), colgroup); colorButton = new KColorButton(m_secColor, colgroup); colorButton->setFixedWidth(COLOR_BUTTON_WIDTH); label->setBuddy(colorButton); - connect(colorButton, SIGNAL(changed(const QColor &)), - SLOT(slotSecColor(const QColor &))); + connect(colorButton, TQT_SIGNAL(changed(const TQColor &)), + TQT_SLOT(slotSecColor(const TQColor &))); grid->addWidget( label, 3, 1 ); grid->addWidget( colorButton, 3, 2 ); - label = new QLabel(i18n("Scal&e:"), colgroup); + label = new TQLabel(i18n("Scal&e:"), colgroup); colorButton = new KColorButton(m_scaleColor, colgroup); colorButton->setFixedWidth(COLOR_BUTTON_WIDTH); label->setBuddy(colorButton); - connect(colorButton, SIGNAL(changed(const QColor &)), - SLOT(slotScaleColor(const QColor &))); + connect(colorButton, TQT_SIGNAL(changed(const TQColor &)), + TQT_SLOT(slotScaleColor(const TQColor &))); grid->addWidget( label, 4, 1 ); grid->addWidget( colorButton, 4, 2 ); - label = new QLabel(i18n("&Background:"), colgroup); + label = new TQLabel(i18n("&Background:"), colgroup); colorButton = new KColorButton(m_bgndColor, colgroup); colorButton->setFixedWidth(COLOR_BUTTON_WIDTH); label->setBuddy(colorButton); - connect(colorButton, SIGNAL(changed(const QColor &)), - SLOT(slotBgndColor(const QColor &))); + connect(colorButton, TQT_SIGNAL(changed(const TQColor &)), + TQT_SLOT(slotBgndColor(const TQColor &))); grid->addWidget( label, 5, 1 ); grid->addWidget( colorButton, 5, 2 ); hbox->addWidget(colgroup); - QWidget *m_preview = new QWidget(main); + TQWidget *m_preview = new TQWidget(main); m_preview->setFixedSize(220, 165); m_preview->show(); m_saver = new KClockSaver(m_preview->winId()); hbox->addWidget(m_preview); - label = new QLabel( i18n( "Si&ze:" ), main ); + label = new TQLabel( i18n( "Si&ze:" ), main ); top->addWidget( label ); - QSlider *qs = new QSlider(0, MAX_CLOCK_SIZE, 1, m_size, Horizontal, main); + TQSlider *qs = new TQSlider(0, MAX_CLOCK_SIZE, 1, m_size, Horizontal, main); label->setBuddy( qs ); qs->setTickInterval(1); - qs->setTickmarks(QSlider::Below); - connect(qs, SIGNAL(valueChanged(int)), this, SLOT(slotSliderMoved(int))); + qs->setTickmarks(TQSlider::Below); + connect(qs, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotSliderMoved(int))); top->addWidget( qs ); bool rtl = kapp->reverseLayout(); - QHBox *qsscale = new QHBox(main); - label = new QLabel(i18n("Small"), qsscale); + TQHBox *qsscale = new TQHBox(main); + label = new TQLabel(i18n("Small"), qsscale); label->setAlignment(rtl ? AlignRight : AlignLeft); - label = new QLabel(i18n("Medium"), qsscale); + label = new TQLabel(i18n("Medium"), qsscale); label->setAlignment(AlignHCenter); - label = new QLabel(i18n("Big"), qsscale); + label = new TQLabel(i18n("Big"), qsscale); label->setAlignment(rtl ? AlignLeft : AlignRight); top->addWidget(qsscale); - QCheckBox *keepCentered = new QCheckBox(i18n("&Keep clock centered"), main); + TQCheckBox *keepCentered = new TQCheckBox(i18n("&Keep clock centered"), main); keepCentered->setChecked(m_keepCentered); - connect(keepCentered, SIGNAL(stateChanged(int)), SLOT(slotKeepCenteredChanged(int))); + connect(keepCentered, TQT_SIGNAL(stateChanged(int)), TQT_SLOT(slotKeepCenteredChanged(int))); top->addWidget(keepCentered); top->addStretch(); } @@ -183,7 +183,7 @@ void KClockSetup::readSettings() m_size = MAX_CLOCK_SIZE; config->setGroup("Colors"); - QColor c = Qt::black; + TQColor c = Qt::black; m_bgndColor = config->readColorEntry("Background", &c); c = Qt::white; @@ -229,11 +229,11 @@ void KClockSetup::slotHelp() "Version 1.0<br>" "<nobr>Melchior FRANZ (c) 2003</nobr>") + "<br><a href=\"mailto:[email protected]\">[email protected]</a>" - "</qt>", QString::null, KMessageBox::AllowLink); + "</qt>", TQString::null, KMessageBox::AllowLink); } -void KClockSetup::slotBgndColor(const QColor &color) +void KClockSetup::slotBgndColor(const TQColor &color) { m_bgndColor = color; if (m_saver) @@ -241,7 +241,7 @@ void KClockSetup::slotBgndColor(const QColor &color) } -void KClockSetup::slotScaleColor(const QColor &color) +void KClockSetup::slotScaleColor(const TQColor &color) { m_scaleColor = color; if (m_saver) @@ -249,7 +249,7 @@ void KClockSetup::slotScaleColor(const QColor &color) } -void KClockSetup::slotHourColor(const QColor &color) +void KClockSetup::slotHourColor(const TQColor &color) { m_hourColor = color; if (m_saver) @@ -257,7 +257,7 @@ void KClockSetup::slotHourColor(const QColor &color) } -void KClockSetup::slotMinColor(const QColor &color) +void KClockSetup::slotMinColor(const TQColor &color) { m_minColor = color; if (m_saver) @@ -265,7 +265,7 @@ void KClockSetup::slotMinColor(const QColor &color) } -void KClockSetup::slotSecColor(const QColor &color) +void KClockSetup::slotSecColor(const TQColor &color) { m_secColor = color; if (m_saver) @@ -320,7 +320,7 @@ void KClockPainter::copy(KClockPainter *p) } -void KClockPainter::drawToImage(QImage *q, int xoffs = 0, int yoffs = 0) +void KClockPainter::drawToImage(TQImage *q, int xoffs = 0, int yoffs = 0) { unsigned char *src = (unsigned char *)image(); for (int y = 0; y < m_height; y++) { @@ -331,19 +331,19 @@ void KClockPainter::drawToImage(QImage *q, int xoffs = 0, int yoffs = 0) } -void KClockPainter::setColor(const QColor &c) +void KClockPainter::setColor(const TQColor &c) { m_color = (c.red() << 24) | (c.green() << 16) | (c.blue() << 8) | 255; } -void KClockPainter::setShadowColor(const QColor &c) +void KClockPainter::setShadowColor(const TQColor &c) { m_shadow = (c.red() << 24) | (c.green() << 16) | (c.blue() << 8) | 255; } -void KClockPainter::fill(const QColor &c) +void KClockPainter::fill(const TQColor &c) { art_rgb_fill_run(m_buf, c.red(), c.green(), c.blue(), m_width * m_height); } @@ -398,7 +398,7 @@ void KClockPainter::drawDisc(double r) } -void KClockPainter::drawHand(const QColor &c, double angle, double length, +void KClockPainter::drawHand(const TQColor &c, double angle, double length, double width, bool disc = true) { const double shadow_width = 1.0; @@ -426,7 +426,7 @@ KClockSaver::KClockSaver(WId id) { readSettings(); setBackgroundColor(m_bgndColor); - connect(&m_timer, SIGNAL(timeout()), SLOT(slotTimeout())); + connect(&m_timer, TQT_SIGNAL(timeout()), TQT_SLOT(slotTimeout())); start(m_size); m_timer.start(TIMER_INTERVALL); } @@ -445,7 +445,7 @@ void KClockSaver::start(int size) m_x = (width() - m_diameter) / 2; m_y = (height() - m_diameter) / 2; - m_image = new QImage(m_diameter, m_diameter, 32); + m_image = new TQImage(m_diameter, m_diameter, 32); m_scale = new KClockPainter(m_diameter, m_diameter); m_clock = new KClockPainter(m_diameter, m_diameter); @@ -497,7 +497,7 @@ void KClockSaver::readSettings() m_size = MAX_CLOCK_SIZE; config->setGroup("Colors"); - QColor c = Qt::black; + TQColor c = Qt::black; m_bgndColor = config->readColorEntry("Background", &c); c = Qt::white; @@ -542,7 +542,7 @@ void KClockSaver::drawClock() void KClockSaver::slotTimeout() { - QTime t = QTime::currentTime(); + TQTime t = TQTime::currentTime(); int s = t.second(); if (s == m_second) return; @@ -552,11 +552,11 @@ void KClockSaver::slotTimeout() m_minute = t.minute(); drawClock(); - QPainter p(this); + TQPainter p(this); if (width() < 256) { // intended for the control module preview: always fill the whole area - QImage *img = new QImage(width(), height(), 32); + TQImage *img = new TQImage(width(), height(), 32); img->fill(qRgb(m_bgndColor.red(), m_bgndColor.green(), m_bgndColor.blue())); m_clock->drawToImage(img, m_x, m_y); p.drawImage(0, 0, *img); diff --git a/kscreensaver/kdesavers/kclock.h b/kscreensaver/kdesavers/kclock.h index b16945d6..2afc42a6 100644 --- a/kscreensaver/kdesavers/kclock.h +++ b/kscreensaver/kdesavers/kclock.h @@ -10,7 +10,7 @@ #ifndef __KCLOCK_H__ #define __KCLOCK_H__ -#include <qtimer.h> +#include <tqtimer.h> #include <kdialogbase.h> #include <kscreensaver.h> @@ -28,16 +28,16 @@ class KClockPainter KClockPainter(int width, int height); ~KClockPainter(); void copy(KClockPainter *p); - void drawToImage(QImage *q, int x, int y); + void drawToImage(TQImage *q, int x, int y); inline int width() { return m_width; } inline int height() { return m_height; } inline void *image() { return (void *)m_buf; } - void setColor(const QColor &color); - void setShadowColor(const QColor &color); - void fill(const QColor &color); + void setColor(const TQColor &color); + void setShadowColor(const TQColor &color); + void fill(const TQColor &color); void drawRadial(double alpha, double r0, double r1, double width); void drawDisc(double radius); - void drawHand(const QColor &color, double angle, double length, + void drawHand(const TQColor &color, double angle, double length, double width, bool disc); }; @@ -48,11 +48,11 @@ class KClockSaver : public KScreenSaver public: KClockSaver(WId id); virtual ~KClockSaver(); - inline void setBgndColor(const QColor &c) { m_bgndColor = c; drawScale(); setBackgroundColor(c); }; - inline void setScaleColor(const QColor &c) { m_scaleColor = c; drawScale(); }; - inline void setHourColor(const QColor &c) { m_hourColor = c; forceRedraw(); }; - inline void setMinColor(const QColor &c) { m_minColor = c; forceRedraw(); }; - inline void setSecColor(const QColor &c) { m_secColor = c; forceRedraw(); }; + inline void setBgndColor(const TQColor &c) { m_bgndColor = c; drawScale(); setBackgroundColor(c); }; + inline void setScaleColor(const TQColor &c) { m_scaleColor = c; drawScale(); }; + inline void setHourColor(const TQColor &c) { m_hourColor = c; forceRedraw(); }; + inline void setMinColor(const TQColor &c) { m_minColor = c; forceRedraw(); }; + inline void setSecColor(const TQColor &c) { m_secColor = c; forceRedraw(); }; void setKeepCentered(bool b); void restart(int siz); inline void forceRedraw() { m_second = -1; } @@ -68,8 +68,8 @@ class KClockSaver : public KScreenSaver void slotTimeout(); protected: - QTimer m_timer; - QImage *m_image; + TQTimer m_timer; + TQImage *m_image; KClockPainter *m_scale; KClockPainter *m_clock; @@ -83,11 +83,11 @@ class KClockSaver : public KScreenSaver int m_minute; int m_second; - QColor m_bgndColor; - QColor m_scaleColor; - QColor m_hourColor; - QColor m_minColor; - QColor m_secColor; + TQColor m_bgndColor; + TQColor m_scaleColor; + TQColor m_hourColor; + TQColor m_minColor; + TQColor m_secColor; }; @@ -95,7 +95,7 @@ class KClockSetup : public KDialogBase { Q_OBJECT public: - KClockSetup(QWidget *parent = 0, const char *name = 0); + KClockSetup(TQWidget *parent = 0, const char *name = 0); ~KClockSetup(); protected: void readSettings(); @@ -104,22 +104,22 @@ class KClockSetup : public KDialogBase void slotOk(); void slotHelp(); - void slotBgndColor(const QColor &); - void slotScaleColor(const QColor &); - void slotHourColor(const QColor &); - void slotMinColor(const QColor &); - void slotSecColor(const QColor &); + void slotBgndColor(const TQColor &); + void slotScaleColor(const TQColor &); + void slotHourColor(const TQColor &); + void slotMinColor(const TQColor &); + void slotSecColor(const TQColor &); void slotSliderMoved(int); void slotKeepCenteredChanged(int); private: KClockSaver *m_saver; - QColor m_bgndColor; - QColor m_scaleColor; - QColor m_hourColor; - QColor m_minColor; - QColor m_secColor; + TQColor m_bgndColor; + TQColor m_scaleColor; + TQColor m_hourColor; + TQColor m_minColor; + TQColor m_secColor; int m_size; bool m_keepCentered; diff --git a/kscreensaver/kdesavers/kvm.cpp b/kscreensaver/kdesavers/kvm.cpp index 9d7a32fa..e0d54265 100644 --- a/kscreensaver/kdesavers/kvm.cpp +++ b/kscreensaver/kdesavers/kvm.cpp @@ -33,12 +33,12 @@ /* for AIX at least */ #include <time.h> -#include <qcolor.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qslider.h> -#include <qpainter.h> -#include <qbitmap.h> +#include <tqcolor.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqslider.h> +#include <tqpainter.h> +#include <tqbitmap.h> #include <kapplication.h> #include <kconfig.h> @@ -70,7 +70,7 @@ extern "C" return new kVmSaver( id ); } - KDE_EXPORT QDialog *kss_setup() + KDE_EXPORT TQDialog *kss_setup() { return new kVmSetup(); } @@ -81,13 +81,13 @@ extern "C" static void load_images (m_state *state) { - if ( QPixmap::defaultDepth() > 1 ) + if ( TQPixmap::defaultDepth() > 1 ) { - state->images = QPixmap( vm ); + state->images = TQPixmap( vm ); } else { - state->images = QBitmap( vm_width, vm_height, vm_bits ); + state->images = TQBitmap( vm_width, vm_height, vm_bits ); } state->image_width = state->images.width(); state->image_height = state->images.height(); @@ -96,7 +96,7 @@ load_images (m_state *state) static m_state * -init_pool ( QWidget *w ) +init_pool ( TQWidget *w ) { m_state *state = new m_state; state->w = w; @@ -165,7 +165,7 @@ draw_pool (m_state *state) if( state->show_threads ) if( state->modified[index] == 1 ) pos_x += 2; - QPainter p(state->w); + TQPainter p(state->w); p.setPen( Qt::green ); p.setBrush( Qt::black ); p.drawPixmap( state->grid_margin_x + x*state->char_width, @@ -184,7 +184,7 @@ kVmSaver::kVmSaver( WId id ) : KScreenSaver( id ) { readSettings(); - colorContext = QColor::enterAllocContext(); + colorContext = TQColor::enterAllocContext(); blank(); setSpeed( speed ); @@ -194,7 +194,7 @@ kVmSaver::kVmSaver( WId id ) : KScreenSaver( id ) pool_state = init_pool( this ); vm_default_initstate( time(0), &(pool_state->pool->vm_random_data) ); - connect( &timer, SIGNAL( timeout() ), SLOT( slotTimeout() ) ); + connect( &timer, TQT_SIGNAL( timeout() ), TQT_SLOT( slotTimeout() ) ); timer.start( 100 - speed ); } @@ -203,8 +203,8 @@ kVmSaver::~kVmSaver() timer.stop(); vm_done_pool( pool_state->pool ); delete[] pool_state->modified; - QColor::leaveAllocContext(); - QColor::destroyAllocContext( colorContext ); + TQColor::leaveAllocContext(); + TQColor::destroyAllocContext( colorContext ); } void kVmSaver::blank() @@ -273,49 +273,49 @@ void kVmSaver::slotTimeout() //----------------------------------------------------------------------------- -kVmSetup::kVmSetup( QWidget *parent, const char *name ) +kVmSetup::kVmSetup( TQWidget *parent, const char *name ) : KDialogBase( parent, name, true, i18n( "Setup Virtual Machine" ), Ok|Cancel|Help, Ok, true ) { readSettings(); setButtonText( Help, i18n( "A&bout" ) ); - QWidget *main = makeMainWidget(); + TQWidget *main = makeMainWidget(); - QHBoxLayout *tl = new QHBoxLayout( main, 0, spacingHint() ); - QVBoxLayout *tl1 = new QVBoxLayout(); + TQHBoxLayout *tl = new TQHBoxLayout( main, 0, spacingHint() ); + TQVBoxLayout *tl1 = new TQVBoxLayout(); tl->addLayout(tl1); - QLabel *label = new QLabel( i18n("Virtual machine speed:"), main ); + TQLabel *label = new TQLabel( i18n("Virtual machine speed:"), main ); tl1->addWidget(label); - QSlider *slider = new QSlider( QSlider::Horizontal, main ); + TQSlider *slider = new TQSlider( TQSlider::Horizontal, main ); slider->setMinimumSize( 120, 20 ); slider->setRange( 0, 100 ); slider->setSteps( 10, 20 ); - slider->setTickmarks( QSlider::Below ); + slider->setTickmarks( TQSlider::Below ); slider->setTickInterval( 10 ); slider->setValue( speed ); - connect( slider, SIGNAL( valueChanged( int ) ), - SLOT( slotSpeed( int ) ) ); + connect( slider, TQT_SIGNAL( valueChanged( int ) ), + TQT_SLOT( slotSpeed( int ) ) ); tl1->addWidget(slider); - label = new QLabel( i18n("Display update speed:"), main ); + label = new TQLabel( i18n("Display update speed:"), main ); tl1->addWidget(label); - slider = new QSlider( QSlider::Horizontal, main ); + slider = new TQSlider( TQSlider::Horizontal, main ); slider->setMinimumSize( 120, 20 ); slider->setRange( 0, MAX_REFRESH_TIMEOUT ); slider->setSteps( MAX_REFRESH_TIMEOUT/10, MAX_REFRESH_TIMEOUT/5 ); - slider->setTickmarks( QSlider::Below ); + slider->setTickmarks( TQSlider::Below ); slider->setTickInterval( MAX_REFRESH_TIMEOUT/10 ); slider->setValue( MAX_REFRESH_TIMEOUT - refreshTimeout ); - connect( slider, SIGNAL( valueChanged( int ) ), - SLOT( slotRefreshTimeout( int ) ) ); + connect( slider, TQT_SIGNAL( valueChanged( int ) ), + TQT_SLOT( slotRefreshTimeout( int ) ) ); tl1->addWidget(slider); tl1->addStretch(); - preview = new QWidget( main ); + preview = new TQWidget( main ); preview->setFixedSize( 220, 165 ); preview->show(); // otherwise saver does not get correct size saver = new kVmSaver( preview->winId() ); @@ -362,7 +362,7 @@ void kVmSetup::slotOk() KConfig *config = KGlobal::config(); config->setGroup( "Settings" ); - QString sspeed; + TQString sspeed; sspeed.setNum( speed ); config->writeEntry( "Speed", sspeed ); sspeed.setNum( refreshTimeout ); diff --git a/kscreensaver/kdesavers/kvm.h b/kscreensaver/kdesavers/kvm.h index 44c7eeb3..0f705e21 100644 --- a/kscreensaver/kdesavers/kvm.h +++ b/kscreensaver/kdesavers/kvm.h @@ -6,8 +6,8 @@ #ifndef __KVM_H__ #define __KVM_H__ -#include <qtimer.h> -#include <qptrlist.h> +#include <tqtimer.h> +#include <tqptrlist.h> #include <kdialogbase.h> #include <kscreensaver.h> @@ -23,7 +23,7 @@ extern "C" { #define MAX_REFRESH_TIMEOUT 40 typedef struct { - QWidget *w; + TQWidget *w; int grid_width, grid_height; int grid_margin_x; int grid_margin_y; @@ -34,7 +34,7 @@ typedef struct { char* modified; int show_threads; - QPixmap images; + TQPixmap images; int image_width, image_height; int nglyphs; @@ -61,7 +61,7 @@ protected slots: void slotTimeout(); protected: - QTimer timer; + TQTimer timer; int colorContext; int speed; @@ -75,7 +75,7 @@ class kVmSetup : public KDialogBase { Q_OBJECT public: - kVmSetup( QWidget *parent = NULL, const char *name = NULL ); + kVmSetup( TQWidget *parent = NULL, const char *name = NULL ); ~kVmSetup(); protected: void readSettings(); @@ -87,7 +87,7 @@ private slots: void slotHelp(); private: - QWidget *preview; + TQWidget *preview; kVmSaver *saver; int speed; diff --git a/kscreensaver/kdesavers/lines.cpp b/kscreensaver/kdesavers/lines.cpp index fbe31056..02d895e6 100644 --- a/kscreensaver/kdesavers/lines.cpp +++ b/kscreensaver/kdesavers/lines.cpp @@ -11,9 +11,9 @@ #include <config.h> #include <stdlib.h> #include <time.h> -#include <qcolor.h> -#include <qlabel.h> -#include <qslider.h> +#include <tqcolor.h> +#include <tqlabel.h> +#include <tqslider.h> #include <kconfig.h> #include <kapplication.h> #include <kmessagebox.h> @@ -23,10 +23,10 @@ #include "lines.h" #include "lines.moc" -#include <qlayout.h> +#include <tqlayout.h> #include <klocale.h> #include <kglobal.h> -#include <qpainter.h> +#include <tqpainter.h> #define MAXLENGTH 256 @@ -42,7 +42,7 @@ extern "C" return new kLinesSaver( id ); } - KDE_EXPORT QDialog *kss_setup() + KDE_EXPORT TQDialog *kss_setup() { return new kLinesSetup(); } @@ -112,66 +112,66 @@ void Lines::turn(const int& w, const int& h){ //----------------------------------------------------------------------------- // dialog to setup screen saver parameters // -kLinesSetup::kLinesSetup(QWidget *parent, const char *name) +kLinesSetup::kLinesSetup(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n( "Setup Lines Screen Saver" ), Ok|Cancel|Help, Ok, true ), saver( 0 ), length( 10 ), speed( 50 ) { readSettings(); setButtonText( Help, i18n( "A&bout" ) ); - QWidget *main = makeMainWidget(); + TQWidget *main = makeMainWidget(); - QHBoxLayout *tl = new QHBoxLayout(main, 0, spacingHint()); - QVBoxLayout *tl1 = new QVBoxLayout; + TQHBoxLayout *tl = new TQHBoxLayout(main, 0, spacingHint()); + TQVBoxLayout *tl1 = new QVBoxLayout; tl->addLayout(tl1); - QLabel *label=new QLabel(i18n("Length:"), main); + TQLabel *label=new TQLabel(i18n("Length:"), main); tl1->addWidget(label); - QSlider *sb= new QSlider(1, MAXLENGTH+1, 16, length, QSlider::Horizontal, + TQSlider *sb= new TQSlider(1, MAXLENGTH+1, 16, length, TQSlider::Horizontal, main); sb->setMinimumSize(120, 20); - sb->setTickmarks(QSlider::Below); + sb->setTickmarks(TQSlider::Below); sb->setTickInterval(32); - connect(sb, SIGNAL(valueChanged(int)), SLOT(slotLength(int))); + connect(sb, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotLength(int))); tl1->addWidget(sb); - label=new QLabel(i18n("Speed:"), main); + label=new TQLabel(i18n("Speed:"), main); tl1->addWidget(label); - sb = new QSlider(0, 100, 10, speed, QSlider::Horizontal, main); + sb = new TQSlider(0, 100, 10, speed, TQSlider::Horizontal, main); sb->setMinimumSize(120, 20); - sb->setTickmarks(QSlider::Below); + sb->setTickmarks(TQSlider::Below); sb->setTickInterval(10); - connect( sb, SIGNAL( valueChanged( int ) ), SLOT( slotSpeed( int ) ) ); + connect( sb, TQT_SIGNAL( valueChanged( int ) ), TQT_SLOT( slotSpeed( int ) ) ); tl1->addWidget(sb); - label=new QLabel(i18n("Beginning:"), main); + label=new TQLabel(i18n("Beginning:"), main); tl1->addWidget(label); colorPush0=new KColorButton(colstart, main); - connect(colorPush0, SIGNAL(changed(const QColor &)), - SLOT(slotColstart(const QColor &))); + connect(colorPush0, TQT_SIGNAL(changed(const TQColor &)), + TQT_SLOT(slotColstart(const TQColor &))); tl1->addWidget(colorPush0); - label=new QLabel(i18n("Middle:"), main); + label=new TQLabel(i18n("Middle:"), main); tl1->addWidget(label); colorPush1=new KColorButton(colmid, main); - connect(colorPush1, SIGNAL(changed(const QColor &)), - SLOT(slotColmid(const QColor &))); + connect(colorPush1, TQT_SIGNAL(changed(const TQColor &)), + TQT_SLOT(slotColmid(const TQColor &))); tl1->addWidget(colorPush1); - label=new QLabel(i18n("End:"), main); + label=new TQLabel(i18n("End:"), main); tl1->addWidget(label); colorPush2=new KColorButton(colend, main); - connect(colorPush2, SIGNAL(changed(const QColor &)), - SLOT(slotColend(const QColor &))); + connect(colorPush2, TQT_SIGNAL(changed(const TQColor &)), + TQT_SLOT(slotColend(const TQColor &))); tl1->addWidget(colorPush2); tl1->addStretch(); - preview = new QWidget( main ); + preview = new TQWidget( main ); preview->setFixedSize( 220, 170 ); preview->setBackgroundColor( black ); preview->show(); // otherwise saver does not get correct size @@ -189,7 +189,7 @@ void kLinesSetup::readSettings(){ KConfig *config = KGlobal::config(); config->setGroup( "Settings" ); - QString str; + TQString str; length = config->readNumEntry("Length", length); if(length>MAXLENGTH) length=MAXLENGTH; @@ -220,17 +220,17 @@ void kLinesSetup::slotSpeed(int num){ if(saver) saver->setSpeed(speed); } -void kLinesSetup::slotColstart(const QColor &col){ +void kLinesSetup::slotColstart(const TQColor &col){ colstart = col; if(saver) saver->setColor(colstart, colmid, colend); } -void kLinesSetup::slotColmid(const QColor &col){ +void kLinesSetup::slotColmid(const TQColor &col){ colmid = col; if(saver) saver->setColor(colstart, colmid, colend); } -void kLinesSetup::slotColend(const QColor &col){ +void kLinesSetup::slotColend(const TQColor &col){ colend = col; if(saver) saver->setColor(colstart, colmid, colend); } @@ -247,15 +247,15 @@ void kLinesSetup::slotOk(){ KConfig *config = KGlobal::config(); config->setGroup("Settings"); - QString slength; + TQString slength; slength.setNum(length); config->writeEntry("Length", slength); - QString sspeed; + TQString sspeed; sspeed.setNum( speed ); config->writeEntry( "Speed", sspeed ); - QString colName0, colName1, colName2; + TQString colName0, colName1, colName2; colName0.sprintf("#%02x%02x%02x", colstart.red(), colstart.green(), colstart.blue() ); config->writeEntry( "StartColor", colName0 ); @@ -278,18 +278,18 @@ void kLinesSetup::slotOk(){ kLinesSaver::kLinesSaver( WId id ) : KScreenSaver( id ){ readSettings(); lines=new Lines(numLines); - colorContext=QColor::enterAllocContext(); + colorContext=TQColor::enterAllocContext(); blank(); initialiseColor(); initialiseLines(); timer.start(speed); - connect(&timer, SIGNAL(timeout()), SLOT(slotTimeout())); + connect(&timer, TQT_SIGNAL(timeout()), TQT_SLOT(slotTimeout())); } kLinesSaver::~kLinesSaver(){ timer.stop(); - QColor::leaveAllocContext(); - QColor::destroyAllocContext(colorContext); + TQColor::leaveAllocContext(); + TQColor::destroyAllocContext(colorContext); delete lines; } @@ -310,7 +310,7 @@ void kLinesSaver::setSpeed(int spd){ timer.start(speed); } -void kLinesSaver::setColor(const QColor& cs, const QColor& cm, const QColor& ce){ +void kLinesSaver::setColor(const TQColor& cs, const TQColor& cm, const TQColor& ce){ colstart=cs; colmid=cm; colend=ce; @@ -339,7 +339,7 @@ void kLinesSaver::slotTimeout(){ int col=0; lines->reset(); - QPainter p( this ); + TQPainter p( this ); p.setPen( black ); for(i=0; i<numLines; i++){ diff --git a/kscreensaver/kdesavers/lines.h b/kscreensaver/kdesavers/lines.h index d3f1062c..c5e7f42a 100644 --- a/kscreensaver/kdesavers/lines.h +++ b/kscreensaver/kdesavers/lines.h @@ -8,8 +8,8 @@ #ifndef __LINES_H__ #define __LINES_H__ -#include <qtimer.h> -#include <qptrlist.h> +#include <tqtimer.h> +#include <tqptrlist.h> #include <kdialogbase.h> #include <krandomsequence.h> @@ -44,7 +44,7 @@ class kLinesSaver:public KScreenSaver{ void setLines(int len); void setSpeed(int spd); - void setColor(const QColor&, const QColor&, const QColor&); + void setColor(const TQColor&, const TQColor&, const TQColor&); private: void readSettings(); @@ -57,11 +57,11 @@ class kLinesSaver:public KScreenSaver{ protected: KRandomSequence rnd; - QTimer timer; + TQTimer timer; unsigned numLines; int colorContext, speed; - QColor colors[64]; - QColor colstart, colmid, colend; + TQColor colors[64]; + TQColor colstart, colmid, colend; double colscale; Lines* lines; }; @@ -69,7 +69,7 @@ class kLinesSaver:public KScreenSaver{ class kLinesSetup : public KDialogBase{ Q_OBJECT public: - kLinesSetup(QWidget *parent=NULL, const char *name=NULL); + kLinesSetup(TQWidget *parent=NULL, const char *name=NULL); ~kLinesSetup(); protected: @@ -78,18 +78,18 @@ class kLinesSetup : public KDialogBase{ private slots: void slotLength(int); void slotSpeed(int); - void slotColstart(const QColor &); - void slotColmid(const QColor &); - void slotColend(const QColor &); + void slotColstart(const TQColor &); + void slotColmid(const TQColor &); + void slotColend(const TQColor &); void slotOk(); void slotHelp(); private: KColorButton *colorPush0, *colorPush1, *colorPush2; - QWidget *preview; + TQWidget *preview; kLinesSaver *saver; int length, speed; - QColor colstart, colmid, colend; + TQColor colstart, colmid, colend; }; #endif diff --git a/kscreensaver/kdesavers/lorenz.cpp b/kscreensaver/kdesavers/lorenz.cpp index c9017bb0..7c96a152 100644 --- a/kscreensaver/kdesavers/lorenz.cpp +++ b/kscreensaver/kdesavers/lorenz.cpp @@ -11,11 +11,11 @@ #include <math.h> #include <stdlib.h> -#include <qpainter.h> -#include <qslider.h> -#include <qlayout.h> -#include <qcolor.h> -#include <qlabel.h> +#include <tqpainter.h> +#include <tqslider.h> +#include <tqlayout.h> +#include <tqcolor.h> +#include <tqlabel.h> #include <kapplication.h> #include <klocale.h> @@ -38,7 +38,7 @@ extern "C" return new KLorenzSaver( id ); } - KDE_EXPORT QDialog *kss_setup() + KDE_EXPORT TQDialog *kss_setup() { return new KLorenzSetup(); } @@ -66,80 +66,80 @@ extern "C" //----------------------------------------------------------------------------- // dialog to setup screen saver parameters // -KLorenzSetup::KLorenzSetup( QWidget *parent, const char *name ) +KLorenzSetup::KLorenzSetup( TQWidget *parent, const char *name ) : KDialogBase( parent, name, true, i18n( "Setup Lorenz Attractor" ), Ok|Cancel|Default|Help, Ok, true ) { readSettings(); setButtonText( Help, i18n( "A&bout" ) ); - QWidget *main = makeMainWidget(); + TQWidget *main = makeMainWidget(); - QHBoxLayout *tl = new QHBoxLayout( main, 0, spacingHint() ); - QVBoxLayout *tl1 = new QVBoxLayout; + TQHBoxLayout *tl = new TQHBoxLayout( main, 0, spacingHint() ); + TQVBoxLayout *tl1 = new QVBoxLayout; tl->addLayout(tl1); - QLabel *label = new QLabel( i18n("Speed:"), main ); + TQLabel *label = new TQLabel( i18n("Speed:"), main ); tl1->addWidget(label); - sps = new QSlider(MINSPEED, MAXSPEED, 10, speed, QSlider::Horizontal, main); + sps = new TQSlider(MINSPEED, MAXSPEED, 10, speed, TQSlider::Horizontal, main); sps->setMinimumSize( 120, 20 ); - sps->setTickmarks(QSlider::Below); + sps->setTickmarks(TQSlider::Below); sps->setTickInterval(150); - connect( sps, SIGNAL( valueChanged( int ) ), SLOT( slotSpeed( int ) ) ); + connect( sps, TQT_SIGNAL( valueChanged( int ) ), TQT_SLOT( slotSpeed( int ) ) ); tl1->addWidget(sps); - label = new QLabel( i18n("Epoch:"), main ); + label = new TQLabel( i18n("Epoch:"), main ); tl1->addWidget(label); - eps = new QSlider(MINEPOCH, MAXEPOCH, 100, epoch, QSlider::Horizontal, main); + eps = new TQSlider(MINEPOCH, MAXEPOCH, 100, epoch, TQSlider::Horizontal, main); eps->setMinimumSize( 120, 20 ); - eps->setTickmarks(QSlider::Below); + eps->setTickmarks(TQSlider::Below); eps->setTickInterval(3000); - connect( eps, SIGNAL( valueChanged( int ) ), SLOT( slotEpoch( int ) ) ); + connect( eps, TQT_SIGNAL( valueChanged( int ) ), TQT_SLOT( slotEpoch( int ) ) ); tl1->addWidget(eps); - label = new QLabel( i18n("Color rate:"), main ); + label = new TQLabel( i18n("Color rate:"), main ); tl1->addWidget(label); - crs = new QSlider(MINCOLOR, MAXCOLOR, 5, crate, QSlider::Horizontal, main); + crs = new TQSlider(MINCOLOR, MAXCOLOR, 5, crate, TQSlider::Horizontal, main); crs->setMinimumSize( 120, 20 ); - crs->setTickmarks(QSlider::Below); + crs->setTickmarks(TQSlider::Below); crs->setTickInterval(10); - connect( crs, SIGNAL( valueChanged( int ) ), SLOT( slotCRate( int ) ) ); + connect( crs, TQT_SIGNAL( valueChanged( int ) ), TQT_SLOT( slotCRate( int ) ) ); tl1->addWidget(crs); - label = new QLabel( i18n("Rotation Z:"), main ); + label = new TQLabel( i18n("Rotation Z:"), main ); tl1->addWidget(label); - zrs = new QSlider(MINZROT, MAXZROT, 18, zrot, QSlider::Horizontal, main); + zrs = new TQSlider(MINZROT, MAXZROT, 18, zrot, TQSlider::Horizontal, main); zrs->setMinimumSize( 120, 20 ); - zrs->setTickmarks(QSlider::Below); + zrs->setTickmarks(TQSlider::Below); zrs->setTickInterval(36); - connect( zrs, SIGNAL( valueChanged( int ) ), SLOT( slotZRot( int ) ) ); + connect( zrs, TQT_SIGNAL( valueChanged( int ) ), TQT_SLOT( slotZRot( int ) ) ); tl1->addWidget(zrs); - label = new QLabel( i18n("Rotation Y:"), main ); + label = new TQLabel( i18n("Rotation Y:"), main ); tl1->addWidget(label); - yrs = new QSlider(MINYROT, MAXYROT, 18, yrot, QSlider::Horizontal, main); + yrs = new TQSlider(MINYROT, MAXYROT, 18, yrot, TQSlider::Horizontal, main); yrs->setMinimumSize( 120, 20 ); - yrs->setTickmarks(QSlider::Below); + yrs->setTickmarks(TQSlider::Below); yrs->setTickInterval(36); - connect( yrs, SIGNAL( valueChanged( int ) ), SLOT( slotYRot( int ) ) ); + connect( yrs, TQT_SIGNAL( valueChanged( int ) ), TQT_SLOT( slotYRot( int ) ) ); tl1->addWidget(yrs); - label = new QLabel( i18n("Rotation X:"), main ); + label = new TQLabel( i18n("Rotation X:"), main ); tl1->addWidget(label); - xrs = new QSlider(MINXROT, MAXXROT, 18, xrot, QSlider::Horizontal, main); + xrs = new TQSlider(MINXROT, MAXXROT, 18, xrot, TQSlider::Horizontal, main); xrs->setMinimumSize( 120, 20 ); - xrs->setTickmarks(QSlider::Below); + xrs->setTickmarks(TQSlider::Below); xrs->setTickInterval(36); - connect( xrs, SIGNAL( valueChanged( int ) ), SLOT( slotXRot( int ) ) ); + connect( xrs, TQT_SIGNAL( valueChanged( int ) ), TQT_SLOT( slotXRot( int ) ) ); tl1->addWidget(xrs); - preview = new QWidget( main ); + preview = new TQWidget( main ); preview->setFixedSize( 220, 165 ); preview->setBackgroundColor( black ); preview->show(); // otherwise saver does not get correct size @@ -441,12 +441,12 @@ KLorenzSaver::KLorenzSaver( WId id ) : KScreenSaver( id ) mat = new Matrix3D(); updateMatrix(); - colorContext = QColor::enterAllocContext(); + colorContext = TQColor::enterAllocContext(); setBackgroundColor( black ); newEpoch(); timer.start( 10 ); - connect( &timer, SIGNAL( timeout() ), SLOT( drawOnce() ) ); + connect( &timer, TQT_SIGNAL( timeout() ), TQT_SLOT( drawOnce() ) ); } KLorenzSaver::~KLorenzSaver() @@ -454,8 +454,8 @@ KLorenzSaver::~KLorenzSaver() delete mat; mat=0; timer.stop(); - QColor::leaveAllocContext(); - QColor::destroyAllocContext( colorContext ); + TQColor::leaveAllocContext(); + TQColor::destroyAllocContext( colorContext ); } // read configuration settings from config file @@ -544,7 +544,7 @@ void KLorenzSaver::drawOnce() double kx, ky, kz, dx, dy, dz; const double h = 0.0001; const double tqh = h * 3.0 / 4.0; - QPainter p(this); + TQPainter p(this); for (int i=0; i<speed; i++) { // Runge-Kutta formula @@ -557,7 +557,7 @@ void KLorenzSaver::drawOnce() mat->transform(x,y,z,kx,ky,kz); // Choose a color p.setPen( - QColor((int)(sin(t*crate/pi)*127+128), + TQColor((int)(sin(t*crate/pi)*127+128), (int)(sin(t*crate/(pi-1))*127+128), (int)(sin(t*crate/(pi-2))*127+128)).pixel() ); // Draw a point diff --git a/kscreensaver/kdesavers/lorenz.h b/kscreensaver/kdesavers/lorenz.h index f666db71..9d9390b4 100644 --- a/kscreensaver/kdesavers/lorenz.h +++ b/kscreensaver/kdesavers/lorenz.h @@ -11,8 +11,8 @@ #ifndef __LORENZKSCRN_H__ #define __LORENZKSCRN_H__ -#include <qtimer.h> -#include <qcolor.h> +#include <tqtimer.h> +#include <tqcolor.h> #include <kscreensaver.h> #include <kdialogbase.h> @@ -38,7 +38,7 @@ protected slots: void drawOnce(); protected: - QTimer timer; + TQTimer timer; int colorContext; private: @@ -57,7 +57,7 @@ class KLorenzSetup : public KDialogBase { Q_OBJECT public: - KLorenzSetup(QWidget *parent = 0, const char *name = 0 ); + KLorenzSetup(TQWidget *parent = 0, const char *name = 0 ); ~KLorenzSetup(); protected: @@ -76,8 +76,8 @@ private slots: void slotDefault(); private: - QWidget *preview; - QSlider *sps, *eps, *zrs, *yrs, *xrs, *crs; + TQWidget *preview; + TQSlider *sps, *eps, *zrs, *yrs, *xrs, *crs; KLorenzSaver *saver; int speed, epoch, zrot, yrot, xrot, crate; }; diff --git a/kscreensaver/kdesavers/pendulum.cpp b/kscreensaver/kdesavers/pendulum.cpp index 801b74dd..18f03be8 100644 --- a/kscreensaver/kdesavers/pendulum.cpp +++ b/kscreensaver/kdesavers/pendulum.cpp @@ -30,12 +30,12 @@ #include <cstdlib> // Qt headers -#include <qlineedit.h> -#include <qspinbox.h> -#include <qvalidator.h> -#include <qcolordialog.h> -#include <qpushbutton.h> -#include <qtooltip.h> +#include <tqlineedit.h> +#include <tqspinbox.h> +#include <tqvalidator.h> +#include <tqcolordialog.h> +#include <tqpushbutton.h> +#include <tqtooltip.h> // KDE headers #include <klocale.h> #include <kconfig.h> @@ -67,7 +67,7 @@ extern "C" } /// function to create setup dialog for screen saver - KDE_EXPORT QDialog* kss_setup() + KDE_EXPORT TQDialog* kss_setup() { return new KPendulumSetup(); } @@ -129,8 +129,8 @@ std::valarray<double> PendulumOdeSolver::f( // Rotation: screen saver widget //----------------------------------------------------------------------------- -PendulumGLWidget::PendulumGLWidget(QWidget* parent, const char* name) - : QGLWidget(parent, name), +PendulumGLWidget::PendulumGLWidget(TQWidget* parent, const char* name) + : TQGLWidget(parent, name), eyeR(30), // eye coordinates (polar) eyeTheta(M_PI*0.45), eyePhi(0), @@ -180,7 +180,7 @@ void PendulumGLWidget::setLengths(const double& _l1, const double& _l2) l2 = static_cast<GLfloat>(_l2); } -void PendulumGLWidget::setBarColor(const QColor& c) +void PendulumGLWidget::setBarColor(const TQColor& c) { if (c.isValid()) { @@ -188,14 +188,14 @@ void PendulumGLWidget::setBarColor(const QColor& c) } } -void PendulumGLWidget::setM1Color(const QColor& c) +void PendulumGLWidget::setM1Color(const TQColor& c) { if (c.isValid()) { m_m1Color = c; } } -void PendulumGLWidget::setM2Color(const QColor& c) +void PendulumGLWidget::setM2Color(const TQColor& c) { if (c.isValid()) { @@ -207,7 +207,7 @@ void PendulumGLWidget::setM2Color(const QColor& c) void PendulumGLWidget::initializeGL(void) { - qglClearColor(QColor(black)); // set color to clear the background + qglClearColor(TQColor(black)); // set color to clear the background glClearDepth(1); // depth buffer setup glEnable(GL_DEPTH_TEST); // depth testing @@ -377,9 +377,9 @@ KPendulumSaver::KPendulumSaver(WId id) : glArea->show(); // show gl widget // set up and start cyclic timer - timer = new QTimer(this); + timer = new TQTimer(this); timer->start(deltaT, TRUE); - connect(timer, SIGNAL(timeout()), this, SLOT(doTimeStep())); + connect(timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(doTimeStep())); } KPendulumSaver::~KPendulumSaver() @@ -465,38 +465,38 @@ void KPendulumSaver::initData() } -void KPendulumSaver::setBarColor(const QColor& c) +void KPendulumSaver::setBarColor(const TQColor& c) { glArea->setBarColor(c); } -QColor KPendulumSaver::barColor(void) const +TQColor KPendulumSaver::barColor(void) const { return glArea->barColor(); } -const QColor KPendulumSaver::barColorDefault(255, 255, 127); +const TQColor KPendulumSaver::barColorDefault(255, 255, 127); -void KPendulumSaver::setM1Color(const QColor& c) +void KPendulumSaver::setM1Color(const TQColor& c) { glArea->setM1Color(c); } -QColor KPendulumSaver::m1Color(void) const +TQColor KPendulumSaver::m1Color(void) const { return glArea->m1Color(); } -const QColor KPendulumSaver::m1ColorDefault(170, 0, 127); +const TQColor KPendulumSaver::m1ColorDefault(170, 0, 127); -void KPendulumSaver::setM2Color(const QColor& c) +void KPendulumSaver::setM2Color(const TQColor& c) { glArea->setM2Color(c); } -QColor KPendulumSaver::m2Color(void) const +TQColor KPendulumSaver::m2Color(void) const { return glArea->m2Color(); } -const QColor KPendulumSaver::m2ColorDefault( 85, 170, 127); +const TQColor KPendulumSaver::m2ColorDefault( 85, 170, 127); void KPendulumSaver::setMassRatio(const double& massRatio) @@ -660,7 +660,7 @@ void KPendulumSaver::doTimeStep() // public slot of KPendulumSaver, forward resize event to public slot of glArea // to allow the resizing of the gl area withing the setup dialog -void KPendulumSaver::resizeGlArea(QResizeEvent* e) +void KPendulumSaver::resizeGlArea(TQResizeEvent* e) { glArea->resize(e->size()); } @@ -669,7 +669,7 @@ void KPendulumSaver::resizeGlArea(QResizeEvent* e) // KPendulumSetup: dialog to setup screen saver parameters //----------------------------------------------------------------------------- -KPendulumSetup::KPendulumSetup(QWidget* parent, const char* name) +KPendulumSetup::KPendulumSetup(TQWidget* parent, const char* name) : KPendulumSetupUi(parent, name), // create saver and give it the WinID of the preview area saver(new KPendulumSaver(preview->winId())) @@ -679,19 +679,19 @@ KPendulumSetup::KPendulumSetup(QWidget* parent, const char* name) setModal(TRUE); // create input validators - mEdit->setValidator(new QDoubleValidator( + mEdit->setValidator(new TQDoubleValidator( KPendulumSaver::massRatioLimitLower, KPendulumSaver::massRatioLimitUpper, 5, mEdit)); - lEdit->setValidator(new QDoubleValidator( + lEdit->setValidator(new TQDoubleValidator( KPendulumSaver::lengthRatioLimitLower, KPendulumSaver::lengthRatioLimitUpper, 5, lEdit)); - gEdit->setValidator(new QDoubleValidator( + gEdit->setValidator(new TQDoubleValidator( KPendulumSaver::gLimitLower, KPendulumSaver::gLimitUpper, 5, gEdit)); - eEdit->setValidator(new QDoubleValidator( + eEdit->setValidator(new TQDoubleValidator( KPendulumSaver::ELimitLower, KPendulumSaver::ELimitUpper, 5, eEdit)); @@ -701,27 +701,27 @@ KPendulumSetup::KPendulumSetup(QWidget* parent, const char* name) persSpinBox->setMaxValue(KPendulumSaver::persChangeIntervalLimitUpper); // set tool tips of editable fields - QToolTip::add( + TQToolTip::add( mEdit, i18n("Ratio of 2nd mass to sum of both masses.\nValid values from %1 to %2.") .arg(KPendulumSaver::massRatioLimitLower, 0, 'f', 2) .arg(KPendulumSaver::massRatioLimitUpper, 0, 'f', 2)); - QToolTip::add( + TQToolTip::add( lEdit, i18n("Ratio of 2nd pendulum part length to the sum of both part lengths.\nValid values from %1 to %2.") .arg(KPendulumSaver::lengthRatioLimitLower, 0, 'f', 2) .arg(KPendulumSaver::lengthRatioLimitUpper, 0, 'f', 2)); - QToolTip::add( + TQToolTip::add( gEdit, i18n("Gravitational constant in arbitrary units.\nValid values from %1 to %2.") .arg(KPendulumSaver::gLimitLower, 0, 'f', 2) .arg(KPendulumSaver::gLimitUpper, 0, 'f', 2)); - QToolTip::add( + TQToolTip::add( eEdit, i18n("Energy in units of the maximum potential energy of the given configuration.\nValid values from %1 to %2.") .arg(KPendulumSaver::ELimitLower, 0, 'f', 2) .arg(KPendulumSaver::ELimitUpper, 0, 'f', 2)); - QToolTip::add( + TQToolTip::add( persSpinBox, i18n("Time in seconds after which a random perspective change occurs.\nValid values from %1 to %2.") .arg(KPendulumSaver::persChangeIntervalLimitLower) @@ -735,7 +735,7 @@ KPendulumSetup::KPendulumSetup(QWidget* parent, const char* name) // has read settings in its constructor // set editable fields with stored values as defaults - QString text; + TQString text; text.setNum(saver->massRatio()); mEdit->setText(text); text.setNum(saver->lengthRatio()); @@ -754,8 +754,8 @@ KPendulumSetup::KPendulumSetup(QWidget* parent, const char* name) // if the preview area is resized it emmits the resized() event which is // caught by the saver. The embedded GlArea is resized to fit into the // preview area. - connect(preview, SIGNAL(resized(QResizeEvent*)), - saver, SLOT(resizeGlArea(QResizeEvent*))); + connect(preview, TQT_SIGNAL(resized(TQResizeEvent*)), + saver, TQT_SLOT(resizeGlArea(TQResizeEvent*))); } KPendulumSetup::~KPendulumSetup() @@ -800,7 +800,7 @@ void KPendulumSetup::mEditLostFocusSlot(void) } else { // write current setting back into input field - QString text; + TQString text; text.setNum(saver->massRatio()); mEdit->setText(text); } @@ -813,7 +813,7 @@ void KPendulumSetup::lEditLostFocusSlot(void) } else { // write current setting back into input field - QString text; + TQString text; text.setNum(saver->lengthRatio()); lEdit->setText(text); } @@ -826,7 +826,7 @@ void KPendulumSetup::gEditLostFocusSlot(void) } else { // write current setting back into input field - QString text; + TQString text; text.setNum(saver->g()); gEdit->setText(text); } @@ -839,7 +839,7 @@ void KPendulumSetup::eEditLostFocusSlot(void) } else { // write current setting back into input field - QString text; + TQString text; text.setNum(saver->E()); eEdit->setText(text); } @@ -851,7 +851,7 @@ void KPendulumSetup::persChangeEnteredSlot(int t) void KPendulumSetup::barColorButtonClickedSlot(void) { - QColor color = QColorDialog::getColor( + TQColor color = QColorDialog::getColor( saver->barColor(), this, "bar color dialog"); if (color.isValid()) { @@ -861,7 +861,7 @@ void KPendulumSetup::barColorButtonClickedSlot(void) } void KPendulumSetup::m1ColorButtonClickedSlot(void) { - QColor color = QColorDialog::getColor( + TQColor color = QColorDialog::getColor( saver->m1Color(), this, "mass 1 color dialog"); if (color.isValid()) { @@ -871,7 +871,7 @@ void KPendulumSetup::m1ColorButtonClickedSlot(void) } void KPendulumSetup::m2ColorButtonClickedSlot(void) { - QColor color = QColorDialog::getColor( + TQColor color = QColorDialog::getColor( saver->m2Color(), this, "mass 2 color dialog"); if (color.isValid()) { diff --git a/kscreensaver/kdesavers/pendulum.h b/kscreensaver/kdesavers/pendulum.h index 2b917a2b..3c26a1ef 100644 --- a/kscreensaver/kdesavers/pendulum.h +++ b/kscreensaver/kdesavers/pendulum.h @@ -16,9 +16,9 @@ // STL headers #include <valarray> // Qt headers -#include <qwidget.h> -#include <qtimer.h> -#include <qgl.h> +#include <tqwidget.h> +#include <tqtimer.h> +#include <tqgl.h> // GL headers #include <GL/glu.h> #include <GL/gl.h> @@ -78,7 +78,7 @@ class PendulumOdeSolver : public RkOdeSolver<double> /** @brief GL widget class for the KPendulum screen saver * - * Class implements QGLWidget to display the KPendulum screen saver. */ + * Class implements TQGLWidget to display the KPendulum screen saver. */ class PendulumGLWidget : public QGLWidget { Q_OBJECT @@ -87,7 +87,7 @@ class PendulumGLWidget : public QGLWidget /** @brief Constructor of KPendulum's GL widget * @param parent parent widget, passed to QGLWidget's constructor * @param name name of widget, passed to QGLWidget's constructor */ - PendulumGLWidget(QWidget* parent=0, const char* name=0); + PendulumGLWidget(TQWidget* parent=0, const char* name=0); /** @brief Destructor of KPendulum's GL widget */ ~PendulumGLWidget(void); @@ -111,22 +111,22 @@ class PendulumGLWidget : public QGLWidget /** @brief set color of the bars * @param c color */ - void setBarColor(const QColor& c); + void setBarColor(const TQColor& c); /** @brief get color of the bars * @return color */ - inline QColor barColor(void) const {return m_barColor;} + inline TQColor barColor(void) const {return m_barColor;} /** @brief set color of mass 1 * @param c color */ - void setM1Color(const QColor& c); + void setM1Color(const TQColor& c); /** @brief get color of mass 1 * @return color */ - inline QColor m1Color(void) const {return m_m1Color;} + inline TQColor m1Color(void) const {return m_m1Color;} /** @brief set color of mass 2 * @param c color */ - void setM2Color(const QColor& c); + void setM2Color(const TQColor& c); /** @brief get color of mass 2 * @return color */ - inline QColor m2Color(void) const {return m_m2Color;} + inline TQColor m2Color(void) const {return m_m2Color;} protected: /** paint the GL view */ @@ -169,11 +169,11 @@ class PendulumGLWidget : public QGLWidget GLUquadricObj* const quadM1; /** color of the pendulum bars */ - QColor m_barColor; + TQColor m_barColor; /** color of the 1. mass */ - QColor m_m1Color; + TQColor m_m1Color; /** color of the 2. mass */ - QColor m_m2Color; + TQColor m_m2Color; }; //-------------------------------------------------------------------- @@ -206,25 +206,25 @@ class KPendulumSaver : public KScreenSaver /* accessors for PendulumGLWidget member variables */ /** Set the displayed bar color of the pendulum */ - void setBarColor(const QColor& c); + void setBarColor(const TQColor& c); /** Get the displayed bar color of the pendulum */ - QColor barColor(void) const; + TQColor barColor(void) const; - static const QColor barColorDefault; + static const TQColor barColorDefault; /** Set the displayed color of the 1. pendulum mass */ - void setM1Color(const QColor& c); + void setM1Color(const TQColor& c); /** Get the displayed color of the 1. pendulum mass */ - QColor m1Color(void) const; + TQColor m1Color(void) const; - static const QColor m1ColorDefault; + static const TQColor m1ColorDefault; /** Set the displayed color of the 2. pendulum mass */ - void setM2Color(const QColor& c); + void setM2Color(const TQColor& c); /** Get the displayed color of the 2. pendulum mass */ - QColor m2Color(void) const; + TQColor m2Color(void) const; - static const QColor m2ColorDefault; + static const TQColor m2ColorDefault; /* accessors for own member variables */ @@ -287,7 +287,7 @@ class KPendulumSaver : public KScreenSaver void doTimeStep(); /** slot is called if setup dialog changes in size and the GL are should be * adjusted */ - void resizeGlArea(QResizeEvent* e); + void resizeGlArea(TQResizeEvent* e); private: /** The ode solver which is used to integrate the equations of motion */ @@ -295,7 +295,7 @@ class KPendulumSaver : public KScreenSaver /** Gl widget of simulation */ PendulumGLWidget* glArea; /** Timer for the real time integration of the eqs. of motion */ - QTimer* timer; + TQTimer* timer; /** Time step size for the integration in milliseconds. 20 ms corresponds to * a frame rate of 50 fps. */ @@ -340,7 +340,7 @@ class KPendulumSetup : public KPendulumSetupUi * * The dialog box is set up and the screen saver object KPendulumSetup::saver * is instantiated. */ - KPendulumSetup(QWidget* parent = 0, const char* name = 0); + KPendulumSetup(TQWidget* parent = 0, const char* name = 0); /** @brief Destructor of the KPendulum screen saver setup dialog * * Only KPendulumSetup::saver is deleted. */ diff --git a/kscreensaver/kdesavers/polygon.cpp b/kscreensaver/kdesavers/polygon.cpp index 55e052f1..8f4dadb2 100644 --- a/kscreensaver/kdesavers/polygon.cpp +++ b/kscreensaver/kdesavers/polygon.cpp @@ -10,17 +10,17 @@ #include <config.h> #include <stdlib.h> #include <time.h> -#include <qcolor.h> -#include <qlabel.h> -#include <qslider.h> -#include <qlayout.h> +#include <tqcolor.h> +#include <tqlabel.h> +#include <tqslider.h> +#include <tqlayout.h> #include <klocale.h> #include <kconfig.h> #include <kglobal.h> #include <kmessagebox.h> #include "polygon.h" -#include <qpainter.h> +#include <tqpainter.h> #include "polygon.moc" @@ -40,7 +40,7 @@ extern "C" return new kPolygonSaver( id ); } - KDE_EXPORT QDialog *kss_setup() + KDE_EXPORT TQDialog *kss_setup() { return new kPolygonSetup(); } @@ -49,53 +49,53 @@ extern "C" //----------------------------------------------------------------------------- // dialog to setup screen saver parameters // -kPolygonSetup::kPolygonSetup( QWidget *parent, const char *name ) +kPolygonSetup::kPolygonSetup( TQWidget *parent, const char *name ) : KDialogBase( parent, name, true, i18n( "Setup Polygon Screen Saver" ), Ok|Cancel|Help, Ok, true ), saver( 0 ), length( 10 ), vertices( 3 ), speed( 50 ) { readSettings(); - QWidget *main = makeMainWidget(); + TQWidget *main = makeMainWidget(); setButtonText( Help, i18n( "A&bout" ) ); - QHBoxLayout *tl = new QHBoxLayout(main, 0, spacingHint()); - QVBoxLayout *tl1 = new QVBoxLayout; + TQHBoxLayout *tl = new TQHBoxLayout(main, 0, spacingHint()); + TQVBoxLayout *tl1 = new QVBoxLayout; tl->addLayout(tl1); - QLabel *label = new QLabel( i18n("Length:"), main ); + TQLabel *label = new TQLabel( i18n("Length:"), main ); tl1->addWidget(label); - QSlider *sb = new QSlider(1, MAXLENGTH, 10, length, QSlider::Horizontal, + TQSlider *sb = new TQSlider(1, MAXLENGTH, 10, length, TQSlider::Horizontal, main ); sb->setMinimumSize( 90, 20 ); - sb->setTickmarks(QSlider::Below); + sb->setTickmarks(TQSlider::Below); sb->setTickInterval(10); - connect( sb, SIGNAL( valueChanged( int ) ), SLOT( slotLength( int ) ) ); + connect( sb, TQT_SIGNAL( valueChanged( int ) ), TQT_SLOT( slotLength( int ) ) ); tl1->addWidget(sb); - label = new QLabel( i18n("Vertices:"), main ); + label = new TQLabel( i18n("Vertices:"), main ); tl1->addWidget(label); - sb = new QSlider(3, MAXVERTICES, 2, vertices, QSlider::Horizontal, main); + sb = new TQSlider(3, MAXVERTICES, 2, vertices, TQSlider::Horizontal, main); sb->setMinimumSize( 90, 20 ); - sb->setTickmarks(QSlider::Below); + sb->setTickmarks(TQSlider::Below); sb->setTickInterval(2); - connect( sb, SIGNAL( valueChanged( int ) ), SLOT( slotVertices( int ) ) ); + connect( sb, TQT_SIGNAL( valueChanged( int ) ), TQT_SLOT( slotVertices( int ) ) ); tl1->addWidget(sb); - label = new QLabel( i18n("Speed:"), main ); + label = new TQLabel( i18n("Speed:"), main ); tl1->addWidget(label); - sb = new QSlider(0, 100, 10, speed, QSlider::Horizontal, main); + sb = new TQSlider(0, 100, 10, speed, TQSlider::Horizontal, main); sb->setMinimumSize( 90, 20 ); - sb->setTickmarks(QSlider::Below); + sb->setTickmarks(TQSlider::Below); sb->setTickInterval(10); - connect( sb, SIGNAL( valueChanged( int ) ), SLOT( slotSpeed( int ) ) ); + connect( sb, TQT_SIGNAL( valueChanged( int ) ), TQT_SLOT( slotSpeed( int ) ) ); tl1->addWidget(sb); tl1->addStretch(); - preview = new QWidget( main ); + preview = new TQWidget( main ); preview->setFixedSize( 220, 170 ); preview->setBackgroundColor( black ); preview->show(); // otherwise saver does not get correct size @@ -162,15 +162,15 @@ void kPolygonSetup::slotOk() KConfig *config = KGlobal::config(); config->setGroup( "Settings" ); - QString slength; + TQString slength; slength.setNum( length ); config->writeEntry( "Length", slength ); - QString svertices; + TQString svertices; svertices.setNum( vertices ); config->writeEntry( "Vertices", svertices ); - QString sspeed; + TQString sspeed; sspeed.setNum( speed ); config->writeEntry( "Speed", sspeed ); @@ -197,7 +197,7 @@ kPolygonSaver::kPolygonSaver( WId id ) : KScreenSaver( id ) readSettings(); directions.resize( numVertices ); - colorContext = QColor::enterAllocContext(); + colorContext = TQColor::enterAllocContext(); blank(); @@ -205,14 +205,14 @@ kPolygonSaver::kPolygonSaver( WId id ) : KScreenSaver( id ) initialisePolygons(); timer.start( speed ); - connect( &timer, SIGNAL( timeout() ), SLOT( slotTimeout() ) ); + connect( &timer, TQT_SIGNAL( timeout() ), TQT_SLOT( slotTimeout() ) ); } kPolygonSaver::~kPolygonSaver() { timer.stop(); - QColor::leaveAllocContext(); - QColor::destroyAllocContext( colorContext ); + TQColor::leaveAllocContext(); + TQColor::destroyAllocContext( colorContext ); } // set polygon properties @@ -262,7 +262,7 @@ void kPolygonSaver::readSettings() // draw next polygon and erase tail void kPolygonSaver::slotTimeout() { - QPainter p( this ); + TQPainter p( this ); if ( polygons.count() > numLines ) { p.setPen( black ); @@ -276,7 +276,7 @@ void kPolygonSaver::slotTimeout() if ( polygons.count() > numLines ) polygons.removeFirst(); - polygons.append( new QPointArray( polygons.last()->copy() ) ); + polygons.append( new TQPointArray( polygons.last()->copy() ) ); moveVertices(); } @@ -291,9 +291,9 @@ void kPolygonSaver::initialisePolygons() { int i; - polygons.append( new QPointArray( numVertices + 1 ) ); + polygons.append( new TQPointArray( numVertices + 1 ) ); - QPointArray &poly = *polygons.last(); + TQPointArray &poly = *polygons.last(); for ( i = 0; i < numVertices; i++ ) { @@ -313,7 +313,7 @@ void kPolygonSaver::initialisePolygons() void kPolygonSaver::moveVertices() { int i; - QPointArray &poly = *polygons.last(); + TQPointArray &poly = *polygons.last(); for ( i = 0; i < numVertices; i++ ) { diff --git a/kscreensaver/kdesavers/polygon.h b/kscreensaver/kdesavers/polygon.h index bfaac8a4..fed640c1 100644 --- a/kscreensaver/kdesavers/polygon.h +++ b/kscreensaver/kdesavers/polygon.h @@ -8,8 +8,8 @@ #ifndef __POLYGON_H__ #define __POLYGON_H__ -#include <qtimer.h> -#include <qptrlist.h> +#include <tqtimer.h> +#include <tqptrlist.h> #include <kdialogbase.h> #include <kscreensaver.h> @@ -44,8 +44,8 @@ protected: int speed; QColor colors[64]; int currentColor; - QPtrList<QPointArray> polygons; - QMemArray<QPoint> directions; + TQPtrList<TQPointArray> polygons; + TQMemArray<TQPoint> directions; KRandomSequence rnd; }; @@ -53,7 +53,7 @@ class kPolygonSetup : public KDialogBase { Q_OBJECT public: - kPolygonSetup( QWidget *parent = 0, const char *name = 0 ); + kPolygonSetup( TQWidget *parent = 0, const char *name = 0 ); ~kPolygonSetup(); protected: @@ -67,7 +67,7 @@ private slots: void slotHelp(); private: - QWidget *preview; + TQWidget *preview; kPolygonSaver *saver; int length; diff --git a/kscreensaver/kdesavers/rotation.cpp b/kscreensaver/kdesavers/rotation.cpp index 38098cb0..4868c9dc 100644 --- a/kscreensaver/kdesavers/rotation.cpp +++ b/kscreensaver/kdesavers/rotation.cpp @@ -32,10 +32,10 @@ // STL #include <deque> // Qt headers -#include <qcheckbox.h> -#include <qlineedit.h> -#include <qvalidator.h> -#include <qtooltip.h> +#include <tqcheckbox.h> +#include <tqlineedit.h> +#include <tqvalidator.h> +#include <tqtooltip.h> // KDE headers #include <klocale.h> #include <kconfig.h> @@ -68,7 +68,7 @@ extern "C" } /** function to create setup dialog for screen saver */ - KDE_EXPORT QDialog* kss_setup() + KDE_EXPORT TQDialog* kss_setup() { return new KRotationSetup(); } @@ -137,13 +137,13 @@ std::valarray<double> EulerOdeSolver::f( //----------------------------------------------------------------------------- RotationGLWidget::RotationGLWidget( - QWidget* parent, const char* name, + TQWidget* parent, const char* name, const vec3<double>& _omega, const std::deque<vec3<double> >& e1_, const std::deque<vec3<double> >& e2_, const std::deque<vec3<double> >& e3_, const vec3<double>& J) - : QGLWidget(parent, name), + : TQGLWidget(parent, name), eyeR(25), eyeTheta(1), eyePhi(M_PI*0.25), boxSize(1,1,1), fixedAxses(0), @@ -185,7 +185,7 @@ RotationGLWidget::RotationGLWidget( void RotationGLWidget::initializeGL(void) { - qglClearColor(QColor(black)); // set color to clear the background + qglClearColor(TQColor(black)); // set color to clear the background glClearDepth(1); // depth buffer setup glEnable(GL_DEPTH_TEST); // depth testing @@ -221,17 +221,17 @@ void RotationGLWidget::initializeGL(void) glLoadIdentity(); // z-axis, blue - qglColor(QColor(blue)); + qglColor(TQColor(blue)); myGlArrow(fixedAxsesLength, 0.5f, 0.03f, 0.1f); // x-axis, red - qglColor(QColor(red)); + qglColor(TQColor(red)); glRotatef(90, 0, 1, 0); myGlArrow(fixedAxsesLength, 0.5f, 0.03f, 0.1f); // y-axis, green - qglColor(QColor(green)); + qglColor(TQColor(green)); glLoadIdentity(); glRotatef(-90, 1, 0, 0); myGlArrow(fixedAxsesLength, 0.5f, 0.03f, 0.1f); @@ -247,18 +247,18 @@ void RotationGLWidget::initializeGL(void) glNewList(bodyAxses, GL_COMPILE); // z-axis, blue - qglColor(QColor(blue)); + qglColor(TQColor(blue)); myGlArrow(bodyAxsesLength, 0.5f, 0.03f, 0.1f); // x-axis, red - qglColor(QColor(red)); + qglColor(TQColor(red)); glPushMatrix(); glRotatef(90, 0, 1, 0); myGlArrow(bodyAxsesLength, 0.5f, 0.03f, 0.1f); glPopMatrix(); // y-axis, green - qglColor(QColor(green)); + qglColor(TQColor(green)); glPushMatrix(); glRotatef(-90, 1, 0, 0); myGlArrow(bodyAxsesLength, 0.5f, 0.03f, 0.1f); @@ -340,7 +340,7 @@ void RotationGLWidget::paintGL(void) 180./M_PI * vec3<double>::angle(vec3<double>(0,0,1), omega); glPushMatrix(); glRotatef(rotdeg, rotvec[0], rotvec[1], rotvec[2]); - qglColor(QColor(white)); + qglColor(TQColor(white)); myGlArrow(7, .5f, .1f, 0.2f); glPopMatrix(); @@ -374,7 +374,7 @@ void RotationGLWidget::paintGL(void) // paint box glBegin(GL_QUADS); // front (z) - qglColor(QColor(blue)); + qglColor(TQColor(blue)); glNormal3f( 0,0,1); glVertex3f( 1, 1, 1); glVertex3f(-1, 1, 1); @@ -387,7 +387,7 @@ void RotationGLWidget::paintGL(void) glVertex3f(-1, -1, -1); glVertex3f( 1, -1, -1); // top (y) - qglColor(QColor(green)); + qglColor(TQColor(green)); glNormal3f( 0,1,0); glVertex3f( 1, 1, 1); glVertex3f( 1, 1, -1); @@ -401,7 +401,7 @@ void RotationGLWidget::paintGL(void) glVertex3f(-1, -1, -1); glVertex3f(-1, -1, 1); // left (-x) - qglColor(QColor(red)); + qglColor(TQColor(red)); glNormal3f( -1,0,0); glVertex3f(-1, 1, 1); glVertex3f(-1, 1, -1); @@ -489,9 +489,9 @@ KRotationSaver::KRotationSaver(WId id) embed(glArea); // embed gl widget and resize it glArea->show(); // show gl widget - timer = new QTimer(this); + timer = new TQTimer(this); timer->start(deltaT, TRUE); - connect(timer, SIGNAL(timeout()), this, SLOT(doTimeStep())); + connect(timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(doTimeStep())); } KRotationSaver::~KRotationSaver() @@ -678,7 +678,7 @@ void KRotationSaver::doTimeStep() // public slot of KRotationSaver, forward resize event to public slot of glArea // to allow the resizing of the gl area withing the setup dialog -void KRotationSaver::resizeGlArea(QResizeEvent* e) +void KRotationSaver::resizeGlArea(TQResizeEvent* e) { glArea->resize(e->size()); } @@ -687,7 +687,7 @@ void KRotationSaver::resizeGlArea(QResizeEvent* e) // KRotationSetup: dialog to setup screen saver parameters //----------------------------------------------------------------------------- -KRotationSetup::KRotationSetup(QWidget* parent, const char* name) +KRotationSetup::KRotationSetup(TQWidget* parent, const char* name) : KRotationSetupUi(parent, name), // create ssaver and give it the WinID of the preview area saver(new KRotationSaver(preview->winId())) @@ -697,33 +697,33 @@ KRotationSetup::KRotationSetup(QWidget* parent, const char* name) setModal(TRUE); lengthEdit->setValidator( - new QDoubleValidator( + new TQDoubleValidator( KRotationSaver::traceLengthSecondsLimitLower, KRotationSaver::traceLengthSecondsLimitUpper, 3, lengthEdit)); LzEdit->setValidator( - new QDoubleValidator( + new TQDoubleValidator( KRotationSaver::LzLimitLower, KRotationSaver::LzLimitUpper, 3, LzEdit)); thetaEdit->setValidator( - new QDoubleValidator( + new TQDoubleValidator( KRotationSaver::initEulerThetaLimitLower, KRotationSaver::initEulerThetaLimitUpper, 3, thetaEdit)); // set tool tips of editable fields - QToolTip::add( + TQToolTip::add( lengthEdit, i18n("Length of traces in seconds of visibility.\nValid values from %1 to %2.") .arg(KRotationSaver::traceLengthSecondsLimitLower, 0, 'f', 2) .arg(KRotationSaver::traceLengthSecondsLimitUpper, 0, 'f', 2)); - QToolTip::add( + TQToolTip::add( LzEdit, i18n("Angular momentum in z direction in arbitrary units.\nValid values from %1 to %2.") .arg(KRotationSaver::LzLimitLower, 0, 'f', 2) .arg(KRotationSaver::LzLimitUpper, 0, 'f', 2)); - QToolTip::add( + TQToolTip::add( thetaEdit, i18n("Gravitational constant in arbitrary units.\nValid values from %1 to %2.") .arg(KRotationSaver::initEulerThetaLimitLower, 0, 'f', 2) @@ -741,7 +741,7 @@ KRotationSetup::KRotationSetup(QWidget* parent, const char* name) yTrace->setChecked(saver->traceFlag(1)); zTrace->setChecked(saver->traceFlag(2)); randTraces->setChecked(saver->randomTraces()); - QString text; + TQString text; text.setNum(saver->traceLengthSeconds()); lengthEdit->validateAndSet(text,0,0,0); text.setNum(saver->Lz()); @@ -752,8 +752,8 @@ KRotationSetup::KRotationSetup(QWidget* parent, const char* name) // if the preview area is resized it emmits the resized() event which is // caught by the saver. The embedded GlArea is resized to fit into the // preview area. - connect(preview, SIGNAL(resized(QResizeEvent*)), - saver, SLOT(resizeGlArea(QResizeEvent*))); + connect(preview, TQT_SIGNAL(resized(TQResizeEvent*)), + saver, TQT_SLOT(resizeGlArea(TQResizeEvent*))); } KRotationSetup::~KRotationSetup() @@ -809,16 +809,16 @@ void KRotationSetup::randomTracesToggled(bool state) saver->setTraceFlag(2, zTrace->isChecked()); } } -void KRotationSetup::lengthEnteredSlot(const QString& s) +void KRotationSetup::lengthEnteredSlot(const TQString& s) { saver->setTraceLengthSeconds(s.toDouble()); } -void KRotationSetup::LzEnteredSlot(const QString& s) +void KRotationSetup::LzEnteredSlot(const TQString& s) { saver->setLz(s.toDouble()); if (saver!=0) saver->initData(); } -void KRotationSetup::thetaEnteredSlot(const QString& s) +void KRotationSetup::thetaEnteredSlot(const TQString& s) { saver->setInitEulerTheta(s.toDouble()); if (saver!=0) saver->initData(); diff --git a/kscreensaver/kdesavers/rotation.h b/kscreensaver/kdesavers/rotation.h index a1a73867..0144275d 100644 --- a/kscreensaver/kdesavers/rotation.h +++ b/kscreensaver/kdesavers/rotation.h @@ -13,9 +13,9 @@ // STL headers #include <valarray> // Qt headers -#include <qwidget.h> -#include <qtimer.h> -#include <qgl.h> +#include <tqwidget.h> +#include <tqtimer.h> +#include <tqgl.h> // GL headers #include <GL/glu.h> #include <GL/gl.h> @@ -78,7 +78,7 @@ class EulerOdeSolver : public RkOdeSolver<double> /** @brief GL widget class for the KRotation screen saver * - * Class implements QGLWidget to display the KRotation screen saver. */ + * Class implements TQGLWidget to display the KRotation screen saver. */ class RotationGLWidget : public QGLWidget { Q_OBJECT @@ -93,7 +93,7 @@ class RotationGLWidget : public QGLWidget * @param e3 z trace data * @param J 3 vector with momenta of inertia with respect to the 3 figure * axes. */ - RotationGLWidget(QWidget* parent, const char* name, + RotationGLWidget(TQWidget* parent, const char* name, const vec3<double>& omega, const std::deque<vec3<double> >& e1, const std::deque<vec3<double> >& e2, @@ -144,7 +144,7 @@ class RotationGLWidget : public QGLWidget GLfloat lightPhi; /** stores position where the mouse button was pressed down */ - QPoint mouse_press_pos; + TQPoint mouse_press_pos; /** Length of the rotating coordinate system axses */ GLfloat bodyAxsesLength; @@ -245,7 +245,7 @@ class KRotationSaver : public KScreenSaver void doTimeStep(); /** slot is called if setup dialog changes in size and the GL area should be * adjusted */ - void resizeGlArea(QResizeEvent* e); + void resizeGlArea(TQResizeEvent* e); private: /** Momentum of inertia along figure axes */ @@ -260,7 +260,7 @@ class KRotationSaver : public KScreenSaver /** Gl widget of simulation */ RotationGLWidget* glArea; /** Timer for the real time integration of the Euler equations */ - QTimer* timer; + TQTimer* timer; /** current rotation vector */ vec3<double> omega; @@ -301,7 +301,7 @@ class KRotationSetup : public KRotationSetupUi Q_OBJECT public: - KRotationSetup(QWidget* parent = NULL, const char* name = NULL); + KRotationSetup(TQWidget* parent = NULL, const char* name = NULL); ~KRotationSetup(); public slots: @@ -313,9 +313,9 @@ class KRotationSetup : public KRotationSetupUi void xTraceToggled(bool state); void yTraceToggled(bool state); void zTraceToggled(bool state); - void lengthEnteredSlot(const QString& s); - void LzEnteredSlot(const QString& s); - void thetaEnteredSlot(const QString& s); + void lengthEnteredSlot(const TQString& s); + void LzEnteredSlot(const TQString& s); + void thetaEnteredSlot(const TQString& s); private: /// the screen saver widget which is displayed in the preview area diff --git a/kscreensaver/kdesavers/science.cpp b/kscreensaver/kdesavers/science.cpp index 185f3b55..7dbb89bf 100644 --- a/kscreensaver/kdesavers/science.cpp +++ b/kscreensaver/kdesavers/science.cpp @@ -12,13 +12,13 @@ #include <sys/types.h> #include <time.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qlabel.h> -#include <qlistbox.h> -#include <qcheckbox.h> -#include <qslider.h> -#include <qlayout.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqlabel.h> +#include <tqlistbox.h> +#include <tqcheckbox.h> +#include <tqslider.h> +#include <tqlayout.h> #include <kapplication.h> #include <kglobal.h> @@ -63,14 +63,14 @@ extern "C" return new KScienceSaver( id ); } - KDE_EXPORT QDialog *kss_setup() + KDE_EXPORT TQDialog *kss_setup() { return new KScienceSetup(); } } static struct { - QString name; + TQString name; bool inverseEnable; } modeInfo[MAX_MODES]; @@ -101,10 +101,10 @@ void initModeInfo() // KPreviewWidget // -KPreviewWidget::KPreviewWidget( QWidget *parent ) : - QWidget ( parent ) { } +KPreviewWidget::KPreviewWidget( TQWidget *parent ) : + TQWidget ( parent ) { } -void KPreviewWidget::paintEvent( QPaintEvent *event ) +void KPreviewWidget::paintEvent( TQPaintEvent *event ) { if( saver != 0 ) saver->do_refresh( event->rect() ); @@ -146,10 +146,10 @@ KScienceSaver::KScienceSaver( WId id, bool s, bool gP ) { grabRootWindow(); initialize(); - do_refresh( QRect ( 0, 0, width(), height() ) ); + do_refresh( TQRect ( 0, 0, width(), height() ) ); } - connect( &timer, SIGNAL( timeout() ), SLOT( slotTimeout() ) ); + connect( &timer, TQT_SIGNAL( timeout() ), TQT_SLOT( slotTimeout() ) ); timer.start( SCI_MAX_SPEED - speed[mode] ); } @@ -452,12 +452,12 @@ void KScienceSaver::setMode( int m ) int dm = diam; initLens(); if( hideBG[old] ^ hideBG[m] ) - do_refresh( QRect( 0, 0, width(), height() ) ); + do_refresh( TQRect( 0, 0, width(), height() ) ); else if( diam < dm ) { - do_refresh( QRect( (int) x+diam, (int) y, dm-diam, diam ) ); - do_refresh( QRect( (int) x, (int) y+diam, dm, dm-diam ) ); + do_refresh( TQRect( (int) x+diam, (int) y, dm-diam, diam ) ); + do_refresh( TQRect( (int) x, (int) y+diam, dm, dm-diam ) ); } timer.start( SCI_MAX_SPEED - speed[mode] ); @@ -498,8 +498,8 @@ void KScienceSaver::setSize( int s ) initLens(); if( diam < dm ) { - do_refresh( QRect( (int) x+diam, (int) y, dm-diam, diam ) ); - do_refresh( QRect( (int) x, (int) y+diam, dm, dm-diam ) ); + do_refresh( TQRect( (int) x+diam, (int) y, dm-diam, diam ) ); + do_refresh( TQRect( (int) x, (int) y+diam, dm, dm-diam ) ); } timer.start( SCI_MAX_SPEED - speed[mode] ); @@ -553,7 +553,7 @@ void KScienceSaver::setHideBG( bool b ) releaseLens(); hideBG[mode] = b; initLens(); - do_refresh( QRect( 0, 0, width(), height() ) ); + do_refresh( TQRect( 0, 0, width(), height() ) ); timer.start( SCI_MAX_SPEED - speed[mode]); } @@ -561,7 +561,7 @@ void KScienceSaver::setHideBG( bool b ) void KScienceSaver::readSettings() { KConfig *config = KGlobal::config(); - QString sMode; + TQString sMode; config->setGroup( "Settings" ); mode = config->readNumEntry( "ModeNr", SCI_DEFAULT_MODE ); @@ -584,7 +584,7 @@ void KScienceSaver::readSettings() vy = copysign( moveY[mode], vy ); } -void KScienceSaver::do_refresh( const QRect & rect ) +void KScienceSaver::do_refresh( const TQRect & rect ) { if( grabPixmap ) return; @@ -609,13 +609,13 @@ void KScienceSaver::do_refresh( const QRect & rect ) void KScienceSaver::slotTimeout() { if( grabPixmap ) { - if( !QWidget::find(winId())->isActiveWindow() ) + if( !TQWidget::find(winId())->isActiveWindow() ) return; grabPreviewWidget(); grabPixmap = false; initialize(); if( hideBG[mode] ) - do_refresh( QRect ( 0, 0, width(), height() ) ); + do_refresh( TQRect ( 0, 0, width(), height() ) ); } signed int oldx = xcoord, oldy = ycoord; @@ -724,7 +724,7 @@ void KScienceSaver::grabRootWindow() void KScienceSaver::grabPreviewWidget() { - myAssert( QWidget::find(winId())->isActiveWindow(), "can't grab preview widget: dialog not active()" ); + myAssert( TQWidget::find(winId())->isActiveWindow(), "can't grab preview widget: dialog not active()" ); if( d->xRootWin ) XDestroyImage( d->xRootWin ); @@ -846,124 +846,124 @@ void KScienceSaver::applyLens32bpp(int xs, int ys, int xd, int yd, int w, int h) //----------------------------------------------------------------------------- -KScienceSetup::KScienceSetup( QWidget *parent, const char *name ) +KScienceSetup::KScienceSetup( TQWidget *parent, const char *name ) : KDialogBase( parent, name, true, i18n( "Setup Science Screen Saver" ), Ok|Cancel|Help, Ok, true ), saver( 0 ) { readSettings(); initModeInfo(); - QWidget *main = makeMainWidget(); + TQWidget *main = makeMainWidget(); - QHBoxLayout *lt = new QHBoxLayout( main, 0, spacingHint()); - QVBoxLayout *ltm = new QVBoxLayout; + TQHBoxLayout *lt = new TQHBoxLayout( main, 0, spacingHint()); + TQVBoxLayout *ltm = new QVBoxLayout; lt->addLayout( ltm ); - QVBoxLayout *ltc = new QVBoxLayout; + TQVBoxLayout *ltc = new QVBoxLayout; lt->addLayout( ltc ); // mode - QLabel *label = new QLabel( i18n("Mode:"), main ); + TQLabel *label = new TQLabel( i18n("Mode:"), main ); ltm->addWidget( label ); - QListBox *c = new QListBox( main ); + TQListBox *c = new TQListBox( main ); for(int i = 0; i<MAX_MODES; i++) c->insertItem( modeInfo[i].name ); c->setCurrentItem( mode ); c->setFixedHeight( 5 * c->fontMetrics().height() ); - connect( c, SIGNAL( highlighted( int ) ), SLOT( slotMode( int ) ) ); + connect( c, TQT_SIGNAL( highlighted( int ) ), TQT_SLOT( slotMode( int ) ) ); ltm->addWidget( c ); // inverse - QCheckBox *cbox = checkInverse = new QCheckBox( i18n("Inverse"), main ); + TQCheckBox *cbox = checkInverse = new TQCheckBox( i18n("Inverse"), main ); cbox->setEnabled( modeInfo[mode].inverseEnable ); cbox->setChecked( inverse[mode] ); - connect( cbox, SIGNAL( clicked() ), SLOT( slotInverse() ) ); + connect( cbox, TQT_SIGNAL( clicked() ), TQT_SLOT( slotInverse() ) ); ltm->addWidget( cbox ); // gravity - cbox = checkGravity = new QCheckBox( i18n("Gravity"), main ); + cbox = checkGravity = new TQCheckBox( i18n("Gravity"), main ); cbox->setChecked( gravity[mode] ); - connect( cbox, SIGNAL( clicked() ), SLOT( slotGravity() ) ); + connect( cbox, TQT_SIGNAL( clicked() ), TQT_SLOT( slotGravity() ) ); ltm->addWidget( cbox ); // hide background - cbox = checkHideBG = new QCheckBox( i18n("Hide background"), main ); + cbox = checkHideBG = new TQCheckBox( i18n("Hide background"), main ); cbox->setChecked( hideBG[mode] ); - connect( cbox, SIGNAL( clicked() ), SLOT( slotHideBG() ) ); + connect( cbox, TQT_SIGNAL( clicked() ), TQT_SLOT( slotHideBG() ) ); ltm->addWidget( cbox ); ltm->addStretch(); // size - label = new QLabel( i18n("Size:"), main ); + label = new TQLabel( i18n("Size:"), main ); ltc->addWidget( label ); - slideSize = new QSlider(9, 50, 5, size[mode], QSlider::Horizontal, + slideSize = new TQSlider(9, 50, 5, size[mode], TQSlider::Horizontal, main ); slideSize->setMinimumSize( 90, 20 ); - slideSize->setTickmarks(QSlider::Below); + slideSize->setTickmarks(TQSlider::Below); slideSize->setTickInterval(5); - connect( slideSize, SIGNAL( sliderMoved( int ) ), - SLOT( slotSize( int ) ) ); - connect( slideSize, SIGNAL( sliderPressed() ), - SLOT( slotSliderPressed() ) ); - connect( slideSize, SIGNAL( sliderReleased() ), - SLOT( slotSliderReleased() ) ); + connect( slideSize, TQT_SIGNAL( sliderMoved( int ) ), + TQT_SLOT( slotSize( int ) ) ); + connect( slideSize, TQT_SIGNAL( sliderPressed() ), + TQT_SLOT( slotSliderPressed() ) ); + connect( slideSize, TQT_SIGNAL( sliderReleased() ), + TQT_SLOT( slotSliderReleased() ) ); ltc->addWidget( slideSize ); // intensity - label = new QLabel( i18n("Intensity:"), main ); + label = new TQLabel( i18n("Intensity:"), main ); ltc->addWidget( label ); - slideIntensity = new QSlider(0, 10, 1, intensity[mode], - QSlider::Horizontal, main ); + slideIntensity = new TQSlider(0, 10, 1, intensity[mode], + TQSlider::Horizontal, main ); slideIntensity->setMinimumSize( 90, 20 ); - slideIntensity->setTickmarks(QSlider::Below); + slideIntensity->setTickmarks(TQSlider::Below); slideIntensity->setTickInterval(1); - connect( slideIntensity, SIGNAL( sliderMoved( int ) ), - SLOT( slotIntensity( int )) ); - connect( slideIntensity, SIGNAL( sliderPressed() ), - SLOT( slotSliderPressed() ) ); - connect( slideIntensity, SIGNAL( sliderReleased() ), - SLOT( slotSliderReleased() ) ); + connect( slideIntensity, TQT_SIGNAL( sliderMoved( int ) ), + TQT_SLOT( slotIntensity( int )) ); + connect( slideIntensity, TQT_SIGNAL( sliderPressed() ), + TQT_SLOT( slotSliderPressed() ) ); + connect( slideIntensity, TQT_SIGNAL( sliderReleased() ), + TQT_SLOT( slotSliderReleased() ) ); ltc->addWidget( slideIntensity ); // speed - label = new QLabel( i18n("Speed:"), main ); + label = new TQLabel( i18n("Speed:"), main ); ltc->addWidget( label ); - slideSpeed = new QSlider(0, SCI_MAX_SPEED, 10, speed[mode], - QSlider::Horizontal, main ); + slideSpeed = new TQSlider(0, SCI_MAX_SPEED, 10, speed[mode], + TQSlider::Horizontal, main ); slideSpeed->setMinimumSize( 90, 20 ); - slideSpeed->setTickmarks(QSlider::Below); + slideSpeed->setTickmarks(TQSlider::Below); slideSpeed->setTickInterval(10); - connect( slideSpeed, SIGNAL( sliderMoved( int ) ), - SLOT( slotSpeed( int ) ) ); + connect( slideSpeed, TQT_SIGNAL( sliderMoved( int ) ), + TQT_SLOT( slotSpeed( int ) ) ); ltc->addWidget( slideSpeed ); // motion - label = new QLabel( i18n("Motion:"), main ); + label = new TQLabel( i18n("Motion:"), main ); ltc->addWidget( label ); - QHBoxLayout *ltcm = new QHBoxLayout; + TQHBoxLayout *ltcm = new QHBoxLayout; ltc->addLayout( ltcm ); - slideMoveX = new QSlider(0, SCI_MAX_MOVE, 5, moveX[mode], - QSlider::Horizontal, main ); + slideMoveX = new TQSlider(0, SCI_MAX_MOVE, 5, moveX[mode], + TQSlider::Horizontal, main ); slideMoveX->setMinimumSize( 40, 20 ); - slideMoveX->setTickmarks(QSlider::Below); + slideMoveX->setTickmarks(TQSlider::Below); slideMoveX->setTickInterval(5); - connect( slideMoveX, SIGNAL( sliderMoved( int ) ), - SLOT( slotMoveX( int ) ) ); + connect( slideMoveX, TQT_SIGNAL( sliderMoved( int ) ), + TQT_SLOT( slotMoveX( int ) ) ); ltcm->addWidget( slideMoveX ); - slideMoveY = new QSlider(0, SCI_MAX_MOVE, 5, moveY[mode], - QSlider::Horizontal, main ); + slideMoveY = new TQSlider(0, SCI_MAX_MOVE, 5, moveY[mode], + TQSlider::Horizontal, main ); slideMoveY->setMinimumSize( 40, 20 ); - slideMoveY->setTickmarks(QSlider::Below); + slideMoveY->setTickmarks(TQSlider::Below); slideMoveY->setTickInterval(5); - connect( slideMoveY, SIGNAL( sliderMoved( int ) ), - SLOT( slotMoveY( int ) ) ); + connect( slideMoveY, TQT_SIGNAL( sliderMoved( int ) ), + TQT_SLOT( slotMoveY( int ) ) ); ltcm->addWidget( slideMoveY ); ltc->addStretch(); @@ -971,7 +971,7 @@ KScienceSetup::KScienceSetup( QWidget *parent, const char *name ) // preview preview = new KPreviewWidget( main ); preview->setFixedSize( 220, 170 ); - QPixmap p( locate("data", "kscreensaver/pics/kscience.png") ); + TQPixmap p( locate("data", "kscreensaver/pics/kscience.png") ); if( p.isNull() ) preview->setBackgroundColor( black ); else @@ -1009,7 +1009,7 @@ void KScienceSetup::updateSettings() void KScienceSetup::readSettings() { KConfig *config = KGlobal::config(); - QString sMode; + TQString sMode; config->setGroup( "Settings" ); mode = config->readNumEntry( "ModeNr", SCI_DEFAULT_MODE ); @@ -1119,7 +1119,7 @@ void KScienceSetup::slotSliderReleased() void KScienceSetup::slotOk() { KConfig *config = KGlobal::config(); - QString sSize, sSpeed, sIntensity, sMode; + TQString sSize, sSpeed, sIntensity, sMode; config->setGroup( "Settings" ); config->writeEntry( "ModeNr", mode ); @@ -1145,7 +1145,7 @@ void KScienceSetup::slotOk() void KScienceSetup::slotHelp() { - QString about = i18n("Science Version 0.26.5\n\nWritten by Rene Beutler (1998)\[email protected]"); + TQString about = i18n("Science Version 0.26.5\n\nWritten by Rene Beutler (1998)\[email protected]"); KMessageBox::about(this, about); } diff --git a/kscreensaver/kdesavers/science.h b/kscreensaver/kdesavers/science.h index 7211f5d5..6c367c23 100644 --- a/kscreensaver/kdesavers/science.h +++ b/kscreensaver/kdesavers/science.h @@ -8,8 +8,8 @@ #ifndef __SCIENCE_H__ #define __SCIENCE_H__ -#include <qrect.h> -#include <qtimer.h> +#include <tqrect.h> +#include <tqtimer.h> #include <kdialogbase.h> #include <kscreensaver.h> @@ -26,8 +26,8 @@ class KPreviewWidget : public QWidget { Q_OBJECT public: - KPreviewWidget( QWidget *parent ); - void paintEvent( QPaintEvent *event ); + KPreviewWidget( TQWidget *parent ); + void paintEvent( TQPaintEvent *event ); void notifySaver( KScienceSaver *s = 0 ); private: KScienceSaver *saver; @@ -42,7 +42,7 @@ public: KScienceSaver( WId id, bool setup=false, bool gP=false); virtual ~KScienceSaver(); - void do_refresh( const QRect & rect ); + void do_refresh( const TQRect & rect ); void setMode ( int mode ); void setMoveX ( signed int s ); void setMoveY ( signed int s ); @@ -80,7 +80,7 @@ protected: void applyLens16bpp(int xs, int ys, int xd, int yd, int w, int h); void applyLens24bpp(int xs, int ys, int xd, int yd, int w, int h); void applyLens32bpp(int xs, int ys, int xd, int yd, int w, int h); - QTimer timer; + TQTimer timer; bool moveOn; bool setup; bool grabPixmap; @@ -107,7 +107,7 @@ class KScienceSetup : public KDialogBase { Q_OBJECT public: - KScienceSetup(QWidget *parent=0, const char *name=0); + KScienceSetup(TQWidget *parent=0, const char *name=0); ~KScienceSetup(); protected: void updateSettings(); @@ -131,9 +131,9 @@ private slots: private: KPreviewWidget *preview; KScienceSaver *saver; - QSlider *slideSize, *slideSpeed, *slideIntensity; - QSlider *slideMoveX, *slideMoveY; - QCheckBox *checkInverse, *checkGravity, *checkHideBG; + TQSlider *slideSize, *slideSpeed, *slideIntensity; + TQSlider *slideMoveX, *slideMoveY; + TQCheckBox *checkInverse, *checkGravity, *checkHideBG; int mode; bool inverse [MAX_MODES]; diff --git a/kscreensaver/kdesavers/slideshow.cpp b/kscreensaver/kdesavers/slideshow.cpp index 29df23ae..de88fe3d 100644 --- a/kscreensaver/kdesavers/slideshow.cpp +++ b/kscreensaver/kdesavers/slideshow.cpp @@ -10,17 +10,17 @@ */ -#include <qdir.h> -#include <qcolor.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qfile.h> -#include <qpaintdevicemetrics.h> -#include <qcheckbox.h> -#include <qcombobox.h> -#include <qspinbox.h> -#include <qframe.h> -#include <qdesktopwidget.h> +#include <tqdir.h> +#include <tqcolor.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqfile.h> +#include <tqpaintdevicemetrics.h> +#include <tqcheckbox.h> +#include <tqcombobox.h> +#include <tqspinbox.h> +#include <tqframe.h> +#include <tqdesktopwidget.h> #include <kconfig.h> #include <kglobal.h> @@ -62,7 +62,7 @@ extern "C" return new kSlideShowSaver( id ); } - KDE_EXPORT QDialog *kss_setup() + KDE_EXPORT TQDialog *kss_setup() { return new kSlideShowSetup(); } @@ -87,19 +87,19 @@ kSlideShowSaver::kSlideShowSaver( WId id ): KScreenSaver(id) initNextScreen(); mFileIdx = 0; - mColorContext = QColor::enterAllocContext(); + mColorContext = TQColor::enterAllocContext(); mEffectRunning = false; mTimer.start(10, true); - connect(&mTimer, SIGNAL(timeout()), SLOT(slotTimeout())); + connect(&mTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotTimeout())); - QDesktopWidget *d = QApplication::desktop(); + TQDesktopWidget *d = TQApplication::desktop(); if( geometry() == d->geometry() && d->numScreens() > 1) { for(int i = 0; i < d->numScreens(); ++i) { - QRect s = d->screenGeometry(i); + TQRect s = d->screenGeometry(i); mGeoList.append(new mScreenGeo(s.width(), s.height(), s.topLeft().x(), s.topLeft().y())); } } @@ -119,20 +119,20 @@ kSlideShowSaver::~kSlideShowSaver() mTimer.stop(); if (mPainter.isActive()) mPainter.end(); - QColor::leaveAllocContext(); - QColor::destroyAllocContext(mColorContext); + TQColor::leaveAllocContext(); + TQColor::destroyAllocContext(mColorContext); } //----------------------------------------------------------------------------- void kSlideShowSaver::initNextScreen() { - QPaintDeviceMetrics metric(this); + TQPaintDeviceMetrics metric(this); int w, h; w = width(); h = height(); - mNextScreen = QPixmap(w, h, metric.depth()); + mNextScreen = TQPixmap(w, h, metric.depth()); } @@ -182,7 +182,7 @@ int kSlideShowSaver::effectMultiCircleOut(bool aInit) { int x, y, i; double alpha; - static QPointArray pa(4); + static TQPointArray pa(4); if (aInit) { @@ -341,7 +341,7 @@ int kSlideShowSaver::effectMeltdown(bool aInit) int kSlideShowSaver::effectCircleOut(bool aInit) { int x, y; - static QPointArray pa(4); + static TQPointArray pa(4); if (aInit) { @@ -663,7 +663,7 @@ int kSlideShowSaver::effectVertLines(bool aInit) //----------------------------------------------------------------------------- void kSlideShowSaver::startPainter(Qt::PenStyle aPen) { - QBrush brush; + TQBrush brush; brush.setPixmap(mNextScreen); if (mPainter.isActive()) mPainter.end(); mPainter.begin(this); @@ -724,7 +724,7 @@ void kSlideShowSaver::showNextScreen() //---------------------------------------------------------------------------- void kSlideShowSaver::createNextScreen() { - QPainter p; + TQPainter p; int ww, wh, iw, ih, x, y; double fx, fy; @@ -747,7 +747,7 @@ void kSlideShowSaver::createNextScreen() if (mFileList.isEmpty()) { - p.setPen(QColor("white")); + p.setPen(TQColor("white")); p.drawText(20 + (KApplication::random() % (ww>>1)), 20 + (KApplication::random() % (wh>>1)), i18n("No images found")); } @@ -761,7 +761,7 @@ void kSlideShowSaver::createNextScreen() if (fx > 2) fx = 2; iw = (int)(iw * fx); ih = (int)(ih * fx); - QImage scaledImg = mImage.smoothScale(iw, ih); + TQImage scaledImg = mImage.smoothScale(iw, ih); x = ((ww - iw) >> 1) + geoptr->mXorg; y = ((wh - ih) >> 1) + geoptr->mYorg; @@ -778,7 +778,7 @@ void kSlideShowSaver::createNextScreen() if (fx > 2) fx = 2; iw = (int)(iw * fx); ih = (int)(ih * fx); - QImage scaledImg = mImage.smoothScale(iw, ih); + TQImage scaledImg = mImage.smoothScale(iw, ih); x = ((ww - iw) >> 1) + geoptr->mXorg; y = ((wh - ih) >> 1) + geoptr->mYorg; @@ -805,11 +805,11 @@ void kSlideShowSaver::createNextScreen() if (mPrintName) { - p.setPen(QColor("black")); + p.setPen(TQColor("black")); for (x=9; x<=11; x++) for (y=21; y>=19; y--) p.drawText(x + geoptr->mXorg, wh-y+geoptr->mYorg, mImageName); - p.setPen(QColor("white")); + p.setPen(TQColor("white")); p.drawText(10 + geoptr->mXorg, wh-20 + geoptr->mYorg, mImageName); } } @@ -821,7 +821,7 @@ void kSlideShowSaver::createNextScreen() //---------------------------------------------------------------------------- void kSlideShowSaver::loadNextImage() { - QString fname; + TQString fname; int num; num = mFileList.count(); @@ -875,18 +875,18 @@ void kSlideShowSaver::loadDirectory() mRandomList = mFileList; } -void kSlideShowSaver::traverseDirectory(const QString &dirName) +void kSlideShowSaver::traverseDirectory(const TQString &dirName) { - QDir dir(dirName); + TQDir dir(dirName); if (!dir.exists()) { return ; } - dir.setFilter(QDir::Dirs | QDir::Files); + dir.setFilter(TQDir::Dirs | TQDir::Files); const QFileInfoList *fileinfolist = dir.entryInfoList(); QFileInfoListIterator it(*fileinfolist); - QFileInfo *fi; + TQFileInfo *fi; while ((fi = it.current())) { if (fi->fileName() == "." || fi->fileName() == "..") @@ -920,14 +920,14 @@ void kSlideShowSaver::blank() //============================================================================= // Class kSlideShowSetup //============================================================================= -kSlideShowSetup::kSlideShowSetup(QWidget *aParent, const char *aName) +kSlideShowSetup::kSlideShowSetup(TQWidget *aParent, const char *aName) : KDialogBase(aParent, aName, true, i18n( "Setup Slide Show Screen Saver" ), Ok|Cancel|Help, Ok, true ) { setButtonText( Help, i18n( "A&bout" ) ); - QWidget *main = makeMainWidget(); - QVBoxLayout *top = new QVBoxLayout( main, 0, spacingHint() ); + TQWidget *main = makeMainWidget(); + TQVBoxLayout *top = new TQVBoxLayout( main, 0, spacingHint() ); cfg = new SlideShowCfg( main, "SlideShowCfg" ); top->addWidget( cfg ); @@ -939,10 +939,10 @@ kSlideShowSetup::kSlideShowSetup(QWidget *aParent, const char *aName) mSaver = new kSlideShowSaver(cfg->mPreview->winId()); cfg->mDirChooser->setMode(KFile::Directory | KFile::ExistingOnly); - connect(cfg->mDirChooser, SIGNAL(returnPressed(const QString &)), - SLOT(slotDirSelected(const QString &))); - connect(cfg->mDirChooser, SIGNAL(urlSelected(const QString &)), - SLOT(slotDirSelected(const QString &))); + connect(cfg->mDirChooser, TQT_SIGNAL(returnPressed(const TQString &)), + TQT_SLOT(slotDirSelected(const TQString &))); + connect(cfg->mDirChooser, TQT_SIGNAL(urlSelected(const TQString &)), + TQT_SLOT(slotDirSelected(const TQString &))); readSettings(); } @@ -993,7 +993,7 @@ void kSlideShowSetup::writeSettings() //----------------------------------------------------------------------------- -void kSlideShowSetup::slotDirSelected(const QString &) +void kSlideShowSetup::slotDirSelected(const TQString &) { writeSettings(); } diff --git a/kscreensaver/kdesavers/slideshow.h b/kscreensaver/kdesavers/slideshow.h index fa51670a..c52dbda9 100644 --- a/kscreensaver/kdesavers/slideshow.h +++ b/kscreensaver/kdesavers/slideshow.h @@ -7,12 +7,12 @@ #ifndef SLIDESHOW_H #define SLIDESHOW_H -#include <qtimer.h> -#include <qptrlist.h> -#include <qstringlist.h> -#include <qpixmap.h> -#include <qpainter.h> -#include <qimage.h> +#include <tqtimer.h> +#include <tqptrlist.h> +#include <tqstringlist.h> +#include <tqpixmap.h> +#include <tqpainter.h> +#include <tqimage.h> #include <kscreensaver.h> #include <kdialogbase.h> @@ -45,7 +45,7 @@ protected: virtual void loadDirectory(); /** Helper for loadDirectory() */ - virtual void traverseDirectory(const QString &dirName); + virtual void traverseDirectory(const TQString &dirName); /** Load next image from list. If the file cannot be read it is automatically removed from the file list. @@ -92,20 +92,20 @@ protected: int mXorg; int mYorg; }; - QPtrList<mScreenGeo> mGeoList; + TQPtrList<mScreenGeo> mGeoList; bool mEffectRunning; - QTimer mTimer; + TQTimer mTimer; int mColorContext; - QStringList mFileList; - QStringList mRandomList; + TQStringList mFileList; + TQStringList mRandomList; int mFileIdx; - QImage mImage; - QPixmap mNextScreen; + TQImage mImage; + TQPixmap mNextScreen; EffectMethod* mEffectList; EffectMethod mEffect; int mNumEffects; - QPainter mPainter; - QString mImageName; + TQPainter mPainter; + TQString mImageName; // config settings: bool mShowRandom; @@ -114,7 +114,7 @@ protected: bool mSubdirectory; bool mRandomPosition; int mDelay; - QString mDirectory; + TQString mDirectory; // values for state of various effects: int mx, my, mw, mh, mdx, mdy, mix, miy, mi, mj, mSubType; @@ -129,7 +129,7 @@ class kSlideShowSetup : public KDialogBase { Q_OBJECT public: - kSlideShowSetup(QWidget *parent=NULL, const char *name=NULL); + kSlideShowSetup(TQWidget *parent=NULL, const char *name=NULL); ~kSlideShowSetup(); protected: @@ -139,7 +139,7 @@ protected slots: void slotOk(); void slotHelp(); void writeSettings(); - void slotDirSelected(const QString &where); + void slotDirSelected(const TQString &where); private: kSlideShowSaver *mSaver; diff --git a/kscreensaver/kdesavers/sspreviewarea.cpp b/kscreensaver/kdesavers/sspreviewarea.cpp index d189c409..2b8b3c65 100644 --- a/kscreensaver/kdesavers/sspreviewarea.cpp +++ b/kscreensaver/kdesavers/sspreviewarea.cpp @@ -9,12 +9,12 @@ #include "sspreviewarea.h" #include "sspreviewarea.moc" -SsPreviewArea::SsPreviewArea(QWidget* parent, const char* name) - : QWidget(parent, name) +SsPreviewArea::SsPreviewArea(TQWidget* parent, const char* name) + : TQWidget(parent, name) { } -void SsPreviewArea::resizeEvent(QResizeEvent* e) +void SsPreviewArea::resizeEvent(TQResizeEvent* e) { emit resized(e); } diff --git a/kscreensaver/kdesavers/sspreviewarea.h b/kscreensaver/kdesavers/sspreviewarea.h index 5b14f09d..e0c9fc51 100644 --- a/kscreensaver/kdesavers/sspreviewarea.h +++ b/kscreensaver/kdesavers/sspreviewarea.h @@ -9,11 +9,11 @@ #ifndef SSPREVIEWAREA_H #define SSPREVIEWAREA_H -#include <qwidget.h> +#include <tqwidget.h> -/** @brief Reimplementation of QWidget emitting a signal if resized. +/** @brief Reimplementation of TQWidget emitting a signal if resized. * - * This class is equalt to QWidget except for the fact that the signal resized() + * This class is equalt to TQWidget except for the fact that the signal resized() * is emitted if the widget gets resized. By this signaling mechanism it is * possible to resize the embedded GL area object within the screen saver setup * dialog. @@ -22,7 +22,7 @@ * KRotationSetup::KRotationSetup()) the signal SsPreviewArea::resized() is * connected with a slot of the screensaver class * (KPendulumSaver::resizeGlArea(), KRotationSaver::resizeGlArea()). This slot - * function calls the reimplemented QGLWidget::resizeGL() method of the GL + * function calls the reimplemented TQGLWidget::resizeGL() method of the GL * widgets (PendulumGLWidget::resizeGL(), RotationGLWidget::resizeGL()) which * really resizes the GL scenery. */ class SsPreviewArea : public QWidget @@ -33,25 +33,25 @@ class SsPreviewArea : public QWidget /** @brief Constructor for SsPreviewArea * @param parent Pointer tp parent widget, forwarded to the QWidget * constructor - * @param name Pointer to widget name, forwarded to the QWidget constructor + * @param name Pointer to widget name, forwarded to the TQWidget constructor * - * The constructor just calls QWidget::QWidget() with the given arguments. + * The constructor just calls TQWidget::TQWidget() with the given arguments. */ - SsPreviewArea(QWidget* parent = NULL, const char* name = NULL); + SsPreviewArea(TQWidget* parent = NULL, const char* name = NULL); protected: /** @brief Called if widget gets resized. - * @param e Pointer to the corresponding QResizeEvent object containing the + * @param e Pointer to the corresponding TQResizeEvent object containing the * resize information * - * Reimplemented event handler from QWidget. Only the signal resized() is + * Reimplemented event handler from TQWidget. Only the signal resized() is * emitted. */ - virtual void resizeEvent(QResizeEvent* e); + virtual void resizeEvent(TQResizeEvent* e); signals: /** @brief Signal which is emitted in the resizeEvent() method. - * @param e Pointer to the corresponding QResizeEvent object */ - void resized(QResizeEvent* e); + * @param e Pointer to the corresponding TQResizeEvent object */ + void resized(TQResizeEvent* e); }; #endif diff --git a/kscreensaver/kdesavers/wave.cpp b/kscreensaver/kdesavers/wave.cpp index e8a999a5..e65d04ac 100644 --- a/kscreensaver/kdesavers/wave.cpp +++ b/kscreensaver/kdesavers/wave.cpp @@ -5,8 +5,8 @@ // Copyright (c) Ian Reinhart Geiser 2001 // #include <stdlib.h> -#include <qlabel.h> -#include <qlayout.h> +#include <tqlabel.h> +#include <tqlayout.h> #include <kapplication.h> #include <klocale.h> #include <kconfig.h> @@ -23,11 +23,11 @@ #include <GL/glu.h> #include <GL/gl.h> #endif -#include <qimage.h> +#include <tqimage.h> #include <kdebug.h> -#include <qpainter.h> -#include <qradiobutton.h> -#include <qspinbox.h> +#include <tqpainter.h> +#include <tqradiobutton.h> +#include <tqspinbox.h> #include <kstandarddirs.h> #include <math.h> #include <kmessagebox.h> @@ -47,7 +47,7 @@ extern "C" return new KWaveSaver( id ); } - KDE_EXPORT QDialog *kss_setup() + KDE_EXPORT TQDialog *kss_setup() { return new KWaveSetup(); } @@ -56,7 +56,7 @@ extern "C" //----------------------------------------------------------------------------- // dialog to setup screen saver parameters // -KWaveSetup::KWaveSetup( QWidget *parent, const char *name ) +KWaveSetup::KWaveSetup( TQWidget *parent, const char *name ) : SetupUi( parent, name, TRUE ) { readSettings(); @@ -66,11 +66,11 @@ KWaveSetup::KWaveSetup( QWidget *parent, const char *name ) preview->show(); // otherwise saver does not get correct size saver = new KWaveSaver( preview->winId() ); - connect( PushButton1, SIGNAL( clicked() ), SLOT( slotOkPressed() ) ); - connect( PushButton2, SIGNAL( clicked() ), SLOT( reject() ) ); - connect( PushButton3, SIGNAL( clicked() ), SLOT( aboutPressed() ) ); - connect( SpinBox1, SIGNAL( valueChanged(int)), saver, SLOT( updateSize(int))); - connect( RadioButton1, SIGNAL( toggled(bool)), saver, SLOT( doStars(bool))); + connect( PushButton1, TQT_SIGNAL( clicked() ), TQT_SLOT( slotOkPressed() ) ); + connect( PushButton2, TQT_SIGNAL( clicked() ), TQT_SLOT( reject() ) ); + connect( PushButton3, TQT_SIGNAL( clicked() ), TQT_SLOT( aboutPressed() ) ); + connect( SpinBox1, TQT_SIGNAL( valueChanged(int)), saver, TQT_SLOT( updateSize(int))); + connect( RadioButton1, TQT_SIGNAL( toggled(bool)), saver, TQT_SLOT( doStars(bool))); } @@ -115,14 +115,14 @@ KWaveSaver::KWaveSaver( WId id ) : KScreenSaver( id ) kdDebug() << "Blank" << endl; readSettings(); - timer = new QTimer( this ); + timer = new TQTimer( this ); timer->start( 50, TRUE ); setBackgroundColor( black ); erase(); wave = new Wave(); embed(wave); wave->show(); - connect( timer, SIGNAL(timeout()), this, SLOT(blank()) );; + connect( timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(blank()) );; } KWaveSaver::~KWaveSaver() @@ -147,7 +147,7 @@ void KWaveSaver::blank() timer->start( 100, TRUE ); } -Wave::Wave( QWidget * parent, const char * name) : QGLWidget (parent,name) +Wave::Wave( TQWidget * parent, const char * name) : TQGLWidget (parent,name) { pNurb = 0; @@ -291,7 +291,7 @@ bool Wave::LoadGLTextures() /* Status indicator */ bool Status = TRUE; - QImage buf; // = QPixmap::grabWindow ( 0 ).convertToImage(); + TQImage buf; // = TQPixmap::grabWindow ( 0 ).convertToImage(); kdDebug() << "Loading: " << locate("data", "kscreensaver/image.png") << endl; if (buf.load( locate("data", "kscreensaver/image.png") ) ) @@ -301,7 +301,7 @@ bool Wave::LoadGLTextures() } else { - QImage dummy( 64, 64, 64 ); + TQImage dummy( 64, 64, 64 ); dummy.fill( Qt::white.rgb() ); buf = dummy; tex = convertToGLFormat( buf ); diff --git a/kscreensaver/kdesavers/wave.h b/kscreensaver/kdesavers/wave.h index ea2f64f3..4d0f614f 100644 --- a/kscreensaver/kdesavers/wave.h +++ b/kscreensaver/kdesavers/wave.h @@ -14,8 +14,8 @@ #ifndef __WAVE_H__ #define __WAVE_H__ -#include <qdialog.h> -#include <qgl.h> +#include <tqdialog.h> +#include <tqgl.h> #ifdef Q_WS_MACX #include <OpenGL/glu.h> #include <OpenGL/gl.h> @@ -24,8 +24,8 @@ #include <GL/gl.h> #endif #include <kscreensaver.h> -#include <qtimer.h> -#include <qimage.h> +#include <tqtimer.h> +#include <tqimage.h> #include "wavecfg.h" @@ -34,7 +34,7 @@ class Wave : public QGLWidget Q_OBJECT public: - Wave( QWidget * parent=0, const char * name=0 ); + Wave( TQWidget * parent=0, const char * name=0 ); ~Wave(); protected: @@ -55,7 +55,7 @@ private: int index; bool LoadGLTextures(); GLuint texture[1]; - QImage tex; + TQImage tex; }; @@ -71,14 +71,14 @@ public slots: private: Wave *wave; - QTimer *timer; + TQTimer *timer; }; class KWaveSetup : public SetupUi { Q_OBJECT public: - KWaveSetup( QWidget *parent = NULL, const char *name = NULL ); + KWaveSetup( TQWidget *parent = NULL, const char *name = NULL ); ~KWaveSetup( ); protected: void readSettings(); diff --git a/kscreensaver/kpartsaver/kpartsaver.cpp b/kscreensaver/kpartsaver/kpartsaver.cpp index 5a1c09c7..e1699e73 100644 --- a/kscreensaver/kpartsaver/kpartsaver.cpp +++ b/kscreensaver/kpartsaver/kpartsaver.cpp @@ -21,16 +21,16 @@ #include <unistd.h> #include <time.h> -#include <qwidget.h> -#include <qdialog.h> -#include <qtimer.h> -#include <qstring.h> -#include <qvaluelist.h> -#include <qpushbutton.h> -#include <qradiobutton.h> -#include <qspinbox.h> -#include <qcheckbox.h> -#include <qlabel.h> +#include <tqwidget.h> +#include <tqdialog.h> +#include <tqtimer.h> +#include <tqstring.h> +#include <tqvaluelist.h> +#include <tqpushbutton.h> +#include <tqradiobutton.h> +#include <tqspinbox.h> +#include <tqcheckbox.h> +#include <tqlabel.h> #include <klocale.h> #include <kapplication.h> @@ -52,7 +52,7 @@ #include <kiconloader.h> -QPtrList<KPartSaver> g_savers; +TQPtrList<KPartSaver> g_savers; bool g_inited = false; @@ -68,7 +68,7 @@ extern "C" return new KPartSaver( d ); } - KDE_EXPORT QDialog *kss_setup() + KDE_EXPORT TQDialog *kss_setup() { kdDebug() << "kss_setup" << endl; KGlobal::locale()->insertCatalogue("kpartsaver"); @@ -121,7 +121,7 @@ KPartSaver::KPartSaver( WId id ) if( m_files.count()==0 ) { // create background widget - m_back = new QLabel( i18n("The screen saver is not configured yet."), this ); + m_back = new TQLabel( i18n("The screen saver is not configured yet."), this ); m_back->setAlignment( AlignCenter ); embed( m_back ); @@ -138,9 +138,9 @@ KPartSaver::KPartSaver( WId id ) next( m_random ); else { next( m_random ); - m_timer = new QTimer( this ); + m_timer = new TQTimer( this ); m_timer->start( m_delay*1000, true ); - connect( m_timer, SIGNAL(timeout()), SLOT(timeout()) ); + connect( m_timer, TQT_SIGNAL(timeout()), TQT_SLOT(timeout()) ); } } } @@ -168,7 +168,7 @@ bool KPartSaver::openURL( KURL url ) closeURL(); // find mime type - QString mime = KMimeType::findByURL( url )->name(); + TQString mime = KMimeType::findByURL( url )->name(); // find fitting kparts KTrader::OfferList offers; @@ -179,7 +179,7 @@ bool KPartSaver::openURL( KURL url ) } // load kpart library - QString lib = offers.first()->library(); + TQString lib = offers.first()->library(); KLibFactory *factory = KLibLoader::self()->factory( lib.latin1() ); if( !factory ) { kdDebug() << "Library " << lib << " not found." << endl; @@ -255,7 +255,7 @@ void KPartSaver::next( bool random ) } // create background widget - m_back = new QLabel( i18n("All of your files are unsupported"), this ); + m_back = new TQLabel( i18n("All of your files are unsupported"), this ); m_back->setAlignment( AlignCenter ); embed( m_back ); @@ -269,23 +269,23 @@ void KPartSaver::next( bool random ) /*******************************************************************************/ -SaverConfig::SaverConfig( QWidget* parent, const char* name ) +SaverConfig::SaverConfig( TQWidget* parent, const char* name ) : ConfigWidget( parent, name, true ) { - connect( m_ok, SIGNAL(clicked()), SLOT(apply()) ); - connect( m_ok, SIGNAL(clicked()), SLOT(accept()) ); - connect( m_cancel, SIGNAL(clicked()), SLOT(reject()) ); + connect( m_ok, TQT_SIGNAL(clicked()), TQT_SLOT(apply()) ); + connect( m_ok, TQT_SIGNAL(clicked()), TQT_SLOT(accept()) ); + connect( m_cancel, TQT_SIGNAL(clicked()), TQT_SLOT(reject()) ); - connect( m_multiple, SIGNAL(toggled(bool)), m_delayLabel, SLOT(setEnabled(bool)) ); - connect( m_multiple, SIGNAL(toggled(bool)), m_delay, SLOT(setEnabled(bool)) ); - connect( m_multiple, SIGNAL(toggled(bool)), m_secondsLabel, SLOT(setEnabled(bool)) ); - connect( m_multiple, SIGNAL(toggled(bool)), m_random, SLOT(setEnabled(bool)) ); + connect( m_multiple, TQT_SIGNAL(toggled(bool)), m_delayLabel, TQT_SLOT(setEnabled(bool)) ); + connect( m_multiple, TQT_SIGNAL(toggled(bool)), m_delay, TQT_SLOT(setEnabled(bool)) ); + connect( m_multiple, TQT_SIGNAL(toggled(bool)), m_secondsLabel, TQT_SLOT(setEnabled(bool)) ); + connect( m_multiple, TQT_SIGNAL(toggled(bool)), m_random, TQT_SLOT(setEnabled(bool)) ); - connect( m_files, SIGNAL(selectionChanged()), SLOT(select()) ); - connect( m_add, SIGNAL(clicked()), SLOT(add()) ); - connect( m_remove, SIGNAL(clicked()), SLOT(remove()) ); - connect( m_up, SIGNAL(clicked()), SLOT(up()) ); - connect( m_down, SIGNAL(clicked()), SLOT(down()) ); + connect( m_files, TQT_SIGNAL(selectionChanged()), TQT_SLOT(select()) ); + connect( m_add, TQT_SIGNAL(clicked()), TQT_SLOT(add()) ); + connect( m_remove, TQT_SIGNAL(clicked()), TQT_SLOT(remove()) ); + connect( m_up, TQT_SIGNAL(clicked()), TQT_SLOT(up()) ); + connect( m_down, TQT_SIGNAL(clicked()), TQT_SLOT(down()) ); m_up->setIconSet( SmallIconSet("up") ); m_down->setIconSet( SmallIconSet("down") ); @@ -325,7 +325,7 @@ void SaverConfig::apply() cfg->writeEntry( "Random", m_random->isChecked() ); int num = m_files->count(); - QStringList files; + TQStringList files; for( int n=0; n<num; n++ ) files << m_files->text(n); @@ -337,7 +337,7 @@ void SaverConfig::apply() void SaverConfig::add() { - KURL::List files = KFileDialog::getOpenURLs( QString::null, QString::null, + KURL::List files = KFileDialog::getOpenURLs( TQString::null, TQString::null, this, i18n("Select Media Files") ); for( unsigned int n=0; n<files.count(); n++ ) m_files->insertItem( files[n].prettyURL(), -1 ); @@ -365,7 +365,7 @@ void SaverConfig::up() { int current = m_files->currentItem(); if ( current>0 ) { - QString txt = m_files->currentText(); + TQString txt = m_files->currentText(); m_files->removeItem( current ); m_files->insertItem( txt, current-1 ); m_files->setCurrentItem( current-1 ); @@ -377,7 +377,7 @@ void SaverConfig::down() { int current = m_files->currentItem(); if ( current!=-1 && current<(int)m_files->count()-1 ) { - QString txt = m_files->currentText(); + TQString txt = m_files->currentText(); m_files->removeItem( current ); m_files->insertItem( txt, current+1 ); m_files->setCurrentItem( current+1 ); diff --git a/kscreensaver/kpartsaver/kpartsaver.h b/kscreensaver/kpartsaver/kpartsaver.h index 2f92ca47..40e9c342 100644 --- a/kscreensaver/kpartsaver/kpartsaver.h +++ b/kscreensaver/kpartsaver/kpartsaver.h @@ -20,16 +20,16 @@ #define KPARTSAVER_H_INCLUDED -#include <qwidget.h> -#include <qtimer.h> -#include <qstring.h> -#include <qvaluelist.h> -#include <qdialog.h> -#include <qpushbutton.h> -#include <qradiobutton.h> -#include <qspinbox.h> -#include <qcheckbox.h> -#include <qlabel.h> +#include <tqwidget.h> +#include <tqtimer.h> +#include <tqstring.h> +#include <tqvaluelist.h> +#include <tqdialog.h> +#include <tqpushbutton.h> +#include <tqradiobutton.h> +#include <tqspinbox.h> +#include <tqcheckbox.h> +#include <tqlabel.h> #include <klocale.h> #include <kapplication.h> @@ -52,7 +52,7 @@ class SaverConfig : public ConfigWidget { Q_OBJECT public: - SaverConfig( QWidget* parent = 0, const char* name = 0 ); + SaverConfig( TQWidget* parent = 0, const char* name = 0 ); ~SaverConfig(); protected slots: @@ -86,16 +86,16 @@ Q_OBJECT bool openURL( KURL url ); - QValueList<Medium> m_media; - QTimer *m_timer; + TQValueList<Medium> m_media; + TQTimer *m_timer; KParts::ReadOnlyPart *m_part; int m_current; bool m_single; bool m_random; int m_delay; - QStringList m_files; - QLabel *m_back; + TQStringList m_files; + TQLabel *m_back; }; #endif diff --git a/kscreensaver/kxsconfig/kxsconfig.cpp b/kscreensaver/kxsconfig/kxsconfig.cpp index feda1ee8..ca3093de 100644 --- a/kscreensaver/kxsconfig/kxsconfig.cpp +++ b/kscreensaver/kxsconfig/kxsconfig.cpp @@ -37,11 +37,11 @@ #include <config.h> #include <stdlib.h> -#include <qlayout.h> -#include <qtimer.h> -#include <qvbox.h> -#include <qlabel.h> -#include <qfileinfo.h> +#include <tqlayout.h> +#include <tqtimer.h> +#include <tqvbox.h> +#include <tqlabel.h> +#include <tqfileinfo.h> #include <kdebug.h> #include <kapplication.h> @@ -57,7 +57,7 @@ #include "kxscontrol.h" #include "kxsxml.h" -template class QPtrList<KXSConfigItem>; +template class TQPtrList<KXSConfigItem>; #include <X11/Xlib.h> #include <X11/Xatom.h> @@ -75,7 +75,7 @@ const uint widgetEventMask = // X event mask StructureNotifyMask ); -KXSConfigDialog::KXSConfigDialog(const QString &filename, const QString &name) +KXSConfigDialog::KXSConfigDialog(const TQString &filename, const TQString &name) : KDialogBase(Plain, name, Ok| Cancel, Ok, 0, 0, false), mFilename(filename), mPreviewProc(0), mKilled(true) { @@ -91,33 +91,33 @@ KXSConfigDialog::KXSConfigDialog(const QString &filename, const QString &name) bool KXSConfigDialog::create() { - QVBoxLayout *topLayout = new QVBoxLayout(plainPage(), spacingHint()); - QHBoxLayout *layout = new QHBoxLayout(topLayout, spacingHint()); - QVBox *controlLayout = new QVBox(plainPage()); + TQVBoxLayout *topLayout = new TQVBoxLayout(plainPage(), spacingHint()); + TQHBoxLayout *layout = new TQHBoxLayout(topLayout, spacingHint()); + TQVBox *controlLayout = new TQVBox(plainPage()); controlLayout->setSpacing(spacingHint()); layout->addWidget(controlLayout); - ((QBoxLayout*)controlLayout->layout())->addStrut(120); + ((TQBoxLayout*)controlLayout->layout())->addStrut(120); KConfig config(mConfigFile); - QString xmlFile = "/doesntexist"; + TQString xmlFile = "/doesntexist"; #ifdef XSCREENSAVER_CONFIG_DIR xmlFile = XSCREENSAVER_CONFIG_DIR; #endif xmlFile += "/" + mExeName + ".xml"; - if ( QFile::exists( xmlFile ) ) { + if ( TQFile::exists( xmlFile ) ) { // We can use the xscreensaver xml config files. KXSXml xmlParser(controlLayout); xmlParser.parse( xmlFile ); mConfigItemList = *xmlParser.items(); - QWidget *spacer = new QWidget(controlLayout); + TQWidget *spacer = new TQWidget(controlLayout); controlLayout->setStretchFactor(spacer, 1 ); - QString descr = xmlParser.description(); + TQString descr = xmlParser.description(); if ( !descr.isEmpty() ) { descr.replace('\n',' '); descr = descr.simplifyWhiteSpace(); - QLabel *l = new QLabel( i18n( descr.utf8() ), plainPage() ); + TQLabel *l = new TQLabel( i18n( descr.utf8() ), plainPage() ); l->setAlignment ( WordBreak ); topLayout->addWidget( l ); } @@ -125,10 +125,10 @@ bool KXSConfigDialog::create() // fall back to KDE's old config files. int idx = 0; while (true) { - QString group = QString("Arg%1").arg(idx); + TQString group = TQString("Arg%1").arg(idx); if (config.hasGroup(group)) { config.setGroup(group); - QString type = config.readEntry("Type"); + TQString type = config.readEntry("Type"); if (type == "Range") { KXSRangeControl *rc = new KXSRangeControl(controlLayout, group, config); mConfigItemList.append(rc); @@ -154,27 +154,27 @@ bool KXSConfigDialog::create() return false; } - QPtrListIterator<KXSConfigItem> it( mConfigItemList ); + TQPtrListIterator<KXSConfigItem> it( mConfigItemList ); KXSConfigItem *item; while ( (item = it.current()) != 0 ) { ++it; item->read( config ); - QWidget *i = dynamic_cast<QWidget*>(item); + TQWidget *i = dynamic_cast<TQWidget*>(item); if (i) { - connect( i, SIGNAL(changed()), SLOT(slotChanged()) ); + connect( i, TQT_SIGNAL(changed()), TQT_SLOT(slotChanged()) ); } } mPreviewProc = new KProcess; - connect(mPreviewProc, SIGNAL(processExited(KProcess *)), - SLOT(slotPreviewExited(KProcess *))); + connect(mPreviewProc, TQT_SIGNAL(processExited(KProcess *)), + TQT_SLOT(slotPreviewExited(KProcess *))); - mPreviewTimer = new QTimer(this); - connect(mPreviewTimer, SIGNAL(timeout()), SLOT(slotNewPreview())); + mPreviewTimer = new TQTimer(this); + connect(mPreviewTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotNewPreview())); - mPreview = new QWidget(plainPage()); + mPreview = new TQWidget(plainPage()); mPreview->setFixedSize(250, 200); - // mPreview->setBackgroundMode(QWidget::NoBackground); + // mPreview->setBackgroundMode(TQWidget::NoBackground); mPreview->setBackgroundColor(Qt::black); layout->add(mPreview); @@ -199,9 +199,9 @@ KXSConfigDialog::~KXSConfigDialog() } //--------------------------------------------------------------------------- -QString KXSConfigDialog::command() +TQString KXSConfigDialog::command() { - QString cmd; + TQString cmd; KXSConfigItem *item; for (item = mConfigItemList.first(); item != 0; item = mConfigItemList.next()) @@ -218,19 +218,19 @@ void KXSConfigDialog::slotPreviewExited(KProcess *) if ( mKilled ) { mKilled = false; mPreviewProc->clearArguments(); - QString saver; + TQString saver; saver.sprintf( "%s -window-id 0x%lX", mFilename.latin1(), long(mPreview->winId()) ); saver += command(); kdDebug() << "Command: " << saver << endl; unsigned int i = 0; - QString word; + TQString word; saver = saver.stripWhiteSpace(); while ( !saver[i].isSpace() ) word += saver[i++]; //work around a KStandarDirs::findExe() "feature" where it looks in $KDEDIR/bin first no matter what and sometimes finds the wrong executable - QFileInfo checkExe; - QString saverdir = QString("%1/%2").arg(XSCREENSAVER_HACKS_DIR).arg(word); - QString path; + TQFileInfo checkExe; + TQString saverdir = TQString("%1/%2").arg(XSCREENSAVER_HACKS_DIR).arg(word); + TQString path; checkExe.setFile(saverdir); if (checkExe.exists() && checkExe.isExecutable() && checkExe.isFile()) { @@ -260,8 +260,8 @@ void KXSConfigDialog::slotPreviewExited(KProcess *) } } else { // stops us from spawning the hack really fast, but still not the best - QString path = KStandardDirs::findExe(mFilename, XSCREENSAVER_HACKS_DIR); - if ( QFile::exists(path) ) { + TQString path = KStandardDirs::findExe(mFilename, XSCREENSAVER_HACKS_DIR); + if ( TQFile::exists(path) ) { mKilled = true; slotChanged(); } @@ -370,7 +370,7 @@ int main(int argc, char *argv[]) XtGetApplicationNameAndClass (dpy, const_cast<char**>(&progname), const_cast<char**>(&progclass)); - QString name = QString::fromLocal8Bit(args->arg(args->count() - 1)); + TQString name = TQString::fromLocal8Bit(args->arg(args->count() - 1)); KXSConfigDialog *dialog=new KXSConfigDialog(args->arg(0), name); if ( dialog->create() ) { dialog->show(); diff --git a/kscreensaver/kxsconfig/kxsconfig.h b/kscreensaver/kxsconfig/kxsconfig.h index f17bcd85..1d17b78e 100644 --- a/kscreensaver/kxsconfig/kxsconfig.h +++ b/kscreensaver/kxsconfig/kxsconfig.h @@ -32,11 +32,11 @@ class KXSConfigDialog : public KDialogBase { Q_OBJECT public: - KXSConfigDialog(const QString &file, const QString &name); + KXSConfigDialog(const TQString &file, const TQString &name); ~KXSConfigDialog(); bool create(); - QString command(); + TQString command(); protected slots: void slotPreviewExited(KProcess *); @@ -46,13 +46,13 @@ protected slots: virtual void slotCancel(); protected: - QString mFilename; - QString mExeName; - QString mConfigFile; + TQString mFilename; + TQString mExeName; + TQString mConfigFile; KProcess *mPreviewProc; - QWidget *mPreview; - QTimer *mPreviewTimer; - QPtrList<KXSConfigItem> mConfigItemList; + TQWidget *mPreview; + TQTimer *mPreviewTimer; + TQPtrList<KXSConfigItem> mConfigItemList; bool mKilled; }; diff --git a/kscreensaver/kxsconfig/kxscontrol.cpp b/kscreensaver/kxsconfig/kxscontrol.cpp index b8a2b666..aca1993c 100644 --- a/kscreensaver/kxsconfig/kxscontrol.cpp +++ b/kscreensaver/kxsconfig/kxscontrol.cpp @@ -19,63 +19,63 @@ // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, // Boston, MA 02110-1301, USA. -#include <qlabel.h> -#include <qslider.h> -#include <qlayout.h> -#include <qcombobox.h> -#include <qlineedit.h> -#include <qspinbox.h> -#include <qpushbutton.h> -#include <qxml.h> +#include <tqlabel.h> +#include <tqslider.h> +#include <tqlayout.h> +#include <tqcombobox.h> +#include <tqlineedit.h> +#include <tqspinbox.h> +#include <tqpushbutton.h> +#include <tqxml.h> #include <klocale.h> #include <kfiledialog.h> #include "kxscontrol.h" //=========================================================================== -KXSRangeControl::KXSRangeControl(QWidget *parent, const QString &name, +KXSRangeControl::KXSRangeControl(TQWidget *parent, const TQString &name, KConfig &config) - : QWidget(parent), KXSRangeItem(name, config), mSlider(0), mSpinBox(0) + : TQWidget(parent), KXSRangeItem(name, config), mSlider(0), mSpinBox(0) { - QVBoxLayout *l = new QVBoxLayout(this); - QLabel *label = new QLabel(mLabel, this); + TQVBoxLayout *l = new TQVBoxLayout(this); + TQLabel *label = new TQLabel(mLabel, this); l->add(label); - mSlider = new QSlider(mMinimum, mMaximum, 10, mValue, Qt::Horizontal, this); - connect(mSlider, SIGNAL(valueChanged(int)), SLOT(slotValueChanged(int))); + mSlider = new TQSlider(mMinimum, mMaximum, 10, mValue, Qt::Horizontal, this); + connect(mSlider, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotValueChanged(int))); l->add(mSlider); } -KXSRangeControl::KXSRangeControl(QWidget *parent, const QString &name, - const QXmlAttributes &attr ) - : QWidget(parent), KXSRangeItem(name, attr), mSlider(0), mSpinBox(0) +KXSRangeControl::KXSRangeControl(TQWidget *parent, const TQString &name, + const TQXmlAttributes &attr ) + : TQWidget(parent), KXSRangeItem(name, attr), mSlider(0), mSpinBox(0) { if (attr.value("type") == "spinbutton" ) { - QHBoxLayout *hb = new QHBoxLayout(this); + TQHBoxLayout *hb = new TQHBoxLayout(this); if (!mLabel.isEmpty()) { - QLabel *l = new QLabel(i18n(mLabel.utf8()), this); + TQLabel *l = new TQLabel(i18n(mLabel.utf8()), this); hb->add(l); } - mSpinBox = new QSpinBox(mMinimum, mMaximum, 1, this); + mSpinBox = new TQSpinBox(mMinimum, mMaximum, 1, this); mSpinBox->setValue(mValue); - connect(mSpinBox, SIGNAL(valueChanged(int)), SLOT(slotValueChanged(int))); + connect(mSpinBox, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotValueChanged(int))); hb->add(mSpinBox); } else { - QString lowLabel = attr.value("_low-label"); - QString highLabel = attr.value("_high-label"); - QVBoxLayout *vb = new QVBoxLayout(this); + TQString lowLabel = attr.value("_low-label"); + TQString highLabel = attr.value("_high-label"); + TQVBoxLayout *vb = new TQVBoxLayout(this); if (!mLabel.isEmpty()) { - QLabel *l = new QLabel(i18n(mLabel.utf8()), this); + TQLabel *l = new TQLabel(i18n(mLabel.utf8()), this); vb->add(l); } - QHBoxLayout *hb = new QHBoxLayout(vb); + TQHBoxLayout *hb = new TQHBoxLayout(vb); if (!lowLabel.isEmpty()) { - QLabel *l = new QLabel(i18n(lowLabel.utf8()), this); + TQLabel *l = new TQLabel(i18n(lowLabel.utf8()), this); hb->addWidget(l); } - mSlider = new QSlider(mMinimum, mMaximum, 10, mValue, Qt::Horizontal, this); - connect(mSlider, SIGNAL(valueChanged(int)), SLOT(slotValueChanged(int))); + mSlider = new TQSlider(mMinimum, mMaximum, 10, mValue, Qt::Horizontal, this); + connect(mSlider, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotValueChanged(int))); hb->add(mSlider); if (!highLabel.isEmpty()){ - QLabel *l = new QLabel(i18n(highLabel.utf8()), this); + TQLabel *l = new TQLabel(i18n(highLabel.utf8()), this); hb->addWidget(l); } } @@ -97,43 +97,43 @@ void KXSRangeControl::read(KConfig &config) } //=========================================================================== -KXSDoubleRangeControl::KXSDoubleRangeControl(QWidget *parent, - const QString &name, KConfig &config) - : QWidget(parent), KXSDoubleRangeItem(name, config) +KXSDoubleRangeControl::KXSDoubleRangeControl(TQWidget *parent, + const TQString &name, KConfig &config) + : TQWidget(parent), KXSDoubleRangeItem(name, config) { - QVBoxLayout *l = new QVBoxLayout(this); - QLabel *label = new QLabel(mLabel, this); + TQVBoxLayout *l = new TQVBoxLayout(this); + TQLabel *label = new TQLabel(mLabel, this); l->add(label); int value = int((mValue - mMinimum) * 100 / (mMaximum - mMinimum)); - mSlider = new QSlider(0, 100, 10, value, Qt::Horizontal, this); - connect(mSlider, SIGNAL(valueChanged(int)), SLOT(slotValueChanged(int))); + mSlider = new TQSlider(0, 100, 10, value, Qt::Horizontal, this); + connect(mSlider, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotValueChanged(int))); l->add(mSlider); } -KXSDoubleRangeControl::KXSDoubleRangeControl(QWidget *parent, - const QString &name, const QXmlAttributes &attr) - : QWidget(parent), KXSDoubleRangeItem(name, attr) +KXSDoubleRangeControl::KXSDoubleRangeControl(TQWidget *parent, + const TQString &name, const TQXmlAttributes &attr) + : TQWidget(parent), KXSDoubleRangeItem(name, attr) { - QString lowLabel = attr.value("_low-label"); - QString highLabel = attr.value("_high-label"); - QVBoxLayout *vb = new QVBoxLayout(this); + TQString lowLabel = attr.value("_low-label"); + TQString highLabel = attr.value("_high-label"); + TQVBoxLayout *vb = new TQVBoxLayout(this); if (!mLabel.isEmpty()) { - QLabel *l = new QLabel(i18n(mLabel.utf8()), this); + TQLabel *l = new TQLabel(i18n(mLabel.utf8()), this); vb->add(l); } - QHBoxLayout *hb = new QHBoxLayout(vb); + TQHBoxLayout *hb = new TQHBoxLayout(vb); if (!lowLabel.isEmpty()) { - QLabel *l = new QLabel(i18n(lowLabel.utf8()), this); + TQLabel *l = new TQLabel(i18n(lowLabel.utf8()), this); hb->addWidget(l); } int value = int((mValue - mMinimum) * 100 / (mMaximum - mMinimum)); - mSlider = new QSlider(0, 100, 10, value, Qt::Horizontal, this); - connect(mSlider, SIGNAL(valueChanged(int)), SLOT(slotValueChanged(int))); + mSlider = new TQSlider(0, 100, 10, value, Qt::Horizontal, this); + connect(mSlider, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotValueChanged(int))); hb->add(mSlider); if (!highLabel.isEmpty()){ - QLabel *l = new QLabel(i18n(highLabel.utf8()), this); + TQLabel *l = new TQLabel(i18n(highLabel.utf8()), this); hb->addWidget(l); } } @@ -152,22 +152,22 @@ void KXSDoubleRangeControl::read(KConfig &config) } //=========================================================================== -KXSCheckBoxControl::KXSCheckBoxControl(QWidget *parent, const QString &name, +KXSCheckBoxControl::KXSCheckBoxControl(TQWidget *parent, const TQString &name, KConfig &config) - : QCheckBox(parent), KXSBoolItem(name, config) + : TQCheckBox(parent), KXSBoolItem(name, config) { setText(mLabel); setChecked(mValue); - connect(this, SIGNAL(toggled(bool)), SLOT(slotToggled(bool))); + connect(this, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotToggled(bool))); } -KXSCheckBoxControl::KXSCheckBoxControl(QWidget *parent, const QString &name, - const QXmlAttributes &attr) - : QCheckBox(parent), KXSBoolItem(name, attr) +KXSCheckBoxControl::KXSCheckBoxControl(TQWidget *parent, const TQString &name, + const TQXmlAttributes &attr) + : TQCheckBox(parent), KXSBoolItem(name, attr) { setText(i18n(mLabel.utf8())); setChecked(mValue); - connect(this, SIGNAL(toggled(bool)), SLOT(slotToggled(bool))); + connect(this, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotToggled(bool))); } void KXSCheckBoxControl::slotToggled(bool state) @@ -183,34 +183,34 @@ void KXSCheckBoxControl::read(KConfig &config) } //=========================================================================== -KXSDropListControl::KXSDropListControl(QWidget *parent, const QString &name, +KXSDropListControl::KXSDropListControl(TQWidget *parent, const TQString &name, KConfig &config) - : QWidget(parent), KXSSelectItem(name, config) + : TQWidget(parent), KXSSelectItem(name, config) { - QVBoxLayout *l = new QVBoxLayout(this); - QLabel *label = new QLabel(mLabel, this); + TQVBoxLayout *l = new TQVBoxLayout(this); + TQLabel *label = new TQLabel(mLabel, this); l->add(label); - mCombo = new QComboBox(this); + mCombo = new TQComboBox(this); for(uint i=0; i < mOptions.count(); i++) mCombo->insertItem( i18n(mOptions[i].utf8()) ); mCombo->setCurrentItem(mValue); - connect(mCombo, SIGNAL(activated(int)), SLOT(slotActivated(int))); + connect(mCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotActivated(int))); l->add(mCombo); } -KXSDropListControl::KXSDropListControl(QWidget *parent, const QString &name, - const QXmlAttributes &attr) - : QWidget(parent), KXSSelectItem(name, attr) +KXSDropListControl::KXSDropListControl(TQWidget *parent, const TQString &name, + const TQXmlAttributes &attr) + : TQWidget(parent), KXSSelectItem(name, attr) { - QVBoxLayout *l = new QVBoxLayout(this); - QLabel *label = new QLabel(i18n(mLabel.utf8()), this); + TQVBoxLayout *l = new TQVBoxLayout(this); + TQLabel *label = new TQLabel(i18n(mLabel.utf8()), this); l->add(label); - mCombo = new QComboBox(this); - connect(mCombo, SIGNAL(activated(int)), SLOT(slotActivated(int))); + mCombo = new TQComboBox(this); + connect(mCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotActivated(int))); l->add(mCombo); } -void KXSDropListControl::addOption(const QXmlAttributes &attr) +void KXSDropListControl::addOption(const TQXmlAttributes &attr) { KXSSelectItem::addOption( attr ); mCombo->insertItem( i18n(mOptions[mOptions.count()-1].utf8()) ); @@ -231,31 +231,31 @@ void KXSDropListControl::read(KConfig &config) } //=========================================================================== -KXSLineEditControl::KXSLineEditControl(QWidget *parent, const QString &name, +KXSLineEditControl::KXSLineEditControl(TQWidget *parent, const TQString &name, KConfig &config) - : QWidget(parent), KXSStringItem(name, config) + : TQWidget(parent), KXSStringItem(name, config) { - QVBoxLayout *l = new QVBoxLayout(this); - QLabel *label = new QLabel(mLabel, this); + TQVBoxLayout *l = new TQVBoxLayout(this); + TQLabel *label = new TQLabel(mLabel, this); l->add(label); - mEdit = new QLineEdit(this); - connect(mEdit, SIGNAL(textChanged(const QString &)), SLOT(textChanged(const QString &))); + mEdit = new TQLineEdit(this); + connect(mEdit, TQT_SIGNAL(textChanged(const TQString &)), TQT_SLOT(textChanged(const TQString &))); l->add(mEdit); } -KXSLineEditControl::KXSLineEditControl(QWidget *parent, const QString &name, - const QXmlAttributes &attr ) - : QWidget(parent), KXSStringItem(name, attr) +KXSLineEditControl::KXSLineEditControl(TQWidget *parent, const TQString &name, + const TQXmlAttributes &attr ) + : TQWidget(parent), KXSStringItem(name, attr) { - QVBoxLayout *l = new QVBoxLayout(this); - QLabel *label = new QLabel(i18n(mLabel.utf8()), this); + TQVBoxLayout *l = new TQVBoxLayout(this); + TQLabel *label = new TQLabel(i18n(mLabel.utf8()), this); l->add(label); - mEdit = new QLineEdit(this); - connect(mEdit, SIGNAL(textChanged(const QString &)), SLOT(textChanged(const QString &))); + mEdit = new TQLineEdit(this); + connect(mEdit, TQT_SIGNAL(textChanged(const TQString &)), TQT_SLOT(textChanged(const TQString &))); l->add(mEdit); } -void KXSLineEditControl::textChanged( const QString &text ) +void KXSLineEditControl::textChanged( const TQString &text ) { mValue = text; emit changed(); @@ -268,35 +268,35 @@ void KXSLineEditControl::read(KConfig &config) } //=========================================================================== -KXSFileControl::KXSFileControl(QWidget *parent, const QString &name, +KXSFileControl::KXSFileControl(TQWidget *parent, const TQString &name, KConfig &config) - : QWidget(parent), KXSStringItem(name, config) + : TQWidget(parent), KXSStringItem(name, config) { - QVBoxLayout *l = new QVBoxLayout(this); - QLabel *label = new QLabel(mLabel, this); + TQVBoxLayout *l = new TQVBoxLayout(this); + TQLabel *label = new TQLabel(mLabel, this); l->add(label); - mEdit = new QLineEdit(this); - connect(mEdit, SIGNAL(textChanged(const QString &)), SLOT(textChanged(const QString &))); + mEdit = new TQLineEdit(this); + connect(mEdit, TQT_SIGNAL(textChanged(const TQString &)), TQT_SLOT(textChanged(const TQString &))); l->add(mEdit); } -KXSFileControl::KXSFileControl(QWidget *parent, const QString &name, - const QXmlAttributes &attr ) - : QWidget(parent), KXSStringItem(name, attr) +KXSFileControl::KXSFileControl(TQWidget *parent, const TQString &name, + const TQXmlAttributes &attr ) + : TQWidget(parent), KXSStringItem(name, attr) { - QVBoxLayout *l = new QVBoxLayout(this); - QLabel *label = new QLabel(i18n(mLabel.utf8()), this); + TQVBoxLayout *l = new TQVBoxLayout(this); + TQLabel *label = new TQLabel(i18n(mLabel.utf8()), this); l->add(label); - QHBoxLayout *hb = new QHBoxLayout(l); - mEdit = new QLineEdit(this); - connect(mEdit, SIGNAL(textChanged(const QString &)), SLOT(textChanged(const QString &))); + TQHBoxLayout *hb = new TQHBoxLayout(l); + mEdit = new TQLineEdit(this); + connect(mEdit, TQT_SIGNAL(textChanged(const TQString &)), TQT_SLOT(textChanged(const TQString &))); hb->add(mEdit); - QPushButton *pb = new QPushButton( "...", this ); - connect( pb, SIGNAL(clicked()), this, SLOT(selectFile()) ); + TQPushButton *pb = new TQPushButton( "...", this ); + connect( pb, TQT_SIGNAL(clicked()), this, TQT_SLOT(selectFile()) ); hb->addWidget(pb); } -void KXSFileControl::textChanged( const QString &text ) +void KXSFileControl::textChanged( const TQString &text ) { mValue = text; emit changed(); @@ -304,7 +304,7 @@ void KXSFileControl::textChanged( const QString &text ) void KXSFileControl::selectFile() { - QString f = KFileDialog::getOpenFileName(); + TQString f = KFileDialog::getOpenFileName(); if ( !f.isEmpty() ) { mValue = f; mEdit->setText(mValue); diff --git a/kscreensaver/kxsconfig/kxscontrol.h b/kscreensaver/kxsconfig/kxscontrol.h index 36f16e43..8a6dde3c 100644 --- a/kscreensaver/kxsconfig/kxscontrol.h +++ b/kscreensaver/kxsconfig/kxscontrol.h @@ -22,8 +22,8 @@ #ifndef __KXSCONTROL_H__ #define __KXSCONTROL_H__ -#include <qwidget.h> -#include <qcheckbox.h> +#include <tqwidget.h> +#include <tqcheckbox.h> #include "kxsitem.h" @@ -34,12 +34,12 @@ class QComboBox; class QLineEdit; //=========================================================================== -class KXSRangeControl : public QWidget, public KXSRangeItem +class KXSRangeControl : public TQWidget, public KXSRangeItem { Q_OBJECT public: - KXSRangeControl(QWidget *parent, const QString &name, KConfig &config); - KXSRangeControl(QWidget *parent, const QString &name, const QXmlAttributes &attr ); + KXSRangeControl(TQWidget *parent, const TQString &name, KConfig &config); + KXSRangeControl(TQWidget *parent, const TQString &name, const TQXmlAttributes &attr ); virtual void read(KConfig &config); @@ -50,17 +50,17 @@ protected slots: void slotValueChanged(int value); protected: - QSlider *mSlider; - QSpinBox *mSpinBox; + TQSlider *mSlider; + TQSpinBox *mSpinBox; }; //=========================================================================== -class KXSDoubleRangeControl : public QWidget, public KXSDoubleRangeItem +class KXSDoubleRangeControl : public TQWidget, public KXSDoubleRangeItem { Q_OBJECT public: - KXSDoubleRangeControl(QWidget *parent, const QString &name, KConfig &config); - KXSDoubleRangeControl(QWidget *parent, const QString &name, const QXmlAttributes &attr ); + KXSDoubleRangeControl(TQWidget *parent, const TQString &name, KConfig &config); + KXSDoubleRangeControl(TQWidget *parent, const TQString &name, const TQXmlAttributes &attr ); virtual void read(KConfig &config); @@ -71,17 +71,17 @@ protected slots: void slotValueChanged(int value); protected: - QSlider *mSlider; + TQSlider *mSlider; double mStep; }; //=========================================================================== -class KXSCheckBoxControl : public QCheckBox, public KXSBoolItem +class KXSCheckBoxControl : public TQCheckBox, public KXSBoolItem { Q_OBJECT public: - KXSCheckBoxControl(QWidget *parent, const QString &name, KConfig &config); - KXSCheckBoxControl(QWidget *parent, const QString &name, const QXmlAttributes &attr ); + KXSCheckBoxControl(TQWidget *parent, const TQString &name, KConfig &config); + KXSCheckBoxControl(TQWidget *parent, const TQString &name, const TQXmlAttributes &attr ); virtual void read(KConfig &config); @@ -93,16 +93,16 @@ protected slots: }; //=========================================================================== -class KXSDropListControl : public QWidget, public KXSSelectItem +class KXSDropListControl : public TQWidget, public KXSSelectItem { Q_OBJECT public: - KXSDropListControl(QWidget *parent, const QString &name, KConfig &config); - KXSDropListControl(QWidget *parent, const QString &name, const QXmlAttributes &attr ); + KXSDropListControl(TQWidget *parent, const TQString &name, KConfig &config); + KXSDropListControl(TQWidget *parent, const TQString &name, const TQXmlAttributes &attr ); virtual void read(KConfig &config); - virtual void addOption( const QXmlAttributes &attr ); + virtual void addOption( const TQXmlAttributes &attr ); signals: void changed(); @@ -111,16 +111,16 @@ protected slots: void slotActivated(int); protected: - QComboBox *mCombo; + TQComboBox *mCombo; }; //=========================================================================== -class KXSLineEditControl : public QWidget, public KXSStringItem +class KXSLineEditControl : public TQWidget, public KXSStringItem { Q_OBJECT public: - KXSLineEditControl(QWidget *parent, const QString &name, KConfig &config); - KXSLineEditControl(QWidget *parent, const QString &name, const QXmlAttributes &attr ); + KXSLineEditControl(TQWidget *parent, const TQString &name, KConfig &config); + KXSLineEditControl(TQWidget *parent, const TQString &name, const TQXmlAttributes &attr ); virtual void read(KConfig &config); @@ -128,19 +128,19 @@ signals: void changed(); protected slots: - void textChanged(const QString &); + void textChanged(const TQString &); protected: - QLineEdit *mEdit; + TQLineEdit *mEdit; }; //=========================================================================== -class KXSFileControl : public QWidget, public KXSStringItem +class KXSFileControl : public TQWidget, public KXSStringItem { Q_OBJECT public: - KXSFileControl(QWidget *parent, const QString &name, KConfig &config); - KXSFileControl(QWidget *parent, const QString &name, const QXmlAttributes &attr ); + KXSFileControl(TQWidget *parent, const TQString &name, KConfig &config); + KXSFileControl(TQWidget *parent, const TQString &name, const TQXmlAttributes &attr ); virtual void read(KConfig &config); @@ -148,11 +148,11 @@ signals: void changed(); protected slots: - void textChanged(const QString &); + void textChanged(const TQString &); void selectFile(); protected: - QLineEdit *mEdit; + TQLineEdit *mEdit; }; diff --git a/kscreensaver/kxsconfig/kxsitem.cpp b/kscreensaver/kxsconfig/kxsitem.cpp index d7cd010c..7d9ab034 100644 --- a/kscreensaver/kxsconfig/kxsitem.cpp +++ b/kscreensaver/kxsconfig/kxsitem.cpp @@ -21,24 +21,24 @@ #include "kxsconfig.h" #include <klocale.h> -#include <qxml.h> +#include <tqxml.h> //=========================================================================== -KXSConfigItem::KXSConfigItem(const QString &name, KConfig &config) +KXSConfigItem::KXSConfigItem(const TQString &name, KConfig &config) : mName(name) { config.setGroup(name); mLabel = i18n(config.readEntry("Label").utf8()); } -KXSConfigItem::KXSConfigItem(const QString &name, const QXmlAttributes &attr ) +KXSConfigItem::KXSConfigItem(const TQString &name, const TQXmlAttributes &attr ) : mName(name) { mLabel = attr.value("_label"); } //=========================================================================== -KXSRangeItem::KXSRangeItem(const QString &name, KConfig &config) +KXSRangeItem::KXSRangeItem(const TQString &name, KConfig &config) : KXSConfigItem(name, config), mInvert(false) { mMinimum = config.readNumEntry("Minimum"); @@ -47,7 +47,7 @@ KXSRangeItem::KXSRangeItem(const QString &name, KConfig &config) mSwitch = config.readEntry("Switch"); } -KXSRangeItem::KXSRangeItem(const QString &name, const QXmlAttributes &attr ) +KXSRangeItem::KXSRangeItem(const TQString &name, const TQXmlAttributes &attr ) : KXSConfigItem(name, attr), mInvert(false) { mMinimum = attr.value("low").toInt(); @@ -63,7 +63,7 @@ KXSRangeItem::KXSRangeItem(const QString &name, const QXmlAttributes &attr ) mValue = mMaximum-(mValue-mMinimum); } -QString KXSRangeItem::command() +TQString KXSRangeItem::command() { return mSwitch.arg(mInvert?mMaximum-(mValue-mMinimum):mValue); } @@ -82,7 +82,7 @@ void KXSRangeItem::save(KConfig &config) } //=========================================================================== -KXSDoubleRangeItem::KXSDoubleRangeItem(const QString &name, KConfig &config) +KXSDoubleRangeItem::KXSDoubleRangeItem(const TQString &name, KConfig &config) : KXSConfigItem(name, config), mInvert(false) { mMinimum = config.readDoubleNumEntry("Minimum"); @@ -91,7 +91,7 @@ KXSDoubleRangeItem::KXSDoubleRangeItem(const QString &name, KConfig &config) mSwitch = config.readEntry("Switch"); } -KXSDoubleRangeItem::KXSDoubleRangeItem(const QString &name, const QXmlAttributes &attr) +KXSDoubleRangeItem::KXSDoubleRangeItem(const TQString &name, const TQXmlAttributes &attr) : KXSConfigItem(name, attr), mInvert(false) { mMinimum = attr.value("low").toDouble(); @@ -107,7 +107,7 @@ KXSDoubleRangeItem::KXSDoubleRangeItem(const QString &name, const QXmlAttributes mValue = mMaximum-(mValue-mMinimum); } -QString KXSDoubleRangeItem::command() +TQString KXSDoubleRangeItem::command() { return mSwitch.arg(mInvert?mMaximum-(mValue-mMinimum):mValue); } @@ -127,7 +127,7 @@ void KXSDoubleRangeItem::save(KConfig &config) //=========================================================================== -KXSBoolItem::KXSBoolItem(const QString &name, KConfig &config) +KXSBoolItem::KXSBoolItem(const TQString &name, KConfig &config) : KXSConfigItem(name, config) { mValue = config.readBoolEntry("Value"); @@ -135,7 +135,7 @@ KXSBoolItem::KXSBoolItem(const QString &name, KConfig &config) mSwitchOff = config.readEntry("SwitchOff"); } -KXSBoolItem::KXSBoolItem(const QString &name, const QXmlAttributes &attr ) +KXSBoolItem::KXSBoolItem(const TQString &name, const TQXmlAttributes &attr ) : KXSConfigItem(name, attr) { mSwitchOn = attr.value("arg-set"); @@ -143,7 +143,7 @@ KXSBoolItem::KXSBoolItem(const QString &name, const QXmlAttributes &attr ) mValue = mSwitchOn.isEmpty() ? true : false; } -QString KXSBoolItem::command() +TQString KXSBoolItem::command() { return mValue ? mSwitchOn : mSwitchOff; } @@ -162,7 +162,7 @@ void KXSBoolItem::save(KConfig &config) } //=========================================================================== -KXSSelectItem::KXSSelectItem(const QString &name, KConfig &config) +KXSSelectItem::KXSSelectItem(const TQString &name, KConfig &config) : KXSConfigItem(name, config) { mOptions = config.readListEntry("Options"); @@ -170,24 +170,24 @@ KXSSelectItem::KXSSelectItem(const QString &name, KConfig &config) mValue = config.readNumEntry("Value"); } -KXSSelectItem::KXSSelectItem(const QString &name, const QXmlAttributes &attr ) +KXSSelectItem::KXSSelectItem(const TQString &name, const TQXmlAttributes &attr ) : KXSConfigItem(name, attr), mValue(0) { } -void KXSSelectItem::addOption( const QXmlAttributes &attr ) +void KXSSelectItem::addOption( const TQXmlAttributes &attr ) { - QString opt = attr.value("_label"); - QString arg = attr.value("arg-set"); + TQString opt = attr.value("_label"); + TQString arg = attr.value("arg-set"); if ( arg.isEmpty() ) mValue = mSwitches.count(); mOptions += opt; mSwitches += arg; } -QString KXSSelectItem::command() +TQString KXSSelectItem::command() { - QStringList::Iterator it = mSwitches.at(mValue); + TQStringList::Iterator it = mSwitches.at(mValue); return (*it); } @@ -206,7 +206,7 @@ void KXSSelectItem::save(KConfig &config) //=========================================================================== -KXSStringItem::KXSStringItem(const QString &name, KConfig &config) +KXSStringItem::KXSStringItem(const TQString &name, KConfig &config) : KXSConfigItem(name, config) { mValue = config.readEntry("Value"); @@ -218,7 +218,7 @@ KXSStringItem::KXSStringItem(const QString &name, KConfig &config) } } -KXSStringItem::KXSStringItem(const QString &name, const QXmlAttributes &attr ) +KXSStringItem::KXSStringItem(const TQString &name, const TQXmlAttributes &attr ) : KXSConfigItem(name, attr) { mSwitch = attr.value("arg"); @@ -229,7 +229,7 @@ KXSStringItem::KXSStringItem(const QString &name, const QXmlAttributes &attr ) } } -QString KXSStringItem::command() +TQString KXSStringItem::command() { if (!mValue.isEmpty()) return mSwitch.arg(mValue); diff --git a/kscreensaver/kxsconfig/kxsitem.h b/kscreensaver/kxsconfig/kxsitem.h index fdffb8fe..8a614bb1 100644 --- a/kscreensaver/kxsconfig/kxsitem.h +++ b/kscreensaver/kxsconfig/kxsitem.h @@ -29,31 +29,31 @@ class QXmlAttributes; class KXSConfigItem { public: - KXSConfigItem(const QString &name, KConfig &config); - KXSConfigItem(const QString &name, const QXmlAttributes &attr); + KXSConfigItem(const TQString &name, KConfig &config); + KXSConfigItem(const TQString &name, const TQXmlAttributes &attr); virtual ~KXSConfigItem() {} - virtual QString command() = 0; + virtual TQString command() = 0; virtual void save(KConfig &config) = 0; virtual void read(KConfig &config) = 0; protected: - QString mName; - QString mLabel; + TQString mName; + TQString mLabel; }; class KXSRangeItem : public KXSConfigItem { public: - KXSRangeItem(const QString &name, KConfig &config); - KXSRangeItem(const QString &name, const QXmlAttributes &attr); + KXSRangeItem(const TQString &name, KConfig &config); + KXSRangeItem(const TQString &name, const TQXmlAttributes &attr); - virtual QString command(); + virtual TQString command(); virtual void save(KConfig &config); virtual void read(KConfig &config); protected: - QString mSwitch; + TQString mSwitch; int mMinimum; int mMaximum; int mValue; @@ -63,15 +63,15 @@ protected: class KXSDoubleRangeItem : public KXSConfigItem { public: - KXSDoubleRangeItem(const QString &name, KConfig &config); - KXSDoubleRangeItem(const QString &name, const QXmlAttributes &attr); + KXSDoubleRangeItem(const TQString &name, KConfig &config); + KXSDoubleRangeItem(const TQString &name, const TQXmlAttributes &attr); - virtual QString command(); + virtual TQString command(); virtual void read(KConfig &config); virtual void save(KConfig &config); protected: - QString mSwitch; + TQString mSwitch; double mMinimum; double mMaximum; double mValue; @@ -81,51 +81,51 @@ protected: class KXSBoolItem : public KXSConfigItem { public: - KXSBoolItem(const QString &name, KConfig &config); - KXSBoolItem(const QString &name, const QXmlAttributes &attr); + KXSBoolItem(const TQString &name, KConfig &config); + KXSBoolItem(const TQString &name, const TQXmlAttributes &attr); - virtual QString command(); + virtual TQString command(); virtual void read(KConfig &config); virtual void save(KConfig &config); protected: - QString mSwitchOn; - QString mSwitchOff; + TQString mSwitchOn; + TQString mSwitchOff; bool mValue; }; class KXSSelectItem : public KXSConfigItem { public: - KXSSelectItem(const QString &name, KConfig &config); - KXSSelectItem(const QString &name, const QXmlAttributes &attr); + KXSSelectItem(const TQString &name, KConfig &config); + KXSSelectItem(const TQString &name, const TQXmlAttributes &attr); - virtual void addOption(const QXmlAttributes &attr); + virtual void addOption(const TQXmlAttributes &attr); - virtual QString command(); + virtual TQString command(); virtual void read(KConfig &config); virtual void save(KConfig &config); protected: - QStringList mOptions; - QStringList mSwitches; + TQStringList mOptions; + TQStringList mSwitches; int mValue; }; class KXSStringItem : public KXSConfigItem { public: - KXSStringItem(const QString &name, KConfig &config); - KXSStringItem(const QString &name, const QXmlAttributes &attr); + KXSStringItem(const TQString &name, KConfig &config); + KXSStringItem(const TQString &name, const TQXmlAttributes &attr); - virtual QString command(); + virtual TQString command(); virtual void save(KConfig &config); virtual void read(KConfig &config); protected: - QString mSwitch; - QString mValue; + TQString mSwitch; + TQString mValue; }; #endif diff --git a/kscreensaver/kxsconfig/kxsrun.cpp b/kscreensaver/kxsconfig/kxsrun.cpp index 5a28f929..0f212c10 100644 --- a/kscreensaver/kxsconfig/kxsrun.cpp +++ b/kscreensaver/kxsconfig/kxsrun.cpp @@ -25,9 +25,9 @@ #include <stdio.h> #include <unistd.h> -#include <qptrlist.h> -#include <qfile.h> -#include <qfileinfo.h> +#include <tqptrlist.h> +#include <tqfile.h> +#include <tqfileinfo.h> #include <kdebug.h> #include <kapplication.h> @@ -41,7 +41,7 @@ #define MAX_ARGS 30 -template class QPtrList<KXSConfigItem>; +template class TQPtrList<KXSConfigItem>; //=========================================================================== static const char appName[] = "kxsrun"; @@ -71,33 +71,33 @@ int main(int argc, char *argv[]) if ( !args->count() ) exit( 1 ); - QString filename = args->arg(0); - QString configFile(filename); + TQString filename = args->arg(0); + TQString configFile(filename); // Get the config filename int slash = filename.findRev('/'); if (slash >= 0) configFile = filename.mid(slash+1); - QString exeName = configFile; + TQString exeName = configFile; configFile += "rc"; // read configuration args KConfig config(configFile); - QPtrList<KXSConfigItem> configItemList; + TQPtrList<KXSConfigItem> configItemList; - QString xmlFile = "/doesntexist"; + TQString xmlFile = "/doesntexist"; #ifdef XSCREENSAVER_CONFIG_DIR xmlFile = XSCREENSAVER_CONFIG_DIR; #endif xmlFile += "/" + exeName + ".xml"; - if ( QFile::exists( xmlFile ) ) { + if ( TQFile::exists( xmlFile ) ) { // We can use the xscreensaver xml config files. KXSXml xmlParser(0); xmlParser.parse(xmlFile); configItemList = *xmlParser.items(); - QPtrListIterator<KXSConfigItem> it( configItemList ); + TQPtrListIterator<KXSConfigItem> it( configItemList ); KXSConfigItem *item; while ( (item = it.current()) != 0 ) { ++it; @@ -108,10 +108,10 @@ int main(int argc, char *argv[]) int idx = 0; while (true) { - QString group = QString("Arg%1").arg(idx); + TQString group = TQString("Arg%1").arg(idx); if (config.hasGroup(group)) { config.setGroup(group); - QString type = config.readEntry("Type"); + TQString type = config.readEntry("Type"); if (type == "Range") { KXSRangeItem *rc = new KXSRangeItem(group, config); configItemList.append(rc); @@ -134,10 +134,10 @@ int main(int argc, char *argv[]) // find the xscreensaver executable //work around a KStandarDirs::findExe() "feature" where it looks in $KDEDIR/bin first no matter what and sometimes finds the wrong executable - QFileInfo checkExe; - QString saverdir = QString("%1/%2").arg(XSCREENSAVER_HACKS_DIR).arg(filename); + TQFileInfo checkExe; + TQString saverdir = TQString("%1/%2").arg(XSCREENSAVER_HACKS_DIR).arg(filename); kdDebug() << "saverdir is" << saverdir << endl; - QString exeFile; + TQString exeFile; checkExe.setFile(saverdir); if (checkExe.exists() && checkExe.isExecutable() && checkExe.isFile()) { @@ -151,10 +151,10 @@ int main(int argc, char *argv[]) strcpy(sargs[0], filename.ascii()); // add the command line options - QString cmd; + TQString cmd; unsigned int i; for (i = 1; i < (unsigned)args->count(); i++) - cmd += " " + QString(args->arg(i)); + cmd += " " + TQString(args->arg(i)); // add the config options KXSConfigItem *item; @@ -163,7 +163,7 @@ int main(int argc, char *argv[]) } // put into char * array for execv - QString word; + TQString word; int si = 1; i = 0; bool inQuotes = false; diff --git a/kscreensaver/kxsconfig/kxsxml.cpp b/kscreensaver/kxsconfig/kxsxml.cpp index d8a689be..e35294dd 100644 --- a/kscreensaver/kxsconfig/kxsxml.cpp +++ b/kscreensaver/kxsconfig/kxsxml.cpp @@ -21,23 +21,23 @@ #include "kxsxml.h" #include "kxscontrol.h" -#include <qobject.h> -#include <qfile.h> -#include <qvbox.h> -#include <qhbox.h> +#include <tqobject.h> +#include <tqfile.h> +#include <tqvbox.h> +#include <tqhbox.h> #include <stdio.h> -KXSXml::KXSXml( QWidget *p ) +KXSXml::KXSXml( TQWidget *p ) : parent(p), handler(0) { } -bool KXSXml::parse( const QString &filename ) +bool KXSXml::parse( const TQString &filename ) { - QFile file( filename ); + TQFile file( filename ); handler = new KXSXmlHandler( parent ); - QXmlInputSource source( &file ); - QXmlSimpleReader reader; + TQXmlInputSource source( &file ); + TQXmlSimpleReader reader; reader.setContentHandler( handler ); if ( !reader.parse( &source, FALSE ) ) return FALSE; @@ -45,24 +45,24 @@ bool KXSXml::parse( const QString &filename ) return true; } -const QPtrList<KXSConfigItem> *KXSXml::items() const +const TQPtrList<KXSConfigItem> *KXSXml::items() const { if ( handler ) return handler->items(); return 0; } -QString KXSXml::description() const +TQString KXSXml::description() const { if ( handler ) return handler->description(); - return QString(); + return TQString(); } //=========================================================================== -KXSXmlHandler::KXSXmlHandler( QWidget *p ) - : QXmlDefaultHandler(), parent(p), selItem(0), inDesc(false) +KXSXmlHandler::KXSXmlHandler( TQWidget *p ) + : TQXmlDefaultHandler(), parent(p), selItem(0), inDesc(false) { mParentStack.push( p ); } @@ -72,15 +72,15 @@ bool KXSXmlHandler::startDocument() return true; } -bool KXSXmlHandler::startElement( const QString&, const QString&, - const QString& qName, - const QXmlAttributes &atts ) +bool KXSXmlHandler::startElement( const TQString&, const TQString&, + const TQString& qName, + const TQXmlAttributes &atts ) { KXSConfigItem *i = 0; - QString id = atts.value("id"); + TQString id = atts.value("id"); if ( qName == "number" ) { - QString sLow = atts.value( "low" ); - QString sHigh = atts.value( "high" ); + TQString sLow = atts.value( "low" ); + TQString sHigh = atts.value( "high" ); if ( sLow.contains( '.' ) || sHigh.contains( '.' ) ) { if ( parent ) i = new KXSDoubleRangeControl( parent, id, atts ); @@ -118,11 +118,11 @@ bool KXSXmlHandler::startElement( const QString&, const QString&, } else if ( qName == "option" && selItem ) { selItem->addOption( atts ); } else if ( qName == "hgroup" && parent ) { - QHBox *hb = new QHBox( parent ); + TQHBox *hb = new TQHBox( parent ); mParentStack.push( hb ); parent = hb; } else if ( qName == "vgroup" && parent ) { - QVBox *vb = new QVBox( parent ); + TQVBox *vb = new TQVBox( parent ); mParentStack.push( vb ); parent = vb; } @@ -133,7 +133,7 @@ bool KXSXmlHandler::startElement( const QString&, const QString&, return true; } -bool KXSXmlHandler::endElement( const QString&, const QString&, const QString &qName ) +bool KXSXmlHandler::endElement( const TQString&, const TQString&, const TQString &qName ) { if ( qName == "select" ) { selItem = 0; @@ -148,7 +148,7 @@ bool KXSXmlHandler::endElement( const QString&, const QString&, const QString &q return true; } -bool KXSXmlHandler::characters( const QString &ch ) +bool KXSXmlHandler::characters( const TQString &ch ) { if ( inDesc ) desc += ch; diff --git a/kscreensaver/kxsconfig/kxsxml.h b/kscreensaver/kxsconfig/kxsxml.h index 922ad93e..c7278c20 100644 --- a/kscreensaver/kxsconfig/kxsxml.h +++ b/kscreensaver/kxsconfig/kxsxml.h @@ -23,46 +23,46 @@ #define KXSXML_H #include "kxsconfig.h" -#include <qxml.h> -#include <qptrstack.h> +#include <tqxml.h> +#include <tqptrstack.h> class KXSXmlHandler; class KXSXml { public: - KXSXml( QWidget *p ); + KXSXml( TQWidget *p ); - bool parse( const QString &filename ); - const QPtrList<KXSConfigItem> *items() const; - QString description() const; + bool parse( const TQString &filename ); + const TQPtrList<KXSConfigItem> *items() const; + TQString description() const; private: - QWidget *parent; + TQWidget *parent; KXSXmlHandler *handler; }; class KXSXmlHandler : public QXmlDefaultHandler { public: - KXSXmlHandler( QWidget *p ); + KXSXmlHandler( TQWidget *p ); bool startDocument(); - bool startElement( const QString&, const QString&, const QString& , - const QXmlAttributes& ); - bool endElement( const QString&, const QString&, const QString& ); - bool characters( const QString & ); + bool startElement( const TQString&, const TQString&, const TQString& , + const TQXmlAttributes& ); + bool endElement( const TQString&, const TQString&, const TQString& ); + bool characters( const TQString & ); - const QPtrList<KXSConfigItem> *items() const { return &mConfigItemList; } - const QString &description() const { return desc; } + const TQPtrList<KXSConfigItem> *items() const { return &mConfigItemList; } + const TQString &description() const { return desc; } private: - QWidget *parent; + TQWidget *parent; KXSSelectItem *selItem; bool inDesc; - QString desc; - QPtrList<KXSConfigItem> mConfigItemList; - QPtrStack<QWidget> mParentStack; + TQString desc; + TQPtrList<KXSConfigItem> mConfigItemList; + TQPtrStack<TQWidget> mParentStack; }; #endif // KXSXML_H diff --git a/kscreensaver/xsavers/demowin.h b/kscreensaver/xsavers/demowin.h index 327b61dc..d31fc353 100644 --- a/kscreensaver/xsavers/demowin.h +++ b/kscreensaver/xsavers/demowin.h @@ -25,13 +25,13 @@ class DemoWindow : public QWidget { Q_OBJECT public: - DemoWindow() : QWidget() + DemoWindow() : TQWidget() { setFixedSize(600, 420); } protected: - virtual void keyPressEvent(QKeyEvent *e) + virtual void keyPressEvent(TQKeyEvent *e) { if (e->ascii() == 'q') { diff --git a/kscreensaver/xsavers/helpers.cpp b/kscreensaver/xsavers/helpers.cpp index 1ba67925..ef700545 100644 --- a/kscreensaver/xsavers/helpers.cpp +++ b/kscreensaver/xsavers/helpers.cpp @@ -2,33 +2,33 @@ #include <kapplication.h> -void min_width(QWidget *w) { +void min_width(TQWidget *w) { w->setMinimumWidth(w->sizeHint().width()); } -void fixed_width(QWidget *w) { +void fixed_width(TQWidget *w) { w->setFixedWidth(w->sizeHint().width()); } -void min_height(QWidget *w) { +void min_height(TQWidget *w) { w->setMinimumHeight(w->sizeHint().height()); } -void fixed_height(QWidget *w) { +void fixed_height(TQWidget *w) { w->setFixedHeight(w->sizeHint().height()); } -void min_size(QWidget *w) { +void min_size(TQWidget *w) { w->setMinimumSize(w->sizeHint()); } -void fixed_size(QWidget *w) { +void fixed_size(TQWidget *w) { w->setFixedSize(w->sizeHint()); } KConfig *klock_config() { - QString name( kapp->argv()[0] ); + TQString name( kapp->argv()[0] ); int slash = name.findRev( '/' ); if ( slash ) name = name.mid( slash+1 ); diff --git a/kscreensaver/xsavers/helpers.h b/kscreensaver/xsavers/helpers.h index 948c86ef..c0f8fb59 100644 --- a/kscreensaver/xsavers/helpers.h +++ b/kscreensaver/xsavers/helpers.h @@ -1,15 +1,15 @@ #ifndef __HELPERS__H__ #define __HELPERS__H__ -#include <qwidget.h> +#include <tqwidget.h> #include <kconfig.h> -void min_width(QWidget *); -void fixed_width(QWidget *); -void min_height(QWidget *); -void fixed_height(QWidget *); -void min_size(QWidget *); -void fixed_size(QWidget *); +void min_width(TQWidget *); +void fixed_width(TQWidget *); +void min_height(TQWidget *); +void fixed_height(TQWidget *); +void min_size(TQWidget *); +void fixed_size(TQWidget *); /* * Use this to get a KConfig object that uses a reasonable config filename. diff --git a/kscreensaver/xsavers/main.cpp b/kscreensaver/xsavers/main.cpp index b264b8f5..78e5351d 100644 --- a/kscreensaver/xsavers/main.cpp +++ b/kscreensaver/xsavers/main.cpp @@ -11,7 +11,7 @@ #include <stdlib.h> #include <signal.h> -#include <qcolor.h> +#include <tqcolor.h> #include <klocale.h> #include <kconfig.h> @@ -75,7 +75,7 @@ int main(int argc, char *argv[]) if (args->isSet("root")) { - saveWin = QApplication::desktop()->handle(); + saveWin = TQApplication::desktop()->handle(); } if (args->isSet("demo")) @@ -86,7 +86,7 @@ int main(int argc, char *argv[]) if (saveWin == 0) { demoWidget = new DemoWindow(); - demoWidget->setBackgroundMode(QWidget::NoBackground); + demoWidget->setBackgroundMode(TQWidget::NoBackground); // demoWidget->setBackgroundColor(Qt::black); demoWidget->show(); saveWin = demoWidget->winId(); diff --git a/kscreensaver/xsavers/saver.cpp b/kscreensaver/xsavers/saver.cpp index b905d619..9af37da0 100644 --- a/kscreensaver/xsavers/saver.cpp +++ b/kscreensaver/xsavers/saver.cpp @@ -9,7 +9,7 @@ #include "saver.moc" //----------------------------------------------------------------------------- -kScreenSaver::kScreenSaver(Drawable drawable) : QObject() +kScreenSaver::kScreenSaver(Drawable drawable) : TQObject() { Window root; int ai; diff --git a/kscreensaver/xsavers/saver.h b/kscreensaver/xsavers/saver.h index 4f4727d0..318728fc 100644 --- a/kscreensaver/xsavers/saver.h +++ b/kscreensaver/xsavers/saver.h @@ -2,7 +2,7 @@ #ifndef __SAVER_H__ #define __SAVER_H__ -#include <qobject.h> +#include <tqobject.h> #include <X11/Xlib.h> extern void startScreenSaver( Drawable d ); diff --git a/kscreensaver/xsavers/space.cpp b/kscreensaver/xsavers/space.cpp index f3650558..77070ad2 100644 --- a/kscreensaver/xsavers/space.cpp +++ b/kscreensaver/xsavers/space.cpp @@ -49,8 +49,8 @@ #define LONG64 //#define QT_CLEAN_NAMESPACE -#include <qslider.h> -#include <qlayout.h> +#include <tqslider.h> +#include <tqlayout.h> #include <kglobal.h> #include <kconfig.h> #include <krandomsequence.h> @@ -462,10 +462,10 @@ initSpace(Window window) #define WARPFACTOR 100 //----------------------------------------------------------------------------- -#include <qpushbutton.h> -#include <qcheckbox.h> -#include <qlabel.h> -#include <qcolor.h> +#include <tqpushbutton.h> +#include <tqcheckbox.h> +#include <tqlabel.h> +#include <tqcolor.h> #include <kmessagebox.h> @@ -504,21 +504,21 @@ kSpaceSaver::kSpaceSaver( Drawable drawable ) : kScreenSaver( drawable ) readSettings(); counter = (int)warpinterval *WARPFACTOR; - colorContext = QColor::enterAllocContext(); + colorContext = TQColor::enterAllocContext(); initXLock( mGc ); initSpace( mDrawable ); timer.start( speed ); - connect( &timer, SIGNAL( timeout() ), SLOT( slotTimeout() ) ); + connect( &timer, TQT_SIGNAL( timeout() ), TQT_SLOT( slotTimeout() ) ); } kSpaceSaver::~kSpaceSaver() { timer.stop(); release_Space(); - QColor::leaveAllocContext(); - QColor::destroyAllocContext( colorContext ); + TQColor::leaveAllocContext(); + TQColor::destroyAllocContext( colorContext ); delete rnd; rnd = 0; } @@ -543,7 +543,7 @@ void kSpaceSaver::readSettings() KConfig *config = klock_config(); config->setGroup( "Settings" ); - QString str; + TQString str; str = config->readEntry( "Speed" ); if ( !str.isNull() ) @@ -575,44 +575,44 @@ void kSpaceSaver::slotTimeout() //----------------------------------------------------------------------------- -kSpaceSetup::kSpaceSetup( QWidget *parent, const char *name ) +kSpaceSetup::kSpaceSetup( TQWidget *parent, const char *name ) : KDialogBase( parent, name, true, i18n("Setup Space Screen Saver"), Ok|Cancel|Help, Ok, true ) { setButtonText( Help, i18n( "A&bout" ) ); readSettings(); - QWidget *page = new QWidget( this ); + TQWidget *page = new TQWidget( this ); setMainWidget( page ); - QHBoxLayout *hb = new QHBoxLayout( page, 0, spacingHint() ); - QVBoxLayout *vb = new QVBoxLayout( hb, spacingHint() ); + TQHBoxLayout *hb = new TQHBoxLayout( page, 0, spacingHint() ); + TQVBoxLayout *vb = new TQVBoxLayout( hb, spacingHint() ); - QLabel *label; - QSlider *slider; + TQLabel *label; + TQSlider *slider; - label = new QLabel( i18n("Speed:"), page ); + label = new TQLabel( i18n("Speed:"), page ); vb->addWidget( label ); - slider = new QSlider(MINSPEED, MAXSPEED, 10, speed, QSlider::Horizontal, + slider = new TQSlider(MINSPEED, MAXSPEED, 10, speed, TQSlider::Horizontal, page ); vb->addWidget( slider ); - slider->setTickmarks(QSlider::Below); + slider->setTickmarks(TQSlider::Below); slider->setTickInterval(10); - connect( slider, SIGNAL( valueChanged( int ) ), SLOT( slotSpeed( int ) ) ); + connect( slider, TQT_SIGNAL( valueChanged( int ) ), TQT_SLOT( slotSpeed( int ) ) ); - label = new QLabel( i18n("Warp interval:"), page ); + label = new TQLabel( i18n("Warp interval:"), page ); vb->addWidget( label ); - slider = new QSlider(MINWARP, MAXWARP, 3, warpinterval, Horizontal, page ); + slider = new TQSlider(MINWARP, MAXWARP, 3, warpinterval, Horizontal, page ); vb->addWidget( slider ); - slider->setTickmarks(QSlider::Below); + slider->setTickmarks(TQSlider::Below); slider->setTickInterval(3); - connect( slider, SIGNAL( valueChanged( int ) ), SLOT( slotWarp( int ) ) ); + connect( slider, TQT_SIGNAL( valueChanged( int ) ), TQT_SLOT( slotWarp( int ) ) ); vb->addStrut( 150 ); vb->addStretch(); - preview = new QWidget( page ); + preview = new TQWidget( page ); hb->addWidget( preview ); preview->setFixedSize( 220, 170 ); preview->setBackgroundColor( black ); @@ -657,11 +657,11 @@ void kSpaceSetup::slotOk() KConfig *config = klock_config(); config->setGroup( "Settings" ); - QString sspeed; + TQString sspeed; sspeed.setNum( speed ); config->writeEntry( "Speed", sspeed ); - QString interval; + TQString interval; interval.setNum( (int)warpinterval ); config->writeEntry( "WarpInterval", interval ); diff --git a/kscreensaver/xsavers/space.h b/kscreensaver/xsavers/space.h index 6bf82c87..f20db852 100644 --- a/kscreensaver/xsavers/space.h +++ b/kscreensaver/xsavers/space.h @@ -2,10 +2,10 @@ #ifndef __SPACE_H__ #define __SPACE_H__ -#include <qtimer.h> -#include <qptrlist.h> +#include <tqtimer.h> +#include <tqptrlist.h> #include <kdialogbase.h> -#include <qlineedit.h> +#include <tqlineedit.h> #include "saver.h" class kSpaceSaver : public kScreenSaver @@ -26,7 +26,7 @@ protected slots: void slotTimeout(); protected: - QTimer timer; + TQTimer timer; int colorContext; int counter; @@ -39,7 +39,7 @@ class kSpaceSetup : public KDialogBase { Q_OBJECT public: - kSpaceSetup( QWidget *parent = NULL, const char *name = NULL ); + kSpaceSetup( TQWidget *parent = NULL, const char *name = NULL ); protected: void readSettings(); @@ -51,7 +51,7 @@ private slots: void slotHelp(); private: - QWidget *preview; + TQWidget *preview; kSpaceSaver *saver; int speed; diff --git a/kscreensaver/xsavers/swarm.cpp b/kscreensaver/xsavers/swarm.cpp index 0afae901..efc04c28 100644 --- a/kscreensaver/xsavers/swarm.cpp +++ b/kscreensaver/xsavers/swarm.cpp @@ -21,7 +21,7 @@ #define MINBATCH 0 #define DEFBATCH 20 -#include <qslider.h> +#include <tqslider.h> #include <kglobal.h> #include <kconfig.h> #include <krandomsequence.h> @@ -217,10 +217,10 @@ drawswarm(Window win, KRandomSequence &rnd) //----------------------------------------------------------------------------- -#include <qcheckbox.h> -#include <qlabel.h> -#include <qcolor.h> -#include <qlayout.h> +#include <tqcheckbox.h> +#include <tqlabel.h> +#include <tqcolor.h> +#include <tqlayout.h> #include <klocale.h> #include <kmessagebox.h> @@ -264,7 +264,7 @@ kSwarmSaver::kSwarmSaver( Drawable drawable ) : kScreenSaver( drawable ) XSetWindowBackground(qt_xdisplay(), mDrawable, BlackPixel(qt_xdisplay(), qt_xscreen())); - colorContext = QColor::enterAllocContext(); + colorContext = TQColor::enterAllocContext(); batchcount = maxLevels; @@ -272,14 +272,14 @@ kSwarmSaver::kSwarmSaver( Drawable drawable ) : kScreenSaver( drawable ) initswarm( mDrawable, rnd ); timer.start( speed ); - connect( &timer, SIGNAL( timeout() ), SLOT( slotTimeout() ) ); + connect( &timer, TQT_SIGNAL( timeout() ), TQT_SLOT( slotTimeout() ) ); } kSwarmSaver::~kSwarmSaver() { timer.stop(); - QColor::leaveAllocContext(); - QColor::destroyAllocContext( colorContext ); + TQColor::leaveAllocContext(); + TQColor::destroyAllocContext( colorContext ); } void kSwarmSaver::setSpeed( int spd ) @@ -313,45 +313,45 @@ void kSwarmSaver::slotTimeout() //----------------------------------------------------------------------------- -kSwarmSetup::kSwarmSetup( QWidget *parent, const char *name ) +kSwarmSetup::kSwarmSetup( TQWidget *parent, const char *name ) : KDialogBase( parent, name, true, i18n( "Setup Swarm Screen Saver" ), Ok|Cancel|Help, Ok, true ) { readSettings(); setButtonText( Help, i18n( "A&bout" ) ); - QWidget *main = makeMainWidget(); + TQWidget *main = makeMainWidget(); - QHBoxLayout *top = new QHBoxLayout( main, 0, spacingHint() ); - QVBoxLayout *left = new QVBoxLayout(top, spacingHint()); + TQHBoxLayout *top = new TQHBoxLayout( main, 0, spacingHint() ); + TQVBoxLayout *left = new TQVBoxLayout(top, spacingHint()); - QLabel *label = new QLabel( i18n("Speed:"), main ); + TQLabel *label = new TQLabel( i18n("Speed:"), main ); min_size(label); left->addWidget(label); - QSlider *slider = new QSlider(MINSPEED, MAXSPEED, 10, speed, + TQSlider *slider = new TQSlider(MINSPEED, MAXSPEED, 10, speed, Horizontal, main ); slider->setMinimumSize( 120, 20 ); - slider->setTickmarks(QSlider::Below); + slider->setTickmarks(TQSlider::Below); slider->setTickInterval(10); - connect( slider, SIGNAL( valueChanged( int ) ), - SLOT( slotSpeed( int ) ) ); + connect( slider, TQT_SIGNAL( valueChanged( int ) ), + TQT_SLOT( slotSpeed( int ) ) ); left->addWidget(slider); - label = new QLabel( i18n("Number of bees:"), main ); + label = new TQLabel( i18n("Number of bees:"), main ); min_size(label); left->addWidget(label); - slider = new QSlider(MINBATCH, MAXBATCH, 20, maxLevels, Horizontal, main ); + slider = new TQSlider(MINBATCH, MAXBATCH, 20, maxLevels, Horizontal, main ); slider->setMinimumSize( 120, 20 ); - slider->setTickmarks(QSlider::Below); + slider->setTickmarks(TQSlider::Below); slider->setTickInterval(20); - connect( slider, SIGNAL( valueChanged( int ) ), - SLOT( slotLevels( int ) ) ); + connect( slider, TQT_SIGNAL( valueChanged( int ) ), + TQT_SLOT( slotLevels( int ) ) ); left->addWidget(slider); left->addStretch(); - preview = new QWidget( main ); + preview = new TQWidget( main ); preview->setFixedSize( 220, 170 ); preview->setBackgroundColor( black ); preview->show(); // otherwise saver does not get correct size @@ -398,11 +398,11 @@ void kSwarmSetup::slotOk() KConfig *config = klock_config(); config->setGroup( "Settings" ); - QString sspeed; + TQString sspeed; sspeed.setNum( speed ); config->writeEntry( "Speed", sspeed ); - QString slevels; + TQString slevels; slevels.setNum( maxLevels ); config->writeEntry( "MaxLevels", slevels ); diff --git a/kscreensaver/xsavers/swarm.h b/kscreensaver/xsavers/swarm.h index dd4b2f6d..0e34049c 100644 --- a/kscreensaver/xsavers/swarm.h +++ b/kscreensaver/xsavers/swarm.h @@ -6,7 +6,7 @@ #ifndef __SWARM_H__ #define __SWARM_H__ -#include <qtimer.h> +#include <tqtimer.h> #include <kdialogbase.h> #include "saver.h" @@ -30,7 +30,7 @@ protected slots: protected: KRandomSequence rnd; - QTimer timer; + TQTimer timer; int colorContext; int speed; @@ -41,7 +41,7 @@ class kSwarmSetup : public KDialogBase { Q_OBJECT public: - kSwarmSetup( QWidget *parent = NULL, const char *name = NULL ); + kSwarmSetup( TQWidget *parent = NULL, const char *name = NULL ); protected: void readSettings(); @@ -54,7 +54,7 @@ private slots: void slotHelp(); private: - QWidget *preview; + TQWidget *preview; kSwarmSaver *saver; int speed; diff --git a/kscreensaver/xsavers/xlock.cpp b/kscreensaver/xsavers/xlock.cpp index 7e7634db..aaf1cea7 100644 --- a/kscreensaver/xsavers/xlock.cpp +++ b/kscreensaver/xsavers/xlock.cpp @@ -4,7 +4,7 @@ // #include <time.h> -#include <qapplication.h> +#include <tqapplication.h> #include "xlock.h" @@ -75,7 +75,7 @@ void initXLock( GC gc ) Scr[0].bgcol = allocpixel(cmap, "background", "White"); Scr[0].bgcol = allocpixel(cmap, "foreground", "Black"); - QColor color; + TQColor color; for ( int i = 0; i < NUMCOLORS; i++ ) { diff --git a/kscreensaver/xsavers/xlock.h b/kscreensaver/xsavers/xlock.h index e8c2a2bb..ab58fe9c 100644 --- a/kscreensaver/xsavers/xlock.h +++ b/kscreensaver/xsavers/xlock.h @@ -34,7 +34,7 @@ * */ -#include <qapplication.h> // hack for qt-1.2 +#include <tqapplication.h> // hack for qt-1.2 #include <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/Xos.h> diff --git a/kwin-styles/cde/cdeclient.cpp b/kwin-styles/cde/cdeclient.cpp index 9757ee87..6e2dd152 100644 --- a/kwin-styles/cde/cdeclient.cpp +++ b/kwin-styles/cde/cdeclient.cpp @@ -18,15 +18,15 @@ */ #include "cdeclient.h" -#include <qdatetime.h> -#include <qlayout.h> -#include <qbutton.h> -#include <qcursor.h> -#include <qlabel.h> -#include <qtooltip.h> -#include <qdrawutil.h> -#include <qpainter.h> -#include <qapplication.h> +#include <tqdatetime.h> +#include <tqlayout.h> +#include <tqbutton.h> +#include <tqcursor.h> +#include <tqlabel.h> +#include <tqtooltip.h> +#include <tqdrawutil.h> +#include <tqpainter.h> +#include <tqapplication.h> #include <klocale.h> #include <kconfig.h> @@ -114,9 +114,9 @@ static inline const KDecorationOptions* options() return KDecoration::options(); } -static void fixColorGroup(QColorGroup & colorGroup) +static void fixColorGroup(TQColorGroup & colorGroup) { - QColor light = colorGroup.light(); + TQColor light = colorGroup.light(); int hue, saturation, value; @@ -125,17 +125,17 @@ static void fixColorGroup(QColorGroup & colorGroup) if (value < 128) { light.setHsv(hue, saturation, 128); - colorGroup.setColor(QColorGroup::Light, light); + colorGroup.setColor(TQColorGroup::Light, light); } - QColor dark = colorGroup.dark(); + TQColor dark = colorGroup.dark(); dark.hsv(&hue, &saturation, &value); if (value < 84) { dark.setHsv(hue, saturation, 84); - colorGroup.setColor(QColorGroup::Dark, dark); + colorGroup.setColor(TQColorGroup::Dark, dark); } } @@ -156,7 +156,7 @@ static void readConfig(CdeClientFactory *f) coloredFrame = conf.readBoolEntry( "UseTitleBarBorderColors", true ); titlebarButtonMode = conf.readBoolEntry( "TitlebarButtonMode", true ); - QString value = conf.readEntry( "TextAlignment", "AlignHCenter" ); + TQString value = conf.readEntry( "TextAlignment", "AlignHCenter" ); if ( value == "AlignLeft" ) textAlignment = Qt::AlignLeft; else if ( value == "AlignHCenter" ) @@ -178,7 +178,7 @@ static void readConfig(CdeClientFactory *f) // Force button size to be in a reasonable range. // If the frame width is large, the button size must be large too. - s_buttonSize = QFontMetrics(options()->font( true )).height() + 2; + s_buttonSize = TQFontMetrics(options()->font( true )).height() + 2; if (s_buttonSize < 19) s_buttonSize = 19; if (s_buttonSize < s_frameWidth) s_buttonSize = s_frameWidth; s_buttonSize |= 1; // Be sure the button size is odd. @@ -248,11 +248,11 @@ bool CdeClientFactory::supports( Ability ability ) }; } -QValueList< CdeClientFactory::BorderSize > +TQValueList< CdeClientFactory::BorderSize > CdeClientFactory::borderSizes() const { // the list must be sorted - return QValueList< BorderSize >() << BorderTiny << BorderNormal << + return TQValueList< BorderSize >() << BorderTiny << BorderNormal << BorderLarge << BorderVeryLarge << BorderHuge << BorderVeryHuge << BorderOversized; } @@ -271,9 +271,9 @@ void CdeClient::init() widget()->setBackgroundMode(NoBackground); - mainLayout = new QVBoxLayout(widget()); - QBoxLayout* windowLayout = new QBoxLayout(0, QBoxLayout::LeftToRight, 0, 0, 0); - titleLayout = new QBoxLayout(0, QBoxLayout::LeftToRight, 0, 0, 0); + mainLayout = new TQVBoxLayout(widget()); + TQBoxLayout* windowLayout = new TQBoxLayout(0, TQBoxLayout::LeftToRight, 0, 0, 0); + titleLayout = new TQBoxLayout(0, TQBoxLayout::LeftToRight, 0, 0, 0); // TODO Check if this stuff can be simplified. // Border sizes are from a fixed set now. @@ -295,17 +295,17 @@ void CdeClient::init() mainLayout->addLayout( windowLayout, 1 ); if (isPreview()) - windowLayout->addWidget(new QLabel(i18n( + windowLayout->addWidget(new TQLabel(i18n( "<center><b>CDE preview</b></center>"), widget()), 1); else - windowLayout->addItem( new QSpacerItem( 0, 0 )); + windowLayout->addItem( new TQSpacerItem( 0, 0 )); for ( int i=0; i < BtnCount; i++ ) button[i] = NULL; addClientButtons( options()->titleButtonsLeft() ); - titlebar = new QSpacerItem( 10, 16, QSizePolicy::Expanding, QSizePolicy::Minimum ); + titlebar = new TQSpacerItem( 10, 16, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); titleLayout->addItem( titlebar ); addClientButtons( options()->titleButtonsRight() ); @@ -314,7 +314,7 @@ void CdeClient::init() closing = false; } -void CdeClient::addClientButtons( const QString& s ) +void CdeClient::addClientButtons( const TQString& s ) { if ( s.length() > 0 ) for ( unsigned int i = 0; i < s.length(); i++ ) @@ -326,8 +326,8 @@ void CdeClient::addClientButtons( const QString& s ) if ( ! button[BtnMenu] ) { button[BtnMenu] = new CdeButton( this, "menu", BtnMenu, i18n("Menu"), LeftButton|RightButton ); - connect( button[BtnMenu], SIGNAL(pressed()), SLOT(menuButtonPressed()) ); - connect( button[BtnMenu], SIGNAL(released()), SLOT(menuButtonReleased()) ); + connect( button[BtnMenu], TQT_SIGNAL(pressed()), TQT_SLOT(menuButtonPressed()) ); + connect( button[BtnMenu], TQT_SIGNAL(released()), TQT_SLOT(menuButtonReleased()) ); titleLayout->addWidget( button[BtnMenu] ); } break; @@ -338,7 +338,7 @@ void CdeClient::addClientButtons( const QString& s ) { button[BtnHelp] = new CdeButton( this, "help", BtnHelp, i18n("Help") ); connect(button[BtnHelp], - SIGNAL(clicked()), SLOT(showContextHelp())); + TQT_SIGNAL(clicked()), TQT_SLOT(showContextHelp())); titleLayout->addWidget( button[BtnHelp] ); } break; @@ -349,7 +349,7 @@ void CdeClient::addClientButtons( const QString& s ) { button[BtnIconify] = new CdeButton( this, "iconify", BtnIconify, i18n("Minimize") ); connect(button[BtnIconify], - SIGNAL(clicked()), SLOT(minimize())); + TQT_SIGNAL(clicked()), TQT_SLOT(minimize())); titleLayout->addWidget( button[BtnIconify] ); } break; @@ -359,8 +359,8 @@ void CdeClient::addClientButtons( const QString& s ) if ( (! button[BtnMax] ) && isMaximizable() ) { button[BtnMax] = new CdeButton(this, "maximize", BtnMax, i18n("Maximize"), LeftButton|MidButton|RightButton); - connect(button[BtnMax], SIGNAL(clicked()), - SLOT(maximizeButtonClicked())); + connect(button[BtnMax], TQT_SIGNAL(clicked()), + TQT_SLOT(maximizeButtonClicked())); titleLayout->addWidget( button[BtnMax] ); } break; @@ -370,7 +370,7 @@ void CdeClient::addClientButtons( const QString& s ) if ( !button[BtnClose] && isCloseable()) { button[BtnClose] = new CdeButton(this, "close", BtnClose, i18n("Close")); - connect( button[BtnClose], SIGNAL( clicked()), SLOT(closeWindow()) ); + connect( button[BtnClose], TQT_SIGNAL( clicked()), TQT_SLOT(closeWindow()) ); titleLayout->addWidget( button[BtnClose] ); } // Add onAlldesktops button and spacers @@ -396,8 +396,8 @@ void CdeClient::maximizeChange() { if ( button[BtnMax] ) { bool m = maximizeMode() == MaximizeFull; - QToolTip::remove(button[BtnMax]); - QToolTip::add(button[BtnMax], m ? i18n("Restore") : i18n("Maximize")); + TQToolTip::remove(button[BtnMax]); + TQToolTip::add(button[BtnMax], m ? i18n("Restore") : i18n("Maximize")); button[BtnMax]->repaint(); } } @@ -410,7 +410,7 @@ void CdeClient::shadeChange() { } -void CdeClient::showEvent(QShowEvent *) +void CdeClient::showEvent(TQShowEvent *) { widget()->repaint(); } @@ -420,13 +420,13 @@ void CdeClient::desktopChange() // Nothing to do yet } -QSize CdeClient::minimumSize() const +TQSize CdeClient::minimumSize() const { - return QSize(2 * (s_buttonSize + s_frameWidth), + return TQSize(2 * (s_buttonSize + s_frameWidth), 2 * s_frameWidth + s_buttonSize); } -void CdeClient::resize(const QSize& s) +void CdeClient::resize(const TQSize& s) { widget()->resize(s); } @@ -440,21 +440,21 @@ void CdeClient::maximizeButtonClicked() void CdeClient::menuButtonPressed() { - static QTime* t = NULL; + static TQTime* t = NULL; static CdeClient* lastClient = NULL; if( t == NULL ) t = new QTime; - bool dbl = ( lastClient == this && t->elapsed() <= QApplication::doubleClickInterval()); + bool dbl = ( lastClient == this && t->elapsed() <= TQApplication::doubleClickInterval()); lastClient = this; t->start(); if( !dbl ) { - QRect menuRect = button[BtnMenu]->rect(); - QPoint menuTop = button[BtnMenu]->mapToGlobal(menuRect.topLeft()); - QPoint menuBottom = + TQRect menuRect = button[BtnMenu]->rect(); + TQPoint menuTop = button[BtnMenu]->mapToGlobal(menuRect.topLeft()); + TQPoint menuBottom = button[BtnMenu]->mapToGlobal(menuRect.bottomRight()); KDecorationFactory* f = factory(); - showWindowMenu(QRect(menuTop, menuBottom)); + showWindowMenu(TQRect(menuTop, menuBottom)); if( !f->exists( this )) // 'this' was deleted return; button[BtnMenu]->setDown(false); @@ -469,7 +469,7 @@ void CdeClient::menuButtonReleased() closeWindow(); } -void CdeClient::resizeEvent( QResizeEvent* e) +void CdeClient::resizeEvent( TQResizeEvent* e) { if (widget()->isVisibleToTLW()) { widget()->update(); @@ -488,22 +488,22 @@ void CdeClient::resizeEvent( QResizeEvent* e) if ( dx ) { widget()->update( width() - dx + 1, 0, dx, height() ); - widget()->update( QRect( QPoint(4,4), - titlebar->geometry().bottomLeft() - QPoint(1,0) ) ); - widget()->update(QRect(titlebar->geometry().topRight(), - QPoint(width() - 4, titlebar->geometry().bottom()))); + widget()->update( TQRect( TQPoint(4,4), + titlebar->geometry().bottomLeft() - TQPoint(1,0) ) ); + widget()->update(TQRect(titlebar->geometry().topRight(), + TQPoint(width() - 4, titlebar->geometry().bottom()))); // Titlebar needs no paint event - QApplication::postEvent( this, new QPaintEvent( titlebar->geometry(), false ) ); + TQApplication::postEvent( this, new TQPaintEvent( titlebar->geometry(), false ) ); } } } -void CdeClient::paintEvent( QPaintEvent* ) +void CdeClient::paintEvent( TQPaintEvent* ) { - QPainter p(widget()); + TQPainter p(widget()); - QColorGroup colorGroup; + TQColorGroup colorGroup; if ( coloredFrame ) colorGroup = options()->colorGroup( KDecoration::ColorTitleBar, isActive() ); @@ -512,8 +512,8 @@ void CdeClient::paintEvent( QPaintEvent* ) fixColorGroup( colorGroup ); - QRect trect = titlebar->geometry(); - QRect mrect = widget()->rect(); + TQRect trect = titlebar->geometry(); + TQRect mrect = widget()->rect(); if ( s_frameWidth > 0 ) { @@ -678,7 +678,7 @@ void CdeClient::paintEvent( QPaintEvent* ) } -KDecoration::Position CdeClient::mousePosition( const QPoint& p ) const +KDecoration::Position CdeClient::mousePosition( const TQPoint& p ) const { const int range = s_frameWidth + s_buttonSize; const int border = s_frameWidth + 1; @@ -710,19 +710,19 @@ KDecoration::Position CdeClient::mousePosition( const QPoint& p ) const return m; } -void CdeClient::mouseDoubleClickEvent( QMouseEvent * e ) +void CdeClient::mouseDoubleClickEvent( TQMouseEvent * e ) { if ( e->button() == LeftButton && titlebar->geometry().contains( e->pos() ) ) titlebarDblClickOperation(); } -void CdeClient::wheelEvent( QWheelEvent * e ) +void CdeClient::wheelEvent( TQWheelEvent * e ) { if (isSetShade() || titleLayout->geometry().contains( e->pos() ) ) titlebarMouseWheelOperation( e->delta()); } -void CdeClient::mousePressEvent( QMouseEvent * e ) +void CdeClient::mousePressEvent( TQMouseEvent * e ) { if ( e->button() == LeftButton && titlebar->geometry().contains( e->pos() ) ) { @@ -740,7 +740,7 @@ void CdeClient::borders(int &left, int &right, int &top, int &bottom) const top = s_buttonSize + s_frameWidth + 1; } -void CdeClient::mouseReleaseEvent( QMouseEvent * e ) +void CdeClient::mouseReleaseEvent( TQMouseEvent * e ) { if ( e->button() == LeftButton && titlebarPressed ) { @@ -749,28 +749,28 @@ void CdeClient::mouseReleaseEvent( QMouseEvent * e ) } } -bool CdeClient::eventFilter(QObject *o, QEvent *e) +bool CdeClient::eventFilter(TQObject *o, TQEvent *e) { if (o != widget()) return false; switch (e->type()) { - case QEvent::Resize: - resizeEvent(static_cast< QResizeEvent* >(e)); + case TQEvent::Resize: + resizeEvent(static_cast< TQResizeEvent* >(e)); return true; - case QEvent::Paint: - paintEvent(static_cast< QPaintEvent* >(e)); + case TQEvent::Paint: + paintEvent(static_cast< TQPaintEvent* >(e)); return true; - case QEvent::MouseButtonDblClick: - mouseDoubleClickEvent(static_cast< QMouseEvent* >(e)); + case TQEvent::MouseButtonDblClick: + mouseDoubleClickEvent(static_cast< TQMouseEvent* >(e)); return true; - case QEvent::MouseButtonPress: - processMousePressEvent(static_cast< QMouseEvent* >(e)); + case TQEvent::MouseButtonPress: + processMousePressEvent(static_cast< TQMouseEvent* >(e)); return true; - case QEvent::Show: - showEvent(static_cast< QShowEvent* >(e)); + case TQEvent::Show: + showEvent(static_cast< TQShowEvent* >(e)); return true; - case QEvent::Wheel: - wheelEvent( static_cast< QWheelEvent* >( e )); + case TQEvent::Wheel: + wheelEvent( static_cast< TQWheelEvent* >( e )); return true; default: break; @@ -781,16 +781,16 @@ bool CdeClient::eventFilter(QObject *o, QEvent *e) // --------------------------------------- CdeButton::CdeButton(CdeClient* parent, - const char* name, int btnType, const QString& tip, int realize_btns) - : QButton(parent->widget(), name), m_btnType(btnType), last_button(NoButton) + const char* name, int btnType, const TQString& tip, int realize_btns) + : TQButton(parent->widget(), name), m_btnType(btnType), last_button(NoButton) { - setBackgroundMode( QWidget::NoBackground ); + setBackgroundMode( TQWidget::NoBackground ); setFixedSize( s_buttonSize, s_buttonSize ); resize( s_buttonSize, s_buttonSize ); m_parent = parent; setCursor(ArrowCursor); - QToolTip::add(this, tip); + TQToolTip::add(this, tip); m_realize_buttons = realize_btns; } @@ -800,12 +800,12 @@ void CdeButton::reset() repaint( false ); } -void CdeButton::drawButton( QPainter* p ) +void CdeButton::drawButton( TQPainter* p ) { p->setBrush( options()->color( KDecoration::ColorTitleBar, m_parent->isActive() ) ); p->drawRect( 0, 0, s_buttonSize, s_buttonSize ); - QColorGroup colorGroup = + TQColorGroup colorGroup = options()->colorGroup( KDecoration::ColorTitleBar, m_parent->isActive() ); fixColorGroup(colorGroup); @@ -820,9 +820,9 @@ void CdeButton::drawButton( QPainter* p ) break; case (BtnHelp): p->setPen( colorGroup.light() ); - p->drawLineSegments( QPointArray(16, helpLLines) ); + p->drawLineSegments( TQPointArray(16, helpLLines) ); p->setPen( colorGroup.dark() ); - p->drawLineSegments( QPointArray(14, helpDLines) ); + p->drawLineSegments( TQPointArray(14, helpDLines) ); break; case (BtnIconify): qDrawShadePanel( p, s_o2, s_o2, s_w2, s_w2, colorGroup ); @@ -833,27 +833,27 @@ void CdeButton::drawButton( QPainter* p ) break; case (BtnClose): p->setPen( colorGroup.dark() ); - p->drawLineSegments( QPointArray(18, closeDLines) ); + p->drawLineSegments( TQPointArray(18, closeDLines) ); p->setPen( colorGroup.light() ); - p->drawLineSegments( QPointArray(15, closeLLines) ); + p->drawLineSegments( TQPointArray(15, closeLLines) ); break; } } -void CdeButton::mousePressEvent(QMouseEvent *e) +void CdeButton::mousePressEvent(TQMouseEvent *e) { last_button = e->button(); - QMouseEvent me(e->type(), e->pos(), + TQMouseEvent me(e->type(), e->pos(), e->globalPos(), (e->button()&m_realize_buttons)?LeftButton:NoButton, e->state()); - QButton::mousePressEvent(&me); + TQButton::mousePressEvent(&me); } -void CdeButton::mouseReleaseEvent(QMouseEvent * e) +void CdeButton::mouseReleaseEvent(TQMouseEvent * e) { last_button = e->button(); - QMouseEvent me(e->type(), e->pos(), + TQMouseEvent me(e->type(), e->pos(), e->globalPos(), (e->button()&m_realize_buttons)?LeftButton:NoButton, e->state()); - QButton::mouseReleaseEvent(&me); + TQButton::mouseReleaseEvent(&me); } } // CDE namespace diff --git a/kwin-styles/cde/cdeclient.h b/kwin-styles/cde/cdeclient.h index 40e8f2eb..071c41ff 100644 --- a/kwin-styles/cde/cdeclient.h +++ b/kwin-styles/cde/cdeclient.h @@ -18,8 +18,8 @@ #ifndef __CDECLIENT_H #define __CDECLIENT_H -#include <qbutton.h> -#include <qbitmap.h> +#include <tqbutton.h> +#include <tqbitmap.h> #include <kpixmap.h> #include <kdecoration.h> #include <kdecorationfactory.h> @@ -39,14 +39,14 @@ class CdeButton : public QButton { public: CdeButton( CdeClient* parent=0, const char* name=0, int btnType=0, - const QString& tip=NULL, int realize_btns = LeftButton ); + const TQString& tip=NULL, int realize_btns = LeftButton ); void reset(); ButtonState lastButton() { return last_button; } protected: - void mousePressEvent(QMouseEvent *e); - void mouseReleaseEvent(QMouseEvent *e); - virtual void drawButton(QPainter *p); + void mousePressEvent(TQMouseEvent *e); + void mouseReleaseEvent(TQMouseEvent *e); + virtual void drawButton(TQPainter *p); private: CdeClient *m_parent; @@ -64,26 +64,26 @@ public: void init(); protected: - bool eventFilter(QObject *o, QEvent *e); - void resizeEvent( QResizeEvent* ); - void paintEvent( QPaintEvent* ); - - void showEvent(QShowEvent *); - void addClientButtons( const QString& ); - void mouseDoubleClickEvent( QMouseEvent* ); - void wheelEvent( QWheelEvent * ); + bool eventFilter(TQObject *o, TQEvent *e); + void resizeEvent( TQResizeEvent* ); + void paintEvent( TQPaintEvent* ); + + void showEvent(TQShowEvent *); + void addClientButtons( const TQString& ); + void mouseDoubleClickEvent( TQMouseEvent* ); + void wheelEvent( TQWheelEvent * ); void captionChange(); void desktopChange(); void activeChange(); void shadeChange(); void iconChange(); - QSize minimumSize() const; - void resize(const QSize &size); + TQSize minimumSize() const; + void resize(const TQSize &size); void borders(int &left, int &right, int &top, int &bottom) const; - void mousePressEvent( QMouseEvent* ); - void mouseReleaseEvent( QMouseEvent* ); + void mousePressEvent( TQMouseEvent* ); + void mouseReleaseEvent( TQMouseEvent* ); void maximizeChange(); - Position mousePosition( const QPoint& p ) const; + Position mousePosition( const TQPoint& p ) const; protected slots: void menuButtonPressed(); @@ -92,14 +92,14 @@ protected slots: private: CdeButton* button[BtnCount]; - QVBoxLayout* mainLayout; - QBoxLayout* titleLayout; - QSpacerItem* titlebar; + TQVBoxLayout* mainLayout; + TQBoxLayout* titleLayout; + TQSpacerItem* titlebar; bool titlebarPressed; bool closing; }; -class CdeClientFactory: public QObject, public KDecorationFactory +class CdeClientFactory: public TQObject, public KDecorationFactory { public: CdeClientFactory(); @@ -108,7 +108,7 @@ public: virtual bool supports( Ability ability ); virtual bool reset(unsigned long changed); - QValueList< CdeClientFactory::BorderSize > borderSizes() const; + TQValueList< CdeClientFactory::BorderSize > borderSizes() const; }; diff --git a/kwin-styles/cde/config/config.cpp b/kwin-styles/cde/config/config.cpp index 5c3ac455..e9e49df0 100644 --- a/kwin-styles/cde/config/config.cpp +++ b/kwin-styles/cde/config/config.cpp @@ -2,11 +2,11 @@ #include "config.h" #include <kapplication.h> #include <kglobal.h> -#include <qwhatsthis.h> -#include <qvbox.h> +#include <tqwhatsthis.h> +#include <tqvbox.h> #include <klocale.h> -extern "C" KDE_EXPORT QObject* allocate_config( KConfig* conf, QWidget* parent ) +extern "C" KDE_EXPORT TQObject* allocate_config( KConfig* conf, TQWidget* parent ) { return new CdeConfig(conf, parent); } @@ -16,36 +16,36 @@ extern "C" KDE_EXPORT QObject* allocate_config( KConfig* conf, QWidget* parent ) * 'conf' is a pointer to the kwindecoration modules open kwin config, * and is by default set to the "Style" group. * - * 'parent' is the parent of the QObject, which is a VBox inside the + * 'parent' is the parent of the TQObject, which is a VBox inside the * Configure tab in kwindecoration */ -CdeConfig::CdeConfig( KConfig* conf, QWidget* parent ) - : QObject( parent ) +CdeConfig::CdeConfig( KConfig* conf, TQWidget* parent ) + : TQObject( parent ) { cdeConfig = new KConfig("kwincderc"); KGlobal::locale()->insertCatalogue("kwin_art_clients"); - groupBox = new QVBox( parent ); + groupBox = new TQVBox( parent ); - bgAlign = new QButtonGroup( 3, Qt::Horizontal, i18n("Text &Alignment"), groupBox ); + bgAlign = new TQButtonGroup( 3, Qt::Horizontal, i18n("Text &Alignment"), groupBox ); bgAlign->setExclusive( true ); - QWhatsThis::add( bgAlign, i18n("Use these buttons to set the alignment of the titlebar caption text.") ); - new QRadioButton( i18n("Left"), bgAlign, "AlignLeft" ); - QRadioButton *radio2 = new QRadioButton( i18n("Centered"), bgAlign, "AlignHCenter" ); + TQWhatsThis::add( bgAlign, i18n("Use these buttons to set the alignment of the titlebar caption text.") ); + new TQRadioButton( i18n("Left"), bgAlign, "AlignLeft" ); + TQRadioButton *radio2 = new TQRadioButton( i18n("Centered"), bgAlign, "AlignHCenter" ); radio2->setChecked( true ); - new QRadioButton( i18n("Right"), bgAlign, "AlignRight" ); + new TQRadioButton( i18n("Right"), bgAlign, "AlignRight" ); - cbColorBorder = new QCheckBox( i18n("Draw window frames using &titlebar colors"), groupBox ); - QWhatsThis::add( cbColorBorder, i18n("When selected, the window decoration borders " + cbColorBorder = new TQCheckBox( i18n("Draw window frames using &titlebar colors"), groupBox ); + TQWhatsThis::add( cbColorBorder, i18n("When selected, the window decoration borders " "are drawn using the titlebar colors. Otherwise, they are " "drawn using normal border colors instead.") ); -// cbTitlebarButton = new QCheckBox( i18n("Titlebar acts like a &pushbutton when clicked"), groupBox ); -// QWhatsThis::add( cbTitlebarButton, i18n("When selected, this option causes the window titlebar to behave " +// cbTitlebarButton = new TQCheckBox( i18n("Titlebar acts like a &pushbutton when clicked"), groupBox ); +// TQWhatsThis::add( cbTitlebarButton, i18n("When selected, this option causes the window titlebar to behave " // "as if it was a pushbutton when you click it to move the window.") ); - (void) new QLabel( i18n("Tip: If you want the look of the original Motif(tm) Window Manager,\n" + (void) new TQLabel( i18n("Tip: If you want the look of the original Motif(tm) Window Manager,\n" "click the \"Buttons\" tab above and remove the help\n" "and close buttons from the titlebar."), groupBox ); @@ -53,9 +53,9 @@ CdeConfig::CdeConfig( KConfig* conf, QWidget* parent ) load( conf ); // Ensure we track user changes properly - connect( cbColorBorder, SIGNAL(clicked()), SLOT(slotSelectionChanged()) ); -// connect( cbTitlebarButton, SIGNAL(clicked()), SLOT(slotSelectionChanged()) ); - connect( bgAlign, SIGNAL(clicked(int)), SLOT(slotSelectionChanged(int)) ); + connect( cbColorBorder, TQT_SIGNAL(clicked()), TQT_SLOT(slotSelectionChanged()) ); +// connect( cbTitlebarButton, TQT_SIGNAL(clicked()), TQT_SLOT(slotSelectionChanged()) ); + connect( bgAlign, TQT_SIGNAL(clicked(int)), TQT_SLOT(slotSelectionChanged(int)) ); // Make the widgets visible in kwindecoration groupBox->show(); @@ -86,8 +86,8 @@ void CdeConfig::load( KConfig* /*conf*/ ) { cdeConfig->setGroup("General"); - QString value = cdeConfig->readEntry( "TextAlignment", "AlignHCenter" ); - QRadioButton *button = (QRadioButton*)bgAlign->child( (const char *)value.latin1() ); + TQString value = cdeConfig->readEntry( "TextAlignment", "AlignHCenter" ); + TQRadioButton *button = (TQRadioButton*)bgAlign->child( (const char *)value.latin1() ); if ( button ) button->setChecked( true ); @@ -104,9 +104,9 @@ void CdeConfig::save( KConfig* /*conf*/ ) { cdeConfig->setGroup("General"); - QRadioButton *button = (QRadioButton*)bgAlign->selected(); + TQRadioButton *button = (TQRadioButton*)bgAlign->selected(); if ( button ) - cdeConfig->writeEntry( "TextAlignment", QString(button->name()) ); + cdeConfig->writeEntry( "TextAlignment", TQString(button->name()) ); cdeConfig->writeEntry( "UseTitleBarBorderColors", cbColorBorder->isChecked() ); // cdeConfig->writeEntry( "TitlebarButtonMode", cbTitlebarButton->isChecked() ); @@ -119,7 +119,7 @@ void CdeConfig::save( KConfig* /*conf*/ ) // Sets UI widget defaults which must correspond to style defaults void CdeConfig::defaults() { - QRadioButton *button = (QRadioButton*)bgAlign->child( "AlignHCenter" ); + TQRadioButton *button = (TQRadioButton*)bgAlign->child( "AlignHCenter" ); if ( button ) button->setChecked( true ); diff --git a/kwin-styles/cde/config/config.h b/kwin-styles/cde/config/config.h index 723d7b95..c9a6c528 100644 --- a/kwin-styles/cde/config/config.h +++ b/kwin-styles/cde/config/config.h @@ -1,12 +1,12 @@ #ifndef __KDE_CDECONFIG_H #define __KDE_CDECONFIG_H -#include <qcheckbox.h> -#include <qgroupbox.h> -#include <qbuttongroup.h> -#include <qlabel.h> -#include <qradiobutton.h> -#include <qhbox.h> +#include <tqcheckbox.h> +#include <tqgroupbox.h> +#include <tqbuttongroup.h> +#include <tqlabel.h> +#include <tqradiobutton.h> +#include <tqhbox.h> #include <kconfig.h> class QCheckBox; @@ -20,7 +20,7 @@ class CdeConfig: public QObject Q_OBJECT public: - CdeConfig( KConfig* conf, QWidget* parent ); + CdeConfig( KConfig* conf, TQWidget* parent ); ~CdeConfig(); // These public signals/slots work similar to KCM modules @@ -38,11 +38,11 @@ class CdeConfig: public QObject private: KConfig* cdeConfig; - QCheckBox* cbColorBorder; -// QCheckBox* cbTitlebarButton; - QHBox* groupBox; - QGroupBox* gbSlider; - QButtonGroup* bgAlign; + TQCheckBox* cbColorBorder; +// TQCheckBox* cbTitlebarButton; + TQHBox* groupBox; + TQGroupBox* gbSlider; + TQButtonGroup* bgAlign; }; diff --git a/kwin-styles/glow/config/glowconfigdialog.cpp b/kwin-styles/glow/config/glowconfigdialog.cpp index 41144c8a..ab0cd40d 100644 --- a/kwin-styles/glow/config/glowconfigdialog.cpp +++ b/kwin-styles/glow/config/glowconfigdialog.cpp @@ -15,19 +15,19 @@ * * ***************************************************************************/ -#include <qbitmap.h> -#include <qbuttongroup.h> -#include <qcheckbox.h> -#include <qcombobox.h> -#include <qdir.h> -#include <qfileinfo.h> -#include <qgroupbox.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qlistview.h> -#include <qpushbutton.h> -#include <qsignalmapper.h> -#include <qstringlist.h> +#include <tqbitmap.h> +#include <tqbuttongroup.h> +#include <tqcheckbox.h> +#include <tqcombobox.h> +#include <tqdir.h> +#include <tqfileinfo.h> +#include <tqgroupbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqlistview.h> +#include <tqpushbutton.h> +#include <tqsignalmapper.h> +#include <tqstringlist.h> #include <kconfig.h> #include <kcolorbutton.h> #include <kdebug.h> @@ -45,129 +45,129 @@ extern "C" { - KDE_EXPORT QObject* allocate_config( KConfig* conf, QWidget* parent ) + KDE_EXPORT TQObject* allocate_config( KConfig* conf, TQWidget* parent ) { return(new GlowConfigDialog(conf, parent)); } } -GlowConfigDialog::GlowConfigDialog( KConfig * conf, QWidget * parent ) - : QObject(parent) +GlowConfigDialog::GlowConfigDialog( KConfig * conf, TQWidget * parent ) + : TQObject(parent) { _glowConfig = new KConfig("kwinglowrc"); KGlobal::locale()->insertCatalogue("kwin_glow_config"); - _main_group_box = new QWidget(parent); - QVBoxLayout *main_group_boxLayout = new QVBoxLayout(_main_group_box); + _main_group_box = new TQWidget(parent); + TQVBoxLayout *main_group_boxLayout = new TQVBoxLayout(_main_group_box); main_group_boxLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft); main_group_boxLayout->setSpacing(6); //------------------------------------------------------------------------- // themes - _theme_list_view = new QListView (_main_group_box, "theme_list_view"); + _theme_list_view = new TQListView (_main_group_box, "theme_list_view"); _theme_list_view->addColumn (i18n("Theme")); _theme_list_view->addColumn (i18n("Button Size")); _theme_list_view->setAllColumnsShowFocus(true); - _theme_list_view->setResizeMode(QListView::AllColumns); + _theme_list_view->setResizeMode(TQListView::AllColumns); main_group_boxLayout->addWidget (_theme_list_view); - QObject::connect (_theme_list_view, SIGNAL(selectionChanged()), - this, SLOT(slotThemeListViewSelectionChanged())); + TQObject::connect (_theme_list_view, TQT_SIGNAL(selectionChanged()), + this, TQT_SLOT(slotThemeListViewSelectionChanged())); slotLoadThemeList(); - _button_glow_color_group_box = new QGroupBox( + _button_glow_color_group_box = new TQGroupBox( 0, Qt::Horizontal, i18n("Button Glow Colors"), _main_group_box); - QHBoxLayout *colorHBoxLayout = - new QHBoxLayout(_button_glow_color_group_box->layout()); + TQHBoxLayout *colorHBoxLayout = + new TQHBoxLayout(_button_glow_color_group_box->layout()); // create buttons - QSize buttonSize(BITMAP_SIZE, BITMAP_SIZE); - QPixmap pm(buttonSize); + TQSize buttonSize(BITMAP_SIZE, BITMAP_SIZE); + TQPixmap pm(buttonSize); pm.fill(Qt::black); - _stickyButton = new QPushButton(_button_glow_color_group_box); - pm.setMask(QBitmap(buttonSize, stickyoff_bits, true)); + _stickyButton = new TQPushButton(_button_glow_color_group_box); + pm.setMask(TQBitmap(buttonSize, stickyoff_bits, true)); _stickyButton->setPixmap(pm); colorHBoxLayout->addWidget(_stickyButton); _titleButtonList.push_back(_stickyButton); - _helpButton = new QPushButton(_button_glow_color_group_box); - pm.setMask(QBitmap(buttonSize, help_bits, true)); + _helpButton = new TQPushButton(_button_glow_color_group_box); + pm.setMask(TQBitmap(buttonSize, help_bits, true)); _helpButton->setPixmap(pm); colorHBoxLayout->addWidget(_helpButton); _titleButtonList.push_back(_helpButton); - _iconifyButton = new QPushButton(_button_glow_color_group_box); - pm.setMask(QBitmap(buttonSize, minimize_bits, true)); + _iconifyButton = new TQPushButton(_button_glow_color_group_box); + pm.setMask(TQBitmap(buttonSize, minimize_bits, true)); _iconifyButton->setPixmap(pm); colorHBoxLayout->addWidget(_iconifyButton); _titleButtonList.push_back(_iconifyButton); - _maximizeButton = new QPushButton(_button_glow_color_group_box); - pm.setMask(QBitmap(buttonSize, maximizeoff_bits, true)); + _maximizeButton = new TQPushButton(_button_glow_color_group_box); + pm.setMask(TQBitmap(buttonSize, maximizeoff_bits, true)); _maximizeButton->setPixmap(pm); colorHBoxLayout->addWidget(_maximizeButton); _titleButtonList.push_back(_maximizeButton); - _closeButton = new QPushButton(_button_glow_color_group_box); - pm.setMask(QBitmap(buttonSize, close_bits, true)); + _closeButton = new TQPushButton(_button_glow_color_group_box); + pm.setMask(TQBitmap(buttonSize, close_bits, true)); _closeButton->setPixmap(pm); colorHBoxLayout->addWidget(_closeButton); _titleButtonList.push_back(_closeButton); // create signal mapper - _titleButtonMapper = new QSignalMapper(this); + _titleButtonMapper = new TQSignalMapper(this); for( uint i=0; i<_titleButtonList.size(); i++ ) { _titleButtonMapper->setMapping(_titleButtonList[i], i); - connect(_titleButtonList[i], SIGNAL(clicked()),_titleButtonMapper, SLOT(map())); + connect(_titleButtonList[i], TQT_SIGNAL(clicked()),_titleButtonMapper, TQT_SLOT(map())); } - connect(_titleButtonMapper, SIGNAL(mapped(int)),this, SLOT(slotTitleButtonClicked(int))); + connect(_titleButtonMapper, TQT_SIGNAL(mapped(int)),this, TQT_SLOT(slotTitleButtonClicked(int))); _colorButton = new KColorButton(_button_glow_color_group_box); _colorButton->setEnabled(false); - connect(_colorButton, SIGNAL(changed(const QColor&)), - this, SLOT(slotColorButtonChanged(const QColor&))); + connect(_colorButton, TQT_SIGNAL(changed(const TQColor&)), + this, TQT_SLOT(slotColorButtonChanged(const TQColor&))); - colorHBoxLayout->addItem(new QSpacerItem( - 200, 20, QSizePolicy::Expanding, QSizePolicy::Minimum)); + colorHBoxLayout->addItem(new TQSpacerItem( + 200, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum)); colorHBoxLayout->addWidget(_colorButton); main_group_boxLayout->addWidget(_button_glow_color_group_box); - QHBoxLayout *titlebarGradientTypeLayout = new QHBoxLayout(); - _titlebarGradientTypeComboBox = new QComboBox(_main_group_box); + TQHBoxLayout *titlebarGradientTypeLayout = new TQHBoxLayout(); + _titlebarGradientTypeComboBox = new TQComboBox(_main_group_box); KConfig *c = KGlobal::config(); - KConfigGroupSaver cgs( c, QString::fromLatin1("WM") ); - QColor activeBackground = c->readColorEntry("activeBackground"); - QColor activeBlend = c->readColorEntry("activeBlend"); + KConfigGroupSaver cgs( c, TQString::fromLatin1("WM") ); + TQColor activeBackground = c->readColorEntry("activeBackground"); + TQColor activeBlend = c->readColorEntry("activeBlend"); // If the colors are equal, change one to get a gradient effect if (activeBackground==activeBlend) { activeBackground = activeBackground.dark(); } for (int i=0; i< KPixmapEffect::EllipticGradient; i++ ) { - KPixmap gradPixmap(QSize(196,20)); + KPixmap gradPixmap(TQSize(196,20)); KPixmapEffect::gradient(gradPixmap, activeBackground, activeBlend, (KPixmapEffect::GradientType) i); _titlebarGradientTypeComboBox->insertItem(gradPixmap, i); } - connect(_titlebarGradientTypeComboBox, SIGNAL(activated(int)), - this, SLOT(slotTitlebarGradientTypeChanged(int))); + connect(_titlebarGradientTypeComboBox, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(slotTitlebarGradientTypeChanged(int))); titlebarGradientTypeLayout->addWidget( - new QLabel(i18n("Titlebar gradient:"), _main_group_box)); + new TQLabel(i18n("Titlebar gradient:"), _main_group_box)); titlebarGradientTypeLayout->addWidget(_titlebarGradientTypeComboBox, 0, Qt::AlignLeft); titlebarGradientTypeLayout->addStretch(10); main_group_boxLayout->addLayout(titlebarGradientTypeLayout); - _showResizeHandleCheckBox = new QCheckBox( + _showResizeHandleCheckBox = new TQCheckBox( i18n("Show resize handle"), _main_group_box); - connect(_showResizeHandleCheckBox, SIGNAL(clicked()), - this, SLOT(slotResizeHandleCheckBoxChanged())); + connect(_showResizeHandleCheckBox, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotResizeHandleCheckBoxChanged())); main_group_boxLayout->addWidget(_showResizeHandleCheckBox); // load config and update user interface @@ -185,12 +185,12 @@ GlowConfigDialog::~GlowConfigDialog() void GlowConfigDialog::load( KConfig* /* conf */ ) { - QColor color; - const QColor defaultCloseButtonColor(DEFAULT_CLOSE_BUTTON_COLOR); - const QColor defaultMaximizeButtonColor(DEFAULT_MAXIMIZE_BUTTON_COLOR); - const QColor defaultIconifyButtonColor(DEFAULT_ICONIFY_BUTTON_COLOR); - const QColor defaultHelpButtonColor(DEFAULT_HELP_BUTTON_COLOR); - const QColor defaultStickyButtonColor(DEFAULT_STICKY_BUTTON_COLOR); + TQColor color; + const TQColor defaultCloseButtonColor(DEFAULT_CLOSE_BUTTON_COLOR); + const TQColor defaultMaximizeButtonColor(DEFAULT_MAXIMIZE_BUTTON_COLOR); + const TQColor defaultIconifyButtonColor(DEFAULT_ICONIFY_BUTTON_COLOR); + const TQColor defaultHelpButtonColor(DEFAULT_HELP_BUTTON_COLOR); + const TQColor defaultStickyButtonColor(DEFAULT_STICKY_BUTTON_COLOR); _glowConfig->setGroup("General"); @@ -249,11 +249,11 @@ void GlowConfigDialog::save( KConfig* /* conf */ ) void GlowConfigDialog::defaults() { - const QColor defaultCloseButtonColor = DEFAULT_CLOSE_BUTTON_COLOR; - const QColor defaultMaximizeButtonColor(DEFAULT_MAXIMIZE_BUTTON_COLOR); - const QColor defaultIconifyButtonColor(DEFAULT_ICONIFY_BUTTON_COLOR); - const QColor defaultHelpButtonColor(DEFAULT_HELP_BUTTON_COLOR); - const QColor defaultStickyButtonColor(DEFAULT_STICKY_BUTTON_COLOR); + const TQColor defaultCloseButtonColor = DEFAULT_CLOSE_BUTTON_COLOR; + const TQColor defaultMaximizeButtonColor(DEFAULT_MAXIMIZE_BUTTON_COLOR); + const TQColor defaultIconifyButtonColor(DEFAULT_ICONIFY_BUTTON_COLOR); + const TQColor defaultHelpButtonColor(DEFAULT_HELP_BUTTON_COLOR); + const TQColor defaultStickyButtonColor(DEFAULT_STICKY_BUTTON_COLOR); _buttonConfigMap[stickyButton] = defaultStickyButtonColor; _buttonConfigMap[helpButton] = defaultHelpButtonColor; @@ -273,21 +273,21 @@ void GlowConfigDialog::defaults() void GlowConfigDialog::slotLoadThemeList () { - QStringList dir_list=KGlobal::dirs()->findDirs("data", "kwin/glow-themes"); + TQStringList dir_list=KGlobal::dirs()->findDirs("data", "kwin/glow-themes"); - QStringList::ConstIterator it; + TQStringList::ConstIterator it; _theme_list_view->clear(); - new QListViewItem (_theme_list_view, "default", "17x17"); + new TQListViewItem (_theme_list_view, "default", "17x17"); for (it=dir_list.begin(); it!=dir_list.end(); ++it) { - QDir dir (*it, QString("*"), QDir::Unsorted, - QDir::Dirs | QDir::Readable); + TQDir dir (*it, TQString("*"), TQDir::Unsorted, + TQDir::Dirs | TQDir::Readable); if (dir.exists()) { QFileInfoListIterator it2(*dir.entryInfoList()); - QFileInfo * finfo; + TQFileInfo * finfo; while ((finfo=it2.current())) { @@ -300,17 +300,17 @@ void GlowConfigDialog::slotLoadThemeList () { KConfig conf (dir.path() + "/" + finfo->fileName() + "/" + finfo->fileName() + ".theme"); - QSize button_size = conf.readSizeEntry ( - "buttonSize", new QSize (-1, -1)); + TQSize button_size = conf.readSizeEntry ( + "buttonSize", new TQSize (-1, -1)); if (button_size.width() == -1) { ++it2; continue; } - QString size_string = QString("") + - QString::number(button_size.width()) + - "x" + QString::number(button_size.height()); - new QListViewItem (_theme_list_view, + TQString size_string = TQString("") + + TQString::number(button_size.width()) + + "x" + TQString::number(button_size.height()); + new TQListViewItem (_theme_list_view, finfo->fileName(), size_string); } @@ -341,7 +341,7 @@ void GlowConfigDialog::slotTitleButtonClicked(int index) _colorButton->setColor(_buttonConfigMap[index]); } -void GlowConfigDialog::slotColorButtonChanged(const QColor& glowColor) +void GlowConfigDialog::slotColorButtonChanged(const TQColor& glowColor) { if( _stickyButton->isDown() ) { _buttonConfigMap[stickyButton] = glowColor; diff --git a/kwin-styles/glow/config/glowconfigdialog.h b/kwin-styles/glow/config/glowconfigdialog.h index 2190b3ce..033954b6 100644 --- a/kwin-styles/glow/config/glowconfigdialog.h +++ b/kwin-styles/glow/config/glowconfigdialog.h @@ -18,8 +18,8 @@ #ifndef GLOW_CONFIG_DIALOG_H #define GLOW_CONFIG_DIALOG_H -#include <qvaluevector.h> -#include <qobject.h> +#include <tqvaluevector.h> +#include <tqobject.h> class QListView; class QPushButton; @@ -34,7 +34,7 @@ class GlowConfigDialog : public QObject Q_OBJECT public: - GlowConfigDialog( KConfig* conf, QWidget* parent ); + GlowConfigDialog( KConfig* conf, TQWidget* parent ); ~GlowConfigDialog(); signals: @@ -47,7 +47,7 @@ public slots: protected slots: void slotTitleButtonClicked(int); - void slotColorButtonChanged(const QColor&); + void slotColorButtonChanged(const TQColor&); void slotTitlebarGradientTypeChanged(int); void slotResizeHandleCheckBoxChanged(); void slotThemeListViewSelectionChanged (); @@ -63,26 +63,26 @@ private: bool _showResizeHandle; KPixmapEffect::GradientType _titlebarGradientType; - QString _theme_name; + TQString _theme_name; - QWidget *_main_group_box; - QGroupBox *_button_glow_color_group_box; - QGroupBox *_theme_group_box; + TQWidget *_main_group_box; + TQGroupBox *_button_glow_color_group_box; + TQGroupBox *_theme_group_box; - QListView * _theme_list_view; + TQListView * _theme_list_view; - QCheckBox *_showResizeHandleCheckBox; - QComboBox *_titlebarGradientTypeComboBox; + TQCheckBox *_showResizeHandleCheckBox; + TQComboBox *_titlebarGradientTypeComboBox; - QPushButton *_stickyButton; - QPushButton *_helpButton; - QPushButton *_iconifyButton; - QPushButton *_maximizeButton; - QPushButton *_closeButton; - QSignalMapper *_titleButtonMapper; + TQPushButton *_stickyButton; + TQPushButton *_helpButton; + TQPushButton *_iconifyButton; + TQPushButton *_maximizeButton; + TQPushButton *_closeButton; + TQSignalMapper *_titleButtonMapper; - QColor* _buttonConfigMap; - QValueVector<QPushButton*> _titleButtonList; + TQColor* _buttonConfigMap; + TQValueVector<TQPushButton*> _titleButtonList; KColorButton *_colorButton; }; diff --git a/kwin-styles/glow/glowbutton.cpp b/kwin-styles/glow/glowbutton.cpp index 41f53386..25bae19c 100644 --- a/kwin-styles/glow/glowbutton.cpp +++ b/kwin-styles/glow/glowbutton.cpp @@ -18,14 +18,14 @@ #include <math.h> #include <iostream> #include <vector> -#include <qmap.h> -#include <qpixmap.h> -#include <qpixmapcache.h> -#include <qbitmap.h> -#include <qpainter.h> -#include <qimage.h> -#include <qtimer.h> -#include <qtooltip.h> +#include <tqmap.h> +#include <tqpixmap.h> +#include <tqpixmapcache.h> +#include <tqbitmap.h> +#include <tqpainter.h> +#include <tqimage.h> +#include <tqtimer.h> +#include <tqtooltip.h> #include <kdecoration.h> #include <kiconeffect.h> #include "glowbutton.h" @@ -37,11 +37,11 @@ namespace Glow // PixmapCache //----------------------------------------------------------------------------- -QMap<QString, const QPixmap*> PixmapCache::m_pixmapMap; +TQMap<TQString, const TQPixmap*> PixmapCache::m_pixmapMap; -const QPixmap* PixmapCache::find(const QString& key) +const TQPixmap* PixmapCache::find(const TQString& key) { - QMap<QString, const QPixmap*>::const_iterator it = + TQMap<TQString, const TQPixmap*>::const_iterator it = m_pixmapMap.find(key); if( it != m_pixmapMap.end() ) return *it; @@ -49,14 +49,14 @@ const QPixmap* PixmapCache::find(const QString& key) return 0; } -void PixmapCache::insert(const QString& key, const QPixmap *pixmap) +void PixmapCache::insert(const TQString& key, const TQPixmap *pixmap) { m_pixmapMap[key] = pixmap; } -void PixmapCache::erase(const QString& key) +void PixmapCache::erase(const TQString& key) { - QMap<QString, const QPixmap*>::iterator it = + TQMap<TQString, const TQPixmap*>::iterator it = m_pixmapMap.find(key); if (it != m_pixmapMap.end()) { @@ -68,7 +68,7 @@ void PixmapCache::erase(const QString& key) void PixmapCache::clear() { // delete all pixmaps in the cache - QMap<QString, const QPixmap*>::const_iterator it + TQMap<TQString, const TQPixmap*>::const_iterator it = m_pixmapMap.begin(); for(; it != m_pixmapMap.end(); ++it) delete *it; @@ -79,18 +79,18 @@ void PixmapCache::clear() // GlowButton //----------------------------------------------------------------------------- -GlowButton::GlowButton(QWidget *parent, const char *name, - const QString& tip, const int realizeBtns) - : QButton(parent, name) +GlowButton::GlowButton(TQWidget *parent, const char *name, + const TQString& tip, const int realizeBtns) + : TQButton(parent, name) { m_realizeButtons = realizeBtns; _steps = 0; m_updateTime = 50; - m_pixmapName = QString::null; + m_pixmapName = TQString::null; - m_timer = new QTimer(this); - connect(m_timer, SIGNAL(timeout()), this, SLOT(slotTimeout())); + m_timer = new TQTimer(this); + connect(m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotTimeout())); m_pos = 0; m_timerStatus = Stop; @@ -102,16 +102,16 @@ GlowButton::~GlowButton() { } -void GlowButton::setTipText( const QString& tip ) +void GlowButton::setTipText( const TQString& tip ) { if (KDecoration::options()->showTooltips()) { - QToolTip::remove( this ); - QToolTip::add( this, tip ); + TQToolTip::remove( this ); + TQToolTip::add( this, tip ); } } -QString GlowButton::getPixmapName() const +TQString GlowButton::getPixmapName() const { return m_pixmapName; } @@ -121,11 +121,11 @@ Qt::ButtonState GlowButton::lastButton() const return _last_button; } -void GlowButton::setPixmapName(const QString& pixmapName) +void GlowButton::setPixmapName(const TQString& pixmapName) { m_pixmapName = pixmapName; - const QPixmap *pixmap = PixmapCache::find(pixmapName); + const TQPixmap *pixmap = PixmapCache::find(pixmapName); if( ! pixmap ) return; @@ -135,18 +135,18 @@ void GlowButton::setPixmapName(const QString& pixmapName) repaint(false); } -void GlowButton::paintEvent( QPaintEvent *e ) +void GlowButton::paintEvent( TQPaintEvent *e ) { - QWidget::paintEvent(e); - const QPixmap *pixmap = PixmapCache::find(m_pixmapName); + TQWidget::paintEvent(e); + const TQPixmap *pixmap = PixmapCache::find(m_pixmapName); if( pixmap != 0 ) { int pos = m_pos>=0?m_pos:-m_pos; - QPainter p; - QPixmap pm (pixmap->size()); + TQPainter p; + TQPixmap pm (pixmap->size()); p.begin(&pm); - const QPixmap * bg_pixmap = PixmapCache::find( - QString::number(parentWidget()->winId())); + const TQPixmap * bg_pixmap = PixmapCache::find( + TQString::number(parentWidget()->winId())); p.drawPixmap (0, 0, *bg_pixmap, x(), y(), width(), height()); p.drawPixmap (0, 0, *pixmap, 0, pos*height(), width(), height()); p.end(); @@ -156,25 +156,25 @@ void GlowButton::paintEvent( QPaintEvent *e ) } } -void GlowButton::enterEvent( QEvent *e ) +void GlowButton::enterEvent( TQEvent *e ) { if( m_pos<0 ) m_pos=-m_pos; m_timerStatus = Run; if( ! m_timer->isActive() ) m_timer->start(m_updateTime); - QButton::enterEvent(e); + TQButton::enterEvent(e); } -void GlowButton::leaveEvent( QEvent *e ) +void GlowButton::leaveEvent( TQEvent *e ) { m_timerStatus = Stop; if( ! m_timer->isActive() ) m_timer->start(m_updateTime); - QButton::leaveEvent(e); + TQButton::leaveEvent(e); } -void GlowButton::mousePressEvent( QMouseEvent *e ) +void GlowButton::mousePressEvent( TQMouseEvent *e ) { _last_button = e->button(); if( m_timer->isActive() ) @@ -183,24 +183,24 @@ void GlowButton::mousePressEvent( QMouseEvent *e ) repaint(false); // without pretending LeftButton, clicking on the button with MidButton // or RightButton would cause unwanted titlebar action - QMouseEvent me (e->type(), e->pos(), e->globalPos(), + TQMouseEvent me (e->type(), e->pos(), e->globalPos(), (e->button()&m_realizeButtons)?LeftButton:NoButton, e->state()); - QButton::mousePressEvent(&me); + TQButton::mousePressEvent(&me); } -void GlowButton::mouseReleaseEvent( QMouseEvent *e ) +void GlowButton::mouseReleaseEvent( TQMouseEvent *e ) { _last_button = e->button(); - QPoint p = mapToParent(mapFromGlobal(e->globalPos())); + TQPoint p = mapToParent(mapFromGlobal(e->globalPos())); if( ! m_timer->isActive() ) { m_timer->start(m_updateTime); } if( ! geometry().contains(p) ) { m_timerStatus = Stop; } - QMouseEvent me (e->type(), e->pos(), e->globalPos(), + TQMouseEvent me (e->type(), e->pos(), e->globalPos(), (e->button()&m_realizeButtons)?LeftButton:NoButton, e->state()); - QButton::mouseReleaseEvent(&me); + TQButton::mouseReleaseEvent(&me); } void GlowButton::slotTimeout() @@ -241,26 +241,26 @@ void GlowButtonFactory::setSteps(int steps) _steps = steps; } -QPixmap * GlowButtonFactory::createGlowButtonPixmap( - const QImage & bg_image, - const QImage & fg_image, - const QImage & glow_image, - const QColor & color, - const QColor & glow_color) +TQPixmap * GlowButtonFactory::createGlowButtonPixmap( + const TQImage & bg_image, + const TQImage & fg_image, + const TQImage & glow_image, + const TQColor & color, + const TQColor & glow_color) { if (bg_image.size() != fg_image.size() || fg_image.size() != glow_image.size()) { std::cerr << "Image size error" << std::endl; - return new QPixmap(); + return new TQPixmap(); } - QImage colorized_bg_image = bg_image.copy(); + TQImage colorized_bg_image = bg_image.copy(); KIconEffect::colorize (colorized_bg_image, color, 1.0); int w = colorized_bg_image.width(); int h = colorized_bg_image.height(); - QImage image (w, (_steps+1)*h, 32); + TQImage image (w, (_steps+1)*h, 32); image.setAlphaBuffer (true); for (int i=0; i<_steps+1; ++i) { for (int y=0; y<h; ++y) { @@ -276,11 +276,11 @@ QPixmap * GlowButtonFactory::createGlowButtonPixmap( } } } - QPixmap * pixmap = new QPixmap (image); - QPainter painter (pixmap); + TQPixmap * pixmap = new TQPixmap (image); + TQPainter painter (pixmap); bool dark = (qGray(color.rgb()) <= 127); - QImage fg_img (w, h, 32); + TQImage fg_img (w, h, 32); fg_img.setAlphaBuffer (true); for (int y=0; y<h; ++y) { uint * src_line = (uint*) fg_image.scanLine (y); @@ -297,7 +297,7 @@ QPixmap * GlowButtonFactory::createGlowButtonPixmap( int r = glow_color.red(); int g = glow_color.green(); int b = glow_color.blue(); - QImage glow_img (w, h, 32); + TQImage glow_img (w, h, 32); glow_img.setAlphaBuffer (true); for (int i=0; i<_steps; ++i) { painter.drawImage (0, i*h, fg_img); @@ -327,7 +327,7 @@ QPixmap * GlowButtonFactory::createGlowButtonPixmap( } GlowButton* GlowButtonFactory::createGlowButton( - QWidget *parent, const char* name, const QString& tip, const int realizeBtns) + TQWidget *parent, const char* name, const TQString& tip, const int realizeBtns) { GlowButton *glowButton = new GlowButton(parent, name, tip, realizeBtns); return glowButton; diff --git a/kwin-styles/glow/glowbutton.h b/kwin-styles/glow/glowbutton.h index 3d4f5e1d..e7cc3605 100644 --- a/kwin-styles/glow/glowbutton.h +++ b/kwin-styles/glow/glowbutton.h @@ -19,8 +19,8 @@ #define GLOW_BUTTON_H #include <vector> -#include <qmap.h> -#include <qbutton.h> +#include <tqmap.h> +#include <tqbutton.h> class QPixmap; class QBitmap; @@ -33,12 +33,12 @@ namespace Glow class PixmapCache { public: - static const QPixmap* find(const QString& key); - static void insert(const QString& key, const QPixmap *pixmap); - static void erase(const QString& key); + static const TQPixmap* find(const TQString& key); + static void insert(const TQString& key, const TQPixmap *pixmap); + static void erase(const TQString& key); static void clear(); private: - static QMap<QString, const QPixmap*> m_pixmapMap; + static TQMap<TQString, const TQPixmap*> m_pixmapMap; }; @@ -49,24 +49,24 @@ class GlowButton : public QButton Q_OBJECT public: - GlowButton(QWidget *parent, const char* name, const QString& tip, const int realizeBtns); + GlowButton(TQWidget *parent, const char* name, const TQString& tip, const int realizeBtns); ~GlowButton(); - void setTipText( const QString& tip ); + void setTipText( const TQString& tip ); - QString getPixmapName() const; + TQString getPixmapName() const; ButtonState lastButton() const; /** Sets the name of the pixmap in the pixmap cache. - * If no background pixmap is wanted use QString::null as name. */ - void setPixmapName(const QString& pixmapName); + * If no background pixmap is wanted use TQString::null as name. */ + void setPixmapName(const TQString& pixmapName); protected: - virtual void paintEvent( QPaintEvent * ); - virtual void enterEvent( QEvent * ); - virtual void leaveEvent( QEvent * ); - virtual void mousePressEvent( QMouseEvent * ); - virtual void mouseReleaseEvent( QMouseEvent * ); + virtual void paintEvent( TQPaintEvent * ); + virtual void enterEvent( TQEvent * ); + virtual void leaveEvent( TQEvent * ); + virtual void mousePressEvent( TQMouseEvent * ); + virtual void mouseReleaseEvent( TQMouseEvent * ); protected slots: void slotTimeout(); @@ -76,9 +76,9 @@ private: int m_updateTime; int _steps; - QString m_pixmapName; + TQString m_pixmapName; - QTimer *m_timer; + TQTimer *m_timer; int m_pos; TimerStatus m_timerStatus; @@ -108,16 +108,16 @@ public: * in succession to create the glow effect. The last sub pixmap is used * when the button is pressed. */ - QPixmap * createGlowButtonPixmap( - const QImage & bg_image, -// const QImage & bg_alpha_image, - const QImage & fg_image, - const QImage & glow_image, - const QColor & color, - const QColor & glow_color); + TQPixmap * createGlowButtonPixmap( + const TQImage & bg_image, +// const TQImage & bg_alpha_image, + const TQImage & fg_image, + const TQImage & glow_image, + const TQColor & color, + const TQColor & glow_color); GlowButton* createGlowButton( - QWidget *parent, const char* name, const QString& tip, const int realizeBtns = Qt::LeftButton); + TQWidget *parent, const char* name, const TQString& tip, const int realizeBtns = Qt::LeftButton); private: int _steps; diff --git a/kwin-styles/glow/glowclient.cpp b/kwin-styles/glow/glowclient.cpp index ed13f480..53d52b79 100644 --- a/kwin-styles/glow/glowclient.cpp +++ b/kwin-styles/glow/glowclient.cpp @@ -15,19 +15,19 @@ * * ***************************************************************************/ -#include <qapplication.h> -#include <qbitmap.h> -#include <qimage.h> -#include <qlayout.h> -#include <qpainter.h> -#include <qpixmap.h> +#include <tqapplication.h> +#include <tqbitmap.h> +#include <tqimage.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqpixmap.h> #include <kconfig.h> #include <kdebug.h> #include <klocale.h> #include <kpixmapeffect.h> #include <kpixmap.h> #include <kstandarddirs.h> -#include <qlabel.h> +#include <tqlabel.h> #include "resources.h" #include "glowclient.h" #include "glowbutton.h" @@ -54,11 +54,11 @@ void GlowClientConfig::load(KDecorationFactory *factory) KConfig conf("kwinglowrc"); conf.setGroup("General"); - const QColor defaultCloseButtonColor(DEFAULT_CLOSE_BUTTON_COLOR); - const QColor defaultMaximizeButtonColor(DEFAULT_MAXIMIZE_BUTTON_COLOR); - const QColor defaultIconifyButtonColor(DEFAULT_ICONIFY_BUTTON_COLOR); - const QColor defaultHelpButtonColor(DEFAULT_HELP_BUTTON_COLOR); - const QColor defaultStickyButtonColor(DEFAULT_STICKY_BUTTON_COLOR); + const TQColor defaultCloseButtonColor(DEFAULT_CLOSE_BUTTON_COLOR); + const TQColor defaultMaximizeButtonColor(DEFAULT_MAXIMIZE_BUTTON_COLOR); + const TQColor defaultIconifyButtonColor(DEFAULT_ICONIFY_BUTTON_COLOR); + const TQColor defaultHelpButtonColor(DEFAULT_HELP_BUTTON_COLOR); + const TQColor defaultStickyButtonColor(DEFAULT_STICKY_BUTTON_COLOR); stickyButtonGlowColor = conf.readColorEntry( "stickyButtonGlowColor", &defaultStickyButtonColor); @@ -123,9 +123,9 @@ GlowClientGlobals::~GlowClientGlobals() m_instance = 0; } -QString GlowClientGlobals::getPixmapName(PixmapType type, bool isActive) +TQString GlowClientGlobals::getPixmapName(PixmapType type, bool isActive) { - QString s = getPixmapTypeName(static_cast<PixmapType>(type)); + TQString s = getPixmapTypeName(static_cast<PixmapType>(type)); s += "|"; s += isActive ? "Active" : "NotActive"; return s; @@ -153,19 +153,19 @@ void GlowClientGlobals::readConfig() _config->load(this); } -QValueList< GlowClientGlobals::BorderSize > +TQValueList< GlowClientGlobals::BorderSize > GlowClientGlobals::borderSizes() const { // the list must be sorted - return QValueList< BorderSize >() << BorderNormal << + return TQValueList< BorderSize >() << BorderNormal << BorderLarge << BorderVeryLarge << BorderHuge << BorderVeryHuge << BorderOversized; } void GlowClientGlobals::readTheme() { - QString theme_config_file = KGlobal::dirs()->findResource ("data", - QString("kwin/glow-themes/") + config()->themeName + "/" + + TQString theme_config_file = KGlobal::dirs()->findResource ("data", + TQString("kwin/glow-themes/") + config()->themeName + "/" + config()->themeName + ".theme"); if (theme_config_file.isNull()) { @@ -207,7 +207,7 @@ void GlowClientGlobals::readTheme() _theme->iconifyGlowPixmap = conf.readEntry ("iconifyGlowPixmap", _theme->iconifyGlowPixmap); - titleHeight = QFontMetrics(KDecoration::options()->font(true)).height(); + titleHeight = TQFontMetrics(KDecoration::options()->font(true)).height(); if (titleHeight < SIDE_MARGIN) titleHeight = SIDE_MARGIN; if (titleHeight < _theme->buttonSize.height()) @@ -266,7 +266,7 @@ void GlowClientGlobals::deletePixmaps() PixmapCache::clear(); } -const QString GlowClientGlobals::getPixmapTypeName(PixmapType type) +const TQString GlowClientGlobals::getPixmapTypeName(PixmapType type) { switch(type) { case (StickyOn): @@ -284,69 +284,69 @@ const QString GlowClientGlobals::getPixmapTypeName(PixmapType type) case(Close): return "Close"; default: - return QString::null; + return TQString::null; } } bool GlowClientGlobals::createPixmap(PixmapType type, bool isActive) { - QString theme_dir = KGlobal::dirs()->findResource ("data", - QString("kwin/glow-themes/") + _config->themeName + "/"); + TQString theme_dir = KGlobal::dirs()->findResource ("data", + TQString("kwin/glow-themes/") + _config->themeName + "/"); - QColor glow_color; - QColor color = options()->color(ColorButtonBg, isActive); + TQColor glow_color; + TQColor color = options()->color(ColorButtonBg, isActive); - QImage bg_image (theme_dir+_theme->backgroundPixmap); - QImage fg_image; - QImage glow_image; + TQImage bg_image (theme_dir+_theme->backgroundPixmap); + TQImage fg_image; + TQImage glow_image; switch(type) { case (StickyOn): { - fg_image = QImage (theme_dir+_theme->stickyOnPixmap); - glow_image = QImage (theme_dir+_theme->stickyOnGlowPixmap); + fg_image = TQImage (theme_dir+_theme->stickyOnPixmap); + glow_image = TQImage (theme_dir+_theme->stickyOnGlowPixmap); glow_color = _config->stickyButtonGlowColor; break; } case (StickyOff): { - fg_image = QImage (theme_dir+_theme->stickyOffPixmap); - glow_image = QImage (theme_dir+_theme->stickyOffGlowPixmap); + fg_image = TQImage (theme_dir+_theme->stickyOffPixmap); + glow_image = TQImage (theme_dir+_theme->stickyOffGlowPixmap); glow_color = _config->stickyButtonGlowColor; break; } case (Help): { - fg_image = QImage (theme_dir+_theme->helpPixmap); - glow_image = QImage (theme_dir+_theme->helpGlowPixmap); + fg_image = TQImage (theme_dir+_theme->helpPixmap); + glow_image = TQImage (theme_dir+_theme->helpGlowPixmap); glow_color = _config->helpButtonGlowColor; break; } case (Iconify): { - fg_image = QImage (theme_dir+_theme->iconifyPixmap); - glow_image = QImage (theme_dir+_theme->iconifyGlowPixmap); + fg_image = TQImage (theme_dir+_theme->iconifyPixmap); + glow_image = TQImage (theme_dir+_theme->iconifyGlowPixmap); glow_color = _config->iconifyButtonGlowColor; break; } case (MaximizeOn): { - fg_image = QImage (theme_dir+_theme->maximizeOnPixmap); - glow_image = QImage (theme_dir+_theme->maximizeOnGlowPixmap); + fg_image = TQImage (theme_dir+_theme->maximizeOnPixmap); + glow_image = TQImage (theme_dir+_theme->maximizeOnGlowPixmap); glow_color = _config->maximizeButtonGlowColor; break; } case (MaximizeOff): { - fg_image = QImage (theme_dir+_theme->maximizeOffPixmap); - glow_image = QImage (theme_dir+_theme->maximizeOffGlowPixmap); + fg_image = TQImage (theme_dir+_theme->maximizeOffPixmap); + glow_image = TQImage (theme_dir+_theme->maximizeOffGlowPixmap); glow_color = _config->maximizeButtonGlowColor; break; } case (Close): { - fg_image = QImage (theme_dir+_theme->closePixmap); - glow_image = QImage (theme_dir+_theme->closeGlowPixmap); + fg_image = TQImage (theme_dir+_theme->closePixmap); + glow_image = TQImage (theme_dir+_theme->closeGlowPixmap); glow_color = _config->closeButtonGlowColor; break; } @@ -357,7 +357,7 @@ bool GlowClientGlobals::createPixmap(PixmapType type, bool isActive) || glow_image.size() != _theme->buttonSize) return false; - QPixmap * glowPm = buttonFactory()->createGlowButtonPixmap( + TQPixmap * glowPm = buttonFactory()->createGlowButtonPixmap( bg_image, fg_image, glow_image, color, glow_color); if (glowPm->isNull()) @@ -398,40 +398,40 @@ void GlowClient::init() GlowClient::~GlowClient() { - PixmapCache::erase(QString::number(widget()->winId())); + PixmapCache::erase(TQString::number(widget()->winId())); } -void GlowClient::resizeEvent( QResizeEvent * ) +void GlowClient::resizeEvent( TQResizeEvent * ) { doShape(); widget()->repaint(false); } -void GlowClient::paintEvent( QPaintEvent * ) +void GlowClient::paintEvent( TQPaintEvent * ) { GlowClientConfig *conf = GlowClientGlobals::instance()->config(); - QRect r_this = widget()->rect(); - QRect r_title = _title_spacer->geometry(); - QColorGroup titleCg = options()->colorGroup(ColorTitleBar, isActive()); - QColorGroup titleBlendCg=options()->colorGroup(ColorTitleBlend, isActive()); - QColorGroup cg = widget()->colorGroup(); - QColor titleColor = options()->color(ColorTitleBar, isActive()); - QColor titleBlendColor = options()->color(ColorTitleBlend, isActive()); - QColor bgColor = widget()->colorGroup().background(); - QPainter p; - QPointArray pArray, pArray2, pArray3, pArray4; + TQRect r_this = widget()->rect(); + TQRect r_title = _title_spacer->geometry(); + TQColorGroup titleCg = options()->colorGroup(ColorTitleBar, isActive()); + TQColorGroup titleBlendCg=options()->colorGroup(ColorTitleBlend, isActive()); + TQColorGroup cg = widget()->colorGroup(); + TQColor titleColor = options()->color(ColorTitleBar, isActive()); + TQColor titleBlendColor = options()->color(ColorTitleBlend, isActive()); + TQColor bgColor = widget()->colorGroup().background(); + TQPainter p; + TQPointArray pArray, pArray2, pArray3, pArray4; // pixmap for title bar - QSize tBSize(width(), r_title.height()); - QSize gradientPixmapSize (tBSize-QSize(3,3)); + TQSize tBSize(width(), r_title.height()); + TQSize gradientPixmapSize (tBSize-TQSize(3,3)); if (! gradientPixmapSize.isValid()) - gradientPixmapSize = QSize(0,0); + gradientPixmapSize = TQSize(0,0); KPixmap gradientPixmap(gradientPixmapSize); if (! gradientPixmapSize.isNull()) KPixmapEffect::gradient(gradientPixmap, titleColor, titleBlendColor, (KPixmapEffect::GradientType) conf->titlebarGradientType); - QPixmap * title_buffer = new QPixmap(tBSize); + TQPixmap * title_buffer = new TQPixmap(tBSize); p.begin(title_buffer); if (! gradientPixmap.isNull()) p.drawPixmap(2, 2, gradientPixmap); @@ -446,7 +446,7 @@ void GlowClient::paintEvent( QPaintEvent * ) Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, caption()); // draw split color beneath buttons top right - pArray4 = QPointArray(4); + pArray4 = TQPointArray(4); pArray4.setPoint(0, tBSize.width()-1, tBSize.height()/2-1); pArray4.setPoint(1, r_title.x()+r_title.width()-1+tBSize.height()/2, tBSize.height()/2-1); @@ -457,7 +457,7 @@ void GlowClient::paintEvent( QPaintEvent * ) p.drawPolygon(pArray4); // draw borders - pArray = QPointArray(3); + pArray = TQPointArray(3); pArray.setPoint(0, tBSize.width()-1, tBSize.height()/2-1); pArray.setPoint(1, r_title.x()+r_title.width()-1+tBSize.height()/2, tBSize.height()/2-1); @@ -466,7 +466,7 @@ void GlowClient::paintEvent( QPaintEvent * ) p.drawPolyline(pArray); p.drawLine (0, tBSize.height()-1, r_title.x()+r_title.width()-1, tBSize.height()-1); - pArray2 = QPointArray(3); + pArray2 = TQPointArray(3); pArray2.setPoint(0, 1, tBSize.height()-2); pArray2.setPoint(1, 1, 1); pArray2.setPoint(2, tBSize.width()-2, 1); @@ -474,7 +474,7 @@ void GlowClient::paintEvent( QPaintEvent * ) p.drawPolyline(pArray2); } - pArray3 = QPointArray(4); + pArray3 = TQPointArray(4); pArray3.setPoint(0, 0, tBSize.height()-1); pArray3.setPoint(1, 0, 0); pArray3.setPoint(2, tBSize.width()-1, 0); @@ -484,8 +484,8 @@ void GlowClient::paintEvent( QPaintEvent * ) p.end(); // insert title buffer in cache; before that, remove old buffer - PixmapCache::erase(QString::number(widget()->winId())); - PixmapCache::insert(QString::number(widget()->winId()), title_buffer); + PixmapCache::erase(TQString::number(widget()->winId())); + PixmapCache::insert(TQString::number(widget()->winId()), title_buffer); bitBlt(widget(), 0, 0, title_buffer); for (unsigned int i=0; i<m_buttonList.size(); ++i) @@ -518,21 +518,21 @@ void GlowClient::paintEvent( QPaintEvent * ) } } -void GlowClient::showEvent( QShowEvent * ) +void GlowClient::showEvent( TQShowEvent * ) { doShape(); widget()->repaint(false); } -void GlowClient::mouseDoubleClickEvent( QMouseEvent *e ) +void GlowClient::mouseDoubleClickEvent( TQMouseEvent *e ) { if(e->button() == LeftButton && _title_spacer->geometry().contains(e->pos())) titlebarDblClickOperation(); } -void GlowClient::wheelEvent( QWheelEvent *e ) +void GlowClient::wheelEvent( TQWheelEvent *e ) { - if (isSetShade() || QRect( 0, 0, width(), titleHeight ).contains(e->pos())) + if (isSetShade() || TQRect( 0, 0, width(), titleHeight ).contains(e->pos())) titlebarMouseWheelOperation( e->delta()); } @@ -556,12 +556,12 @@ void GlowClient::captionChange() widget()->update(_title_spacer->geometry()); } -QSize GlowClient::minimumSize() const +TQSize GlowClient::minimumSize() const { return widget()->minimumSize(); } -void GlowClient::resize( const QSize& s ) +void GlowClient::resize( const TQSize& s ) { widget()->resize( s ); } @@ -607,7 +607,7 @@ void GlowClient::maximizeChange() } } -KDecoration::Position GlowClient::mousePosition(const QPoint &pos) const +KDecoration::Position GlowClient::mousePosition(const TQPoint &pos) const { Position m = PositionCenter; @@ -646,87 +646,87 @@ void GlowClient::createButtons() { GlowClientGlobals *globals = GlowClientGlobals::instance(); GlowButtonFactory *factory = globals->buttonFactory(); - QSize size = globals->theme()->buttonSize; + TQSize size = globals->theme()->buttonSize; m_stickyButton = factory->createGlowButton(widget(), "StickyButton", isOnAllDesktops()?i18n("Not on all desktops"):i18n("On all desktops"), LeftButton|RightButton); m_stickyButton->setFixedSize(size); - connect(m_stickyButton, SIGNAL(clicked()), this, SLOT(toggleOnAllDesktops())); + connect(m_stickyButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(toggleOnAllDesktops())); m_buttonList.insert(m_buttonList.end(), m_stickyButton); m_helpButton = factory->createGlowButton(widget(), "HelpButton", i18n("Help")); m_helpButton->setFixedSize(size); - connect(m_helpButton, SIGNAL(clicked()), this, SLOT(showContextHelp())); + connect(m_helpButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(showContextHelp())); m_buttonList.insert(m_buttonList.end(), m_helpButton); m_minimizeButton = factory->createGlowButton(widget(), "IconifyButton", i18n("Minimize")); m_minimizeButton->setFixedSize(size); - connect(m_minimizeButton, SIGNAL(clicked()), this, SLOT(minimize())); + connect(m_minimizeButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(minimize())); m_buttonList.insert(m_buttonList.end(), m_minimizeButton); m_maximizeButton=factory->createGlowButton(widget(), "MaximizeButton", i18n("Maximize"), LeftButton|MidButton|RightButton); m_maximizeButton->setFixedSize(size); - connect(m_maximizeButton, SIGNAL(clicked()), this, SLOT(slotMaximize())); + connect(m_maximizeButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotMaximize())); m_buttonList.insert(m_buttonList.end(), m_maximizeButton); m_closeButton = factory->createGlowButton(widget(), "CloseButton", i18n("Close")); m_closeButton->setFixedSize(size); - connect(m_closeButton, SIGNAL(clicked()), this, SLOT(closeWindow())); + connect(m_closeButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(closeWindow())); m_buttonList.insert(m_buttonList.end(), m_closeButton); } void GlowClient::resetLayout() { - _main_layout = new QVBoxLayout(widget(), 0, 0); - _main_layout->setResizeMode (QLayout::FreeResize); + _main_layout = new TQVBoxLayout(widget(), 0, 0); + _main_layout->setResizeMode (TQLayout::FreeResize); // update button positions and colors updateButtonPositions(); updateButtonPixmaps(); - QBoxLayout * topLayout = new QBoxLayout(_main_layout, - QBoxLayout::LeftToRight, 0, 0); + TQBoxLayout * topLayout = new TQBoxLayout(_main_layout, + TQBoxLayout::LeftToRight, 0, 0); topLayout->setMargin(0); topLayout->setSpacing(TITLE_SPACING); topLayout->addSpacing(SIDE_MARGIN); - QVBoxLayout *outerLeftLayout = new QVBoxLayout(topLayout); + TQVBoxLayout *outerLeftLayout = new TQVBoxLayout(topLayout); outerLeftLayout->addSpacing(TITLE_MARGIN); outerLeftLayout->addItem(m_leftButtonLayout); outerLeftLayout->addSpacing(1); topLayout->addSpacing(SIDE_MARGIN); - _title_spacer = new QSpacerItem(0, titleHeight + TITLE_MARGIN + 1, - QSizePolicy::Expanding, QSizePolicy::Fixed); + _title_spacer = new TQSpacerItem(0, titleHeight + TITLE_MARGIN + 1, + TQSizePolicy::Expanding, TQSizePolicy::Fixed); topLayout->addItem(_title_spacer); topLayout->addSpacing(SIDE_MARGIN); - QVBoxLayout *outerRightLayout = new QVBoxLayout(topLayout); + TQVBoxLayout *outerRightLayout = new TQVBoxLayout(topLayout); outerRightLayout->addSpacing(TITLE_MARGIN); outerRightLayout->addItem(m_rightButtonLayout); outerRightLayout->addSpacing(1); topLayout->addSpacing(SIDE_MARGIN); - QBoxLayout *midLayout = new QBoxLayout( - _main_layout, QBoxLayout::LeftToRight, 0, 0); + TQBoxLayout *midLayout = new TQBoxLayout( + _main_layout, TQBoxLayout::LeftToRight, 0, 0); midLayout->addSpacing(SIDE_MARGIN); if(isPreview()) midLayout->addWidget( - new QLabel( i18n( "<b><center>Glow preview</center></b>" ), widget())); + new TQLabel( i18n( "<b><center>Glow preview</center></b>" ), widget())); else - midLayout->addItem( new QSpacerItem( 0, 0 )); + midLayout->addItem( new TQSpacerItem( 0, 0 )); midLayout->addSpacing(SIDE_MARGIN); if(GlowClientGlobals::instance()->config()->showResizeHandle && isResizable() ) { - _bottom_spacer = new QSpacerItem(SIDE_MARGIN*2, - RESIZE_HANDLE_HEIGHT, QSizePolicy::Expanding, QSizePolicy::Minimum); + _bottom_spacer = new TQSpacerItem(SIDE_MARGIN*2, + RESIZE_HANDLE_HEIGHT, TQSizePolicy::Expanding, TQSizePolicy::Minimum); } else { - _bottom_spacer = new QSpacerItem(SIDE_MARGIN*2, - BOTTOM_MARGIN, QSizePolicy::Expanding, QSizePolicy::Minimum); + _bottom_spacer = new TQSpacerItem(SIDE_MARGIN*2, + BOTTOM_MARGIN, TQSizePolicy::Expanding, TQSizePolicy::Minimum); } _main_layout->addItem (_bottom_spacer); _main_layout->setStretchFactor(topLayout, 0); @@ -735,7 +735,7 @@ void GlowClient::resetLayout() void GlowClient::updateButtonPositions() { - QString buttons = options()->titleButtonsLeft() + "|" + TQString buttons = options()->titleButtonsLeft() + "|" + options()->titleButtonsRight(); bool leftButtons=true; @@ -749,12 +749,12 @@ void GlowClient::updateButtonPositions() // reset left and right button layout if(m_leftButtonLayout) delete m_leftButtonLayout; - m_leftButtonLayout = new QBoxLayout(0, QBoxLayout::LeftToRight, 0, 0, 0); + m_leftButtonLayout = new TQBoxLayout(0, TQBoxLayout::LeftToRight, 0, 0, 0); m_leftButtonLayout->setMargin(0); m_leftButtonLayout->setSpacing(TITLE_SPACING); if(m_rightButtonLayout) delete m_rightButtonLayout; - m_rightButtonLayout = new QBoxLayout(0, QBoxLayout::LeftToRight, 0, 0, 0); + m_rightButtonLayout = new TQBoxLayout(0, TQBoxLayout::LeftToRight, 0, 0, 0); m_rightButtonLayout->setMargin(0); m_rightButtonLayout->setSpacing(TITLE_SPACING); @@ -825,12 +825,12 @@ void GlowClient::updateButtonPixmaps() void GlowClient::doShape() { - QRegion mask(widget()->rect()); + TQRegion mask(widget()->rect()); // edges - mask -= QRegion(width()-1,0,1,1); - mask -= QRegion(0,height()-1,1,1); - mask -= QRegion(width()-1,height()-1,1,1); + mask -= TQRegion(width()-1,0,1,1); + mask -= TQRegion(0,height()-1,1,1); + mask -= TQRegion(width()-1,height()-1,1,1); setMask(mask); } @@ -855,29 +855,29 @@ void GlowClient::slotMaximize() maximize(m_maximizeButton->lastButton()); } -bool GlowClient::eventFilter( QObject* o, QEvent* e ) +bool GlowClient::eventFilter( TQObject* o, TQEvent* e ) { if( o != widget()) return false; switch( e->type()) { - case QEvent::Resize: - resizeEvent( static_cast< QResizeEvent* >( e )); + case TQEvent::Resize: + resizeEvent( static_cast< TQResizeEvent* >( e )); return true; - case QEvent::Paint: - paintEvent( static_cast< QPaintEvent* >( e )); + case TQEvent::Paint: + paintEvent( static_cast< TQPaintEvent* >( e )); return true; - case QEvent::MouseButtonDblClick: - mouseDoubleClickEvent( static_cast< QMouseEvent* >( e )); + case TQEvent::MouseButtonDblClick: + mouseDoubleClickEvent( static_cast< TQMouseEvent* >( e )); return true; - case QEvent::MouseButtonPress: - processMousePressEvent( static_cast< QMouseEvent* >( e )); + case TQEvent::MouseButtonPress: + processMousePressEvent( static_cast< TQMouseEvent* >( e )); return true; - case QEvent::Show: - showEvent( static_cast< QShowEvent* >( e )); + case TQEvent::Show: + showEvent( static_cast< TQShowEvent* >( e )); return true; - case QEvent::Wheel: - wheelEvent( static_cast< QWheelEvent* >( e )); + case TQEvent::Wheel: + wheelEvent( static_cast< TQWheelEvent* >( e )); return true; default: break; diff --git a/kwin-styles/glow/glowclient.h b/kwin-styles/glow/glowclient.h index 9de73126..faa12e62 100644 --- a/kwin-styles/glow/glowclient.h +++ b/kwin-styles/glow/glowclient.h @@ -43,30 +43,30 @@ class GlowButtonFactory; struct GlowTheme { - QSize buttonSize; + TQSize buttonSize; - QString backgroundPixmap; - QString backgroundAlphaPixmap; - - QString stickyOnPixmap; - QString stickyOffPixmap; - QString maximizeOnPixmap; - QString maximizeOffPixmap; - QString helpPixmap; - QString closePixmap; - QString iconifyPixmap; - - QString stickyOnGlowPixmap; - QString stickyOffGlowPixmap; - QString maximizeOnGlowPixmap; - QString maximizeOffGlowPixmap; - QString helpGlowPixmap; - QString closeGlowPixmap; - QString iconifyGlowPixmap; + TQString backgroundPixmap; + TQString backgroundAlphaPixmap; + + TQString stickyOnPixmap; + TQString stickyOffPixmap; + TQString maximizeOnPixmap; + TQString maximizeOffPixmap; + TQString helpPixmap; + TQString closePixmap; + TQString iconifyPixmap; + + TQString stickyOnGlowPixmap; + TQString stickyOffGlowPixmap; + TQString maximizeOnGlowPixmap; + TQString maximizeOffGlowPixmap; + TQString helpGlowPixmap; + TQString closeGlowPixmap; + TQString iconifyGlowPixmap; }; static GlowTheme default_glow_theme = { - QSize (17, 17), + TQSize (17, 17), "background.png", "background_alpha.png", "stickyon.png", "stickyoff.png", "maximizeon.png", "maximizeoff.png", @@ -86,14 +86,14 @@ public: void load (KDecorationFactory *factory); - QColor stickyButtonGlowColor; - QColor helpButtonGlowColor; - QColor iconifyButtonGlowColor; - QColor maximizeButtonGlowColor; - QColor closeButtonGlowColor; + TQColor stickyButtonGlowColor; + TQColor helpButtonGlowColor; + TQColor iconifyButtonGlowColor; + TQColor maximizeButtonGlowColor; + TQColor closeButtonGlowColor; bool showResizeHandle; int titlebarGradientType; - QString themeName; + TQString themeName; }; //----------------------------------------------------------------------------- @@ -113,9 +113,9 @@ public: virtual KDecoration* createDecoration( KDecorationBridge* b ); virtual bool reset( unsigned long changed ); virtual bool supports( Ability ability ); - QValueList< GlowClientGlobals::BorderSize > borderSizes() const; + TQValueList< GlowClientGlobals::BorderSize > borderSizes() const; - QString getPixmapName(PixmapType type, bool isActive); + TQString getPixmapName(PixmapType type, bool isActive); GlowTheme * theme() const { return _theme; } GlowClientConfig * config() const { return _config; } @@ -134,7 +134,7 @@ private: bool createPixmaps(); void deletePixmaps(); bool createPixmap(PixmapType type,bool isActive); - const QString getPixmapTypeName(PixmapType type); + const TQString getPixmapTypeName(PixmapType type); }; //----------------------------------------------------------------------------- @@ -150,23 +150,23 @@ public: virtual void init(); virtual void borders( int&, int&, int&, int& ) const; - virtual void resize( const QSize& ); - virtual QSize minimumSize() const; + virtual void resize( const TQSize& ); + virtual TQSize minimumSize() const; protected: - virtual void resizeEvent( QResizeEvent * ); - virtual void paintEvent( QPaintEvent * ); - virtual void showEvent( QShowEvent * ); - virtual void mouseDoubleClickEvent( QMouseEvent * ); - virtual void wheelEvent( QWheelEvent * ); + virtual void resizeEvent( TQResizeEvent * ); + virtual void paintEvent( TQPaintEvent * ); + virtual void showEvent( TQShowEvent * ); + virtual void mouseDoubleClickEvent( TQMouseEvent * ); + virtual void wheelEvent( TQWheelEvent * ); virtual void maximizeChange(); virtual void activeChange(); virtual void iconChange(); virtual void desktopChange(); virtual void shadeChange(); virtual void captionChange(); - virtual Position mousePosition(const QPoint &) const; - virtual bool eventFilter( QObject* o, QEvent* e ); + virtual Position mousePosition(const TQPoint &) const; + virtual bool eventFilter( TQObject* o, TQEvent* e ); private: std::vector<GlowButton*> m_buttonList; @@ -177,11 +177,11 @@ private: GlowButton *m_minimizeButton; GlowButton *m_maximizeButton; GlowButton *m_closeButton; - QBoxLayout *m_leftButtonLayout; - QBoxLayout *m_rightButtonLayout; - QSpacerItem * _bottom_spacer; - QSpacerItem * _title_spacer; - QVBoxLayout * _main_layout; + TQBoxLayout *m_leftButtonLayout; + TQBoxLayout *m_rightButtonLayout; + TQSpacerItem * _bottom_spacer; + TQSpacerItem * _title_spacer; + TQVBoxLayout * _main_layout; void createButtons(); void updateButtonPositions(); diff --git a/kwin-styles/icewm/config/config.cpp b/kwin-styles/icewm/config/config.cpp index 7cae598e..980e949a 100644 --- a/kwin-styles/icewm/config/config.cpp +++ b/kwin-styles/icewm/config/config.cpp @@ -25,10 +25,10 @@ */ #include "config.h" -#include <qdir.h> -#include <qregexp.h> -#include <qvbox.h> -#include <qwhatsthis.h> +#include <tqdir.h> +#include <tqregexp.h> +#include <tqvbox.h> +#include <tqwhatsthis.h> #include <kglobal.h> #include <klocale.h> #include <kstandarddirs.h> @@ -39,7 +39,7 @@ extern "C" { - KDE_EXPORT QObject* allocate_config( KConfig* conf, QWidget* parent ) + KDE_EXPORT TQObject* allocate_config( KConfig* conf, TQWidget* parent ) { return(new IceWMConfig(conf, parent)); } @@ -51,43 +51,43 @@ extern "C" // 'conf' is a pointer to the kwindecoration modules open kwin config, // and is by default set to the "Style" group. // -// 'parent' is the parent of the QObject, which is a VBox inside the +// 'parent' is the parent of the TQObject, which is a VBox inside the // Configure tab in kwindecoration // ========================================================================== -IceWMConfig::IceWMConfig( KConfig* conf, QWidget* parent ) - : QObject( parent ) +IceWMConfig::IceWMConfig( KConfig* conf, TQWidget* parent ) + : TQObject( parent ) { icewmConfig = new KConfig("kwinicewmrc"); KGlobal::locale()->insertCatalogue("kwin_art_clients"); - mainWidget = new QVBox( parent ); + mainWidget = new TQVBox( parent ); mainWidget->setSpacing( KDialog::spacingHint() ); - themeListBox = new QListBox( mainWidget ); - QWhatsThis::add( themeListBox, + themeListBox = new TQListBox( mainWidget ); + TQWhatsThis::add( themeListBox, i18n("Make your IceWM selection by clicking on a theme here. ") ); - cbThemeTitleTextColors = new QCheckBox( + cbThemeTitleTextColors = new TQCheckBox( i18n("Use theme &title text colors"), mainWidget ); - QWhatsThis::add( cbThemeTitleTextColors, + TQWhatsThis::add( cbThemeTitleTextColors, i18n("When selected, titlebar colors will follow those set " "in the IceWM theme. If not selected, the current KDE " "titlebar colors will be used instead.") ); - cbTitleBarOnTop = new QCheckBox( + cbTitleBarOnTop = new TQCheckBox( i18n("&Show title bar on top of windows"), mainWidget ); - QWhatsThis::add( cbTitleBarOnTop, + TQWhatsThis::add( cbTitleBarOnTop, i18n("When selected, all window titlebars will be shown " "at the top of each window, otherwise they will be " "shown at the bottom.") ); - cbShowMenuButtonIcon = new QCheckBox( + cbShowMenuButtonIcon = new TQCheckBox( i18n("&Menu button always shows application mini icon"), mainWidget ); - QWhatsThis::add( cbShowMenuButtonIcon, + TQWhatsThis::add( cbShowMenuButtonIcon, i18n("When selected, all titlebar menu buttons will have " "the application icon shown. If not selected, the current " "theme's defaults are used instead.") ); @@ -95,7 +95,7 @@ IceWMConfig::IceWMConfig( KConfig* conf, QWidget* parent ) urlLabel = new KURLLabel( mainWidget ); urlLabel->setText( i18n("Open KDE's IceWM theme folder") ); - themeLabel = new QLabel( + themeLabel = new TQLabel( i18n("Clicking on the link above will cause a window to appear " "showing the KDE IceWM theme folder. You can " "add or remove native IceWM themes by " @@ -107,36 +107,36 @@ IceWMConfig::IceWMConfig( KConfig* conf, QWidget* parent ) load( conf ); // Ensure we track user changes properly - connect( themeListBox, SIGNAL(selectionChanged()), - this, SLOT(slotSelectionChanged()) ); + connect( themeListBox, TQT_SIGNAL(selectionChanged()), + this, TQT_SLOT(slotSelectionChanged()) ); - connect( urlLabel, SIGNAL(leftClickedURL(const QString&)), - this, SLOT(callURL(const QString&))); + connect( urlLabel, TQT_SIGNAL(leftClickedURL(const TQString&)), + this, TQT_SLOT(callURL(const TQString&))); - connect( cbThemeTitleTextColors, SIGNAL(clicked()), - this, SLOT(slotSelectionChanged()) ); + connect( cbThemeTitleTextColors, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotSelectionChanged()) ); - connect( cbTitleBarOnTop, SIGNAL(clicked()), - this, SLOT(slotSelectionChanged()) ); + connect( cbTitleBarOnTop, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotSelectionChanged()) ); - connect( cbShowMenuButtonIcon, SIGNAL(clicked()), - this, SLOT(slotSelectionChanged()) ); + connect( cbShowMenuButtonIcon, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotSelectionChanged()) ); // Create the theme directory (if not found) ... and obtain the path as we do so. localThemeString = KGlobal::dirs()->saveLocation("data", "kwin"); localThemeString += "/icewm-themes"; - if (!QFile::exists(localThemeString)) - QDir().mkdir(localThemeString); + if (!TQFile::exists(localThemeString)) + TQDir().mkdir(localThemeString); // Watch the icewm theme directory for theme additions/removals KDirWatch::self()->addDir(localThemeString); - connect( KDirWatch::self(), SIGNAL(dirty(const QString&)), this, SLOT(findIceWMThemes()) ); - connect( KDirWatch::self(), SIGNAL(created(const QString&)), this, SLOT(findIceWMThemes()) ); - connect( KDirWatch::self(), SIGNAL(deleted(const QString&)), this, SLOT(findIceWMThemes()) ); + connect( KDirWatch::self(), TQT_SIGNAL(dirty(const TQString&)), this, TQT_SLOT(findIceWMThemes()) ); + connect( KDirWatch::self(), TQT_SIGNAL(created(const TQString&)), this, TQT_SLOT(findIceWMThemes()) ); + connect( KDirWatch::self(), TQT_SIGNAL(deleted(const TQString&)), this, TQT_SLOT(findIceWMThemes()) ); // Set the konqui link url - QString urlThemeString = QString("file://") + localThemeString; - urlThemeString.replace( QRegExp("~"), "$HOME" ); + TQString urlThemeString = TQString("file://") + localThemeString; + urlThemeString.replace( TQRegExp("~"), "$HOME" ); urlLabel->setURL( urlThemeString ); // Make the widgets visible in kwindecoration @@ -158,8 +158,8 @@ IceWMConfig::~IceWMConfig() // Searches for all installed IceWM themes, and adds them to the listBox. void IceWMConfig::findIceWMThemes() { - QStringList dirList = KGlobal::dirs()->findDirs("data", "kwin/icewm-themes"); - QStringList::ConstIterator it; + TQStringList dirList = KGlobal::dirs()->findDirs("data", "kwin/icewm-themes"); + TQStringList::ConstIterator it; // Remove any old themes in the list (if any) themeListBox->clear(); @@ -169,11 +169,11 @@ void IceWMConfig::findIceWMThemes() for( it = dirList.begin(); it != dirList.end(); it++) { // List all directory names only... - QDir d(*it, QString("*"), QDir::Unsorted, QDir::Dirs | QDir::Readable ); + TQDir d(*it, TQString("*"), TQDir::Unsorted, TQDir::Dirs | TQDir::Readable ); if (d.exists()) { QFileInfoListIterator it2( *d.entryInfoList() ); - QFileInfo* finfo; + TQFileInfo* finfo; // Step through all directories within the kwin/icewm-themes directory while( (finfo = it2.current()) ) @@ -197,7 +197,7 @@ void IceWMConfig::findIceWMThemes() themeListBox->sort(); // Select the currently used IceWM theme - QString themeName = icewmConfig->readEntry("CurrentTheme"); + TQString themeName = icewmConfig->readEntry("CurrentTheme"); // Provide a theme alias if (themeName == "default") @@ -211,7 +211,7 @@ void IceWMConfig::findIceWMThemes() } -void IceWMConfig::callURL( const QString& s ) +void IceWMConfig::callURL( const TQString& s ) { kapp->invokeBrowser( s ); } diff --git a/kwin-styles/icewm/config/config.h b/kwin-styles/icewm/config/config.h index e156137e..09c2fd8c 100644 --- a/kwin-styles/icewm/config/config.h +++ b/kwin-styles/icewm/config/config.h @@ -27,11 +27,11 @@ #ifndef _ICEWMCONFIG_H #define _ICEWMCONFIG_H -#include <qwidget.h> -#include <qcheckbox.h> -#include <qgroupbox.h> -#include <qlistbox.h> -#include <qlabel.h> +#include <tqwidget.h> +#include <tqcheckbox.h> +#include <tqgroupbox.h> +#include <tqlistbox.h> +#include <tqlabel.h> #include <kurllabel.h> #include <kconfig.h> @@ -42,7 +42,7 @@ class IceWMConfig: public QObject Q_OBJECT public: - IceWMConfig( KConfig* conf, QWidget* parent ); + IceWMConfig( KConfig* conf, TQWidget* parent ); ~IceWMConfig(); // These public signals/slots work similar to KCM modules @@ -56,19 +56,19 @@ class IceWMConfig: public QObject protected slots: void slotSelectionChanged(); // Internal use - void callURL( const QString& s ); + void callURL( const TQString& s ); void findIceWMThemes(); private: KConfig* icewmConfig; - QCheckBox* cbThemeTitleTextColors; - QCheckBox* cbTitleBarOnTop; - QCheckBox* cbShowMenuButtonIcon; - QListBox* themeListBox; - QLabel* themeLabel; + TQCheckBox* cbThemeTitleTextColors; + TQCheckBox* cbTitleBarOnTop; + TQCheckBox* cbShowMenuButtonIcon; + TQListBox* themeListBox; + TQLabel* themeLabel; KURLLabel* urlLabel; - QString localThemeString; - QVBox* mainWidget; + TQString localThemeString; + TQVBox* mainWidget; }; diff --git a/kwin-styles/icewm/icewm.cpp b/kwin-styles/icewm/icewm.cpp index e6108748..9b60219d 100644 --- a/kwin-styles/icewm/icewm.cpp +++ b/kwin-styles/icewm/icewm.cpp @@ -45,15 +45,15 @@ #include <kglobal.h> #include <klocale.h> #include <kdrawutil.h> -#include <qapplication.h> -#include <qlabel.h> -#include <qdrawutil.h> -#include <qdatetime.h> -#include <qbitmap.h> -#include <qcursor.h> -#include <qstring.h> -#include <qtooltip.h> -#include <qregexp.h> +#include <tqapplication.h> +#include <tqlabel.h> +#include <tqdrawutil.h> +#include <tqdatetime.h> +#include <tqbitmap.h> +#include <tqcursor.h> +#include <tqstring.h> +#include <tqtooltip.h> +#include <tqregexp.h> #include "icewm.h" namespace IceWM { @@ -63,52 +63,52 @@ namespace IceWM { //////////////////////////////////////////////////////////////////////////////////////////// // IceWM frame pixmaps -QPixmap* frameTL[] = {NULL, NULL}; -QPixmap* frameT [] = {NULL, NULL}; -QPixmap* frameTR[] = {NULL, NULL}; -QPixmap* frameL [] = {NULL, NULL}; -QPixmap* frameR [] = {NULL, NULL}; -QPixmap* frameBL[] = {NULL, NULL}; -QPixmap* frameB [] = {NULL, NULL}; -QPixmap* frameBR[] = {NULL, NULL}; +TQPixmap* frameTL[] = {NULL, NULL}; +TQPixmap* frameT [] = {NULL, NULL}; +TQPixmap* frameTR[] = {NULL, NULL}; +TQPixmap* frameL [] = {NULL, NULL}; +TQPixmap* frameR [] = {NULL, NULL}; +TQPixmap* frameBL[] = {NULL, NULL}; +TQPixmap* frameB [] = {NULL, NULL}; +TQPixmap* frameBR[] = {NULL, NULL}; // Button pixmaps -QPixmap* closePix[] = {NULL, NULL}; -QPixmap* depthPix[] = {NULL, NULL}; -QPixmap* maximizePix[] = {NULL, NULL}; -QPixmap* minimizePix[] = {NULL, NULL}; -QPixmap* restorePix[] = {NULL, NULL}; -QPixmap* hidePix[] = {NULL, NULL}; -QPixmap* rollupPix[] = {NULL, NULL}; -QPixmap* rolldownPix[] = {NULL, NULL}; -QPixmap* menuButtonPix[] = {NULL, NULL}; +TQPixmap* closePix[] = {NULL, NULL}; +TQPixmap* depthPix[] = {NULL, NULL}; +TQPixmap* maximizePix[] = {NULL, NULL}; +TQPixmap* minimizePix[] = {NULL, NULL}; +TQPixmap* restorePix[] = {NULL, NULL}; +TQPixmap* hidePix[] = {NULL, NULL}; +TQPixmap* rollupPix[] = {NULL, NULL}; +TQPixmap* rolldownPix[] = {NULL, NULL}; +TQPixmap* menuButtonPix[] = {NULL, NULL}; // Titlebar pixmaps -QPixmap* titleJ[] = {NULL, NULL}; -QPixmap* titleL[] = {NULL, NULL}; -QPixmap* titleS[] = {NULL, NULL}; -QPixmap* titleP[] = {NULL, NULL}; -QPixmap* titleT[] = {NULL, NULL}; -QPixmap* titleM[] = {NULL, NULL}; -QPixmap* titleB[] = {NULL, NULL}; -QPixmap* titleR[] = {NULL, NULL}; -QPixmap* titleQ[] = {NULL, NULL}; +TQPixmap* titleJ[] = {NULL, NULL}; +TQPixmap* titleL[] = {NULL, NULL}; +TQPixmap* titleS[] = {NULL, NULL}; +TQPixmap* titleP[] = {NULL, NULL}; +TQPixmap* titleT[] = {NULL, NULL}; +TQPixmap* titleM[] = {NULL, NULL}; +TQPixmap* titleB[] = {NULL, NULL}; +TQPixmap* titleR[] = {NULL, NULL}; +TQPixmap* titleQ[] = {NULL, NULL}; ThemeHandler* clientHandler; -QString* titleButtonsLeft; -QString* titleButtonsRight; +TQString* titleButtonsLeft; +TQString* titleButtonsRight; -QColor* colorActiveBorder; -QColor* colorInActiveBorder; -QColor* colorActiveButton; -QColor* colorInActiveButton; -QColor* colorActiveTitleBarText; -QColor* colorInActiveTitleBarText; -QColor* colorActiveTitleBar; -QColor* colorInActiveTitleBar; -QColor* colorActiveTitleTextShadow; -QColor* colorInActiveTitleTextShadow; +TQColor* colorActiveBorder; +TQColor* colorInActiveBorder; +TQColor* colorActiveButton; +TQColor* colorInActiveButton; +TQColor* colorActiveTitleBarText; +TQColor* colorInActiveTitleBarText; +TQColor* colorActiveTitleBar; +TQColor* colorInActiveTitleBar; +TQColor* colorActiveTitleTextShadow; +TQColor* colorInActiveTitleTextShadow; int cornerSizeX; int cornerSizeY; @@ -136,7 +136,7 @@ enum styles {OTHER, WARP3, WARP4, MOTIF, WIN95, NICE} themeLook; //////////////////////////////////////////////////////////////////////////////////////////// // Returns true if both active and inactive pixmaps are valid, and not null -bool validPixmaps( QPixmap* p[] ) +bool validPixmaps( TQPixmap* p[] ) { return ( p[Active] && ( !p[Active]->isNull() ) && p[InActive] && ( !p[InActive]->isNull() ) ); @@ -156,19 +156,19 @@ ThemeHandler::ThemeHandler() initialized = false; // Prevent having globals objects (use pointers to objects) - titleButtonsLeft = new QString(); - titleButtonsRight = new QString(); - - colorActiveBorder = new QColor(); - colorInActiveBorder = new QColor(); - colorActiveButton = new QColor(); - colorInActiveButton = new QColor(); - colorActiveTitleBarText = new QColor(); - colorInActiveTitleBarText = new QColor(); - colorActiveTitleBar = new QColor(); - colorInActiveTitleBar = new QColor(); - colorActiveTitleTextShadow = new QColor(); - colorInActiveTitleTextShadow = new QColor(); + titleButtonsLeft = new TQString(); + titleButtonsRight = new TQString(); + + colorActiveBorder = new TQColor(); + colorInActiveBorder = new TQColor(); + colorActiveButton = new TQColor(); + colorInActiveButton = new TQColor(); + colorActiveTitleBarText = new TQColor(); + colorInActiveTitleBarText = new TQColor(); + colorActiveTitleBar = new TQColor(); + colorInActiveTitleBar = new TQColor(); + colorActiveTitleTextShadow = new TQColor(); + colorInActiveTitleTextShadow = new TQColor(); // Initialize readConfig(); @@ -206,25 +206,25 @@ KDecoration* ThemeHandler::createDecoration( KDecorationBridge* bridge ) // Converts KDE style button strings to icewm style button strings -void ThemeHandler::convertButtons( QString& s ) +void ThemeHandler::convertButtons( TQString& s ) { - s.replace( QRegExp("_"), ""); // Spacer (ignored) - s.replace( QRegExp("H"), ""); // Help (ignored) - s.replace( QRegExp("M"), "s"); // Sysmenu - s.replace( QRegExp("S"), "d"); // Sticky/OnAllDesktops - s.replace( QRegExp("I"), "i"); // Minimize - s.replace( QRegExp("A"), "m"); // Maximize - s.replace( QRegExp("X"), "x"); // Close + s.replace( TQRegExp("_"), ""); // Spacer (ignored) + s.replace( TQRegExp("H"), ""); // Help (ignored) + s.replace( TQRegExp("M"), "s"); // Sysmenu + s.replace( TQRegExp("S"), "d"); // Sticky/OnAllDesktops + s.replace( TQRegExp("I"), "i"); // Minimize + s.replace( TQRegExp("A"), "m"); // Maximize + s.replace( TQRegExp("X"), "x"); // Close } // Reverses all characters in a QString -QString ThemeHandler::reverseString( QString s ) +TQString ThemeHandler::reverseString( TQString s ) { if (s.length() <= 1) return s; - QString tmpStr; + TQString tmpStr; for(int i = s.length()-1; i >= 0; i--) { tmpStr += s[(unsigned int)i]; @@ -271,8 +271,8 @@ void ThemeHandler::initTheme() // We use kconfig to read icewm config files... // this is easy since icewm uses key=value pairs! - KConfig config( locate("data", QString("kwin/icewm-themes/") + - themeName + QString("default.theme")) ); + KConfig config( locate("data", TQString("kwin/icewm-themes/") + + themeName + TQString("default.theme")) ); // Load specifics, or use IceWM defaults instead. borderSizeX = config.readNumEntry("BorderSizeX", 6); @@ -292,9 +292,9 @@ void ThemeHandler::initTheme() // Ignore on all desktops 'd' on the left buttons // (some themes look bad with it on by default) *titleButtonsLeft = config.readEntry("TitleButtonsLeft", "s"); - *titleButtonsLeft = titleButtonsLeft->replace( QRegExp(QString("\"")), ""); + *titleButtonsLeft = titleButtonsLeft->replace( TQRegExp(TQString("\"")), ""); *titleButtonsRight = config.readEntry("TitleButtonsRight", "xmir"); - *titleButtonsRight = titleButtonsRight->replace( QRegExp(QString("\"")), ""); + *titleButtonsRight = titleButtonsRight->replace( TQRegExp(TQString("\"")), ""); // I have no idea why the right side buttons in icewm are reversed *titleButtonsRight = reverseString( *titleButtonsRight ); @@ -302,7 +302,7 @@ void ThemeHandler::initTheme() // Read the default border and text colours from the config file // And use IceWM defaults if not found - QString s; + TQString s; s = config.readEntry("Look", "other"); if (s=="motif") themeLook = MOTIF; @@ -433,16 +433,16 @@ void ThemeHandler::initTheme() } -QPixmap* ThemeHandler::duplicateValidPixmap( bool act, int size ) +TQPixmap* ThemeHandler::duplicateValidPixmap( bool act, int size ) { - QPixmap* p1 = NULL; + TQPixmap* p1 = NULL; // Use the stretch or title pixmaps instead if ( titleS[act] ) - p1 = new QPixmap( *titleS[act] ); + p1 = new TQPixmap( *titleS[act] ); else if ( titleB[act] ) - p1 = new QPixmap( *titleB[act] ); + p1 = new TQPixmap( *titleB[act] ); else if ( titleT[act] ) - p1 = new QPixmap( *titleT[act] ); + p1 = new TQPixmap( *titleT[act] ); // Stretch if required if ( (size != -1) && p1 && (!p1->isNull()) ) @@ -487,7 +487,7 @@ void ThemeHandler::freePixmaps() // Frees a dynamic pixmap group from the heap. -void ThemeHandler::freePixmapGroup( QPixmap* p[] ) +void ThemeHandler::freePixmapGroup( TQPixmap* p[] ) { if (p) { @@ -496,35 +496,35 @@ void ThemeHandler::freePixmapGroup( QPixmap* p[] ) p[Active] = NULL; p[InActive] = NULL; } else - qWarning("kwin-icewm: freePixmapGroup - invalid QPixmap** 'p'\n"); + qWarning("kwin-icewm: freePixmapGroup - invalid TQPixmap** 'p'\n"); } // Converts icewm colors #C0C0C0 or rgb:C0/C0/C0 to QColors -QColor ThemeHandler::decodeColor( QString& s ) +TQColor ThemeHandler::decodeColor( TQString& s ) { // Make rgb:C0/C0/C0, or #C0/C0/C0 -> C0C0C0 - s.replace( QRegExp("r"), ""); - s.replace( QRegExp("g"), ""); - s.replace( QRegExp("b"), ""); - s.replace( QRegExp("#"), ""); - s.replace( QRegExp("/"), ""); - s.replace( QRegExp(":"), ""); - s.replace( QRegExp("\\"), ""); - s.replace( QRegExp("\""), ""); + s.replace( TQRegExp("r"), ""); + s.replace( TQRegExp("g"), ""); + s.replace( TQRegExp("b"), ""); + s.replace( TQRegExp("#"), ""); + s.replace( TQRegExp("/"), ""); + s.replace( TQRegExp(":"), ""); + s.replace( TQRegExp("\\"), ""); + s.replace( TQRegExp("\""), ""); // Wierd error - return grey if (s.length() != 6) - return QColor( 0xC0, 0xC0, 0xC0 ); + return TQColor( 0xC0, 0xC0, 0xC0 ); // Qt makes this conversion very easy - return QColor( QString("#") + s ); + return TQColor( TQString("#") + s ); } // Stretches tiny pixmaps vertically or horizontally, taking into account // repetition in patterns, so as not to make them mismatched -QPixmap* ThemeHandler::stretchPixmap( QPixmap* src, bool stretchHoriz, int stretchSize ) +TQPixmap* ThemeHandler::stretchPixmap( TQPixmap* src, bool stretchHoriz, int stretchSize ) { if (!src) return NULL; if (src->isNull()) return NULL; @@ -549,13 +549,13 @@ QPixmap* ThemeHandler::stretchPixmap( QPixmap* src, bool stretchHoriz, int stret } else size = stretchSize; - QPixmap* p = new QPixmap(); + TQPixmap* p = new TQPixmap(); if ( stretchHoriz ) p->resize( size, src->height() ); else p->resize( src->width(), size ); - QPainter pnt( p ); + TQPainter pnt( p ); if ( stretchHoriz ) pnt.drawTiledPixmap( 0, 0, size, src->height(), *src); else @@ -566,9 +566,9 @@ QPixmap* ThemeHandler::stretchPixmap( QPixmap* src, bool stretchHoriz, int stret return p; } -static void draw3DRect(QPainter &pnt, QColor &col, int x, int y, int w, int h, bool up) { - QColor light = col.light(135); - QColor dark = col.dark(140); +static void draw3DRect(TQPainter &pnt, TQColor &col, int x, int y, int w, int h, bool up) { + TQColor light = col.light(135); + TQColor dark = col.dark(140); pnt.setPen(up ? light : dark); pnt.drawLine(x, y, x+w, y); pnt.drawLine(x, y, x, y+h); @@ -580,30 +580,30 @@ static void draw3DRect(QPainter &pnt, QColor &col, int x, int y, int w, int h, b pnt.drawPoint(x, y+h); } -void ThemeHandler::setPixmapButton( QPixmap* p[], QString s1, QString s2) +void ThemeHandler::setPixmapButton( TQPixmap* p[], TQString s1, TQString s2) { if ( p[Active] ) qWarning("kwin-icewm: setPixmap - should be null (1)\n"); if ( p[InActive] ) qWarning("kwin-icewm: setPixmap - should be null (2)\n"); - QString str = locate("appdata", QString("icewm-themes/") + TQString str = locate("appdata", TQString("icewm-themes/") + themeName + s1 + "A" + s2); if (str.isEmpty()) - str = locate("appdata", QString("icewm-themes/") + str = locate("appdata", TQString("icewm-themes/") + themeName + s1 + s2); - QPixmap *qp = new QPixmap(str); - QColor cActive = themeLook == WIN95 ? *colorActiveTitleBar : *colorActiveButton; - QColor cInActive = themeLook == WIN95 ? *colorInActiveTitleBar : *colorInActiveButton; + TQPixmap *qp = new TQPixmap(str); + TQColor cActive = themeLook == WIN95 ? *colorActiveTitleBar : *colorActiveButton; + TQColor cInActive = themeLook == WIN95 ? *colorInActiveTitleBar : *colorInActiveButton; if (!qp->isNull() && themeLook > 0) { int w = qp->width(); if (themeLook > 0 && titleBarHeight > w) w = titleBarHeight; - p[Active] = new QPixmap(w, 2*titleBarHeight ); + p[Active] = new TQPixmap(w, 2*titleBarHeight ); p[Active] -> fill(cActive); - QPainter pnt( p[Active] ); + TQPainter pnt( p[Active] ); int offX = (w - qp->width())/2; int offY = (titleBarHeight - qp->height())/2; @@ -631,20 +631,20 @@ void ThemeHandler::setPixmapButton( QPixmap* p[], QString s1, QString s2) p[Active] = qp; } - str = locate("appdata", QString("icewm-themes/") + str = locate("appdata", TQString("icewm-themes/") + themeName + s1 + "I" + s2); if (str.isEmpty()) - str = locate("appdata", QString("icewm-themes/") + str = locate("appdata", TQString("icewm-themes/") + themeName + s1 + s2); - qp = new QPixmap(str); + qp = new TQPixmap(str); if (!qp->isNull() && themeLook > 0) { int w = qp->width(); if (titleBarHeight > w) w = titleBarHeight; - p[InActive] = new QPixmap(w, 2*titleBarHeight ); + p[InActive] = new TQPixmap(w, 2*titleBarHeight ); p[InActive] -> fill(cInActive); - QPainter pnt( p[InActive] ); + TQPainter pnt( p[InActive] ); int offX = (w - qp->width())/2; int offY = (titleBarHeight - qp->height())/2; @@ -678,7 +678,7 @@ void ThemeHandler::setPixmapButton( QPixmap* p[], QString s1, QString s2) // Loads the specified Active/InActive files into the specific pixmaps, and // can perform horizontal / vertical stretching if required for speed. // Tries to implement some icewm specific pixmap handling for some dodgy themes -void ThemeHandler::setPixmap( QPixmap* p[], QString s1, QString s2, +void ThemeHandler::setPixmap( TQPixmap* p[], TQString s1, TQString s2, bool stretch, bool stretchHoriz ) { if ( p[Active] ) @@ -686,9 +686,9 @@ void ThemeHandler::setPixmap( QPixmap* p[], QString s1, QString s2, if ( p[InActive] ) qWarning("kwin-icewm: setPixmap - should be null (2)\n"); - p[Active] = new QPixmap( locate("data", QString("kwin/icewm-themes/") + p[Active] = new TQPixmap( locate("data", TQString("kwin/icewm-themes/") + themeName + s1 + "A" + s2) ); - p[InActive] = new QPixmap( locate("data", QString("kwin/icewm-themes/") + p[InActive] = new TQPixmap( locate("data", TQString("kwin/icewm-themes/") + themeName + s1 + "I" + s2) ); // Stretch the pixmap if requested. @@ -761,15 +761,15 @@ bool ThemeHandler::supports( Ability ability ) // IceWM button class //////////////////////////////////////////////////////////////////////////////////////////// -IceWMButton::IceWMButton(IceWMClient *parent, const char *name, QPixmap* (*p)[2], - bool isToggle, const QString& tip, const int realizeBtns ) - : QButton(parent->widget(), name) +IceWMButton::IceWMButton(IceWMClient *parent, const char *name, TQPixmap* (*p)[2], + bool isToggle, const TQString& tip, const int realizeBtns ) + : TQButton(parent->widget(), name) { m_realizeButtons = realizeBtns; setTipText(tip); setCursor(ArrowCursor); // Eliminate any possible background flicker - setBackgroundMode( QWidget::NoBackground ); + setBackgroundMode( TQWidget::NoBackground ); client = parent; usePixmap( p ); setFixedSize( sizeHint() ); @@ -777,27 +777,27 @@ IceWMButton::IceWMButton(IceWMClient *parent, const char *name, QPixmap* (*p)[2] } -void IceWMButton::setTipText(const QString &tip) { +void IceWMButton::setTipText(const TQString &tip) { if(KDecoration::options()->showTooltips()) { - QToolTip::remove(this ); - QToolTip::add(this, tip ); + TQToolTip::remove(this ); + TQToolTip::add(this, tip ); } } -QSize IceWMButton::sizeHint() const +TQSize IceWMButton::sizeHint() const { // Check for invalid data - if ( validPixmaps( (QPixmap**) (*pix) ) ) // Cast to avoid dumb warning + if ( validPixmaps( (TQPixmap**) (*pix) ) ) // Cast to avoid dumb warning { - QPixmap* p = (*pix)[ client->isActive() ? Active : InActive ]; - return( QSize(p->width(), titleBarHeight) ); + TQPixmap* p = (*pix)[ client->isActive() ? Active : InActive ]; + return( TQSize(p->width(), titleBarHeight) ); } else - return( QSize(0, 0) ); + return( TQSize(0, 0) ); } -void IceWMButton::usePixmap( QPixmap* (*p)[2] ) +void IceWMButton::usePixmap( TQPixmap* (*p)[2] ) { if (validPixmaps( *p )) { pix = p; @@ -808,11 +808,11 @@ void IceWMButton::usePixmap( QPixmap* (*p)[2] ) } -void IceWMButton::drawButton(QPainter *pnt) +void IceWMButton::drawButton(TQPainter *pnt) { if ( pix && validPixmaps(*pix) ) { - QPixmap* p = (*pix)[ client->isActive() ? Active : InActive ]; + TQPixmap* p = (*pix)[ client->isActive() ? Active : InActive ]; if( p && (!p->isNull()) ) { @@ -836,21 +836,21 @@ void IceWMButton::turnOn( bool isOn ) } -void IceWMButton::mousePressEvent( QMouseEvent* e ) +void IceWMButton::mousePressEvent( TQMouseEvent* e ) { last_button = e->button(); - QMouseEvent me ( e->type(), e->pos(), e->globalPos(), + TQMouseEvent me ( e->type(), e->pos(), e->globalPos(), (e->button()&m_realizeButtons)?LeftButton:NoButton, e->state() ); - QButton::mousePressEvent( &me ); + TQButton::mousePressEvent( &me ); } -void IceWMButton::mouseReleaseEvent( QMouseEvent* e ) +void IceWMButton::mouseReleaseEvent( TQMouseEvent* e ) { last_button = e->button(); - QMouseEvent me ( e->type(), e->pos(), e->globalPos(), + TQMouseEvent me ( e->type(), e->pos(), e->globalPos(), (e->button()&m_realizeButtons)?LeftButton:NoButton, e->state() ); - QButton::mouseReleaseEvent( &me ); + TQButton::mouseReleaseEvent( &me ); } @@ -893,26 +893,26 @@ void IceWMClient::init() widget()->setBackgroundMode( NoBackground ); // Pack the windowWrapper() window within a grid layout - grid = new QGridLayout(widget(), 0, 0, 0); - grid->setResizeMode(QLayout::FreeResize); + grid = new TQGridLayout(widget(), 0, 0, 0); + grid->setResizeMode(TQLayout::FreeResize); grid->addRowSpacing(0, borderSizeY); // Top grab bar // Do something IceWM can't do :) if (titleBarOnTop) { if( isPreview()) - grid->addWidget( new QLabel( i18n( "<center><b>IceWM preview</b></center>" ), widget() ), 2, 1); + grid->addWidget( new TQLabel( i18n( "<center><b>IceWM preview</b></center>" ), widget() ), 2, 1); else - grid->addItem( new QSpacerItem( 0, 0 ), 2, 1); + grid->addItem( new TQSpacerItem( 0, 0 ), 2, 1); // no shade flicker - grid->addItem( new QSpacerItem( 0, 0, QSizePolicy::Fixed, QSizePolicy::Expanding ) ); + grid->addItem( new TQSpacerItem( 0, 0, TQSizePolicy::Fixed, TQSizePolicy::Expanding ) ); } else { // no shade flicker - grid->addItem( new QSpacerItem( 0, 0, QSizePolicy::Fixed, QSizePolicy::Expanding ) ); + grid->addItem( new TQSpacerItem( 0, 0, TQSizePolicy::Fixed, TQSizePolicy::Expanding ) ); if( isPreview()) - grid->addWidget( new QLabel( i18n( "<center><b>IceWM preview</b></center>" ), widget() ), 1, 1); + grid->addWidget( new TQLabel( i18n( "<center><b>IceWM preview</b></center>" ), widget() ), 1, 1); else - grid->addItem( new QSpacerItem( 0, 0 ), 1, 1); + grid->addItem( new TQSpacerItem( 0, 0 ), 1, 1); } grid->setRowStretch(1, 10); @@ -923,8 +923,8 @@ void IceWMClient::init() grid->addColSpacing(2, borderSizeX); // Pack the titlebar with spacers and buttons - hb = new QBoxLayout(0, QBoxLayout::LeftToRight, 0, 0, 0); - hb->setResizeMode( QLayout::FreeResize ); + hb = new TQBoxLayout(0, TQBoxLayout::LeftToRight, 0, 0, 0); + hb->setResizeMode( TQLayout::FreeResize ); titleSpacerJ = addPixmapSpacer( titleJ ); @@ -932,17 +932,17 @@ void IceWMClient::init() titleSpacerL = addPixmapSpacer( titleL ); // Centre titlebar if required. - QSizePolicy::SizeType spTitleBar; - spTitleBar = titleBarCentered ? QSizePolicy::Expanding : QSizePolicy::Maximum; + TQSizePolicy::SizeType spTitleBar; + spTitleBar = titleBarCentered ? TQSizePolicy::Expanding : TQSizePolicy::Maximum; titleSpacerS = addPixmapSpacer( titleS, spTitleBar, 1 ); titleSpacerP = addPixmapSpacer( titleP ); - titlebar = new QSpacerItem( titleTextWidth(caption()), titleBarHeight, - QSizePolicy::Preferred, QSizePolicy::Fixed ); + titlebar = new TQSpacerItem( titleTextWidth(caption()), titleBarHeight, + TQSizePolicy::Preferred, TQSizePolicy::Fixed ); hb->addItem(titlebar); titleSpacerM = addPixmapSpacer( titleM ); - titleSpacerB = addPixmapSpacer( titleB, QSizePolicy::Expanding, 1 ); + titleSpacerB = addPixmapSpacer( titleB, TQSizePolicy::Expanding, 1 ); titleSpacerR = addPixmapSpacer( titleR ); addClientButtons( *titleButtonsRight ); @@ -958,7 +958,7 @@ void IceWMClient::init() // Adds the buttons to the hbox layout as per the buttons specified // in the button string 's' -void IceWMClient::addClientButtons( const QString& s ) +void IceWMClient::addClientButtons( const TQString& s ) { if (!s.isEmpty()) for(unsigned int i = 0; i < s.length(); i++) @@ -979,10 +979,10 @@ void IceWMClient::addClientButtons( const QString& s ) button[BtnSysMenu] = new IceWMButton(this, "menu", &menuButtonPix, false, i18n("Menu")); - connect( button[BtnSysMenu], SIGNAL(pressed()), - this, SLOT(menuButtonPressed())); - connect( button[BtnSysMenu], SIGNAL(released()), - this, SLOT(menuButtonReleased())); + connect( button[BtnSysMenu], TQT_SIGNAL(pressed()), + this, TQT_SLOT(menuButtonPressed())); + connect( button[BtnSysMenu], TQT_SIGNAL(released()), + this, TQT_SLOT(menuButtonReleased())); hb->addWidget( button[BtnSysMenu] ); } break; @@ -993,8 +993,8 @@ void IceWMClient::addClientButtons( const QString& s ) button[BtnClose] = new IceWMButton(this, "close", &closePix, false, i18n("Close")); hb->addWidget( button[BtnClose] ); - connect( button[BtnClose], SIGNAL(clicked()), - this, SLOT(closeWindow())); + connect( button[BtnClose], TQT_SIGNAL(clicked()), + this, TQT_SLOT(closeWindow())); } break; @@ -1004,8 +1004,8 @@ void IceWMClient::addClientButtons( const QString& s ) button[BtnMaximize] = new IceWMButton(this, "maximize", &maximizePix, false, i18n("Maximize"), LeftButton|MidButton|RightButton); hb->addWidget( button[BtnMaximize] ); - connect( button[BtnMaximize], SIGNAL(clicked()), - this, SLOT(slotMaximize())); + connect( button[BtnMaximize], TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotMaximize())); } break; @@ -1016,8 +1016,8 @@ void IceWMClient::addClientButtons( const QString& s ) button[BtnMinimize] = new IceWMButton(this, "minimize", &minimizePix, false, i18n("Minimize")); hb->addWidget( button[BtnMinimize] ); - connect( button[BtnMinimize], SIGNAL(clicked()), - this, SLOT(minimize())); + connect( button[BtnMinimize], TQT_SIGNAL(clicked()), + this, TQT_SLOT(minimize())); } break; @@ -1035,8 +1035,8 @@ void IceWMClient::addClientButtons( const QString& s ) isSetShade() ? &rolldownPix : &rollupPix, false, i18n("Rollup")); hb->addWidget( button[BtnRollup] ); - connect( button[BtnRollup], SIGNAL(clicked()), - this, SLOT(toggleShade())); + connect( button[BtnRollup], TQT_SIGNAL(clicked()), + this, TQT_SLOT(toggleShade())); } break; @@ -1048,8 +1048,8 @@ void IceWMClient::addClientButtons( const QString& s ) &depthPix, true, isOnAllDesktops()?i18n("Not on all desktops"):i18n("On all desktops")); button[BtnDepth]->turnOn( isOnAllDesktops() ); hb->addWidget( button[BtnDepth] ); - connect( button[BtnDepth], SIGNAL(clicked()), - this, SLOT(toggleOnAllDesktops())); + connect( button[BtnDepth], TQT_SIGNAL(clicked()), + this, TQT_SLOT(toggleOnAllDesktops())); } break; } @@ -1058,18 +1058,18 @@ void IceWMClient::addClientButtons( const QString& s ) // Adds a pixmap to the titlebar layout via the use of a nice QSpacerItem -QSpacerItem* IceWMClient::addPixmapSpacer( QPixmap* p[], QSizePolicy::SizeType s, int hsize ) +TQSpacerItem* IceWMClient::addPixmapSpacer( TQPixmap* p[], TQSizePolicy::SizeType s, int hsize ) { - QSpacerItem* sp; + TQSpacerItem* sp; // Add a null spacer for zero image if ( p && p[Active] ) { int w = (hsize == -1) ? p[Active]->width(): hsize; - sp = new QSpacerItem( w, titleBarHeight, s, QSizePolicy::Fixed ); + sp = new TQSpacerItem( w, titleBarHeight, s, TQSizePolicy::Fixed ); } else - sp = new QSpacerItem(0, 0, QSizePolicy::Maximum, QSizePolicy::Fixed ); + sp = new TQSpacerItem(0, 0, TQSizePolicy::Maximum, TQSizePolicy::Fixed ); hb->addItem( sp ); return sp; @@ -1078,7 +1078,7 @@ QSpacerItem* IceWMClient::addPixmapSpacer( QPixmap* p[], QSizePolicy::SizeType s void IceWMClient::renderMenuIcons() { - QPixmap miniIcon( icon().pixmap( QIconSet::Small, QIconSet::Normal) ); + TQPixmap miniIcon( icon().pixmap( TQIconSet::Small, TQIconSet::Normal) ); if (!miniIcon.isNull()) for(int i = 0; i < 2; i++) { @@ -1090,12 +1090,12 @@ void IceWMClient::renderMenuIcons() int w = titleBarHeight; if (validPixmaps(menuButtonPix) && menuButtonPix[i]->width() > w) w = menuButtonPix[i]->width(); - menuButtonWithIconPix[i] = new QPixmap(w, 2*titleBarHeight ); + menuButtonWithIconPix[i] = new TQPixmap(w, 2*titleBarHeight ); if (themeLook != WIN95) menuButtonWithIconPix[i] -> fill((i==0) ? *colorInActiveButton : *colorActiveButton); else menuButtonWithIconPix[i] -> fill((i==0) ? *colorInActiveTitleBar : *colorActiveTitleBar); - QPainter pnt( menuButtonWithIconPix[i] ); + TQPainter pnt( menuButtonWithIconPix[i] ); if (themeLook > 0 && themeLook != WIN95 && themeLook != WARP4) { draw3DRect(pnt, *colorActiveButton, 0, 0, @@ -1127,11 +1127,11 @@ void IceWMClient::toggleShade() setShade(!isSetShade()); } -int IceWMClient::titleTextWidth( const QString& s ) +int IceWMClient::titleTextWidth( const TQString& s ) { // Obtains the actual width of the text, using the titlebar font - QSize size; - QFontMetrics fm( options()->font(true) ); + TQSize size; + TQFontMetrics fm( options()->font(true) ); size = fm.size( 0, s ); return size.width(); } @@ -1151,20 +1151,20 @@ void IceWMClient::borders(int& left, int& right, int& top, int& bottom) const } -void IceWMClient::resize( const QSize& s ) +void IceWMClient::resize( const TQSize& s ) { widget()->resize( s ); } -QSize IceWMClient::minimumSize() const +TQSize IceWMClient::minimumSize() const { return widget()->minimumSize(); } // Repaint nicely upon resize to minimise flicker. -void IceWMClient::resizeEvent( QResizeEvent* e ) +void IceWMClient::resizeEvent( TQResizeEvent* e ) { calcHiddenButtons(); @@ -1186,8 +1186,8 @@ void IceWMClient::resizeEvent( QResizeEvent* e ) if ( dx ) { widget()->update( width() - dx + 1, 0, dx, height() ); - widget()->update( QRect( QPoint(4,4), titlebar->geometry().bottomLeft() - QPoint(1,0) ) ); - widget()->update( QRect( titlebar->geometry().topRight(), QPoint( width() - 4, titlebar->geometry().bottom() ) ) ); + widget()->update( TQRect( TQPoint(4,4), titlebar->geometry().bottomLeft() - TQPoint(1,0) ) ); + widget()->update( TQRect( titlebar->geometry().topRight(), TQPoint( width() - 4, titlebar->geometry().bottom() ) ) ); widget()->repaint(titlebar->geometry(), false); } } @@ -1195,14 +1195,14 @@ void IceWMClient::resizeEvent( QResizeEvent* e ) // IceWM Paint magic goes here. -void IceWMClient::paintEvent( QPaintEvent* ) +void IceWMClient::paintEvent( TQPaintEvent* ) { - QColor colorTitleShadow; - QColor colorTitle; - QColor c1; + TQColor colorTitleShadow; + TQColor colorTitle; + TQColor c1; int rx, rw; - QPainter p( widget() ); + TQPainter p( widget() ); int act = isActive() ? Active: InActive; // Determine titlebar shadow colors @@ -1216,7 +1216,7 @@ void IceWMClient::paintEvent( QPaintEvent* ) colorTitle = options()->color(ColorFont, isActive()); // Obtain widget bounds. - QRect r; + TQRect r; r = widget()->rect(); int fillWidth = r.width() - 2*borderSizeX; int y = r.y(); @@ -1373,8 +1373,8 @@ void IceWMClient::paintEvent( QPaintEvent* ) // Draw the title elements, if we need to draw a titlebar. if (titleBarHeight > 0) { - QPixmap* titleBuffer = new QPixmap( width()-(2*borderSizeX), titleBarHeight ); - QPainter p2( titleBuffer, this ); + TQPixmap* titleBuffer = new TQPixmap( width()-(2*borderSizeX), titleBarHeight ); + TQPainter p2( titleBuffer, this ); titleBuffer->fill( act ? *colorActiveTitleBar : *colorInActiveTitleBar ); r = titleSpacerJ->geometry(); @@ -1439,24 +1439,24 @@ void IceWMClient::paintEvent( QPaintEvent* ) } -void IceWMClient::showEvent(QShowEvent *ev) +void IceWMClient::showEvent(TQShowEvent *ev) { calcHiddenButtons(); titlebar->changeSize( titleTextWidth(caption()), titleBarHeight, - QSizePolicy::Preferred, QSizePolicy::Fixed ); + TQSizePolicy::Preferred, TQSizePolicy::Fixed ); grid->activate(); widget()->show(); IceWMClient::showEvent(ev); } -void IceWMClient::mouseDoubleClickEvent( QMouseEvent * e ) +void IceWMClient::mouseDoubleClickEvent( TQMouseEvent * e ) { if( e->button() != LeftButton ) return; - QRect r; + TQRect r; if (titleBarOnTop) r.setRect( borderSizeX, borderSizeY, width()-(2*borderSizeX), titleBarHeight); else @@ -1469,9 +1469,9 @@ void IceWMClient::mouseDoubleClickEvent( QMouseEvent * e ) } -void IceWMClient::wheelEvent(QWheelEvent *e) +void IceWMClient::wheelEvent(TQWheelEvent *e) { - if (isSetShade() || QRect( 0, 0, width(), titleBarHeight ).contains( e->pos() ) ) + if (isSetShade() || TQRect( 0, 0, width(), titleBarHeight ).contains( e->pos() ) ) titlebarMouseWheelOperation( e->delta()); } @@ -1506,10 +1506,10 @@ void IceWMClient::desktopChange() // Please don't modify the following unless you want layout problems void IceWMClient::captionChange() { - QRect r( 0, borderSizeY, geometry().width(), titleBarHeight); + TQRect r( 0, borderSizeY, geometry().width(), titleBarHeight); titlebar->changeSize( titleTextWidth( caption() ), titleBarHeight, - QSizePolicy::Preferred, QSizePolicy::Fixed ); + TQSizePolicy::Preferred, TQSizePolicy::Fixed ); titlebar->invalidate(); grid->activate(); widget()->repaint( r, false ); @@ -1592,7 +1592,7 @@ void IceWMClient::calcHiddenButtons() // Mouse position code modified from that in workspace.cpp -IceWMClient::Position IceWMClient::mousePosition( const QPoint& p ) const +IceWMClient::Position IceWMClient::mousePosition( const TQPoint& p ) const { int rangeX = cornerSizeX; int rangeY = cornerSizeY; @@ -1629,9 +1629,9 @@ IceWMClient::Position IceWMClient::mousePosition( const QPoint& p ) const void IceWMClient::menuButtonPressed() { - static QTime t; + static TQTime t; static IceWMClient* lastClient = NULL; - bool dbl = ( lastClient == this && t.elapsed() <= QApplication::doubleClickInterval()); + bool dbl = ( lastClient == this && t.elapsed() <= TQApplication::doubleClickInterval()); lastClient = this; t.start(); @@ -1641,7 +1641,7 @@ void IceWMClient::menuButtonPressed() return; } - QPoint menuPoint ( button[BtnSysMenu]->rect().bottomLeft() ); + TQPoint menuPoint ( button[BtnSysMenu]->rect().bottomLeft() ); // Move to right if menu on rhs, otherwise on left // and make this depend on windowWrapper(), not button. @@ -1659,26 +1659,26 @@ void IceWMClient::menuButtonReleased() closeWindow(); } -bool IceWMClient::eventFilter( QObject* o, QEvent* e ) +bool IceWMClient::eventFilter( TQObject* o, TQEvent* e ) { if( o != widget()) return false; switch( e->type()) { - case QEvent::Resize: - resizeEvent(static_cast< QResizeEvent* >( e ) ); + case TQEvent::Resize: + resizeEvent(static_cast< TQResizeEvent* >( e ) ); return true; - case QEvent::Paint: - paintEvent(static_cast< QPaintEvent* >( e ) ); + case TQEvent::Paint: + paintEvent(static_cast< TQPaintEvent* >( e ) ); return true; - case QEvent::MouseButtonDblClick: - mouseDoubleClickEvent(static_cast< QMouseEvent* >( e ) ); + case TQEvent::MouseButtonDblClick: + mouseDoubleClickEvent(static_cast< TQMouseEvent* >( e ) ); return true; - case QEvent::MouseButtonPress: - processMousePressEvent(static_cast< QMouseEvent* >( e ) ); + case TQEvent::MouseButtonPress: + processMousePressEvent(static_cast< TQMouseEvent* >( e ) ); return true; - case QEvent::Wheel: - wheelEvent( static_cast< QWheelEvent* >( e )); + case TQEvent::Wheel: + wheelEvent( static_cast< TQWheelEvent* >( e )); return true; default: break; diff --git a/kwin-styles/icewm/icewm.h b/kwin-styles/icewm/icewm.h index 656f3426..8bfef4f6 100644 --- a/kwin-styles/icewm/icewm.h +++ b/kwin-styles/icewm/icewm.h @@ -42,12 +42,12 @@ #ifndef __KDEGALLIUM_ICEWM_H #define __KDEGALLIUM_ICEWM_H -#include <qbutton.h> -#include <qlayout.h> +#include <tqbutton.h> +#include <tqlayout.h> #include <kpixmap.h> #include <kdecoration.h> #include <kdecorationfactory.h> -#include <qbutton.h> +#include <tqbutton.h> class QLabel; class QSpacerItem; class QBoxLayout; @@ -77,22 +77,22 @@ class ThemeHandler: public KDecorationFactory private: bool initialized; - QString themeName; + TQString themeName; void readConfig(); - QColor decodeColor( QString& s ); + TQColor decodeColor( TQString& s ); bool isFrameValid(); void initTheme(); void freePixmaps(); - void freePixmapGroup( QPixmap* p[] ); - void setPixmap( QPixmap* p[], QString s1, QString s2, bool + void freePixmapGroup( TQPixmap* p[] ); + void setPixmap( TQPixmap* p[], TQString s1, TQString s2, bool stretch=false, bool stretchHoriz=true ); - void setPixmapButton( QPixmap* p[], QString s1, QString s2); - QPixmap* stretchPixmap( QPixmap* src, bool stretchHoriz=true, + void setPixmapButton( TQPixmap* p[], TQString s1, TQString s2); + TQPixmap* stretchPixmap( TQPixmap* src, bool stretchHoriz=true, int stretchSize=-1); - QPixmap* duplicateValidPixmap( bool act, int size = -1 ); - void convertButtons( QString& s ); - QString reverseString( QString s ); + TQPixmap* duplicateValidPixmap( bool act, int size = -1 ); + void convertButtons( TQString& s ); + TQString reverseString( TQString s ); }; @@ -100,25 +100,25 @@ class IceWMButton : public QButton { public: IceWMButton( IceWMClient *parent=0, const char *name=0, - QPixmap* (*p)[2]=0L, bool isToggle=false, - const QString& tip=NULL, const int realizeBtns = LeftButton ); - void setTipText(const QString &tip); - void usePixmap( QPixmap* (*p)[2] ); - QSize sizeHint() const; + TQPixmap* (*p)[2]=0L, bool isToggle=false, + const TQString& tip=NULL, const int realizeBtns = LeftButton ); + void setTipText(const TQString &tip); + void usePixmap( TQPixmap* (*p)[2] ); + TQSize sizeHint() const; void turnOn( bool isOn ); ButtonState last_button; protected: - void mousePressEvent( QMouseEvent* e ); - void mouseReleaseEvent( QMouseEvent* e ); + void mousePressEvent( TQMouseEvent* e ); + void mouseReleaseEvent( TQMouseEvent* e ); - void drawButton( QPainter *p ); - void drawButtonLabel( QPainter * ) {;} + void drawButton( TQPainter *p ); + void drawButtonLabel( TQPainter * ) {;} private: int m_realizeButtons; IceWMClient* client; - QPixmap* (*pix)[2]; // Points to active/inactive pixmap array + TQPixmap* (*pix)[2]; // Points to active/inactive pixmap array }; @@ -130,26 +130,26 @@ class IceWMClient : public KDecoration ~IceWMClient(); virtual void init(); - virtual void resize(const QSize&); - virtual bool eventFilter( QObject* o, QEvent* e ); + virtual void resize(const TQSize&); + virtual bool eventFilter( TQObject* o, TQEvent* e ); protected: - void resizeEvent( QResizeEvent* ); - void paintEvent( QPaintEvent* ); - void showEvent( QShowEvent* ); - void mouseDoubleClickEvent( QMouseEvent * ); - void wheelEvent( QWheelEvent * ); + void resizeEvent( TQResizeEvent* ); + void paintEvent( TQPaintEvent* ); + void showEvent( TQShowEvent* ); + void mouseDoubleClickEvent( TQMouseEvent * ); + void wheelEvent( TQWheelEvent * ); virtual void captionChange(); virtual void maximizeChange(); virtual void shadeChange(); virtual void activeChange(); // void shadeChange(bool); /* KWin Client class doesn't provide this yet */ - Position mousePosition( const QPoint& ) const; + Position mousePosition( const TQPoint& ) const; void renderMenuIcons(); void iconChange(); virtual void desktopChange( ); virtual void borders(int&, int&, int&, int&) const; - virtual QSize minimumSize() const; + virtual TQSize minimumSize() const; protected slots: void slotMaximize(); @@ -162,26 +162,26 @@ class IceWMClient : public KDecoration enum Buttons{ BtnSysMenu=0, BtnClose, BtnMaximize, BtnMinimize, BtnHide, BtnRollup, BtnDepth, BtnCount }; - QString shortenCaption( const QString* s ); + TQString shortenCaption( const TQString* s ); void calcHiddenButtons(); - int titleTextWidth( const QString& s ); - void addClientButtons( const QString& s ); - QSpacerItem* addPixmapSpacer( QPixmap* p[], - QSizePolicy::SizeType = QSizePolicy::Maximum, int hsize = -1 ); + int titleTextWidth( const TQString& s ); + void addClientButtons( const TQString& s ); + TQSpacerItem* addPixmapSpacer( TQPixmap* p[], + TQSizePolicy::SizeType = TQSizePolicy::Maximum, int hsize = -1 ); IceWMButton* button[ IceWMClient::BtnCount ]; - QPixmap* menuButtonWithIconPix[2]; - QSpacerItem* titleSpacerJ; - QSpacerItem* titleSpacerL; - QSpacerItem* titleSpacerS; - QSpacerItem* titleSpacerP; - QSpacerItem* titlebar; - QSpacerItem* titleSpacerM; - QSpacerItem* titleSpacerB; - QSpacerItem* titleSpacerR; - QSpacerItem* titleSpacerQ; - QBoxLayout* hb; - QGridLayout* grid; + TQPixmap* menuButtonWithIconPix[2]; + TQSpacerItem* titleSpacerJ; + TQSpacerItem* titleSpacerL; + TQSpacerItem* titleSpacerS; + TQSpacerItem* titleSpacerP; + TQSpacerItem* titlebar; + TQSpacerItem* titleSpacerM; + TQSpacerItem* titleSpacerB; + TQSpacerItem* titleSpacerR; + TQSpacerItem* titleSpacerQ; + TQBoxLayout* hb; + TQGridLayout* grid; bool m_closing; }; diff --git a/kwin-styles/kde1/kde1client.cpp b/kwin-styles/kde1/kde1client.cpp index 39ba9605..c0b7ab57 100644 --- a/kwin-styles/kde1/kde1client.cpp +++ b/kwin-styles/kde1/kde1client.cpp @@ -4,18 +4,18 @@ kwin - the KDE window manager Copyright (C) 1999, 2000 Matthias Ettrich <[email protected]> ******************************************************************/ #include "kde1client.h" -#include <qcursor.h> -#include <qlayout.h> -#include <qtoolbutton.h> -#include <qlabel.h> -#include <qdrawutil.h> -#include <qbitmap.h> +#include <tqcursor.h> +#include <tqlayout.h> +#include <tqtoolbutton.h> +#include <tqlabel.h> +#include <tqdrawutil.h> +#include <tqbitmap.h> #include <kdrawutil.h> #include <klocale.h> #include <kpixmap.h> -#include <qdatetime.h> -#include <qimage.h> -#include <qtooltip.h> +#include <tqdatetime.h> +#include <tqimage.h> +#include <tqtooltip.h> #include "kde1client_bitmaps.h" @@ -26,25 +26,25 @@ const char default_right[] = "H_IAX"; namespace KDE1 { -QPixmap* close_pix = 0; -QPixmap* maximize_pix = 0; -QPixmap* minimize_pix = 0; -QPixmap* normalize_pix = 0; -QPixmap* pinup_pix = 0; -QPixmap* pindown_pix = 0; -QPixmap* menu_pix = 0; -QPixmap* question_mark_pix = 0; +TQPixmap* close_pix = 0; +TQPixmap* maximize_pix = 0; +TQPixmap* minimize_pix = 0; +TQPixmap* normalize_pix = 0; +TQPixmap* pinup_pix = 0; +TQPixmap* pindown_pix = 0; +TQPixmap* menu_pix = 0; +TQPixmap* question_mark_pix = 0; -QPixmap* dis_close_pix = 0; -QPixmap* dis_maximize_pix = 0; -QPixmap* dis_minimize_pix = 0; -QPixmap* dis_normalize_pix = 0; -QPixmap* dis_pinup_pix = 0; -QPixmap* dis_pindown_pix = 0; -QPixmap* dis_menu_pix = 0; -QPixmap* dis_question_mark_pix = 0; +TQPixmap* dis_close_pix = 0; +TQPixmap* dis_maximize_pix = 0; +TQPixmap* dis_minimize_pix = 0; +TQPixmap* dis_normalize_pix = 0; +TQPixmap* dis_pinup_pix = 0; +TQPixmap* dis_pindown_pix = 0; +TQPixmap* dis_menu_pix = 0; +TQPixmap* dis_question_mark_pix = 0; -QPixmap* titleBuffer = 0; +TQPixmap* titleBuffer = 0; bool pixmaps_created = FALSE; @@ -55,96 +55,96 @@ void create_pixmaps() if ( pixmaps_created ) return; pixmaps_created = true; - QColorGroup aGrp = options()->colorGroup(KDecorationOptions::ColorButtonBg, true); - QColorGroup iGrp = options()->colorGroup(KDecorationOptions::ColorButtonBg, false); + TQColorGroup aGrp = options()->colorGroup(KDecorationOptions::ColorButtonBg, true); + TQColorGroup iGrp = options()->colorGroup(KDecorationOptions::ColorButtonBg, false); - QPainter aPainter, iPainter; - close_pix = new QPixmap(16, 16); - dis_close_pix = new QPixmap(16, 16); + TQPainter aPainter, iPainter; + close_pix = new TQPixmap(16, 16); + dis_close_pix = new TQPixmap(16, 16); aPainter.begin(close_pix); iPainter.begin(dis_close_pix); kColorBitmaps(&aPainter, aGrp, 0, 0, 16, 16, true, close_white_bits, NULL, NULL, close_dgray_bits, NULL, NULL); kColorBitmaps(&iPainter, iGrp, 0, 0, 16, 16, true, close_white_bits, NULL, NULL, close_dgray_bits, NULL, NULL); aPainter.end(); iPainter.end(); - close_pix->setMask(QBitmap(16, 16, close_mask_bits, true)); + close_pix->setMask(TQBitmap(16, 16, close_mask_bits, true)); dis_close_pix->setMask(*close_pix->mask()); - minimize_pix = new QPixmap(16, 16); - dis_minimize_pix = new QPixmap(16, 16); + minimize_pix = new TQPixmap(16, 16); + dis_minimize_pix = new TQPixmap(16, 16); aPainter.begin(minimize_pix); iPainter.begin(dis_minimize_pix); kColorBitmaps(&aPainter, aGrp, 0, 0, 16, 16, true, iconify_white_bits, NULL, NULL, iconify_dgray_bits, NULL, NULL); kColorBitmaps(&iPainter, iGrp, 0, 0, 16, 16, true, iconify_white_bits, NULL, NULL, iconify_dgray_bits, NULL, NULL); aPainter.end(); iPainter.end(); - minimize_pix->setMask(QBitmap(16, 16, iconify_mask_bits, true)); + minimize_pix->setMask(TQBitmap(16, 16, iconify_mask_bits, true)); dis_minimize_pix->setMask(*minimize_pix->mask()); - maximize_pix = new QPixmap(16, 16); - dis_maximize_pix = new QPixmap(16, 16); + maximize_pix = new TQPixmap(16, 16); + dis_maximize_pix = new TQPixmap(16, 16); aPainter.begin(maximize_pix); iPainter.begin(dis_maximize_pix); kColorBitmaps(&aPainter, aGrp, 0, 0, 16, 16, true, maximize_white_bits, NULL, NULL, maximize_dgray_bits, NULL, NULL); kColorBitmaps(&iPainter, iGrp, 0, 0, 16, 16, true, maximize_white_bits, NULL, NULL, maximize_dgray_bits, NULL, NULL); aPainter.end(); iPainter.end(); - maximize_pix->setMask(QBitmap(16, 16, maximize_mask_bits, true)); + maximize_pix->setMask(TQBitmap(16, 16, maximize_mask_bits, true)); dis_maximize_pix->setMask(*maximize_pix->mask()); - normalize_pix = new QPixmap(16, 16); - dis_normalize_pix = new QPixmap(16, 16); + normalize_pix = new TQPixmap(16, 16); + dis_normalize_pix = new TQPixmap(16, 16); aPainter.begin(normalize_pix); iPainter.begin(dis_normalize_pix); kColorBitmaps(&aPainter, aGrp, 0, 0, 16, 16, true, maximizedown_white_bits, NULL, NULL, maximizedown_dgray_bits, NULL, NULL); kColorBitmaps(&iPainter, iGrp, 0, 0, 16, 16, true, maximizedown_white_bits, NULL, NULL, maximizedown_dgray_bits, NULL, NULL); aPainter.end(); iPainter.end(); - normalize_pix->setMask(QBitmap(16, 16, maximizedown_mask_bits, true)); + normalize_pix->setMask(TQBitmap(16, 16, maximizedown_mask_bits, true)); dis_normalize_pix->setMask(*normalize_pix->mask()); - menu_pix = new QPixmap(16, 16); - dis_menu_pix = new QPixmap(16, 16); + menu_pix = new TQPixmap(16, 16); + dis_menu_pix = new TQPixmap(16, 16); aPainter.begin(menu_pix); iPainter.begin(dis_menu_pix); kColorBitmaps(&aPainter, aGrp, 0, 0, 16, 16, true, menu_white_bits, NULL, NULL, menu_dgray_bits, NULL, NULL); kColorBitmaps(&iPainter, iGrp, 0, 0, 16, 16, true, menu_white_bits, NULL, NULL, menu_dgray_bits, NULL, NULL); aPainter.end(); iPainter.end(); - menu_pix->setMask(QBitmap(16, 16, menu_mask_bits, true)); + menu_pix->setMask(TQBitmap(16, 16, menu_mask_bits, true)); dis_menu_pix->setMask(*menu_pix->mask()); - pinup_pix = new QPixmap(16, 16); - dis_pinup_pix = new QPixmap(16, 16); + pinup_pix = new TQPixmap(16, 16); + dis_pinup_pix = new TQPixmap(16, 16); aPainter.begin(pinup_pix); iPainter.begin(dis_pinup_pix); kColorBitmaps(&aPainter, aGrp, 0, 0, 16, 16, true, pinup_white_bits, pinup_gray_bits, NULL, pinup_dgray_bits, NULL, NULL); kColorBitmaps(&iPainter, iGrp, 0, 0, 16, 16, true, pinup_white_bits, pinup_gray_bits, NULL, pinup_dgray_bits, NULL, NULL); aPainter.end(); iPainter.end(); - pinup_pix->setMask(QBitmap(16, 16, pinup_mask_bits, true)); + pinup_pix->setMask(TQBitmap(16, 16, pinup_mask_bits, true)); dis_pinup_pix->setMask(*pinup_pix->mask()); - pindown_pix = new QPixmap(16, 16); - dis_pindown_pix = new QPixmap(16, 16); + pindown_pix = new TQPixmap(16, 16); + dis_pindown_pix = new TQPixmap(16, 16); aPainter.begin(pindown_pix); iPainter.begin(dis_pindown_pix); kColorBitmaps(&aPainter, aGrp, 0, 0, 16, 16, true, pindown_white_bits, pindown_gray_bits, NULL, pindown_dgray_bits, NULL, NULL); kColorBitmaps(&iPainter, iGrp, 0, 0, 16, 16, true, pindown_white_bits, pindown_gray_bits, NULL, pindown_dgray_bits, NULL, NULL); aPainter.end(); iPainter.end(); - pindown_pix->setMask(QBitmap(16, 16, pindown_mask_bits, true)); + pindown_pix->setMask(TQBitmap(16, 16, pindown_mask_bits, true)); dis_pindown_pix->setMask(*pindown_pix->mask()); - question_mark_pix = new QPixmap(16, 16); - dis_question_mark_pix = new QPixmap(16, 16); + question_mark_pix = new TQPixmap(16, 16); + dis_question_mark_pix = new TQPixmap(16, 16); aPainter.begin(question_mark_pix); iPainter.begin(dis_question_mark_pix); kColorBitmaps(&aPainter, aGrp, 0, 0, 16, 16, true, help_light_bits, NULL, NULL, help_dark_bits, NULL, NULL); kColorBitmaps(&iPainter, iGrp, 0, 0, 16, 16, true, help_light_bits, NULL, NULL, help_dark_bits, NULL, NULL); aPainter.end(); iPainter.end(); - question_mark_pix->setMask(QBitmap(16, 16, help_mask_bits, true)); + question_mark_pix->setMask(TQBitmap(16, 16, help_mask_bits, true)); dis_question_mark_pix->setMask(*question_mark_pix->mask()); titleBuffer = new KPixmap; @@ -174,15 +174,15 @@ void delete_pixmaps() void drawGradient ( - QPainter & p, - const QRect & t, - const QColor & c1, - const QColor & c2 + TQPainter & p, + const TQRect & t, + const TQColor & c1, + const TQColor & c2 ) { // Don't draw a million vertical lines if we don't need to. - if (c1 == c2 || QPixmap::defaultDepth() <= 8) + if (c1 == c2 || TQPixmap::defaultDepth() <= 8) { p.fillRect(t, c1); return; @@ -212,7 +212,7 @@ void drawGradient gl += gcdelta; bl += bcdelta; - p.setPen(QColor(rl >> 16, gl >> 16, bl >> 16)); + p.setPen(TQColor(rl >> 16, gl >> 16, bl >> 16)); p.drawLine(t.x() + x, 0, t.x() + x, t.y() + t.height() - 1); } @@ -221,7 +221,7 @@ void drawGradient void StdClient::reset( unsigned long ) { - if (button[ButtonMenu] && (icon().pixmap( QIconSet::Small, QIconSet::Normal ).isNull())) + if (button[ButtonMenu] && (icon().pixmap( TQIconSet::Small, TQIconSet::Normal ).isNull())) button[ButtonMenu]->setIconSet(isActive() ? *menu_pix : *dis_menu_pix); if (button[ButtonSticky]) button[ButtonSticky]->setIconSet(isOnAllDesktops() ? isActive() ? *pindown_pix : *dis_pindown_pix : @@ -251,30 +251,30 @@ void StdClient::init() widget()->setFont(options()->font(isActive() )); - QGridLayout* g = new QGridLayout( widget(), 0, 0, 3, 2 ); + TQGridLayout* g = new TQGridLayout( widget(), 0, 0, 3, 2 ); g->setRowStretch( 1, 10 ); if( isPreview()) - g->addWidget( new QLabel( i18n( "<center><b>KDE 1 preview</b></center>" ), widget()), 1, 1 ); + g->addWidget( new TQLabel( i18n( "<center><b>KDE 1 preview</b></center>" ), widget()), 1, 1 ); else - g->addItem( new QSpacerItem( 0, 0 ), 1, 1 ); //no widget in the middle - g->addItem( new QSpacerItem( 0, 0, QSizePolicy::Fixed, QSizePolicy::Expanding ) ); + g->addItem( new TQSpacerItem( 0, 0 ), 1, 1 ); //no widget in the middle + g->addItem( new TQSpacerItem( 0, 0, TQSizePolicy::Fixed, TQSizePolicy::Expanding ) ); g->addColSpacing(0, 1); g->addColSpacing(2, 1); g->addRowSpacing(2, 1); int fh = widget()->fontMetrics().lineSpacing(); - titlebar = new QSpacerItem(10, fh, QSizePolicy::Expanding, - QSizePolicy::Minimum ); + titlebar = new TQSpacerItem(10, fh, TQSizePolicy::Expanding, + TQSizePolicy::Minimum ); - QBoxLayout* hb = new QBoxLayout(0, QBoxLayout::LeftToRight, 0, 0, 0); + TQBoxLayout* hb = new TQBoxLayout(0, TQBoxLayout::LeftToRight, 0, 0, 0); g->addLayout( hb, 0, 1 ); // setup titlebar buttons for (int n=0; n<ButtonTypeCount; n++) button[n] = 0; - addButtons(hb, options()->customButtonPositions() ? options()->titleButtonsLeft() : QString(default_left)); + addButtons(hb, options()->customButtonPositions() ? options()->titleButtonsLeft() : TQString(default_left)); hb->addItem(titlebar); - addButtons(hb, options()->customButtonPositions() ? options()->titleButtonsRight() : QString(default_right)); + addButtons(hb, options()->customButtonPositions() ? options()->titleButtonsRight() : TQString(default_right)); for (int n=0; n<ButtonTypeCount; n++) { if ( !button[n] ) @@ -282,7 +282,7 @@ void StdClient::init() button[n]->setBackgroundMode( PaletteBackground ); button[n]->setMouseTracking( FALSE ); button[n]->setAutoRaise( TRUE ); - button[n]->setFocusPolicy( QWidget::NoFocus ); + button[n]->setFocusPolicy( TQWidget::NoFocus ); button[n]->setFixedSize( 20, 20 ); } @@ -297,44 +297,44 @@ void StdClient::init() #endif } -void StdClient::addButtons(QBoxLayout *hb, const QString& s) +void StdClient::addButtons(TQBoxLayout *hb, const TQString& s) { if (s.length() > 0) { for (unsigned n=0; n < s.length(); n++) { switch (s[n]) { case 'M': // Menu button if (!button[ButtonMenu]) { - button[ButtonMenu] = new QToolButton( widget(), 0 ); - QToolTip::add( button[ButtonMenu], i18n("Menu") ); + button[ButtonMenu] = new TQToolButton( widget(), 0 ); + TQToolTip::add( button[ButtonMenu], i18n("Menu") ); button[ButtonMenu]->setCursor(ArrowCursor); - if( icon().pixmap( QIconSet::Small, QIconSet::Normal ).isNull()) + if( icon().pixmap( TQIconSet::Small, TQIconSet::Normal ).isNull()) button[ButtonMenu]->setIconSet(isActive() ? *menu_pix : *dis_menu_pix); else - button[ButtonMenu]->setIconSet( icon().pixmap( QIconSet::Small, QIconSet::Normal )); - connect( button[0], SIGNAL( pressed() ), this, SLOT( menuButtonPressed() ) ); + button[ButtonMenu]->setIconSet( icon().pixmap( TQIconSet::Small, TQIconSet::Normal )); + connect( button[0], TQT_SIGNAL( pressed() ), this, TQT_SLOT( menuButtonPressed() ) ); hb->addWidget(button[ButtonMenu]); } break; case 'S': // Sticky button if (!button[ButtonSticky]) { - button[ButtonSticky] = new QToolButton( widget(), 0 ); + button[ButtonSticky] = new TQToolButton( widget(), 0 ); button[ButtonSticky]->setIconSet( isOnAllDesktops()?*pindown_pix:*pinup_pix ); - QToolTip::add( button[ButtonSticky], isOnAllDesktops()?i18n("Not On All Desktops"):i18n("On All Desktops") ); + TQToolTip::add( button[ButtonSticky], isOnAllDesktops()?i18n("Not On All Desktops"):i18n("On All Desktops") ); button[ButtonSticky]->setCursor(ArrowCursor); button[ButtonSticky]->setIconSet(isOnAllDesktops() ? isActive() ? *pindown_pix : *dis_pindown_pix : isActive() ? *pinup_pix : *dis_pinup_pix ); - connect( button[ButtonSticky], SIGNAL( clicked() ), this, ( SLOT( toggleOnAllDesktops() ) ) ); + connect( button[ButtonSticky], TQT_SIGNAL( clicked() ), this, ( TQT_SLOT( toggleOnAllDesktops() ) ) ); hb->addWidget(button[ButtonSticky]); } break; case 'H': // Help button if ((!button[ButtonHelp]) && providesContextHelp()) { - button[ButtonHelp] = new QToolButton( widget(), 0 ); - QToolTip::add( button[ButtonHelp], i18n("Help") ); + button[ButtonHelp] = new TQToolButton( widget(), 0 ); + TQToolTip::add( button[ButtonHelp], i18n("Help") ); button[ButtonHelp]->setIconSet( isActive() ? *question_mark_pix : *dis_question_mark_pix); - connect( button[ButtonHelp], SIGNAL( clicked() ), this, ( SLOT( showContextHelp() ) ) ); + connect( button[ButtonHelp], TQT_SIGNAL( clicked() ), this, ( TQT_SLOT( showContextHelp() ) ) ); button[ButtonHelp]->setCursor(ArrowCursor); hb->addWidget(button[ButtonHelp]); } @@ -342,11 +342,11 @@ void StdClient::addButtons(QBoxLayout *hb, const QString& s) case 'I': // Minimize button if ((!button[ButtonMinimize]) && isMinimizable()) { - button[ButtonMinimize] = new QToolButton( widget(), 0 ); - QToolTip::add( button[ButtonMinimize], i18n("Minimize") ); + button[ButtonMinimize] = new TQToolButton( widget(), 0 ); + TQToolTip::add( button[ButtonMinimize], i18n("Minimize") ); button[ButtonMinimize]->setCursor(ArrowCursor); button[ButtonMinimize]->setIconSet(isActive() ? *minimize_pix : *dis_minimize_pix); - connect( button[ButtonMinimize], SIGNAL( clicked() ), this, ( SLOT( minimize() ) ) ); + connect( button[ButtonMinimize], TQT_SIGNAL( clicked() ), this, ( TQT_SLOT( minimize() ) ) ); hb->addWidget(button[ButtonMinimize]); } break; @@ -355,28 +355,28 @@ void StdClient::addButtons(QBoxLayout *hb, const QString& s) if ((!button[ButtonMaximize]) && isMaximizable()) { const bool max = maximizeMode()!=MaximizeRestore; button[ButtonMaximize] = new ThreeButtonButton( widget(), 0 ); - QToolTip::add( button[ButtonMaximize], max?i18n("Restore"):i18n("Maximize") ); + TQToolTip::add( button[ButtonMaximize], max?i18n("Restore"):i18n("Maximize") ); button[ButtonMaximize]->setCursor(ArrowCursor); button[ButtonMaximize]->setIconSet( max?(isActive() ? *normalize_pix : *dis_normalize_pix):(isActive() ? *maximize_pix : *dis_maximize_pix) ); - connect( button[ButtonMaximize], SIGNAL( clicked(ButtonState) ), - this, ( SLOT( maxButtonClicked(ButtonState) ) ) ); + connect( button[ButtonMaximize], TQT_SIGNAL( clicked(ButtonState) ), + this, ( TQT_SLOT( maxButtonClicked(ButtonState) ) ) ); hb->addWidget(button[ButtonMaximize]); } break; case 'X': // Close button if ((!button[ButtonClose]) && isCloseable()) { - button[ButtonClose] = new QToolButton( widget(), 0 ); - QToolTip::add( button[ButtonClose], i18n("Close") ); + button[ButtonClose] = new TQToolButton( widget(), 0 ); + TQToolTip::add( button[ButtonClose], i18n("Close") ); button[ButtonClose]->setCursor(ArrowCursor); button[ButtonClose]->setIconSet(isActive() ? *close_pix : *dis_close_pix); - connect( button[ButtonClose], SIGNAL( clicked() ), this, ( SLOT( closeWindow() ) ) ); + connect( button[ButtonClose], TQT_SIGNAL( clicked() ), this, ( TQT_SLOT( closeWindow() ) ) ); hb->addWidget(button[ButtonClose]); } break; case '_': // Spacer item - hb->addItem( new QSpacerItem( 5, 0, QSizePolicy::Fixed, QSizePolicy::Expanding ) ); + hb->addItem( new TQSpacerItem( 5, 0, TQSizePolicy::Fixed, TQSizePolicy::Expanding ) ); } } } @@ -385,7 +385,7 @@ void StdClient::addButtons(QBoxLayout *hb, const QString& s) void StdClient::activeChange() { bool on = isActive(); - if (button[ButtonMenu] && (icon().pixmap( QIconSet::Small, QIconSet::Normal ).isNull())) + if (button[ButtonMenu] && (icon().pixmap( TQIconSet::Small, TQIconSet::Normal ).isNull())) button[ButtonMenu]->setIconSet(on ? *menu_pix : *dis_menu_pix); if (button[ButtonSticky]) button[ButtonSticky]->setIconSet(isOnAllDesktops() ? on ? *pindown_pix : *dis_pindown_pix : @@ -410,18 +410,18 @@ StdClient::~StdClient() } -void StdClient::resizeEvent( QResizeEvent* ) +void StdClient::resizeEvent( TQResizeEvent* ) { - QRegion rr = widget()->rect(); - QRect t = titlebar->geometry(); + TQRegion rr = widget()->rect(); + TQRect t = titlebar->geometry(); // t.setTop( 0 ); -// QRegion r = rr.subtract( QRect( t.x()+1, 0, t.width()-2, 1 ) ); +// TQRegion r = rr.subtract( TQRect( t.x()+1, 0, t.width()-2, 1 ) ); // setMask( r ); if ( widget()->isVisibleToTLW() && !widget()->testWFlags( WStaticContents )) { // manual clearing without the titlebar (we selected WResizeNoErase ) - QRect cr( 2, 2, width()-4, height()- 4 ); - widget()->erase( QRegion( cr ).subtract( t ) ); + TQRect cr( 2, 2, width()-4, height()- 4 ); + widget()->erase( TQRegion( cr ).subtract( t ) ); } } @@ -440,8 +440,8 @@ void StdClient::maximizeChange() bool m = maximizeMode() == MaximizeFull; if (button[ButtonMaximize]) { button[ButtonMaximize]->setIconSet( m?*normalize_pix:*maximize_pix ); - QToolTip::remove( button[ButtonMaximize] ); - QToolTip::add( button[ButtonMaximize], m ? i18n("Restore") : i18n("Maximize") ); + TQToolTip::remove( button[ButtonMaximize] ); + TQToolTip::add( button[ButtonMaximize], m ? i18n("Restore") : i18n("Maximize") ); } } @@ -453,16 +453,16 @@ void StdClient::desktopChange() bool s = isOnAllDesktops(); if (button[ButtonSticky]) { button[ButtonSticky]->setIconSet( s?*pindown_pix:*pinup_pix ); - QToolTip::remove( button[ButtonSticky] ); - QToolTip::add( button[ButtonSticky], s ? i18n("Not On All Desktops") : i18n("On All Desktops") ); + TQToolTip::remove( button[ButtonSticky] ); + TQToolTip::add( button[ButtonSticky], s ? i18n("Not On All Desktops") : i18n("On All Desktops") ); } } -void StdClient::paintEvent( QPaintEvent* ) +void StdClient::paintEvent( TQPaintEvent* ) { - QPainter p( widget() ); - QRect t = titlebar->geometry(); - QRegion r = widget()->rect(); + TQPainter p( widget() ); + TQRect t = titlebar->geometry(); + TQRegion r = widget()->rect(); r = r.subtract( t ); p.setClipRegion( r ); qDrawWinPanel( &p, widget()->rect(), widget()->colorGroup() ); @@ -470,9 +470,9 @@ void StdClient::paintEvent( QPaintEvent* ) // p.setClipRegion( t ); // t.setTop( 0 ); - QRect titleRect( 0, 0, t.width(), t.height() ); + TQRect titleRect( 0, 0, t.width(), t.height() ); titleBuffer->resize( titleRect.width(), titleRect.height() ); - QPainter p2( titleBuffer ); + TQPainter p2( titleBuffer ); drawGradient(p2, titleRect, options()->color(KDecorationOptions::ColorTitleBar, isActive()), options()->color(KDecorationOptions::ColorTitleBlend, isActive())); @@ -492,16 +492,16 @@ void StdClient::paintEvent( QPaintEvent* ) } -void StdClient::mouseDoubleClickEvent( QMouseEvent * e ) +void StdClient::mouseDoubleClickEvent( TQMouseEvent * e ) { if ( e->button() == LeftButton && titlebar->geometry().contains( e->pos() ) ) titlebarDblClickOperation(); } -void StdClient::wheelEvent( QWheelEvent * e ) +void StdClient::wheelEvent( TQWheelEvent * e ) { - if (isSetShade() || QRect( 0, 0, width(), titlebar->geometry().height() ).contains( e->pos() ) ) + if (isSetShade() || TQRect( 0, 0, width(), titlebar->geometry().height() ).contains( e->pos() ) ) titlebarMouseWheelOperation( e->delta()); } @@ -509,10 +509,10 @@ void StdClient::wheelEvent( QWheelEvent * e ) void StdClient::iconChange() { if (button[ButtonMenu]) { - if ( icon().pixmap( QIconSet::Small, QIconSet::Normal ).isNull()) + if ( icon().pixmap( TQIconSet::Small, TQIconSet::Normal ).isNull()) button[ButtonMenu]->setIconSet(isActive() ? *menu_pix : *dis_menu_pix); else - button[ButtonMenu]->setIconSet( icon().pixmap( QIconSet::Small, QIconSet::Normal ) ); + button[ButtonMenu]->setIconSet( icon().pixmap( TQIconSet::Small, TQIconSet::Normal ) ); button[ButtonMenu]->repaint( FALSE ); } } @@ -524,12 +524,12 @@ void StdClient::iconChange() */ void StdClient::menuButtonPressed() { - QRect menuRect = button[ButtonMenu]->rect(); + TQRect menuRect = button[ButtonMenu]->rect(); menuRect.addCoords(-1, 0, +1, +2); - QPoint menuTop = button[ButtonMenu]->mapToGlobal(menuRect.topLeft()); - QPoint menuBottom = button[ButtonMenu]->mapToGlobal(menuRect.bottomRight()); + TQPoint menuTop = button[ButtonMenu]->mapToGlobal(menuRect.topLeft()); + TQPoint menuBottom = button[ButtonMenu]->mapToGlobal(menuRect.bottomRight()); KDecorationFactory* f = factory(); // needs to be saved before - showWindowMenu( QRect(menuTop, menuBottom) ); + showWindowMenu( TQRect(menuTop, menuBottom) ); if( !f->exists( this )) // destroyed, return immediately return; button[ButtonMenu]->setDown(false); @@ -541,30 +541,30 @@ void StdClient::maxButtonClicked( ButtonState button ) maximize( button ); } -bool StdClient::eventFilter( QObject* o, QEvent* e ) +bool StdClient::eventFilter( TQObject* o, TQEvent* e ) { if ( o != widget() ) return false; switch ( e->type() ) { - case QEvent::Resize: - resizeEvent( static_cast< QResizeEvent* >( e ) ); + case TQEvent::Resize: + resizeEvent( static_cast< TQResizeEvent* >( e ) ); return true; - case QEvent::Paint: - paintEvent( static_cast< QPaintEvent* >( e ) ); + case TQEvent::Paint: + paintEvent( static_cast< TQPaintEvent* >( e ) ); return true; - case QEvent::MouseButtonDblClick: - mouseDoubleClickEvent( static_cast< QMouseEvent* >( e ) ); + case TQEvent::MouseButtonDblClick: + mouseDoubleClickEvent( static_cast< TQMouseEvent* >( e ) ); return true; - case QEvent::MouseButtonPress: - processMousePressEvent( static_cast< QMouseEvent* >( e ) ); + case TQEvent::MouseButtonPress: + processMousePressEvent( static_cast< TQMouseEvent* >( e ) ); return true; - case QEvent::Wheel: - wheelEvent( static_cast< QWheelEvent* >( e )); + case TQEvent::Wheel: + wheelEvent( static_cast< TQWheelEvent* >( e )); return true; default: @@ -572,9 +572,9 @@ bool StdClient::eventFilter( QObject* o, QEvent* e ) } } -QSize StdClient::minimumSize() const +TQSize StdClient::minimumSize() const { - return widget()->minimumSize().expandedTo( QSize( 100, 50 )); + return widget()->minimumSize().expandedTo( TQSize( 100, 50 )); } void StdClient::borders( int& left, int& right, int& top, int& bottom ) const @@ -583,7 +583,7 @@ void StdClient::borders( int& left, int& right, int& top, int& bottom ) const top = 6 + widget()->fontMetrics().lineSpacing()+2; } -void StdClient::resize( const QSize& s ) +void StdClient::resize( const TQSize& s ) { widget()->resize( s ); } @@ -600,31 +600,31 @@ void StdToolClient::init() widget()->setFont(options()->font(isActive(), true )); - QGridLayout* g = new QGridLayout( widget(), 0, 0, 2 ); + TQGridLayout* g = new TQGridLayout( widget(), 0, 0, 2 ); g->setRowStretch( 1, 10 ); if( isPreview()) - g->addWidget( new QLabel( i18n( "<center><b>KDE 1 decoration</b></center>" ), widget()), 1, 1 ); + g->addWidget( new TQLabel( i18n( "<center><b>KDE 1 decoration</b></center>" ), widget()), 1, 1 ); else - g->addItem( new QSpacerItem( 0, 0 ), 1, 1 ); //no widget in the middle - g->addItem( new QSpacerItem( 0, 0, QSizePolicy::Fixed, QSizePolicy::Expanding ) ); + g->addItem( new TQSpacerItem( 0, 0 ), 1, 1 ); //no widget in the middle + g->addItem( new TQSpacerItem( 0, 0, TQSizePolicy::Fixed, TQSizePolicy::Expanding ) ); g->addColSpacing(0, 1); g->addColSpacing(2, 1); g->addRowSpacing(2, 1); - closeBtn = new QToolButton( widget(), 0 ); - QToolTip::add( closeBtn, i18n("Close") ); - connect( closeBtn, SIGNAL( clicked() ), this, ( SLOT( closeWindow() ) ) ); + closeBtn = new TQToolButton( widget(), 0 ); + TQToolTip::add( closeBtn, i18n("Close") ); + connect( closeBtn, TQT_SIGNAL( clicked() ), this, ( TQT_SLOT( closeWindow() ) ) ); closeBtn->setFixedSize( 13, 13); reset( -1U ); - QHBoxLayout* hb = new QHBoxLayout; + TQHBoxLayout* hb = new QHBoxLayout; g->addLayout( hb, 0, 1 ); int fh = widget()->fontMetrics().lineSpacing()+2; - titlebar = new QSpacerItem(10, fh, QSizePolicy::Expanding, - QSizePolicy::Minimum ); + titlebar = new TQSpacerItem(10, fh, TQSizePolicy::Expanding, + TQSizePolicy::Minimum ); hb->addItem( titlebar ); hb->addWidget( closeBtn ); } @@ -633,26 +633,26 @@ StdToolClient::~StdToolClient() { } -void StdToolClient::resizeEvent( QResizeEvent* ) +void StdToolClient::resizeEvent( TQResizeEvent* ) { -// QRegion r = rect(); -// QRect t = titlebar->geometry(); +// TQRegion r = rect(); +// TQRect t = titlebar->geometry(); // t.setTop( 0 ); -// r = r.subtract( QRect(0, 0, width(), 1) ); -// r = r.subtract (QRect( 0, 0, 1, t.height() ) ); -// r = r.subtract (QRect( width()-1, 0, 1, t.height() ) ); +// r = r.subtract( TQRect(0, 0, width(), 1) ); +// r = r.subtract (TQRect( 0, 0, 1, t.height() ) ); +// r = r.subtract (TQRect( width()-1, 0, 1, t.height() ) ); // setMask( r ); } -void StdToolClient::paintEvent( QPaintEvent* ) +void StdToolClient::paintEvent( TQPaintEvent* ) { - QPainter p( widget() ); - QRect t = titlebar->geometry(); - QRect r = widget()->rect(); + TQPainter p( widget() ); + TQRect t = titlebar->geometry(); + TQRect r = widget()->rect(); qDrawWinPanel( &p, r, widget()->colorGroup() ); r.setTop( t.bottom()+1 ); qDrawWinPanel( &p, r, widget()->colorGroup() ); - p.fillRect( QRect( QPoint(t.topLeft() ), QPoint( width() - t.left(), t.bottom() ) ), + p.fillRect( TQRect( TQPoint(t.topLeft() ), TQPoint( width() - t.left(), t.bottom() ) ), options()->color(KDecorationOptions::ColorTitleBar, isActive())); p.setPen( options()->color(KDecorationOptions::ColorTitleBar, isActive()).light() ); t.setLeft( t.left() + 4 ); @@ -663,15 +663,15 @@ void StdToolClient::paintEvent( QPaintEvent* ) } -void StdToolClient::mouseDoubleClickEvent( QMouseEvent * e ) +void StdToolClient::mouseDoubleClickEvent( TQMouseEvent * e ) { if ( e->button() == LeftButton && titlebar->geometry().contains( e->pos() ) ) titlebarDblClickOperation(); } -void StdToolClient::wheelEvent( QWheelEvent * e ) +void StdToolClient::wheelEvent( TQWheelEvent * e ) { - if (isSetShade() || QRect( 0, 0, width(), titlebar->geometry().height() ).contains( e->pos() ) ) + if (isSetShade() || TQRect( 0, 0, width(), titlebar->geometry().height() ).contains( e->pos() ) ) titlebarMouseWheelOperation( e->delta()); } @@ -682,38 +682,38 @@ void StdToolClient::captionChange() void StdToolClient::reset( unsigned long ) { - QImage img = close_pix->convertToImage(); + TQImage img = close_pix->convertToImage(); img = img.smoothScale( 12, 12 ); - QPixmap pm; + TQPixmap pm; pm.convertFromImage( img ); closeBtn->setPixmap( pm ); widget()->setFont(options()->font(isActive(), true )); } -bool StdToolClient::eventFilter( QObject* o, QEvent* e ) +bool StdToolClient::eventFilter( TQObject* o, TQEvent* e ) { if ( o != widget() ) return false; switch ( e->type() ) { - case QEvent::Resize: - resizeEvent( static_cast< QResizeEvent* >( e ) ); + case TQEvent::Resize: + resizeEvent( static_cast< TQResizeEvent* >( e ) ); return true; - case QEvent::Paint: - paintEvent( static_cast< QPaintEvent* >( e ) ); + case TQEvent::Paint: + paintEvent( static_cast< TQPaintEvent* >( e ) ); return true; - case QEvent::MouseButtonDblClick: - mouseDoubleClickEvent( static_cast< QMouseEvent* >( e ) ); + case TQEvent::MouseButtonDblClick: + mouseDoubleClickEvent( static_cast< TQMouseEvent* >( e ) ); return true; - case QEvent::MouseButtonPress: - processMousePressEvent( static_cast< QMouseEvent* >( e ) ); + case TQEvent::MouseButtonPress: + processMousePressEvent( static_cast< TQMouseEvent* >( e ) ); return true; - case QEvent::Wheel: - wheelEvent( static_cast< QWheelEvent* >( e )); + case TQEvent::Wheel: + wheelEvent( static_cast< TQWheelEvent* >( e )); return true; default: @@ -721,9 +721,9 @@ bool StdToolClient::eventFilter( QObject* o, QEvent* e ) } } -QSize StdToolClient::minimumSize() const +TQSize StdToolClient::minimumSize() const { - return widget()->minimumSize().expandedTo( QSize( 100, 50 )); + return widget()->minimumSize().expandedTo( TQSize( 100, 50 )); } void StdToolClient::borders( int& left, int& right, int& top, int& bottom ) const @@ -732,7 +732,7 @@ void StdToolClient::borders( int& left, int& right, int& top, int& bottom ) cons top = 6 + widget()->fontMetrics().lineSpacing(); } -void StdToolClient::resize( const QSize& s ) +void StdToolClient::resize( const TQSize& s ) { widget()->resize( s ); } diff --git a/kwin-styles/kde1/kde1client.h b/kwin-styles/kde1/kde1client.h index 27a246dd..5c960abd 100644 --- a/kwin-styles/kde1/kde1client.h +++ b/kwin-styles/kde1/kde1client.h @@ -5,11 +5,11 @@ Copyright (C) 1999, 2000 Matthias Ettrich <[email protected]> ******************************************************************/ #ifndef STDCLIENT_H #define STDCLIENT_H -#include <qlayout.h> -#include <qvariant.h> +#include <tqlayout.h> +#include <tqvariant.h> #include <kdecoration.h> #include <kdecorationfactory.h> -#include <qtoolbutton.h> +#include <tqtoolbutton.h> class QLabel; class QSpacerItem; @@ -32,19 +32,19 @@ public: StdClient( KDecorationBridge* b, KDecorationFactory* f ); ~StdClient(); void init(); - QSize minimumSize() const; + TQSize minimumSize() const; void borders( int& left, int& right, int& top, int& bottom ) const; void reset( unsigned long mask ); - void resize( const QSize& s ); + void resize( const TQSize& s ); void shadeChange() {}; - Position mousePosition( const QPoint& p ) const { return KDecoration::mousePosition( p ); } + Position mousePosition( const TQPoint& p ) const { return KDecoration::mousePosition( p ); } protected: - bool eventFilter( QObject* o, QEvent* e ); - void resizeEvent( QResizeEvent* ); - void paintEvent( QPaintEvent* ); + bool eventFilter( TQObject* o, TQEvent* e ); + void resizeEvent( TQResizeEvent* ); + void paintEvent( TQPaintEvent* ); - void mouseDoubleClickEvent( QMouseEvent * ); - void wheelEvent( QWheelEvent * ); + void mouseDoubleClickEvent( TQMouseEvent * ); + void wheelEvent( TQWheelEvent * ); void captionChange(); void iconChange(); void maximizeChange(); @@ -52,15 +52,15 @@ protected: void activeChange(); private: - void addButtons(QBoxLayout* hb, const QString& buttons); + void addButtons(TQBoxLayout* hb, const TQString& buttons); private slots: void menuButtonPressed(); void maxButtonClicked( ButtonState ); private: - QToolButton* button[ButtonTypeCount]; - QSpacerItem* titlebar; + TQToolButton* button[ButtonTypeCount]; + TQSpacerItem* titlebar; }; class StdToolClient : public KDecoration @@ -70,44 +70,44 @@ public: StdToolClient( KDecorationBridge* b, KDecorationFactory* f ); ~StdToolClient(); void init(); - QSize minimumSize() const; + TQSize minimumSize() const; void borders( int& left, int& right, int& top, int& bottom ) const; void reset( unsigned long mask ); - void resize( const QSize& s ); + void resize( const TQSize& s ); void shadeChange() {}; void activeChange() {}; void iconChange() {}; void maximizeChange() {}; void desktopChange() {}; - Position mousePosition( const QPoint& p ) const { return KDecoration::mousePosition( p ); } + Position mousePosition( const TQPoint& p ) const { return KDecoration::mousePosition( p ); } protected: - bool eventFilter( QObject* o, QEvent* e ); - void resizeEvent( QResizeEvent* ); - void paintEvent( QPaintEvent* ); + bool eventFilter( TQObject* o, TQEvent* e ); + void resizeEvent( TQResizeEvent* ); + void paintEvent( TQPaintEvent* ); - void mouseDoubleClickEvent( QMouseEvent * ); - void wheelEvent( QWheelEvent * ); + void mouseDoubleClickEvent( TQMouseEvent * ); + void wheelEvent( TQWheelEvent * ); void captionChange(); private: - QToolButton* closeBtn; - QSpacerItem* titlebar; + TQToolButton* closeBtn; + TQSpacerItem* titlebar; }; /* - Like QToolButton, but provides a clicked(ButtonState) signals that + Like TQToolButton, but provides a clicked(ButtonState) signals that has the last pressed mouse button as argument */ class ThreeButtonButton: public QToolButton { Q_OBJECT public: - ThreeButtonButton ( QWidget *parent = 0, const char* name = 0 ) - : QToolButton( parent, name ) + ThreeButtonButton ( TQWidget *parent = 0, const char* name = 0 ) + : TQToolButton( parent, name ) { - connect( this, SIGNAL( clicked() ), this, SLOT( handleClicked() ) ); + connect( this, TQT_SIGNAL( clicked() ), this, TQT_SLOT( handleClicked() ) ); setCursor( arrowCursor ); } ~ThreeButtonButton () {} @@ -116,17 +116,17 @@ signals: void clicked( ButtonState ); protected: - void mousePressEvent( QMouseEvent* e ) + void mousePressEvent( TQMouseEvent* e ) { last_button = e->button(); - QMouseEvent me ( e->type(), e->pos(), e->globalPos(), LeftButton, e->state() ); - QToolButton::mousePressEvent( &me ); + TQMouseEvent me ( e->type(), e->pos(), e->globalPos(), LeftButton, e->state() ); + TQToolButton::mousePressEvent( &me ); } - void mouseReleaseEvent( QMouseEvent* e ) + void mouseReleaseEvent( TQMouseEvent* e ) { - QMouseEvent me ( e->type(), e->pos(), e->globalPos(), LeftButton, e->state() ); - QToolButton::mouseReleaseEvent( &me ); + TQMouseEvent me ( e->type(), e->pos(), e->globalPos(), LeftButton, e->state() ); + TQToolButton::mouseReleaseEvent( &me ); } private slots: diff --git a/kwin-styles/kstep/nextclient.cpp b/kwin-styles/kstep/nextclient.cpp index 64fb5217..d4e57e86 100644 --- a/kwin-styles/kstep/nextclient.cpp +++ b/kwin-styles/kstep/nextclient.cpp @@ -1,11 +1,11 @@ #include "nextclient.h" -#include <qdatetime.h> -#include <qdrawutil.h> -#include <qlayout.h> -#include <qpainter.h> -#include <qbitmap.h> -#include <qlabel.h> -#include <qtooltip.h> +#include <tqdatetime.h> +#include <tqdrawutil.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqbitmap.h> +#include <tqlabel.h> +#include <tqtooltip.h> #include <kdebug.h> #include <klocale.h> #include <kpixmapeffect.h> @@ -165,7 +165,7 @@ static KPixmap *aBtn; static KPixmap *aBtnDown; static KPixmap *iBtn; static KPixmap *iBtnDown; -static QColor *btnForeground; +static TQColor *btnForeground; static bool pixmaps_created = false; static int titleHeight = 16; @@ -191,7 +191,7 @@ static void create_pixmaps(NextClientFactory *f) int i = options()->preferredBorderSize(f); if (i >= 0 && i <= 6) handleSize = borderSizes[i]; - titleHeight = QFontMetrics(options()->font(true)).height() + 4; + titleHeight = TQFontMetrics(options()->font(true)).height() + 4; if (titleHeight < handleSize) titleHeight = handleSize; titleHeight &= ~1; // Make title height even if (titleHeight < 16) titleHeight = 16; @@ -250,7 +250,7 @@ static void create_pixmaps(NextClientFactory *f) internal.resize(internalHeight, internalHeight); // inactive buttons - QColor c(options()->color(KDecoration::ColorButtonBg, false)); + TQColor c(options()->color(KDecoration::ColorButtonBg, false)); KPixmapEffect::gradient(*iBtn, c.light(120), c.dark(120), KPixmapEffect::DiagonalGradient); KPixmapEffect::gradient(internal, c.dark(120), c.light(120), @@ -277,7 +277,7 @@ static void create_pixmaps(NextClientFactory *f) KPixmapEffect::DiagonalGradient); bitBlt(aBtnDown, 3, 3, &internal, 0, 0, internalHeight, internalHeight, Qt::CopyROP, true); - QPainter p; + TQPainter p; p.begin(aBtn); p.setPen(Qt::black); p.drawRect(0, 0, btnWidth, btnWidth); @@ -296,9 +296,9 @@ static void create_pixmaps(NextClientFactory *f) p.end(); if(qGray(options()->color(KDecoration::ColorButtonBg, true).rgb()) > 128) - btnForeground = new QColor(Qt::black); + btnForeground = new TQColor(Qt::black); else - btnForeground = new QColor(Qt::white); + btnForeground = new TQColor(Qt::white); } static void delete_pixmaps() @@ -322,8 +322,8 @@ static void delete_pixmaps() NextButton::NextButton(NextClient *parent, const char *name, const unsigned char *bitmap, int bw, int bh, - const QString& tip, const int realizeBtns) - : QButton(parent->widget(), name), + const TQString& tip, const int realizeBtns) + : TQButton(parent->widget(), name), deco(NULL), client(parent), last_button(NoButton) { realizeButtons = realizeBtns; @@ -335,7 +335,7 @@ NextButton::NextButton(NextClient *parent, const char *name, if(bitmap) setBitmap(bitmap, bw, bh); - QToolTip::add(this, tip); + TQToolTip::add(this, tip); } void NextButton::reset() @@ -345,12 +345,12 @@ void NextButton::reset() void NextButton::setBitmap(const unsigned char *bitmap, int w, int h) { - deco = new QBitmap(w, h, bitmap, true); + deco = new TQBitmap(w, h, bitmap, true); deco->setMask(*deco); repaint(); } -void NextButton::drawButton(QPainter *p) +void NextButton::drawButton(TQPainter *p) { if(client->isActive()) p->drawPixmap(0, 0, isDown() ? *aBtnDown : *aBtn); @@ -366,26 +366,26 @@ void NextButton::drawButton(QPainter *p) p->drawPixmap(offset, offset, *deco); } else { offset = (titleHeight - 16) / 2; - KPixmap btnpix = client->icon().pixmap(QIconSet::Small, - client->isActive() ? QIconSet::Normal : QIconSet::Disabled); + KPixmap btnpix = client->icon().pixmap(TQIconSet::Small, + client->isActive() ? TQIconSet::Normal : TQIconSet::Disabled); p->drawPixmap( offset, offset, btnpix ); } } -void NextButton::mousePressEvent( QMouseEvent* e ) +void NextButton::mousePressEvent( TQMouseEvent* e ) { last_button = e->button(); - QMouseEvent me( e->type(), e->pos(), e->globalPos(), + TQMouseEvent me( e->type(), e->pos(), e->globalPos(), (e->button()&realizeButtons)?LeftButton:NoButton, e->state() ); - QButton::mousePressEvent( &me ); + TQButton::mousePressEvent( &me ); } -void NextButton::mouseReleaseEvent( QMouseEvent* e ) +void NextButton::mouseReleaseEvent( TQMouseEvent* e ) { last_button = e->button(); - QMouseEvent me( e->type(), e->pos(), e->globalPos(), + TQMouseEvent me( e->type(), e->pos(), e->globalPos(), (e->button()&realizeButtons)?LeftButton:NoButton, e->state() ); - QButton::mouseReleaseEvent( &me ); + TQButton::mouseReleaseEvent( &me ); } // ===================================== @@ -402,19 +402,19 @@ void NextClient::init() widget()->setBackgroundMode( NoBackground ); - QVBoxLayout *mainLayout = new QVBoxLayout(widget()); - QBoxLayout *titleLayout = new QBoxLayout(0, QBoxLayout::LeftToRight, 0, 0, 0); - QHBoxLayout *windowLayout = new QHBoxLayout(); + TQVBoxLayout *mainLayout = new TQVBoxLayout(widget()); + TQBoxLayout *titleLayout = new TQBoxLayout(0, TQBoxLayout::LeftToRight, 0, 0, 0); + TQHBoxLayout *windowLayout = new TQHBoxLayout(); mainLayout->addLayout(titleLayout); mainLayout->addLayout(windowLayout, 1); mainLayout->addSpacing(mustDrawHandle() ? handleSize : 1); windowLayout->addSpacing(1); if (isPreview()) - windowLayout->addWidget(new QLabel(i18n( + windowLayout->addWidget(new TQLabel(i18n( "<center><b>KStep preview</b></center>"), widget())); else - windowLayout->addItem(new QSpacerItem( 0, 0 )); + windowLayout->addItem(new TQSpacerItem( 0, 0 )); windowLayout->addSpacing(1); @@ -432,7 +432,7 @@ void NextClient::init() button is selected in the current button scheme, or (2) null otherwise. */ -void NextClient::initializeButtonsAndTitlebar(QBoxLayout* titleLayout) +void NextClient::initializeButtonsAndTitlebar(TQBoxLayout* titleLayout) { // Null the buttons to begin with (they are not guaranteed to be null). for (int i=0; i<MAX_NUM_BUTTONS; i++) { @@ -442,20 +442,20 @@ void NextClient::initializeButtonsAndTitlebar(QBoxLayout* titleLayout) // The default button positions for other styles do not match the // behavior of older versions of KStep, so we have to set these // manually when customButtonPositions isn't enabled. - QString left, right; + TQString left, right; if (options()->customButtonPositions()) { left = options()->titleButtonsLeft(); right = options()->titleButtonsRight(); } else { - left = QString("I"); - right = QString("SX"); + left = TQString("I"); + right = TQString("SX"); } // Do actual creation and addition to titleLayout addButtons(titleLayout, left); - titlebar = new QSpacerItem(10, titleHeight, QSizePolicy::Expanding, - QSizePolicy::Minimum ); + titlebar = new TQSpacerItem(10, titleHeight, TQSizePolicy::Expanding, + TQSizePolicy::Minimum ); titleLayout->addItem(titlebar); addButtons(titleLayout, right); @@ -470,7 +470,7 @@ void NextClient::initializeButtonsAndTitlebar(QBoxLayout* titleLayout) /** Adds the buttons for one side of the title bar, based on the spec * string; see the KWinInternal::KDecoration class, methods * titleButtonsLeft and titleBUttonsRight. */ -void NextClient::addButtons(QBoxLayout* titleLayout, const QString& spec) +void NextClient::addButtons(TQBoxLayout* titleLayout, const TQString& spec) { for (unsigned int i=0; i<spec.length(); i++) { switch (spec[i].latin1()) { @@ -480,8 +480,8 @@ void NextClient::addButtons(QBoxLayout* titleLayout, const QString& spec) new NextButton(this, "maximize", maximize_bits, 10, 10, i18n("Maximize"), LeftButton|MidButton|RightButton); titleLayout->addWidget( button[MAXIMIZE_IDX] ); - connect( button[MAXIMIZE_IDX], SIGNAL(clicked()), - this, SLOT(maximizeButtonClicked()) ); + connect( button[MAXIMIZE_IDX], TQT_SIGNAL(clicked()), + this, TQT_SLOT(maximizeButtonClicked()) ); } break; @@ -490,8 +490,8 @@ void NextClient::addButtons(QBoxLayout* titleLayout, const QString& spec) button[HELP_IDX] = new NextButton(this, "help", question_bits, 10, 10, i18n("Help")); titleLayout->addWidget( button[HELP_IDX] ); - connect( button[HELP_IDX], SIGNAL(clicked()), - this, SLOT(showContextHelp()) ); + connect( button[HELP_IDX], TQT_SIGNAL(clicked()), + this, TQT_SLOT(showContextHelp()) ); } break; @@ -501,8 +501,8 @@ void NextClient::addButtons(QBoxLayout* titleLayout, const QString& spec) new NextButton(this, "iconify", iconify_bits, 10, 10, i18n("Minimize")); titleLayout->addWidget( button[ICONIFY_IDX] ); - connect( button[ICONIFY_IDX], SIGNAL(clicked()), - this, SLOT(minimize()) ); + connect( button[ICONIFY_IDX], TQT_SIGNAL(clicked()), + this, TQT_SLOT(minimize()) ); } break; @@ -511,16 +511,16 @@ void NextClient::addButtons(QBoxLayout* titleLayout, const QString& spec) new NextButton(this, "menu", NULL, 10, 10, i18n("Menu"), LeftButton|RightButton); titleLayout->addWidget( button[MENU_IDX] ); // NOTE DIFFERENCE: capture pressed(), not clicked() - connect( button[MENU_IDX], SIGNAL(pressed()), - this, SLOT(menuButtonPressed()) ); + connect( button[MENU_IDX], TQT_SIGNAL(pressed()), + this, TQT_SLOT(menuButtonPressed()) ); break; case 'L': button[SHADE_IDX] = new NextButton(this, "shade", NULL, 0, 0, i18n("Shade")); titleLayout->addWidget( button[SHADE_IDX] ); - connect( button[SHADE_IDX], SIGNAL(clicked()), - this, SLOT(shadeClicked()) ); + connect( button[SHADE_IDX], TQT_SIGNAL(clicked()), + this, TQT_SLOT(shadeClicked()) ); // NOTE DIFFERENCE: set the pixmap separately (2 states) shadeChange(); break; @@ -529,8 +529,8 @@ void NextClient::addButtons(QBoxLayout* titleLayout, const QString& spec) button[STICKY_IDX] = new NextButton(this, "sticky", NULL, 0, 0, i18n("On all desktops")); titleLayout->addWidget( button[STICKY_IDX] ); - connect( button[STICKY_IDX], SIGNAL(clicked()), - this, SLOT(toggleOnAllDesktops()) ); + connect( button[STICKY_IDX], TQT_SIGNAL(clicked()), + this, TQT_SLOT(toggleOnAllDesktops()) ); // NOTE DIFFERENCE: set the pixmap separately (2 states) desktopChange(); break; @@ -538,20 +538,20 @@ void NextClient::addButtons(QBoxLayout* titleLayout, const QString& spec) case 'F': button[ABOVE_IDX] = new NextButton(this, "above", NULL, 0, 0, ""); titleLayout->addWidget( button[ABOVE_IDX] ); - connect( button[ABOVE_IDX], SIGNAL(clicked()), - this, SLOT(aboveClicked()) ); - connect(this, SIGNAL(keepAboveChanged(bool)), - SLOT(keepAboveChange(bool))); + connect( button[ABOVE_IDX], TQT_SIGNAL(clicked()), + this, TQT_SLOT(aboveClicked()) ); + connect(this, TQT_SIGNAL(keepAboveChanged(bool)), + TQT_SLOT(keepAboveChange(bool))); keepAboveChange(keepAbove()); break; case 'B': button[BELOW_IDX] = new NextButton(this, "below", NULL, 0, 0, ""); titleLayout->addWidget( button[BELOW_IDX] ); - connect( button[BELOW_IDX], SIGNAL(clicked()), - this, SLOT(belowClicked()) ); - connect(this, SIGNAL(keepBelowChanged(bool)), - SLOT(keepBelowChange(bool))); + connect( button[BELOW_IDX], TQT_SIGNAL(clicked()), + this, TQT_SLOT(belowClicked()) ); + connect(this, TQT_SIGNAL(keepBelowChanged(bool)), + TQT_SLOT(keepBelowChange(bool))); keepBelowChange(keepBelow()); break; @@ -561,8 +561,8 @@ void NextClient::addButtons(QBoxLayout* titleLayout, const QString& spec) new NextButton(this, "close", close_bits, 10, 10, i18n("Close")); titleLayout->addWidget(button[CLOSE_IDX]); - connect(button[CLOSE_IDX], SIGNAL(clicked()), - this, SLOT(closeWindow())); + connect(button[CLOSE_IDX], TQT_SIGNAL(clicked()), + this, TQT_SLOT(closeWindow())); } break; @@ -573,8 +573,8 @@ void NextClient::addButtons(QBoxLayout* titleLayout, const QString& spec) i18n("Resize")); titleLayout->addWidget(button[RESIZE_IDX]); // NOTE DIFFERENCE: capture pressed(), not clicked() - connect(button[RESIZE_IDX], SIGNAL(pressed()), - this, SLOT(resizePressed())); + connect(button[RESIZE_IDX], TQT_SIGNAL(pressed()), + this, TQT_SLOT(resizePressed())); } break; case '_': @@ -583,7 +583,7 @@ void NextClient::addButtons(QBoxLayout* titleLayout, const QString& spec) default: kdDebug() << " Can't happen: unknown button code " - << QString(spec[i]); + << TQString(spec[i]); break; } } @@ -609,13 +609,13 @@ void NextClient::menuButtonPressed() { // Probably don't need this null check, but we might as well. if (button[MENU_IDX]) { - QRect menuRect = button[MENU_IDX]->rect(); - QPoint menuTop = button[MENU_IDX]->mapToGlobal(menuRect.topLeft()); - QPoint menuBottom = button[MENU_IDX]->mapToGlobal(menuRect.bottomRight()); - menuTop += QPoint(1, 1); - menuBottom += QPoint(1, 1); + TQRect menuRect = button[MENU_IDX]->rect(); + TQPoint menuTop = button[MENU_IDX]->mapToGlobal(menuRect.topLeft()); + TQPoint menuBottom = button[MENU_IDX]->mapToGlobal(menuRect.bottomRight()); + menuTop += TQPoint(1, 1); + menuBottom += TQPoint(1, 1); KDecorationFactory* f = factory(); - showWindowMenu(QRect(menuTop, menuBottom)); + showWindowMenu(TQRect(menuTop, menuBottom)); if( !f->exists( this )) // 'this' was deleted return; button[MENU_IDX]->setDown(false); @@ -652,17 +652,17 @@ void NextClient::resizePressed() performWindowOperation(ResizeOp); } -void NextClient::resizeEvent(QResizeEvent *) +void NextClient::resizeEvent(TQResizeEvent *) { if (widget()->isVisible()) { // TODO ? update border area only? widget()->update(); #if 0 widget()->update(titlebar->geometry()); - QPainter p(widget()); - QRect t = titlebar->geometry(); + TQPainter p(widget()); + TQRect t = titlebar->geometry(); t.setTop( 0 ); - QRegion r = widget()->rect(); + TQRegion r = widget()->rect(); r = r.subtract( t ); p.setClipRegion( r ); p.eraseRect(widget()->rect()); @@ -676,17 +676,17 @@ void NextClient::captionChange() } -void NextClient::paintEvent( QPaintEvent* ) +void NextClient::paintEvent( TQPaintEvent* ) { - QPainter p(widget()); + TQPainter p(widget()); // Draw black frame - QRect fr = widget()->rect(); + TQRect fr = widget()->rect(); p.setPen(Qt::black); p.drawRect(fr); // Draw title bar - QRect t = titlebar->geometry(); + TQRect t = titlebar->geometry(); t.setTop(1); p.drawTiledPixmap(t.x()+1, t.y()+1, t.width()-2, t.height()-2, isActive() ? *aTitlePix : *iTitlePix); @@ -696,7 +696,7 @@ void NextClient::paintEvent( QPaintEvent* ) #if 0 // Why setting up a clipping region if it is not used? (setClipping(false)) - QRegion r = fr; + TQRegion r = fr; r = r.subtract( t ); p.setClipRegion( r ); p.setClipping(false); @@ -739,19 +739,19 @@ void NextClient::paintEvent( QPaintEvent* ) } } -void NextClient::mouseDoubleClickEvent( QMouseEvent * e ) +void NextClient::mouseDoubleClickEvent( TQMouseEvent * e ) { if (e->button() == LeftButton && titlebar->geometry().contains( e->pos() ) ) titlebarDblClickOperation(); } -void NextClient::wheelEvent( QWheelEvent * e ) +void NextClient::wheelEvent( TQWheelEvent * e ) { - if (isSetShade() || QRect( 0, 0, width(), titleHeight ).contains( e->pos() ) ) + if (isSetShade() || TQRect( 0, 0, width(), titleHeight ).contains( e->pos() ) ) titlebarMouseWheelOperation( e->delta()); } -void NextClient::showEvent(QShowEvent *) +void NextClient::showEvent(TQShowEvent *) { widget()->repaint(); } @@ -761,8 +761,8 @@ void NextClient::desktopChange() bool on = isOnAllDesktops(); if (NextButton * b = button[STICKY_IDX]) { b->setBitmap( on ? unsticky_bits : sticky_bits, 10, 10); - QToolTip::remove(b); - QToolTip::add(b, on ? i18n("Not on all desktops") : i18n("On all desktops")); + TQToolTip::remove(b); + TQToolTip::add(b, on ? i18n("Not on all desktops") : i18n("On all desktops")); } } @@ -771,12 +771,12 @@ void NextClient::maximizeChange() if (button[MAXIMIZE_IDX]) { bool m = maximizeMode() == MaximizeFull; //button[MAXIMIZE_IDX]->setBitmap(m ? minmax_bits : maximize_bits); - QToolTip::remove(button[MAXIMIZE_IDX]); - QToolTip::add(button[MAXIMIZE_IDX], + TQToolTip::remove(button[MAXIMIZE_IDX]); + TQToolTip::add(button[MAXIMIZE_IDX], m ? i18n("Restore") : i18n("Maximize")); } //spacer->changeSize(10, mustDrawHandle() ? handleSize : 1, - // QSizePolicy::Expanding, QSizePolicy::Minimum); + // TQSizePolicy::Expanding, TQSizePolicy::Minimum); //mainLayout->activate(); } @@ -796,7 +796,7 @@ void NextClient::slotReset() } KDecoration::Position -NextClient::mousePosition( const QPoint& p ) const +NextClient::mousePosition( const TQPoint& p ) const { Position m = PositionCenter; @@ -827,8 +827,8 @@ void NextClient::shadeChange() { if (NextButton *b = button[SHADE_IDX]) { b->setBitmap(isSetShade() ? unshade_bits : shade_bits, 10, 10); - QToolTip::remove(b); - QToolTip::add(b, isSetShade() ? i18n("Unshade") : i18n("Shade")); + TQToolTip::remove(b); + TQToolTip::add(b, isSetShade() ? i18n("Unshade") : i18n("Shade")); } } @@ -836,8 +836,8 @@ void NextClient::keepAboveChange(bool above) { if (NextButton *b = button[ABOVE_IDX]) { b->setBitmap(above ? from_above_bits : keep_above_bits, 10, 10); - QToolTip::remove(b); - QToolTip::add(b, above ? + TQToolTip::remove(b); + TQToolTip::add(b, above ? i18n("Do not keep above others") : i18n("Keep above others")); b->repaint(false); } @@ -847,19 +847,19 @@ void NextClient::keepBelowChange(bool below) { if (NextButton *b = button[BELOW_IDX]) { b->setBitmap(below ? from_below_bits : keep_below_bits, 10, 10); - QToolTip::remove(b); - QToolTip::add(b, below ? + TQToolTip::remove(b); + TQToolTip::add(b, below ? i18n("Do not keep below others") : i18n("Keep below others")); b->repaint(false); } } -QSize NextClient::minimumSize() const +TQSize NextClient::minimumSize() const { - return QSize(titleHeight * 6 + 2, titleHeight + handleSize + 2); + return TQSize(titleHeight * 6 + 2, titleHeight + handleSize + 2); } -void NextClient::resize(const QSize& s) +void NextClient::resize(const TQSize& s) { widget()->resize(s); } @@ -873,28 +873,28 @@ void NextClient::reset(unsigned long) widget()->repaint(); } -bool NextClient::eventFilter(QObject *o, QEvent *e) +bool NextClient::eventFilter(TQObject *o, TQEvent *e) { if (o != widget()) return false; switch (e->type()) { - case QEvent::Resize: - resizeEvent(static_cast< QResizeEvent* >( e )); + case TQEvent::Resize: + resizeEvent(static_cast< TQResizeEvent* >( e )); return true; - case QEvent::Paint: - paintEvent(static_cast< QPaintEvent* >( e )); + case TQEvent::Paint: + paintEvent(static_cast< TQPaintEvent* >( e )); return true; - case QEvent::MouseButtonDblClick: - mouseDoubleClickEvent(static_cast< QMouseEvent* >( e )); + case TQEvent::MouseButtonDblClick: + mouseDoubleClickEvent(static_cast< TQMouseEvent* >( e )); return true; - case QEvent::Wheel: - wheelEvent( static_cast< QWheelEvent* >( e )); + case TQEvent::Wheel: + wheelEvent( static_cast< TQWheelEvent* >( e )); return true; - case QEvent::MouseButtonPress: - processMousePressEvent(static_cast< QMouseEvent* >( e )); + case TQEvent::MouseButtonPress: + processMousePressEvent(static_cast< TQMouseEvent* >( e )); return true; - case QEvent::Show: - showEvent(static_cast< QShowEvent* >( e )); + case TQEvent::Show: + showEvent(static_cast< TQShowEvent* >( e )); return true; default: break; @@ -902,10 +902,10 @@ bool NextClient::eventFilter(QObject *o, QEvent *e) return false; } -bool NextClient::drawbound(const QRect& geom, bool /* clear */) +bool NextClient::drawbound(const TQRect& geom, bool /* clear */) { - QPainter p(workspaceWidget()); - p.setPen(QPen(Qt::white, 3)); + TQPainter p(workspaceWidget()); + p.setPen(TQPen(Qt::white, 3)); p.setRasterOp(Qt::XorROP); p.drawRect(geom); int leftMargin = geom.left() + 2; @@ -966,11 +966,11 @@ bool NextClientFactory::supports( Ability ability ) }; } -QValueList< NextClientFactory::BorderSize > +TQValueList< NextClientFactory::BorderSize > NextClientFactory::borderSizes() const { // the list must be sorted - return QValueList< BorderSize >() << BorderTiny << BorderNormal << + return TQValueList< BorderSize >() << BorderTiny << BorderNormal << BorderLarge << BorderVeryLarge << BorderHuge << BorderVeryHuge << BorderOversized; } diff --git a/kwin-styles/kstep/nextclient.h b/kwin-styles/kstep/nextclient.h index dc0470c8..9eff9621 100644 --- a/kwin-styles/kstep/nextclient.h +++ b/kwin-styles/kstep/nextclient.h @@ -1,11 +1,11 @@ #ifndef __NEXTCLIENT_H #define __NEXTCLIENT_H -#include <qvariant.h> -#include <qbitmap.h> +#include <tqvariant.h> +#include <tqbitmap.h> #include <kpixmap.h> -#include <qlayout.h> -#include <qbutton.h> +#include <tqlayout.h> +#include <tqbutton.h> #include <kdecoration.h> #include <kdecorationfactory.h> @@ -21,19 +21,19 @@ class NextButton : public QButton public: NextButton(NextClient *parent=0, const char *name=0, const unsigned char *bitmap=NULL, int bw=0, int bh=0, - const QString& tip=NULL, const int realizeBtns = LeftButton); + const TQString& tip=NULL, const int realizeBtns = LeftButton); void setBitmap(const unsigned char *bitmap, int bw, int bh); void reset(); ButtonState lastButton() { return last_button; } protected: - void mousePressEvent( QMouseEvent* e ); - void mouseReleaseEvent( QMouseEvent* e ); - virtual void drawButton(QPainter *p); - void drawButtonLabel(QPainter *){;} + void mousePressEvent( TQMouseEvent* e ); + void mouseReleaseEvent( TQMouseEvent* e ); + virtual void drawButton(TQPainter *p); + void drawButtonLabel(TQPainter *){;} KPixmap aBackground, iBackground; - QBitmap* deco; + TQBitmap* deco; NextClient *client; ButtonState last_button; int realizeButtons; @@ -46,28 +46,28 @@ public: NextClient(KDecorationBridge *b, KDecorationFactory *f); ~NextClient() {;} void init(); - virtual bool drawbound(const QRect& geom, bool clear); + virtual bool drawbound(const TQRect& geom, bool clear); protected: - bool eventFilter(QObject *o, QEvent *e); - void resizeEvent( QResizeEvent* ); - void paintEvent( QPaintEvent* ); - void showEvent( QShowEvent* ); + bool eventFilter(TQObject *o, TQEvent *e); + void resizeEvent( TQResizeEvent* ); + void paintEvent( TQPaintEvent* ); + void showEvent( TQShowEvent* ); - void mouseDoubleClickEvent( QMouseEvent * ); - void wheelEvent( QWheelEvent * ); + void mouseDoubleClickEvent( TQMouseEvent * ); + void wheelEvent( TQWheelEvent * ); void captionChange(); void desktopChange(); void activeChange(); void shadeChange(); void iconChange(); - QSize minimumSize() const; - void resize(const QSize &size); + TQSize minimumSize() const; + void resize(const TQSize &size); void borders(int &left, int &right, int &top, int &bottom) const; void reset(unsigned long changed); void calcHiddenButtons(); void updateActiveBuffer(); - Position mousePosition(const QPoint &) const; + Position mousePosition(const TQPoint &) const; void maximizeChange(); protected slots: @@ -83,11 +83,11 @@ protected slots: void keepBelowChange(bool below); private: - void initializeButtonsAndTitlebar(QBoxLayout* titleLayout); - void addButtons(QBoxLayout* titleLayout, const QString& buttons); + void initializeButtonsAndTitlebar(TQBoxLayout* titleLayout); + void addButtons(TQBoxLayout* titleLayout, const TQString& buttons); bool mustDrawHandle() const; - QSpacerItem* titlebar; + TQSpacerItem* titlebar; // Helpful constants for buttons in array enum { CLOSE_IDX = 0, @@ -107,7 +107,7 @@ private: NextButton* button[MAX_NUM_BUTTONS]; }; -class NextClientFactory: public QObject, public KDecorationFactory +class NextClientFactory: public TQObject, public KDecorationFactory { public: NextClientFactory(); @@ -116,7 +116,7 @@ public: virtual bool reset(unsigned long changed); virtual bool supports( Ability ability ); - QValueList< NextClientFactory::BorderSize > borderSizes() const; + TQValueList< NextClientFactory::BorderSize > borderSizes() const; }; diff --git a/kwin-styles/openlook/OpenLook.cpp b/kwin-styles/openlook/OpenLook.cpp index 0f31a6ec..d3f2b190 100644 --- a/kwin-styles/openlook/OpenLook.cpp +++ b/kwin-styles/openlook/OpenLook.cpp @@ -26,13 +26,13 @@ #include <unistd.h> // for usleep #include <math.h> -#include <qlayout.h> -#include <qpainter.h> -#include <qdrawutil.h> -#include <qtoolbutton.h> -#include <qimage.h> -#include <qlabel.h> -#include <qpixmap.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqdrawutil.h> +#include <tqtoolbutton.h> +#include <tqimage.h> +#include <tqlabel.h> +#include <tqpixmap.h> #include <kapplication.h> #include <klocale.h> @@ -86,11 +86,11 @@ bool DecorationFactory::supports( Ability ability ) }; } -QValueList< DecorationFactory::BorderSize > +TQValueList< DecorationFactory::BorderSize > DecorationFactory::borderSizes() const { // the list must be sorted - return QValueList< BorderSize >() << BorderNormal << + return TQValueList< BorderSize >() << BorderNormal << BorderLarge << BorderVeryLarge << BorderHuge << BorderVeryHuge << BorderOversized; } @@ -124,7 +124,7 @@ void OpenLook::init() widget()->setBackgroundMode(NoBackground); NET::WindowType type = windowType(SUPPORTED_WINDOW_TYPES_MASK); tool_ = (type == NET::Toolbar || type == NET::Utility || type == NET::Menu); - QFontMetrics fm(options()->font(isActive(), tool_)); + TQFontMetrics fm(options()->font(isActive(), tool_)); titleHeight = fm.height() + openLookTextVMargin * 2; @@ -160,35 +160,35 @@ OpenLook::~OpenLook() // Empty. } -bool OpenLook::eventFilter(QObject *o, QEvent *e) +bool OpenLook::eventFilter(TQObject *o, TQEvent *e) { if (o != widget()) return false; switch (e->type()) { - case QEvent::Resize: - resizeEvent(static_cast< QResizeEvent* >(e)); + case TQEvent::Resize: + resizeEvent(static_cast< TQResizeEvent* >(e)); return true; - case QEvent::Paint: - paintEvent(static_cast< QPaintEvent* >(e)); + case TQEvent::Paint: + paintEvent(static_cast< TQPaintEvent* >(e)); return true; - case QEvent::MouseButtonDblClick: - mouseDoubleClickEvent(static_cast< QMouseEvent* >(e)); + case TQEvent::MouseButtonDblClick: + mouseDoubleClickEvent(static_cast< TQMouseEvent* >(e)); return true; - case QEvent::Wheel: - wheelEvent( static_cast< QWheelEvent* >( e )); + case TQEvent::Wheel: + wheelEvent( static_cast< TQWheelEvent* >( e )); return true; - case QEvent::MouseButtonPress: - if (!isButtonPress(static_cast< QMouseEvent* >(e))) { - processMousePressEvent(static_cast< QMouseEvent* >(e)); + case TQEvent::MouseButtonPress: + if (!isButtonPress(static_cast< TQMouseEvent* >(e))) { + processMousePressEvent(static_cast< TQMouseEvent* >(e)); } return true; - case QEvent::MouseButtonRelease: - if (isButtonRelease(static_cast< QMouseEvent* >(e))) { + case TQEvent::MouseButtonRelease: + if (isButtonRelease(static_cast< TQMouseEvent* >(e))) { return true; } else { return false; } - case QEvent::Show: - showEvent(static_cast< QShowEvent* >(e)); + case TQEvent::Show: + showEvent(static_cast< TQShowEvent* >(e)); return true; default: break; @@ -215,28 +215,28 @@ OpenLook::shadeChange() { } -QSize OpenLook::minimumSize() const +TQSize OpenLook::minimumSize() const { int left, right, top, bottom; borders(left, right, top, bottom); - return QSize(left + right + 2 * titleHeight, top + bottom); + return TQSize(left + right + 2 * titleHeight, top + bottom); } void -OpenLook::resize(const QSize& s) +OpenLook::resize(const TQSize& s) { widget()->resize(s); widget()->repaint(); //there is some strange wrong repaint of the frame without } void -OpenLook::paintEvent(QPaintEvent * pe) +OpenLook::paintEvent(TQPaintEvent * pe) { - QRect tr(titleRect()); + TQRect tr(titleRect()); - QPainter p(widget()); + TQPainter p(widget()); - QRegion clipRegion(pe->region()); + TQRegion clipRegion(pe->region()); p.setClipRegion(clipRegion); @@ -249,12 +249,12 @@ OpenLook::paintEvent(QPaintEvent * pe) p.setClipRegion(clipRegion + buttonRect()); - QBrush titleBackground(options()->color(KDecoration::ColorTitleBar, true)); + TQBrush titleBackground(options()->color(KDecoration::ColorTitleBar, true)); if (isActive()) qDrawShadePanel(&p, tr, widget()->colorGroup(), true, 1, &titleBackground); else - p.fillRect(tr, widget()->colorGroup().brush(QColorGroup::Background)); + p.fillRect(tr, widget()->colorGroup().brush(TQColorGroup::Background)); p.setClipRegion(clipRegion); @@ -270,13 +270,13 @@ OpenLook::paintEvent(QPaintEvent * pe) } void -OpenLook::showEvent(QShowEvent *) +OpenLook::showEvent(TQShowEvent *) { widget()->repaint(); } void -OpenLook::mouseDoubleClickEvent(QMouseEvent * e) +OpenLook::mouseDoubleClickEvent(TQMouseEvent * e) { if (e->button() == LeftButton && titleRect().contains(e->pos())) { @@ -285,7 +285,7 @@ OpenLook::mouseDoubleClickEvent(QMouseEvent * e) } void -OpenLook::wheelEvent(QWheelEvent *e) +OpenLook::wheelEvent(TQWheelEvent *e) { if (isSetShade() || titleRect().contains(e->pos())) { @@ -294,7 +294,7 @@ OpenLook::wheelEvent(QWheelEvent *e) } void -OpenLook::resizeEvent(QResizeEvent* e) +OpenLook::resizeEvent(TQResizeEvent* e) { widget()->update(); } @@ -306,7 +306,7 @@ OpenLook::activeChange() } KDecoration::Position -OpenLook::mousePosition(const QPoint & p) const +OpenLook::mousePosition(const TQPoint & p) const { if (topLeftRect().contains(p)) return PositionTopLeft; @@ -339,31 +339,31 @@ OpenLook::maximizeChange() void OpenLook::doLayout() { - QVBoxLayout * layout = new QVBoxLayout(widget(), openLookMargin); + TQVBoxLayout * layout = new TQVBoxLayout(widget(), openLookMargin); titleSpacer_ = new QSpacerItem ( 0, titleHeight, - QSizePolicy::Expanding, - QSizePolicy::Fixed + TQSizePolicy::Expanding, + TQSizePolicy::Fixed ); layout->addItem(titleSpacer_); layout->addSpacing(2); - QBoxLayout * midLayout = - new QBoxLayout(layout, QBoxLayout::LeftToRight, 0, 0); + TQBoxLayout * midLayout = + new TQBoxLayout(layout, TQBoxLayout::LeftToRight, 0, 0); if (isPreview()) { - midLayout->addWidget(new QLabel( + midLayout->addWidget(new TQLabel( i18n("<center><b>OpenLook preview</b></center>"), widget()), 1); } else { - midLayout->addItem( new QSpacerItem( 0, 0 )); + midLayout->addItem( new TQSpacerItem( 0, 0 )); } } @@ -372,21 +372,21 @@ OpenLook::doLayout() OpenLook::animateMinimize(bool /*iconify*/) { #if 0 - QRect icongeom(iconGeometry()); + TQRect icongeom(iconGeometry()); if (!icongeom.isValid()) return false; - QRect wingeom(geometry()); + TQRect wingeom(geometry()); - QPainter p(workspaceWidget()); + TQPainter p(workspaceWidget()); p.setRasterOp(Qt::NotROP); #if 0 if (iconify) p.setClipRegion( - QRegion(workspace()->desktopWidget()->rect()) - wingeom + TQRegion(workspace()->desktopWidget()->rect()) - wingeom ); #endif @@ -471,11 +471,11 @@ OpenLook::bottomRightRect() const } void -OpenLook::paintTopLeftRect(QPainter & p) const +OpenLook::paintTopLeftRect(TQPainter & p) const { - QColor handleColour(options()->color(KDecoration::ColorHandle, isActive())); + TQColor handleColour(options()->color(KDecoration::ColorHandle, isActive())); - QRect r(topLeftRect()); + TQRect r(topLeftRect()); int x1(r.left()); int y1(r.top()); @@ -502,11 +502,11 @@ OpenLook::paintTopLeftRect(QPainter & p) const } void -OpenLook::paintTopRightRect(QPainter & p) const +OpenLook::paintTopRightRect(TQPainter & p) const { - QColor handleColour(options()->color(KDecoration::ColorHandle, isActive())); + TQColor handleColour(options()->color(KDecoration::ColorHandle, isActive())); - QRect r(topRightRect()); + TQRect r(topRightRect()); int x1(r.left()); int y1(r.top()); @@ -530,11 +530,11 @@ OpenLook::paintTopRightRect(QPainter & p) const } void -OpenLook::paintBottomLeftRect(QPainter & p) const +OpenLook::paintBottomLeftRect(TQPainter & p) const { - QColor handleColour(options()->color(KDecoration::ColorHandle, isActive())); + TQColor handleColour(options()->color(KDecoration::ColorHandle, isActive())); - QRect r(bottomLeftRect()); + TQRect r(bottomLeftRect()); int x1(r.left()); int y1(r.top()); @@ -558,11 +558,11 @@ OpenLook::paintBottomLeftRect(QPainter & p) const } void -OpenLook::paintBottomRightRect(QPainter & p) const +OpenLook::paintBottomRightRect(TQPainter & p) const { - QColor handleColour(options()->color(KDecoration::ColorHandle, isActive())); + TQColor handleColour(options()->color(KDecoration::ColorHandle, isActive())); - QRect r(bottomRightRect()); + TQRect r(bottomRightRect()); int x1(r.left()); int y1(r.top()); @@ -598,9 +598,9 @@ OpenLook::buttonRect() const } void -OpenLook::paintButton(QPainter & p) const +OpenLook::paintButton(TQPainter & p) const { - QRect r(buttonRect()); + TQRect r(buttonRect()); p.fillRect ( @@ -627,16 +627,16 @@ OpenLook::paintButton(QPainter & p) const } void -OpenLook::paintArrow(QPainter & p) const +OpenLook::paintArrow(TQPainter & p) const { - QRect br(buttonRect()); + TQRect br(buttonRect()); int x = br.left() + 5; int y = br.top() + 5; int w = br.width() - 10; int h = br.height() - 10; - QPointArray poly(3); + TQPointArray poly(3); p.setBrush(widget()->colorGroup().mid()); @@ -658,7 +658,7 @@ OpenLook::paintArrow(QPainter & p) const } void -OpenLook::paintBorder(QPainter & p) const +OpenLook::paintBorder(TQPainter & p) const { const uint cs(openLookCornerSize); @@ -674,7 +674,7 @@ OpenLook::paintBorder(QPainter & p) const p.fillRect(x, y + cs, 2, h - cs - cs, widget()->colorGroup().shadow()); p.fillRect(r - 1, y + cs, 2, h - cs - cs, widget()->colorGroup().shadow()); - QColor frameColour(options()->color(KDecoration::ColorFrame, isActive())); + TQColor frameColour(options()->color(KDecoration::ColorFrame, isActive())); p.fillRect(x + cs, y + 2, w - cs - cs, openLookMargin-2, frameColour); p.fillRect(x + cs, b - openLookMargin + 1, w - cs - cs, openLookMargin-2, frameColour); @@ -698,7 +698,7 @@ OpenLook::titleRect() const } bool -OpenLook::isButtonPress(QMouseEvent * e) +OpenLook::isButtonPress(TQMouseEvent * e) { mousePressPoint_ = e->pos(); @@ -709,7 +709,7 @@ OpenLook::isButtonPress(QMouseEvent * e) } bool -OpenLook::isButtonRelease(QMouseEvent * e) +OpenLook::isButtonRelease(TQMouseEvent * e) { if (buttonDown_ && buttonRect().contains(e->pos())) { diff --git a/kwin-styles/openlook/OpenLook.h b/kwin-styles/openlook/OpenLook.h index 698dec4d..900ccb54 100644 --- a/kwin-styles/openlook/OpenLook.h +++ b/kwin-styles/openlook/OpenLook.h @@ -25,8 +25,8 @@ #ifndef KWIN_WEB_H #define KWIN_WEB_H -#include <qptrlist.h> -#include <qbutton.h> +#include <tqptrlist.h> +#include <tqbutton.h> #include <kdecoration.h> #include <kdecorationfactory.h> @@ -47,10 +47,10 @@ namespace OpenLook void init(); protected: - bool eventFilter(QObject *o, QEvent *e); - void resizeEvent(QResizeEvent *e); - void paintEvent(QPaintEvent *e); - void showEvent(QShowEvent *e); + bool eventFilter(TQObject *o, TQEvent *e); + void resizeEvent(TQResizeEvent *e); + void paintEvent(TQPaintEvent *e); + void showEvent(TQShowEvent *e); virtual void captionChange(); void desktopChange(); @@ -59,47 +59,47 @@ namespace OpenLook void iconChange(); void maximizeChange(); void borders(int &left, int &right, int &top, int &bottom) const; - QSize minimumSize() const; - void resize( const QSize& ); - virtual void mouseDoubleClickEvent(QMouseEvent *); - virtual void wheelEvent(QWheelEvent *e); + TQSize minimumSize() const; + void resize( const TQSize& ); + virtual void mouseDoubleClickEvent(TQMouseEvent *); + virtual void wheelEvent(TQWheelEvent *e); - virtual Position mousePosition(const QPoint &) const; + virtual Position mousePosition(const TQPoint &) const; virtual bool animateMinimize(bool); private: void doLayout(); - QRect titleRect() const; + TQRect titleRect() const; - QRect topLeftRect() const; - QRect topRightRect() const; - QRect bottomLeftRect() const; - QRect bottomRightRect() const; + TQRect topLeftRect() const; + TQRect topRightRect() const; + TQRect bottomLeftRect() const; + TQRect bottomRightRect() const; - QRect buttonRect() const; + TQRect buttonRect() const; - void paintBorder(QPainter &) const; + void paintBorder(TQPainter &) const; - void paintTopLeftRect(QPainter &) const; - void paintTopRightRect(QPainter &) const; - void paintBottomLeftRect(QPainter &) const; - void paintBottomRightRect(QPainter &) const; + void paintTopLeftRect(TQPainter &) const; + void paintTopRightRect(TQPainter &) const; + void paintBottomLeftRect(TQPainter &) const; + void paintBottomRightRect(TQPainter &) const; - void paintButton(QPainter &) const; - void paintArrow(QPainter &) const; + void paintButton(TQPainter &) const; + void paintArrow(TQPainter &) const; - bool isButtonPress(QMouseEvent *); - bool isButtonRelease(QMouseEvent *); + bool isButtonPress(TQMouseEvent *); + bool isButtonRelease(TQMouseEvent *); - QSpacerItem * titleSpacer_; - QPoint mousePressPoint_; + TQSpacerItem * titleSpacer_; + TQPoint mousePressPoint_; bool tool_; bool buttonDown_; }; - class DecorationFactory: public QObject, public KDecorationFactory + class DecorationFactory: public TQObject, public KDecorationFactory { public: DecorationFactory(); @@ -107,7 +107,7 @@ namespace OpenLook virtual KDecoration *createDecoration(KDecorationBridge *); virtual bool reset(unsigned long changed); virtual bool supports( Ability ability ); - QValueList< DecorationFactory::BorderSize > borderSizes() const; + TQValueList< DecorationFactory::BorderSize > borderSizes() const; }; } diff --git a/kwin-styles/riscos/AboveButton.cpp b/kwin-styles/riscos/AboveButton.cpp index 738b7f79..7b66e3ba 100644 --- a/kwin-styles/riscos/AboveButton.cpp +++ b/kwin-styles/riscos/AboveButton.cpp @@ -44,13 +44,13 @@ static const char * const above_xpm[] = { " ..... ", " "}; -AboveButton::AboveButton(QWidget *parent) +AboveButton::AboveButton(TQWidget *parent) : Button(parent, i18n("Keep above others")) { - setPixmap(QPixmap((const char **)above_xpm)); + setPixmap(TQPixmap((const char **)above_xpm)); } -void AboveButton::mouseReleaseEvent(QMouseEvent *e) +void AboveButton::mouseReleaseEvent(TQMouseEvent *e) { Button::mouseReleaseEvent(e); diff --git a/kwin-styles/riscos/AboveButton.h b/kwin-styles/riscos/AboveButton.h index b7a910ec..9ea0e005 100644 --- a/kwin-styles/riscos/AboveButton.h +++ b/kwin-styles/riscos/AboveButton.h @@ -34,7 +34,7 @@ class AboveButton : public Button public: - AboveButton(QWidget *parent); + AboveButton(TQWidget *parent); signals: @@ -42,7 +42,7 @@ class AboveButton : public Button protected: - void mouseReleaseEvent(QMouseEvent*); + void mouseReleaseEvent(TQMouseEvent*); }; } // End namespace diff --git a/kwin-styles/riscos/Button.cpp b/kwin-styles/riscos/Button.cpp index d4da6ecc..d126ced1 100644 --- a/kwin-styles/riscos/Button.cpp +++ b/kwin-styles/riscos/Button.cpp @@ -20,23 +20,23 @@ Boston, MA 02110-1301, USA. */ -#include <qtooltip.h> +#include <tqtooltip.h> #include "Button.h" #include "Static.h" namespace RiscOS { -Button::Button(QWidget *parent, const QString& tip, +Button::Button(TQWidget *parent, const TQString& tip, const ButtonState realizeButtons) - : QWidget(parent, "Button", 0), + : TQWidget(parent, "Button", 0), realizeButtons_(realizeButtons), lastButton_(NoButton), alignment_(Left), down_ (false), active_ (false) { - QToolTip::add(this, tip); + TQToolTip::add(this, tip); setBackgroundColor(Qt::black); setFixedSize(Static::instance()->titleHeight() - 1, @@ -65,32 +65,32 @@ Button::Alignment Button::alignment() const return alignment_; } -void Button::mousePressEvent(QMouseEvent *e) +void Button::mousePressEvent(TQMouseEvent *e) { down_ = true; lastButton_ = e->button(); repaint(); - QMouseEvent me(e->type(), e->pos(), e->globalPos(), + TQMouseEvent me(e->type(), e->pos(), e->globalPos(), (e->button()&realizeButtons_) ? LeftButton : NoButton, e->state()); - QWidget::mousePressEvent(&me); + TQWidget::mousePressEvent(&me); } -void Button::mouseReleaseEvent(QMouseEvent *e) +void Button::mouseReleaseEvent(TQMouseEvent *e) { down_ = false; lastButton_ = e->button(); repaint(); - QMouseEvent me(e->type(), e->pos(), e->globalPos(), + TQMouseEvent me(e->type(), e->pos(), e->globalPos(), (e->button()&realizeButtons_) ? LeftButton : NoButton, e->state()); - QWidget::mouseReleaseEvent(&me); + TQWidget::mouseReleaseEvent(&me); } -void Button::setPixmap(const QPixmap &p) +void Button::setPixmap(const TQPixmap &p) { - if (QPixmap::defaultDepth() <= 8) + if (TQPixmap::defaultDepth() <= 8) aPixmap_ = iPixmap_ = p; else { @@ -98,8 +98,8 @@ void Button::setPixmap(const QPixmap &p) QRgb* data = NULL; QRgb w = qRgb(255, 255, 255); - QImage aTx(p.convertToImage()); - QImage iTx(aTx.copy()); + TQImage aTx(p.convertToImage()); + TQImage iTx(aTx.copy()); const KDecorationOptions* options = KDecoration::options(); light = options->color(KDecoration::ColorButtonBg, true).light(150).rgb(); @@ -136,7 +136,7 @@ void Button::setPixmap(const QPixmap &p) repaint(); } -void Button::paintEvent(QPaintEvent *) +void Button::paintEvent(TQPaintEvent *) { bitBlt(this, alignment_ == Left ? 1 : 0, 0, &Static::instance()->buttonBase(active_, down_)); diff --git a/kwin-styles/riscos/Button.h b/kwin-styles/riscos/Button.h index 1289a2fa..fc29e205 100644 --- a/kwin-styles/riscos/Button.h +++ b/kwin-styles/riscos/Button.h @@ -23,8 +23,8 @@ #ifndef RISC_OS_BUTTON_H #define RISC_OS_BUTTON_H -#include <qpixmap.h> -#include <qwidget.h> +#include <tqpixmap.h> +#include <tqwidget.h> #include <klocale.h> #include <kdecoration.h> @@ -41,7 +41,7 @@ class Button : public QWidget enum Alignment { Left, Right }; - Button(QWidget *parent, const QString &tip, + Button(TQWidget *parent, const TQString &tip, const ButtonState realizeButton = LeftButton); virtual ~Button(); @@ -55,13 +55,13 @@ class Button : public QWidget protected: - void paintEvent(QPaintEvent *); + void paintEvent(TQPaintEvent *); - void mousePressEvent(QMouseEvent *); - void mouseReleaseEvent(QMouseEvent *); - void mouseMoveEvent(QMouseEvent *) { /* Empty. */ } + void mousePressEvent(TQMouseEvent *); + void mouseReleaseEvent(TQMouseEvent *); + void mouseMoveEvent(TQMouseEvent *) { /* Empty. */ } - void setPixmap(const QPixmap &); + void setPixmap(const TQPixmap &); ButtonState realizeButtons_; ButtonState lastButton_; @@ -71,7 +71,7 @@ class Button : public QWidget Alignment alignment_; bool down_; bool active_; - QPixmap aPixmap_, iPixmap_; + TQPixmap aPixmap_, iPixmap_; }; } // End namespace diff --git a/kwin-styles/riscos/CloseButton.cpp b/kwin-styles/riscos/CloseButton.cpp index 4f2066cf..1a4c06b5 100644 --- a/kwin-styles/riscos/CloseButton.cpp +++ b/kwin-styles/riscos/CloseButton.cpp @@ -44,13 +44,13 @@ static const char * const close_xpm[] = { " .+. .+. ", " . . "}; -CloseButton::CloseButton(QWidget *parent) +CloseButton::CloseButton(TQWidget *parent) : Button(parent, i18n("Close")) { - setPixmap(QPixmap((const char **)close_xpm)); + setPixmap(TQPixmap((const char **)close_xpm)); } -void CloseButton::mouseReleaseEvent(QMouseEvent *e) +void CloseButton::mouseReleaseEvent(TQMouseEvent *e) { Button::mouseReleaseEvent(e); diff --git a/kwin-styles/riscos/CloseButton.h b/kwin-styles/riscos/CloseButton.h index 73791b76..b9173c14 100644 --- a/kwin-styles/riscos/CloseButton.h +++ b/kwin-styles/riscos/CloseButton.h @@ -34,7 +34,7 @@ class CloseButton : public Button public: - CloseButton(QWidget *parent); + CloseButton(TQWidget *parent); signals: @@ -42,7 +42,7 @@ class CloseButton : public Button protected: - void mouseReleaseEvent(QMouseEvent *); + void mouseReleaseEvent(TQMouseEvent *); }; } // End namespace; diff --git a/kwin-styles/riscos/HelpButton.cpp b/kwin-styles/riscos/HelpButton.cpp index a3d36668..936738eb 100644 --- a/kwin-styles/riscos/HelpButton.cpp +++ b/kwin-styles/riscos/HelpButton.cpp @@ -44,13 +44,13 @@ static const char * const help_xpm[] = { " + ++ ", " ++ "}; -HelpButton::HelpButton(QWidget *parent) +HelpButton::HelpButton(TQWidget *parent) : Button(parent, i18n("Help")) { - setPixmap(QPixmap((const char **)help_xpm)); + setPixmap(TQPixmap((const char **)help_xpm)); } -void HelpButton::mouseReleaseEvent(QMouseEvent *e) +void HelpButton::mouseReleaseEvent(TQMouseEvent *e) { Button::mouseReleaseEvent(e); diff --git a/kwin-styles/riscos/HelpButton.h b/kwin-styles/riscos/HelpButton.h index 89d76453..f825a05b 100644 --- a/kwin-styles/riscos/HelpButton.h +++ b/kwin-styles/riscos/HelpButton.h @@ -34,7 +34,7 @@ class HelpButton : public Button public: - HelpButton(QWidget *parent); + HelpButton(TQWidget *parent); signals: @@ -42,7 +42,7 @@ class HelpButton : public Button protected: - void mouseReleaseEvent(QMouseEvent *); + void mouseReleaseEvent(TQMouseEvent *); }; } // End namespace; diff --git a/kwin-styles/riscos/IconifyButton.cpp b/kwin-styles/riscos/IconifyButton.cpp index 760194f5..b5eef9e5 100644 --- a/kwin-styles/riscos/IconifyButton.cpp +++ b/kwin-styles/riscos/IconifyButton.cpp @@ -44,13 +44,13 @@ static const char * const iconify_xpm[] = { " ", " "}; -IconifyButton::IconifyButton(QWidget *parent) +IconifyButton::IconifyButton(TQWidget *parent) : Button(parent, i18n("Minimize")) { - setPixmap(QPixmap((const char **)iconify_xpm)); + setPixmap(TQPixmap((const char **)iconify_xpm)); } -void IconifyButton::mouseReleaseEvent(QMouseEvent *e) +void IconifyButton::mouseReleaseEvent(TQMouseEvent *e) { Button::mouseReleaseEvent(e); diff --git a/kwin-styles/riscos/IconifyButton.h b/kwin-styles/riscos/IconifyButton.h index 9c940713..8f757cb4 100644 --- a/kwin-styles/riscos/IconifyButton.h +++ b/kwin-styles/riscos/IconifyButton.h @@ -34,7 +34,7 @@ class IconifyButton : public Button public: - IconifyButton(QWidget *parent); + IconifyButton(TQWidget *parent); signals: @@ -42,7 +42,7 @@ class IconifyButton : public Button protected: - void mouseReleaseEvent(QMouseEvent *); + void mouseReleaseEvent(TQMouseEvent *); }; } // End namespace; diff --git a/kwin-styles/riscos/LowerButton.cpp b/kwin-styles/riscos/LowerButton.cpp index a14c6149..7f03e41f 100644 --- a/kwin-styles/riscos/LowerButton.cpp +++ b/kwin-styles/riscos/LowerButton.cpp @@ -44,13 +44,13 @@ static const char * const lower_xpm[] = { " ..... ", " "}; -LowerButton::LowerButton(QWidget *parent) +LowerButton::LowerButton(TQWidget *parent) : Button(parent, i18n("Keep below others")) { - setPixmap(QPixmap((const char **)lower_xpm)); + setPixmap(TQPixmap((const char **)lower_xpm)); } -void LowerButton::mouseReleaseEvent(QMouseEvent *e) +void LowerButton::mouseReleaseEvent(TQMouseEvent *e) { Button::mouseReleaseEvent(e); diff --git a/kwin-styles/riscos/LowerButton.h b/kwin-styles/riscos/LowerButton.h index ec5ab474..f3fc4df1 100644 --- a/kwin-styles/riscos/LowerButton.h +++ b/kwin-styles/riscos/LowerButton.h @@ -34,7 +34,7 @@ class LowerButton : public Button public: - LowerButton(QWidget *parent); + LowerButton(TQWidget *parent); signals: @@ -42,7 +42,7 @@ class LowerButton : public Button protected: - void mouseReleaseEvent(QMouseEvent *); + void mouseReleaseEvent(TQMouseEvent *); }; } // End namespace; diff --git a/kwin-styles/riscos/Manager.cpp b/kwin-styles/riscos/Manager.cpp index a890ac63..c4b77f0a 100644 --- a/kwin-styles/riscos/Manager.cpp +++ b/kwin-styles/riscos/Manager.cpp @@ -24,11 +24,11 @@ #include <config.h> // for usleep on non-linux platforms #include <math.h> // for sin and cos -#include <qapplication.h> -#include <qimage.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qpainter.h> +#include <tqapplication.h> +#include <tqimage.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpainter.h> #include <netwm.h> @@ -80,37 +80,37 @@ void Manager::init() resetLayout(); } -bool Manager::eventFilter(QObject *o, QEvent *e) +bool Manager::eventFilter(TQObject *o, TQEvent *e) { if (o != widget()) return false; switch (e->type()) { - case QEvent::Resize: - resizeEvent(static_cast<QResizeEvent*>(e)); + case TQEvent::Resize: + resizeEvent(static_cast<TQResizeEvent*>(e)); return true; - case QEvent::Paint: - paintEvent(static_cast<QPaintEvent*>(e)); + case TQEvent::Paint: + paintEvent(static_cast<TQPaintEvent*>(e)); return true; - case QEvent::MouseButtonDblClick: - mouseDoubleClickEvent(static_cast<QMouseEvent*>(e)); + case TQEvent::MouseButtonDblClick: + mouseDoubleClickEvent(static_cast<TQMouseEvent*>(e)); return true; - case QEvent::MouseButtonPress: - processMousePressEvent(static_cast<QMouseEvent*>(e)); + case TQEvent::MouseButtonPress: + processMousePressEvent(static_cast<TQMouseEvent*>(e)); return true; - case QEvent::Wheel: - wheelEvent( static_cast< QWheelEvent* >( e )); + case TQEvent::Wheel: + wheelEvent( static_cast< TQWheelEvent* >( e )); return true; - case QEvent::MouseButtonRelease: + case TQEvent::MouseButtonRelease: return false; - case QEvent::Show: + case TQEvent::Show: return false; - case QEvent::MouseMove: + case TQEvent::MouseMove: return false; - case QEvent::Enter: + case TQEvent::Enter: return false; - case QEvent::Leave: + case TQEvent::Leave: return false; - case QEvent::Move: + case TQEvent::Move: return false; default: return false; @@ -129,12 +129,12 @@ void Manager::borders(int &left, int &right, int &top, int &bottom) const bottom = isResizable() ? Static::instance()->resizeHeight() : 1; } -void Manager::resize(const QSize &s) +void Manager::resize(const TQSize &s) { widget()->resize(s); } -QSize Manager::minimumSize() const +TQSize Manager::minimumSize() const { return widget()->minimumSize(); } @@ -169,16 +169,16 @@ void Manager::shadeChange() { } -void Manager::paintEvent(QPaintEvent *e) +void Manager::paintEvent(TQPaintEvent *e) { - QPainter p(widget()); + TQPainter p(widget()); - QRect r(e->rect()); + TQRect r(e->rect()); - bool intersectsLeft = r.intersects(QRect(0, 0, 1, height())); + bool intersectsLeft = r.intersects(TQRect(0, 0, 1, height())); bool intersectsRight = - r.intersects(QRect(width() - 1, 0, width(), height())); + r.intersects(TQRect(width() - 1, 0, width(), height())); if (intersectsLeft || intersectsRight) { @@ -197,7 +197,7 @@ void Manager::paintEvent(QPaintEvent *e) // Title bar. - QRect tr = titleSpacer_->geometry(); + TQRect tr = titleSpacer_->geometry(); bitBlt(widget(), tr.topLeft(), &titleBuf_); // Resize bar. @@ -220,7 +220,7 @@ void Manager::paintEvent(QPaintEvent *e) p.drawLine(1, height() - 1, width() - 2, height() - 1); } -void Manager::resizeEvent(QResizeEvent*) +void Manager::resizeEvent(TQResizeEvent*) { updateButtonVisibility(); updateTitleBuffer(); @@ -292,14 +292,14 @@ void Manager::updateTitleBuffer() Static * s = Static::instance(); - QRect tr = titleSpacer_->geometry(); + TQRect tr = titleSpacer_->geometry(); if (tr.width() == 0 || tr.height() == 0) titleBuf_.resize(8, 8); else titleBuf_.resize(tr.size()); - QPainter p(&titleBuf_); + TQPainter p(&titleBuf_); p.drawPixmap(0, 0, s->titleTextLeft(active)); @@ -316,7 +316,7 @@ void Manager::updateTitleBuffer() p.drawPixmap(tr.width() - 3, 0, s->titleTextRight(active)); } -KDecoration::Position Manager::mousePosition(const QPoint& p) const +KDecoration::Position Manager::mousePosition(const TQPoint& p) const { Position m = PositionCenter; @@ -350,19 +350,19 @@ KDecoration::Position Manager::mousePosition(const QPoint& p) const return m; } -void Manager::mouseDoubleClickEvent(QMouseEvent *e) +void Manager::mouseDoubleClickEvent(TQMouseEvent *e) { if (e->button() == LeftButton && titleSpacer_->geometry().contains(e->pos())) titlebarDblClickOperation(); } -void Manager::wheelEvent(QWheelEvent *e) +void Manager::wheelEvent(TQWheelEvent *e) { if (isSetShade() || titleLayout_->geometry().contains(e->pos()) ) titlebarMouseWheelOperation( e->delta()); } -void Manager::paletteChange(const QPalette &) +void Manager::paletteChange(const TQPalette &) { resetLayout(); } @@ -430,7 +430,7 @@ bool Manager::animateMinimize(bool iconify) helperShowHide(false); qApp->syncX(); - QRect r = iconGeometry(); + TQRect r = iconGeometry(); if (!r.isValid()) return true; @@ -462,7 +462,7 @@ bool Manager::animateMinimize(bool iconify) double delta = finalAngle / steps; - QPainter p(workspaceWidget()); + TQPainter p(workspaceWidget()); p.setRasterOp(Qt::NotROP); for (double angle = 0; ; angle += delta) @@ -474,10 +474,10 @@ bool Manager::animateMinimize(bool iconify) double dch = (ch / 2) * cos(angle); double midy = cy + (ch / 2); - QPoint p1(int(cx + dx), int(midy - dch)); - QPoint p2(int(cx + cw - dx), p1.y()); - QPoint p3(int(cx + dw + dx), int(midy + dch)); - QPoint p4(int(cx - dx), p3.y()); + TQPoint p1(int(cx + dx), int(midy - dch)); + TQPoint p2(int(cx + cw - dx), p1.y()); + TQPoint p3(int(cx + dw + dx), int(midy + dch)); + TQPoint p4(int(cx - dx), p3.y()); grabXServer(); @@ -521,12 +521,12 @@ bool Manager::animateMinimize(bool iconify) int stepCount = 12; - QRect r(geometry()); + TQRect r(geometry()); int dx = r.width() / (stepCount * 2); int dy = r.height() / (stepCount * 2); - QPainter p(workspaceWidget()); + TQPainter p(workspaceWidget()); p.setRasterOp(Qt::NotROP); for (int step = 0; step < stepCount; step++) @@ -550,19 +550,19 @@ bool Manager::animateMinimize(bool iconify) default: { - QRect icongeom = iconGeometry(); + TQRect icongeom = iconGeometry(); if (!icongeom.isValid()) return true; - QRect wingeom = geometry(); + TQRect wingeom = geometry(); - QPainter p(workspaceWidget()); + TQPainter p(workspaceWidget()); p.setRasterOp(Qt::NotROP); #if 0 if (iconify) - p.setClipRegion(QRegion(workspaceWidget()->rect()) - wingeom); + p.setClipRegion(TQRegion(workspaceWidget()->rect()) - wingeom); #endif grabXServer(); @@ -594,7 +594,7 @@ void Manager::createTitle() leftButtonList_.clear(); rightButtonList_.clear(); - QString buttons; + TQString buttons; if (options()->customButtonPositions()) buttons = options()->titleButtonsLeft() + "|" + @@ -602,7 +602,7 @@ void Manager::createTitle() else buttons = "XSH|IA"; - QPtrList<Button> *buttonList = &leftButtonList_; + TQPtrList<Button> *buttonList = &leftButtonList_; for (unsigned int i = 0; i < buttons.length(); ++i) { @@ -612,9 +612,9 @@ void Manager::createTitle() { case 'S': // Sticky tb = new StickyButton(widget()); - connect(this, SIGNAL(stickyChanged(bool)), - tb, SLOT(setOn(bool))); - connect(tb, SIGNAL(toggleSticky()), this, SLOT(slotToggleSticky())); + connect(this, TQT_SIGNAL(stickyChanged(bool)), + tb, TQT_SLOT(setOn(bool))); + connect(tb, TQT_SIGNAL(toggleSticky()), this, TQT_SLOT(slotToggleSticky())); emit(stickyChanged(isOnAllDesktops())); break; @@ -622,7 +622,7 @@ void Manager::createTitle() if (providesContextHelp()) { tb = new HelpButton(widget()); - connect(tb, SIGNAL(help()), this, SLOT(showContextHelp())); + connect(tb, TQT_SIGNAL(help()), this, TQT_SLOT(showContextHelp())); } break; @@ -630,7 +630,7 @@ void Manager::createTitle() if (isMinimizable()) { tb = new IconifyButton(widget()); - connect(tb, SIGNAL(iconify()), this, SLOT(minimize())); + connect(tb, TQT_SIGNAL(iconify()), this, TQT_SLOT(minimize())); } break; @@ -638,29 +638,29 @@ void Manager::createTitle() if (isMaximizable()) { tb = new MaximiseButton(widget()); - connect(tb, SIGNAL(maximizeClicked(ButtonState)), - this, SLOT(slotMaximizeClicked(ButtonState))); - connect(this, SIGNAL(maximizeChanged(bool)), - tb, SLOT(setOn(bool))); + connect(tb, TQT_SIGNAL(maximizeClicked(ButtonState)), + this, TQT_SLOT(slotMaximizeClicked(ButtonState))); + connect(this, TQT_SIGNAL(maximizeChanged(bool)), + tb, TQT_SLOT(setOn(bool))); emit(maximizeChanged(maximizeMode() == MaximizeFull)); } break; case 'F': // Above tb = new AboveButton(widget()); - connect(tb, SIGNAL(above()), this, SLOT(slotAbove())); + connect(tb, TQT_SIGNAL(above()), this, TQT_SLOT(slotAbove())); break; case 'B': // Lower tb = new LowerButton(widget()); - connect(tb, SIGNAL(lower()), this, SLOT(slotLower())); + connect(tb, TQT_SIGNAL(lower()), this, TQT_SLOT(slotLower())); break; case 'X': // Close if (isCloseable()) { tb = new CloseButton(widget()); - connect(tb, SIGNAL(closeWindow()), this, SLOT(closeWindow())); + connect(tb, TQT_SIGNAL(closeWindow()), this, TQT_SLOT(closeWindow())); } break; @@ -671,23 +671,23 @@ void Manager::createTitle() if (tb != NULL) { - connect(this, SIGNAL(activeChanged(bool)), tb, SLOT(setActive(bool))); + connect(this, TQT_SIGNAL(activeChanged(bool)), tb, TQT_SLOT(setActive(bool))); buttonList->append(tb); } } - for (QPtrListIterator<Button> it(leftButtonList_); it.current(); ++it) + for (TQPtrListIterator<Button> it(leftButtonList_); it.current(); ++it) { it.current()->setAlignment(Button::Left); titleLayout_->addWidget(it.current()); } - titleSpacer_ = new QSpacerItem(0, Static::instance()->titleHeight(), - QSizePolicy::Expanding, QSizePolicy::Fixed); + titleSpacer_ = new TQSpacerItem(0, Static::instance()->titleHeight(), + TQSizePolicy::Expanding, TQSizePolicy::Fixed); titleLayout_->addItem(titleSpacer_); - for (QPtrListIterator<Button> it(rightButtonList_); it.current(); ++it) + for (TQPtrListIterator<Button> it(rightButtonList_); it.current(); ++it) { it.current()->setAlignment(Button::Right); titleLayout_->addWidget(it.current()); @@ -697,21 +697,21 @@ void Manager::createTitle() void Manager::resetLayout() { delete topLayout_; - topLayout_ = new QVBoxLayout(widget(), 0, 0); - topLayout_->setResizeMode(QLayout::FreeResize); + topLayout_ = new TQVBoxLayout(widget(), 0, 0); + topLayout_->setResizeMode(TQLayout::FreeResize); - titleLayout_ = new QBoxLayout(topLayout_, QBoxLayout::LeftToRight, 0, 0); - titleLayout_->setResizeMode(QLayout::FreeResize); + titleLayout_ = new TQBoxLayout(topLayout_, TQBoxLayout::LeftToRight, 0, 0); + titleLayout_->setResizeMode(TQLayout::FreeResize); createTitle(); - QBoxLayout *midLayout = new QBoxLayout(topLayout_, QBoxLayout::LeftToRight, + TQBoxLayout *midLayout = new TQBoxLayout(topLayout_, TQBoxLayout::LeftToRight, 0, 0); - midLayout->setResizeMode(QLayout::FreeResize); + midLayout->setResizeMode(TQLayout::FreeResize); midLayout->addSpacing(1); if (isPreview()) midLayout->addWidget( - new QLabel(i18n("<center><b>RiscOS preview</b></center>"), widget())); + new TQLabel(i18n("<center><b>RiscOS preview</b></center>"), widget())); midLayout->addSpacing(1); if (isResizable()) diff --git a/kwin-styles/riscos/Manager.h b/kwin-styles/riscos/Manager.h index 1d30b7a6..c5269051 100644 --- a/kwin-styles/riscos/Manager.h +++ b/kwin-styles/riscos/Manager.h @@ -23,7 +23,7 @@ #ifndef RISC_OS_MANAGER_H #define RISC_OS_MANAGER_H -#include <qdict.h> +#include <tqdict.h> #include <kdecoration.h> #include <kdecorationfactory.h> @@ -51,11 +51,11 @@ class Manager : public KDecoration Manager(KDecorationBridge*, KDecorationFactory*); ~Manager(); void init(); - bool eventFilter(QObject*, QEvent*); + bool eventFilter(TQObject*, TQEvent*); void reset(unsigned long changed); void borders(int&, int&, int&, int&) const; - void resize(const QSize&); - QSize minimumSize() const; + void resize(const TQSize&); + TQSize minimumSize() const; void activeChange(); void captionChange(); void iconChange(); @@ -78,14 +78,14 @@ class Manager : public KDecoration protected: - KDecoration::Position mousePosition(const QPoint &) const; - void paletteChange(const QPalette &); + KDecoration::Position mousePosition(const TQPoint &) const; + void paletteChange(const TQPalette &); void activeChange(bool); void stickyChange(bool); - void paintEvent(QPaintEvent *); - void resizeEvent(QResizeEvent *); - void mouseDoubleClickEvent(QMouseEvent *); - void wheelEvent(QWheelEvent *e); + void paintEvent(TQPaintEvent *); + void resizeEvent(TQResizeEvent *); + void mouseDoubleClickEvent(TQMouseEvent *); + void wheelEvent(TQWheelEvent *e); bool animateMinimize(bool); void updateButtonVisibility(); void updateTitleBuffer(); @@ -95,16 +95,16 @@ class Manager : public KDecoration private: - QVBoxLayout *topLayout_; - QBoxLayout *titleLayout_; - QSpacerItem *titleSpacer_; + TQVBoxLayout *topLayout_; + TQBoxLayout *titleLayout_; + TQSpacerItem *titleSpacer_; - QPixmap titleBuf_; - QPtrList<Button> leftButtonList_; - QPtrList<Button> rightButtonList_; + TQPixmap titleBuf_; + TQPtrList<Button> leftButtonList_; + TQPtrList<Button> rightButtonList_; }; -class Factory : public QObject, public KDecorationFactory +class Factory : public TQObject, public KDecorationFactory { Q_OBJECT diff --git a/kwin-styles/riscos/MaximiseButton.cpp b/kwin-styles/riscos/MaximiseButton.cpp index b82f2867..ebfb6628 100644 --- a/kwin-styles/riscos/MaximiseButton.cpp +++ b/kwin-styles/riscos/MaximiseButton.cpp @@ -22,7 +22,7 @@ #include "MaximiseButton.h" -#include <qtooltip.h> +#include <tqtooltip.h> namespace RiscOS { @@ -65,25 +65,25 @@ static const char * const unmaximise_xpm[] = { " ", " "}; -MaximiseButton::MaximiseButton(QWidget * parent) +MaximiseButton::MaximiseButton(TQWidget * parent) : Button(parent, i18n("Maximize"), (ButtonState)(LeftButton|MidButton|RightButton)), on_(false) { - setPixmap(QPixmap((const char **)maximise_xpm)); + setPixmap(TQPixmap((const char **)maximise_xpm)); } void MaximiseButton::setOn(bool on) { on_ = on; - setPixmap(on_ ? QPixmap((const char **)unmaximise_xpm) - : QPixmap((const char **)maximise_xpm)); + setPixmap(on_ ? TQPixmap((const char **)unmaximise_xpm) + : TQPixmap((const char **)maximise_xpm)); repaint(); - QToolTip::remove(this); - QToolTip::add(this, on_ ? i18n("Restore") : i18n("Maximize")); + TQToolTip::remove(this); + TQToolTip::add(this, on_ ? i18n("Restore") : i18n("Maximize")); } -void MaximiseButton::mouseReleaseEvent(QMouseEvent *e) +void MaximiseButton::mouseReleaseEvent(TQMouseEvent *e) { Button::mouseReleaseEvent(e); diff --git a/kwin-styles/riscos/MaximiseButton.h b/kwin-styles/riscos/MaximiseButton.h index 7da4bc0a..ff715ba1 100644 --- a/kwin-styles/riscos/MaximiseButton.h +++ b/kwin-styles/riscos/MaximiseButton.h @@ -34,7 +34,7 @@ class MaximiseButton : public Button public: - MaximiseButton(QWidget *parent); + MaximiseButton(TQWidget *parent); public slots: @@ -46,7 +46,7 @@ class MaximiseButton : public Button protected: - void mouseReleaseEvent(QMouseEvent *); + void mouseReleaseEvent(TQMouseEvent *); private: diff --git a/kwin-styles/riscos/Palette.h b/kwin-styles/riscos/Palette.h index e13457a6..260175b9 100644 --- a/kwin-styles/riscos/Palette.h +++ b/kwin-styles/riscos/Palette.h @@ -23,8 +23,8 @@ #ifndef RISC_OS_PALETTE_H #define RISC_OS_PALETTE_H -#include <qmemarray.h> -#include <qglobal.h> +#include <tqmemarray.h> +#include <tqglobal.h> namespace RiscOS { @@ -59,7 +59,7 @@ class Palette private: - QMemArray<QRgb> data_; + TQMemArray<QRgb> data_; }; } // End namespace diff --git a/kwin-styles/riscos/Static.cpp b/kwin-styles/riscos/Static.cpp index 675cdfc1..5c6e427d 100644 --- a/kwin-styles/riscos/Static.cpp +++ b/kwin-styles/riscos/Static.cpp @@ -25,10 +25,10 @@ #undef Bool #endif -#include <qimage.h> -#include <qpixmap.h> -#include <qpainter.h> -#include <qptrlist.h> +#include <tqimage.h> +#include <tqpixmap.h> +#include <tqpainter.h> +#include <tqptrlist.h> #include <kdecoration.h> @@ -71,37 +71,37 @@ Static::~Static() instance_ = NULL; } -const QPixmap& Static::titleTextLeft(bool active) const +const TQPixmap& Static::titleTextLeft(bool active) const { return active ? aTitleTextLeft_ : iTitleTextLeft_; } -const QPixmap& Static::titleTextRight(bool active) const +const TQPixmap& Static::titleTextRight(bool active) const { return active ? aTitleTextRight_ : iTitleTextRight_; } -const QPixmap& Static::resizeMidLeft(bool active) const +const TQPixmap& Static::resizeMidLeft(bool active) const { return active ? aResizeMidLeft_ : iResizeMidLeft_; } -const QPixmap& Static::resizeMidRight(bool active) const +const TQPixmap& Static::resizeMidRight(bool active) const { return active ? aResizeMidRight_ : iResizeMidRight_; } -const QPixmap& Static::titleTextMid(bool active) const +const TQPixmap& Static::titleTextMid(bool active) const { return active ? aTitleTextMid_ : iTitleTextMid_; } -const QPixmap& Static::resizeMidMid(bool active) const +const TQPixmap& Static::resizeMidMid(bool active) const { return active ? aResizeMid_ : iResizeMid_; } -const QPixmap& Static::resize(bool active) const +const TQPixmap& Static::resize(bool active) const { return active ? aResize_ : iResize_; } @@ -121,7 +121,7 @@ int Static::resizeHeight() const return resizeHeight_; } -void Static::_drawBorder(QPixmap &pix, int w, int h) +void Static::_drawBorder(TQPixmap &pix, int w, int h) { // 0111111113 // 1122222235 @@ -134,14 +134,14 @@ void Static::_drawBorder(QPixmap &pix, int w, int h) painter_.begin(&pix); painter_.translate(transx, transy); - QColor c0 = down_ ? palette_[7] : palette_[0]; - QColor c1 = down_ ? palette_[6] : palette_[1]; - QColor c2 = down_ ? palette_[5] : palette_[2]; - QColor c3 = down_ ? palette_[4] : palette_[3]; - QColor c4 = down_ ? palette_[3] : palette_[4]; - QColor c5 = down_ ? palette_[2] : palette_[5]; - QColor c6 = down_ ? palette_[2] : palette_[6]; - QColor c7 = down_ ? palette_[1] : palette_[7]; + TQColor c0 = down_ ? palette_[7] : palette_[0]; + TQColor c1 = down_ ? palette_[6] : palette_[1]; + TQColor c2 = down_ ? palette_[5] : palette_[2]; + TQColor c3 = down_ ? palette_[4] : palette_[3]; + TQColor c4 = down_ ? palette_[3] : palette_[4]; + TQColor c5 = down_ ? palette_[2] : palette_[5]; + TQColor c6 = down_ ? palette_[2] : palette_[6]; + TQColor c7 = down_ ? palette_[1] : palette_[7]; painter_.setPen(c0); painter_.drawPoint(0, 0); @@ -183,7 +183,7 @@ void Static::_drawBorder(QPixmap &pix, int w, int h) painter_.resetXForm(); } -void setPalette(Palette &pal, QColor c) +void setPalette(Palette &pal, TQColor c) { pal[3] = c.rgb(); @@ -204,7 +204,7 @@ void setPalette(Palette &pal, QColor c) void Static::_init() { - hicolour_ = QPixmap::defaultDepth() > 8; + hicolour_ = TQPixmap::defaultDepth() > 8; animationStyle_ = 0; updatePixmaps(); } @@ -242,13 +242,13 @@ void Static::updatePixmaps() _drawButtonBackgrounds(); } -void Static::_createTexture(QPixmap &px, int t, bool active) +void Static::_createTexture(TQPixmap &px, int t, bool active) { - const QImage texture(QPixmap((const char **)texture_xpm).convertToImage()); + const TQImage texture(TQPixmap((const char **)texture_xpm).convertToImage()); const QRgb w(qRgb(255, 255, 255)); const QRgb b(qRgb(0, 0, 0)); - QColor c(KDecoration::options()->color(KDecoration::ColorType(t), active)); + TQColor c(KDecoration::options()->color(KDecoration::ColorType(t), active)); QRgb mid (c.rgb()); QRgb light (c.light(110).rgb()); @@ -267,7 +267,7 @@ void Static::_createTexture(QPixmap &px, int t, bool active) px.convertFromImage(texture); } -const QPixmap& Static::buttonBase(bool active, bool down) const +const TQPixmap& Static::buttonBase(bool active, bool down) const { if (active) return down ? aButtonDown_ : aButtonUp_; @@ -277,9 +277,9 @@ const QPixmap& Static::buttonBase(bool active, bool down) const void Static::_initSizes() { - QFont f(KDecoration::options()->font(true)); // XXX false doesn't work right at the moment + TQFont f(KDecoration::options()->font(true)); // XXX false doesn't work right at the moment - QFontMetrics fm(f); + TQFontMetrics fm(f); int h = fm.height(); @@ -361,7 +361,7 @@ void Static::_initTextures() void Static::_drawTitleTextAreaSides() { - QPixmap temp(4, titleHeight_); + TQPixmap temp(4, titleHeight_); temp.fill(Qt::black); transx = transy = 0.0; @@ -393,7 +393,7 @@ void Static::_drawTitleTextAreaSides() void Static::_drawResizeCentralAreaSides() { - QPixmap temp(4, resizeHeight_); + TQPixmap temp(4, resizeHeight_); temp.fill(Qt::black); transy = 1.0; @@ -424,7 +424,7 @@ void Static::_drawResizeCentralAreaSides() void Static::_drawTitleTextAreaBackground() { - QPixmap temp(70, titleHeight_); + TQPixmap temp(70, titleHeight_); temp.fill(Qt::black); transx = transy = 0.0; @@ -450,7 +450,7 @@ void Static::_drawTitleTextAreaBackground() void Static::_drawResizeCentralAreaBackground() { - QPixmap temp(70, titleHeight_); + TQPixmap temp(70, titleHeight_); temp.fill(Qt::black); transy = 1.0; diff --git a/kwin-styles/riscos/Static.h b/kwin-styles/riscos/Static.h index 8a01d03b..e7b49d59 100644 --- a/kwin-styles/riscos/Static.h +++ b/kwin-styles/riscos/Static.h @@ -23,10 +23,10 @@ #ifndef RISC_OS_STATIC_H #define RISC_OS_STATIC_H -#include <qimage.h> -#include <qpixmap.h> -#include <qpainter.h> -#include <qstringlist.h> +#include <tqimage.h> +#include <tqpixmap.h> +#include <tqpainter.h> +#include <tqstringlist.h> #include "Palette.h" @@ -54,14 +54,14 @@ class Static void reset(); void updatePixmaps(); - const QPixmap& titleTextLeft(bool active) const; - const QPixmap& titleTextRight(bool active) const; - const QPixmap& resizeMidLeft(bool active) const; - const QPixmap& resizeMidRight(bool active) const; - const QPixmap& titleTextMid(bool active) const; - const QPixmap& resizeMidMid(bool active) const; - const QPixmap& buttonBase(bool active, bool down) const; - const QPixmap& resize(bool active) const; + const TQPixmap& titleTextLeft(bool active) const; + const TQPixmap& titleTextRight(bool active) const; + const TQPixmap& resizeMidLeft(bool active) const; + const TQPixmap& resizeMidRight(bool active) const; + const TQPixmap& titleTextMid(bool active) const; + const TQPixmap& resizeMidMid(bool active) const; + const TQPixmap& buttonBase(bool active, bool down) const; + const TQPixmap& resize(bool active) const; int animationStyle() const; int titleHeight() const; @@ -71,8 +71,8 @@ class Static void _init(); - void _drawBorder(QPixmap&, int, int); - void _createTexture(QPixmap&, int, bool); + void _drawBorder(TQPixmap&, int, int); + void _createTexture(TQPixmap&, int, bool); void _initSizes(); @@ -111,9 +111,9 @@ class Static aResizeMidRight_, iResizeMidRight_, aResizeMid_, iResizeMid_; - QPixmap aTexture_, iTexture_, abTexture_, ibTexture_; + TQPixmap aTexture_, iTexture_, abTexture_, ibTexture_; - QPainter painter_; + TQPainter painter_; bool down_; Palette palette_; double transx, transy; diff --git a/kwin-styles/riscos/StickyButton.cpp b/kwin-styles/riscos/StickyButton.cpp index 808f04c7..b40db535 100644 --- a/kwin-styles/riscos/StickyButton.cpp +++ b/kwin-styles/riscos/StickyButton.cpp @@ -22,7 +22,7 @@ #include "StickyButton.h" -#include <qtooltip.h> +#include <tqtooltip.h> namespace RiscOS { @@ -66,24 +66,24 @@ static const char * const sticky_xpm[] = { ".. "}; -StickyButton::StickyButton(QWidget *parent) +StickyButton::StickyButton(TQWidget *parent) : Button(parent, i18n("On all desktops")), on_(false) { - setPixmap(QPixmap((const char **)sticky_xpm)); + setPixmap(TQPixmap((const char **)sticky_xpm)); } void StickyButton::setOn(bool on) { on_ = on; - setPixmap(on_ ? QPixmap((const char **)unsticky_xpm) : - QPixmap((const char **)sticky_xpm)); + setPixmap(on_ ? TQPixmap((const char **)unsticky_xpm) : + TQPixmap((const char **)sticky_xpm)); repaint(); - QToolTip::remove(this); - QToolTip::add(this, on_ ? i18n("Not on all desktops") + TQToolTip::remove(this); + TQToolTip::add(this, on_ ? i18n("Not on all desktops") : i18n("On all desktops")); } -void StickyButton::mouseReleaseEvent(QMouseEvent *e) +void StickyButton::mouseReleaseEvent(TQMouseEvent *e) { Button::mouseReleaseEvent(e); diff --git a/kwin-styles/riscos/StickyButton.h b/kwin-styles/riscos/StickyButton.h index fb7746ae..4c500b8b 100644 --- a/kwin-styles/riscos/StickyButton.h +++ b/kwin-styles/riscos/StickyButton.h @@ -34,7 +34,7 @@ class StickyButton : public Button public: - StickyButton(QWidget *parent); + StickyButton(TQWidget *parent); public slots: @@ -46,7 +46,7 @@ class StickyButton : public Button protected: - void mouseReleaseEvent(QMouseEvent *); + void mouseReleaseEvent(TQMouseEvent *); private: diff --git a/kwin-styles/smooth-blend/client/buttons.h b/kwin-styles/smooth-blend/client/buttons.h index a62268b7..ac0eaa8e 100644 --- a/kwin-styles/smooth-blend/client/buttons.h +++ b/kwin-styles/smooth-blend/client/buttons.h @@ -24,10 +24,10 @@ ** WARNING! All changes made in this file will be lost! ****************************************************************************/ -#include <qimage.h> -#include <qdict.h> -#include <qmime.h> -#include <qdragobject.h> +#include <tqimage.h> +#include <tqdict.h> +#include <tqmime.h> +#include <tqdragobject.h> // circle.png static const unsigned char image_0_data[] = { @@ -1726,20 +1726,20 @@ static struct EmbedImage { { 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; -static QImage uic_findImage( const QString& name ) +static TQImage uic_findImage( const TQString& name ) { for ( int i=0; embed_image_vec[i].data; i++ ) { - if ( QString::fromUtf8(embed_image_vec[i].name) == name ) { - QByteArray baunzip; + if ( TQString::fromUtf8(embed_image_vec[i].name) == name ) { + TQByteArray baunzip; baunzip = qUncompress( embed_image_vec[i].data, embed_image_vec[i].compressed ); - QImage img((uchar*)baunzip.data(), + TQImage img((uchar*)baunzip.data(), embed_image_vec[i].width, embed_image_vec[i].height, embed_image_vec[i].depth, (QRgb*)embed_image_vec[i].colorTable, embed_image_vec[i].numColors, - QImage::BigEndian + TQImage::BigEndian ); img = img.copy(); if ( embed_image_vec[i].alpha ) @@ -1747,7 +1747,7 @@ static QImage uic_findImage( const QString& name ) return img; } } - return QImage(); + return TQImage(); } class MimeSourceFactory_smoothblend : public QMimeSourceFactory @@ -1755,30 +1755,30 @@ class MimeSourceFactory_smoothblend : public QMimeSourceFactory public: MimeSourceFactory_smoothblend() {} ~MimeSourceFactory_smoothblend() {} - const QMimeSource* data( const QString& abs_name ) const { - const QMimeSource* d = QMimeSourceFactory::data( abs_name ); + const TQMimeSource* data( const TQString& abs_name ) const { + const TQMimeSource* d = TQMimeSourceFactory::data( abs_name ); if ( d || abs_name.isNull() ) return d; - QImage img = uic_findImage( abs_name ); + TQImage img = uic_findImage( abs_name ); if ( !img.isNull() ) - ((QMimeSourceFactory*)this)->setImage( abs_name, img ); - return QMimeSourceFactory::data( abs_name ); + ((TQMimeSourceFactory*)this)->setImage( abs_name, img ); + return TQMimeSourceFactory::data( abs_name ); }; }; -static QMimeSourceFactory* bfactory = 0; +static TQMimeSourceFactory* bfactory = 0; void qInitImages_smoothblend() { if ( !bfactory ) { bfactory = new MimeSourceFactory_smoothblend; - QMimeSourceFactory::defaultFactory()->addFactory( bfactory ); + TQMimeSourceFactory::defaultFactory()->addFactory( bfactory ); } } void qCleanupImages_smoothblend() { if ( bfactory ) { - QMimeSourceFactory::defaultFactory()->removeFactory( bfactory ); + TQMimeSourceFactory::defaultFactory()->removeFactory( bfactory ); delete bfactory; bfactory = 0; } diff --git a/kwin-styles/smooth-blend/client/config/smoothblendconfig.cc b/kwin-styles/smooth-blend/client/config/smoothblendconfig.cc index 30472143..3ec445b9 100644 --- a/kwin-styles/smooth-blend/client/config/smoothblendconfig.cc +++ b/kwin-styles/smooth-blend/client/config/smoothblendconfig.cc @@ -10,13 +10,13 @@ #include <kconfig.h> #include <klocale.h> #include <kglobal.h> -#include <qbuttongroup.h> -#include <qgroupbox.h> -#include <qradiobutton.h> -#include <qcheckbox.h> -#include <qspinbox.h> -#include <qwhatsthis.h> -#include <qcombobox.h> +#include <tqbuttongroup.h> +#include <tqgroupbox.h> +#include <tqradiobutton.h> +#include <tqcheckbox.h> +#include <tqspinbox.h> +#include <tqwhatsthis.h> +#include <tqcombobox.h> #include "smoothblendconfig.h" #include "configdialog.h" @@ -26,8 +26,8 @@ // ------------- // Constructor -smoothblendConfig::smoothblendConfig(KConfig* config, QWidget* parent) - : QObject(parent), config_(0), dialog_(0) { +smoothblendConfig::smoothblendConfig(KConfig* config, TQWidget* parent) + : TQObject(parent), config_(0), dialog_(0) { // create the configuration object config_ = new KConfig("kwinsmoothblendrc"); KGlobal::locale()->insertCatalogue("kwin_smoothblend_config"); @@ -40,20 +40,20 @@ smoothblendConfig::smoothblendConfig(KConfig* config, QWidget* parent) load(config_); // setup the connections for title align - connect(dialog_->titlealign, SIGNAL(clicked(int)),this, SLOT(selectionChanged(int))); + connect(dialog_->titlealign, TQT_SIGNAL(clicked(int)),this, TQT_SLOT(selectionChanged(int))); // setup the connections for corner rounding - connect(dialog_->roundCorners, SIGNAL(stateChanged(int)),this,SLOT(selectionChanged(int))); + connect(dialog_->roundCorners, TQT_SIGNAL(stateChanged(int)),this,TQT_SLOT(selectionChanged(int))); // setup title shadow - connect(dialog_->titleshadow, SIGNAL(stateChanged(int)),this,SLOT(selectionChanged(int))); + connect(dialog_->titleshadow, TQT_SIGNAL(stateChanged(int)),this,TQT_SLOT(selectionChanged(int))); // setup button actions - connect(dialog_->animatebuttons, SIGNAL(stateChanged(int)),this,SLOT(selectionChanged(int))); - connect(dialog_->btnComboBox, SIGNAL(activated(int)),this,SLOT(selectionChanged(int))); + connect(dialog_->animatebuttons, TQT_SIGNAL(stateChanged(int)),this,TQT_SLOT(selectionChanged(int))); + connect(dialog_->btnComboBox, TQT_SIGNAL(activated(int)),this,TQT_SLOT(selectionChanged(int))); // setup the connections for spin boxes - connect(dialog_->titlesize, SIGNAL(valueChanged(int)),this,SLOT(selectionChanged(int))); - connect(dialog_->buttonsize, SIGNAL(valueChanged(int)),this,SLOT(selectionChanged(int))); - connect(dialog_->framesize, SIGNAL(valueChanged(int)),this,SLOT(selectionChanged(int))); + connect(dialog_->titlesize, TQT_SIGNAL(valueChanged(int)),this,TQT_SLOT(selectionChanged(int))); + connect(dialog_->buttonsize, TQT_SIGNAL(valueChanged(int)),this,TQT_SLOT(selectionChanged(int))); + connect(dialog_->framesize, TQT_SIGNAL(valueChanged(int)),this,TQT_SLOT(selectionChanged(int))); // double click the menu - connect(dialog_->menuClose, SIGNAL(stateChanged(int)),this, SLOT(selectionChanged(int))); + connect(dialog_->menuClose, TQT_SIGNAL(stateChanged(int)),this, TQT_SLOT(selectionChanged(int))); } ////////////////////////////////////////////////////////////////////////////// @@ -99,8 +99,8 @@ void smoothblendConfig::selectionChanged(int) { void smoothblendConfig::load(KConfig*) { config_->setGroup("General"); - QString value = config_->readEntry("TitleAlignment", "AlignHCenter"); - QRadioButton *button = (QRadioButton*)dialog_->titlealign->child(value.latin1()); + TQString value = config_->readEntry("TitleAlignment", "AlignHCenter"); + TQRadioButton *button = (TQRadioButton*)dialog_->titlealign->child(value.latin1()); if (button) { button->setChecked(true); @@ -129,10 +129,10 @@ void smoothblendConfig::load(KConfig*) { void smoothblendConfig::save(KConfig*) { config_->setGroup("General"); - QRadioButton *button = (QRadioButton*)dialog_->titlealign->selected(); + TQRadioButton *button = (TQRadioButton*)dialog_->titlealign->selected(); if (button) { - config_->writeEntry("TitleAlignment", QString(button->name())); + config_->writeEntry("TitleAlignment", TQString(button->name())); } config_->writeEntry("RoundCorners", dialog_->roundCorners->isChecked() ); config_->writeEntry("TitleSize", dialog_->titlesize->value() ); @@ -152,7 +152,7 @@ void smoothblendConfig::save(KConfig*) { // Set configuration defaults void smoothblendConfig::defaults() { - QRadioButton *button = (QRadioButton*)dialog_->titlealign->child("AlignHCenter"); + TQRadioButton *button = (TQRadioButton*)dialog_->titlealign->child("AlignHCenter"); if (button) { button->setChecked(true); @@ -172,7 +172,7 @@ void smoothblendConfig::defaults() { ////////////////////////////////////////////////////////////////////////////// extern "C" { - QObject* allocate_config(KConfig* config, QWidget* parent) { + TQObject* allocate_config(KConfig* config, TQWidget* parent) { return (new smoothblendConfig(config, parent)); } } diff --git a/kwin-styles/smooth-blend/client/config/smoothblendconfig.h b/kwin-styles/smooth-blend/client/config/smoothblendconfig.h index 3c4d18f7..de861779 100644 --- a/kwin-styles/smooth-blend/client/config/smoothblendconfig.h +++ b/kwin-styles/smooth-blend/client/config/smoothblendconfig.h @@ -25,15 +25,15 @@ #ifndef SMOOTHBLENDCONFIG_H #define SMOOTHBLENDCONFIG_H -#include <qobject.h> +#include <tqobject.h> class KConfig; class ConfigDialog; -class smoothblendConfig : public QObject { +class smoothblendConfig : public TQObject { Q_OBJECT public: - smoothblendConfig(KConfig* config, QWidget* parent); + smoothblendConfig(KConfig* config, TQWidget* parent); ~smoothblendConfig(); signals: diff --git a/kwin-styles/smooth-blend/client/smoothblend.cc b/kwin-styles/smooth-blend/client/smoothblend.cc index 9adb60ac..67d2fa48 100644 --- a/kwin-styles/smooth-blend/client/smoothblend.cc +++ b/kwin-styles/smooth-blend/client/smoothblend.cc @@ -17,13 +17,13 @@ #include <kpixmapeffect.h> #include <kpixmap.h> -#include <qbitmap.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qpainter.h> -#include <qtooltip.h> -#include <qtimer.h> -#include <qapplication.h> +#include <tqbitmap.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqtooltip.h> +#include <tqtimer.h> +#include <tqapplication.h> #include "smoothblend.h" #include "buttons.h" @@ -122,7 +122,7 @@ bool smoothblendFactory::readConfig() { config.setGroup("General"); // grab settings - QString value = config.readEntry("TitleAlignment", "AlignHCenter"); + TQString value = config.readEntry("TitleAlignment", "AlignHCenter"); if (value == "AlignLeft") titlealign_ = Qt::AlignLeft; else if (value == "AlignHCenter") @@ -156,7 +156,7 @@ bool smoothblendFactory::readConfig() { // smoothblendButton() // --------------- // Constructor -smoothblendButton::smoothblendButton(smoothblendClient *parent, const char *name, const QString& tip, ButtonType type, int button_size, bool toggle): QButton(parent->widget(), name), +smoothblendButton::smoothblendButton(smoothblendClient *parent, const char *name, const TQString& tip, ButtonType type, int button_size, bool toggle): TQButton(parent->widget(), name), client_(parent), type_(type), size_(button_size), @@ -167,13 +167,13 @@ smoothblendButton::smoothblendButton(smoothblendClient *parent, const char *name setBackgroundMode(NoBackground); setFixedSize( ::factory->buttonSize(), ::factory->buttonSize()); setCursor(arrowCursor); - QToolTip::add(this, tip); + TQToolTip::add(this, tip); setToggleButton(toggle); //button animation setup - animTmr = new QTimer(this); - connect(animTmr, SIGNAL(timeout() ), this, SLOT(animate() ) ); - connect(this, SIGNAL(pressed() ), this, SLOT(buttonClicked() ) ); - connect(this, SIGNAL(released() ), this, SLOT(buttonReleased() ) ); + animTmr = new TQTimer(this); + connect(animTmr, TQT_SIGNAL(timeout() ), this, TQT_SLOT(animate() ) ); + connect(this, TQT_SIGNAL(pressed() ), this, TQT_SLOT(buttonClicked() ) ); + connect(this, TQT_SIGNAL(released() ), this, TQT_SLOT(buttonReleased() ) ); animProgress = 0; m_clicked=false; } @@ -188,8 +188,8 @@ smoothblendButton::~smoothblendButton() { // ---------- // Return size hint -QSize smoothblendButton::sizeHint() const { - return QSize(::factory->buttonSize(), ::factory->buttonSize()); +TQSize smoothblendButton::sizeHint() const { + return TQSize(::factory->buttonSize(), ::factory->buttonSize()); } ////////////////////////////////////////////////////////////////////////////// @@ -239,9 +239,9 @@ void smoothblendButton::animate() { // ------------ // Mouse has entered the button -void smoothblendButton::enterEvent(QEvent *e) { +void smoothblendButton::enterEvent(TQEvent *e) { // we wanted to pass on the event - QButton::enterEvent(e); + TQButton::enterEvent(e); // we want to do mouseovers, so keep track of it here hover_=true; if(!m_clicked) @@ -255,9 +255,9 @@ void smoothblendButton::enterEvent(QEvent *e) { // ------------ // Mouse has left the button -void smoothblendButton::leaveEvent(QEvent *e) { +void smoothblendButton::leaveEvent(TQEvent *e) { // we wanted to pass on the event - QButton::leaveEvent(e); + TQButton::leaveEvent(e); // we want to do mouseovers, so keep track of it here hover_=false; if(!m_clicked) @@ -271,7 +271,7 @@ void smoothblendButton::leaveEvent(QEvent *e) { // ----------------- // Button has been pressed -void smoothblendButton::mousePressEvent(QMouseEvent* e) { +void smoothblendButton::mousePressEvent(TQMouseEvent* e) { lastmouse_ = e->button(); // translate and pass on mouse event @@ -279,9 +279,9 @@ void smoothblendButton::mousePressEvent(QMouseEvent* e) { if ((type_ != ButtonMax) && (e->button() != LeftButton)) { button = NoButton; // middle & right buttons inappropriate } - QMouseEvent me(e->type(), e->pos(), e->globalPos(), + TQMouseEvent me(e->type(), e->pos(), e->globalPos(), button, e->state()); - QButton::mousePressEvent(&me); + TQButton::mousePressEvent(&me); } ////////////////////////////////////////////////////////////////////////////// @@ -289,7 +289,7 @@ void smoothblendButton::mousePressEvent(QMouseEvent* e) { // ----------------- // Button has been released -void smoothblendButton::mouseReleaseEvent(QMouseEvent* e) { +void smoothblendButton::mouseReleaseEvent(TQMouseEvent* e) { lastmouse_ = e->button(); // translate and pass on mouse event @@ -297,8 +297,8 @@ void smoothblendButton::mouseReleaseEvent(QMouseEvent* e) { if ((type_ != ButtonMax) && (e->button() != LeftButton)) { button = NoButton; // middle & right buttons inappropriate } - 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); if(m_clicked) { m_clicked=false; @@ -307,21 +307,21 @@ void smoothblendButton::mouseReleaseEvent(QMouseEvent* e) { void smoothblendButton::setOn(bool on) { - QButton::setOn(on); + TQButton::setOn(on); } void smoothblendButton::setDown(bool on) { - QButton::setDown(on); + TQButton::setDown(on); } ////////////////////////////////////////////////////////// // getButtonImage() // ---------------- -// get the button QImage based on type and window mode -QImage smoothblendButton::getButtonImage(ButtonType type) +// get the button TQImage based on type and window mode +TQImage smoothblendButton::getButtonImage(ButtonType type) { - QImage finalImage; + TQImage finalImage; switch(type) { case ButtonClose: finalImage = uic_findImage( "close.png" ); @@ -394,7 +394,7 @@ QImage smoothblendButton::getButtonImage(ButtonType type) // ------------------------- // draw the pixmap button -void smoothblendButton::drawButton( QPainter *painter ) { +void smoothblendButton::drawButton( TQPainter *painter ) { if ( !smoothblendFactory::initialized() ) return ; @@ -402,11 +402,11 @@ void smoothblendButton::drawButton( QPainter *painter ) { int newHeight = height() - 2; int dx = (width() - newWidth) / 2; int dy = (height() - newHeight) / 2; - QImage tmpResult; - QColorGroup group; - QColor redColor(red); + TQImage tmpResult; + TQColorGroup group; + TQColor redColor(red); bool active = client_->isActive(); - QPixmap backgroundTile = client_->getTitleBarTile(active); + TQPixmap backgroundTile = client_->getTitleBarTile(active); group = KDecoration::options()->colorGroup(KDecoration::ColorTitleBar, active); //draw the titlebar behind the buttons and app icons @@ -419,7 +419,7 @@ void smoothblendButton::drawButton( QPainter *painter ) { painter->drawTiledPixmap(0, 0, width(), height(), backgroundTile, 0, y()-::factory->frameSize()); } - QImage buttonImage = getButtonImage(type_).smoothScale( width(),height()); + TQImage buttonImage = getButtonImage(type_).smoothScale( width(),height()); buttonImage = KImageEffect::blend( group.background(), buttonImage, .50); if (type_ == ButtonMenu) { //slight movement to show the menu button is depressed @@ -427,10 +427,10 @@ void smoothblendButton::drawButton( QPainter *painter ) { dx++; dy++; } - QPixmap menuButtonPixmap(client_->icon().pixmap(QIconSet::Large, QIconSet::Normal)); - QImage menuButtonImage(menuButtonPixmap.convertToImage()); + TQPixmap menuButtonPixmap(client_->icon().pixmap(TQIconSet::Large, TQIconSet::Normal)); + TQImage menuButtonImage(menuButtonPixmap.convertToImage()); //draw the menu button the same size as the other buttons - //using QIconSet::Large gives us a 32x32 icon to resize, resizing larger than + //using TQIconSet::Large gives us a 32x32 icon to resize, resizing larger than //that may produce pixilation of the image painter->drawImage( dx, dy, menuButtonImage.smoothScale(newWidth, newHeight) ); } else { @@ -453,7 +453,7 @@ void smoothblendButton::drawButton( QPainter *painter ) { { tmpResult = buttonImage; } - painter->drawPixmap( 0, 0, QPixmap( tmpResult ) ); + painter->drawPixmap( 0, 0, TQPixmap( tmpResult ) ); } } @@ -482,11 +482,11 @@ smoothblendClient::smoothblendClient(KDecorationBridge *b, KDecorationFactory *f pixmaps_created(false), //captionBufferDirty(true), s_titleHeight(0), - s_titleFont(QFont()), + s_titleFont(TQFont()), closing(false) { - aCaptionBuffer = new QPixmap(); - iCaptionBuffer = new QPixmap(); + aCaptionBuffer = new TQPixmap(); + iCaptionBuffer = new TQPixmap(); //s_titleFont = isTool()?smoothblendFactory::titleFontTool():smoothblendFactory::titleFont(); s_titleFont = options()->font(); s_titleHeight = smoothblendFactory::titleSize(); @@ -504,8 +504,8 @@ void smoothblendClient::create_pixmaps() { if(pixmaps_created) return; KPixmap tempPixmap; - QPainter painter; - QColorGroup group,widgetGroup; + TQPainter painter; + TQColorGroup group,widgetGroup; int FRAMESIZE = ::factory->frameSize(); // Get the color groups we need for the gradients group = options()->colorGroup(KDecoration::ColorTitleBar, true); @@ -519,7 +519,7 @@ void smoothblendClient::create_pixmaps() { KPixmapEffect::VerticalGradient, 100, -100); - aTitleBarTopTile = new QPixmap(1, TOPMARGIN); + aTitleBarTopTile = new TQPixmap(1, TOPMARGIN); painter.begin(aTitleBarTopTile); painter.drawPixmap(0, 0, tempPixmap); painter.end(); @@ -532,7 +532,7 @@ void smoothblendClient::create_pixmaps() { KPixmapEffect::VerticalGradient, 100, -100); - iTitleBarTopTile = new QPixmap(1, TOPMARGIN); + iTitleBarTopTile = new TQPixmap(1, TOPMARGIN); painter.begin(iTitleBarTopTile); painter.drawPixmap(0, 0, tempPixmap); painter.end(); @@ -546,7 +546,7 @@ void smoothblendClient::create_pixmaps() { KPixmapEffect::VerticalGradient, 100, 200); - aTitleBarTile = new QPixmap(1, s_titleHeight+FRAMESIZE); + aTitleBarTile = new TQPixmap(1, s_titleHeight+FRAMESIZE); painter.begin(aTitleBarTile); painter.drawPixmap(0, 0, tempPixmap); painter.end(); @@ -559,7 +559,7 @@ void smoothblendClient::create_pixmaps() { KPixmapEffect::VerticalGradient, 100, 200); - iTitleBarTile = new QPixmap(1, s_titleHeight+FRAMESIZE); + iTitleBarTile = new TQPixmap(1, s_titleHeight+FRAMESIZE); painter.begin(iTitleBarTile); painter.drawPixmap(0, 0, tempPixmap); painter.end(); @@ -630,26 +630,26 @@ void smoothblendClient::_resetLayout() delete bottomSpacer_; delete windowSpacer_; - mainLayout_ = new QVBoxLayout(widget()); + mainLayout_ = new TQVBoxLayout(widget()); // title - titleLayout_ = new QHBoxLayout(); - QHBoxLayout *windowLayout_ = new QHBoxLayout(); + titleLayout_ = new TQHBoxLayout(); + TQHBoxLayout *windowLayout_ = new TQHBoxLayout(); int FRAMESIZE = ::factory->frameSize(); - topSpacer_ = new QSpacerItem(1, FRAMESIZE, QSizePolicy::Expanding, QSizePolicy::Fixed); - titlebar_ = new QSpacerItem(1, ::factory->buttonSize(), - QSizePolicy::Expanding, QSizePolicy::Fixed); - leftTitleSpacer_ = new QSpacerItem(FRAMESIZE, s_titleHeight, - QSizePolicy::Fixed, QSizePolicy::Fixed); - rightTitleSpacer_ = new QSpacerItem(FRAMESIZE, s_titleHeight, - QSizePolicy::Fixed, QSizePolicy::Fixed); - decoSpacer_ = new QSpacerItem(1, FRAMESIZE, QSizePolicy::Expanding, QSizePolicy::Fixed); - leftSpacer_ = new QSpacerItem(::factory->frameSize(), 1, - QSizePolicy::Fixed, QSizePolicy::Expanding); - rightSpacer_ = new QSpacerItem(::factory->frameSize(), 1, - QSizePolicy::Fixed, QSizePolicy::Expanding); - bottomSpacer_ = new QSpacerItem(1, ::factory->frameSize(), - QSizePolicy::Expanding, QSizePolicy::Fixed); + topSpacer_ = new TQSpacerItem(1, FRAMESIZE, TQSizePolicy::Expanding, TQSizePolicy::Fixed); + titlebar_ = new TQSpacerItem(1, ::factory->buttonSize(), + TQSizePolicy::Expanding, TQSizePolicy::Fixed); + leftTitleSpacer_ = new TQSpacerItem(FRAMESIZE, s_titleHeight, + TQSizePolicy::Fixed, TQSizePolicy::Fixed); + rightTitleSpacer_ = new TQSpacerItem(FRAMESIZE, s_titleHeight, + TQSizePolicy::Fixed, TQSizePolicy::Fixed); + decoSpacer_ = new TQSpacerItem(1, FRAMESIZE, TQSizePolicy::Expanding, TQSizePolicy::Fixed); + leftSpacer_ = new TQSpacerItem(::factory->frameSize(), 1, + TQSizePolicy::Fixed, TQSizePolicy::Expanding); + rightSpacer_ = new TQSpacerItem(::factory->frameSize(), 1, + TQSizePolicy::Fixed, TQSizePolicy::Expanding); + bottomSpacer_ = new TQSpacerItem(1, ::factory->frameSize(), + TQSizePolicy::Expanding, TQSizePolicy::Fixed); // sizeof(...) is calculated at compile time memset(button, 0, sizeof(smoothblendButton *) * ButtonTypeCount); @@ -657,9 +657,9 @@ void smoothblendClient::_resetLayout() // message in preview widget if (isPreview()) { windowLayout_->addWidget( - new QLabel( i18n("<b><center>Smooth Blend</center></b>"), widget() ), 1 ); + new TQLabel( i18n("<b><center>Smooth Blend</center></b>"), widget() ), 1 ); } else { - windowLayout_->addItem(new QSpacerItem(0, 0)); + windowLayout_->addItem(new TQSpacerItem(0, 0)); } // setup titlebar buttons @@ -668,16 +668,16 @@ void smoothblendClient::_resetLayout() //Deal with the title and buttons titleLayout_->addItem(leftTitleSpacer_); addButtons(titleLayout_, - options()->customButtonPositions() ? options()->titleButtonsLeft() : QString(default_left), + options()->customButtonPositions() ? options()->titleButtonsLeft() : TQString(default_left), ::factory->titleSize()-1); titleLayout_->addItem(titlebar_); addButtons(titleLayout_, - options()->customButtonPositions() ? options()->titleButtonsRight() : QString(default_right), + options()->customButtonPositions() ? options()->titleButtonsRight() : TQString(default_right), ::factory->titleSize()-1); titleLayout_->addItem(rightTitleSpacer_); //Mid - left side, middle contents and right side - QHBoxLayout * midLayout_ = new QHBoxLayout(); + TQHBoxLayout * midLayout_ = new TQHBoxLayout(); midLayout_->addItem(leftSpacer_); midLayout_->addLayout(windowLayout_); midLayout_->addItem(rightSpacer_); @@ -690,8 +690,8 @@ void smoothblendClient::_resetLayout() mainLayout_->addItem( bottomSpacer_ ); // connections - 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))); } ////////////////////////////////////////////////////////////////////////////// @@ -699,8 +699,8 @@ void smoothblendClient::_resetLayout() // ------------ // Add buttons to title layout -void smoothblendClient::addButtons(QBoxLayout *layout, const QString& s, int button_size) { - QString tip; +void smoothblendClient::addButtons(TQBoxLayout *layout, const TQString& s, int button_size) { + TQString tip; if (s.length() > 0) { for (unsigned n=0; n < s.length(); n++) { switch (s[n]) { @@ -708,8 +708,8 @@ void smoothblendClient::addButtons(QBoxLayout *layout, const QString& s, int but if (!button[ButtonMenu]) { button[ButtonMenu] = new smoothblendButton(this, "splat.png", i18n("Menu"),ButtonMenu,button_size); - connect(button[ButtonMenu], SIGNAL(pressed()), this, SLOT(menuButtonPressed())); - connect(button[ButtonMenu], SIGNAL(released()), this, SLOT(menuButtonReleased())); + connect(button[ButtonMenu], TQT_SIGNAL(pressed()), this, TQT_SLOT(menuButtonPressed())); + connect(button[ButtonMenu], TQT_SIGNAL(released()), this, TQT_SLOT(menuButtonReleased())); layout->addWidget(button[ButtonMenu]); if (n < s.length()-1) layout->addSpacing(1); } @@ -724,8 +724,8 @@ void smoothblendClient::addButtons(QBoxLayout *layout, const QString& s, int but } button[ButtonSticky] = new smoothblendButton(this, "circle.png", tip, ButtonSticky, button_size, true); - connect(button[ButtonSticky], SIGNAL(clicked()), - this, SLOT(toggleOnAllDesktops())); + connect(button[ButtonSticky], TQT_SIGNAL(clicked()), + this, TQT_SLOT(toggleOnAllDesktops())); layout->addWidget(button[ButtonSticky]); if (n < s.length()-1) layout->addSpacing(1); } @@ -735,8 +735,8 @@ void smoothblendClient::addButtons(QBoxLayout *layout, const QString& s, int but if ((!button[ButtonHelp]) && providesContextHelp()) { button[ButtonHelp] = new smoothblendButton(this, "help.png", i18n("Help"), ButtonHelp, button_size); - connect(button[ButtonHelp], SIGNAL(clicked()), - this, SLOT(showContextHelp())); + connect(button[ButtonHelp], TQT_SIGNAL(clicked()), + this, TQT_SLOT(showContextHelp())); layout->addWidget(button[ButtonHelp]); if (n < s.length()-1) layout->addSpacing(1); } @@ -746,8 +746,8 @@ void smoothblendClient::addButtons(QBoxLayout *layout, const QString& s, int but if ((!button[ButtonMin]) && isMinimizable()) { button[ButtonMin] = new smoothblendButton(this, "minimize.png", i18n("Minimize"), ButtonMin, button_size); - connect(button[ButtonMin], SIGNAL(clicked()), - this, SLOT(minimize())); + connect(button[ButtonMin], TQT_SIGNAL(clicked()), + this, TQT_SLOT(minimize())); layout->addWidget(button[ButtonMin]); if (n < s.length()-1) layout->addSpacing(1); } @@ -762,8 +762,8 @@ void smoothblendClient::addButtons(QBoxLayout *layout, const QString& s, int but } button[ButtonMax] = new smoothblendButton(this, "maximize.png", tip, ButtonMax, button_size, true); - connect(button[ButtonMax], SIGNAL(clicked()), - this, SLOT(maxButtonPressed())); + connect(button[ButtonMax], TQT_SIGNAL(clicked()), + this, TQT_SLOT(maxButtonPressed())); layout->addWidget(button[ButtonMax]); if (n < s.length()-1) layout->addSpacing(1); } @@ -773,8 +773,8 @@ void smoothblendClient::addButtons(QBoxLayout *layout, const QString& s, int but if ((!button[ButtonClose]) && isCloseable()) { button[ButtonClose] = new smoothblendButton(this, "close.png", i18n("Close"), ButtonClose, button_size); - connect(button[ButtonClose], SIGNAL(clicked()), - this, SLOT(closeWindow())); + connect(button[ButtonClose], TQT_SIGNAL(clicked()), + this, TQT_SLOT(closeWindow())); layout->addWidget(button[ButtonClose]); if (n < s.length()-1) layout->addSpacing(1); } @@ -785,8 +785,8 @@ void smoothblendClient::addButtons(QBoxLayout *layout, const QString& s, int but button[ButtonAbove] = new smoothblendButton(this, "keep_above.png", i18n("Keep Above Others"), ButtonAbove, button_size, true); - connect(button[ButtonAbove], SIGNAL(clicked()), - this, SLOT(aboveButtonPressed())); + connect(button[ButtonAbove], TQT_SIGNAL(clicked()), + this, TQT_SLOT(aboveButtonPressed())); layout->addWidget(button[ButtonAbove]); if (n < s.length()-1) layout->addSpacing(1); } @@ -797,8 +797,8 @@ void smoothblendClient::addButtons(QBoxLayout *layout, const QString& s, int but button[ButtonBelow] = new smoothblendButton(this, "keep_below.png", i18n("Keep Below Others"), ButtonBelow, button_size, true); - connect(button[ButtonBelow], SIGNAL(clicked()), - this, SLOT(belowButtonPressed())); + connect(button[ButtonBelow], TQT_SIGNAL(clicked()), + this, TQT_SLOT(belowButtonPressed())); layout->addWidget(button[ButtonBelow]); if (n < s.length()-1) layout->addSpacing(1); } @@ -813,8 +813,8 @@ void smoothblendClient::addButtons(QBoxLayout *layout, const QString& s, int but } button[ButtonShade] = new smoothblendButton(this, "shade.png", tip, ButtonShade, button_size, true); - connect(button[ButtonShade], SIGNAL(clicked()), - this, SLOT(shadeButtonPressed())); + connect(button[ButtonShade], TQT_SIGNAL(clicked()), + this, TQT_SLOT(shadeButtonPressed())); layout->addWidget(button[ButtonShade]); if (n < s.length()-1) layout->addSpacing(1); } @@ -856,8 +856,8 @@ void smoothblendClient::captionChange() { void smoothblendClient::desktopChange() { bool d = isOnAllDesktops(); if (button[ButtonSticky]) { - QToolTip::remove(button[ButtonSticky]); - QToolTip::add(button[ButtonSticky], d ? i18n("Un-Sticky") : i18n("Sticky")); + TQToolTip::remove(button[ButtonSticky]); + TQToolTip::add(button[ButtonSticky], d ? i18n("Un-Sticky") : i18n("Sticky")); button[ButtonSticky]->repaint(false); } } @@ -881,8 +881,8 @@ void smoothblendClient::iconChange() { void smoothblendClient::maximizeChange() { bool m = (maximizeMode() == MaximizeFull); if (button[ButtonMax]) { - 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")); button[ButtonMax]->repaint(false); } } @@ -895,8 +895,8 @@ void smoothblendClient::maximizeChange() { void smoothblendClient::shadeChange() { bool s = isSetShade(); if (button[ButtonShade]) { - QToolTip::remove(button[ButtonShade]); - QToolTip::add(button[ButtonShade], s ? i18n("Unshade") : i18n("Shade")); + TQToolTip::remove(button[ButtonShade]); + TQToolTip::add(button[ButtonShade], s ? i18n("Unshade") : i18n("Shade")); button[ButtonShade]->repaint(false); } } @@ -938,25 +938,25 @@ void smoothblendClient::borders(int &left, int &right, int &top, int &bottom) co top = ::factory->buttonSize(); // update layout etc. - topSpacer_->changeSize(1, 0, QSizePolicy::Expanding, QSizePolicy::Fixed); - decoSpacer_->changeSize(1, 0, QSizePolicy::Expanding, QSizePolicy::Fixed); - leftSpacer_->changeSize(left, 1, QSizePolicy::Fixed, QSizePolicy::Expanding); - leftTitleSpacer_->changeSize(left, top, QSizePolicy::Fixed, QSizePolicy::Fixed); - rightSpacer_->changeSize(right, 1, QSizePolicy::Fixed, QSizePolicy::Expanding); - rightTitleSpacer_->changeSize(right, top, QSizePolicy::Fixed, QSizePolicy::Fixed); - bottomSpacer_->changeSize(1, bottom, QSizePolicy::Expanding, QSizePolicy::Fixed); + topSpacer_->changeSize(1, 0, TQSizePolicy::Expanding, TQSizePolicy::Fixed); + decoSpacer_->changeSize(1, 0, TQSizePolicy::Expanding, TQSizePolicy::Fixed); + leftSpacer_->changeSize(left, 1, TQSizePolicy::Fixed, TQSizePolicy::Expanding); + leftTitleSpacer_->changeSize(left, top, TQSizePolicy::Fixed, TQSizePolicy::Fixed); + rightSpacer_->changeSize(right, 1, TQSizePolicy::Fixed, TQSizePolicy::Expanding); + rightTitleSpacer_->changeSize(right, top, TQSizePolicy::Fixed, TQSizePolicy::Fixed); + bottomSpacer_->changeSize(1, bottom, TQSizePolicy::Expanding, TQSizePolicy::Fixed); } else { left = right = bottom = ::factory->frameSize(); top = ::factory->titleSize() + (FRAMESIZE*2); // update layout etc. - topSpacer_->changeSize(1, FRAMESIZE, QSizePolicy::Expanding, QSizePolicy::Fixed); - decoSpacer_->changeSize(1, FRAMESIZE, QSizePolicy::Expanding, QSizePolicy::Fixed); - leftSpacer_->changeSize(left, 1, QSizePolicy::Fixed, QSizePolicy::Expanding); - leftTitleSpacer_->changeSize(left, s_titleHeight, QSizePolicy::Fixed, QSizePolicy::Fixed); - rightSpacer_->changeSize(right, 1, QSizePolicy::Fixed, QSizePolicy::Expanding); - rightTitleSpacer_->changeSize(right,s_titleHeight,QSizePolicy::Fixed, QSizePolicy::Fixed); - bottomSpacer_->changeSize(1, bottom, QSizePolicy::Expanding, QSizePolicy::Fixed); + topSpacer_->changeSize(1, FRAMESIZE, TQSizePolicy::Expanding, TQSizePolicy::Fixed); + decoSpacer_->changeSize(1, FRAMESIZE, TQSizePolicy::Expanding, TQSizePolicy::Fixed); + leftSpacer_->changeSize(left, 1, TQSizePolicy::Fixed, TQSizePolicy::Expanding); + leftTitleSpacer_->changeSize(left, s_titleHeight, TQSizePolicy::Fixed, TQSizePolicy::Fixed); + rightSpacer_->changeSize(right, 1, TQSizePolicy::Fixed, TQSizePolicy::Expanding); + rightTitleSpacer_->changeSize(right,s_titleHeight,TQSizePolicy::Fixed, TQSizePolicy::Fixed); + bottomSpacer_->changeSize(1, bottom, TQSizePolicy::Expanding, TQSizePolicy::Fixed); } widget()->layout()->activate(); } @@ -966,7 +966,7 @@ void smoothblendClient::borders(int &left, int &right, int &top, int &bottom) co // -------- // Called to resize the window -void smoothblendClient::resize(const QSize &size) { +void smoothblendClient::resize(const TQSize &size) { widget()->resize(size); } @@ -975,7 +975,7 @@ void smoothblendClient::resize(const QSize &size) { // ------------- // Return the minimum allowable size for this window -QSize smoothblendClient::minimumSize() const { +TQSize smoothblendClient::minimumSize() const { return widget()->minimumSize(); } @@ -984,7 +984,7 @@ QSize smoothblendClient::minimumSize() const { // --------------- // Return logical mouse position -KDecoration::Position smoothblendClient::mousePosition(const QPoint &point) const { +KDecoration::Position smoothblendClient::mousePosition(const TQPoint &point) const { const int corner = 24; Position pos; int fs = ::factory->frameSize() + handlebar; @@ -1034,33 +1034,33 @@ KDecoration::Position smoothblendClient::mousePosition(const QPoint &point) cons // ------------- // Event filter -bool smoothblendClient::eventFilter(QObject *obj, QEvent *e) { +bool smoothblendClient::eventFilter(TQObject *obj, TQEvent *e) { if (obj != widget()) return false; switch (e->type()) { - case QEvent::MouseButtonDblClick: { - mouseDoubleClickEvent(static_cast<QMouseEvent *>(e)); + case TQEvent::MouseButtonDblClick: { + mouseDoubleClickEvent(static_cast<TQMouseEvent *>(e)); return true; } - case QEvent::MouseButtonPress: { - processMousePressEvent(static_cast<QMouseEvent *>(e)); + case TQEvent::MouseButtonPress: { + processMousePressEvent(static_cast<TQMouseEvent *>(e)); return true; } - case QEvent::Paint: { - paintEvent(static_cast<QPaintEvent *>(e)); + case TQEvent::Paint: { + paintEvent(static_cast<TQPaintEvent *>(e)); return true; } - case QEvent::Resize: { - resizeEvent(static_cast<QResizeEvent *>(e)); + case TQEvent::Resize: { + resizeEvent(static_cast<TQResizeEvent *>(e)); return true; } - case QEvent::Show: { - showEvent(static_cast<QShowEvent *>(e)); + case TQEvent::Show: { + showEvent(static_cast<TQShowEvent *>(e)); return true; } - case QEvent::Wheel: { - wheelEvent( static_cast< QWheelEvent* >( e )); + case TQEvent::Wheel: { + wheelEvent( static_cast< TQWheelEvent* >( e )); return true; } default: { @@ -1076,7 +1076,7 @@ bool smoothblendClient::eventFilter(QObject *obj, QEvent *e) { // ----------------------- // Doubleclick on title -void smoothblendClient::mouseDoubleClickEvent(QMouseEvent *e) { +void smoothblendClient::mouseDoubleClickEvent(TQMouseEvent *e) { if (titlebar_->geometry().contains(e->pos())) titlebarDblClickOperation(); } @@ -1086,7 +1086,7 @@ void smoothblendClient::mouseDoubleClickEvent(QMouseEvent *e) { // ------------ // Mouse wheel on titlebar -void smoothblendClient::wheelEvent(QWheelEvent *e) +void smoothblendClient::wheelEvent(TQWheelEvent *e) { if (titleLayout_->geometry().contains(e->pos()) ) titlebarMouseWheelOperation( e->delta()); @@ -1097,7 +1097,7 @@ void smoothblendClient::wheelEvent(QWheelEvent *e) // ------------ // Repaint the window -void smoothblendClient::paintEvent(QPaintEvent*) { +void smoothblendClient::paintEvent(TQPaintEvent*) { if (!::factory->initialized()) { return; @@ -1105,31 +1105,31 @@ void smoothblendClient::paintEvent(QPaintEvent*) { //int FRAMESIZE = ::factory->frameSize(); const uint maxCaptionLength = 300; // truncate captions longer than this! - QString captionText(caption()); + TQString captionText(caption()); if (captionText.length() > maxCaptionLength) { captionText.truncate(maxCaptionLength); captionText.append(" [...]"); } - QColor blackColor(black); - QColor redColor(red); - QColorGroup group,widgetGroup; - QPainter painter(widget()); + TQColor blackColor(black); + TQColor redColor(red); + TQColorGroup group,widgetGroup; + TQPainter painter(widget()); bool active = isActive(); //get group information first group = options()->colorGroup(KDecoration::ColorTitleBar, isActive()); widgetGroup = widget()->colorGroup(); - QRect topRect( topSpacer_->geometry() ); - QRect titleRect( titleLayout_->geometry() ); - QRect textRect( titlebar_->geometry() ); - QRect Rltitle( leftTitleSpacer_->geometry() ); - QRect Rrtitle( rightTitleSpacer_->geometry() ); - QRect Rdeco( decoSpacer_->geometry() ); - QRect Rleft( leftSpacer_->geometry() ); - QRect Rright( rightSpacer_->geometry() ); - QRect Rbottom( bottomSpacer_->geometry() ); - QRect tempRect; + TQRect topRect( topSpacer_->geometry() ); + TQRect titleRect( titleLayout_->geometry() ); + TQRect textRect( titlebar_->geometry() ); + TQRect Rltitle( leftTitleSpacer_->geometry() ); + TQRect Rrtitle( rightTitleSpacer_->geometry() ); + TQRect Rdeco( decoSpacer_->geometry() ); + TQRect Rleft( leftSpacer_->geometry() ); + TQRect Rright( rightSpacer_->geometry() ); + TQRect Rbottom( bottomSpacer_->geometry() ); + TQRect tempRect; /* @@ -1159,7 +1159,7 @@ void smoothblendClient::paintEvent(QPaintEvent*) { textRect.y(), textRect.width()-SIDETITLEMARGIN*2, textRect.height()); - QRect shadowRect(textRect.x()+1,textRect.y()+1,textRect.width(),textRect.height()); + TQRect shadowRect(textRect.x()+1,textRect.y()+1,textRect.width(),textRect.height()); //if we are shadowing title bar text if(::factory->titleShadow()) { @@ -1242,32 +1242,32 @@ void smoothblendClient::updateMask() { bool cornersFlag = ::factory->roundedCorners(); if ( (!options()->moveResizeMaximizedWindows() && maximizeMode() == MaximizeFull ) ) { - setMask(QRegion(widget()->rect())); + setMask(TQRegion(widget()->rect())); return; } int r(width()); int b(height()); - QRegion mask; + TQRegion mask; - mask=QRegion(widget()->rect()); + mask=TQRegion(widget()->rect()); // Remove top-left corner. if(cornersFlag) { - mask -= QRegion(0, 0, 5, 1); - mask -= QRegion(0, 1, 3, 1); - mask -= QRegion(0, 2, 2, 1); - mask -= QRegion(0, 3, 1, 2); - mask -= QRegion(r - 5, 0, 5, 1); - mask -= QRegion(r - 3, 1, 3, 1); - mask -= QRegion(r - 2, 2, 2, 1); - mask -= QRegion(r - 1, 3, 1, 2); + mask -= TQRegion(0, 0, 5, 1); + mask -= TQRegion(0, 1, 3, 1); + mask -= TQRegion(0, 2, 2, 1); + mask -= TQRegion(0, 3, 1, 2); + mask -= TQRegion(r - 5, 0, 5, 1); + mask -= TQRegion(r - 3, 1, 3, 1); + mask -= TQRegion(r - 2, 2, 2, 1); + mask -= TQRegion(r - 1, 3, 1, 2); } //always remove one corner pixel so it simulates a soft corner like plastik - mask -= QRegion(0,0,1,1); - mask -= QRegion(r-1,0,1,1); - mask -= QRegion(0, b-1, 1,1); - mask -= QRegion(r-1,b-1,1,1); + mask -= TQRegion(0,0,1,1); + mask -= TQRegion(r-1,0,1,1); + mask -= TQRegion(0, b-1, 1,1); + mask -= TQRegion(r-1,b-1,1,1); setMask(mask); } @@ -1277,9 +1277,9 @@ void smoothblendClient::updateMask() { // ------------- // Window is being resized -void smoothblendClient::resizeEvent(QResizeEvent *) { +void smoothblendClient::resizeEvent(TQResizeEvent *) { if (widget()->isShown()) { - QRegion region = widget()->rect(); + TQRegion region = widget()->rect(); region = region.subtract(titlebar_->geometry()); widget()->erase(region); updateMask(); @@ -1291,7 +1291,7 @@ void smoothblendClient::resizeEvent(QResizeEvent *) { // ----------- // Window is being shown -void smoothblendClient::showEvent(QShowEvent *) { +void smoothblendClient::showEvent(TQShowEvent *) { updateMask(); widget()->repaint(); } @@ -1362,16 +1362,16 @@ void smoothblendClient::belowButtonPressed() { // Menu button was pressed (popup the menu) void smoothblendClient::menuButtonPressed() { - static QTime* t = NULL; + static TQTime* t = NULL; static smoothblendClient* lastClient = NULL; if (t == NULL) t = new QTime; - bool dbl = (lastClient==this && t->elapsed() <= QApplication::doubleClickInterval()); + bool dbl = (lastClient==this && t->elapsed() <= TQApplication::doubleClickInterval()); lastClient = this; t->start(); //if (button[ButtonMenu] && !dbl && !::factory->menuClosed()) { if ( !dbl || !::factory->menuClosed()) { - QPoint p(button[ButtonMenu]->rect().bottomLeft().x(), + TQPoint p(button[ButtonMenu]->rect().bottomLeft().x(), button[ButtonMenu]->rect().bottomLeft().y()); KDecorationFactory* f = factory(); showWindowMenu(button[ButtonMenu]->mapToGlobal(p)); diff --git a/kwin-styles/smooth-blend/client/smoothblend.h b/kwin-styles/smooth-blend/client/smoothblend.h index d5f07576..e5a2ec70 100644 --- a/kwin-styles/smooth-blend/client/smoothblend.h +++ b/kwin-styles/smooth-blend/client/smoothblend.h @@ -25,7 +25,7 @@ #ifndef SMOOTHBLEND_H #define SMOOTHBLEND_H -#include <qbutton.h> +#include <tqbutton.h> #include <kdecoration.h> #include <kdecorationfactory.h> @@ -71,7 +71,7 @@ public: static int buttonSize(); static int frameSize(); static int roundSize(); - static QFont titleFontTool() { return m_titleFontTool; } + static TQFont titleFontTool() { return m_titleFontTool; } static bool titleShadow(); static bool animateButtons() { return animatebuttons; } static int getBtnComboBox() { return btnComboBox; } @@ -88,7 +88,7 @@ private: static int buttonsize_; static int framesize_; static int roundsize_; - static QFont m_titleFontTool; + static TQFont m_titleFontTool; static bool titleshadow_; static bool animatebuttons; static int btnComboBox; @@ -122,11 +122,11 @@ inline bool smoothblendFactory::titleShadow() { // smoothblendButton ////////////////////////////////////////////////////////// -class smoothblendButton : public QButton { +class smoothblendButton : public TQButton { Q_OBJECT public: smoothblendButton(smoothblendClient *parent=0, const char *name=0, - const QString &tip=NULL, + const TQString &tip=NULL, ButtonType type=ButtonHelp, int button_size=18, bool toggle=false); @@ -134,10 +134,10 @@ public: ~smoothblendButton(); void setBitmap(const unsigned char *bitmap); - QSize sizeHint() const; + TQSize sizeHint() const; ButtonState lastMousePress() const; void reset(); - QImage getButtonImage(ButtonType type); + TQImage getButtonImage(ButtonType type); virtual void setOn(bool on); virtual void setDown(bool on); @@ -147,22 +147,22 @@ protected slots: void buttonReleased(); private: - void enterEvent(QEvent *e); - void leaveEvent(QEvent *e); - void mousePressEvent(QMouseEvent *e); - void mouseReleaseEvent(QMouseEvent *e); - void drawButton(QPainter *painter); + void enterEvent(TQEvent *e); + void leaveEvent(TQEvent *e); + void mousePressEvent(TQMouseEvent *e); + void mouseReleaseEvent(TQMouseEvent *e); + void drawButton(TQPainter *painter); private: smoothblendClient *client_; ButtonType type_; int size_; - QBitmap *deco_; - QPixmap *pixmap[2][4]; + TQBitmap *deco_; + TQPixmap *pixmap[2][4]; ButtonState lastmouse_; bool hover_; bool m_clicked; - QTimer *animTmr; + TQTimer *animTmr; uint animProgress; }; @@ -192,34 +192,34 @@ public: 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 minimumSize() const; + virtual Position mousePosition(const TQPoint &point) const; - QPixmap getTitleBarTile(bool active) const + TQPixmap getTitleBarTile(bool active) const { return active ? *aTitleBarTile : *iTitleBarTile; } private: - void addButtons(QBoxLayout* layout, const QString& buttons, int buttonSize = 18); - bool eventFilter(QObject *obj, QEvent *e); - void mouseDoubleClickEvent(QMouseEvent *e); - void wheelEvent(QWheelEvent *e); - void paintEvent(QPaintEvent *e); - void resizeEvent(QResizeEvent *); - void showEvent(QShowEvent *); + void addButtons(TQBoxLayout* layout, const TQString& buttons, int buttonSize = 18); + bool eventFilter(TQObject *obj, TQEvent *e); + void mouseDoubleClickEvent(TQMouseEvent *e); + void wheelEvent(TQWheelEvent *e); + void paintEvent(TQPaintEvent *e); + void resizeEvent(TQResizeEvent *); + void showEvent(TQShowEvent *); void updateMask(); void _resetLayout(); - QVBoxLayout *mainLayout_; - QHBoxLayout *titleLayout_; - QSpacerItem *topSpacer_, + TQVBoxLayout *mainLayout_; + TQHBoxLayout *titleLayout_; + TQSpacerItem *topSpacer_, *titleSpacer_, *leftTitleSpacer_, *rightTitleSpacer_, *decoSpacer_, *leftSpacer_, *rightSpacer_, *bottomSpacer_, *windowSpacer_; - QPixmap *aCaptionBuffer, *iCaptionBuffer; + TQPixmap *aCaptionBuffer, *iCaptionBuffer; private slots: void maxButtonPressed(); @@ -236,12 +236,12 @@ signals: void keepBelowChanged(bool); private: - QPixmap *aTitleBarTile, *iTitleBarTile, *aTitleBarTopTile, *iTitleBarTopTile; + TQPixmap *aTitleBarTile, *iTitleBarTile, *aTitleBarTopTile, *iTitleBarTopTile; smoothblendButton *button[ButtonTypeCount]; - QSpacerItem *titlebar_; + TQSpacerItem *titlebar_; bool pixmaps_created; int s_titleHeight; - QFont s_titleFont; + TQFont s_titleFont; int handlebar; bool closing; diff --git a/kwin-styles/system/systemclient.cpp b/kwin-styles/system/systemclient.cpp index e3d85e8e..caab350a 100644 --- a/kwin-styles/system/systemclient.cpp +++ b/kwin-styles/system/systemclient.cpp @@ -1,11 +1,11 @@ #include "systemclient.h" -#include <qlayout.h> -#include <qdrawutil.h> -#include <qbitmap.h> -#include <qtooltip.h> -#include <qlabel.h> -#include <qcursor.h> +#include <tqlayout.h> +#include <tqdrawutil.h> +#include <tqbitmap.h> +#include <tqtooltip.h> +#include <tqlabel.h> +#include <tqcursor.h> #include <kpixmapeffect.h> #include <kdrawutil.h> @@ -47,13 +47,13 @@ static KPixmap *btnPix=0; static KPixmap *btnPixDown=0; static KPixmap *iBtnPix=0; static KPixmap *iBtnPixDown=0; -static QColor *btnForeground; +static TQColor *btnForeground; static bool pixmaps_created = false; -static void drawButtonFrame(KPixmap *pix, const QColorGroup &g) +static void drawButtonFrame(KPixmap *pix, const TQColorGroup &g) { - QPainter p; + TQPainter p; p.begin(pix); p.setPen(g.mid()); p.drawLine(0, 0, 13, 0); @@ -72,13 +72,13 @@ static void create_pixmaps() return; pixmaps_created = true; - if(QPixmap::defaultDepth() > 8){ + if(TQPixmap::defaultDepth() > 8){ // titlebar aUpperGradient = new KPixmap; aUpperGradient->resize(32, 18); iUpperGradient = new KPixmap; iUpperGradient->resize(32, 18); - QColor bgColor = kapp->palette().active().background(); + TQColor bgColor = kapp->palette().active().background(); KPixmapEffect::gradient(*aUpperGradient, KDecoration::options()->color(KDecorationOptions::ColorFrame, true).light(130), bgColor, @@ -98,7 +98,7 @@ static void create_pixmaps() KPixmap iInternal; iInternal.resize(8, 8); - QColor hColor(KDecoration::options()->color(KDecorationOptions::ColorButtonBg, false)); + TQColor hColor(KDecoration::options()->color(KDecorationOptions::ColorButtonBg, false)); KPixmapEffect::gradient(iInternal, hColor.dark(120), hColor.light(120), @@ -168,9 +168,9 @@ static void create_pixmaps() false)); } if(qGray(KDecoration::options()->color(KDecorationOptions::ColorButtonBg, true).rgb()) > 128) - btnForeground = new QColor(Qt::black); + btnForeground = new TQColor(Qt::black); else - btnForeground = new QColor(Qt::white); + btnForeground = new TQColor(Qt::white); } static void delete_pixmaps() @@ -189,8 +189,8 @@ static void delete_pixmaps() } SystemButton::SystemButton(SystemClient *parent, const char *name, - const unsigned char *bitmap, const QString& tip) -: QButton(parent->widget(), name) + const unsigned char *bitmap, const TQString& tip) +: TQButton(parent->widget(), name) { setTipText(tip); setBackgroundMode( NoBackground ); @@ -201,19 +201,19 @@ SystemButton::SystemButton(SystemClient *parent, const char *name, client = parent; } -void SystemButton::setTipText(const QString &tip) +void SystemButton::setTipText(const TQString &tip) { if (KDecoration::options()->showTooltips()) { - QToolTip::remove(this ); - QToolTip::add(this, tip ); + TQToolTip::remove(this ); + TQToolTip::add(this, tip ); } } -QSize SystemButton::sizeHint() const +TQSize SystemButton::sizeHint() const { - return(QSize(14, 14)); + return(TQSize(14, 14)); } void SystemButton::reset() @@ -223,12 +223,12 @@ void SystemButton::reset() void SystemButton::setBitmap(const unsigned char *bitmap) { - deco = QBitmap(8, 8, bitmap, true); + deco = TQBitmap(8, 8, bitmap, true); deco.setMask(deco); repaint(); } -void SystemButton::drawButton(QPainter *p) +void SystemButton::drawButton(TQPainter *p) { if(btnPixDown){ if(client->isActive()) @@ -237,7 +237,7 @@ void SystemButton::drawButton(QPainter *p) p->drawPixmap(0, 0, isDown() ? *iBtnPixDown : *iBtnPix); } else{ - QColorGroup g = KDecoration::options()->colorGroup(KDecorationOptions::ColorFrame, + TQColorGroup g = KDecoration::options()->colorGroup(KDecorationOptions::ColorFrame, client->isActive()); int x2 = width()-1; int y2 = height()-1; @@ -268,18 +268,18 @@ void SystemButton::drawButton(QPainter *p) } } -void SystemButton::mousePressEvent( QMouseEvent* e ) +void SystemButton::mousePressEvent( TQMouseEvent* e ) { last_button = e->button(); - QMouseEvent me ( e->type(), e->pos(), e->globalPos(), LeftButton, e->state() ); - QButton::mousePressEvent( &me ); + TQMouseEvent me ( e->type(), e->pos(), e->globalPos(), LeftButton, e->state() ); + TQButton::mousePressEvent( &me ); } -void SystemButton::mouseReleaseEvent( QMouseEvent* e ) +void SystemButton::mouseReleaseEvent( TQMouseEvent* e ) { last_button = e->button(); - QMouseEvent me ( e->type(), e->pos(), e->globalPos(), LeftButton, e->state() ); - QButton::mouseReleaseEvent( &me ); + TQMouseEvent me ( e->type(), e->pos(), e->globalPos(), LeftButton, e->state() ); + TQButton::mouseReleaseEvent( &me ); } @@ -300,47 +300,47 @@ void SystemClient::init() createMainWidget(0); widget()->installEventFilter( this ); - QGridLayout* g = new QGridLayout(widget(), 0, 0, 2); + TQGridLayout* g = new TQGridLayout(widget(), 0, 0, 2); if (isPreview()) { - g->addWidget(new QLabel(i18n("<center><b>System++ preview</b></center>"), widget()), 1, 1); + g->addWidget(new TQLabel(i18n("<center><b>System++ preview</b></center>"), widget()), 1, 1); } else { - g->addItem(new QSpacerItem( 0, 0 ), 1, 1); // no widget in the middle + g->addItem(new TQSpacerItem( 0, 0 ), 1, 1); // no widget in the middle } -// g->addItem( new QSpacerItem( 0, 0, QSizePolicy::Fixed, QSizePolicy::Expanding ) ); +// g->addItem( new TQSpacerItem( 0, 0, TQSizePolicy::Fixed, TQSizePolicy::Expanding ) ); g->setRowStretch(1, 10); g->addColSpacing(0, 2); g->addColSpacing(2, 2); g->addRowSpacing(2, 6); - QBoxLayout* hb = new QBoxLayout(0, QBoxLayout::LeftToRight, 0, 0, 0); - hb->setResizeMode(QLayout::FreeResize); + TQBoxLayout* hb = new TQBoxLayout(0, TQBoxLayout::LeftToRight, 0, 0, 0); + hb->setResizeMode(TQLayout::FreeResize); g->addLayout( hb, 0, 1 ); hb->addSpacing(3); - titlebar = new QSpacerItem(10, 14, QSizePolicy::Expanding, - QSizePolicy::Minimum); + titlebar = new TQSpacerItem(10, 14, TQSizePolicy::Expanding, + TQSizePolicy::Minimum); // setup titlebar buttons for (int n=0; n<ButtonTypeCount; n++) button[n] = 0; addButtons(hb, KDecoration::options()->customButtonPositions() ? - KDecoration::options()->titleButtonsLeft() : QString(default_left)); + KDecoration::options()->titleButtonsLeft() : TQString(default_left)); hb->addSpacing(2); hb->addItem(titlebar); hb->addSpacing(3); addButtons(hb, KDecoration::options()->customButtonPositions() ? - KDecoration::options()->titleButtonsRight() : QString(default_right)); + KDecoration::options()->titleButtonsRight() : TQString(default_right)); hb->addSpacing(2); - widget()->setBackgroundMode(QWidget::NoBackground); + widget()->setBackgroundMode(TQWidget::NoBackground); recalcTitleBuffer(); } -void SystemClient::addButtons(QBoxLayout *hb, const QString& s) +void SystemClient::addButtons(TQBoxLayout *hb, const TQString& s) { unsigned char *minmax_bits; int l_max = KDecoration::options()->titleButtonsLeft().find('A'); @@ -350,7 +350,7 @@ void SystemClient::addButtons(QBoxLayout *hb, const QString& s) case 'X': // Close button if ((!button[ButtonClose]) && isCloseable()) { button[ButtonClose] = new SystemButton(this, "close", NULL, i18n("Close")); - connect( button[ButtonClose], SIGNAL( clicked() ), this, ( SLOT( closeWindow() ) ) ); + connect( button[ButtonClose], TQT_SIGNAL( clicked() ), this, ( TQT_SLOT( closeWindow() ) ) ); hb->addWidget(button[ButtonClose]); hb->addSpacing(1); } @@ -363,7 +363,7 @@ void SystemClient::addButtons(QBoxLayout *hb, const QString& s) button[ButtonSticky]->setBitmap(unsticky_bits); else button[ButtonSticky]->setBitmap(sticky_bits); - connect( button[ButtonSticky], SIGNAL( clicked() ), this, ( SLOT( toggleOnAllDesktops() ) ) ); + connect( button[ButtonSticky], TQT_SIGNAL( clicked() ), this, ( TQT_SLOT( toggleOnAllDesktops() ) ) ); hb->addWidget(button[ButtonSticky]); hb->addSpacing(1); } @@ -372,7 +372,7 @@ void SystemClient::addButtons(QBoxLayout *hb, const QString& s) case 'I': // Minimize button if ((!button[ButtonMinimize]) && isMinimizable()) { button[ButtonMinimize] = new SystemButton(this, "iconify", iconify_bits, i18n("Minimize")); - connect( button[ButtonMinimize], SIGNAL( clicked() ), this, ( SLOT( minimize() ) ) ); + connect( button[ButtonMinimize], TQT_SIGNAL( clicked() ), this, ( TQT_SLOT( minimize() ) ) ); hb->addWidget(button[ButtonMinimize]); hb->addSpacing(1); } @@ -389,7 +389,7 @@ void SystemClient::addButtons(QBoxLayout *hb, const QString& s) } else button[ButtonMaximize] = new SystemButton(this, "maximize", maximize_bits, i18n("Maximize")); - connect( button[ButtonMaximize], SIGNAL( clicked() ), this, ( SLOT( maxButtonClicked() ) ) ); + connect( button[ButtonMaximize], TQT_SIGNAL( clicked() ), this, ( TQT_SLOT( maxButtonClicked() ) ) ); hb->addWidget(button[ButtonMaximize]); hb->addSpacing(1); } @@ -398,7 +398,7 @@ void SystemClient::addButtons(QBoxLayout *hb, const QString& s) case 'H': // Help button if ((!button[ButtonHelp]) && providesContextHelp()) { button[ButtonHelp] = new SystemButton(this, "help", question_bits, i18n("Help")); - connect( button[ButtonHelp], SIGNAL( clicked() ), this, ( SLOT( showContextHelp() ) ) ); + connect( button[ButtonHelp], TQT_SIGNAL( clicked() ), this, ( TQT_SLOT( showContextHelp() ) ) ); hb->addWidget(button[ButtonHelp]); hb->addSpacing(1); } @@ -409,26 +409,26 @@ void SystemClient::addButtons(QBoxLayout *hb, const QString& s) } } -bool SystemClient::eventFilter( QObject* o, QEvent* e ) +bool SystemClient::eventFilter( TQObject* o, TQEvent* e ) { if( o != widget()) return false; switch( e->type()) { - case QEvent::Resize: - resizeEvent(static_cast< QResizeEvent* >( e ) ); + case TQEvent::Resize: + resizeEvent(static_cast< TQResizeEvent* >( e ) ); return true; - case QEvent::Paint: - paintEvent(static_cast< QPaintEvent* >( e ) ); + case TQEvent::Paint: + paintEvent(static_cast< TQPaintEvent* >( e ) ); return true; - case QEvent::MouseButtonDblClick: - mouseDoubleClickEvent(static_cast< QMouseEvent* >( e ) ); + case TQEvent::MouseButtonDblClick: + mouseDoubleClickEvent(static_cast< TQMouseEvent* >( e ) ); return true; - case QEvent::MouseButtonPress: - processMousePressEvent(static_cast< QMouseEvent* >( e ) ); + case TQEvent::MouseButtonPress: + processMousePressEvent(static_cast< TQMouseEvent* >( e ) ); return true; - case QEvent::Wheel: - wheelEvent( static_cast< QWheelEvent* >( e )); + case TQEvent::Wheel: + wheelEvent( static_cast< TQWheelEvent* >( e )); return true; default: break; @@ -458,30 +458,30 @@ void SystemClient::maxButtonClicked() maximize( button[ButtonMaximize]->last_button ); } -void SystemClient::resizeEvent( QResizeEvent* ) +void SystemClient::resizeEvent( TQResizeEvent* ) { //Client::resizeEvent( e ); recalcTitleBuffer(); doShape(); /* if ( isVisibleToTLW() && !testWFlags( WStaticContents )) { - QPainter p( this ); - QRect t = titlebar->geometry(); + TQPainter p( this ); + TQRect t = titlebar->geometry(); t.setTop( 0 ); - QRegion r = rect(); + TQRegion r = rect(); r = r.subtract( t ); p.setClipRegion( r ); p.eraseRect( rect() ); }*/ } -void SystemClient::resize( const QSize& s ) +void SystemClient::resize( const TQSize& s ) { widget()->resize( s ); } -QSize SystemClient::minimumSize() const +TQSize SystemClient::minimumSize() const { return widget()->minimumSize(); } @@ -491,24 +491,24 @@ void SystemClient::recalcTitleBuffer() { if(oldTitle == caption() && width() == titleBuffer.width()) return; - QFontMetrics fm(options()->font(true)); + TQFontMetrics fm(options()->font(true)); titleBuffer.resize(width(), 18); - QPainter p; + TQPainter p; p.begin(&titleBuffer); if(aUpperGradient) p.drawTiledPixmap(0, 0, width(), 18, *aUpperGradient); else p.fillRect(0, 0, width(), 18, options()->colorGroup(KDecorationOptions::ColorFrame, true). - brush(QColorGroup::Button)); + brush(TQColorGroup::Button)); - QRect t = titlebar->geometry(); + TQRect t = titlebar->geometry(); t.setTop( 2 ); t.setLeft( t.left() + 4 ); t.setRight( t.right() - 2 ); - QRegion r(t.x(), 0, t.width(), 18); - r -= QRect(t.x()+((t.width()-fm.width(caption()))/2)-4, + TQRegion r(t.x(), 0, t.width(), 18); + r -= TQRect(t.x()+((t.width()-fm.width(caption()))/2)-4, 0, fm.width(caption())+8, 18); p.setClipRegion(r); int i, ly; @@ -535,22 +535,22 @@ void SystemClient::captionChange() widget()->repaint(titlebar->geometry(), false); } -void SystemClient::drawRoundFrame(QPainter &p, int x, int y, int w, int h) +void SystemClient::drawRoundFrame(TQPainter &p, int x, int y, int w, int h) { kDrawRoundButton(&p, x, y, w, h, options()->colorGroup(KDecorationOptions::ColorFrame, isActive()), false); } -void SystemClient::paintEvent( QPaintEvent* ) +void SystemClient::paintEvent( TQPaintEvent* ) { - QPainter p(widget()); - QRect t = titlebar->geometry(); + TQPainter p(widget()); + TQRect t = titlebar->geometry(); - QBrush fillBrush(widget()->colorGroup().brush(QColorGroup::Background).pixmap() ? - widget()->colorGroup().brush(QColorGroup::Background) : + TQBrush fillBrush(widget()->colorGroup().brush(TQColorGroup::Background).pixmap() ? + widget()->colorGroup().brush(TQColorGroup::Background) : options()->colorGroup(KDecorationOptions::ColorFrame, isActive()). - brush(QColorGroup::Button)); + brush(TQColorGroup::Button)); p.fillRect(1, 18, width()-2, height()-19, fillBrush); @@ -584,15 +584,15 @@ void SystemClient::paintEvent( QPaintEvent* ) void SystemClient::doShape() { - // using a bunch of QRect lines seems much more efficent than bitmaps or + // using a bunch of TQRect lines seems much more efficent than bitmaps or // point arrays - QRegion mask; + TQRegion mask; kRoundMaskRegion(mask, 0, 0, width(), height()); setMask(mask); } -void SystemClient::showEvent(QShowEvent *) +void SystemClient::showEvent(TQShowEvent *) { // Client::showEvent(ev); doShape(); @@ -600,20 +600,20 @@ void SystemClient::showEvent(QShowEvent *) // widget()->repaint(); } -/*void SystemClient::windowWrapperShowEvent( QShowEvent* ) +/*void SystemClient::windowWrapperShowEvent( TQShowEvent* ) { doShape(); }*/ -void SystemClient::mouseDoubleClickEvent( QMouseEvent * e ) +void SystemClient::mouseDoubleClickEvent( TQMouseEvent * e ) { if ( e->button() == LeftButton && titlebar->geometry().contains( e->pos() ) ) titlebarDblClickOperation(); } -void SystemClient::wheelEvent( QWheelEvent *e ) +void SystemClient::wheelEvent( TQWheelEvent *e ) { - if (isSetShade() || QRect( 0, 0, width(), titlebar->geometry().height() ).contains( e->pos() ) ) + if (isSetShade() || TQRect( 0, 0, width(), titlebar->geometry().height() ).contains( e->pos() ) ) titlebarMouseWheelOperation( e->delta()); } @@ -664,7 +664,7 @@ void SystemClient::desktopChange() { }*/ -KDecoration::Position SystemClient::mousePosition(const QPoint &p) const +KDecoration::Position SystemClient::mousePosition(const TQPoint &p) const { return KDecoration::mousePosition(p); } @@ -722,9 +722,9 @@ bool SystemDecoFactory::supports( Ability ability ) }; } -QValueList<KDecorationFactory::BorderSize> SystemDecoFactory::borderSizes() const +TQValueList<KDecorationFactory::BorderSize> SystemDecoFactory::borderSizes() const { // the list must be sorted - return QValueList< BorderSize >() << BorderNormal; + return TQValueList< BorderSize >() << BorderNormal; } } diff --git a/kwin-styles/system/systemclient.h b/kwin-styles/system/systemclient.h index 360f204d..3ab4df8d 100644 --- a/kwin-styles/system/systemclient.h +++ b/kwin-styles/system/systemclient.h @@ -1,9 +1,9 @@ #ifndef __SYSTEMCLIENT_H #define __SYSTEMCLIENT_H -#include <qvariant.h> -#include <qbitmap.h> -#include <qbutton.h> +#include <tqvariant.h> +#include <tqbitmap.h> +#include <tqbutton.h> #include <kpixmap.h> #include <kdecoration.h> @@ -33,9 +33,9 @@ class SystemClient : public KDecoration public: SystemClient(KDecorationBridge* bridge, KDecorationFactory* factory); ~SystemClient(); - virtual Position mousePosition(const QPoint& p) const; - virtual void resize(const QSize&); - virtual bool eventFilter(QObject* o, QEvent* e); + virtual Position mousePosition(const TQPoint& p) const; + virtual void resize(const TQSize&); + virtual bool eventFilter(TQObject* o, TQEvent* e); virtual void init(); protected: virtual void maximizeChange(); @@ -44,53 +44,53 @@ class SystemClient : public KDecoration virtual void iconChange(); virtual void desktopChange(); virtual void activeChange(); - virtual QSize minimumSize() const; + virtual TQSize minimumSize() const; virtual void borders(int&, int&, int&, int&) const; virtual void reset( unsigned long changed ); - void drawRoundFrame(QPainter &p, int x, int y, int w, int h); - void resizeEvent( QResizeEvent* ); - void paintEvent( QPaintEvent* ); - void showEvent( QShowEvent* ); - void mouseDoubleClickEvent( QMouseEvent * ); - void wheelEvent(QWheelEvent *e); + void drawRoundFrame(TQPainter &p, int x, int y, int w, int h); + void resizeEvent( TQResizeEvent* ); + void paintEvent( TQPaintEvent* ); + void showEvent( TQShowEvent* ); + void mouseDoubleClickEvent( TQMouseEvent * ); + void wheelEvent(TQWheelEvent *e); void doShape(); void recalcTitleBuffer(); private: - void addButtons(QBoxLayout* hb, const QString& buttons); + void addButtons(TQBoxLayout* hb, const TQString& buttons); private slots: void maxButtonClicked(); private: SystemButton* button[ButtonTypeCount]; - QSpacerItem* titlebar; - QPixmap titleBuffer; - QString oldTitle; + TQSpacerItem* titlebar; + TQPixmap titleBuffer; + TQString oldTitle; }; class SystemButton : public QButton { public: SystemButton(SystemClient *parent=0, const char *name=0, - const unsigned char *bitmap=NULL, const QString& tip=NULL); + const unsigned char *bitmap=NULL, const TQString& tip=NULL); void setBitmap(const unsigned char *bitmap); void reset(); - QSize sizeHint() const; - void setTipText(const QString &tip); + TQSize sizeHint() const; + void setTipText(const TQString &tip); ButtonState last_button; protected: - virtual void drawButton(QPainter *p); - void drawButtonLabel(QPainter *){} - QBitmap deco; + virtual void drawButton(TQPainter *p); + void drawButtonLabel(TQPainter *){} + TQBitmap deco; - void mousePressEvent( QMouseEvent* e ); - void mouseReleaseEvent( QMouseEvent* e ); + void mousePressEvent( TQMouseEvent* e ); + void mouseReleaseEvent( TQMouseEvent* e ); private: SystemClient* client; }; -class SystemDecoFactory : public QObject, public KDecorationFactory +class SystemDecoFactory : public TQObject, public KDecorationFactory { Q_OBJECT public: @@ -99,7 +99,7 @@ class SystemDecoFactory : public QObject, public KDecorationFactory virtual KDecoration *createDecoration(KDecorationBridge *); virtual bool reset(unsigned long); virtual bool supports( Ability ability ); - virtual QValueList< BorderSize > borderSizes() const; + virtual TQValueList< BorderSize > borderSizes() const; private: void readConfig(); }; diff --git a/styles/dotnet/dotnet.cpp b/styles/dotnet/dotnet.cpp index 6eeb7c41..ec4987f8 100644 --- a/styles/dotnet/dotnet.cpp +++ b/styles/dotnet/dotnet.cpp @@ -24,34 +24,34 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ -#include <qstyleplugin.h> -#include <qstylefactory.h> -#include <qpointarray.h> -#include <qpainter.h> -#include <qtabbar.h> -#include <qtabwidget.h> -#include <qprogressbar.h> -#include <qcombobox.h> -#include <qlistbox.h> -#include <qscrollbar.h> -#include <qpushbutton.h> -#include <qtoolbutton.h> -#include <qtoolbar.h> -#include <qmenubar.h> -#include <qpopupmenu.h> -#include <qdrawutil.h> -#include <qapplication.h> -#include <qvariant.h> -#include <qpixmapcache.h> -#include <qslider.h> -#include <qsettings.h> +#include <tqstyleplugin.h> +#include <tqstylefactory.h> +#include <tqpointarray.h> +#include <tqpainter.h> +#include <tqtabbar.h> +#include <tqtabwidget.h> +#include <tqprogressbar.h> +#include <tqcombobox.h> +#include <tqlistbox.h> +#include <tqscrollbar.h> +#include <tqpushbutton.h> +#include <tqtoolbutton.h> +#include <tqtoolbar.h> +#include <tqmenubar.h> +#include <tqpopupmenu.h> +#include <tqdrawutil.h> +#include <tqapplication.h> +#include <tqvariant.h> +#include <tqpixmapcache.h> +#include <tqslider.h> +#include <tqsettings.h> #include <kpixmap.h> #include "dotnet.h" #include "dotnet.moc" -/* This code registers the style with QStyleFactory, which makes it possible - * for any code that uses QStyle to find out about it. */ +/* This code registers the style with TQStyleFactory, which makes it possible + * for any code that uses TQStyle to find out about it. */ // -- Style Plugin Interface ------------------------- class dotNETstylePlugin : public QStylePlugin { @@ -59,11 +59,11 @@ class dotNETstylePlugin : public QStylePlugin dotNETstylePlugin() {} ~dotNETstylePlugin() {} - QStringList keys() const { - return QStringList() << "dotNET"; + TQStringList keys() const { + return TQStringList() << "dotNET"; } - QStyle* create( const QString& key ) { + TQStyle* create( const TQString& key ) { if (key == "dotnet") return new dotNETstyle; return 0; @@ -77,22 +77,22 @@ KDE_Q_EXPORT_PLUGIN( dotNETstylePlugin ) dotNETstyle::dotNETstyle() : KStyle( AllowMenuTransparency ), kickerMode(false) { winstyle = 0L; - winstyle = QStyleFactory::create("Windows"); + winstyle = TQStyleFactory::create("Windows"); if (winstyle == 0L) { // We don't have the Windows style, neither builtin nor as a plugin. // Use any style rather than crashing. - winstyle = QStyleFactory::create("B3"); + winstyle = TQStyleFactory::create("B3"); } if (qApp->inherits("KApplication")) { - connect( qApp, SIGNAL( kdisplayPaletteChanged() ), SLOT( paletteChanged() )); + connect( qApp, TQT_SIGNAL( kdisplayPaletteChanged() ), TQT_SLOT( paletteChanged() )); } - QSettings settings; + TQSettings settings; pseudo3D = settings.readBoolEntry("/KStyle/Settings/Pseudo3D", true); roundedCorners = settings.readBoolEntry("/KStyle/Settings/RoundedCorners", true); useTextShadows = settings.readBoolEntry("/KStyle/Settings/UseTextShadows", false); - reverseLayout = QApplication::QApplication::reverseLayout(); + reverseLayout = TQApplication::TQApplication::reverseLayout(); } @@ -100,7 +100,7 @@ dotNETstyle::~dotNETstyle() { } -bool dotNETstyle::inheritsKHTML(const QWidget* w) const +bool dotNETstyle::inheritsKHTML(const TQWidget* w) const { if (w->parentWidget(true) && w->parentWidget(true)->parentWidget(true) && w->parentWidget(true)->parentWidget(true)->parentWidget(true) && w->parentWidget(true)->parentWidget(true)->parentWidget(true)->inherits("KHTMLView")) { return true; @@ -109,7 +109,7 @@ bool dotNETstyle::inheritsKHTML(const QWidget* w) const } } -void dotNETstyle::polish(QWidget* widget) +void dotNETstyle::polish(TQWidget* widget) { if (!qstrcmp(qApp->argv()[0], "kicker") || widget->inherits("Kicker")) kickerMode = true; @@ -121,9 +121,9 @@ void dotNETstyle::polish(QWidget* widget) // to update the palette again. bool extraPalette = false; - if (widget->inherits("QComboBox") && !inheritsKHTML(widget)) { + if (widget->inherits("TQComboBox") && !inheritsKHTML(widget)) { widget->installEventFilter (this); - updatePalette( (QComboBox*) widget ); + updatePalette( (TQComboBox*) widget ); extraPalette = true; } else { winstyle->polish(widget); @@ -134,32 +134,32 @@ void dotNETstyle::polish(QWidget* widget) // other bad things (see bug #54569) /* if (!widget->ownPalette()) { - if (widget->inherits("QToolBar")) { - updatePalette( (QToolBar*) widget ); + if (widget->inherits("TQToolBar")) { + updatePalette( (TQToolBar*) widget ); extraPalette = true; - } else if (widget->inherits("QMenuBar")) { - updatePalette( (QMenuBar*) widget ); + } else if (widget->inherits("TQMenuBar")) { + updatePalette( (TQMenuBar*) widget ); extraPalette = true; } } */ } -void dotNETstyle::unPolish(QWidget* widget) +void dotNETstyle::unPolish(TQWidget* widget) { winstyle->unPolish(widget); - if (widget->inherits("QComboBox") && !inheritsKHTML(widget)) { + if (widget->inherits("TQComboBox") && !inheritsKHTML(widget)) { widget->removeEventFilter (this); } } void dotNETstyle::renderMenuBlendPixmap(KPixmap &pix, - const QColorGroup &cg, - const QPopupMenu *popup) const + const TQColorGroup &cg, + const TQPopupMenu *popup) const { - QPainter p( &pix ); - if (QApplication::reverseLayout()) { + TQPainter p( &pix ); + if (TQApplication::reverseLayout()) { p.fillRect( popup->frameRect().width()-22, 0, 22, pix.height(), cg.mid() ); p.fillRect( 0, 0, popup->frameRect().width()-22, pix.height(), cg.background().light() ); } else { @@ -174,9 +174,9 @@ void dotNETstyle::renderMenuBlendPixmap(KPixmap &pix, * Also, take a look at the sizeMetric function and play with the * widths that things return for different Frame elements. */ -void dotNETstyle::renderButton(QPainter *p, - const QRect &r, - const QColorGroup &g, +void dotNETstyle::renderButton(TQPainter *p, + const TQRect &r, + const TQColorGroup &g, bool sunken, bool corners) const { @@ -193,11 +193,11 @@ void dotNETstyle::renderButton(QPainter *p, const QCOORD iCorners[] = { x, y + h - 2, x, y + 1, x + 1, y, x + w - 2, y, x + w - 1, y + 1, x + w - 1, y + h - 2, x + w - 2, y + h - 1, x + 1, y + h - 1 }; p->fillRect(x+1, y+1, w-2, h-2, g.button()); p->setPen(g.button().dark()); - p->drawLineSegments(QPointArray(8, iCorners)); + p->drawLineSegments(TQPointArray(8, iCorners)); if (corners) { const QCOORD cPixels[] = { x, y, x + w - 1, y, x + w - 1, y + h - 1, x, y + h - 1 }; p->setPen(g.button()); - p->drawPoints(QPointArray(4, cPixels)); + p->drawPoints(TQPointArray(4, cPixels)); } } else { p->setPen(g.button().dark()); @@ -206,9 +206,9 @@ void dotNETstyle::renderButton(QPainter *p, } const QCOORD oCorners[] = { x + 1, y + h - 2, x + 1, y + 1, x + w - 2, y + 1, x + w - 2, y + h - 2 }; - const QPointArray outline(4, oCorners); + const TQPointArray outline(4, oCorners); p->setPen(g.button().dark(115)); - p->setBrush(QBrush::NoBrush); + p->setBrush(TQBrush::NoBrush); p->drawConvexPolygon(outline); p->setPen(g.button().light()); p->drawPolyline(outline, 0, 3); @@ -227,9 +227,9 @@ void dotNETstyle::renderButton(QPainter *p, * them just like normal buttons, by calling renderButton, but it also adds * very subtle grips to the slider handle. */ -void dotNETstyle::renderSlider(QPainter *p, - const QRect &r, - const QColorGroup &g) const +void dotNETstyle::renderSlider(TQPainter *p, + const TQRect &r, + const TQColorGroup &g) const { int x, y, w, h; int offset = 6; @@ -293,9 +293,9 @@ void dotNETstyle::renderSlider(QPainter *p, * Changing this function will have pretty widespread effects. Also a good * place to start if you're looking to make your own style. */ -void dotNETstyle::renderPanel(QPainter *p, - const QRect &r, - const QColorGroup &g, +void dotNETstyle::renderPanel(TQPainter *p, + const TQRect &r, + const TQColorGroup &g, bool sunken, bool thick) const { @@ -309,11 +309,11 @@ void dotNETstyle::renderPanel(QPainter *p, const QCOORD oCorners[] = { x, y2, x, y, x2, y, x2, y2 }; const QCOORD iCorners[] = { x+1, y2-1, x+1, y+1, x2-1, y+1, x2-1, y2-1 }; p->setPen(g.background().dark()); - p->drawConvexPolygon(QPointArray(4, oCorners)); + p->drawConvexPolygon(TQPointArray(4, oCorners)); if (thick) { p->setPen(g.background().dark(115)); - p->drawConvexPolygon(QPointArray(4, iCorners)); + p->drawConvexPolygon(TQPointArray(4, iCorners)); p->setPen(g.background().light()); if (sunken) { @@ -327,21 +327,21 @@ void dotNETstyle::renderPanel(QPainter *p, if (roundedCorners) { p->setPen(g.background()); - p->drawPoints(QPointArray(4, oCorners)); + p->drawPoints(TQPointArray(4, oCorners)); } } else { if (sunken) { const QCOORD corners[] = { x2, y, x2, y2, x, y2, x, y }; p->setPen(g.background().dark()); - p->drawConvexPolygon(QPointArray(4, corners)); + p->drawConvexPolygon(TQPointArray(4, corners)); p->setPen(g.background().light()); - p->drawPolyline(QPointArray(4, corners), 0, 3); + p->drawPolyline(TQPointArray(4, corners), 0, 3); } else { const QCOORD corners[] = { x, y2, x, y, x2, y, x2, y2 }; p->setPen(g.background().dark()); - p->drawPolygon(QPointArray(4, corners)); + p->drawPolygon(TQPointArray(4, corners)); p->setPen(g.background().light()); - p->drawPolyline(QPointArray(4, corners), 0, 3); + p->drawPolyline(TQPointArray(4, corners), 0, 3); } } @@ -351,15 +351,15 @@ void dotNETstyle::renderPanel(QPainter *p, if (sunken) { const QCOORD corners[] = { x2, y, x2, y2, x, y2, x, y }; p->setPen(g.background().dark()); - p->drawConvexPolygon(QPointArray(4, corners)); + p->drawConvexPolygon(TQPointArray(4, corners)); p->setPen(g.background().light()); - p->drawPolyline(QPointArray(4, corners), 0, 3); + p->drawPolyline(TQPointArray(4, corners), 0, 3); } else { const QCOORD corners[] = { x, y2, x, y, x2, y, x2, y2 }; p->setPen(g.background().dark()); - p->drawPolygon(QPointArray(4, corners)); + p->drawPolygon(TQPointArray(4, corners)); p->setPen(g.background().light()); - p->drawPolyline(QPointArray(4, corners), 0, 3); + p->drawPolyline(TQPointArray(4, corners), 0, 3); } } } @@ -369,18 +369,18 @@ void dotNETstyle::renderPanel(QPainter *p, void dotNETstyle::drawKStylePrimitive(KStylePrimitive kpe, - QPainter *p, - const QWidget* widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget* widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, - const QStyleOption& opt) const + const TQStyleOption& opt) const { // SLIDER // ------ switch( kpe ) { case KPE_SliderGroove: { - const QSlider* slider = (const QSlider*)widget; + const TQSlider* slider = (const TQSlider*)widget; int x, y, w, h; r.rect(&x, &y, &w, &h); bool horizontal = slider->orientation() == Horizontal; @@ -417,11 +417,11 @@ void dotNETstyle::drawKStylePrimitive(KStylePrimitive kpe, // This function draws primitive elements as well as their masks. void dotNETstyle::drawPrimitive(PrimitiveElement pe, - QPainter *p, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, - const QStyleOption &opt ) const + const TQStyleOption &opt ) const { bool down = flags & Style_Down; bool on = flags & Style_On; @@ -452,8 +452,8 @@ void dotNETstyle::drawPrimitive(PrimitiveElement pe, } case PE_ButtonDefault: { - QRect sr = r; - p->setPen(QPen::NoPen); + TQRect sr = r; + p->setPen(TQPen::NoPen); p->setBrush(cg.background().dark(105)); p->drawRoundRect(sr, 25, 25); p->setBrush(cg.background().dark(110)); @@ -473,16 +473,16 @@ void dotNETstyle::drawPrimitive(PrimitiveElement pe, case PE_ScrollBarAddPage: case PE_ScrollBarSubPage: { // draw double buffered to avoid flicker... - QPixmap buffer(2,2); - QRect br(buffer.rect() ); - QPainter bp(&buffer); + TQPixmap buffer(2,2); + TQRect br(buffer.rect() ); + TQPainter bp(&buffer); if (on || down) { - bp.fillRect(br, QBrush(cg.mid().dark())); + bp.fillRect(br, TQBrush(cg.mid().dark())); } else { - bp.fillRect(br, QBrush(cg.background())); + bp.fillRect(br, TQBrush(cg.background())); } - bp.fillRect(br, QBrush(cg.background().light(), Dense4Pattern)); + bp.fillRect(br, TQBrush(cg.background().light(), Dense4Pattern)); bp.end(); p->drawTiledPixmap(r, buffer); @@ -519,7 +519,7 @@ void dotNETstyle::drawPrimitive(PrimitiveElement pe, if (pseudo3D && roundedCorners) { const QCOORD corners[] = { x, y, x, y2, x2, y, x2, y2 }; p->setPen(cg.background()); - p->drawPoints(QPointArray(4, corners)); + p->drawPoints(TQPointArray(4, corners)); } break; @@ -547,9 +547,9 @@ void dotNETstyle::drawPrimitive(PrimitiveElement pe, p->fillRect(r, cg.background()); p->setPen(cg.background().dark()); p->setBrush(flags & Style_Enabled ? cg.light() : cg.background()); - p->drawPolygon(QPointArray(28, outline)); + p->drawPolygon(TQPointArray(28, outline)); p->setPen(cg.background().dark(115)); - p->drawPoints(QPointArray(10, indark)); + p->drawPoints(TQPointArray(10, indark)); break; } @@ -559,7 +559,7 @@ void dotNETstyle::drawPrimitive(PrimitiveElement pe, p->setPen(color1); p->setBrush(color1); p->translate(r.x(), r.y()); - p->drawPolygon(QPointArray(28, outline)); + p->drawPolygon(TQPointArray(28, outline)); p->translate(-r.x(), -r.y()); break; } @@ -593,7 +593,7 @@ void dotNETstyle::drawPrimitive(PrimitiveElement pe, if (pseudo3D && roundedCorners) { const QCOORD corners[] = { x, y, x, y2, x2, y, x2, y2 }; p->setPen(cg.background()); - p->drawPoints(QPointArray(4, corners)); + p->drawPoints(TQPointArray(4, corners)); } break; } @@ -670,7 +670,7 @@ void dotNETstyle::drawPrimitive(PrimitiveElement pe, case PE_CheckMark: { int x = r.center().x() - 3, y = r.center().y() - 3; const QCOORD check[] = { x, y + 2, x, y + 4, x + 2, y + 6, x + 6, y + 2, x + 6, y, x + 2, y + 4 }; - const QPointArray a(6, check); + const TQPointArray a(6, check); p->setPen(flags & Style_Down ? cg.highlight() : p->pen()); p->setBrush(flags & Style_Down ? cg.highlight() : p->pen().color()); @@ -686,7 +686,7 @@ void dotNETstyle::drawPrimitive(PrimitiveElement pe, case PE_ArrowDown: case PE_ArrowLeft: case PE_ArrowRight: { - QPointArray a; + TQPointArray a; switch (pe) { case PE_SpinWidgetUp: @@ -725,21 +725,21 @@ void dotNETstyle::drawPrimitive(PrimitiveElement pe, if (flags & Style_Enabled) { a.translate((r.x() + r.width()/2), (r.y() + r.height()/2)); - if (p->pen() == QPen::NoPen) { + if (p->pen() == TQPen::NoPen) { p->setPen(cg.buttonText()); } p->drawLineSegments(a, 0, 3); p->drawPoint(a[6]); } else { a.translate((r.x() + r.width()/2)+1, (r.y() + r.height()/2)+1); - if (p->pen() == QPen::NoPen) { + if (p->pen() == TQPen::NoPen) { p->setPen(cg.highlightedText()); } p->drawLineSegments(a, 0, 3); p->drawPoint(a[6]); a.translate(-1,-1); - if (p->pen() == QPen::NoPen) { + if (p->pen() == TQPen::NoPen) { p->setPen(cg.mid()); } p->drawLineSegments(a, 0, 3); @@ -758,12 +758,12 @@ void dotNETstyle::drawPrimitive(PrimitiveElement pe, void dotNETstyle::drawControl(ControlElement element, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, - const QStyleOption& opt) const + const TQStyleOption& opt) const { switch (element) { // CHECKBOXES @@ -785,7 +785,7 @@ void dotNETstyle::drawControl(ControlElement element, } case CE_ProgressBarContents: { - const QProgressBar *pb = (const QProgressBar *)widget; + const TQProgressBar *pb = (const TQProgressBar *)widget; if (pb->totalSteps()) { int x, y, w, h; @@ -795,7 +795,7 @@ void dotNETstyle::drawControl(ControlElement element, p->fillRect(x + 1, y + 1, w - 2, h - 2, cg.background().light()); - if (QApplication::reverseLayout()) { + if (TQApplication::reverseLayout()) { x += w - ((int)(w * percent)); y += 1; h -= 2; w = ((int)(w * percent)) - 2; @@ -808,7 +808,7 @@ void dotNETstyle::drawControl(ControlElement element, if (pb->progress() < pb->totalSteps()) { p->setPen(cg.background().dark(115)); - if (QApplication::reverseLayout()) { + if (TQApplication::reverseLayout()) { p->drawLine(x - 1, y, x - 1, h); } else { p->drawLine(x + w, y, x + w, h); @@ -816,13 +816,13 @@ void dotNETstyle::drawControl(ControlElement element, } if (pseudo3D) { - QPointArray corners; - if (QApplication::reverseLayout()) { + TQPointArray corners; + if (TQApplication::reverseLayout()) { const QCOORD c[] = { x, h, x, y, x + w, y, x + w, h }; - corners = QPointArray(4, c); + corners = TQPointArray(4, c); } else { const QCOORD c[] = { x, h, x, y, w, y, w, h }; - corners = QPointArray(4, c); + corners = TQPointArray(4, c); } p->setPen(cg.highlight().dark(120)); p->drawConvexPolygon(corners); @@ -844,7 +844,7 @@ void dotNETstyle::drawControl(ControlElement element, if (flags & Style_On || flags & Style_Down) { QCOORD center[] = { 4, 5, 4, 7, 5, 8, 7, 8, 8, 7, 8, 5, 7, 4, 5, 4 }; - QPointArray c(8, center); + TQPointArray c(8, center); p->setPen(flags & Style_Down ? cg.highlight() : cg.text()); p->setBrush(flags & Style_Down ? cg.highlight() : cg.text()); p->drawPolygon(c); @@ -855,34 +855,34 @@ void dotNETstyle::drawControl(ControlElement element, // TABS // ---- case CE_TabBarTab: { - const QTabBar *tb = (const QTabBar *) widget; + const TQTabBar *tb = (const TQTabBar *) widget; bool cornerWidget = false; - QTabBar::Shape tbs = tb->shape(); + TQTabBar::Shape tbs = tb->shape(); bool selected = flags & Style_Selected; int x, x2, y, y2, w, h; r.rect(&x, &y, &w, &h); r.coords(&x, &y, &x2, &y2); - if (tb->parent()->inherits("QTabWidget")) { - const QTabWidget *tw = (const QTabWidget *)tb->parent(); - QWidget *cw = tw->cornerWidget(Qt::TopLeft); + if (tb->parent()->inherits("TQTabWidget")) { + const TQTabWidget *tw = (const TQTabWidget *)tb->parent(); + TQWidget *cw = tw->cornerWidget(Qt::TopLeft); if (cw) { cornerWidget = true; } } switch (tbs) { - case QTabBar::RoundedAbove: { + case TQTabBar::RoundedAbove: { y2 -= 1; if (pseudo3D) { p->setPen(cg.background().dark()); if (selected) { const QCOORD oCorners[] = { x, y2, x, y, x2, y, x2, y2 }; - p->drawPolyline(QPointArray(4, oCorners)); + p->drawPolyline(TQPointArray(4, oCorners)); if (roundedCorners) { p->setPen(cg.background()); - p->drawPoints(QPointArray(4, oCorners), 1, 2); + p->drawPoints(TQPointArray(4, oCorners), 1, 2); } p->setPen(cg.background().dark(115)); @@ -894,11 +894,11 @@ void dotNETstyle::drawControl(ControlElement element, /* Left inner border */ p->drawLine(x + 1, y + 1, x + 1, y + h - 1); } else { - QRect r2(x+1, y+3, w-2, h-5); + TQRect r2(x+1, y+3, w-2, h-5); p->fillRect(r2, cg.mid().light(105)); const QCOORD oCorners[] = { x, y2, x, y + 2, x2, y + 2, x2, y2 }; - p->drawPolyline(QPointArray(4, oCorners)); + p->drawPolyline(TQPointArray(4, oCorners)); p->setPen(cg.background()); @@ -931,7 +931,7 @@ void dotNETstyle::drawControl(ControlElement element, p->setPen(cg.background().dark(115)); p->drawLine(x + w - 2, y + 1, x + w - 2, y + h - 3); } else { - QRect r2(x + 1, y + 3, w - 2, h - 4); + TQRect r2(x + 1, y + 3, w - 2, h - 4); p->fillRect(r2, cg.mid()); p->setPen(cg.background().light()); @@ -947,12 +947,12 @@ void dotNETstyle::drawControl(ControlElement element, break; } - case QTabBar::RoundedBelow: { + case TQTabBar::RoundedBelow: { if (pseudo3D) { p->setPen(cg.background().dark()); if (selected) { const QCOORD oCorners[] = { x, y + 1, x, y2, x2, y2, x2, y + 1 }; - p->drawPolyline(QPointArray(4, oCorners)); + p->drawPolyline(TQPointArray(4, oCorners)); p->setPen(cg.background().dark(115)); p->drawLine(x + 1, y + h - 2, x + w - 2, y + h - 2); @@ -964,10 +964,10 @@ void dotNETstyle::drawControl(ControlElement element, } else { y2 -= 2; const QCOORD oCorners[] = { x, y, x, y2, x2, y2, x2, y }; - QRect r2(x + 1, y + 2, w - 2, h - 5); + TQRect r2(x + 1, y + 2, w - 2, h - 5); p->fillRect(r2, cg.mid().light(105)); - p->drawPolyline(QPointArray(4, oCorners)); + p->drawPolyline(TQPointArray(4, oCorners)); p->setPen(cg.mid().dark(115)); /* Inner right border */ @@ -1004,7 +1004,7 @@ void dotNETstyle::drawControl(ControlElement element, p->drawLine(x + w - 1, y, x + w - 1, y + h - 1); p->drawLine(x, y + h-1, x + w - 1, y + h - 1); } else { - QRect r2(x, y + 1, w - 1, h - 4); + TQRect r2(x, y + 1, w - 1, h - 4); p->fillRect(r2, cg.mid()); p->setPen(cg.background().dark()); @@ -1053,8 +1053,8 @@ void dotNETstyle::drawControl(ControlElement element, } case CE_PushButton: { - QPushButton *button = (QPushButton *)widget; - QRect br = r; + TQPushButton *button = (TQPushButton *)widget; + TQRect br = r; bool btnDefault = button->isDefault(); static int di = pixelMetric(PM_ButtonDefaultIndicator); @@ -1069,11 +1069,11 @@ void dotNETstyle::drawControl(ControlElement element, } case CE_PushButtonLabel: { - const QPushButton *pb = (const QPushButton *)widget; + const TQPushButton *pb = (const TQPushButton *)widget; const bool enabled = flags & Style_Enabled; const int text_flags = AlignVCenter | AlignHCenter | ShowPrefix | DontClip | SingleLine; - QRect ur(r); + TQRect ur(r); if (flags & Style_Down) { p->translate(pixelMetric(PM_ButtonShiftHorizontal), @@ -1081,12 +1081,12 @@ void dotNETstyle::drawControl(ControlElement element, } if (!pb->text().isEmpty() && (flags & Style_ButtonDefault)) { - p->setFont(QFont(p->font().family(), p->font().pointSize(), 75)); + p->setFont(TQFont(p->font().family(), p->font().pointSize(), 75)); } if (pb->iconSet() && !pb->iconSet()->isNull()) { - QIconSet::Mode mode = enabled ? QIconSet::Normal : QIconSet::Disabled; - QPixmap pixmap = pb->iconSet()->pixmap(QIconSet::Small, mode); + TQIconSet::Mode mode = enabled ? TQIconSet::Normal : TQIconSet::Disabled; + TQPixmap pixmap = pb->iconSet()->pixmap(TQIconSet::Small, mode); if (!pb->text().isEmpty()) { @@ -1109,7 +1109,7 @@ void dotNETstyle::drawControl(ControlElement element, } if (pb->pixmap() && !pb->text()) { - QRect pr(0, 0, pb->pixmap()->width(), pb->pixmap()->height()); + TQRect pr(0, 0, pb->pixmap()->width(), pb->pixmap()->height()); pr.moveCenter(r.center()); p->drawPixmap(pr.topLeft(), *pb->pixmap()); } @@ -1135,7 +1135,7 @@ void dotNETstyle::drawControl(ControlElement element, // MENUBAR ITEM (sunken panel on mouse over) // ----------------------------------------- case CE_MenuBarItem: { - QMenuItem *mi = opt.menuItem(); + TQMenuItem *mi = opt.menuItem(); bool active = flags & Style_Active; bool focused = flags & Style_HasFocus; bool down = flags & Style_Down; @@ -1151,7 +1151,7 @@ void dotNETstyle::drawControl(ControlElement element, if (pseudo3D && roundedCorners && !down) { const QCOORD corners[] = { x, y2, x, y, x2, y, x2, y2 }; p->setPen(cg.background()); - p->drawPoints(QPointArray(4, corners)); + p->drawPoints(TQPointArray(4, corners)); } if (down) { @@ -1180,13 +1180,13 @@ void dotNETstyle::drawControl(ControlElement element, // POPUPMENU ITEM (highlighted on mouseover) // ------------------------------------------ case CE_PopupMenuItem: { - QMenuItem *mi = opt.menuItem(); + TQMenuItem *mi = opt.menuItem(); if (!mi) { return; } - const QPopupMenu *pum = (const QPopupMenu *) widget; + const TQPopupMenu *pum = (const TQPopupMenu *) widget; static const int itemFrame = 2; static const int itemHMargin = 3; static const int itemVMargin = 3; @@ -1209,7 +1209,7 @@ void dotNETstyle::drawControl(ControlElement element, if (pum->erasePixmap() && !pum->erasePixmap()->isNull()) { p->drawPixmap( x, y, *pum->erasePixmap(), x, y, w, h ); } else { - if (!QApplication::reverseLayout()) { + if (!TQApplication::reverseLayout()) { p->fillRect( x, y, 22, h, cg.mid() ); p->fillRect( x + 22, y, w - 22, h, cg.background().light() ); } else { // i wonder why exactly +1 (diego) @@ -1220,7 +1220,7 @@ void dotNETstyle::drawControl(ControlElement element, if (mi->isSeparator()) { p->setPen(cg.mid()); - if (!QApplication::reverseLayout()) + if (!TQApplication::reverseLayout()) p->drawLine(x + opt.maxIconWidth() + 6, y, x + w, y); else p->drawLine(w - (x + opt.maxIconWidth() + 6), y, @@ -1235,28 +1235,28 @@ void dotNETstyle::drawControl(ControlElement element, if (pseudo3D && roundedCorners) { const QCOORD segments[] = { x+2, y+1, x2-2, y+1, x2-1, y+2, x2-1, y2-2, x2-2, y2-1, x+2, y2-1, x+1, y2-2, x+1, y+2 }; const QCOORD icorners[] = { x+2, y+2, x2-2, y+2, x2-2,y2-2, x+2, y2-2 }; - p->drawLineSegments(QPointArray(8, segments)); - p->drawPoints(QPointArray(4, icorners)); + p->drawLineSegments(TQPointArray(8, segments)); + p->drawPoints(TQPointArray(4, icorners)); } else { const QCOORD corners[] = { x+1, y2-1, x+1, y+1, x2-1, y+1, x2-1, y2-1 }; - p->drawConvexPolygon(QPointArray(4, corners)); + p->drawConvexPolygon(TQPointArray(4, corners)); } p->setPen(cg.highlightedText()); } if (mi->iconSet()) { p->save(); - QIconSet::Mode mode = - disabled ? QIconSet::Disabled : QIconSet::Normal; - QPixmap pixmap = mi->iconSet()->pixmap(QIconSet::Small, mode); + TQIconSet::Mode mode = + disabled ? TQIconSet::Disabled : TQIconSet::Normal; + TQPixmap pixmap = mi->iconSet()->pixmap(TQIconSet::Small, mode); int pixw = pixmap.width(); int pixh = pixmap.height(); - QRect cr(xpos, y, opt.maxIconWidth(), h); - QRect pmr(0, 0, pixw, pixh); + TQRect cr(xpos, y, opt.maxIconWidth(), h); + TQRect pmr(0, 0, pixw, pixh); pmr.moveCenter(cr.center()); - if (QApplication::reverseLayout()) + if (TQApplication::reverseLayout()) pmr = visualRect( pmr, r ); p->setPen(cg.highlightedText()); @@ -1274,7 +1274,7 @@ void dotNETstyle::drawControl(ControlElement element, mi->custom()->paint(p, cg, active, !disabled, x+xm, y+m, w-xm-tab+1, h-2*m); return; } else { - QString s = mi->text(); + TQString s = mi->text(); if(!s.isNull()) { int t = s.find('\t'); int m = itemVMargin; @@ -1293,12 +1293,12 @@ void dotNETstyle::drawControl(ControlElement element, int xp; xp = x + w - tab - rightBorder - itemHMargin - itemFrame + 1; - QRect rr = QRect(xp, y+m, tab, h-(2*m)); - if (QApplication::reverseLayout()) + TQRect rr = TQRect(xp, y+m, tab, h-(2*m)); + if (TQApplication::reverseLayout()) rr = visualRect(rr, r); if (useTextShadows) { - QPen op = p->pen(); + TQPen op = p->pen(); p->setPen(active && !disabled ? cg.highlight().dark(130) : cg.background().dark(115)); p->drawText(rr.x() + 1, rr.y() + 1, rr.width(), rr.height(), text_flags, s.mid(t+1)); p->setPen(op); @@ -1308,14 +1308,14 @@ void dotNETstyle::drawControl(ControlElement element, s = s.left(t); } - QRect rr = QRect(xpos, y+m, w-xm-tab+1, h-(2*m)); - if (QApplication::reverseLayout()) { + TQRect rr = TQRect(xpos, y+m, w-xm-tab+1, h-(2*m)); + if (TQApplication::reverseLayout()) { rr = visualRect(rr, r); text_flags |= AlignRight; } if (useTextShadows) { - QPen op = p->pen(); + TQPen op = p->pen(); p->setPen(active && !disabled ? cg.highlight().dark(130) : cg.background().dark(115)); p->drawText(rr.x() + 1, rr.y() + 1, rr.width(), rr.height(), text_flags, s); p->setPen(op); @@ -1323,7 +1323,7 @@ void dotNETstyle::drawControl(ControlElement element, p->drawText(rr, text_flags, s); } else if (mi->pixmap()) { - QPixmap *pixmap = mi->pixmap(); + TQPixmap *pixmap = mi->pixmap(); if (pixmap->depth() == 1) { p->setBackgroundMode(OpaqueMode); } @@ -1345,10 +1345,10 @@ void dotNETstyle::drawControl(ControlElement element, p->setPen(cg.text()); - QRect rr = QRect(xpos, y + h/2 - dim/2, dim, dim); - if (QApplication::reverseLayout()) + TQRect rr = TQRect(xpos, y + h/2 - dim/2, dim, dim); + if (TQApplication::reverseLayout()) rr = visualRect( rr, r ); - drawPrimitive((QApplication::reverseLayout() ? PE_ArrowLeft : PE_ArrowRight), p, rr, cg, Style_Enabled); + drawPrimitive((TQApplication::reverseLayout() ? PE_ArrowLeft : PE_ArrowRight), p, rr, cg, Style_Enabled); } if (checkable) { @@ -1362,8 +1362,8 @@ void dotNETstyle::drawControl(ControlElement element, else cflags |= Style_On; - QRect rr = QRect( xp + 6, y + 6, 16, h - 6 ); - if (QApplication::reverseLayout()) + TQRect rr = TQRect( xp + 6, y + 6, 16, h - 6 ); + if (TQApplication::reverseLayout()) rr = visualRect( rr, r ); drawPrimitive(PE_CheckMark, p, rr, cg, cflags); @@ -1385,10 +1385,10 @@ void dotNETstyle::drawControl(ControlElement element, } void dotNETstyle::drawControlMask(ControlElement element, - QPainter *p, - const QWidget *w, - const QRect &r, - const QStyleOption &opt) const + TQPainter *p, + const TQWidget *w, + const TQRect &r, + const TQStyleOption &opt) const { switch (element) { case CE_PushButton: { @@ -1398,7 +1398,7 @@ void dotNETstyle::drawControlMask(ControlElement element, QCOORD corners[] = { x1, y1, x2, y1, x1, y2, x2, y2 }; p->fillRect (r, color1); p->setPen (color0); - p->drawPoints (QPointArray (4, corners)); + p->drawPoints (TQPointArray (4, corners)); } else { // Just fill the entire thing p->fillRect (r, color1); @@ -1413,10 +1413,10 @@ void dotNETstyle::drawControlMask(ControlElement element, } void dotNETstyle::drawComplexControlMask(ComplexControl c, - QPainter *p, - const QWidget *w, - const QRect &r, - const QStyleOption &o) const + TQPainter *p, + const TQWidget *w, + const TQRect &r, + const TQStyleOption &o) const { switch (c) { case CC_ComboBox: { @@ -1426,7 +1426,7 @@ void dotNETstyle::drawComplexControlMask(ComplexControl c, QCOORD corners[] = { x1, y1, x2, y1, x1, y2, x2, y2 }; p->fillRect (r, color1); p->setPen (color0); - p->drawPoints (QPointArray (4, corners)); + p->drawPoints (TQPointArray (4, corners)); } else { // Just fill the entire thing p->fillRect (r, color1); @@ -1440,21 +1440,21 @@ void dotNETstyle::drawComplexControlMask(ComplexControl c, } void dotNETstyle::drawComplexControl(ComplexControl control, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, SCFlags controls, SCFlags active, - const QStyleOption& opt) const + const TQStyleOption& opt) const { switch(control) { // COMBOBOX // -------- case CC_ComboBox: { int x, y, w, h; - const QComboBox *cb = (const QComboBox *)widget; + const TQComboBox *cb = (const TQComboBox *)widget; r.rect(&x, &y, &w, &h); if (active & Style_Sunken) @@ -1468,7 +1468,7 @@ void dotNETstyle::drawComplexControl(ComplexControl control, static const unsigned int handle_width = 15; static const unsigned int handle_offset = handle_width + 1; - QBitmap downArrow = QBitmap(7, 4, downarrow_bits, true); + TQBitmap downArrow = TQBitmap(7, 4, downarrow_bits, true); downArrow.setMask(downArrow); cb->editable() ? p->fillRect(x + 1, y + 1, w - 2, h - 2, cg.base()) : p->fillRect(x + 1, y + 1, w - 2, h - 2, cg.light()); @@ -1488,14 +1488,14 @@ void dotNETstyle::drawComplexControl(ComplexControl control, p->setBrush(cg.midlight()); } - QRect hr = (pseudo3D ? QRect(w - handle_offset - 1, y, handle_width + 2, h) : QRect(w - handle_offset - 1, y + 1, handle_width + 2, h - 1)); - if (QApplication::reverseLayout()) { hr = visualRect(hr, r); } + TQRect hr = (pseudo3D ? TQRect(w - handle_offset - 1, y, handle_width + 2, h) : TQRect(w - handle_offset - 1, y + 1, handle_width + 2, h - 1)); + if (TQApplication::reverseLayout()) { hr = visualRect(hr, r); } p->drawRect(hr); p->setBrush(NoBrush); - QRect rr = (pseudo3D ? QRect(x + 1, y + 1, w - 2, h - 2) : QRect(x + 1, y + 1, w - 1, h - 1)); + TQRect rr = (pseudo3D ? TQRect(x + 1, y + 1, w - 2, h - 2) : TQRect(x + 1, y + 1, w - 1, h - 1)); - if (QApplication::reverseLayout()) { rr = visualRect( rr, r ); } + if (TQApplication::reverseLayout()) { rr = visualRect( rr, r ); } if (flags & Style_HasFocus || cg.highlight() == cg.midlight() || (cb->listBox() && cb->listBox()->isVisible())) { @@ -1506,12 +1506,12 @@ void dotNETstyle::drawComplexControl(ComplexControl control, (cb->listBox() && cb->listBox()->isVisible()))) { p->save(); p->setBrush(NoBrush); - QColor test = ((flags & Style_HasFocus) ? cg.highlight() : cg.midlight()); + TQColor test = ((flags & Style_HasFocus) ? cg.highlight() : cg.midlight()); p->setPen(test.dark()); p->drawRect(hr); hr.moveBy(1,1); - hr.setSize(QSize(hr.width() -2, hr.height() -2)); - QPointArray ca(3); + hr.setSize(TQSize(hr.width() -2, hr.height() -2)); + TQPointArray ca(3); ca.setPoint(0, hr.topRight()); ca.setPoint(1, hr.bottomRight()); ca.setPoint(2, hr.bottomLeft()); @@ -1529,7 +1529,7 @@ void dotNETstyle::drawComplexControl(ComplexControl control, p->drawPoint(r.bottomRight()); p->setPen(cg.background().dark()); hr.moveBy(-1,-1); - hr.setSize(QSize(hr.width() + 2, hr.height() + 2)); + hr.setSize(TQSize(hr.width() + 2, hr.height() + 2)); p->drawPoint(hr.topLeft()); p->drawPoint(hr.bottomLeft()); } @@ -1540,10 +1540,10 @@ void dotNETstyle::drawComplexControl(ComplexControl control, p->setPen(cg.text()); } - QRect cr(w - handle_offset, y, handle_width, h - 2); - QRect pmr(0, 0, 7, 4); + TQRect cr(w - handle_offset, y, handle_width, h - 2); + TQRect pmr(0, 0, 7, 4); pmr.moveCenter(cr.center()); - if (QApplication::reverseLayout()) { + if (TQApplication::reverseLayout()) { pmr = visualRect( pmr, r ); } @@ -1556,9 +1556,9 @@ void dotNETstyle::drawComplexControl(ComplexControl control, // TOOLBUTTON // ---------- case CC_ToolButton: { - const QToolButton *tb = (const QToolButton *) widget; + const TQToolButton *tb = (const TQToolButton *) widget; - QRect button, menuarea; + TQRect button, menuarea; button = querySubControlMetrics(control, widget, SC_ToolButton, opt); menuarea = querySubControlMetrics(control, widget, SC_ToolButtonMenu, opt); @@ -1578,7 +1578,7 @@ void dotNETstyle::drawComplexControl(ComplexControl control, } else if (tb->parentWidget() && tb->parentWidget()->backgroundPixmap() && !tb->parentWidget()->backgroundPixmap()->isNull()) { - QPixmap pixmap = *(tb->parentWidget()->backgroundPixmap()); + TQPixmap pixmap = *(tb->parentWidget()->backgroundPixmap()); p->drawTiledPixmap( r, pixmap, tb->pos() ); } } @@ -1592,7 +1592,7 @@ void dotNETstyle::drawComplexControl(ComplexControl control, } if (tb->hasFocus() && !tb->focusProxy()) { - QRect fr = tb->rect(); + TQRect fr = tb->rect(); fr.addCoords(2, 2, -2, -2); drawPrimitive(PE_FocusRect, p, fr, cg); } @@ -1603,11 +1603,11 @@ void dotNETstyle::drawComplexControl(ComplexControl control, // SPINWIDGETS // ----------- case CC_SpinWidget: { - const QSpinWidget *sw = (const QSpinWidget *) widget; + const TQSpinWidget *sw = (const TQSpinWidget *) widget; SFlags flags; PrimitiveElement pe; - QRect swf = querySubControlMetrics(control, sw, SC_SpinWidgetFrame); + TQRect swf = querySubControlMetrics(control, sw, SC_SpinWidgetFrame); swf = visualRect( swf, sw ); if (controls & SC_SpinWidgetFrame) { @@ -1623,18 +1623,18 @@ void dotNETstyle::drawComplexControl(ComplexControl control, } else flags |= Style_Raised; - if (sw->buttonSymbols() == QSpinWidget::PlusMinus) + if (sw->buttonSymbols() == TQSpinWidget::PlusMinus) pe = PE_SpinWidgetPlus; else pe = PE_SpinWidgetUp; - QRect re = sw->upRect(); - QColorGroup ucg = sw->isUpEnabled() ? cg : sw->palette().disabled(); + TQRect re = sw->upRect(); + TQColorGroup ucg = sw->isUpEnabled() ? cg : sw->palette().disabled(); p->fillRect(re.x() + 1, re.y() + 1, re.width() - 2, re.height() - 1, flags & Style_Raised ? ucg.background() : ucg.highlight()); if (pseudo3D) { const QCOORD corners[] = { re.x(), re.bottom(), re.x(), re.y() + 1, re.x() + 1, re.y(), re.right() - 1, re.y(), re.right(), re.y() + 1, re.right(), re.bottom() }; p->setPen(flags & Style_Raised ? ucg.background().dark() : ucg.highlight()); - p->drawLineSegments(QPointArray(6, corners)); + p->drawLineSegments(TQPointArray(6, corners)); p->setPen(flags & Style_Raised ? ucg.background().light() : ucg.highlight()); p->drawLine(re.x() + 1, re.y() + 1, re.x() + 1, re.bottom()); p->drawLine(re.x() + 1, re.y() + 1, re.right()-1, re.y() + 1); @@ -1655,13 +1655,13 @@ void dotNETstyle::drawComplexControl(ComplexControl control, } else flags |= Style_Raised; - if (sw->buttonSymbols() == QSpinWidget::PlusMinus) + if (sw->buttonSymbols() == TQSpinWidget::PlusMinus) pe = PE_SpinWidgetMinus; else pe = PE_SpinWidgetDown; - QRect re = sw->downRect(); - QColorGroup dcg = sw->isDownEnabled() ? cg : sw->palette().disabled(); + TQRect re = sw->downRect(); + TQColorGroup dcg = sw->isDownEnabled() ? cg : sw->palette().disabled(); p->fillRect(re.x() + 1, re.y(), re.width() - 2, re.height() - 1, flags & Style_Raised ? dcg.background() : dcg.highlight()); if (pseudo3D) { const QCOORD corners[] = { @@ -1673,7 +1673,7 @@ void dotNETstyle::drawComplexControl(ComplexControl control, re.right(), re.y() }; p->setPen(flags & Style_Raised ? dcg.background().dark() : dcg.highlight()); - p->drawLineSegments(QPointArray(6, corners)); + p->drawLineSegments(TQPointArray(6, corners)); p->setPen(flags & Style_Raised ? dcg.background().light() : dcg.highlight()); p->drawLine(re.x() + 1, re.y(), re.x() + 1, re.bottom()); p->setPen(flags & Style_Raised ? dcg.background().dark(115) : dcg.highlight()); @@ -1698,7 +1698,7 @@ void dotNETstyle::drawComplexControl(ComplexControl control, } -QRect dotNETstyle::subRect(SubRect r, const QWidget *widget) const +TQRect dotNETstyle::subRect(SubRect r, const TQWidget *widget) const { // Don't use KStyles progressbar subrect switch (r) { @@ -1707,7 +1707,7 @@ QRect dotNETstyle::subRect(SubRect r, const QWidget *widget) const } case SR_PushButtonFocusRect: { - QRect rect = widget->rect(); + TQRect rect = widget->rect(); int margin = pixelMetric(PM_ButtonDefaultIndicator, widget) + pixelMetric(PM_DefaultFrameWidth, widget) + 2; rect.addCoords(margin, margin, -margin, -margin); @@ -1725,21 +1725,21 @@ QRect dotNETstyle::subRect(SubRect r, const QWidget *widget) const } } -QRect dotNETstyle::querySubControlMetrics(ComplexControl control, - const QWidget *widget, +TQRect dotNETstyle::querySubControlMetrics(ComplexControl control, + const TQWidget *widget, SubControl subcontrol, - const QStyleOption &opt) const + const TQStyleOption &opt) const { if (!widget) { - return QRect(); + return TQRect(); } - QRect r(widget->rect()); + TQRect r(widget->rect()); switch (control) { case CC_ComboBox: { switch (subcontrol) { case SC_ComboBoxEditField: { - return QRect(r.x() + 2, r.y() + 2, r.width() - 19, r.height() - 4); + return TQRect(r.x() + 2, r.y() + 2, r.width() - 19, r.height() - 4); } default: { return KStyle::querySubControlMetrics(control, widget, subcontrol, opt); @@ -1750,7 +1750,7 @@ QRect dotNETstyle::querySubControlMetrics(ComplexControl control, case CC_SpinWidget: { int fw = pixelMetric(PM_SpinBoxFrameWidth, widget); - QSize bs; + TQSize bs; bs.setHeight(QMAX(8, widget->height()/2)); bs.setWidth(QMIN(bs.height() * 8 / 5, widget->width() / 4)); @@ -1762,19 +1762,19 @@ QRect dotNETstyle::querySubControlMetrics(ComplexControl control, switch (subcontrol) { case SC_SpinWidgetUp: { - return QRect(x, y-1, bs.width(), bs.height()); + return TQRect(x, y-1, bs.width(), bs.height()); } case SC_SpinWidgetDown: { - return QRect(x, y + bs.height()-1, bs.width(), bs.height()); + return TQRect(x, y + bs.height()-1, bs.width(), bs.height()); } case SC_SpinWidgetFrame: { - return QRect(0, 0, widget->width() - (bs.width() + 2), widget->height()); + return TQRect(0, 0, widget->width() - (bs.width() + 2), widget->height()); } case SC_SpinWidgetEditField: { - return QRect(lx, fw, widget->width() - (bs.width() + 4), widget->height() - 2 * fw); + return TQRect(lx, fw, widget->width() - (bs.width() + 4), widget->height() - 2 * fw); } case SC_SpinWidgetButtonField: { - return QRect(x, y, bs.width(), widget->height() - 2 * fw); + return TQRect(x, y, bs.width(), widget->height() - 2 * fw); } default: { } @@ -1787,24 +1787,24 @@ QRect dotNETstyle::querySubControlMetrics(ComplexControl control, return KStyle::querySubControlMetrics(control, widget, subcontrol, opt); } -int dotNETstyle::pixelMetric(PixelMetric m, const QWidget *widget) const +int dotNETstyle::pixelMetric(PixelMetric m, const TQWidget *widget) const { switch(m) { // TABS // ---- case PM_TabBarTabVSpace: { - const QTabBar * tb = (const QTabBar *) widget; - if (tb->shape() == QTabBar::RoundedAbove || - tb->shape() == QTabBar::RoundedBelow) + const TQTabBar * tb = (const TQTabBar *) widget; + if (tb->shape() == TQTabBar::RoundedAbove || + tb->shape() == TQTabBar::RoundedBelow) return 12; else return 0; } case PM_TabBarTabOverlap: { - const QTabBar* tb = (const QTabBar*)widget; - if (tb->shape() != QTabBar::RoundedAbove && - tb->shape() != QTabBar::RoundedBelow) + const TQTabBar* tb = (const TQTabBar*)widget; + if (tb->shape() != TQTabBar::RoundedAbove && + tb->shape() != TQTabBar::RoundedBelow) return 3; // Leave standard size alone else return 1; // Change size for our tabs only @@ -1857,10 +1857,10 @@ int dotNETstyle::pixelMetric(PixelMetric m, const QWidget *widget) const return 1; } else { if (widget && - (widget->inherits("QPopupMenu") || - widget->inherits("QMenuBar") || - widget->inherits("QRangeControl") || - widget->inherits("QScrollView"))) { + (widget->inherits("TQPopupMenu") || + widget->inherits("TQMenuBar") || + widget->inherits("TQRangeControl") || + widget->inherits("TQScrollView"))) { return 1; } else { return 2; @@ -1883,10 +1883,10 @@ int dotNETstyle::pixelMetric(PixelMetric m, const QWidget *widget) const } -QSize dotNETstyle::sizeFromContents(ContentsType t, - const QWidget *widget, - const QSize &s, - const QStyleOption &opt) const +TQSize dotNETstyle::sizeFromContents(ContentsType t, + const TQWidget *widget, + const TQSize &s, + const TQStyleOption &opt) const { switch (t) { @@ -1894,8 +1894,8 @@ QSize dotNETstyle::sizeFromContents(ContentsType t, if (!widget || opt.isDefault()) break; - const QPopupMenu *popup = (const QPopupMenu *)widget; - QMenuItem *mi = opt.menuItem(); + const TQPopupMenu *popup = (const TQPopupMenu *)widget; + TQMenuItem *mi = opt.menuItem(); int maxpmw = opt.maxIconWidth(); int w = s.width(), h = s.height(); bool checkable = popup->isCheckable(); @@ -1916,7 +1916,7 @@ QSize dotNETstyle::sizeFromContents(ContentsType t, h = QMAX(h, widget->fontMetrics().height() + 10); if (mi->iconSet()) { - h = QMAX(h, mi->iconSet()->pixmap(QIconSet::Small, QIconSet::Normal).height() + 8); + h = QMAX(h, mi->iconSet()->pixmap(TQIconSet::Small, TQIconSet::Normal).height() + 8); } } @@ -1938,19 +1938,19 @@ QSize dotNETstyle::sizeFromContents(ContentsType t, w += 20; - return QSize(w, h); + return TQSize(w, h); } case CT_PushButton: { - const QPushButton* button = (const QPushButton*) widget; + const TQPushButton* button = (const TQPushButton*) widget; int w = s.width(); int h = s.height(); int bm = pixelMetric( PM_ButtonMargin, widget ); int fw = pixelMetric( PM_DefaultFrameWidth, widget ) * 2; //We use bold font sometimes, so that make take more space than Qt allocated. - QFontMetrics origFM = button->fontMetrics(); - QFontMetrics boldFM = QFontMetrics(QFont(button->font().family(), button->font().pointSize(), 75)); + TQFontMetrics origFM = button->fontMetrics(); + TQFontMetrics boldFM = TQFontMetrics(TQFont(button->font().family(), button->font().pointSize(), 75)); int origTextWidth = origFM.size(ShowPrefix, button->text()).width(); int boldTextWidth = boldFM.size(ShowPrefix, button->text()).width(); @@ -1974,12 +1974,12 @@ QSize dotNETstyle::sizeFromContents(ContentsType t, if ( h < 22 ) h = 22; - return QSize( w, h ); + return TQSize( w, h ); } case CT_ComboBox: { int arrow = 21; - return QSize(s.width() + arrow, QMAX(s.height() + 4, 16)); + return TQSize(s.width() + arrow, QMAX(s.height() + 4, 16)); } default: @@ -1992,81 +1992,81 @@ QSize dotNETstyle::sizeFromContents(ContentsType t, void dotNETstyle::paletteChanged() { - QComboBox *combo = 0L; - QMenuBar *menuBar = 0L; - QToolBar *toolBar = 0L; - QWidget *widget = 0L; + TQComboBox *combo = 0L; + TQMenuBar *menuBar = 0L; + TQToolBar *toolBar = 0L; + TQWidget *widget = 0L; - QValueListIterator<QWidget*> it = m_widgets.begin(); + TQValueListIterator<TQWidget*> it = m_widgets.begin(); for ( ; it != m_widgets.end(); ++it ) { widget = *it; - if ((combo = dynamic_cast<QComboBox*>( widget ))) + if ((combo = dynamic_cast<TQComboBox*>( widget ))) updatePalette( combo ); - else if ((toolBar = dynamic_cast<QToolBar*>( widget ))) + else if ((toolBar = dynamic_cast<TQToolBar*>( widget ))) updatePalette( toolBar ); - else if ((menuBar = dynamic_cast<QMenuBar*>( widget ))) + else if ((menuBar = dynamic_cast<TQMenuBar*>( widget ))) updatePalette( menuBar ); } } -void dotNETstyle::updatePalette( QComboBox *combo ) +void dotNETstyle::updatePalette( TQComboBox *combo ) { - QPalette pal = QApplication::palette(); - pal.setColor(QColorGroup::Dark, - pal.active().color(QColorGroup::Base)); - pal.setColor(QColorGroup::Midlight, - pal.active().color(QColorGroup::Background)); + TQPalette pal = TQApplication::palette(); + pal.setColor(TQColorGroup::Dark, + pal.active().color(TQColorGroup::Base)); + pal.setColor(TQColorGroup::Midlight, + pal.active().color(TQColorGroup::Background)); combo->setPalette(pal); } -void dotNETstyle::updatePalette( QToolBar *bar ) +void dotNETstyle::updatePalette( TQToolBar *bar ) { - QPalette pal = QApplication::palette(); - pal.setColor(QColorGroup::Button, - pal.active().color(QColorGroup::Background)); + TQPalette pal = TQApplication::palette(); + pal.setColor(TQColorGroup::Button, + pal.active().color(TQColorGroup::Background)); bar->setPalette(pal); } -void dotNETstyle::updatePalette( QMenuBar *bar ) +void dotNETstyle::updatePalette( TQMenuBar *bar ) { - QPalette pal = QApplication::palette(); - pal.setColor(QColorGroup::Button, - pal.active().color(QColorGroup::Background)); + TQPalette pal = TQApplication::palette(); + pal.setColor(TQColorGroup::Button, + pal.active().color(TQColorGroup::Background)); bar->setPalette(pal); } void dotNETstyle::slotDestroyed() { - m_widgets.remove( (QWidget*) sender() ); + m_widgets.remove( (TQWidget*) sender() ); } -bool dotNETstyle::eventFilter(QObject *obj, QEvent *ev) +bool dotNETstyle::eventFilter(TQObject *obj, TQEvent *ev) { - if (obj->inherits("QComboBox")) { - if (ev->type() == QEvent::Enter) { - QWidget *btn = (QWidget *)obj; + if (obj->inherits("TQComboBox")) { + if (ev->type() == TQEvent::Enter) { + TQWidget *btn = (TQWidget *)obj; if (btn->isEnabled()) { - QPalette pal = btn->palette(); - pal.setColor(QColorGroup::Dark, - pal.active().color(QColorGroup::Highlight).dark()); - pal.setColor(QColorGroup::Midlight, - pal.active().color(QColorGroup::Highlight)); + TQPalette pal = btn->palette(); + pal.setColor(TQColorGroup::Dark, + pal.active().color(TQColorGroup::Highlight).dark()); + pal.setColor(TQColorGroup::Midlight, + pal.active().color(TQColorGroup::Highlight)); btn->setPalette(pal); } - } else if (ev->type() == QEvent::Leave) { - QWidget *btn = (QWidget *)obj; - QPalette pal = btn->palette(); - pal.setColor(QColorGroup::Dark, - pal.active().color(QColorGroup::Base)); - pal.setColor(QColorGroup::Midlight, - pal.active().color(QColorGroup::Background)); + } else if (ev->type() == TQEvent::Leave) { + TQWidget *btn = (TQWidget *)obj; + TQPalette pal = btn->palette(); + pal.setColor(TQColorGroup::Dark, + pal.active().color(TQColorGroup::Base)); + pal.setColor(TQColorGroup::Midlight, + pal.active().color(TQColorGroup::Background)); btn->setPalette(pal); } - } else if (obj->inherits("QButton")) { - QWidget *btn = (QWidget *)obj; - QPalette pal = btn->palette(); - pal.setColor(QColorGroup::Button, - pal.active().color(QColorGroup::Background)); + } else if (obj->inherits("TQButton")) { + TQWidget *btn = (TQWidget *)obj; + TQPalette pal = btn->palette(); + pal.setColor(TQColorGroup::Button, + pal.active().color(TQColorGroup::Background)); btn->setPalette(pal); } diff --git a/styles/dotnet/dotnet.h b/styles/dotnet/dotnet.h index dce41e97..8225da28 100644 --- a/styles/dotnet/dotnet.h +++ b/styles/dotnet/dotnet.h @@ -23,7 +23,7 @@ #define __DOTNET_H #include <kstyle.h> -#include <qbitmap.h> +#include <tqbitmap.h> #define u_arrow -4,1, 2,1, -3,0, 1,0, -2,-1, 0,-1, -1,-2 #define d_arrow -4,-2, 2,-2, -3,-1, 1,-1, -2,0, 0,0, -1,1 @@ -40,90 +40,90 @@ public: dotNETstyle(); virtual ~dotNETstyle(); - bool inheritsKHTML( const QWidget* widget ) const; - void polish( QWidget* widget ); - void unPolish( QWidget* widget ); + bool inheritsKHTML( const TQWidget* widget ) const; + void polish( TQWidget* widget ); + void unPolish( TQWidget* widget ); - void renderMenuBlendPixmap( KPixmap&, const QColorGroup&, const QPopupMenu * ) const; + void renderMenuBlendPixmap( KPixmap&, const TQColorGroup&, const TQPopupMenu * ) const; void drawKStylePrimitive( KStylePrimitive kpe, - QPainter* p, - const QWidget* widget, - const QRect &r, - const QColorGroup &cg, + TQPainter* p, + const TQWidget* widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags = Style_Default, - const QStyleOption& = QStyleOption::Default ) const; + const TQStyleOption& = TQStyleOption::Default ) const; void drawPrimitive( PrimitiveElement pe, - QPainter *p, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQRect &r, + const TQColorGroup &cg, SFlags flags = Style_Default, - const QStyleOption &opt = QStyleOption::Default ) const; + const TQStyleOption &opt = TQStyleOption::Default ) const; void drawControl( ControlElement element, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags = Style_Default, - const QStyleOption& = QStyleOption::Default ) const; + const TQStyleOption& = TQStyleOption::Default ) const; - void drawControlMask( ControlElement, QPainter *, const QWidget *, const QRect &, const QStyleOption &) const; + void drawControlMask( ControlElement, TQPainter *, const TQWidget *, const TQRect &, const TQStyleOption &) const; void drawComplexControl( ComplexControl control, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags = Style_Default, SCFlags controls = SC_All, SCFlags active = SC_None, - const QStyleOption& = QStyleOption::Default ) const; + const TQStyleOption& = TQStyleOption::Default ) const; int pixelMetric( PixelMetric m, - const QWidget *widget = 0 ) const; + const TQWidget *widget = 0 ) const; - QRect subRect( SubRect r, - const QWidget *widget ) const; + TQRect subRect( SubRect r, + const TQWidget *widget ) const; - QRect querySubControlMetrics( ComplexControl control, - const QWidget *widget, + TQRect querySubControlMetrics( ComplexControl control, + const TQWidget *widget, SubControl subcontrol, - const QStyleOption &opt = QStyleOption::Default ) const; + const TQStyleOption &opt = TQStyleOption::Default ) const; - void drawComplexControlMask(QStyle::ComplexControl c, - QPainter *p, - const QWidget *w, - const QRect &r, - const QStyleOption &o=QStyleOption::Default) const; + void drawComplexControlMask(TQStyle::ComplexControl c, + TQPainter *p, + const TQWidget *w, + const TQRect &r, + const TQStyleOption &o=TQStyleOption::Default) const; - QSize sizeFromContents(QStyle::ContentsType t, - const QWidget *w, - const QSize &s, - const QStyleOption &o) const; + TQSize sizeFromContents(TQStyle::ContentsType t, + const TQWidget *w, + const TQSize &s, + const TQStyleOption &o) const; protected: - void renderButton(QPainter *p, - const QRect &r, - const QColorGroup &g, + void renderButton(TQPainter *p, + const TQRect &r, + const TQColorGroup &g, bool sunken = false, bool corners = false) const; - void renderPanel(QPainter *p, - const QRect &r, - const QColorGroup &g, + void renderPanel(TQPainter *p, + const TQRect &r, + const TQColorGroup &g, bool sunken = true, bool thick = true) const; - void renderSlider(QPainter *p, - const QRect &r, - const QColorGroup &g) const; - bool eventFilter(QObject *, QEvent *); + void renderSlider(TQPainter *p, + const TQRect &r, + const TQColorGroup &g) const; + bool eventFilter(TQObject *, TQEvent *); - void updatePalette( QComboBox * ); - void updatePalette( QToolBar * ); - void updatePalette( QMenuBar * ); + void updatePalette( TQComboBox * ); + void updatePalette( TQToolBar * ); + void updatePalette( TQMenuBar * ); protected slots: void slotDestroyed(); @@ -133,11 +133,11 @@ private: // Disable copy constructor and = operator dotNETstyle( const dotNETstyle & ); dotNETstyle& operator=( const dotNETstyle & ); - QStyle *winstyle; + TQStyle *winstyle; bool pseudo3D, useTextShadows, roundedCorners, reverseLayout, kickerMode; - QValueList<QWidget*> m_widgets; + TQValueList<TQWidget*> m_widgets; }; #endif diff --git a/styles/phase/bitmaps.h b/styles/phase/bitmaps.h index d1b8c712..1163e103 100644 --- a/styles/phase/bitmaps.h +++ b/styles/phase/bitmaps.h @@ -11,57 +11,57 @@ // Arrows (6x6) -static QBitmap uarrow; +static TQBitmap uarrow; static const unsigned char uarrow_bits[] = { 0x00, 0x0c, 0x1e, 0x3f, 0x3f, 0x00}; -static QBitmap darrow; +static TQBitmap darrow; static const unsigned char darrow_bits[] = { 0x00, 0x3f, 0x3f, 0x1e, 0x0c, 0x00}; -static QBitmap larrow; +static TQBitmap larrow; static const unsigned char larrow_bits[] = { 0x18, 0x1c, 0x1e, 0x1e, 0x1c, 0x18}; -static QBitmap rarrow; +static TQBitmap rarrow; static const unsigned char rarrow_bits[] = { 0x06, 0x0e, 0x1e, 0x1e, 0x0e, 0x06}; // plus/minus "arrows" -static QBitmap bplus; +static TQBitmap bplus; static const unsigned char bplus_bits[] = { 0x0c, 0x0c, 0x3f, 0x3f, 0x0c, 0x0c}; -static QBitmap bminus; +static TQBitmap bminus; static const unsigned char bminus_bits[] = { 0x00, 0x00, 0x3f, 0x3f, 0x00, 0x00}; // checkmark (9x9) -static QBitmap bcheck; +static TQBitmap bcheck; static const unsigned char bcheck_bits[] = { 0x00, 0x00, 0x80, 0x01, 0xc0, 0x01, 0xe0, 0x00, 0x73, 0x00, 0x3f, 0x00, 0x1e, 0x00, 0x0c, 0x00, 0x00, 0x00}; // expander arrows (9x9) -static QBitmap dexpand; +static TQBitmap dexpand; static const unsigned char dexpand_bits[] = { 0x00, 0x00, 0x00, 0x00, 0xff, 0x01, 0xfe, 0x00, 0x7c, 0x00, 0x38, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}; -static QBitmap rexpand; +static TQBitmap rexpand; static const unsigned char rexpand_bits[] = { 0x04, 0x00, 0x0c, 0x00, 0x1c, 0x00, 0x3c, 0x00, 0x7c, 0x00, 0x3c, 0x00, 0x1c, 0x00, 0x0c, 0x00, 0x04, 0x00}; // scrollbar doodads (4x4) -static QBitmap doodad_mid; +static TQBitmap doodad_mid; static const unsigned char doodad_mid_bits[] = { 0x07, 0x01, 0x01, 0x00}; -static QBitmap doodad_light; +static TQBitmap doodad_light; static const unsigned char doodad_light_bits[] = { 0x00, 0x08, 0x08, 0x0e}; diff --git a/styles/phase/config/phasestyleconfig.cpp b/styles/phase/config/phasestyleconfig.cpp index 8543214c..4f7e200d 100644 --- a/styles/phase/config/phasestyleconfig.cpp +++ b/styles/phase/config/phasestyleconfig.cpp @@ -7,10 +7,10 @@ // Please see the header file for copyright and license information. ////////////////////////////////////////////////////////////////////////////// -#include <qsettings.h> -#include <qcheckbox.h> -#include <qgroupbox.h> -#include <qwhatsthis.h> +#include <tqsettings.h> +#include <tqcheckbox.h> +#include <tqgroupbox.h> +#include <tqwhatsthis.h> #include <klocale.h> #include <kglobal.h> @@ -26,11 +26,11 @@ // ---------------- // Constructor -PhaseStyleConfig::PhaseStyleConfig(QWidget* parent) : StyleDialog(parent) +PhaseStyleConfig::PhaseStyleConfig(TQWidget* parent) : StyleDialog(parent) { KGlobal::locale()->insertCatalogue("kstyle_phase_config"); - QSettings settings; + TQSettings settings; oldgradients = settings.readBoolEntry("/phasestyle/Settings/gradients", true); gradients->setChecked(oldgradients); @@ -39,10 +39,10 @@ PhaseStyleConfig::PhaseStyleConfig(QWidget* parent) : StyleDialog(parent) highlights->setChecked(oldhighlights); // connections - connect(gradients, SIGNAL(toggled(bool)), - this, SLOT(updateChanged())); - connect(highlights, SIGNAL(toggled(bool)), - this, SLOT(updateChanged())); + connect(gradients, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT(updateChanged())); + connect(highlights, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT(updateChanged())); } ////////////////////////////////////////////////////////////////////////////// @@ -79,7 +79,7 @@ void PhaseStyleConfig::updateChanged() void PhaseStyleConfig::save() { - QSettings settings; + TQSettings settings; settings.writeEntry("/phasestyle/Settings/gradients", gradients->isChecked()); settings.writeEntry("/phasestyle/Settings/highlights", @@ -103,7 +103,7 @@ void PhaseStyleConfig::defaults() extern "C" { - KDE_EXPORT QObject* allocate_kstyle_config(QWidget* parent) { + KDE_EXPORT TQObject* allocate_kstyle_config(TQWidget* parent) { return(new PhaseStyleConfig(parent)); } } diff --git a/styles/phase/config/phasestyleconfig.h b/styles/phase/config/phasestyleconfig.h index 8f15531c..f77c5a3a 100644 --- a/styles/phase/config/phasestyleconfig.h +++ b/styles/phase/config/phasestyleconfig.h @@ -35,7 +35,7 @@ class PhaseStyleConfig : public StyleDialog { Q_OBJECT public: - PhaseStyleConfig(QWidget* parent); + PhaseStyleConfig(TQWidget* parent); ~PhaseStyleConfig(); signals: diff --git a/styles/phase/phasestyle.cpp b/styles/phase/phasestyle.cpp index 7ce112b2..d2b14e46 100644 --- a/styles/phase/phasestyle.cpp +++ b/styles/phase/phasestyle.cpp @@ -26,30 +26,30 @@ #include <kpixmap.h> #include <kpixmapeffect.h> -#include <qapplication.h> -#include <qintdict.h> -#include <qpainter.h> -#include <qpointarray.h> -#include <qsettings.h> -#include <qstyleplugin.h> - -#include <qcheckbox.h> -#include <qcombobox.h> -#include <qheader.h> -#include <qmainwindow.h> -#include <qmenubar.h> -#include <qpopupmenu.h> -#include <qprogressbar.h> -#include <qpushbutton.h> -#include <qradiobutton.h> -#include <qscrollbar.h> -#include <qslider.h> -#include <qsplitter.h> -#include <qtabbar.h> -#include <qtabwidget.h> -#include <qtoolbar.h> -#include <qtoolbox.h> -#include <qtoolbutton.h> +#include <tqapplication.h> +#include <tqintdict.h> +#include <tqpainter.h> +#include <tqpointarray.h> +#include <tqsettings.h> +#include <tqstyleplugin.h> + +#include <tqcheckbox.h> +#include <tqcombobox.h> +#include <tqheader.h> +#include <tqmainwindow.h> +#include <tqmenubar.h> +#include <tqpopupmenu.h> +#include <tqprogressbar.h> +#include <tqpushbutton.h> +#include <tqradiobutton.h> +#include <tqscrollbar.h> +#include <tqslider.h> +#include <tqsplitter.h> +#include <tqtabbar.h> +#include <tqtabwidget.h> +#include <tqtoolbar.h> +#include <tqtoolbox.h> +#include <tqtoolbutton.h> #include "phasestyle.h" #include "bitmaps.h" @@ -83,9 +83,9 @@ static unsigned contrast = 110; PhaseStyle::PhaseStyle() : KStyle(FilledFrameWorkaround | AllowMenuTransparency, ThreeButtonScrollBar), hover_(0), hovertab_(0), - gradients_(QPixmap::defaultDepth() > 8), kicker_(false) + gradients_(TQPixmap::defaultDepth() > 8), kicker_(false) { - QSettings settings; + TQSettings settings; if (gradients_) { // don't bother setting if already false gradients_ = settings.readBoolEntry("/phasestyle/Settings/gradients", true); @@ -94,31 +94,31 @@ PhaseStyle::PhaseStyle() highlights_ = settings.readBoolEntry("/phasestyle/Settings/highlights", true); - gradients = new QMap<unsigned int, QIntDict<GradientSet> >; + gradients = new TQMap<unsigned int, TQIntDict<GradientSet> >; - reverse_ = QApplication::reverseLayout(); + reverse_ = TQApplication::reverseLayout(); // create bitmaps - uarrow = QBitmap(6, 6, uarrow_bits, true); + uarrow = TQBitmap(6, 6, uarrow_bits, true); uarrow.setMask(uarrow); - darrow = QBitmap(6, 6, darrow_bits, true); + darrow = TQBitmap(6, 6, darrow_bits, true); darrow.setMask(darrow); - larrow = QBitmap(6, 6, larrow_bits, true); + larrow = TQBitmap(6, 6, larrow_bits, true); larrow.setMask(larrow); - rarrow = QBitmap(6, 6, rarrow_bits, true); + rarrow = TQBitmap(6, 6, rarrow_bits, true); rarrow.setMask(rarrow); - bplus = QBitmap(6, 6, bplus_bits, true); + bplus = TQBitmap(6, 6, bplus_bits, true); bplus.setMask(bplus); - bminus = QBitmap(6, 6, bminus_bits, true); + bminus = TQBitmap(6, 6, bminus_bits, true); bminus.setMask(bminus); - bcheck = QBitmap(9, 9, bcheck_bits, true); + bcheck = TQBitmap(9, 9, bcheck_bits, true); bcheck.setMask(bcheck); - dexpand = QBitmap(9, 9, dexpand_bits, true); + dexpand = TQBitmap(9, 9, dexpand_bits, true); dexpand.setMask(dexpand); - rexpand = QBitmap(9, 9, rexpand_bits, true); + rexpand = TQBitmap(9, 9, rexpand_bits, true); rexpand.setMask(rexpand); - doodad_mid = QBitmap(4, 4, doodad_mid_bits, true); - doodad_light = QBitmap(4, 4, doodad_light_bits, true); + doodad_mid = TQBitmap(4, 4, doodad_mid_bits, true); + doodad_light = TQBitmap(4, 4, doodad_light_bits, true); } PhaseStyle::~PhaseStyle() @@ -136,7 +136,7 @@ PhaseStyle::~PhaseStyle() // -------- // Initialize application specific -void PhaseStyle::polish(QApplication* app) +void PhaseStyle::polish(TQApplication* app) { if (!qstrcmp(app->argv()[0], "kicker")) kicker_ = true; } @@ -146,28 +146,28 @@ void PhaseStyle::polish(QApplication* app) // -------- // Initialize the appearance of a widget -void PhaseStyle::polish(QWidget *widget) +void PhaseStyle::polish(TQWidget *widget) { - if (::qt_cast<QMenuBar*>(widget) || - ::qt_cast<QPopupMenu*>(widget)) { + if (::qt_cast<TQMenuBar*>(widget) || + ::qt_cast<TQPopupMenu*>(widget)) { // anti-flicker optimization widget->setBackgroundMode(NoBackground); - } else if (::qt_cast<QFrame*>(widget) || + } else if (::qt_cast<TQFrame*>(widget) || widget->inherits(QTOOLBAREXTENSION) || (!qstrcmp(widget->name(), KTOOLBARWIDGET))) { // needs special handling on paint events widget->installEventFilter(this); } else if (highlights_ && - (::qt_cast<QPushButton*>(widget) || - ::qt_cast<QComboBox*>(widget) || - ::qt_cast<QSpinWidget*>(widget) || - ::qt_cast<QCheckBox*>(widget) || - ::qt_cast<QRadioButton*>(widget) || - ::qt_cast<QSlider*>(widget) || + (::qt_cast<TQPushButton*>(widget) || + ::qt_cast<TQComboBox*>(widget) || + ::qt_cast<TQSpinWidget*>(widget) || + ::qt_cast<TQCheckBox*>(widget) || + ::qt_cast<TQRadioButton*>(widget) || + ::qt_cast<TQSlider*>(widget) || widget->inherits(QSPLITTERHANDLE))) { // mouseover highlighting widget->installEventFilter(this); - } else if (highlights_ && ::qt_cast<QTabBar*>(widget)) { + } else if (highlights_ && ::qt_cast<TQTabBar*>(widget)) { // highlighting needing mouse tracking widget->setMouseTracking(true); widget->installEventFilter(this); @@ -181,22 +181,22 @@ void PhaseStyle::polish(QWidget *widget) // -------- // Initialize the palette -void PhaseStyle::polish(QPalette &pal) +void PhaseStyle::polish(TQPalette &pal) { // clear out gradients on a color change gradients->clear(); // lighten up a bit, so the look is not so "crisp" - if (QPixmap::defaultDepth() > 8) { // but not on low color displays - pal.setColor(QPalette::Disabled, QColorGroup::Dark, - pal.color(QPalette::Disabled, QColorGroup::Dark).light(contrast)); - pal.setColor(QPalette::Active, QColorGroup::Dark, - pal.color(QPalette::Active, QColorGroup::Dark).light(contrast)); - pal.setColor(QPalette::Inactive, QColorGroup::Dark, - pal.color(QPalette::Inactive, QColorGroup::Dark).light(contrast)); + if (TQPixmap::defaultDepth() > 8) { // but not on low color displays + pal.setColor(TQPalette::Disabled, TQColorGroup::Dark, + pal.color(TQPalette::Disabled, TQColorGroup::Dark).light(contrast)); + pal.setColor(TQPalette::Active, TQColorGroup::Dark, + pal.color(TQPalette::Active, TQColorGroup::Dark).light(contrast)); + pal.setColor(TQPalette::Inactive, TQColorGroup::Dark, + pal.color(TQPalette::Inactive, TQColorGroup::Dark).light(contrast)); } - QStyle::polish(pal); + TQStyle::polish(pal); } ////////////////////////////////////////////////////////////////////////////// @@ -204,25 +204,25 @@ void PhaseStyle::polish(QPalette &pal) // ---------- // Undo the initialization of a widget's appearance -void PhaseStyle::unPolish(QWidget *widget) +void PhaseStyle::unPolish(TQWidget *widget) { - if (::qt_cast<QMenuBar*>(widget) || - ::qt_cast<QPopupMenu*>(widget)) { + if (::qt_cast<TQMenuBar*>(widget) || + ::qt_cast<TQPopupMenu*>(widget)) { widget->setBackgroundMode(PaletteBackground); - } else if (::qt_cast<QFrame*>(widget) || + } else if (::qt_cast<TQFrame*>(widget) || widget->inherits(QTOOLBAREXTENSION) || (!qstrcmp(widget->name(), KTOOLBARWIDGET))) { widget->removeEventFilter(this); } else if (highlights_ && // highlighting - (::qt_cast<QPushButton*>(widget) || - ::qt_cast<QComboBox*>(widget) || - ::qt_cast<QSpinWidget*>(widget) || - ::qt_cast<QCheckBox*>(widget) || - ::qt_cast<QRadioButton*>(widget) || - ::qt_cast<QSlider*>(widget) || + (::qt_cast<TQPushButton*>(widget) || + ::qt_cast<TQComboBox*>(widget) || + ::qt_cast<TQSpinWidget*>(widget) || + ::qt_cast<TQCheckBox*>(widget) || + ::qt_cast<TQRadioButton*>(widget) || + ::qt_cast<TQSlider*>(widget) || widget->inherits(QSPLITTERHANDLE))) { widget->removeEventFilter(this); - } else if (highlights_ && ::qt_cast<QTabBar*>(widget)) { + } else if (highlights_ && ::qt_cast<TQTabBar*>(widget)) { widget->setMouseTracking(false); widget->removeEventFilter(this); } @@ -239,9 +239,9 @@ void PhaseStyle::unPolish(QWidget *widget) // ------------------ // Draw gradient -void PhaseStyle::drawPhaseGradient(QPainter *painter, - const QRect &rect, - QColor color, +void PhaseStyle::drawPhaseGradient(TQPainter *painter, + const TQRect &rect, + TQColor color, bool horizontal, int px, int py, int pw, int ph, @@ -270,7 +270,7 @@ void PhaseStyle::drawPhaseGradient(QPainter *painter, (*gradients)[color.rgb()].insert(size, set); } painter->drawTiledPixmap(rect, *set->gradient(horizontal, reverse), - QPoint(px, py)); + TQPoint(px, py)); } } @@ -279,10 +279,10 @@ void PhaseStyle::drawPhaseGradient(QPainter *painter, // ---------------- // Draw the basic Phase bevel -void PhaseStyle::drawPhaseBevel(QPainter *painter, +void PhaseStyle::drawPhaseBevel(TQPainter *painter, int x, int y, int w, int h, - const QColorGroup &group, - const QColor &fill, + const TQColorGroup &group, + const TQColor &fill, bool sunken, bool horizontal, bool reverse) const @@ -310,7 +310,7 @@ void PhaseStyle::drawPhaseBevel(QPainter *painter, // sunken bevels don't get gradients painter->fillRect(x+2, y+2, w-4, h-4, fill); } else { - drawPhaseGradient(painter, QRect(x+2, y+2, w-4, h-4), fill, + drawPhaseGradient(painter, TQRect(x+2, y+2, w-4, h-4), fill, horizontal, 0, 0, w-4, h-4, reverse); } painter->restore(); @@ -321,10 +321,10 @@ void PhaseStyle::drawPhaseBevel(QPainter *painter, // ---------------- // Draw the basic Phase button -void PhaseStyle::drawPhaseButton(QPainter *painter, +void PhaseStyle::drawPhaseButton(TQPainter *painter, int x, int y, int w, int h, - const QColorGroup &group, - const QColor &fill, + const TQColorGroup &group, + const TQColor &fill, bool sunken) const { int x2 = x + w - 1; @@ -351,11 +351,11 @@ void PhaseStyle::drawPhaseButton(QPainter *painter, // ---------------- // Draw the basic Phase panel -void PhaseStyle::drawPhasePanel(QPainter *painter, +void PhaseStyle::drawPhasePanel(TQPainter *painter, int x, int y, int w, int h, - const QColorGroup &group, + const TQColorGroup &group, bool sunken, - const QBrush *fill) const + const TQBrush *fill) const { int x2 = x + w - 1; int y2 = y + h - 1; @@ -398,14 +398,14 @@ void PhaseStyle::drawPhasePanel(QPainter *painter, // ------------- // Draw a Phase style tab -void PhaseStyle::drawPhaseTab(QPainter *painter, +void PhaseStyle::drawPhaseTab(TQPainter *painter, int x, int y, int w, int h, - const QColorGroup &group, - const QTabBar *bar, - const QStyleOption &option, + const TQColorGroup &group, + const TQTabBar *bar, + const TQStyleOption &option, SFlags flags) const { - const QTabWidget *tabwidget; + const TQTabWidget *tabwidget; bool selected = (flags & Style_Selected); bool edge; // tab is at edge of bar const int x2 = x + w - 1; @@ -421,11 +421,11 @@ void PhaseStyle::drawPhaseTab(QPainter *painter, edge = false; } - switch (QTabBar::Shape(bar->shape())) { - case QTabBar::RoundedAbove: - case QTabBar::TriangularAbove: { + switch (TQTabBar::Shape(bar->shape())) { + case TQTabBar::RoundedAbove: + case TQTabBar::TriangularAbove: { // is there a corner widget? - tabwidget = ::qt_cast<QTabWidget*>(bar->parent()); + tabwidget = ::qt_cast<TQTabWidget*>(bar->parent()); if (edge && tabwidget && tabwidget->cornerWidget(reverse_ ? Qt::TopRight : Qt::TopLeft)) { @@ -438,9 +438,9 @@ void PhaseStyle::drawPhaseTab(QPainter *painter, if (selected) { painter->setPen(Qt::NoPen); painter->fillRect(x+1, y+1, w-1, h-1, - group.brush(QColorGroup::Background)); + group.brush(TQColorGroup::Background)); } else { - drawPhaseGradient(painter, QRect(x+1, y+1, w-1, h-2), + drawPhaseGradient(painter, TQRect(x+1, y+1, w-1, h-2), (flags & Style_MouseOver) ? group.background() : group.background().dark(contrast), @@ -501,10 +501,10 @@ void PhaseStyle::drawPhaseTab(QPainter *painter, break; } - case QTabBar::RoundedBelow: - case QTabBar::TriangularBelow: { + case TQTabBar::RoundedBelow: + case TQTabBar::TriangularBelow: { // is there a corner widget? - tabwidget = ::qt_cast<QTabWidget*>(bar->parent()); + tabwidget = ::qt_cast<TQTabWidget*>(bar->parent()); if (edge && tabwidget && tabwidget->cornerWidget(reverse_ ? Qt::BottomRight : Qt::BottomLeft)) { @@ -572,11 +572,11 @@ void PhaseStyle::drawPhaseTab(QPainter *painter, // Draw the primitive element void PhaseStyle::drawPrimitive(PrimitiveElement element, - QPainter *painter, - const QRect &rect, - const QColorGroup &group, + TQPainter *painter, + const TQRect &rect, + const TQColorGroup &group, SFlags flags, - const QStyleOption &option) const + const TQStyleOption &option) const { // common locals bool down = flags & Style_Down; @@ -586,8 +586,8 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element, bool horiz = flags & Style_Horizontal; bool mouseover = highlights_ && (flags & Style_MouseOver); int x, y, w, h, x2, y2, n, cx, cy; - QPointArray parray; - QWidget* widget; + TQPointArray parray; + TQWidget* widget; rect.rect(&x, &y, &w, &h); x2 = rect.right(); @@ -610,7 +610,7 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element, break; case PE_FocusRect: { - QPen old = painter->pen(); + TQPen old = painter->pen(); painter->setPen(group.highlight().dark(contrast)); painter->drawRect(rect); @@ -621,8 +621,8 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element, case PE_HeaderSection: { // covers kicker taskbar buttons and menu titles - QHeader* header = dynamic_cast<QHeader*>(painter->device()); - widget =dynamic_cast<QWidget*>(painter->device()); + TQHeader* header = dynamic_cast<TQHeader*>(painter->device()); + widget =dynamic_cast<TQWidget*>(painter->device()); if (header) { horiz = (header->orientation() == Horizontal); @@ -630,7 +630,7 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element, horiz = true; } - if ((widget) && ((widget->inherits("QPopupMenu")) || + if ((widget) && ((widget->inherits("TQPopupMenu")) || (widget->inherits("KPopupTitle")))) { // kicker/kdesktop menu titles drawPhaseBevel(painter, x,y,w,h, @@ -639,7 +639,7 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element, // taskbar buttons (assuming no normal headers used in kicker) if (depress) { painter->setPen(group.dark()); - painter->setBrush(group.brush(QColorGroup::Mid)); + painter->setBrush(group.brush(TQColorGroup::Mid)); painter->drawRect(x-1, y-1, w+1, h+1); } else { @@ -650,7 +650,7 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element, // other headers if (depress) { painter->setPen(group.dark()); - painter->setBrush(group.brush(QColorGroup::Mid)); + painter->setBrush(group.brush(TQColorGroup::Mid)); painter->drawRect(x-1, y-1, w+1, h+1); } else { @@ -703,7 +703,7 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element, } } - drawPrimitive(arrow, painter, QRect(x,y,h,w), group, flags); + drawPrimitive(arrow, painter, TQRect(x,y,h,w), group, flags); break; } @@ -727,8 +727,8 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element, case PE_Indicator: drawPhasePanel(painter, x+1, y+1, w-2, h-2, group, true, enabled ? - &group.brush(QColorGroup::Base) : - &group.brush(QColorGroup::Background)); + &group.brush(TQColorGroup::Base) : + &group.brush(TQColorGroup::Background)); if (on) { painter->setPen(mouseover @@ -736,7 +736,7 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element, : group.dark()); painter->drawRect(x+4, y+4, w-8, h-8); painter->fillRect(x+5, y+5, w-10, h-10, - group.brush(QColorGroup::Highlight)); + group.brush(TQColorGroup::Highlight)); } else if (mouseover) { painter->setPen(group.highlight().dark(contrast)); painter->drawRect(x+4, y+4, w-8, h-8); @@ -754,8 +754,8 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element, cy = (y + y2) / 2; painter->setBrush(enabled - ? group.brush(QColorGroup::Base) - : group.brush(QColorGroup::Background)); + ? group.brush(TQColorGroup::Base) + : group.brush(TQColorGroup::Background)); painter->setPen(group.dark()); parray.putPoints(0, 8, @@ -771,7 +771,7 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element, painter->drawPolyline(parray, 0, 4); if (on) { - painter->setBrush(group.brush(QColorGroup::Highlight)); + painter->setBrush(group.brush(TQColorGroup::Highlight)); painter->setPen(mouseover ? group.highlight().dark(contrast) : group.dark()); @@ -804,7 +804,7 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element, case PE_DockWindowResizeHandle: drawPhasePanel(painter, x, y, w, h, group, false, - &group.brush(QColorGroup::Background)); + &group.brush(TQColorGroup::Background)); break; case PE_Splitter: @@ -883,12 +883,12 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element, break; case PE_DockWindowSeparator: { - widget = dynamic_cast<QWidget*>(painter->device()); + widget = dynamic_cast<TQWidget*>(painter->device()); bool flat = true; if (widget && widget->parent() && - widget->parent()->inherits("QToolBar")) { - QToolBar *toolbar = ::qt_cast<QToolBar*>(widget->parent()); + widget->parent()->inherits("TQToolBar")) { + TQToolBar *toolbar = ::qt_cast<TQToolBar*>(widget->parent()); if (toolbar) { // toolbar not floating or in a QMainWindow flat = flatToolbar(toolbar); @@ -1009,12 +1009,12 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element, // Draw the element void PhaseStyle::drawKStylePrimitive(KStylePrimitive element, - QPainter *painter, - const QWidget *widget, - const QRect &rect, - const QColorGroup &group, + TQPainter *painter, + const TQWidget *widget, + const TQRect &rect, + const TQColorGroup &group, SFlags flags, - const QStyleOption &option) const + const TQStyleOption &option) const { bool horiz = flags & Style_Horizontal; int x, y, w, h, x2, y2, n, cx, cy; @@ -1050,7 +1050,7 @@ void PhaseStyle::drawKStylePrimitive(KStylePrimitive element, //case KPE_DockWindowHandle: case KPE_GeneralHandle: cx-=2; cy-=2; - painter->fillRect(rect, group.brush(QColorGroup::Background)); + painter->fillRect(rect, group.brush(TQColorGroup::Background)); if (horiz) { for (n = -5; n <= 5; n += 5) { @@ -1084,7 +1084,7 @@ void PhaseStyle::drawKStylePrimitive(KStylePrimitive element, break; case KPE_SliderGroove: { - const QSlider* slider = ::qt_cast<const QSlider*>(widget); + const TQSlider* slider = ::qt_cast<const TQSlider*>(widget); if (slider) { if (slider->orientation() == Horizontal) { y = cy - 3; @@ -1095,14 +1095,14 @@ void PhaseStyle::drawKStylePrimitive(KStylePrimitive element, } } drawPhasePanel(painter, x, y, w, h, group, true, - &group.brush(QColorGroup::Mid)); + &group.brush(TQColorGroup::Mid)); break; } case KPE_SliderHandle: { - const QSlider* slider = ::qt_cast<const QSlider*>(widget); + const TQSlider* slider = ::qt_cast<const TQSlider*>(widget); if (slider) { - QColor color = (widget==hover_) + TQColor color = (widget==hover_) ? group.button().light(contrast) : group.button(); if (slider->orientation() == Horizontal) { @@ -1132,19 +1132,19 @@ void PhaseStyle::drawKStylePrimitive(KStylePrimitive element, // Draw the control void PhaseStyle::drawControl(ControlElement element, - QPainter *painter, - const QWidget *widget, - const QRect &rect, - const QColorGroup &group, + TQPainter *painter, + const TQWidget *widget, + const TQRect &rect, + const TQColorGroup &group, SFlags flags, - const QStyleOption &option) const + const TQStyleOption &option) const { bool active, enabled, depress; int x, y, w, h, x2, y2, dx; - QMenuItem *mi; - QIconSet::Mode mode; - QIconSet::State state; - QPixmap pixmap; + TQMenuItem *mi; + TQIconSet::Mode mode; + TQIconSet::State state; + TQPixmap pixmap; rect.rect(&x, &y, &w, &h); x2 = rect.right(); @@ -1157,7 +1157,7 @@ void PhaseStyle::drawControl(ControlElement element, if ((flags & Style_ButtonDefault) && !depress) { drawPhasePanel(painter, x, y, w, h, group, true, - &group.brush(QColorGroup::Mid)); + &group.brush(TQColorGroup::Mid)); drawPhaseBevel(painter, x+bd, y+bd, w-bd*2, h-bd*2, group, (widget==hover_) ? group.button().light(contrast) @@ -1179,7 +1179,7 @@ void PhaseStyle::drawControl(ControlElement element, } case CE_PushButtonLabel: { - const QPushButton* button = ::qt_cast<const QPushButton*>(widget); + const TQPushButton* button = ::qt_cast<const TQPushButton*>(widget); if (!button) { KStyle::drawControl(element, painter, widget, rect, group, flags, option); @@ -1195,7 +1195,7 @@ void PhaseStyle::drawControl(ControlElement element, if (button->isMenuButton()) { // menu indicator int dx = pixelMetric(PM_MenuButtonIndicator, widget); drawPrimitive(PE_ArrowDown, painter, - QRect(x+w-dx-2, y+2, dx, h-4), + TQRect(x+w-dx-2, y+2, dx, h-4), group, flags, option); w -= dx; } @@ -1203,21 +1203,21 @@ void PhaseStyle::drawControl(ControlElement element, if (button->iconSet() && !button->iconSet()->isNull()) { // draw icon if (button->isEnabled()) { if (button->hasFocus()) { - mode = QIconSet::Active; + mode = TQIconSet::Active; } else { - mode = QIconSet::Normal; + mode = TQIconSet::Normal; } } else { - mode = QIconSet::Disabled; + mode = TQIconSet::Disabled; } if (button->isToggleButton() && button->isOn()) { - state = QIconSet::On; + state = TQIconSet::On; } else { - state = QIconSet::Off; + state = TQIconSet::Off; } - pixmap = button->iconSet()->pixmap(QIconSet::Small, mode, state); + pixmap = button->iconSet()->pixmap(TQIconSet::Small, mode, state); if (button->text().isEmpty() && !button->pixmap()) { painter->drawPixmap(x+w/2 - pixmap.width()/2, y+h/2 - pixmap.height()/2, pixmap); @@ -1230,7 +1230,7 @@ void PhaseStyle::drawControl(ControlElement element, if (active || button->isDefault()) { // default button for(int n=0; n<2; n++) { - drawItem(painter, QRect(x+n, y, w, h), + drawItem(painter, TQRect(x+n, y, w, h), AlignCenter | ShowPrefix, button->colorGroup(), button->isEnabled(), @@ -1241,7 +1241,7 @@ void PhaseStyle::drawControl(ControlElement element, &button->colorGroup().mid()); } } else { // normal button - drawItem(painter, QRect(x, y, w, h), + drawItem(painter, TQRect(x, y, w, h), AlignCenter | ShowPrefix, button->colorGroup(), button->isEnabled(), @@ -1256,7 +1256,7 @@ void PhaseStyle::drawControl(ControlElement element, case CE_CheckBoxLabel: case CE_RadioButtonLabel: { - const QButton *b = ::qt_cast<const QButton*>(widget); + const TQButton *b = ::qt_cast<const TQButton*>(widget); if (!b) return; int alignment = reverse_ ? AlignRight : AlignLeft; @@ -1274,7 +1274,7 @@ void PhaseStyle::drawControl(ControlElement element, } case CE_DockWindowEmptyArea: { - const QToolBar *tb = ::qt_cast<const QToolBar*>(widget); + const TQToolBar *tb = ::qt_cast<const TQToolBar*>(widget); if (tb) { // toolbar not floating or in a QMainWindow if (flatToolbar(tb)) { @@ -1289,24 +1289,24 @@ void PhaseStyle::drawControl(ControlElement element, } case CE_MenuBarEmptyArea: - drawPhaseGradient(painter, QRect(x, y, w, h), group.background(), + drawPhaseGradient(painter, TQRect(x, y, w, h), group.background(), (w<h), 0, 0, 0, 0, false); break; case CE_MenuBarItem: { - const QMenuBar *mbar = ::qt_cast<const QMenuBar*>(widget); + const TQMenuBar *mbar = ::qt_cast<const TQMenuBar*>(widget); if (!mbar) { KStyle::drawControl(element, painter, widget, rect, group, flags, option); return; } mi = option.menuItem(); - QRect prect = mbar->rect(); + TQRect prect = mbar->rect(); if ((flags & Style_Active) && (flags & Style_HasFocus)) { if (flags & Style_Down) { drawPhasePanel(painter, x, y, w, h, group, true, - &group.brush(QColorGroup::Background)); + &group.brush(TQColorGroup::Background)); } else { drawPhaseBevel(painter, x, y, w, h, group, group.background(), @@ -1325,7 +1325,7 @@ void PhaseStyle::drawControl(ControlElement element, } case CE_PopupMenuItem: { - const QPopupMenu *popup = ::qt_cast<const QPopupMenu*>(widget); + const TQPopupMenu *popup = ::qt_cast<const TQPopupMenu*>(widget); if (!popup) { KStyle::drawControl(element, painter, widget, rect, group, flags, option); @@ -1344,7 +1344,7 @@ void PhaseStyle::drawControl(ControlElement element, bool etchtext = styleHint(SH_EtchDisabledText); active = flags & Style_Active; enabled = mi->isEnabled(); - QRect vrect; + TQRect vrect; if (checkable) checkwidth = QMAX(checkwidth, 20); @@ -1374,13 +1374,13 @@ void PhaseStyle::drawControl(ControlElement element, // draw icon if (mi->iconSet() && !mi->isChecked()) { if (active) - mode = enabled ? QIconSet::Active : QIconSet::Disabled; + mode = enabled ? TQIconSet::Active : TQIconSet::Disabled; else - mode = enabled ? QIconSet::Normal : QIconSet::Disabled; + mode = enabled ? TQIconSet::Normal : TQIconSet::Disabled; - pixmap = mi->iconSet()->pixmap(QIconSet::Small, mode); - QRect pmrect(0, 0, pixmap.width(), pixmap.height()); - vrect = visualRect(QRect(x, y, checkwidth, h), rect); + pixmap = mi->iconSet()->pixmap(TQIconSet::Small, mode); + TQRect pmrect(0, 0, pixmap.width(), pixmap.height()); + vrect = visualRect(TQRect(x, y, checkwidth, h), rect); pmrect.moveCenter(vrect.center()); painter->drawPixmap(pmrect.topLeft(), pixmap); } @@ -1389,7 +1389,7 @@ void PhaseStyle::drawControl(ControlElement element, if (mi->isChecked()) { int cx = reverse_ ? x+w - checkwidth : x; drawPrimitive(PE_CheckMark, painter, - QRect(cx + ITEMFRAME, y + ITEMFRAME, + TQRect(cx + ITEMFRAME, y + ITEMFRAME, checkwidth - ITEMFRAME*2, h - ITEMFRAME*2), group, Style_Default | (active ? Style_Enabled : Style_On)); @@ -1421,7 +1421,7 @@ void PhaseStyle::drawControl(ControlElement element, painter->restore(); } else { // draw label - QString text = mi->text(); + TQString text = mi->text(); if (!text.isNull()) { int t = text.find('\t'); @@ -1477,7 +1477,7 @@ void PhaseStyle::drawControl(ControlElement element, if (mi->popup()) { // draw submenu arrow PrimitiveElement arrow = reverse_ ? PE_ArrowLeft : PE_ArrowRight; int dim = (h-2*ITEMFRAME) / 2; - vrect = visualRect(QRect(x + w - ARROWMARGIN - ITEMFRAME - dim, + vrect = visualRect(TQRect(x + w - ARROWMARGIN - ITEMFRAME - dim, y + h / 2 - dim / 2, dim, dim), rect); drawPrimitive(arrow, painter, vrect, group, enabled ? Style_Enabled : Style_Default); @@ -1486,7 +1486,7 @@ void PhaseStyle::drawControl(ControlElement element, } case CE_TabBarTab: { - const QTabBar* tab = ::qt_cast<const QTabBar*>(widget); + const TQTabBar* tab = ::qt_cast<const TQTabBar*>(widget); if (tab) { if ((widget == hover_) && (option.tab() == hovertab_)) { flags |= Style_MouseOver; @@ -1504,12 +1504,12 @@ void PhaseStyle::drawControl(ControlElement element, case CE_ProgressBarGroove: { drawPhasePanel(painter, x, y, w, h, group, true, - &group.brush(QColorGroup::Base)); + &group.brush(TQColorGroup::Base)); break; } case CE_ProgressBarContents: { - const QProgressBar* pbar = ::qt_cast<const QProgressBar*>(widget); + const TQProgressBar* pbar = ::qt_cast<const TQProgressBar*>(widget); if (!pbar) { KStyle::drawControl(element, painter, widget, rect, group, flags, option); @@ -1517,7 +1517,7 @@ void PhaseStyle::drawControl(ControlElement element, } subRect(SR_ProgressBarContents, widget).rect(&x, &y, &w, &h); - painter->setBrush(group.brush(QColorGroup::Highlight)); + painter->setBrush(group.brush(TQColorGroup::Highlight)); painter->setPen(group.dark()); if (!pbar->totalSteps()) { @@ -1539,7 +1539,7 @@ void PhaseStyle::drawControl(ControlElement element, #if (QT_VERSION >= 0x030200) case CE_ToolBoxTab: { - const QToolBox *box = ::qt_cast<const QToolBox*>(widget); + const TQToolBox *box = ::qt_cast<const TQToolBox*>(widget); if (!box) { KStyle::drawControl(element, painter, widget, rect, group, flags, option); @@ -1549,7 +1549,7 @@ void PhaseStyle::drawControl(ControlElement element, const int rx = x2 - 20; const int cx = rx - h + 1; - QPointArray parray(6); + TQPointArray parray(6); parray.putPoints(0, 6, x-1,y, cx,y, rx-2,y2-2, x2+1,y2-2, x2+1,y2+2, x-1,y2+2); @@ -1560,7 +1560,7 @@ void PhaseStyle::drawControl(ControlElement element, painter->drawConvexPolygon(parray, 0, 6); painter->setBrush(NoBrush); } else { - painter->setClipRegion(parray, QPainter::CoordPainter); + painter->setClipRegion(parray, TQPainter::CoordPainter); drawPhaseGradient(painter, rect, group.background(), false, 0, 0, 0, h*2, false); @@ -1588,10 +1588,10 @@ void PhaseStyle::drawControl(ControlElement element, // Draw a bitmask for the element void PhaseStyle::drawControlMask(ControlElement element, - QPainter *painter, - const QWidget *widget, - const QRect &rect, - const QStyleOption &option) const + TQPainter *painter, + const TQWidget *widget, + const TQRect &rect, + const TQStyleOption &option) const { switch (element) { case CE_PushButton: @@ -1610,26 +1610,26 @@ void PhaseStyle::drawControlMask(ControlElement element, // Draw a complex control void PhaseStyle::drawComplexControl(ComplexControl control, - QPainter *painter, - const QWidget *widget, - const QRect &rect, - const QColorGroup &group, + TQPainter *painter, + const TQWidget *widget, + const TQRect &rect, + const TQColorGroup &group, SFlags flags, SCFlags controls, SCFlags active, - const QStyleOption &option) const + const TQStyleOption &option) const { bool down = flags & Style_Down; bool on = flags & Style_On; bool raised = flags & Style_Raised; bool sunken = flags & Style_Sunken; - QRect subrect; + TQRect subrect; int x, y, w, h, x2, y2; rect.rect(&x, &y, &w, &h); switch (control) { case CC_ComboBox: { - const QComboBox * combo = ::qt_cast<const QComboBox*>(widget); + const TQComboBox * combo = ::qt_cast<const TQComboBox*>(widget); if (!combo) { KStyle::drawComplexControl(control, painter, widget, rect, group, flags, controls, active, option); @@ -1650,8 +1650,8 @@ void PhaseStyle::drawComplexControl(ComplexControl control, int slot = QMAX(h/4, 6) + (h % 2); drawPhasePanel(painter, x+3, y+(h/2)-(slot/2), w-6, slot, group, true, - sunken ? &group.brush(QColorGroup::Midlight) - : &group.brush(QColorGroup::Mid)); + sunken ? &group.brush(TQColorGroup::Midlight) + : &group.brush(TQColorGroup::Mid)); } if (controls & SC_ComboBoxEditField) { // draw edit box @@ -1670,7 +1670,7 @@ void PhaseStyle::drawComplexControl(ComplexControl control, combo), widget); drawPrimitive(PE_FocusRect, painter, subrect, group, Style_FocusAtBorder, - QStyleOption(group.highlight())); + TQStyleOption(group.highlight())); } } @@ -1680,14 +1680,14 @@ void PhaseStyle::drawComplexControl(ComplexControl control, case CC_ScrollBar: { // always a three button scrollbar - const QScrollBar *sb = ::qt_cast<const QScrollBar*>(widget); + const TQScrollBar *sb = ::qt_cast<const TQScrollBar*>(widget); if (!sb) { KStyle::drawComplexControl(control, painter, widget, rect, group, flags, controls, active, option); return; } - QRect srect; + TQRect srect; bool horizontal = (sb->orientation() == Qt::Horizontal); SFlags scrollflags = (horizontal ? Style_Horizontal : Style_Default); @@ -1777,7 +1777,7 @@ void PhaseStyle::drawComplexControl(ComplexControl control, } case CC_SpinWidget: { - const QSpinWidget *spin = ::qt_cast<const QSpinWidget*>(widget); + const TQSpinWidget *spin = ::qt_cast<const TQSpinWidget*>(widget); if (!spin) { KStyle::drawComplexControl(control, painter, widget, rect, group, flags, controls, active, option); @@ -1809,7 +1809,7 @@ void PhaseStyle::drawComplexControl(ComplexControl control, subrect = spin->upRect(); sunken = (active == SC_SpinWidgetUp); - if (spin->buttonSymbols() == QSpinWidget::PlusMinus) + if (spin->buttonSymbols() == TQSpinWidget::PlusMinus) element = PE_SpinWidgetPlus; else element = PE_SpinWidgetUp; @@ -1824,7 +1824,7 @@ void PhaseStyle::drawComplexControl(ComplexControl control, subrect = spin->downRect(); sunken = (active == SC_SpinWidgetDown); - if (spin->buttonSymbols() == QSpinWidget::PlusMinus) + if (spin->buttonSymbols() == TQSpinWidget::PlusMinus) element = PE_SpinWidgetMinus; else element = PE_SpinWidgetDown; @@ -1837,23 +1837,23 @@ void PhaseStyle::drawComplexControl(ComplexControl control, } case CC_ToolButton: { - const QToolButton *btn = ::qt_cast<const QToolButton*>(widget); + const TQToolButton *btn = ::qt_cast<const TQToolButton*>(widget); if (!btn) { KStyle::drawComplexControl(control, painter, widget, rect, group, flags, controls, active, option); return; } - QToolBar *toolbar; + TQToolBar *toolbar; bool horiz = true; bool normal = !(down || on || raised); // normal button state x2 = rect.right(); y2 = rect.bottom(); - // check for QToolBar parent - if (btn->parent() && btn->parent()->inherits("QToolBar")) { - toolbar = ::qt_cast<QToolBar*>(btn->parent()); + // check for TQToolBar parent + if (btn->parent() && btn->parent()->inherits("TQToolBar")) { + toolbar = ::qt_cast<TQToolBar*>(btn->parent()); if (toolbar) { horiz = (toolbar->orientation() == Qt::Horizontal); if (normal) { // draw background @@ -1878,9 +1878,9 @@ void PhaseStyle::drawComplexControl(ComplexControl control, // check for QToolBarExtensionWidget parent else if (btn->parent() && btn->parent()->inherits(QTOOLBAREXTENSION)) { - QWidget *extension; - if ((extension = ::qt_cast<QWidget*>(btn->parent()))) { - toolbar = ::qt_cast<QToolBar*>(extension->parent()); + TQWidget *extension; + if ((extension = ::qt_cast<TQWidget*>(btn->parent()))) { + toolbar = ::qt_cast<TQToolBar*>(extension->parent()); if (toolbar) { horiz = (toolbar->orientation() == Qt::Horizontal); if (normal) { // draw background @@ -1895,7 +1895,7 @@ void PhaseStyle::drawComplexControl(ComplexControl control, else if (normal && btn->parentWidget() && btn->parentWidget()->backgroundPixmap() && !btn->parentWidget()->backgroundPixmap()->isNull()) { - QPixmap pixmap = *(btn->parentWidget()->backgroundPixmap()); + TQPixmap pixmap = *(btn->parentWidget()->backgroundPixmap()); painter->drawTiledPixmap(rect, pixmap, btn->pos()); } // everything else @@ -1907,7 +1907,7 @@ void PhaseStyle::drawComplexControl(ComplexControl control, // now draw active buttons if (down || on) { drawPhasePanel(painter, x, y, w, h, group, true, - &group.brush(QColorGroup::Button)); + &group.brush(TQColorGroup::Button)); } else if (raised) { drawPhaseBevel(painter, x, y, w, h, group, group.button(), false, !horiz, true); @@ -1929,10 +1929,10 @@ void PhaseStyle::drawComplexControl(ComplexControl control, // Draw a bitmask for the control void PhaseStyle::drawComplexControlMask(ComplexControl control, - QPainter *painter, - const QWidget *widget, - const QRect &rect, - const QStyleOption &option) const + TQPainter *painter, + const TQWidget *widget, + const TQRect &rect, + const TQStyleOption &option) const { switch (control) { case CC_ComboBox: @@ -1952,10 +1952,10 @@ void PhaseStyle::drawComplexControlMask(ComplexControl control, // ------------- // Get the pixel metric for metric -int PhaseStyle::pixelMetric(PixelMetric metric, const QWidget *widget) const +int PhaseStyle::pixelMetric(PixelMetric metric, const TQWidget *widget) const { // not using widget's font, so that all metrics are uniform - int em = QMAX(QApplication::fontMetrics().strikeOutPos() * 3, 17); + int em = QMAX(TQApplication::fontMetrics().strikeOutPos() * 3, 17); switch (metric) { case PM_DefaultFrameWidth: @@ -1974,8 +1974,8 @@ int PhaseStyle::pixelMetric(PixelMetric metric, const QWidget *widget) const return 24; case PM_TabBarTabVSpace: - if (const QTabBar *tb = ::qt_cast<const QTabBar*>(widget)) { - if (tb->shape() == QTabBar::RoundedAbove) { + if (const TQTabBar *tb = ::qt_cast<const TQTabBar*>(widget)) { + if (tb->shape() == TQTabBar::RoundedAbove) { return 10; } else { return 6; @@ -2011,11 +2011,11 @@ int PhaseStyle::pixelMetric(PixelMetric metric, const QWidget *widget) const // --------- // Return subrect for the widget in logical coordinates -QRect PhaseStyle::subRect(SubRect rect, const QWidget *widget) const +TQRect PhaseStyle::subRect(SubRect rect, const TQWidget *widget) const { switch (rect) { case SR_ComboBoxFocusRect: { - QRect r = querySubControlMetrics(CC_ComboBox, widget, + TQRect r = querySubControlMetrics(CC_ComboBox, widget, SC_ComboBoxEditField); r.addCoords(1, 1,-1,-1); return r; @@ -2031,12 +2031,12 @@ QRect PhaseStyle::subRect(SubRect rect, const QWidget *widget) const // ------------------------ // Get metrics for subcontrols of complex controls -QRect PhaseStyle::querySubControlMetrics(ComplexControl control, - const QWidget *widget, +TQRect PhaseStyle::querySubControlMetrics(ComplexControl control, + const TQWidget *widget, SubControl subcontrol, - const QStyleOption &option) const + const TQStyleOption &option) const { - QRect rect; + TQRect rect; const int fw = pixelMetric(PM_DefaultFrameWidth, widget); int w = widget->width(), h = widget->height(); @@ -2071,7 +2071,7 @@ QRect PhaseStyle::querySubControlMetrics(ComplexControl control, } case CC_ScrollBar: { - const QScrollBar *sb = ::qt_cast<const QScrollBar*>(widget); + const TQScrollBar *sb = ::qt_cast<const TQScrollBar*>(widget); if (!sb) break; bool horizontal = (sb->orientation() == Qt::Horizontal); @@ -2130,17 +2130,17 @@ QRect PhaseStyle::querySubControlMetrics(ComplexControl control, // ------------------ // Returns the size of widget based on the contentsize -QSize PhaseStyle::sizeFromContents(ContentsType contents, - const QWidget* widget, - const QSize &contentsize, - const QStyleOption &option ) const +TQSize PhaseStyle::sizeFromContents(ContentsType contents, + const TQWidget* widget, + const TQSize &contentsize, + const TQStyleOption &option ) const { int w = contentsize.width(); int h = contentsize.height(); switch (contents) { case CT_PushButton: { - const QPushButton* button = ::qt_cast<const QPushButton*>(widget); + const TQPushButton* button = ::qt_cast<const TQPushButton*>(widget); if (!button) { return KStyle::sizeFromContents(contents, widget, contentsize, option); @@ -2156,17 +2156,17 @@ QSize PhaseStyle::sizeFromContents(ContentsType contents, if (w < 80 && !button->pixmap()) w = 80; } if (h < 22) h = 22; - return QSize(w, h); + return TQSize(w, h); } case CT_PopupMenuItem: { if (!widget || option.isDefault()) return contentsize; - const QPopupMenu *popup = ::qt_cast<const QPopupMenu*>(widget); + const TQPopupMenu *popup = ::qt_cast<const TQPopupMenu*>(widget); if (!popup) { return KStyle::sizeFromContents(contents, widget, contentsize, option); } - QMenuItem *item = option.menuItem(); + TQMenuItem *item = option.menuItem(); if (item->custom()) { w = item->custom()->sizeHint().width(); @@ -2188,7 +2188,7 @@ QSize PhaseStyle::sizeFromContents(ContentsType contents, } if (item->iconSet()) h = QMAX(h, item->iconSet()-> - pixmap(QIconSet::Small, QIconSet::Normal).height() + pixmap(TQIconSet::Small, TQIconSet::Normal).height() + ITEMFRAME*2); } @@ -2199,11 +2199,11 @@ QSize PhaseStyle::sizeFromContents(ContentsType contents, if (option.maxIconWidth() || popup->isCheckable()) { w += QMAX(option.maxIconWidth(), - QIconSet::iconSize(QIconSet::Small).width()) + TQIconSet::iconSize(TQIconSet::Small).width()) + ITEMHMARGIN*2; } w += RIGHTBORDER; - return QSize(w, h); + return TQSize(w, h); } default: @@ -2221,12 +2221,12 @@ QSize PhaseStyle::sizeFromContents(ContentsType contents, // ------------- // Is the toolbar "flat" -bool PhaseStyle::flatToolbar(const QToolBar *toolbar) const +bool PhaseStyle::flatToolbar(const TQToolBar *toolbar) const { if (!toolbar) return true; // not on a toolbar if (!toolbar->isMovingEnabled()) return true; // immobile toolbars are flat if (!toolbar->area()) return true; // not docked - if (toolbar->place() == QDockWindow::OutsideDock) return true; // ditto + if (toolbar->place() == TQDockWindow::OutsideDock) return true; // ditto if (!toolbar->mainWindow()) return true; // not in a main window return false; } @@ -2237,42 +2237,42 @@ bool PhaseStyle::flatToolbar(const QToolBar *toolbar) const // Grab events we are interested in. Most of this routine is to handle the // exceptions to the normal styling rules. -bool PhaseStyle::eventFilter(QObject *object, QEvent *event) +bool PhaseStyle::eventFilter(TQObject *object, TQEvent *event) { if (KStyle::eventFilter(object, event)) return true; if (!object->isWidgetType()) return false; bool horiz; int x, y, w, h; - QFrame *frame; - QToolBar *toolbar; - QWidget *widget; + TQFrame *frame; + TQToolBar *toolbar; + TQWidget *widget; // painting events - if (event->type() == QEvent::Paint) { + if (event->type() == TQEvent::Paint) { // make sure we do the most specific stuff first // KDE Toolbar Widget // patch by Daniel Brownlees <[email protected]> if (object->parent() && !qstrcmp(object->name(), KTOOLBARWIDGET)) { - if (0 == (widget = ::qt_cast<QWidget*>(object))) return false; - QWidget *parent = ::qt_cast<QWidget*>(object->parent()); + if (0 == (widget = ::qt_cast<TQWidget*>(object))) return false; + TQWidget *parent = ::qt_cast<TQWidget*>(object->parent()); int px = widget->x(), py = widget->y(); // find the toolbar while (parent && parent->parent() - && !::qt_cast<QToolBar*>(parent)) { + && !::qt_cast<TQToolBar*>(parent)) { px += parent->x(); py += parent->y(); - parent = ::qt_cast<QWidget*>(parent->parent()); + parent = ::qt_cast<TQWidget*>(parent->parent()); } if (!parent) return false; widget->rect().rect(&x, &y, &w, &h); - QRect prect = parent->rect(); + TQRect prect = parent->rect(); - toolbar = ::qt_cast<QToolBar*>(parent); + toolbar = ::qt_cast<TQToolBar*>(parent); horiz = (toolbar) ? (toolbar->orientation() == Qt::Horizontal) : (prect.height() < prect.width()); - QPainter painter(widget); + TQPainter painter(widget); if (flatToolbar(toolbar)) { painter.fillRect(widget->rect(), parent->colorGroup().background()); @@ -2293,10 +2293,10 @@ bool PhaseStyle::eventFilter(QObject *object, QEvent *event) // QToolBarExtensionWidget else if (object && object->isWidgetType() && object->parent() && - (toolbar = ::qt_cast<QToolBar*>(object->parent()))) { - if (0 == (widget = ::qt_cast<QWidget*>(object))) return false; + (toolbar = ::qt_cast<TQToolBar*>(object->parent()))) { + if (0 == (widget = ::qt_cast<TQWidget*>(object))) return false; horiz = (toolbar->orientation() == Qt::Horizontal); - QPainter painter(widget); + TQPainter painter(widget); widget->rect().rect(&x, &y, &w, &h); // draw the extension drawPhaseGradient(&painter, widget->rect(), @@ -2323,19 +2323,19 @@ bool PhaseStyle::eventFilter(QObject *object, QEvent *event) } } - // QFrame lines (do this guy last) - else if (0 != (frame = ::qt_cast<QFrame*>(object))) { - QFrame::Shape shape = frame->frameShape(); + // TQFrame lines (do this guy last) + else if (0 != (frame = ::qt_cast<TQFrame*>(object))) { + TQFrame::Shape shape = frame->frameShape(); switch (shape) { - case QFrame::HLine: - case QFrame::VLine: { + case TQFrame::HLine: + case TQFrame::VLine: { // NOTE: assuming lines have no content - QPainter painter(frame); + TQPainter painter(frame); frame->rect().rect(&x, &y, &w, &h); painter.setPen(frame->colorGroup().dark()); - if (shape == QFrame::HLine) { + if (shape == TQFrame::HLine) { painter.drawLine(0, h/2, w, h/2); - } else if (shape == QFrame::VLine) { + } else if (shape == TQFrame::VLine) { painter.drawLine(w/2, 0, w/2, h); } return true; @@ -2346,45 +2346,45 @@ bool PhaseStyle::eventFilter(QObject *object, QEvent *event) } } else if (highlights_) { // "mouseover" events - if (::qt_cast<QPushButton*>(object) || - ::qt_cast<QComboBox*>(object) || - ::qt_cast<QSpinWidget*>(object) || - ::qt_cast<QCheckBox*>(object) || - ::qt_cast<QRadioButton*>(object) || - ::qt_cast<QSlider*>(object) || + if (::qt_cast<TQPushButton*>(object) || + ::qt_cast<TQComboBox*>(object) || + ::qt_cast<TQSpinWidget*>(object) || + ::qt_cast<TQCheckBox*>(object) || + ::qt_cast<TQRadioButton*>(object) || + ::qt_cast<TQSlider*>(object) || object->inherits(QSPLITTERHANDLE)) { - if (event->type() == QEvent::Enter) { - if (0 != (widget = ::qt_cast<QWidget*>(object)) && + if (event->type() == TQEvent::Enter) { + if (0 != (widget = ::qt_cast<TQWidget*>(object)) && widget->isEnabled()) { hover_ = widget; widget->repaint(false); } - } else if (event->type() == QEvent::Leave) { - if (0 != (widget = ::qt_cast<QWidget*>(object))) { + } else if (event->type() == TQEvent::Leave) { + if (0 != (widget = ::qt_cast<TQWidget*>(object))) { hover_ = 0; widget->repaint(false); } } - } else if (::qt_cast<QTabBar*>(object)) { // special case for qtabbar - if (event->type() == QEvent::Enter) { - if (0 != (widget = ::qt_cast<QWidget*>(object)) && + } else if (::qt_cast<TQTabBar*>(object)) { // special case for qtabbar + if (event->type() == TQEvent::Enter) { + if (0 != (widget = ::qt_cast<TQWidget*>(object)) && widget->isEnabled()) { hover_ = widget; hovertab_ = 0;; widget->repaint(false); } - } else if (event->type() == QEvent::Leave) { - if (0 != (widget = ::qt_cast<QWidget*>(object))) { + } else if (event->type() == TQEvent::Leave) { + if (0 != (widget = ::qt_cast<TQWidget*>(object))) { hover_ = 0; hovertab_ = 0;; widget->repaint(false); } - } else if (event->type() == QEvent::MouseMove) { - QTabBar *tabbar; - if (0 != (tabbar = ::qt_cast<QTabBar*>(object))) { - QMouseEvent *me; - if (0 != (me = dynamic_cast<QMouseEvent*>(event))) { - QTab *tab = tabbar->selectTab(me->pos()); + } else if (event->type() == TQEvent::MouseMove) { + TQTabBar *tabbar; + if (0 != (tabbar = ::qt_cast<TQTabBar*>(object))) { + TQMouseEvent *me; + if (0 != (me = dynamic_cast<TQMouseEvent*>(event))) { + TQTab *tab = tabbar->selectTab(me->pos()); if (hovertab_ != tab) { hovertab_ = tab; tabbar->repaint(false); @@ -2407,7 +2407,7 @@ bool PhaseStyle::eventFilter(QObject *object, QEvent *event) // ------------- // Constructor -GradientSet::GradientSet(const QColor &color, int size) +GradientSet::GradientSet(const TQColor &color, int size) : color_(color), size_(size) { for (int n=0; n<GradientTypeCount; ++n) set[n] = 0; @@ -2489,18 +2489,18 @@ class PhaseStylePlugin : public QStylePlugin { public: PhaseStylePlugin(); - QStringList keys() const; - QStyle *create(const QString &key); + TQStringList keys() const; + TQStyle *create(const TQString &key); }; -PhaseStylePlugin::PhaseStylePlugin() : QStylePlugin() { ; } +PhaseStylePlugin::PhaseStylePlugin() : TQStylePlugin() { ; } -QStringList PhaseStylePlugin::keys() const +TQStringList PhaseStylePlugin::keys() const { - return QStringList() << "Phase"; + return TQStringList() << "Phase"; } -QStyle* PhaseStylePlugin::create(const QString& key) +TQStyle* PhaseStylePlugin::create(const TQString& key) { if (key.lower() == "phase") return new PhaseStyle(); diff --git a/styles/phase/phasestyle.h b/styles/phase/phasestyle.h index f8d4b7e0..5c44c742 100644 --- a/styles/phase/phasestyle.h +++ b/styles/phase/phasestyle.h @@ -28,7 +28,7 @@ #define PHASESTYLE_H #include <kstyle.h> -#include <qcolor.h> +#include <tqcolor.h> class KPixmap; @@ -43,14 +43,14 @@ public: GradientTypeCount }; - GradientSet(const QColor &color, int size); + GradientSet(const TQColor &color, int size); ~GradientSet(); KPixmap* gradient(bool horizontal, bool reverse); private: KPixmap *set[GradientTypeCount]; - QColor color_; + TQColor color_; int size_; }; @@ -61,118 +61,118 @@ public: PhaseStyle(); virtual ~PhaseStyle(); - void polish(QApplication* app); - void polish(QWidget *widget); - void polish(QPalette &pal); - void unPolish(QWidget *widget); + void polish(TQApplication* app); + void polish(TQWidget *widget); + void polish(TQPalette &pal); + void unPolish(TQWidget *widget); void drawPrimitive(PrimitiveElement element, - QPainter *painter, - const QRect &rect, - const QColorGroup &group, + TQPainter *painter, + const TQRect &rect, + const TQColorGroup &group, SFlags flags = Style_Default, - const QStyleOption &option = QStyleOption::Default) const; + const TQStyleOption &option = TQStyleOption::Default) const; void drawKStylePrimitive(KStylePrimitive element, - QPainter *painter, - const QWidget *widget, - const QRect &rect, - const QColorGroup &group, + TQPainter *painter, + const TQWidget *widget, + const TQRect &rect, + const TQColorGroup &group, SFlags flags = Style_Default, - const QStyleOption &option = QStyleOption::Default) const; + const TQStyleOption &option = TQStyleOption::Default) const; void drawControl(ControlElement element, - QPainter *painter, - const QWidget *widget, - const QRect &rect, - const QColorGroup &group, + TQPainter *painter, + const TQWidget *widget, + const TQRect &rect, + const TQColorGroup &group, SFlags flags = Style_Default, - const QStyleOption &option = QStyleOption::Default) const; + const TQStyleOption &option = TQStyleOption::Default) const; void drawControlMask(ControlElement element, - QPainter *painter, - const QWidget *widget, - const QRect &rect, - const QStyleOption &option = QStyleOption::Default) const; + TQPainter *painter, + const TQWidget *widget, + const TQRect &rect, + const TQStyleOption &option = TQStyleOption::Default) const; void drawComplexControl(ComplexControl control, - QPainter *painter, - const QWidget *widget, - const QRect &rect, - const QColorGroup &group, + TQPainter *painter, + const TQWidget *widget, + const TQRect &rect, + const TQColorGroup &group, SFlags flags = Style_Default, SCFlags controls = SC_All, SCFlags active = SC_None, - const QStyleOption &option = QStyleOption::Default) const; + const TQStyleOption &option = TQStyleOption::Default) const; void drawComplexControlMask(ComplexControl control, - QPainter *painter, - const QWidget *widget, - const QRect &rect, - const QStyleOption &option = QStyleOption::Default) const; + TQPainter *painter, + const TQWidget *widget, + const TQRect &rect, + const TQStyleOption &option = TQStyleOption::Default) const; int pixelMetric(PixelMetric metric, - const QWidget *widget = 0) const; + const TQWidget *widget = 0) const; - QRect subRect(SubRect rect, const QWidget *widget) const; + TQRect subRect(SubRect rect, const TQWidget *widget) const; - QRect querySubControlMetrics(ComplexControl control, - const QWidget *widget, + TQRect querySubControlMetrics(ComplexControl control, + const TQWidget *widget, SubControl subcontrol, - const QStyleOption &option = QStyleOption::Default) const; + const TQStyleOption &option = TQStyleOption::Default) const; - QSize sizeFromContents(ContentsType contents, - const QWidget *widget, - const QSize &contentsize, - const QStyleOption& option = QStyleOption::Default) const; + TQSize sizeFromContents(ContentsType contents, + const TQWidget *widget, + const TQSize &contentsize, + const TQStyleOption& option = TQStyleOption::Default) const; private: PhaseStyle(const PhaseStyle &); PhaseStyle& operator=(const PhaseStyle &); - void drawPhaseBevel(QPainter *painter, + void drawPhaseBevel(TQPainter *painter, int x, int y, int w, int h, - const QColorGroup &group, - const QColor &fill, + const TQColorGroup &group, + const TQColor &fill, bool sunken=false, bool horizontal=true, bool reverse=false) const; - void drawPhaseButton(QPainter *painter, + void drawPhaseButton(TQPainter *painter, int x, int y, int w, int h, - const QColorGroup &group, - const QColor &fill, + const TQColorGroup &group, + const TQColor &fill, bool sunken=false) const; - void drawPhasePanel(QPainter *painter, + void drawPhasePanel(TQPainter *painter, int x, int y, int w, int h, - const QColorGroup &group, + const TQColorGroup &group, bool sunken=false, - const QBrush *fill=NULL) const; + const TQBrush *fill=NULL) const; - void drawPhaseTab(QPainter *painter, + void drawPhaseTab(TQPainter *painter, int x, int y, int w, int h, - const QColorGroup &group, - const QTabBar *bar, - const QStyleOption &option, + const TQColorGroup &group, + const TQTabBar *bar, + const TQStyleOption &option, const SFlags flags) const; - void drawPhaseGradient(QPainter *painter, - const QRect &rect, - QColor color, + void drawPhaseGradient(TQPainter *painter, + const TQRect &rect, + TQColor color, bool horizontal, int px=0, int py=0, int pw=-1, int ph=-1, bool reverse=false) const; - bool flatToolbar(const QToolBar *toolbar) const; + bool flatToolbar(const TQToolBar *toolbar) const; - bool eventFilter(QObject *object, QEvent *event); + bool eventFilter(TQObject *object, TQEvent *event); private: - QWidget *hover_; - QTab *hovertab_; - QMap<unsigned int, QIntDict<GradientSet> > * gradients; + TQWidget *hover_; + TQTab *hovertab_; + TQMap<unsigned int, TQIntDict<GradientSet> > * gradients; bool gradients_; bool highlights_; bool reverse_; |