not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / kwin / clients / kde2 / kde2.h
blob46872a65a674e260ae3d0931fd5363aa435f0d4c
1 /*********************************************************************
3 KDE2 Default KWin client
5 Copyright (C) 1999, 2001 Daniel Duley <mosfet@kde.org>
6 Matthias Ettrich <ettrich@kde.org>
7 Karol Szwed <gallium@kde.org>
9 Draws mini titlebars for tool windows.
10 Many features are now customizable.
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program. If not, see <http://www.gnu.org/licenses/>.
24 *********************************************************************/
26 #ifndef KDE2_H
27 #define KDE2_H
29 #include <QBitmap>
30 #include <QDateTime>
31 #include <kcommondecoration.h>
32 #include <kdecorationfactory.h>
34 class QPixmap;
36 namespace KDE2 {
38 class KDE2Client;
40 class KDE2Handler: public KDecorationFactory
42 public:
43 KDE2Handler();
44 ~KDE2Handler();
45 KDecoration* createDecoration( KDecorationBridge* b );
46 bool reset( unsigned long changed );
47 virtual QList< BorderSize > borderSizes() const;
48 virtual bool supports( Ability ability ) const;
50 private:
51 unsigned long readConfig( bool update );
52 void createPixmaps();
53 void freePixmaps();
54 void drawButtonBackground(QPixmap *pix,
55 const QPalette &g, bool sunken);
59 class KDE2Button : public KCommonDecorationButton
61 public:
62 KDE2Button(ButtonType type, KDE2Client *parent, const char *name);
63 ~KDE2Button();
65 void reset(unsigned long changed);
67 void setBitmap(const unsigned char *bitmap);
69 protected:
70 void enterEvent(QEvent *);
71 void leaveEvent(QEvent *);
72 void paintEvent(QPaintEvent *);
73 void drawButton(QPainter *p);
74 void drawButtonLabel(QPainter*) {;}
76 QBitmap* deco;
77 bool large;
78 bool isMouseOver;
82 class KDE2Client : public KCommonDecoration
84 public:
85 KDE2Client( KDecorationBridge* b, KDecorationFactory* f );
86 ~KDE2Client() {;}
88 virtual QString visibleName() const;
89 virtual bool decorationBehaviour(DecorationBehaviour behaviour) const;
90 virtual int layoutMetric(LayoutMetric lm, bool respectWindowState = true, const KCommonDecorationButton * = 0) const;
91 virtual KCommonDecorationButton *createButton(ButtonType type);
93 virtual QRegion cornerShape(WindowCorner corner);
95 void init();
96 void reset( unsigned long changed );
98 protected:
99 void paintEvent( QPaintEvent* );
101 private:
102 bool mustDrawHandle() const;
103 int titleHeight;
108 #endif
109 // vim: ts=4
110 // kate: space-indent off; tab-width 4;