• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

KWinLibraries

KWin::Effect

KWin::Effect Class Reference
[KWin effects library]

Base class for all KWin effects. More...

#include <kwineffects.h>

List of all members.


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 &region, 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.
For each stage there are *Screen() and *Window() methods. The window method is called for every window which the screen method is usually called just once.

Definition at line 236 of file kwineffects.h.


Member Enumeration Documentation

anonymous enum

Flags controlling how painting is done.

Enumerator:
PAINT_WINDOW_OPAQUE  Window (or at least part of it) will be painted opaque.
PAINT_WINDOW_TRANSLUCENT  Window (or at least part of it) will be painted translucent.
PAINT_WINDOW_TRANSFORMED  Window will be painted with transformed geometry.
PAINT_SCREEN_REGION  Paint only a region of the screen (can be optimized, cannot be used together with TRANSFORMED flags).
PAINT_SCREEN_TRANSFORMED  The whole screen will be painted with transformed geometry.

Forces the entire screen to be painted.

PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS  At least one window will be painted with transformed geometry.

Forces the entire screen to be painted.

PAINT_SCREEN_BACKGROUND_FIRST  Clear whole background as the very first step, without optimizing it.

Definition at line 241 of file kwineffects.h.


The documentation for this class was generated from the following files:
  • kwineffects.h
  • kwineffects.cpp

KWinLibraries

Skip menu "KWinLibraries"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal