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

« back to all changes in this revision

Viewing changes to kwin/clients/redmond/redmond.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
/*
 
2
 *
 
3
 * Redmond KWin client
 
4
 *
 
5
 * Copyright 2001-2003
 
6
 *   Ported to kwin_iii by Chris Lee <clee@kde.org>
 
7
 *   Karol Szwed <gallium@kde.org>
 
8
 *   http://gallium.n3.net/
 
9
 *
 
10
 * Based on the default KWin client.
 
11
 *
 
12
 * Updated to support the new API 9/2003 (CL)
 
13
 * Updated to emulate More Accurately 9/2003 (CL)
 
14
 * Updated to support toolwindows 3/2001 (KS)
 
15
 *
 
16
 */
 
17
 
 
18
#ifndef __KDE_REDMOND_H
 
19
#define __KDE_REDMOND_H
 
20
 
 
21
#include <QBitmap>
 
22
#include <kcommondecoration.h>
 
23
#include <kdecorationfactory.h>
 
24
 
 
25
namespace Redmond {
 
26
 
 
27
class RedmondDeco;
 
28
 
 
29
class RedmondButton : public KCommonDecorationButton
 
30
{
 
31
        Q_OBJECT
 
32
public:
 
33
        RedmondButton(ButtonType type, RedmondDeco *parent);
 
34
        void setBitmap(const unsigned char *bitmap);
 
35
        void setPixmap(const QPixmap &p);
 
36
        void reset(unsigned long changed);
 
37
 
 
38
protected:
 
39
        void paintEvent(QPaintEvent *);
 
40
        virtual void drawButton(QPainter *p);
 
41
        void drawButtonLabel(QPainter *){;}
 
42
 
 
43
        QBitmap  deco;
 
44
        QPixmap  pix;
 
45
        bool     miniBtn;
 
46
};
 
47
 
 
48
 
 
49
class RedmondDeco : public KCommonDecoration
 
50
{
 
51
public:
 
52
        RedmondDeco(KDecorationBridge *, KDecorationFactory *);
 
53
        ~RedmondDeco() {;}
 
54
 
 
55
        virtual QString visibleName() const;
 
56
        virtual QString defaultButtonsLeft() const;
 
57
        virtual QString defaultButtonsRight() const;
 
58
        virtual bool decorationBehaviour(DecorationBehaviour behaviour) const;
 
59
        virtual int layoutMetric(LayoutMetric lm, bool respectWindowState = true, const KCommonDecorationButton * = 0) const;
 
60
        virtual KCommonDecorationButton *createButton(ButtonType type);
 
61
 
 
62
        void init();
 
63
 
 
64
protected:
 
65
    virtual void reset( unsigned long changed );
 
66
 
 
67
        void paintEvent(QPaintEvent*);
 
68
 
 
69
private:
 
70
        int            titleHeight;
 
71
};
 
72
 
 
73
class RedmondDecoFactory : public QObject, public KDecorationFactory
 
74
{
 
75
   Q_OBJECT
 
76
public:
 
77
        RedmondDecoFactory();
 
78
        virtual ~RedmondDecoFactory();
 
79
        virtual KDecoration *createDecoration(KDecorationBridge *);
 
80
        virtual bool reset(unsigned long);
 
81
        virtual bool supports( Ability ability );
 
82
        virtual QList< BorderSize > borderSizes() const;
 
83
private:
 
84
        void readConfig();
 
85
};
 
86
 
 
87
}
 
88
 
 
89
#endif
 
90
// vim: ts=4
 
91
// kate: space-indent off; tab-width 4;