add more spacing
[personal-kdebase.git] / workspace / kwin / clients / kwmtheme / kwmthemeclient.h
blob69e6d3844b4ecfc63f9d36a79db70e525eaf457c
1 /********************************************************************
2 This program is free software; you can redistribute it and/or modify
3 it under the terms of the GNU General Public License as published by
4 the Free Software Foundation; either version 2 of the License, or
5 (at your option) any later version.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU General Public License for more details.
12 You should have received a copy of the GNU General Public License
13 along with this program. If not, see <http://www.gnu.org/licenses/>.
14 *********************************************************************/
16 #ifndef __KWMTHEMECLIENT_H
17 #define __KWMTHEMECLIENT_H
19 #include <qbutton.h>
20 #include <QToolButton>
21 #include <QPixmap>
22 #include <kdecoration.h>
23 #include <kdecorationfactory.h>
25 class QSpacerItem;
26 class QGridLayout;
28 namespace KWMTheme {
30 class MyButton : public QToolButton
32 public:
33 explicit MyButton(QWidget *parent=0, const char *name=0)
34 : QToolButton(parent, name){setAutoRaise(true);setCursor( arrowCursor ); }
35 protected:
36 void drawButtonLabel(QPainter *p);
39 class KWMThemeClient : public KDecoration
41 Q_OBJECT
42 public:
43 KWMThemeClient( KDecorationBridge* b, KDecorationFactory* f );
44 ~KWMThemeClient(){;}
45 void init();
46 void resize( const QSize& s );
47 QSize minimumSize() const;
48 void borders( int& left, int& right, int& top, int& bottom ) const;
49 protected:
50 void doShape();
51 void drawTitle(QPainter &p);
52 void resizeEvent( QResizeEvent* );
53 void paintEvent( QPaintEvent* );
54 void showEvent( QShowEvent* );
55 void mouseDoubleClickEvent( QMouseEvent * );
56 bool eventFilter( QObject* o, QEvent* e );
57 void captionChange();
58 void desktopChange();
59 void maximizeChange();
60 void iconChange();
61 void activeChange();
62 void shadeChange() {};
63 Position mousePosition(const QPoint &) const;
64 protected slots:
65 //void slotReset();
66 void menuButtonPressed();
67 void slotMaximize();
68 private:
69 QPixmap buffer;
70 KPixmap *aGradient, *iGradient;
71 MyButton *maxBtn, *stickyBtn, *mnuBtn;
72 QSpacerItem *titlebar;
73 QGridLayout* layout;
76 class KWMThemeFactory : public KDecorationFactory
78 public:
79 KWMThemeFactory();
80 ~KWMThemeFactory();
81 KDecoration* createDecoration( KDecorationBridge* b );
82 bool reset( unsigned long mask );
87 #endif