add more spacing
[personal-kdebase.git] / workspace / kwin / clients / plastik / plastik.h
blobae7a46e122805344c329dd45677cc5ed6f602e8c
1 /* Plastik KWin window decoration
2 Copyright (C) 2003-2005 Sandro Giessl <sandro@giessl.com>
4 based on the window decoration "Web":
5 Copyright (C) 2001 Rik Hemsley (rikkus) <rik@kde.org>
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; see the file COPYING. If not, write to
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA.
23 #ifndef PLASTIK_H
24 #define PLASTIK_H
26 #include <QFont>
28 #include <kdecoration.h>
29 #include <kdecorationfactory.h>
31 namespace KWinPlastik {
33 enum ColorType {
34 WindowContour=0,
35 TitleGradient1, // top
36 TitleGradient2,
37 TitleGradient3, // bottom
38 ShadeTitleLight,
39 ShadeTitleDark,
40 Border,
41 TitleFont
44 enum Pixmaps {
45 TitleBarTileTop=0,
46 TitleBarTile,
47 TitleBarLeft,
48 TitleBarRight,
49 BorderLeftTile,
50 BorderRightTile,
51 BorderBottomTile,
52 BorderBottomLeft,
53 BorderBottomRight,
54 NumPixmaps
57 enum ButtonIcon {
58 CloseIcon = 0,
59 MaxIcon,
60 MaxRestoreIcon,
61 MinIcon,
62 HelpIcon,
63 OnAllDesktopsIcon,
64 NotOnAllDesktopsIcon,
65 KeepAboveIcon,
66 NoKeepAboveIcon,
67 KeepBelowIcon,
68 NoKeepBelowIcon,
69 ShadeIcon,
70 UnShadeIcon,
71 NumButtonIcons
74 class PlastikHandler: public QObject, public KDecorationFactory
76 Q_OBJECT
77 public:
78 PlastikHandler();
79 ~PlastikHandler();
80 virtual bool reset( unsigned long changed );
82 virtual KDecoration* createDecoration( KDecorationBridge* );
83 virtual bool supports( Ability ability ) const;
85 const QPixmap &pixmap(Pixmaps type, bool active, bool toolWindow);
86 const QBitmap &buttonBitmap(ButtonIcon type, const QSize &size, bool toolWindow);
88 int titleHeight() const { return m_titleHeight; }
89 int titleHeightTool() const { return m_titleHeightTool; }
90 const QFont &titleFont() { return m_titleFont; }
91 const QFont &titleFontTool() { return m_titleFontTool; }
92 bool titleShadow() const { return m_titleShadow; }
93 int borderSize() const { return m_borderSize; }
94 bool animateButtons() const { return m_animateButtons; }
95 bool menuClose() const { return m_menuClose; }
96 Qt::AlignmentFlag titleAlign() const { return m_titleAlign; }
97 bool reverseLayout() const { return m_reverse; }
98 QColor getColor(KWinPlastik::ColorType type, const bool active = true);
100 QList< PlastikHandler::BorderSize > borderSizes() const;
101 private:
102 void readConfig();
104 bool m_coloredBorder;
105 bool m_titleShadow;
106 bool m_animateButtons;
107 bool m_menuClose;
108 bool m_reverse;
109 int m_borderSize;
110 int m_titleHeight;
111 int m_titleHeightTool;
112 QFont m_titleFont;
113 QFont m_titleFontTool;
114 Qt::AlignmentFlag m_titleAlign;
116 // pixmap cache
117 QPixmap *m_pixmaps[2][2][NumPixmaps]; // button pixmaps have normal+pressed state...
118 QBitmap *m_bitmaps[2][NumButtonIcons];
121 PlastikHandler* Handler();
123 } // KWinPlastik
125 #endif // PLASTIK_H