kwin Library API Documentation

plastikclient.h

00001 /* Plastik KWin window decoration
00002   Copyright (C) 2003 Sandro Giessl <ceebx@users.sourceforge.net>
00003 
00004   based on the window decoration "Web":
00005   Copyright (C) 2001 Rik Hemsley (rikkus) <rik@kde.org>
00006 
00007   This program is free software; you can redistribute it and/or
00008   modify it under the terms of the GNU General Public
00009   License as published by the Free Software Foundation; either
00010   version 2 of the License, or (at your option) any later version.
00011 
00012   This program is distributed in the hope that it will be useful,
00013   but WITHOUT ANY WARRANTY; without even the implied warranty of
00014   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015   General Public License for more details.
00016 
00017   You should have received a copy of the GNU General Public License
00018   along with this program; see the file COPYING.  If not, write to
00019   the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00020   Boston, MA 02111-1307, USA.
00021  */
00022 
00023 #ifndef KNIFTYCLIENT_H
00024 #define KNIFTYCLIENT_H
00025 
00026 #include <kdecoration.h>
00027 #include "plastik.h"
00028 
00029 class QSpacerItem;
00030 class QVBoxLayout;
00031 class QBoxLayout;
00032 
00033 namespace KWinPlastik {
00034 
00035 class PlastikButton;
00036 
00037 class PlastikClient : public KDecoration
00038 {
00039     Q_OBJECT
00040 public:
00041     PlastikClient(KDecorationBridge* bridge, KDecorationFactory* factory);
00042     ~PlastikClient();
00043 
00044     virtual void init();
00045 
00046     virtual void borders( int& left, int& right, int& top, int& bottom ) const;
00047     virtual void resize(const QSize&);
00048     virtual QSize minimumSize() const;
00049     virtual void show();
00050     virtual bool eventFilter( QObject* o, QEvent* e );
00051 
00052     QPixmap getTitleBarTile(bool active) const
00053     {
00054         return active ? *aTitleBarTile : *iTitleBarTile;
00055     }
00056 protected:
00057     virtual void resizeEvent();
00058     virtual void paintEvent(QPaintEvent *e);
00059     virtual void mouseDoubleClickEvent(QMouseEvent *e);
00060 
00061     virtual void maximizeChange();
00062     virtual void desktopChange();
00063     virtual void shadeChange();
00064     virtual void doShape();
00065 
00066     virtual void reset( unsigned long changed );
00067 
00068     virtual void captionChange();
00069     virtual void iconChange();
00070     virtual void activeChange();
00071     virtual Position mousePosition(const QPoint &point) const;
00072 
00073 private slots:
00074     void keepAboveChange(bool above);
00075     void keepBelowChange(bool below);
00076     void slotMaximize();
00077     void slotShade();
00078     void slotKeepAbove();
00079     void slotKeepBelow();
00080     void menuButtonPressed();
00081     void menuButtonReleased();
00082     bool isTool();
00083 private:
00084     void _resetLayout();
00085     void addButtons(QBoxLayout* layout, const QString& buttons, int buttonSize = 18);
00086 
00087     QVBoxLayout *mainLayout_;
00088     QSpacerItem *topSpacer_,
00089                 *titleSpacer_,
00090                 *leftTitleSpacer_, *rightTitleSpacer_,
00091                 *decoSpacer_,
00092                 *leftSpacer_, *rightSpacer_,
00093                 *bottomSpacer_;
00094 
00095     QPixmap *aCaptionBuffer, *iCaptionBuffer;
00096     void update_captionBuffer();
00097 
00098     QPixmap *aTitleBarTile, *iTitleBarTile, *aTitleBarTopTile, *iTitleBarTopTile;
00099     bool pixmaps_created;
00100     void create_pixmaps();
00101     void delete_pixmaps();
00102 
00103     PlastikButton *m_button[NumButtons];
00104 
00105     bool captionBufferDirty;
00106 
00107     bool closing;
00108 
00109     // settings...
00110     int   s_titleHeight;
00111     QFont s_titleFont;
00112 };
00113 
00114 } // KWinPlastik
00115 
00116 #endif // KNIFTCLIENT_H
KDE Logo
This file is part of the documentation for kwin Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Sep 30 18:40:43 2005 by doxygen 1.4.3 written by Dimitri van Heesch, © 1997-2003