KWinLibraries
kdecorationfactory.cpp
Go to the documentation of this file.00001 /***************************************************************** 00002 This file is part of the KDE project. 00003 00004 Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org> 00005 00006 Permission is hereby granted, free of charge, to any person obtaining a 00007 copy of this software and associated documentation files (the "Software"), 00008 to deal in the Software without restriction, including without limitation 00009 the rights to use, copy, modify, merge, publish, distribute, sublicense, 00010 and/or sell copies of the Software, and to permit persons to whom the 00011 Software is furnished to do so, subject to the following conditions: 00012 00013 The above copyright notice and this permission notice shall be included in 00014 all copies or substantial portions of the Software. 00015 00016 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00017 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00018 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 00019 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00020 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 00021 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 00022 DEALINGS IN THE SOFTWARE. 00023 ******************************************************************/ 00024 00025 #include "kdecorationfactory.h" 00026 00027 #include <assert.h> 00028 00029 #include "kdecorationbridge.h" 00030 00031 KDecorationFactory::KDecorationFactory() 00032 { 00033 } 00034 00035 KDecorationFactory::~KDecorationFactory() 00036 { 00037 assert( _decorations.count() == 0 ); 00038 } 00039 00040 bool KDecorationFactory::reset( unsigned long ) 00041 { 00042 return true; 00043 } 00044 00045 void KDecorationFactory::checkRequirements( KDecorationProvides* ) 00046 { 00047 } 00048 00049 QList< KDecorationDefines::BorderSize > KDecorationFactory::borderSizes() const 00050 { 00051 return QList< BorderSize >() << BorderNormal; 00052 } 00053 00054 bool KDecorationFactory::exists( const KDecoration* deco ) const 00055 { 00056 return _decorations.contains( const_cast< KDecoration* >( deco )); 00057 } 00058 00059 void KDecorationFactory::addDecoration( KDecoration* deco ) 00060 { 00061 _decorations.append( deco ); 00062 } 00063 00064 void KDecorationFactory::removeDecoration( KDecoration* deco ) 00065 { 00066 _decorations.removeAll( deco ); 00067 } 00068 00069 void KDecorationFactory::resetDecorations( unsigned long changed ) 00070 { 00071 for( QList< KDecoration* >::ConstIterator it = _decorations.begin(); 00072 it != _decorations.end(); 00073 ++it ) 00074 (*it)->reset( changed ); 00075 } 00076 00077 NET::WindowType KDecorationFactory::windowType( unsigned long supported_types, KDecorationBridge* bridge ) const 00078 { 00079 return bridge->windowType( supported_types ); 00080 }