2003-08-29 22:49:03 +00:00
|
|
|
/* Plastik KWin window decoration
|
2005-03-22 23:08:50 +00:00
|
|
|
Copyright (C) 2003-2005 Sandro Giessl <sandro@giessl.com>
|
2003-08-29 22:49:03 +00:00
|
|
|
|
|
|
|
based on the window decoration "Web":
|
|
|
|
Copyright (C) 2001 Rik Hemsley (rikkus) <rik@kde.org>
|
|
|
|
|
|
|
|
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
|
2005-10-05 08:44:32 +00:00
|
|
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
2005-07-04 19:02:09 +00:00
|
|
|
Boston, MA 02110-1301, USA.
|
2003-08-29 22:49:03 +00:00
|
|
|
*/
|
|
|
|
|
2005-03-12 19:31:31 +00:00
|
|
|
#ifndef PLASTIK_H
|
|
|
|
#define PLASTIK_H
|
|
|
|
|
|
|
|
#include <qfont.h>
|
2003-08-29 22:49:03 +00:00
|
|
|
|
2003-09-17 18:43:17 +00:00
|
|
|
#include <kdecoration.h>
|
|
|
|
#include <kdecorationfactory.h>
|
2003-08-29 22:49:03 +00:00
|
|
|
|
2003-09-17 18:43:17 +00:00
|
|
|
namespace KWinPlastik {
|
2003-08-29 22:49:03 +00:00
|
|
|
|
|
|
|
enum ColorType {
|
|
|
|
WindowContour=0,
|
2005-03-16 20:00:13 +00:00
|
|
|
TitleGradient1, // top
|
|
|
|
TitleGradient2,
|
|
|
|
TitleGradient3, // bottom
|
2005-03-20 21:07:11 +00:00
|
|
|
ShadeTitleLight,
|
|
|
|
ShadeTitleDark,
|
2003-08-29 22:49:03 +00:00
|
|
|
Border,
|
|
|
|
TitleFont
|
|
|
|
};
|
|
|
|
|
2005-03-12 19:31:31 +00:00
|
|
|
enum Pixmaps {
|
2005-03-15 14:07:37 +00:00
|
|
|
TitleBarTileTop=0,
|
|
|
|
TitleBarTile,
|
2005-03-20 21:07:11 +00:00
|
|
|
TitleBarLeft,
|
|
|
|
TitleBarRight,
|
|
|
|
BorderLeftTile,
|
|
|
|
BorderRightTile,
|
|
|
|
BorderBottomTile,
|
|
|
|
BorderBottomLeft,
|
|
|
|
BorderBottomRight,
|
2005-03-12 19:31:31 +00:00
|
|
|
NumPixmaps
|
|
|
|
};
|
|
|
|
|
2005-03-19 16:16:33 +00:00
|
|
|
enum ButtonIcon {
|
|
|
|
CloseIcon = 0,
|
|
|
|
MaxIcon,
|
|
|
|
MaxRestoreIcon,
|
|
|
|
MinIcon,
|
|
|
|
HelpIcon,
|
|
|
|
OnAllDesktopsIcon,
|
|
|
|
NotOnAllDesktopsIcon,
|
|
|
|
KeepAboveIcon,
|
|
|
|
NoKeepAboveIcon,
|
|
|
|
KeepBelowIcon,
|
|
|
|
NoKeepBelowIcon,
|
|
|
|
ShadeIcon,
|
|
|
|
UnShadeIcon,
|
|
|
|
NumButtonIcons
|
2005-03-15 14:07:37 +00:00
|
|
|
};
|
|
|
|
|
2003-09-17 18:43:17 +00:00
|
|
|
class PlastikHandler: public QObject, public KDecorationFactory
|
2003-08-29 22:49:03 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
PlastikHandler();
|
|
|
|
~PlastikHandler();
|
2003-09-17 18:43:17 +00:00
|
|
|
virtual bool reset( unsigned long changed );
|
|
|
|
|
|
|
|
virtual KDecoration* createDecoration( KDecorationBridge* );
|
2004-11-05 15:33:09 +00:00
|
|
|
virtual bool supports( Ability ability );
|
2003-08-29 22:49:03 +00:00
|
|
|
|
2005-03-15 14:07:37 +00:00
|
|
|
const QPixmap &pixmap(Pixmaps type, bool active, bool toolWindow);
|
2005-03-19 16:16:33 +00:00
|
|
|
const QBitmap &buttonBitmap(ButtonIcon type, const QSize &size, bool toolWindow);
|
2005-03-12 19:31:31 +00:00
|
|
|
|
2005-03-12 20:13:51 +00:00
|
|
|
int titleHeight() { return m_titleHeight; }
|
|
|
|
int titleHeightTool() { return m_titleHeightTool; }
|
|
|
|
const QFont &titleFont() { return m_titleFont; }
|
|
|
|
const QFont &titleFontTool() { return m_titleFontTool; }
|
|
|
|
bool titleShadow() { return m_titleShadow; }
|
|
|
|
int borderSize() { return m_borderSize; }
|
|
|
|
bool animateButtons() { return m_animateButtons; }
|
|
|
|
bool menuClose() { return m_menuClose; }
|
2005-07-28 14:59:42 +00:00
|
|
|
Qt::AlignmentFlag titleAlign() { return m_titleAlign; }
|
2005-03-12 20:13:51 +00:00
|
|
|
bool reverseLayout() { return m_reverse; }
|
|
|
|
QColor getColor(KWinPlastik::ColorType type, const bool active = true);
|
|
|
|
|
2005-07-28 14:59:42 +00:00
|
|
|
QList< PlastikHandler::BorderSize > borderSizes() const;
|
2003-08-29 22:49:03 +00:00
|
|
|
private:
|
|
|
|
void readConfig();
|
|
|
|
|
2005-03-20 22:24:04 +00:00
|
|
|
bool m_coloredBorder;
|
2005-03-12 20:13:51 +00:00
|
|
|
bool m_titleShadow;
|
|
|
|
bool m_animateButtons;
|
|
|
|
bool m_menuClose;
|
|
|
|
bool m_reverse;
|
|
|
|
int m_borderSize;
|
|
|
|
int m_titleHeight;
|
|
|
|
int m_titleHeightTool;
|
|
|
|
QFont m_titleFont;
|
|
|
|
QFont m_titleFontTool;
|
2005-07-28 14:59:42 +00:00
|
|
|
Qt::AlignmentFlag m_titleAlign;
|
2005-03-12 19:31:31 +00:00
|
|
|
|
|
|
|
// pixmap cache
|
2005-03-19 16:16:33 +00:00
|
|
|
QPixmap *m_pixmaps[2][2][NumPixmaps]; // button pixmaps have normal+pressed state...
|
|
|
|
QBitmap *m_bitmaps[2][NumButtonIcons];
|
2003-08-29 22:49:03 +00:00
|
|
|
};
|
|
|
|
|
2005-03-12 19:31:31 +00:00
|
|
|
PlastikHandler* Handler();
|
|
|
|
|
2003-09-17 18:43:17 +00:00
|
|
|
} // KWinPlastik
|
2003-08-29 22:49:03 +00:00
|
|
|
|
2005-03-12 19:31:31 +00:00
|
|
|
#endif // PLASTIK_H
|