~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to kwin/clients/plastik/plastik.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Plastik KWin window decoration
 
2
  Copyright (C) 2003-2005 Sandro Giessl <sandro@giessl.com>
 
3
 
 
4
  based on the window decoration "Web":
 
5
  Copyright (C) 2001 Rik Hemsley (rikkus) <rik@kde.org>
 
6
 
 
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.
 
11
 
 
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.
 
16
 
 
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.
 
21
 */
 
22
 
 
23
#ifndef PLASTIK_H
 
24
#define PLASTIK_H
 
25
 
 
26
#include <QFont>
 
27
 
 
28
#include <kdecoration.h>
 
29
#include <kdecorationfactory.h>
 
30
 
 
31
namespace KWinPlastik {
 
32
 
 
33
enum ColorType {
 
34
    WindowContour=0,
 
35
    TitleGradient1, // top
 
36
    TitleGradient2,
 
37
    TitleGradient3, // bottom
 
38
    ShadeTitleLight,
 
39
    ShadeTitleDark,
 
40
    Border,
 
41
    TitleFont
 
42
};
 
43
 
 
44
enum Pixmaps {
 
45
    TitleBarTileTop=0,
 
46
    TitleBarTile,
 
47
    TitleBarLeft,
 
48
    TitleBarRight,
 
49
    BorderLeftTile,
 
50
    BorderRightTile,
 
51
    BorderBottomTile,
 
52
    BorderBottomLeft,
 
53
    BorderBottomRight,
 
54
    NumPixmaps
 
55
};
 
56
 
 
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
 
72
};
 
73
 
 
74
class PlastikHandler: public QObject, public KDecorationFactory
 
75
{
 
76
    Q_OBJECT
 
77
public:
 
78
    PlastikHandler();
 
79
    ~PlastikHandler();
 
80
    virtual bool reset( unsigned long changed );
 
81
 
 
82
    virtual KDecoration* createDecoration( KDecorationBridge* );
 
83
    virtual bool supports( Ability ability ) const;
 
84
 
 
85
    const QPixmap &pixmap(Pixmaps type, bool active, bool toolWindow);
 
86
    const QBitmap &buttonBitmap(ButtonIcon type, const QSize &size, bool toolWindow);
 
87
 
 
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);
 
99
 
 
100
    QList< PlastikHandler::BorderSize >  borderSizes() const;
 
101
private:
 
102
    void readConfig();
 
103
 
 
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;
 
115
 
 
116
    // pixmap cache
 
117
    QPixmap *m_pixmaps[2][2][NumPixmaps]; // button pixmaps have normal+pressed state...
 
118
    QBitmap *m_bitmaps[2][NumButtonIcons];
 
119
};
 
120
 
 
121
PlastikHandler* Handler();
 
122
 
 
123
} // KWinPlastik
 
124
 
 
125
#endif // PLASTIK_H