1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
/* SuSE KWin window decoration
Copyright (C) 2005 Gerd Fleischer <gerdfleischer@web.de>
Copyright (C) 2003 Sandro Giessl <ceebx@users.sourceforge.net>
based on the window decoration "Web":
Copyright (C) 2001 Rik Hemsley (rikkus) <rik@kde.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
Boston, MA 02110-1301 USA.
*/
#ifndef SUSE2_H
#define SUSE2_H
#include <qfont.h>
#include <kdecoration.h>
#include <kdecorationfactory.h>
namespace KWinSUSE2 {
enum ButtonStatus {
ActiveUp = 0,
ActiveDown,
InactiveUp,
InactiveDown,
Shadow,
NumButtonStatus
};
enum ButtonIcon {
CloseIcon = 0,
MaxIcon,
MaxRestoreIcon,
MinIcon,
HelpIcon,
OnAllDesktopsIcon,
NotOnAllDesktopsIcon,
KeepAboveIcon,
NoKeepAboveIcon,
KeepBelowIcon,
NoKeepBelowIcon,
ShadeIcon,
UnShadeIcon,
NumButtonIcons
};
enum ColorType {
WindowContour = 0,
TitleGradientFrom,
TitleGradientTo,
Border,
TitleFont,
BtnBg
};
class SUSE2Handler: public QObject, public KDecorationFactory
{
Q_OBJECT
public:
SUSE2Handler();
~SUSE2Handler();
virtual bool reset( unsigned long changed );
virtual KDecoration *createDecoration( KDecorationBridge * );
virtual bool supports( Ability ability ) const;
const KPixmap &buttonPixmap(ButtonIcon type, int size, ButtonStatus status);
int titleHeight() const { return m_titleHeight; }
int titleHeightTool() const { return m_titleHeightTool; }
QFont titleFont() const { return m_titleFont; }
QFont titleFontTool() const { return m_titleFontTool; }
bool titleLogo() const { return m_titleLogo; }
int titleLogoOffset() const { return m_titleLogoOffset; }
QString titleLogoURL() const { return m_titleLogoURL; }
bool titleShadow() const { return m_titleShadow; }
int borderSize() const { return m_borderSize; }
int titlebarStyle() const { return m_titlebarStyle; }
int buttonType() const { return m_buttonType; }
bool customColors() const { return m_customColors; }
bool useTitleProps() const { return m_useTitleProps; }
bool animateButtons() const { return m_animateButtons; }
bool redCloseButton() const { return m_redCloseButton; }
float iconSize() const { return m_iconSize; }
bool iconShadow() const { return m_iconShadow; }
bool menuClose() const { return m_menuClose; }
Qt::AlignmentFlags titleAlign() const { return m_titleAlign; }
int roundCorners() const { return m_roundCorners; }
bool reverseLayout() const { return m_reverse; }
QColor getColor(KWinSUSE2::ColorType type, const bool active = true) const;
QValueList< SUSE2Handler::BorderSize > borderSizes() const;
private:
void readConfig();
bool m_titleLogo;
bool m_titleShadow;
bool m_shrinkBorders;
int m_buttonType;
bool m_customColors;
float m_iconSize;
int m_titlebarStyle;
bool m_customIconColors;
QColor m_aFgColor;
QColor m_aBgColor;
QColor m_iFgColor;
QColor m_iBgColor;
bool m_iconShadow;
bool m_animateButtons;
bool m_redCloseButton;
bool m_menuClose;
bool m_reverse;
int m_borderSize;
int m_titleHeight;
int m_titleHeightTool;
QFont m_titleFont;
QFont m_titleFontTool;
Qt::AlignmentFlags m_titleAlign;
int m_roundCorners;
int m_titleLogoOffset;
QString m_titleLogoURL;
bool m_useTitleProps;
KPixmap *m_pixmaps[NumButtonStatus][NumButtonIcons];
};
SUSE2Handler* Handler();
} // KWinSUSE2
#endif
// kate: space-indent on; indent-width 4; replace-tabs on;
|