KWin
Loading...
Searching...
No Matches
Classes | Public Types | Public Slots | Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties | List of all members
KWin::WobblyWindowsEffect Class Reference

#include <wobblywindows.h>

Inheritance diagram for KWin::WobblyWindowsEffect:
KWin::OffscreenEffect KWin::Effect

Classes

struct  Pair
 

Public Types

enum  WindowStatus { Free , Moving }
 
- 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

void slotWindowAdded (KWin::EffectWindow *w)
 
void slotWindowStartUserMovedResized (KWin::EffectWindow *w)
 
void slotWindowStepUserMovedResized (KWin::EffectWindow *w, const QRectF &geometry)
 
void slotWindowFinishUserMovedResized (KWin::EffectWindow *w)
 
void slotWindowMaximizeStateChanged (KWin::EffectWindow *w, bool horizontal, bool vertical)
 
- Public Slots inherited from KWin::Effect
virtual bool borderActivated (ElectricBorder border)
 

Public Member Functions

 WobblyWindowsEffect ()
 
 ~WobblyWindowsEffect () override
 
void reconfigure (ReconfigureFlags) override
 
void prePaintScreen (ScreenPrePaintData &data, std::chrono::milliseconds presentTime) override
 
void prePaintWindow (EffectWindow *w, WindowPrePaintData &data, std::chrono::milliseconds presentTime) override
 
void postPaintScreen () override
 
bool isActive () const override
 
int requestedEffectChainPosition () const override
 
void setStiffness (qreal stiffness)
 
void setDrag (qreal drag)
 
void setVelocityThreshold (qreal velocityThreshold)
 
void setMoveFactor (qreal factor)
 
qreal stiffness () const
 
qreal drag () const
 
qreal moveFactor () const
 
qreal xTesselation () const
 
qreal yTesselation () const
 
qreal minVelocity () const
 
qreal maxVelocity () const
 
qreal stopVelocity () const
 
qreal minAcceleration () const
 
qreal maxAcceleration () const
 
qreal stopAcceleration () const
 
bool isMoveWobble () const
 
bool isResizeWobble () const
 
- Public Member Functions inherited from KWin::OffscreenEffect
 OffscreenEffect (QObject *parent=nullptr)
 
 ~OffscreenEffect () override
 
- Public Member Functions inherited from KWin::Effect
 Effect (QObject *parent=nullptr)
 
 ~Effect () override
 
virtual void paintScreen (const RenderTarget &renderTarget, const RenderViewport &viewport, int mask, const QRegion &region, Output *screen)
 
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 windowInputMouseEvent (QEvent *e)
 
virtual void grabbedKeyboardEvent (QKeyEvent *e)
 
virtual QString debug (const QString &parameter) 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
 

Static Public Member Functions

static bool supported ()
 
- Static Public Member Functions inherited from KWin::OffscreenEffect
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)
 

Protected Member Functions

void apply (EffectWindow *w, int mask, WindowPaintData &data, WindowQuadList &quads) override
 
- Protected Member Functions inherited from KWin::OffscreenEffect
void drawWindow (const RenderTarget &renderTarget, const RenderViewport &viewport, EffectWindow *window, int mask, const QRegion &region, WindowPaintData &data) override
 
void redirect (EffectWindow *window)
 
void unredirect (EffectWindow *window)
 
void setShader (EffectWindow *window, GLShader *shader)
 
void setVertexSnappingMode (RenderGeometry::VertexSnappingMode mode)
 

Properties

qreal stiffness
 
qreal drag
 
qreal moveFactor
 
qreal xTesselation
 
qreal yTesselation
 
qreal minVelocity
 
qreal maxVelocity
 
qreal stopVelocity
 
qreal minAcceleration
 
qreal maxAcceleration
 
qreal stopAcceleration
 
bool moveWobble
 
bool resizeWobble
 

Detailed Description

Effect which wobble windows

Definition at line 23 of file wobblywindows.h.

Member Enumeration Documentation

◆ WindowStatus

Enumerator
Free 
Moving 

Definition at line 69 of file wobblywindows.h.

Constructor & Destructor Documentation

◆ WobblyWindowsEffect()

KWin::WobblyWindowsEffect::WobblyWindowsEffect ( )

Definition at line 123 of file wobblywindows.cpp.

◆ ~WobblyWindowsEffect()

KWin::WobblyWindowsEffect::~WobblyWindowsEffect ( )
override

