RFC: Introduce QtQuick effect API
In order to provide a simple way to write QtQuick based fullscreen effects, it's worth adding a QtQuick effect API in libkwineffects.
The Overview effect can be used as the seed. Potential api may look as follows
class KWINEFFECTS_EXPORT QuickScreenView : public OffscreenQuickView
{
stuff
};
class KWINEFFECTS_EXPORT QuickSceneEffect : public Effect
{
Q_OBJECT
public:
explicit QuickSceneEffect(QObject *parent = nullptr);
bool isRunning() const;
void setRunning(bool running);
bool acceptsPointerEvents() const;
void setAcceptsPointerEvents(bool accepts);
bool acceptsKeyboardEvents() const;
void setAcceptsKeyboardEvents(bool accepts);
bool acceptsTouchEvents() const;
void setAccepsTouchEvents(bool accepts);
QList<QuickScreenView *> views() const;
QuickScreenView *viewAt(const QPoint &pos) const;
protected:
virtual QuickScreenView *createView(EffectScreen *screen) = 0;
};
Another advantage of this approach is that the QuickEffect could have internal caching logic to avoid re-parsing qml files when the overview effect is toggled.
Class name candidates
- QuickEffect
- QuickSceneEffect
- QuickViewEffect
- QuickScreenEffect
- QuickWorkspaceEffect
- QuickFullscreenEffect
- other?
Edited by Vlad Zahorodnii