diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2016-03-25 20:03:28 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2016-03-25 20:03:28 +0100 |
commit | 2ee99ab520931c5efe91123c85ba10064a45e95d (patch) | |
tree | a367666e410de28d0f258aed77b11e17cafb28e4 /style/utils.cpp | |
parent | cfa36e1a95e82492c17225ff376911abb3688f62 (diff) | |
download | tde-style-baghira-2ee99ab520931c5efe91123c85ba10064a45e95d.tar.gz tde-style-baghira-2ee99ab520931c5efe91123c85ba10064a45e95d.zip |
Initial TQt conversion
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'style/utils.cpp')
-rw-r--r-- | style/utils.cpp | 360 |
1 files changed, 180 insertions, 180 deletions
diff --git a/style/utils.cpp b/style/utils.cpp index dd24986..31ef75a 100644 --- a/style/utils.cpp +++ b/style/utils.cpp @@ -1,14 +1,14 @@ #include "baghira.h" -#include <qbitmap.h> -#include <qimage.h> -#include <qcolor.h> -#include <qpalette.h> -#include <qrect.h> -#include <qpoint.h> -#include <qapplication.h> -#include <qpainter.h> -#include <qpen.h> +#include <tqbitmap.h> +#include <tqimage.h> +#include <tqcolor.h> +#include <tqpalette.h> +#include <tqrect.h> +#include <tqpoint.h> +#include <tqapplication.h> +#include <tqpainter.h> +#include <tqpen.h> //#include <kwordwrap.h> @@ -33,7 +33,7 @@ A1 = CLAMP(A1 + A2,0,255); #define DELTA_COLOR(D,R,G,B) \ - delta = (255 - qRed(D))/2; \ + delta = (255 - tqRed(D))/2; \ destR = R - delta; \ destG = G - delta; \ destB = B - delta; @@ -83,42 +83,42 @@ if ( B < 0 ) B = 0; else if ( B > 255 ) B = 255; #ifndef PRINTDEVICE -#define PRINTDEVICE(_p_) qWarning("device is %s", (_p_->device()->devType() == QInternal::Widget) ?\ -"Widget": (_p_->device()->devType() == QInternal::Pixmap) ?\ -"Pixmap": (_p_->device()->devType() == QInternal::Printer) ?\ -"Printer": (_p_->device()->devType() == QInternal::Picture) ?\ -"Picture": (_p_->device()->devType() == QInternal::UndefinedDevice) ?\ +#define PRINTDEVICE(_p_) tqWarning("device is %s", (_p_->device()->devType() == TQInternal::Widget) ?\ +"Widget": (_p_->device()->devType() == TQInternal::Pixmap) ?\ +"Pixmap": (_p_->device()->devType() == TQInternal::Printer) ?\ +"Printer": (_p_->device()->devType() == TQInternal::Picture) ?\ +"Picture": (_p_->device()->devType() == TQInternal::UndefinedDevice) ?\ "UndefinedDevice": "fuckdevice!" ); #endif int LiquidStyle::getBrightness(unsigned int rgb) const { - int red = qRed( rgb ); - int green = qGreen( rgb ); - int blue = qBlue( rgb ); + int red = tqRed( rgb ); + int green = tqGreen( rgb ); + int blue = tqBlue( rgb ); int V = red; if (green > V) V = green; if (blue > V) V = blue; return V; } -QPixmap* LiquidStyle::adjustHSV( QImage &img, const QColor &c, const QColor *bg ) const +TQPixmap* LiquidStyle::adjustHSV( TQImage &img, const TQColor &c, const TQColor *bg ) const { - QImage * tmp = adjustHSVImage( img, c, bg ); + TQImage * tmp = adjustHSVImage( img, c, bg ); - QPixmap *pix = new QPixmap; + TQPixmap *pix = new TQPixmap; pix->convertFromImage( *tmp ); delete tmp; return ( pix ); } -ButtonTile* LiquidStyle::createRoundFrameTile(QImage &img, const QColor &color, const QColor *bg, const QColor &baseColor ) const +ButtonTile* LiquidStyle::createRoundFrameTile(TQImage &img, const TQColor &color, const TQColor *bg, const TQColor &baseColor ) const { - QColor bgColor( bg ? *bg : qApp->palette().active().background() ); + TQColor bgColor( bg ? *bg : tqApp->palette().active().background() ); if ( img.depth() != 32 ) img = img.convertDepth( 32 ); - QImage *dest = new QImage( img.width(), img.height(), 32, 0 ); + TQImage *dest = new TQImage( img.width(), img.height(), 32, 0 ); dest->setAlphaBuffer( true ); unsigned int *data = ( unsigned int * ) img.bits(); unsigned int *destData = ( unsigned int* ) dest->bits(); @@ -143,14 +143,14 @@ ButtonTile* LiquidStyle::createRoundFrameTile(QImage &img, const QColor &color, for ( current = 0 ; current < total ; ++current ) { - alpha = qAlpha( data[ current ] ); + alpha = tqAlpha( data[ current ] ); if (alpha) { if (optionHandler->IcyButtons()) { - red = qRed( data[ current ] ); - green = qGreen( data[ current ] ); - blue = qBlue( data[ current ] ); + red = tqRed( data[ current ] ); + green = tqGreen( data[ current ] ); + blue = tqBlue( data[ current ] ); SATURATION_COLOR(red, green, blue); } else @@ -177,22 +177,22 @@ ButtonTile* LiquidStyle::createRoundFrameTile(QImage &img, const QColor &color, #endif // force back to valid colorspace ! COLOR_SPACE(destR, destG, destB); - destData[ current ] = qRgba( destR, destG, destB, alpha ); + destData[ current ] = tqRgba( destR, destG, destB, alpha ); } - QPixmap destPix; + TQPixmap destPix; destPix = *dest; ButtonTile *ret = separateTiles( &destPix, 11, 10, 6, 1, 0, false); delete dest; return ret; } -QImage* LiquidStyle::adjustHSVImage( QImage &img, const QColor &c, const QColor *bg ) const +TQImage* LiquidStyle::adjustHSVImage( TQImage &img, const TQColor &c, const TQColor *bg ) const { - QColor bgColor( bg ? *bg : qApp->palette().active().background() ); + TQColor bgColor( bg ? *bg : tqApp->palette().active().background() ); if ( img.depth() != 32 ) img = img.convertDepth( 32 ); - QImage *dest = new QImage( img.width(), img.height(), 32, 0 ); + TQImage *dest = new TQImage( img.width(), img.height(), 32, 0 ); dest->setAlphaBuffer( true ); unsigned int *data = ( unsigned int * ) img.bits(); unsigned int *destData = ( unsigned int* ) dest->bits(); @@ -222,12 +222,12 @@ QImage* LiquidStyle::adjustHSVImage( QImage &img, const QColor &c, const QColor // float srcPercent, destPercent; for ( current = 0 ; current < total ; ++current ) { - alpha = qAlpha( data[ current ] ); + alpha = tqAlpha( data[ current ] ); if (optionHandler->IcyButtons()) { - red = qRed( data[ current ] ); - green = qGreen( data[ current ] ); - blue = qBlue( data[ current ] ); + red = tqRed( data[ current ] ); + green = tqGreen( data[ current ] ); + blue = tqBlue( data[ current ] ); SATURATION_COLOR2(sq, red, green, blue); } else @@ -237,16 +237,16 @@ QImage* LiquidStyle::adjustHSVImage( QImage &img, const QColor &c, const QColor } // force back to valid colorspace ! COLOR_SPACE(destR, destG, destB); - destData[ current ] = qRgba( destR, destG, destB, alpha ); + destData[ current ] = tqRgba( destR, destG, destB, alpha ); } return ( dest ); } -QImage* LiquidStyle::tintBrush( const QImage &img, const QColor &c ) const +TQImage* LiquidStyle::tintBrush( const TQImage &img, const TQColor &c ) const { // if ( img.depth() != 32 ) // img = img.convertDepth( 32 ); - QImage *dest = new QImage( img.width(), img.height(), 32, 0 ); + TQImage *dest = new TQImage( img.width(), img.height(), 32, 0 ); unsigned int *data = ( unsigned int * ) img.bits(); unsigned int *destData = ( unsigned int* ) dest->bits(); int total = img.width() * img.height(); @@ -262,19 +262,19 @@ QImage* LiquidStyle::tintBrush( const QImage &img, const QColor &c ) const // float srcPercent, destPercent; for ( current = 0 ; current < total ; ++current ) { - alpha = qAlpha( data[ current ] ); - blue = qBlue( data[ current ] ); - red = qRed( data[ current ] ); - green = qGreen( data[ current ] ); + alpha = tqAlpha( data[ current ] ); + blue = tqBlue( data[ current ] ); + red = tqRed( data[ current ] ); + green = tqGreen( data[ current ] ); SATURATION_COLOR(red, green, blue); // force back to valid colorspace ! COLOR_SPACE(destR, destG, destB); - destData[ current ] = qRgba( destR, destG, destB, alpha ); + destData[ current ] = tqRgba( destR, destG, destB, alpha ); } return ( dest ); } -QColor LiquidStyle::brushedMetalColor(QColor &c) const +TQColor LiquidStyle::brushedMetalColor(TQColor &c) const { if (optionHandler->TintBrush()) { @@ -284,21 +284,21 @@ QColor LiquidStyle::brushedMetalColor(QColor &c) const int destR, destG, destB, grey, iGrey, delta; SATURATION_COLOR(180, 180, 180); COLOR_SPACE(destR, destG, destB); - return QColor(destR, destG, destB); + return TQColor(destR, destG, destB); } else - return QColor (180,180,180); + return TQColor (180,180,180); } -void LiquidStyle::clearImage( QImage &img ) const +void LiquidStyle::clearImage( TQImage &img ) const { int x, y; int w = img.width(); int h = img.height(); - unsigned int pixel = qRgba( 0, 0, 0, 0 ); + unsigned int pixel = tqRgba( 0, 0, 0, 0 ); unsigned int *data; for ( y = 0 ; y < h ; ++y ) @@ -306,10 +306,10 @@ void LiquidStyle::clearImage( QImage &img ) const // img.fill( pixel ); } -void LiquidStyle::adjustHSV( QPixmap &pix, const QColor &c ) const +void LiquidStyle::adjustHSV( TQPixmap &pix, const TQColor &c ) const { - QImage img = pix.convertToImage(); - QPixmap *result = adjustHSV( img, c); + TQImage img = pix.convertToImage(); + TQPixmap *result = adjustHSV( img, c); pix = *result; delete result; } @@ -320,17 +320,17 @@ w, h are width and height of the whole button. xOff (yOff) is the distance of the central fraction from left (upper) button side. centerW (centerH) is the width (height) of the central button fraction. shadowH is the height of the buttons shadow*/ -ButtonTile* LiquidStyle::createButtonTile( const QColor &c, - const QColor &bgColor, - QImage *buttonImage, - QImage *shadowImage, - QImage *glowImage, - QIntDict<ButtonTile>*buttonDict, - QIntDict<ButtonTile>*shadowDict, - QIntDict<ButtonTile>*glowDict, - int w, int h, int xOff, int yOff, - int centerW, int centerH, - int shadowH, int glowWH, +ButtonTile* LiquidStyle::createButtonTile( const TQColor &c, + const TQColor &bgColor, + TQImage *buttonImage, + TQImage *shadowImage, + TQImage *glowImage, + TQIntDict<ButtonTile>*buttonDict, + TQIntDict<ButtonTile>*shadowDict, + TQIntDict<ButtonTile>*glowDict, + int w, int h, int xOff, int yOff, + int centerW, int centerH, + int shadowH, int glowWH, bool sunken) const { int x, y, delta; @@ -360,7 +360,7 @@ ButtonTile* LiquidStyle::createButtonTile( const QColor &c, int shadowOverhead; shadowH > glowWH ? shadowOverhead = shadowH - glowWH : shadowOverhead = 0; - QImage img( w + 2*glowWH, h + 2*glowWH + shadowOverhead, 32, 0 ); + TQImage img( w + 2*glowWH, h + 2*glowWH + shadowOverhead, 32, 0 ); img.setAlphaBuffer( !isPlain() || optionHandler->drawGroupBoxShadow() ? true : false); clearImage( img ); @@ -388,15 +388,15 @@ ButtonTile* LiquidStyle::createButtonTile( const QColor &c, if (optionHandler->buttonStyle() == Jaguar) // has brighter shadows... { for ( x = 0 ; x < w ; ++x ) - if ((alpha = qAlpha( data[ x ] ))) + if ((alpha = tqAlpha( data[ x ] ))) { - destData[ x + glowWH ] = qRgba( qRed(data[ x ]), qGreen(data[ x ]), qBlue(data[ x ]), alpha >> 1 ); + destData[ x + glowWH ] = tqRgba( tqRed(data[ x ]), tqGreen(data[ x ]), tqBlue(data[ x ]), alpha >> 1 ); } } else { for ( x = 0 ; x < w ; ++x ) - if ((alpha = qAlpha( data[ x ] ))) + if ((alpha = tqAlpha( data[ x ] ))) { destData[ x + glowWH ] = data[x]; } @@ -409,11 +409,11 @@ ButtonTile* LiquidStyle::createButtonTile( const QColor &c, data = ( unsigned int * ) glowImage->scanLine( y ); destData = ( unsigned int * ) img.scanLine( y ); for ( x = 0 ; x < w + 2*glowWH ; ++x ) - if ((alpha = qAlpha( data[ x ] ))) + if ((alpha = tqAlpha( data[ x ] ))) { DELTA_COLOR(data[ x ], srcR, srcG, srcB); COLOR_SPACE(destR, destG, destB); - destData[ x ] = qRgba( destR, destG, destB, alpha ); + destData[ x ] = tqRgba( destR, destG, destB, alpha ); } } @@ -423,15 +423,15 @@ ButtonTile* LiquidStyle::createButtonTile( const QColor &c, data = ( unsigned int * ) buttonImage->scanLine( y ); destData = ( unsigned int * ) img.scanLine( y + glowWH ); for ( x = 0 ; x < w ; ++x ) - if ((alpha = qAlpha( data[ x ] ))) + if ((alpha = tqAlpha( data[ x ] ))) { if (!rect || (y > 1 && y < h-2 && x > 0 && x < w-1) ) { if (optionHandler->IcyButtons()) { - red = qRed( data[ x ] ); - green = qGreen( data[ x ] ); - blue = qBlue( data[ x ] ); + red = tqRed( data[ x ] ); + green = tqGreen( data[ x ] ); + blue = tqBlue( data[ x ] ); SATURATION_COLOR2(sq, red, green, blue); } else @@ -441,24 +441,24 @@ ButtonTile* LiquidStyle::createButtonTile( const QColor &c, } else { - red = qRed( data[ x ] ); - green = qGreen( data[ x ] ); - blue = qBlue( data[ x ] ); + red = tqRed( data[ x ] ); + green = tqGreen( data[ x ] ); + blue = tqBlue( data[ x ] ); TINT_WHITE(55, red, green, blue); } if (alpha != 255) { - if ( qAlpha( destData[ x + glowWH ] ) ) + if ( tqAlpha( destData[ x + glowWH ] ) ) { - ALPHA_COLOR2(alpha, qAlpha( destData[ x + glowWH ] ), qRed( destData[ x + glowWH ]), qGreen( destData[ x + glowWH ]), qBlue( destData[ x + glowWH ])); + ALPHA_COLOR2(alpha, tqAlpha( destData[ x + glowWH ] ), tqRed( destData[ x + glowWH ]), tqGreen( destData[ x + glowWH ]), tqBlue( destData[ x + glowWH ])); } } COLOR_SPACE(destR, destG, destB); - destData[ x + glowWH ] = qRgba( destR, destG, destB, alpha ); + destData[ x + glowWH ] = tqRgba( destR, destG, destB, alpha ); } } - QPixmap *pix = new QPixmap; + TQPixmap *pix = new TQPixmap; pix->convertFromImage( img ); tile = separateTiles( pix, xOff+glowWH, yOff+glowWH, centerW, centerH, shadowH, sunken); @@ -473,7 +473,7 @@ ButtonTile* LiquidStyle::createButtonTile( const QColor &c, return ( tile ); } -QPixmap* LiquidStyle::createSliderEnd( const QColor &c, const QColor &bgColor, bool top) const +TQPixmap* LiquidStyle::createSliderEnd( const TQColor &c, const TQColor &bgColor, bool top) const { int x, y, delta; @@ -490,7 +490,7 @@ QPixmap* LiquidStyle::createSliderEnd( const QColor &c, const QColor &bgColor, b unsigned int *data, *destData; - QImage img( 13, 9, 32, 0 ); + TQImage img( 13, 9, 32, 0 ); img.setAlphaBuffer( true ); // we need this always, as the slider groove is nevernever plain! clearImage( img ); @@ -500,10 +500,10 @@ QPixmap* LiquidStyle::createSliderEnd( const QColor &c, const QColor &bgColor, b top ? data = ( unsigned int * ) slider_top_shd->scanLine( y ) : data = ( unsigned int * ) slider_btm_shd->scanLine( y ); destData = ( unsigned int * ) img.scanLine( y ); for ( x = 0; x < 13; ++x ) - if ((alpha = qAlpha( data[ x ] ))) { + if ((alpha = tqAlpha( data[ x ] ))) { DELTA_COLOR(data[ x ], bgColor.red(), bgColor.green(), bgColor.blue()); COLOR_SPACE(destR, destG, destB); - destData[ x ] = qRgba( destR, destG, destB, alpha ); + destData[ x ] = tqRgba( destR, destG, destB, alpha ); } } // then the button and overlay @@ -524,26 +524,26 @@ QPixmap* LiquidStyle::createSliderEnd( const QColor &c, const QColor &bgColor, b top ? data = ( unsigned int * ) slider_top->scanLine( y ) : data = ( unsigned int * ) slider_btm->scanLine( y ); destData = ( unsigned int * ) img.scanLine( top ? y + 2 : y ); for ( x = 0 ; x < 13 ; ++x ) - if ((alpha = qAlpha( data[ x ] ))) { + if ((alpha = tqAlpha( data[ x ] ))) { if (optionHandler->IcyButtons()) { - red = qRed( data[ x ] ); - green = qGreen( data[ x] ); - blue = qBlue( data[ x] ); + red = tqRed( data[ x ] ); + green = tqGreen( data[ x] ); + blue = tqBlue( data[ x] ); SATURATION_COLOR2(sq, red, green, blue); } else { - DELTA_COLOR(data[ x ], srcR, srcG, srcB); + DELTA_COLOR(data[ x ], srcR, srcG, srcB); } if (alpha != 255) { - if ( qAlpha( destData[ x ] ) ) { - ALPHA_COLOR2(alpha, qAlpha( destData[ x ]), qRed( destData[ x ]), qGreen( destData[ x ]), qBlue( destData[ x ])); + if ( tqAlpha( destData[ x ] ) ) { + ALPHA_COLOR2(alpha, tqAlpha( destData[ x ]), tqRed( destData[ x ]), tqGreen( destData[ x ]), tqBlue( destData[ x ])); } } COLOR_SPACE(destR, destG, destB); - destData[ x ] = qRgba( destR, destG, destB, alpha ); + destData[ x ] = tqRgba( destR, destG, destB, alpha ); } } - QPixmap *pix = new QPixmap; + TQPixmap *pix = new TQPixmap; pix->convertFromImage( img ); return ( pix ); } @@ -560,12 +560,12 @@ QPixmap* LiquidStyle::createSliderEnd( const QColor &c, const QColor &bgColor, b // ------------------------------------- // Overload of mosfet's original function, takes 6 more parameters to use the funktion on variable bitmaps (mosfet's function does only work for very special bitmaps) // by giving position and dimension of the central tile + the shadow height (panther doesn't seem to have a right shadow-offset) -ButtonTile* LiquidStyle::separateTiles( QPixmap *pix, - int xO, int yO, int w, int h, +ButtonTile* LiquidStyle::separateTiles( TQPixmap *pix, + int xO, int yO, int w, int h, int, bool sunken) const { ButtonTile * tile = new ButtonTile(); - QPixmap *tmp; + TQPixmap *tmp; int w1 = xO; int w2 = w; @@ -583,72 +583,72 @@ ButtonTile* LiquidStyle::separateTiles( QPixmap *pix, if ( !sunken ) { // Top tiles - tmp = new QPixmap( w1, h1 ); + tmp = new TQPixmap( w1, h1 ); // bitBlt(...,x,y,width,height) copyBlt( tmp, 0, 0, pix, xO1, yO1, w1, h1 ); tile->setPixmap( TileTopLeft, tmp ); - tmp = new QPixmap( w2, h1 ); + tmp = new TQPixmap( w2, h1 ); copyBlt( tmp, 0, 0, pix, xO2, yO1, w2, h1 ); tile->setPixmap( TileTop, tmp ); - tmp = new QPixmap( w3, h1 ); + tmp = new TQPixmap( w3, h1 ); copyBlt( tmp, 0, 0, pix, xO3, yO1, w3, h1 ); tile->setPixmap( TileTopRight, tmp ); // Middle tiles - tmp = new QPixmap( w1, h2 ); + tmp = new TQPixmap( w1, h2 ); copyBlt( tmp, 0, 0, pix, xO1, yO2, w1, h2 ); tile->setPixmap( TileLeft, tmp ); - tmp = new QPixmap( w2, h2 ); + tmp = new TQPixmap( w2, h2 ); copyBlt( tmp, 0, 0, pix, xO2, yO2, w2, h2 ); tile->setPixmap( TileMiddle, tmp ); - tmp = new QPixmap( w3, h2 ); + tmp = new TQPixmap( w3, h2 ); copyBlt( tmp, 0, 0, pix, xO3, yO2, w3, h2 ); tile->setPixmap( TileRight, tmp ); // Bottom tiles - tmp = new QPixmap( w1, h3 ); + tmp = new TQPixmap( w1, h3 ); copyBlt( tmp, 0, 0, pix, xO1, yO3, w1, h3 ); tile->setPixmap( TileBtmLeft, tmp ); - tmp = new QPixmap( w2, h3 ); + tmp = new TQPixmap( w2, h3 ); copyBlt( tmp, 0, 0, pix, xO2, yO3, w2, h3 ); tile->setPixmap( TileBtm, tmp ); - tmp = new QPixmap( w3, h3 ); + tmp = new TQPixmap( w3, h3 ); copyBlt( tmp, 0, 0, pix, xO3, yO3, w3, h3 ); tile->setPixmap( TileBtmRight, tmp ); } else { // Top tiles - tmp = new QPixmap( w1, h3 ); + tmp = new TQPixmap( w1, h3 ); // bitBlt(...,x,y,width,height) copyBlt( tmp, 0, 0, pix, xO1, yO1, w1, h3 ); tile->setPixmap( TileTopLeft, tmp ); - tmp = new QPixmap( w2, h3 ); + tmp = new TQPixmap( w2, h3 ); copyBlt( tmp, 0, 0, pix, xO2, yO1, w2, h3 ); tile->setPixmap( TileTop, tmp ); - tmp = new QPixmap( w3, h3 ); + tmp = new TQPixmap( w3, h3 ); copyBlt( tmp, 0, 0, pix, xO3, yO1, w3, h3 ); tile->setPixmap( TileTopRight, tmp ); // Middle tiles - tmp = new QPixmap( w1, h2 ); + tmp = new TQPixmap( w1, h2 ); copyBlt( tmp, 0, 0, pix, xO1, yO2 + h3 - h1, w1, h2 ); tile->setPixmap( TileLeft, tmp ); - tmp = new QPixmap( w2, h2 ); + tmp = new TQPixmap( w2, h2 ); copyBlt( tmp, 0, 0, pix, xO2, yO2 + h3 - h1, w2, h2 ); tile->setPixmap( TileMiddle, tmp ); - tmp = new QPixmap( w3, h2 ); + tmp = new TQPixmap( w3, h2 ); copyBlt( tmp, 0, 0, pix, xO3, yO2 + h3 - h1, w3, h2 ); tile->setPixmap( TileRight, tmp ); // Bottom tiles - tmp = new QPixmap( w1, h1 ); + tmp = new TQPixmap( w1, h1 ); copyBlt( tmp, 0, 0, pix, xO1, yO3 + h3 - h1, w1, h1 ); tile->setPixmap( TileBtmLeft, tmp ); - tmp = new QPixmap( w2, h1 ); + tmp = new TQPixmap( w2, h1 ); copyBlt( tmp, 0, 0, pix, xO2, yO3 + h3 - h1, w2, h1 ); tile->setPixmap( TileBtm, tmp ); - tmp = new QPixmap( w3, h1 ); + tmp = new TQPixmap( w3, h1 ); copyBlt( tmp, 0, 0, pix, xO3, yO3 + h3 - h1, w3, h1 ); tile->setPixmap( TileBtmRight, tmp ); } @@ -664,64 +664,64 @@ ButtonTile* LiquidStyle::separateTiles( QPixmap *pix, #define _LRWIDTH_ (_LOFF_ + _ROFF_) #define _TBHEIGHT_ (_TOFF_ + _BOFF_) -void LiquidStyle::drawRoundButton( QPainter *painter, const QColorGroup &cg, const QColor &c, int x, int y, int w, int h, bool pushedDown, bool hover, int bgX, int bgY ) const +void LiquidStyle::drawRoundButton( TQPainter *painter, const TQColorGroup &cg, const TQColor &c, int x, int y, int w, int h, bool pushedDown, bool hover, int bgX, int bgY ) const { - QColor myC =(isOOO && (hover || pushedDown))?optionHandler->CustomButtonColor():c; + TQColor myC =(isOOO && (hover || pushedDown))?optionHandler->CustomButtonColor():c; LiquidStyle *ptr = const_cast<LiquidStyle*>( this ); ButtonTile *tile = pushedDown ? btnDict.find( myC.rgb() ) : btnShadowedDict.find( myC.rgb() ); if ( !tile ) { - tile = createButtonTile( myC, qApp->palette().color(QPalette::Active, QColorGroup::Background), ptr->btnBorderImg, ptr->btnShadowImg, ptr->buttonGlow, &(ptr->btnDict), &(ptr->btnShadowedDict), &(ptr->buttonGlowDict), 37, 21, 10, 11, 17, 1, 2, 2, pushedDown); + tile = createButtonTile( myC, tqApp->palette().color(TQPalette::Active, TQColorGroup::Background), ptr->btnBorderImg, ptr->btnShadowImg, ptr->buttonGlow, &(ptr->btnDict), &(ptr->btnShadowedDict), &(ptr->buttonGlowDict), 37, 21, 10, 11, 17, 1, 2, 2, pushedDown); } if ( !tile ) { - qWarning( "Button tile is NULL!" ); + tqWarning( "Button tile is NULL!" ); return ; } - QPainter *p; - QPen oldPen = painter->pen(); + TQPainter *p; + TQPen oldPen = painter->pen(); if (!isHTMLButton) { if ( !tmpBtnPix ) - ptr->tmpBtnPix = new QPixmap( w, h ); + ptr->tmpBtnPix = new TQPixmap( w, h ); else if ( w > tmpBtnPix->width() || h > tmpBtnPix->height() ) { // make temp pixmap size == largest button ptr->tmpBtnPix->resize(w,h); } - p = new QPainter(tmpBtnPix); + p = new TQPainter(tmpBtnPix); if (!isPlain()) { - QPixmap *stipple; + TQPixmap *stipple; if (paintWidget && paintWidget->parentWidget()) { - stipple = const_cast<QPixmap*>(paintWidget->parentWidget()->palette().brush(QPalette::Active, QColorGroup::Background).pixmap()); + stipple = const_cast<TQPixmap*>(paintWidget->parentWidget()->palette().brush(TQPalette::Active, TQColorGroup::Background).pixmap()); if (!stipple || stipple->isNull()) - p->fillRect(0,0,w,h, paintWidget->parentWidget()->palette().brush(QPalette::Active, QColorGroup::Background) ); + p->fillRect(0,0,w,h, paintWidget->parentWidget()->palette().brush(TQPalette::Active, TQColorGroup::Background) ); else p->drawTiledPixmap( 0, 0, w, h, *stipple, bgX, bgY ); } else { - stipple = cg.brush( QColorGroup::Background ).pixmap(); + stipple = cg.brush( TQColorGroup::Background ).pixmap(); stipple ? p->drawTiledPixmap( 0, 0, w, h, *stipple, bgX, bgY ) : - p->fillRect(0,0,w,h, cg.brush( QColorGroup::Background )); + p->fillRect(0,0,w,h, cg.brush( TQColorGroup::Background )); } } else - p->fillRect(0,0,w,h, cg.brush( QColorGroup::Background )); + p->fillRect(0,0,w,h, cg.brush( TQColorGroup::Background )); } else { p = painter; } -// QPainter p(tmpBtnPix); +// TQPainter p(tmpBtnPix); // tiled fills if ( w > _LRWIDTH_ ) @@ -753,16 +753,16 @@ void LiquidStyle::drawRoundButton( QPainter *painter, const QColorGroup &cg, con } -void LiquidStyle::drawRectangularButton( QPainter *painter, - const QColorGroup &cg, const QColor &c, - int x, int y, int w, int h, +void LiquidStyle::drawRectangularButton( TQPainter *painter, + const TQColorGroup &cg, const TQColor &c, + int x, int y, int w, int h, bool sunken, bool hover, bool isCombo, int position, bool isHTML) const { #define _HEIGHT_ ptr->rectbutton->height() #define _WIDTH_ ptr->rectbutton->width() LiquidStyle *ptr = const_cast<LiquidStyle*>( this ); - QColor tmpColor; + TQColor tmpColor; tmpColor = isCombo && !(hover || sunken) ? optionHandler->InactiveButtonColor() : c; int xOffset, width; @@ -770,11 +770,11 @@ void LiquidStyle::drawRectangularButton( QPainter *painter, ButtonTile *tile = rectBtnDict.find( tmpColor.rgb() ); if ( !tile ) - tile = createButtonTile( tmpColor, cg.background(), ptr->rectbutton, ((QImage*)0L), ((QImage*)0L), &(ptr->rectBtnDict), (QIntDict<ButtonTile>*)0L, (QIntDict<ButtonTile>*)0L, 33, 25, 10, 5, 13, 15, 0, 0, sunken); + tile = createButtonTile( tmpColor, cg.background(), ptr->rectbutton, ((TQImage*)0L), ((TQImage*)0L), &(ptr->rectBtnDict), (TQIntDict<ButtonTile>*)0L, (TQIntDict<ButtonTile>*)0L, 33, 25, 10, 5, 13, 15, 0, 0, sunken); if ( !tile ) { - qWarning( "Button tile is NULL!" ); + tqWarning( "Button tile is NULL!" ); return ; } @@ -802,23 +802,23 @@ void LiquidStyle::drawRectangularButton( QPainter *painter, break; } - QPainter *p; - QPen oldPen = painter->pen(); + TQPainter *p; + TQPen oldPen = painter->pen(); if (!isHTML) { if ( !tmpBtnPix ) - ptr->tmpBtnPix = new QPixmap( w, h ); + ptr->tmpBtnPix = new TQPixmap( w, h ); else if ( w > tmpBtnPix->width() || h > tmpBtnPix->height() ) { // make temp pixmap size == largest button ptr->tmpBtnPix->resize(w,h); } - p = new QPainter(tmpBtnPix); + p = new TQPainter(tmpBtnPix); if (position != center && paintWidget && paintWidget->parentWidget()) { if (this->paintWidget->parentWidget()->paletteBackgroundPixmap ()) - p->drawTiledPixmap(QRect(0, 0, w, h), *this->paintWidget->parentWidget()->paletteBackgroundPixmap(), ((QWidget *)this->paintWidget)->backgroundOffset()); + p->drawTiledPixmap(TQRect(0, 0, w, h), *this->paintWidget->parentWidget()->paletteBackgroundPixmap(), ((TQWidget *)this->paintWidget)->backgroundOffset()); else p->fillRect( 0, 0, w, h, this->paintWidget->parentWidget()->paletteBackgroundColor()); } @@ -831,7 +831,7 @@ void LiquidStyle::drawRectangularButton( QPainter *painter, } int tileH = 0; - QPixmap tmpPix(_LOFF_, 1); + TQPixmap tmpPix(_LOFF_, 1); if (position == left || position == full) { @@ -946,10 +946,10 @@ void LiquidStyle::drawRectangularButton( QPainter *painter, // second part of combos if needed tile = rectBtnDict.find( c.rgb() ); if ( !tile ) - tile = createButtonTile( c, cg.background(), ptr->rectbutton, ((QImage*)0L), ((QImage*)0L), &(ptr->rectBtnDict), (QIntDict<ButtonTile>*)0L, (QIntDict<ButtonTile>*)0L, 33, 25, 10, 5, 13, 15, 0, 0, sunken); + tile = createButtonTile( c, cg.background(), ptr->rectbutton, ((TQImage*)0L), ((TQImage*)0L), &(ptr->rectBtnDict), (TQIntDict<ButtonTile>*)0L, (TQIntDict<ButtonTile>*)0L, 33, 25, 10, 5, 13, 15, 0, 0, sunken); if ( !tile ) { - qWarning( "Button tile is NULL!" ); + tqWarning( "Button tile is NULL!" ); return ; } @@ -1038,31 +1038,31 @@ void LiquidStyle::drawRectangularButton( QPainter *painter, } -void LiquidStyle::drawCombo( QPainter *painter, - const QColorGroup &cg, - const QColor &c, - int x, int y, int w, int h, - bool sunken, bool hover, bool isCombo, +void LiquidStyle::drawCombo( TQPainter *painter, + const TQColorGroup &cg, + const TQColor &c, + int x, int y, int w, int h, + bool sunken, bool hover, bool isCombo, int position, bool isHTML ) const { LiquidStyle *ptr = const_cast<LiquidStyle*>( this ); - QColor myC =(isOOO && isCombo)?optionHandler->CustomButtonColor():c; - QColor tmpColor = isCombo && !(hover || sunken) ? optionHandler->InactiveButtonColor() : myC; + TQColor myC =(isOOO && isCombo)?optionHandler->CustomButtonColor():c; + TQColor tmpColor = isCombo && !(hover || sunken) ? optionHandler->InactiveButtonColor() : myC; ButtonTile *tile = sunken ? comboDict.find( tmpColor.rgb() ) : comboShadowedDict.find( tmpColor.rgb() ); if ( !tile ) { if (optionHandler->buttonStyle() == Milk && sunken) - tile = createButtonTile( tmpColor, cg.background(), ptr->btnBorderImg, ptr->comboShadow, ((QImage*)0L), &(ptr->comboDict), &(ptr->comboShadowedDict), (QIntDict<ButtonTile>*)0L, 44, 21, 7, 9, 30, 1, 2, 0, true); + tile = createButtonTile( tmpColor, cg.background(), ptr->btnBorderImg, ptr->comboShadow, ((TQImage*)0L), &(ptr->comboDict), &(ptr->comboShadowedDict), (TQIntDict<ButtonTile>*)0L, 44, 21, 7, 9, 30, 1, 2, 0, true); else - tile = createButtonTile( tmpColor, cg.background(), ptr->combo, ptr->comboShadow, ((QImage*)0L), &(ptr->comboDict), &(ptr->comboShadowedDict), (QIntDict<ButtonTile>*)0L, 44, 21, 7, 9, 30, 1, 2, 0, sunken); + tile = createButtonTile( tmpColor, cg.background(), ptr->combo, ptr->comboShadow, ((TQImage*)0L), &(ptr->comboDict), &(ptr->comboShadowedDict), (TQIntDict<ButtonTile>*)0L, 44, 21, 7, 9, 30, 1, 2, 0, sunken); } if ( !tile ) { - qWarning( "Button tile is NULL!" ); + tqWarning( "Button tile is NULL!" ); return ; } @@ -1092,23 +1092,23 @@ void LiquidStyle::drawCombo( QPainter *painter, break; } - QPainter *p; - QPen oldPen = painter->pen(); + TQPainter *p; + TQPen oldPen = painter->pen(); if (!isHTML) { if ( !tmpBtnPix ) - ptr->tmpBtnPix = new QPixmap( w, h ); + ptr->tmpBtnPix = new TQPixmap( w, h ); else if ( w > tmpBtnPix->width() || h > tmpBtnPix->height() ) { // make temp pixmap size == largest button ptr->tmpBtnPix->resize(w,h); } - p = new QPainter(tmpBtnPix); + p = new TQPainter(tmpBtnPix); #if 0 - QPixmap *stipple = cg.brush( QColorGroup::Background ).pixmap(); + TQPixmap *stipple = cg.brush( TQColorGroup::Background ).pixmap(); if ( !stipple ) // button may have custom colorgroup - stipple = qApp->palette().active().brush( QColorGroup::Background ).pixmap(); + stipple = tqApp->palette().active().brush( TQColorGroup::Background ).pixmap(); if ( stipple ) p->drawTiledPixmap( 0, 0, w, h, *stipple); else @@ -1117,7 +1117,7 @@ void LiquidStyle::drawCombo( QPainter *painter, if (position != center && paintWidget && paintWidget->parentWidget()) { if (this->paintWidget->parentWidget()->paletteBackgroundPixmap ()) - p->drawTiledPixmap(QRect(0, 0, w, h), *this->paintWidget->parentWidget()->paletteBackgroundPixmap(), ((QWidget *)this->paintWidget)->backgroundOffset()); + p->drawTiledPixmap(TQRect(0, 0, w, h), *this->paintWidget->parentWidget()->paletteBackgroundPixmap(), ((TQWidget *)this->paintWidget)->backgroundOffset()); else p->fillRect( 0, 0, w, h, this->paintWidget->parentWidget()->paletteBackgroundColor()); } @@ -1173,11 +1173,11 @@ void LiquidStyle::drawCombo( QPainter *painter, tile = comboShadowedDict.find( myC.rgb() ); if ( !tile ) { - tile = createButtonTile( myC, cg.background(), ptr->combo, ptr->comboShadow, ((QImage*)0L), &(ptr->comboDict), &(ptr->comboShadowedDict), (QIntDict<ButtonTile>*)0L, 44, 21, 7, 9, 30, 1, 2, 0, sunken); + tile = createButtonTile( myC, cg.background(), ptr->combo, ptr->comboShadow, ((TQImage*)0L), &(ptr->comboDict), &(ptr->comboShadowedDict), (TQIntDict<ButtonTile>*)0L, 44, 21, 7, 9, 30, 1, 2, 0, sunken); } if ( !tile ) { - qWarning( "Button tile is NULL!" ); + tqWarning( "Button tile is NULL!" ); return ; } if ( w > _LRWIDTH_ ) @@ -1242,15 +1242,15 @@ void LiquidStyle::drawCombo( QPainter *painter, p->setPen(oldPen); } -void LiquidStyle::drawRoundFrame( QPainter *p, const QRect &r, - const QColorGroup &cg, bool focused, QPoint offset ) const +void LiquidStyle::drawRoundFrame( TQPainter *p, const TQRect &r, + const TQColorGroup &cg, bool focused, TQPoint offset ) const { ButtonTile *tile = focused ? activeRoundFrame : inactiveRoundFrame; if (!tile) tile = createRoundFrameTile(*roundFrame, focused ? cg.button() : optionHandler->InactiveButtonColor(), &cg.background(), cg.base() ); // first: fill background (tiled) // outer - QPixmap *stipple = cg.brush( QColorGroup::Background ).pixmap(); + TQPixmap *stipple = cg.brush( TQColorGroup::Background ).pixmap(); if (stipple) { p->drawTiledPixmap( r.x(),r.y(), 7, 8, *stipple, offset.x(), offset.y()); @@ -1290,17 +1290,17 @@ void LiquidStyle::drawRoundFrame( QPainter *p, const QRect &r, } } -void LiquidStyle::drawEditFrame( QPainter *p, const QRect &r, - const QColorGroup &cg, bool isHTML, bool focused, bool inverse ) const +void LiquidStyle::drawEditFrame( TQPainter *p, const TQRect &r, + const TQColorGroup &cg, bool isHTML, bool focused, bool inverse ) const { - QColor fill( cg.background().dark( 105 ) ); - QColor tmp(0,0,0); - QColor light1( 0, 0, 0 ); - QColor light2( 0, 0, 0 ); + TQColor fill( cg.background().dark( 105 ) ); + TQColor tmp(0,0,0); + TQColor light1( 0, 0, 0 ); + TQColor light2( 0, 0, 0 ); - QColor dark1( 0, 0, 0 ); - QColor dark2( 0, 0, 0 ); - QColor dark3( 0, 0, 0 ); + TQColor dark1( 0, 0, 0 ); + TQColor dark2( 0, 0, 0 ); + TQColor dark3( 0, 0, 0 ); if ( !focused ) { @@ -1390,12 +1390,12 @@ void LiquidStyle::drawEditFrame( QPainter *p, const QRect &r, p->drawLine( right - 1, y + 2, right - 1, bottom - 2 ); } -bool LiquidStyle::isHTMLWidget( const QWidget *widget ) const +bool LiquidStyle::isHTMLWidget( const TQWidget *widget ) const { - const QObject * w = widget->parent(); + const TQObject * w = widget->parent(); if ( w ) { - if ( !w->inherits( "QClipperWidget" ) ) + if ( !w->inherits( "TQClipperWidget" ) ) return ( false ); w = w->parent(); if ( w ) @@ -1408,9 +1408,9 @@ bool LiquidStyle::isHTMLWidget( const QWidget *widget ) const return ( false ); } -void LiquidStyle::drawHTMLCBBorder( const QPixmap &pix, const QColor &c ) const +void LiquidStyle::drawHTMLCBBorder( const TQPixmap &pix, const TQColor &c ) const { - QPainter p; + TQPainter p; p.begin( &pix ); p.setPen( c.dark( 200 ) ); p.drawRect( 0, 0, 16, 16 ); |