diff options
author | Timothy Pearson <[email protected]> | 2011-11-07 21:50:31 -0600 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2011-11-07 21:50:31 -0600 |
commit | e35f3fe53cd8df85d4fd04e49dfffbaeac971cdf (patch) | |
tree | 95836fc22de909b3b20dbf3fc3dea230e5e58e3b /twin-styles/cde/cdeclient.h | |
parent | a5355f151396be579eba5838c7d8d93a43362cd7 (diff) | |
download | tdeartwork-e35f3fe53cd8df85d4fd04e49dfffbaeac971cdf.tar.gz tdeartwork-e35f3fe53cd8df85d4fd04e49dfffbaeac971cdf.zip |
Rename kwin to twin (Part 2 of 2)
Diffstat (limited to 'twin-styles/cde/cdeclient.h')
-rw-r--r-- | twin-styles/cde/cdeclient.h | 119 |
1 files changed, 119 insertions, 0 deletions
diff --git a/twin-styles/cde/cdeclient.h b/twin-styles/cde/cdeclient.h new file mode 100644 index 00000000..e3a0e9ad --- /dev/null +++ b/twin-styles/cde/cdeclient.h @@ -0,0 +1,119 @@ +/* + * CDE KWin client - emulates the look and feel + * of dtwm, the CDE window manager. + * + * Copyright (c) 2000-2001, 2002 + * Chris Lee <[email protected]> + * Lennart Kudling <[email protected]> + * Fredrik H�glund <[email protected]> + * + * Copyright (c) 2003 + * Luciano Montanaro <[email protected]> + * + * Originally based on the KStep client. + * + * Distributed under the terms of the BSD license. + */ + +#ifndef __CDECLIENT_H +#define __CDECLIENT_H + +#include <tqbutton.h> +#include <tqbitmap.h> +#include <kpixmap.h> +#include <kdecoration.h> +#include <kdecorationfactory.h> + +class TQLabel; +class TQBoxLayout; +class TQVBoxLayout; +class TQSpacerItem; + +namespace CDE { + +class CdeClient; + +enum Buttons { BtnMenu=0, BtnHelp, BtnIconify, BtnMax, BtnClose, BtnCount }; + +class CdeButton : public TQButton +{ +public: + CdeButton( CdeClient* parent=0, const char* name=0, int btnType=0, + const TQString& tip=NULL, int realize_btns = Qt::LeftButton ); + void reset(); + ButtonState lastButton() { return last_button; } + +protected: + void mousePressEvent(TQMouseEvent *e); + void mouseReleaseEvent(TQMouseEvent *e); + virtual void drawButton(TQPainter *p); + +private: + CdeClient *m_parent; + int m_btnType; + int m_realize_buttons; + ButtonState last_button; +}; + +class CdeClient : public KDecoration +{ + Q_OBJECT + TQ_OBJECT +public: + CdeClient(KDecorationBridge *b, KDecorationFactory *f); + ~CdeClient() {}; + void init(); + +protected: + bool eventFilter(TQObject *o, TQEvent *e); + void resizeEvent( TQResizeEvent* ); + void paintEvent( TQPaintEvent* ); + + void showEvent(TQShowEvent *); + void addClientButtons( const TQString& ); + void mouseDoubleClickEvent( TQMouseEvent* ); + void wheelEvent( TQWheelEvent * ); + void captionChange(); + void desktopChange(); + void activeChange(); + void shadeChange(); + void iconChange(); + TQSize tqminimumSize() const; + void resize(const TQSize &size); + void borders(int &left, int &right, int &top, int &bottom) const; + void mousePressEvent( TQMouseEvent* ); + void mouseReleaseEvent( TQMouseEvent* ); + void maximizeChange(); + Position mousePosition( const TQPoint& p ) const; + +protected slots: + void menuButtonPressed(); + void menuButtonReleased(); + void maximizeButtonClicked(); + +private: + CdeButton* button[BtnCount]; + TQVBoxLayout* mainLayout; + TQBoxLayout* titleLayout; + TQSpacerItem* titlebar; + bool titlebarPressed; + bool closing; +}; + +class CdeClientFactory: public TQObject, public KDecorationFactory +{ +public: + CdeClientFactory(); + virtual ~CdeClientFactory(); + virtual KDecoration *createDecoration(KDecorationBridge *); + virtual bool supports( Ability ability ); + virtual bool reset(unsigned long changed); + + TQValueList< CdeClientFactory::BorderSize > borderSizes() const; + +}; + +} + +#endif + |