Make it possible to find out window type also in createDecoration().

svn path=/trunk/kdebase/kwin/; revision=254816
icc-effect-5.14.5
Luboš Luňák 2003-09-29 11:21:46 +00:00
parent c8c1c6c764
commit 81e475c523
6 changed files with 25 additions and 3 deletions

View File

@ -1,3 +1,3 @@
SUBDIRS = test keramik modernsystem default laptop redmond web quartz b2
SUBDIRS = keramik modernsystem default laptop redmond web quartz b2
#SUBDIRS = default kde1 riscos redmond quartz icewm web b2 \
# modernsystem laptop system kwmtheme kstep keramik

View File

@ -313,9 +313,12 @@ bool Decoration::animateMinimize(bool iconify)
}
return true;
}
KDecoration* Factory::createDecoration( KDecorationBridge* bridge )
{
NET::WindowType type = windowType( SUPPORTED_WINDOW_TYPES_MASK, bridge );
if( type == NET::Dialog )
;
return new Decoration( bridge, this );
}

View File

@ -8,6 +8,10 @@
namespace KWinTest
{
const int SUPPORTED_WINDOW_TYPES_MASK = NET::NormalMask | NET::DesktopMask | NET::DockMask
| NET::ToolbarMask | NET::MenuMask | NET::DialogMask | NET::OverrideMask | NET::TopMenuMask
| NET::UtilityMask | NET::SplashMask;
class Decoration
: public KDecoration
{

View File

@ -149,7 +149,7 @@ bool KDecoration::isResizable() const
}
NET::WindowType KDecoration::windowType( unsigned long supported_types ) const
{
{ // this one is also duplicated in KDecorationFactory
return bridge_->windowType( supported_types );
}

View File

@ -26,6 +26,8 @@ DEALINGS IN THE SOFTWARE.
#include <assert.h>
#include "kdecoration_p.h"
KDecorationFactory::KDecorationFactory()
{
}
@ -67,3 +69,8 @@ void KDecorationFactory::resetDecorations( unsigned long changed )
++it )
(*it)->reset( changed );
}
NET::WindowType KDecorationFactory::windowType( unsigned long supported_types, KDecorationBridge* bridge ) const
{
return bridge->windowType( supported_types );
}

View File

@ -91,6 +91,14 @@ class KDecorationFactory
* objects.
*/
void resetDecorations( unsigned long changed ); // convenience
/**
* This function has the same functionality like KDecoration::windowType().
* It can be used in createDecoration() to return different KDecoration
* inherited classes depending on the window type, as at that time
* KDecoration::windowType() is not available yet. The additional argument
* is the one passed to createDecoration().
*/
NET::WindowType windowType( unsigned long supported_types, KDecorationBridge* bridge ) const;
private:
QValueList< KDecoration* > _decorations;
KDecorationFactoryPrivate* d;