Initial TQt conversion

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/1/head
Slávek Banko 9 years ago
parent 46ccd436f5
commit 6be98faf5b

@ -12,7 +12,7 @@ kwin_DATA = iaora.desktop
kde_module_LTLIBRARIES = kwin3_iaora.la
kwin3_iaora_la_SOURCES = iaora.cpp iaoraclient.cpp iaorabutton.cpp misc.cpp
kwin3_iaora_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
kwin3_iaora_la_LIBADD = $(LIB_KDEUI) -lkdecorations -lqt-mt -lkdecore -lkdefx
kwin3_iaora_la_LIBADD = $(LIB_KDEUI) -lkdecorations $(LIB_QT) $(LIB_KDECORE) -lkdefx
kwin3_iaora_la_METASOURCES = AUTO
DISTCLEANFILES = $(kwin3_iaora_la_METASOURCES)

@ -4,7 +4,7 @@ kde_module_LTLIBRARIES = kwin_iaora_config.la
kwin_iaora_config_la_SOURCES = config.cpp configdialog.ui
kwin_iaora_config_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
kwin_iaora_config_la_LIBADD = $(LIB_KDEUI) -lqt-mt -lkdecore
kwin_iaora_config_la_LIBADD = $(LIB_KDEUI) $(LIB_QT) $(LIB_KDECORE)
METASOURCES = AUTO
noinst_HEADERS = config.h

