2001-03-17 11:49:51 +00:00
|
|
|
/*
|
2001-06-04 09:51:23 +00:00
|
|
|
* Gallium-Quartz KWin client
|
|
|
|
*
|
2005-03-22 23:06:32 +00:00
|
|
|
* Copyright (C) 2005 Sandro Giessl <sandro@giessl.com>
|
2001-06-04 09:51:23 +00:00
|
|
|
* Copyright 2001
|
2001-07-15 12:15:41 +00:00
|
|
|
* Karol Szwed <gallium@kde.org>
|
2001-06-04 09:51:23 +00:00
|
|
|
* http://gallium.n3.net/
|
|
|
|
*
|
2001-07-15 12:15:41 +00:00
|
|
|
* Based on the KDE default client.
|
2001-06-04 09:51:23 +00:00
|
|
|
*
|
|
|
|
* Includes mini titlebars for ToolWindow Support.
|
|
|
|
* Button positions are now customizable.
|
|
|
|
*
|
|
|
|
*/
|
2001-03-17 11:49:51 +00:00
|
|
|
|
|
|
|
#ifndef __KDEGALLIUM_QUARTZ_H
|
|
|
|
#define __KDEGALLIUM_QUARTZ_H
|
|
|
|
|
|
|
|
#include <qbitmap.h>
|
|
|
|
#include <kpixmap.h>
|
2005-03-21 15:53:41 +00:00
|
|
|
#include "../../lib/kcommondecoration.h"
|
2003-09-18 15:27:12 +00:00
|
|
|
#include "../../lib/kdecorationfactory.h"
|
2001-04-22 09:31:42 +00:00
|
|
|
|
2001-03-17 11:49:51 +00:00
|
|
|
class QSpacerItem;
|
2002-08-27 15:12:14 +00:00
|
|
|
class QBoxLayout;
|
2001-03-17 11:49:51 +00:00
|
|
|
|
2002-08-27 18:08:20 +00:00
|
|
|
namespace Quartz {
|
2001-03-17 11:49:51 +00:00
|
|
|
|
2003-09-18 15:27:12 +00:00
|
|
|
class QuartzClient;
|
2001-04-22 09:31:42 +00:00
|
|
|
|
2003-09-18 15:27:12 +00:00
|
|
|
class QuartzHandler: public QObject, public KDecorationFactory
|
2001-03-17 11:49:51 +00:00
|
|
|
{
|
2001-04-22 09:31:42 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QuartzHandler();
|
|
|
|
~QuartzHandler();
|
|
|
|
|
2003-09-18 15:27:12 +00:00
|
|
|
virtual KDecoration* createDecoration( KDecorationBridge* );
|
|
|
|
virtual bool reset(unsigned long changed);
|
2004-11-05 15:33:09 +00:00
|
|
|
virtual bool supports( Ability ability );
|
2003-09-29 16:35:12 +00:00
|
|
|
virtual QValueList< BorderSize > borderSizes() const;
|
2001-04-22 09:31:42 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void readConfig();
|
|
|
|
void createPixmaps();
|
|
|
|
void freePixmaps();
|
|
|
|
void drawBlocks(KPixmap* pi, KPixmap &p, const QColor &c1, const QColor &c2);
|
|
|
|
};
|
|
|
|
|
2001-03-17 11:49:51 +00:00
|
|
|
|
2005-03-21 15:53:41 +00:00
|
|
|
class QuartzButton : public KCommonDecorationButton
|
2001-04-22 09:31:42 +00:00
|
|
|
{
|
|
|
|
public:
|
2005-03-21 15:53:41 +00:00
|
|
|
QuartzButton(ButtonType type, QuartzClient *parent, const char *name);
|
2001-04-22 09:31:42 +00:00
|
|
|
~QuartzButton();
|
|
|
|
void setBitmap(const unsigned char *bitmap);
|
2005-03-21 15:53:41 +00:00
|
|
|
|
|
|
|
void reset(unsigned long changed);
|
2001-04-22 09:31:42 +00:00
|
|
|
|
|
|
|
protected:
|
2001-05-26 02:34:47 +00:00
|
|
|
void drawButton(QPainter *p);
|
2001-04-22 09:31:42 +00:00
|
|
|
|
|
|
|
QBitmap* deco;
|
2001-03-17 11:49:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2005-03-21 15:53:41 +00:00
|
|
|
class QuartzClient : public KCommonDecoration
|
2001-03-17 11:49:51 +00:00
|
|
|
{
|
2001-04-22 09:31:42 +00:00
|
|
|
public:
|
2003-09-18 15:27:12 +00:00
|
|
|
QuartzClient(KDecorationBridge* bridge, KDecorationFactory* factory);
|
2001-04-22 09:31:42 +00:00
|
|
|
~QuartzClient() {;}
|
|
|
|
|
2005-03-21 15:53:41 +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-18 15:27:12 +00:00
|
|
|
virtual void init();
|
|
|
|
|
2001-04-22 09:31:42 +00:00
|
|
|
protected:
|
2003-09-18 15:27:12 +00:00
|
|
|
virtual void reset( unsigned long changed );
|
2001-04-22 09:31:42 +00:00
|
|
|
void paintEvent( QPaintEvent* );
|
|
|
|
|
|
|
|
private:
|
2003-09-18 15:27:12 +00:00
|
|
|
int titleHeight, borderSize;
|
2001-04-22 09:31:42 +00:00
|
|
|
bool largeButtons;
|
2001-03-17 11:49:51 +00:00
|
|
|
};
|
|
|
|
|
2003-07-26 10:41:28 +00:00
|
|
|
}
|
2001-03-17 11:49:51 +00:00
|
|
|
|
|
|
|
#endif
|
2001-05-26 02:34:47 +00:00
|
|
|
// vim: ts=4
|
2005-03-21 15:53:41 +00:00
|
|
|
// kate: space-indent off; tab-width 4;
|