2003-08-29 22:49:03 +00:00
|
|
|
/* Plastik KWin window decoration
|
|
|
|
Copyright (C) 2003 Sandro Giessl <ceebx@users.sourceforge.net>
|
|
|
|
|
|
|
|
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., 59 Temple Place - Suite 330,
|
|
|
|
Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef KNIFTYCLIENT_H
|
|
|
|
#define KNIFTYCLIENT_H
|
|
|
|
|
2005-03-11 20:14:04 +00:00
|
|
|
#include <kcommondecoration.h>
|
2003-08-29 22:49:03 +00:00
|
|
|
|
2005-03-11 20:14:04 +00:00
|
|
|
#include "plastik.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
|
|
|
|
|
|
|
class PlastikButton;
|
|
|
|
|
2005-03-11 20:14:04 +00:00
|
|
|
class PlastikClient : public KCommonDecoration
|
2003-08-29 22:49:03 +00:00
|
|
|
{
|
|
|
|
public:
|
2003-09-17 18:43:17 +00:00
|
|
|
PlastikClient(KDecorationBridge* bridge, KDecorationFactory* factory);
|
2003-08-29 22:49:03 +00:00
|
|
|
~PlastikClient();
|
|
|
|
|
2005-03-11 20:14:04 +00:00
|
|
|
virtual QString visibleName() const;
|
|
|
|
virtual QString defaultButtonsLeft() const;
|
|
|
|
virtual QString defaultButtonsRight() const;
|
|
|
|
virtual bool decorationBehaviour(DecorationBehaviour behaviour) const;
|
|
|
|
virtual int layoutMetric(LayoutMetric lm, bool respectWindowState = true, const KCommonDecorationButton * = 0) const;
|
|
|
|
virtual QRegion cornerShape(WindowCorner corner);
|
|
|
|
virtual KCommonDecorationButton *createButton(ButtonType type);
|
|
|
|
|
2003-09-17 18:43:17 +00:00
|
|
|
virtual void init();
|
2005-03-11 20:14:04 +00:00
|
|
|
virtual void reset( unsigned long changed );
|
2003-09-17 18:43:17 +00:00
|
|
|
|
2005-03-11 20:14:04 +00:00
|
|
|
virtual void paintEvent(QPaintEvent *e);
|
|
|
|
virtual void updateCaption();
|
2003-09-17 18:43:17 +00:00
|
|
|
|
2005-03-12 19:31:31 +00:00
|
|
|
const QPixmap &getTitleBarTile(bool active) const;
|
2003-08-29 22:49:03 +00:00
|
|
|
|
|
|
|
private:
|
2005-03-11 20:14:04 +00:00
|
|
|
QRect captionRect() const;
|
2003-08-29 22:49:03 +00:00
|
|
|
|
2005-03-15 16:09:49 +00:00
|
|
|
const QPixmap &captionPixmap() const;
|
|
|
|
void clearCaptionPixmaps();
|
|
|
|
|
|
|
|
mutable QPixmap *m_captionPixmaps[2];
|
2003-08-29 22:49:03 +00:00
|
|
|
|
2005-03-11 20:14:04 +00:00
|
|
|
QRect m_captionRect;
|
|
|
|
QString oldCaption;
|
2003-08-29 22:49:03 +00:00
|
|
|
|
|
|
|
// settings...
|
|
|
|
QFont s_titleFont;
|
|
|
|
};
|
|
|
|
|
2003-09-17 18:43:17 +00:00
|
|
|
} // KWinPlastik
|
2003-08-29 22:49:03 +00:00
|
|
|
|
|
|
|
#endif // KNIFTCLIENT_H
|