diff options
Diffstat (limited to 'style/polyester.h')
-rwxr-xr-x | style/polyester.h | 242 |
1 files changed, 121 insertions, 121 deletions
diff --git a/style/polyester.h b/style/polyester.h index 26ad080..a4a93d8 100755 --- a/style/polyester.h +++ b/style/polyester.h @@ -45,97 +45,97 @@ #define __POLYESTER_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; //a tiny reimplementation of max... int max(int a, int b){return (a>b?a:b);} class PolyesterStyle : public KStyle { - Q_OBJECT + TQ_OBJECT public: PolyesterStyle(); virtual ~PolyesterStyle(); - 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, + 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, + 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 drawControlMask( ControlElement, TQPainter *, const TQWidget *, const TQRect &, const TQStyleOption &) const; void drawComplexControl(ComplexControl control, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags = Style_Default, SCFlags controls = SC_All, SCFlags active = SC_None, - const QStyleOption& = QStyleOption::Default ) const; + const TQStyleOption& = TQStyleOption::Default ) const; int pixelMetric(PixelMetric m, - const QWidget *widget = 0 ) const; + const TQWidget *widget = 0 ) const; - int kPixelMetric(KStylePixelMetric kpm, const QWidget *widget) const; + int kPixelMetric(KStylePixelMetric kpm, const TQWidget *widget) 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 drawComplexControlMask(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 sizeFromContents(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 styleHint(StyleHint, const TQWidget * = 0, + const TQStyleOption & = TQStyleOption::Default, + TQStyleHintReturn * = 0 ) const; protected: enum TabPosition @@ -205,39 +205,39 @@ protected: Sharp_BottomRight = 0x00200000 }; - 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, @@ -246,27 +246,27 @@ protected: int animFrame = 0, bool isDefault = 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 SelectedTab selected = OtherTab, const bool bottom = false, @@ -274,29 +274,29 @@ protected: const bool triangular = false, 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 *); // what widget has mouse over him? - QWidget* hoverWidget; + TQWidget* hoverWidget; // mouse over for listview headers int hoverHeaderId; protected slots: - void khtmlWidgetDestroyed(QObject* w); + void khtmlWidgetDestroyed(TQObject* w); void sliderThumbMoved(int val); //Animation slots. void updateProgressPos(); - void progressBarDestroyed(QObject* bar); - void animWidgetDestroyed(QObject* w); + void progressBarDestroyed(TQObject* bar); + void animWidgetDestroyed(TQObject* w); void animate(); - 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 PolyesterStyle( const PolyesterStyle & ); @@ -309,7 +309,7 @@ private: int _contrast; bool _scrollBarLines; - QString _scrollBarStyle; + TQString _scrollBarStyle; int _scrollBarExtent; KStyle::KStyleScrollBarType _scrollBarType; bool _useLowerCaseText; @@ -328,7 +328,7 @@ private: bool _menuBarEmphasisBorder; bool _customMenuBarEmphasisColor; bool _menuStripe; - QColor _menuBarEmphasisColor; + TQColor _menuBarEmphasisColor; bool _shadowedMenuBarText; bool _shadowedButtonsText; bool _drawToolBarSeparator; @@ -339,18 +339,18 @@ private: bool _customOverHighlightColor; bool _customFocusHighlightColor; bool _customCheckMarkColor; - QColor _overHighlightColor; - QColor _focusHighlightColor; - QColor _checkMarkColor; - QString _buttonStyle; + TQColor _overHighlightColor; + TQColor _focusHighlightColor; + TQColor _checkMarkColor; + TQString _buttonStyle; - 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 { @@ -363,14 +363,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) {} @@ -381,7 +381,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); @@ -396,43 +396,43 @@ private: (c1Rgb == other.c1Rgb) && (horizontal = other.horizontal); // if(!match) { -// qDebug("operator ==: CacheEntries don't match!"); -// qDebug("width: %d\t\tother width: %d", width, other.width); -// qDebug("height: %d\t\tother height: %d", height, other.height); -// qDebug("fgRgb: %d\t\tother fgRgb: %d", fgRgb, other.fgRgb); -// qDebug("bgRgb: %d\t\tother bgRgb: %d", bgRgb, other.bgRgb); -// qDebug("surfaceFlags: %d\t\tother surfaceFlags: %d", surfaceFlags, other.surfaceFlags); +// tqDebug("operator ==: CacheEntries don't match!"); +// tqDebug("width: %d\t\tother width: %d", width, other.width); +// tqDebug("height: %d\t\tother height: %d", height, other.height); +// tqDebug("fgRgb: %d\t\tother fgRgb: %d", fgRgb, other.fgRgb); +// tqDebug("bgRgb: %d\t\tother bgRgb: %d", bgRgb, other.bgRgb); +// tqDebug("surfaceFlags: %d\t\tother surfaceFlags: %d", surfaceFlags, other.surfaceFlags); // } 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 buttons animation struct AnimInfo { bool active; uint animFrame; }; - typedef QMap<QWidget*, AnimInfo>AnimWidgetMap; + typedef TQMap<TQWidget*, AnimInfo>AnimWidgetMap; AnimWidgetMap animWidgets; - QTimer *btnAnimTimer; + TQTimer *btnAnimTimer; - typedef QMap<const QWidget*, int>SliderValuesMap; + typedef TQMap<const TQWidget*, int>SliderValuesMap; SliderValuesMap sliderValues; // For progress bar animation - QTimer *animationTimer; + TQTimer *animationTimer; //for the semi transparent menu stripe - QImage *alphaStripe; + TQImage *alphaStripe; }; #endif // __POLYESTER_H |