/* Plastik KWin window decoration Copyright (C) 2003 Sandro Giessl based on the window decoration "Web": Copyright (C) 2001 Rik Hemsley (rikkus) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef KNIFTYCLIENT_H #define KNIFTYCLIENT_H #include #include "plastik.h" class QSpacerItem; class QVBoxLayout; namespace KWinInternal { class PlastikButton; class PlastikClient : public KWinInternal::Client { Q_OBJECT public: PlastikClient(Workspace *ws, WId w, QWidget *parent = 0, const char *name = 0); ~PlastikClient(); QPixmap getTitleBarTile(bool active) const { return active ? *aTitleBarTile : *iTitleBarTile; } protected: virtual void resizeEvent(QResizeEvent *e); virtual void paintEvent(QPaintEvent *e); virtual void showEvent(QShowEvent *); virtual void mouseDoubleClickEvent(QMouseEvent *e); virtual void windowWrapperShowEvent(QShowEvent *); virtual void maximizeChange(bool m); virtual void doShape(); virtual void captionChange(const QString &name); virtual void stickyChange(bool s); virtual void iconChange(); virtual void activeChange(bool a); virtual MousePosition mousePosition(const QPoint &point) const; private slots: void maxButtonPressed(); void menuButtonPressed(); void menuButtonReleased(); private: void _resetLayout(); void addButtons(QBoxLayout* layout, const QString& buttons, int buttonSize = 18); QVBoxLayout *mainLayout_; QSpacerItem *topSpacer_, *titleSpacer_, *leftTitleSpacer_, *rightTitleSpacer_, *decoSpacer_, *leftSpacer_, *rightSpacer_, *bottomSpacer_; QPixmap *aCaptionBuffer, *iCaptionBuffer; void update_captionBuffer(); QPixmap *aTitleBarTile, *iTitleBarTile, *aTitleBarTopTile, *iTitleBarTopTile; bool pixmaps_created; void create_pixmaps(); void delete_pixmaps(); PlastikButton *m_button[ButtonTypeCount]; bool captionBufferDirty; bool closing; // settings... int s_titleHeight; QFont s_titleFont; }; } #endif // KNIFTCLIENT_H