Definition at line 135 of file wobblywindows.cpp.

Member Function Documentation

◆ apply()

void KWin::WobblyWindowsEffect::apply ( EffectWindow * window,
int mask,
WindowPaintData & data,
WindowQuadList & quads )
overrideprotectedvirtual

Override this function to transform the window.

Reimplemented from KWin::OffscreenEffect.

Definition at line 257 of file wobblywindows.cpp.

◆ drag()

qreal KWin::WobblyWindowsEffect::drag ( ) const

Definition at line 1107 of file wobblywindows.cpp.

◆ isActive()

bool KWin::WobblyWindowsEffect::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 1097 of file wobblywindows.cpp.

◆ isMoveWobble()

bool KWin::WobblyWindowsEffect::isMoveWobble ( ) const

Definition at line 1157 of file wobblywindows.cpp.

◆ isResizeWobble()

bool KWin::WobblyWindowsEffect::isResizeWobble ( ) const

Definition at line 1162 of file wobblywindows.cpp.

◆ maxAcceleration()

qreal KWin::WobblyWindowsEffect::maxAcceleration ( ) const

Definition at line 1147 of file wobblywindows.cpp.

◆ maxVelocity()

qreal KWin::WobblyWindowsEffect::maxVelocity ( ) const

Definition at line 1132 of file wobblywindows.cpp.

◆ minAcceleration()

qreal KWin::WobblyWindowsEffect::minAcceleration ( ) const

Definition at line 1142 of file wobblywindows.cpp.

◆ minVelocity()

qreal KWin::WobblyWindowsEffect::minVelocity ( ) const

Definition at line 1127 of file wobblywindows.cpp.

◆ moveFactor()

qreal KWin::WobblyWindowsEffect::moveFactor ( ) const

Definition at line 1112 of file wobblywindows.cpp.

◆ postPaintScreen()

void KWin::WobblyWindowsEffect::postPaintScreen ( )
overridevirtual

Called after all the painting has been finished. In this method you can:

  • schedule next repaint in case of animations You shouldn't paint anything here.

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

Reimplemented from KWin::Effect.

Definition at line 298 of file wobblywindows.cpp.

◆ prePaintScreen()

void KWin::WobblyWindowsEffect::prePaintScreen ( ScreenPrePaintData & data,
std::chrono::milliseconds presentTime )
overridevirtual

Called before starting to paint the screen. In this method you can:

  • set whether the windows or the entire screen will be transformed
  • change the region of the screen that will be painted
  • do various housekeeping tasks such as initing your effect's variables for the upcoming paint pass or updating animation's progress

presentTime specifies the expected monotonic time when the rendered frame will be displayed on the screen.

Reimplemented from KWin::Effect.

Definition at line 231 of file wobblywindows.cpp.

◆ prePaintWindow()

void KWin::WobblyWindowsEffect::prePaintWindow ( EffectWindow * w,
WindowPrePaintData & data,
std::chrono::milliseconds presentTime )
overridevirtual

Called for every window before the actual paint pass In this method you can:

  • enable or disable painting of the window (e.g. enable paiting of minimized window)
  • set window to be painted with translucency
  • set window to be transformed
  • request the window to be divided into multiple parts

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

presentTime specifies the expected monotonic time when the rendered frame will be displayed on the screen.

Reimplemented from KWin::Effect.

Definition at line 238 of file wobblywindows.cpp.

◆ reconfigure()

void KWin::WobblyWindowsEffect::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 143 of file wobblywindows.cpp.

◆ requestedEffectChainPosition()

int KWin::WobblyWindowsEffect::requestedEffectChainPosition ( ) const
inlineoverridevirtual

Reimplement this method to indicate where in the Effect chain the Effect should be placed.

A low number indicates early chain position, thus before other Effects got called, a high number indicates a late position. The returned number should be in the interval [0, 100]. The default value is 0.

In KWin4 this information was provided in the Effect's desktop file as property X-KDE-Ordering. In the case of Scripted Effects this property is still used.

Since
5.0

Reimplemented from KWin::Effect.

Definition at line 49 of file wobblywindows.h.

◆ setDrag()

void KWin::WobblyWindowsEffect::setDrag ( qreal drag)

Definition at line 226 of file wobblywindows.cpp.

◆ setMoveFactor()

void KWin::WobblyWindowsEffect::setMoveFactor ( qreal factor)

