KWin
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
KWin::ShakeCursorEffect Class Reference

#include <shakecursor.h>

Inheritance diagram for KWin::ShakeCursorEffect:
KWin::Effect KWin::InputEventSpy

Public Member Functions

 ShakeCursorEffect ()
 
 ~ShakeCursorEffect () override
 
void reconfigure (ReconfigureFlags flags) override
 
void pointerEvent (MouseEvent *event) override
 
bool isActive () const override
 
void paintScreen (const RenderTarget &renderTarget, const RenderViewport &viewport, int mask, const QRegion &region, Output *screen) override
 
- Public Member Functions inherited from KWin::Effect
 Effect (QObject *parent=nullptr)
 
 ~Effect () override
 
virtual void prePaintScreen (ScreenPrePaintData &data, std::chrono::milliseconds presentTime)
 
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 &region, WindowPaintData &data)
 
virtual void windowInputMouseEvent (QEvent *e)
 
virtual void grabbedKeyboardEvent (QKeyEvent *e)
 
virtual QString debug (const QString &parameter) const
 
virtual int requestedEffectChainPosition () const
 
virtual bool touchDown (qint32 id, const QPointF &pos, std::chrono::microseconds time)
 
virtual bool touchMotion (qint32 id, const QPointF &pos, std::chrono::microseconds time)
 
virtual bool touchUp (qint32 id, std::chrono::microseconds time)
 
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
 
- Public Member Functions inherited from KWin::InputEventSpy
 InputEventSpy ()
 
virtual ~InputEventSpy ()
 
virtual void wheelEvent (WheelEvent *event)
 
virtual void keyEvent (KeyEvent *event)
 
virtual void touchDown (qint32 id, const QPointF &pos, std::chrono::microseconds time)
 
virtual void touchMotion (qint32 id, const QPointF &pos, std::chrono::microseconds time)
 
virtual void touchUp (qint32 id, std::chrono::microseconds time)
 
virtual void pinchGestureBegin (int fingerCount, std::chrono::microseconds time)
 
virtual void pinchGestureUpdate (qreal scale, qreal angleDelta, const QPointF &delta, std::chrono::microseconds time)
 
virtual void pinchGestureEnd (std::chrono::microseconds time)
 
virtual void pinchGestureCancelled (std::chrono::microseconds time)
 
virtual void swipeGestureBegin (int fingerCount, std::chrono::microseconds time)
 
virtual void swipeGestureUpdate (const QPointF &delta, std::chrono::microseconds time)
 
virtual void swipeGestureEnd (std::chrono::microseconds time)
 
virtual void swipeGestureCancelled (std::chrono::microseconds time)
 
virtual void holdGestureBegin (int fingerCount, std::chrono::microseconds time)
 
virtual void holdGestureEnd (std::chrono::microseconds time)
 
virtual void holdGestureCancelled (std::chrono::microseconds time)
 
virtual void switchEvent (SwitchEvent *event)
 
virtual void tabletToolEvent (TabletEvent *event)
 
virtual void tabletToolButtonEvent (uint button, bool pressed, const TabletToolId &tabletToolId, std::chrono::microseconds time)
 
virtual void tabletPadButtonEvent (uint button, bool pressed, const TabletPadId &tabletPadId, std::chrono::microseconds time)
 
virtual void tabletPadStripEvent (int number, int position, bool isFinger, const TabletPadId &tabletPadId, std::chrono::microseconds time)
 
virtual void tabletPadRingEvent (int number, int position, bool isFinger, const TabletPadId &tabletPadId, std::chrono::microseconds time)
 

Static Public Member Functions

static bool supported ()
 
- Static Public Member Functions inherited from KWin::Effect
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 &region, EffectWindow *w, const QRect &r, Qt::AspectRatioMode aspect)
 

Additional Inherited Members

- Public Types inherited from KWin::Effect
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 }
 
- Public Slots inherited from KWin::Effect
virtual bool borderActivated (ElectricBorder border)
 

Detailed Description

Definition at line 22 of file shakecursor.h.

Constructor & Destructor Documentation

◆ ShakeCursorEffect()

KWin::ShakeCursorEffect::ShakeCursorEffect ( )

Definition at line 21 of file shakecursor.cpp.

◆ ~ShakeCursorEffect()

KWin::ShakeCursorEffect::~ShakeCursorEffect ( )
override

Definition at line 48 of file shakecursor.cpp.

Member Function Documentation

◆ isActive()

bool KWin::ShakeCursorEffect::isActive ( ) const
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.

Since
4.8

Reimplemented from KWin::Effect.

Definition at line 69 of file shakecursor.cpp.

◆ paintScreen()

void KWin::ShakeCursorEffect::paintScreen ( const RenderTarget & renderTarget,
const RenderViewport & viewport,
int mask,
const QRegion & region,
Output * screen )
overridevirtual

In this method you can:

  • paint something on top of the windows (by painting after calling effects->paintScreen())
  • paint multiple desktops and/or multiple copies of the same desktop by calling effects->paintScreen() multiple times

In OpenGL based compositing, the frameworks ensures that the context is current when this method is invoked.

Reimplemented from KWin::Effect.

Definition at line 184 of file shakecursor.cpp.

◆ pointerEvent()

void KWin::ShakeCursorEffect::pointerEvent ( MouseEvent * event)
overridevirtual

Event spy for pointer events which can be described by a MouseEvent.

Parameters
eventThe event information about the move or button press/release

Reimplemented from KWin::InputEventSpy.

Definition at line 74 of file shakecursor.cpp.

◆ reconfigure()

void KWin::ShakeCursorEffect::reconfigure ( ReconfigureFlags flags)
overridevirtual

Called when configuration changes (either the effect's or KWin's global).

In OpenGL based compositing, the frameworks ensures that the context is current when the Effect is reconfigured. If this method is called from within the Effect it is required to ensure that the context is current if the implementation does OpenGL calls.

Reimplemented from KWin::Effect.

Definition at line 61 of file shakecursor.cpp.

◆ supported()

bool KWin::ShakeCursorEffect::supported ( )
static

Definition at line 53 of file shakecursor.cpp.


The documentation for this class was generated from the following files: