1 //////////////////////////////////////////////////////////////////////////////
4 // Ozone 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"
42 class OxygenClient
: public KCommonDecorationUnstable
46 OxygenClient(KDecorationBridge
*b
, KDecorationFactory
*f
);
47 virtual ~OxygenClient();
49 virtual QString
visibleName() const;
50 virtual KCommonDecorationButton
*createButton(::ButtonType type
);
51 virtual bool decorationBehaviour(DecorationBehaviour behaviour
) const;
52 virtual int layoutMetric(LayoutMetric lm
, bool respectWindowState
= true, const KCommonDecorationButton
* = 0) const;
53 virtual void updateWindowShape();
56 virtual QList
<QRect
> shadowQuads( ShadowType type
) const;
57 virtual double shadowOpacity( ShadowType type
) const;
60 void paintEvent(QPaintEvent
*e
);
61 void drawScratch(QPainter
*p
, QPalette
&palette
, const int start
, const int end
, const int topMargin
);
62 QColor
titlebarTextColor(const QPalette
&palette
);
63 bool colorCacheInvalid_
;
64 QColor cachedTitlebarTextColor_
;
67 friend class OxygenButton
;
68 OxygenHelper
&helper_
;
75 #endif // EXAMPLECLIENT_H