summaryrefslogtreecommitdiffstats
path: root/style/qtcurve.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-06 22:09:18 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-06 22:09:18 +0000
commitd1fb90134ab8504932ee36de6157f846b50f7415 (patch)
tree191f2f1f1ed00a754687d1258d47f78e99723182 /style/qtcurve.h
parentb23b8edce7cbd48165084dbd852875afeb800735 (diff)
downloadtde-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.h')
-rw-r--r--style/qtcurve.h255
1 files changed, 128 insertions, 127 deletions
diff --git a/style/qtcurve.h b/style/qtcurve.h
index cccfb8f..930a67a 100644
--- a/style/qtcurve.h
+++ b/style/qtcurve.h
@@ -1,8 +1,8 @@
-#ifndef __QTCURVE_H__
-#define __QTCURVE_H__
+#ifndef __TQTCURVE_H__
+#define __TQTCURVE_H__
/*
- QtCurve (C) Craig Drummond, 2003 - 2010 [email protected]
+ TQtCurve (C) Craig Drummond, 2003 - 2010 [email protected]
----
@@ -51,32 +51,33 @@
*/
#include "config.h"
-#ifdef QTC_QT_ONLY
-#include "qtc_kstyle.h"
+#ifdef TQTC_TQT_ONLY
+#include "tqtc_kstyle.h"
#else
#include <kdeversion.h>
#include <kstyle.h>
#endif
-#include <qcolor.h>
-#include <qpoint.h>
-#include <qpalette.h>
-#include <qpixmap.h>
-#include <qcache.h>
-#include <qvaluelist.h>
+#include <tqcolor.h>
+#include <tqpoint.h>
+#include <tqpalette.h>
+#include <tqpixmap.h>
+#include <tqcache.h>
+#include <tqvaluelist.h>
#include "common.h"
-class QTimer;
-class QSlider;
+class TQTimer;
+class TQSlider;
-#ifdef QTC_QT_ONLY
-#define BASE_STYLE QtCKStyle
+#ifdef TQTC_TQT_ONLY
+#define BASE_STYLE TQtCKStyle
#else
#define BASE_STYLE KStyle
#endif
-class QtCurveStyle : public BASE_STYLE
+class TQtCurveStyle : public BASE_STYLE
{
Q_OBJECT
+ TQ_OBJECT
public:
@@ -87,7 +88,7 @@ class QtCurveStyle : public BASE_STYLE
APP_OPENOFFICE,
APP_MACTOR,
APP_KPRESENTER,
- APP_KONQUEROR,
+ APP_KONTQUEROR,
APP_SKIP_TASKBAR,
APP_KPRINTER,
APP_KDIALOG,
@@ -125,136 +126,136 @@ class QtCurveStyle : public BASE_STYLE
ENTRY_NONE
};
-#ifdef QTC_STYLE_SUPPORT
- QtCurveStyle(const QString &name=QString());
+#ifdef TQTC_STYLE_SUPPORT
+ TQtCurveStyle(const TQString &name=TQString());
#else
- QtCurveStyle();
+ TQtCurveStyle();
#endif
- virtual ~QtCurveStyle();
+ virtual ~TQtCurveStyle();
- void polish(QApplication *app);
- void polish(QPalette &pal);
- QColorGroup setColorGroup(const QColorGroup &old, const QColorGroup &act, bool dis=false);
- void polish(QWidget *widget);
- void unPolish(QWidget *widget);
- void drawLightBevel(QPainter *p, const QRect &r, const QColorGroup &cg, SFlags flags,
- int round, const QColor &fill, const QColor *custom=NULL,
+ void polish(TQApplication *app);
+ void polish(TQPalette &pal);
+ TQColorGroup setColorGroup(const TQColorGroup &old, const TQColorGroup &act, bool dis=false);
+ void polish(TQWidget *widget);
+ void unPolish(TQWidget *widget);
+ void drawLightBevel(TQPainter *p, const TQRect &r, const TQColorGroup &cg, SFlags flags,
+ int round, const TQColor &fill, const TQColor *custom=NULL,
bool doBorder=true, bool doCorners=true, EWidget w=WIDGET_OTHER) const
{ drawLightBevel(cg.background(), p, r, cg, flags, round, fill, custom, doBorder, doCorners, w); }
- void drawLightBevel(const QColor &bgnd, QPainter *p, const QRect &r, const QColorGroup &cg,
- SFlags flags, int round, const QColor &fill, const QColor *custom=NULL,
+ void drawLightBevel(const TQColor &bgnd, TQPainter *p, const TQRect &r, const TQColorGroup &cg,
+ SFlags flags, int round, const TQColor &fill, const TQColor *custom=NULL,
bool doBorder=true, bool doCorners=true, EWidget w=WIDGET_OTHER) const;
- void drawGlow(QPainter *p, const QRect &r, const QColorGroup &cg, EWidget w, const QColor *cols=0) const;
- void drawEtch(QPainter *p, const QRect &r, const QColorGroup &cg, bool raised=false, bool square=false) const;
- void drawBorder(const QColor &bgnd, QPainter *p, const QRect &r, const QColorGroup &cg,
- SFlags flags, int round, const QColor *custom=NULL, EWidget w=WIDGET_OTHER,
+ void drawGlow(TQPainter *p, const TQRect &r, const TQColorGroup &cg, EWidget w, const TQColor *cols=0) const;
+ void drawEtch(TQPainter *p, const TQRect &r, const TQColorGroup &cg, bool raised=false, bool square=false) const;
+ void drawBorder(const TQColor &bgnd, TQPainter *p, const TQRect &r, const TQColorGroup &cg,
+ SFlags flags, int round, const TQColor *custom=NULL, EWidget w=WIDGET_OTHER,
bool doCorners=true, EBorder borderProfile=BORDER_FLAT, bool blendBorderColors=true, int borderVal=STD_BORDER) const;
- void drawMdiIcon(QPainter *painter, const QColor &color, const QColor &shadow, const QRect &r, bool sunken, int margin,
+ void drawMdiIcon(TQPainter *painter, const TQColor &color, const TQColor &shadow, const TQRect &r, bool sunken, int margin,
SubControl button) const;
- void drawWindowIcon(QPainter *painter, const QColor &color, const QRect &r, bool sunken, int margin, SubControl button) const;
- void drawEntryField(QPainter *p, const QRect &r, const QColorGroup &cg, SFlags flags,
+ void drawWindowIcon(TQPainter *painter, const TQColor &color, const TQRect &r, bool sunken, int margin, SubControl button) const;
+ void drawEntryField(TQPainter *p, const TQRect &r, const TQColorGroup &cg, SFlags flags,
EntryColor coloration, int round, EWidget=WIDGET_ENTRY) const;
- void drawArrow(QPainter *p, const QRect &r, const QColorGroup &cg, SFlags flags,
- QStyle::PrimitiveElement pe, bool small=false, bool checkActive=false) const;
- void drawPrimitive(PrimitiveElement, QPainter *, const QRect &, const QColorGroup &,
- SFlags = Style_Default, const QStyleOption & = QStyleOption::Default) const;
- void drawKStylePrimitive(KStylePrimitive kpe, QPainter* p, const QWidget* widget, const QRect &r,
- const QColorGroup &cg, SFlags flags, const QStyleOption &opt ) const;
- void drawControl(ControlElement, QPainter *, const QWidget *, const QRect &, const QColorGroup &,
- SFlags = Style_Default, const QStyleOption & = QStyleOption::Default) const;
- void drawControlMask(ControlElement, QPainter *, const QWidget *, const QRect &,
- const QStyleOption & = QStyleOption::Default) const;
- void drawComplexControlMask(ComplexControl control, QPainter *p, const QWidget *widget,
- const QRect &r, const QStyleOption &data) const;
- QRect subRect(SubRect, const QWidget *) const;
- void drawComplexControl(ComplexControl, QPainter *, const QWidget *, const QRect &,
- const QColorGroup &, SFlags = Style_Default, SCFlags = SC_All,
- SCFlags = SC_None, const QStyleOption & = QStyleOption::Default) const;
- QRect querySubControlMetrics(ComplexControl, const QWidget *, SubControl,
- const QStyleOption & = QStyleOption::Default) const;
- int pixelMetric(PixelMetric, const QWidget *widget= 0) const;
- int kPixelMetric(KStylePixelMetric kpm, const QWidget *widget) const;
- QSize sizeFromContents(ContentsType, const QWidget *, const QSize &,
- const QStyleOption & = QStyleOption::Default) const;
- int styleHint(StyleHint, const QWidget *widget= 0, const QStyleOption & = QStyleOption::Default,
- QStyleHintReturn *returnData= 0) const;
- void drawItem(QPainter *p, const QRect &r, int flags, const QColorGroup &cg, bool enabled,
- const QPixmap *pixmap, const QString &text, int len=-1, const QColor *penColor=0) const;
+ void drawArrow(TQPainter *p, const TQRect &r, const TQColorGroup &cg, SFlags flags,
+ TQ_PrimitiveElement pe, bool small=false, bool checkActive=false) const;
+ void tqdrawPrimitive(TQ_PrimitiveElement, TQPainter *, const TQRect &, const TQColorGroup &,
+ SFlags = Style_Default, const TQStyleOption & = TQStyleOption::Default) const;
+ void drawKStylePrimitive(KStylePrimitive kpe, TQPainter* p, const TQWidget* widget, const TQRect &r,
+ const TQColorGroup &cg, SFlags flags, const TQStyleOption &opt ) const;
+ void tqdrawControl(ControlElement, TQPainter *, const TQWidget *, const TQRect &, const TQColorGroup &,
+ SFlags = Style_Default, const TQStyleOption & = TQStyleOption::Default) const;
+ void tqdrawControlMask(ControlElement, TQPainter *, const TQWidget *, const TQRect &,
+ const TQStyleOption & = TQStyleOption::Default) const;
+ void tqdrawComplexControlMask(ComplexControl control, TQPainter *p, const TQWidget *widget,
+ const TQRect &r, const TQStyleOption &data) const;
+ TQRect subRect(SubRect, const TQWidget *) const;
+ void tqdrawComplexControl(ComplexControl, TQPainter *, const TQWidget *, const TQRect &,
+ const TQColorGroup &, SFlags = Style_Default, SCFlags = SC_All,
+ SCFlags = SC_None, const TQStyleOption & = TQStyleOption::Default) const;
+ TQRect querySubControlMetrics(TQ_ComplexControl, const TQWidget *, SubControl,
+ const TQStyleOption & = TQStyleOption::Default) const;
+ int tqpixelMetric(PixelMetric, const TQWidget *widget= 0) const;
+ int kPixelMetric(KStylePixelMetric kpm, const TQWidget *widget) const;
+ TQSize tqsizeFromContents(ContentsType, const TQWidget *, const TQSize &,
+ const TQStyleOption & = TQStyleOption::Default) const;
+ int tqstyleHint(StyleHint, const TQWidget *widget= 0, const TQStyleOption & = TQStyleOption::Default,
+ TQStyleHintReturn *returnData= 0) const;
+ void drawItem(TQPainter *p, const TQRect &r, int flags, const TQColorGroup &cg, bool enabled,
+ const TQPixmap *pixmap, const TQString &text, int len=-1, const TQColor *penColor=0) const;
protected:
- bool appIsNotEmbedded(QDialog *dlg);
- bool eventFilter(QObject *object, QEvent *event);
- void drawMenuItem(QPainter *p, const QRect &r, int flags, const QColorGroup &cg,
- bool mbi, int round, const QColor &bgnd, const QColor *cols) const;
- void drawProgress(QPainter *p, const QRect &r, const QColorGroup &cg, SFlags flags, int round,
- const QWidget *widget) const;
- void drawBevelGradient(const QColor &base, QPainter *p, QRect const &r,
+ bool appIsNotEmbedded(TQDialog *dlg);
+ bool eventFilter(TQObject *object, TQEvent *event);
+ void drawMenuItem(TQPainter *p, const TQRect &r, int flags, const TQColorGroup &cg,
+ bool mbi, int round, const TQColor &bgnd, const TQColor *cols) const;
+ void drawProgress(TQPainter *p, const TQRect &r, const TQColorGroup &cg, SFlags flags, int round,
+ const TQWidget *widget) const;
+ void drawBevelGradient(const TQColor &base, TQPainter *p, TQRect const &r,
bool horiz, bool sel, EAppearance bevApp, EWidget w=WIDGET_OTHER) const;
- void drawBevelGradientReal(const QColor &base, QPainter *p, QRect const &r,
+ void drawBevelGradientReal(const TQColor &base, TQPainter *p, TQRect const &r,
bool horiz, bool sel, EAppearance bevApp, EWidget w=WIDGET_OTHER) const;
- void drawGradient(const QColor &top, const QColor &bot, QPainter *p, const QRect &r, bool horiz=true) const;
- void drawSbSliderHandle(QPainter *p, const QRect &r, const QColorGroup &cg, SFlags flags, bool slider=false) const;
- void drawSliderHandle(QPainter *p, const QRect &r, const QColorGroup &cg, SFlags flags, QSlider *slider, bool tb=false) const;
- void drawSliderGroove(QPainter *p, const QRect &r, const QColorGroup &cg, SFlags flags,
- const QWidget *widget) const;
- void drawMenuOrToolBarBackground(QPainter *p, const QRect &r, const QColorGroup &cg, bool menu=true, bool horiz=true) const;
- void drawHandleMarkers(QPainter *p, const QRect &r, SFlags flags, bool tb, ELine handles) const;
- void drawHighlight(QPainter *p, const QRect &r, const QColorGroup &cg, bool horiz, bool inc) const;
+ void drawGradient(const TQColor &top, const TQColor &bot, TQPainter *p, const TQRect &r, bool horiz=true) const;
+ void drawSbSliderHandle(TQPainter *p, const TQRect &r, const TQColorGroup &cg, SFlags flags, bool slider=false) const;
+ void drawSliderHandle(TQPainter *p, const TQRect &r, const TQColorGroup &cg, SFlags flags, TQSlider *slider, bool tb=false) const;
+ void drawSliderGroove(TQPainter *p, const TQRect &r, const TQColorGroup &cg, SFlags flags,
+ const TQWidget *widget) const;
+ void drawMenuOrToolBarBackground(TQPainter *p, const TQRect &r, const TQColorGroup &cg, bool menu=true, bool horiz=true) const;
+ void drawHandleMarkers(TQPainter *p, const TQRect &r, SFlags flags, bool tb, ELine handles) const;
+ void drawHighlight(TQPainter *p, const TQRect &r, const TQColorGroup &cg, bool horiz, bool inc) const;
private:
- static QColor shadowColor(const QColor col)
+ static TQColor shadowColor(const TQColor col)
{
- return qGray(col.rgb()) < 100 ? QColor(255, 255, 255) : QColor(0, 0, 0);
+ return tqGray(col.rgb()) < 100 ? TQColor(255, 255, 255) : TQColor(0, 0, 0);
}
- void shadeColors(const QColor &base, QColor *vals) const;
- const QColor * buttonColors(const QColorGroup &cg) const;
- const QColor * checkRadioColors(const QColorGroup &cg, SFlags flags) const;
- const QColor * sliderColors(/*const QColorGroup &cg, */SFlags flags) const;
- const QColor * backgroundColors(const QColor &c) const;
- const QColor * backgroundColors(const QColorGroup &cg) const
+ void shadeColors(const TQColor &base, TQColor *vals) const;
+ const TQColor * buttonColors(const TQColorGroup &cg) const;
+ const TQColor * checkRadioColors(const TQColorGroup &cg, SFlags flags) const;
+ const TQColor * sliderColors(/*const TQColorGroup &cg, */SFlags flags) const;
+ const TQColor * backgroundColors(const TQColor &c) const;
+ const TQColor * backgroundColors(const TQColorGroup &cg) const
{ return backgroundColors(cg.background()); }
- const QColor * borderColors(SFlags flags, const QColor *use) const;
- const QColor * getSidebarButtons() const;
- void setMenuColors(const QColorGroup &cg);
- const QColor * menuColors(const QColorGroup &cg, bool active) const;
+ const TQColor * borderColors(SFlags flags, const TQColor *use) const;
+ const TQColor * getSidebarButtons() const;
+ void setMenuColors(const TQColorGroup &cg);
+ const TQColor * menuColors(const TQColorGroup &cg, bool active) const;
void setDecorationColors(bool init=false);
- const QColor * getMdiColors(const QColorGroup &cg, bool active) const;
+ const TQColor * getMdiColors(const TQColorGroup &cg, bool active) const;
#ifdef SET_MDI_WINDOW_BUTTON_POSITIONS
void readMdiPositions() const;
#endif
- bool redrawHoverWidget(const QPoint &pos);
- const QColor & getFill(SFlags flags, const QColor *use, bool cr=false, bool darker=false) const;
- const QColor & getListViewFill(SFlags flags, const QColor *use) const;
- const QColor & getTabFill(bool current, bool highlight, const QColor *use) const;
- const QColor & menuStripeCol() const;
- const QColor & checkRadioCol(SFlags flags, const QColorGroup &cg) const;
- QColor shade(const QColor &a, float k) const;
+ bool redrawHoverWidget(const TQPoint &pos);
+ const TQColor & getFill(SFlags flags, const TQColor *use, bool cr=false, bool darker=false) const;
+ const TQColor & getListViewFill(SFlags flags, const TQColor *use) const;
+ const TQColor & getTabFill(bool current, bool highlight, const TQColor *use) const;
+ const TQColor & menuStripeCol() const;
+ const TQColor & checkRadioCol(SFlags flags, const TQColorGroup &cg) const;
+ TQColor shade(const TQColor &a, float k) const;
void shade(const color &ca, color *cb, double k) const;
- void drawDot(QPainter *p, const QRect &r, const QColor *cols) const;
- QPixmap * getPixelPixmap(const QColor col) const;
- QPixmap * getPixmap(const QColor col, EPixmap pix, double shade=1.0) const;
- QPixmap * createStripePixmap(const QColor &col, bool forWindow) const;
+ void drawDot(TQPainter *p, const TQRect &r, const TQColor *cols) const;
+ TQPixmap * getPixelPixmap(const TQColor col) const;
+ TQPixmap * getPixmap(const TQColor col, EPixmap pix, double shade=1.0) const;
+ TQPixmap * createStripePixmap(const TQColor &col, bool forWindow) const;
void setSbType();
- bool isFormWidget(const QWidget *w) const { return itsKhtmlWidgets.contains(w); }
+ bool isFormWidget(const TQWidget *w) const { return itsKhtmlWidgets.tqcontains(w); }
void resetHover();
- bool isWindowDragWidget(QObject *o, const QPoint &pos=QPoint());
+ bool isWindowDragWidget(TQObject *o, const TQPoint &pos=TQPoint());
private slots:
void updateProgressPos();
- void progressBarDestroyed(QObject *bar);
+ void progressBarDestroyed(TQObject *bar);
void sliderThumbMoved(int val);
- void khtmlWidgetDestroyed(QObject *o);
- void hoverWidgetDestroyed(QObject *o);
+ void khtmlWidgetDestroyed(TQObject *o);
+ void hoverWidgetDestroyed(TQObject *o);
private:
mutable Options opts;
- QColor itsHighlightCols[TOTAL_SHADES+1],
+ TQColor itsHighlightCols[TOTAL_SHADES+1],
itsBackgroundCols[TOTAL_SHADES+1],
itsMenubarCols[TOTAL_SHADES+1],
itsFocusCols[TOTAL_SHADES+1],
@@ -268,32 +269,32 @@ class QtCurveStyle : public BASE_STYLE
itsButtonCols[TOTAL_SHADES+1],
itsLighterPopupMenuBgndCol,
itsCheckRadioCol;
- mutable QColor *itsSidebarButtonsCols;
- mutable QColor *itsActiveMdiColors;
- mutable QColor *itsMdiColors;
- mutable QColor itsActiveMdiTextColor;
- mutable QColor itsMdiTextColor;
- mutable QColor itsColoredButtonCols[TOTAL_SHADES+1];
- mutable QColor itsColoredBackgroundCols[TOTAL_SHADES+1];
+ mutable TQColor *itsSidebarButtonsCols;
+ mutable TQColor *itsActiveMdiColors;
+ mutable TQColor *itsMdiColors;
+ mutable TQColor itsActiveMdiTextColor;
+ mutable TQColor itsMdiTextColor;
+ mutable TQColor itsColoredButtonCols[TOTAL_SHADES+1];
+ mutable TQColor itsColoredBackgroundCols[TOTAL_SHADES+1];
EApp itsThemedApp;
- mutable QCache<QPixmap> itsPixmapCache;
-#if defined QTC_QT_ONLY || !defined KDE_VERSION || KDE_VERSION >= 0x30200
+ mutable TQCache<TQPixmap> itsPixmapCache;
+#if defined TQTC_TQT_ONLY || !defined KDE_VERSION || KDE_VERSION >= 0x30200
bool itsIsTransKicker;
#endif
EHover itsHover;
- QPoint itsOldPos;
+ TQPoint itsOldPos;
mutable bool itsFormMode;
- QWidget *itsHoverWidget;
+ TQWidget *itsHoverWidget;
int itsHoverSect;
- QTab *itsHoverTab;
- QPalette *itsMactorPal;
- QMap<QWidget*, int> itsProgAnimWidgets;
- QMap<const QWidget*, bool> itsKhtmlWidgets;
- QTimer *itsAnimationTimer;
+ TQTab *itsHoverTab;
+ TQPalette *itsMactorPal;
+ TQMap<TQWidget*, int> itsProgAnimWidgets;
+ TQMap<const TQWidget*, bool> itsKhtmlWidgets;
+ TQTimer *itsAnimationTimer;
mutable bool itsActive,
itsIsSpecialHover;
- mutable QValueList<int> itsMdiButtons[2]; // 0=left, 1=right
- QWidget *itsDragWidget;
+ mutable TQValueList<int> itsMdiButtons[2]; // 0=left, 1=right
+ TQWidget *itsDragWidget;
bool itsDragWidgetHadMouseTracking;
};