2001-06-24 17:12:39 +00:00
|
|
|
#ifndef __NEXTCLIENT_H
|
|
|
|
#define __NEXTCLIENT_H
|
|
|
|
|
2001-08-18 23:51:08 +00:00
|
|
|
#include <qvariant.h>
|
2001-06-24 17:12:39 +00:00
|
|
|
#include <qbitmap.h>
|
|
|
|
#include <kpixmap.h>
|
2002-04-26 02:03:01 +00:00
|
|
|
#include <qlayout.h>
|
2001-06-24 17:12:39 +00:00
|
|
|
#include "../../client.h"
|
2001-07-01 10:10:17 +00:00
|
|
|
#include "../../kwinbutton.h"
|
2001-06-24 17:12:39 +00:00
|
|
|
class QLabel;
|
|
|
|
class QSpacerItem;
|
|
|
|
|
2002-08-27 18:08:20 +00:00
|
|
|
namespace KStep {
|
2001-06-24 17:12:39 +00:00
|
|
|
|
2002-08-27 18:08:20 +00:00
|
|
|
using namespace KWinInternal;
|
|
|
|
|
|
|
|
class NextButton : public KWinButton
|
2001-06-24 17:12:39 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NextButton(Client *parent=0, const char *name=0,
|
2001-07-01 10:10:17 +00:00
|
|
|
const unsigned char *bitmap=NULL, int bw=0, int bh=0,
|
|
|
|
const QString& tip=NULL);
|
2001-06-24 17:12:39 +00:00
|
|
|
void setBitmap(const unsigned char *bitmap, int bw, int bh);
|
|
|
|
void reset();
|
2002-04-26 02:03:01 +00:00
|
|
|
ButtonState lastButton() { return last_button; }
|
|
|
|
|
2001-06-24 17:12:39 +00:00
|
|
|
protected:
|
2002-04-26 02:03:01 +00:00
|
|
|
void mousePressEvent( QMouseEvent* e );
|
|
|
|
void mouseReleaseEvent( QMouseEvent* e );
|
2001-06-24 17:12:39 +00:00
|
|
|
virtual void drawButton(QPainter *p);
|
|
|
|
void drawButtonLabel(QPainter *){;}
|
2002-04-26 02:03:01 +00:00
|
|
|
|
2001-06-24 17:12:39 +00:00
|
|
|
KPixmap aBackground, iBackground;
|
2002-04-26 02:03:01 +00:00
|
|
|
QBitmap* deco;
|
2001-06-24 17:12:39 +00:00
|
|
|
Client *client;
|
2002-04-26 02:03:01 +00:00
|
|
|
ButtonState last_button;
|
2001-06-24 17:12:39 +00:00
|
|
|
};
|
|
|
|
|
2002-08-27 18:08:20 +00:00
|
|
|
class NextClient : public Client
|
2001-06-24 17:12:39 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
NextClient( Workspace *ws, WId w, QWidget *parent=0, const char *name=0 );
|
2002-04-26 02:03:01 +00:00
|
|
|
~NextClient() {;}
|
2001-06-24 17:12:39 +00:00
|
|
|
protected:
|
|
|
|
void resizeEvent( QResizeEvent* );
|
|
|
|
void paintEvent( QPaintEvent* );
|
|
|
|
|
|
|
|
void mouseDoubleClickEvent( QMouseEvent * );
|
|
|
|
void init();
|
|
|
|
void captionChange( const QString& name );
|
|
|
|
void stickyChange(bool on);
|
|
|
|
void activeChange(bool);
|
|
|
|
|
|
|
|
MousePosition mousePosition(const QPoint &) const;
|
|
|
|
|
|
|
|
protected slots:
|
|
|
|
void slotReset();
|
2002-04-26 02:03:01 +00:00
|
|
|
void menuButtonPressed();
|
|
|
|
void maximizeButtonClicked();
|
|
|
|
|
2001-06-24 17:12:39 +00:00
|
|
|
private:
|
2002-08-27 15:12:14 +00:00
|
|
|
void initializeButtonsAndTitlebar(QBoxLayout* titleLayout);
|
|
|
|
void addButtons(QBoxLayout* titleLayout, const QString& buttons);
|
2002-04-26 02:03:01 +00:00
|
|
|
|
2001-06-24 17:12:39 +00:00
|
|
|
QSpacerItem* titlebar;
|
2002-04-26 02:03:01 +00:00
|
|
|
|
|
|
|
// Helpful constants for buttons in array
|
|
|
|
static const int CLOSE_IDX = 0;
|
|
|
|
static const int HELP_IDX = 1;
|
|
|
|
static const int ICONIFY_IDX = 2;
|
|
|
|
static const int MAXIMIZE_IDX = 3;
|
|
|
|
static const int MENU_IDX = 4;
|
|
|
|
static const int STICKY_IDX = 5;
|
|
|
|
static const int MAX_NUM_BUTTONS = STICKY_IDX + 1;
|
|
|
|
|
|
|
|
// WARNING: button[i] may be null for any given i. Make sure you
|
|
|
|
// always check for null before doing button[i]->foo().
|
|
|
|
NextButton* button[MAX_NUM_BUTTONS];
|
2001-06-24 17:12:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|