not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / kwin / lib / kcommondecoration_p.cpp
blob733b9d93d809ab853843080e746c2fd3b623428e
1 /*
2 This file is part of the KDE project.
4 Copyright (C) 2007 Lubos Lunak <l.lunak@kde.org>
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
25 #include "kcommondecoration_p.h"
27 #include "kcommondecoration.h"
28 #include "kdecorationbridge.h"
30 #include <assert.h>
32 #include "kcommondecoration_p.moc"
34 KCommonDecorationWrapper::KCommonDecorationWrapper( KCommonDecoration* deco, KDecorationBridge* bridge, KDecorationFactory* factory )
35 : KDecorationUnstable( bridge, factory )
36 , decoration( deco )
40 KCommonDecorationWrapper::~KCommonDecorationWrapper()
42 // the wrapper actually owns KCommonDecoration, since the wrapper is what KWin core uses
43 delete decoration;
46 void KCommonDecorationWrapper::init()
48 return decoration->init();
51 KCommonDecorationWrapper::Position KCommonDecorationWrapper::mousePosition( const QPoint& p ) const
53 return decoration->mousePosition( p );
56 void KCommonDecorationWrapper::borders( int& left, int& right, int& top, int& bottom ) const
58 return decoration->borders( left, right, top, bottom );
61 void KCommonDecorationWrapper::resize( const QSize& s )
63 return decoration->resize( s );
66 QSize KCommonDecorationWrapper::minimumSize() const
68 return decoration->minimumSize();
71 void KCommonDecorationWrapper::activeChange()
73 return decoration->activeChange();
76 void KCommonDecorationWrapper::captionChange()
78 return decoration->captionChange();
81 void KCommonDecorationWrapper::iconChange()
83 return decoration->iconChange();
86 void KCommonDecorationWrapper::maximizeChange()
88 return decoration->maximizeChange();
91 void KCommonDecorationWrapper::desktopChange()
93 return decoration->desktopChange();
96 void KCommonDecorationWrapper::shadeChange()
98 return decoration->shadeChange();
101 bool KCommonDecorationWrapper::drawbound( const QRect& geom, bool clear )
103 return decoration->drawbound( geom, clear );
106 bool KCommonDecorationWrapper::windowDocked( Position side )
108 return decoration->windowDocked( side );
111 void KCommonDecorationWrapper::reset( unsigned long changed )
113 return decoration->reset( changed );
116 QList<QRect> KCommonDecorationWrapper::shadowQuads( ShadowType type ) const
118 if( KCommonDecorationUnstable *decoration2 = dynamic_cast<KCommonDecorationUnstable*>( decoration ))
119 return decoration2->shadowQuads( type );
120 return QList<QRect>();
123 double KCommonDecorationWrapper::shadowOpacity( ShadowType type ) const
125 if( KCommonDecorationUnstable *decoration2 = dynamic_cast<KCommonDecorationUnstable*>( decoration ))
126 return decoration2->shadowOpacity( type );
127 return 1.0;
130 double KCommonDecorationWrapper::shadowBrightness( ShadowType type ) const
132 if( KCommonDecorationUnstable *decoration2 = dynamic_cast<KCommonDecorationUnstable*>( decoration ))
133 return decoration2->shadowBrightness( type );
134 return 1.0;
137 double KCommonDecorationWrapper::shadowSaturation( ShadowType type ) const
139 if( KCommonDecorationUnstable *decoration2 = dynamic_cast<KCommonDecorationUnstable*>( decoration ))
140 return decoration2->shadowSaturation( type );
141 return 1.0;