diff options
Diffstat (limited to 'src/kwin/iaora.cpp')
-rw-r--r-- | src/kwin/iaora.cpp | 222 |
1 files changed, 111 insertions, 111 deletions
diff --git a/src/kwin/iaora.cpp b/src/kwin/iaora.cpp index 887baff..d827141 100644 --- a/src/kwin/iaora.cpp +++ b/src/kwin/iaora.cpp @@ -22,10 +22,10 @@ Boston, MA 02110-1301, USA. */ -#include <qbitmap.h> -#include <qpainter.h> -#include <qimage.h> -#include <qapplication.h> +#include <tqbitmap.h> +#include <tqpainter.h> +#include <tqimage.h> +#include <tqapplication.h> #include <kconfig.h> #include <kpixmap.h> #include <kpixmapeffect.h> @@ -41,8 +41,8 @@ namespace KWinIaOra IaOraHandler::IaOraHandler() { - memset(m_pixmaps, 0, sizeof(QPixmap*)*NumPixmaps*2*2); // set elements to 0 - memset(m_bitmaps, 0, sizeof(QBitmap*)*NumButtonIcons*2); + memset(m_pixmaps, 0, sizeof(TQPixmap*)*NumPixmaps*2*2); // set elements to 0 + memset(m_bitmaps, 0, sizeof(TQBitmap*)*NumButtonIcons*2); reset(0); } @@ -66,7 +66,7 @@ bool IaOraHandler::reset(unsigned long changed) m_titleFontTool = KDecoration::options()->font(true, true); // small // check if we are in reverse layout mode - m_reverse = QApplication::reverseLayout(); + m_reverse = TQApplication::reverseLayout(); // read in the configuration readConfig(); @@ -146,18 +146,18 @@ void IaOraHandler::readConfig() // grab settings m_titleShadow = config.readBoolEntry("TitleShadow", true); - QFontMetrics fm(m_titleFont); // active font = inactive font + TQFontMetrics fm(m_titleFont); // active font = inactive font int titleHeightMin = config.readNumEntry("MinTitleHeight", 22); // The title should strech with bigger font sizes! - m_titleHeight = QMAX(titleHeightMin, fm.height() + 4); // 4 px for the shadow etc. + m_titleHeight = TQMAX(titleHeightMin, fm.height() + 4); // 4 px for the shadow etc. // have an even title/button size so the button icons are fully centered... if ( m_titleHeight%2 == 0) m_titleHeight++; - fm = QFontMetrics(m_titleFontTool); // active font = inactive font + fm = TQFontMetrics(m_titleFontTool); // active font = inactive font int titleHeightToolMin = config.readNumEntry("MinTitleHeightTool", 22); // The title should strech with bigger font sizes! - m_titleHeightTool = QMAX(titleHeightToolMin, fm.height() ); // don't care about the shadow etc. + m_titleHeightTool = TQMAX(titleHeightToolMin, fm.height() ); // don't care about the shadow etc. // have an even title/button size so the button icons are fully centered... if ( m_titleHeightTool%2 == 0) m_titleHeightTool++; @@ -165,157 +165,157 @@ void IaOraHandler::readConfig() m_menuClose = config.readBoolEntry("CloseOnMenuDoubleClick", true); } -QColor IaOraHandler::getBorderColor( KWinIaOra::ColorType type, const bool active) +TQColor IaOraHandler::getBorderColor( KWinIaOra::ColorType type, const bool active) { //Force colors switch (type) { case Border1: - return QColor( "#EFF3F7" ); + return TQColor( "#EFF3F7" ); break; case Border2: - return QColor( "#DFE7EF" ); + return TQColor( "#DFE7EF" ); break; case Border3: - return QColor( "#C7D3DF" ); + return TQColor( "#C7D3DF" ); break; default: - return Qt::black; + return TQt::black; } - return Qt::black; + return TQt::black; } -QColor IaOraHandler::getShadowColor() +TQColor IaOraHandler::getShadowColor() { - QColor col = KDecoration::options()->color(ColorTitleBar, true); - if ( col == QColor("#4964AE") ) + TQColor col = KDecoration::options()->color(ColorTitleBar, true); + if ( col == TQColor("#4964AE") ) { - return QColor( "#000000" ); + return TQColor( "#000000" ); } //default Arctic color - else if ( col == QColor("#8ec7ff") ) + else if ( col == TQColor("#8ec7ff") ) { - return QColor( "#666666" ); + return TQColor( "#666666" ); } - else if ( col == QColor("7BAAE7") ) + else if ( col == TQColor("7BAAE7") ) { - return QColor( "#666666" ); + return TQColor( "#666666" ); } //default Orange color - else if ( col == QColor("#F7B610") ) + else if ( col == TQColor("#F7B610") ) { - return QColor( "#666666" ); + return TQColor( "#666666" ); } //default Gray color - else if ( col == QColor("#c7d3df") ) + else if ( col == TQColor("#c7d3df") ) { - return QColor( "#333333" ); + return TQColor( "#333333" ); } - return QColor( "#666666" ); + return TQColor( "#666666" ); } -QColor IaOraHandler::getGradientColor( KWinIaOra::ColorType type, const bool active) +TQColor IaOraHandler::getGradientColor( KWinIaOra::ColorType type, const bool active) { - QColor col = KDecoration::options()->color(ColorTitleBar, active); + TQColor col = KDecoration::options()->color(ColorTitleBar, active); //default Blue color if ( active ) { - if ( col == QColor("#4964AE") ) + if ( col == TQColor("#4964AE") ) { switch (type) { case TitleGradient1: - return QColor("#8EA2CF"); + return TQColor("#8EA2CF"); break; case TitleGradient2: - return QColor("#415DA6"); + return TQColor("#415DA6"); break; case TitleGradient4: - return QColor("#4964AE"); + return TQColor("#4964AE"); break; case TitleGradient3: - return QColor("#21459C"); + return TQColor("#21459C"); break; default: - return Qt::black; + return TQt::black; } } //default Smooth color - else if ( col == QColor("#7BAAE7") ) + else if ( col == TQColor("#7BAAE7") ) { switch (type) { case TitleGradient1: - return QColor("#ADCFFF"); + return TQColor("#ADCFFF"); break; case TitleGradient2: - return QColor("#5A8AD6"); + return TQColor("#5A8AD6"); break; case TitleGradient4: - return QColor("#7BAAE7"); + return TQColor("#7BAAE7"); break; case TitleGradient3: - return QColor("#427DC6"); + return TQColor("#427DC6"); break; default: - return Qt::black; + return TQt::black; } } //default Orange color - else if ( col == QColor("#F7B610") ) + else if ( col == TQColor("#F7B610") ) { switch (type) { case TitleGradient1: - return QColor("#FFCB10"); + return TQColor("#FFCB10"); break; case TitleGradient2: - return QColor("#ffa208"); + return TQColor("#ffa208"); break; case TitleGradient4: - return QColor("#f7b610"); + return TQColor("#f7b610"); break; case TitleGradient3: - return QColor("#f79600"); + return TQColor("#f79600"); break; default: - return Qt::black; + return TQt::black; } } //default Arctic color - else if ( col == QColor("#8ec7ff") ) + else if ( col == TQColor("#8ec7ff") ) { switch (type) { case TitleGradient1: - return QColor("#c7dfff"); + return TQColor("#c7dfff"); break; case TitleGradient2: - return QColor("#79beff"); + return TQColor("#79beff"); break; case TitleGradient4: - return QColor("#8ec7ff"); + return TQColor("#8ec7ff"); break; case TitleGradient3: - return QColor("#69b6ff"); + return TQColor("#69b6ff"); break; default: - return Qt::black; + return TQt::black; } } //default Gray color - else if ( col == QColor("#c7d3df") ) + else if ( col == TQColor("#c7d3df") ) { switch (type) { case TitleGradient1: - return QColor("#cfd7df"); + return TQColor("#cfd7df"); break; case TitleGradient2: - return QColor("#a6b2c7"); + return TQColor("#a6b2c7"); break; case TitleGradient4: - return QColor("#c7d3df"); + return TQColor("#c7d3df"); break; case TitleGradient3: - return QColor("#8692a6"); + return TQColor("#8692a6"); break; default: - return Qt::black; + return TQt::black; } } else @@ -334,29 +334,29 @@ QColor IaOraHandler::getGradientColor( KWinIaOra::ColorType type, const bool act return col.dark( 130 ); break; default: - return Qt::black; + return TQt::black; } } } else { - if ( col == QColor( "#EFF3F7" ) ) + if ( col == TQColor( "#EFF3F7" ) ) { switch (type) { case TitleGradient1: - return QColor( "#DFE7EF" ); + return TQColor( "#DFE7EF" ); break; case TitleGradient2: - return QColor( "#C7D3DF" ); + return TQColor( "#C7D3DF" ); break; case TitleGradient4: - return QColor( "#CFD7DF" ); + return TQColor( "#CFD7DF" ); break; case TitleGradient3: - return QColor( "#B6C3CF" ); + return TQColor( "#B6C3CF" ); break; default: - return Qt::black; + return TQt::black; } } else @@ -376,15 +376,15 @@ QColor IaOraHandler::getGradientColor( KWinIaOra::ColorType type, const bool act return col.dark( 131 ); break; default: - return Qt::black; + return TQt::black; } } } - return Qt::black; + return TQt::black; } -QColor IaOraHandler::getColor(KWinIaOra::ColorType type, const bool active) +TQColor IaOraHandler::getColor(KWinIaOra::ColorType type, const bool active) { switch (type) { case TitleBorder: @@ -400,28 +400,28 @@ QColor IaOraHandler::getColor(KWinIaOra::ColorType type, const bool active) return getBorderColor( type, active); case ShadeTitleLight: return alphaBlendColors(KDecoration::options()->color(ColorTitleBar, active), - Qt::white, active?205:215); + TQt::white, active?205:215); //todo verify case ShadeTitleDark: return alphaBlendColors(KDecoration::options()->color(ColorTitleBar, active), - Qt::black, active?205:215); + TQt::black, active?205:215); break; case TitleFont: return KDecoration::options()->color(ColorFont, active); default: - return Qt::black; + return TQt::black; } } -void IaOraHandler::pretile( QPixmap *&pix, int size, Qt::Orientation dir ) const +void IaOraHandler::pretile( TQPixmap *&pix, int size, TQt::Orientation dir ) const { - QPixmap *newpix; - QPainter p; + TQPixmap *newpix; + TQPainter p; - if ( dir == Qt::Horizontal ) - newpix = new QPixmap( size, pix->height() ); + if ( dir == TQt::Horizontal ) + newpix = new TQPixmap( size, pix->height() ); else - newpix = new QPixmap( pix->width(), size ); + newpix = new TQPixmap( pix->width(), size ); p.begin( newpix ); p.drawTiledPixmap( newpix->rect(), *pix ) ; @@ -431,24 +431,24 @@ void IaOraHandler::pretile( QPixmap *&pix, int size, Qt::Orientation dir ) const pix = newpix; } -const QPixmap &IaOraHandler::pixmap(Pixmaps type, bool active, bool toolWindow) +const TQPixmap &IaOraHandler::pixmap(Pixmaps type, bool active, bool toolWindow) { if (m_pixmaps[toolWindow][active][type]) return *m_pixmaps[toolWindow][active][type]; - QPixmap *pm = 0; + TQPixmap *pm = 0; switch (type) { case TitleBarTileTop: { - pm = new QPixmap(1, 3); - QPainter painter(pm); + pm = new TQPixmap(1, 3); + TQPainter painter(pm); painter.setPen(getColor(TitleBorder, active)); painter.drawPoint(0,0); painter.fillRect(0,1,pm->width(),pm->height()-1,getColor(TitleGradient1, active)); painter.end(); - pretile(pm, 64, Qt::Horizontal); + pretile(pm, 64, TQt::Horizontal); break; } case TitleBarTile: @@ -456,8 +456,8 @@ const QPixmap &IaOraHandler::pixmap(Pixmaps type, bool active, bool toolWindow) const int titleBarTileHeight = (toolWindow ? m_titleHeightTool : m_titleHeight) + 2; // gradient used as well in TitleBarTileTop as TitleBarTile const int gradientHeight = 2 + titleBarTileHeight; - QPixmap gradient(1, gradientHeight); - QPainter painter(&gradient); + TQPixmap gradient(1, gradientHeight); + TQPainter painter(&gradient); KPixmap tempPixmap; tempPixmap.resize(1, gradientHeight/2); KPixmapEffect::gradient(tempPixmap, @@ -473,7 +473,7 @@ const QPixmap &IaOraHandler::pixmap(Pixmaps type, bool active, bool toolWindow) painter.drawPixmap(0,gradientHeight/2, tempPixmap); painter.end(); - pm = new QPixmap(1, titleBarTileHeight); + pm = new TQPixmap(1, titleBarTileHeight); painter.begin(pm); painter.drawPixmap(0, 0, gradient, 0,2); painter.setPen(getColor(TitleGradient3, active).dark(110) ); @@ -481,7 +481,7 @@ const QPixmap &IaOraHandler::pixmap(Pixmaps type, bool active, bool toolWindow) painter.end(); - pretile(pm, 64, Qt::Horizontal); + pretile(pm, 64, TQt::Horizontal); break; } @@ -490,8 +490,8 @@ const QPixmap &IaOraHandler::pixmap(Pixmaps type, bool active, bool toolWindow) { const int h = 4 + (toolWindow ? m_titleHeightTool : m_titleHeight) + 2; - pm = new QPixmap(3, h); - QPainter painter(pm); + pm = new TQPixmap(3, h); + TQPainter painter(pm); painter.drawTiledPixmap(0,0, 3, 3, pixmap(TitleBarTileTop, active, toolWindow) ); painter.drawTiledPixmap(0,3, 3, h-3, pixmap(TitleBarTile, active, toolWindow) ); @@ -505,8 +505,8 @@ const QPixmap &IaOraHandler::pixmap(Pixmaps type, bool active, bool toolWindow) { const int h = 4 + (toolWindow ? m_titleHeightTool : m_titleHeight) + 2; - pm = new QPixmap(3, h); - QPainter painter(pm); + pm = new TQPixmap(3, h); + TQPainter painter(pm); painter.drawTiledPixmap(0,0, 3, 3, pixmap(TitleBarTileTop, active, toolWindow) ); painter.drawTiledPixmap(0,3, 3, h-3, pixmap(TitleBarTile, active, toolWindow) ); @@ -519,8 +519,8 @@ const QPixmap &IaOraHandler::pixmap(Pixmaps type, bool active, bool toolWindow) case BorderLeftTile: { - pm = new QPixmap(3, 1); - QPainter painter(pm); + pm = new TQPixmap(3, 1); + TQPainter painter(pm); painter.setPen(getColor(Border3, active) ); painter.drawPoint(0, 0); painter.setPen(getColor(Border2, active) ); @@ -529,15 +529,15 @@ const QPixmap &IaOraHandler::pixmap(Pixmaps type, bool active, bool toolWindow) painter.setPen(getColor(Border1, active) ); painter.drawPoint(2,0); painter.end(); - pretile(pm, 64, Qt::Vertical); + pretile(pm, 64, TQt::Vertical); break; } case BorderRightTile: { - pm = new QPixmap(3, 1); - QPainter painter(pm); + pm = new TQPixmap(3, 1); + TQPainter painter(pm); painter.setPen(getColor(Border1, active) ); painter.drawPoint(0,0); painter.setPen(getColor(Border2, active) ); @@ -545,15 +545,15 @@ const QPixmap &IaOraHandler::pixmap(Pixmaps type, bool active, bool toolWindow) painter.setPen(getColor(Border3, active) ); painter.drawPoint(2, 0); painter.end(); - pretile(pm, 64, Qt::Vertical); + pretile(pm, 64, TQt::Vertical); break; } case BorderBottomLeft: { - pm = new QPixmap(3, 3); - QPainter painter(pm); + pm = new TQPixmap(3, 3); + TQPainter painter(pm); painter.drawTiledPixmap(0,0,3,3, pixmap(BorderBottomTile, active, toolWindow) ); painter.setPen(getColor(Border3, active) ); painter.drawLine(0,0, 0,3); @@ -568,8 +568,8 @@ const QPixmap &IaOraHandler::pixmap(Pixmaps type, bool active, bool toolWindow) case BorderBottomRight: { - pm = new QPixmap(3, 3); - QPainter painter(pm); + pm = new TQPixmap(3, 3); + TQPainter painter(pm); painter.drawTiledPixmap(0,0,3,3, pixmap(BorderBottomTile, active, toolWindow) ); painter.setPen(getColor(Border3, active) ); painter.drawLine(2,0, 2,3); @@ -587,8 +587,8 @@ const QPixmap &IaOraHandler::pixmap(Pixmaps type, bool active, bool toolWindow) case BorderBottomTile: default: { - pm = new QPixmap(1, 3); - QPainter painter(pm); + pm = new TQPixmap(1, 3); + TQPainter painter(pm); painter.setPen(getColor(Border1, active) ); painter.drawPoint(0,0); @@ -598,7 +598,7 @@ const QPixmap &IaOraHandler::pixmap(Pixmaps type, bool active, bool toolWindow) painter.drawPoint(0, 2); painter.end(); - pretile(pm, 64, Qt::Horizontal); + pretile(pm, 64, TQt::Horizontal); break; } @@ -608,7 +608,7 @@ const QPixmap &IaOraHandler::pixmap(Pixmaps type, bool active, bool toolWindow) return *pm; } -const QBitmap &IaOraHandler::buttonBitmap(ButtonIcon type, const QSize &size, bool toolWindow) +const TQBitmap &IaOraHandler::buttonBitmap(ButtonIcon type, const TQSize &size, bool toolWindow) { int typeIndex = type; @@ -627,7 +627,7 @@ const QBitmap &IaOraHandler::buttonBitmap(ButtonIcon type, const QSize &size, bo int w = size.width() - reduceW; int h = size.height() - reduceH; - if (m_bitmaps[toolWindow][typeIndex] && m_bitmaps[toolWindow][typeIndex]->size()==QSize(w,h) ) + if (m_bitmaps[toolWindow][typeIndex] && m_bitmaps[toolWindow][typeIndex]->size()==TQSize(w,h) ) return *m_bitmaps[toolWindow][typeIndex]; // no matching pixmap found, create a new one... @@ -635,8 +635,8 @@ const QBitmap &IaOraHandler::buttonBitmap(ButtonIcon type, const QSize &size, bo delete m_bitmaps[toolWindow][typeIndex]; m_bitmaps[toolWindow][typeIndex] = 0; - QBitmap bmp = IconEngine::icon(type /*icon*/, QMIN(w,h) ); - QBitmap *bitmap = new QBitmap(bmp); + TQBitmap bmp = IconEngine::icon(type /*icon*/, TQMIN(w,h) ); + TQBitmap *bitmap = new TQBitmap(bmp); m_bitmaps[toolWindow][typeIndex] = bitmap; return *bitmap; } |