delay a few things on startup, such as setting the visibility mode, which ensures...
[personal-kdebase.git] / runtime / kstyles / oxygen / helper.h
blobb5ae0fe29064981fabc35b6dd585b5c13a83fd4f
1 /*
2 * Copyright 2008 Long Huynh Huu <long.upcase@googlemail.com>
3 * Copyright 2007 Matthew Woehlke <mw_triad@users.sourceforge.net>
4 * Copyright 2007 Casper Boemann <cbr@boemann.dk>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License version 2 as published by the Free Software Foundation.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
21 #ifndef __OXYGEN_STYLE_HELPER_H
22 #define __OXYGEN_STYLE_HELPER_H
24 #include "lib/helper.h"
25 #include "tileset.h"
27 class SlabCache {
28 public:
29 SlabCache() {}
30 ~SlabCache() {}
32 QCache<quint64, QPixmap> m_roundSlabCache;
33 QCache<quint64, TileSet> m_slabCache;
36 class OxygenStyleHelper : public OxygenHelper
38 public:
39 explicit OxygenStyleHelper(const QByteArray &componentName);
40 virtual ~OxygenStyleHelper() {}
42 virtual void invalidateCaches();
44 QColor calcMidColor(const QColor &color) const;
46 static void fillSlab(QPainter&, const QRect&, int size = 7);
47 static void fillHole(QPainter&, const QRect&, int size = 7);
49 QPixmap roundSlab(const QColor&, double shade, int size = 7);
50 QPixmap roundSlabFocused(const QColor&, const QColor &glowColor, double shade, int size = 7);
52 // TODO - need to rebase scrollbars to size=7
53 TileSet *slab(const QColor&, double shade, int size = 7);
54 TileSet *slabFocused(const QColor&, const QColor &glowColor, double shade, int size = 7);
55 TileSet *slabSunken(const QColor&, double shade, int size = 7);
56 TileSet *slabInverted(const QColor&, double shade, int size = 7);
58 TileSet *slope(const QColor&, double shade, int size = 7);
60 TileSet *hole(const QColor&, double shade, int size = 7);
61 TileSet *holeFlat(const QColor&, double shade, int size = 7);
62 TileSet *holeFocused(const QColor&, const QColor &glowColor, double shade, int size = 7);
64 TileSet *groove(const QColor&, double shade, int size = 7);
66 TileSet *slitFocused(const QColor&);
68 TileSet *dockFrame(const QColor&, int size);
69 TileSet *scrollHole(const QColor&, Qt::Orientation orientation);
71 protected:
72 SlabCache* slabCache(const QColor&);
74 void drawInverseShadow(QPainter&, const QColor&, int pad, int size, double fuzz) const;
75 void drawInverseGlow(QPainter&, const QColor&, int pad, int size, int rsize) const;
76 void drawHole(QPainter&, const QColor&, double shade, int r = 7) const;
77 void drawSlab(QPainter&, const QColor&, double shade) const;
79 static const double _slabThickness;
81 QCache<quint64, SlabCache> m_slabCache;
82 QCache<quint64, TileSet> m_slabSunkenCache;
83 QCache<quint64, TileSet> m_slabInvertedCache;
84 QCache<quint64, TileSet> m_holeCache;
85 QCache<quint64, TileSet> m_holeFlatCache;
86 QCache<quint64, TileSet> m_slopeCache;
87 QCache<quint64, TileSet> m_grooveCache;
88 QCache<quint64, TileSet> m_slitCache;
89 QCache<quint64, TileSet> m_dockFrameCache;
90 QCache<quint64, TileSet> m_scrollHoleCache;
93 #endif // __OXYGEN_STYLE_HELPER_H