diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-06 22:09:18 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-06 22:09:18 +0000 |
commit | d1fb90134ab8504932ee36de6157f846b50f7415 (patch) | |
tree | 191f2f1f1ed00a754687d1258d47f78e99723182 /style/qtcurve.cpp | |
parent | b23b8edce7cbd48165084dbd852875afeb800735 (diff) | |
download | tde-style-qtcurve-d1fb90134ab8504932ee36de6157f846b50f7415.tar.gz tde-style-qtcurve-d1fb90134ab8504932ee36de6157f846b50f7415.zip |
TQt4 port kde-style-qtcurve
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kde-style-qtcurve@1230744 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'style/qtcurve.cpp')
-rw-r--r-- | style/qtcurve.cpp | 2871 |
1 files changed, 1438 insertions, 1433 deletions
diff --git a/style/qtcurve.cpp b/style/qtcurve.cpp index f5dbdbc..6af9f3e 100644 --- a/style/qtcurve.cpp +++ b/style/qtcurve.cpp @@ -1,5 +1,5 @@ /* - QtCurve (C) Craig Drummond, 2003 - 2010 [email protected] + TQtCurve (C) Craig Drummond, 2003 - 2010 [email protected] ---- @@ -53,55 +53,56 @@ KHTML Srollbars: For some reason Scrollbars in KHTML seem to lose the bottom/left pixels. As if KHTML expects -the scrollbar to be 1 pixel smaller/thinner than it actually is. To 'fix' this, the pixelMetric +the scrollbar to be 1 pixel smaller/thinner than it actually is. To 'fix' this, the tqpixelMetric function will return 1 scrollbar with 1 greater than standard for form widgets, or where widget==0L In the CC_ScrollBar draw code, the rects used for each component are shrunk by 1, in the appropriate dimension, so as to draw the scrollbar at the correct size. */ -#include <qtable.h> +#include <tqtable.h> #include "config.h" -#ifndef QTC_QT_ONLY +#ifndef TQTC_TQT_ONLY #include <kdeversion.h> #endif -#include <qsettings.h> -#include <qmenubar.h> -#include <qapplication.h> -#include <qpainter.h> -#include <qpalette.h> -#include <qframe.h> -#include <qpushbutton.h> -#include <qdrawutil.h> -#include <qscrollbar.h> -#include <qtabbar.h> -#include <qtabwidget.h> -#include <qlineedit.h> -#include <qlistview.h> -#include <qtable.h> -#include <qimage.h> -#include <qcombobox.h> -#include <qslider.h> -#include <qcleanuphandler.h> -#include <qcheckbox.h> -#include <qradiobutton.h> -#include <qtoolbutton.h> -#include <qtoolbar.h> -#include <qprogressbar.h> -#include <qheader.h> -#include <qwidgetstack.h> -#include <qsplitter.h> -#include <qtextedit.h> -#include <qlabel.h> -#include <qlistbox.h> -#include <qhbox.h> -#include <qvbox.h> -#include <qtimer.h> -#include <qdatetimeedit.h> -#include <qobjectlist.h> -#include <qpixmapcache.h> -#include <qbitmap.h> -#include <qmainwindow.h> +#include <tqsettings.h> +#include <tqmenubar.h> +#include <tqapplication.h> +#include <tqpainter.h> +#include <tqpalette.h> +#include <tqframe.h> +#include <tqpushbutton.h> +#include <tqdrawutil.h> +#include <tqscrollbar.h> +#include <tqtabbar.h> +#include <tqtabwidget.h> +#include <tqlineedit.h> +#include <tqlistview.h> +#include <tqtable.h> +#include <tqimage.h> +#include <tqcombobox.h> +#include <tqslider.h> +#include <tqcleanuphandler.h> +#include <tqcheckbox.h> +#include <tqradiobutton.h> +#include <tqtoolbutton.h> +#include <tqtoolbar.h> +#include <tqprogressbar.h> +#include <tqheader.h> +#include <tqwidgetstack.h> +#include <tqsplitter.h> +#include <tqtextedit.h> +#include <tqlabel.h> +#include <tqlistbox.h> +#include <tqhbox.h> +#include <tqvbox.h> +#include <tqtimer.h> +#include <tqdatetimeedit.h> +#include <tqobjectlist.h> +#include <tqpixmapcache.h> +#include <tqbitmap.h> +#include <tqmainwindow.h> +#include <tqstyle.h> #include <math.h> #include <stdlib.h> #include <unistd.h> @@ -112,61 +113,61 @@ dimension, so as to draw the scrollbar at the correct size. #define CONFIG_READ #include "config_file.c" #include "pixmaps.h" -#include <qdialog.h> -#include <qprogressdialog.h> -#include <qstyleplugin.h> -#include <qgroupbox.h> -#include <qdir.h> -// Need access to classname from within QMetaObject... +#include <tqdialog.h> +#include <tqprogressdialog.h> +#include <tqstyleplugin.h> +#include <tqgroupbox.h> +#include <tqdir.h> +// Need access to classname from within TQMetaObject... #define private public -#include <qmetaobject.h> +#include <tqmetaobject.h> #include <X11/Xlib.h> #include <X11/Xatom.h> #include "qtc_fixx11h.h" static const Atom constNetMoveResize = XInternAtom(qt_xdisplay(), "_NET_WM_MOVERESIZE", False); -static const QWidget * getTopLevel(const QWidget *widget) +static const TQWidget * getTopLevel(const TQWidget *widget) { - const QWidget *w=widget; + const TQWidget *w=widget; while(w && !w->isTopLevel()) - w=w->parentWidget(); + w=w->tqparentWidget(); return w; } -static void emitMenuSize(const QWidget *widget, unsigned short size) +static void emitMenuSize(const TQWidget *widget, unsigned short size) { - const QWidget *w=getTopLevel(widget); + const TQWidget *w=getTopLevel(widget); if(w) { static const Atom constAtom = XInternAtom(qt_xdisplay(), MENU_SIZE_ATOM, False); - XChangeProperty(qt_xdisplay(), w->parentWidget() ? w->parentWidget()->winId() : w->winId(), + XChangeProperty(qt_xdisplay(), w->tqparentWidget() ? w->tqparentWidget()->winId() : w->winId(), constAtom, XA_CARDINAL, 16, PropModeReplace, (unsigned char *)&size, 1); } } -void setBgndProp(QWidget *widget, unsigned short app) +void setBgndProp(TQWidget *widget, unsigned short app) { - const QWidget *w=getTopLevel(widget); + const TQWidget *w=getTopLevel(widget); if(w) { static const Atom constAtom = XInternAtom(qt_xdisplay(), BGND_ATOM, False); - XChangeProperty(qt_xdisplay(), w->parentWidget() ? w->parentWidget()->winId() : w->winId(), + XChangeProperty(qt_xdisplay(), w->tqparentWidget() ? w->tqparentWidget()->winId() : w->winId(), constAtom, XA_CARDINAL, 16, PropModeReplace, (unsigned char *)&app, 1); } } -static void triggerWMMove(const QWidget *w, const QPoint &p) +static void triggerWMMove(const TQWidget *w, const TQPoint &p) { //...Taken from bespin... - // stolen... errr "adapted!" from QSizeGrip + // stolen... errr "adapted!" from TQSizeGrip XEvent xev; xev.xclient.type = ClientMessage; xev.xclient.message_type = constNetMoveResize; xev.xclient.display = qt_xdisplay(); - xev.xclient.window = w->parentWidget() ? w->parentWidget()->winId() : w->winId(); + xev.xclient.window = w->tqparentWidget() ? w->tqparentWidget()->winId() : w->winId(); xev.xclient.format = 32; xev.xclient.data.l[0] = p.x(); xev.xclient.data.l[1] = p.y(); @@ -183,7 +184,7 @@ static void triggerWMMove(const QWidget *w, const QPoint &p) static const int constMenuPixmapWidth=22; -static bool useQt3Settings() +static bool useTQt3Settings() { static int ver=0; @@ -195,7 +196,7 @@ static bool useQt3Settings() ? atoi(sessionVersion)<4 ? 3 : 4 -#ifdef QTC_DEFAULT_TO_KDE3 +#ifdef TQTC_DEFAULT_TO_KDE3 : 3; #else : getenv("KDE_FULL_SESSION") @@ -207,15 +208,15 @@ static bool useQt3Settings() return 3==ver; } -static QRect adjusted(const QRect r, int xp1, int yp1, int xp2, int yp2) +static TQRect adjusted(const TQRect r, int xp1, int yp1, int xp2, int yp2) { int x1, y1, x2, y2; r.coords(&x1, &y1, &x2, &y2); - return QRect(QPoint(x1 + xp1, y1 + yp1), QPoint(x2 + xp2, y2 + yp2)); + return TQRect(TQPoint(x1 + xp1, y1 + yp1), TQPoint(x2 + xp2, y2 + yp2)); } -static void adjust(QRect &r, int dx1, int dy1, int dx2, int dy2) +static void adjust(TQRect &r, int dx1, int dy1, int dx2, int dy2) { int x1, y1, x2, y2; @@ -227,35 +228,35 @@ static void adjust(QRect &r, int dx1, int dy1, int dx2, int dy2) r.setCoords(x1, y1, x2, y2); } -inline bool isSpecialHover(QWidget *w) +inline bool isSpecialHover(TQWidget *w) { return w && ( -#if QT_VERSION >= 0x030200 - ::qt_cast<QRadioButton *>(w) || - ::qt_cast<QCheckBox *>(w) || +#if 0x039999 >= 0x030200 + ::tqqt_cast<TQRadioButton *>(w) || + ::tqqt_cast<TQCheckBox *>(w) || #endif - ::qt_cast<QScrollBar *>(w) || + ::tqqt_cast<TQScrollBar *>(w) || #if defined KDE_VERSION && KDE_VERSION >= 0x30400 && KDE_VERSION < 0x30500 - ::qt_cast<QToolButton *>(w) || + ::tqqt_cast<TQToolButton *>(w) || #endif - ::qt_cast<QHeader *>(w) || - ::qt_cast<QSpinWidget *>(w) || - ::qt_cast<QComboBox *>(w) || - ::qt_cast<QTabBar *>(w) + ::tqqt_cast<TQHeader *>(w) || + ::tqqt_cast<TQSpinWidget *>(w) || + ::tqqt_cast<TQComboBox *>(w) || + ::tqqt_cast<TQTabBar *>(w) ); } -static QString readEnvPath(const char *env) +static TQString readEnvPath(const char *env) { - QCString path=getenv(env); + TQCString path=getenv(env); - return path.isEmpty() ? QString::null : QFile::decodeName(path); + return path.isEmpty() ? TQString() : TQFile::decodeName(path); } -static QString kdeHome(bool kde3=false) +static TQString kdeHome(bool kde3=false) { - static QString kdeHome[2]; + static TQString kdeHome[2]; // Execute kde-config to ascertain users KDEHOME if(kdeHome[kde3 ? 0 : 1].isEmpty()) @@ -268,7 +269,7 @@ static QString kdeHome(bool kde3=false) while(fgets(line, sizeof line, fpipe)) { - kdeHome[kde3 ? 0 : 1]=QFile::decodeName(line).replace("\n", ""); + kdeHome[kde3 ? 0 : 1]=TQString(TQFile::decodeName(line)).tqreplace("\n", ""); break; } pclose(fpipe); @@ -281,55 +282,55 @@ static QString kdeHome(bool kde3=false) kdeHome[kde3 ? 0 : 1]=readEnvPath(getuid() ? "KDEHOME" : "KDEROOTHOME"); if (kdeHome[kde3 ? 0 : 1].isEmpty()) { - QDir homeDir(QDir::homeDirPath()); - QString kdeConfDir("/.kde"); + TQDir homeDir(TQDir::homeDirPath()); + TQString kdeConfDir("/.kde"); if (!kde3 && homeDir.exists(".kde4")) - kdeConfDir = QString("/.kde4"); - kdeHome[kde3 ? 0 : 1] = QDir::homeDirPath() + kdeConfDir; + kdeConfDir = TQString("/.kde4"); + kdeHome[kde3 ? 0 : 1] = TQDir::homeDirPath() + kdeConfDir; } } return kdeHome[kde3 ? 0 : 1]; } -#ifdef QTC_STYLE_SUPPORT -static void getStyles(const QString &dir, const char *sub, QStringList &styles) +#ifdef TQTC_STYLE_SUPPORT +static void getStyles(const TQString &dir, const char *sub, TQStringList &styles) { - QDir d(dir+sub); + TQDir d(dir+sub); if(d.exists()) { d.setNameFilter(THEME_PREFIX"*"THEME_SUFFIX); - QStringList entries(d.entryList()); - QStringList::ConstIterator it(entries.begin()), + TQStringList entries(d.entryList()); + TQStringList::ConstIterator it(entries.begin()), end(entries.end()); for(; it!=end; ++it) { - QString style((*it).left((*it).findRev(THEME_SUFFIX))); + TQString style((*it).left((*it).tqfindRev(THEME_SUFFIX))); - if(!styles.contains(style)) + if(!styles.tqcontains(style)) styles.append(style); } } } -static void getStyles(const QString &dir, QStringList &styles) +static void getStyles(const TQString &dir, TQStringList &styles) { getStyles(dir, THEME_DIR, styles); getStyles(dir, THEME_DIR4, styles); } -static QString themeFile(const QString &dir, const QString &n, const char *sub) +static TQString themeFile(const TQString &dir, const TQString &n, const char *sub) { - QString name(dir+sub+n+THEME_SUFFIX); + TQString name(dir+sub+n+THEME_SUFFIX); - return QFile(name).exists() ? name : QString(); + return TQFile(name).exists() ? name : TQString(); } -static QString themeFile(const QString &dir, const QString &n, bool kde3=true) +static TQString themeFile(const TQString &dir, const TQString &n, bool kde3=true) { - QString name(themeFile(dir, n, kde3 ? THEME_DIR : THEME_DIR4)); + TQString name(themeFile(dir, n, kde3 ? THEME_DIR : THEME_DIR4)); if(name.isEmpty()) name=themeFile(dir, n, kde3 ? THEME_DIR4 : THEME_DIR); @@ -337,45 +338,45 @@ static QString themeFile(const QString &dir, const QString &n, bool kde3=true) } #endif -class QtCurveStylePlugin : public QStylePlugin +class TQtCurveStylePlugin : public TQStylePlugin { public: - QtCurveStylePlugin() : QStylePlugin() { } + TQtCurveStylePlugin() : TQStylePlugin() { } - QStringList keys() const + TQStringList keys() const { - QStringList list; - list << "QtCurve"; + TQStringList list; + list << "TQtCurve"; -#ifdef QTC_STYLE_SUPPORT - getStyles(kdeHome(useQt3Settings()), list); - getStyles(kdeHome(!useQt3Settings()), list); - getStyles(KDE_PREFIX(useQt3Settings() ? 3 : 4), list); - getStyles(KDE_PREFIX(useQt3Settings() ? 4 : 3), list); +#ifdef TQTC_STYLE_SUPPORT + getStyles(kdeHome(useTQt3Settings()), list); + getStyles(kdeHome(!useTQt3Settings()), list); + getStyles(KDE_PREFIX(useTQt3Settings() ? 3 : 4), list); + getStyles(KDE_PREFIX(useTQt3Settings() ? 4 : 3), list); #endif return list; } - QStyle * create(const QString &s) + TQStyle * create(const TQString &s) { return "qtcurve"==s.lower() - ? new QtCurveStyle -#ifdef QTC_STYLE_SUPPORT - : 0==s.find(THEME_PREFIX) - ? new QtCurveStyle(s) + ? new TQtCurveStyle +#ifdef TQTC_STYLE_SUPPORT + : 0==s.tqfind(THEME_PREFIX) + ? new TQtCurveStyle(s) #endif : 0; } }; -Q_EXPORT_PLUGIN(QtCurveStylePlugin) +TQ_EXPORT_PLUGIN(TQtCurveStylePlugin) #define SKIP_TASKBAR (APP_SKIP_TASKBAR==itsThemedApp || APP_KPRINTER==itsThemedApp || APP_KDIALOG==itsThemedApp) -#if defined QTC_QT_ONLY || !defined KDE_VERSION || KDE_VERSION >= 0x30200 -#include <qfile.h> +#if defined TQTC_TQT_ONLY || !defined KDE_VERSION || KDE_VERSION >= 0x30200 +#include <tqfile.h> #endif #define NO_SECT -1 @@ -392,19 +393,19 @@ Q_EXPORT_PLUGIN(QtCurveStylePlugin) #define DW_BGND 105 -#if defined QTC_QT_ONLY || !defined KDE_VERSION || KDE_VERSION >= 0x30200 +#if defined TQTC_TQT_ONLY || !defined KDE_VERSION || KDE_VERSION >= 0x30200 // Try to read $KDEHOME/share/config/kickerrc to find out if kicker is transparent... static bool kickerIsTrans() { - QString cfgFileName(kdeHome(true)+"/share/config/kickerrc"); + TQString cfgFileName(kdeHome(true)+"/share/config/kickerrc"); bool trans(false); - QFile cfgFile(cfgFileName); + TQFile cfgFile(cfgFileName); if (cfgFile.open(IO_ReadOnly)) { - QTextStream stream(&cfgFile); - QString line; + TQTextStream stream(&cfgFile); + TQString line; bool stop(false), inGen(false); @@ -414,16 +415,16 @@ static bool kickerIsTrans() if(inGen) { - if(0==line.find("Transparent=", false)) // Found it! + if(0==line.tqfind("Transparent=", false)) // Found it! { - if(-1!=line.find("true", false)) + if(-1!=line.tqfind("true", false)) trans=true; stop=true; } - else if(line[0]==QChar('[')) // Then wasn't in General section... + else if(line[0]==TQChar('[')) // Then wasn't in General section... stop=true; } - else if(0==line.find("[General]", false)) + else if(0==line.tqfind("[General]", false)) inGen=true; } cfgFile.close(); @@ -433,13 +434,13 @@ static bool kickerIsTrans() } #endif -static bool isKhtmlWidget(const QWidget *w, int level=1) +static bool isKhtmlWidget(const TQWidget *w, int level=1) { return w && ((w->name() && 0==strcmp(w->name(), "__khtml")) || - (level && isKhtmlWidget(w->parentWidget(), --level))); + (level && isKhtmlWidget(w->tqparentWidget(), --level))); } -static bool isKhtmlFormWidget(const QWidget *widget) +static bool isKhtmlFormWidget(const TQWidget *widget) { if(isKhtmlWidget(widget)) return true; @@ -447,19 +448,19 @@ static bool isKhtmlFormWidget(const QWidget *widget) // Copied from Keramik... //Form widgets are in the KHTMLView, but that has 2 further inner levels - //of widgets - QClipperWidget, and outside of that, QViewportWidget - QWidget *potentialClipPort(widget ? widget->parentWidget() : 0L); + //of widgets - TQClipperWidget, and outside of that, TQViewportWidget + TQWidget *potentialClipPort(widget ? widget->tqparentWidget() : 0L); if (!potentialClipPort || potentialClipPort->isTopLevel()) return false; - QWidget *potentialViewPort(potentialClipPort->parentWidget()); + TQWidget *potentialViewPort(potentialClipPort->tqparentWidget()); if (!potentialViewPort || potentialViewPort->isTopLevel() || qstrcmp(potentialViewPort->name(), "qt_viewport")) return false; - QWidget *potentialKHTML(potentialViewPort->parentWidget()); + TQWidget *potentialKHTML(potentialViewPort->tqparentWidget()); if (!potentialKHTML || potentialKHTML->isTopLevel() || qstrcmp(potentialKHTML->className(), "KHTMLView")) @@ -468,22 +469,22 @@ static bool isKhtmlFormWidget(const QWidget *widget) return true; } -static bool inStackWidget(const QWidget *w) +static bool inStackWidget(const TQWidget *w) { while(w) { - if(::qt_cast<const QTabWidget *>(w)) + if(::tqqt_cast<const TQTabWidget *>(w)) return true; - w=w->parentWidget(); + w=w->tqparentWidget(); } return false; } -static void setRgb(QColor *col, const QStringList &rgb) +static void setRgb(TQColor *col, const TQStringList &rgb) { if(3==rgb.size()) - *col=QColor(rgb[0].toInt(), rgb[1].toInt(), rgb[2].toInt()); + *col=TQColor(rgb[0].toInt(), rgb[1].toInt(), rgb[2].toInt()); } struct KDESettings @@ -494,7 +495,7 @@ struct KDESettings } bool inactiveHighlight; - QColor hover, + TQColor hover, focus; }; @@ -510,40 +511,40 @@ static bool readKdeGlobals() return false; - QColor highlight(QApplication::palette().active().highlight()); + TQColor highlight(TQApplication::tqpalette().active().highlight()); bool inactiveEnabled(false), changeSelectionColor(false), - useQt3(useQt3Settings()); - QFile f(kdeHome(useQt3)+"/share/config/kdeglobals"); + useTQt3(useTQt3Settings()); + TQFile f(kdeHome(useTQt3)+"/share/config/kdeglobals"); lastCheck=now; - if(useQt3) + if(useTQt3) kdeSettings.hover=kdeSettings.focus=highlight; else { - kdeSettings.hover=QColor(119, 183, 255); - kdeSettings.focus=QColor( 43, 116, 199); + kdeSettings.hover=TQColor(119, 183, 255); + kdeSettings.focus=TQColor( 43, 116, 199); } if(f.open(IO_ReadOnly)) { - QTextStream in(&f); + TQTextStream in(&f); bool inPal(false), inInactive(false), - donePal(useQt3), + donePal(useTQt3), doneInactive(false); while (!in.atEnd() && (!donePal || !doneInactive)) { - QString line(in.readLine()); + TQString line(in.readLine()); if(inPal) { - if(0==line.find("DecorationFocus=", false)) - setRgb(&kdeSettings.focus, QStringList::split(",", line.mid(16))); - else if(0==line.find("DecorationHover=", false)) - setRgb(&kdeSettings.hover, QStringList::split(",", line.mid(16))); - else if (-1!=line.find('[')) + if(0==line.tqfind("DecorationFocus=", false)) + setRgb(&kdeSettings.focus, TQStringList::split(",", line.mid(16))); + else if(0==line.tqfind("DecorationHover=", false)) + setRgb(&kdeSettings.hover, TQStringList::split(",", line.mid(16))); + else if (-1!=line.tqfind('[')) { donePal=true; inPal=false; @@ -551,20 +552,20 @@ static bool readKdeGlobals() } else if(inInactive) { - if(0==line.find("ChangeSelectionColor=", false)) - changeSelectionColor=line.find("=true"); - else if(0==line.find("Enable=", false)) - inactiveEnabled=line.find("=true"); - else if (-1!=line.find('[')) + if(0==line.tqfind("ChangeSelectionColor=", false)) + changeSelectionColor=line.tqfind("=true"); + else if(0==line.tqfind("Enable=", false)) + inactiveEnabled=line.tqfind("=true"); + else if (-1!=line.tqfind('[')) { doneInactive=true; inInactive=false; } } if(!inPal && !inInactive) - if(!useQt3 && 0==line.find("[Colors:Button]", false)) + if(!useTQt3 && 0==line.tqfind("[Colors:Button]", false)) inPal=true; - else if(!useQt3 && 0==line.find("[ColorEffects:Inactive]", false)) + else if(!useTQt3 && 0==line.tqfind("[ColorEffects:Inactive]", false)) inInactive=true; } f.close(); @@ -574,8 +575,8 @@ static bool readKdeGlobals() return true; } -static void drawLines(QPainter *p, const QRect &r, bool horiz, int nLines, int offset, - const QColor *cols, int startOffset, int dark, ELine type) +static void drawLines(TQPainter *p, const TQRect &r, bool horiz, int nLines, int offset, + const TQColor *cols, int startOffset, int dark, ELine type) { int space((nLines*2)+(LINE_DASHES!=type ? (nLines-1) : 0)), step(LINE_DASHES!=type ? 3 : 2), @@ -624,8 +625,8 @@ static void drawLines(QPainter *p, const QRect &r, bool horiz, int nLines, int o } } -static void drawDots(QPainter *p, const QRect &r, bool horiz, int nLines, int offset, - const QColor *cols, int startOffset, int dark) +static void drawDots(TQPainter *p, const TQRect &r, bool horiz, int nLines, int offset, + const TQColor *cols, int startOffset, int dark) { int space((nLines*2)+(nLines-1)), x(horiz ? r.x() : r.x()+((r.width()-space)>>1)), @@ -665,11 +666,11 @@ static void drawDots(QPainter *p, const QRect &r, bool horiz, int nLines, int of } } -static bool onToolBar(QWidget *widget, int l=0) +static bool onToolBar(TQWidget *widget, int l=0) { - return l<3 && widget && widget->parentWidget() - ? widget->parentWidget()->inherits("QToolBar") || - onToolBar(widget->parentWidget(), ++l) + return l<3 && widget && widget->tqparentWidget() + ? widget->tqparentWidget()->inherits(TQTOOLBAR_OBJECT_NAME_STRING) || + onToolBar(widget->tqparentWidget(), ++l) : false; } @@ -681,35 +682,35 @@ enum ECacheFlags CACHE_COL_SEL_TAB }; -static QString createKey(int size, QRgb color, bool horiz, int app, ECacheFlags flags) +static TQString createKey(int size, TQRgb color, bool horiz, int app, ECacheFlags flags) { - QString key; + TQString key; - QTextOStream(&key) << size << '-' << color << '-' << horiz << '-' << app << '-' << flags; + TQTextOStream(&key) << size << '-' << color << '-' << horiz << '-' << app << '-' << flags; return key; } -static QString createKey(QRgb color, char type='p') +static TQString createKey(TQRgb color, char type='p') { - QString key; + TQString key; - QTextOStream(&key) << type << color; + TQTextOStream(&key) << type << color; return key; } -static QString createKey(QRgb color, EPixmap p) +static TQString createKey(TQRgb color, EPixmap p) { - QString key; + TQString key; - QTextOStream(&key) << 'P' << color << p; + TQTextOStream(&key) << 'P' << color << p; return key; } #ifdef SET_MDI_WINDOW_BUTTON_POSITIONS -static void parseWindowLine(const QString &line, QValueList<int> &data) +static void parseWindowLine(const TQString &line, TQValueList<int> &data) { int len(line.length()); @@ -717,55 +718,55 @@ static void parseWindowLine(const QString &line, QValueList<int> &data) switch(line[i].latin1()) { case 'M': - data.append(QStyle::SC_TitleBarSysMenu); + data.append(TQStyle::SC_TitleBarSysMenu); break; case '_': data.append(WINDOWTITLE_SPACER); break; // case 'H': -// data.append(QStyle::SC_TitleBarContextHelpButton); +// data.append(TQStyle::SC_TitleBarContextHelpButton); // break; case 'L': - data.append(QStyle::SC_TitleBarShadeButton); + data.append(TQStyle::SC_TitleBarShadeButton); break; case 'I': - data.append(QStyle::SC_TitleBarMinButton); + data.append(TQStyle::SC_TitleBarMinButton); break; case 'A': - data.append(QStyle::SC_TitleBarMaxButton); + data.append(TQStyle::SC_TitleBarMaxButton); break; case 'X': - data.append(QStyle::SC_TitleBarCloseButton); + data.append(TQStyle::SC_TitleBarCloseButton); default: break; } } #endif -static bool isCheckBoxOfGroupBox(const QObject *w) +static bool isCheckBoxOfGroupBox(const TQObject *w) { - return w && w->parent() && - ::qt_cast<QCheckBox *>(w) && ::qt_cast<QGroupBox *>(w->parent()) && + return w && w->tqparent() && + ::tqqt_cast<TQCheckBox *>(w) && ::tqqt_cast<TQGroupBox *>(w->tqparent()) && !qstrcmp(w->name(), "qt_groupbox_checkbox"); } -static void drawArrow(QPainter *p, const QRect &r, const QColor &col, QStyle::PrimitiveElement pe, const Options &opts, bool small=false) +static void drawArrow(TQPainter *p, const TQRect &r, const TQColor &col, TQStyle::TQ_PrimitiveElement pe, const Options &opts, bool small=false) { - QPointArray a; + TQPointArray a; if(small) switch(pe) { - case QStyle::PE_ArrowUp: + case TQStyle::PE_ArrowUp: a.setPoints(opts.vArrows ? 6 : 3, 2,0, 0,-2, -2,0, -2,1, 0,-1, 2,1); break; - case QStyle::PE_ArrowDown: + case TQStyle::PE_ArrowDown: a.setPoints(opts.vArrows ? 6 : 3, 2,0, 0,2, -2,0, -2,-1, 0,1, 2,-1); break; - case QStyle::PE_ArrowRight: + case TQStyle::PE_ArrowRight: a.setPoints(opts.vArrows ? 6 : 3, 0,-2, 2,0, 0,2, -1,2, 1,0 -1,-2); break; - case QStyle::PE_ArrowLeft: + case TQStyle::PE_ArrowLeft: a.setPoints(opts.vArrows ? 6 : 3, 0,-2, -2,0, 0,2, 1,2, -1,0, 1,-2); break; default: @@ -774,16 +775,16 @@ static void drawArrow(QPainter *p, const QRect &r, const QColor &col, QStyle::Pr else // Large arrows... switch(pe) { - case QStyle::PE_ArrowUp: + case TQStyle::PE_ArrowUp: a.setPoints(opts.vArrows ? 8 : 3, 3,1, 0,-2, -3,1, -3,2, -2,2, 0,0, 2,2, 3,2); break; - case QStyle::PE_ArrowDown: + case TQStyle::PE_ArrowDown: a.setPoints(opts.vArrows ? 8 : 3, 3,-1, 0,2, -3,-1, -3,-2, -2,-2, 0,0, 2,-2, 3,-2); break; - case QStyle::PE_ArrowRight: + case TQStyle::PE_ArrowRight: a.setPoints(opts.vArrows ? 8 : 3, -1,-3, 2,0, -1,3, -2,3, -2,2, 0,0, -2,-2, -2,-3); break; - case QStyle::PE_ArrowLeft: + case TQStyle::PE_ArrowLeft: a.setPoints(opts.vArrows ? 8 : 3, 1,-3, -2,0, 1,3, 2,3, 2,2, 0,0, 2,-2, 2,-3); break; default: @@ -801,10 +802,10 @@ static void drawArrow(QPainter *p, const QRect &r, const QColor &col, QStyle::Pr p->restore(); } -#ifdef QTC_STYLE_SUPPORT -QtCurveStyle::QtCurveStyle(const QString &name) +#ifdef TQTC_STYLE_SUPPORT +TQtCurveStyle::TQtCurveStyle(const TQString &name) #else -QtCurveStyle::QtCurveStyle() +TQtCurveStyle::TQtCurveStyle() #endif : BASE_STYLE(AllowMenuTransparency, WindowsStyleScrollBar), itsSliderCols(0L), @@ -819,7 +820,7 @@ QtCurveStyle::QtCurveStyle() itsMdiColors(0L), itsThemedApp(APP_OTHER), itsPixmapCache(150000, 499), -#if defined QTC_QT_ONLY || !defined KDE_VERSION || KDE_VERSION >= 0x30200 +#if defined TQTC_TQT_ONLY || !defined KDE_VERSION || KDE_VERSION >= 0x30200 itsIsTransKicker(false), #endif itsHover(HOVER_NONE), @@ -834,41 +835,41 @@ QtCurveStyle::QtCurveStyle() itsDragWidget(0L), itsDragWidgetHadMouseTracking(false) { -#ifdef QTC_STYLE_SUPPORT - QString rcFile; +#ifdef TQTC_STYLE_SUPPORT + TQString rcFile; if(!name.isEmpty()) { - rcFile=themeFile(kdeHome(), name, useQt3Settings()); + rcFile=themeFile(kdeHome(), name, useTQt3Settings()); if(rcFile.isEmpty()) { rcFile=themeFile(kdeHome(true), name); if(rcFile.isEmpty()) { - rcFile=themeFile(KDE_PREFIX(useQt3Settings() ? 3 : 4), name, useQt3Settings()); + rcFile=themeFile(KDE_PREFIX(useTQt3Settings() ? 3 : 4), name, useTQt3Settings()); if(rcFile.isEmpty()) - rcFile=themeFile(KDE_PREFIX(useQt3Settings() ? 4 : 3), name, !useQt3Settings()); + rcFile=themeFile(KDE_PREFIX(useTQt3Settings() ? 4 : 3), name, !useTQt3Settings()); } } } readConfig(rcFile, &opts); #else - readConfig(QString(), &opts); + readConfig(TQString(), &opts); #endif if(FRAME_LINE==opts.groupBox || opts.gbLabel&GB_LBL_BOLD) opts.groupBox=FRAME_NONE; - opts.contrast=QSettings().readNumEntry("/Qt/KDE/contrast", DEFAULT_CONTRAST); + opts.contrast=TQSettings().readNumEntry("/TQt/KDE/contrast", DEFAULT_CONTRAST); if(opts.contrast<0 || opts.contrast>10) opts.contrast=DEFAULT_CONTRAST; itsPixmapCache.setAutoDelete(true); - shadeColors(QApplication::palette().active().highlight(), itsHighlightCols); - shadeColors(QApplication::palette().active().background(), itsBackgroundCols); - shadeColors(QApplication::palette().active().button(), itsButtonCols); + shadeColors(TQApplication::tqpalette().active().highlight(), itsHighlightCols); + shadeColors(TQApplication::tqpalette().active().background(), itsBackgroundCols); + shadeColors(TQApplication::tqpalette().active().button(), itsButtonCols); setDecorationColors(true); @@ -884,7 +885,7 @@ QtCurveStyle::QtCurveStyle() case SHADE_BLEND_SELECTED: case SHADE_CUSTOM: if(!itsSliderCols) - itsSliderCols=new QColor [TOTAL_SHADES+1]; + itsSliderCols=new TQColor [TOTAL_SHADES+1]; shadeColors(SHADE_BLEND_SELECTED==opts.shadeSliders ? midColor(itsHighlightCols[ORIGINAL_SHADE], itsButtonCols[ORIGINAL_SHADE]) @@ -899,7 +900,7 @@ QtCurveStyle::QtCurveStyle() itsDefBtnCols=itsHighlightCols; break; case IND_TINT: - itsDefBtnCols=new QColor [TOTAL_SHADES+1]; + itsDefBtnCols=new TQColor [TOTAL_SHADES+1]; shadeColors(tint(itsButtonCols[ORIGINAL_SHADE], itsHighlightCols[ORIGINAL_SHADE], DEF_BNT_TINT), itsDefBtnCols); break; @@ -910,7 +911,7 @@ QtCurveStyle::QtCurveStyle() itsDefBtnCols=itsSliderCols; else { - itsDefBtnCols=new QColor [TOTAL_SHADES+1]; + itsDefBtnCols=new TQColor [TOTAL_SHADES+1]; shadeColors(midColor(itsHighlightCols[ORIGINAL_SHADE], itsButtonCols[ORIGINAL_SHADE]), itsDefBtnCols); } @@ -938,7 +939,7 @@ QtCurveStyle::QtCurveStyle() break; } if(!itsComboBtnCols) - itsComboBtnCols=new QColor [TOTAL_SHADES+1]; + itsComboBtnCols=new TQColor [TOTAL_SHADES+1]; shadeColors(SHADE_BLEND_SELECTED==opts.comboBtn ? midColor(itsHighlightCols[ORIGINAL_SHADE], itsButtonCols[ORIGINAL_SHADE]) @@ -950,7 +951,7 @@ QtCurveStyle::QtCurveStyle() { case SHADE_DARKEN: if(!itsSortedLvColors) - itsSortedLvColors=new QColor [TOTAL_SHADES+1]; + itsSortedLvColors=new TQColor [TOTAL_SHADES+1]; shadeColors(shade(opts.lvButton ? itsButtonCols[ORIGINAL_SHADE] : itsBackgroundCols[ORIGINAL_SHADE], LV_HEADER_DARK_FACTOR), itsSortedLvColors); break; default: @@ -982,7 +983,7 @@ QtCurveStyle::QtCurveStyle() break; } if(!itsSortedLvColors) - itsSortedLvColors=new QColor [TOTAL_SHADES+1]; + itsSortedLvColors=new TQColor [TOTAL_SHADES+1]; shadeColors(SHADE_BLEND_SELECTED==opts.sortedLv ? midColor(itsHighlightCols[ORIGINAL_SHADE], (opts.lvButton ? itsButtonCols[ORIGINAL_SHADE] : itsBackgroundCols[ORIGINAL_SHADE])) @@ -998,7 +999,7 @@ QtCurveStyle::QtCurveStyle() break; case SHADE_DARKEN: if(!itsCheckRadioSelCols) - itsCheckRadioSelCols=new QColor [TOTAL_SHADES+1]; + itsCheckRadioSelCols=new TQColor [TOTAL_SHADES+1]; shadeColors(shade(itsButtonCols[ORIGINAL_SHADE], LV_HEADER_DARK_FACTOR), itsCheckRadioSelCols); break; case SHADE_SELECTED: @@ -1014,7 +1015,7 @@ QtCurveStyle::QtCurveStyle() else { if(!itsCheckRadioSelCols) - itsCheckRadioSelCols=new QColor [TOTAL_SHADES+1]; + itsCheckRadioSelCols=new TQColor [TOTAL_SHADES+1]; shadeColors(opts.customCrBgndColor, itsCheckRadioSelCols); } break; @@ -1028,7 +1029,7 @@ QtCurveStyle::QtCurveStyle() else { if(!itsCheckRadioSelCols) - itsCheckRadioSelCols=new QColor [TOTAL_SHADES+1]; + itsCheckRadioSelCols=new TQColor [TOTAL_SHADES+1]; shadeColors(midColor(itsHighlightCols[ORIGINAL_SHADE], itsButtonCols[ORIGINAL_SHADE]), itsCheckRadioSelCols); } } @@ -1053,7 +1054,7 @@ QtCurveStyle::QtCurveStyle() else { if(!itsProgressCols) - itsProgressCols=new QColor [TOTAL_SHADES+1]; + itsProgressCols=new TQColor [TOTAL_SHADES+1]; shadeColors(opts.customProgressColor, itsProgressCols); } break; @@ -1067,19 +1068,19 @@ QtCurveStyle::QtCurveStyle() else { if(!itsProgressCols) - itsProgressCols=new QColor [TOTAL_SHADES+1]; + itsProgressCols=new TQColor [TOTAL_SHADES+1]; shadeColors(midColor(itsHighlightCols[ORIGINAL_SHADE], itsBackgroundCols[ORIGINAL_SHADE]), itsProgressCols); } } - setMenuColors(QApplication::palette().active()); + setMenuColors(TQApplication::tqpalette().active()); if(USE_LIGHTER_POPUP_MENU) itsLighterPopupMenuBgndCol=shade(itsBackgroundCols[ORIGINAL_SHADE], TO_FACTOR(opts.lighterPopupMenuBgnd)); if ((SHADE_CUSTOM==opts.shadeMenubars || SHADE_BLEND_SELECTED==opts.shadeMenubars || SHADE_SELECTED==opts.shadeMenubars) && - "soffice.bin"==QString(qApp->argv()[0]) && TOO_DARK(SHADE_CUSTOM==opts.shadeMenubars + "soffice.bin"==TQString(tqApp->argv()[0]) && TOO_DARK(SHADE_CUSTOM==opts.shadeMenubars ? opts.customMenubarsColor : itsHighlightCols[ORIGINAL_SHADE])) opts.shadeMenubars=SHADE_DARKEN; @@ -1087,12 +1088,12 @@ QtCurveStyle::QtCurveStyle() switch(opts.shadeCheckRadio) { default: - itsCheckRadioCol=opts.crButton ? QApplication::palette().active().buttonText() - : QApplication::palette().active().text(); + itsCheckRadioCol=opts.crButton ? TQApplication::tqpalette().active().buttonText() + : TQApplication::tqpalette().active().text(); break; case SHADE_BLEND_SELECTED: case SHADE_SELECTED: - itsCheckRadioCol=QApplication::palette().active().highlight(); + itsCheckRadioCol=TQApplication::tqpalette().active().highlight(); break; case SHADE_CUSTOM: itsCheckRadioCol=opts.customCheckRadioColor; @@ -1100,14 +1101,14 @@ QtCurveStyle::QtCurveStyle() if (opts.animatedProgress) { - itsAnimationTimer = new QTimer(this); - connect(itsAnimationTimer, SIGNAL(timeout()), this, SLOT(updateProgressPos())); + itsAnimationTimer = new TQTimer(this); + connect(itsAnimationTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(updateProgressPos())); } setSbType(); } -QtCurveStyle::~QtCurveStyle() +TQtCurveStyle::~TQtCurveStyle() { if(itsSidebarButtonsCols!=itsSliderCols && itsSidebarButtonsCols!=itsDefBtnCols) @@ -1138,11 +1139,11 @@ QtCurveStyle::~QtCurveStyle() delete itsMactorPal; } -static QString getFile(const QString &f) +static TQString getFile(const TQString &f) { - QString d(f); + TQString d(f); - int slashPos(d.findRev('/')); + int slashPos(d.tqfindRev('/')); if(slashPos!=-1) d.remove(0, slashPos+1); @@ -1150,24 +1151,24 @@ static QString getFile(const QString &f) return d; } -void QtCurveStyle::polish(QApplication *app) +void TQtCurveStyle::polish(TQApplication *app) { - QString appName(getFile(app->argv()[0])); + TQString appName(getFile(app->argv()[0])); - if(NULL!=getenv("QTCURVE_DEBUG")) - std::cout << "QtCurve: Application name: \"" << appName.latin1() << "\"\n"; + if(NULL!=getenv("TQTCURVE_DEBUG")) + std::cout << "TQtCurve: Application name: \"" << appName.latin1() << "\"\n"; if ("kicker"==appName || "appletproxy"==appName) { itsThemedApp=APP_KICKER; -#if defined QTC_QT_ONLY || !defined KDE_VERSION || KDE_VERSION >= 0x30200 +#if defined TQTC_TQT_ONLY || !defined KDE_VERSION || KDE_VERSION >= 0x30200 itsIsTransKicker=kickerIsTrans(); #endif } else if ("kontact"==appName) itsThemedApp=APP_KONTACT; else if ("konqueror"==appName) - itsThemedApp=APP_KONQUEROR; + itsThemedApp=APP_KONTQUEROR; else if ("kate"==appName) itsThemedApp=APP_KATE; else if ("kpresenter"==appName) @@ -1195,14 +1196,14 @@ void QtCurveStyle::polish(QApplication *app) else if ("korn"==appName) { itsThemedApp=APP_KORN; -#if defined QTC_QT_ONLY || !defined KDE_VERSION || KDE_VERSION >= 0x30200 +#if defined TQTC_TQT_ONLY || !defined KDE_VERSION || KDE_VERSION >= 0x30200 itsIsTransKicker=kickerIsTrans(); #endif } else if ("mactor"==appName) { if(!itsMactorPal) - itsMactorPal=new QPalette(QApplication::palette()); + itsMactorPal=new TQPalette(TQApplication::tqpalette()); itsThemedApp=APP_MACTOR; } else @@ -1217,9 +1218,13 @@ void QtCurveStyle::polish(QApplication *app) // works around this... if(opts.useHighlightForMenu) { - QMetaObject *meta=(QMetaObject *)metaObject(); + TQMetaObject *meta=(TQMetaObject *)tqmetaObject(); +#ifdef USE_QT4 +#warning Qt4 does not allow the metaobject classname to be set (skipping) +#else // USE_QT4 meta->classname="HighContrastStyle"; +#endif // USE_QT4 } if(opts.scrollbarType==SCROLLBAR_NEXT) @@ -1229,47 +1234,47 @@ void QtCurveStyle::polish(QApplication *app) setSbType(); } - if(SHADE_NONE!=opts.menuStripe && opts.noMenuStripeApps.contains(appName)) + if(SHADE_NONE!=opts.menuStripe && opts.noMenuStripeApps.tqcontains(appName)) opts.menuStripe=SHADE_NONE; -#ifdef QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT - if(opts.fixParentlessDialogs && (opts.noDlgFixApps.contains(appName) || opts.noDlgFixApps.contains("kde"))) +#ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT + if(opts.fixParentlessDialogs && (opts.noDlgFixApps.tqcontains(appName) || opts.noDlgFixApps.tqcontains("kde"))) opts.fixParentlessDialogs=false; #endif } -void QtCurveStyle::polish(QPalette &pal) +void TQtCurveStyle::polish(TQPalette &pal) { if(APP_MACTOR==itsThemedApp && itsMactorPal && pal.active().background()!=itsMactorPal->active().background()) return; - QSettings settings; - int contrast(settings.readNumEntry("/Qt/KDE/contrast", DEFAULT_CONTRAST)); + TQSettings settings; + int contrast(settings.readNumEntry("/TQt/KDE/contrast", DEFAULT_CONTRAST)); bool newContrast(false); readKdeGlobals(); - if(!kdeSettings.inactiveHighlight)// Read in Qt3 palette... Required for the inactive settings... + if(!kdeSettings.inactiveHighlight)// Read in TQt3 palette... Required for the inactive settings... { - QStringList active(settings.readListEntry("/Qt/Palette/active")), - inactive(settings.readListEntry("/Qt/Palette/inactive")); + TQStringList active(settings.readListEntry("/TQt/Palette/active")), + inactive(settings.readListEntry("/TQt/Palette/inactive")); // Only set if: the active highlight is the same, and the inactive highlight is different. - // If the user has no ~/.qt/qtrc, then QSettings will return a default palette. However, the palette + // If the user has no ~/.qt/qtrc, then TQSettings will return a default palette. However, the palette // passed in to this ::polish function will be the KDE one - which maybe different. Hence, we need to - // check that Qt active == KDE active, before reading inactive... - if (QColorGroup::NColorRoles==active.count() && - QColorGroup::NColorRoles==inactive.count() && - QColor(active[QColorGroup::Highlight])==pal.color(QPalette::Active, QColorGroup::Highlight) && - QColor(active[QColorGroup::HighlightedText])==pal.color(QPalette::Active, QColorGroup::HighlightedText)) + // check that TQt active == KDE active, before reading inactive... + if (TQColorGroup::NColorRoles==active.count() && + TQColorGroup::NColorRoles==inactive.count() && + TQColor(active[TQColorGroup::Highlight])==pal.color(TQPalette::Active, TQColorGroup::Highlight) && + TQColor(active[TQColorGroup::HighlightedText])==pal.color(TQPalette::Active, TQColorGroup::HighlightedText)) { - QColor h(inactive[QColorGroup::Highlight]), - t(inactive[QColorGroup::HighlightedText]); + TQColor h(inactive[TQColorGroup::Highlight]), + t(inactive[TQColorGroup::HighlightedText]); - if(h!=pal.color(QPalette::Inactive, QColorGroup::Highlight) || t!=QPalette::Inactive, QColorGroup::HighlightedText) + if(h!=pal.color(TQPalette::Inactive, TQColorGroup::Highlight) || t!=TQPalette::Inactive, TQColorGroup::HighlightedText) { - pal.setColor(QPalette::Inactive, QColorGroup::Highlight, h); - pal.setColor(QPalette::Inactive, QColorGroup::HighlightedText, t); + pal.setColor(TQPalette::Inactive, TQColorGroup::Highlight, h); + pal.setColor(TQPalette::Inactive, TQColorGroup::HighlightedText, t); } } } @@ -1285,19 +1290,19 @@ void QtCurveStyle::polish(QPalette &pal) if(kdeSettings.inactiveHighlight) { - pal.setColor(QPalette::Inactive, QColorGroup::Highlight, - tint(QApplication::palette().active().background(), - QApplication::palette().active().highlight(), 0.4)); + pal.setColor(TQPalette::Inactive, TQColorGroup::Highlight, + tint(TQApplication::tqpalette().active().background(), + TQApplication::tqpalette().active().highlight(), 0.4)); // KDE4 does not set text colour :-( - //pal.setColor(QPalette::Inactive, QColorGroup::HighlightedText, pal.color(QPalette::Active, QColorGroup::Foreground)); + //pal.setColor(TQPalette::Inactive, TQColorGroup::HighlightedText, pal.color(TQPalette::Active, TQColorGroup::Foreground)); } bool newMenu(newContrast || - itsHighlightCols[ORIGINAL_SHADE]!=QApplication::palette().active().highlight()), + itsHighlightCols[ORIGINAL_SHADE]!=TQApplication::tqpalette().active().highlight()), newGray(newContrast || - itsBackgroundCols[ORIGINAL_SHADE]!=QApplication::palette().active().background()), + itsBackgroundCols[ORIGINAL_SHADE]!=TQApplication::tqpalette().active().background()), newButton(newContrast || - itsButtonCols[ORIGINAL_SHADE]!=QApplication::palette().active().button()), + itsButtonCols[ORIGINAL_SHADE]!=TQApplication::tqpalette().active().button()), newSlider(itsSliderCols && SHADE_BLEND_SELECTED==opts.shadeSliders && (newContrast || newButton || newMenu)), newDefBtn(itsDefBtnCols && /*( (IND_COLORED==opts.defBtnIndicator &&*/ @@ -1322,17 +1327,17 @@ void QtCurveStyle::polish(QPalette &pal) itsSortedLvColors!=itsProgressCols && itsCheckRadioSelCols!=itsProgressCols && (newContrast || newButton)); if(newGray) - shadeColors(QApplication::palette().active().background(), itsBackgroundCols); + shadeColors(TQApplication::tqpalette().active().background(), itsBackgroundCols); if(newButton) - shadeColors(QApplication::palette().active().button(), itsButtonCols); + shadeColors(TQApplication::tqpalette().active().button(), itsButtonCols); if(newMenu) - shadeColors(QApplication::palette().active().highlight(), itsHighlightCols); + shadeColors(TQApplication::tqpalette().active().highlight(), itsHighlightCols); setDecorationColors(); - setMenuColors(QApplication::palette().active()); + setMenuColors(TQApplication::tqpalette().active()); if(newSlider) shadeColors(midColor(itsHighlightCols[ORIGINAL_SHADE], itsButtonCols[ORIGINAL_SHADE]), itsSliderCols); @@ -1380,12 +1385,12 @@ void QtCurveStyle::polish(QPalette &pal) switch(opts.shadeCheckRadio) { default: - itsCheckRadioCol=opts.crButton ? QApplication::palette().active().buttonText() - : QApplication::palette().active().text(); + itsCheckRadioCol=opts.crButton ? TQApplication::tqpalette().active().buttonText() + : TQApplication::tqpalette().active().text(); break; case SHADE_SELECTED: case SHADE_BLEND_SELECTED: - itsCheckRadioCol=QApplication::palette().active().highlight(); + itsCheckRadioCol=TQApplication::tqpalette().active().highlight(); break; case SHADE_CUSTOM: itsCheckRadioCol=opts.customCheckRadioColor; @@ -1395,44 +1400,44 @@ void QtCurveStyle::polish(QPalette &pal) *itsMactorPal=pal; // Force this to be re-generated! if(SHADE_BLEND_SELECTED==opts.menuStripe) - opts.customMenuStripeColor=Qt::black; + opts.customMenuStripeColor=TQt::black; if(APPEARANCE_STRIPED==opts.bgndAppearance) - pal.setBrush(QColorGroup::Background, QBrush(pal.active().background(), *createStripePixmap(pal.active().background(), true))); + pal.setBrush(TQColorGroup::Background, TQBrush(pal.active().background(), *createStripePixmap(pal.active().background(), true))); } -static QColor disable(const QColor &col, const QColor &bgnd) +static TQColor disable(const TQColor &col, const TQColor &bgnd) { - QColor c = col; + TQColor c = col; c = ColorUtils_darken(&c, 0.1, 1.0); c = ColorUtils_mix(&c, &bgnd, 0.65); return c; } -QColorGroup QtCurveStyle::setColorGroup(const QColorGroup &old, const QColorGroup &act, bool dis) +TQColorGroup TQtCurveStyle::setColorGroup(const TQColorGroup &old, const TQColorGroup &act, bool dis) { - QColor mid(old.mid()); + TQColor mid(old.mid()); if(dis) mid=disable(act.foreground(), old.background()); - const QColor *use(backgroundColors(old)); - QColorGroup newGrp(old.foreground(), old.button(), use[0], use[STD_BORDER], + const TQColor *use(backgroundColors(old)); + TQColorGroup newGrp(old.foreground(), old.button(), use[0], use[STD_BORDER], mid, old.text(), old.brightText(), old.base(), old.background()); - QColorGroup::ColorRole roles[]={QColorGroup::Midlight, QColorGroup::ButtonText, - QColorGroup::Shadow, QColorGroup::Highlight, - QColorGroup::HighlightedText, QColorGroup::Link, - QColorGroup::LinkVisited, QColorGroup::NColorRoles }; + TQColorGroup::ColorRole roles[]={TQColorGroup::Midlight, TQColorGroup::ButtonText, + TQColorGroup::Shadow, TQColorGroup::Highlight, + TQColorGroup::HighlightedText, TQColorGroup::Link, + TQColorGroup::LinkVisited, TQColorGroup::NColorRoles }; int r(0); - for(r=0; roles[r]!=QColorGroup::NColorRoles; ++r) + for(r=0; roles[r]!=TQColorGroup::NColorRoles; ++r) newGrp.setColor(roles[r], old.color(roles[r])); if(dis) { - newGrp.setColor(QColorGroup::ButtonText, disable(act.buttonText(), old.button())); - newGrp.setColor(QColorGroup::Text, disable(act.text(), old.background())); + newGrp.setColor(TQColorGroup::ButtonText, disable(act.buttonText(), old.button())); + newGrp.setColor(TQColorGroup::Text, disable(act.text(), old.background())); } return newGrp; @@ -1440,105 +1445,105 @@ QColorGroup QtCurveStyle::setColorGroup(const QColorGroup &old, const QColorGrou static const char * kdeToolbarWidget="kde toolbar widget"; -void QtCurveStyle::polish(QWidget *widget) +void TQtCurveStyle::polish(TQWidget *widget) { bool enableFilter(opts.highlightFactor || opts.coloredMouseOver); if(::isKhtmlFormWidget(widget)) { itsKhtmlWidgets[widget]=true; - connect(widget, SIGNAL(destroyed(QObject *)), this, SLOT(khtmlWidgetDestroyed(QObject *))); + connect(widget, TQT_SIGNAL(destroyed(TQObject *)), this, TQT_SLOT(khtmlWidgetDestroyed(TQObject *))); } if(enableFilter && isSpecialHover(widget)) - connect(widget, SIGNAL(destroyed(QObject *)), this, SLOT(hoverWidgetDestroyed(QObject *))); + connect(widget, TQT_SIGNAL(destroyed(TQObject *)), this, TQT_SLOT(hoverWidgetDestroyed(TQObject *))); - if(isWindowDragWidget(widget)) + if(isWindowDragWidget(TQT_TQOBJECT(widget))) widget->installEventFilter(this); - if(APPEARANCE_STRIPED==opts.bgndAppearance && (::qt_cast<QDialog *>(widget) || ::qt_cast<QMainWindow *>(widget))) + if(APPEARANCE_STRIPED==opts.bgndAppearance && (::tqqt_cast<TQDialog *>(widget) || ::tqqt_cast<TQMainWindow *>(widget))) setBgndProp(widget, APPEARANCE_STRIPED); - if(widget->parentWidget() && ::qt_cast<QScrollView *>(widget) && ::qt_cast<QComboBox *>(widget->parentWidget())) + if(widget->tqparentWidget() && ::tqqt_cast<TQScrollView *>(widget) && ::tqqt_cast<TQComboBox *>(widget->tqparentWidget())) { - QPalette pal(widget->palette()); + TQPalette pal(widget->tqpalette()); #if 0 - QPalette orig(pal); + TQPalette orig(pal); #endif - QColorGroup act(pal.active()); + TQColorGroup act(pal.active()); #if 0 if(opts.gtkComboMenus) - act.setColor(QColorGroup::Base, USE_LIGHTER_POPUP_MENU ? itsLighterPopupMenuBgndCol : itsBackgroundCols[ORIGINAL_SHADE]); - act.setColor(QColorGroup::Background, opts.gtkComboMenus + act.setColor(TQColorGroup::Base, USE_LIGHTER_POPUP_MENU ? itsLighterPopupMenuBgndCol : itsBackgroundCols[ORIGINAL_SHADE]); + act.setColor(TQColorGroup::Background, opts.gtkComboMenus ? USE_LIGHTER_POPUP_MENU ? itsLighterPopupMenuBgndCol : itsBackgroundCols[ORIGINAL_SHADE] - : QApplication::palette().active().base()); + : TQApplication::tqpalette().active().base()); #endif - act.setColor(QColorGroup::Foreground, itsBackgroundCols[STD_BORDER]); + act.setColor(TQColorGroup::Foreground, itsBackgroundCols[STD_BORDER]); pal.setActive(act); widget->setPalette(pal); #if 0 - //((QScrollView *)widget)->setMargin(1); + //((TQScrollView *)widget)->setMargin(1); - const QObjectList *children(widget->children()); + const TQObjectList *tqchildren(widget->tqchildren()); - if(children) + if(tqchildren) { - QObjectList::Iterator it(children->begin()), - end(children->end()); + TQObjectList::Iterator it(tqchildren->begin()), + end(tqchildren->end()); for(; it!=end; ++it) - if(::qt_cast<QWidget *>(*it)) - ((QWidget *)(*it))->setPalette(orig); + if(::tqqt_cast<TQWidget *>(*it)) + ((TQWidget *)(*it))->setPalette(orig); } #endif } - if (APP_MACTOR==itsThemedApp && itsMactorPal && !widget->inherits("QTipLabel")) + if (APP_MACTOR==itsThemedApp && itsMactorPal && !widget->inherits("TQTipLabel")) widget->setPalette(*itsMactorPal); // Get rid of Kontact's frame... - if(APP_KONTACT==itsThemedApp && ::qt_cast<QHBox *>(widget) && widget->parentWidget() && - 0==qstrcmp(widget->parentWidget()->className(), "Kontact::MainWindow")) - ((QHBox *)widget)->setLineWidth(0); + if(APP_KONTACT==itsThemedApp && ::tqqt_cast<TQHBox *>(widget) && widget->tqparentWidget() && + 0==qstrcmp(widget->tqparentWidget()->className(), "Kontact::MainWindow")) + ((TQHBox *)widget)->setLineWidth(0); - if(!IS_FLAT_BGND(opts.menuBgndAppearance) && ::qt_cast<const QPopupMenu *>(widget)) + if(!IS_FLAT_BGND(opts.menuBgndAppearance) && ::tqqt_cast<const TQPopupMenu *>(widget)) widget->installEventFilter(this); #if 0 - if(opts.menubarHiding && ::qt_cast<QMainWindow *>(widget) && static_cast<QMainWindow *>(widget)->menuBar()) + if(opts.menubarHiding && ::tqqt_cast<TQMainWindow *>(widget) && static_cast<TQMainWindow *>(widget)->menuBar()) widget->installEventFilter(this); #endif - if ((opts.square&SQUARE_SCROLLVIEW) && widget && - (::qt_cast<const QScrollView *>(widget) || - (widget->parentWidget() && ::qt_cast<const QFrame *>(widget) && - widget->parentWidget()->inherits("KateView"))) && - ((QFrame *)widget)->lineWidth()>1) - ((QFrame *)widget)->setLineWidth(opts.gtkScrollViews ? 1 : 2); + if ((opts.square&STQUARE_SCROLLVIEW) && widget && + (::tqqt_cast<const TQScrollView *>(widget) || + (widget->tqparentWidget() && ::tqqt_cast<const TQFrame *>(widget) && + widget->tqparentWidget()->inherits("KateView"))) && + ((TQFrame *)widget)->lineWidth()>1) + ((TQFrame *)widget)->setLineWidth(opts.gtkScrollViews ? 1 : 2); else if(!opts.popupBorder && widget && - (::qt_cast<const QPopupMenu *>(widget) || - (widget->parentWidget() && ::qt_cast<const QListBox *>(widget) && - ::qt_cast<const QComboBox *>(widget->parentWidget())))) - ((QFrame *)widget)->setLineWidth(0); + (::tqqt_cast<const TQPopupMenu *>(widget) || + (widget->tqparentWidget() && ::tqqt_cast<const TQListBox *>(widget) && + ::tqqt_cast<const TQComboBox *>(widget->tqparentWidget())))) + ((TQFrame *)widget)->setLineWidth(0); else if ((USE_LIGHTER_POPUP_MENU || !IS_FLAT_BGND(opts.menuBgndAppearance)) && !opts.borderMenuitems && - widget && ::qt_cast<const QPopupMenu *>(widget)) - ((QFrame *)widget)->setLineWidth(1); + widget && ::tqqt_cast<const TQPopupMenu *>(widget)) + ((TQFrame *)widget)->setLineWidth(1); - if (::qt_cast<QRadioButton *>(widget) || ::qt_cast<QCheckBox *>(widget)) + if (::tqqt_cast<TQRadioButton *>(widget) || ::tqqt_cast<TQCheckBox *>(widget)) { - bool framelessGroupBoxCheckBox=(NO_FRAME(opts.groupBox) && isCheckBoxOfGroupBox(widget)); + bool framelessGroupBoxCheckBox=(NO_FRAME(opts.groupBox) && isCheckBoxOfGroupBox(TQT_TQOBJECT(widget))); if(framelessGroupBoxCheckBox || enableFilter) { -#if QT_VERSION >= 0x030200 +#if 0x039999 >= 0x030200 if(!isFormWidget(widget)) widget->setMouseTracking(true); #endif if(framelessGroupBoxCheckBox) { - QFont fnt(widget->font()); + TQFont fnt(widget->font()); fnt.setBold(true); widget->setFont(fnt); @@ -1546,8 +1551,8 @@ void QtCurveStyle::polish(QWidget *widget) widget->installEventFilter(this); } } - else if (::qt_cast<QHeader *>(widget) || ::qt_cast<QTabBar *>(widget) || ::qt_cast<QSpinWidget *>(widget)/* || - ::qt_cast<QDateTimeEditBase*>(widget)*/) + else if (::tqqt_cast<TQHeader *>(widget) || ::tqqt_cast<TQTabBar *>(widget) || ::tqqt_cast<TQSpinWidget *>(widget)/* || + ::tqqt_cast<TQDateTimeEditBase*>(widget)*/) { if(enableFilter) { @@ -1555,7 +1560,7 @@ void QtCurveStyle::polish(QWidget *widget) widget->installEventFilter(this); } } - else if (::qt_cast<QToolButton *>(widget)) + else if (::tqqt_cast<TQToolButton *>(widget)) { if(NoBackground!=widget->backgroundMode()) // && onToolBar(widget)) widget->setBackgroundMode(PaletteBackground); @@ -1567,7 +1572,7 @@ void QtCurveStyle::polish(QWidget *widget) #endif } } - else if (::qt_cast<QButton *>(widget) || widget->inherits("QToolBarExtensionWidget")) + else if (::tqqt_cast<TQButton *>(widget) || widget->inherits("TQToolBarExtensionWidget")) { /*if(onToolBar(widget)) widget->setBackgroundMode(NoBackground); @@ -1576,7 +1581,7 @@ void QtCurveStyle::polish(QWidget *widget) if(enableFilter) widget->installEventFilter(this); } - else if (::qt_cast<QComboBox *>(widget)) + else if (::tqqt_cast<TQComboBox *>(widget)) { if(NoBackground!=widget->backgroundMode()) // && onToolBar(widget)) widget->setBackgroundMode(PaletteBackground); @@ -1588,10 +1593,10 @@ void QtCurveStyle::polish(QWidget *widget) if(enableFilter) widget->setMouseTracking(true); - if(((QComboBox *)widget)->listBox()) - ((QComboBox *)widget)->listBox()->installEventFilter(this); + if(((TQComboBox *)widget)->listBox()) + ((TQComboBox *)widget)->listBox()->installEventFilter(this); } - else if(::qt_cast<QMenuBar *>(widget)) + else if(::tqqt_cast<TQMenuBar *>(widget)) { if(NoBackground!=widget->backgroundMode()) widget->setBackgroundMode(PaletteBackground); @@ -1601,13 +1606,13 @@ void QtCurveStyle::polish(QWidget *widget) emitMenuSize(widget, widget->rect().height()); if(SHADE_WINDOW_BORDER==opts.shadeMenubars) { - QPalette pal(widget->palette()); - QColorGroup act(pal.active()); - QColorGroup inact(pal.inactive()); + TQPalette pal(widget->tqpalette()); + TQColorGroup act(pal.active()); + TQColorGroup inact(pal.inactive()); getMdiColors(act, true); - act.setColor(QColorGroup::Foreground, itsActiveMdiTextColor); - inact.setColor(QColorGroup::Foreground, opts.shadeMenubarOnlyWhenActive ? itsMdiTextColor : itsActiveMdiTextColor); + act.setColor(TQColorGroup::Foreground, itsActiveMdiTextColor); + inact.setColor(TQColorGroup::Foreground, opts.shadeMenubarOnlyWhenActive ? itsMdiTextColor : itsActiveMdiTextColor); pal.setInactive(inact); pal.setActive(act); widget->setPalette(pal); @@ -1615,17 +1620,17 @@ void QtCurveStyle::polish(QWidget *widget) else if(opts.customMenuTextColor || SHADE_BLEND_SELECTED==opts.shadeMenubars || SHADE_SELECTED==opts.shadeMenubars || (SHADE_CUSTOM==opts.shadeMenubars && TOO_DARK(itsMenubarCols[ORIGINAL_SHADE]))) { - QPalette pal(widget->palette()); - QColorGroup act(pal.active()); + TQPalette pal(widget->tqpalette()); + TQColorGroup act(pal.active()); - act.setColor(QColorGroup::Foreground, opts.customMenuTextColor + act.setColor(TQColorGroup::Foreground, opts.customMenuTextColor ? opts.customMenuNormTextColor - : QApplication::palette().active().highlightedText()); + : TQApplication::tqpalette().active().highlightedText()); if(!opts.shadeMenubarOnlyWhenActive) { - QColorGroup inact(pal.inactive()); - inact.setColor(QColorGroup::Foreground, act.color(QColorGroup::Foreground)); + TQColorGroup inact(pal.inactive()); + inact.setColor(TQColorGroup::Foreground, act.color(TQColorGroup::Foreground)); pal.setInactive(inact); } @@ -1633,22 +1638,22 @@ void QtCurveStyle::polish(QWidget *widget) widget->setPalette(pal); } } - else if(::qt_cast<QToolBar *>(widget)) + else if(::tqqt_cast<TQToolBar *>(widget)) { if(NoBackground!=widget->backgroundMode()) widget->setBackgroundMode(PaletteBackground); } - else if(::qt_cast<QPopupMenu *>(widget)) + else if(::tqqt_cast<TQPopupMenu *>(widget)) widget->setBackgroundMode(NoBackground); // PaletteBackground); else if (widget->inherits("KToolBarSeparator") || (widget->inherits("KListViewSearchLineWidget") && - widget->parent() && ::qt_cast<QToolBar *>(widget->parent()))) + widget->tqparent() && ::tqqt_cast<TQToolBar *>(widget->tqparent()))) { widget->setName(kdeToolbarWidget); widget->setBackgroundMode(NoBackground); widget->installEventFilter(this); } - else if (::qt_cast<QScrollBar *>(widget)) + else if (::tqqt_cast<TQScrollBar *>(widget)) { if(enableFilter) { @@ -1657,11 +1662,11 @@ void QtCurveStyle::polish(QWidget *widget) } //widget->setBackgroundMode(NoBackground); } - else if (::qt_cast<QSlider *>(widget)) + else if (::tqqt_cast<TQSlider *>(widget)) { if(enableFilter) widget->installEventFilter(this); - if(widget->parent() && ::qt_cast<QToolBar *>(widget->parent())) + if(widget->tqparent() && ::tqqt_cast<TQToolBar *>(widget->tqparent())) { widget->setName(kdeToolbarWidget); widget->setBackgroundMode(NoBackground); // We paint whole background. @@ -1671,28 +1676,28 @@ void QtCurveStyle::polish(QWidget *widget) } // This bit stolen form polyester... - connect(widget, SIGNAL(sliderMoved(int)), this, SLOT(sliderThumbMoved(int))); - connect(widget, SIGNAL(valueChanged(int)), this, SLOT(sliderThumbMoved(int))); + connect(widget, TQT_SIGNAL(sliderMoved(int)), this, TQT_SLOT(sliderThumbMoved(int))); + connect(widget, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(sliderThumbMoved(int))); } - else if (::qt_cast<QLineEdit*>(widget) || ::qt_cast<QTextEdit*>(widget)) + else if (::tqqt_cast<TQLineEdit*>(widget) || ::tqqt_cast<TQTextEdit*>(widget)) { widget->installEventFilter(this); if(onToolBar(widget)) widget->setName(kdeToolbarWidget); - if(widget && widget->parentWidget() && - widget->inherits("KLineEdit") && widget->parentWidget()->inherits("KIO::DefaultProgress") && - ::qt_cast<QFrame *>(widget)) - ((QFrame *)widget)->setLineWidth(0); + if(widget && widget->tqparentWidget() && + widget->inherits("KLineEdit") && widget->tqparentWidget()->inherits("KIO::DefaultProgress") && + ::tqqt_cast<TQFrame *>(widget)) + ((TQFrame *)widget)->setLineWidth(0); } - else if (widget->inherits("QSplitterHandle") || widget->inherits("QDockWindowHandle") || widget->inherits("QDockWindowResizeHandle")) + else if (widget->inherits(TQSPLITTERHANDLE_OBJECT_NAME_STRING) || widget->inherits(TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING) || widget->inherits("TQDockWindowResizeHandle")) { if(enableFilter) widget->installEventFilter(this); } else if (0==qstrcmp(widget->name(), kdeToolbarWidget)) { - if(!widget->parent() || - 0!=qstrcmp(static_cast<QWidget *>(widget->parent())->className(), + if(!widget->tqparent() || + 0!=qstrcmp(TQT_TQWIDGET(widget->tqparent())->className(), "KListViewSearchLineWidget") || onToolBar(widget)) { @@ -1701,28 +1706,28 @@ void QtCurveStyle::polish(QWidget *widget) } } - if (widget->parentWidget() && ::qt_cast<QMenuBar *>(widget->parentWidget()) && !qstrcmp(widget->className(), "QFrame")) + if (widget->tqparentWidget() && ::tqqt_cast<TQMenuBar *>(widget->tqparentWidget()) && !qstrcmp(widget->className(), TQFRAME_OBJECT_NAME_STRING)) { widget->installEventFilter(this); widget->setBackgroundMode(NoBackground); // We paint whole background. } - else if (Qt::X11ParentRelative!=widget->backgroundMode() && - (::qt_cast<QLabel *>(widget) || ::qt_cast<QHBox *>(widget) || - ::qt_cast<QVBox *>(widget)) && - widget->parent() && - ( 0==qstrcmp(static_cast<QWidget *>(widget->parent())->className(), + else if (TQt::X11ParentRelative!=widget->backgroundMode() && + (::tqqt_cast<TQLabel *>(widget) || ::tqqt_cast<TQHBox *>(widget) || + ::tqqt_cast<TQVBox *>(widget)) && + widget->tqparent() && + ( 0==qstrcmp(TQT_TQWIDGET(widget->tqparent())->className(), "MainWindow") || onToolBar(widget))) { widget->setName(kdeToolbarWidget); widget->installEventFilter(this); widget->setBackgroundMode(NoBackground); // We paint the whole background. } - else if(::qt_cast<QProgressBar *>(widget)) + else if(::tqqt_cast<TQProgressBar *>(widget)) { - if(widget->palette().inactive().highlightedText()!=widget->palette().active().highlightedText()) + if(widget->tqpalette().inactive().highlightedText()!=widget->tqpalette().active().highlightedText()) { - QPalette pal(widget->palette()); - pal.setInactive(widget->palette().active()); + TQPalette pal(widget->tqpalette()); + pal.setInactive(widget->tqpalette().active()); widget->setPalette(pal); } @@ -1730,12 +1735,12 @@ void QtCurveStyle::polish(QWidget *widget) { widget->installEventFilter(this); itsProgAnimWidgets[widget] = 0; - connect(widget, SIGNAL(destroyed(QObject *)), this, SLOT(progressBarDestroyed(QObject *))); + connect(widget, TQT_SIGNAL(destroyed(TQObject *)), this, TQT_SLOT(progressBarDestroyed(TQObject *))); if (!itsAnimationTimer->isActive()) itsAnimationTimer->start(PROGRESS_ANIMATION, false); } } - else if(opts.highlightScrollViews && ::qt_cast<QScrollView*>(widget)) + else if(opts.highlightScrollViews && ::tqqt_cast<TQScrollView*>(widget)) widget->installEventFilter(this); else if(!qstrcmp(widget->className(), "KonqFrameStatusBar")) { @@ -1744,116 +1749,116 @@ void QtCurveStyle::polish(QWidget *widget) // applications cg.midlight() so we override it to standard background. // Thanks Comix! (because this was ugly from day one!) // NOTE: Check if we can set it earlier (before painting), cause - // on slow machines we can see the repainting of the bar (from white to background...) - QPalette pal(QApplication::palette()); + // on slow machines we can see the tqrepainting of the bar (from white to background...) + TQPalette pal(TQApplication::tqpalette()); - pal.setColor(QColorGroup::Midlight, pal.active().background()); - QApplication::setPalette(pal); + pal.setColor(TQColorGroup::Midlight, pal.active().background()); + TQApplication::setPalette(pal); } else if(widget->inherits("KTabCtl")) widget->installEventFilter(this); - else if(NO_FRAME(opts.groupBox) && ::qt_cast<QGroupBox *>(widget)) + else if(NO_FRAME(opts.groupBox) && ::tqqt_cast<TQGroupBox *>(widget)) { - ((QGroupBox *)widget)->setFlat(false); - ((QGroupBox *)widget)->setFrameShape(QFrame::NoFrame); + ((TQGroupBox *)widget)->setFlat(false); + ((TQGroupBox *)widget)->setFrameShape(TQFrame::NoFrame); } -#ifdef QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT - else if(opts.fixParentlessDialogs && ::qt_cast<QDialog *>(widget)) +#ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT + else if(opts.fixParentlessDialogs && ::tqqt_cast<TQDialog *>(widget)) { - QDialog *dlg=(QDialog *)widget; + TQDialog *dlg=(TQDialog *)widget; - // The parent->isShown is needed for KWord. It's insert picure file dialog is a child of + // The tqparent->isShown is needed for KWord. It's insert picure file dialog is a child of // the insert picture dialog - but the file dialog is shown *before* the picture dialog! - if( (SKIP_TASKBAR && !dlg->parentWidget()) || - ( (!dlg->parentWidget() || !dlg->parentWidget()->isShown())// && - /*(dlg->isModal() || ::qt_cast<QProgressDialog *>(widget))*/) ) + if( (SKIP_TASKBAR && !dlg->tqparentWidget()) || + ( (!dlg->tqparentWidget() || !dlg->tqparentWidget()->isShown())// && + /*(dlg->isModal() || ::tqqt_cast<TQProgressDialog *>(widget))*/) ) widget->installEventFilter(this); } if(opts.fixParentlessDialogs && (APP_KPRINTER==itsThemedApp || APP_KDIALOG==itsThemedApp || APP_KDIALOGD==itsThemedApp)) { - QString cap(widget->caption()); + TQString cap(widget->caption()); int index=-1; // Remove horrible "Open - KDialog" titles... if( cap.length() && - ( (APP_KPRINTER==itsThemedApp && (-1!=(index=cap.find(" - KPrinter"))) && + ( (APP_KPRINTER==itsThemedApp && (-1!=(index=cap.tqfind(" - KPrinter"))) && (index+11)==(int)cap.length()) || - (APP_KDIALOG==itsThemedApp && (-1!=(index=cap.find(" - KDialog"))) && + (APP_KDIALOG==itsThemedApp && (-1!=(index=cap.tqfind(" - KDialog"))) && (index+10)==(int)cap.length()) || - (APP_KDIALOGD==itsThemedApp && (-1!=(index=cap.find(" - KDialog Daemon"))) && + (APP_KDIALOGD==itsThemedApp && (-1!=(index=cap.tqfind(" - KDialog Daemon"))) && (index+17)==(int)cap.length())) ) - widget->QWidget::setCaption(cap.left(index)); + widget->TQWidget::setCaption(cap.left(index)); } #endif if(APP_SYSTEMSETTINGS==itsThemedApp) { - if(widget && widget->parentWidget() && widget->parentWidget()->parentWidget() && - ::qt_cast<QFrame *>(widget) && QFrame::NoFrame!=((QFrame *)widget)->frameShape() && - ::qt_cast<QFrame *>(widget->parentWidget()) && - ::qt_cast<QTabWidget *>(widget->parentWidget()->parentWidget())) - ((QFrame *)widget)->setFrameShape(QFrame::NoFrame); + if(widget && widget->tqparentWidget() && widget->tqparentWidget()->tqparentWidget() && + ::tqqt_cast<TQFrame *>(widget) && TQFrame::NoFrame!=((TQFrame *)widget)->frameShape() && + ::tqqt_cast<TQFrame *>(widget->tqparentWidget()) && + ::tqqt_cast<TQTabWidget *>(widget->tqparentWidget()->tqparentWidget())) + ((TQFrame *)widget)->setFrameShape(TQFrame::NoFrame); - if(widget->parentWidget() && widget->parentWidget()->parentWidget() && - ::qt_cast<QScrollView *>(widget->parentWidget()->parentWidget()) && - widget->inherits("KCMultiWidget") && widget->parentWidget()->inherits("QViewportWidget")) - ((QScrollView *)(widget->parentWidget()->parentWidget()))->setLineWidth(0); + if(widget->tqparentWidget() && widget->tqparentWidget()->tqparentWidget() && + ::tqqt_cast<TQScrollView *>(widget->tqparentWidget()->tqparentWidget()) && + widget->inherits("KCMultiWidget") && widget->tqparentWidget()->inherits("TQViewportWidget")) + ((TQScrollView *)(widget->tqparentWidget()->tqparentWidget()))->setLineWidth(0); } - if(opts.tabBgnd && widget && widget->parentWidget() && ::qt_cast<QWidgetStack *>(widget) && - ::qt_cast<QTabWidget *>(widget->parentWidget()) && + if(opts.tabBgnd && widget && widget->tqparentWidget() && ::tqqt_cast<TQWidgetStack *>(widget) && + ::tqqt_cast<TQTabWidget *>(widget->tqparentWidget()) && 0==qstrcmp(widget->name(), "tab pages")) { - QPalette pal(widget->palette()); + TQPalette pal(widget->tqpalette()); - pal.setColor(QColorGroup::Background, shade(pal.active().background(), TO_FACTOR(opts.tabBgnd))); + pal.setColor(TQColorGroup::Background, shade(pal.active().background(), TO_FACTOR(opts.tabBgnd))); widget->setBackgroundMode(PaletteBackground); widget->setPalette(pal); } if(APPEARANCE_STRIPED==opts.bgndAppearance) - widget->setBackgroundOrigin(QWidget::WindowOrigin); + widget->setBackgroundOrigin(TQWidget::WindowOrigin); BASE_STYLE::polish(widget); } -void QtCurveStyle::unPolish(QWidget *widget) +void TQtCurveStyle::unPolish(TQWidget *widget) { if(isFormWidget(widget)) itsKhtmlWidgets.remove(widget); - if(!IS_FLAT_BGND(opts.menuBgndAppearance) && ::qt_cast<const QPopupMenu *>(widget)) + if(!IS_FLAT_BGND(opts.menuBgndAppearance) && ::tqqt_cast<const TQPopupMenu *>(widget)) widget->removeEventFilter(this); #if 0 - if(opts.menubarHiding && ::qt_cast<QMainWindow *>(widget) && static_cast<QMainWindow *>(widget)->menuBar()) + if(opts.menubarHiding && ::tqqt_cast<TQMainWindow *>(widget) && static_cast<TQMainWindow *>(widget)->menuBar()) widget->removeEventFilter(this); #endif - if(isWindowDragWidget(widget)) + if(isWindowDragWidget(TQT_TQOBJECT(widget))) widget->removeEventFilter(this); - if (::qt_cast<QRadioButton *>(widget) || ::qt_cast<QCheckBox *>(widget)) + if (::tqqt_cast<TQRadioButton *>(widget) || ::tqqt_cast<TQCheckBox *>(widget)) { -#if QT_VERSION >= 0x030200 +#if 0x039999 >= 0x030200 widget->setMouseTracking(false); #endif widget->removeEventFilter(this); } - else if (::qt_cast<QHeader *>(widget) || ::qt_cast<QTabBar *>(widget) || ::qt_cast<QSpinWidget *>(widget) /*|| - ::qt_cast<QDateTimeEditBase*>(widget)*/) + else if (::tqqt_cast<TQHeader *>(widget) || ::tqqt_cast<TQTabBar *>(widget) || ::tqqt_cast<TQSpinWidget *>(widget) /*|| + ::tqqt_cast<TQDateTimeEditBase*>(widget)*/) { widget->setMouseTracking(false); widget->removeEventFilter(this); } - else if (::qt_cast<QButton *>(widget) || widget->inherits("QToolBarExtensionWidget")) + else if (::tqqt_cast<TQButton *>(widget) || widget->inherits("TQToolBarExtensionWidget")) { if(NoBackground!=widget->backgroundMode()) // && onToolBar(widget)) widget->setBackgroundMode(PaletteButton); widget->removeEventFilter(this); } - else if (::qt_cast<QToolButton *>(widget)) + else if (::tqqt_cast<TQToolButton *>(widget)) { if(NoBackground!=widget->backgroundMode()) // && onToolBar(widget)) widget->setBackgroundMode(PaletteButton); @@ -1862,21 +1867,21 @@ void QtCurveStyle::unPolish(QWidget *widget) widget->setMouseTracking(false); #endif } - else if (::qt_cast<QComboBox *>(widget)) + else if (::tqqt_cast<TQComboBox *>(widget)) { if(NoBackground!=widget->backgroundMode()) // && onToolBar(widget)) widget->setBackgroundMode(PaletteButton); widget->removeEventFilter(this); widget->setMouseTracking(false); - if(((QComboBox *)widget)->listBox()) - ((QComboBox *)widget)->listBox()->removeEventFilter(this); + if(((TQComboBox *)widget)->listBox()) + ((TQComboBox *)widget)->listBox()->removeEventFilter(this); } - else if (::qt_cast<QToolBar *>(widget) || ::qt_cast<QPopupMenu *>(widget)) + else if (::tqqt_cast<TQToolBar *>(widget) || ::tqqt_cast<TQPopupMenu *>(widget)) { if(NoBackground!=widget->backgroundMode()) widget->setBackgroundMode(PaletteBackground); } - else if (::qt_cast<QMenuBar *>(widget)) + else if (::tqqt_cast<TQMenuBar *>(widget)) { if(NoBackground!=widget->backgroundMode()) widget->setBackgroundMode(PaletteBackground); @@ -1884,57 +1889,57 @@ void QtCurveStyle::unPolish(QWidget *widget) widget->removeEventFilter(this); if(SHADE_WINDOW_BORDER==opts.shadeMenubars || opts.customMenuTextColor || SHADE_BLEND_SELECTED==opts.shadeMenubars || SHADE_SELECTED==opts.shadeMenubars || (SHADE_CUSTOM==opts.shadeMenubars &&TOO_DARK(itsMenubarCols[ORIGINAL_SHADE]))) - widget->setPalette(QApplication::palette()); + widget->setPalette(TQApplication::tqpalette()); } else if (widget->inherits("KToolBarSeparator")) { widget->setBackgroundMode(PaletteBackground); widget->removeEventFilter(this); } - else if (::qt_cast<QScrollBar *>(widget)) + else if (::tqqt_cast<TQScrollBar *>(widget)) { widget->setMouseTracking(false); widget->removeEventFilter(this); widget->setBackgroundMode(PaletteButton); } - else if (::qt_cast<QSlider *>(widget)) + else if (::tqqt_cast<TQSlider *>(widget)) { widget->removeEventFilter(this); - if(widget->parent() && ::qt_cast<QToolBar *>(widget->parent())) + if(widget->tqparent() && ::tqqt_cast<TQToolBar *>(widget->tqparent())) widget->setBackgroundMode(PaletteBackground); } - else if (::qt_cast<QLineEdit*>(widget) || ::qt_cast<QTextEdit*>(widget)) + else if (::tqqt_cast<TQLineEdit*>(widget) || ::tqqt_cast<TQTextEdit*>(widget)) widget->removeEventFilter(this); - else if (widget->inherits("QSplitterHandle") || widget->inherits("QDockWindowHandle") || widget->inherits("QDockWindowResizeHandle")) + else if (widget->inherits(TQSPLITTERHANDLE_OBJECT_NAME_STRING) || widget->inherits(TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING) || widget->inherits("TQDockWindowResizeHandle")) widget->removeEventFilter(this); - else if (::qt_cast<QProgressBar*>(widget)) + else if (::tqqt_cast<TQProgressBar*>(widget)) { itsProgAnimWidgets.remove(widget); widget->removeEventFilter(this); } - else if(opts.highlightScrollViews && ::qt_cast<QScrollView*>(widget)) + else if(opts.highlightScrollViews && ::tqqt_cast<TQScrollView*>(widget)) widget->removeEventFilter(this); else if(0==qstrcmp(widget->name(), kdeToolbarWidget)) { widget->removeEventFilter(this); widget->setBackgroundMode(PaletteBackground); } - if (widget->parentWidget() && ::qt_cast<QMenuBar *>(widget->parentWidget()) && !qstrcmp(widget->className(), "QFrame")) + if (widget->tqparentWidget() && ::tqqt_cast<TQMenuBar *>(widget->tqparentWidget()) && !qstrcmp(widget->className(), TQFRAME_OBJECT_NAME_STRING)) { widget->removeEventFilter(this); widget->setBackgroundMode(PaletteBackground); // We paint whole background. } else if(widget->inherits("KTabCtl")) widget->removeEventFilter(this); -#ifdef QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT - else if(opts.fixParentlessDialogs && ::qt_cast<QDialog *>(widget)) +#ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT + else if(opts.fixParentlessDialogs && ::tqqt_cast<TQDialog *>(widget)) widget->removeEventFilter(this); #endif BASE_STYLE::unPolish(widget); } -static void sendXEvent(QDialog *dlg, const char *msg) +static void sendXEvent(TQDialog *dlg, const char *msg) { static Atom msgTypeAtom = XInternAtom(qt_xdisplay(), "_NET_WM_STATE", False); @@ -1957,7 +1962,7 @@ static void sendXEvent(QDialog *dlg, const char *msg) SubstructureRedirectMask | SubstructureNotifyMask, &xev); } -bool QtCurveStyle::appIsNotEmbedded(QDialog *dlg) +bool TQtCurveStyle::appIsNotEmbedded(TQDialog *dlg) { Window win; @@ -1969,59 +1974,59 @@ bool QtCurveStyle::appIsNotEmbedded(QDialog *dlg) return false; } -bool QtCurveStyle::eventFilter(QObject *object, QEvent *event) +bool TQtCurveStyle::eventFilter(TQObject *object, TQEvent *event) { - if(itsHoverWidget && object==itsHoverWidget && (QEvent::Destroy==event->type() || QEvent::Hide==event->type())) + if(itsHoverWidget && TQT_BASE_OBJECT(object)==TQT_BASE_OBJECT(itsHoverWidget) && (TQEvent::Destroy==event->type() || TQEvent::Hide==event->type())) resetHover(); #if 0 // Works for qtconfig, but k3b hangs? - if(opts.menubarHiding && QEvent::KeyRelease==event->type() && ::qt_cast<QMainWindow *>(object)) + if(opts.menubarHiding && TQEvent::KeyRelease==event->type() && ::tqqt_cast<TQMainWindow *>(object)) { - QMainWindow *window=static_cast<QMainWindow *>(object); + TQMainWindow *window=static_cast<TQMainWindow *>(object); if(window->isVisible() && window->menuBar()) { - QKeyEvent *k=static_cast<QKeyEvent *>(event); + TQKeyEvent *k=static_cast<TQKeyEvent *>(event); - if(k->state()&Qt::ControlButton && k->state()&Qt::AltButton && Qt::Key_M==k->key()) + if(k->state()&TQt::ControlButton && k->state()&TQt::AltButton && TQt::Key_M==k->key()) window->menuBar()->setHidden(window->menuBar()->isVisible()); } } #endif - if(object->parent() && 0==qstrcmp(object->name(), kdeToolbarWidget)) + if(object->tqparent() && 0==qstrcmp(object->name(), kdeToolbarWidget)) { // Draw background for custom widgets in the toolbar that have specified a // "kde toolbar widget" name. - if(QEvent::Paint==event->type()) + if(TQEvent::Paint==event->type()) { - QWidget *widget(static_cast<QWidget*>(object)), - *parent(static_cast<QWidget*>(object->parent())); + TQWidget *widget(TQT_TQWIDGET(object)), + *tqparent(TQT_TQWIDGET(object->tqparent())); if(IS_FLAT(opts.toolbarAppearance)) - QPainter(widget).fillRect(widget->rect(), parent->colorGroup().background()); + TQPainter(widget).fillRect(widget->rect(), tqparent->tqcolorGroup().background()); else { int y_offset(widget->y()); - while(parent && parent->parent() && 0==qstrcmp(parent->name(), kdeToolbarWidget)) + while(tqparent && tqparent->tqparent() && 0==qstrcmp(tqparent->name(), kdeToolbarWidget)) { - y_offset += parent->y(); - parent = static_cast<QWidget*>(parent->parent()); + y_offset += tqparent->y(); + tqparent = TQT_TQWIDGET(tqparent->tqparent()); } - QRect r(widget->rect()), - pr(parent->rect()); + TQRect r(widget->rect()), + pr(tqparent->rect()); bool horiz=pr.width() > pr.height(); - QPainter p(widget); - QToolBar *tb(::qt_cast<QToolBar*>(parent)); + TQPainter p(widget); + TQToolBar *tb(::tqqt_cast<TQToolBar*>(tqparent)); - // If parent is a QToolbar use its orientation, else just base on width>height. + // If tqparent is a TQToolbar use its orientation, else just base on width>height. if (tb) horiz = Qt::Horizontal==tb->orientation(); - QRect bgndRect(r.x(), r.y()-y_offset, r.width(), pr.height()); + TQRect bgndRect(r.x(), r.y()-y_offset, r.width(), pr.height()); if(!IS_FLAT(opts.toolbarAppearance)) if(horiz) @@ -2029,21 +2034,21 @@ bool QtCurveStyle::eventFilter(QObject *object, QEvent *event) else bgndRect.addCoords(-1, 0, 1, 0); - drawMenuOrToolBarBackground(&p, bgndRect, parent->colorGroup(), false, horiz); + drawMenuOrToolBarBackground(&p, bgndRect, tqparent->tqcolorGroup(), false, horiz); } - if(!::qt_cast<QLineEdit*>(object) && !::qt_cast<QTextEdit*>(object) && - !(DO_EFFECT && ::qt_cast<QComboBox*>(object))) + if(!::tqqt_cast<TQLineEdit*>(object) && !::tqqt_cast<TQTextEdit*>(object) && + !(DO_EFFECT && ::tqqt_cast<TQComboBox*>(object))) return false; // Now draw the contents } } - else if (NO_FRAME(opts.groupBox) && QEvent::Move==event->type() && isCheckBoxOfGroupBox(object)) + else if (NO_FRAME(opts.groupBox) && TQEvent::Move==event->type() && isCheckBoxOfGroupBox(object)) { - QCheckBox *cb=static_cast<QCheckBox *>(object); - QRect r(cb->geometry()); + TQCheckBox *cb=static_cast<TQCheckBox *>(TQT_TQWIDGET(object)); + TQRect r(cb->tqgeometry()); cb->removeEventFilter(this); - if(QApplication::reverseLayout()) + if(TQApplication::reverseLayout()) r.setWidth(r.width()+8); else r.setX(0); @@ -2051,13 +2056,13 @@ bool QtCurveStyle::eventFilter(QObject *object, QEvent *event) cb->installEventFilter(this); return false; } - else if (QEvent::Paint==event->type()) + else if (TQEvent::Paint==event->type()) { - if(!IS_FLAT_BGND(opts.menuBgndAppearance) && ::qt_cast<QPopupMenu *>(object)) + if(!IS_FLAT_BGND(opts.menuBgndAppearance) && ::tqqt_cast<TQPopupMenu *>(object)) { - QWidget *widget=(QWidget*)object; - QPainter painter(widget); - QColor col(USE_LIGHTER_POPUP_MENU ? itsLighterPopupMenuBgndCol : widget->palette().active().background()); + TQWidget *widget=(TQWidget*)object; + TQPainter painter(widget); + TQColor col(USE_LIGHTER_POPUP_MENU ? itsLighterPopupMenuBgndCol : widget->tqpalette().active().background()); if(APPEARANCE_STRIPED==opts.menuBgndAppearance) painter.drawTiledPixmap(widget->rect(), *createStripePixmap(col, false)); @@ -2068,58 +2073,58 @@ bool QtCurveStyle::eventFilter(QObject *object, QEvent *event) } else if (object->inherits("KToolBarSeparator")) { - QFrame *frame(::qt_cast<QFrame *>(object)); + TQFrame *frame(::tqqt_cast<TQFrame *>(object)); - if(frame && QFrame::NoFrame!=frame->frameShape()) + if(frame && TQFrame::NoFrame!=frame->frameShape()) { - QPainter painter(frame); - if (QFrame::VLine==frame->frameShape()) - drawPrimitive(PE_DockWindowSeparator, &painter, frame->rect(), - frame->colorGroup(), Style_Horizontal); - else if (QFrame::HLine==frame->frameShape()) - drawPrimitive(PE_DockWindowSeparator, &painter, frame->rect(), - frame->colorGroup()); + TQPainter painter(frame); + if (TQFrame::VLine==frame->frameShape()) + tqdrawPrimitive(PE_DockWindowSeparator, &painter, frame->rect(), + frame->tqcolorGroup(), Style_Horizontal); + else if (TQFrame::HLine==frame->frameShape()) + tqdrawPrimitive(PE_DockWindowSeparator, &painter, frame->rect(), + frame->tqcolorGroup()); else return false; return true; // been drawn! } } - else if(object->inherits("KTabCtl") && ::qt_cast<QWidget*>(object)) + else if(object->inherits("KTabCtl") && ::tqqt_cast<TQWidget*>(object)) { - QWidget *widget((QWidget*)object); - QObject *child(object->child("_tabbar")); - QTabBar *tb(child ? ::qt_cast<QTabBar *>(child) : 0L); - QPainter painter(widget); - QRect r(widget->rect()); + TQWidget *widget((TQWidget*)object); + TQObject *child(object->child("_tabbar")); + TQTabBar *tb(child ? ::tqqt_cast<TQTabBar *>(child) : 0L); + TQPainter painter(widget); + TQRect r(widget->rect()); int tbHeight(tb ? tb->height()-1 : 28); - if(tb && (QTabBar::RoundedBelow == tb->shape() || - QTabBar::TriangularBelow == tb->shape())) + if(tb && (TQTabBar::RoundedBelow == tb->tqshape() || + TQTabBar::TriangularBelow == tb->tqshape())) r.addCoords(0, 0, 0, -tbHeight); else r.addCoords(0, tbHeight, 0, 0); - drawPrimitive(PE_PanelTabWidget, &painter, r, widget->colorGroup(), + tqdrawPrimitive(PE_PanelTabWidget, &painter, r, widget->tqcolorGroup(), Style_Horizontal|Style_Enabled); return true; } } // Fix mdi buttons in menubars... - if(::qt_cast<QWidget*>(object) && ((QWidget *)object)->parentWidget() && - ::qt_cast<QMenuBar*>(((QWidget *)object)->parentWidget())) + if(::tqqt_cast<TQWidget*>(object) && ((TQWidget *)object)->tqparentWidget() && + ::tqqt_cast<TQMenuBar*>(((TQWidget *)object)->tqparentWidget())) { bool drawMenubar=false; switch(event->type()) { - case QEvent::Paint: + case TQEvent::Paint: drawMenubar=true; break; - case QEvent::WindowActivate: + case TQEvent::WindowActivate: itsActive=true; drawMenubar=opts.shadeMenubarOnlyWhenActive && SHADE_NONE!=opts.shadeMenubars; break; - case QEvent::WindowDeactivate: + case TQEvent::WindowDeactivate: itsActive=false; drawMenubar=opts.shadeMenubarOnlyWhenActive && SHADE_NONE!=opts.shadeMenubars; default: @@ -2129,86 +2134,86 @@ bool QtCurveStyle::eventFilter(QObject *object, QEvent *event) if(drawMenubar) { - QWidget *widget(static_cast<QWidget*>(object)), - *parent(static_cast<QWidget*>(object->parent())); - QRect r(widget->rect()); - QPainter p(widget); - int y_offset(widget->y()+parent->y()); + TQWidget *widget(TQT_TQWIDGET(object)), + *tqparent(TQT_TQWIDGET(object->tqparent())); + TQRect r(widget->rect()); + TQPainter p(widget); + int y_offset(widget->y()+tqparent->y()); r.setY(r.y()-y_offset); - r.setHeight(parent->rect().height()); + r.setHeight(tqparent->rect().height()); - drawMenuOrToolBarBackground(&p, r, parent->colorGroup()); + drawMenuOrToolBarBackground(&p, r, tqparent->tqcolorGroup()); return true; } } // Taken from plastik... // focus highlight - if (::qt_cast<QLineEdit*>(object) || ::qt_cast<QTextEdit*>(object)/* || ::qt_cast<QDateTimeEditBase*>(object)*/) + if (::tqqt_cast<TQLineEdit*>(object) || ::tqqt_cast<TQTextEdit*>(object)/* || ::tqqt_cast<TQDateTimeEditBase*>(object)*/) { - if(QEvent::FocusIn==event->type() || QEvent::FocusOut==event->type() || QEvent::Enter==event->type() || QEvent::Leave==event->type()) + if(TQEvent::FocusIn==event->type() || TQEvent::FocusOut==event->type() || TQEvent::Enter==event->type() || TQEvent::Leave==event->type()) { - QWidget *widget(static_cast<QWidget*>(object)); + TQWidget *widget(TQT_TQWIDGET(object)); - if (::qt_cast<QSpinWidget*>(widget->parentWidget())) + if (::tqqt_cast<TQSpinWidget*>(widget->tqparentWidget())) { - widget->parentWidget()->repaint(false); + widget->tqparentWidget()->tqrepaint(false); return false; } - widget->repaint(false); + widget->tqrepaint(false); } return false; } - if(::qt_cast<QMenuBar *>(object)) + if(::tqqt_cast<TQMenuBar *>(object)) { bool useWindowCols=SHADE_WINDOW_BORDER==opts.shadeMenubars; if( (useWindowCols || opts.customMenuTextColor || SHADE_BLEND_SELECTED==opts.shadeMenubars || SHADE_SELECTED==opts.shadeMenubars || - SHADE_CUSTOM==opts.shadeMenubars) && QEvent::Paint==event->type()) + SHADE_CUSTOM==opts.shadeMenubars) && TQEvent::Paint==event->type()) { - const QColor &col(((QWidget *)object)->palette().active().color(QColorGroup::Foreground)); + const TQColor &col(((TQWidget *)object)->tqpalette().active().color(TQColorGroup::Foreground)); // If we're relouring the menubar text, check to see if menubar palette has changed, if so set back to // our values. This fixes opera - which seems to change the widgets palette after it is polished. if((opts.customMenuTextColor && col!=opts.customMenuNormTextColor) || ( (SHADE_BLEND_SELECTED==opts.shadeMenubars || SHADE_SELECTED==opts.shadeMenubars || (SHADE_CUSTOM==opts.shadeMenubars && TOO_DARK(itsMenubarCols[ORIGINAL_SHADE]))) && - col!=QApplication::palette().active().highlightedText())) + col!=TQApplication::tqpalette().active().highlightedText())) { - QPalette pal(((QWidget *)object)->palette()); - QColorGroup act(pal.active()); + TQPalette pal(((TQWidget *)object)->tqpalette()); + TQColorGroup act(pal.active()); - act.setColor(QColorGroup::Foreground, useWindowCols + act.setColor(TQColorGroup::Foreground, useWindowCols ? itsActiveMdiTextColor : opts.customMenuTextColor ? opts.customMenuNormTextColor - : QApplication::palette().active().highlightedText()); + : TQApplication::tqpalette().active().highlightedText()); if(!opts.shadeMenubarOnlyWhenActive || useWindowCols) { - QColorGroup inact(pal.inactive()); - inact.setColor(QColorGroup::Foreground, useWindowCols ? itsMdiTextColor : act.color(QColorGroup::Foreground)); + TQColorGroup inact(pal.inactive()); + inact.setColor(TQColorGroup::Foreground, useWindowCols ? itsMdiTextColor : act.color(TQColorGroup::Foreground)); pal.setInactive(inact); } pal.setActive(act); - ((QWidget *)object)->setPalette(pal); + ((TQWidget *)object)->setPalette(pal); } } if(opts.shadeMenubarOnlyWhenActive && SHADE_NONE!=opts.shadeMenubars) switch(event->type()) { - case QEvent::WindowActivate: + case TQEvent::WindowActivate: itsActive=true; - ((QWidget *)object)->repaint(false); + ((TQWidget *)object)->tqrepaint(false); return false; - case QEvent::WindowDeactivate: + case TQEvent::WindowDeactivate: itsActive=false; - ((QWidget *)object)->repaint(false); + ((TQWidget *)object)->tqrepaint(false); return false; default: break; @@ -2216,41 +2221,41 @@ bool QtCurveStyle::eventFilter(QObject *object, QEvent *event) if(BLEND_TITLEBAR || opts.windowBorder&WINDOW_BORDER_USE_MENUBAR_COLOR_FOR_TITLEBAR) switch(event->type()) { - case QEvent::Resize: + case TQEvent::Resize: { - QResizeEvent *re = static_cast<QResizeEvent *>(event); + TQResizeEvent *re = TQT_TQRESIZEEVENT(event); if (re->size().height() != re->oldSize().height()) - emitMenuSize((QMenuBar *)object, re->size().height()); + emitMenuSize((TQMenuBar *)object, re->size().height()); break; } } } - if(dynamic_cast<QMouseEvent*>(event)) + if(dynamic_cast<TQMouseEvent*>(event)) switch(event->type()) { - case QEvent::MouseMove: // Only occurs for widgets with mouse tracking enabled + case TQEvent::MouseMove: // Only occurs for widgets with mouse tracking enabled if(itsDragWidget) { itsDragWidget->setMouseTracking(itsDragWidgetHadMouseTracking); bool move=isWindowDragWidget(object); if(move) - triggerWMMove(itsDragWidget, ((QMouseEvent *)event)->globalPos()); + triggerWMMove(itsDragWidget, ((TQMouseEvent *)event)->globalPos()); itsDragWidget = 0L; return move; } - case QEvent::MouseButtonPress: + case TQEvent::MouseButtonPress: { - QMouseEvent *mev = (QMouseEvent *)event; + TQMouseEvent *mev = (TQMouseEvent *)event; if(isWindowDragWidget(object, mev->pos())) { - if(/*Qt::NoModifier==mev->modifiers() && */ Qt::LeftButton==mev->button()) + if(/*TQt::NoModifier==mev->modifiers() && */ Qt::LeftButton==mev->button()) { - QWidget *wid = static_cast<QWidget*>(object); + TQWidget *wid = TQT_TQWIDGET(object); itsDragWidget=wid; itsDragWidgetHadMouseTracking=itsDragWidget->hasMouseTracking(); itsDragWidget->setMouseTracking(true); @@ -2259,7 +2264,7 @@ bool QtCurveStyle::eventFilter(QObject *object, QEvent *event) } break; } - case QEvent::MouseButtonRelease: + case TQEvent::MouseButtonRelease: if(itsDragWidget) { itsDragWidget->setMouseTracking(itsDragWidgetHadMouseTracking); @@ -2269,14 +2274,14 @@ bool QtCurveStyle::eventFilter(QObject *object, QEvent *event) break; } -#ifdef QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT - if(opts.fixParentlessDialogs && ::qt_cast<QDialog *>(object)) +#ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT + if(opts.fixParentlessDialogs && ::tqqt_cast<TQDialog *>(object)) { - QDialog *dlg=(QDialog *)object; + TQDialog *dlg=(TQDialog *)object; switch(event->type()) { - case QEvent::ShowMinimized: + case TQEvent::ShowMinimized: if(SKIP_TASKBAR && appIsNotEmbedded(dlg)) { // Ugly hack :-( Cant seem to get KWin to remove the minimize button. So when @@ -2285,7 +2290,7 @@ bool QtCurveStyle::eventFilter(QObject *object, QEvent *event) return true; } break; - case QEvent::WindowActivate: + case TQEvent::WindowActivate: if(SKIP_TASKBAR && appIsNotEmbedded(dlg)) { // OO.o's filepicker is a spawned process - but is not set transient :-( @@ -2297,14 +2302,14 @@ bool QtCurveStyle::eventFilter(QObject *object, QEvent *event) //setActions(dlg); } break; - case QEvent::Show: - // The parent->isShown is needed for KWord. It's insert picure file dialog is a + case TQEvent::Show: + // The tqparent->isShown is needed for KWord. It's insert picure file dialog is a // child of the insert picture dialog - but the file dialog is shown *before* the // picture dialog! - if((!dlg->parentWidget() || !dlg->parentWidget()->isShown())) // && - //(dlg->isModal() || ::qt_cast<QProgressDialog *>(object))) + if((!dlg->tqparentWidget() || !dlg->tqparentWidget()->isShown())) // && + //(dlg->isModal() || ::tqqt_cast<TQProgressDialog *>(object))) { - QWidget *activeWindow=qApp->activeWindow(); + TQWidget *activeWindow=tqApp->activeWindow(); if(activeWindow) { @@ -2345,47 +2350,47 @@ bool QtCurveStyle::eventFilter(QObject *object, QEvent *event) #endif // Track show events for progress bars - if (opts.animatedProgress && ::qt_cast<QProgressBar*>(object)) + if (opts.animatedProgress && ::tqqt_cast<TQProgressBar*>(object)) { - if(QEvent::Show==event->type() && !itsAnimationTimer->isActive()) + if(TQEvent::Show==event->type() && !itsAnimationTimer->isActive()) itsAnimationTimer->start(PROGRESS_ANIMATION, false); return false; } switch(event->type()) { - case QEvent::FocusIn: - case QEvent::FocusOut: - if(opts.highlightScrollViews && object->isWidgetType() && ::qt_cast<QScrollView*>(object)) - ((QWidget *)object)->repaint(false); + case TQEvent::FocusIn: + case TQEvent::FocusOut: + if(opts.highlightScrollViews && object->isWidgetType() && ::tqqt_cast<TQScrollView*>(object)) + ((TQWidget *)object)->tqrepaint(false); break; - case QEvent::Hide: - case QEvent::Show: - if(::qt_cast<QListBox *>(object) && - (((QListBox *)object)->parentWidget() && - ::qt_cast<QComboBox *>(((QListBox *)object)->parentWidget()))) - ((QComboBox *)(((QListBox *)object)->parentWidget()))->repaint(false); -// else if(::qt_cast<QFrame *>(object) && -// (QFrame::Box==((QFrame *)object)->frameShape() || QFrame::Panel==((QFrame *)object)->frameShape() || -// QFrame::WinPanel==((QFrame *)object)->frameShape())) -// ((QFrame *)object)->setFrameShape(QFrame::StyledPanel); + case TQEvent::Hide: + case TQEvent::Show: + if(::tqqt_cast<TQListBox *>(object) && + (((TQListBox *)object)->tqparentWidget() && + ::tqqt_cast<TQComboBox *>(((TQListBox *)object)->tqparentWidget()))) + ((TQComboBox *)(((TQListBox *)object)->tqparentWidget()))->tqrepaint(false); +// else if(::tqqt_cast<TQFrame *>(object) && +// (TQFrame::Box==((TQFrame *)object)->frameShape() || TQFrame::Panel==((TQFrame *)object)->frameShape() || +// TQFrame::WinPanel==((TQFrame *)object)->frameShape())) +// ((TQFrame *)object)->setFrameShape(TQFrame::StyledPanel); break; - case QEvent::Enter: + case TQEvent::Enter: if(object->isWidgetType()) { - itsHoverWidget=(QWidget *)object; + itsHoverWidget=(TQWidget *)object; if(itsHoverWidget && itsHoverWidget->isEnabled()) { - if(::qt_cast<QTabBar*>(object) && static_cast<QWidget*>(object)->isEnabled()) + if(::tqqt_cast<TQTabBar*>(object) && TQT_TQWIDGET(object)->isEnabled()) { itsHoverTab=0L; - itsHoverWidget->repaint(false); + itsHoverWidget->tqrepaint(false); } else if(!itsHoverWidget->hasMouseTracking() || (itsFormMode=isFormWidget(itsHoverWidget))) { - itsHoverWidget->repaint(false); + itsHoverWidget->tqrepaint(false); itsFormMode=false; } } @@ -2396,21 +2401,21 @@ bool QtCurveStyle::eventFilter(QObject *object, QEvent *event) itsIsSpecialHover=true; } break; - case QEvent::Leave: - if(itsHoverWidget && object==itsHoverWidget) + case TQEvent::Leave: + if(itsHoverWidget && TQT_BASE_OBJECT(object)==TQT_BASE_OBJECT(itsHoverWidget)) { resetHover(); - ((QWidget *)object)->repaint(false); + ((TQWidget *)object)->tqrepaint(false); } break; - case QEvent::MouseMove: // Only occurs for widgets with mouse tracking enabled + case TQEvent::MouseMove: // Only occurs for widgets with mouse tracking enabled { - QMouseEvent *me = static_cast<QMouseEvent*>(event); + TQMouseEvent *me = TQT_TQMOUSEEVENT(event); if(me && itsHoverWidget && object->isWidgetType()) { if(!me->pos().isNull() && itsIsSpecialHover && redrawHoverWidget(me->pos())) - itsHoverWidget->repaint(false); + itsHoverWidget->tqrepaint(false); itsOldPos=me->pos(); } break; @@ -2422,13 +2427,13 @@ bool QtCurveStyle::eventFilter(QObject *object, QEvent *event) return BASE_STYLE::eventFilter(object, event); } -void QtCurveStyle::drawLightBevel(const QColor &bgnd, QPainter *p, const QRect &rOrig, - const QColorGroup &cg, SFlags flags, - int round, const QColor &fill, const QColor *custom, +void TQtCurveStyle::drawLightBevel(const TQColor &bgnd, TQPainter *p, const TQRect &rOrig, + const TQColorGroup &cg, SFlags flags, + int round, const TQColor &fill, const TQColor *custom, bool doBorder, bool doCorners, EWidget w) const { EAppearance app(widgetApp(w, &opts)); - QRect r(rOrig), + TQRect r(rOrig), br(r); bool bevelledButton(WIDGET_BUTTON(w) && APPEARANCE_BEVELLED==app), sunken(flags &(Style_Down|Style_On|Style_Sunken)), @@ -2452,7 +2457,7 @@ void QtCurveStyle::drawLightBevel(const QColor &bgnd, QPainter *p, const QRect & glowFocus(doEtch && USE_GLOW_FOCUS(flags&Style_MouseOver) && flags&Style_HasFocus && flags&Style_Enabled), sunkenToggleMo(sunken && !(flags&Style_Down) && flags&(Style_MouseOver|TOGGLE_BUTTON)), horiz(flags&Style_Horizontal); - const QColor *cols(custom ? custom : itsBackgroundCols), + const TQColor *cols(custom ? custom : itsBackgroundCols), *border(colouredMouseOver ? borderColors(flags, cols) : cols); p->save(); @@ -2470,7 +2475,7 @@ void QtCurveStyle::drawLightBevel(const QColor &bgnd, QPainter *p, const QRect & if(WIDGET_PROGRESSBAR==w && opts.stripedProgress) { p->save(); - p->setClipRegion(p->clipRegion().eor(QRegion(br))); + p->setClipRegion(p->clipRegion().eor(TQRegion(br))); } br.addCoords(1, 1,-1,-1); drawBevelGradient(fill, p, br, horiz, sunken, app, w); @@ -2517,7 +2522,7 @@ void QtCurveStyle::drawLightBevel(const QColor &bgnd, QPainter *p, const QRect & if(!colouredMouseOver && lightBorder && br.width()>0 && br.height()>0) { - QColor col(cols[APPEARANCE_DULL_GLASS==app ? 1 : 0]); + TQColor col(cols[APPEARANCE_DULL_GLASS==app ? 1 : 0]); p->setPen(col); br=r; @@ -2545,16 +2550,16 @@ void QtCurveStyle::drawLightBevel(const QColor &bgnd, QPainter *p, const QRect & if(horiz) { - drawBevelGradient(itsMouseOverCols[col], p, QRect(r.x()+so, r.y(), len, r.height()), + drawBevelGradient(itsMouseOverCols[col], p, TQRect(r.x()+so, r.y(), len, r.height()), horiz, sunken, app, w); - drawBevelGradient(itsMouseOverCols[col], p, QRect(r.x()+r.width()-eo, r.y(), len, r.height()), + drawBevelGradient(itsMouseOverCols[col], p, TQRect(r.x()+r.width()-eo, r.y(), len, r.height()), horiz, sunken, app, w); } else { - drawBevelGradient(itsMouseOverCols[col], p, QRect(r.x(), r.y()+so, r.width(), len), + drawBevelGradient(itsMouseOverCols[col], p, TQRect(r.x(), r.y()+so, r.width(), len), horiz, sunken, app, w); - drawBevelGradient(itsMouseOverCols[col], p, QRect(r.x(), r.y()+r.height()-eo, r.width(), len), + drawBevelGradient(itsMouseOverCols[col], p, TQRect(r.x(), r.y()+r.height()-eo, r.width(), len), horiz, sunken, app, w); } } @@ -2606,7 +2611,7 @@ void QtCurveStyle::drawLightBevel(const QColor &bgnd, QPainter *p, const QRect & if(doBorder) { - const QColor *borderCols=glowFocus || + const TQColor *borderCols=glowFocus || (WIDGET_COMBO==w && USE_GLOW_FOCUS(flags&Style_MouseOver) && flags&Style_HasFocus && flags&Style_Enabled) ? itsFocusCols : (WIDGET_COMBO==w || WIDGET_COMBO_BUTTON==w) && cols==itsComboBtnCols @@ -2643,14 +2648,14 @@ void QtCurveStyle::drawLightBevel(const QColor &bgnd, QPainter *p, const QRect & p->restore(); } -void QtCurveStyle::drawGlow(QPainter *p, const QRect &r, const QColorGroup &cg, EWidget w, const QColor *cols) const +void TQtCurveStyle::drawGlow(TQPainter *p, const TQRect &r, const TQColorGroup &cg, EWidget w, const TQColor *cols) const { if(itsMouseOverCols || itsDefBtnCols || cols) { bool def(WIDGET_DEF_BUTTON==w && IND_GLOW==opts.defBtnIndicator), defShade=def && (!itsDefBtnCols || (itsMouseOverCols && itsDefBtnCols[ORIGINAL_SHADE]==itsMouseOverCols[ORIGINAL_SHADE])); - QColor col(cols ? cols[GLOW_MO] + TQColor col(cols ? cols[GLOW_MO] : (def && itsDefBtnCols) || !itsMouseOverCols ? itsDefBtnCols[GLOW_DEFBTN] : itsMouseOverCols[GLOW_MO]); @@ -2678,14 +2683,14 @@ void QtCurveStyle::drawGlow(QPainter *p, const QRect &r, const QColorGroup &cg, } } -void QtCurveStyle::drawEtch(QPainter *p, const QRect &r, const QColorGroup &cg, bool raised, bool square) const +void TQtCurveStyle::drawEtch(TQPainter *p, const TQRect &r, const TQColorGroup &cg, bool raised, bool square) const { square=square || ROUND_NONE==opts.round; int mod(square ? 0 : 2); { - QColor col(raised ? shade(cg.background(), ETCHED_DARK) : itsBackgroundCols[1]); + TQColor col(raised ? shade(cg.background(), ETCHED_DARK) : itsBackgroundCols[1]); p->setPen(col); p->drawLine(r.x()+mod, r.y()+r.height()-1, r.x()+r.width()-(1+mod), r.y()+r.height()-1); @@ -2700,7 +2705,7 @@ void QtCurveStyle::drawEtch(QPainter *p, const QRect &r, const QColorGroup &cg, } if(!raised) { - QColor darkCol(shade(cg.background(), ETCHED_DARK)); + TQColor darkCol(shade(cg.background(), ETCHED_DARK)); p->setPen(darkCol); p->drawLine(r.x()+1+mod, r.y(), r.x()+r.width()-(2+mod), r.y()); @@ -2715,13 +2720,13 @@ void QtCurveStyle::drawEtch(QPainter *p, const QRect &r, const QColorGroup &cg, } } -void QtCurveStyle::drawBorder(const QColor &bgnd, QPainter *p, const QRect &r, const QColorGroup &cg, - SFlags flags, int round, const QColor *custom, EWidget w, bool doCorners, +void TQtCurveStyle::drawBorder(const TQColor &bgnd, TQPainter *p, const TQRect &r, const TQColorGroup &cg, + SFlags flags, int round, const TQColor *custom, EWidget w, bool doCorners, EBorder borderProfile, bool blendBorderColors, int borderVal) const { EAppearance app(widgetApp(w, &opts)); - const QColor *cols(custom ? custom : itsBackgroundCols); - QColor border(flags&Style_ButtonDefault && IND_FONT_COLOR==opts.defBtnIndicator && + const TQColor *cols(custom ? custom : itsBackgroundCols); + TQColor border(flags&Style_ButtonDefault && IND_FONT_COLOR==opts.defBtnIndicator && flags&Style_Enabled ? cg.buttonText() : cols[WIDGET_PROGRESSBAR==w @@ -2824,9 +2829,9 @@ void QtCurveStyle::drawBorder(const QColor &bgnd, QPainter *p, const QRect &r, c //if(!opts.fillProgress || WIDGET_PROGRESSBAR!=w) { - QColor largeArcMid(midColor(border, bgnd)), + TQColor largeArcMid(midColor(border, bgnd)), aaColor(midColor(custom ? custom[3] : itsBackgroundCols[3], bgnd)); - QPixmap *pix=itsFormMode ? getPixelPixmap(border) : 0L; + TQPixmap *pix=itsFormMode ? getPixelPixmap(border) : 0L; if(round&CORNER_TL) { @@ -2965,7 +2970,7 @@ void QtCurveStyle::drawBorder(const QColor &bgnd, QPainter *p, const QRect &r, c } } -void QtCurveStyle::drawMdiIcon(QPainter *painter, const QColor &color, const QColor &shadow, const QRect &r, bool sunken, int margin, +void TQtCurveStyle::drawMdiIcon(TQPainter *painter, const TQColor &color, const TQColor &shadow, const TQRect &r, bool sunken, int margin, SubControl button) const { if(!sunken) @@ -2973,9 +2978,9 @@ void QtCurveStyle::drawMdiIcon(QPainter *painter, const QColor &color, const QCo drawWindowIcon(painter, color, r, sunken, margin, button); } -void QtCurveStyle::drawWindowIcon(QPainter *painter, const QColor &color, const QRect &r, bool sunken, int margin, SubControl button) const +void TQtCurveStyle::drawWindowIcon(TQPainter *painter, const TQColor &color, const TQRect &r, bool sunken, int margin, SubControl button) const { - QRect rect(r); + TQRect rect(r); // Icons look best at 22x22... if(rect.height()>22) @@ -3022,7 +3027,7 @@ void QtCurveStyle::drawWindowIcon(QPainter *painter, const QColor &color, const break; case SC_TitleBarNormalButton: { - QRect r2 = adjusted(rect, 0, 3, -3, 0); + TQRect r2 = adjusted(rect, 0, 3, -3, 0); painter->drawRect(r2); // adjusted(r2, 0, 0, -1, -1)); painter->drawLine(r2.left() + 1, r2.top() + 1, r2.right() - 1, r2.top() + 1); @@ -3031,8 +3036,8 @@ void QtCurveStyle::drawWindowIcon(QPainter *painter, const QColor &color, const painter->drawPoint(r2.bottomLeft()); painter->drawPoint(r2.bottomRight()); - QRect backWindowRect(adjusted(rect, 3, 0, 0, -3)); - QRegion clipRegion(backWindowRect); + TQRect backWindowRect(adjusted(rect, 3, 0, 0, -3)); + TQRegion clipRegion(backWindowRect); clipRegion -= r2; if(sunken) @@ -3056,22 +3061,22 @@ void QtCurveStyle::drawWindowIcon(QPainter *painter, const QColor &color, const } } -void QtCurveStyle::drawEntryField(QPainter *p, const QRect &rx, const QColorGroup &cg, +void TQtCurveStyle::drawEntryField(TQPainter *p, const TQRect &rx, const TQColorGroup &cg, SFlags flags, EntryColor coloration, int round, EWidget w) const { - const QColor *use(ENTRY_MOUSE_OVER==coloration && itsMouseOverCols + const TQColor *use(ENTRY_MOUSE_OVER==coloration && itsMouseOverCols ? itsMouseOverCols : ENTRY_FOCUS==coloration && itsFocusCols ? itsFocusCols : backgroundColors(cg)); bool isSpin(WIDGET_SPIN==w), doEtch(!itsFormMode && opts.etchEntry && (!isSpin || opts.unifySpin) && WIDGET_COMBO!=w && DO_EFFECT), - reverse(QApplication::reverseLayout()); + reverse(TQApplication::reverseLayout()); - if(WIDGET_SCROLLVIEW!=w && (opts.square&SQUARE_ENTRY)) + if(WIDGET_SCROLLVIEW!=w && (opts.square&STQUARE_ENTRY)) round=ROUNDED_NONE; - QRect r(rx); + TQRect r(rx); if(doEtch) r.addCoords(1, 1, -1, -1); @@ -3102,7 +3107,7 @@ void QtCurveStyle::drawEntryField(QPainter *p, const QRect &rx, const QColorGrou if(doEtch) { - QRect r(rx); + TQRect r(rx); p->setClipRegion(r); if(!(round&CORNER_TR) && !(round&CORNER_BR)) @@ -3115,35 +3120,35 @@ void QtCurveStyle::drawEntryField(QPainter *p, const QRect &rx, const QColorGrou } } -void QtCurveStyle::drawArrow(QPainter *p, const QRect &r, const QColorGroup &cg, SFlags flags, - PrimitiveElement pe, bool small, bool checkActive) const +void TQtCurveStyle::drawArrow(TQPainter *p, const TQRect &r, const TQColorGroup &cg, SFlags flags, + TQ_PrimitiveElement pe, bool small, bool checkActive) const { - const QColor &col(flags&Style_Enabled + const TQColor &col(flags&Style_Enabled ? checkActive && flags&Style_Active ? cg.highlightedText() : cg.text() : cg.mid()); - ::drawArrow(p, r, p->pen()==QPen::NoPen ? col : p->pen().color(), pe, opts, small); + ::drawArrow(p, r, p->pen().style()==TQPen::NoPen ? col : TQColor(p->pen().color()), pe, opts, small); } -void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect &r, - const QColorGroup &cg, SFlags flags, const QStyleOption &data) const +void TQtCurveStyle::tqdrawPrimitive(TQ_PrimitiveElement pe, TQPainter *p, const TQRect &r, + const TQColorGroup &cg, SFlags flags, const TQStyleOption &data) const { switch(pe) { case PE_HeaderSection: { // Is it a taskbar button? Kicker uses PE_HeaderSection for these! :-( - // If the painter device is a QWidger, assume its not a taskbar button... - if(APP_KICKER==itsThemedApp && (!p->device() || !dynamic_cast<QWidget *>(p->device()))) + // If the painter device is a TQWidger, assume its not a taskbar button... + if(APP_KICKER==itsThemedApp && (!p->device() || !dynamic_cast<TQWidget *>(p->device()))) { - const QColor *use(buttonColors(cg)); + const TQColor *use(buttonColors(cg)); if(flags&Style_Down) flags=((flags|Style_Down)^Style_Down)| Style_Sunken; flags|=Style_Enabled; -#if defined QTC_QT_ONLY || !defined KDE_VERSION || KDE_VERSION >= 0x30200 +#if defined TQTC_TQT_ONLY || !defined KDE_VERSION || KDE_VERSION >= 0x30200 #if defined KDE_VERSION && KDE_VERSION >= 0x30400 && KDE_VERSION < 0x30500 if(HOVER_KICKER==itsHover && itsHoverWidget) // && itsHoverWidget==p->device()) flags|=Style_MouseOver; @@ -3152,20 +3157,20 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & #endif drawLightBevel(p, r, cg, flags|Style_Horizontal, ROUNDED_ALL, getFill(flags, use), use, true, false); -#if defined QTC_QT_ONLY || !defined KDE_VERSION || KDE_VERSION >= 0x30200 +#if defined TQTC_TQT_ONLY || !defined KDE_VERSION || KDE_VERSION >= 0x30200 itsFormMode=false; #endif } else { bool isFirst(false), isLast(false), isTable(false), isSort(false); - QHeader *header(p && p->device() ? dynamic_cast<QHeader*>(p->device()) : 0L); + TQHeader *header(p && p->device() ? dynamic_cast<TQHeader*>(p->device()) : 0L); if (header) { - if(header->parent() && ::qt_cast<const QTable *>(header->parent())) + if(header->tqparent() && ::tqqt_cast<const TQTable *>(header->tqparent())) { - QTable *tbl((QTable *)(header->parent())); + TQTable *tbl((TQTable *)(header->tqparent())); isTable=true; if(flags&Style_Horizontal) @@ -3181,10 +3186,10 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & } } else if(0==flags) // Header on popup menu? - { QWidget *widget(p && p->device() ? dynamic_cast<QWidget*>(p->device()) : 0L); + { TQWidget *widget(p && p->device() ? dynamic_cast<TQWidget*>(p->device()) : 0L); bool menuTitle(widget && 0==qstrcmp(widget->className(), "KPopupTitle")); - const QColor *use(buttonColors(cg)); - QRect r2(r); + const TQColor *use(buttonColors(cg)); + TQRect r2(r); if(menuTitle) r2.addCoords(2, 2, -2, -2); @@ -3192,7 +3197,7 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & break; } - const QColor *use(flags&Style_Enabled && itsSortedLvColors && isSort + const TQColor *use(flags&Style_Enabled && itsSortedLvColors && isSort ? itsSortedLvColors : opts.lvButton ? buttonColors(cg) : backgroundColors(cg)); @@ -3200,7 +3205,7 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & if(NO_SECT!=itsHoverSect && HOVER_HEADER==itsHover && itsHoverWidget) { - QHeader *hd(::qt_cast<QHeader *>(itsHoverWidget)); + TQHeader *hd(::tqqt_cast<TQHeader *>(itsHoverWidget)); if(hd && hd->isClickEnabled(itsHoverSect) && r==hd->sectionRect(itsHoverSect)) flags|=Style_MouseOver; @@ -3226,7 +3231,7 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & p->drawLine(r.x(), r.y()+r.height()-1, r.x()+r.width()-1, r.y()+r.height()-1); if(itsMouseOverCols && opts.coloredMouseOver && flags&Style_MouseOver) - drawHighlight(p, QRect(r.x(), r.y()+r.height()-2, r.width(), 2), cg, true, true); + drawHighlight(p, TQRect(r.x(), r.y()+r.height()-2, r.width(), 2), cg, true, true); if(!isFirst) { @@ -3252,7 +3257,7 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & } if(itsMouseOverCols && opts.coloredMouseOver && flags&Style_MouseOver) - drawHighlight(p, QRect(r.x(), r.y()+r.height()-3, r.width(), 2), cg, true, true); + drawHighlight(p, TQRect(r.x(), r.y()+r.height()-3, r.width(), 2), cg, true, true); } } break; @@ -3266,7 +3271,7 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & case PE_ButtonTool: case PE_ButtonDropDown: { - const QColor *use((IND_TINT==opts.defBtnIndicator || IND_SELECTED==opts.defBtnIndicator) && flags&Style_Enabled && flags&Style_ButtonDefault + const TQColor *use((IND_TINT==opts.defBtnIndicator || IND_SELECTED==opts.defBtnIndicator) && flags&Style_Enabled && flags&Style_ButtonDefault ? itsDefBtnCols : buttonColors(cg)); bool glassMod(PE_ButtonTool==pe && IS_GLASS(opts.appearance) && IS_GLASS(opts.toolbarAppearance)), @@ -3304,7 +3309,7 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & ? cg.background().dark(DW_BGND) : */cg.background(), p, r, cg, glassMod ? flags : flags|Style_Horizontal, -#if defined QTC_QT_ONLY || !defined KDE_VERSION || KDE_VERSION >= 0x30200 +#if defined TQTC_TQT_ONLY || !defined KDE_VERSION || KDE_VERSION >= 0x30200 (APP_KORN==itsThemedApp && itsIsTransKicker && PE_ButtonTool==pe) || #endif operaMdi || mdi @@ -3321,8 +3326,8 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & if(IND_COLORED==opts.defBtnIndicator && flags&Style_ButtonDefault && flags&Style_Enabled) { - QRegion outer(r); - QRect r2(r); + TQRegion outer(r); + TQRect r2(r); if(!itsFormMode && DO_EFFECT) r2.addCoords(1, 1, -1, -1); @@ -3330,13 +3335,13 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & r2.addCoords(COLORED_BORDER_SIZE, COLORED_BORDER_SIZE, -COLORED_BORDER_SIZE, -COLORED_BORDER_SIZE); - QRegion inner(r2); + TQRegion inner(r2); p->setClipRegion(outer.eor(inner)); drawLightBevel(p, r, cg, glassMod ? flags : flags|Style_Horizontal, flags&CHECK_BUTTON -#if defined QTC_QT_ONLY || !defined KDE_VERSION || KDE_VERSION >= 0x30200 +#if defined TQTC_TQT_ONLY || !defined KDE_VERSION || KDE_VERSION >= 0x30200 || (APP_KORN==itsThemedApp && itsIsTransKicker && PE_ButtonTool==pe) #endif ? ROUNDED_NONE : ROUNDED_ALL, @@ -3353,11 +3358,11 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & { case IND_CORNER: { - QPointArray points; + TQPointArray points; bool sunken(flags&Style_Down || flags&Style_Sunken); int offset(sunken ? 5 : 4), etchOffset(DO_EFFECT ? 1 : 0); - const QColor *cols(itsFocusCols ? itsFocusCols : itsHighlightCols); + const TQColor *cols(itsFocusCols ? itsFocusCols : itsHighlightCols); points.setPoints(3, r.x()+offset+etchOffset, r.y()+offset+etchOffset, r.x()+offset+6+etchOffset, r.y()+offset+etchOffset, r.x()+offset+etchOffset, r.y()+offset+6+etchOffset); @@ -3374,7 +3379,7 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & case PE_CheckMark: if(flags&Style_On) { - QPixmap *pix(getPixmap(checkRadioCol(flags, cg), PIX_CHECK, 1.0)); + TQPixmap *pix(getPixmap(checkRadioCol(flags, cg), PIX_CHECK, 1.0)); p->drawPixmap(r.center().x()-(pix->width()/2), r.center().y()-(pix->height()/2), *pix); @@ -3390,11 +3395,11 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & break; case PE_CheckListController: { - QCheckListItem *item(data.checkListItem()); + TQCheckListItem *item(data.checkListItem()); if(item) { - const QColor *bc(borderColors(flags, 0L)), + const TQColor *bc(borderColors(flags, 0L)), *btn(buttonColors(cg)), *use(bc ? bc : btn); int x(r.x()+1), y(r.y()+2); @@ -3402,40 +3407,40 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & p->drawPixmap(x, y, *getPixmap(use[opts.coloredMouseOver && flags&Style_MouseOver ? 4 : BORDER_VAL(flags&Style_Enabled)], PIX_RADIO_BORDER, 0.8)); - ::drawArrow(p, QRect(r.x()-1, r.y()-1, r.width(), r.height()), + ::drawArrow(p, TQRect(r.x()-1, r.y()-1, r.width(), r.height()), use[opts.coloredMouseOver && flags&Style_MouseOver ? 4:5], PE_ArrowDown, opts); } break; } case PE_CheckListIndicator: { - QCheckListItem *item(data.checkListItem()); + TQCheckListItem *item(data.checkListItem()); if(item) { - QListView *lv(item->listView()); + TQListView *lv(item->listView()); - p->setPen(QPen(flags&Style_Enabled ? cg.text() - : lv->palette().color(QPalette::Disabled, - QColorGroup::Text))); + p->setPen(TQPen(flags&Style_Enabled ? cg.text() + : lv->tqpalette().color(TQPalette::Disabled, + TQColorGroup::Text))); if (flags&Style_Selected) { flags-=Style_Selected; - if(!lv->rootIsDecorated() && !((item->parent() && 1==item->parent()->rtti() && - QCheckListItem::Controller==((QCheckListItem*)item->parent())->type()))) + if(!lv->rootIsDecorated() && !((item->tqparent() && 1==item->tqparent()->rtti() && + TQCheckListItem::Controller==((TQCheckListItem*)item->tqparent())->type()))) { p->fillRect(0, 0, r.x()+lv->itemMargin()+r.width()+4, item->height(), - cg.brush(QColorGroup::Highlight)); + cg.brush(TQColorGroup::Highlight)); if(item->isEnabled()) { - p->setPen(QPen(cg.highlightedText())); + p->setPen(TQPen(cg.highlightedText())); flags+=Style_Selected; } } } - QRect checkRect(r.x()+1, r.y()+1, opts.crSize, opts.crSize); - drawPrimitive(PE_Indicator, p, checkRect, cg, flags|LISTVIEW_ITEM); + TQRect checkRect(r.x()+1, r.y()+1, opts.crSize, opts.crSize); + tqdrawPrimitive(PE_Indicator, p, checkRect, cg, flags|LISTVIEW_ITEM); } break; } @@ -3456,7 +3461,7 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & bool doEtch(DO_EFFECT && !itsFormMode && !(flags&LISTVIEW_ITEM)), on(flags&Style_On || !(flags&Style_Off)), sunken(flags&Style_Down); - QRect rect(doEtch ? QRect(r.x()+1, r.y()+1, r.width()-2, r.height()-2) : r); + TQRect rect(doEtch ? TQRect(r.x()+1, r.y()+1, r.width()-2, r.height()-2) : r); SFlags sflags(!(flags&Style_Off) ? flags|Style_On : flags); if(sunken || (!itsFormMode && HOVER_NONE==itsHover)) @@ -3464,7 +3469,7 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & bool glowFocus(USE_GLOW_FOCUS(flags&Style_MouseOver) && sflags&Style_Enabled && sflags&Style_HasFocus), glow(doEtch && sflags&Style_Enabled && ((MO_GLOW==opts.coloredMouseOver && sflags&Style_MouseOver) || glowFocus)); - const QColor *bc(glowFocus ? itsFocusCols : borderColors(sflags, 0L)), + const TQColor *bc(glowFocus ? itsFocusCols : borderColors(sflags, 0L)), *btn(checkRadioColors(cg, sflags)), *use(bc ? bc : btn), &bgnd(opts.crButton @@ -3484,22 +3489,22 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & drawDark=drawLight && draw3dFull && !lightBorder; if(IS_FLAT(opts.appearance)) - p->fillRect(QRect(rect.x()+1, rect.y()+1, rect.width()-2, rect.height()-2), bgnd); + p->fillRect(TQRect(rect.x()+1, rect.y()+1, rect.width()-2, rect.height()-2), bgnd); else - drawBevelGradient(bgnd, p, QRect(rect.x()+1, rect.y()+1, rect.width()-2, rect.height()-2), true, + drawBevelGradient(bgnd, p, TQRect(rect.x()+1, rect.y()+1, rect.width()-2, rect.height()-2), true, drawSunken, app, wid); if(MO_NONE!=opts.coloredMouseOver && !glow && sflags&Style_MouseOver && sflags&Style_Enabled) { p->setPen(use[CR_MO_FILL]); - p->drawRect(QRect(rect.x()+1, rect.y()+1, rect.width()-2, rect.height()-2)); - // p->drawRect(QRect(rect.x()+2, rect.y()+2, rect.width()-4, rect.height()-4)); + p->drawRect(TQRect(rect.x()+1, rect.y()+1, rect.width()-2, rect.height()-2)); + // p->drawRect(TQRect(rect.x()+2, rect.y()+2, rect.width()-4, rect.height()-4)); } else if(!opts.crButton || drawLight) { p->setPen(drawLight ? btn[LIGHT_BORDER(app)] : midColor(sflags&Style_Enabled ? cg.base() : cg.background(), use[3])); if(lightBorder) - p->drawRect(QRect(rect.x()+1, rect.y()+1, rect.width()-2, rect.height()-2)); + p->drawRect(TQRect(rect.x()+1, rect.y()+1, rect.width()-2, rect.height()-2)); else { p->drawLine(rect.x()+1, rect.y()+1, rect.x()+1, rect.y()+rect.height()-2); @@ -3521,14 +3526,14 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & if(doEtch) { - QColor topCol(glow + TQColor topCol(glow ? glowFocus ? itsFocusCols[GLOW_MO] : itsMouseOverCols[GLOW_MO] : shade(cg.background(), ETCHED_DARK)), botCol(glow ? topCol : itsBackgroundCols[1]); - p->setBrush(Qt::NoBrush); + p->setBrush(TQt::NoBrush); p->setPen(topCol); if(!opts.crButton || EFFECT_SHADOW!=opts.buttonEffect || drawSunken || glow) { @@ -3541,16 +3546,16 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & } if(on) - drawPrimitive(PE_CheckMark, p, rect, cg, flags); + tqdrawPrimitive(PE_CheckMark, p, rect, cg, flags); break; } case PE_CheckListExclusiveIndicator: { - QCheckListItem *item(data.checkListItem()); + TQCheckListItem *item(data.checkListItem()); if(item) { - const QColor *bc(borderColors(flags, 0L)), + const TQColor *bc(borderColors(flags, 0L)), *btn(buttonColors(cg)), *use(bc ? bc : btn), &on(checkRadioCol(flags, cg)); @@ -3569,18 +3574,18 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & if(PE_ExclusiveIndicatorMask==pe) { p->fillRect(r, color0); - p->setPen(Qt::color1); - p->setBrush(Qt::color1); + p->setPen(TQt::color1); + p->setBrush(TQt::color1); p->drawPie(r, 0, 5760); } else { bool doEtch(DO_EFFECT && !itsFormMode), sunken(flags&Style_Down); - QRect rect(doEtch ? QRect(r.x()+1, r.y()+1, r.width()-2, r.height()-2) : r); + TQRect rect(doEtch ? TQRect(r.x()+1, r.y()+1, r.width()-2, r.height()-2) : r); int x(rect.x()), y(rect.y()); - QPointArray clipRegion; + TQPointArray clipRegion; clipRegion.setPoints(8, x, y+8, x, y+4, x+4, y, x+8, y, x+12, y+4, x+12, y+8, x+8, y+12, x+4, y+12); @@ -3596,10 +3601,10 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & set(sflags&Style_On), coloredMo(MO_NONE!=opts.coloredMouseOver && !glow && sflags&Style_MouseOver && sflags&Style_Enabled); - const QColor *bc(glowFocus ? itsFocusCols : borderColors(sflags, 0L)), + const TQColor *bc(glowFocus ? itsFocusCols : borderColors(sflags, 0L)), *btn(checkRadioColors(cg, sflags)), *use(bc ? bc : btn); - const QColor &on(checkRadioCol(flags, cg)), + const TQColor &on(checkRadioCol(flags, cg)), &bgnd(opts.crButton ? getFill(flags, btn, true) : sflags&Style_Enabled && !sunken @@ -3626,25 +3631,25 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & if(doEtch && !glow && opts.crButton && !drawSunken && EFFECT_SHADOW==opts.buttonEffect) { - p->setBrush(Qt::NoBrush); + p->setBrush(TQt::NoBrush); p->setPen(shade(cg.background(), ETCHED_DARK)); - p->drawArc(QRect(r.x(), r.y(), opts.crSize, opts.crSize), 225*16, 180*16); + p->drawArc(TQRect(r.x(), r.y(), opts.crSize, opts.crSize), 225*16, 180*16); doneShadow=true; } - p->setClipRegion(QRegion(clipRegion)); + p->setClipRegion(TQRegion(clipRegion)); if(IS_FLAT(opts.appearance)) - p->fillRect(QRect(x+1, y+1, rect.width()-2, rect.height()-2), bgnd); + p->fillRect(TQRect(x+1, y+1, rect.width()-2, rect.height()-2), bgnd); else - drawBevelGradient(bgnd, p, QRect(x+1, y+1, rect.width()-2, rect.height()-2), true, + drawBevelGradient(bgnd, p, TQRect(x+1, y+1, rect.width()-2, rect.height()-2), true, drawSunken, app, wid); if(coloredMo) { p->setPen(use[CR_MO_FILL]); - p->drawArc(QRect(x+1, y+1, opts.crSize-2, opts.crSize-2), 0, 360*16); -// p->drawArc(QRect(x+2, y+2, opts.crSize-4, opts.crSize-4), 0, 360*16); -// p->drawArc(QRect(x+3, y+3, opts.crSize-6, opts.crSize-6), 0, 360*16); + p->drawArc(TQRect(x+1, y+1, opts.crSize-2, opts.crSize-2), 0, 360*16); +// p->drawArc(TQRect(x+2, y+2, opts.crSize-4, opts.crSize-4), 0, 360*16); +// p->drawArc(TQRect(x+3, y+3, opts.crSize-6, opts.crSize-6), 0, 360*16); p->drawPoint(x+2, y+4); p->drawPoint(x+4, y+2); p->drawPoint(x+8, y+2); @@ -3659,35 +3664,35 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & if(doEtch && !doneShadow) { - QColor topCol(glow + TQColor topCol(glow ? glowFocus ? itsFocusCols[GLOW_MO] : itsMouseOverCols[GLOW_MO] : shade(cg.background(), ETCHED_DARK)), botCol(glow ? topCol : itsBackgroundCols[1]); - p->setBrush(Qt::NoBrush); + p->setBrush(TQt::NoBrush); p->setPen(topCol); if(drawSunken || glow) { - p->drawArc(QRect(r.x(), r.y(), opts.crSize, opts.crSize), 45*16, 180*16); + p->drawArc(TQRect(r.x(), r.y(), opts.crSize, opts.crSize), 45*16, 180*16); p->setPen(botCol); } - p->drawArc(QRect(r.x(), r.y(), opts.crSize, opts.crSize), 225*16, 180*16); + p->drawArc(TQRect(r.x(), r.y(), opts.crSize, opts.crSize), 225*16, 180*16); } p->drawPixmap(rect.x(), rect.y(), *getPixmap(use[BORDER_VAL(flags&Style_Enabled)], PIX_RADIO_BORDER, 0.8)); - if(QApplication::NormalColor!=QApplication::colorSpec() || itsFormMode) + if(TQApplication::NormalColor!=TQApplication::colorSpec() || itsFormMode) { - p->setPen(QPen(use[opts.coloredMouseOver && sflags&Style_MouseOver ? 4 : BORDER_VAL(flags&Style_Enabled)], 1)); + p->setPen(TQPen(use[opts.coloredMouseOver && sflags&Style_MouseOver ? 4 : BORDER_VAL(flags&Style_Enabled)], 1)); p->drawArc(rect, 0, 5760); } if(set) p->drawPixmap(rect.x(), rect.y(), *getPixmap(on, PIX_RADIO_ON, 1.0)); - if(!coloredMo && (!opts.crButton || drawLight) && (QApplication::NormalColor==QApplication::colorSpec() || itsFormMode)) + if(!coloredMo && (!opts.crButton || drawLight) && (TQApplication::NormalColor==TQApplication::colorSpec() || itsFormMode)) p->drawPixmap(rect.x(), rect.y(), *getPixmap(btn[drawLight ? LIGHT_BORDER(app) : (sflags&Style_MouseOver ? 3 : 4)], @@ -3697,7 +3702,7 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & break; case PE_DockWindowSeparator: { - QRect r2(r); + TQRect r2(r); r2.addCoords(-1, -1, 2, 2); drawMenuOrToolBarBackground(p, r2, cg, false, flags&Style_Horizontal); @@ -3753,12 +3758,12 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & if(itsHoverWidget && itsHoverWidget == p->device()) flags|=Style_MouseOver; - const QColor *use(buttonColors(cg)); - const QColor *border(borderColors(flags, use)); + const TQColor *use(buttonColors(cg)); + const TQColor *border(borderColors(flags, use)); - QColor color(cg.background()); + TQColor color(cg.background()); - if(0!=opts.tabBgnd && p->device() && inStackWidget(dynamic_cast<const QWidget *>(p->device()))) + if(0!=opts.tabBgnd && p->device() && inStackWidget(dynamic_cast<const TQWidget *>(p->device()))) color=shade(color, TO_FACTOR(opts.tabBgnd)); if(flags&Style_MouseOver && opts.splitterHighlight) @@ -3789,9 +3794,9 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & case PE_PanelGroupBox: if(FRAME_LINE==opts.groupBox) { - QRect r2(r); - if(p && p->device() && dynamic_cast<QGroupBox *>(p->device()) && - (!((QGroupBox *)(p->device()))->title().isEmpty() || ((QGroupBox *)(p->device()))->isCheckable())) + TQRect r2(r); + if(p && p->device() && dynamic_cast<TQGroupBox *>(p->device()) && + (!((TQGroupBox *)(p->device()))->title().isEmpty() || ((TQGroupBox *)(p->device()))->isCheckable())) r2.addCoords(8, 0, -8, 0); p->setPen(backgroundColors(cg)[STD_BORDER]); p->drawLine(r2.x(), r2.y(), r2.x()+r2.width()-1, r2.y()); @@ -3799,13 +3804,13 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & else if (FRAME_NONE!=opts.groupBox) if(APP_OPENOFFICE==itsThemedApp || data.lineWidth()>0 || data.isDefault()) { - const QColor *use(backgroundColors(cg)); + const TQColor *use(backgroundColors(cg)); drawBorder(cg.background(), p, r, cg, (SFlags)(flags|Style_Horizontal), - opts.square&SQUARE_FRAME ? ROUNDED_NONE : ROUNDED_ALL, use, WIDGET_OTHER, true, BORDER_FLAT); + opts.square&STQUARE_FRAME ? ROUNDED_NONE : ROUNDED_ALL, use, WIDGET_OTHER, true, BORDER_FLAT); } else - QCommonStyle::drawPrimitive(pe, p, r, cg, flags, data); + TQCommonStyle::tqdrawPrimitive(pe, p, r, cg, flags, data); break; case PE_WindowFrame: if(data.lineWidth()>0 || data.isDefault()) @@ -3814,18 +3819,18 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & break; case PE_Panel: if((APP_KICKER==itsThemedApp && data.isDefault()) || - dynamic_cast<QDockWindow *>(p->device())) + dynamic_cast<TQDockWindow *>(p->device())) break; if(APP_OPENOFFICE==itsThemedApp || data.lineWidth()>0 || data.isDefault()) { - const QWidget *widget=p && p->device() ? dynamic_cast<const QWidget *>(p->device()) : 0L; - bool sv(widget && ::qt_cast<const QScrollView *>(widget)), - square((opts.square&SQUARE_SCROLLVIEW) && + const TQWidget *widget=p && p->device() ? dynamic_cast<const TQWidget *>(p->device()) : 0L; + bool sv(widget && ::tqqt_cast<const TQScrollView *>(widget)), + square((opts.square&STQUARE_SCROLLVIEW) && (sv || - (widget && widget->parentWidget() && ::qt_cast<const QFrame *>(widget) && - widget->parentWidget()->inherits("KateView")))); - const QColor *use(opts.highlightScrollViews && /*!square &&*/ flags&Style_HasFocus ? itsHighlightCols : + (widget && widget->tqparentWidget() && ::tqqt_cast<const TQFrame *>(widget) && + widget->tqparentWidget()->inherits("KateView")))); + const TQColor *use(opts.highlightScrollViews && /*!square &&*/ flags&Style_HasFocus ? itsHighlightCols : backgroundColors(cg)); // if(square) @@ -3843,7 +3848,7 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & itsFormMode=itsIsTransKicker; if(sv && !opts.highlightScrollViews) flags&=~Style_HasFocus; - if(sv && opts.etchEntry && ((QFrame *)widget)->lineWidth()>2) + if(sv && opts.etchEntry && ((TQFrame *)widget)->lineWidth()>2) { drawEntryField(p, r, cg, flags, flags&Style_Enabled ? /*flags&Style_MouseOver @@ -3862,21 +3867,21 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & } } else - QCommonStyle::drawPrimitive(pe, p, r, cg, flags, data); + TQCommonStyle::tqdrawPrimitive(pe, p, r, cg, flags, data); break; case PE_PanelTabWidget: { - const QColor *use(backgroundColors(cg)); + const TQColor *use(backgroundColors(cg)); drawBorder(cg.background(), p, r, cg, (SFlags)(flags|Style_Horizontal|Style_Enabled), - opts.square&SQUARE_TAB_FRAME ? ROUNDED_NONE : ROUNDED_ALL, use, WIDGET_OTHER, true, + opts.square&STQUARE_TAB_FRAME ? ROUNDED_NONE : ROUNDED_ALL, use, WIDGET_OTHER, true, opts.borderTab ? BORDER_LIGHT : BORDER_RAISED, false); break; } case PE_PanelPopup: { - const QColor *use(backgroundColors(cg)); + const TQColor *use(backgroundColors(cg)); p->setPen(use[STD_BORDER]); p->setBrush(NoBrush); @@ -3886,7 +3891,7 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & else if(USE_LIGHTER_POPUP_MENU) { p->setPen(/*USE_LIGHTER_POPUP_MENU ? */itsLighterPopupMenuBgndCol/* : cg.background()*/); - p->drawRect(QRect(r.x()+1, r.y()+1, r.width()-2, r.height()-2)); + p->drawRect(TQRect(r.x()+1, r.y()+1, r.width()-2, r.height()-2)); } else { @@ -3901,7 +3906,7 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & } case PE_TabBarBase: { - const QColor *use(backgroundColors(cg)); + const TQColor *use(backgroundColors(cg)); bool flat(APPEARANCE_FLAT==opts.appearance); if(data.isDefault() || data.lineWidth()>1) @@ -3910,13 +3915,13 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & p->setBrush(NoBrush); p->drawRect(r); qDrawShadePanel(p, r.x()+1, r.y()+1, r.width()-2, r.height()-2, - QColorGroup(use[flat ? ORIGINAL_SHADE : 4], use[ORIGINAL_SHADE], + TQColorGroup(use[flat ? ORIGINAL_SHADE : 4], use[ORIGINAL_SHADE], use[0], use[flat ? ORIGINAL_SHADE : 4], use[2], cg.text(), use[ORIGINAL_SHADE]), flags & Style_Sunken, data.isDefault() ? 1 : data.lineWidth()-1); } else - qDrawShadePanel(p, r, QColorGroup(use[flat ? ORIGINAL_SHADE : 5], + qDrawShadePanel(p, r, TQColorGroup(use[flat ? ORIGINAL_SHADE : 5], use[ORIGINAL_SHADE], use[0], use[flat ? ORIGINAL_SHADE : 5], use[2], cg.text(), use[ORIGINAL_SHADE]), flags & Style_Sunken, data.isDefault() ? 2 : data.lineWidth()); @@ -3926,7 +3931,7 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & case PE_PanelMenuBar: { // fix for toolbar lag (from Mosfet Liquid) - QWidget *w = dynamic_cast<QWidget *>(p->device()); + TQWidget *w = dynamic_cast<TQWidget *>(p->device()); if(w) { @@ -3935,7 +3940,7 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & if(itsActive && opts.shadeMenubarOnlyWhenActive && SHADE_NONE!=opts.shadeMenubars) { - QWidget *top=w->topLevelWidget(); + TQWidget *top=w->tqtopLevelWidget(); if(top && !top->isActiveWindow()) itsActive=false; @@ -3947,7 +3952,7 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & if(TB_NONE!=opts.toolbarBorders) { - const QColor *use=PE_PanelMenuBar==pe + const TQColor *use=PE_PanelMenuBar==pe ? menuColors(cg, itsActive) : backgroundColors(cg.background()); bool dark(TB_DARK==opts.toolbarBorders || TB_DARK_ALL==opts.toolbarBorders); @@ -3984,9 +3989,9 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & case PE_ScrollBarAddLine: case PE_ScrollBarSubLine: { - QRect br(r), + TQRect br(r), ar(r); - const QColor *use(flags&Style_Enabled ? itsButtonCols : itsBackgroundCols); // buttonColors(cg)); + const TQColor *use(flags&Style_Enabled ? itsButtonCols : itsBackgroundCols); // buttonColors(cg)); pe=flags&Style_Horizontal ? PE_ScrollBarAddLine==pe ? PE_ArrowRight : PE_ArrowLeft @@ -4063,26 +4068,26 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & // Menu item style selection... if(opts.gtkComboMenus) { - QWidget *widget(dynamic_cast<QWidget*>(p->device())); + TQWidget *widget(dynamic_cast<TQWidget*>(p->device())); - if(widget && 0==qstrcmp(widget->className(), "QViewportWidget") && - widget->parentWidget() && ::qt_cast<QListBox *>(widget->parentWidget()) && - widget->parentWidget()->parentWidget() && ::qt_cast<QComboBox *>(widget->parentWidget()->parentWidget())) + if(widget && 0==qstrcmp(widget->className(), "TQViewportWidget") && + widget->tqparentWidget() && ::tqqt_cast<TQListBox *>(widget->tqparentWidget()) && + widget->tqparentWidget()->tqparentWidget() && ::tqqt_cast<TQComboBox *>(widget->tqparentWidget()->tqparentWidget())) { - struct QtCurveListBoxItem : public QListBoxItem + struct TQtCurveListBoxItem : public TQListBoxItem { - void paintContents(QPainter *p) + void paintContents(TQPainter *p) { paint(p); } }; - QListBox *box=(QListBox *)widget->parentWidget(); - QtCurveListBoxItem *item=(QtCurveListBoxItem *)(box->item(box->currentItem())); + TQListBox *box=(TQListBox *)widget->tqparentWidget(); + TQtCurveListBoxItem *item=(TQtCurveListBoxItem *)(box->item(box->currentItem())); if(item) { - //p->fillRect(r, Qt::black); + //p->fillRect(r, TQt::black); drawMenuItem(p, r, cg, false, ROUNDED_ALL, USE_LIGHTER_POPUP_MENU ? itsLighterPopupMenuBgndCol : itsBackgroundCols[ORIGINAL_SHADE], itsHighlightCols); @@ -4094,18 +4099,18 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & #endif if(FOCUS_STANDARD==opts.focus) { - p->setPen(Qt::black); + p->setPen(TQt::black); p->drawWinFocusRect(r); } else { //Figuring out in what beast we are painting... - QWidget *widget(dynamic_cast<QWidget*>(p->device())); - bool view(widget && (dynamic_cast<QScrollView*>(widget->parent()) || - dynamic_cast<QListBox*>(widget->parent()))); + TQWidget *widget(dynamic_cast<TQWidget*>(p->device())); + bool view(widget && (dynamic_cast<TQScrollView*>(widget->tqparent()) || + dynamic_cast<TQListBox*>(widget->tqparent()))); if(widget && FOCUS_GLOW==opts.focus && - (dynamic_cast<const QButton *>(widget) || dynamic_cast<const QComboBox *>(widget))) + (dynamic_cast<const TQButton *>(widget) || dynamic_cast<const TQComboBox *>(widget))) return; if(FOCUS_LINE==opts.focus) @@ -4117,7 +4122,7 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & } else if(r.width()<4 || r.height()<4 || view) { -// QRect r2(r); +// TQRect r2(r); p->setPen(view ? (flags&Style_Selected ? cg.highlightedText() : cg.text()) : itsFocusCols[FOCUS_SHADE(flags&Style_Selected)]); // if(view) @@ -4141,9 +4146,9 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & case PE_SpinWidgetPlus: case PE_SpinWidgetMinus: { - QRect sr(r); - const QColor *use(buttonColors(cg)); - bool reverse(QApplication::reverseLayout()); + TQRect sr(r); + const TQColor *use(buttonColors(cg)); + bool reverse(TQApplication::reverseLayout()); if((!opts.unifySpinBtns || flags&Style_Sunken) && !opts.unifySpin) drawLightBevel(p, sr, cg, flags|Style_Horizontal, PE_SpinWidgetDown==pe || PE_SpinWidgetMinus==pe @@ -4172,15 +4177,15 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & } else { - int l(QMIN(r.width()-6, r.height()-6)); - QPoint c(r.x()+(r.width()/2), r.y()+(r.height()/2)); + int l(TQMIN(r.width()-6, r.height()-6)); + TQPoint c(r.x()+(r.width()/2), r.y()+(r.height()/2)); l/=2; if(l%2 != 0) --l; if(flags&Style_Sunken && !opts.unifySpin) - c+=QPoint(1, 1); + c+=TQPoint(1, 1); p->setPen(MO_ARROW(cg.buttonText())); p->drawLine(c.x()-l, c.y(), c.x()+l, c.y()); @@ -4191,12 +4196,12 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & } case PE_PanelLineEdit: { - const QWidget *widget=p && p->device() ? dynamic_cast<const QWidget *>(p->device()) : 0L; - bool scrollView=widget && ::qt_cast<const QScrollView *>(widget); + const TQWidget *widget=p && p->device() ? dynamic_cast<const TQWidget *>(p->device()) : 0L; + bool scrollView=widget && ::tqqt_cast<const TQScrollView *>(widget); -// if((opts.square&SQUARE_SCROLLVIEW) && scrollView) +// if((opts.square&STQUARE_SCROLLVIEW) && scrollView) // { -// const QColor *use(backgroundColors(cg)); +// const TQColor *use(backgroundColors(cg)); // // p->setPen(use[STD_BORDER]); // p->drawLine(r.bottomLeft(), r.topLeft()); @@ -4212,9 +4217,9 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & isEnabled(true); // panel is highlighted by default if it has focus, but if we have access to the // widget itself we can try to avoid highlighting in case it's readOnly or disabled. - if (!scrollView && widget && dynamic_cast<const QLineEdit*>(widget)) + if (!scrollView && widget && dynamic_cast<const TQLineEdit*>(widget)) { - const QLineEdit *lineEdit(dynamic_cast<const QLineEdit*>(widget)); + const TQLineEdit *lineEdit(dynamic_cast<const TQLineEdit*>(widget)); isReadOnly = lineEdit->isReadOnly(); isEnabled = lineEdit->isEnabled(); @@ -4226,15 +4231,15 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & // // In this place there is no reliable way to detect if we are in khtml; the // only thing we know is that khtml buffers its widgets into a pixmap. So - // when the paint device is a QPixmap, chances are high that we are in khtml. + // when the paint device is a TQPixmap, chances are high that we are in khtml. // It's possible that this breaks other things, so let's see how it works... - if (p->device() && dynamic_cast<QPixmap*>(p->device())) + if (p->device() && dynamic_cast<TQPixmap*>(p->device())) itsFormMode=true; if(scrollView && !opts.highlightScrollViews) flags&=~Style_HasFocus; - QRect r2(r); + TQRect r2(r); r2.addCoords(1, 1, -1, -1); // p->fillRect(r2, flags&Style_Enabled ? cg.base() : cg.background()); drawEntryField(p, r, cg, flags, !isReadOnly && isEnabled @@ -4244,20 +4249,20 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & ? ENTRY_FOCUS : ENTRY_NONE : ENTRY_NONE, - (opts.square&SQUARE_SCROLLVIEW) && scrollView ? ROUNDED_NONE : ROUNDED_ALL, + (opts.square&STQUARE_SCROLLVIEW) && scrollView ? ROUNDED_NONE : ROUNDED_ALL, scrollView ? WIDGET_SCROLLVIEW : WIDGET_ENTRY); itsFormMode=false; break; } case PE_StatusBarSection: if(opts.drawStatusBarFrames) - BASE_STYLE::drawPrimitive(pe, p, r, cg, flags, data); + BASE_STYLE::tqdrawPrimitive(pe, p, r, cg, flags, data); break; case PE_SizeGrip: { - QPointArray a; + TQPointArray a; - if (QApplication::reverseLayout()) + if (TQApplication::reverseLayout()) { a.setPoints(3, 0,0, SIZE_GRIP_SIZE,SIZE_GRIP_SIZE, 0,SIZE_GRIP_SIZE); a.translate(r.x(), r.y()+(r.height()-SIZE_GRIP_SIZE)); @@ -4276,18 +4281,18 @@ void QtCurveStyle::drawPrimitive(PrimitiveElement pe, QPainter *p, const QRect & break; } default: - BASE_STYLE::drawPrimitive(pe, p, r, cg, flags, data); + BASE_STYLE::tqdrawPrimitive(pe, p, r, cg, flags, data); } } -static QString elliditide(const QString &text, const QFontMetrics &fontMetrics, int space) +static TQString elliditide(const TQString &text, const TQFontMetrics &fontMetrics, int space) { // Chop and insert ellide into title if text is too wide - QString title(text); + TQString title(text); if (fontMetrics.width(text) > space) { - QString ellipsis("..."); + TQString ellipsis("..."); while (fontMetrics.width(title+ellipsis)>space && !title.isEmpty()) title=title.left(title.length()-1); @@ -4297,9 +4302,9 @@ static QString elliditide(const QString &text, const QFontMetrics &fontMetrics, return title; } -void QtCurveStyle::drawKStylePrimitive(KStylePrimitive kpe, QPainter *p, const QWidget *widget, - const QRect &r, const QColorGroup &cg, SFlags flags, - const QStyleOption &opt) const +void TQtCurveStyle::drawKStylePrimitive(KStylePrimitive kpe, TQPainter *p, const TQWidget *widget, + const TQRect &r, const TQColorGroup &cg, SFlags flags, + const TQStyleOption &opt) const { ELine handles(kpe!=KPE_ToolBarHandle && LINE_DASHES==opts.handles ? LINE_SUNKEN : opts.handles); @@ -4310,7 +4315,7 @@ void QtCurveStyle::drawKStylePrimitive(KStylePrimitive kpe, QPainter *p, const Q { if(APPEARANCE_STRIPED!=opts.bgndAppearance) { - QRect r2(r); + TQRect r2(r); r2.addCoords(-1, -1, 2, 2); drawMenuOrToolBarBackground(p, r2, cg, false, flags&Style_Horizontal); } @@ -4336,14 +4341,14 @@ void QtCurveStyle::drawKStylePrimitive(KStylePrimitive kpe, QPainter *p, const Q if (w > 2 && h > 2) { - QWidget *wid(const_cast<QWidget*>(widget)); - bool hasClose(dynamic_cast<const QDockWindow *>(wid->parentWidget()) && - ((QDockWindow *)(wid->parentWidget()))->area() && - ((QDockWindow *)(wid->parentWidget()))->isCloseEnabled()); - QFont fnt(QApplication::font(wid)); - QPixmap pix; - QString title(wid->parentWidget()->caption()); - QPainter p2; + TQWidget *wid(const_cast<TQWidget*>(widget)); + bool hasClose(dynamic_cast<const TQDockWindow *>(wid->tqparentWidget()) && + ((TQDockWindow *)(wid->tqparentWidget()))->area() && + ((TQDockWindow *)(wid->tqparentWidget()))->isCloseEnabled()); + TQFont fnt(TQApplication::font(wid)); + TQPixmap pix; + TQString title(wid->tqparentWidget()->caption()); + TQPainter p2; fnt.setPointSize(fnt.pointSize()-2); if(hasClose) @@ -4365,18 +4370,18 @@ void QtCurveStyle::drawKStylePrimitive(KStylePrimitive kpe, QPainter *p, const Q p2.drawLine(pix.rect().left(), pix.rect().bottom(), pix.rect().right(), pix.rect().bottom()); p2.setPen(cg.text()); p2.setFont(fnt); - QRect textRect(pix.rect()); + TQRect textRect(pix.rect()); textRect.addCoords(2, -3, -2, 0); - p2.drawText(textRect, AlignVCenter|(QApplication::reverseLayout() ? AlignRight : AlignLeft), - elliditide(title, QFontMetrics(fnt), pix.width())); + p2.drawText(textRect, AlignVCenter|(TQApplication::reverseLayout() ? AlignRight : AlignLeft), + elliditide(title, TQFontMetrics(fnt), pix.width())); p2.end(); if (horizontal) { - QWMatrix m; + TQWMatrix m; m.rotate(-90.0); - QPixmap vpix(pix.xForm(m)); + TQPixmap vpix(pix.xForm(m)); bitBlt(wid, r.x(), r.y()+(hasClose ? 15 : 0), &vpix); } else @@ -4391,11 +4396,11 @@ void QtCurveStyle::drawKStylePrimitive(KStylePrimitive kpe, QPainter *p, const Q drawSliderGroove(p, r, cg, flags, widget); break; case KPE_SliderHandle: - drawSliderHandle(p, r, cg, flags, widget ? ::qt_cast<QSlider *>(widget) : 0L); + drawSliderHandle(p, r, cg, flags, widget ? ::tqqt_cast<TQSlider *>(widget) : 0L); break; case KPE_ListViewExpander: { - QRect ar(r.x()+((r.width()-(LV_SIZE+4))>>1), r.y()+((r.height()-(LV_SIZE+4))>>1), LV_SIZE+4, + TQRect ar(r.x()+((r.width()-(LV_SIZE+4))>>1), r.y()+((r.height()-(LV_SIZE+4))>>1), LV_SIZE+4, LV_SIZE+4); if(LV_OLD==opts.lvLines) @@ -4426,7 +4431,7 @@ void QtCurveStyle::drawKStylePrimitive(KStylePrimitive kpe, QPainter *p, const Q } ::drawArrow(p, ar, flags&Style_Enabled ? cg.mid() : cg.text(), flags&Style_On // Collapsed = On - ? QApplication::reverseLayout() + ? TQApplication::reverseLayout() ? PE_ArrowLeft : PE_ArrowRight : PE_ArrowDown, opts); @@ -4451,9 +4456,9 @@ void QtCurveStyle::drawKStylePrimitive(KStylePrimitive kpe, QPainter *p, const Q } } -void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidget *widget, - const QRect &r, const QColorGroup &cg, SFlags flags, - const QStyleOption &data) const +void TQtCurveStyle::tqdrawControl(ControlElement control, TQPainter *p, const TQWidget *widget, + const TQRect &r, const TQColorGroup &cg, SFlags flags, + const TQStyleOption &data) const { if(widget==itsHoverWidget) flags|=Style_MouseOver; @@ -4462,17 +4467,17 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge { case CE_TabBarTab: { - const QTabBar *tb((const QTabBar *)widget); + const TQTabBar *tb((const TQTabBar *)widget); int tabIndex(tb->indexOf(data.tab()->identifier())), dark(APPEARANCE_FLAT==opts.appearance ? ORIGINAL_SHADE : FRAME_DARK_SHADOW), moOffset(ROUNDED_NONE==opts.round || TAB_MO_TOP!=opts.tabMouseOver ? 1 : opts.round); bool cornerWidget(false), bottomCornerWidget(false), - reverse(QApplication::reverseLayout()), + reverse(TQApplication::reverseLayout()), firstTab(0==tabIndex), lastTab((tb->count()-1)==tabIndex), -// isFirstKTabCtlTab(firstTab && widget->parent() -// ? 0==qstrcmp("KTabCtl", widget->parent()->className()) +// isFirstKTabCtlTab(firstTab && widget->tqparent() +// ? 0==qstrcmp("KTabCtl", widget->tqparent()->className()) // : false), active(flags & Style_Selected), itsHover(itsHoverTab && itsHoverTab->isEnabled() && data.tab()==itsHoverTab && @@ -4480,7 +4485,7 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge tb->currentTab()!=tabIndex), glowMo(!active && itsHover && opts.coloredMouseOver && TAB_MO_GLOW==opts.tabMouseOver); int sizeAdjust(!active && TAB_MO_GLOW==opts.tabMouseOver ? 1 : 0); - const QColor &fill(getTabFill(flags&Style_Selected, itsHover, itsBackgroundCols)); + const TQColor &fill(getTabFill(flags&Style_Selected, itsHover, itsBackgroundCols)); EBorder borderProfile(active || opts.borderInactiveTab ? opts.borderTab ? BORDER_LIGHT @@ -4497,23 +4502,23 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge firstTab=oldLast; } - if(::qt_cast<const QTabWidget *>(tb->parent())) + if(::tqqt_cast<const TQTabWidget *>(tb->tqparent())) { - const QTabWidget *tw((const QTabWidget*)tb->parent()); + const TQTabWidget *tw((const TQTabWidget*)tb->tqparent()); // is there a corner widget in the (top) left edge? - if(tw->cornerWidget(Qt::TopLeft)) + if(tw->cornerWidget(TQt::TopLeft)) cornerWidget=true; - if(tw->cornerWidget(Qt::BottomLeft)) + if(tw->cornerWidget(TQt::BottomLeft)) bottomCornerWidget=true; } - QRect tr(r); - bool top(QTabBar::TriangularAbove==tb->shape() || QTabBar::RoundedAbove==tb->shape()); + TQRect tr(r); + bool top(TQTabBar::TriangularAbove==tb->tqshape() || TQTabBar::RoundedAbove==tb->tqshape()); if(active && opts.tabBgnd) { - QRect rx(tr); + TQRect rx(tr); if(top) rx.addCoords(1, 6, -1, 0); @@ -4531,17 +4536,17 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge if(!firstTab && top && (APP_TORA==itsThemedApp || (APP_OPENOFFICE==itsThemedApp && !active))) tr.addCoords(-1, 0, 0, 0); - QRect glowTr(tr); + TQRect glowTr(tr); if(!active && TAB_MO_GLOW==opts.tabMouseOver) glowTr.addCoords(sizeAdjust, 0, -sizeAdjust, 0); - p->setClipRect(QRect(tr.x(), top ? tr.y()-sizeAdjust : tr.y()+2, tr.width(), top ? tr.height()-2+(2*sizeAdjust) : tr.height()), - QPainter::CoordPainter); + p->setClipRect(TQRect(tr.x(), top ? tr.y()-sizeAdjust : tr.y()+2, tr.width(), top ? tr.height()-2+(2*sizeAdjust) : tr.height()), + TQPainter::CoordPainter); bool invertedSel=APPEARANCE_INVERTED==opts.appearance && active; - QColor col(invertedSel ? cg.background() : fill); + TQColor col(invertedSel ? cg.background() : fill); if(opts.tabBgnd) col=shade(col, TO_FACTOR(opts.tabBgnd)); @@ -4589,7 +4594,7 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge p->drawLine(r.x(), r.y()+r.height()-2, r.x()+r.width()-1, r.y()+r.height()-2); if(opts.coloredMouseOver && itsHover && TAB_MO_GLOW!=opts.tabMouseOver) - drawHighlight(p, QRect(tr.x()+(firstTab ? moOffset : 1), + drawHighlight(p, TQRect(tr.x()+(firstTab ? moOffset : 1), tr.y()+(TAB_MO_TOP==opts.tabMouseOver ? 0 : tr.height()-3), tr.width()-(firstTab || lastTab ? moOffset : 1), 2), cg, true, !TAB_MO_TOP==opts.tabMouseOver); @@ -4600,7 +4605,7 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge int x(reverse ? r.x()+r.width()-1 : r.x()), x2(reverse ? x-1 : x+1); - p->setPen(itsBackgroundCols[!active && TAB_MO_GLOW==opts.tabMouseOver && opts.round>ROUND_SLIGHT && !(opts.square&SQUARE_TAB_FRAME) + p->setPen(itsBackgroundCols[!active && TAB_MO_GLOW==opts.tabMouseOver && opts.round>ROUND_SLIGHT && !(opts.square&STQUARE_TAB_FRAME) ? ORIGINAL_SHADE : STD_BORDER]); p->drawLine(x, r.y()+r.height()-1, x, r.height()-2); if(active) @@ -4617,7 +4622,7 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge p->setPen(midColor(fill, itsHighlightCols[0])); // , IS_FLAT(opts.activeTabAppearance) ? 1.0 : 1.2)); p->drawLine(tr.left(), tr.top()+2, tr.right(), tr.top()+2); - p->setClipRect(QRect(tr.x(), tr.y(), tr.width(), 3), QPainter::CoordPainter); + p->setClipRect(TQRect(tr.x(), tr.y(), tr.width(), 3), TQPainter::CoordPainter); drawBorder(cg.background(), p, tr, cg, flags|Style_Horizontal|Style_Enabled, ROUNDED_ALL, itsHighlightCols, top ? WIDGET_TAB_TOP : WIDGET_TAB_BOT, true, BORDER_FLAT, false, 3); @@ -4625,7 +4630,7 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge } // Round top-left corner... - if(!(opts.square&SQUARE_TAB_FRAME) && FULLLY_ROUNDED && APP_TORA!=itsThemedApp && firstTab && !active && !cornerWidget && !reverse) // && !isFirstKTabCtlTab) + if(!(opts.square&STQUARE_TAB_FRAME) && FULLLY_ROUNDED && APP_TORA!=itsThemedApp && firstTab && !active && !cornerWidget && !reverse) // && !isFirstKTabCtlTab) { p->setPen(itsBackgroundCols[STD_BORDER]); p->drawPoint(r.x()+1, r.y()+r.height()-1); @@ -4656,13 +4661,13 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge p->drawLine(r.x(), r.y()+1, r.x()+r.width()-1, r.y()+1); if(opts.coloredMouseOver && itsHover && TAB_MO_GLOW!=opts.tabMouseOver) - drawHighlight(p, QRect(tr.x()+(firstTab ? moOffset : 1), + drawHighlight(p, TQRect(tr.x()+(firstTab ? moOffset : 1), tr.y()+(TAB_MO_TOP==opts.tabMouseOver ? tr.height()-2 : 1), tr.width()-(firstTab || lastTab ? moOffset : 1), 2), cg, true, TAB_MO_TOP==opts.tabMouseOver); } - if(TAB_MO_GLOW==opts.tabMouseOver && opts.round<=ROUND_SLIGHT && !(opts.square&SQUARE_TAB_FRAME) && !reverse && firstTab && !cornerWidget) + if(TAB_MO_GLOW==opts.tabMouseOver && opts.round<=ROUND_SLIGHT && !(opts.square&STQUARE_TAB_FRAME) && !reverse && firstTab && !cornerWidget) { p->setPen(itsBackgroundCols[STD_BORDER]); p->drawPoint(r.x(), r.y()); @@ -4674,14 +4679,14 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge p->drawLine(tr.left(), tr.bottom()-1, tr.right(), tr.bottom()-1); p->setPen(midColor(fill, itsHighlightCols[0])); p->drawLine(tr.left(), tr.bottom()-2, tr.right(), tr.bottom()-2); - p->setClipRect(QRect(tr.x(), tr.y()+r.height()-3, tr.width(), 3), QPainter::CoordPainter); + p->setClipRect(TQRect(tr.x(), tr.y()+r.height()-3, tr.width(), 3), TQPainter::CoordPainter); drawBorder(cg.background(), p, tr, cg, flags|Style_Horizontal|Style_Enabled, ROUNDED_ALL, itsHighlightCols, top ? WIDGET_TAB_TOP : WIDGET_TAB_BOT, true, BORDER_FLAT, false, 3); p->setClipping(false); } - if(!(opts.square&SQUARE_TAB_FRAME) && FULLLY_ROUNDED && APP_TORA!=itsThemedApp && firstTab && !bottomCornerWidget)// && !isFirstKTabCtlTab) + if(!(opts.square&STQUARE_TAB_FRAME) && FULLLY_ROUNDED && APP_TORA!=itsThemedApp && firstTab && !bottomCornerWidget)// && !isFirstKTabCtlTab) { p->setPen(itsBackgroundCols[STD_BORDER]); p->drawPoint(r.x(), reverse ? r.y()+r.width()-1 : r.y()); @@ -4696,47 +4701,47 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge } break; } -#if QT_VERSION >= 0x030200 +#if 0x039999 >= 0x030200 case CE_TabBarLabel: { if (data.isDefault()) break; - const QTabBar *tb((const QTabBar *) widget); - QTab *t(data.tab()); - QRect tr(r); - int shift(pixelMetric(PM_TabBarTabShiftVertical, tb)); + const TQTabBar *tb((const TQTabBar *) widget); + TQTab *t(data.tab()); + TQRect tr(r); + int shift(tqpixelMetric(PM_TabBarTabShiftVertical, tb)); if (t->identifier() == tb->currentTab()) { - if(QTabBar::RoundedAbove==tb->shape() || QTabBar::TriangularAbove==tb->shape()) + if(TQTabBar::RoundedAbove==tb->tqshape() || TQTabBar::TriangularAbove==tb->tqshape()) tr.addCoords(0, -shift, 0, -shift); } else - if(QTabBar::RoundedBelow==tb->shape() || QTabBar::TriangularBelow==tb->shape()) + if(TQTabBar::RoundedBelow==tb->tqshape() || TQTabBar::TriangularBelow==tb->tqshape()) tr.addCoords(0, shift, 0, shift); if(APP_MACTOR==itsThemedApp) { - drawControl(CE_TabBarTab, p, widget, t->rect(), cg, flags, data); + tqdrawControl(CE_TabBarTab, p, widget, t->rect(), cg, flags, data); if(t->iconSet()) { - QIconSet::Mode mode((t->isEnabled() && tb->isEnabled()) - ? QIconSet::Normal : QIconSet::Disabled); + TQIconSet::Mode mode((t->isEnabled() && tb->isEnabled()) + ? TQIconSet::Normal : TQIconSet::Disabled); - if (mode == QIconSet::Normal && (flags&Style_HasFocus)) - mode = QIconSet::Active; + if (mode == TQIconSet::Normal && (flags&Style_HasFocus)) + mode = TQIconSet::Active; - QPixmap pixmap(t->iconSet()->pixmap(QIconSet::Small, mode)); + TQPixmap pixmap(t->iconSet()->pixmap(TQIconSet::Small, mode)); int pixh(pixmap.height()), xoff(0), yoff(0); if(!(flags&Style_Selected)) { - xoff = pixelMetric(PM_TabBarTabShiftHorizontal, widget); - yoff = pixelMetric(PM_TabBarTabShiftVertical, widget); + xoff = tqpixelMetric(PM_TabBarTabShiftHorizontal, widget); + yoff = tqpixelMetric(PM_TabBarTabShiftVertical, widget); } p->drawPixmap(t->rect().left()+8+xoff, t->rect().center().y()-pixh/2 + yoff, pixmap); @@ -4747,14 +4752,14 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge if ((flags & Style_HasFocus) && !t->text().isEmpty()) { - QRect fr(r); + TQRect fr(r); - if(QTabBar::RoundedAbove==tb->shape() || QTabBar::TriangularAbove==tb->shape()) + if(TQTabBar::RoundedAbove==tb->tqshape() || TQTabBar::TriangularAbove==tb->tqshape()) fr.addCoords(0, 1, 0, -1); else fr.addCoords(0, 0, 0, -1); - drawPrimitive(PE_FocusRect, p, fr, cg); + tqdrawPrimitive(PE_FocusRect, p, fr, cg); } break; } @@ -4765,32 +4770,32 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge r.rect(&x, &y, &w, &h); - const QPushButton *button(static_cast<const QPushButton *>(widget)); + const TQPushButton *button(static_cast<const TQPushButton *>(widget)); bool active(button->isOn() || button->isDown()), cornArrow(false); // Shift button contents if pushed. if (active) { - x += pixelMetric(PM_ButtonShiftHorizontal, widget); - y += pixelMetric(PM_ButtonShiftVertical, widget); + x += tqpixelMetric(PM_ButtonShiftHorizontal, widget); + y += tqpixelMetric(PM_ButtonShiftVertical, widget); flags |= Style_Sunken; } // Does the button have a popup menu? if (button->isMenuButton()) { - int dx(pixelMetric(PM_MenuButtonIndicator, widget)), - margin(pixelMetric(PM_ButtonMargin, widget)); + int dx(tqpixelMetric(PM_MenuButtonIndicator, widget)), + margin(tqpixelMetric(PM_ButtonMargin, widget)); if(button->iconSet() && !button->iconSet()->isNull() && - (dx+button->iconSet()->pixmap(QIconSet::Small, QIconSet::Normal, QIconSet::Off + (dx+button->iconSet()->pixmap(TQIconSet::Small, TQIconSet::Normal, TQIconSet::Off ).width()) >= w ) cornArrow = true; //To little room. Draw the arrow in the corner, don't adjust //the widget else { - ::drawArrow(p, visualRect(QRect((x + w) - (dx + margin + arrowOffset), y, dx, h), r), + ::drawArrow(p, tqvisualRect(TQRect((x + w) - (dx + margin + arrowOffset), y, dx, h), r), MO_ARROW(cg.buttonText()), PE_ArrowDown, opts); w-=(dx+arrowOffset); } @@ -4799,15 +4804,15 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge // Draw the icon if there is one if (button->iconSet() && !button->iconSet()->isNull()) { - QIconSet::Mode mode(QIconSet::Disabled); - QIconSet::State state(QIconSet::Off); + TQIconSet::Mode mode(TQIconSet::Disabled); + TQIconSet::State state(TQIconSet::Off); if (button->isEnabled()) - mode = button->hasFocus() ? QIconSet::Active : QIconSet::Normal; + mode = button->hasFocus() ? TQIconSet::Active : TQIconSet::Normal; if (button->isToggleButton() && button->isOn()) - state = QIconSet::On; + state = TQIconSet::On; - QPixmap pixmap = button->iconSet()->pixmap(QIconSet::Small, mode, state); + TQPixmap pixmap = button->iconSet()->pixmap(TQIconSet::Small, mode, state); static const int constSpace(2); @@ -4822,7 +4827,7 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge else { iw=button->pixmap() ? button->pixmap()->width() - : widget->fontMetrics().size(Qt::ShowPrefix, + : widget->fontMetrics().size(TQt::ShowPrefix, button->text()).width(); int cw(iw+pw+constSpace); @@ -4833,7 +4838,7 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge } if (cornArrow) //Draw over the icon - ::drawArrow(p, visualRect(QRect(x + w - (6+arrowOffset), y + h - (6+arrowOffset), 7, 7), r), + ::drawArrow(p, tqvisualRect(TQRect(x + w - (6+arrowOffset), y + h - (6+arrowOffset), 7, 7), r), MO_ARROW(cg.buttonText()), PE_ArrowDown, opts); if(xo && iw) @@ -4853,21 +4858,21 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge j(opts.embolden && button->isDefault() ? 2 : 1); bool sidebar(!opts.stdSidebarButtons && ((button->isFlat() && button->inherits("KMultiTabBarTab")) || - (button->parentWidget() && button->inherits("Ideal::Button") && - button->parentWidget()->inherits("Ideal::ButtonBar")))); - const QColor &textCol(sidebar && (button->isOn() || flags&Style_On) - ? QApplication::palette().active().highlightedText() - : button->colorGroup().buttonText()); + (button->tqparentWidget() && button->inherits("Ideal::Button") && + button->tqparentWidget()->inherits("Ideal::ButtonBar")))); + const TQColor &textCol(sidebar && (button->isOn() || flags&Style_On) + ? TQApplication::tqpalette().active().highlightedText() + : button->tqcolorGroup().buttonText()); for(i=0; i<j; i++) - drawItem(p, QRect(x+i, y, w, h), AlignCenter|ShowPrefix, button->colorGroup(), + drawItem(p, TQRect(x+i, y, w, h), AlignCenter|ShowPrefix, button->tqcolorGroup(), button->isEnabled(), button->pixmap(), button->text(), -1, &textCol); // Draw a focus rect if the button has focus if (flags&Style_HasFocus && FOCUS_GLOW!=opts.focus && !(flags&Style_MouseOver && FOCUS_FULL==opts.focus && MO_NONE!=opts.coloredMouseOver)) - drawPrimitive(PE_FocusRect, p, visualRect(subRect(SR_PushButtonFocusRect, + tqdrawPrimitive(PE_FocusRect, p, tqvisualRect(subRect(SR_PushButtonFocusRect, widget), widget), cg, flags); break; } @@ -4876,14 +4881,14 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge if(!widget || data.isDefault()) break; - const QPopupMenu *popupmenu((const QPopupMenu *)widget); - QMenuItem *mi(data.menuItem()); + const TQPopupMenu *popupmenu((const TQPopupMenu *)widget); + TQMenuItem *mi(data.menuItem()); int tab(data.tabWidth()), maxpmw(data.maxIconWidth()), x, y, w, h; - bool reverse(QApplication::reverseLayout()); + bool reverse(TQApplication::reverseLayout()); - maxpmw=QMAX(maxpmw, constMenuPixmapWidth); + maxpmw=TQMAX(maxpmw, constMenuPixmapWidth); r.rect(&x, &y, &w, &h); if(widget->erasePixmap() && !widget->erasePixmap()->isNull()) @@ -4896,7 +4901,7 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge if(opts.menuStripe) drawBevelGradient(menuStripeCol(), p, - QRect(reverse ? r.right()-maxpmw : r.x(), + TQRect(reverse ? r.right()-maxpmw : r.x(), r.y(), maxpmw, r.height()), false, false, opts.menuStripeAppearance, WIDGET_OTHER); } @@ -4921,7 +4926,7 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge break; } - QRect cr, ir, tr, sr; + TQRect cr, ir, tr, sr; // check column cr.setRect(r.left(), r.top(), maxpmw, r.height()); // submenu indicator column @@ -4933,42 +4938,42 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge if(reverse) { - cr=visualRect(cr, r); - sr=visualRect(sr, r); - tr=visualRect(tr, r); - ir=visualRect(ir, r); + cr=tqvisualRect(cr, r); + sr=tqvisualRect(sr, r); + tr=tqvisualRect(tr, r); + ir=tqvisualRect(ir, r); } if(mi->iconSet() && opts.menuIcons) { // Select the correct icon from the iconset - QIconSet::Mode mode=flags & Style_Active - ? (mi->isEnabled() ? QIconSet::Active : QIconSet::Disabled) - : (mi->isEnabled() ? QIconSet::Normal : QIconSet::Disabled); - cr=visualRect(QRect(x, y, maxpmw, h), r); + TQIconSet::Mode mode=flags & Style_Active + ? (mi->isEnabled() ? TQIconSet::Active : TQIconSet::Disabled) + : (mi->isEnabled() ? TQIconSet::Normal : TQIconSet::Disabled); + cr=tqvisualRect(TQRect(x, y, maxpmw, h), r); // Do we have an icon and are checked at the same time? // Then draw a "pressed" background behind the icon if(popupmenu->isCheckable() && mi->isChecked()) drawLightBevel((flags & Style_Active)&&(flags & Style_Enabled) ? itsHighlightCols[ORIGINAL_SHADE] - : cg.background(), p, QRect(cr.x()+1, cr.y()+2, cr.width()-2, cr.height()-4), + : cg.background(), p, TQRect(cr.x()+1, cr.y()+2, cr.width()-2, cr.height()-4), cg, flags|Style_Sunken|Style_Horizontal, ROUNDED_ALL, getFill(flags|Style_Sunken|Style_Enabled, itsBackgroundCols), itsBackgroundCols, true, false, WIDGET_NO_ETCH_BTN); // Draw the icon - QPixmap pixmap(mi->iconSet()->pixmap(QIconSet::Small, mode)); - QRect pmr(0, 0, pixmap.width(), pixmap.height()); + TQPixmap pixmap(mi->iconSet()->pixmap(TQIconSet::Small, mode)); + TQRect pmr(0, 0, pixmap.width(), pixmap.height()); pmr.moveCenter(cr.center()); p->drawPixmap(pmr.topLeft(), pixmap); } else if(popupmenu->isCheckable() && mi->isChecked()) - drawPrimitive(PE_CheckMark, p, cr, cg, + tqdrawPrimitive(PE_CheckMark, p, cr, cg, (flags &(Style_Enabled|(opts.useHighlightForMenu ? Style_Active : 0)))| Style_On|MENU_ITEM); - QColor textCol(flags&Style_Enabled + TQColor textCol(flags&Style_Enabled ? flags&Style_Active && opts.useHighlightForMenu ? cg.highlightedText() : cg.foreground() @@ -4984,11 +4989,11 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge p->restore(); } - QString text=mi->text(); + TQString text=mi->text(); if(!text.isNull()) { - int t(text.find('\t')); + int t(text.tqfind('\t')); // draw accelerator/tab-text if(t>=0) @@ -4999,15 +5004,15 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge } else if(mi->pixmap()) { - QPixmap *pixmap(mi->pixmap()); + TQPixmap *pixmap(mi->pixmap()); if(1==pixmap->depth()) - p->setBackgroundMode(OpaqueMode); + p->setBackgroundMode(Qt::OpaqueMode); int diffw(((r.width() - pixmap->width())/2) + ((r.width() - pixmap->width())%2)); p->drawPixmap(r.x()+diffw, r.y()+1, *pixmap ); if(1==pixmap->depth()) - p->setBackgroundMode(TransparentMode); + p->setBackgroundMode(Qt::TransparentMode); } if(mi->popup()) @@ -5022,8 +5027,8 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge if(!active || IS_GLASS(opts.menubarAppearance) || SHADE_NONE!=opts.shadeMenubars) { - QMenuBar *mb((QMenuBar*)widget); - QRect r2(r); + TQMenuBar *mb((TQMenuBar*)widget); + TQRect r2(r); r2.setY(mb->rect().y()+1); r2.setHeight(mb->rect().height()-2); @@ -5040,14 +5045,14 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge if(data.isDefault()) break; - QMenuItem *mi(data.menuItem()); + TQMenuItem *mi(data.menuItem()); if(mi->text().isEmpty()) // Draw pixmap... drawItem(p, r, AlignCenter|ShowPrefix|DontClip|SingleLine, cg, flags&Style_Enabled, - mi->pixmap(), QString::null); + mi->pixmap(), TQString()); else { - const QColor *col=((opts.colorMenubarMouseOver && active) || (!opts.colorMenubarMouseOver && down)) + const TQColor *col=((opts.colorMenubarMouseOver && active) || (!opts.colorMenubarMouseOver && down)) ? opts.customMenuTextColor ? &opts.customMenuSelTextColor : opts.useHighlightForMenu @@ -5065,20 +5070,20 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge drawMenuOrToolBarBackground(p, r, cg); break; case CE_DockWindowEmptyArea: - if(widget && widget->inherits("QToolBar")) + if(widget && widget->inherits(TQTOOLBAR_OBJECT_NAME_STRING)) { - QDockWindow *wind((QDockWindow*)widget); + TQDockWindow *wind((TQDockWindow*)widget); drawMenuOrToolBarBackground(p, r, cg, false, Qt::Horizontal==wind->orientation()); } else - BASE_STYLE::drawControl(control, p, widget, r, cg, flags, data); + BASE_STYLE::tqdrawControl(control, p, widget, r, cg, flags, data); break; case CE_ProgressBarGroove: { - QRect rx(r); + TQRect rx(r); bool doEtch(DO_EFFECT && opts.borderProgress); - QColor col; + TQColor col; if(doEtch) rx.addCoords(1, 1, -1, -1); @@ -5099,11 +5104,11 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge drawBevelGradient(col, p, rx, true, false, opts.progressGrooveAppearance, WIDGET_PBAR_TROUGH); - const QColor *use(backgroundColors(cg)); + const TQColor *use(backgroundColors(cg)); if(opts.borderProgress) drawBorder(cg.background(), p, rx, cg, (SFlags)(flags|Style_Horizontal), - (opts.square&SQUARE_PROGRESS) ? ROUNDED_NONE : ROUNDED_ALL, use, WIDGET_OTHER, true, + (opts.square&STQUARE_PROGRESS) ? ROUNDED_NONE : ROUNDED_ALL, use, WIDGET_OTHER, true, IS_FLAT(opts.progressGrooveAppearance) && ECOLOR_DARK!=opts.progressGrooveColor ? BORDER_SUNKEN : BORDER_FLAT); else { @@ -5113,13 +5118,13 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge } if(doEtch) - drawEtch(p, r, cg, false, (opts.square&SQUARE_PROGRESS)); + drawEtch(p, r, cg, false, (opts.square&STQUARE_PROGRESS)); break; } case CE_ProgressBarContents: { - const QProgressBar *pb((const QProgressBar*)widget); + const TQProgressBar *pb((const TQProgressBar*)widget); int steps(pb->totalSteps()); if(0==steps)//Busy indicator @@ -5133,35 +5138,35 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge else if(progress > r.width()-barWidth) progress = (r.width()-barWidth)-(progress-(r.width()-barWidth)); - drawProgress(p, QRect(r.x()+progress, r.y(), barWidth, r.height()), cg, flags, - (opts.square&SQUARE_PROGRESS) ? ROUNDED_NONE : ROUNDED_ALL, widget); + drawProgress(p, TQRect(r.x()+progress, r.y(), barWidth, r.height()), cg, flags, + (opts.square&STQUARE_PROGRESS) ? ROUNDED_NONE : ROUNDED_ALL, widget); } else { - QRect cr(subRect(SR_ProgressBarContents, widget)); + TQRect cr(subRect(SR_ProgressBarContents, widget)); if(cr.isValid() && pb->progress()>0) { double pg(((double)pb->progress()) / steps); - int width(QMIN(cr.width(), (int)(pg * cr.width()))); + int width(TQMIN(cr.width(), (int)(pg * cr.width()))); - if(QApplication::reverseLayout()) - drawProgress(p, QRect(cr.x()+(cr.width()-width), cr.y(), width, + if(TQApplication::reverseLayout()) + drawProgress(p, TQRect(cr.x()+(cr.width()-width), cr.y(), width, cr.height()), cg, flags, - width==cr.width() || (opts.square&SQUARE_PROGRESS) ? ROUNDED_NONE : ROUNDED_ALL, widget); + width==cr.width() || (opts.square&STQUARE_PROGRESS) ? ROUNDED_NONE : ROUNDED_ALL, widget); else - drawProgress(p, QRect(cr.x(), cr.y(), width, cr.height()), cg, flags, - width==cr.width() || (opts.square&SQUARE_PROGRESS) ? ROUNDED_NONE : ROUNDED_ALL, widget); + drawProgress(p, TQRect(cr.x(), cr.y(), width, cr.height()), cg, flags, + width==cr.width() || (opts.square&STQUARE_PROGRESS) ? ROUNDED_NONE : ROUNDED_ALL, widget); } } break; } case CE_ProgressBarLabel: { - const QProgressBar* pb = (const QProgressBar*)widget; - QRect cr = subRect(SR_ProgressBarContents, widget); + const TQProgressBar* pb = (const TQProgressBar*)widget; + TQRect cr = subRect(SR_ProgressBarContents, widget); double progress = pb->progress(); - bool reverse = QApplication::reverseLayout(); + bool reverse = TQApplication::reverseLayout(); int steps = pb->totalSteps(); if (!cr.isValid()) @@ -5169,7 +5174,7 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge if(opts.boldProgress) // This is the only change fro the KStyle code! { - QFont font = p->font(); + TQFont font = p->font(); font.setBold(true); p->setFont(font); } @@ -5178,8 +5183,8 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge if (progress > 0 || steps == 0) { double pg = (steps == 0) ? 1.0 : progress / steps; - int width = QMIN(cr.width(), (int)(pg * cr.width())); - QRect crect; + int width = TQMIN(cr.width(), (int)(pg * cr.width())); + TQRect crect; if (reverse) crect.setRect(cr.x()+(cr.width()-width), cr.y(), cr.width(), cr.height()); else @@ -5202,21 +5207,21 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge } case CE_PushButton: { - const QPushButton *button(static_cast<const QPushButton *>(widget)); + const TQPushButton *button(static_cast<const TQPushButton *>(widget)); bool sidebar(!opts.stdSidebarButtons && ((button->isFlat() && button->inherits("KMultiTabBarTab")) || - (button->parentWidget() && button->inherits("Ideal::Button") && - button->parentWidget()->inherits("Ideal::ButtonBar")))); + (button->tqparentWidget() && button->inherits("Ideal::Button") && + button->tqparentWidget()->inherits("Ideal::ButtonBar")))); if(sidebar) { - QRect r2(r); + TQRect r2(r); flags|=TOGGLE_BUTTON; if(button->isOn()) flags|=Style_On; - const QColor *use(flags&Style_On ? getSidebarButtons() : buttonColors(cg)); + const TQColor *use(flags&Style_On ? getSidebarButtons() : buttonColors(cg)); if((flags&Style_On ) || flags&Style_MouseOver) { @@ -5270,108 +5275,108 @@ void QtCurveStyle::drawControl(ControlElement control, QPainter *p, const QWidge if(sidebar) flags|=NO_ETCH_BUTTON; - drawPrimitive(PE_ButtonCommand, p, r, cg, flags); + tqdrawPrimitive(PE_ButtonCommand, p, r, cg, flags); if (button->isDefault() && IND_CORNER==opts.defBtnIndicator) - drawPrimitive(PE_ButtonDefault, p, r, cg, flags); + tqdrawPrimitive(PE_ButtonDefault, p, r, cg, flags); itsFormMode = false; } break; } case CE_CheckBox: itsFormMode = isFormWidget(widget); - drawPrimitive(PE_Indicator, p, r, cg, flags, data); + tqdrawPrimitive(PE_Indicator, p, r, cg, flags, data); itsFormMode = false; break; case CE_CheckBoxLabel: if(opts.crHighlight || FOCUS_GLOW==opts.focus) { - const QCheckBox *checkbox((const QCheckBox *)widget); + const TQCheckBox *checkbox((const TQCheckBox *)widget); if(flags&Style_MouseOver && opts.crHighlight && -#if QT_VERSION >= 0x030200 +#if 0x039999 >= 0x030200 HOVER_CHECK==itsHover && itsHoverWidget && itsHoverWidget==widget && #endif !isFormWidget(widget)) { -#if QT_VERSION >= 0x030200 - QRect cr(checkbox->rect()); - QRegion r(QRect(cr.x(), cr.y(), visualRect(subRect(SR_CheckBoxFocusRect, widget), +#if 0x039999 >= 0x030200 + TQRect cr(checkbox->rect()); + TQRegion r(TQRect(cr.x(), cr.y(), tqvisualRect(subRect(SR_CheckBoxFocusRect, widget), widget).width()+ - pixelMetric(PM_IndicatorWidth)+4, + tqpixelMetric(PM_IndicatorWidth)+4, cr.height())); #else - QRegion r(checkbox->rect()); + TQRegion r(checkbox->rect()); #endif - r-=visualRect(subRect(SR_CheckBoxIndicator, widget), widget); + r-=tqvisualRect(subRect(SR_CheckBoxIndicator, widget), widget); p->setClipRegion(r); drawBevelGradient(shade(cg.background(), TO_FACTOR(opts.crHighlight)), p, checkbox->rect(), true, false, opts.selectionAppearance, WIDGET_SELECTION); p->setClipping(false); } - int alignment(QApplication::reverseLayout() ? AlignRight : AlignLeft); + int tqalignment(TQApplication::reverseLayout() ? AlignRight : AlignLeft); - drawItem(p, r, alignment | AlignVCenter | ShowPrefix, cg, + drawItem(p, r, tqalignment | AlignVCenter | ShowPrefix, cg, flags & Style_Enabled, checkbox->pixmap(), checkbox->text()); if(checkbox->hasFocus() && FOCUS_GLOW!=opts.focus) - drawPrimitive(PE_FocusRect, p, visualRect(subRect(SR_CheckBoxFocusRect, widget), + tqdrawPrimitive(PE_FocusRect, p, tqvisualRect(subRect(SR_CheckBoxFocusRect, widget), widget), cg, flags); } else - BASE_STYLE::drawControl(control, p, widget, r, cg, flags, data); + BASE_STYLE::tqdrawControl(control, p, widget, r, cg, flags, data); break; case CE_RadioButton: itsFormMode=isFormWidget(widget); - drawPrimitive(PE_ExclusiveIndicator, p, r, cg, flags, data); + tqdrawPrimitive(PE_ExclusiveIndicator, p, r, cg, flags, data); itsFormMode=false; break; case CE_RadioButtonLabel: if(opts.crHighlight || FOCUS_GLOW==opts.focus) { - const QRadioButton *radiobutton((const QRadioButton *)widget); + const TQRadioButton *radiobutton((const TQRadioButton *)widget); if(flags&Style_MouseOver && opts.crHighlight && -#if QT_VERSION >= 0x030200 +#if 0x039999 >= 0x030200 HOVER_RADIO==itsHover && itsHoverWidget && itsHoverWidget==widget && #endif !isFormWidget(widget)) { -#if QT_VERSION >= 0x030200 - QRect rb(radiobutton->rect()); - QRegion r(QRect(rb.x(), rb.y(), - visualRect(subRect(SR_RadioButtonFocusRect, widget), +#if 0x039999 >= 0x030200 + TQRect rb(radiobutton->rect()); + TQRegion r(TQRect(rb.x(), rb.y(), + tqvisualRect(subRect(SR_RadioButtonFocusRect, widget), widget).width()+ - pixelMetric(PM_ExclusiveIndicatorWidth)+4, + tqpixelMetric(PM_ExclusiveIndicatorWidth)+4, rb.height())); #else - QRegion r(radiobutton->rect()); + TQRegion r(radiobutton->rect()); #endif - r-=visualRect(subRect(SR_RadioButtonIndicator, widget), widget); + r-=tqvisualRect(subRect(SR_RadioButtonIndicator, widget), widget); p->setClipRegion(r); drawBevelGradient(shade(cg.background(), TO_FACTOR(opts.crHighlight)), p, radiobutton->rect(), true, false, opts.selectionAppearance, WIDGET_SELECTION); p->setClipping(false); } - int alignment(QApplication::reverseLayout() ? AlignRight : AlignLeft); + int tqalignment(TQApplication::reverseLayout() ? AlignRight : AlignLeft); - drawItem(p, r, alignment | AlignVCenter | ShowPrefix, cg, flags & Style_Enabled, + drawItem(p, r, tqalignment | AlignVCenter | ShowPrefix, cg, flags & Style_Enabled, radiobutton->pixmap(), radiobutton->text()); if(radiobutton->hasFocus() && FOCUS_GLOW!=opts.focus) - drawPrimitive(PE_FocusRect, p, visualRect(subRect(SR_RadioButtonFocusRect, + tqdrawPrimitive(PE_FocusRect, p, tqvisualRect(subRect(SR_RadioButtonFocusRect, widget), widget), cg, flags); break; } // Fall through intentional! default: - BASE_STYLE::drawControl(control, p, widget, r, cg, flags, data); + BASE_STYLE::tqdrawControl(control, p, widget, r, cg, flags, data); } } -void QtCurveStyle::drawControlMask(ControlElement control, QPainter *p, const QWidget *widget, - const QRect &r, const QStyleOption &data) const +void TQtCurveStyle::tqdrawControlMask(ControlElement control, TQPainter *p, const TQWidget *widget, + const TQRect &r, const TQStyleOption &data) const { switch(control) { @@ -5392,28 +5397,28 @@ void QtCurveStyle::drawControlMask(ControlElement control, QPainter *p, const QW break; } default: - BASE_STYLE::drawControlMask(control, p, widget, r, data); + BASE_STYLE::tqdrawControlMask(control, p, widget, r, data); } } -void QtCurveStyle::drawComplexControlMask(ComplexControl control, QPainter *p, const QWidget *widget, - const QRect &r, const QStyleOption &data) const +void TQtCurveStyle::tqdrawComplexControlMask(ComplexControl control, TQPainter *p, const TQWidget *widget, + const TQRect &r, const TQStyleOption &data) const { switch (control) { case CC_SpinWidget: case CC_ComboBox: case CC_ToolButton: - drawControlMask(CE_PushButton, p, widget, r, data); + tqdrawControlMask(CE_PushButton, p, widget, r, data); break; default: - BASE_STYLE::drawComplexControlMask(control, p, widget, r, data); + BASE_STYLE::tqdrawComplexControlMask(control, p, widget, r, data); } } -QRect QtCurveStyle::subRect(SubRect subrect, const QWidget *widget)const +TQRect TQtCurveStyle::subRect(SubRect subrect, const TQWidget *widget)const { - QRect rect, + TQRect rect, wrect(widget->rect()); switch(subrect) @@ -5424,7 +5429,7 @@ QRect QtCurveStyle::subRect(SubRect subrect, const QWidget *widget)const rect=wrect; else { - int dbw1(pixelMetric(PM_ButtonDefaultIndicator, widget)), + int dbw1(tqpixelMetric(PM_ButtonDefaultIndicator, widget)), dbw2(dbw1*2), border(3), border2=(border*2); @@ -5443,10 +5448,10 @@ QRect QtCurveStyle::subRect(SubRect subrect, const QWidget *widget)const return opts.fillProgress ? DO_EFFECT && opts.borderProgress ? wrect - : QRect(wrect.left()-1, wrect.top()-1, wrect.width()+2, wrect.height()+2) + : TQRect(wrect.left()-1, wrect.top()-1, wrect.width()+2, wrect.height()+2) : DO_EFFECT && opts.borderProgress - ? QRect(wrect.left()+2, wrect.top()+2, wrect.width()-4, wrect.height()-4) - : QRect(wrect.left()+1, wrect.top()+1, wrect.width()-2, wrect.height()-2); + ? TQRect(wrect.left()+2, wrect.top()+2, wrect.width()-4, wrect.height()-4) + : TQRect(wrect.left()+1, wrect.top()+1, wrect.width()-2, wrect.height()-2); case SR_ProgressBarLabel: case SR_ProgressBarGroove: return wrect; @@ -5459,19 +5464,19 @@ QRect QtCurveStyle::subRect(SubRect subrect, const QWidget *widget)const return rect; } -// This is a hack, as QTitleBar is private!!! -class QTitleBar : public QWidget +// This is a hack, as TQTitleBar is private!!! +class TQTitleBar : public TQWidget { public: bool isActive() const; - QWidget *window() const; + TQWidget *window() const; }; -void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const QWidget *widget, - const QRect &r, const QColorGroup &cg, SFlags flags, +void TQtCurveStyle::tqdrawComplexControl(ComplexControl control, TQPainter *p, const TQWidget *widget, + const TQRect &r, const TQColorGroup &cg, SFlags flags, SCFlags controls, SCFlags active, - const QStyleOption &data) const + const TQStyleOption &data) const { if(widget==itsHoverWidget) flags |=Style_MouseOver; @@ -5480,8 +5485,8 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const { case CC_ToolButton: { - const QToolButton *toolbutton((const QToolButton *)widget); - QRect button(querySubControlMetrics(control, widget, SC_ToolButton, data)), + const TQToolButton *toolbutton((const TQToolButton *)widget); + TQRect button(querySubControlMetrics(control, widget, SC_ToolButton, data)), menuarea(querySubControlMetrics(control, widget, SC_ToolButtonMenu, data)); SFlags bflags(flags|STD_TOOLBUTTON), @@ -5489,20 +5494,20 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const if (APP_KORN==itsThemedApp) { - drawPrimitive(PE_ButtonTool, p, button, cg, bflags, data); + tqdrawPrimitive(PE_ButtonTool, p, button, cg, bflags, data); break; } - const QToolBar *tb(widget->parentWidget() - ? ::qt_cast<const QToolBar *>(widget->parentWidget()) : 0L); + const TQToolBar *tb(widget->tqparentWidget() + ? ::tqqt_cast<const TQToolBar *>(widget->tqparentWidget()) : 0L); bool onControlButtons(false), onExtender(!tb && - widget->parentWidget() && - widget->parentWidget()->inherits( "QToolBarExtensionWidget") && - ::qt_cast<QToolBar *>(widget->parentWidget()->parentWidget())), + widget->tqparentWidget() && + widget->tqparentWidget()->inherits( "TQToolBarExtensionWidget") && + ::tqqt_cast<TQToolBar *>(widget->tqparentWidget()->tqparentWidget())), isDWClose(!tb && !onExtender && - widget->parentWidget() && - widget->parentWidget()->inherits( "QDockWindowHandle")); + widget->tqparentWidget() && + widget->tqparentWidget()->inherits( TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING)); if(isDWClose) { @@ -5512,8 +5517,8 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const bflags|=DW_CLOSE_BUTTON; } - if (!tb && !onExtender && widget->parentWidget() && - !qstrcmp(widget->parentWidget()->name(), "qt_maxcontrols")) + if (!tb && !onExtender && widget->tqparentWidget() && + !qstrcmp(widget->tqparentWidget()->name(), "qt_maxcontrols")) onControlButtons = true; if(active & SC_ToolButton) @@ -5526,12 +5531,12 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const if(controls&SC_ToolButton) { if(onControlButtons || - (toolbutton->parentWidget() && toolbutton->parentWidget()->parentWidget() && - ::qt_cast<const QMenuBar *>(toolbutton->parentWidget()->parentWidget()))) + (toolbutton->tqparentWidget() && toolbutton->tqparentWidget()->tqparentWidget() && + ::tqqt_cast<const TQMenuBar *>(toolbutton->tqparentWidget()->tqparentWidget()))) bflags|=NO_ETCH_BUTTON; // If we're pressed, on, or raised... -#if defined QTC_QT_ONLY || !defined KDE_VERSION || KDE_VERSION >= 0x30200 +#if defined TQTC_TQT_ONLY || !defined KDE_VERSION || KDE_VERSION >= 0x30200 if(bflags &(Style_Down | Style_On | Style_Raised) || onControlButtons) #else if(bflags &(Style_Down | Style_On | Style_Raised | Style_MouseOver) || @@ -5551,31 +5556,31 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const if(toolbutton->isToggleButton()) bflags|=TOGGLE_BUTTON; - drawPrimitive(PE_ButtonTool, p, button, cg, bflags, data); + tqdrawPrimitive(PE_ButtonTool, p, button, cg, bflags, data); } // Check whether to draw a background pixmap - else if(APP_MACTOR!=itsThemedApp && toolbutton->parentWidget() && - toolbutton->parentWidget()->backgroundPixmap() && - !toolbutton->parentWidget()->backgroundPixmap()->isNull()) - p->drawTiledPixmap(r, *(toolbutton->parentWidget()->backgroundPixmap()), + else if(APP_MACTOR!=itsThemedApp && toolbutton->tqparentWidget() && + toolbutton->tqparentWidget()->backgroundPixmap() && + !toolbutton->tqparentWidget()->backgroundPixmap()->isNull()) + p->drawTiledPixmap(r, *(toolbutton->tqparentWidget()->backgroundPixmap()), toolbutton->pos()); - else if(widget->parent()) + else if(widget->tqparent()) { - QToolBar *tb(0L); + TQToolBar *tb(0L); - if(::qt_cast<const QToolBar *>(widget->parent())) - tb=(QToolBar*)widget->parent(); - else if(widget->parent()->inherits("QToolBarExtensionWidget")) + if(::tqqt_cast<const TQToolBar *>(widget->tqparent())) + tb=(TQToolBar*)widget->tqparent(); + else if(widget->tqparent()->inherits("TQToolBarExtensionWidget")) { - QWidget *parent=(QWidget*)widget->parent(); + TQWidget *tqparent=(TQWidget*)widget->tqparent(); - tb=(QToolBar*)parent->parent(); + tb=(TQToolBar*)tqparent->tqparent(); } if(tb) { - QRect tbr(tb->rect()); + TQRect tbr(tb->rect()); bool horiz(Qt::Horizontal==tb->orientation()); if(!IS_FLAT(opts.toolbarAppearance)) @@ -5592,18 +5597,18 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const if(controls&SC_ToolButtonMenu) { if(mflags &(Style_Down | Style_On | Style_Raised)) - drawPrimitive(PE_ButtonDropDown, p, menuarea, cg, mflags, data); + tqdrawPrimitive(PE_ButtonDropDown, p, menuarea, cg, mflags, data); ::drawArrow(p, menuarea, MO_ARROW(cg.buttonText()), PE_ArrowDown, opts, true); } if(toolbutton->hasFocus() && !toolbutton->focusProxy()) { - QRect fr(toolbutton->rect()); + TQRect fr(toolbutton->rect()); if(FOCUS_FULL!=opts.focus) fr.addCoords(2, 2,-2,-2); if(DO_EFFECT) fr.addCoords(1, 1,-1,-1); - drawPrimitive(PE_FocusRect, p, fr, cg); + tqdrawPrimitive(PE_FocusRect, p, fr, cg); } itsFormMode=false; @@ -5616,20 +5621,20 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const itsFormMode = isFormWidget(widget); - const QComboBox *combobox((const QComboBox *)widget); - QRect frame(QStyle::visualRect(querySubControlMetrics(CC_ComboBox, widget, + const TQComboBox *combobox((const TQComboBox *)widget); + TQRect frame(TQStyle::tqvisualRect(querySubControlMetrics(CC_ComboBox, widget, SC_ComboBoxFrame, data), widget)), - arrow(QStyle::visualRect(querySubControlMetrics(CC_ComboBox, widget, + arrow(TQStyle::tqvisualRect(querySubControlMetrics(CC_ComboBox, widget, SC_ComboBoxArrow, data), widget)), - field(QStyle::visualRect(querySubControlMetrics(CC_ComboBox, widget, + field(TQStyle::tqvisualRect(querySubControlMetrics(CC_ComboBox, widget, SC_ComboBoxEditField, data), widget)); - const QColor *use(buttonColors(cg)); + const TQColor *use(buttonColors(cg)); bool editable(combobox->editable()), sunken(combobox->listBox() ? combobox->listBox()->isShown() : false), - reverse(QApplication::reverseLayout()); + reverse(TQApplication::reverseLayout()); SFlags fillFlags(flags), doEtch(!itsFormMode && DO_EFFECT && (!editable || opts.etchEntry)); @@ -5664,7 +5669,7 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const } else { - const QColor *cols=itsComboBtnCols && editable && flags&Style_Enabled ? itsComboBtnCols : use; + const TQColor *cols=itsComboBtnCols && editable && flags&Style_Enabled ? itsComboBtnCols : use; if(editable && HOVER_CB_ARROW!=itsHover) fillFlags&=~Style_MouseOver; @@ -5708,7 +5713,7 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const ? ENTRY_FOCUS : ENTRY_NONE : ENTRY_NONE, - (opts.square&SQUARE_ENTRY) + (opts.square&STQUARE_ENTRY) ? ROUNDED_NONE : opts.unifyCombo ? ROUNDED_ALL @@ -5733,13 +5738,13 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const if(flags&Style_HasFocus && !editable && FOCUS_GLOW!=opts.focus) { - QRect fr; + TQRect fr; if(FOCUS_FULL==opts.focus) fr=frame; else if(opts.comboSplitter) { - fr=QStyle::visualRect(subRect(SR_ComboBoxFocusRect, widget), widget); + fr=TQStyle::tqvisualRect(subRect(SR_ComboBoxFocusRect, widget), widget); if(reverse) fr.addCoords(3, 0, 0, 0); else @@ -5754,8 +5759,8 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const } if(!(flags&Style_MouseOver && FOCUS_FULL==opts.focus && MO_NONE!=opts.coloredMouseOver)) - drawPrimitive(PE_FocusRect, p, fr, cg, flags | Style_FocusAtBorder, - QStyleOption(cg.highlight())); + tqdrawPrimitive(PE_FocusRect, p, fr, cg, flags | Style_FocusAtBorder, + TQStyleOption(cg.highlight())); } } @@ -5764,8 +5769,8 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const if(!editable && (SHADE_DARKEN==opts.comboBtn || itsComboBtnCols)) { SFlags btnFlags(flags); - QRect btn(arrow.x(), frame.y(), arrow.width()+1, frame.height()); - const QColor *cols=SHADE_DARKEN==opts.comboBtn || !(flags&Style_Enabled) ? use : itsComboBtnCols; + TQRect btn(arrow.x(), frame.y(), arrow.width()+1, frame.height()); + const TQColor *cols=SHADE_DARKEN==opts.comboBtn || !(flags&Style_Enabled) ? use : itsComboBtnCols; if(!sunken) btnFlags|=Style_Raised; p->save(); @@ -5796,10 +5801,10 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const if(!sunken && !editable && ((MO_GLOW==opts.coloredMouseOver && flags&Style_MouseOver)/* || (FOCUS_FULL==opts.focus && flags&Style_HasFocus)*/ || glowFocus)) - drawGlow(p, widget ? widget->rect() : r, cg, WIDGET_COMBO, glowFocus ? itsFocusCols : NULL); + drawGlow(p, widget ? TQT_TQRECT_OBJECT(widget->rect()) : r, cg, WIDGET_COMBO, glowFocus ? itsFocusCols : NULL); else - drawEtch(p, widget ? widget->rect() : r, cg, - !editable && EFFECT_SHADOW==opts.buttonEffect && !sunken, editable && (opts.square&SQUARE_ENTRY)); + drawEtch(p, widget ? TQT_TQRECT_OBJECT(widget->rect()) : r, cg, + !editable && EFFECT_SHADOW==opts.buttonEffect && !sunken, editable && (opts.square&STQUARE_ENTRY)); } p->setPen(cg.buttonText()); @@ -5810,14 +5815,14 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const { itsFormMode = isFormWidget(widget); - const QSpinWidget *spinwidget((const QSpinWidget *)widget); - QRect frame(querySubControlMetrics(CC_SpinWidget, widget, SC_SpinWidgetFrame, + const TQSpinWidget *spinwidget((const TQSpinWidget *)widget); + TQRect frame(querySubControlMetrics(CC_SpinWidget, widget, SC_SpinWidgetFrame, data)), up(spinwidget->upRect()), down(spinwidget->downRect()), all(frame.unite(up).unite(down)); bool hw(itsHoverWidget && itsHoverWidget==spinwidget), - reverse(QApplication::reverseLayout()), + reverse(TQApplication::reverseLayout()), doFrame((controls&SC_SpinWidgetFrame) && frame.isValid()), doEtch(!itsFormMode && DO_EFFECT && opts.etchEntry); @@ -5859,8 +5864,8 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const if(opts.unifySpinBtns) { - QRect btns=up.unite(down); - const QColor *use(buttonColors(cg)); + TQRect btns=up.unite(down); + const TQColor *use(buttonColors(cg)); int btnFlags=flags; btnFlags&=~(Style_Sunken|Style_MouseOver); @@ -5890,11 +5895,11 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const if(hw && HOVER_SW_UP==itsHover) upflags|=Style_MouseOver; up.setHeight(up.height()+1); - if(spinwidget->buttonSymbols()==QSpinWidget::PlusMinus) + if(spinwidget->buttonSymbols()==TQSpinWidget::PlusMinus) pe=PE_SpinWidgetPlus; if(!spinwidget->isUpEnabled()) upflags&=~Style_Enabled; - drawPrimitive(pe, p, up, !(upflags&Style_Enabled) && spinwidget ? spinwidget->palette().disabled() : cg, + tqdrawPrimitive(pe, p, up, !(upflags&Style_Enabled) && spinwidget ? spinwidget->tqpalette().disabled() : cg, upflags |((active==SC_SpinWidgetUp) ? Style_On | Style_Sunken : Style_Raised)); } @@ -5906,11 +5911,11 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const if(hw && HOVER_SW_DOWN==itsHover) downflags|=Style_MouseOver; - if(spinwidget->buttonSymbols()==QSpinWidget::PlusMinus) + if(spinwidget->buttonSymbols()==TQSpinWidget::PlusMinus) pe=PE_SpinWidgetMinus; if(!spinwidget->isDownEnabled()) downflags&=~Style_Enabled; - drawPrimitive(pe, p, down, !(downflags&Style_Enabled) && spinwidget ? spinwidget->palette().disabled() : cg, + tqdrawPrimitive(pe, p, down, !(downflags&Style_Enabled) && spinwidget ? spinwidget->tqpalette().disabled() : cg, downflags |((active==SC_SpinWidgetDown) ? Style_On | Style_Sunken : Style_Raised)); } @@ -5932,14 +5937,14 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const } if(doEtch) - drawEtch(p, spinwidget ? spinwidget->rect() : r, cg, false, (opts.square&SQUARE_ENTRY)); + drawEtch(p, spinwidget ? TQT_TQRECT_OBJECT(spinwidget->rect()) : r, cg, false, (opts.square&STQUARE_ENTRY)); } itsFormMode=false; break; } case CC_ScrollBar: { - const QScrollBar *sb((const QScrollBar *)widget); + const TQScrollBar *sb((const TQScrollBar *)widget); bool hw(itsHoverWidget && itsHoverWidget==sb), useThreeButtonScrollBar(SCROLLBAR_KDE==opts.scrollbarType), horiz(Qt::Horizontal==sb->orientation()), @@ -5948,7 +5953,7 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const atMax(maxed || sb->value()==sb->maxValue()); SFlags sflags((horiz ? Style_Horizontal : Style_Default) | (maxed || !widget->isEnabled() ? Style_Default : Style_Enabled)); - QRect subline(querySubControlMetrics(control, widget, SC_ScrollBarSubLine, + TQRect subline(querySubControlMetrics(control, widget, SC_ScrollBarSubLine, data)), addline(querySubControlMetrics(control, widget, SC_ScrollBarAddLine, data)), @@ -6041,9 +6046,9 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const } // Draw trough... - const QColor *trough(itsBackgroundCols); // backgroundColors(cg)); + const TQColor *trough(itsBackgroundCols); // backgroundColors(cg)); bool noButtons((SCROLLBAR_NONE==opts.scrollbarType || opts.flatSbarButtons) && ROUNDED); - QRect s2(subpage), a2(addpage); + TQRect s2(subpage), a2(addpage); #ifndef SIMPLE_SCROLLBARS if(noButtons) @@ -6055,16 +6060,16 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const #endif p->save(); if(opts.flatSbarButtons) - p->setClipRegion(QRegion(s2)+QRegion(addpage)+QRegion(addline)+QRegion(subline)+QRegion(subline2)); + p->setClipRegion(TQRegion(s2)+TQRegion(addpage)+TQRegion(addline)+TQRegion(subline)+TQRegion(subline2)); else - p->setClipRegion(QRegion(s2)+QRegion(addpage)); + p->setClipRegion(TQRegion(s2)+TQRegion(addpage)); if(opts.flatSbarButtons && SCROLLBAR_NONE!=opts.scrollbarType && ROUNDED && !IS_FLAT(opts.sbarBgndAppearance)) drawBevelGradient(itsBackgroundCols[ORIGINAL_SHADE], p, r, flags&Style_Horizontal, false, opts.sbarBgndAppearance, WIDGET_SB_BGND); else if(opts.thinSbarGroove && (SCROLLBAR_NONE==opts.scrollbarType || opts.flatSbarButtons) && IS_FLAT(opts.sbarBgndAppearance)) { - QColor color(cg.background()); + TQColor color(cg.background()); if(0!=opts.tabBgnd && inStackWidget(widget)) color=shade(color, TO_FACTOR(opts.tabBgnd)); @@ -6081,7 +6086,7 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const drawLightBevel(p, sbRect, cg, sflags/*|Style_Down*/, #ifndef SIMPLE_SCROLLBARS - !(opts.square&SQUARE_SB_SLIDER) && (SCROLLBAR_NONE==opts.scrollbarType || opts.flatSbarButtons) + !(opts.square&STQUARE_SB_SLIDER) && (SCROLLBAR_NONE==opts.scrollbarType || opts.flatSbarButtons) ? ROUNDED_ALL : #endif ROUNDED_NONE, @@ -6094,7 +6099,7 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const { bool enable=!atMin; - drawPrimitive(PE_ScrollBarSubLine, p, subline, !enable && sb ? sb->palette().disabled() : cg, + tqdrawPrimitive(PE_ScrollBarSubLine, p, subline, !enable && sb ? sb->tqpalette().disabled() : cg, sflags | //(enable ? Style_Enabled : Style_Default) | (enable && hw && HOVER_SB_SUB==itsHover @@ -6106,7 +6111,7 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const { if(IS_FLAT(opts.sbarBgndAppearance)) p->fillRect(subline2, cg.background()); - drawPrimitive(PE_ScrollBarSubLine, p, subline2, !enable && sb ? sb->palette().disabled() : cg, + tqdrawPrimitive(PE_ScrollBarSubLine, p, subline2, !enable && sb ? sb->tqpalette().disabled() : cg, sflags | //(enable ? Style_Enabled : Style_Default) | (enable && hw && HOVER_SB_SUB2==itsHover @@ -6126,7 +6131,7 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const else addline.addCoords(0, 0, 0, -1); - drawPrimitive(PE_ScrollBarAddLine, p, addline, !enable && sb ? sb->palette().disabled() : cg, + tqdrawPrimitive(PE_ScrollBarAddLine, p, addline, !enable && sb ? sb->tqpalette().disabled() : cg, sflags | //(enable ? Style_Enabled : Style_Default) | (enable && hw && HOVER_SB_ADD==itsHover @@ -6136,12 +6141,12 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const } if((controls&SC_ScrollBarFirst) && first.isValid()) - drawPrimitive(PE_ScrollBarFirst, p, first, cg, sflags | + tqdrawPrimitive(PE_ScrollBarFirst, p, first, cg, sflags | //(maxed ? Style_Default : Style_Enabled) | (!maxed && SC_ScrollBarFirst==active ? Style_Down : Style_Default)); if((controls&SC_ScrollBarLast) && last.isValid()) - drawPrimitive(PE_ScrollBarLast, p, last, cg, sflags | + tqdrawPrimitive(PE_ScrollBarLast, p, last, cg, sflags | //(maxed ? Style_Default : Style_Enabled) | (!maxed && SC_ScrollBarLast==active ? Style_Down : Style_Default)); @@ -6151,7 +6156,7 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const // of the slider that overlaps with the tough. So, once again set the clipping // region... if(!(controls&SC_ScrollBarSlider)) - p->setClipRegion(QRegion(s2)+QRegion(addpage)); + p->setClipRegion(TQRegion(s2)+TQRegion(addpage)); #ifdef INCREASE_SB_SLIDER else if(!opts.flatSbarButtons) { @@ -6192,7 +6197,7 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const IS_FLAT(opts.sbarBgndAppearance)) p->fillRect(slider, cg.background()); - drawPrimitive(PE_ScrollBarSlider, p, slider, cg, sflags | + tqdrawPrimitive(PE_ScrollBarSlider, p, slider, cg, sflags | //(maxed ? Style_Default : Style_Enabled) | (!maxed && hw && HOVER_SB_SLIDER==itsHover ? Style_MouseOver : Style_Default) | @@ -6201,7 +6206,7 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const // ### perhaps this should not be able to accept focus if maxedOut? if(sb->hasFocus()) - drawPrimitive(PE_FocusRect, p, QRect(slider.x()+2, slider.y()+2, + tqdrawPrimitive(PE_FocusRect, p, TQRect(slider.x()+2, slider.y()+2, slider.width()-5, slider.height()-5), cg, Style_Default); #ifndef SIMPLE_SCROLLBARS @@ -6257,24 +6262,24 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const case CC_Slider: // // Note: Can't use KStyle's drawing routine, as this doesnt work for sliders on gradient - // toolbars. It also draws groove, focus, slider - wherease QtCurve needs groove, + // toolbars. It also draws groove, focus, slider - wherease TQtCurve needs groove, // slider, focus. We also ony double-buffer if not on a toolbar, as we dont know // the background, etc, if on a toolbar - and that is handled in eventFilter { bool tb(!IS_FLAT(opts.toolbarAppearance) && widget && 0==qstrcmp(widget->name(), kdeToolbarWidget)); - QRect groove=querySubControlMetrics(CC_Slider, widget, SC_SliderGroove, data), + TQRect groove=querySubControlMetrics(CC_Slider, widget, SC_SliderGroove, data), handle=querySubControlMetrics(CC_Slider, widget, SC_SliderHandle, data); - QPixmap pix(widget->size()); - QPainter p2, + TQPixmap pix(widget->size()); + TQPainter p2, *paint(tb ? p : &p2); if(!tb) { paint->begin(&pix); - if (widget->parentWidget() && widget->parentWidget()->backgroundPixmap() && - !widget->parentWidget()->backgroundPixmap()->isNull()) - paint->drawTiledPixmap(r, *(widget->parentWidget()->backgroundPixmap()), widget->pos()); + if (widget->tqparentWidget() && widget->tqparentWidget()->backgroundPixmap() && + !widget->tqparentWidget()->backgroundPixmap()->isNull()) + paint->drawTiledPixmap(r, *(widget->tqparentWidget()->backgroundPixmap()), widget->pos()); else pix.fill(cg.background()); } @@ -6282,79 +6287,79 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const if((controls & SC_SliderGroove)&& groove.isValid()) drawSliderGroove(paint, groove, cg, flags, widget); if((controls & SC_SliderHandle)&& handle.isValid()) - drawSliderHandle(paint, handle, cg, flags, widget ? ::qt_cast<QSlider *>(widget) : 0L, tb); + drawSliderHandle(paint, handle, cg, flags, widget ? ::tqqt_cast<TQSlider *>(widget) : 0L, tb); if(controls & SC_SliderTickmarks) - QCommonStyle::drawComplexControl(control, paint, widget, r, cg, flags, SC_SliderTickmarks, + TQCommonStyle::tqdrawComplexControl(control, paint, widget, r, cg, flags, SC_SliderTickmarks, active, data); if(flags&Style_HasFocus && FOCUS_GLOW!=opts.focus) - drawPrimitive(PE_FocusRect, paint, groove, cg); + tqdrawPrimitive(PE_FocusRect, paint, groove, cg); if(!tb) { paint->end(); - bitBlt((QWidget*)widget, r.x(), r.y(), &pix); + bitBlt((TQWidget*)widget, r.x(), r.y(), &pix); } break; } case CC_TitleBar: { const int buttonMargin(3); - const QTitleBar *tb((const QTitleBar *)widget); + const TQTitleBar *tb((const TQTitleBar *)widget); bool isActive((tb->isActive() && widget->isActiveWindow()) || - (!tb->window() && widget->topLevelWidget()->isActiveWindow())); - QColorGroup cgroup(isActive - ? widget->palette().active() - : widget->palette().inactive()); - const QColor *cols(getMdiColors(cg, isActive)); - QColor textCol(isActive ? itsActiveMdiTextColor : itsMdiTextColor), + (!tb->window() && widget->tqtopLevelWidget()->isActiveWindow())); + TQColorGroup cgroup(isActive + ? widget->tqpalette().active() + : widget->tqpalette().inactive()); + const TQColor *cols(getMdiColors(cg, isActive)); + TQColor textCol(isActive ? itsActiveMdiTextColor : itsMdiTextColor), shdCol(shadowColor(textCol)), shadowCol(midColor(cols[ORIGINAL_SHADE], shdCol)); if (controls&SC_TitleBarLabel) { - int alignment=AlignVCenter|SingleLine; + int tqalignment=AlignVCenter|SingleLine; bool full=false; switch(opts.titlebarAlignment) { default: case ALIGN_LEFT: - alignment|=Qt::AlignLeft; + tqalignment|=TQt::AlignLeft; break; case ALIGN_CENTER: - alignment|=Qt::AlignHCenter; + tqalignment|=TQt::AlignHCenter; break; case ALIGN_FULL_CENTER: - alignment|=Qt::AlignHCenter; + tqalignment|=TQt::AlignHCenter; full=true; break; case ALIGN_RIGHT: - alignment|=Qt::AlignRight; + tqalignment|=TQt::AlignRight; } - QRect ir(visualRect(querySubControlMetrics(CC_TitleBar, widget, SC_TitleBarLabel), widget)), + TQRect ir(tqvisualRect(querySubControlMetrics(CC_TitleBar, widget, SC_TitleBarLabel), widget)), textRect(full ? tb->rect().x() : ir.x(), ir.y(), full ? tb->rect().width() : ir.width(), ir.height()); EAppearance app=isActive ? opts.titlebarAppearance : opts.inactiveTitlebarAppearance; drawBevelGradient(cols[ORIGINAL_SHADE], p, r, true, false, app, WIDGET_MDI_WINDOW); ir.addCoords(2, 0, -4, 0); - QFontMetrics fm(QFontMetrics(widget->font())); - QString titleString(elliditide(widget->caption(), fm, textRect.width())); + TQFontMetrics fm(TQFontMetrics(widget->font())); + TQString titleString(elliditide(widget->caption(), fm, textRect.width())); if(full) { int textWidth=fm.boundingRect(titleString).width(); if(ir.left()>((textRect.width()-textWidth)>>1)) { - alignment=Qt::AlignVCenter|Qt::AlignLeft; + tqalignment=TQt::AlignVCenter|TQt::AlignLeft; textRect=ir; full=false; } else if(ir.right()<((textRect.width()+textWidth)>>1)) { - alignment=Qt::AlignVCenter|Qt::AlignRight; + tqalignment=TQt::AlignVCenter|TQt::AlignRight; textRect=ir; full=false; } @@ -6363,23 +6368,23 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const } p->setPen(shadowCol); - p->drawText(textRect.x()+1, textRect.y()+1, textRect.width(), textRect.height(), alignment, titleString); + p->drawText(textRect.x()+1, textRect.y()+1, textRect.width(), textRect.height(), tqalignment, titleString); p->setPen(textCol); - p->drawText(textRect.x(), textRect.y(), textRect.width(), textRect.height(), alignment, titleString); + p->drawText(textRect.x(), textRect.y(), textRect.width(), textRect.height(), tqalignment, titleString); if(full) p->setClipping(false); //controls-=SC_TitleBarLabel; } - QRect ir; + TQRect ir; bool down(false); - QPixmap pm; + TQPixmap pm; if (controls&SC_TitleBarCloseButton) { - ir = visualRect(querySubControlMetrics(CC_TitleBar, widget, SC_TitleBarCloseButton), widget); + ir = tqvisualRect(querySubControlMetrics(CC_TitleBar, widget, SC_TitleBarCloseButton), widget); down = active & SC_TitleBarCloseButton; - drawPrimitive(PE_ButtonTool, p, ir, tb->colorGroup(), down ? Style_Down : Style_Raised); + tqdrawPrimitive(PE_ButtonTool, p, ir, tb->tqcolorGroup(), down ? Style_Down : Style_Raised); drawMdiIcon(p, textCol, shadowCol, ir, down, buttonMargin, SC_TitleBarCloseButton); } @@ -6387,72 +6392,72 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, QPainter *p, const { if (controls &SC_TitleBarMaxButton) { - ir = visualRect(querySubControlMetrics(CC_TitleBar, widget, SC_TitleBarMaxButton), widget); + ir = tqvisualRect(querySubControlMetrics(CC_TitleBar, widget, SC_TitleBarMaxButton), widget); down = active & SC_TitleBarMaxButton; - drawPrimitive(PE_ButtonTool, p, ir, tb->colorGroup(), down ? Style_Down : Style_Raised); + tqdrawPrimitive(PE_ButtonTool, p, ir, tb->tqcolorGroup(), down ? Style_Down : Style_Raised); drawMdiIcon(p, textCol, shadowCol, ir, down, buttonMargin, SC_TitleBarMaxButton); } if (controls&SC_TitleBarNormalButton || controls&SC_TitleBarMinButton) { - ir = visualRect(querySubControlMetrics(CC_TitleBar, widget, SC_TitleBarMinButton), widget); - QStyle::SubControl ctrl = (controls & SC_TitleBarNormalButton ? + ir = tqvisualRect(querySubControlMetrics(CC_TitleBar, widget, SC_TitleBarMinButton), widget); + TQStyle::SubControl ctrl = (controls & SC_TitleBarNormalButton ? SC_TitleBarNormalButton : SC_TitleBarMinButton); down = active & ctrl; - drawPrimitive(PE_ButtonTool, p, ir, tb->colorGroup(), down ? Style_Down : Style_Raised); + tqdrawPrimitive(PE_ButtonTool, p, ir, tb->tqcolorGroup(), down ? Style_Down : Style_Raised); drawMdiIcon(p, textCol, shadowCol, ir, down, buttonMargin, ctrl); } if (controls&SC_TitleBarShadeButton) { - ir = visualRect(querySubControlMetrics(CC_TitleBar, widget, SC_TitleBarShadeButton), widget); + ir = tqvisualRect(querySubControlMetrics(CC_TitleBar, widget, SC_TitleBarShadeButton), widget); down = active & SC_TitleBarShadeButton; - drawPrimitive(PE_ButtonTool, p, ir, tb->colorGroup(), down ? Style_Down : Style_Raised); + tqdrawPrimitive(PE_ButtonTool, p, ir, tb->tqcolorGroup(), down ? Style_Down : Style_Raised); drawMdiIcon(p, textCol, shadowCol, ir, down, buttonMargin, SC_TitleBarShadeButton); } if (controls&SC_TitleBarUnshadeButton) { - ir = visualRect(querySubControlMetrics(CC_TitleBar, widget, SC_TitleBarUnshadeButton), widget); + ir = tqvisualRect(querySubControlMetrics(CC_TitleBar, widget, SC_TitleBarUnshadeButton), widget); down = active & SC_TitleBarUnshadeButton; - drawPrimitive(PE_ButtonTool, p, ir, tb->colorGroup(), down ? Style_Down : Style_Raised); + tqdrawPrimitive(PE_ButtonTool, p, ir, tb->tqcolorGroup(), down ? Style_Down : Style_Raised); drawMdiIcon(p, textCol, shadowCol, ir, down, buttonMargin, SC_TitleBarUnshadeButton); } } if (controls&SC_TitleBarSysMenu && tb->icon()) { - ir = visualRect(querySubControlMetrics(CC_TitleBar, widget, SC_TitleBarSysMenu), widget); + ir = tqvisualRect(querySubControlMetrics(CC_TitleBar, widget, SC_TitleBarSysMenu), widget); down = active & SC_TitleBarSysMenu; - drawPrimitive(PE_ButtonTool, p, ir, tb->colorGroup(), down ? Style_Down : Style_Raised); - drawItem(p, ir, AlignCenter, tb->colorGroup(), true, tb->icon(), QString::null); + tqdrawPrimitive(PE_ButtonTool, p, ir, tb->tqcolorGroup(), down ? Style_Down : Style_Raised); + drawItem(p, ir, AlignCenter, tb->tqcolorGroup(), true, tb->icon(), TQString()); } break; } default: - BASE_STYLE::drawComplexControl(control, p, widget, r, cg, flags, controls, active, data); + BASE_STYLE::tqdrawComplexControl(control, p, widget, r, cg, flags, controls, active, data); } } -QRect QtCurveStyle::querySubControlMetrics(ComplexControl control, const QWidget *widget, - SubControl sc, const QStyleOption &data) const +TQRect TQtCurveStyle::querySubControlMetrics(TQ_ComplexControl control, const TQWidget *widget, + SubControl sc, const TQStyleOption &data) const { - bool reverse(QApplication::reverseLayout()); + bool reverse(TQApplication::reverseLayout()); switch(control) { case CC_SpinWidget: { if(!widget) - return QRect(); + return TQRect(); - int fw(pixelMetric(PM_SpinBoxFrameWidth, 0)); - QSize bs; + int fw(tqpixelMetric(PM_SpinBoxFrameWidth, 0)); + TQSize bs; bs.setHeight(widget->height()>>1); if(bs.height()< 8) bs.setHeight(8); bs.setWidth(DO_EFFECT ? 16 : 15); - bs=bs.expandedTo(QApplication::globalStrut()); + bs=bs.expandedTo(TQApplication::globalStrut()); int extra(bs.height()*2==widget->height()? 0 : 1), y(0), x(widget->width()-bs.width()), @@ -6461,18 +6466,18 @@ QRect QtCurveStyle::querySubControlMetrics(ComplexControl control, const QWidget switch(sc) { case SC_SpinWidgetUp: - return QRect(x, y, bs.width(), bs.height()); + return TQRect(x, y, bs.width(), bs.height()); case SC_SpinWidgetDown: - return QRect(x, y+bs.height(), bs.width(), bs.height()+extra); + return TQRect(x, y+bs.height(), bs.width(), bs.height()+extra); case SC_SpinWidgetButtonField: - return QRect(x, y, bs.width(), widget->height()-2*fw); + return TQRect(x, y, bs.width(), widget->height()-2*fw); case SC_SpinWidgetEditField: - return QRect(fw, fw, rx, widget->height()-2*fw); + return TQRect(fw, fw, rx, widget->height()-2*fw); case SC_SpinWidgetFrame: return reverse - ? QRect(widget->x()+bs.width(), widget->y(), + ? TQRect(widget->x()+bs.width(), widget->y(), widget->width()-bs.width()-1, widget->height()) - : QRect(widget->x(), widget->y(), + : TQRect(widget->x(), widget->y(), widget->width()-bs.width(),widget->height()); default: break; // Remove compiler warnings... @@ -6480,14 +6485,14 @@ QRect QtCurveStyle::querySubControlMetrics(ComplexControl control, const QWidget } case CC_ComboBox: { - QRect r(BASE_STYLE::querySubControlMetrics(control, widget, sc, data)); + TQRect r(BASE_STYLE::querySubControlMetrics(control, widget, sc, data)); if(SC_ComboBoxFrame==sc) { - const QComboBox *cb(::qt_cast<const QComboBox *>(widget)); + const TQComboBox *cb(::tqqt_cast<const TQComboBox *>(widget)); if(cb && cb->editable()) - r=QRect(r.x()+r.width()-19, r.y(), 19, r.height()); + r=TQRect(r.x()+r.width()-19, r.y(), 19, r.height()); } else if (SC_ComboBoxEditField==sc && !DO_EFFECT) r.addCoords(0, 0, -1, 0); @@ -6500,11 +6505,11 @@ QRect QtCurveStyle::querySubControlMetrics(ComplexControl control, const QWidget platinumScrollBar(SCROLLBAR_PLATINUM==opts.scrollbarType), nextScrollBar(SCROLLBAR_NEXT==opts.scrollbarType), noButtons(SCROLLBAR_NONE==opts.scrollbarType); - QRect ret; - const QScrollBar *sb((const QScrollBar*)widget); + TQRect ret; + const TQScrollBar *sb((const TQScrollBar*)widget); bool horizontal(sb->orientation() == Qt::Horizontal); int sliderstart(sb->sliderStart()), - sbextent(pixelMetric(PM_ScrollBarExtent, widget)), + sbextent(tqpixelMetric(PM_ScrollBarExtent, widget)), maxlen((horizontal ? sb->width() : sb->height()) - (noButtons ? 0 : (sbextent * (threeButtonScrollBar ? 3 : 2)))), sliderlen; @@ -6515,7 +6520,7 @@ QRect QtCurveStyle::querySubControlMetrics(ComplexControl control, const QWidget uint range = sb->maxValue() - sb->minValue(); sliderlen = (sb->pageStep() * maxlen) / (range + sb->pageStep()); - int slidermin = pixelMetric( PM_ScrollBarSliderMin, widget ); + int slidermin = tqpixelMetric( PM_ScrollBarSliderMin, widget ); if ( sliderlen < slidermin || range > INT_MAX / 2 ) sliderlen = slidermin; if ( sliderlen > maxlen ) @@ -6529,7 +6534,7 @@ QRect QtCurveStyle::querySubControlMetrics(ComplexControl control, const QWidget { case SC_ScrollBarSubLine: if(noButtons) - return QRect(); + return TQRect(); // top/left button if (platinumScrollBar) @@ -6542,7 +6547,7 @@ QRect QtCurveStyle::querySubControlMetrics(ComplexControl control, const QWidget break; case SC_ScrollBarAddLine: if(noButtons) - return QRect(); + return TQRect(); // bottom/right button if (nextScrollBar) @@ -6632,7 +6637,7 @@ QRect QtCurveStyle::querySubControlMetrics(ComplexControl control, const QWidget ret.setRect(0, sliderstart, sbextent, sliderlen); break; default: - ret = QCommonStyle::querySubControlMetrics(control, widget, sc, data); + ret = TQCommonStyle::querySubControlMetrics(control, widget, sc, data); break; } return ret; @@ -6641,21 +6646,21 @@ QRect QtCurveStyle::querySubControlMetrics(ComplexControl control, const QWidget case CC_TitleBar: if (widget) { - bool isMinimized(tb->titleBarState&Qt::WindowMinimized), - isMaximized(tb->titleBarState&Qt::WindowMaximized); + bool isMinimized(tb->titleBarState&TQt::WindowMinimized), + isMaximized(tb->titleBarState&TQt::WindowMaximized); if( (isMaximized && SC_TitleBarMaxButton==subControl) || (isMinimized && SC_TitleBarMinButton==subControl) || (isMinimized && SC_TitleBarShadeButton==subControl) || (!isMinimized && SC_TitleBarUnshadeButton==subControl)) - return QRect(); + return TQRect(); readMdiPositions(); const int windowMargin(2); const int controlSize(tb->rect.height() - windowMargin *2); - QList<int>::ConstIterator it(itsMdiButtons[0].begin()), + TQList<int>::ConstIterator it(itsMdiButtons[0].begin()), end(itsMdiButtons[0].end()); int sc(SC_TitleBarUnshadeButton==subControl ? SC_TitleBarShadeButton @@ -6709,7 +6714,7 @@ QRect QtCurveStyle::querySubControlMetrics(ComplexControl control, const QWidget if(SC_TitleBarLabel==subControl) r.adjust(totalLeft, 0, -totalRight, 0); else if(!found) - return QRect(); + return TQRect(); else if(rhs) r.setRect(r.right()-(pos+windowMargin), r.top()+windowMargin, @@ -6717,7 +6722,7 @@ QRect QtCurveStyle::querySubControlMetrics(ComplexControl control, const QWidget else r.setRect(r.left()+windowMargin+pos, r.top()+windowMargin, controlSize, controlSize); - return visualRect(tb->direction, tb->rect, r); + return tqvisualRect(tb->direction, tb->rect, r); } } #endif @@ -6728,7 +6733,7 @@ QRect QtCurveStyle::querySubControlMetrics(ComplexControl control, const QWidget return BASE_STYLE::querySubControlMetrics(control, widget, sc, data); } -int QtCurveStyle::pixelMetric(PixelMetric metric, const QWidget *widget) const +int TQtCurveStyle::tqpixelMetric(PixelMetric metric, const TQWidget *widget) const { switch(metric) { @@ -6738,16 +6743,16 @@ int QtCurveStyle::pixelMetric(PixelMetric metric, const QWidget *widget) const return 7; case PM_ButtonMargin: return 3; -#if QT_VERSION >= 0x030200 +#if 0x039999 >= 0x030200 case PM_TabBarTabShiftVertical: { - const QTabBar *tb=widget ? ::qt_cast<const QTabBar *>(widget) : 0; + const TQTabBar *tb=widget ? ::tqqt_cast<const TQTabBar *>(widget) : 0; return tb - ? QTabBar::RoundedAbove==tb->shape() || QTabBar::TriangularAbove==tb->shape() + ? TQTabBar::RoundedAbove==tb->tqshape() || TQTabBar::TriangularAbove==tb->tqshape() ? 1 : -1 - : BASE_STYLE::pixelMetric(metric, widget); + : BASE_STYLE::tqpixelMetric(metric, widget); } case PM_TabBarTabShiftHorizontal: return 0; @@ -6758,18 +6763,18 @@ int QtCurveStyle::pixelMetric(PixelMetric metric, const QWidget *widget) const case PM_ButtonDefaultIndicator: return 0; case PM_DefaultFrameWidth: - if(APP_KATE==itsThemedApp && widget && widget->parentWidget() && widget->parentWidget()->parentWidget() && - ::qt_cast<const QWidgetStack *>(widget) && - ::qt_cast<const QTabWidget *>(widget->parentWidget()) && - ::qt_cast<const QVBox *>(widget->parentWidget()->parentWidget())) + if(APP_KATE==itsThemedApp && widget && widget->tqparentWidget() && widget->tqparentWidget()->tqparentWidget() && + ::tqqt_cast<const TQWidgetStack *>(widget) && + ::tqqt_cast<const TQTabWidget *>(widget->tqparentWidget()) && + ::tqqt_cast<const TQVBox *>(widget->tqparentWidget()->tqparentWidget())) return 0; - if ((opts.square&SQUARE_SCROLLVIEW) && widget && ::qt_cast<const QScrollView *>(widget)) + if ((opts.square&STQUARE_SCROLLVIEW) && widget && ::tqqt_cast<const TQScrollView *>(widget)) return (opts.gtkScrollViews || opts.thinSbarGroove) && !opts.highlightScrollViews ? 1 : 2; if(DO_EFFECT && opts.etchEntry && widget && !isFormWidget(widget) && - (::qt_cast<const QLineEdit *>(widget) || ::qt_cast<const QDateTimeEditBase*>(widget) || - ::qt_cast<const QTextEdit*>(widget) || ::qt_cast<const QScrollView*>(widget))) + (::tqqt_cast<const TQLineEdit *>(widget) || ::tqqt_cast<const TQDateTimeEditBase*>(widget) || + ::tqqt_cast<const TQTextEdit*>(widget) || ::tqqt_cast<const TQScrollView*>(widget))) return 3; else return 2; @@ -6790,7 +6795,7 @@ int QtCurveStyle::pixelMetric(PixelMetric metric, const QWidget *widget) const case PM_DockWindowHandleExtent: return 10; case PM_SplitterWidth: - return widget && widget->inherits("QDockWindowResizeHandle") + return widget && widget->inherits("TQDockWindowResizeHandle") ? 9 : LINE_1DOT==opts.splitters ? 7 @@ -6807,18 +6812,18 @@ int QtCurveStyle::pixelMetric(PixelMetric metric, const QWidget *widget) const // See KHTML note at top of file return opts.sliderWidth+ (APP_KPRESENTER==itsThemedApp || - ((APP_KONQUEROR==itsThemedApp || APP_KONTACT==itsThemedApp) && (!widget || isFormWidget(widget))) + ((APP_KONTQUEROR==itsThemedApp || APP_KONTACT==itsThemedApp) && (!widget || isFormWidget(widget))) ? 1 : 0); case PM_MaximumDragDistance: return -1; case PM_TabBarTabVSpace: return opts.highlightTab ? 11 : 9; default: - return BASE_STYLE::pixelMetric(metric, widget); + return BASE_STYLE::tqpixelMetric(metric, widget); } } -int QtCurveStyle::kPixelMetric(KStylePixelMetric kpm, const QWidget *widget) const +int TQtCurveStyle::kPixelMetric(KStylePixelMetric kpm, const TQWidget *widget) const { switch(kpm) { @@ -6829,19 +6834,19 @@ int QtCurveStyle::kPixelMetric(KStylePixelMetric kpm, const QWidget *widget) con } } -QSize QtCurveStyle::sizeFromContents(ContentsType contents, const QWidget *widget, - const QSize &contentsSize, const QStyleOption &data) const +TQSize TQtCurveStyle::tqsizeFromContents(ContentsType contents, const TQWidget *widget, + const TQSize &contentsSize, const TQStyleOption &data) const { switch(contents) { case CT_PushButton: { - const QPushButton *button(static_cast<const QPushButton *>(widget)); + const TQPushButton *button(static_cast<const TQPushButton *>(widget)); if (button && !button->text().isEmpty()) { - int margin(2*pixelMetric(PM_ButtonMargin, widget)), - mbi(button->isMenuButton() ? pixelMetric(PM_MenuButtonIndicator, widget) : 0), + int margin(2*tqpixelMetric(PM_ButtonMargin, widget)), + mbi(button->isMenuButton() ? tqpixelMetric(PM_MenuButtonIndicator, widget) : 0), w(contentsSize.width() + margin + mbi + 16); // if(button->text()=="...") @@ -6857,15 +6862,15 @@ QSize QtCurveStyle::sizeFromContents(ContentsType contents, const QWidget *widge w=constMinW; } - return QSize(w, contentsSize.height() + margin+(DO_EFFECT && !isFormWidget(widget) && !opts.thinnerBtns + return TQSize(w, contentsSize.height() + margin+(DO_EFFECT && !isFormWidget(widget) && !opts.thinnerBtns ? 6 : 4)); } break; } case CT_ComboBox: { - QSize sz(BASE_STYLE::sizeFromContents(contents, widget, contentsSize, data)); - return QSize(sz.width(), sz.height()+(DO_EFFECT && !isFormWidget(widget) && !opts.thinnerBtns ? 4 : 2)); + TQSize sz(BASE_STYLE::tqsizeFromContents(contents, widget, contentsSize, data)); + return TQSize(sz.width(), sz.height()+(DO_EFFECT && !isFormWidget(widget) && !opts.thinnerBtns ? 4 : 2)); } case CT_PopupMenuItem: { @@ -6874,15 +6879,15 @@ QSize QtCurveStyle::sizeFromContents(ContentsType contents, const QWidget *widge const int constMinH(opts.thinnerMenuItems ? 25 : 27); - QMenuItem *mi(data.menuItem()); - const QPopupMenu *popupmenu(static_cast<const QPopupMenu *>(widget)); + TQMenuItem *mi(data.menuItem()); + const TQPopupMenu *popupmenu(static_cast<const TQPopupMenu *>(widget)); int maxpmw(data.maxIconWidth()), w(contentsSize.width()), h(contentsSize.height()); if (mi->custom()) { - w = mi->custom()->sizeHint().width(); - h = mi->custom()->sizeHint().height(); + w = mi->custom()->tqsizeHint().width(); + h = mi->custom()->tqsizeHint().height(); if (!mi->custom()->fullSpan() && h < constMinH) h = constMinH; @@ -6900,28 +6905,28 @@ QSize QtCurveStyle::sizeFromContents(ContentsType contents, const QWidget *widge if (h < 16) h = 16; if (mi->pixmap()) - h = QMAX(h, mi->pixmap()->height()); + h = TQMAX(h, mi->pixmap()->height()); else if (!mi->text().isNull()) - h = QMAX(h, popupmenu->fontMetrics().height() + 2); + h = TQMAX(h, popupmenu->fontMetrics().height() + 2); if (mi->iconSet()!= 0) - h = QMAX(h, mi->iconSet()->pixmap(QIconSet::Small, QIconSet::Normal).height()); + h = TQMAX(h, mi->iconSet()->pixmap(TQIconSet::Small, TQIconSet::Normal).height()); h+=(opts.thinnerMenuItems ? 2 : 4); } // check | 4 pixels | item | 8 pixels | accel | 4 pixels | check // check is at least 16x16 - maxpmw=QMAX(maxpmw, constMenuPixmapWidth); + maxpmw=TQMAX(maxpmw, constMenuPixmapWidth); w += (maxpmw * 2) + 8; - if (! mi->text().isNull() && mi->text().find('\t') >= 0) + if (! mi->text().isNull() && mi->text().tqfind('\t') >= 0) w += 8; - return QSize(w, h); + return TQSize(w, h); } case CT_SpinBox: { - QSize size(BASE_STYLE::sizeFromContents(contents, widget, contentsSize, data)); + TQSize size(BASE_STYLE::tqsizeFromContents(contents, widget, contentsSize, data)); if(!(size.height()%2)) size.setHeight(size.height()+1); @@ -6932,17 +6937,17 @@ QSize QtCurveStyle::sizeFromContents(ContentsType contents, const QWidget *widge return size; } case CT_ToolButton: - if(widget->parent() && ::qt_cast<QToolBar *>(widget->parent())) - return QSize(contentsSize.width()+8, contentsSize.height()+8); + if(widget->tqparent() && ::tqqt_cast<TQToolBar *>(widget->tqparent())) + return TQSize(contentsSize.width()+8, contentsSize.height()+8); default: break; // Remove compiler warnings... } - return BASE_STYLE::sizeFromContents(contents, widget, contentsSize, data); + return BASE_STYLE::tqsizeFromContents(contents, widget, contentsSize, data); } -int QtCurveStyle::styleHint(StyleHint stylehint, const QWidget *widget, const QStyleOption &option, - QStyleHintReturn *returnData) const +int TQtCurveStyle::tqstyleHint(StyleHint stylehint, const TQWidget *widget, const TQStyleOption &option, + TQStyleHintReturn *returnData) const { switch(stylehint) { @@ -6966,10 +6971,10 @@ int QtCurveStyle::styleHint(StyleHint stylehint, const QWidget *widget, const QS if(opts.passwordChar) { int chars[4]={opts.passwordChar, 0x25CF, 0x2022, 0}; - const QFontMetrics &fm(widget ? widget->fontMetrics() : QFontMetrics(QFont())); + const TQFontMetrics &fm(widget ? widget->fontMetrics() : TQFontMetrics(TQFont())); for(int i=0; chars[i]; ++i) - if (fm.inFont(QChar(chars[i]))) + if (fm.inFont(TQChar(chars[i]))) return chars[i]; return '*'; } @@ -6984,18 +6989,18 @@ int QtCurveStyle::styleHint(StyleHint stylehint, const QWidget *widget, const QS case SH_TabBar_Alignment: return AlignLeft; default: - return BASE_STYLE::styleHint(stylehint, widget, option, returnData); + return BASE_STYLE::tqstyleHint(stylehint, widget, option, returnData); } } -void QtCurveStyle::drawItem(QPainter *p, const QRect &r, int flags, const QColorGroup &cg, bool enabled, - const QPixmap *pixmap, const QString &text, int len, const QColor *penColor) const +void TQtCurveStyle::drawItem(TQPainter *p, const TQRect &r, int flags, const TQColorGroup &cg, bool enabled, + const TQPixmap *pixmap, const TQString &text, int len, const TQColor *penColor) const { - QRect r2(r); + TQRect r2(r); - if((opts.gbLabel&GB_LBL_BOLD) && text.length() && p->device() && dynamic_cast<QGroupBox *>(p->device())) + if((opts.gbLabel&GB_LBL_BOLD) && text.length() && p->device() && dynamic_cast<TQGroupBox *>(p->device())) { - QGroupBox *box=static_cast<QGroupBox*>(p->device()); + TQGroupBox *box=static_cast<TQGroupBox*>(p->device()); if (!box->isCheckable()) { @@ -7003,17 +7008,17 @@ void QtCurveStyle::drawItem(QPainter *p, const QRect &r, int flags, const QColor top, width, height; - QFontMetrics fm(p->fontMetrics()); - QRect rb(box->rect()); + TQFontMetrics fm(p->fontMetrics()); + TQRect rb(box->rect()); int th(fm.height()+2); - QFont f(p->font()); + TQFont f(p->font()); rb.rect(&left, &top, &width, &height); //rb.coords(&left, &top, &right, &bottom); f.setBold(true); - p->setPen(box->colorGroup().foreground()); + p->setPen(box->tqcolorGroup().foreground()); p->setFont(f); - p->drawText(QRect(left, top, width, th), (QApplication::reverseLayout() + p->drawText(TQRect(left, top, width, th), (TQApplication::reverseLayout() ? AlignRight : AlignLeft)|AlignVCenter|ShowPrefix|SingleLine, text); @@ -7029,8 +7034,8 @@ void QtCurveStyle::drawItem(QPainter *p, const QRect &r, int flags, const QColor p->setPen(penColor ? *penColor : cg.foreground()); if (pixmap) { - QPixmap pm(*pixmap); - bool clip = (flags&Qt::DontClip) == 0; + TQPixmap pm(*pixmap); + bool clip = (flags&TQt::DontClip) == 0; if (clip) { if (pm.width() < w && pm.height() < h) @@ -7038,54 +7043,54 @@ void QtCurveStyle::drawItem(QPainter *p, const QRect &r, int flags, const QColor else { p->save(); - QRegion cr = QRect(x, y, w, h); + TQRegion cr = TQRect(x, y, w, h); if (p->hasClipping()) - cr &= p->clipRegion(QPainter::CoordPainter); + cr &= p->clipRegion(TQPainter::CoordPainter); p->setClipRegion(cr); } } - if ((flags&Qt::AlignVCenter) == Qt::AlignVCenter) + if ((flags&TQt::AlignVCenter) == TQt::AlignVCenter) y += h/2 - pm.height()/2; - else if ((flags&Qt::AlignBottom) == Qt::AlignBottom) + else if ((flags&TQt::AlignBottom) == TQt::AlignBottom) y += h - pm.height(); - if ((flags&Qt::AlignRight) == Qt::AlignRight) + if ((flags&TQt::AlignRight) == TQt::AlignRight) x += w - pm.width(); - else if ((flags&Qt::AlignHCenter) == Qt::AlignHCenter) + else if ((flags&TQt::AlignHCenter) == TQt::AlignHCenter) x += w/2 - pm.width()/2; - else if (((flags&Qt::AlignLeft) != Qt::AlignLeft) && QApplication::reverseLayout()) // AlignAuto && rightToLeft + else if (((flags&TQt::AlignLeft) != TQt::AlignLeft) && TQApplication::reverseLayout()) // AlignAuto && rightToLeft x += w - pm.width(); if (!enabled) { - if (pm.mask()) // pixmap with a mask + if (pm.tqmask()) // pixmap with a tqmask { - if (!pm.selfMask()) // mask is not pixmap itself + if (!pm.selfMask()) // tqmask is not pixmap itself { - QPixmap pmm(*pm.mask()); - pmm.setMask(*((QBitmap *)&pmm)); + TQPixmap pmm(*pm.tqmask()); + pmm.setMask(*((TQBitmap *)&pmm)); pm = pmm; } } - else if (pm.depth() == 1) // monochrome pixmap, no mask + else if (pm.depth() == 1) // monochrome pixmap, no tqmask { - pm.setMask(*((QBitmap *)&pm)); -#ifndef QT_NO_IMAGE_HEURISTIC_MASK + pm.setMask(*((TQBitmap *)&pm)); +#ifndef TQT_NO_IMAGE_HEURISTIC_MASK } - else // color pixmap, no mask + else // color pixmap, no tqmask { - QString k; + TQString k; k.sprintf("$qt-drawitem-%x", pm.serialNumber()); - QPixmap *mask = QPixmapCache::find(k); + TQPixmap *tqmask = TQPixmapCache::tqfind(k); bool del=false; - if (!mask) + if (!tqmask) { - mask = new QPixmap(pm.createHeuristicMask()); - mask->setMask(*((QBitmap*)mask)); - del = !QPixmapCache::insert(k, mask); + tqmask = new TQPixmap(pm.createHeuristicMask()); + tqmask->setMask(*((TQBitmap*)tqmask)); + del = !TQPixmapCache::insert(k, tqmask); } - pm = *mask; + pm = *tqmask; if (del) - delete mask; + delete tqmask; #endif } p->setPen(cg.text()); @@ -7102,8 +7107,8 @@ void QtCurveStyle::drawItem(QPainter *p, const QRect &r, int flags, const QColor } } -void QtCurveStyle::drawMenuItem(QPainter *p, const QRect &r, int flags, const QColorGroup &cg, - bool mbi, int round, const QColor &bgnd, const QColor *cols) const +void TQtCurveStyle::drawMenuItem(TQPainter *p, const TQRect &r, int flags, const TQColorGroup &cg, + bool mbi, int round, const TQColor &bgnd, const TQColor *cols) const { int fill=opts.useHighlightForMenu && (!mbi || itsHighlightCols==cols) ? ORIGINAL_SHADE : 4, border=opts.borderMenuitems ? 0 : fill; @@ -7114,9 +7119,9 @@ void QtCurveStyle::drawMenuItem(QPainter *p, const QRect &r, int flags, const QC if(!mbi && APPEARANCE_FADE==opts.menuitemAppearance) { - bool reverse=QApplication::reverseLayout(); + bool reverse=TQApplication::reverseLayout(); int roundOffet=ROUNDED ? 1 : 0; - QRect main(r.x()+(reverse ? 1+MENUITEM_FADE_SIZE : roundOffet+1), r.y()+roundOffet+1, + TQRect main(r.x()+(reverse ? 1+MENUITEM_FADE_SIZE : roundOffet+1), r.y()+roundOffet+1, r.width()-(1+MENUITEM_FADE_SIZE), r.height()-(2+(roundOffet*2))), fade(reverse ? r.x()+1 : r.width()-MENUITEM_FADE_SIZE, r.y()+1, MENUITEM_FADE_SIZE, r.height()-2); @@ -7129,7 +7134,7 @@ void QtCurveStyle::drawMenuItem(QPainter *p, const QRect &r, int flags, const QC cols, WIDGET_MENU_ITEM, false, BORDER_FLAT, false, fill); } - QColor bgnd(USE_LIGHTER_POPUP_MENU ? itsLighterPopupMenuBgndCol : itsBackgroundCols[ORIGINAL_SHADE]); + TQColor bgnd(USE_LIGHTER_POPUP_MENU ? itsLighterPopupMenuBgndCol : itsBackgroundCols[ORIGINAL_SHADE]); drawGradient(reverse ? bgnd : cols[fill], reverse ? cols[fill] : bgnd, p, fade, false); } else if(mbi || opts.borderMenuitems) @@ -7145,7 +7150,7 @@ void QtCurveStyle::drawMenuItem(QPainter *p, const QRect &r, int flags, const QC cols, stdColor, !(mbi && IS_GLASS(opts.menubarAppearance)), WIDGET_MENU_ITEM); else { - QRect fr(r); + TQRect fr(r); fr.addCoords(1, 1, -1, -1); @@ -7159,19 +7164,19 @@ void QtCurveStyle::drawMenuItem(QPainter *p, const QRect &r, int flags, const QC drawBevelGradient(cols[fill], p, r, true, false, opts.menuitemAppearance, WIDGET_MENU_ITEM); } -void QtCurveStyle::drawProgress(QPainter *p, const QRect &rx, const QColorGroup &cg, SFlags flags, - int round, const QWidget *widget) const +void TQtCurveStyle::drawProgress(TQPainter *p, const TQRect &rx, const TQColorGroup &cg, SFlags flags, + int round, const TQWidget *widget) const { if(rx.width()<1) return; - QRect r=opts.borderProgress - ? QRect(rx.x()+1, rx.y()+1, rx.width()-2, rx.height()-2) + TQRect r=opts.borderProgress + ? TQRect(rx.x()+1, rx.y()+1, rx.width()-2, rx.height()-2) : rx; int minWidth(3); bool drawFull(r.width()>minWidth), drawStripe(r.width()>(minWidth*1.5)); - QRegion outer(r); + TQRegion outer(r); if(r.width()<3) r.setWidth(3); @@ -7183,8 +7188,8 @@ void QtCurveStyle::drawProgress(QPainter *p, const QRect &rx, const QColorGroup if (opts.animatedProgress) { // find the animation Offset for the current Widget - QWidget *nonConstWidget(const_cast<QWidget*>(widget)); - QMapConstIterator<QWidget*, int> it(itsProgAnimWidgets.find(nonConstWidget)); + TQWidget *nonConstWidget(const_cast<TQWidget*>(widget)); + TQMapConstIterator<TQWidget*, int> it(itsProgAnimWidgets.tqfind(nonConstWidget)); if (it!=itsProgAnimWidgets.end()) animShift += it.data(); @@ -7198,15 +7203,15 @@ void QtCurveStyle::drawProgress(QPainter *p, const QRect &rx, const QColorGroup case STRIPE_PLAIN: for(int offset=0; offset<(r.width()+PROGRESS_CHUNK_WIDTH); offset+=(PROGRESS_CHUNK_WIDTH*2)) { - QRect r2(r.x()+offset+animShift, r.y(), PROGRESS_CHUNK_WIDTH, r.height()); - QRegion inner(r2); + TQRect r2(r.x()+offset+animShift, r.y(), PROGRESS_CHUNK_WIDTH, r.height()); + TQRegion inner(r2); outer=outer.eor(inner); } break; case STRIPE_DIAGONAL: { - QPointArray a; + TQPointArray a; int shift(r.height()); for(int offset=0; offset<(r.width()+shift+2); offset+=(PROGRESS_CHUNK_WIDTH*2)) @@ -7216,13 +7221,13 @@ void QtCurveStyle::drawProgress(QPainter *p, const QRect &rx, const QColorGroup (r.x()+offset+animShift+PROGRESS_CHUNK_WIDTH)-shift, r.y()+r.height()-1, (r.x()+offset+animShift)-shift, r.y()+r.height()-1); - outer=outer.eor(QRegion(a)); + outer=outer.eor(TQRegion(a)); } } } } - const QColor *use=flags&Style_Enabled || ECOLOR_BACKGROUND==opts.progressGrooveColor + const TQColor *use=flags&Style_Enabled || ECOLOR_BACKGROUND==opts.progressGrooveColor ? itsProgressCols ? itsProgressCols : itsHighlightCols @@ -7242,7 +7247,7 @@ void QtCurveStyle::drawProgress(QPainter *p, const QRect &rx, const QColorGroup } if(opts.borderProgress) - drawBorder(cg.background(), p, r, cg, flags, !(opts.square&SQUARE_PROGRESS) && opts.fillProgress ? ROUNDED_ALL : round, + drawBorder(cg.background(), p, r, cg, flags, !(opts.square&STQUARE_PROGRESS) && opts.fillProgress ? ROUNDED_ALL : round, use, WIDGET_PROGRESSBAR, false, BORDER_FLAT, false, PBAR_BORDER); else { @@ -7253,7 +7258,7 @@ void QtCurveStyle::drawProgress(QPainter *p, const QRect &rx, const QColorGroup } } -void QtCurveStyle::drawBevelGradient(const QColor &base, QPainter *p, const QRect &origRect, bool horiz, bool sel, EAppearance bevApp, EWidget w) const +void TQtCurveStyle::drawBevelGradient(const TQColor &base, TQPainter *p, const TQRect &origRect, bool horiz, bool sel, EAppearance bevApp, EWidget w) const { if(IS_FLAT(bevApp) && opts.colorSelTab && sel) bevApp=APPEARANCE_GRADIENT; @@ -7272,18 +7277,18 @@ void QtCurveStyle::drawBevelGradient(const QColor &base, QPainter *p, const QRec WIDGET_NO_ETCH_BTN==w || WIDGET_MENU_BUTTON==w ? bevApp : APPEARANCE_GRADIENT); - QRect r(0, 0, horiz ? PIXMAP_DIMENSION : origRect.width(), + TQRect r(0, 0, horiz ? PIXMAP_DIMENSION : origRect.width(), horiz ? origRect.height() : PIXMAP_DIMENSION); - QString key(createKey(horiz ? r.height() : r.width(), base.rgb(), horiz, app, + TQString key(createKey(horiz ? r.height() : r.width(), base.rgb(), horiz, app, tab && sel && opts.colorSelTab ? CACHE_COL_SEL_TAB : CACHE_STD)); - QPixmap *pix(itsPixmapCache.find(key)); + TQPixmap *pix(itsPixmapCache.tqfind(key)); bool inCache(true); if(!pix) { - pix=new QPixmap(r.width(), r.height()); + pix=new TQPixmap(r.width(), r.height()); - QPainter pixPainter(pix); + TQPainter pixPainter(pix); drawBevelGradientReal(base, &pixPainter, r, horiz, sel, app, w); pixPainter.end(); @@ -7301,7 +7306,7 @@ void QtCurveStyle::drawBevelGradient(const QColor &base, QPainter *p, const QRec } } -void QtCurveStyle::drawBevelGradientReal(const QColor &base, QPainter *p, const QRect &r, bool horiz, bool sel, EAppearance app, EWidget w) const +void TQtCurveStyle::drawBevelGradientReal(const TQColor &base, TQPainter *p, const TQRect &r, bool horiz, bool sel, EAppearance app, EWidget w) const { const Gradient *grad=getGradient(app, &opts); @@ -7310,7 +7315,7 @@ void QtCurveStyle::drawBevelGradientReal(const QColor &base, QPainter *p, const size(horiz ? r.height() : r.width()); bool topTab(WIDGET_TAB_TOP==w), botTab(WIDGET_TAB_BOT==w); - QColor prev; + TQColor prev; if(botTab) { @@ -7319,13 +7324,13 @@ void QtCurveStyle::drawBevelGradientReal(const QColor &base, QPainter *p, const for(int i=0; it!=end; ++it, ++i) { - QColor col; + TQColor col; int pos((int)(((1.0-(*it).pos)*size)+0.5)); if(sel && 0==i) col=base; else - shade(base, &col, opts.invertBotTab ? QMAX(INVERT_SHADE((*it).val), 0.9) : (*it).val); + shade(base, &col, opts.invertBotTab ? TQMAX(INVERT_SHADE((*it).val), 0.9) : (*it).val); if(/*sel && */opts.colorSelTab && i>0) col=tint(col, itsHighlightCols[0], (1.0-(*it).pos)*(0.2+TO_ALPHA(opts.colorSelTab))); @@ -7333,8 +7338,8 @@ void QtCurveStyle::drawBevelGradientReal(const QColor &base, QPainter *p, const if(i) drawGradient(prev, col, p, horiz - ? QRect(r.x(), lastPos, r.width(), pos-lastPos) - : QRect(lastPos, r.y(), pos-lastPos, r.height()), + ? TQRect(r.x(), lastPos, r.width(), pos-lastPos) + : TQRect(lastPos, r.y(), pos-lastPos, r.height()), horiz); prev=col; lastPos=pos; @@ -7347,13 +7352,13 @@ void QtCurveStyle::drawBevelGradientReal(const QColor &base, QPainter *p, const for(int i=0; it!=end; ++it, ++i) { - QColor col; + TQColor col; int pos((int)(((*it).pos*size)+0.5)); if(/*sel && */topTab && i==numStops-1) col=base; else - shade(base, &col, WIDGET_TAB_BOT==w ? QMAX((*it).val, 0.9) : (*it).val); + shade(base, &col, WIDGET_TAB_BOT==w ? TQMAX((*it).val, 0.9) : (*it).val); if(sel && opts.colorSelTab && topTab && i<numStops-1) col=tint(col, itsHighlightCols[0], (1.0-(*it).pos)*(0.2+TO_ALPHA(opts.colorSelTab))); @@ -7361,8 +7366,8 @@ void QtCurveStyle::drawBevelGradientReal(const QColor &base, QPainter *p, const if(i) drawGradient(prev, col, p, horiz - ? QRect(r.x(), lastPos, r.width(), pos-lastPos) - : QRect(lastPos, r.y(), pos-lastPos, r.height()), + ? TQRect(r.x(), lastPos, r.width(), pos-lastPos) + : TQRect(lastPos, r.y(), pos-lastPos, r.height()), horiz); prev=col; lastPos=pos; @@ -7370,8 +7375,8 @@ void QtCurveStyle::drawBevelGradientReal(const QColor &base, QPainter *p, const } } -void QtCurveStyle::drawGradient(const QColor &top, const QColor &bot, - QPainter *p, QRect const &r, bool horiz) const +void TQtCurveStyle::drawGradient(const TQColor &top, const TQColor &bot, + TQPainter *p, TQRect const &r, bool horiz) const { if(r.width()>0 && r.height()>0) { @@ -7399,7 +7404,7 @@ void QtCurveStyle::drawGradient(const QColor &top, const QColor &bot, { for (i=0; i < size; i++) { - p->setPen(QColor(rl>>16, gl>>16, bl>>16)); + p->setPen(TQColor(rl>>16, gl>>16, bl>>16)); p->drawLine(rx, ry+i, rx2, ry+i); rl += dr; gl += dg; @@ -7409,7 +7414,7 @@ void QtCurveStyle::drawGradient(const QColor &top, const QColor &bot, else for(i=0; i < size; i++) { - p->setPen(QColor(rl>>16, gl>>16, bl>>16)); + p->setPen(TQColor(rl>>16, gl>>16, bl>>16)); p->drawLine(rx+i, ry, rx+i, ry2); rl += dr; gl += dg; @@ -7419,12 +7424,12 @@ void QtCurveStyle::drawGradient(const QColor &top, const QColor &bot, } } -void QtCurveStyle::drawSbSliderHandle(QPainter *p, const QRect &orig, const QColorGroup &cg, +void TQtCurveStyle::drawSbSliderHandle(TQPainter *p, const TQRect &orig, const TQColorGroup &cg, SFlags flags, bool slider) const { int min(MIN_SLIDER_SIZE(opts.sliderThumbs)); - const QColor *use(sliderColors(/*cg, */flags)); - QRect r(orig); + const TQColor *use(sliderColors(/*cg, */flags)); + TQRect r(orig); // EShade shade(opts.shadeSliders); if(flags&(Style_Sunken|Style_Down)) @@ -7434,16 +7439,16 @@ void QtCurveStyle::drawSbSliderHandle(QPainter *p, const QRect &orig, const QCol flags|=Style_Horizontal; flags|=Style_Raised; - drawLightBevel(p, r, cg, flags, (slider && !(opts.square&SQUARE_SLIDER)) + drawLightBevel(p, r, cg, flags, (slider && !(opts.square&STQUARE_SLIDER)) #ifndef SIMPLE_SCROLLBARS - || (!slider && !(opts.square&SQUARE_SB_SLIDER) && (SCROLLBAR_NONE==opts.scrollbarType || opts.flatSbarButtons)) + || (!slider && !(opts.square&STQUARE_SB_SLIDER) && (SCROLLBAR_NONE==opts.scrollbarType || opts.flatSbarButtons)) #endif ? ROUNDED_ALL : ROUNDED_NONE, getFill(flags, use, false, SHADE_DARKEN==opts.shadeSliders), use, true, false, WIDGET_SB_SLIDER); if(LINE_NONE!=opts.sliderThumbs && (slider || ((flags & Style_Horizontal && r.width()>=min)|| r.height()>=min))) { - const QColor *markers(/*opts.coloredMouseOver && flags&Style_MouseOver + const TQColor *markers(/*opts.coloredMouseOver && flags&Style_MouseOver ? itsMouseOverCols : */use); bool horiz(flags&Style_Horizontal); @@ -7474,18 +7479,18 @@ void QtCurveStyle::drawSbSliderHandle(QPainter *p, const QRect &orig, const QCol } } -void QtCurveStyle::drawSliderHandle(QPainter *p, const QRect &r, const QColorGroup &cg, - SFlags flags, QSlider *slider, bool tb) const +void TQtCurveStyle::drawSliderHandle(TQPainter *p, const TQRect &r, const TQColorGroup &cg, + SFlags flags, TQSlider *slider, bool tb) const { bool horiz(SLIDER_TRIANGULAR==opts.sliderStyle ? r.height()>r.width() : r.width()>r.height()); if(SLIDER_TRIANGULAR==opts.sliderStyle || ((SLIDER_ROUND==opts.sliderStyle || SLIDER_ROUND_ROTATED==opts.sliderStyle) && FULLLY_ROUNDED)) { - const QColor *use(sliderColors(/*cg, */flags)), + const TQColor *use(sliderColors(/*cg, */flags)), *border(flags&Style_MouseOver && (MO_GLOW==opts.coloredMouseOver || MO_COLORED==opts.coloredMouseOver) ? itsMouseOverCols : use); - const QColor &fill(getFill(flags, use, false, SHADE_DARKEN==opts.shadeSliders)); + const TQColor &fill(getFill(flags, use, false, SHADE_DARKEN==opts.shadeSliders)); int x(r.x()), y(r.y()), xo(horiz ? 8 : 0), @@ -7503,7 +7508,7 @@ void QtCurveStyle::drawSliderHandle(QPainter *p, const QRect &r, const QColorGro else x++; - QPointArray clipRegion; + TQPointArray clipRegion; p->save(); if(SLIDER_TRIANGULAR==opts.sliderStyle) @@ -7511,12 +7516,12 @@ void QtCurveStyle::drawSliderHandle(QPainter *p, const QRect &r, const QColorGro if(slider) switch(slider->tickmarks()) { - case QSlider::Both: - case QSlider::NoMarks: - case QSlider::Below: + case TQSlider::Both: + case TQSlider::NoMarks: + case TQSlider::Below: direction=horiz ? PE_ArrowDown : PE_ArrowRight; break; - case QSlider::Above: + case TQSlider::Above: direction=horiz ? PE_ArrowUp : PE_ArrowLeft; } @@ -7545,8 +7550,8 @@ void QtCurveStyle::drawSliderHandle(QPainter *p, const QRect &r, const QColorGro x+12+xo, y+4, x+12+xo, y+8+yo, x+8+xo, y+12+yo, x+4, y+12+yo); if(!tb) - p->fillRect(QRect(x, y, r.width()-(horiz ? 0 : 2), r.height()-(horiz ? 2 : 0)), cg.background()); - p->setClipRegion(QRegion(clipRegion)); // , QPainter::CoordPainter); + p->fillRect(TQRect(x, y, r.width()-(horiz ? 0 : 2), r.height()-(horiz ? 2 : 0)), cg.background()); + p->setClipRegion(TQRegion(clipRegion)); // , TQPainter::CoordPainter); if(IS_FLAT(opts.sliderAppearance)) { p->fillRect(r, fill); @@ -7557,19 +7562,19 @@ void QtCurveStyle::drawSliderHandle(QPainter *p, const QRect &r, const QColorGro if(horiz) { - p->fillRect(QRect(x+1, y+1, len, size-2), itsMouseOverCols[col]); - p->fillRect(QRect(x+r.width()-(1+len), y+1, len, r.height()-2), itsMouseOverCols[col]); + p->fillRect(TQRect(x+1, y+1, len, size-2), itsMouseOverCols[col]); + p->fillRect(TQRect(x+r.width()-(1+len), y+1, len, r.height()-2), itsMouseOverCols[col]); } else { - p->fillRect(QRect(x+1, y+1, size-2, len), itsMouseOverCols[col]); - p->fillRect(QRect(x+1, y+r.height()-(1+len), r.width()-2, len), itsMouseOverCols[col]); + p->fillRect(TQRect(x+1, y+1, size-2, len), itsMouseOverCols[col]); + p->fillRect(TQRect(x+1, y+r.height()-(1+len), r.width()-2, len), itsMouseOverCols[col]); } } } else { - drawBevelGradient(fill, p, QRect(x, y, horiz ? r.width()-1 : size, horiz ? size : r.height()-1), + drawBevelGradient(fill, p, TQRect(x, y, horiz ? r.width()-1 : size, horiz ? size : r.height()-1), horiz, false, opts.sliderAppearance); if(MO_PLASTIK==opts.coloredMouseOver && flags&Style_MouseOver && !opts.colorSliderMouseOver) @@ -7579,19 +7584,19 @@ void QtCurveStyle::drawSliderHandle(QPainter *p, const QRect &r, const QColorGro if(horiz) { - drawBevelGradient(itsMouseOverCols[col], p, QRect(x+1, y+1, len, size-2), + drawBevelGradient(itsMouseOverCols[col], p, TQRect(x+1, y+1, len, size-2), horiz, false, opts.sliderAppearance); drawBevelGradient(itsMouseOverCols[col], p, - QRect(x+r.width()-((SLIDER_ROUND_ROTATED==opts.sliderStyle ? 3 : 1)+len), + TQRect(x+r.width()-((SLIDER_ROUND_ROTATED==opts.sliderStyle ? 3 : 1)+len), y+1, len, size-2), horiz, false, opts.sliderAppearance); } else { - drawBevelGradient(itsMouseOverCols[col], p, QRect(x+1, y+1, size-2, len), + drawBevelGradient(itsMouseOverCols[col], p, TQRect(x+1, y+1, size-2, len), horiz, false, opts.sliderAppearance); drawBevelGradient(itsMouseOverCols[col], p, - QRect(x+1, y+r.height()-((SLIDER_ROUND_ROTATED==opts.sliderStyle ? 3 : 1)+len), + TQRect(x+1, y+r.height()-((SLIDER_ROUND_ROTATED==opts.sliderStyle ? 3 : 1)+len), size-2, len), horiz, false, opts.sliderAppearance); } @@ -7602,7 +7607,7 @@ void QtCurveStyle::drawSliderHandle(QPainter *p, const QRect &r, const QColorGro if(SLIDER_TRIANGULAR==opts.sliderStyle) { - QPointArray aa, + TQPointArray aa, light; switch(direction) @@ -7647,7 +7652,7 @@ void QtCurveStyle::drawSliderHandle(QPainter *p, const QRect &r, const QColorGro } else { - QRect sr(r); + TQRect sr(r); if(!ROTATED_SLIDER) if(horiz) @@ -7659,13 +7664,13 @@ void QtCurveStyle::drawSliderHandle(QPainter *p, const QRect &r, const QColorGro } } -void QtCurveStyle::drawSliderGroove(QPainter *p, const QRect &r, const QColorGroup &cg, - SFlags flags, const QWidget *widget) const +void TQtCurveStyle::drawSliderGroove(TQPainter *p, const TQRect &r, const TQColorGroup &cg, + SFlags flags, const TQWidget *widget) const { - const QSlider *sliderWidget((const QSlider *)widget); - QRect groove(r); + const TQSlider *sliderWidget((const TQSlider *)widget); + TQRect groove(r); bool horiz(Qt::Horizontal==sliderWidget->orientation()), - reverse(QApplication::reverseLayout()); + reverse(TQApplication::reverseLayout()); flags&=~Style_MouseOver; if(horiz) @@ -7686,20 +7691,20 @@ void QtCurveStyle::drawSliderGroove(QPainter *p, const QRect &r, const QColorGro groove.addCoords(-1, 0, 1, 0); } - drawLightBevel(p, groove, cg, flags, opts.square&SQUARE_SLIDER ? ROUNDED_NONE : ROUNDED_ALL, + drawLightBevel(p, groove, cg, flags, opts.square&STQUARE_SLIDER ? ROUNDED_NONE : ROUNDED_ALL, itsBackgroundCols[flags&Style_Enabled ? 2 : ORIGINAL_SHADE], itsBackgroundCols, true, true, WIDGET_SLIDER_TROUGH); if(opts.fillSlider && (horiz ? sliderWidget->value()>0 : sliderWidget->value()<sliderWidget->maxValue()) && sliderWidget->maxValue()!=sliderWidget->minValue() && flags&Style_Enabled) { - QRect used(groove); + TQRect used(groove); int pos((int)(((double)(horiz ? groove.width() : groove.height()) / (sliderWidget->maxValue()-sliderWidget->minValue())) * (sliderWidget->value() - sliderWidget->minValue()))); if(pos>0) { - const QColor *usedCols=itsSliderCols ? itsSliderCols : itsHighlightCols; + const TQColor *usedCols=itsSliderCols ? itsSliderCols : itsHighlightCols; if(horiz) { @@ -7715,21 +7720,21 @@ void QtCurveStyle::drawSliderGroove(QPainter *p, const QRect &r, const QColorGro used.addCoords(0, pos, 0, 0); } if(used.height()>0 && used.width()>0) - drawLightBevel(p, used, cg, flags, opts.square&SQUARE_SLIDER ? ROUNDED_NONE : ROUNDED_ALL, + drawLightBevel(p, used, cg, flags, opts.square&STQUARE_SLIDER ? ROUNDED_NONE : ROUNDED_ALL, usedCols[ORIGINAL_SHADE], usedCols, true, true, WIDGET_FILLED_SLIDER_TROUGH); } } } -void QtCurveStyle::drawMenuOrToolBarBackground(QPainter *p, const QRect &r, const QColorGroup &cg, +void TQtCurveStyle::drawMenuOrToolBarBackground(TQPainter *p, const TQRect &r, const TQColorGroup &cg, bool menu, bool horiz) const { if(menu && APPEARANCE_STRIPED==opts.bgndAppearance && IS_FLAT(opts.menubarAppearance) && SHADE_NONE==opts.shadeMenubars) return; - QRect rx(r); + TQRect rx(r); EAppearance app(menu ? opts.menubarAppearance : opts.toolbarAppearance); - QColor color(menu ? menuColors(cg, itsActive)[ORIGINAL_SHADE] : cg.background()); + TQColor color(menu ? menuColors(cg, itsActive)[ORIGINAL_SHADE] : cg.background()); if(menu && BLEND_TITLEBAR) rx.addCoords(0, -qtcGetWindowBorderSize().titleHeight, 0, 0); @@ -7737,7 +7742,7 @@ void QtCurveStyle::drawMenuOrToolBarBackground(QPainter *p, const QRect &r, cons drawBevelGradient(color, p, rx, horiz, false, app); } -void QtCurveStyle::drawHandleMarkers(QPainter *p, const QRect &r, SFlags flags, bool tb, +void TQtCurveStyle::drawHandleMarkers(TQPainter *p, const TQRect &r, SFlags flags, bool tb, ELine handles) const { if(r.width()<2 || r.height()<2) @@ -7747,7 +7752,7 @@ void QtCurveStyle::drawHandleMarkers(QPainter *p, const QRect &r, SFlags flags, // flags|=Style_MouseOver; flags&=~Style_MouseOver; // Dont mouse-over handles - we dont do this for KDE4... - const QColor *border(borderColors(flags, itsBackgroundCols)); + const TQColor *border(borderColors(flags, itsBackgroundCols)); switch(handles) { @@ -7764,14 +7769,14 @@ void QtCurveStyle::drawHandleMarkers(QPainter *p, const QRect &r, SFlags flags, case LINE_DASHES: if(flags&Style_Horizontal) { - QRect r1(r.x()+(tb ? 2 : (r.width()-6)/2), r.y(), 3, r.height()); + TQRect r1(r.x()+(tb ? 2 : (r.width()-6)/2), r.y(), 3, r.height()); drawLines(p, r1, true, (r.height()-8)/2, tb ? 0 : (r.width()-5)/2, border, 0, 5, handles); } else { - QRect r1(r.x(), r.y()+(tb ? 2 : (r.height()-6)/2), r.width(), 3); + TQRect r1(r.x(), r.y()+(tb ? 2 : (r.height()-6)/2), r.width(), 3); drawLines(p, r1, false, (r.width()-8)/2, tb ? 0 : (r.height()-5)/2, border, 0, 5, handles); @@ -7789,10 +7794,10 @@ void QtCurveStyle::drawHandleMarkers(QPainter *p, const QRect &r, SFlags flags, } } -void QtCurveStyle::drawHighlight(QPainter *p, const QRect &r, const QColorGroup &cg, bool horiz, bool inc) const +void TQtCurveStyle::drawHighlight(TQPainter *p, const TQRect &r, const TQColorGroup &cg, bool horiz, bool inc) const { - QColor col1(midColor(cg.background(), itsMouseOverCols[ORIGINAL_SHADE])); - QRect r2(r); + TQColor col1(midColor(cg.background(), itsMouseOverCols[ORIGINAL_SHADE])); + TQRect r2(r); p->setPen(inc ? col1 : itsMouseOverCols[ORIGINAL_SHADE]); p->drawLine(r2.x(), r2.y(), r2.x()+(horiz ? r2.width()-1 : 0), r2.y()+(horiz ? 0 : r2.height()-1)); @@ -7801,7 +7806,7 @@ void QtCurveStyle::drawHighlight(QPainter *p, const QRect &r, const QColorGroup p->drawLine(r2.x(), r2.y(), r2.x()+(horiz ? r2.width()-1 : 0), r2.y()+(horiz ? 0 : r2.height()-1)); } -void QtCurveStyle::shadeColors(const QColor &base, QColor *vals) const +void TQtCurveStyle::shadeColors(const TQColor &base, TQColor *vals) const { SHADES @@ -7817,7 +7822,7 @@ void QtCurveStyle::shadeColors(const QColor &base, QColor *vals) const vals[ORIGINAL_SHADE]=base; } -const QColor * QtCurveStyle::buttonColors(const QColorGroup &cg) const +const TQColor * TQtCurveStyle::buttonColors(const TQColorGroup &cg) const { if(cg.button()!=itsButtonCols[ORIGINAL_SHADE]) { @@ -7828,14 +7833,14 @@ const QColor * QtCurveStyle::buttonColors(const QColorGroup &cg) const return itsButtonCols; } -const QColor * QtCurveStyle::checkRadioColors(const QColorGroup &cg, SFlags flags) const +const TQColor * TQtCurveStyle::checkRadioColors(const TQColorGroup &cg, SFlags flags) const { return opts.crColor && flags&Style_Enabled && (flags&Style_On || !(flags&Style_Off)) ? itsCheckRadioSelCols : buttonColors(cg); } -const QColor * QtCurveStyle::sliderColors(/*const QColorGroup &cg, */ SFlags flags) const +const TQColor * TQtCurveStyle::sliderColors(/*const TQColorGroup &cg, */ SFlags flags) const { return (flags&Style_Enabled) ? SHADE_NONE!=opts.shadeSliders &&itsSliderCols && (!opts.colorSliderMouseOver || flags&Style_MouseOver) @@ -7844,7 +7849,7 @@ const QColor * QtCurveStyle::sliderColors(/*const QColorGroup &cg, */ SFlags fla : itsBackgroundCols; } -const QColor * QtCurveStyle::backgroundColors(const QColor &c) const +const TQColor * TQtCurveStyle::backgroundColors(const TQColor &c) const { if(c!=itsBackgroundCols[ORIGINAL_SHADE]) { @@ -7855,13 +7860,13 @@ const QColor * QtCurveStyle::backgroundColors(const QColor &c) const return itsBackgroundCols; } -const QColor * QtCurveStyle::borderColors(SFlags flags, const QColor *use) const +const TQColor * TQtCurveStyle::borderColors(SFlags flags, const TQColor *use) const { return itsMouseOverCols && opts.coloredMouseOver && flags&Style_MouseOver ? itsMouseOverCols : use; } -const QColor * QtCurveStyle::getSidebarButtons() const +const TQColor * TQtCurveStyle::getSidebarButtons() const { if(!itsSidebarButtonsCols) { @@ -7871,7 +7876,7 @@ const QColor * QtCurveStyle::getSidebarButtons() const itsSidebarButtonsCols=itsDefBtnCols; else { - itsSidebarButtonsCols=new QColor [TOTAL_SHADES+1]; + itsSidebarButtonsCols=new TQColor [TOTAL_SHADES+1]; shadeColors(midColor(itsHighlightCols[ORIGINAL_SHADE], itsButtonCols[ORIGINAL_SHADE]), itsSidebarButtonsCols); } @@ -7880,12 +7885,12 @@ const QColor * QtCurveStyle::getSidebarButtons() const return itsSidebarButtonsCols; } -void QtCurveStyle::setMenuColors(const QColorGroup &cg) +void TQtCurveStyle::setMenuColors(const TQColorGroup &cg) { switch(opts.shadeMenubars) { case SHADE_NONE: - memcpy(itsMenubarCols, itsBackgroundCols, sizeof(QColor)*(TOTAL_SHADES+1)); + memcpy(itsMenubarCols, itsBackgroundCols, sizeof(TQColor)*(TOTAL_SHADES+1)); break; case SHADE_BLEND_SELECTED: shadeColors(midColor(itsHighlightCols[ORIGINAL_SHADE], itsBackgroundCols[ORIGINAL_SHADE]), itsMenubarCols); @@ -7907,7 +7912,7 @@ void QtCurveStyle::setMenuColors(const QColorGroup &cg) } } -const QColor * QtCurveStyle::menuColors(const QColorGroup &cg, bool active) const +const TQColor * TQtCurveStyle::menuColors(const TQColorGroup &cg, bool active) const { return SHADE_WINDOW_BORDER==opts.shadeMenubars ? getMdiColors(cg, active) @@ -7916,7 +7921,7 @@ const QColor * QtCurveStyle::menuColors(const QColorGroup &cg, bool active) cons : itsMenubarCols; } -void QtCurveStyle::setDecorationColors(bool init) +void TQtCurveStyle::setDecorationColors(bool init) { if(!readKdeGlobals() && !init) return; @@ -7924,13 +7929,13 @@ void QtCurveStyle::setDecorationColors(bool init) if(opts.coloredMouseOver) { if(!itsMouseOverCols) - itsMouseOverCols=new QColor [TOTAL_SHADES+1]; + itsMouseOverCols=new TQColor [TOTAL_SHADES+1]; shadeColors(kdeSettings.hover, itsMouseOverCols); } shadeColors(kdeSettings.focus, itsFocusCols); } -const QColor * QtCurveStyle::getMdiColors(const QColorGroup &cg, bool active) const +const TQColor * TQtCurveStyle::getMdiColors(const TQColorGroup &cg, bool active) const { if(!itsActiveMdiColors) { @@ -7938,52 +7943,52 @@ const QColor * QtCurveStyle::getMdiColors(const QColorGroup &cg, bool active) co itsMdiTextColor=cg.text(); // Try to read kwin's settings... - if(useQt3Settings()) + if(useTQt3Settings()) { - QFile f(QDir::homeDirPath()+"/.qt/qtrc"); + TQFile f(TQDir::homeDirPath()+"/.qt/qtrc"); if(f.open(IO_ReadOnly)) { - QTextStream in(&f); + TQTextStream in(&f); bool inPal(false); while (!in.atEnd()) { - QString line(in.readLine()); + TQString line(in.readLine()); if(inPal) { - if(!itsActiveMdiColors && 0==line.find("activeBackground=#", false)) + if(!itsActiveMdiColors && 0==line.tqfind("activeBackground=#", false)) { - QColor col; + TQColor col; setRgb(&col, line.mid(17).latin1()); if(col!=itsBackgroundCols[ORIGINAL_SHADE]) { - itsActiveMdiColors=new QColor [TOTAL_SHADES+1]; + itsActiveMdiColors=new TQColor [TOTAL_SHADES+1]; shadeColors(col, itsActiveMdiColors); } } - else if(!itsMdiColors && 0==line.find("inactiveBackground=#", false)) + else if(!itsMdiColors && 0==line.tqfind("inactiveBackground=#", false)) { - QColor col; + TQColor col; setRgb(&col, line.mid(19).latin1()); if(col!=itsBackgroundCols[ORIGINAL_SHADE]) { - itsMdiColors=new QColor [TOTAL_SHADES+1]; + itsMdiColors=new TQColor [TOTAL_SHADES+1]; shadeColors(col, itsMdiColors); } } - else if(0==line.find("activeForeground=#", false)) + else if(0==line.tqfind("activeForeground=#", false)) setRgb(&itsActiveMdiTextColor, line.mid(17).latin1()); - else if(0==line.find("inactiveForeground=#", false)) + else if(0==line.tqfind("inactiveForeground=#", false)) setRgb(&itsMdiTextColor, line.mid(19).latin1()); - else if (-1!=line.find('[')) + else if (-1!=line.tqfind('[')) break; } - else if(0==line.find("[KWinPalette]", false)) + else if(0==line.tqfind("[KWinPalette]", false)) inPal=true; } f.close(); @@ -7991,50 +7996,50 @@ const QColor * QtCurveStyle::getMdiColors(const QColorGroup &cg, bool active) co } else // KDE4 { - QFile f(kdeHome(false)+"/share/config/kdeglobals"); + TQFile f(kdeHome(false)+"/share/config/kdeglobals"); if(f.open(IO_ReadOnly)) { - QTextStream in(&f); + TQTextStream in(&f); bool inPal(false); while (!in.atEnd()) { - QString line(in.readLine()); + TQString line(in.readLine()); if(inPal) { - if(!itsActiveMdiColors && 0==line.find("activeBackground=", false)) + if(!itsActiveMdiColors && 0==line.tqfind("activeBackground=", false)) { - QColor col; + TQColor col; - setRgb(&col, QStringList::split(",", line.mid(17))); + setRgb(&col, TQStringList::split(",", line.mid(17))); if(col!=itsBackgroundCols[ORIGINAL_SHADE]) { - itsActiveMdiColors=new QColor [TOTAL_SHADES+1]; + itsActiveMdiColors=new TQColor [TOTAL_SHADES+1]; shadeColors(col, itsActiveMdiColors); } } - else if(!itsMdiColors && 0==line.find("inactiveBackground=", false)) + else if(!itsMdiColors && 0==line.tqfind("inactiveBackground=", false)) { - QColor col; + TQColor col; - setRgb(&col, QStringList::split(",", line.mid(19))); + setRgb(&col, TQStringList::split(",", line.mid(19))); if(col!=itsBackgroundCols[ORIGINAL_SHADE]) { - itsMdiColors=new QColor [TOTAL_SHADES+1]; + itsMdiColors=new TQColor [TOTAL_SHADES+1]; shadeColors(col, itsMdiColors); } } - else if(0==line.find("activeForeground=", false)) - setRgb(&itsActiveMdiTextColor, QStringList::split(",", line.mid(17))); - else if(0==line.find("inactiveForeground=", false)) - setRgb(&itsMdiTextColor, QStringList::split(",", line.mid(19))); - else if (-1!=line.find('[')) + else if(0==line.tqfind("activeForeground=", false)) + setRgb(&itsActiveMdiTextColor, TQStringList::split(",", line.mid(17))); + else if(0==line.tqfind("inactiveForeground=", false)) + setRgb(&itsMdiTextColor, TQStringList::split(",", line.mid(19))); + else if (-1!=line.tqfind('[')) break; } - else if(0==line.find("[WM]", false)) + else if(0==line.tqfind("[WM]", false)) inPal=true; } f.close(); @@ -8046,16 +8051,16 @@ const QColor * QtCurveStyle::getMdiColors(const QColorGroup &cg, bool active) co opts.shadeMenubarOnlyWhenActive=false; if(!itsActiveMdiColors) - itsActiveMdiColors=(QColor *)itsBackgroundCols; + itsActiveMdiColors=(TQColor *)itsBackgroundCols; if(!itsMdiColors) - itsMdiColors=(QColor *)itsBackgroundCols; + itsMdiColors=(TQColor *)itsBackgroundCols; } return active ? itsActiveMdiColors : itsMdiColors; } #ifdef SET_MDI_WINDOW_BUTTON_POSITIONS -void QtCurveStyle::readMdiPositions() const +void TQtCurveStyle::readMdiPositions() const { if(0==itsMdiButtons[0].size() && 0==itsMdiButtons[1].size()) { @@ -8070,33 +8075,33 @@ void QtCurveStyle::readMdiPositions() const itsMdiButtons[1].append(SC_TitleBarCloseButton); // Read in KWin settings... - QFile f(kdeHome(useQt3Settings())+"/share/config/kwinrc"); + TQFile f(kdeHome(useTQt3Settings())+"/share/config/kwinrc"); if(f.open(IO_ReadOnly)) { - QTextStream in(&f); + TQTextStream in(&f); bool inStyle(false); while (!in.atEnd()) { - QString line(in.readLine()); + TQString line(in.readLine()); if(inStyle) { - if(0==line.find("ButtonsOnLeft=", false)) + if(0==line.tqfind("ButtonsOnLeft=", false)) { itsMdiButtons[0].clear(); parseWindowLine(line.mid(14), itsMdiButtons[0]); } - else if(0==line.find("ButtonsOnRight=", false)) + else if(0==line.tqfind("ButtonsOnRight=", false)) { itsMdiButtons[1].clear(); parseWindowLine(line.mid(15), itsMdiButtons[1]); } - else if (-1!=line.find('[')) + else if (-1!=line.tqfind('[')) break; } - else if(0==line.find("[Style]", false)) + else if(0==line.tqfind("[Style]", false)) inStyle=true; } f.close(); @@ -8113,14 +8118,14 @@ void QtCurveStyle::readMdiPositions() const int minPos=itsMdiButtons[1].findIndex(SC_TitleBarMinButton); maxPos=itsMdiButtons[1].findIndex(SC_TitleBarMaxButton); - itsMdiButtons[1].insert(itsMdiButtons[1].find(minPos<maxPos ? (minPos==-1 ? 0 : minPos) + itsMdiButtons[1].insert(itsMdiButtons[1].tqfind(minPos<maxPos ? (minPos==-1 ? 0 : minPos) : (maxPos==-1 ? 0 : maxPos)), SC_TitleBarShadeButton); } else // Add to left button { int minPos=itsMdiButtons[0].findIndex(SC_TitleBarMinButton); - itsMdiButtons[1].insert(itsMdiButtons[1].find(minPos>maxPos ? (minPos==-1 ? 0 : minPos) + itsMdiButtons[1].insert(itsMdiButtons[1].tqfind(minPos>maxPos ? (minPos==-1 ? 0 : minPos) : (maxPos==-1 ? 0 : maxPos)), SC_TitleBarShadeButton); } } @@ -8128,51 +8133,51 @@ void QtCurveStyle::readMdiPositions() const } #endif -bool QtCurveStyle::redrawHoverWidget(const QPoint &pos) +bool TQtCurveStyle::redrawHoverWidget(const TQPoint &pos) { if(!itsHoverWidget || !itsHoverWidget->isShown() || !itsHoverWidget->isVisible()) return false; -#if QT_VERSION >= 0x030200 +#if 0x039999 >= 0x030200 // - // Qt>=3.2 sets the sensitive part of a check/radio to the image + label -> anything else + // TQt>=3.2 sets the sensitive part of a check/radio to the image + label -> anything else // is not sensitive. But, the widget can ocupy a larger area - and this whole area will // react to mouse over. This needs to be counteracted so that it looks as if only the // sensitive area mouse-overs... - QRadioButton *rb(::qt_cast<QRadioButton *>(itsHoverWidget)); + TQRadioButton *rb(::tqqt_cast<TQRadioButton *>(itsHoverWidget)); if(rb) { - QRect rect(0, 0, - visualRect(subRect(SR_RadioButtonFocusRect, rb), rb).width()+ - pixelMetric(PM_ExclusiveIndicatorWidth)+4, itsHoverWidget->height()); + TQRect rect(0, 0, + tqvisualRect(subRect(SR_RadioButtonFocusRect, rb), rb).width()+ + tqpixelMetric(PM_ExclusiveIndicatorWidth)+4, itsHoverWidget->height()); - itsHover=rect.contains(pos) ? HOVER_RADIO : HOVER_NONE; - return (HOVER_NONE!=itsHover && !rect.contains(itsOldPos)) || - (HOVER_NONE==itsHover && rect.contains(itsOldPos)); + itsHover=rect.tqcontains(pos) ? HOVER_RADIO : HOVER_NONE; + return (HOVER_NONE!=itsHover && !rect.tqcontains(itsOldPos)) || + (HOVER_NONE==itsHover && rect.tqcontains(itsOldPos)); } else { - QCheckBox *cb(::qt_cast<QCheckBox *>(itsHoverWidget)); + TQCheckBox *cb(::tqqt_cast<TQCheckBox *>(itsHoverWidget)); if(cb) { - QRect rect(0, 0, - visualRect(subRect(SR_CheckBoxFocusRect, cb), cb).width()+ - pixelMetric(PM_IndicatorWidth)+4, itsHoverWidget->height()); + TQRect rect(0, 0, + tqvisualRect(subRect(SR_CheckBoxFocusRect, cb), cb).width()+ + tqpixelMetric(PM_IndicatorWidth)+4, itsHoverWidget->height()); - itsHover=rect.contains(pos) ? HOVER_CHECK : HOVER_NONE; - return (HOVER_NONE!=itsHover && !rect.contains(itsOldPos)) || (HOVER_NONE==itsHover && rect.contains(itsOldPos)); + itsHover=rect.tqcontains(pos) ? HOVER_CHECK : HOVER_NONE; + return (HOVER_NONE!=itsHover && !rect.tqcontains(itsOldPos)) || (HOVER_NONE==itsHover && rect.tqcontains(itsOldPos)); } else { #endif - QScrollBar *sb(::qt_cast<QScrollBar *>(itsHoverWidget)); + TQScrollBar *sb(::tqqt_cast<TQScrollBar *>(itsHoverWidget)); if(sb) // So, are we over add button, sub button, slider, or none? { bool useThreeButtonScrollBar(SCROLLBAR_KDE==opts.scrollbarType); - QRect subline(querySubControlMetrics(CC_ScrollBar, itsHoverWidget, + TQRect subline(querySubControlMetrics(CC_ScrollBar, itsHoverWidget, SC_ScrollBarSubLine)), addline(querySubControlMetrics(CC_ScrollBar, itsHoverWidget, SC_ScrollBarAddLine)), @@ -8186,33 +8191,33 @@ bool QtCurveStyle::redrawHoverWidget(const QPoint &pos) else subline2.moveBy(0, -addline.height()); - if(slider.contains(pos)) + if(slider.tqcontains(pos)) itsHover=HOVER_SB_SLIDER; - else if(subline.contains(pos)) + else if(subline.tqcontains(pos)) itsHover=HOVER_SB_SUB; - else if(addline.contains(pos)) + else if(addline.tqcontains(pos)) itsHover=HOVER_SB_ADD; - else if(subline2.contains(pos)) + else if(subline2.tqcontains(pos)) itsHover=HOVER_SB_SUB2; else itsHover=HOVER_NONE; - return (HOVER_SB_SLIDER==itsHover && !slider.contains(itsOldPos)) || - (HOVER_SB_SLIDER!=itsHover && slider.contains(itsOldPos)) || - (HOVER_SB_SUB==itsHover && !subline.contains(itsOldPos)) || - (HOVER_SB_SUB!=itsHover && subline.contains(itsOldPos)) || + return (HOVER_SB_SLIDER==itsHover && !slider.tqcontains(itsOldPos)) || + (HOVER_SB_SLIDER!=itsHover && slider.tqcontains(itsOldPos)) || + (HOVER_SB_SUB==itsHover && !subline.tqcontains(itsOldPos)) || + (HOVER_SB_SUB!=itsHover && subline.tqcontains(itsOldPos)) || (useThreeButtonScrollBar && - (HOVER_SB_SUB2==itsHover && !subline2.contains(itsOldPos)) || - (HOVER_SB_SUB2!=itsHover && subline2.contains(itsOldPos))) || + (HOVER_SB_SUB2==itsHover && !subline2.tqcontains(itsOldPos)) || + (HOVER_SB_SUB2!=itsHover && subline2.tqcontains(itsOldPos))) || - (HOVER_SB_ADD==itsHover && !addline.contains(itsOldPos)) || - (HOVER_SB_ADD!=itsHover && addline.contains(itsOldPos)); + (HOVER_SB_ADD==itsHover && !addline.tqcontains(itsOldPos)) || + (HOVER_SB_ADD!=itsHover && addline.tqcontains(itsOldPos)); } else { #if defined KDE_VERSION && KDE_VERSION >= 0x30400 && KDE_VERSION < 0x30500 - QToolButton *tb(::qt_cast<QToolButton *>(itsHoverWidget)); + TQToolButton *tb(::tqqt_cast<TQToolButton *>(itsHoverWidget)); if(tb) { @@ -8222,7 +8227,7 @@ bool QtCurveStyle::redrawHoverWidget(const QPoint &pos) else #endif { - QHeader *hd(::qt_cast<QHeader *>(itsHoverWidget)); + TQHeader *hd(::tqqt_cast<TQHeader *>(itsHoverWidget)); if(hd) { @@ -8230,24 +8235,24 @@ bool QtCurveStyle::redrawHoverWidget(const QPoint &pos) // sections... // and the ones that aren't clickable should not highlight on mouse over! - QRect rect(0, 0, itsHoverWidget->width(), itsHoverWidget->height()); + TQRect rect(0, 0, itsHoverWidget->width(), itsHoverWidget->height()); int s(0); bool redraw(false); - itsHover=rect.contains(pos) ? HOVER_HEADER : HOVER_NONE; + itsHover=rect.tqcontains(pos) ? HOVER_HEADER : HOVER_NONE; itsHoverSect=NO_SECT; for(s=0; s<hd->count() && (NO_SECT==itsHoverSect || !redraw); ++s) { - QRect r(hd->sectionRect(s)); - bool hasNew(r.contains(pos)); + TQRect r(hd->sectionRect(s)); + bool hasNew(r.tqcontains(pos)); if(hasNew) itsHoverSect=s; if(!redraw) { - bool hasOld(r.contains(itsOldPos)); + bool hasOld(r.tqcontains(itsOldPos)); if((hasNew && !hasOld) || (!hasNew && hasOld)) redraw=true; @@ -8257,36 +8262,36 @@ bool QtCurveStyle::redrawHoverWidget(const QPoint &pos) } else { - QSpinWidget *sw(::qt_cast<QSpinWidget *>(itsHoverWidget)); + TQSpinWidget *sw(::tqqt_cast<TQSpinWidget *>(itsHoverWidget)); if(sw) // So, are we over up or down? { - QRect up(querySubControlMetrics(CC_SpinWidget, itsHoverWidget, + TQRect up(querySubControlMetrics(CC_SpinWidget, itsHoverWidget, SC_SpinWidgetUp)), down(querySubControlMetrics(CC_SpinWidget, itsHoverWidget, SC_SpinWidgetDown)); - if(up.contains(pos)) + if(up.tqcontains(pos)) itsHover=HOVER_SW_UP; - else if(down.contains(pos)) + else if(down.tqcontains(pos)) itsHover=HOVER_SW_DOWN; else itsHover=HOVER_SW_ENTRY; - return (HOVER_SW_UP==itsHover && !up.contains(itsOldPos)) || - (HOVER_SW_UP!=itsHover && up.contains(itsOldPos)) || - (HOVER_SW_DOWN==itsHover && !down.contains(itsOldPos)) || - (HOVER_SW_DOWN!=itsHover && down.contains(itsOldPos)) || + return (HOVER_SW_UP==itsHover && !up.tqcontains(itsOldPos)) || + (HOVER_SW_UP!=itsHover && up.tqcontains(itsOldPos)) || + (HOVER_SW_DOWN==itsHover && !down.tqcontains(itsOldPos)) || + (HOVER_SW_DOWN!=itsHover && down.tqcontains(itsOldPos)) || (HOVER_SW_ENTRY==itsHover); } else { - QTabBar *tabbar(::qt_cast<QTabBar *>(itsHoverWidget)); + TQTabBar *tabbar(::tqqt_cast<TQTabBar *>(itsHoverWidget)); if(tabbar) { bool redraw(false); - QTab *tab(tabbar->selectTab(pos)); + TQTab *tab(tabbar->selectTab(pos)); int tabIndex(tab ? tabbar->indexOf(tab->identifier()) : -1), selectedTab(tabbar->currentTab()); @@ -8297,11 +8302,11 @@ bool QtCurveStyle::redrawHoverWidget(const QPoint &pos) } else { - QComboBox *cb(::qt_cast<QComboBox *>(itsHoverWidget)); + TQComboBox *cb(::tqqt_cast<TQComboBox *>(itsHoverWidget)); if(cb) { - QRect arrow(cb->rect()); + TQRect arrow(cb->rect()); if(!cb->editable()) itsHover=HOVER_CB_ARROW; @@ -8310,37 +8315,37 @@ bool QtCurveStyle::redrawHoverWidget(const QPoint &pos) arrow=(querySubControlMetrics(CC_ComboBox, itsHoverWidget, SC_ComboBoxArrow)); - if(arrow.contains(pos)) + if(arrow.tqcontains(pos)) itsHover=HOVER_CB_ARROW; else { - QRect r(cb->rect()); - if(QApplication::reverseLayout()) + TQRect r(cb->rect()); + if(TQApplication::reverseLayout()) r.addCoords(6, 0, 0, 0); else r.addCoords(0, 0, -6, 0); if(DO_EFFECT && opts.etchEntry) r.addCoords(1, 0, -1, 0); - if(r.contains(pos)) + if(r.tqcontains(pos)) itsHover=HOVER_CB_ENTRY; else itsHover=HOVER_NONE; } } - return (HOVER_CB_ARROW==itsHover && !arrow.contains(itsOldPos)) || - (HOVER_CB_ARROW!=itsHover && arrow.contains(itsOldPos)) || + return (HOVER_CB_ARROW==itsHover && !arrow.tqcontains(itsOldPos)) || + (HOVER_CB_ARROW!=itsHover && arrow.tqcontains(itsOldPos)) || (HOVER_CB_ENTRY==itsHover); } else - return itsOldPos==QPoint(-1, -1); + return itsOldPos==TQPoint(-1, -1); } } } } } -#if QT_VERSION >= 0x030200 +#if 0x039999 >= 0x030200 } } #endif @@ -8348,7 +8353,7 @@ bool QtCurveStyle::redrawHoverWidget(const QPoint &pos) return false; } -const QColor & QtCurveStyle::getFill(SFlags flags, const QColor *use, bool cr, bool darker) const +const TQColor & TQtCurveStyle::getFill(SFlags flags, const TQColor *use, bool cr, bool darker) const { return !(flags&Style_Enabled) ? use[darker ? 2 : ORIGINAL_SHADE] @@ -8363,7 +8368,7 @@ const QColor & QtCurveStyle::getFill(SFlags flags, const QColor *use, bool cr, b : use[darker ? 2 : ORIGINAL_SHADE]; } -const QColor & QtCurveStyle::getTabFill(bool current, bool highlight, const QColor *use) const +const TQColor & TQtCurveStyle::getTabFill(bool current, bool highlight, const TQColor *use) const { return current ? use[ORIGINAL_SHADE] @@ -8372,7 +8377,7 @@ const QColor & QtCurveStyle::getTabFill(bool current, bool highlight, const QCol : use[2]; } -const QColor & QtCurveStyle::menuStripeCol() const +const TQColor & TQtCurveStyle::menuStripeCol() const { switch(opts.menuStripe) { @@ -8398,7 +8403,7 @@ const QColor & QtCurveStyle::menuStripeCol() const } } -const QColor & QtCurveStyle::checkRadioCol(SFlags flags, const QColorGroup &cg) const +const TQColor & TQtCurveStyle::checkRadioCol(SFlags flags, const TQColorGroup &cg) const { if(flags&MENU_ITEM) return flags&Style_Enabled && flags&Style_Active && opts.useHighlightForMenu @@ -8412,60 +8417,60 @@ const QColor & QtCurveStyle::checkRadioCol(SFlags flags, const QColorGroup &cg) : cg.text(); } -QColor QtCurveStyle::shade(const QColor &a, float k) const +TQColor TQtCurveStyle::shade(const TQColor &a, float k) const { - QColor mod; + TQColor mod; ::shade(&opts, a, &mod, k); return mod; } -void QtCurveStyle::shade(const color &ca, color *cb, double k) const +void TQtCurveStyle::shade(const color &ca, color *cb, double k) const { ::shade(&opts, ca, cb, k); } -QPixmap * QtCurveStyle::getPixelPixmap(const QColor col) const +TQPixmap * TQtCurveStyle::getPixelPixmap(const TQColor col) const { - QRgb rgb(col.rgb()); - QString key(createKey(rgb)); + TQRgb rgb(col.rgb()); + TQString key(createKey(rgb)); - QPixmap *pix=itsPixmapCache.find(key); + TQPixmap *pix=itsPixmapCache.tqfind(key); if(!pix) { static const int constAlpha=110; - QImage img(1, 1, 32); + TQImage img(1, 1, 32); img.setAlphaBuffer(true); - img.setPixel(0, 0, qRgba(qRed(rgb), qGreen(rgb), qBlue(rgb), constAlpha)); - pix=new QPixmap(img); + img.setPixel(0, 0, tqRgba(tqRed(rgb), tqGreen(rgb), tqBlue(rgb), constAlpha)); + pix=new TQPixmap(img); itsPixmapCache.insert(key, pix, pix->depth()/8); } return pix; } -QPixmap * QtCurveStyle::createStripePixmap(const QColor &col, bool forWindow) const +TQPixmap * TQtCurveStyle::createStripePixmap(const TQColor &col, bool forWindow) const { - QRgb rgb(col.rgb()); - QString key(createKey(rgb, forWindow ? 'S' : 's')); + TQRgb rgb(col.rgb()); + TQString key(createKey(rgb, forWindow ? 'S' : 's')); - QPixmap *pix=itsPixmapCache.find(key); + TQPixmap *pix=itsPixmapCache.tqfind(key); if(!pix) { - QColor col2(shade(col, BGND_STRIPE_SHADE)); + TQColor col2(shade(col, BGND_STRIPE_SHADE)); int i, adjust=forWindow ? qtcGetWindowBorderSize().titleHeight%4 : 0; - pix=new QPixmap(64, 64); + pix=new TQPixmap(64, 64); pix->fill(col.rgb()); - QPainter p; + TQPainter p; p.begin(pix); - p.setPen(QColor((3*col.red()+col2.red())/4, + p.setPen(TQColor((3*col.red()+col2.red())/4, (3*col.green()+col2.green())/4, (3*col.blue()+col2.blue())/4)); @@ -8483,19 +8488,19 @@ QPixmap * QtCurveStyle::createStripePixmap(const QColor &col, bool forWindow) co return pix; } -static QImage rotateImage(const QImage &img, double angle=90.0) +static TQImage rotateImage(const TQImage &img, double angle=90.0) { - QWMatrix matrix; + TQWMatrix matrix; matrix.translate(img.width()/2, img.height()/2); matrix.rotate(angle); - QRect newRect(matrix.mapRect(QRect(0, 0, img.width(), img.height()))); + TQRect newRect(matrix.mapRect(TQRect(0, 0, img.width(), img.height()))); - return img.xForm(QWMatrix(matrix.m11(), matrix.m12(), matrix.m21(), matrix.m22(), + return img.xForm(TQWMatrix(matrix.m11(), matrix.m12(), matrix.m21(), matrix.m22(), matrix.dx() - newRect.left(), matrix.dy() - newRect.top())); } -static void recolour(QImage &img, const QColor &col, double shade) +static void recolour(TQImage &img, const TQColor &col, double shade) { if (img.depth()<32) img=img.convertDepth(32); @@ -8503,23 +8508,23 @@ static void recolour(QImage &img, const QColor &col, double shade) adjustPix(img.bits(), 4, img.width(), img.height(), img.bytesPerLine(), col.red(), col.green(), col.blue(), shade); } -void QtCurveStyle::drawDot(QPainter *p, const QRect &r, const QColor *cols) const +void TQtCurveStyle::drawDot(TQPainter *p, const TQRect &r, const TQColor *cols) const { - QPixmap *pix=getPixmap(cols[STD_BORDER], PIX_DOT, 0.9); + TQPixmap *pix=getPixmap(cols[STD_BORDER], PIX_DOT, 0.9); p->drawPixmap(r.x()+((r.width()-pix->width())>>1), r.y()+((r.height()-pix->height())>>1), *pix); } -QPixmap * QtCurveStyle::getPixmap(const QColor col, EPixmap p, double shade) const +TQPixmap * TQtCurveStyle::getPixmap(const TQColor col, EPixmap p, double shade) const { - QRgb rgb(col.rgb()); - QString key(createKey(rgb, p)); - QPixmap *pix=itsPixmapCache.find(key); + TQRgb rgb(col.rgb()); + TQString key(createKey(rgb, p)); + TQPixmap *pix=itsPixmapCache.tqfind(key); if(!pix) { - pix=new QPixmap(); + pix=new TQPixmap(); - QImage img; + TQImage img; switch(p) { @@ -8570,7 +8575,7 @@ QPixmap * QtCurveStyle::getPixmap(const QColor col, EPixmap p, double shade) con return pix; } -void QtCurveStyle::setSbType() +void TQtCurveStyle::setSbType() { switch(opts.scrollbarType) { @@ -8590,7 +8595,7 @@ void QtCurveStyle::setSbType() } } -void QtCurveStyle::resetHover() +void TQtCurveStyle::resetHover() { itsIsSpecialHover=false; itsOldPos.setX(-1); @@ -8601,41 +8606,41 @@ void QtCurveStyle::resetHover() itsHoverTab=0L; } -struct QtcMenuBar : public QMenuBar +struct TQtcMenuBar : public TQMenuBar { - bool itemUnderPos(const QPoint &pos) + bool itemUnderPos(const TQPoint &pos) { return -1!=itemAtPos(pos); } }; -bool QtCurveStyle::isWindowDragWidget(QObject *o, const QPoint &pos) +bool TQtCurveStyle::isWindowDragWidget(TQObject *o, const TQPoint &pos) { return opts.windowDrag && - (//qobject_cast<QDialog*>(o) || - (::qt_cast<QMenuBar*>(o) && (pos.isNull() || !((QtcMenuBar *)o)->itemUnderPos(pos))) - //|| qobject_cast<QGroupBox*>(o) - //|| (o->inherits("QToolButton") && !static_cast<QWidget*>(o)->isEnabled()) -// || qobject_cast<QToolBar*>(o) - //|| qobject_cast<QDockWidget*>(o) + (//qobject_cast<TQDialog*>(o) || + (::tqqt_cast<TQMenuBar*>(o) && (pos.isNull() || !((TQtcMenuBar *)o)->itemUnderPos(pos))) + //|| qobject_cast<TQGroupBox*>(o) + //|| (o->inherits(TQTOOLBUTTON_OBJECT_NAME_STRING) && !TQT_TQWIDGET(o)->isEnabled()) +// || qobject_cast<TQToolBar*>(o) + //|| qobject_cast<TQDockWidget*>(o) // || ((*appType == Hacks::SMPlayer) && o->inherits(SMPlayerVideoWidget)) // || ((*appType == Hacks::Dragon) && o->inherits(DragonVideoWidget)) -// || o->inherits("QStatusBar") -// || (o->inherits("QLabel") && o->parent() && o->parent()->inherits("QStatusBar")) +// || o->inherits("TQStatusBar") +// || (o->inherits(TQLABEL_OBJECT_NAME_STRING) && o->tqparent() && o->tqparent()->inherits("TQStatusBar")) ); } -void QtCurveStyle::updateProgressPos() +void TQtCurveStyle::updateProgressPos() { // Taken from lipstik! - QMap<QWidget*, int>::iterator it(itsProgAnimWidgets.begin()), + TQMap<TQWidget*, int>::iterator it(itsProgAnimWidgets.begin()), end(itsProgAnimWidgets.end()); bool visible(false); for (; it!=end; ++it) { - QProgressBar *pb(::qt_cast<QProgressBar*>(it.key())); + TQProgressBar *pb(::tqqt_cast<TQProgressBar*>(it.key())); if (!pb) continue; @@ -8643,7 +8648,7 @@ void QtCurveStyle::updateProgressPos() if(pb->isEnabled() && pb->progress()!=pb->totalSteps()) { // update animation Offset of the current Widget - it.data() = (it.data() + (QApplication::reverseLayout() ? -1 : 1)) + it.data() = (it.data() + (TQApplication::reverseLayout() ? -1 : 1)) % (PROGRESS_CHUNK_WIDTH*2); pb->update(); } @@ -8654,27 +8659,27 @@ void QtCurveStyle::updateProgressPos() itsAnimationTimer->stop(); } -void QtCurveStyle::progressBarDestroyed(QObject *bar) +void TQtCurveStyle::progressBarDestroyed(TQObject *bar) { - itsProgAnimWidgets.remove(static_cast<QWidget*>(bar)); + itsProgAnimWidgets.remove(TQT_TQWIDGET(bar)); } -void QtCurveStyle::sliderThumbMoved(int) +void TQtCurveStyle::sliderThumbMoved(int) { - QSlider *slider(::qt_cast<QSlider*>(sender())); + TQSlider *slider(::tqqt_cast<TQSlider*>(sender())); if(slider) slider->update(); } -void QtCurveStyle::khtmlWidgetDestroyed(QObject *o) +void TQtCurveStyle::khtmlWidgetDestroyed(TQObject *o) { - itsKhtmlWidgets.remove(static_cast<const QWidget *>(o)); + itsKhtmlWidgets.remove(TQT_TQWIDGET_CONST(o)); } -void QtCurveStyle::hoverWidgetDestroyed(QObject *o) +void TQtCurveStyle::hoverWidgetDestroyed(TQObject *o) { - if(o==itsHoverWidget) + if(TQT_BASE_OBJECT(o)==TQT_BASE_OBJECT(itsHoverWidget)) resetHover(); } |