From e35f3fe53cd8df85d4fd04e49dfffbaeac971cdf Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Mon, 7 Nov 2011 21:50:31 -0600 Subject: Rename kwin to twin (Part 2 of 2) --- twin-styles/system/systemclient.h | 113 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 twin-styles/system/systemclient.h (limited to 'twin-styles/system/systemclient.h') diff --git a/twin-styles/system/systemclient.h b/twin-styles/system/systemclient.h new file mode 100644 index 00000000..ecaf25ee --- /dev/null +++ b/twin-styles/system/systemclient.h @@ -0,0 +1,113 @@ +#ifndef __SYSTEMCLIENT_H +#define __SYSTEMCLIENT_H + +#include +#include +#include + +#include +#include +#include + + +class TQLabel; +class TQSpacerItem; +class TQBoxLayout; + +namespace System { + +class SystemButton; + +enum ButtonType { + ButtonClose=0, + ButtonSticky, + ButtonMinimize, + ButtonMaximize, + ButtonHelp, + ButtonTypeCount +}; + +class SystemClient : public KDecoration +{ + Q_OBJECT + TQ_OBJECT + public: + SystemClient(KDecorationBridge* bridge, KDecorationFactory* factory); + ~SystemClient(); + virtual Position mousePosition(const TQPoint& p) const; + virtual void resize(const TQSize&); + virtual bool eventFilter(TQObject* o, TQEvent* e); + virtual void init(); + protected: + virtual void maximizeChange(); + virtual void captionChange(); + virtual void shadeChange() {}; + virtual void iconChange(); + virtual void desktopChange(); + virtual void activeChange(); + virtual TQSize tqminimumSize() const; + virtual void borders(int&, int&, int&, int&) const; + virtual void reset( unsigned long changed ); + void drawRoundFrame(TQPainter &p, int x, int y, int w, int h); + void resizeEvent( TQResizeEvent* ); + void paintEvent( TQPaintEvent* ); + void showEvent( TQShowEvent* ); + void mouseDoubleClickEvent( TQMouseEvent * ); + void wheelEvent(TQWheelEvent *e); + void doShape(); + void recalcTitleBuffer(); + private: + void addButtons(TQBoxLayout* hb, const TQString& buttons); + private slots: + void maxButtonClicked(); + + private: + SystemButton* button[ButtonTypeCount]; + TQSpacerItem* titlebar; + TQPixmap titleBuffer; + TQString oldTitle; +}; + +class SystemButton : public TQButton +{ + public: + SystemButton(SystemClient *parent=0, const char *name=0, + const unsigned char *bitmap=NULL, const TQString& tip=NULL); + void setBitmap(const unsigned char *bitmap); + void reset(); + TQSize tqsizeHint() const; + void setTipText(const TQString &tip); + ButtonState last_button; + protected: + virtual void drawButton(TQPainter *p); + void drawButtonLabel(TQPainter *){} + TQBitmap deco; + + void mousePressEvent( TQMouseEvent* e ); + void mouseReleaseEvent( TQMouseEvent* e ); + + private: + SystemClient* client; +}; + + +class SystemDecoFactory : public TQObject, public KDecorationFactory +{ + Q_OBJECT + TQ_OBJECT + public: + SystemDecoFactory(); + virtual ~SystemDecoFactory(); + virtual KDecoration *createDecoration(KDecorationBridge *); + virtual bool reset(unsigned long); + virtual bool supports( Ability ability ); + virtual TQValueList< BorderSize > borderSizes() const; + private: + void readConfig(); +}; + + + +} + +#endif -- cgit v1.2.1