fc23037d3a
but not explicitly the license, there I assumed they're licensed under the same license as the rest of KWin, which is GPLv2+ as of now. CC-ing all people mentioned as copyright holders just in case somebody wants some other license, e.g. the X11 license KWin used to be licensed under until KDE3.2. Please check with other relevant contributors and change accordingly in such case. CCMAIL: Karol Szwed <gallium@kde.org> CCMAIL: Luciano Montanaro <mikelima@cirulla.net> CCMAIL: Sandro Giessl <sandro@giessl.com> CCMAIL: Daniel M. Duley <mosfet@kde.org> CCMAIL: Chris Lee <clee@kde.org> svn path=/trunk/KDE/kdebase/workspace/; revision=742990
88 lines
2.4 KiB
C++
88 lines
2.4 KiB
C++
/********************************************************************
|
|
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. If not, see <http://www.gnu.org/licenses/>.
|
|
*********************************************************************/
|
|
|
|
#ifndef __KWMTHEMECLIENT_H
|
|
#define __KWMTHEMECLIENT_H
|
|
|
|
#include <qbutton.h>
|
|
#include <QToolButton>
|
|
#include <QPixmap>
|
|
#include <kdecoration.h>
|
|
#include <kdecorationfactory.h>
|
|
|
|
class QSpacerItem;
|
|
class QGridLayout;
|
|
|
|
namespace KWMTheme {
|
|
|
|
class MyButton : public QToolButton
|
|
{
|
|
public:
|
|
explicit MyButton(QWidget *parent=0, const char *name=0)
|
|
: QToolButton(parent, name){setAutoRaise(true);setCursor( arrowCursor ); }
|
|
protected:
|
|
void drawButtonLabel(QPainter *p);
|
|
};
|
|
|
|
class KWMThemeClient : public KDecoration
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
KWMThemeClient( KDecorationBridge* b, KDecorationFactory* f );
|
|
~KWMThemeClient(){;}
|
|
void init();
|
|
void resize( const QSize& s );
|
|
QSize minimumSize() const;
|
|
void borders( int& left, int& right, int& top, int& bottom ) const;
|
|
protected:
|
|
void doShape();
|
|
void drawTitle(QPainter &p);
|
|
void resizeEvent( QResizeEvent* );
|
|
void paintEvent( QPaintEvent* );
|
|
void showEvent( QShowEvent* );
|
|
void mouseDoubleClickEvent( QMouseEvent * );
|
|
bool eventFilter( QObject* o, QEvent* e );
|
|
void captionChange();
|
|
void desktopChange();
|
|
void maximizeChange();
|
|
void iconChange();
|
|
void activeChange();
|
|
void shadeChange() {};
|
|
Position mousePosition(const QPoint &) const;
|
|
protected slots:
|
|
//void slotReset();
|
|
void menuButtonPressed();
|
|
void slotMaximize();
|
|
private:
|
|
QPixmap buffer;
|
|
KPixmap *aGradient, *iGradient;
|
|
MyButton *maxBtn, *stickyBtn, *mnuBtn;
|
|
QSpacerItem *titlebar;
|
|
QGridLayout* layout;
|
|
};
|
|
|
|
class KWMThemeFactory : public KDecorationFactory
|
|
{
|
|
public:
|
|
KWMThemeFactory();
|
|
~KWMThemeFactory();
|
|
KDecoration* createDecoration( KDecorationBridge* b );
|
|
bool reset( unsigned long mask );
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|
|
|