diff options
Diffstat (limited to 'style/lipstik.h')
-rw-r--r-- | style/lipstik.h | 235 |
1 files changed, 118 insertions, 117 deletions
diff --git a/style/lipstik.h b/style/lipstik.h index c8ca9e5..7634e0b 100644 --- a/style/lipstik.h +++ b/style/lipstik.h @@ -19,7 +19,7 @@ (c) 2002,2003 Maksim Orlovich <[email protected]> based on the KDE3 HighColor Style Copyright (C) 2001-2002 Karol Szwed <[email protected]> - (C) 2001-2002 Fredrik H�glund <[email protected]> + (C) 2001-2002 Fredrik H�glund <[email protected]> Drawing routines adapted from the KDE2 HCStyle, Copyright (C) 2000 Daniel M. Duley <[email protected]> (C) 2000 Dirk Mueller <[email protected]> @@ -46,92 +46,93 @@ #define __LIPSTIK_H #include <kstyle.h> -#include <qbitmap.h> -#include <qintcache.h> +#include <tqbitmap.h> +#include <tqintcache.h> #define u_arrow -4,1, 2,1, -3,0, 1,0, -2,-1, 0,-1, -1,-2 #define d_arrow -4,-2, 2,-2, -3,-1, 1,-1, -2,0, 0,0, -1,1 #define l_arrow 0,-3, 0,3,-1,-2,-1,2,-2,-1,-2,1,-3,0 #define r_arrow -2,-3,-2,3,-1,-2, -1,2,0,-1,0,1,1,0 -#define QCOORDARRLEN(x) sizeof(x)/(sizeof(QCOORD)*2) +#define TQCOORDARRLEN(x) sizeof(x)/(sizeof(TQCOORD)*2) -class QSettings; -class QTab; -class QTimer; +class TQSettings; +class TQTab; +class TQTimer; class LipstikStyle : public KStyle { Q_OBJECT + TQ_OBJECT public: LipstikStyle(); virtual ~LipstikStyle(); - void polish(QApplication* app ); - void polish(QWidget* widget ); - void unPolish(QWidget* widget ); + void polish(TQApplication* app ); + void polish(TQWidget* widget ); + void unPolish(TQWidget* widget ); void drawKStylePrimitive(KStylePrimitive kpe, - QPainter* p, - const QWidget* widget, - const QRect &r, - const QColorGroup &cg, + TQPainter* p, + const TQWidget* widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags = Style_Default, - const QStyleOption& = QStyleOption::Default ) const; + const TQStyleOption& = TQStyleOption::Default ) const; - void drawPrimitive(PrimitiveElement pe, - QPainter *p, - const QRect &r, - const QColorGroup &cg, + void tqdrawPrimitive(PrimitiveElement pe, + TQPainter *p, + const TQRect &r, + const TQColorGroup &cg, SFlags flags = Style_Default, - const QStyleOption &opt = QStyleOption::Default ) const; + const TQStyleOption &opt = TQStyleOption::Default ) const; - void drawControl(ControlElement element, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, + void tqdrawControl(ControlElement element, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags = Style_Default, - const QStyleOption& = QStyleOption::Default ) const; + const TQStyleOption& = TQStyleOption::Default ) const; - void drawControlMask( ControlElement, QPainter *, const QWidget *, const QRect &, const QStyleOption &) const; + void tqdrawControlMask( ControlElement, TQPainter *, const TQWidget *, const TQRect &, const TQStyleOption &) const; - void drawComplexControl(ComplexControl control, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, + void tqdrawComplexControl(ComplexControl control, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags = Style_Default, SCFlags controls = SC_All, SCFlags active = SC_None, - const QStyleOption& = QStyleOption::Default ) const; + const TQStyleOption& = TQStyleOption::Default ) const; - int pixelMetric(PixelMetric m, - const QWidget *widget = 0 ) const; + int tqpixelMetric(PixelMetric m, + const TQWidget *widget = 0 ) const; - QRect subRect(SubRect r, - const QWidget *widget ) const; + TQRect subRect(SubRect r, + const TQWidget *widget ) const; - QRect querySubControlMetrics(ComplexControl control, - const QWidget *widget, + TQRect querySubControlMetrics(ComplexControl control, + const TQWidget *widget, SubControl subcontrol, - const QStyleOption &opt = QStyleOption::Default ) const; + const TQStyleOption &opt = TQStyleOption::Default ) const; - void drawComplexControlMask(QStyle::ComplexControl c, - QPainter *p, - const QWidget *w, - const QRect &r, - const QStyleOption &o=QStyleOption::Default) const; + void tqdrawComplexControlMask(TQStyle::ComplexControl c, + TQPainter *p, + const TQWidget *w, + const TQRect &r, + const TQStyleOption &o=TQStyleOption::Default) const; - QSize sizeFromContents(QStyle::ContentsType t, - const QWidget *w, - const QSize &s, - const QStyleOption &o) const; + TQSize tqsizeFromContents(TQStyle::ContentsType t, + const TQWidget *w, + const TQSize &s, + const TQStyleOption &o) const; - int styleHint(StyleHint, const QWidget * = 0, - const QStyleOption & = QStyleOption::Default, - QStyleHintReturn * = 0 ) const; + int tqstyleHint(StyleHint, const TQWidget * = 0, + const TQStyleOption & = TQStyleOption::Default, + TQStyleHintReturn * = 0 ) const; protected: enum TabPosition @@ -191,66 +192,66 @@ protected: Draw_AlphaBlend = 0x00020000 }; - void renderContour(QPainter *p, - const QRect &r, - const QColor &backgroundColor, - const QColor &contourColor, + void renderContour(TQPainter *p, + const TQRect &r, + const TQColor &backgroundColor, + const TQColor &contourColor, const uint flags = Draw_Left|Draw_Right|Draw_Top|Draw_Bottom| Round_UpperLeft|Round_UpperRight|Round_BottomLeft|Round_BottomRight) const; - void renderMask(QPainter *p, - const QRect &r, - const QColor &color, + void renderMask(TQPainter *p, + const TQRect &r, + const TQColor &color, const uint flags = Draw_Left|Draw_Right|Draw_Top|Draw_Bottom| Round_UpperLeft|Round_UpperRight|Round_BottomLeft|Round_BottomRight) const; - void renderSurface(QPainter *p, - const QRect &r, - const QColor &backgroundColor, - const QColor &buttonColor, - const QColor &highlightColor, + void renderSurface(TQPainter *p, + const TQRect &r, + const TQColor &backgroundColor, + const TQColor &buttonColor, + const TQColor &highlightColor, int intensity = 5, const uint flags = Draw_Left|Draw_Right|Draw_Top|Draw_Bottom| Round_UpperLeft|Round_UpperRight|Round_BottomLeft|Round_BottomRight| Is_Horizontal) const; - inline void renderPixel(QPainter *p, - const QPoint &pos, + inline void renderPixel(TQPainter *p, + const TQPoint &pos, const int alpha, - const QColor &color, - const QColor &background = QColor(), + const TQColor &color, + const TQColor &background = TQColor(), bool fullAlphaBlend = true) const; - void renderButton(QPainter *p, - const QRect &r, - const QColorGroup &g, + void renderButton(TQPainter *p, + const TQRect &r, + const TQColorGroup &g, bool sunken = false, bool mouseOver = false, bool horizontal = true, bool enabled = true, bool khtmlMode = false) const; - void renderPanel(QPainter *p, - const QRect &r, - const QColorGroup &g, + void renderPanel(TQPainter *p, + const TQRect &r, + const TQColorGroup &g, const bool pseudo3d = true, const bool sunken = true) const; - void renderDot(QPainter *p, - const QPoint &point, - const QColor &baseColor, + void renderDot(TQPainter *p, + const TQPoint &point, + const TQColor &baseColor, const bool thick = false, const bool sunken = false) const; - void renderGradient(QPainter *p, - const QRect &r, - const QColor &c1, - const QColor &c2, + void renderGradient(TQPainter *p, + const TQRect &r, + const TQColor &c1, + const TQColor &c2, bool horizontal = true) const; - void renderTab(QPainter *p, - const QRect &r, - const QColorGroup &g, + void renderTab(TQPainter *p, + const TQRect &r, + const TQColorGroup &g, bool mouseOver = false, const bool selected = false, const bool bottom = false, @@ -258,21 +259,21 @@ protected: const bool triangular = false, const bool cornerWidget = false) const; - virtual void renderMenuBlendPixmap( KPixmap& pix, const QColorGroup& cg, - const QPopupMenu* popup ) const; + virtual void renderMenuBlendPixmap( KPixmap& pix, const TQColorGroup& cg, + const TQPopupMenu* popup ) const; - bool eventFilter(QObject *, QEvent *); + bool eventFilter(TQObject *, TQEvent *); - QWidget* hoverWidget; + TQWidget* hoverWidget; protected slots: - void khtmlWidgetDestroyed(QObject* w); + void khtmlWidgetDestroyed(TQObject* w); //Animation slots. void updateProgressPos(); - void progressBarDestroyed(QObject* bar); + void progressBarDestroyed(TQObject* bar); - inline QColor getColor(const QColorGroup &cg, const ColorType t, const bool enabled = true)const; - inline QColor getColor(const QColorGroup &cg, const ColorType t, const WidgetState s)const; + inline TQColor getColor(const TQColorGroup &cg, const ColorType t, const bool enabled = true)const; + inline TQColor getColor(const TQColorGroup &cg, const ColorType t, const WidgetState s)const; private: // Disable copy constructor and = operator LipstikStyle( const LipstikStyle & ); @@ -313,25 +314,25 @@ private: bool _tickCheckMark; bool _flatStripe; - QString _scrollBarStyle; - QString _scrollBarWidth; - QString _sliderStyle; + TQString _scrollBarStyle; + TQString _scrollBarWidth; + TQString _sliderStyle; - QColor _overHighlightColor; - QColor _focusHighlightColor; - QColor _checkMarkColor; - QColor _tabHighlightColor; - QColor _menuStripeColor; - QColor _defaultMenuStripeColor; -// QColor _arrowColor; + TQColor _overHighlightColor; + TQColor _focusHighlightColor; + TQColor _checkMarkColor; + TQColor _tabHighlightColor; + TQColor _menuStripeColor; + TQColor _defaultMenuStripeColor; +// TQColor _arrowColor; - QTab *hoverTab; + TQTab *hoverTab; // track khtml widgets. - QMap<const QWidget*,bool> khtmlWidgets; + TQMap<const TQWidget*,bool> khtmlWidgets; //Animation support. - QMap<QWidget*, int> progAnimWidgets; + TQMap<TQWidget*, int> progAnimWidgets; // pixmap cache. enum CacheEntryType { @@ -344,14 +345,14 @@ private: CacheEntryType type; int width; int height; - QRgb c1Rgb; - QRgb c2Rgb; + TQRgb c1Rgb; + TQRgb c2Rgb; bool horizontal; - QPixmap* pixmap; + TQPixmap* pixmap; - CacheEntry(CacheEntryType t, int w, int h, QRgb c1, QRgb c2 = 0, - bool hor = false, QPixmap* p = 0 ): + CacheEntry(CacheEntryType t, int w, int h, TQRgb c1, TQRgb c2 = 0, + bool hor = false, TQPixmap* p = 0 ): type(t), width(w), height(h), c1Rgb(c1), c2Rgb(c2), horizontal(hor), pixmap(p) {} @@ -362,7 +363,7 @@ private: int key() { - // create an int key from the properties which is used to refer to entries in the QIntCache. + // create an int key from the properties which is used to refer to entries in the TQIntCache. // the result may not be 100% correct as we don't have so much space in one integer -- use // == operator after find to make sure we got the right one. :) return horizontal ^ (type<<1) ^ (width<<5) ^ (height<<10) ^ (c1Rgb<<19) ^ (c2Rgb<<22); @@ -387,18 +388,18 @@ private: return match; } }; - QIntCache<CacheEntry> *pixmapCache; + TQIntCache<CacheEntry> *pixmapCache; // For renderFocusRect - mutable QBitmap *verticalDots; - mutable QBitmap *horizontalDots; + mutable TQBitmap *verticalDots; + mutable TQBitmap *horizontalDots; // For KPE_ListViewBranch - mutable QBitmap *verticalLine; - mutable QBitmap *horizontalLine; + mutable TQBitmap *verticalLine; + mutable TQBitmap *horizontalLine; // For progress bar animation - QTimer *animationTimer; + TQTimer *animationTimer; }; #endif // __LIPSTIK_H |