KWinLibraries
KWin::Effect Class Reference
[KWin effects library]
Base class for all KWin effects.
More...
#include <kwineffects.h>
Public Types | |
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 | ReconfigureFlag { ReconfigureAll = 1 << 0 } |
Public Member Functions | |
virtual bool | borderActivated (ElectricBorder border) |
virtual void | buildQuads (EffectWindow *w, WindowQuadList &quadList) |
virtual void | desktopChanged (int old) |
virtual void | drawWindow (EffectWindow *w, int mask, QRegion region, WindowPaintData &data) |
Effect () | |
virtual void | grabbedKeyboardEvent (QKeyEvent *e) |
virtual void | mouseChanged (const QPoint &pos, const QPoint &oldpos, Qt::MouseButtons buttons, Qt::MouseButtons oldbuttons, Qt::KeyboardModifiers modifiers, Qt::KeyboardModifiers oldmodifiers) |
virtual void | paintScreen (int mask, QRegion region, ScreenPaintData &data) |
virtual void | paintWindow (EffectWindow *w, int mask, QRegion region, WindowPaintData &data) |
virtual void | postPaintScreen () |
virtual void | postPaintWindow (EffectWindow *w) |
virtual void | prePaintScreen (ScreenPrePaintData &data, int time) |
virtual void | prePaintWindow (EffectWindow *w, WindowPrePaintData &data, int time) |
virtual void | propertyNotify (EffectWindow *w, long atom) |
virtual void | reconfigure (ReconfigureFlags flags) |
virtual void | tabBoxAdded (int mode) |
virtual void | tabBoxClosed () |
virtual void | tabBoxUpdated () |
virtual QRect | transformWindowDamage (EffectWindow *w, const QRect &r) |
virtual void | windowActivated (EffectWindow *c) |
virtual void | windowAdded (EffectWindow *c) |
virtual void | windowClosed (EffectWindow *c) |
virtual void | windowDamaged (EffectWindow *w, const QRect &r) |
virtual void | windowDeleted (EffectWindow *c) |
virtual void | windowGeometryShapeChanged (EffectWindow *w, const QRect &old) |
virtual void | windowInputMouseEvent (Window w, QEvent *e) |
virtual void | windowMinimized (EffectWindow *c) |
virtual void | windowOpacityChanged (EffectWindow *c, double old_opacity) |
virtual void | windowUnminimized (EffectWindow *c) |
virtual void | windowUserMovedResized (EffectWindow *c, bool first, bool last) |
virtual | ~Effect () |
Static Public Member Functions | |
static double | animationTime (int defaultTime) |
static double | animationTime (const KConfigGroup &cfg, const QString &key, int defaultTime) |
static QPoint | cursorPos () |
static int | displayHeight () |
static int | displayWidth () |
static double | interpolate (double x, double y, double a) |
static void | setPositionTransformations (WindowPaintData &data, QRect ®ion, EffectWindow *w, const QRect &r, Qt::AspectRatioMode aspect) |
Detailed Description
Base class for all KWin effects.This is the base class for all effects. By reimplementing virtual methods of this class, you can customize how the windows are painted.
The virtual methods of this class can broadly be divided into two categories: the methods used for painting and those you can use to be notified and react to certain events, e.g. that a window was closed.
Chaining
Most methods of this class are called in chain style. This means that when effects A and B area active then first e.g. A::paintWindow() is called and then from within that method B::paintWindow() is called (although indirectly). To achieve this, you need to make sure to call corresponding method in EffectsHandler class from each such method (using effects pointer):void MyEffect::postPaintScreen() { // Do your own processing here ... // Call corresponding EffectsHandler method effects->postPaintScreen(); }
Effects pointer
effects pointer points to the global EffectsHandler object that you can use to interact with the windows.Painting stages
Painting of windows is done in three stages:- First, the prepaint pass.
Here you can specify how the windows will be painted, e.g. that they will be translucent and transformed. - Second, the paint pass.
Here the actual painting takes place. You can change attributes such as opacity of windows as well as apply transformations to them. You can also paint something onto the screen yourself. - Finally, the postpaint pass.
Here you can mark windows, part of windows or even the entire screen for repainting to create animations.
Definition at line 236 of file kwineffects.h.
Member Enumeration Documentation
anonymous enum |
Flags controlling how painting is done.
- Enumerator:
Definition at line 241 of file kwineffects.h.
The documentation for this class was generated from the following files: