2001-06-19 15:26:48 +00:00
|
|
|
// $Id$
|
|
|
|
#ifndef __MODSYSTEMCLIENT_H
|
|
|
|
#define __MODSYSTEMCLIENT_H
|
|
|
|
|
|
|
|
#include <qbutton.h>
|
|
|
|
#include <qbitmap.h>
|
|
|
|
#include <kpixmap.h>
|
|
|
|
#include "../../client.h"
|
2001-07-01 10:10:17 +00:00
|
|
|
#include "../../kwinbutton.h"
|
2001-06-19 15:26:48 +00:00
|
|
|
class QLabel;
|
|
|
|
class QSpacerItem;
|
|
|
|
|
2002-08-27 18:08:20 +00:00
|
|
|
namespace ModernSystem {
|
2001-06-19 15:26:48 +00:00
|
|
|
|
2002-08-27 18:08:20 +00:00
|
|
|
using namespace KWinInternal;
|
|
|
|
|
|
|
|
class ModernButton : public KWinButton
|
2001-06-19 15:26:48 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
ModernButton(Client *parent=0, const char *name=0,
|
2001-07-01 10:10:17 +00:00
|
|
|
const unsigned char *bitmap=NULL,
|
|
|
|
const QString& tip=NULL);
|
2001-06-19 15:26:48 +00:00
|
|
|
void setBitmap(const unsigned char *bitmap);
|
|
|
|
void reset();
|
|
|
|
QSize sizeHint() const;
|
|
|
|
protected:
|
|
|
|
void mousePressEvent( QMouseEvent* e );
|
|
|
|
void mouseReleaseEvent( QMouseEvent* e );
|
|
|
|
|
|
|
|
virtual void drawButton(QPainter *p);
|
|
|
|
void drawButtonLabel(QPainter *){;}
|
|
|
|
QBitmap deco;
|
2001-07-01 10:10:17 +00:00
|
|
|
Client* client;
|
2001-06-19 15:26:48 +00:00
|
|
|
public:
|
|
|
|
int last_button;
|
|
|
|
};
|
|
|
|
|
2002-08-27 18:08:20 +00:00
|
|
|
class ModernSys : public Client
|
2001-06-19 15:26:48 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
ModernSys( Workspace *ws, WId w, QWidget *parent=0, const char *name=0 );
|
|
|
|
~ModernSys(){;}
|
|
|
|
protected:
|
|
|
|
void drawRoundFrame(QPainter &p, int x, int y, int w, int h);
|
|
|
|
void resizeEvent( QResizeEvent* );
|
|
|
|
void paintEvent( QPaintEvent* );
|
|
|
|
void showEvent( QShowEvent* );
|
|
|
|
void windowWrapperShowEvent( QShowEvent* );
|
|
|
|
void mouseDoubleClickEvent( QMouseEvent * );
|
|
|
|
void init();
|
|
|
|
void captionChange( const QString& name );
|
|
|
|
void stickyChange(bool on);
|
|
|
|
void maximizeChange(bool m);
|
|
|
|
void doShape();
|
|
|
|
void recalcTitleBuffer();
|
|
|
|
void activeChange(bool);
|
|
|
|
MousePosition mousePosition( const QPoint& ) const;
|
|
|
|
protected slots:
|
|
|
|
void slotReset();
|
|
|
|
void maxButtonClicked();
|
|
|
|
private:
|
|
|
|
enum Buttons{ BtnClose = 0, BtnSticky, BtnMinimize, BtnMaximize, BtnHelp };
|
|
|
|
ModernButton* button[5];
|
|
|
|
QSpacerItem* titlebar;
|
|
|
|
QPixmap titleBuffer;
|
|
|
|
QString oldTitle;
|
|
|
|
};
|
|
|
|
|
2003-07-26 10:41:28 +00:00
|
|
|
}
|
2001-06-19 15:26:48 +00:00
|
|
|
|
|
|
|
#endif
|