KWin
|
Namespaces | |
namespace | KWin |
Classes | |
class | KWin::PaintData |
class | KWin::WindowPrePaintData |
class | KWin::WindowPaintData |
class | KWin::ScreenPrePaintData |
class | KWin::Effect |
Base class for all KWin effects. More... | |
class | KWin::EffectPluginFactory |
Macros | |
#define | KWIN_EFFECT_API_MAKE_VERSION(major, minor) ((major) << 8 | (minor)) |
#define | KWIN_EFFECT_API_VERSION_MAJOR 0 |
#define | KWIN_EFFECT_API_VERSION_MINOR 236 |
#define | KWIN_EFFECT_API_VERSION |
#define | EffectPluginFactory_iid "org.kde.kwin.EffectPluginFactory" KWIN_PLUGIN_VERSION_STRING |
#define | KWIN_PLUGIN_FACTORY_NAME KPLUGINFACTORY_PLUGIN_CLASS_INTERNAL_NAME |
#define | KWIN_EFFECT_FACTORY_SUPPORTED_ENABLED(className, jsonFile, supported, enabled) |
#define | KWIN_EFFECT_FACTORY_ENABLED(className, jsonFile, enabled) KWIN_EFFECT_FACTORY_SUPPORTED_ENABLED(className, jsonFile, return true;, enabled) |
#define | KWIN_EFFECT_FACTORY_SUPPORTED(className, jsonFile, supported) KWIN_EFFECT_FACTORY_SUPPORTED_ENABLED(className, jsonFile, supported, return true;) |
#define | KWIN_EFFECT_FACTORY(className, jsonFile) KWIN_EFFECT_FACTORY_SUPPORTED_ENABLED(className, jsonFile, return true;, return true;) |
Enumerations | |
enum | { KWin::Effect::PAINT_WINDOW_OPAQUE = 1 << 0 , KWin::Effect::PAINT_WINDOW_TRANSLUCENT = 1 << 1 , KWin::Effect::PAINT_WINDOW_TRANSFORMED = 1 << 2 , KWin::Effect::PAINT_SCREEN_REGION = 1 << 3 , KWin::Effect::PAINT_SCREEN_TRANSFORMED = 1 << 4 , KWin::Effect::PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS = 1 << 5 , KWin::Effect::PAINT_SCREEN_BACKGROUND_FIRST = 1 << 6 } |
enum | KWin::Effect::Feature { KWin::Effect::Nothing = 0 , KWin::Effect::ScreenInversion , KWin::Effect::Blur , KWin::Effect::Contrast , KWin::Effect::HighlightWindows } |
enum | KWin::Effect::ReconfigureFlag { KWin::Effect::ReconfigureAll = 1 << 0 } |
Variables | |
int | KWin::WindowPrePaintData::mask |
QRegion | KWin::WindowPrePaintData::paint |
QRegion | KWin::WindowPrePaintData::opaque |
int | KWin::ScreenPrePaintData::mask |
QRegion | KWin::ScreenPrePaintData::paint |
Output * | KWin::ScreenPrePaintData::screen = nullptr |
Public Slots | |
virtual bool | KWin::Effect::borderActivated (ElectricBorder border) |
KWin effects library contains necessary classes for creating new KWin compositing effects.
This example will demonstrate the basics of creating an effect. We'll use CoolEffect as the class name, cooleffect as internal name and "Cool Effect" as user-visible name of the effect.
This example doesn't demonstrate how to write the effect's code. For that, see the documentation of the Effect class.
First you need to create CoolEffect class which has to be a subclass of KWin::Effect. In that class you can reimplement various virtual methods to control how and where the windows are drawn.
This library provides a specialized KPluginFactory subclass and macros to create a sub class. This subclass of KPluginFactory has to be used, otherwise KWin won't load the plugin. Use the KWIN_EFFECT_FACTORY macro to create the plugin factory. This macro will take the embedded json metadata filename as the second argument.
To build the effect, you can use the kcoreaddons_add_plugin cmake macro which takes care of creating the library and installing it. The first parameter is the name of the library, this is the same as the id of the plugin. If our effect's source is in cooleffect.cpp, we'd use following:
The format follows the one of the
Example cooleffect.json file:
Effects can gain access to the properties of windows and workspace via EffectWindow and EffectsHandler classes.
There is one global EffectsHandler object which you can access using the effects pointer. For each window, there is an EffectWindow object which can be used to read window properties such as position and also to change them.
For more information about this, see the documentation of the corresponding classes.
#define EffectPluginFactory_iid "org.kde.kwin.EffectPluginFactory" KWIN_PLUGIN_VERSION_STRING |
#define KWIN_EFFECT_API_MAKE_VERSION | ( | major, | |
minor ) ((major) << 8 | (minor)) |
#define KWIN_EFFECT_API_VERSION |
#define KWIN_EFFECT_FACTORY | ( | className, | |
jsonFile ) KWIN_EFFECT_FACTORY_SUPPORTED_ENABLED(className, jsonFile, return true;, return true;) |
#define KWIN_EFFECT_FACTORY_ENABLED | ( | className, | |
jsonFile, | |||
enabled ) KWIN_EFFECT_FACTORY_SUPPORTED_ENABLED(className, jsonFile, return true;, enabled) |
#define KWIN_EFFECT_FACTORY_SUPPORTED | ( | className, | |
jsonFile, | |||
supported ) KWIN_EFFECT_FACTORY_SUPPORTED_ENABLED(className, jsonFile, supported, return true;) |
#define KWIN_EFFECT_FACTORY_SUPPORTED_ENABLED | ( | className, | |
jsonFile, | |||
supported, | |||
enabled ) |
Defines an EffectPluginFactory sub class with customized isSupported and enabledByDefault methods.
If the Effect to be created does not need the isSupported or enabledByDefault methods prefer the simplified KWIN_EFFECT_FACTORY, KWIN_EFFECT_FACTORY_SUPPORTED or KWIN_EFFECT_FACTORY_ENABLED macros which create an EffectPluginFactory with a useable default value.
This API is not providing binary compatibility and thus the effect plugin must be compiled against the same kwineffects library version as KWin.
factoryName | The name to be used for the EffectPluginFactory |
className | The class name of the Effect sub class which is to be created by the factory |
jsonFile | Name of the json file to be compiled into the plugin as metadata |
supported | Source code to go into the isSupported() method, must return a boolean |
enabled | Source code to go into the enabledByDefault() method, must return a boolean |
#define KWIN_PLUGIN_FACTORY_NAME KPLUGINFACTORY_PLUGIN_CLASS_INTERNAL_NAME |
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 |
|
static |
Read animation time from the configuration and possibly adjust using animationTimeFactor(). The configuration value in the effect should also have special value 'default' (set using QSpinBox::setSpecialValueText()) with the value 0. This special value is adjusted using the global animation speed, otherwise the exact time configured is returned.
cfg | configuration group to read value from |
key | configuration key to read value from |
defaultTime | default animation time in milliseconds |
Definition at line 483 of file effect.cpp.
int KWin::Effect::animationTime | ( | int | defaultDuration | ) |
|
static |
Definition at line 489 of file effect.cpp.
|
virtual |
overwrite this method to return false if your effect does not need to be drawn over opaque fullscreen windows
Reimplemented in KWin::ContrastEffect, and KWin::BlurEffect.
Definition at line 545 of file effect.cpp.
qreal KWin::WindowPaintData::brightness | ( | ) | const |
Brightness of the window, in range [0; 1] 1 means that the window is unchanged, 0 means that it's completely black. 0.5 would make it 50% darker than usual
Definition at line 269 of file effect.cpp.
|
pure virtual |
This method returns the created Effect.
qreal KWin::WindowPaintData::crossFadeProgress | ( | ) | const |
Definition at line 299 of file effect.cpp.
|
static |
Definition at line 478 of file effect.cpp.
|
virtual |
Reimplement this method to provide online debugging. This could be as trivial as printing specific detail information about the effect state but could also be used to move the effect in and out of a special debug modes, clear bogus data, etc. Notice that the functions is const by intent! Whenever you alter the state of the object due to random user input, you should do so with greatest care, hence const_cast<> your object - signalling "let me alone, i know what i'm doing"
parameter | A freeform string user input for your effect to interpret. |
Reimplemented in KWin::AnimationEffect.
Definition at line 452 of file effect.cpp.
|
virtual |
Can be called to draw multiple copies (e.g. thumbnails) of a window. You can change window's opacity/brightness/etc here, but you can't do any transformations.
In OpenGL based compositing, the frameworks ensures that the context is current when this method is invoked.
Reimplemented in KWin::ContrastEffect, KWin::BlurEffect, KWin::OffscreenEffect, and KWin::CrossFadeEffect.
Definition at line 457 of file effect.cpp.
KWin::Effect::Effect | ( | QObject * | parent = nullptr | ) |
Constructs new Effect object.
In OpenGL based compositing, the frameworks ensures that the context is current when the Effect is constructed.
Definition at line 386 of file effect.cpp.
KWin::EffectPluginFactory::EffectPluginFactory | ( | ) |
Definition at line 550 of file effect.cpp.
|
virtual |
Returns whether the Effect should get enabled by default.
This function provides a way for an effect to override the default at runtime, e.g. based on the capabilities of the hardware.
This method is optional; the effect doesn't have to provide it.
Note that this function is only called if the supported() function returns true, and if X-KDE-PluginInfo-EnabledByDefault is set to true in the .desktop file.
This method is optional, by default true
is returned.
Definition at line 558 of file effect.cpp.
|
virtual |
Reimplemented in KWin::HelperEffect, KWin::WindowViewEffect, KWin::QuickSceneEffect, KWin::OverviewEffect, and KWin::TilesEditorEffect.
Definition at line 403 of file effect.cpp.
|
inlinestatic |
|
virtual |
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
.
Reimplemented in KWin::AnimationEffect, KWin::QuickSceneEffect, KWin::ContrastEffect, KWin::BlendChanges, KWin::BlurEffect, KWin::ColorBlindnessCorrectionEffect, KWin::ColorPickerEffect, KWin::DimInactiveEffect, KWin::FallApartEffect, KWin::GlideEffect, KWin::InvertEffect, KWin::KscreenEffect, KWin::MagicLampEffect, KWin::MagnifierEffect, KWin::MouseClickEffect, KWin::MouseMarkEffect, KWin::OutputLocatorEffect, KWin::ScreenEdgeEffect, KWin::ScreenShotEffect, KWin::ScreenTransformEffect, KWin::ShakeCursorEffect, KWin::SheetEffect, KWin::ShowPaintEffect, KWin::SlideEffect, KWin::SlideBackEffect, KWin::SlidingPopupsEffect, KWin::SnapHelperEffect, KWin::StartupFeedbackEffect, KWin::ThumbnailAsideEffect, KWin::TouchPointsEffect, KWin::TrackMouseEffect, KWin::WobblyWindowsEffect, and KWin::ZoomEffect.
Definition at line 447 of file effect.cpp.
|
virtual |
Returns whether the Effect is supported.
An Effect can implement this method to determine at runtime whether the Effect is supported.
If the current compositing backend is not supported it should return false
.
This method is optional, by default true
is returned.
Definition at line 563 of file effect.cpp.
qreal KWin::WindowPaintData::multiplyBrightness | ( | qreal | factor | ) |
Multiplies the current brightness level with factor
.
factor | with which the brightness should be multiplied. |
Definition at line 321 of file effect.cpp.
qreal KWin::WindowPaintData::multiplyOpacity | ( | qreal | factor | ) |
Multiplies the current opacity with the factor
.
factor | Factor with which the opacity should be multiplied |
Definition at line 309 of file effect.cpp.
qreal KWin::WindowPaintData::multiplySaturation | ( | qreal | factor | ) |
Multiplies the current saturation with factor
.
factor | with which the saturation should be multiplied |
Definition at line 315 of file effect.cpp.
qreal KWin::WindowPaintData::opacity | ( | ) | const |
Window opacity, in range 0 = transparent to 1 = fully opaque
Definition at line 259 of file effect.cpp.
WindowPaintData & KWin::WindowPaintData::operator*= | ( | const QVector2D & | scale | ) |
Scales the window by scale
factor. Performs a component wise multiplication on x and y components.
Definition at line 350 of file effect.cpp.
WindowPaintData & KWin::WindowPaintData::operator*= | ( | const QVector3D & | scale | ) |
Scales the window by scale
factor. Performs a component wise multiplication.
Definition at line 357 of file effect.cpp.
WindowPaintData & KWin::WindowPaintData::operator*= | ( | qreal | scale | ) |
Scales the window by scale
factor. Multiplies all three components by the given factor.
Definition at line 342 of file effect.cpp.
WindowPaintData & KWin::WindowPaintData::operator+= | ( | const QPoint & | translation | ) |
Translates the window by the given translation
and returns a reference to the ScreenPaintData. Overloaded method for convenience.
Definition at line 370 of file effect.cpp.
WindowPaintData & KWin::WindowPaintData::operator+= | ( | const QPointF & | translation | ) |
Translates the window by the given translation
and returns a reference to the ScreenPaintData.
Definition at line 365 of file effect.cpp.
WindowPaintData & KWin::WindowPaintData::operator+= | ( | const QVector2D & | translation | ) |
Translates the window by the given translation
and returns a reference to the ScreenPaintData. Overloaded method for convenience.
Definition at line 375 of file effect.cpp.
WindowPaintData & KWin::WindowPaintData::operator+= | ( | const QVector3D & | translation | ) |
Translates the window by the given translation
and returns a reference to the ScreenPaintData. Overloaded method for convenience.
Definition at line 380 of file effect.cpp.
|
protected |
Definition at line 49 of file effect.cpp.
|
protected |
|
virtual |
In this method you can:
In OpenGL based compositing, the frameworks ensures that the context is current when this method is invoked.
Reimplemented in KWin::OutputLocatorEffect, KWin::ScreenTransformEffect, KWin::QuickSceneEffect, KWin::ColorPickerEffect, KWin::MagnifierEffect, KWin::MouseClickEffect, KWin::MouseMarkEffect, KWin::ScreenEdgeEffect, KWin::ScreenShotEffect, KWin::ShakeCursorEffect, KWin::ShowFpsEffect, KWin::ShowPaintEffect, KWin::SlideEffect, KWin::SnapHelperEffect, KWin::StartupFeedbackEffect, KWin::ThumbnailAsideEffect, KWin::TouchPointsEffect, KWin::TrackMouseEffect, and KWin::ZoomEffect.
Definition at line 417 of file effect.cpp.
|
virtual |
This is the main method for painting windows. In this method you can:
In OpenGL based compositing, the frameworks ensures that the context is current when this method is invoked.
Reimplemented in KWin::ShowFpsEffect, KWin::AnimationEffect, KWin::BlendChanges, KWin::DimInactiveEffect, KWin::GlideEffect, KWin::KscreenEffect, KWin::SheetEffect, KWin::ShowPaintEffect, KWin::SlideEffect, KWin::SlideBackEffect, KWin::SlidingPopupsEffect, and KWin::ThumbnailAsideEffect.
Definition at line 432 of file effect.cpp.
|
virtual |
Performs the feature
with the arguments
.
This allows to have specific protocols between KWin core and an Effect.
The method is supposed to return true
if it performed the features, false
otherwise.
The default implementation returns false
.
Reimplemented in KWin::HighlightWindowEffect.
Definition at line 515 of file effect.cpp.
|
virtual |
Called after all the painting has been finished. In this method you can:
In OpenGL based compositing, the frameworks ensures that the context is current when this method is invoked.
Reimplemented in KWin::AnimationEffect, KWin::BlendChanges, KWin::DimInactiveEffect, KWin::FallApartEffect, KWin::GlideEffect, KWin::KscreenEffect, KWin::MagicLampEffect, KWin::MagnifierEffect, KWin::MouseClickEffect, KWin::ShowFpsEffect, KWin::SlideEffect, KWin::SlideBackEffect, KWin::SnapHelperEffect, KWin::StartupFeedbackEffect, KWin::TouchPointsEffect, KWin::TrackMouseEffect, KWin::WobblyWindowsEffect, and KWin::ZoomEffect.
Definition at line 422 of file effect.cpp.
|
virtual |
Called for every window after all painting has been finished. In this method you can:
In OpenGL based compositing, the frameworks ensures that the context is current when this method is invoked.
Reimplemented in KWin::SheetEffect, KWin::SlideBackEffect, and KWin::SlidingPopupsEffect.
Definition at line 437 of file effect.cpp.
|
virtual |
Called before starting to paint the screen. In this method you can:
presentTime specifies the expected monotonic time when the rendered frame will be displayed on the screen.
Reimplemented in KWin::QuickSceneEffect, KWin::BlendChanges, KWin::BlurEffect, KWin::DimInactiveEffect, KWin::FallApartEffect, KWin::GlideEffect, KWin::KscreenEffect, KWin::MagicLampEffect, KWin::MagnifierEffect, KWin::MouseClickEffect, KWin::ScreenEdgeEffect, KWin::ScreenTransformEffect, KWin::SheetEffect, KWin::ShowFpsEffect, KWin::SlideEffect, KWin::SlideBackEffect, KWin::SnapHelperEffect, KWin::StartupFeedbackEffect, KWin::TouchPointsEffect, KWin::TrackMouseEffect, KWin::WobblyWindowsEffect, and KWin::ZoomEffect.
Definition at line 412 of file effect.cpp.
|
virtual |
Called for every window before the actual paint pass In this method you can:
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 in KWin::AnimationEffect, KWin::BlurEffect, KWin::FallApartEffect, KWin::GlideEffect, KWin::KscreenEffect, KWin::MagicLampEffect, KWin::SheetEffect, KWin::SlideEffect, KWin::SlideBackEffect, KWin::SlidingPopupsEffect, and KWin::WobblyWindowsEffect.
Definition at line 427 of file effect.cpp.
QMatrix4x4 KWin::WindowPaintData::projectionMatrix | ( | ) | const |
Returns the current projection matrix.
Definition at line 332 of file effect.cpp.
|
virtual |
Called on Transparent resizes. return true if your effect substitutes questioned feature
Reimplemented in KWin::ContrastEffect, KWin::BlurEffect, KWin::HighlightWindowEffect, KWin::ColorBlindnessCorrectionEffect, and KWin::InvertEffect.
Definition at line 442 of file effect.cpp.
|
virtual |
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 in KWin::BlurEffect, KWin::ColorBlindnessCorrectionEffect, KWin::DimInactiveEffect, KWin::GlideEffect, KWin::KscreenEffect, KWin::OverviewEffect, KWin::ShakeCursorEffect, KWin::SheetEffect, KWin::SlidingPopupsEffect, KWin::SnapHelperEffect, KWin::StartupFeedbackEffect, KWin::ZoomEffect, KWin::ScriptedEffect, KWin::ScriptedQuickSceneEffect, KWin::FallApartEffect, KWin::MagicLampEffect, KWin::MagnifierEffect, KWin::MouseClickEffect, KWin::MouseMarkEffect, KWin::SlideEffect, KWin::ThumbnailAsideEffect, KWin::TilesEditorEffect, KWin::TrackMouseEffect, KWin::WindowViewEffect, and KWin::WobblyWindowsEffect.
Definition at line 395 of file effect.cpp.
|
virtual |
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.
Reimplemented in KWin::ContrastEffect, KWin::BlendChanges, KWin::BlurEffect, KWin::ColorBlindnessCorrectionEffect, KWin::ColorPickerEffect, KWin::DimInactiveEffect, KWin::FallApartEffect, KWin::GlideEffect, KWin::HighlightWindowEffect, KWin::InvertEffect, KWin::KscreenEffect, KWin::MagicLampEffect, KWin::MouseMarkEffect, KWin::OverviewEffect, KWin::ScreenEdgeEffect, KWin::ScreenShotEffect, KWin::ScreenTransformEffect, KWin::SheetEffect, KWin::SlideEffect, KWin::SlideBackEffect, KWin::SlidingPopupsEffect, KWin::StartupFeedbackEffect, KWin::TilesEditorEffect, KWin::WindowViewEffect, KWin::WobblyWindowsEffect, KWin::ZoomEffect, KWin::ScriptedEffect, and KWin::ScriptedQuickSceneEffect.
Definition at line 495 of file effect.cpp.
qreal KWin::PaintData::rotationAngle | ( | ) | const |
Returns the rotation angle. Initially 0.0.
Definition at line 146 of file effect.cpp.
QVector3D KWin::PaintData::rotationAxis | ( | ) | const |
The current rotation axis. By default the rotation is (0/0/1) which means a rotation around the z axis.
Definition at line 151 of file effect.cpp.
QVector3D KWin::PaintData::rotationOrigin | ( | ) | const |
Returns the rotation origin. That is the point in space which is fixed during the rotation. Initially this is 0/0/0.
Definition at line 156 of file effect.cpp.
QMatrix4x4 & KWin::WindowPaintData::rprojectionMatrix | ( | ) |
Returns a reference to the projection matrix.
Definition at line 337 of file effect.cpp.
qreal KWin::WindowPaintData::saturation | ( | ) | const |
Saturation of the window, in range [0; 1] 1 means that the window is unchanged, 0 means that it's completely unsaturated (greyscale). 0.5 would make the colors less intense, but not completely grey Use EffectsHandler::saturationSupported() to find out whether saturation is supported by the system, otherwise this value has no effect.
Definition at line 264 of file effect.cpp.
const QVector3D & KWin::PaintData::scale | ( | ) | const |
Definition at line 96 of file effect.cpp.
int KWin::WindowPaintData::screen | ( | ) | const |
The screen number for which the painting should be done. This affects color correction (different screens may need different color correction lookup tables because they have different ICC profiles).
Definition at line 274 of file effect.cpp.
void KWin::WindowPaintData::setBrightness | ( | qreal | brightness | ) |
Sets the window brightness level to brightness
. If you want to modify the existing brightness level consider using multiplyBrightness.
brightness | The new brightness level |
Definition at line 289 of file effect.cpp.
void KWin::WindowPaintData::setCrossFadeProgress | ( | qreal | factor | ) |
Sets the cross fading factor
to fade over with previously sized window. If 1.0
only the current window is used, if 0.0
only the previous window is used.
By default only the current window is used. This factor can only make any visual difference if the previous window get referenced.
factor | The cross fade factor between 0.0 (previous window) and 1.0 (current window) |
Definition at line 304 of file effect.cpp.
void KWin::WindowPaintData::setOpacity | ( | qreal | opacity | ) |
Sets the window opacity to the new opacity
. If you want to modify the existing opacity level consider using multiplyOpacity.
opacity | The new opacity level |
Definition at line 279 of file effect.cpp.
|
static |
Helper to set WindowPaintData and QRegion to necessary transformations so that a following drawWindow() would put the window at the requested geometry (useful for thumbnails)
Definition at line 462 of file effect.cpp.
void KWin::WindowPaintData::setProjectionMatrix | ( | const QMatrix4x4 & | matrix | ) |
Sets the projection matrix that will be used when painting the window.
The default projection matrix can be overridden by setting this matrix
Definition at line 327 of file effect.cpp.
void KWin::PaintData::setRotationAngle | ( | qreal | angle | ) |
Sets the rotation angle.
angle | The new rotation angle. |
Definition at line 161 of file effect.cpp.
void KWin::PaintData::setRotationAxis | ( | const QVector3D & | axis | ) |
Sets the rotation axis. Set a component to 1.0 to rotate around this axis and to 0.0 to disable rotation around the axis.
axis | A vector holding information on which axis to rotate |
Definition at line 181 of file effect.cpp.
void KWin::PaintData::setRotationAxis | ( | Qt::Axis | axis | ) |
Sets the rotation axis. Overloaded method for convenience.
axis | The axis around which should be rotated. |
Definition at line 166 of file effect.cpp.
void KWin::PaintData::setRotationOrigin | ( | const QVector3D & | origin | ) |
Sets the rotation origin.
origin | The new rotation origin. |
Definition at line 186 of file effect.cpp.
void KWin::WindowPaintData::setSaturation | ( | qreal | saturation | ) | const |
Sets the window saturation level to saturation
. If you want to modify the existing saturation level consider using multiplySaturation.
saturation | The new saturation level |
Definition at line 284 of file effect.cpp.
void KWin::PaintData::setScale | ( | const QVector2D & | scale | ) |
Sets the scale factor in X and Y direction.
scale | The scale factor for X and Y direction |
Definition at line 71 of file effect.cpp.
void KWin::PaintData::setScale | ( | const QVector3D & | scale | ) |
Sets the scale factor in X, Y and Z direction
scale | The scale factor for X, Y and Z direction |
Definition at line 77 of file effect.cpp.
void KWin::WindowPaintData::setScreen | ( | int | screen | ) | const |
screen | New screen number A value less than 0 will indicate that a default profile should be done. |
Definition at line 294 of file effect.cpp.
void KWin::WindowPrePaintData::setTransformed | ( | ) |
Helper to mark that this window will be transformed
Definition at line 27 of file effect.cpp.
void KWin::WindowPrePaintData::setTranslucent | ( | ) |
Simple helper that sets data to say the window will be painted as non-opaque. Takes also care of changing the regions.
Definition at line 20 of file effect.cpp.
void KWin::PaintData::setXScale | ( | qreal | scale | ) |
Sets the scale factor in X direction to scale
scale | The scale factor in X direction |
Definition at line 81 of file effect.cpp.
void KWin::PaintData::setXTranslation | ( | qreal | translate | ) |
Sets the translation in X direction to translate
.
Definition at line 101 of file effect.cpp.
void KWin::PaintData::setYScale | ( | qreal | scale | ) |
Sets the scale factor in Y direction to scale
scale | The scale factor in Y direction |
Definition at line 86 of file effect.cpp.
void KWin::PaintData::setYTranslation | ( | qreal | translate | ) |
Sets the translation in Y direction to translate
.
Definition at line 106 of file effect.cpp.
void KWin::PaintData::setZScale | ( | qreal | scale | ) |
Sets the scale factor in Z direction to scale
scale | The scale factor in Z direction |
Definition at line 91 of file effect.cpp.
void KWin::PaintData::setZTranslation | ( | qreal | translate | ) |
Sets the translation in Z direction to translate
.
Definition at line 111 of file effect.cpp.
|
virtual |
There has been an event from a button on a drawing tablet pad
button | which button |
pressed | true if pressed, false when released |
tabletPadId | the identifier of the tool id |
Definition at line 530 of file effect.cpp.
|
virtual |
There has been an event from a input ring on a drawing tablet pad
number | which ring |
position | the value within the ring that was selected |
isFinger | if it was activated with a finger |
tabletPadId | the identifier of the tool id |
Definition at line 540 of file effect.cpp.
|
virtual |
There has been an event from a input strip on a drawing tablet pad
number | which strip |
position | the value within the strip that was selected |
isFinger | if it was activated with a finger |
tabletPadId | the identifier of the tool id |
Definition at line 535 of file effect.cpp.
|
virtual |
There has been an event from a button on a drawing tablet tool
button | which button |
pressed | true if pressed, false when released |
tabletToolId | the identifier of the tool id |
Definition at line 525 of file effect.cpp.
|
virtual |
There has been an event from a drawing tablet tool
i.e. a pen and the likes.
event | the event information |
Reimplemented in KWin::MouseClickEffect.
Definition at line 520 of file effect.cpp.
QMatrix4x4 KWin::PaintData::toMatrix | ( | qreal | deviceScale | ) | const |
Returns the corresponding transform matrix.
The transform matrix is converted to device coordinates using the supplied deviceScale.
Definition at line 191 of file effect.cpp.
|
virtual |
A touch point was pressed.
If the effect wants to exclusively use the touch event it should return true
. If false
is returned the touch event is passed to further effects.
In general an Effect should only return true
if it is the exclusive effect getting input events. E.g. has grabbed mouse events.
Default implementation returns false
.
id | The unique id of the touch point |
pos | The position of the touch point in global coordinates |
time | Timestamp |
Reimplemented in KWin::QuickSceneEffect, and KWin::TouchPointsEffect.
Definition at line 500 of file effect.cpp.
|
virtual |
A touch point moved.
If the effect wants to exclusively use the touch event it should return true
. If false
is returned the touch event is passed to further effects.
In general an Effect should only return true
if it is the exclusive effect getting input events. E.g. has grabbed mouse events.
Default implementation returns false
.
id | The unique id of the touch point |
pos | The position of the touch point in global coordinates |
time | Timestamp |
Reimplemented in KWin::QuickSceneEffect, and KWin::TouchPointsEffect.
Definition at line 505 of file effect.cpp.
|
virtual |
A touch point was released.
If the effect wants to exclusively use the touch event it should return true
. If false
is returned the touch event is passed to further effects.
In general an Effect should only return true
if it is the exclusive effect getting input events. E.g. has grabbed mouse events.
Default implementation returns false
.
id | The unique id of the touch point |
time | Timestamp |
Reimplemented in KWin::QuickSceneEffect, and KWin::TouchPointsEffect.
Definition at line 510 of file effect.cpp.
void KWin::PaintData::translate | ( | const QVector3D & | translate | ) |
Performs a translation by adding the values component wise. Overloaded method for convenience.
translate | The translation |
Definition at line 121 of file effect.cpp.
void KWin::PaintData::translate | ( | qreal | x, |
qreal | y = 0.0, | ||
qreal | z = 0.0 ) |
Performs a translation by adding the values component wise.
x | Translation in X direction |
y | Translation in Y direction |
z | Translation in Z direction |
Definition at line 116 of file effect.cpp.
const QVector3D & KWin::PaintData::translation | ( | ) | const |
Definition at line 141 of file effect.cpp.
|
virtual |
Reimplemented in KWin::HelperEffect, and KWin::QuickSceneEffect.
Definition at line 399 of file effect.cpp.
KWin::WindowPaintData::WindowPaintData | ( | ) |
Definition at line 221 of file effect.cpp.
|
explicit |
Definition at line 226 of file effect.cpp.
KWin::WindowPaintData::WindowPaintData | ( | const WindowPaintData & | other | ) |
Definition at line 238 of file effect.cpp.
qreal KWin::PaintData::xScale | ( | ) | const |
qreal KWin::PaintData::xTranslation | ( | ) | const |
qreal KWin::PaintData::yScale | ( | ) | const |
qreal KWin::PaintData::yTranslation | ( | ) | const |
qreal KWin::PaintData::zScale | ( | ) | const |
qreal KWin::PaintData::zTranslation | ( | ) | const |
|
override |
Destructs the Effect object.
In OpenGL based compositing, the frameworks ensures that the context is current when the Effect is destroyed.
Definition at line 391 of file effect.cpp.
|
override |
Definition at line 554 of file effect.cpp.
|
virtualdefault |
|
overridedefault |
QRegion KWin::WindowPrePaintData::opaque |
QRegion KWin::WindowPrePaintData::paint |
|
virtualslot |
Reimplemented in KWin::OverviewEffect, and KWin::WindowViewEffect.
Definition at line 407 of file effect.cpp.