@ -22,12 +22,12 @@
Boston, MA 02110-1301, USA.
*/
#include <qbuttongroup.h>
#include <qcheckbox.h>
#include <qradiobutton.h>
#include <qslider.h>
#include <qspinbox.h>
#include <qwhatsthis.h>
#include <tqbuttongroup.h>
#include <tqcheckbox.h>
#include <tqradiobutton.h>
#include <tqslider.h>
#include <tqspinbox.h>
#include <tqwhatsthis.h>
#include <kconfig.h>
#include <klocale.h>
@ -36,8 +36,8 @@
#include "config.h"
#include "configdialog.h"
IaOraConfig::IaOraConfig(KConfig* config, QWidget* parent)
: QObject(parent), m_config(0), m_dialog(0)
IaOraConfig::IaOraConfig(KConfig* config, TQWidget* parent)
: TQObject(parent), m_config(0), m_dialog(0)
{
// create the configuration object
m_config = new KConfig("kwiniaorarc");
@ -94,7 +94,7 @@ void IaOraConfig::defaults()
extern "C"
{
KDE_EXPORT QObject* allocate_config(KConfig* config, QWidget* parent) {
KDE_EXPORT TQObject* allocate_config(KConfig* config, TQWidget* parent) {
return (new IaOraConfig(config, parent));
}
}

@ -25,18 +25,18 @@
#ifndef KNIFTYCONFIG_H
#define KNIFTYCONFIG_H
#include <qobject.h>
#include <tqobject.h>
class QButtonGroup;
class QGroupBox;
class TQButtonGroup;
class TQGroupBox;
class KConfig;
class ConfigDialog;
class IaOraConfig : public QObject
class IaOraConfig : public TQObject
{
Q_OBJECT
public:
IaOraConfig(KConfig* config, QWidget* parent);
IaOraConfig(KConfig* config, TQWidget* parent);
~IaOraConfig();
signals:

@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>ConfigDialog</class>
<widget class="QWidget">
<widget class="TQWidget">
<property name="name">
<cstring>ConfigDialog</cstring>
</property>
@ -22,7 +22,7 @@
<property name="margin">
<number>0</number>
</property>
<widget class="QCheckBox">
<widget class="TQCheckBox">
<property name="name">
<cstring>titleShadow</cstring>
</property>
@ -33,7 +33,7 @@
<string>Check this option if you want the titlebar text to have a 3D look with a shadow behind it.</string>
</property>
</widget>
<widget class="QCheckBox">
<widget class="TQCheckBox">
<property name="name">
<cstring>menuClose</cstring>
</property>

@ -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;
}

@ -24,7 +24,7 @@
#ifndef IAORA_H
#define IAORA_H
#include <qfont.h>
#include <tqfont.h>
#include <kdecoration.h>
#include <kdecorationfactory.h>
@ -75,7 +75,7 @@ enum ButtonIcon {
NumButtonIcons
};
class IaOraHandler: public QObject, public KDecorationFactory
class IaOraHandler: public TQObject, public KDecorationFactory
{
Q_OBJECT
public:
@ -86,37 +86,37 @@ public:
virtual KDecoration* createDecoration( KDecorationBridge* );
virtual bool supports( Ability ability );
const QPixmap &pixmap(Pixmaps type, bool active, bool toolWindow);
const QBitmap &buttonBitmap(ButtonIcon type, const QSize &size, bool toolWindow);
const TQPixmap &pixmap(Pixmaps type, bool active, bool toolWindow);
const TQBitmap &buttonBitmap(ButtonIcon type, const TQSize &size, bool toolWindow);
int titleHeight()const { return m_titleHeight; }
int titleHeightTool()const { return m_titleHeightTool; }
const QFont &titleFont() { return m_titleFont; }
const QFont &titleFontTool() { return m_titleFontTool; }
const TQFont &titleFont() { return m_titleFont; }
const TQFont &titleFontTool() { return m_titleFontTool; }
bool titleShadow()const { return m_titleShadow; }
bool menuClose()const { return m_menuClose; }
bool reverseLayout()const { return m_reverse; }
QColor getColor(KWinIaOra::ColorType type, const bool active = true);
QColor getGradientColor( KWinIaOra::ColorType type, const bool active);
QColor getBorderColor( KWinIaOra::ColorType type, const bool active);
QColor getShadowColor();
TQColor getColor(KWinIaOra::ColorType type, const bool active = true);
TQColor getGradientColor( KWinIaOra::ColorType type, const bool active);
TQColor getBorderColor( KWinIaOra::ColorType type, const bool active);
TQColor getShadowColor();
private:
void readConfig();
void pretile(QPixmap *&pix, int size, Qt::Orientation dir) const;
void pretile(TQPixmap *&pix, int size, TQt::Orientation dir) const;
bool m_titleShadow;
bool m_menuClose;
bool m_reverse;
int m_titleHeight;
int m_titleHeightTool;
QFont m_titleFont;
QFont m_titleFontTool;
TQFont m_titleFont;
TQFont m_titleFontTool;
// pixmap cache
QPixmap *m_pixmaps[2][2][NumPixmaps]; // button pixmaps have normal+pressed state...
QBitmap *m_bitmaps[2][NumButtonIcons];
TQPixmap *m_pixmaps[2][2][NumPixmaps]; // button pixmaps have normal+pressed state...
TQBitmap *m_bitmaps[2][NumButtonIcons];
};
IaOraHandler* Handler();

@ -22,12 +22,12 @@
Boston, MA 02110-1301, USA.
*/
#include <qbitmap.h>
#include <qpainter.h>
#include <qpixmap.h>
#include <tqbitmap.h>
#include <tqpainter.h>
#include <tqpixmap.h>
#include <kpixmap.h>
#include <kpixmapeffect.h>
#include <qtimer.h>
#include <tqtimer.h>
#include "iaorabutton.h"
#include "iaorabutton.moc"
@ -110,38 +110,38 @@ void IaOraButton::reset(unsigned long changed)
}
void IaOraButton::enterEvent(QEvent *e)
void IaOraButton::enterEvent(TQEvent *e)
{
QButton::enterEvent(e);
TQButton::enterEvent(e);
hover = true;
repaint(false);
}
void IaOraButton::leaveEvent(QEvent *e)
void IaOraButton::leaveEvent(TQEvent *e)
{
QButton::leaveEvent(e);
TQButton::leaveEvent(e);
hover = false;
repaint(false);
}
void IaOraButton::drawButton(QPainter *painter)
void IaOraButton::drawButton(TQPainter *painter)
{
QRect r(0,0,width(),height());
TQRect r(0,0,width(),height());
bool active = m_client->isActive();
KPixmap tempKPixmap;
QPixmap buffer;
TQPixmap buffer;
buffer.resize(width(), height());
QPainter bP(&buffer);
TQPainter bP(&buffer);
// fake the titlebar background
bP.drawTiledPixmap(0, 0, width(), width(), /*define color*/m_client->getTitleBarTile(active) );
if (type() == MenuButton)
{
QPixmap menuIcon(m_client->icon().pixmap( QIconSet::Small, QIconSet::Normal));
TQPixmap menuIcon(m_client->icon().pixmap( TQIconSet::Small, TQIconSet::Normal));
if (width() < menuIcon.width() || height() < menuIcon.height() ) {
menuIcon.convertFromImage( menuIcon.convertToImage().smoothScale(width(), height()));
}
@ -150,7 +150,7 @@ void IaOraButton::drawButton(QPainter *painter)
else
{
int dX,dY;
const QBitmap &icon = Handler()->buttonBitmap(m_iconType, size(), decoration()->isToolWindow() );
const TQBitmap &icon = Handler()->buttonBitmap(m_iconType, size(), decoration()->isToolWindow() );
dX = r.x()+(r.width()-icon.width())/2;
dY = r.y()+(r.height()-icon.height())/2;
if (isDown() ) {
@ -158,36 +158,36 @@ void IaOraButton::drawButton(QPainter *painter)
}
#if 0
if(!isDown() && Handler()->titleShadow() ) {
QColor shadowColor;
if (qGray(Handler()->getColor(TitleFont,active).rgb()) < 100)
shadowColor = QColor(255, 255, 255);
TQColor shadowColor;
if (tqGray(Handler()->getColor(TitleFont,active).rgb()) < 100)
shadowColor = TQColor(255, 255, 255);
else
shadowColor = QColor(0,0,0);
shadowColor = TQColor(0,0,0);
//bP.setPen(alphaBlendColors(sourfaceTop, shadowColor, 180) );
bP.drawPixmap(dX+1, dY+1, icon);
}
#endif
bP.setPen(Handler()->getColor(TitleFont,hover ? false : active) );
bP.drawPixmap(dX, dY, icon,0,0,icon.width(),icon.height()/2);
bP.setPen(QColor("#CFD7DF") );
bP.setPen(TQColor("#CFD7DF") );
bP.drawPixmap(dX, dY+icon.height()/2, icon,0,icon.height()/2,icon.width(),icon.height());
}
bP.end();
painter->drawPixmap(0, 0, buffer);
}
QBitmap IconEngine::icon(ButtonIcon icon, int size)
TQBitmap IconEngine::icon(ButtonIcon icon, int size)
{
if (size%2 == 0)
--size;
QBitmap bitmap(size,size);
bitmap.fill(Qt::color0);
QPainter p(&bitmap);
TQBitmap bitmap(size,size);
bitmap.fill(TQt::color0);
TQPainter p(&bitmap);
p.setPen(Qt::color1);
p.setPen(TQt::color1);
QRect r = bitmap.rect();
TQRect r = bitmap.rect();
// line widths
int lwTitleBar = 1;
@ -203,8 +203,8 @@ QBitmap IconEngine::icon(ButtonIcon icon, int size)
lwArrow = 2;
}
//QColor col1( "#FFFFFF" );
//QColor col2( "#CFD7DF" );
//TQColor col1( "#FFFFFF" );
//TQColor col2( "#CFD7DF" );
switch(icon) {
case CloseIcon:
@ -430,7 +430,7 @@ QBitmap IconEngine::icon(ButtonIcon icon, int size)
lw2 = 1;
}
int h = QMAX( (r.width()/2), (lw1+2*lw2) );
int h = TQMAX( (r.width()/2), (lw1+2*lw2) );
// horizontal bars
drawObject(p, HorizontalLine, r.x(), r.y(), r.width(), lw1);
@ -453,7 +453,7 @@ QBitmap IconEngine::icon(ButtonIcon icon, int size)
return bitmap;
}
void IconEngine::drawObject(QPainter &p, Object object, int x, int y, int length, int lineWidth)
void IconEngine::drawObject(TQPainter &p, Object object, int x, int y, int length, int lineWidth)
{
switch(object) {
case DiagonalLine:

@ -23,13 +23,13 @@
#ifndef IAORABUTTON_H
#define IAORABUTTON_H
#include <qbutton.h>
#include <qimage.h>
#include <tqbutton.h>
#include <tqimage.h>
#include "iaora.h"
#include <kcommondecoration.h>
class QTimer;
class TQTimer;
namespace KWinIaOra {
@ -47,9 +47,9 @@ public:
private:
void enterEvent(QEvent *e);
void leaveEvent(QEvent *e);
void drawButton(QPainter *painter);
void enterEvent(TQEvent *e);
void leaveEvent(TQEvent *e);
void drawButton(TQPainter *painter);
private:
IaOraClient *m_client;
@ -60,14 +60,14 @@ private:
/**
* This class creates bitmaps which can be used as icons on buttons. The icons
* are "hardcoded".
* Over the previous "Gimp->xpm->QImage->recolor->SmoothScale->QPixmap" solution
* Over the previous "Gimp->xpm->TQImage->recolor->SmoothScale->TQPixmap" solution
* it has the important advantage that icons are more scalable and at the same
* time sharp and not blurred.
*/
class IconEngine
{
public:
static QBitmap icon(ButtonIcon icon, int size);
static TQBitmap icon(ButtonIcon icon, int size);
private:
enum Object {
@ -77,7 +77,7 @@ class IconEngine
CrossDiagonalLine
};
static void drawObject(QPainter &p, Object object, int x, int y, int length, int lineWidth);
static void drawObject(TQPainter &p, Object object, int x, int y, int length, int lineWidth);
};
} // namespace KWinIaOra

@ -24,15 +24,15 @@
#include <klocale.h>
#include <qbitmap.h>
#include <qdatetime.h>
#include <qfontmetrics.h>
#include <qimage.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qpainter.h>
#include <qpixmap.h>
#include <qdesktopwidget.h>
#include <tqbitmap.h>
#include <tqdatetime.h>
#include <tqfontmetrics.h>
#include <tqimage.h>
#include <tqlabel.h>
#include <tqlayout.h>
#include <tqpainter.h>
#include <tqpixmap.h>
#include <tqdesktopwidget.h>
#include "iaoraclient.h"
#include "iaorabutton.h"
@ -43,9 +43,9 @@ namespace KWinIaOra
IaOraClient::IaOraClient(KDecorationBridge* bridge, KDecorationFactory* factory)
: KCommonDecoration (bridge, factory),
s_titleFont(QFont() )
s_titleFont(TQFont() )
{
memset(m_captionPixmaps, 0, sizeof(QPixmap*)*2);
memset(m_captionPixmaps, 0, sizeof(TQPixmap*)*2);
}
IaOraClient::~IaOraClient()
@ -53,17 +53,17 @@ IaOraClient::~IaOraClient()
clearCaptionPixmaps();
}
QString IaOraClient::visibleName() const
TQString IaOraClient::visibleName() const
{
return i18n("Ia Ora");
}
QString IaOraClient::defaultButtonsLeft() const
TQString IaOraClient::defaultButtonsLeft() const
{
return "M";
}
QString IaOraClient::defaultButtonsRight() const
TQString IaOraClient::defaultButtonsRight() const
{
return "IAX";
}
@ -199,7 +199,7 @@ void IaOraClient::init()
KCommonDecoration::init();
}
QRegion IaOraClient::cornerShape(WindowCorner corner)
TQRegion IaOraClient::cornerShape(WindowCorner corner)
{
int w = widget()->width();
int h = widget()->height();
@ -207,37 +207,37 @@ QRegion IaOraClient::cornerShape(WindowCorner corner)
switch (corner) {
case WC_TopLeft:
if (layoutMetric(LM_TitleEdgeLeft) > 0)
return QRegion(0, 0, 1, 1);// + QRegion(1, 0, 1, 1);
return TQRegion(0, 0, 1, 1);// + TQRegion(1, 0, 1, 1);
else
return QRegion();
return TQRegion();
case WC_TopRight:
if (layoutMetric(LM_TitleEdgeRight) > 0)
return QRegion(w-1, 0, 1, 1);// + QRegion(w-2, 0, 1, 1);
return TQRegion(w-1, 0, 1, 1);// + TQRegion(w-2, 0, 1, 1);
else
return QRegion();
return TQRegion();
case WC_BottomLeft:
if (layoutMetric(LM_BorderBottom) > 0)
return QRegion(0, h-1, 1, 1);
return TQRegion(0, h-1, 1, 1);
else
return QRegion();
return TQRegion();
case WC_BottomRight:
if (layoutMetric(LM_BorderBottom) > 0)
return QRegion(w-1, h-1, 1, 1);
return TQRegion(w-1, h-1, 1, 1);
else
return QRegion();
return TQRegion();
default:
return QRegion();
return TQRegion();
}
}
void IaOraClient::paintEvent(QPaintEvent *e)
void IaOraClient::paintEvent(TQPaintEvent *e)
{
QRegion region = e->region();
TQRegion region = e->region();
IaOraHandler *handler = Handler();
@ -247,10 +247,10 @@ void IaOraClient::paintEvent(QPaintEvent *e)
bool active = isActive();
bool toolWindow = isToolWindow();
QPainter painter(widget() );
TQPainter painter(widget() );
// often needed coordinates
QRect r = widget()->rect();
TQRect r = widget()->rect();
int r_w = r.width();
// int r_h = r.height();
@ -272,11 +272,11 @@ void IaOraClient::paintEvent(QPaintEvent *e)
const int sideHeight = borderBottomTop-titleEdgeBottomBottom-1;
QRect Rtitle = QRect(r_x+titleEdgeLeft+buttonsLeftWidth(), r_y+titleEdgeTop,
TQRect Rtitle = TQRect(r_x+titleEdgeLeft+buttonsLeftWidth(), r_y+titleEdgeTop,
r_x2-titleEdgeRight-buttonsRightWidth()-(r_x+titleEdgeLeft+buttonsLeftWidth()),
titleEdgeBottomBottom-(r_y+titleEdgeTop) );
QRect tempRect;
TQRect tempRect;
// topSpacer
if(titleEdgeTop > 0)
@ -310,7 +310,7 @@ void IaOraClient::paintEvent(QPaintEvent *e)
}
// titleSpacer
const QPixmap &caption = captionPixmap();
const TQPixmap &caption = captionPixmap();
if(Rtitle.width() > 0)
{
m_captionRect = captionRect(); // also update m_captionRect!
@ -378,10 +378,10 @@ void IaOraClient::paintEvent(QPaintEvent *e)
}
}
QRect IaOraClient::captionRect() const
TQRect IaOraClient::captionRect() const
{
const QPixmap &caption = captionPixmap();
QRect r = widget()->rect();
const TQPixmap &caption = captionPixmap();
TQRect r = widget()->rect();
const int titleHeight = layoutMetric(LM_TitleHeight);
const int titleEdgeBottom = layoutMetric(LM_TitleEdgeBottom);
@ -408,12 +408,12 @@ QRect IaOraClient::captionRect() const
}
else
tX = titleLeft+(titleWidth- caption.width() )/2;
return QRect(tX, r.top()+titleEdgeTop, tW, titleHeight+titleEdgeBottom);
return TQRect(tX, r.top()+titleEdgeTop, tW, titleHeight+titleEdgeBottom);
}
void IaOraClient::updateCaption()
{
QRect oldCaptionRect = m_captionRect;
TQRect oldCaptionRect = m_captionRect;
if (oldCaption != caption() )
clearCaptionPixmaps();
@ -448,12 +448,12 @@ void IaOraClient::reset( unsigned long changed )
KCommonDecoration::reset(changed);
}
const QPixmap &IaOraClient::getTitleBarTile(bool active) const
const TQPixmap &IaOraClient::getTitleBarTile(bool active) const
{
return Handler()->pixmap(TitleBarTile, active, isToolWindow() );
}
const QPixmap &IaOraClient::captionPixmap() const
const TQPixmap &IaOraClient::captionPixmap() const
{
bool active = isActive();
@ -464,34 +464,34 @@ const QPixmap &IaOraClient::captionPixmap() const
// not found, create new pixmap...
const uint maxCaptionLength = 300; // truncate captions longer than this!
QString c(caption() );
TQString c(caption() );
if (c.length() > maxCaptionLength) {
c.truncate(maxCaptionLength);
c.append(" [...]");
}
QFontMetrics fm(s_titleFont);
TQFontMetrics fm(s_titleFont);
int captionWidth = fm.width(c);
int captionHeight = fm.height();
const int th = layoutMetric(LM_TitleHeight, false) + layoutMetric(LM_TitleEdgeBottom, false);
QPainter painter;
TQPainter painter;
const int thickness = 2;
QPixmap *captionPixmap = new QPixmap(captionWidth+2*thickness, th);
TQPixmap *captionPixmap = new TQPixmap(captionWidth+2*thickness, th);
painter.begin(captionPixmap);
painter.drawTiledPixmap(captionPixmap->rect(),
Handler()->pixmap(TitleBarTile, active, isToolWindow()) );
painter.setFont(s_titleFont);
QPoint tp(1, captionHeight-1);
TQPoint tp(1, captionHeight-1);
// if(Handler()->titleShadow())
// {
// painter.setPen(Handler()->getShadowColor());
// painter.drawText(tp+QPoint(2,2), c);
// painter.drawText(tp+TQPoint(2,2), c);
// }
painter.setPen(Handler()->getColor(TitleFont,active) );
painter.drawText(tp, c );

@ -37,35 +37,35 @@ public:
IaOraClient(KDecorationBridge* bridge, KDecorationFactory* factory);
~IaOraClient();
virtual QString visibleName() const;
virtual QString defaultButtonsLeft() const;
virtual QString defaultButtonsRight() const;
virtual TQString visibleName() const;
virtual TQString defaultButtonsLeft() const;
virtual TQString defaultButtonsRight() const;
virtual bool decorationBehaviour(DecorationBehaviour behaviour) const;
virtual int layoutMetric(LayoutMetric lm, bool respectWindowState = true, const KCommonDecorationButton * = 0) const;
virtual QRegion cornerShape(WindowCorner corner);
virtual TQRegion cornerShape(WindowCorner corner);
virtual KCommonDecorationButton *createButton(ButtonType type);
virtual void init();
virtual void reset( unsigned long changed );
virtual void paintEvent(QPaintEvent *e);
virtual void paintEvent(TQPaintEvent *e);
virtual void updateCaption();
const QPixmap &getTitleBarTile(bool active) const;
const TQPixmap &getTitleBarTile(bool active) const;
private:
QRect captionRect() const;
TQRect captionRect() const;
const QPixmap &captionPixmap() const;
const TQPixmap &captionPixmap() const;
void clearCaptionPixmaps();
mutable QPixmap *m_captionPixmaps[2];
mutable TQPixmap *m_captionPixmaps[2];
QRect m_captionRect;
QString oldCaption;
TQRect m_captionRect;
TQString oldCaption;
// settings...
QFont s_titleFont;
TQFont s_titleFont;
};
} // KwinIaora

