not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / kwin / clients / quartz / quartz.h
blob2e113749d286b62d6aa95f801baf5734489c662b
1 /********************************************************************
2 Gallium-Quartz KWin client
4 Copyright (C) 2005 Sandro Giessl <sandro@giessl.com>
5 Copyright 2001
6 Karol Szwed <gallium@kde.org>
7 http://gallium.n3.net/
9 Based on the KDE default client.
11 Includes mini titlebars for ToolWindow Support.
12 Button positions are now customizable.
14 This program is free software; you can redistribute it and/or modify
15 it under the terms of the GNU General Public License as published by
16 the Free Software Foundation; either version 2 of the License, or
17 (at your option) any later version.
19 This program is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU General Public License for more details.
24 You should have received a copy of the GNU General Public License
25 along with this program. If not, see <http://www.gnu.org/licenses/>.
26 *********************************************************************/
28 #ifndef __KDEGALLIUM_QUARTZ_H
29 #define __KDEGALLIUM_QUARTZ_H
31 #include <QBitmap>
32 #include "../../lib/kcommondecoration.h"
33 #include "../../lib/kdecorationfactory.h"
36 namespace Quartz {
38 class QuartzClient;
40 class QuartzHandler: public QObject, public KDecorationFactory
42 Q_OBJECT
43 public:
44 QuartzHandler();
45 ~QuartzHandler();
47 virtual KDecoration* createDecoration( KDecorationBridge* );
48 virtual bool reset(unsigned long changed);
49 virtual bool supports( Ability ability ) const;
50 virtual QList< BorderSize > borderSizes() const;
52 private:
53 void readConfig();
54 void createPixmaps();
55 void freePixmaps();
56 void drawBlocks(QPixmap* pi, QPixmap &p, const QColor &c1, const QColor &c2);
60 class QuartzButton : public KCommonDecorationButton
62 public:
63 QuartzButton(ButtonType type, QuartzClient *parent, const char *name);
64 ~QuartzButton();
65 void setBitmap(const unsigned char *bitmap);
67 void reset(unsigned long changed);
69 protected:
70 void paintEvent(QPaintEvent *);
71 void drawButton(QPainter *p);
73 QBitmap* deco;
77 class QuartzClient : public KCommonDecoration
79 public:
80 QuartzClient(KDecorationBridge* bridge, KDecorationFactory* factory);
81 ~QuartzClient() {;}
83 virtual QString visibleName() const;
84 virtual QString defaultButtonsLeft() const;
85 virtual QString defaultButtonsRight() const;
86 virtual bool decorationBehaviour(DecorationBehaviour behaviour) const;
87 virtual int layoutMetric(LayoutMetric lm, bool respectWindowState = true, const KCommonDecorationButton * = 0) const;
88 virtual KCommonDecorationButton *createButton(ButtonType type);
90 virtual void init();
92 protected:
93 virtual void reset( unsigned long changed );
94 void paintEvent( QPaintEvent* );
96 private:
97 int titleHeight, borderSize;
98 bool largeButtons;
103 #endif
104 // vim: ts=4
105 // kate: space-indent off; tab-width 4;