Jump to content

KWin/KConfigXT Effects: Difference between revisions

From KDE Community Wiki
Mgraesslin (talk | contribs)
Created page with "= 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 ..."
 
Dcambie (talk | contribs)
m in progress -> done for submitted patch
 
(57 intermediate revisions by 10 users not shown)
Line 27: Line 27:


== Publish the Result ==
== Publish the Result ==
Best is to upload a Review Request on [https://git.reviewboard.kde.org 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.
Best is to upload a Review Request on [https://git.reviewboard.kde.org 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 - [http://techbase.kde.org/Development/Tutorials/Git/Create_a_patch Git/Create a patch])


== Effects ==
== Effects ==
Line 39: Line 39:
! Claimed By
! Claimed By


{{FeatureProjectTodo |Blur|-|-}}
{{FeatureProjectDone |Blur|[https://git.reviewboard.kde.org/r/106400/ 106400]|[email protected]|lilianmoraru}}
{{FeatureProjectTodo |CoverSwitch|-|-}}
{{FeatureProjectDone |CoverSwitch|[https://git.reviewboard.kde.org/r/106396/ 106396]|[email protected]|dcambie}}
{{FeatureProjectTodo |Cube|-|-}}
{{FeatureProjectDone |Cube|[https://git.reviewboard.kde.org/r/106403/ 106403]|[email protected]|cecconi}}
{{FeatureProjectTodo |Dashboard|-|-}}
{{FeatureProjectDone |Dashboard|[https://git.reviewboard.kde.org/r/106390/ 106390]|[email protected]|ascarpino}}
{{FeatureProjectTodo |DesktopGrid|-|-}}
{{FeatureProjectDone |DesktopGrid|[https://git.reviewboard.kde.org/r/106398/ 106398]|[email protected]|lilianmoraru}}
{{FeatureProjectTodo |DimInactive|-|-}}
{{FeatureProjectDone |DimInactive|[https://git.reviewboard.kde.org/r/106422/ 106422]|[email protected]}}
{{FeatureProjectTodo |FlipSwitch|-|-}}
{{FeatureProjectDone |FlipSwitch|[https://git.reviewboard.kde.org/r/106401/ 106401]|[email protected]|lilianmoraru}}
{{FeatureProjectTodo |Glide|-|-}}
{{FeatureProjectDone |Glide|[https://git.reviewboard.kde.org/r/106392/ 106392]|[email protected]|dcambie}}
{{FeatureProjectTodo |Invert|-|-}}
{{FeatureProjectInProgress |Invert|[https://git.reviewboard.kde.org/r/106408/ 106408]|christian@ch-sc.de}}
{{FeatureProjectTodo |Login|-|-}}
{{FeatureProjectDone |Login|[https://git.reviewboard.kde.org/r/106387/ 106387]|[email protected]|ascarpino}}
{{FeatureProjectTodo |LookingGlass|-|-}}
{{FeatureProjectDone |LookingGlass|[https://git.reviewboard.kde.org/r/106406/ 106406]|[email protected]}}
{{FeatureProjectTodo |MagicLamp|-|-}}
{{FeatureProjectDone |MagicLamp|[https://git.reviewboard.kde.org/r/106412/ 106412]|[email protected]|ascarpino}}
{{FeatureProjectTodo |Magnifier|-|-}}
{{FeatureProjectDone |Magnifier|[https://git.reviewboard.kde.org/r/106442/ 106442]|[email protected]|alexanderjones}}
{{FeatureProjectTodo |MouseMark|-|-}}
{{FeatureProjectDone |MouseMark|[https://git.reviewboard.kde.org/r/106414/ 106414]|[email protected]|gcala}}
{{FeatureProjectTodo |PresentWindows|-|-}}
{{FeatureProjectDone |PresentWindows|[https://git.reviewboard.kde.org/r/106407/ 106407]|[email protected]}}
{{FeatureProjectTodo |Resize|-|-}}
{{FeatureProjectDone |Resize|[https://git.reviewboard.kde.org/r/106397/ 106397]|[email protected]|alexanderjones}}
{{FeatureProjectTodo |ShowFPS|-|-}}
{{FeatureProjectDone |ShowFps|[https://git.reviewboard.kde.org/r/106415/ 106415]|[email protected]|gcala}}
{{FeatureProjectTodo |ThumbnailAside|-|-}}
{{FeatureProjectDone |ThumbnailAside|[https://git.reviewboard.kde.org/r/106436/ 106436]|[email protected]|ascarpino}}
{{FeatureProjectTodo |Trackmouse|-|-}}
{{FeatureProjectDone |TrackMouse|[https://git.reviewboard.kde.org/r/106416/ 106416]|[email protected]|gcala}}
{{FeatureProjectInProgress|Translucency|[https://git.reviewboard.kde.org/r/106310/ 106310]|[email protected]|Martin Gräßlin}}
{{FeatureProjectInProgress|Translucency|[https://git.reviewboard.kde.org/r/106310/ 106310]|[email protected]|Martin Gräßlin}}
{{FeatureProjectTodo |WindowGeometry|-|-}}
{{FeatureProjectDone |WindowGeometry|[https://git.reviewboard.kde.org/r/106413/ 106413]|[email protected]|ascarpino}}
{{FeatureProjectTodo |WobblyWindows|-|-}}
{{FeatureProjectDone |WobblyWindows|[https://git.reviewboard.kde.org/r/106389/ 106389]|[email protected]|friesoft}}
{{FeatureProjectTodo |Zoom|-|-}}
{{FeatureProjectDone |Zoom|[https://git.reviewboard.kde.org/r/106402/ 106402]|[email protected]|alexanderjones}}
|}
|}

Latest revision as of 20:07, 6 November 2012

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 <[email protected]>
DONE CoverSwitch 106396 <[email protected]>
DONE Cube 106403 <[email protected]>
DONE Dashboard 106390 <[email protected]>
DONE DesktopGrid 106398 <[email protected]>
DONE DimInactive 106422 <[email protected]>
DONE FlipSwitch 106401 <[email protected]>
DONE Glide 106392 <[email protected]>
IN PROGRESS Invert 106408 <[email protected]>
DONE Login 106387 <[email protected]>
DONE LookingGlass 106406 <[email protected]>
DONE MagicLamp 106412 <[email protected]>
DONE Magnifier 106442 <[email protected]>
DONE MouseMark 106414 <[email protected]>
DONE PresentWindows 106407 <[email protected]>
DONE Resize 106397 <[email protected]>
DONE ShowFps 106415 <[email protected]>
DONE ThumbnailAside 106436 <[email protected]>
DONE TrackMouse 106416 <[email protected]>
IN PROGRESS Translucency 106310 <[email protected]>
DONE WindowGeometry 106413 <[email protected]>
DONE WobblyWindows 106389 <[email protected]>
DONE Zoom 106402 <[email protected]>