diff options
Diffstat (limited to 'client/deKoratorclient.cc')
-rw-r--r-- | client/deKoratorclient.cc | 458 |
1 files changed, 229 insertions, 229 deletions
diff --git a/client/deKoratorclient.cc b/client/deKoratorclient.cc index 4374b71..8f6d87c 100644 --- a/client/deKoratorclient.cc +++ b/client/deKoratorclient.cc @@ -37,7 +37,7 @@ #include "deKoratorclient.h" -#include <qsettings.h> +#include <tqsettings.h> using namespace DeKorator; @@ -46,7 +46,7 @@ using namespace DeKorator; static int MARGIN = 4; //static int GRUBMARGIN = 5; -static QColor STYLEBGCOL; +static TQColor STYLEBGCOL; // frames static int TITLESIZE = 0; @@ -105,7 +105,7 @@ static int BOTTOMRIGHTMASKHEIGHT = 0; // config // misc -static Qt::AlignmentFlags TITLEALIGN = Qt::AlignHCenter; +static TQt::AlignmentFlags TITLEALIGN = TQt::AlignHCenter; static bool USEMENUEIMAGE = FALSE; static bool IGNOREAPPICNCOL = FALSE; static bool DBLCLKCLOSE = FALSE; @@ -113,10 +113,10 @@ static bool SHOWBTMBORDER = FALSE; static bool USESHDTEXT = FALSE; static int ACTIVESHDTEXTX = FALSE; static int ACTIVESHDTEXTY = FALSE; -static QColor ACTIVESHADECOLOR = QColor( 150, 150, 150 ); +static TQColor ACTIVESHADECOLOR = TQColor( 150, 150, 150 ); static int INACTIVESHDTEXTX = FALSE; static int INACTIVESHDTEXTY = FALSE; -static QColor INACTIVESHADECOLOR = QColor( 150, 150, 150 ); +static TQColor INACTIVESHADECOLOR = TQColor( 150, 150, 150 ); static int BTNSHIFTX = 0; static int BTNSHIFTY = 0; @@ -124,19 +124,19 @@ static int BTNSHIFTY = 0; // colors static bool USEANIMATION = TRUE; -static QString ANIMATIONTYPE = "Intensity"; +static TQString ANIMATIONTYPE = "Intensity"; static int STEPS = 5; static int INTERVAL = 5; static int KEEPANIMATING = FALSE; -static QString BUTTONHOVERTYPE = "To Gray"; +static TQString BUTTONHOVERTYPE = "To Gray"; static float EFFECTAMOUNT = 5; -static QColor ACTIVEHIGHLIGHTCOLOR = QColor( 150, 150, 150 ); -static QColor INACTIVEHIGHLIGHTCOLOR = QColor( 150, 150, 150 ); -static QString DECOCOLORIZE = "Liquid Method"; -static QString BUTTONSCOLORIZE = "Liquid Method"; -//static QString BUTTONSHOVERCOLORIZE = "Liquid Method"; +static TQColor ACTIVEHIGHLIGHTCOLOR = TQColor( 150, 150, 150 ); +static TQColor INACTIVEHIGHLIGHTCOLOR = TQColor( 150, 150, 150 ); +static TQString DECOCOLORIZE = "Liquid Method"; +static TQString BUTTONSCOLORIZE = "Liquid Method"; +//static TQString BUTTONSHOVERCOLORIZE = "Liquid Method"; static const uint TIMERINTERVAL = 30; // msec static const uint ANIMATIONSTEPS = 100; @@ -146,13 +146,13 @@ static const uint ANIMATIONSTEPS = 100; static bool USEMASKS = FALSE; // pix arrays -static QPixmap *DECOARR[ decoCount ][ pixTypeCount ]; -static QPixmap *DECOPIXACTARR[ decoCount ]; -static QPixmap *DECOPIXINACTARR[ decoCount ]; +static TQPixmap *DECOARR[ decoCount ][ pixTypeCount ]; +static TQPixmap *DECOPIXACTARR[ decoCount ]; +static TQPixmap *DECOPIXINACTARR[ decoCount ]; -static QPixmap *BUTTONSARR[ buttonTypeAllCount ][ buttonStateCount ][ pixTypeCount ]; -static QPixmap *BUTTONPIXACTARR[ buttonTypeAllCount ][ buttonStateCount ]; -static QPixmap *BUTTONPIXINACTARR[ buttonTypeAllCount ][ buttonStateCount ]; +static TQPixmap *BUTTONSARR[ buttonTypeAllCount ][ buttonStateCount ][ pixTypeCount ]; +static TQPixmap *BUTTONPIXACTARR[ buttonTypeAllCount ][ buttonStateCount ]; +static TQPixmap *BUTTONPIXINACTARR[ buttonTypeAllCount ][ buttonStateCount ]; ////////////////////////////////////////////////////////////////////////////// // DeKoratorFactory Class // @@ -167,13 +167,13 @@ bool DeKoratorFactory::colorizeInActButtons_ = FALSE; bool DeKoratorFactory::useCustomButtonsColors_ = FALSE; bool DeKoratorFactory::customColorsActiveButtons_ = FALSE; bool DeKoratorFactory::customColorsInActiveButtons_ = FALSE; -QColor DeKoratorFactory::cusBtnCol_[ buttonTypeAllCount ]; +TQColor DeKoratorFactory::cusBtnCol_[ buttonTypeAllCount ]; bool DeKoratorFactory::needInit_ = FALSE; bool DeKoratorFactory::needReload_ = FALSE; -QString DeKoratorFactory::framesPath_ = ""; -QString DeKoratorFactory::buttonsPath_ = ""; -QString DeKoratorFactory::masksPath_ = ""; +TQString DeKoratorFactory::framesPath_ = ""; +TQString DeKoratorFactory::buttonsPath_ = ""; +TQString DeKoratorFactory::masksPath_ = ""; extern "C" KDecorationFactory* create_factory() @@ -267,7 +267,7 @@ bool DeKoratorFactory::reset( unsigned long changed ) if ( confchange || ( changed & ( SettingDecoration | SettingButtons | SettingBorder | SettingColors ) ) ) { - //qWarning( "aaaaaaaaaaaaa" ); + //tqWarning( "aaaaaaaaaaaaa" ); if ( DeKoratorFactory::needReload_ ) { loadPixmaps(); @@ -328,21 +328,21 @@ bool DeKoratorFactory::readConfig() { // create a config object KConfig config( "kwindeKoratorrc" ); - QColor col = QColor( 150, 150, 150 ); + TQColor col = TQColor( 150, 150, 150 ); // grab settings // misc settings config.setGroup( "MISC" ); - Qt::AlignmentFlags oldalign = TITLEALIGN; - QString value = config.readEntry( "TitleAlignment", "AlignHCenter" ); + TQt::AlignmentFlags oldalign = TITLEALIGN; + TQString value = config.readEntry( "TitleAlignment", "AlignHCenter" ); if ( value == "AlignLeft" ) - TITLEALIGN = Qt::AlignLeft; + TITLEALIGN = TQt::AlignLeft; else if ( value == "AlignHCenter" ) - TITLEALIGN = Qt::AlignHCenter; + TITLEALIGN = TQt::AlignHCenter; else if ( value == "AlignRight" ) - TITLEALIGN = Qt::AlignRight; + TITLEALIGN = TQt::AlignRight; bool oldUseMenuImage = USEMENUEIMAGE; USEMENUEIMAGE = config.readBoolEntry( "UseMenuImage", "false" ); @@ -365,7 +365,7 @@ bool DeKoratorFactory::readConfig() int oldActiveShdtextY = ACTIVESHDTEXTY; ACTIVESHDTEXTY = config.readNumEntry( "ActiveShdtextY", 0 ); - QColor oldActiveShadeColor = ACTIVESHADECOLOR; + TQColor oldActiveShadeColor = ACTIVESHADECOLOR; ACTIVESHADECOLOR = config.readColorEntry( "ActiveShadowColor", &col ); int oldInActiveShdtextX = INACTIVESHDTEXTX; @@ -374,7 +374,7 @@ bool DeKoratorFactory::readConfig() int oldInActiveShdtextY = INACTIVESHDTEXTY; INACTIVESHDTEXTY = config.readNumEntry( "InActiveShdtextY", 0 ); - QColor oldInActiveShadeColor = INACTIVESHADECOLOR; + TQColor oldInActiveShadeColor = INACTIVESHADECOLOR; INACTIVESHADECOLOR = config.readColorEntry( "InActiveShadowColor", &col ); @@ -416,13 +416,13 @@ bool DeKoratorFactory::readConfig() INACTIVEHIGHLIGHTCOLOR = config.readColorEntry( "InActiveHighlightColor", &col ); - QString oldDecoColorize = DECOCOLORIZE; + TQString oldDecoColorize = DECOCOLORIZE; DECOCOLORIZE = config.readEntry( "DecoColorize", "Liquid Method" ); - QString oldButtonsColorize = BUTTONSCOLORIZE; + TQString oldButtonsColorize = BUTTONSCOLORIZE; BUTTONSCOLORIZE = config.readEntry( "ButtonsColorize", "Liquid Method" ); /* - QString oldButtonsHoverColorize = BUTTONSHOVERCOLORIZE; + TQString oldButtonsHoverColorize = BUTTONSHOVERCOLORIZE; BUTTONSHOVERCOLORIZE = config.readEntry( "ButtonsHoverColorize", "Liquid Method" );*/ // buttons settings @@ -438,7 +438,7 @@ bool DeKoratorFactory::readConfig() DeKoratorFactory::customColorsInActiveButtons_ = config.readBoolEntry( "customColorsInActiveButtons", "false" ); // load buttons colors - QColor colArr[ buttonTypeAllCount ]; + TQColor colArr[ buttonTypeAllCount ]; for ( int i = 0 ; i < buttonTypeAllCount ; i++ ) { colArr[ i ] = DeKoratorFactory::cusBtnCol_[ i ]; @@ -465,7 +465,7 @@ bool DeKoratorFactory::readConfig() { cusColChanged = true; i = buttonTypeAllCount; - qWarning( "true" ); + tqWarning( "true" ); } } @@ -473,28 +473,28 @@ bool DeKoratorFactory::readConfig() // path's settings config.setGroup( "PATHS" ); - QString oldFramesPath = DeKoratorFactory::framesPath_; + TQString oldFramesPath = DeKoratorFactory::framesPath_; DeKoratorFactory::framesPath_ = config.readEntry( "FramesPath", "" ); - QString oldButtonsPath = DeKoratorFactory::buttonsPath_; + TQString oldButtonsPath = DeKoratorFactory::buttonsPath_; DeKoratorFactory::buttonsPath_ = config.readEntry( "ButtonsPath", "" ); bool oldUseMasks = USEMASKS; USEMASKS = config.readBoolEntry( "UseMasks", "false" ); - QString oldMasksPath = DeKoratorFactory::masksPath_; + TQString oldMasksPath = DeKoratorFactory::masksPath_; DeKoratorFactory::masksPath_ = config.readEntry( "MasksPath", "" ); //style backgrond - QColor oldStyleBgCol = STYLEBGCOL; + TQColor oldStyleBgCol = STYLEBGCOL; - QString colStr = QSettings().readEntry( "/Qt/Palette/active", "aaaa" ); + TQString colStr = TQSettings().readEntry( "/TQt/Palette/active", "aaaa" ); colStr = colStr.section( "#", 3, 3 ) ; colStr.insert( 0, '#' ); colStr.truncate( 7 ); - QColor c; + TQColor c; c.setNamedColor( colStr ); STYLEBGCOL = c; @@ -561,9 +561,9 @@ bool DeKoratorFactory::readConfig() // Read in the configuration file void DeKoratorFactory::loadPixmaps() { - QString decoPixDir = DeKoratorFactory::framesPath_; - QString btnPixDir = DeKoratorFactory::buttonsPath_; - QString masksPixDir = DeKoratorFactory::masksPath_; + TQString decoPixDir = DeKoratorFactory::framesPath_; + TQString btnPixDir = DeKoratorFactory::buttonsPath_; + TQString masksPixDir = DeKoratorFactory::masksPath_; // deco @@ -648,12 +648,12 @@ void DeKoratorFactory::loadPixmaps() //masks - topLeftCornerBitmap_ = QBitmap( masksPixDir + "/topLeftCornerBitmap.png" ); - topMidBitmap_ = QBitmap( masksPixDir + "/topMidBitmap.png" ); - topRightCornerBitmap_ = QBitmap( masksPixDir + "/topRightCornerBitmap.png" ); - buttomLeftCornerBitmap_ = QBitmap( masksPixDir + "/buttomLeftCornerBitmap.png" ); - buttomMidBitmap_ = QBitmap( masksPixDir + "/buttomMidBitmap.png" ); - buttomRightCornerBitmap_ = QBitmap( masksPixDir + "/buttomRightCornerBitmap.png" ); + topLeftCornerBitmap_ = TQBitmap( masksPixDir + "/topLeftCornerBitmap.png" ); + topMidBitmap_ = TQBitmap( masksPixDir + "/topMidBitmap.png" ); + topRightCornerBitmap_ = TQBitmap( masksPixDir + "/topRightCornerBitmap.png" ); + buttomLeftCornerBitmap_ = TQBitmap( masksPixDir + "/buttomLeftCornerBitmap.png" ); + buttomMidBitmap_ = TQBitmap( masksPixDir + "/buttomMidBitmap.png" ); + buttomRightCornerBitmap_ = TQBitmap( masksPixDir + "/buttomRightCornerBitmap.png" ); determineSizes(); @@ -732,7 +732,7 @@ void DeKoratorFactory::determineSizes() void DeKoratorFactory::colorizeDecoPixmaps( bool isActive ) { int i; - QColor col = options() ->colorGroup( KDecoration::ColorTitleBar, isActive ).background(); + TQColor col = options() ->colorGroup( KDecoration::ColorTitleBar, isActive ).background(); if ( isActive ) { @@ -762,7 +762,7 @@ void DeKoratorFactory::colorizeDecoPixmaps( bool isActive ) void DeKoratorFactory::colorizeButtonsPixmaps( bool isActive ) { int i, j; - QColor col = options() ->colorGroup( KDecoration::ColorButtonBg, isActive ).background(); + TQColor col = options() ->colorGroup( KDecoration::ColorButtonBg, isActive ).background(); if ( isActive ) { @@ -821,9 +821,9 @@ void DeKoratorFactory::colorizeButtonsPixmaps( bool isActive ) // colorizePixmap() // ------------ // -void DeKoratorFactory::colorizePixmap( QPixmap *pix, QColor c, QString colorizeMethod ) +void DeKoratorFactory::colorizePixmap( TQPixmap *pix, TQColor c, TQString colorizeMethod ) { - QImage img; + TQImage img; if ( colorizeMethod == "Liquid Method" ) { img = pix->convertToImage(); @@ -831,7 +831,7 @@ void DeKoratorFactory::colorizePixmap( QPixmap *pix, QColor c, QString colorizeM if ( img.depth() != 32 ) img = img.convertDepth( 32 ); - QImage *dest = new QImage( img.width(), img.height(), 32 ); + TQImage *dest = new TQImage( img.width(), img.height(), 32 ); dest->setAlphaBuffer( TRUE ); unsigned int *data = ( unsigned int * ) img.bits(); unsigned int *destData = ( unsigned int* ) dest->bits(); @@ -845,14 +845,14 @@ void DeKoratorFactory::colorizePixmap( QPixmap *pix, QColor c, QString colorizeM for ( current = 0; current < total; ++current ) { - alpha = qAlpha( data[ current ] ); + alpha = tqAlpha( data[ current ] ); - // qWarning( "--------------------------" ); - // qWarning( "red - %d", qRed( data[ current ] ) ); - // qWarning( "green - %d", qRed( data[ current ] ) ); - // qWarning( "blue - %d", qRed( data[ current ] ) ); + // tqWarning( "--------------------------" ); + // tqWarning( "red - %d", tqRed( data[ current ] ) ); + // tqWarning( "green - %d", tqRed( data[ current ] ) ); + // tqWarning( "blue - %d", tqRed( data[ current ] ) ); - delta = 255 - qGray( data[ current ] ); + delta = 255 - tqGray( data[ current ] ); destR = srcR - delta; destG = srcG - delta; @@ -870,7 +870,7 @@ void DeKoratorFactory::colorizePixmap( QPixmap *pix, QColor c, QString colorizeM destG = 255; if ( destB > 255 ) destB = 255; - destData[ current ] = qRgba( destR, destG, destB, alpha ); + destData[ current ] = tqRgba( destR, destG, destB, alpha ); } pix->convertFromImage( *dest ); } @@ -888,9 +888,9 @@ void DeKoratorFactory::colorizePixmap( QPixmap *pix, QColor c, QString colorizeM if ( img.depth() != 32 ) img = img.convertDepth( 32 ); - // QImage *dest; + // TQImage *dest; // *dest = img; - QImage *dest = new QImage( img.width(), img.height(), 32 ); + TQImage *dest = new TQImage( img.width(), img.height(), 32 ); dest->setAlphaBuffer( TRUE ); unsigned int *data = ( unsigned int * ) img.bits(); unsigned int *destData = ( unsigned int* ) dest->bits(); @@ -903,19 +903,19 @@ void DeKoratorFactory::colorizePixmap( QPixmap *pix, QColor c, QString colorizeM // int srcB = c.blue(); int h, s, v, ch; // int *r, *g, *b, *a; - QColor col ; + TQColor col ; // float srcPercent, destPercent; for ( current = 0; current < total; ++current ) { - // int qRed ( data[ current ] ); - // int qGreen ( data[ current ] ); - // int qBlue ( data[ current ] ); - // alpha = qAlpha( destData[ current ] ); + // int tqRed ( data[ current ] ); + // int tqGreen ( data[ current ] ); + // int tqBlue ( data[ current ] ); + // alpha = tqAlpha( destData[ current ] ); // // //destData[ current ] = data[ current ]; // - // QColor col = destData[ current ]; + // TQColor col = destData[ current ]; // col.getHsv( h, s, v ); // //*h += 50; // @@ -924,7 +924,7 @@ void DeKoratorFactory::colorizePixmap( QPixmap *pix, QColor c, QString colorizeM // col.getRgb( r, g, b ); col.setRgb( data[ current ] ); - //col = Qt::red; + //col = TQt::red; c.hsv( &h, &s, &v ); ch = h; col.hsv( &h, &s, &v ); @@ -934,7 +934,7 @@ void DeKoratorFactory::colorizePixmap( QPixmap *pix, QColor c, QString colorizeM destR = col.red(); destG = col.green(); destB = col.blue(); - alpha = qAlpha( data[ current ] ); + alpha = tqAlpha( data[ current ] ); // if ( destR < 0 ) @@ -950,10 +950,10 @@ void DeKoratorFactory::colorizePixmap( QPixmap *pix, QColor c, QString colorizeM // if ( destB > 255 ) // destB = 255; - destData[ current ] = qRgba( destR, destG, destB, alpha ); + destData[ current ] = tqRgba( destR, destG, destB, alpha ); //destData[ current ] = data[ current ]; } - pix->convertFromImage( *dest, /*Qt::ColorOnly | Qt::DiffuseDither | Qt::DiffuseAlphaDither |*/ Qt::AvoidDither ); + pix->convertFromImage( *dest, /*TQt::ColorOnly | TQt::DiffuseDither | TQt::DiffuseAlphaDither |*/ TQt::AvoidDither ); } } @@ -969,7 +969,7 @@ void DeKoratorFactory::initPixmaps() { for ( j = 0; j < pixTypeCount; j++ ) { - DECOARR[ i ][ j ] = new QPixmap(); + DECOARR[ i ][ j ] = new TQPixmap(); } } @@ -979,7 +979,7 @@ void DeKoratorFactory::initPixmaps() { for ( k = 0; k < pixTypeCount; k++ ) { - BUTTONSARR[ i ][ j ][ k ] = new QPixmap(); + BUTTONSARR[ i ][ j ][ k ] = new TQPixmap(); } } } @@ -1076,10 +1076,10 @@ void DeKoratorFactory::chooseRightPixmaps() void DeKoratorFactory::prepareDecoWithBgCol() { int i; - QPainter painter; - QPixmap tempPix; - QWidget widget; - QColor col = widget.colorGroup().background(); + TQPainter painter; + TQPixmap tempPix; + TQWidget widget; + TQColor col = widget.colorGroup().background(); if ( DeKoratorFactory::colorizeActFrames_ ) @@ -1186,8 +1186,8 @@ void DeKoratorFactory::prepareDecoWithBgCol() // --------------- // Constructor DeKoratorButton::DeKoratorButton( bool isLeft, int buttonWidth, int buttonHeight, DeKoratorClient * parent, const char * name, - const QString & tip, ButtonType type, buttonTypeAll btnType ) - : QButton( parent->widget(), name ), isLeft_( isLeft ), buttonWidth_( buttonWidth ), client_( parent ), type_( type ), lastmouse_( NoButton ), decoPixHeight_( buttonHeight ) + const TQString & tip, ButtonType type, buttonTypeAll btnType ) + : TQButton( parent->widget(), name ), isLeft_( isLeft ), buttonWidth_( buttonWidth ), client_( parent ), type_( type ), lastmouse_( NoButton ), decoPixHeight_( buttonHeight ) { //decoPixInAct_ = buttonPixInAct; animProgress = 0; @@ -1200,9 +1200,9 @@ DeKoratorButton::DeKoratorButton( bool isLeft, int buttonWidth, int buttonHeight //if ( buttonPix ) setPixmap( btnType ); - QToolTip::add + TQToolTip::add ( this, tip ); - animTmr = new QTimer( this ); + animTmr = new TQTimer( this ); connect( animTmr, SIGNAL( timeout() ), this, SLOT( animate() ) ); } @@ -1239,7 +1239,7 @@ void DeKoratorButton::setPixmap( buttonTypeAll btnType ) // } // else // { - // deco_ = new QBitmap(DECOSIZE, DECOSIZE, bitmap, TRUE); + // deco_ = new TQBitmap(DECOSIZE, DECOSIZE, bitmap, TRUE); // deco_->setMask(*deco_); // } repaint( FALSE ); @@ -1249,22 +1249,22 @@ void DeKoratorButton::setPixmap( buttonTypeAll btnType ) // sizeHint() // ---------- // Return size hint -QSize DeKoratorButton::sizeHint() const +TQSize DeKoratorButton::sizeHint() const { - return QSize( buttonWidth_, BUTTONSHEIGHT ); + return TQSize( buttonWidth_, BUTTONSHEIGHT ); } ////////////////////////////////////////////////////////////////////////////// // enterEvent() // ------------ // Mouse has entered the button -void DeKoratorButton::enterEvent( QEvent * e ) +void DeKoratorButton::enterEvent( TQEvent * e ) { // if we wanted to do mouseovers, we would keep track of it here - QButton::enterEvent( e ); + TQButton::enterEvent( e ); s = STEPS; hover_ = TRUE; - setCursor( Qt::PointingHandCursor ); + setCursor( TQt::PointingHandCursor ); if ( USEANIMATION ) animate(); @@ -1276,11 +1276,11 @@ void DeKoratorButton::enterEvent( QEvent * e ) // leaveEvent() // ------------ // Mouse has left the button -void DeKoratorButton::leaveEvent( QEvent * e ) +void DeKoratorButton::leaveEvent( TQEvent * e ) { // if we wanted to do mouseovers, we would keep track of it here - QButton::leaveEvent( e ); + TQButton::leaveEvent( e ); //STEPS = s; hover_ = FALSE; unsetCursor (); @@ -1295,7 +1295,7 @@ void DeKoratorButton::leaveEvent( QEvent * e ) // mousePressEvent() // ----------------- // Button has been pressed -void DeKoratorButton::mousePressEvent( QMouseEvent * e ) +void DeKoratorButton::mousePressEvent( TQMouseEvent * e ) { lastmouse_ = e->button(); @@ -1305,16 +1305,16 @@ void DeKoratorButton::mousePressEvent( QMouseEvent * e ) { 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 ); } ////////////////////////////////////////////////////////////////////////////// // mouseReleaseEvent() // ----------------- // Button has been released -void DeKoratorButton::mouseReleaseEvent( QMouseEvent * e ) +void DeKoratorButton::mouseReleaseEvent( TQMouseEvent * e ) { lastmouse_ = e->button(); @@ -1324,23 +1324,23 @@ void DeKoratorButton::mouseReleaseEvent( QMouseEvent * e ) { 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 ); } ////////////////////////////////////////////////////////////////////////////// // drawButton() // ------------ // Draw the button -void DeKoratorButton::drawButton( QPainter * painter ) +void DeKoratorButton::drawButton( TQPainter * painter ) { if ( !DeKoratorFactory::initialized() ) return ; - QColorGroup group; + TQColorGroup group; int dx = 0, dy = 0; bool act = client_->isActive(); - QImage buttonImgBak; + TQImage buttonImgBak; // fill background if ( isLeft_ ) @@ -1353,7 +1353,7 @@ void DeKoratorButton::drawButton( QPainter * painter ) { dy = ( height() - 16 ) / 2; - QPixmap appIconPix = client_->icon().pixmap( QIconSet::Small, QIconSet::Normal ); + TQPixmap appIconPix = client_->icon().pixmap( TQIconSet::Small, TQIconSet::Normal ); if ( !IGNOREAPPICNCOL ) { @@ -1365,7 +1365,7 @@ void DeKoratorButton::drawButton( QPainter * painter ) } else if ( client_->decoFactory_->colorizeActButtons_ ) { - QColor col = client_->decoFactory_->options() ->colorGroup( KDecoration::ColorButtonBg, act ).background(); + TQColor col = client_->decoFactory_->options() ->colorGroup( KDecoration::ColorButtonBg, act ).background(); DeKoratorFactory::colorizePixmap( &appIconPix, col, BUTTONSCOLORIZE ); } @@ -1378,7 +1378,7 @@ void DeKoratorButton::drawButton( QPainter * painter ) } else if ( client_->decoFactory_->colorizeInActButtons_ ) { - QColor col = client_->decoFactory_->options() ->colorGroup( KDecoration::ColorButtonBg, act ).background(); + TQColor col = client_->decoFactory_->options() ->colorGroup( KDecoration::ColorButtonBg, act ).background(); DeKoratorFactory::colorizePixmap( &appIconPix, col, BUTTONSCOLORIZE ); } @@ -1431,7 +1431,7 @@ void DeKoratorButton::drawButton( QPainter * painter ) if ( client_->isShade() && !SHOWBTMBORDER ) { - painter->setPen( QColor( 70, 70, 70 ) ); + painter->setPen( TQColor( 70, 70, 70 ) ); painter->drawLine( 0, BUTTONSHEIGHT - 1, buttonWidth_ - 1, BUTTONSHEIGHT - 1 ); } } @@ -1440,7 +1440,7 @@ void DeKoratorButton::drawButton( QPainter * painter ) // chooseRightHoverEffect() // ------------ // -QImage* DeKoratorButton::chooseRightHoverEffect( QImage * img, QString res ) +TQImage* DeKoratorButton::chooseRightHoverEffect( TQImage * img, TQString res ) { if ( USEANIMATION && !isDown() ) @@ -1456,7 +1456,7 @@ QImage* DeKoratorButton::chooseRightHoverEffect( QImage * img, QString res ) else if ( res == "Blend" ) { f /= 1.7; - QColor col = client_->isActive() ? ACTIVEHIGHLIGHTCOLOR : INACTIVEHIGHLIGHTCOLOR; + TQColor col = client_->isActive() ? ACTIVEHIGHLIGHTCOLOR : INACTIVEHIGHLIGHTCOLOR; * img = KImageEffect::blend ( col, *img, f ); } @@ -1467,25 +1467,25 @@ QImage* DeKoratorButton::chooseRightHoverEffect( QImage * img, QString res ) else if ( res == "Fade" ) { f /= 3; - QColor col = client_->isActive() ? ACTIVEHIGHLIGHTCOLOR : INACTIVEHIGHLIGHTCOLOR; + TQColor col = client_->isActive() ? ACTIVEHIGHLIGHTCOLOR : INACTIVEHIGHLIGHTCOLOR; * img = KImageEffect::fade ( *img, f, col ); } else if ( res == "Trashed" ) { - * img = KImageEffect::fade ( *img, animProgress, Qt::black ); + * img = KImageEffect::fade ( *img, animProgress, TQt::black ); } else if ( res == "Hue Shift" ) { int h, s, v; - QColor col ; + TQColor col ; int shift = ( int ) ( animProgress * 3.5 ); col.setRgb( 255, 0, 0 ); col.hsv( &h, &s, &v ); col.setHsv( shift, s, v ); - QPixmap pix; - pix.convertFromImage( *img, Qt::AvoidDither ); + TQPixmap pix; + pix.convertFromImage( *img, TQt::AvoidDither ); DeKoratorFactory::colorizePixmap( &pix, col, "Hue Adgustment" ); *img = pix.convertToImage(); } @@ -1496,10 +1496,10 @@ QImage* DeKoratorButton::chooseRightHoverEffect( QImage * img, QString res ) KIconEffect::toGray( *img, EFFECTAMOUNT ); else if ( BUTTONHOVERTYPE == "Colorize" ) { - QColor col = client_->isActive() ? ACTIVEHIGHLIGHTCOLOR : INACTIVEHIGHLIGHTCOLOR; + TQColor col = client_->isActive() ? ACTIVEHIGHLIGHTCOLOR : INACTIVEHIGHLIGHTCOLOR; - QPixmap pix; - pix.convertFromImage( *img, Qt::AvoidDither ); + TQPixmap pix; + pix.convertFromImage( *img, TQt::AvoidDither ); DeKoratorFactory::colorizePixmap( &pix, col, BUTTONSCOLORIZE ); *img = pix.convertToImage(); } @@ -1558,9 +1558,9 @@ void DeKoratorButton::animate() if ( animProgress > 0 ) animTmr->start( INTERVAL, true ); // single-shot } - //qWarning( "STEPS: %d", STEPS ); - //qWarning( "animProgress: %d", animProgress ); - //qWarning( "INTERVAL: %d", INTERVAL ); + //tqWarning( "STEPS: %d", STEPS ); + //tqWarning( "animProgress: %d", animProgress ); + //tqWarning( "INTERVAL: %d", INTERVAL ); repaint( false ); } @@ -1658,23 +1658,23 @@ void DeKoratorClient::init() buttomRightFrameBg[ normal ] ->load( decoPixDir + "/bottomRightFrameBg.png" );*/ // layouts - mainLayout_ = new QVBoxLayout( widget(), 0, 0 ); - titleLayout_ = new QHBoxLayout( mainLayout_, 0, 0 ); - midLayout_ = new QHBoxLayout( mainLayout_, 0, 0 ); + mainLayout_ = new TQVBoxLayout( widget(), 0, 0 ); + titleLayout_ = new TQHBoxLayout( mainLayout_, 0, 0 ); + midLayout_ = new TQHBoxLayout( mainLayout_, 0, 0 ); // spacers - leftTitleBarSpacer_ = new QSpacerItem( TOPLEFTCORNERWIDTH, TITLESIZE, - QSizePolicy::Fixed, QSizePolicy::Fixed ); - titleBarSpacer_ = new QSpacerItem( 1, TITLESIZE, QSizePolicy::Expanding, - QSizePolicy::Fixed ); - rightTitleBarSpacer_ = new QSpacerItem( TOPRIGHTCORNERWIDTH, TITLESIZE, - QSizePolicy::Fixed, QSizePolicy::Fixed ); - leftSpacer_ = new QSpacerItem( LEFTFRAMESIZE, 1, - QSizePolicy::Fixed, QSizePolicy::Expanding ); - rightSpacer_ = new QSpacerItem( RIGHTFRAMESIZE, 1, - QSizePolicy::Fixed, QSizePolicy::Expanding ); - bottomSpacer_ = new QSpacerItem( 1, ( !isSetShade() || SHOWBTMBORDER ) ? BUTTOMFRAMESIZE : 0, - QSizePolicy::Expanding, QSizePolicy::Fixed ); + leftTitleBarSpacer_ = new TQSpacerItem( TOPLEFTCORNERWIDTH, TITLESIZE, + TQSizePolicy::Fixed, TQSizePolicy::Fixed ); + titleBarSpacer_ = new TQSpacerItem( 1, TITLESIZE, TQSizePolicy::Expanding, + TQSizePolicy::Fixed ); + rightTitleBarSpacer_ = new TQSpacerItem( TOPRIGHTCORNERWIDTH, TITLESIZE, + TQSizePolicy::Fixed, TQSizePolicy::Fixed ); + leftSpacer_ = new TQSpacerItem( LEFTFRAMESIZE, 1, + TQSizePolicy::Fixed, TQSizePolicy::Expanding ); + rightSpacer_ = new TQSpacerItem( RIGHTFRAMESIZE, 1, + TQSizePolicy::Fixed, TQSizePolicy::Expanding ); + bottomSpacer_ = new TQSpacerItem( 1, ( !isSetShade() || SHOWBTMBORDER ) ? BUTTOMFRAMESIZE : 0, + TQSizePolicy::Expanding, TQSizePolicy::Fixed ); // setup layout @@ -1694,11 +1694,11 @@ void DeKoratorClient::init() midLayout_->addItem( leftSpacer_ ); if ( isPreview() ) { - midLayout_->addWidget( new QLabel( "<center><b>" + i18n( "Dekorator preview (Version 0.3)" ) + "</b></center>", widget() ) ); + midLayout_->addWidget( new TQLabel( "<center><b>" + i18n( "Dekorator preview (Version 0.3)" ) + "</b></center>", widget() ) ); } else { - midLayout_->addItem( new QSpacerItem( 0, 0 ) ); + midLayout_->addItem( new TQSpacerItem( 0, 0 ) ); } midLayout_->addItem( rightSpacer_ ); @@ -1720,11 +1720,11 @@ void DeKoratorClient::init() // addButtons() // ------------ // Add buttons to title layout -void DeKoratorClient::addButtons( QBoxLayout * layout, const QString & s, bool isLeft ) +void DeKoratorClient::addButtons( TQBoxLayout * layout, const TQString & s, bool isLeft ) { //const unsigned char * bitmap; -// QPixmap * pix1, *pix2, *pix3, *pix4; - QString tip; +// TQPixmap * pix1, *pix2, *pix3, *pix4; + TQString tip; buttonTypeAll btnType; if ( s.length() > 0 ) @@ -1964,9 +1964,9 @@ void DeKoratorClient::desktopChange() if ( button[ ButtonSticky ] ) { button[ ButtonSticky ] ->setPixmap( btnType ); - QToolTip::remove + TQToolTip::remove ( button[ ButtonSticky ] ); - QToolTip::add + TQToolTip::add ( button[ ButtonSticky ], d ? i18n( "Sticky" ) : i18n( "Un-Sticky" ) ); } } @@ -2004,9 +2004,9 @@ void DeKoratorClient::maximizeChange() if ( button[ ButtonMax ] ) { button[ ButtonMax ] ->setPixmap( btnType ); - QToolTip::remove + TQToolTip::remove ( button[ ButtonMax ] ); - QToolTip::add + TQToolTip::add ( button[ ButtonMax ], m ? i18n( "Restore" ) : i18n( "Maximize" ) ); } } @@ -2031,9 +2031,9 @@ void DeKoratorClient::shadeChange() if ( button[ ButtonShade ] ) { button[ ButtonShade ] ->setPixmap( btnType ); - QToolTip::remove + TQToolTip::remove ( button[ ButtonShade ] ); - QToolTip::add + TQToolTip::add ( button[ ButtonShade ], s ? i18n( "Unshade" ) : i18n( "Shade" ) ); } @@ -2109,12 +2109,12 @@ void DeKoratorClient::borders( int & l, int & r, int & t, int & b ) const if ( !isShade() || SHOWBTMBORDER ) { b = BUTTOMFRAMESIZE; - bottomSpacer_->changeSize( 1, BUTTOMFRAMESIZE, QSizePolicy::Expanding, QSizePolicy::Fixed ); + bottomSpacer_->changeSize( 1, BUTTOMFRAMESIZE, TQSizePolicy::Expanding, TQSizePolicy::Fixed ); } else { b = 0; - bottomSpacer_->changeSize( 1, b, QSizePolicy::Expanding, QSizePolicy::Fixed ); + bottomSpacer_->changeSize( 1, b, TQSizePolicy::Expanding, TQSizePolicy::Fixed ); } widget() ->layout() ->activate(); } @@ -2123,7 +2123,7 @@ void DeKoratorClient::borders( int & l, int & r, int & t, int & b ) const // resize() // -------- // Called to resize the window -void DeKoratorClient::resize( const QSize & size ) +void DeKoratorClient::resize( const TQSize & size ) { widget() ->resize( size ); } @@ -2132,9 +2132,9 @@ void DeKoratorClient::resize( const QSize & size ) // minimumSize() // ------------- // Return the minimum allowable size for this window -QSize DeKoratorClient::minimumSize() const +TQSize DeKoratorClient::minimumSize() const { - QSize size = widget() ->minimumSize(); + TQSize size = widget() ->minimumSize(); size.setWidth( size.width() + TOPLEFTCORNERWIDTH + TOPRIGHTCORNERWIDTH ); return size; @@ -2145,7 +2145,7 @@ QSize DeKoratorClient::minimumSize() const // mousePosition() // --------------- // Return logical mouse position -KDecoration::Position DeKoratorClient::mousePosition( const QPoint & point ) const +KDecoration::Position DeKoratorClient::mousePosition( const TQPoint & point ) const { // bool res = TRUE; Position pos; @@ -2237,7 +2237,7 @@ KDecoration::Position DeKoratorClient::mousePosition( const QPoint & point ) con // eventFilter() // ------------- // Event filter -bool DeKoratorClient::eventFilter( QObject * obj, QEvent * e ) +bool DeKoratorClient::eventFilter( TQObject * obj, TQEvent * e ) { if ( obj != widget() ) return FALSE; @@ -2245,36 +2245,36 @@ bool DeKoratorClient::eventFilter( QObject * obj, QEvent * e ) switch ( e->type() ) { - case QEvent::MouseButtonDblClick: + case TQEvent::MouseButtonDblClick: { - mouseDoubleClickEvent( static_cast<QMouseEvent *>( e ) ); + mouseDoubleClickEvent( static_cast<TQMouseEvent *>( e ) ); return TRUE; } - case QEvent::Wheel: + case TQEvent::Wheel: { - wheelEvent( static_cast<QWheelEvent *>( e ) ); + wheelEvent( static_cast<TQWheelEvent *>( e ) ); return TRUE; } - case QEvent::MouseButtonPress: + case TQEvent::MouseButtonPress: { - processMousePressEvent( static_cast<QMouseEvent *>( e ) ); + processMousePressEvent( static_cast<TQMouseEvent *>( e ) ); if ( USEMASKS ) doShape(); return TRUE; } - case QEvent::Paint: + case TQEvent::Paint: { - paintEvent( static_cast<QPaintEvent *>( e ) ); + paintEvent( static_cast<TQPaintEvent *>( e ) ); return TRUE; } - case QEvent::Resize: + case TQEvent::Resize: { - resizeEvent( static_cast<QResizeEvent *>( e ) ); + resizeEvent( static_cast<TQResizeEvent *>( e ) ); return TRUE; } - case QEvent::Show: + case TQEvent::Show: { - showEvent( static_cast<QShowEvent *>( e ) ); + showEvent( static_cast<TQShowEvent *>( e ) ); return TRUE; } default: @@ -2290,7 +2290,7 @@ bool DeKoratorClient::eventFilter( QObject * obj, QEvent * e ) // mouseDoubleClickEvent() // ----------------------- // Doubleclick on title -void DeKoratorClient::mouseDoubleClickEvent( QMouseEvent * e ) +void DeKoratorClient::mouseDoubleClickEvent( TQMouseEvent * e ) { if ( titleBarSpacer_->geometry().contains( e->pos() ) ) titlebarDblClickOperation(); @@ -2300,7 +2300,7 @@ void DeKoratorClient::mouseDoubleClickEvent( QMouseEvent * e ) // wheelEvent() // ----------------------- // -void DeKoratorClient::wheelEvent( QWheelEvent *e ) +void DeKoratorClient::wheelEvent( TQWheelEvent *e ) { if ( titleLayout_->geometry().contains( e->pos() ) ) titlebarMouseWheelOperation( e->delta() ); @@ -2311,7 +2311,7 @@ void DeKoratorClient::wheelEvent( QWheelEvent *e ) // paintEvent() // ------------ // Repaint the window -void DeKoratorClient::paintEvent( QPaintEvent* ) +void DeKoratorClient::paintEvent( TQPaintEvent* ) { if ( !DeKoratorFactory::initialized() ) return ; @@ -2320,17 +2320,17 @@ void DeKoratorClient::paintEvent( QPaintEvent* ) if ( captionBufferDirty_ && USESHDTEXT ) updateCaptionBuffer(); - QPainter painter( widget() ); + TQPainter painter( widget() ); int tx, ty, tw, th; int w = width() , h = height(); - QRect titleR( titleBarSpacer_->geometry() ); - QRect leftTitleR( leftTitleBarSpacer_->geometry() ); - QRect rightTitleR( rightTitleBarSpacer_->geometry() ); + TQRect titleR( titleBarSpacer_->geometry() ); + TQRect leftTitleR( leftTitleBarSpacer_->geometry() ); + TQRect rightTitleR( rightTitleBarSpacer_->geometry() ); titleR.rect( &tx, &ty, &tw, &th ); - QRect rect; + TQRect rect; - QPainter painter2; - QPixmap pix( w, TITLESIZE ); + TQPainter painter2; + TQPixmap pix( w, TITLESIZE ); painter2.begin( &pix ); { // topLeftCorner @@ -2347,14 +2347,14 @@ void DeKoratorClient::paintEvent( QPaintEvent* ) if ( tw > 0 ) { - //qWarning("%d",titleR.width()); + //tqWarning("%d",titleR.width()); //leftTitleR - rect.setRect( tx, 0, QMIN( LEFTTITLEWIDTH, tw ), TITLESIZE ); + rect.setRect( tx, 0, TQMIN( LEFTTITLEWIDTH, tw ), TITLESIZE ); painter2.drawTiledPixmap( rect, isActive() ? *( DECOPIXACTARR[ leftTitle ] ) : *( DECOPIXINACTARR[ leftTitle ] ) ); - // rect.setRect( tx, 0, QMIN( LEFTTITLEWIDTH, tw ), TITLESIZE ); + // rect.setRect( tx, 0, TQMIN( LEFTTITLEWIDTH, tw ), TITLESIZE ); // painter2.drawTiledPixmap( rect, isActive() ? decoFactory_->leftTitleBg_ : decoFactory_->leftTitleBgInAct_ ); //midTitle @@ -2370,7 +2370,7 @@ void DeKoratorClient::paintEvent( QPaintEvent* ) //rightTitleR if ( tw > LEFTTITLEWIDTH ) { - rect.setRect( QMAX( tx + tw - RIGHTTITLEWIDTH, tx + LEFTTITLEWIDTH ), 0, QMIN( RIGHTTITLEWIDTH, tw - LEFTTITLEWIDTH ), th ); + rect.setRect( TQMAX( tx + tw - RIGHTTITLEWIDTH, tx + LEFTTITLEWIDTH ), 0, TQMIN( RIGHTTITLEWIDTH, tw - LEFTTITLEWIDTH ), th ); painter2.drawTiledPixmap( rect.x(), rect.y(), rect.width(), rect.height(), isActive() ? *( DECOPIXACTARR[ rightTitle ] ) : *( DECOPIXINACTARR[ rightTitle ] ), ( tw > LEFTTITLEWIDTH + RIGHTTITLEWIDTH ) ? 0 : LEFTTITLEWIDTH - ( tw - RIGHTTITLEWIDTH ), 0 ); @@ -2391,8 +2391,8 @@ void DeKoratorClient::paintEvent( QPaintEvent* ) // painter2.drawTiledPixmap( rect, isActive() ? decoFactory_->topRightCornerBg_ : decoFactory_->topRightCornerBgInAct_ ); - QString c( caption() ); - QFontMetrics fm( options() ->font( isActive() ) ); + TQString c( caption() ); + TQFontMetrics fm( options() ->font( isActive() ) ); int captionWidth = fm.width( c ); // shadow text effect if ( USESHDTEXT ) @@ -2401,23 +2401,23 @@ void DeKoratorClient::paintEvent( QPaintEvent* ) int captionHeight = fm.height( ); int dx = 0, dy = 0; - if ( TITLEALIGN == Qt::AlignLeft || captionWidth > titleR.width() ) + if ( TITLEALIGN == TQt::AlignLeft || captionWidth > titleR.width() ) { dx = tx + 1 + ( isActive() ? ACTIVESHDTEXTX : INACTIVESHDTEXTX ) ; dy = ( TITLESIZE / 2 ) - ( captionHeight / 2 ) + ( isActive() ? ACTIVESHDTEXTY : INACTIVESHDTEXTY ) ; } - else if ( TITLEALIGN == Qt::AlignHCenter ) + else if ( TITLEALIGN == TQt::AlignHCenter ) { dx = tx + ( tw / 2 ) - ( ( captionWidth + ( MARGIN * 2 ) ) / 2 ) + ( isActive() ? ACTIVESHDTEXTX : INACTIVESHDTEXTX ) ; dy = ( TITLESIZE / 2 ) - ( captionHeight / 2 ) + ( isActive() ? ACTIVESHDTEXTY : INACTIVESHDTEXTY ) ; } - else if ( TITLEALIGN == Qt::AlignRight ) + else if ( TITLEALIGN == TQt::AlignRight ) { dx = tx + tw - ( captionWidth + ( MARGIN * 2 ) ) - 1 + ( isActive() ? ACTIVESHDTEXTX : INACTIVESHDTEXTX ) ; dy = ( TITLESIZE / 2 ) - ( captionHeight / 2 ) + ( isActive() ? ACTIVESHDTEXTY : INACTIVESHDTEXTY ) ; } - painter2.drawImage( dx, dy, isActive() ? activeShadowImg_ : inActiveShadowImg_, 0, 0, isActive() ? QMIN( activeShadowImg_.width(), titleR.width() ) : QMIN( inActiveShadowImg_.width(), titleR.width() ), isActive() ? activeShadowImg_.height() : inActiveShadowImg_.height() ); + painter2.drawImage( dx, dy, isActive() ? activeShadowImg_ : inActiveShadowImg_, 0, 0, isActive() ? TQMIN( activeShadowImg_.width(), titleR.width() ) : TQMIN( inActiveShadowImg_.width(), titleR.width() ), isActive() ? activeShadowImg_.height() : inActiveShadowImg_.height() ); } @@ -2425,9 +2425,9 @@ void DeKoratorClient::paintEvent( QPaintEvent* ) painter2.setFont( options() ->font( isActive(), FALSE ) ); painter2.setPen( options() ->color( KDecoration::ColorFont, isActive() ) ); - Qt::AlignmentFlags titleAlignBak = TITLEALIGN; + TQt::AlignmentFlags titleAlignBak = TITLEALIGN; if ( captionWidth > titleR.width() ) - titleAlignBak = Qt::AlignLeft; + titleAlignBak = TQt::AlignLeft; painter2.drawText( tx + MARGIN, ty, tw - ( MARGIN * 2 ), th, titleAlignBak | AlignVCenter, caption() ); } @@ -2445,7 +2445,7 @@ void DeKoratorClient::paintEvent( QPaintEvent* ) //left frame //top - rect.setRect( 0, TITLESIZE , LEFTFRAMESIZE, QMIN( TOPLEFTFRAMEHEIGHT, leftRightFramesHeight ) ); + rect.setRect( 0, TITLESIZE , LEFTFRAMESIZE, TQMIN( TOPLEFTFRAMEHEIGHT, leftRightFramesHeight ) ); painter.drawTiledPixmap( rect, isActive() ? *( DECOPIXACTARR[ topLeftFrame ] ) : *( DECOPIXINACTARR[ topLeftFrame ] ) ); @@ -2462,7 +2462,7 @@ void DeKoratorClient::paintEvent( QPaintEvent* ) // buttom if ( leftRightFramesHeight > TOPLEFTFRAMEHEIGHT ) { - rect.setRect( 0, QMAX( h - BUTTOMFRAMESIZE - BOTTOMLEFTFRAMEHEIGHT, TITLESIZE + TOPLEFTFRAMEHEIGHT ) , LEFTFRAMESIZE, QMIN( BOTTOMLEFTFRAMEHEIGHT, leftRightFramesHeight - TOPLEFTFRAMEHEIGHT ) ); + rect.setRect( 0, TQMAX( h - BUTTOMFRAMESIZE - BOTTOMLEFTFRAMEHEIGHT, TITLESIZE + TOPLEFTFRAMEHEIGHT ) , LEFTFRAMESIZE, TQMIN( BOTTOMLEFTFRAMEHEIGHT, leftRightFramesHeight - TOPLEFTFRAMEHEIGHT ) ); painter.drawTiledPixmap( rect.x(), rect.y(), rect.width(), rect.height(), isActive() ? *( DECOPIXACTARR[ buttomLeftFrame ] ) : *( DECOPIXINACTARR[ buttomLeftFrame ] ), 0, ( leftRightFramesHeight > TOPLEFTFRAMEHEIGHT + BOTTOMLEFTFRAMEHEIGHT ) ? 0 : TITLESIZE + TOPLEFTFRAMEHEIGHT - ( h - BUTTOMFRAMESIZE - BOTTOMLEFTFRAMEHEIGHT ) ); @@ -2472,7 +2472,7 @@ void DeKoratorClient::paintEvent( QPaintEvent* ) //rightFrame // top - rect.setRect( w - RIGHTFRAMESIZE, TITLESIZE , RIGHTFRAMESIZE, QMIN( TOPRIGHTFRAMEHEIGHT, leftRightFramesHeight ) ); + rect.setRect( w - RIGHTFRAMESIZE, TITLESIZE , RIGHTFRAMESIZE, TQMIN( TOPRIGHTFRAMEHEIGHT, leftRightFramesHeight ) ); painter.drawTiledPixmap( rect, isActive() ? *( DECOPIXACTARR[ topRightFrame ] ) : *( DECOPIXINACTARR[ topRightFrame ] ) ); @@ -2491,7 +2491,7 @@ void DeKoratorClient::paintEvent( QPaintEvent* ) // bottom if ( leftRightFramesHeight > TOPRIGHTFRAMEHEIGHT ) { - rect.setRect( w - RIGHTFRAMESIZE, QMAX( h - BUTTOMFRAMESIZE - BOTTOMRIGHTFRAMEHEIGHT, TITLESIZE + TOPRIGHTFRAMEHEIGHT ) , RIGHTFRAMESIZE, QMIN( BOTTOMRIGHTFRAMEHEIGHT, leftRightFramesHeight - TOPRIGHTFRAMEHEIGHT ) ); + rect.setRect( w - RIGHTFRAMESIZE, TQMAX( h - BUTTOMFRAMESIZE - BOTTOMRIGHTFRAMEHEIGHT, TITLESIZE + TOPRIGHTFRAMEHEIGHT ) , RIGHTFRAMESIZE, TQMIN( BOTTOMRIGHTFRAMEHEIGHT, leftRightFramesHeight - TOPRIGHTFRAMEHEIGHT ) ); painter.drawTiledPixmap( rect.x(), rect.y(), rect.width(), rect.height(), isActive() ? *( DECOPIXACTARR[ buttomRightFrame ] ) : *( DECOPIXINACTARR[ buttomRightFrame ] ), 0, ( leftRightFramesHeight > TOPRIGHTFRAMEHEIGHT + BOTTOMRIGHTFRAMEHEIGHT ) ? 0 : TITLESIZE + TOPRIGHTFRAMEHEIGHT - ( h - BUTTOMFRAMESIZE - BOTTOMRIGHTFRAMEHEIGHT ) ); @@ -2503,7 +2503,7 @@ void DeKoratorClient::paintEvent( QPaintEvent* ) // buttom frame if ( w > 0 ) { // left - rect.setRect( 0 , h - BUTTOMFRAMESIZE, QMIN( LEFTBOTTOMFRAMEWIDTH, w ) , BUTTOMFRAMESIZE ); + rect.setRect( 0 , h - BUTTOMFRAMESIZE, TQMIN( LEFTBOTTOMFRAMEWIDTH, w ) , BUTTOMFRAMESIZE ); painter.drawTiledPixmap( rect, isActive() ? *( DECOPIXACTARR[ leftButtomFrame ] ) : *( DECOPIXINACTARR[ leftButtomFrame ] ) ); @@ -2520,7 +2520,7 @@ void DeKoratorClient::paintEvent( QPaintEvent* ) // right if ( w > LEFTBOTTOMFRAMEWIDTH ) { - rect.setRect( QMAX( w - RIGHTBOTTOMFRAMEWIDTH, LEFTBOTTOMFRAMEWIDTH ) , h - BUTTOMFRAMESIZE, QMIN( RIGHTBOTTOMFRAMEWIDTH, w - LEFTBOTTOMFRAMEWIDTH ) , BUTTOMFRAMESIZE ); + rect.setRect( TQMAX( w - RIGHTBOTTOMFRAMEWIDTH, LEFTBOTTOMFRAMEWIDTH ) , h - BUTTOMFRAMESIZE, TQMIN( RIGHTBOTTOMFRAMEWIDTH, w - LEFTBOTTOMFRAMEWIDTH ) , BUTTOMFRAMESIZE ); painter.drawTiledPixmap( rect.x(), rect.y(), rect.width(), rect.height(), isActive() ? *( DECOPIXACTARR[ rightButtomFrame ] ) : *( DECOPIXINACTARR[ rightButtomFrame ] ), ( w > LEFTBOTTOMFRAMEWIDTH + RIGHTBOTTOMFRAMEWIDTH ) ? 0 : LEFTBOTTOMFRAMEWIDTH - ( w - RIGHTBOTTOMFRAMEWIDTH ), 0 ); @@ -2530,7 +2530,7 @@ void DeKoratorClient::paintEvent( QPaintEvent* ) } else { - painter.setPen( QColor( 70, 70, 70 ) ); + painter.setPen( TQColor( 70, 70, 70 ) ); painter.drawLine( 0 , h - 1, w, h - 1 ); } } @@ -2545,16 +2545,16 @@ void DeKoratorClient::updateCaptionBuffer() if ( !DeKoratorFactory::initialized() ) return ; - QPainter painter; - QString c( caption() ); - QFontMetrics fm( options() ->font( isActive() ) ); + TQPainter painter; + TQString c( caption() ); + TQFontMetrics fm( options() ->font( isActive() ) ); int captionWidth = fm.width( c ); int captionHeight = fm.height( ); - QPixmap textPixmap; + TQPixmap textPixmap; // prepare the shadow - textPixmap = QPixmap( captionWidth + ( MARGIN * 2 ) , captionHeight ); // 2*2 px shadow space - textPixmap.fill( QColor( 0, 0, 0 ) ); + textPixmap = TQPixmap( captionWidth + ( MARGIN * 2 ) , captionHeight ); // 2*2 px shadow space + textPixmap.fill( TQColor( 0, 0, 0 ) ); textPixmap.setMask( textPixmap.createHeuristicMask( TRUE ) ); painter.begin( &textPixmap ); painter.setFont( options() ->font( isActive(), FALSE ) ); @@ -2576,11 +2576,11 @@ void DeKoratorClient::updateCaptionBuffer() // resizeEvent() // ------------- // Window is being resized -void DeKoratorClient::resizeEvent( QResizeEvent *e ) +void DeKoratorClient::resizeEvent( TQResizeEvent *e ) { if ( widget() ->isShown() ) { - QRegion region = widget() ->rect(); + TQRegion region = widget() ->rect(); region = region.subtract( titleBarSpacer_->geometry() ); widget() ->erase( region ); } @@ -2589,7 +2589,7 @@ void DeKoratorClient::resizeEvent( QResizeEvent *e ) if ( oldSize_ != e->size() ) { - //qWarning("QResizeEvent"); + //tqWarning("TQResizeEvent"); sizeChanged = true; } else @@ -2597,11 +2597,11 @@ void DeKoratorClient::resizeEvent( QResizeEvent *e ) oldSize_ = e->size(); - // if(e->type() == QEvent::Resize) + // if(e->type() == TQEvent::Resize) // { // - // //oldSize((QResizeEvent*)e)->size()); - // qWarning( "resizeEvent" ); + // //oldSize((TQResizeEvent*)e)->size()); + // tqWarning( "resizeEvent" ); // } // maskDirty_ = true; @@ -2613,7 +2613,7 @@ void DeKoratorClient::resizeEvent( QResizeEvent *e ) // showEvent() // ----------- // Window is being shown -void DeKoratorClient::showEvent( QShowEvent * ) +void DeKoratorClient::showEvent( TQShowEvent * ) { widget() ->repaint(); if ( USEMASKS ) @@ -2676,7 +2676,7 @@ void DeKoratorClient::aboveButtonPressed() ////////////////////////////////////////////////////////////////////////////// // belowButtonPressed() // ----------------- -// Below buttQt::green; //on was pressed +// Below buttTQt::green; //on was pressed void DeKoratorClient::belowButtonPressed() { if ( button[ ButtonBelow ] ) @@ -2693,7 +2693,7 @@ void DeKoratorClient::menuButtonPressed() { // if ( button[ ButtonMenu ] ) // { - // 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 ) ); @@ -2701,16 +2701,16 @@ void DeKoratorClient::menuButtonPressed() // button[ ButtonMenu ] ->setDown( FALSE ); // } - static QTime * t = NULL; + static TQTime * t = NULL; static DeKoratorClient* lastClient = NULL; if ( t == NULL ) - t = new QTime; - bool dbl = ( lastClient == this && t->elapsed() <= QApplication::doubleClickInterval() ); + t = new TQTime; + bool dbl = ( lastClient == this && t->elapsed() <= TQApplication::doubleClickInterval() ); lastClient = this; t->start(); if ( !dbl || !DBLCLKCLOSE ) { - 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 ) ); @@ -2740,16 +2740,16 @@ void DeKoratorClient::doShape() { int w = width(); int h = height(); - QRegion mask( 0, 0, w, h ); + TQRegion mask( 0, 0, w, h ); if ( sizeChanged ) { - //qWarning("doShape"); + //tqWarning("doShape"); // top left - QRegion mtr; - QRegion m = QRegion( decoFactory_->topLeftCornerBitmap_ ); - mask -= QRegion( m ); + TQRegion mtr; + TQRegion m = TQRegion( decoFactory_->topLeftCornerBitmap_ ); + mask -= TQRegion( m ); // top mid @@ -2757,14 +2757,14 @@ void DeKoratorClient::doShape() { int pos = TOPLEFTMASKWIDTH; int rep = ( w - TOPLEFTMASKWIDTH - TOPRIGHTMASKWIDTH ) / TOPMIDMASKWIDTH; - m = QRegion( decoFactory_->topMidBitmap_ ); - QRegion mBak = m; + m = TQRegion( decoFactory_->topMidBitmap_ ); + TQRegion mBak = m; for ( int i = 0 ; i < rep ; i++ ) { m = mBak; m.translate( TOPLEFTMASKWIDTH + ( i * TOPMIDMASKWIDTH ), 0 ); - mask -= QRegion( m ); + mask -= TQRegion( m ); pos += TOPMIDMASKWIDTH; } @@ -2778,18 +2778,18 @@ void DeKoratorClient::doShape() { //top right - m = QRegion( decoFactory_->topRightCornerBitmap_ ); + m = TQRegion( decoFactory_->topRightCornerBitmap_ ); m.translate( width() - TOPRIGHTMASKWIDTH, 0 ); - mask -= QRegion( m ); + mask -= TQRegion( m ); } if ( !isShade() || SHOWBTMBORDER ) { //buttom left - m = QRegion( decoFactory_->buttomLeftCornerBitmap_ ); + m = TQRegion( decoFactory_->buttomLeftCornerBitmap_ ); m.translate( 0, h - BOTTOMLEFTMASKHEIGHT ); - mask -= QRegion( m ); + mask -= TQRegion( m ); // bottom mid if ( BOTTOMMIDMASKWIDTH >= 1 ) @@ -2797,14 +2797,14 @@ void DeKoratorClient::doShape() int pos = BOTTOMLEFTMASKWIDTH; int rep = ( w - BOTTOMLEFTMASKWIDTH - BOTTOMRIGHTMASKWIDTH ) / BOTTOMMIDMASKWIDTH; int hm = h - BOTTOMMIDMASKHEIGHT; - m = QRegion( decoFactory_->buttomMidBitmap_ ); - QRegion mBak = m; + m = TQRegion( decoFactory_->buttomMidBitmap_ ); + TQRegion mBak = m; for ( int i = 0 ; i < rep ; i++ ) { m = mBak; m.translate( BOTTOMLEFTMASKWIDTH + ( i * BOTTOMMIDMASKWIDTH ), hm ); - mask -= QRegion( m ); + mask -= TQRegion( m ); pos += BOTTOMMIDMASKWIDTH; } @@ -2817,9 +2817,9 @@ void DeKoratorClient::doShape() } //buttom right - m = QRegion( decoFactory_->buttomRightCornerBitmap_ ); + m = TQRegion( decoFactory_->buttomRightCornerBitmap_ ); m.translate( width() - BOTTOMRIGHTMASKWIDTH, h - BOTTOMRIGHTMASKHEIGHT ); - mask -= QRegion( m ); + mask -= TQRegion( m ); } mask_ = mask; } |