KWin
|
#include <quickeffect.h>
Signals | |
void | itemDraggedOutOfScreen (QQuickItem *item, QList< Output * > screens) |
void | itemDroppedOutOfScreen (const QPointF &globalPos, QQuickItem *item, Output *screen) |
void | activeViewChanged (KWin::QuickSceneView *view) |
void | delegateChanged () |
Public Member Functions | |
QuickSceneEffect (QObject *parent=nullptr) | |
~QuickSceneEffect () override | |
bool | isRunning () const |
void | setRunning (bool running) |
QuickSceneView * | activeView () const |
Q_INVOKABLE QuickSceneView * | viewForScreen (Output *screen) const |
Q_INVOKABLE QuickSceneView * | viewAt (const QPoint &pos) const |
Q_INVOKABLE KWin::QuickSceneView * | getView (Qt::Edge edge) |
Q_INVOKABLE void | activateView (QuickSceneView *view) |
QQmlComponent * | delegate () const |
void | setDelegate (QQmlComponent *delegate) |
QUrl | source () const |
void | setSource (const QUrl &url) |
bool | eventFilter (QObject *watched, QEvent *event) override |
void | prePaintScreen (ScreenPrePaintData &data, std::chrono::milliseconds presentTime) override |
void | paintScreen (const RenderTarget &renderTarget, const RenderViewport &viewport, int mask, const QRegion ®ion, Output *screen) override |
bool | isActive () const override |
void | windowInputMouseEvent (QEvent *event) override |
void | grabbedKeyboardEvent (QKeyEvent *keyEvent) override |
bool | touchDown (qint32 id, const QPointF &pos, std::chrono::microseconds time) override |
bool | touchMotion (qint32 id, const QPointF &pos, std::chrono::microseconds time) override |
bool | touchUp (qint32 id, std::chrono::microseconds time) override |
Q_INVOKABLE void | checkItemDraggedOutOfScreen (QQuickItem *item) |
Q_INVOKABLE void | checkItemDroppedOutOfScreen (const QPointF &globalPos, QQuickItem *item) |
![]() | |
Effect (QObject *parent=nullptr) | |
~Effect () override | |
virtual void | reconfigure (ReconfigureFlags flags) |
virtual void | postPaintScreen () |
virtual void | prePaintWindow (EffectWindow *w, WindowPrePaintData &data, std::chrono::milliseconds presentTime) |
virtual void | paintWindow (const RenderTarget &renderTarget, const RenderViewport &viewport, EffectWindow *w, int mask, QRegion region, WindowPaintData &data) |
virtual void | postPaintWindow (EffectWindow *w) |
virtual bool | provides (Feature) |
virtual bool | perform (Feature feature, const QVariantList &arguments) |
virtual void | drawWindow (const RenderTarget &renderTarget, const RenderViewport &viewport, EffectWindow *w, int mask, const QRegion ®ion, WindowPaintData &data) |
virtual QString | debug (const QString ¶meter) const |
virtual int | requestedEffectChainPosition () const |
virtual bool | tabletToolEvent (QTabletEvent *event) |
virtual bool | tabletToolButtonEvent (uint button, bool pressed, quint64 tabletToolId) |
virtual bool | tabletPadButtonEvent (uint button, bool pressed, void *tabletPadId) |
virtual bool | tabletPadStripEvent (int number, int position, bool isFinger, void *tabletPadId) |
virtual bool | tabletPadRingEvent (int number, int position, bool isFinger, void *tabletPadId) |
template<typename T > | |
int | animationTime (int defaultDuration) |
virtual bool | blocksDirectScanout () const |
Static Public Member Functions | |
static bool | supported () |
![]() | |
static QPointF | cursorPos () |
static double | animationTime (const KConfigGroup &cfg, const QString &key, int defaultTime) |
static double | animationTime (int defaultTime) |
static double | interpolate (double x, double y, double a) |
static void | setPositionTransformations (WindowPaintData &data, QRect ®ion, EffectWindow *w, const QRect &r, Qt::AspectRatioMode aspect) |
Protected Member Functions | |
virtual QVariantMap | initialProperties (Output *screen) |
Properties | |
QuickSceneView * | activeView |
QQmlComponent * | delegate |
Friends | |
class | QuickSceneEffectPrivate |
Additional Inherited Members | |
![]() | |
enum | { PAINT_WINDOW_OPAQUE = 1 << 0 , PAINT_WINDOW_TRANSLUCENT = 1 << 1 , PAINT_WINDOW_TRANSFORMED = 1 << 2 , PAINT_SCREEN_REGION = 1 << 3 , PAINT_SCREEN_TRANSFORMED = 1 << 4 , PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS = 1 << 5 , PAINT_SCREEN_BACKGROUND_FIRST = 1 << 6 } |
enum | Feature { Nothing = 0 , ScreenInversion , Blur , Contrast , HighlightWindows } |
enum | ReconfigureFlag { ReconfigureAll = 1 << 0 } |
![]() | |
virtual bool | borderActivated (ElectricBorder border) |
The QuickSceneEffect class provides a convenient way to write fullscreen QtQuick-based effects.
QuickSceneView objects are managed internally.
The QuickSceneEffect takes care of forwarding input events to QuickSceneView and rendering. You can override relevant hooks from the Effect class to customize input handling or rendering, although it's highly recommended that you avoid doing that.
Definition at line 75 of file quickeffect.h.
|
explicit |
Definition at line 172 of file quickeffect.cpp.
|
override |
Definition at line 178 of file quickeffect.cpp.
void KWin::QuickSceneEffect::activateView | ( | QuickSceneView * | view | ) |
Sets the given view as active. It will get a focusin event and all the other views will be set as inactive
Definition at line 341 of file quickeffect.cpp.
QuickSceneView * KWin::QuickSceneEffect::activeView | ( | ) | const |
Definition at line 287 of file quickeffect.cpp.
|
signal |
void KWin::QuickSceneEffect::checkItemDraggedOutOfScreen | ( | QQuickItem * | item | ) |
Definition at line 187 of file quickeffect.cpp.
void KWin::QuickSceneEffect::checkItemDroppedOutOfScreen | ( | const QPointF & | globalPos, |
QQuickItem * | item ) |
Definition at line 201 of file quickeffect.cpp.
QQmlComponent * KWin::QuickSceneEffect::delegate | ( | ) | const |
The delegate provides a template defining the contents of each instantiated screen view.
Definition at line 255 of file quickeffect.cpp.
|
signal |
|
override |
Definition at line 212 of file quickeffect.cpp.
KWin::QuickSceneView * KWin::QuickSceneEffect::getView | ( | Qt::Edge | edge | ) |
Get a view at the given direction from the active view Returns null if no other views exist in the given direction
Definition at line 298 of file quickeffect.cpp.
|
overridevirtual |
Reimplemented from KWin::Effect.
Reimplemented in KWin::WindowViewEffect, and KWin::TilesEditorEffect.
Definition at line 561 of file quickeffect.cpp.
|
protectedvirtual |
Reimplement this function to provide your initial properties for the scene view on the specified screen.
Reimplemented in KWin::TilesEditorEffect.
Definition at line 404 of file quickeffect.cpp.
|
overridevirtual |
Overwrite this method to indicate whether your effect will be doing something in the next frame to be rendered. If the method returns false
the effect will be excluded from the chained methods in the next rendered frame.
This method is called always directly before the paint loop begins. So it is totally fine to e.g. react on a window event, issue a repaint to trigger an animation and change a flag to indicate that this method returns true
.
As the method is called each frame, you should not perform complex calculations. Best use just a boolean flag.
The default implementation of this method returns true
.
Reimplemented from KWin::Effect.
Definition at line 399 of file quickeffect.cpp.
bool KWin::QuickSceneEffect::isRunning | ( | ) | const |
Returns true
if the effect is running; otherwise returns false
.
Definition at line 222 of file quickeffect.cpp.
|
signal |
|
signal |
|
overridevirtual |
In this method you can:
In OpenGL based compositing, the frameworks ensures that the context is current when this method is invoked.
Reimplemented from KWin::Effect.
Definition at line 385 of file quickeffect.cpp.
|
overridevirtual |
Called before starting to paint the screen. In this method you can:
presentTime specifies the expected monotonic time when the rendered frame will be displayed on the screen.
Reimplemented from KWin::Effect.
Definition at line 367 of file quickeffect.cpp.
void KWin::QuickSceneEffect::setDelegate | ( | QQmlComponent * | delegate | ) |
Definition at line 260 of file quickeffect.cpp.
void KWin::QuickSceneEffect::setRunning | ( | bool | running | ) |
Starts or stops the effect depending on running.
Definition at line 227 of file quickeffect.cpp.
void KWin::QuickSceneEffect::setSource | ( | const QUrl & | url | ) |
Sets the source url to url. Note that the QML component will be loaded the next time the effect is started.
While the effect is running, the source url cannot be changed.
In order to provide your custom initial properties, you need to override the initialProperties() function.
Definition at line 243 of file quickeffect.cpp.
QUrl KWin::QuickSceneEffect::source | ( | ) | const |
Returns the source URL.
Definition at line 238 of file quickeffect.cpp.
|
static |
Definition at line 182 of file quickeffect.cpp.
|
overridevirtual |
A touch point was pressed.
If the effect wants to exclusively use the touch event it should return true
. If false
is returned the touch event is passed to further effects.
In general an Effect should only return true
if it is the exclusive effect getting input events. E.g. has grabbed mouse events.
Default implementation returns false
.
id | The unique id of the touch point |
pos | The position of the touch point in global coordinates |
time | Timestamp |
Reimplemented from KWin::Effect.
Definition at line 572 of file quickeffect.cpp.
|
overridevirtual |
A touch point moved.
If the effect wants to exclusively use the touch event it should return true
. If false
is returned the touch event is passed to further effects.
In general an Effect should only return true
if it is the exclusive effect getting input events. E.g. has grabbed mouse events.
Default implementation returns false
.
id | The unique id of the touch point |
pos | The position of the touch point in global coordinates |
time | Timestamp |
Reimplemented from KWin::Effect.
Definition at line 583 of file quickeffect.cpp.
|
overridevirtual |
A touch point was released.
If the effect wants to exclusively use the touch event it should return true
. If false
is returned the touch event is passed to further effects.
In general an Effect should only return true
if it is the exclusive effect getting input events. E.g. has grabbed mouse events.
Default implementation returns false
.
id | The unique id of the touch point |
time | Timestamp |
Reimplemented from KWin::Effect.
Definition at line 593 of file quickeffect.cpp.
QuickSceneView * KWin::QuickSceneEffect::viewAt | ( | const QPoint & | pos | ) | const |
Returns the view at the specified pos in the global screen coordinates.
Definition at line 279 of file quickeffect.cpp.
QuickSceneView * KWin::QuickSceneEffect::viewForScreen | ( | Output * | screen | ) | const |
Returns the scene view on the specified screen
Definition at line 273 of file quickeffect.cpp.
|
overridevirtual |
Reimplemented from KWin::Effect.
Definition at line 524 of file quickeffect.cpp.
|
friend |
Definition at line 182 of file quickeffect.h.
|
read |
Definition at line 78 of file quickeffect.h.
|
readwrite |
Definition at line 79 of file quickeffect.h.