diff --git a/kcmkwin/kwindecoration/preview.cpp b/kcmkwin/kwindecoration/preview.cpp index 8e80ea2992..6e26aedb92 100644 --- a/kcmkwin/kwindecoration/preview.cpp +++ b/kcmkwin/kwindecoration/preview.cpp @@ -397,5 +397,10 @@ unsigned long KDecorationPreviewOptions::updateSettings() changed |= d->updateKWinSettings( &cfg ); return changed; } + +bool KDecorationPreviewPlugins::provides( Requirement ) + { + return false; + } #include "preview.moc" diff --git a/kcmkwin/kwindecoration/preview.h b/kcmkwin/kwindecoration/preview.h index c63770eb3f..13e1483cbf 100644 --- a/kcmkwin/kwindecoration/preview.h +++ b/kcmkwin/kwindecoration/preview.h @@ -24,11 +24,11 @@ #include #include +#include class QLabel; class KDecorationPreviewBridge; -class KDecorationPlugins; class KDecorationOptions; class KDecorationPreview @@ -117,5 +117,18 @@ class KDecorationPreviewOptions virtual ~KDecorationPreviewOptions(); virtual unsigned long updateSettings(); }; - + +class KDecorationPreviewPlugins + : public KDecorationPlugins + { + public: + KDecorationPreviewPlugins( KConfig* cfg ); + virtual bool provides( Requirement ); + }; + +inline KDecorationPreviewPlugins::KDecorationPreviewPlugins( KConfig* cfg ) + : KDecorationPlugins( cfg ) + { + } + #endif diff --git a/lib/kdecoration.h b/lib/kdecoration.h index 4a2f79931e..b75d72465d 100644 --- a/lib/kdecoration.h +++ b/lib/kdecoration.h @@ -125,8 +125,19 @@ public: BorderOversized, ///< Oversized borders BordersCount ///< @internal }; + + enum Ability { ABILITY_DUMMY = 10000000 }; + + enum Requirement { REQUIREMENT_DUMMY = 1000000 }; }; +class KDecorationProvides + : public KDecorationDefines + { + public: + virtual bool provides( Requirement req ) = 0; + }; + /** * This class holds various configuration settings for the decoration. * It is accessible from the decorations either as KDecoration::options() diff --git a/lib/kdecoration_plugins_p.cpp b/lib/kdecoration_plugins_p.cpp index 3f9341269e..975aa388ab 100644 --- a/lib/kdecoration_plugins_p.cpp +++ b/lib/kdecoration_plugins_p.cpp @@ -161,6 +161,7 @@ bool KDecorationPlugins::loadPlugin( QString nameStr ) return false; } fact = create_ptr(); + fact->checkRequirements( this ); // let it check what is supported pluginStr = nameStr; diff --git a/lib/kdecoration_plugins_p.h b/lib/kdecoration_plugins_p.h index e283071aa0..36206fdfe6 100644 --- a/lib/kdecoration_plugins_p.h +++ b/lib/kdecoration_plugins_p.h @@ -34,13 +34,16 @@ DEALINGS IN THE SOFTWARE. #include #include +#include "kdecoration.h" + class KLibrary; +class KConfig; class KDecoration; class KDecorationBridge; class KDecorationFactory; -class KConfig; class KDecorationPlugins + : public KDecorationProvides { public: KDecorationPlugins( KConfig* cfg ); diff --git a/lib/kdecorationfactory.cpp b/lib/kdecorationfactory.cpp index 38cf41ba01..74508501b1 100644 --- a/lib/kdecorationfactory.cpp +++ b/lib/kdecorationfactory.cpp @@ -47,6 +47,10 @@ bool KDecorationFactory::supports( Ability ) return false; } +void KDecorationFactory::checkRequirements( KDecorationProvides* ) + { + } + QValueList< KDecorationDefines::BorderSize > KDecorationFactory::borderSizes() const { return QValueList< BorderSize >() << BorderNormal; diff --git a/lib/kdecorationfactory.h b/lib/kdecorationfactory.h index f55f3058f2..093f8fe34b 100644 --- a/lib/kdecorationfactory.h +++ b/lib/kdecorationfactory.h @@ -35,7 +35,6 @@ class KDecorationFactory : public KDecorationDefines { public: - enum Ability { NOTHING_YET }; // FRAME pridat, + pamatovat na 32bitu? /** * Constructor. Called after loading the decoration plugin. All global * initialization of the plugin should be done in the factory constructor. @@ -72,6 +71,8 @@ class KDecorationFactory virtual QValueList< BorderSize > borderSizes() const; virtual bool supports( Ability ability ); + + virtual void checkRequirements( KDecorationProvides* provides ); /** * Returns the KDecorationOptions object, which is used to access * configuration settings for the decoration. diff --git a/plugins.cpp b/plugins.cpp index fe88774107..5ab58e75da 100644 --- a/plugins.cpp +++ b/plugins.cpp @@ -34,4 +34,9 @@ void PluginMgr::error( const QString &error_msg ) exit(1); } +bool PluginMgr::provides( Requirement ) + { + return false; + } + } // namespace diff --git a/plugins.h b/plugins.h index fc6c200459..7e779098c6 100644 --- a/plugins.h +++ b/plugins.h @@ -22,6 +22,7 @@ class PluginMgr { public: PluginMgr(); + virtual bool provides( Requirement ); protected: virtual void error( const QString& error_msg ); };