Mgraesslin (Talk | contribs) (Created page with "The KWin Scripting functionality has been reworked and extended in the KDE Plasma Workspaces version 4.9. Unfortunately it was not possible to keep the API 100 % compatible. This...") |
Mgraesslin (Talk | contribs) (→Toplevel) |
||
Line 13: | Line 13: | ||
== Toplevel == | == Toplevel == | ||
− | All methods are available as properties with the same name as the getter methods in the old API. | + | All methods are available as properties with the same name as the getter methods in the old API except '''hasAlpha''' which is just '''alpha'''. |
== Client == | == Client == |
The KWin Scripting functionality has been reworked and extended in the KDE Plasma Workspaces version 4.9. Unfortunately it was not possible to keep the API 100 % compatible. This document lists most changes. The new API is documented in Development/Tutorials/KWin/Scripting/API_4.9.
In general the API has been changed to make greater use of Properties. This has been done to be able to use the same API in both JavaScript and QML. So instead of
var opacity = client.opacity();
opacity = opacity*0.5;
client.setOpacity(opacity);
use
client.opacity = client.opacity*0.5;
All methods are available as properties with the same name as the getter methods in the old API except hasAlpha which is just alpha.
The following methods are no longer available:
The following methods have been renamed as properties:
The events are documented as Signals in the new documentation. The new API follows the pattern of emitting a signal whenever a value changes. Use the property to query the new value. If the old value is required you should save the state in your script.
The following signals have been renamed:
ClientGroup is no longer instantiable. This was an error in the previous API version. In order to use the ClientGroup just access the Client's clientGroup property. If the value is null this means the Client is undecorated and a ClientGroup cannot be used.
WindowInfo is no longer provided. All relevant properties are merged into Toplevel or Client.