KWin
|
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 |
EffectWindow * | windowAtPoint (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 |
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.
|
explicit |
Creates a new window manager object.
Definition at line 54 of file motionmanager.cpp.
KWin::WindowMotionManager::~WindowMotionManager | ( | ) |
Definition at line 61 of file motionmanager.cpp.
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.
|
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.
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.
|
inline |
Returns whether or not a specified window is being managed by this manager object.
Definition at line 268 of file motionmanager.h.
|
inline |
Returns whether a window has reached its targets yet or not.
Definition at line 293 of file motionmanager.h.
|
inline |
Register a list of windows for managing.
Definition at line 170 of file motionmanager.h.
void KWin::WindowMotionManager::manage | ( | EffectWindow * | w | ) |
Register a window for managing.
Definition at line 65 of file motionmanager.cpp.
|
inline |
Return a list of all currently registered windows.
Definition at line 260 of file motionmanager.h.
|
inline |
Returns whether or not this manager object is actually managing any windows or not.
Definition at line 276 of file motionmanager.h.
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.
|
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.
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.
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.
void KWin::WindowMotionManager::setTransformedGeometry | ( | EffectWindow * | w, |
const QRectF & | geometry ) |
Sets the current transformed geometry of a registered window to the given geometry.
Definition at line 241 of file motionmanager.cpp.
QRectF KWin::WindowMotionManager::targetGeometry | ( | EffectWindow * | w | ) | const |
Retrieve the current target geometry of a registered window.
Definition at line 252 of file motionmanager.cpp.
QRectF KWin::WindowMotionManager::transformedGeometry | ( | EffectWindow * | w | ) | const |
Retrieve the current tranformed geometry of a registered window.
Definition at line 223 of file motionmanager.cpp.
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.
void KWin::WindowMotionManager::unmanageAll | ( | ) |
Deregister all windows, returning the manager to its originally initiated state.
Definition at line 95 of file motionmanager.cpp.
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.