fix the effect kcm for kwin
(port it to KPluginFactory) svn path=/trunk/KDE/kdebase/workspace/; revision=714825
This commit is contained in:
parent
69058845e6
commit
4ff6a33526
10 changed files with 40 additions and 19 deletions
|
@ -84,7 +84,7 @@ void EffectsHandlerImpl::reconfigure()
|
|||
}
|
||||
|
||||
// the idea is that effects call this function again which calls the next one
|
||||
void EffectsHandlerImpl::prePaintScreen( ScreenPrePaintData& data, int time )
|
||||
void EffectsHandlerImpl::cprePaintScreen( ScreenPrePaintData& data, int time )
|
||||
{
|
||||
if( current_paint_screen < loaded_effects.size())
|
||||
{
|
||||
|
|
|
@ -99,7 +99,7 @@ if(OPENGL_FOUND)
|
|||
DESTINATION ${DATA_INSTALL_DIR}/kwin )
|
||||
|
||||
# config modules
|
||||
KWIN4_ADD_EFFECT_CONFIG( builtins presentwindows_config.cpp shadow_config.cpp )
|
||||
KWIN4_ADD_EFFECT_CONFIG( builtins presentwindows_config.cpp shadow_config.cpp configs_builtins.cpp)
|
||||
install( FILES
|
||||
presentwindows_config.desktop
|
||||
shadow_config.desktop
|
||||
|
|
21
effects/configs_builtins.cpp
Normal file
21
effects/configs_builtins.cpp
Normal file
|
@ -0,0 +1,21 @@
|
|||
/*****************************************************************
|
||||
KWin - the KDE window manager
|
||||
This file is part of the KDE project.
|
||||
|
||||
Copyright (C) 2007 Bernhard Loos <nhuh.put@web.de>
|
||||
|
||||
You can Freely distribute this program under the GNU General Public
|
||||
License. See the file "COPYING" for the exact licensing terms.
|
||||
******************************************************************/
|
||||
|
||||
#include "shadow_config.h"
|
||||
#include "presentwindows_config.h"
|
||||
|
||||
#include <kwineffects.h>
|
||||
|
||||
#include <KPluginLoader>
|
||||
|
||||
K_PLUGIN_FACTORY_DEFINITION(EffectFactory, registerPlugin<KWin::ShadowEffectConfig>("shadow");
|
||||
registerPlugin<KWin::PresentWindowsEffectConfig>("presentwindows");)
|
||||
K_EXPORT_PLUGIN(EffectFactory("kcm_kwineffect"))
|
||||
|
|
@ -12,7 +12,6 @@ License. See the file "COPYING" for the exact licensing terms.
|
|||
|
||||
#include <kwineffects.h>
|
||||
|
||||
#include <kgenericfactory.h>
|
||||
#include <klocale.h>
|
||||
#include <kdebug.h>
|
||||
|
||||
|
@ -21,13 +20,12 @@ License. See the file "COPYING" for the exact licensing terms.
|
|||
#include <QLabel>
|
||||
#include <QComboBox>
|
||||
|
||||
KWIN_EFFECT_CONFIG( presentwindows, KWin::PresentWindowsEffectConfig )
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
PresentWindowsEffectConfig::PresentWindowsEffectConfig(QWidget* parent, const QStringList& args) :
|
||||
KCModule(KGenericFactory<PresentWindowsEffectConfig>::componentData(), parent, args)
|
||||
PresentWindowsEffectConfig::PresentWindowsEffectConfig(QWidget* parent, const QVariantList& args) :
|
||||
KCModule(EffectFactory::componentData(), parent, args)
|
||||
{
|
||||
kDebug() ;
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ Type=Service
|
|||
ServiceTypes=KCModule
|
||||
|
||||
X-KDE-Library=kcm_kwin4_effect_builtins
|
||||
X-KDE-FactoryName=kcm_kwineffect_presentwindows
|
||||
X-KDE-ParentComponents=kwin4_effect_presentwindows
|
||||
X-KDE-PluginKeyword=presentwindows
|
||||
|
||||
Name=Present Windows
|
||||
Name[ar]=نوافذ حديثة
|
||||
|
|
|
@ -17,7 +17,6 @@ License. See the file "COPYING" for the exact licensing terms.
|
|||
|
||||
class QComboBox;
|
||||
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
|
@ -25,7 +24,7 @@ class PresentWindowsEffectConfig : public KCModule
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit PresentWindowsEffectConfig(QWidget* parent = 0, const QStringList& args = QStringList());
|
||||
explicit PresentWindowsEffectConfig(QWidget* parent = 0, const QVariantList& args = QVariantList());
|
||||
~PresentWindowsEffectConfig();
|
||||
|
||||
virtual void save();
|
||||
|
|
|
@ -12,7 +12,6 @@ License. See the file "COPYING" for the exact licensing terms.
|
|||
|
||||
#include <kwineffects.h>
|
||||
|
||||
#include <kgenericfactory.h>
|
||||
#include <klocale.h>
|
||||
#include <kdebug.h>
|
||||
|
||||
|
@ -21,13 +20,12 @@ License. See the file "COPYING" for the exact licensing terms.
|
|||
#include <QLabel>
|
||||
#include <QSpinBox>
|
||||
|
||||
KWIN_EFFECT_CONFIG( shadow, KWin::ShadowEffectConfig )
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
ShadowEffectConfig::ShadowEffectConfig(QWidget* parent, const QStringList& args) :
|
||||
KCModule(KGenericFactory<ShadowEffectConfig>::componentData(), parent, args)
|
||||
ShadowEffectConfig::ShadowEffectConfig(QWidget* parent, const QVariantList& args) :
|
||||
KCModule(EffectFactory::componentData(), parent, args)
|
||||
{
|
||||
kDebug() ;
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ Type=Service
|
|||
ServiceTypes=KCModule
|
||||
|
||||
X-KDE-Library=kcm_kwin4_effect_builtins
|
||||
X-KDE-FactoryName=kcm_kwineffect_shadow
|
||||
X-KDE-ParentComponents=kwin4_effect_shadow
|
||||
X-KDE-PluginKeyword=shadow
|
||||
|
||||
Name=Shadow
|
||||
Name[be]=Цень
|
||||
|
|
|
@ -17,7 +17,6 @@ License. See the file "COPYING" for the exact licensing terms.
|
|||
|
||||
class QSpinBox;
|
||||
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
|
@ -25,7 +24,7 @@ class ShadowEffectConfig : public KCModule
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ShadowEffectConfig(QWidget* parent = 0, const QStringList& args = QStringList());
|
||||
explicit ShadowEffectConfig(QWidget* parent = 0, const QVariantList& args = QVariantList());
|
||||
~ShadowEffectConfig();
|
||||
|
||||
virtual void save();
|
||||
|
|
|
@ -24,6 +24,8 @@ License. See the file "COPYING" for the exact licensing terms.
|
|||
#include <QtCore/QList>
|
||||
#include <QtCore/QHash>
|
||||
|
||||
#include <KPluginFactory>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
class KLibrary;
|
||||
|
@ -159,9 +161,13 @@ class KWIN_EXPORT Effect
|
|||
* E.g. KWIN_EFFECT_CONFIG( flames, MyFlameEffectConfig )
|
||||
**/
|
||||
#define KWIN_EFFECT_CONFIG( name, classname ) \
|
||||
K_EXPORT_COMPONENT_FACTORY( \
|
||||
kcm_kwineffect_##name, \
|
||||
KGenericFactory<classname>( "kcm_kwineffect_" #name ) )
|
||||
K_PLUGIN_FACTORY(name##_factory, registerPlugin<classname>();) \
|
||||
K_EXPORT_PLUGIN(name##_factory("kcm_kwineffect_" #name))
|
||||
|
||||
/**
|
||||
* The declaration of the factory to export the effect
|
||||
**/
|
||||
K_PLUGIN_FACTORY_DECLARATION(EffectFactory)
|
||||
|
||||
|
||||
class KWIN_EXPORT EffectsHandler
|
||||
|
|
Loading…
Reference in a new issue