2000-07-16 13:06:27 +00:00
|
|
|
/*****************************************************************
|
|
|
|
kwin - the KDE window manager
|
|
|
|
|
|
|
|
Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
|
|
|
|
******************************************************************/
|
|
|
|
#ifndef STDCLIENT_H
|
|
|
|
#define STDCLIENT_H
|
2001-08-18 23:34:53 +00:00
|
|
|
#include <qvariant.h>
|
2000-07-16 13:06:27 +00:00
|
|
|
#include "../../client.h"
|
2001-07-01 10:10:17 +00:00
|
|
|
#include "../../kwinbutton.h"
|
2000-07-16 13:06:27 +00:00
|
|
|
class QLabel;
|
|
|
|
class QSpacerItem;
|
|
|
|
|
2002-08-27 18:08:20 +00:00
|
|
|
namespace KDE1 {
|
2001-02-20 01:20:38 +00:00
|
|
|
|
2002-08-27 18:08:20 +00:00
|
|
|
using namespace KWinInternal;
|
|
|
|
|
|
|
|
class StdClient : public Client
|
2000-07-16 13:06:27 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
StdClient( Workspace *ws, WId w, QWidget *parent=0, const char *name=0 );
|
|
|
|
~StdClient();
|
|
|
|
protected:
|
|
|
|
void resizeEvent( QResizeEvent* );
|
|
|
|
void paintEvent( QPaintEvent* );
|
|
|
|
|
|
|
|
void mouseDoubleClickEvent( QMouseEvent * );
|
|
|
|
void init();
|
|
|
|
void captionChange( const QString& name );
|
|
|
|
void iconChange();
|
|
|
|
void maximizeChange( bool );
|
|
|
|
void stickyChange( bool );
|
|
|
|
void activeChange( bool );
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void menuButtonPressed();
|
|
|
|
void maxButtonClicked( int );
|
|
|
|
void slotReset();
|
|
|
|
|
|
|
|
private:
|
2001-07-01 10:10:17 +00:00
|
|
|
KWinToolButton* button[7];
|
2000-07-16 13:06:27 +00:00
|
|
|
QSpacerItem* titlebar;
|
|
|
|
};
|
|
|
|
|
|
|
|
class StdToolClient : public Client
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
StdToolClient( Workspace *ws, WId w, QWidget *parent=0, const char *name=0 );
|
|
|
|
~StdToolClient();
|
|
|
|
protected:
|
|
|
|
void resizeEvent( QResizeEvent* );
|
|
|
|
void paintEvent( QPaintEvent* );
|
|
|
|
|
|
|
|
void mouseDoubleClickEvent( QMouseEvent * );
|
|
|
|
void init();
|
|
|
|
void captionChange( const QString& name );
|
|
|
|
void activeChange( bool );
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void slotReset();
|
|
|
|
private:
|
2001-07-01 10:10:17 +00:00
|
|
|
KWinToolButton* closeBtn;
|
2000-07-16 13:06:27 +00:00
|
|
|
QSpacerItem* titlebar;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
Like QToolButton, but provides a clicked(int) signals that
|
|
|
|
has the last pressed mouse button as argument
|
|
|
|
*/
|
2002-08-27 18:08:20 +00:00
|
|
|
class ThreeButtonButton: public KWinToolButton
|
2000-07-16 13:06:27 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2001-07-01 10:10:17 +00:00
|
|
|
ThreeButtonButton ( QWidget *parent = 0, const char* name = 0,
|
|
|
|
const QString& tip = 0 )
|
|
|
|
: KWinToolButton( parent, name, tip )
|
2000-07-16 13:06:27 +00:00
|
|
|
{
|
|
|
|
connect( this, SIGNAL( clicked() ), this, SLOT( handleClicked() ) );
|
|
|
|
}
|
2001-07-01 10:10:17 +00:00
|
|
|
~ThreeButtonButton () {}
|
2000-07-16 13:06:27 +00:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void clicked( int );
|
|
|
|
|
|
|
|
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
|
|
|
KWinToolButton::mousePressEvent( &me );
|
2000-07-16 13:06:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void mouseReleaseEvent( QMouseEvent* e )
|
|
|
|
{
|
|
|
|
QMouseEvent me ( e->type(), e->pos(), e->globalPos(), LeftButton, e->state() );
|
2001-07-01 10:10:17 +00:00
|
|
|
KWinToolButton::mouseReleaseEvent( &me );
|
2000-07-16 13:06:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void handleClicked()
|
|
|
|
{
|
|
|
|
emit clicked( last_button );
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
int last_button;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2001-02-20 01:20:38 +00:00
|
|
|
};
|
2000-07-16 13:06:27 +00:00
|
|
|
|
|
|
|
#endif
|