Diffstat (limited to 'noncore/styles/phase/phasestyle.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/styles/phase/phasestyle.h | 166 |
1 files changed, 166 insertions, 0 deletions
diff --git a/noncore/styles/phase/phasestyle.h b/noncore/styles/phase/phasestyle.h new file mode 100644 index 0000000..ab593e6 --- a/dev/null +++ b/noncore/styles/phase/phasestyle.h | |||
@@ -0,0 +1,166 @@ | |||
1 | ////////////////////////////////////////////////////////////////////////////// | ||
2 | // phasestyle.h | ||
3 | // ------------------- | ||
4 | // A style for KDE | ||
5 | // ------------------- | ||
6 | // Copyright (c) 2004 David Johnson <david@usermode.org> | ||
7 | // | ||
8 | // Permission is hereby granted, free of charge, to any person obtaining a copy | ||
9 | // of this software and associated documentation files (the "Software"), to | ||
10 | // deal in the Software without restriction, including without limitation the | ||
11 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
12 | // sell copies of the Software, and to permit persons to whom the Software is | ||
13 | // furnished to do so, subject to the following conditions: | ||
14 | // | ||
15 | // The above copyright notice and this permission notice shall be included in | ||
16 | // all copies or substantial portions of the Software. | ||
17 | // | ||
18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
23 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
24 | // IN THE SOFTWARE. | ||
25 | ////////////////////////////////////////////////////////////////////////////// | ||
26 | |||
27 | #ifndef PHASESTYLE_H | ||
28 | #define PHASESTYLE_H | ||
29 | |||
30 | #include <qstyle.h> | ||
31 | #include <qwindowsstyle.h> | ||
32 | #include <qcolor.h> | ||
33 | |||
34 | class KPixmap; | ||
35 | |||
36 | class PhaseStyle : public QWindowsStyle | ||
37 | { | ||
38 | Q_OBJECT | ||
39 | public: | ||
40 | PhaseStyle(); | ||
41 | virtual ~PhaseStyle(); | ||
42 | |||
43 | void polish( QWidget * ); | ||
44 | void polish( QPalette& ); | ||
45 | void polish( QApplication* ); | ||
46 | |||
47 | |||
48 | void drawCheckMark ( QPainter * p, int x, int y, int w, | ||
49 | int h, const QColorGroup & g, | ||
50 | bool act, bool dis ); | ||
51 | void drawArrow(QPainter *p, Qt::ArrowType type, bool down, | ||
52 | int x, int y, int w, int h, const QColorGroup &g, | ||
53 | bool enabled=true, const QBrush *fill = 0); | ||
54 | |||
55 | void drawPushButton(QPushButton* btn, QPainter* p ); | ||
56 | void drawPushButtonLabel(QPushButton* btn, QPainter* p ); | ||
57 | void drawPanel(QPainter* p, int , int, int, int, | ||
58 | const QColorGroup&, bool sunken = false, | ||
59 | int lineWidth = 1, const QBrush *b = 0l ); | ||
60 | void drawButton( QPainter*, int x, int y, int w, int h, | ||
61 | const QColorGroup&, bool sunken = false, | ||
62 | const QBrush* fill = 0); | ||
63 | void drawBevelButton(QPainter*, int, int, int, int, | ||
64 | const QColorGroup&, bool sunken = false, | ||
65 | const QBrush* fill = 0 ); | ||
66 | void drawFocusRect( QPainter* p, const QRect& r, | ||
67 | const QColorGroup&, const QColor* = 0, | ||
68 | bool atBorder = false ); | ||
69 | void drawButtonMask( QPainter* p, int x, int y, | ||
70 | int w, int h ); | ||
71 | |||
72 | |||
73 | /* Menu Stuff */ | ||
74 | void drawSeperator( QPainter* p, int x, int y, int w, | ||
75 | int h, const QColorGroup& group, bool sunken = true, | ||
76 | int lineWidth = 1, int midLineWidtth = 0 ); | ||
77 | void drawMenuBarItem(QPainter* p, int x, int y, int w, int h, | ||
78 | QMenuItem *mi, QColorGroup& g, bool enabled, | ||
79 | bool act); | ||
80 | |||
81 | /* RadioButton, CheckBox... */ | ||
82 | void drawIndicator(QPainter* p, int x, int y, int w, int h, | ||
83 | const QColorGroup &g, int state, bool down = FALSE, | ||
84 | bool enabled = TRUE ); | ||
85 | void drawExclusiveIndicator( QPainter*, int, int, int, int, | ||
86 | const QColorGroup&, bool on, | ||
87 | bool down = false,bool enabled = true ); | ||
88 | void drawExclusiveIndicatorMask (QPainter*, int, int, int, int, bool ); | ||
89 | |||
90 | /* spacing,dimensions */ | ||
91 | int defaultFrameWidth () const; | ||
92 | int popupMenuItemHeight ( bool checkable, | ||
93 | QMenuItem * mi, | ||
94 | const QFontMetrics & fm ); | ||
95 | int extraPopupMenuItemWidth(bool checkable, int maxpmw, | ||
96 | QMenuItem* mi, const QFontMetrics& fm ); | ||
97 | |||
98 | QSize indicatorSize()const; | ||
99 | QSize exclusiveIndicatorSize()const; | ||
100 | void getButtonShift( int &x, int &y ); | ||
101 | |||
102 | /* popup drawing */ | ||
103 | void drawPopupMenuItem ( QPainter * p, bool checkable, int maxpmw, | ||
104 | int tab, QMenuItem * mi, | ||
105 | const QPalette & pal, bool act, | ||
106 | bool enabled, int x, int y, | ||
107 | int w, int h ); | ||
108 | |||
109 | /* combo box */ | ||
110 | QRect comboButtonRect ( int x, int y, int w, int h ); | ||
111 | void drawComboButton( QPainter * p, int x, int y, | ||
112 | int w, int h, | ||
113 | const QColorGroup & g, | ||
114 | bool sunken = FALSE, | ||
115 | bool editable = FALSE, | ||
116 | bool enabled = TRUE, | ||
117 | const QBrush * fill = 0 ); | ||
118 | |||
119 | /* tabbar */ | ||
120 | void drawTab(QPainter*, const QTabBar*, QTab*, | ||
121 | bool selected ); | ||
122 | void drawTabMask( QPainter*, const QTabBar*, QTab*, | ||
123 | bool ); | ||
124 | |||
125 | /* tool button */ | ||
126 | void drawToolButton ( QPainter * p, int x, int y, | ||
127 | int w, int h, | ||
128 | const QColorGroup & g, | ||
129 | bool sunken = FALSE, | ||
130 | const QBrush * fill = 0 ); | ||
131 | |||
132 | /* scrollbar */ | ||
133 | void drawScrollBarControls ( QPainter *, const QScrollBar *, | ||
134 | int sliderStart, uint controls, | ||
135 | uint activeControl ); | ||
136 | void scrollBarMetrics( const QScrollBar*, int&, int&, int&, int& ); | ||
137 | QStyle::ScrollControl scrollBarPointOver( const QScrollBar*, int sliderStart, | ||
138 | const QPoint& ); | ||
139 | |||
140 | /* slider drawing */ | ||
141 | void drawSlider ( QPainter * p, int x, int y, int w, int h, | ||
142 | const QColorGroup & g, Orientation, | ||
143 | bool tickAbove, bool tickBelow ); | ||
144 | |||
145 | void drawSliderGroove ( QPainter * p, int x, int y, int w, | ||
146 | int h, const QColorGroup & g, | ||
147 | QCOORD c, Orientation ); | ||
148 | private: | ||
149 | void drawPhaseGradient(QPainter* p, | ||
150 | const QRect& rec, | ||
151 | const QColor& col )const; | ||
152 | static void scrollBarItemPositions( const QScrollBar *, | ||
153 | const bool horizontal, | ||
154 | int sliderStart, | ||
155 | int sliderMax, | ||
156 | int sliderLength, | ||
157 | int buttomDim, | ||
158 | QRect& sub, | ||
159 | QRect& add, | ||
160 | QRect& subPage, | ||
161 | QRect& addPage, | ||
162 | QRect& slider ); | ||
163 | }; | ||
164 | |||
165 | |||
166 | #endif | ||