2001-06-07 11:35:06 +00:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* KDE2 Default KWin client
|
|
|
|
*
|
|
|
|
* Copyright (C) 1999, 2001 Daniel Duley <mosfet@kde.org>
|
|
|
|
* Matthias Ettrich <ettrich@kde.org>
|
|
|
|
* Karol Szwed <gallium@kde.org>
|
|
|
|
*
|
|
|
|
* Draws mini titlebars for tool windows.
|
|
|
|
* Many features are now customizable.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _KDE_DEFAULT_H
|
|
|
|
#define _KDE_DEFAULT_H
|
|
|
|
|
2006-05-13 16:33:18 +00:00
|
|
|
#include <QBitmap>
|
2006-05-11 08:04:23 +00:00
|
|
|
#include <QDateTime>
|
2005-03-28 13:43:49 +00:00
|
|
|
#include <kcommondecoration.h>
|
2003-09-16 19:40:44 +00:00
|
|
|
#include <kdecorationfactory.h>
|
2001-06-07 11:35:06 +00:00
|
|
|
|
|
|
|
class QSpacerItem;
|
2002-08-27 15:12:14 +00:00
|
|
|
class QBoxLayout;
|
2003-09-16 19:40:44 +00:00
|
|
|
class QGridLayout;
|
2006-05-08 08:28:37 +00:00
|
|
|
class QPixmap;
|
2001-06-07 11:35:06 +00:00
|
|
|
|
2002-08-27 18:08:20 +00:00
|
|
|
namespace Default {
|
|
|
|
|
2003-09-16 19:40:44 +00:00
|
|
|
class KDEDefaultClient;
|
2001-06-07 11:35:06 +00:00
|
|
|
|
2003-09-16 19:40:44 +00:00
|
|
|
class KDEDefaultHandler: public KDecorationFactory
|
2001-06-07 11:35:06 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
KDEDefaultHandler();
|
|
|
|
~KDEDefaultHandler();
|
2003-09-16 19:40:44 +00:00
|
|
|
KDecoration* createDecoration( KDecorationBridge* b );
|
|
|
|
bool reset( unsigned long changed );
|
2005-07-28 14:59:42 +00:00
|
|
|
virtual QList< BorderSize > borderSizes() const;
|
2004-11-05 15:33:09 +00:00
|
|
|
virtual bool supports( Ability ability );
|
2001-06-07 11:35:06 +00:00
|
|
|
|
|
|
|
private:
|
2003-09-17 08:37:56 +00:00
|
|
|
unsigned long readConfig( bool update );
|
2001-06-07 11:35:06 +00:00
|
|
|
void createPixmaps();
|
|
|
|
void freePixmaps();
|
2006-05-08 08:28:37 +00:00
|
|
|
void drawButtonBackground(QPixmap *pix,
|
2006-04-12 15:13:31 +00:00
|
|
|
const QPalette &g, bool sunken);
|
2001-06-07 11:35:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2005-03-28 13:43:49 +00:00
|
|
|
// class KDEDefaultButton : public QButton, public KDecorationDefines
|
|
|
|
class KDEDefaultButton : public KCommonDecorationButton
|
2001-06-07 11:35:06 +00:00
|
|
|
{
|
|
|
|
public:
|
2005-03-28 13:43:49 +00:00
|
|
|
KDEDefaultButton(ButtonType type, KDEDefaultClient *parent, const char *name);
|
2003-07-15 18:18:26 +00:00
|
|
|
~KDEDefaultButton();
|
2001-07-01 10:10:17 +00:00
|
|
|
|
2005-03-28 13:43:49 +00:00
|
|
|
void reset(unsigned long changed);
|
|
|
|
|
2001-06-07 11:35:06 +00:00
|
|
|
void setBitmap(const unsigned char *bitmap);
|
|
|
|
|
|
|
|
protected:
|
2001-07-01 10:10:17 +00:00
|
|
|
void enterEvent(QEvent *);
|
|
|
|
void leaveEvent(QEvent *);
|
2005-08-17 09:15:59 +00:00
|
|
|
void paintEvent(QPaintEvent *);
|
2001-06-07 11:35:06 +00:00
|
|
|
void drawButton(QPainter *p);
|
|
|
|
void drawButtonLabel(QPainter*) {;}
|
|
|
|
|
|
|
|
QBitmap* deco;
|
|
|
|
bool large;
|
|
|
|
bool isMouseOver;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2005-03-28 13:43:49 +00:00
|
|
|
class KDEDefaultClient : public KCommonDecoration
|
2001-06-07 11:35:06 +00:00
|
|
|
{
|
|
|
|
public:
|
2003-09-16 19:40:44 +00:00
|
|
|
KDEDefaultClient( KDecorationBridge* b, KDecorationFactory* f );
|
2001-06-07 11:35:06 +00:00
|
|
|
~KDEDefaultClient() {;}
|
2005-03-28 13:43:49 +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);
|
|
|
|
|
|
|
|
virtual QRegion cornerShape(WindowCorner corner);
|
|
|
|
|
|
|
|
void init();
|
|
|
|
void reset( unsigned long changed );
|
2001-06-07 11:35:06 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void paintEvent( QPaintEvent* );
|
|
|
|
|
|
|
|
private:
|
2004-07-28 16:55:38 +00:00
|
|
|
bool mustDrawHandle() const;
|
2001-06-07 11:35:06 +00:00
|
|
|
int titleHeight;
|
|
|
|
};
|
|
|
|
|
2003-07-26 10:41:28 +00:00
|
|
|
}
|
2001-06-07 11:35:06 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
// vim: ts=4
|
2005-03-28 13:43:49 +00:00
|
|
|
// kate: space-indent off; tab-width 4;
|