KWin/KConfigXT Effects

Jump to: navigation, search

Contents

KConfigXT for KWin Effects

Motivation

To port the configuration of an Effect to KConfigXT no programming skills are required, though can be helpful. The task is to move the configuration from being hard coded values in the source code into an XML definition from which source code get's generated. This improves the maintenance of the source code and makes it more difficult to have errors caused by typos. Furthermore the business logic to update and track the user interface can be managed automatically limiting the risk of errors there.

Last but not least it allows to move the configuration interfaces in future to new technologies like QML.

Performing a Port

Best first read the tutorial on KConfigXT, then pick an effect of those listed below. The source code for the effects can be found here, each effect is in an own sub directory. Locate the file effectname_config.cpp, that's the most important one to look at. In there you find some code starting with void EffectNameConfig::load(), there you find many readEntry() lines. Each readEntry contains the name of the config option, the default value and the data type. Each of these config options becomes an entry in the kcfg file.

Now start creating the kcfg file. As a name use effectname.kcfg. For the name attribute of "kcfgfile" use kwinrc. The kcfg file should have exactly one group. The name of this you can find in the source code in a method call EffectsHandler::effectConfig("Foo") which gets appended to a Effect-, e.g. Effect-Foo. This should be enough to define the complete kcfg file for the effect.

The next step is to update the ui file in the same directory. Best do that in Qt designer and for each widget update the object name to be kcfg_ConfigOption as explained in the tutorial.

Now all that is needed is defining the kcfgc file:

File=foo.kcfg
ClassName=FooConfig
NameSpace=KWin
Singleton=true
Mutators=true

If you have some developer experience, please also update the CMakeLists.txt and the source code of the effect and the configuration. Though this is no requirement.

A complete example for such a port can be found in Review Request for Translucency Effect.

Publish the Result

Best is to upload a Review Request on Review Board for group KWin. Alternative is to send your changes to KWin's mailing list. Bonus for being a git format-patched diff as that allows that the change in the repository will be addressed to the correct author. (see Techbase - Git/Create a patch)

Effects

Status Effect Review Board Claimed By
DONE Blur 106400 <moraru69@yahoo.com>
DONE CoverSwitch 106396 <dariocambie@gmail.com>
DONE Cube 106403 <francesco.cecconi@gmail.com>
DONE Dashboard 106390 <andrea@archlinux.org>
DONE DesktopGrid 106398 <moraru69@yahoo.com>
DONE DimInactive 106422 <jsardid@gmail.com>
DONE FlipSwitch 106401 <moraru69@yahoo.com>
DONE Glide 106392 <dariocambie@gmail.com>
IN PROGRESS Invert 106408 <christian@ch-sc.de>
DONE Login 106387 <andrea@archlinux.org>
DONE LookingGlass 106406 <jiveaxe@gmail.com>
DONE MagicLamp 106412 <andrea@archlinux.org>
DONE Magnifier 106442 <happy5214@gmail.com>
DONE MouseMark 106414 <jiveaxe@gmail.com>
DONE PresentWindows 106407 <dns_hmpf@web.de>
DONE Resize 106397 <happy5214@gmail.com>
DONE ShowFps 106415 <jiveaxe@gmail.com>
DONE ThumbnailAside 106436 <andrea@archlinux.org>
DONE TrackMouse 106416 <jiveaxe@gmail.com>
IN PROGRESS Translucency 106310 <mgraesslin@kde.org>
DONE WindowGeometry 106413 <andrea@archlinux.org>
DONE WobblyWindows 106389 <friesoft@gmail.com>
DONE Zoom 106402 <happy5214@gmail.com>

This page was last modified on 6 November 2012, at 21:07. This page has been accessed 2,691 times. Content is available under Creative Commons License SA 3.0 as well as the GNU Free Documentation License 1.2.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal