-rw-r--r-- | noncore/decorations/flat/flat.cpp | 4 | ||||
-rw-r--r-- | noncore/decorations/flat/flat.h | 1 | ||||
-rw-r--r-- | noncore/decorations/liquid/liquid.cpp | 4 | ||||
-rw-r--r-- | noncore/decorations/liquid/liquid.h | 2 | ||||
-rw-r--r-- | noncore/decorations/polished/polished.cpp | 4 | ||||
-rw-r--r-- | noncore/decorations/polished/polished.h | 2 |
6 files changed, 9 insertions, 8 deletions
diff --git a/noncore/decorations/flat/flat.cpp b/noncore/decorations/flat/flat.cpp index b6a81a3..a2f12be 100644 --- a/noncore/decorations/flat/flat.cpp +++ b/noncore/decorations/flat/flat.cpp | |||
@@ -191,25 +191,25 @@ static QImage scaleButton( const QImage &img, int height ) | |||
191 | } | 191 | } |
192 | } | 192 | } |
193 | 193 | ||
194 | static void colorize( QImage &img, const QColor &c, bool rev ) | 194 | static void colorize( QImage &img, const QColor &c, bool rev ) |
195 | { | 195 | { |
196 | for ( int i = 0; i < img.numColors(); i++ ) { | 196 | for ( int i = 0; i < img.numColors(); i++ ) { |
197 | bool sc = (img.color(i) & 0xff000000); | 197 | bool sc = (img.color(i) & 0xff000000); |
198 | if ( rev ) sc = !sc; | 198 | if ( rev ) sc = !sc; |
199 | img.setColor(i, sc ? c.rgb() : 0x00000000 ); | 199 | img.setColor(i, sc ? c.rgb() : 0x00000000 ); |
200 | } | 200 | } |
201 | } | 201 | } |
202 | 202 | ||
203 | FlatDecoration::FlatDecoration() : ref(0), buttonCache(16) | 203 | FlatDecoration::FlatDecoration() : buttonCache(16) |
204 | { | 204 | { |
205 | buttonCache.setAutoDelete(TRUE); | 205 | buttonCache.setAutoDelete(TRUE); |
206 | } | 206 | } |
207 | 207 | ||
208 | FlatDecoration::~FlatDecoration() | 208 | FlatDecoration::~FlatDecoration() |
209 | { | 209 | { |
210 | } | 210 | } |
211 | 211 | ||
212 | int FlatDecoration::metric( Metric m, const WindowData *wd ) const | 212 | int FlatDecoration::metric( Metric m, const WindowData *wd ) const |
213 | { | 213 | { |
214 | switch ( m ) { | 214 | switch ( m ) { |
215 | case TopBorder: | 215 | case TopBorder: |
@@ -338,23 +338,25 @@ QString FlatDecoration::name() const | |||
338 | QPixmap FlatDecoration::icon() const | 338 | QPixmap FlatDecoration::icon() const |
339 | { | 339 | { |
340 | return QPixmap(); | 340 | return QPixmap(); |
341 | } | 341 | } |
342 | 342 | ||
343 | QRESULT FlatDecoration::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) | 343 | QRESULT FlatDecoration::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) |
344 | { | 344 | { |
345 | *iface = 0; | 345 | *iface = 0; |
346 | if ( uuid == IID_QUnknown ) | 346 | if ( uuid == IID_QUnknown ) |
347 | *iface = this; | 347 | *iface = this; |
348 | else if ( uuid == IID_WindowDecoration ) | 348 | else if ( uuid == IID_WindowDecoration ) |
349 | *iface = this; | 349 | *iface = this; |
350 | else | ||
351 | return QS_FALSE; | ||
350 | 352 | ||
351 | if ( *iface ) | 353 | if ( *iface ) |
352 | (*iface)->addRef(); | 354 | (*iface)->addRef(); |
353 | return QS_OK; | 355 | return QS_OK; |
354 | } | 356 | } |
355 | 357 | ||
356 | Q_EXPORT_INTERFACE() | 358 | Q_EXPORT_INTERFACE() |
357 | { | 359 | { |
358 | Q_CREATE_INSTANCE( FlatDecoration ) | 360 | Q_CREATE_INSTANCE( FlatDecoration ) |
359 | } | 361 | } |
360 | 362 | ||
diff --git a/noncore/decorations/flat/flat.h b/noncore/decorations/flat/flat.h index 3d8a18b..96ceb1f 100644 --- a/noncore/decorations/flat/flat.h +++ b/noncore/decorations/flat/flat.h | |||
@@ -33,17 +33,16 @@ public: | |||
33 | 33 | ||
34 | virtual int metric( Metric m, const WindowData * ) const; | 34 | virtual int metric( Metric m, const WindowData * ) const; |
35 | virtual void drawArea( Area a, QPainter *, const WindowData * ) const; | 35 | virtual void drawArea( Area a, QPainter *, const WindowData * ) const; |
36 | virtual void drawButton( Button b, QPainter *, const WindowData *, int x, int y, int w, int h, QWSButton::State ) const; | 36 | virtual void drawButton( Button b, QPainter *, const WindowData *, int x, int y, int w, int h, QWSButton::State ) const; |
37 | virtual QRegion mask( const WindowData * ) const; | 37 | virtual QRegion mask( const WindowData * ) const; |
38 | virtual QString name() const; | 38 | virtual QString name() const; |
39 | virtual QPixmap icon() const; | 39 | virtual QPixmap icon() const; |
40 | 40 | ||
41 | QRESULT queryInterface( const QUuid&, QUnknownInterface** ); | 41 | QRESULT queryInterface( const QUuid&, QUnknownInterface** ); |
42 | Q_REFCOUNT | 42 | Q_REFCOUNT |
43 | 43 | ||
44 | private: | 44 | private: |
45 | ulong ref; | ||
46 | QCache<QImage> buttonCache; | 45 | QCache<QImage> buttonCache; |
47 | }; | 46 | }; |
48 | 47 | ||
49 | #endif | 48 | #endif |
diff --git a/noncore/decorations/liquid/liquid.cpp b/noncore/decorations/liquid/liquid.cpp index 75b1fc9..ef2ac3c 100644 --- a/noncore/decorations/liquid/liquid.cpp +++ b/noncore/decorations/liquid/liquid.cpp | |||
@@ -1,21 +1,21 @@ | |||
1 | #include "liquid.h" | 1 | #include "liquid.h" |
2 | 2 | ||
3 | #include <qapplication.h> | 3 | #include <qapplication.h> |
4 | #include <qpainter.h> | 4 | #include <qpainter.h> |
5 | #include <qpalette.h> | 5 | #include <qpalette.h> |
6 | #include <qdrawutil.h> | 6 | #include <qdrawutil.h> |
7 | 7 | ||
8 | 8 | ||
9 | LiquidDecoInterface::LiquidDecoInterface ( ) : ref ( 0 ) | 9 | LiquidDecoInterface::LiquidDecoInterface ( ) |
10 | { | 10 | { |
11 | } | 11 | } |
12 | 12 | ||
13 | LiquidDecoInterface::~LiquidDecoInterface ( ) | 13 | LiquidDecoInterface::~LiquidDecoInterface ( ) |
14 | { | 14 | { |
15 | } | 15 | } |
16 | 16 | ||
17 | 17 | ||
18 | 18 | ||
19 | QString LiquidDecoInterface::name ( ) const | 19 | QString LiquidDecoInterface::name ( ) const |
20 | { | 20 | { |
21 | return qApp-> translate ( "Decoration", "Liquid" ); | 21 | return qApp-> translate ( "Decoration", "Liquid" ); |
@@ -113,24 +113,26 @@ void LiquidDecoInterface::drawArea( Area a, QPainter *p, const WindowData *wd ) | |||
113 | } | 113 | } |
114 | } | 114 | } |
115 | } | 115 | } |
116 | 116 | ||
117 | QRESULT LiquidDecoInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) | 117 | QRESULT LiquidDecoInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) |
118 | { | 118 | { |
119 | *iface = 0; | 119 | *iface = 0; |
120 | 120 | ||
121 | if ( uuid == IID_QUnknown ) | 121 | if ( uuid == IID_QUnknown ) |
122 | *iface = this; | 122 | *iface = this; |
123 | else if ( uuid == IID_WindowDecoration ) | 123 | else if ( uuid == IID_WindowDecoration ) |
124 | *iface = this; | 124 | *iface = this; |
125 | else | ||
126 | return QS_FALSE; | ||
125 | 127 | ||
126 | if ( *iface ) | 128 | if ( *iface ) |
127 | (*iface)-> addRef ( ); | 129 | (*iface)-> addRef ( ); |
128 | 130 | ||
129 | return QS_OK; | 131 | return QS_OK; |
130 | } | 132 | } |
131 | 133 | ||
132 | Q_EXPORT_INTERFACE() | 134 | Q_EXPORT_INTERFACE() |
133 | { | 135 | { |
134 | Q_CREATE_INSTANCE( LiquidDecoInterface ) | 136 | Q_CREATE_INSTANCE( LiquidDecoInterface ) |
135 | } | 137 | } |
136 | 138 | ||
diff --git a/noncore/decorations/liquid/liquid.h b/noncore/decorations/liquid/liquid.h index ec55132..bbe433e 100644 --- a/noncore/decorations/liquid/liquid.h +++ b/noncore/decorations/liquid/liquid.h | |||
@@ -9,17 +9,15 @@ class LiquidDecoInterface : public WindowDecorationInterface { | |||
9 | public: | 9 | public: |
10 | LiquidDecoInterface ( ); | 10 | LiquidDecoInterface ( ); |
11 | virtual ~LiquidDecoInterface ( ); | 11 | virtual ~LiquidDecoInterface ( ); |
12 | 12 | ||
13 | QRESULT queryInterface ( const QUuid &, QUnknownInterface ** ); | 13 | QRESULT queryInterface ( const QUuid &, QUnknownInterface ** ); |
14 | Q_REFCOUNT | 14 | Q_REFCOUNT |
15 | 15 | ||
16 | virtual void drawArea( Area a, QPainter *, const WindowData * ) const; | 16 | virtual void drawArea( Area a, QPainter *, const WindowData * ) const; |
17 | 17 | ||
18 | virtual QString name ( ) const; | 18 | virtual QString name ( ) const; |
19 | virtual QPixmap icon ( ) const; | 19 | virtual QPixmap icon ( ) const; |
20 | 20 | ||
21 | private: | ||
22 | ulong ref; | ||
23 | }; | 21 | }; |
24 | 22 | ||
25 | #endif | 23 | #endif |
diff --git a/noncore/decorations/polished/polished.cpp b/noncore/decorations/polished/polished.cpp index 30f1a84..43179be 100644 --- a/noncore/decorations/polished/polished.cpp +++ b/noncore/decorations/polished/polished.cpp | |||
@@ -13,25 +13,25 @@ | |||
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "polished.h" | 21 | #include "polished.h" |
22 | #include <qpainter.h> | 22 | #include <qpainter.h> |
23 | #include <qapplication.h> | 23 | #include <qapplication.h> |
24 | 24 | ||
25 | PolishedDecoration::PolishedDecoration() : ref(0) | 25 | PolishedDecoration::PolishedDecoration() |
26 | { | 26 | { |
27 | } | 27 | } |
28 | 28 | ||
29 | PolishedDecoration::~PolishedDecoration() | 29 | PolishedDecoration::~PolishedDecoration() |
30 | { | 30 | { |
31 | } | 31 | } |
32 | 32 | ||
33 | int PolishedDecoration::metric( Metric m, const WindowData *wd ) const | 33 | int PolishedDecoration::metric( Metric m, const WindowData *wd ) const |
34 | { | 34 | { |
35 | switch ( m ) { | 35 | switch ( m ) { |
36 | case TopBorder: | 36 | case TopBorder: |
37 | return 1; | 37 | return 1; |
@@ -149,23 +149,25 @@ void PolishedDecoration::drawBlend( QPainter *p, const QRect &r, const QColor &c | |||
149 | v1 + ((v2-v1)*j)/(r.height()-split-1), QColor::Hsv ) ); | 149 | v1 + ((v2-v1)*j)/(r.height()-split-1), QColor::Hsv ) ); |
150 | p->drawLine( r.x(), r.bottom()-j, r.right(), r.bottom()-j ); | 150 | p->drawLine( r.x(), r.bottom()-j, r.right(), r.bottom()-j ); |
151 | } | 151 | } |
152 | } | 152 | } |
153 | 153 | ||
154 | QRESULT PolishedDecoration::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) | 154 | QRESULT PolishedDecoration::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) |
155 | { | 155 | { |
156 | *iface = 0; | 156 | *iface = 0; |
157 | if ( uuid == IID_QUnknown ) | 157 | if ( uuid == IID_QUnknown ) |
158 | *iface = this; | 158 | *iface = this; |
159 | else if ( uuid == IID_WindowDecoration ) | 159 | else if ( uuid == IID_WindowDecoration ) |
160 | *iface = this; | 160 | *iface = this; |
161 | else | ||
162 | return QS_FALSE; | ||
161 | 163 | ||
162 | if ( *iface ) | 164 | if ( *iface ) |
163 | (*iface)->addRef(); | 165 | (*iface)->addRef(); |
164 | return QS_OK; | 166 | return QS_OK; |
165 | } | 167 | } |
166 | 168 | ||
167 | Q_EXPORT_INTERFACE() | 169 | Q_EXPORT_INTERFACE() |
168 | { | 170 | { |
169 | Q_CREATE_INSTANCE( PolishedDecoration ) | 171 | Q_CREATE_INSTANCE( PolishedDecoration ) |
170 | } | 172 | } |
171 | 173 | ||
diff --git a/noncore/decorations/polished/polished.h b/noncore/decorations/polished/polished.h index e5c19c0..d661427 100644 --- a/noncore/decorations/polished/polished.h +++ b/noncore/decorations/polished/polished.h | |||
@@ -33,17 +33,15 @@ public: | |||
33 | virtual void drawArea( Area a, QPainter *, const WindowData * ) const; | 33 | virtual void drawArea( Area a, QPainter *, const WindowData * ) const; |
34 | virtual void drawButton( Button b, QPainter *, const WindowData *, int x, int y, int w, int h, QWSButton::State ) const; | 34 | virtual void drawButton( Button b, QPainter *, const WindowData *, int x, int y, int w, int h, QWSButton::State ) const; |
35 | virtual QRegion mask( const WindowData * ) const; | 35 | virtual QRegion mask( const WindowData * ) const; |
36 | virtual QString name() const; | 36 | virtual QString name() const; |
37 | virtual QPixmap icon() const; | 37 | virtual QPixmap icon() const; |
38 | 38 | ||
39 | QRESULT queryInterface( const QUuid&, QUnknownInterface** ); | 39 | QRESULT queryInterface( const QUuid&, QUnknownInterface** ); |
40 | Q_REFCOUNT | 40 | Q_REFCOUNT |
41 | 41 | ||
42 | protected: | 42 | protected: |
43 | void PolishedDecoration::drawBlend( QPainter *, const QRect &r, const QColor &c1, const QColor&c2 ) const; | 43 | void PolishedDecoration::drawBlend( QPainter *, const QRect &r, const QColor &c1, const QColor&c2 ) const; |
44 | 44 | ||
45 | private: | ||
46 | ulong ref; | ||
47 | }; | 45 | }; |
48 | 46 | ||
49 | #endif | 47 | #endif |