1 /* Plastik KWin window decoration
2 Copyright (C) 2003-2005 Sandro Giessl <sandro@giessl.com>
4 based on the window decoration "Web":
5 Copyright (C) 2001 Rik Hemsley (rikkus) <rik@kde.org>
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; see the file COPYING. If not, write to
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA.
23 #ifndef PLASTIKBUTTON_H
24 #define PLASTIKBUTTON_H
29 #include <kcommondecoration.h>
33 namespace KWinPlastik
{
37 class PlastikButton
: public KCommonDecorationButton
41 PlastikButton(ButtonType type
, PlastikClient
*parent
);
44 void reset(unsigned long changed
);
45 PlastikClient
* client() { return m_client
; }
51 void paintEvent(QPaintEvent
*);
54 void enterEvent(QEvent
*e
);
55 void leaveEvent(QEvent
*e
);
56 void drawButton(QPainter
*painter
);
59 PlastikClient
*m_client
;
60 ButtonIcon m_iconType
;
68 * This class creates bitmaps which can be used as icons on buttons. The icons
70 * Over the previous "Gimp->xpm->QImage->recolor->SmoothScale->QPixmap" solution
71 * it has the important advantage that icons are more scalable and at the same
72 * time sharp and not blurred.
77 static QBitmap
icon(ButtonIcon icon
, int size
);
87 static void drawObject(QPainter
&p
, Object object
, int x
, int y
, int length
, int lineWidth
);
90 } // namespace KWinPlastik
92 #endif // PLASTIKBUTTON_H