You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
128 lines
3.4 KiB
128 lines
3.4 KiB
15 years ago
|
/* Plastik KWin window decoration
|
||
|
Copyright (C) 2003-2005 Sandro Giessl <sandro@giessl.com>
|
||
|
|
||
|
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
|
||
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||
|
Boston, MA 02110-1301, USA.
|
||
|
*/
|
||
|
|
||
|
#ifndef PLASTIK_H
|
||
|
#define PLASTIK_H
|
||
|
|
||
15 years ago
|
#include <tqfont.h>
|
||
15 years ago
|
|
||
|
#include <kdecoration.h>
|
||
|
#include <kdecorationfactory.h>
|
||
|
|
||
|
namespace KWinPlastik {
|
||
|
|
||
|
enum ColorType {
|
||
|
WindowContour=0,
|
||
|
TitleGradient1, // top
|
||
|
TitleGradient2,
|
||
|
TitleGradient3, // bottom
|
||
|
ShadeTitleLight,
|
||
|
ShadeTitleDark,
|
||
|
Border,
|
||
|
TitleFont
|
||
|
};
|
||
|
|
||
|
enum Pixmaps {
|
||
|
TitleBarTileTop=0,
|
||
|
TitleBarTile,
|
||
|
TitleBarLeft,
|
||
|
TitleBarRight,
|
||
|
BorderLeftTile,
|
||
|
BorderRightTile,
|
||
|
BorderBottomTile,
|
||
|
BorderBottomLeft,
|
||
|
BorderBottomRight,
|
||
|
NumPixmaps
|
||
|
};
|
||
|
|
||
|
enum ButtonIcon {
|
||
|
CloseIcon = 0,
|
||
|
MaxIcon,
|
||
|
MaxRestoreIcon,
|
||
|
MinIcon,
|
||
|
HelpIcon,
|
||
|
OnAllDesktopsIcon,
|
||
|
NotOnAllDesktopsIcon,
|
||
|
KeepAboveIcon,
|
||
|
NoKeepAboveIcon,
|
||
|
KeepBelowIcon,
|
||
|
NoKeepBelowIcon,
|
||
|
ShadeIcon,
|
||
|
UnShadeIcon,
|
||
|
NumButtonIcons
|
||
|
};
|
||
|
|
||
15 years ago
|
class PlastikHandler: public TQObject, public KDecorationFactory
|
||
15 years ago
|
{
|
||
|
Q_OBJECT
|
||
|
public:
|
||
|
PlastikHandler();
|
||
|
~PlastikHandler();
|
||
|
virtual bool reset( unsigned long changed );
|
||
|
|
||
|
virtual KDecoration* createDecoration( KDecorationBridge* );
|
||
|
virtual bool supports( Ability ability );
|
||
|
|
||
15 years ago
|
const TQPixmap &pixmap(Pixmaps type, bool active, bool toolWindow);
|
||
|
const TQBitmap &buttonBitmap(ButtonIcon type, const TQSize &size, bool toolWindow);
|
||
15 years ago
|
|
||
|
int titleHeight() { return m_titleHeight; }
|
||
|
int titleHeightTool() { return m_titleHeightTool; }
|
||
15 years ago
|
const TQFont &titleFont() { return m_titleFont; }
|
||
|
const TQFont &titleFontTool() { return m_titleFontTool; }
|
||
15 years ago
|
bool titleShadow() { return m_titleShadow; }
|
||
|
int borderSize() { return m_borderSize; }
|
||
|
bool animateButtons() { return m_animateButtons; }
|
||
|
bool menuClose() { return m_menuClose; }
|
||
14 years ago
|
TQ_Alignment titleAlign() { return m_titleAlign; }
|
||
15 years ago
|
bool reverseLayout() { return m_reverse; }
|
||
15 years ago
|
TQColor getColor(KWinPlastik::ColorType type, const bool active = true);
|
||
15 years ago
|
|
||
15 years ago
|
TQValueList< PlastikHandler::BorderSize > borderSizes() const;
|
||
15 years ago
|
private:
|
||
|
void readConfig();
|
||
|
|
||
15 years ago
|
void pretile(TQPixmap *&pix, int size, Qt::Orientation dir) const;
|
||
15 years ago
|
|
||
|
bool m_coloredBorder;
|
||
|
bool m_titleShadow;
|
||
|
bool m_animateButtons;
|
||
|
bool m_menuClose;
|
||
|
bool m_reverse;
|
||
|
int m_borderSize;
|
||
|
int m_titleHeight;
|
||
|
int m_titleHeightTool;
|
||
15 years ago
|
TQFont m_titleFont;
|
||
|
TQFont m_titleFontTool;
|
||
14 years ago
|
TQ_Alignment m_titleAlign;
|
||
15 years ago
|
|
||
|
// pixmap cache
|
||
15 years ago
|
TQPixmap *m_pixmaps[2][2][NumPixmaps]; // button pixmaps have normal+pressed state...
|
||
|
TQBitmap *m_bitmaps[2][NumButtonIcons];
|
||
15 years ago
|
};
|
||
|
|
||
|
PlastikHandler* Handler();
|
||
|
|
||
|
} // KWinPlastik
|
||
|
|
||
|
#endif // PLASTIK_H
|