~ubuntu-branches/ubuntu/gutsy/kdebase-workspace/gutsy-backports

« back to all changes in this revision

Viewing changes to kwin/clients/kwmtheme/kwmthemeclient.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2007-09-05 20:45:14 UTC
  • Revision ID: james.westby@ubuntu.com-20070905204514-632hhspl0nvrc84i
Tags: upstream-3.93.0
ImportĀ upstreamĀ versionĀ 3.93.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __KWMTHEMECLIENT_H
 
2
#define __KWMTHEMECLIENT_H
 
3
 
 
4
#include <qbutton.h>
 
5
#include <QToolButton>
 
6
#include <QPixmap>
 
7
#include <kdecoration.h>
 
8
#include <kdecorationfactory.h>
 
9
 
 
10
class QSpacerItem;
 
11
class QGridLayout;
 
12
 
 
13
namespace KWMTheme {
 
14
 
 
15
class MyButton : public QToolButton
 
16
{
 
17
public:
 
18
    MyButton(QWidget *parent=0, const char *name=0)
 
19
        : QToolButton(parent, name){setAutoRaise(true);setCursor( arrowCursor ); }
 
20
protected:
 
21
    void drawButtonLabel(QPainter *p);
 
22
};
 
23
 
 
24
class KWMThemeClient : public KDecoration
 
25
{
 
26
    Q_OBJECT
 
27
public:
 
28
    KWMThemeClient( KDecorationBridge* b, KDecorationFactory* f );
 
29
    ~KWMThemeClient(){;}
 
30
    void init();
 
31
    void resize( const QSize& s );
 
32
    QSize minimumSize() const;
 
33
    void borders( int& left, int& right, int& top, int& bottom ) const;
 
34
protected:
 
35
    void doShape();
 
36
    void drawTitle(QPainter &p);
 
37
    void resizeEvent( QResizeEvent* );
 
38
    void paintEvent( QPaintEvent* );
 
39
    void showEvent( QShowEvent* );
 
40
    void mouseDoubleClickEvent( QMouseEvent * );
 
41
    bool eventFilter( QObject* o, QEvent* e );
 
42
    void captionChange();
 
43
    void desktopChange();
 
44
    void maximizeChange();
 
45
    void iconChange();
 
46
    void activeChange();
 
47
    void shadeChange() {};
 
48
    Position mousePosition(const QPoint &) const;
 
49
protected slots:
 
50
    //void slotReset();
 
51
    void menuButtonPressed();
 
52
    void slotMaximize();
 
53
private:
 
54
    QPixmap buffer;
 
55
    KPixmap *aGradient, *iGradient;
 
56
    MyButton *maxBtn, *stickyBtn, *mnuBtn;
 
57
    QSpacerItem *titlebar;
 
58
    QGridLayout* layout;
 
59
};
 
60
 
 
61
class KWMThemeFactory : public KDecorationFactory
 
62
{
 
63
public:
 
64
    KWMThemeFactory();
 
65
    ~KWMThemeFactory();
 
66
    KDecoration* createDecoration( KDecorationBridge* b );
 
67
    bool reset( unsigned long mask );
 
68
};
 
69
 
 
70
}
 
71
 
 
72
#endif
 
73