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.
24 #include <kcommondecoration.h>
25 #include <kdecorationfactory.h>
27 namespace ModernSystem
{
31 class ModernButton
: public KCommonDecorationButton
34 ModernButton(ButtonType type
, ModernSys
*parent
, const char *name
);
35 void setBitmap(const unsigned char *bitmap
);
36 virtual void reset(unsigned long changed
);
38 void paintEvent(QPaintEvent
*);
39 virtual void drawButton(QPainter
*p
);
40 void drawButtonLabel(QPainter
*){;}
44 class ModernSys
: public KCommonDecoration
47 ModernSys( KDecorationBridge
* b
, KDecorationFactory
* f
);
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();
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 );
72 class ModernSysFactory
: public QObject
, public KDecorationFactory
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;
89 #endif // __MODERNSYS_H