2001-07-16 06:53:11 +00:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Redmond KWin client
|
|
|
|
*
|
2003-09-17 08:27:26 +00:00
|
|
|
* Copyright 2001-2003
|
|
|
|
* Ported to kwin_iii by Chris Lee <clee@kde.org>
|
2001-07-16 06:53:11 +00:00
|
|
|
* Karol Szwed <gallium@kde.org>
|
|
|
|
* http://gallium.n3.net/
|
|
|
|
*
|
|
|
|
* Based on the default KWin client.
|
|
|
|
*
|
2003-09-17 08:27:26 +00:00
|
|
|
* Updated to support the new API 9/2003 (CL)
|
|
|
|
* Updated to emulate More Accurately 9/2003 (CL)
|
2001-07-16 06:53:11 +00:00
|
|
|
* Updated to support toolwindows 3/2001 (KS)
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __KDE_REDMOND_H
|
|
|
|
#define __KDE_REDMOND_H
|
|
|
|
|
2006-05-13 16:33:18 +00:00
|
|
|
#include <QBitmap>
|
2005-03-25 23:31:21 +00:00
|
|
|
#include <kcommondecoration.h>
|
2003-09-17 08:27:26 +00:00
|
|
|
#include <kdecorationfactory.h>
|
|
|
|
|
2002-08-27 18:08:20 +00:00
|
|
|
namespace Redmond {
|
2001-07-16 06:53:11 +00:00
|
|
|
|
2003-09-17 08:27:26 +00:00
|
|
|
class RedmondDeco;
|
2002-08-27 18:08:20 +00:00
|
|
|
|
2005-03-25 23:31:21 +00:00
|
|
|
class RedmondButton : public KCommonDecorationButton
|
2001-07-16 06:53:11 +00:00
|
|
|
{
|
2003-09-17 08:27:26 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2005-03-25 23:31:21 +00:00
|
|
|
RedmondButton(ButtonType type, RedmondDeco *parent, const char *name);
|
2003-09-17 08:27:26 +00:00
|
|
|
void setBitmap(const unsigned char *bitmap);
|
|
|
|
void setPixmap(const QPixmap &p);
|
2005-03-25 23:31:21 +00:00
|
|
|
void reset(unsigned long changed);
|
2003-09-17 08:27:26 +00:00
|
|
|
|
|
|
|
protected:
|
2005-08-17 09:15:59 +00:00
|
|
|
void paintEvent(QPaintEvent *);
|
2003-09-17 08:27:26 +00:00
|
|
|
virtual void drawButton(QPainter *p);
|
|
|
|
void drawButtonLabel(QPainter *){;}
|
|
|
|
|
|
|
|
QBitmap deco;
|
|
|
|
QPixmap pix;
|
|
|
|
bool miniBtn;
|
2001-07-16 06:53:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2005-03-25 23:31:21 +00:00
|
|
|
class RedmondDeco : public KCommonDecoration
|
2001-07-16 06:53:11 +00:00
|
|
|
{
|
2003-09-17 08:27:26 +00:00
|
|
|
public:
|
|
|
|
RedmondDeco(KDecorationBridge *, KDecorationFactory *);
|
|
|
|
~RedmondDeco() {;}
|
2005-03-25 23:31:21 +00:00
|
|
|
|
|
|
|
virtual QString visibleName() const;
|
|
|
|
virtual QString defaultButtonsLeft() const;
|
|
|
|
virtual QString defaultButtonsRight() const;
|
|
|
|
virtual bool decorationBehaviour(DecorationBehaviour behaviour) const;
|
|
|
|
virtual int layoutMetric(LayoutMetric lm, bool respectWindowState = true, const KCommonDecorationButton * = 0) const;
|
|
|
|
virtual KCommonDecorationButton *createButton(ButtonType type);
|
|
|
|
|
2003-09-17 08:27:26 +00:00
|
|
|
void init();
|
|
|
|
|
|
|
|
protected:
|
2005-03-25 23:31:21 +00:00
|
|
|
virtual void reset( unsigned long changed );
|
|
|
|
|
2003-09-17 08:27:26 +00:00
|
|
|
void paintEvent(QPaintEvent*);
|
|
|
|
|
|
|
|
private:
|
|
|
|
int titleHeight;
|
|
|
|
};
|
|
|
|
|
|
|
|
class RedmondDecoFactory : public QObject, public KDecorationFactory
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
RedmondDecoFactory();
|
|
|
|
virtual ~RedmondDecoFactory();
|
|
|
|
virtual KDecoration *createDecoration(KDecorationBridge *);
|
|
|
|
virtual bool reset(unsigned long);
|
2004-11-05 15:33:09 +00:00
|
|
|
virtual bool supports( Ability ability );
|
2005-07-28 14:59:42 +00:00
|
|
|
virtual QList< BorderSize > borderSizes() const;
|
2003-09-26 12:06:58 +00:00
|
|
|
private:
|
|
|
|
void readConfig();
|
2001-07-16 06:53:11 +00:00
|
|
|
};
|
|
|
|
|
2003-07-26 10:41:28 +00:00
|
|
|
}
|
2001-07-16 06:53:11 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
// vim: ts=4
|
2005-03-25 23:31:21 +00:00
|
|
|
// kate: space-indent off; tab-width 4;
|