1 //////////////////////////////////////////////////////////////////////////////
4 // Oxygen window decoration for KDE
6 // Copyright (c) 2003, 2004 David Johnson <david@usermode.org>
7 // Copyright (c) 2006, 2007 Riccardo Iaconelli <ruphy@fsfe.org>
9 // Permission is hereby granted, free of charge, to any person obtaining a copy
10 // of this software and associated documentation files (the "Software"), to
11 // deal in the Software without restriction, including without limitation the
12 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
13 // sell copies of the Software, and to permit persons to whom the Software is
14 // furnished to do so, subject to the following conditions:
16 // The above copyright notice and this permission notice shall be included in
17 // all copies or substantial portions of the Software.
19 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
26 //////////////////////////////////////////////////////////////////////////////
28 #ifndef OXYGENCLIENT_H
29 #define OXYGENCLIENT_H
32 #include <kcommondecoration.h>
34 #include "lib/helper.h"
40 class OxygenClient
: public KCommonDecorationUnstable
44 OxygenClient(KDecorationBridge
*b
, KDecorationFactory
*f
);
45 virtual ~OxygenClient();
47 virtual QString
visibleName() const;
48 virtual KCommonDecorationButton
*createButton(::ButtonType type
);
49 virtual bool decorationBehaviour(DecorationBehaviour behaviour
) const;
50 virtual int layoutMetric(LayoutMetric lm
, bool respectWindowState
= true, const KCommonDecorationButton
* = 0) const;
51 virtual void updateWindowShape();
54 virtual QList
<QRect
> shadowQuads( ShadowType type
) const;
55 virtual double shadowOpacity( ShadowType type
) const;
58 void paintEvent(QPaintEvent
*e
);
59 void drawScratch(QPainter
*p
, QPalette
&palette
, const int start
, const int end
, const int topMargin
);
60 QColor
titlebarTextColor(const QPalette
&palette
);
61 bool colorCacheInvalid_
;
62 QColor cachedTitlebarTextColor_
;
65 friend class OxygenButton
;
66 OxygenHelper
&helper_
;
72 #endif // EXAMPLECLIENT_H