2001-06-20 11:17:03 +00:00
|
|
|
#ifndef __KDECLIENT_H
|
|
|
|
#define __KDECLIENT_H
|
|
|
|
|
|
|
|
#include <qbitmap.h>
|
|
|
|
#include <kpixmap.h>
|
|
|
|
#include "../../client.h"
|
2001-07-01 10:10:17 +00:00
|
|
|
#include "../../kwinbutton.h"
|
2001-06-20 11:17:03 +00:00
|
|
|
class QLabel;
|
|
|
|
class QSpacerItem;
|
2002-08-27 15:12:14 +00:00
|
|
|
class QBoxLayout;
|
2001-06-20 11:17:03 +00:00
|
|
|
|
2002-08-27 18:08:20 +00:00
|
|
|
namespace Laptop {
|
2001-06-20 11:17:03 +00:00
|
|
|
|
2002-08-27 18:08:20 +00:00
|
|
|
using namespace KWinInternal;
|
|
|
|
|
|
|
|
class LaptopClientButton : public KWinButton
|
2001-06-20 11:17:03 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
LaptopClientButton(int w, int h, 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-20 11:17:03 +00:00
|
|
|
void setBitmap(const unsigned char *bitmap);
|
|
|
|
void reset();
|
|
|
|
QSize sizeHint() const;
|
|
|
|
int last_button;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void mousePressEvent( QMouseEvent* e )
|
|
|
|
{
|
|
|
|
last_button = e->button();
|
|
|
|
QMouseEvent me ( e->type(), e->pos(), e->globalPos(), LeftButton, e->state() );
|
2001-07-01 10:10:17 +00:00
|
|
|
KWinButton::mousePressEvent( &me );
|
2001-06-20 11:17:03 +00:00
|
|
|
}
|
|
|
|
void mouseReleaseEvent( QMouseEvent* e )
|
|
|
|
{
|
|
|
|
last_button = e->button();
|
|
|
|
QMouseEvent me ( e->type(), e->pos(), e->globalPos(), LeftButton, e->state() );
|
2001-07-01 10:10:17 +00:00
|
|
|
KWinButton::mouseReleaseEvent( &me );
|
2001-06-20 11:17:03 +00:00
|
|
|
}
|
|
|
|
virtual void drawButton(QPainter *p);
|
|
|
|
void drawButtonLabel(QPainter *) {}
|
|
|
|
QSize defaultSize;
|
|
|
|
QBitmap deco;
|
|
|
|
Client *client;
|
|
|
|
};
|
|
|
|
|
|
|
|
class LaptopClient : public KWinInternal::Client
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
enum Buttons{BtnHelp=0, BtnSticky, BtnMax, BtnIconify, BtnClose};
|
|
|
|
LaptopClient( Workspace *ws, WId w, QWidget *parent=0, const char *name=0 );
|
|
|
|
~LaptopClient() {}
|
|
|
|
protected:
|
|
|
|
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 activeChange(bool);
|
|
|
|
|
|
|
|
void calcHiddenButtons();
|
|
|
|
void updateActiveBuffer();
|
|
|
|
|
|
|
|
MousePosition mousePosition(const QPoint &) const;
|
|
|
|
|
|
|
|
protected slots:
|
|
|
|
void slotReset();
|
|
|
|
void slotMaximize();
|
|
|
|
private:
|
|
|
|
LaptopClientButton* button[5];
|
|
|
|
int lastButtonWidth;
|
|
|
|
QSpacerItem* titlebar;
|
|
|
|
bool hiddenItems;
|
2002-08-27 15:12:14 +00:00
|
|
|
QBoxLayout* hb;
|
2001-06-20 11:17:03 +00:00
|
|
|
KPixmap activeBuffer;
|
|
|
|
bool bufferDirty;
|
|
|
|
int lastBufferWidth;
|
|
|
|
};
|
|
|
|
|
2003-07-26 10:41:28 +00:00
|
|
|
}
|
2001-06-20 11:17:03 +00:00
|
|
|
|
|
|
|
#endif
|