kwin/clients/laptop/laptopclient.h
Karol Szwed a33f4313ab - Removing patch by Diego Iastrubini that attempted to fix the bidi issues in
clients by adding an unnecessary 'enable-bidi' checkbox which was never agreed
  upon on the kwin mailing list.

  The use of --reverse is sufficient without needing this checkbox.
  Please discuss largish patches like these first, especially during a feature
  freeze!

  (Everyone also seems to forget the kwin-styles in kdeartwork)

- Make clients look the same with --reverse instead of the broken state they
  were in previously. If the button ordering is not to your liking in reverse
  mode, just change the button positions. (Or send patches for those clients
  that have not got these features yet).

- Clean up popupMenu handling somewhat.

- Remove a global static object in keramik.

svn path=/trunk/kdebase/kwin/; revision=174079
2002-08-27 15:12:14 +00:00

85 lines
2.1 KiB
C++

#ifndef __KDECLIENT_H
#define __KDECLIENT_H
#include <qbitmap.h>
#include <kpixmap.h>
#include "../../client.h"
#include "../../kwinbutton.h"
class QLabel;
class QSpacerItem;
class QBoxLayout;
namespace KWinInternal {
class LaptopClientButton : public KWinInternal::KWinButton
{
public:
LaptopClientButton(int w, int h, Client *parent=0, const char *name=0,
const unsigned char *bitmap=NULL, const QString& tip=NULL);
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() );
KWinButton::mousePressEvent( &me );
}
void mouseReleaseEvent( QMouseEvent* e )
{
last_button = e->button();
QMouseEvent me ( e->type(), e->pos(), e->globalPos(), LeftButton, e->state() );
KWinButton::mouseReleaseEvent( &me );
}
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;
QBoxLayout* hb;
KPixmap activeBuffer;
bool bufferDirty;
int lastBufferWidth;
};
};
#endif