Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / workspace / kwin / clients / modernsystem / modernsys.h
blob1a68e4de46905d2790d752165d636fe2a1edc546
1 /*
2 Copyright (C) 1999 Daniel M. Duley <mosfet@kde.org>
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; see the file COPYING. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #ifndef __MODERNSYS_H
21 #define __MODERNSYS_H
23 #include <QBitmap>
24 #include <kcommondecoration.h>
25 #include <kdecorationfactory.h>
27 namespace ModernSystem {
29 class ModernSys;
31 class ModernButton : public KCommonDecorationButton
33 public:
34 ModernButton(ButtonType type, ModernSys *parent, const char *name);
35 void setBitmap(const unsigned char *bitmap);
36 virtual void reset(unsigned long changed);
37 protected:
38 void paintEvent(QPaintEvent *);
39 virtual void drawButton(QPainter *p);
40 void drawButtonLabel(QPainter *){;}
41 QBitmap deco;
44 class ModernSys : public KCommonDecoration
46 public:
47 ModernSys( KDecorationBridge* b, KDecorationFactory* f );
48 ~ModernSys(){;}
50 virtual QString visibleName() const;
51 virtual QString defaultButtonsLeft() const;
52 virtual QString defaultButtonsRight() const;
53 virtual bool decorationBehaviour(DecorationBehaviour behaviour) const;
54 virtual int layoutMetric(LayoutMetric lm, bool respectWindowState = true, const KCommonDecorationButton * = 0) const;
55 virtual KCommonDecorationButton *createButton(ButtonType type);
57 virtual void updateWindowShape();
58 virtual void updateCaption();
60 void init();
61 protected:
62 void drawRoundFrame(QPainter &p, int x, int y, int w, int h);
63 void paintEvent( QPaintEvent* );
64 void recalcTitleBuffer();
65 void reset( unsigned long );
66 private:
67 QPixmap titleBuffer;
68 QString oldTitle;
69 bool reverse;
72 class ModernSysFactory : public QObject, public KDecorationFactory
74 Q_OBJECT
76 public:
77 ModernSysFactory();
78 virtual ~ModernSysFactory();
79 virtual KDecoration* createDecoration( KDecorationBridge* );
80 virtual bool reset( unsigned long changed );
81 virtual bool supports( Ability ability ) const;
82 QList< BorderSize > borderSizes() const;
83 private:
84 void read_config();
89 #endif // __MODERNSYS_H