summaryrefslogtreecommitdiffstats
path: root/deco/config/aquariusbutton.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deco/config/aquariusbutton.cc')
-rw-r--r--deco/config/aquariusbutton.cc42
1 files changed, 21 insertions, 21 deletions
diff --git a/deco/config/aquariusbutton.cc b/deco/config/aquariusbutton.cc
index 6201abc..dcc1638 100644
--- a/deco/config/aquariusbutton.cc
+++ b/deco/config/aquariusbutton.cc
@@ -1,7 +1,7 @@
#include "aquariusbutton.h"
-#include <qcolor.h>
-#include <qpixmap.h>
-#include <qpainter.h>
+#include <tqcolor.h>
+#include <tqpixmap.h>
+#include <tqpainter.h>
#include <kimageeffect.h>
#include "config.h"
@@ -33,7 +33,7 @@
destG = (S*destG + (100-S)*G)/100; \
destB = (S*destB + (100-S)*B)/100;
-static bool blend( const QImage & upper, const QImage & lower, QImage & output)
+static bool blend( const TQImage & upper, const TQImage & lower, TQImage & output)
// adopted from kimageeffect::blend - what is not endian safe...
{
if
@@ -92,7 +92,7 @@ static bool blend( const QImage & upper, const QImage & lower, QImage & output)
return true;
}
-AquariusButton::AquariusButton( QPixmap &pixmap, QWidget* parent, const char* name) : QWidget( parent, name){
+AquariusButton::AquariusButton( TQPixmap &pixmap, TQWidget* parent, const char* name) : TQWidget( parent, name){
pixmap = pixmap;
image = pixmap.convertToImage();
setFixedSize( pixmap.size() );
@@ -101,18 +101,18 @@ AquariusButton::AquariusButton( QPixmap &pixmap, QWidget* parent, const char* na
AquariusButton::~AquariusButton(){
}
-QColor AquariusButton::Color(){
+TQColor AquariusButton::Color(){
return color;
}
-void AquariusButton::setColor(QColor c){
+void AquariusButton::setColor(TQColor c){
color = c;
tint(color);
repaint(false);
}
-void AquariusButton::tint(QColor &c){
- QImage dest( image.width(), image.height(), 32, 0 );
+void AquariusButton::tint(TQColor &c){
+ TQImage dest( image.width(), image.height(), 32, 0 );
dest.setAlphaBuffer( true );
unsigned int *data = ( unsigned int * ) image.bits();
unsigned int *destData = ( unsigned int* ) dest.bits();
@@ -127,34 +127,34 @@ void AquariusButton::tint(QColor &c){
int sq = CLAMP((int)((45.0/128.0)*s+55),0,100);
// float srcPercent, destPercent;
for ( int current = 0 ; current < total ; ++current ) {
- alpha = qAlpha( data[ current ] );
+ alpha = tqAlpha( data[ current ] );
if (alpha < 230){
destData[ current ] = data[ current ];
continue; //do not handle translucent parts to not affect blending
}
- 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);
// 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 backPix = QPixmap(dest.size());
- QPainter tmpPainter(&backPix);
+ TQPixmap backPix = TQPixmap(dest.size());
+ TQPainter tmpPainter(&backPix);
tmpPainter.fillRect(0, 0, dest.width(),dest.height(), backgroundBrush());
tmpPainter.end();
- QImage back = backPix.convertToImage();
+ TQImage back = backPix.convertToImage();
blend(dest,back,back);
- pixmap = QPixmap(back);
+ pixmap = TQPixmap(back);
}
-void AquariusButton::mousePressEvent( QMouseEvent *e ){
+void AquariusButton::mousePressEvent( TQMouseEvent *e ){
emit clicked();
}
-void AquariusButton::paintEvent( QPaintEvent *e){
- QPainter tmpPainter(this);
+void AquariusButton::paintEvent( TQPaintEvent *e){
+ TQPainter tmpPainter(this);
tmpPainter.drawPixmap(0,0, pixmap);
}