@ -23,26 +23,26 @@
#include <kpixmap.h>
#include <kpixmapeffect.h>
#include <qcolor.h>
#include <qimage.h>
#include <qpainter.h>
#include <tqcolor.h>
#include <tqimage.h>
#include <tqpainter.h>
#include "misc.h"
QColor alphaBlendColors(const QColor &bgColor, const QColor &fgColor, const int a)
TQColor alphaBlendColors(const TQColor &bgColor, const TQColor &fgColor, const int a)
{
// normal button...
QRgb rgb = bgColor.rgb();
QRgb rgb_b = fgColor.rgb();
TQRgb rgb = bgColor.rgb();
TQRgb rgb_b = fgColor.rgb();
int alpha = a;
if(alpha>255) alpha = 255;
if(alpha<0) alpha = 0;
int inv_alpha = 255 - alpha;
QColor result = QColor( qRgb(qRed(rgb_b)*inv_alpha/255 + qRed(rgb)*alpha/255,
qGreen(rgb_b)*inv_alpha/255 + qGreen(rgb)*alpha/255,
qBlue(rgb_b)*inv_alpha/255 + qBlue(rgb)*alpha/255) );
TQColor result = TQColor( tqRgb(tqRed(rgb_b)*inv_alpha/255 + tqRed(rgb)*alpha/255,
tqGreen(rgb_b)*inv_alpha/255 + tqGreen(rgb)*alpha/255,
tqBlue(rgb_b)*inv_alpha/255 + tqBlue(rgb)*alpha/255) );
return result;
}

