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

Helper class for motion dynamics in KWin effects. More...

#include <motionmanager.h>

Public Member Functions

 WindowMotionManager (bool useGlobalAnimationModifier=true)
 
 ~WindowMotionManager ()
 
void manage (EffectWindow *w)
 
void manage (const QList< EffectWindow * > &list)
 
void unmanage (EffectWindow *w)
 
void unmanageAll ()
 
void calculate (int time)
 
void apply (EffectWindow *w, WindowPaintData &data)
 
void reset ()
 
void reset (EffectWindow *w)
 
void moveWindow (EffectWindow *w, QPoint target, double scale=1.0, double yScale=0.0)
 
void moveWindow (EffectWindow *w, QRect target)
 
QRectF transformedGeometry (EffectWindow *w) const
 
void setTransformedGeometry (EffectWindow *w, const QRectF &geometry)
 
QRectF targetGeometry (EffectWindow *w) const
 
EffectWindowwindowAtPoint (QPoint point, bool useStackingOrder=true) const
 
QList< EffectWindow * > managedWindows () const
 
bool isManaging (EffectWindow *w) const
 
bool managingWindows () const
 
bool areWindowsMoving () const
 
bool isWindowMoving (EffectWindow *w) const
 

Detailed Description

Helper class for motion dynamics in KWin effects.

This motion manager class is intended to help KWin effect authors move windows across the screen smoothly and naturally. Once windows are registered by the manager the effect can issue move commands with the moveWindow() methods. The position of any managed window can be determined in realtime by the transformedGeometry() method. As the manager knows if any windows are moving at any given time it can also be used as a notifier as to see whether the effect is active or not.

Definition at line 154 of file motionmanager.h.

Constructor & Destructor Documentation

◆ WindowMotionManager()

KWin::WindowMotionManager::WindowMotionManager ( bool useGlobalAnimationModifier = true)
explicit

Creates a new window manager object.

Definition at line 54 of file motionmanager.cpp.

◆ ~WindowMotionManager()

KWin::WindowMotionManager::~WindowMotionManager ( )

Definition at line 61 of file motionmanager.cpp.

Member Function Documentation

◆ apply()

void KWin::WindowMotionManager::apply ( EffectWindow * w,
WindowPaintData & data )

Modify a registered window's paint data to make it appear at its real location on the screen. Usually called in paintWindow(). Remember to flag the window as having been transformed in prePaintWindow() by calling WindowPrePaintData::setTransformed()

Definition at line 188 of file motionmanager.cpp.

◆ areWindowsMoving()

bool KWin::WindowMotionManager::areWindowsMoving ( ) const
inline

Returns whether all windows have reached their targets yet or not. Can be used to see if an effect should be processed and displayed or not.

Definition at line 285 of file motionmanager.h.

◆ calculate()

void KWin::WindowMotionManager::calculate ( int time)

Determine the new positions for windows that have not reached their target. Called once per frame, usually in prePaintScreen(). Remember to set the Effect::PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS flag.

Definition at line 101 of file motionmanager.cpp.

◆ isManaging()

bool KWin::WindowMotionManager::isManaging ( EffectWindow * w) const
inline

Returns whether or not a specified window is being managed by this manager object.

Definition at line 268 of file motionmanager.h.

◆ isWindowMoving()

bool KWin::WindowMotionManager::isWindowMoving ( EffectWindow * w) const
inline

Returns whether a window has reached its targets yet or not.

Definition at line 293 of file motionmanager.h.

◆ manage() [1/2]

void KWin::WindowMotionManager::manage ( const QList< EffectWindow * > & list)
inline

Register a list of windows for managing.

Definition at line 170 of file motionmanager.h.

◆ manage() [2/2]

void KWin::WindowMotionManager::manage ( EffectWindow * w)

Register a window for managing.

Definition at line 65 of file motionmanager.cpp.

◆ managedWindows()

QList< EffectWindow * > KWin::WindowMotionManager::managedWindows ( ) const
inline

Return a list of all currently registered windows.

Definition at line 260 of file motionmanager.h.

◆ managingWindows()

bool KWin::WindowMotionManager::managingWindows ( ) const
inline

Returns whether or not this manager object is actually managing any windows or not.

Definition at line 276 of file motionmanager.h.

◆ moveWindow() [1/2]

void KWin::WindowMotionManager::moveWindow ( EffectWindow * w,
QPoint target,
double scale = 1.0,
double yScale = 0.0 )

Ask the manager to move the window to the target position with the specified scale. If yScale is not provided or set to 0.0, scale will be used as the scale in the vertical direction as well as in the horizontal direction.

Definition at line 201 of file motionmanager.cpp.

◆ moveWindow() [2/2]

void KWin::WindowMotionManager::moveWindow ( EffectWindow * w,
QRect target )
inline

This is an overloaded method, provided for convenience.

Ask the manager to move the window to the target rectangle. Automatically determines scale.

Definition at line 226 of file motionmanager.h.

◆ reset() [1/2]

void KWin::WindowMotionManager::reset ( )

Set all motion targets and values back to where the windows were before transformations. The same as unmanaging then remanaging all windows.

Definition at line 161 of file motionmanager.cpp.

◆ reset() [2/2]

void KWin::WindowMotionManager::reset ( EffectWindow * w)

Resets the motion target and current value of a single window.

Definition at line 174 of file motionmanager.cpp.

◆ setTransformedGeometry()

void KWin::WindowMotionManager::setTransformedGeometry ( EffectWindow * w,
const QRectF & geometry )

Sets the current transformed geometry of a registered window to the given geometry.

See also
transformedGeometry
Since
4.5

Definition at line 241 of file motionmanager.cpp.

◆ targetGeometry()

QRectF KWin::WindowMotionManager::targetGeometry ( EffectWindow * w) const

Retrieve the current target geometry of a registered window.

Definition at line 252 of file motionmanager.cpp.

◆ transformedGeometry()

QRectF KWin::WindowMotionManager::transformedGeometry ( EffectWindow * w) const

Retrieve the current tranformed geometry of a registered window.

Definition at line 223 of file motionmanager.cpp.

◆ unmanage()

void KWin::WindowMotionManager::unmanage ( EffectWindow * w)

Deregister a window. All transformations applied to the window will be permanently removed and cannot be recovered.

Definition at line 89 of file motionmanager.cpp.

◆ unmanageAll()

void KWin::WindowMotionManager::unmanageAll ( )

Deregister all windows, returning the manager to its originally initiated state.

Definition at line 95 of file motionmanager.cpp.

◆ windowAtPoint()

EffectWindow * KWin::WindowMotionManager::windowAtPoint ( QPoint point,
bool useStackingOrder = true ) const

Return the window that has its transformed geometry under the specified point. It is recommended to use the stacking order as it's what the user sees, but it is slightly slower to process.

Definition at line 270 of file motionmanager.cpp.


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