KWin
|
#include <effectloader.h>
Public Member Functions | |
PluginEffectLoader (QObject *parent=nullptr) | |
~PluginEffectLoader () override | |
bool | hasEffect (const QString &name) const override |
Whether this Effect Loader can load the Effect with the given name . | |
bool | isEffectSupported (const QString &name) const override |
Whether the Effect with the given name is supported by the compositing backend. | |
QStringList | listOfKnownEffects () const override |
All the Effects this loader knows of. | |
void | clear () override |
Clears the load queue, that is all scheduled Effects are discarded from loading. | |
void | queryAndLoadAll () override |
The Effect Loader should query its store for all available effects and try to load them. | |
bool | loadEffect (const QString &name) override |
Synchronous loading of the Effect with the given name . | |
bool | loadEffect (const KPluginMetaData &info, LoadEffectFlags flags) |
void | setPluginSubDirectory (const QString &directory) |
![]() | |
~AbstractEffectLoader () override | |
virtual void | setConfig (KSharedConfig::Ptr config) |
The KSharedConfig this EffectLoader should operate on. | |
Additional Inherited Members | |
![]() | |
void | effectLoaded (KWin::Effect *effect, const QString &name) |
The loader emits this signal when it successfully loaded an effect. | |
![]() | |
AbstractEffectLoader (QObject *parent=nullptr) | |
LoadEffectFlags | readConfig (const QString &effectName, bool defaultValue) const |
Checks the configuration for the Effect identified by effectName . | |
Definition at line 301 of file effectloader.h.
|
explicit |
Definition at line 251 of file effectloader.cpp.
|
override |
Definition at line 257 of file effectloader.cpp.
|
overridevirtual |
Clears the load queue, that is all scheduled Effects are discarded from loading.
Implements KWin::AbstractEffectLoader.
Definition at line 404 of file effectloader.cpp.
|
overridevirtual |
Whether this Effect Loader can load the Effect with the given name
.
The Effect Loader determines whether it knows or can find an Effect called name
, and thus whether it can attempt to load the Effect.
name | The name of the Effect to look for. |
true
if the Effect Loader knows this effect, false otherwise Implements KWin::AbstractEffectLoader.
Definition at line 261 of file effectloader.cpp.
|
overridevirtual |
Whether the Effect with the given name
is supported by the compositing backend.
name | The name of the Effect to check. |
true
if it is supported, false
otherwise Implements KWin::AbstractEffectLoader.
Definition at line 279 of file effectloader.cpp.
|
overridevirtual |
All the Effects this loader knows of.
The implementation should re-query its store whenever this method is invoked. It's possible that the store of effects changed (e.g. a new one got installed)
Implements KWin::AbstractEffectLoader.
Definition at line 313 of file effectloader.cpp.
bool KWin::PluginEffectLoader::loadEffect | ( | const KPluginMetaData & | info, |
LoadEffectFlags | flags ) |
Definition at line 333 of file effectloader.cpp.
|
overridevirtual |
Synchronous loading of the Effect with the given name
.
Loads the Effect without checking any configuration value or any enabled by default function provided by the Effect.
The loader is expected to apply the following checks: If the Effect is already loaded, the Effect should not get loaded again. Thus the loader is expected to track which Effects it has loaded, and which of those have been destroyed. The loader should check whether the Effect is supported. If the Effect indicates it is not supported, it should not get loaded.
If the Effect loaded successfully the signal effectLoaded(KWin::Effect*,const QString&) must be emitted. Otherwise the user of the loader is not able to get the loaded Effect. It's not returning the Effect as queryAndLoadAll() is working async and thus the users of the loader are expected to be prepared for async loading.
name | The internal name of the Effect which should be loaded |
true
if the effect could be loaded, false
in error case Implements KWin::AbstractEffectLoader.
Definition at line 324 of file effectloader.cpp.
|
overridevirtual |
The Effect Loader should query its store for all available effects and try to load them.
The Effect Loader is supposed to perform this operation in a highly async way. If there is IO which needs to be performed this should be done in a background thread and a queue should be used to load the effects. The loader should make sure to not load more than one Effect in one event cycle. Loading the Effect has to be performed in the Compositor thread and thus blocks the Compositor. Therefore after loading one Effect all events should get processed first, so that the Compositor can perform a painting pass if needed. To simplify this operation one can use the EffectLoadQueue. This requires to add another loadEffect method with the custom loader specific type to refer to an Effect and LoadEffectFlags.
The LoadEffectFlags have to be determined by querying the configuration with readConfig(). If the Load flag is set the loading can proceed and all the checks from loadEffect(const QString &) have to be applied. In addition if the CheckDefaultFunction flag is set and the Effect provides such a method, it should be queried to determine whether the Effect is enabled by default. If such a method returns false
the Effect should not get loaded. If the Effect does not provide a way to query whether it's enabled by default at runtime the flag can get ignored.
If the Effect loaded successfully the signal effectLoaded(KWin::Effect*,const QString&) must be emitted.
Implements KWin::AbstractEffectLoader.
Definition at line 383 of file effectloader.cpp.
void KWin::PluginEffectLoader::setPluginSubDirectory | ( | const QString & | directory | ) |
Definition at line 399 of file effectloader.cpp.