@ -23,6 +23,6 @@
#ifndef MISC_H
#define MISC_H
QColor alphaBlendColors(const QColor &backgroundColor, const QColor &foregroundColor, const int alpha);
TQColor alphaBlendColors(const TQColor &backgroundColor, const TQColor &foregroundColor, const int alpha);
#endif // MISC_H

@ -6,7 +6,7 @@ INCLUDES = $(all_includes)
noinst_HEADERS = ia_ora.h bitmaps.h
kde_style_LTLIBRARIES = ia_ora.la
ia_ora_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
ia_ora_la_LIBADD = -lkdefx -lkdecore -lqt-mt
ia_ora_la_LIBADD = -lkdefx $(LIB_KDECORE) $(LIB_QT)
ia_ora_la_SOURCES = ia_ora.cpp
ia_ora_la_METASOURCES = AUTO

@ -1,7 +1,7 @@
#ifndef __BITMAPS_H
#define __BITMAPS_H
// Fix Qt's wacky image positions
// Fix TQt's wacky image positions
static const char * const hc_minimize_toto_xpm[] = {
"12 12 2 1",
"# c #000000",
@ -38,41 +38,41 @@ static const char * const hc_close_toto_xpm[] = {
"..##....##.."};
static const QCOORD s_arrowUp[]={0,4,5,0,
static const TQCOORD s_arrowUp[]={0,4,5,0,
1,3,6,1,
2,4,7,2,
3,1,8,3,
4,0,9,4};
static const QCOORD s_arrowDown[]={0,0,9,0,
static const TQCOORD s_arrowDown[]={0,0,9,0,
1,1,8,1,
2,2,7,2,
3,3,6,3,
4,4,5,4};
static const QCOORD c_edit_arrow[]={-4,-5, 4, -5,
static const TQCOORD c_edit_arrow[]={-4,-5, 4, -5,
-4 ,-2, 4, -2,
-3 ,-1, 3, -1,
-2 ,0, 2, 0,
-1, 1, 1, 1,
0, 2, 0, 2};
static const QCOORD c_arrow[]={-4 ,-2, 4, -2,
static const TQCOORD c_arrow[]={-4 ,-2, 4, -2,
-3 ,-1, 3, -1,
-2 ,0, 2, 0,
-1, 1, 1, 1,
0, 2, 0, 2};
const QCOORD u_spinarrow[]={ 0,-2, 0,-2, -1,-1, 1,-1, -2,0, 2,0 };
const QCOORD d_spinarrow[]={ -2,-1, 2,-1, -1,0, 1,0, 0,1, 0,1 };
const TQCOORD u_spinarrow[]={ 0,-2, 0,-2, -1,-1, 1,-1, -2,0, 2,0 };
const TQCOORD d_spinarrow[]={ -2,-1, 2,-1, -1,0, 1,0, 0,1, 0,1 };
const QCOORD u_arrow[]={ 0,-2, 0,-2, -1,-1, 1,-1, -2,0, 2,0, -3,1, 3,1 };
const QCOORD d_arrow[]={ -3,-2, 3,-2, -2,-1, 2,-1, -1,0, 1,0, 0,1, 0,1 };
const QCOORD l_arrow[]={ 1,-3, 1,-3, 0,-2, 1,-2, -1,-1, 1,-1, -2,0, 1,0, -1,1, 1,1, 0,2, 1,2, 1,3, 1,3 };
const QCOORD r_arrow[]={ -2,-3, -2,-3, -2,-2, -1,-2, -2,-1, 0,-1, -2,0, 1,0, -2,1, 0,1, -2,2, -1,2, -2,3, -2,3 };
const TQCOORD u_arrow[]={ 0,-2, 0,-2, -1,-1, 1,-1, -2,0, 2,0, -3,1, 3,1 };
const TQCOORD d_arrow[]={ -3,-2, 3,-2, -2,-1, 2,-1, -1,0, 1,0, 0,1, 0,1 };
const TQCOORD l_arrow[]={ 1,-3, 1,-3, 0,-2, 1,-2, -1,-1, 1,-1, -2,0, 1,0, -1,1, 1,1, 0,2, 1,2, 1,3, 1,3 };
const TQCOORD r_arrow[]={ -2,-3, -2,-3, -2,-2, -1,-2, -2,-1, 0,-1, -2,0, 1,0, -2,1, 0,1, -2,2, -1,2, -2,3, -2,3 };
#define QCOORDARRLEN(x) sizeof(x)/(sizeof(QCOORD)*2)
#define TQCOORDARRLEN(x) sizeof(x)/(sizeof(TQCOORD)*2)

File diff suppressed because it is too large Load Diff

@ -33,14 +33,14 @@
#ifndef __MANDRIVASTYLE_H
#define __MANDRIVASTYLE_H
#include <qbitmap.h>
#include <qintdict.h>
#include <tqbitmap.h>
#include <tqintdict.h>
#include <kdrawutil.h>
#include <kpixmap.h>
#include <kstyle.h>
#include <qintcache.h>
#include <tqintcache.h>
class QPopupMenu;
class TQPopupMenu;
class MandrivaStyle : public KStyle
@ -51,77 +51,77 @@ public:
MandrivaStyle();
virtual ~MandrivaStyle();
void polish( QWidget* widget );
void unPolish( QWidget* widget );
void polish( QApplication *app );
void renderMenuBlendPixmap( KPixmap& pix, const QColorGroup &cg,
const QPopupMenu* popup ) const;
void polish( TQWidget* widget );
void unPolish( TQWidget* widget );
void polish( TQApplication *app );
void renderMenuBlendPixmap( KPixmap& pix, const TQColorGroup &cg,
const TQPopupMenu* popup ) const;
void drawKStylePrimitive( KStylePrimitive kpe,
QPainter* p,
const QWidget* widget,
const QRect &r,
const QColorGroup &cg,
TQPainter* p,
const TQWidget* widget,
const TQRect &r,
const TQColorGroup &cg,
SFlags flags = Style_Default,
const QStyleOption& = QStyleOption::Default ) const;
const TQStyleOption& = TQStyleOption::Default ) const;
void drawPrimitive( PrimitiveElement pe,
QPainter* p,
const QRect &r,
const QColorGroup &cg,
TQPainter* p,
const TQRect &r,
const TQColorGroup &cg,
SFlags flags = Style_Default,
const QStyleOption& = QStyleOption::Default ) const;
const TQStyleOption& = TQStyleOption::Default ) const;
void drawControl( ControlElement element,
QPainter *p,
const QWidget *widget,
const QRect &r,
const QColorGroup &cg,
TQPainter *p,
const TQWidget *widget,
const TQRect &r,
const TQColorGroup &cg,
SFlags flags = Style_Default,
const QStyleOption& = QStyleOption::Default ) const;
const TQStyleOption& = TQStyleOption::Default ) const;
void drawControlMask( ControlElement element,
QPainter *p,
const QWidget *widget,
const QRect &r,
const QStyleOption& = QStyleOption::Default ) const;
TQPainter *p,
const TQWidget *widget,
const TQRect &r,
const TQStyleOption& = TQStyleOption::Default ) const;
void drawComplexControl( ComplexControl control,
QPainter *p,
const QWidget *widget,
const QRect &r,
const QColorGroup &cg,
TQPainter *p,
const TQWidget *widget,
const TQRect &r,
const TQColorGroup &cg,
SFlags flags = Style_Default,
SCFlags controls = SC_All,
SCFlags active = SC_None,
const QStyleOption& = QStyleOption::Default ) const;
const TQStyleOption& = TQStyleOption::Default ) const;
void drawComplexControlMask( ComplexControl control,
QPainter *p,
const QWidget *widget,
const QRect &r,
const QStyleOption& = QStyleOption::Default ) const;
TQPainter *p,
const TQWidget *widget,
const TQRect &r,
const TQStyleOption& = TQStyleOption::Default ) const;
int pixelMetric( PixelMetric m,
const QWidget *widget = 0 ) const;
const TQWidget *widget = 0 ) const;
QSize sizeFromContents( ContentsType contents,
const QWidget *widget,
const QSize &contentSize,
const QStyleOption& opt ) const;
TQSize sizeFromContents( ContentsType contents,
const TQWidget *widget,
const TQSize &contentSize,
const TQStyleOption& opt ) const;
QRect subRect( SubRect r,
const QWidget *widget ) const;
TQRect subRect( SubRect r,
const TQWidget *widget ) const;
// Fix Qt3's wacky image positions
QPixmap stylePixmap( StylePixmap stylepixmap,
const QWidget *widget = 0,
const QStyleOption& = QStyleOption::Default ) const;
// Fix TQt3's wacky image positions
TQPixmap stylePixmap( StylePixmap stylepixmap,
const TQWidget *widget = 0,
const TQStyleOption& = TQStyleOption::Default ) const;
QRect querySubControlMetrics( ComplexControl control,
const QWidget* widget,
TQRect querySubControlMetrics( ComplexControl control,
const TQWidget* widget,
SubControl subcontrol,
const QStyleOption& opt = QStyleOption::Default ) const;
const TQStyleOption& opt = TQStyleOption::Default ) const;
protected:
enum Hover
@ -141,36 +141,36 @@ protected:
};
bool eventFilter( QObject *object, QEvent *event );
bool eventFilter( TQObject *object, TQEvent *event );
void renderGradient(QPainter* p,
const QRect& r,
const QColor& ca,
const QColor& cb ,
void renderGradient(TQPainter* p,
const TQRect& r,
const TQColor& ca,
const TQColor& cb ,
bool horizontal) const;
QWidget *hoverWidget;
TQWidget *hoverWidget;
enum Hover hoverControl;
struct MandrivaColorData
{
~MandrivaColorData();
QRgb spotColor;
TQRgb spotColor;
// gradient color
//rename to grey
QColor shades[7];
TQColor shades[7];
// five blue color
QColor blueMdkColor[5];
TQColor blueMdkColor[5];
// button gradients
QColor buttonColor[7];
TQColor buttonColor[7];
QColor radioColor;
TQColor radioColor;
bool isGroup (const QColorGroup &cg)
bool isGroup (const TQColorGroup &cg)
{
return cg.button() == buttonColor[0] && cg.highlight().rgb() == spotColor;
}
@ -184,73 +184,73 @@ private:
MandrivaStyle& operator=( const MandrivaStyle & );
void drawButton( const MandrivaColorData *cdata,
const QRect & r, QPainter *p,
const QColorGroup &cg,
const TQRect & r, TQPainter *p,
const TQColorGroup &cg,
SFlags flags) const;
void drawHandlePoint ( const MandrivaColorData *cdata,
QPainter *p,
TQPainter *p,
int x,
int y) const;
void drawHandle( const MandrivaColorData *cdata,
QPainter *p,
const QRect &r,
const QColorGroup &cg,
TQPainter *p,
const TQRect &r,
const TQColorGroup &cg,
SFlags flags,
const QStyleOption& opt,
const TQStyleOption& opt,
bool drawBorderAndGradient,
bool drawGradient = false ) const;
void drawGroupBox(const MandrivaColorData *cdata,
const QColorGroup & cg,
QPainter *p,
const QRect & r,
const TQColorGroup & cg,
TQPainter *p,
const TQRect & r,
bool active,
bool sunken )const;
void drawLineSeparator(const MandrivaColorData *cdata,
const QColorGroup & cg,
QPainter *p,
const QRect & r,
const TQColorGroup & cg,
TQPainter *p,
const TQRect & r,
bool horiziontal,
bool active,
bool sunken,
bool skipOffset = true) const;
void drawFrame( const MandrivaColorData *cdata,
const QColorGroup & cg,
QPainter *p,
const QRect & r,
const TQColorGroup & cg,
TQPainter *p,
const TQRect & r,
bool active) const;
void drawComboboxArrow( QPainter *p,
const QWidget *widget,
const QRect &r,
const QColorGroup &cg,
void drawComboboxArrow( TQPainter *p,
const TQWidget *widget,
const TQRect &r,
const TQColorGroup &cg,
SFlags flags,
SCFlags active)const;
void drawMandrivaArrow( QPointArray a, QPainter *p,
const QRect &r,
const QColorGroup &cg,
void drawMandrivaArrow( TQPointArray a, TQPainter *p,
const TQRect &r,
const TQColorGroup &cg,
SFlags flags,
const QStyleOption& opt ) const;
const TQStyleOption& opt ) const;
MandrivaColorData *realizeData (const QColorGroup &cg) const;
const MandrivaColorData *lookupData (const QColorGroup &cg) const;
bool isFormWidget(const QWidget* widget) const;
bool excludeColor(const QColor &col, bool active) const;
void getShade (const QColorGroup &cg, int shadenr, QColor &res) const;
void updateHoverControl(const QPoint &pos);
QIntCache<MandrivaColorData> m_dataCache;
MandrivaColorData *realizeData (const TQColorGroup &cg) const;
const MandrivaColorData *lookupData (const TQColorGroup &cg) const;
bool isFormWidget(const TQWidget* widget) const;
bool excludeColor(const TQColor &col, bool active) const;
void getShade (const TQColorGroup &cg, int shadenr, TQColor &res) const;
void updateHoverControl(const TQPoint &pos);
TQIntCache<MandrivaColorData> m_dataCache;
static const double shading[8];
mutable bool formMode;
bool kickerMode;
// For KPE_ListViewBranch
mutable QBitmap *verticalLine;
mutable QBitmap *horizontalLine;
mutable TQBitmap *verticalLine;
mutable TQBitmap *horizontalLine;
// pixmap cache.
enum CacheEntryType
@ -264,14 +264,14 @@ private:
CacheEntryType type;
int width;
int height;
QRgb c1Rgb;
QRgb c2Rgb;
TQRgb c1Rgb;
TQRgb c2Rgb;
bool horizontal;
QPixmap* pixmap;
TQPixmap* pixmap;
CacheEntry(CacheEntryType t, int w, int h, QRgb c1, QRgb c2 = 0,
bool hor = false, QPixmap* p = 0 ):
CacheEntry(CacheEntryType t, int w, int h, TQRgb c1, TQRgb c2 = 0,
bool hor = false, TQPixmap* p = 0 ):
type(t), width(w), height(h), c1Rgb(c1), c2Rgb(c2), horizontal(hor), pixmap(p)
{}
@ -282,7 +282,7 @@ private:
int key()
{
// create an int key from the properties which is used to refer to entries in the QIntCache.
// create an int key from the properties which is used to refer to entries in the TQIntCache.
// the result may not be 100% correct as we don't have so much space in one integer -- use
// == operator after find to make sure we got the right one. :)
return horizontal ^ (type<<1) ^ (width<<5) ^ (height<<10) ^ (c1Rgb<<19) ^ (c2Rgb<<22);
@ -299,7 +299,7 @@ private:
return match;
}
};
QIntCache<CacheEntry> *pixmapCache;
TQIntCache<CacheEntry> *pixmapCache;
};

Loading…
Cancel
Save