Definition at line 216 of file wobblywindows.cpp.

◆ setStiffness()

void KWin::WobblyWindowsEffect::setStiffness ( qreal stiffness)

Definition at line 221 of file wobblywindows.cpp.

◆ setVelocityThreshold()

void KWin::WobblyWindowsEffect::setVelocityThreshold ( qreal velocityThreshold)

Definition at line 211 of file wobblywindows.cpp.

◆ slotWindowAdded

void KWin::WobblyWindowsEffect::slotWindowAdded ( KWin::EffectWindow * w)
slot

Definition at line 309 of file wobblywindows.cpp.

◆ slotWindowFinishUserMovedResized

void KWin::WobblyWindowsEffect::slotWindowFinishUserMovedResized ( KWin::EffectWindow * w)
slot

Definition at line 349 of file wobblywindows.cpp.

◆ slotWindowMaximizeStateChanged

void KWin::WobblyWindowsEffect::slotWindowMaximizeStateChanged ( KWin::EffectWindow * w,
bool horizontal,
bool vertical )
slot

Definition at line 370 of file wobblywindows.cpp.

◆ slotWindowStartUserMovedResized

void KWin::WobblyWindowsEffect::slotWindowStartUserMovedResized ( KWin::EffectWindow * w)
slot

Definition at line 317 of file wobblywindows.cpp.

◆ slotWindowStepUserMovedResized

void KWin::WobblyWindowsEffect::slotWindowStepUserMovedResized ( KWin::EffectWindow * w,
const QRectF & geometry )
slot

Definition at line 328 of file wobblywindows.cpp.

◆ stiffness()

qreal KWin::WobblyWindowsEffect::stiffness ( ) const

Definition at line 1102 of file wobblywindows.cpp.

◆ stopAcceleration()

qreal KWin::WobblyWindowsEffect::stopAcceleration ( ) const

Definition at line 1152 of file wobblywindows.cpp.

◆ stopVelocity()

qreal KWin::WobblyWindowsEffect::stopVelocity ( ) const

Definition at line 1137 of file wobblywindows.cpp.

◆ supported()

bool KWin::WobblyWindowsEffect::supported ( )
static

Definition at line 189 of file wobblywindows.cpp.

◆ xTesselation()

qreal KWin::WobblyWindowsEffect::xTesselation ( ) const

Definition at line 1117 of file wobblywindows.cpp.

◆ yTesselation()

qreal KWin::WobblyWindowsEffect::yTesselation ( ) const

Definition at line 1122 of file wobblywindows.cpp.

Property Documentation

◆ drag

qreal KWin::WobblyWindowsEffect::drag
read

Definition at line 27 of file wobblywindows.h.

◆ maxAcceleration

qreal KWin::WobblyWindowsEffect::maxAcceleration
read

Definition at line 35 of file wobblywindows.h.

◆ maxVelocity

qreal KWin::WobblyWindowsEffect::maxVelocity
read

Definition at line 32 of file wobblywindows.h.

◆ minAcceleration

qreal KWin::WobblyWindowsEffect::minAcceleration
read

Definition at line 34 of file wobblywindows.h.

◆ minVelocity

qreal KWin::WobblyWindowsEffect::minVelocity
read

Definition at line 31 of file wobblywindows.h.

◆ moveFactor

qreal KWin::WobblyWindowsEffect::moveFactor
read

Definition at line 28 of file wobblywindows.h.

◆ moveWobble

bool KWin::WobblyWindowsEffect::moveWobble
read

Definition at line 37 of file wobblywindows.h.

◆ resizeWobble

bool KWin::WobblyWindowsEffect::resizeWobble
read

Definition at line 38 of file wobblywindows.h.

◆ stiffness

qreal KWin::WobblyWindowsEffect::stiffness
read

Definition at line 26 of file wobblywindows.h.

◆ stopAcceleration

qreal KWin::WobblyWindowsEffect::stopAcceleration
read

Definition at line 36 of file wobblywindows.h.

◆ stopVelocity

qreal KWin::WobblyWindowsEffect::stopVelocity
read

Definition at line 33 of file wobblywindows.h.

◆ xTesselation

qreal KWin::WobblyWindowsEffect::xTesselation
read

Definition at line 29 of file wobblywindows.h.

◆ yTesselation

qreal KWin::WobblyWindowsEffect::yTesselation
read

Definition at line 30 of file wobblywindows.h.


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