-rw-r--r-- | noncore/decorations/flat/flat.cpp | 4 | ||||
-rw-r--r-- | noncore/decorations/flat/flat.h | 1 |
2 files changed, 3 insertions, 2 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 |