# (m) workspace.getAllClients : Returns the client objects according to stacking order specified by an optional parameter which specifies the desktop nubmer to fetch the clients from. If no such parameter is provided, all clients are returned.
# (e) workspace.currentDesktopChanged : Occurs when the active desktop is changed. Parameters: prev_desktop
# (e) workspace.desktopPresenceChanged : Occurs when a client is switched from one desktop to another. Parameters: affected_client, prev_desktop
# (m) client.caption : Returns the caption of the client (or title in other terminologies)
# (e) client.clientMoved : Called when the client's geometry changed. Semantic error I know. Will be changed. TODO.
# (p) workspace.currentDesktop : Returns the current desktop of the workspace. Getter ONLY.
# (e) workspace.clientAdded : Called when a new client is added to the workspace. However, if there are clients already present when kwin is loaded, the C++ method. Workspace::clientAdded is called, but the script registered functions are not called. They are called ONLY for clients which are added after KWin has loaded. Maybe this will be fixed later, maybe not.
# (e) workspace.clientManaging: Called when a client is managed. Calls with one parameter, the client which is managed. NOTE: During this event, many of the client properties will not be available.
# (e) workspace.clientMinimize: Called when a client is minimized. Passes 1 parameter, the client which was minimized.
# (e) workspace.clientMaximizeSet: Called when the value of either of the two scalar dimensions of the client are set to the corresponding value of the workspace's dimensions or set to any other values FROM the corresponding values of the workspaces' dimensions. Passes 2 parameters, 1st being the client which is maximized and second specifying the vertically and horizontally hints.
# (m) client.close: Closes the given client. BTW: Just added client.close() within a function registered with workspace.clientAdded() to make a really annoying script ;)
# (e) workspace.killWindowCalled: Called whenever a kill window is requested [by default using the Ctrl+Esc sequence. Passes 1 param, the Client object of the Kill Window.
# (e) client.minimize: Called when the client is minimized. Called with no parameters.
# (e) client.maximizeSet: Similar to workspace.clientMaximizeSet other than for it's 1st parameter and called only when the event occurs on the specific client.
# (e) workspace.clientActivated: Called when any client gets focus. Called with one parameter: the client which was activated.
# (e) client.activated: Called when the object client gets activated.
#
# -- GEOMETRY PROPERTIES FOR TOPLEVEL --
# client inherits from toplevel i.e. toplevel properties are merged into the client scriptvalue before passing it to the
# scripting environment. Hence, all properties, methods and events of toplevel are available with the client object also
#
# (m) toplevel.x: Gives the x co-ordinate of the toplevel object.
# (m) toplevel.y: Gives the y co-ordinate of the toplevel object.
# (m) toplevel.width: Gives the width of the toplevel object.
# (m) toplevel.height: Givesn the height of the toplevel object.
# (m) toplevel.size: Returns the size in a QtScript object with properties of it's components. In JSON representation, the structure would be {w: <value>, h: <value>}.
# (m) toplevel.pos: Returns the posisition in a QtScript object with properties of it's components. In JSON representation, the structure would be {x: <value>, y: <value>}.
# (m) toplevel.geometry: Returns the complete geometry on a QtScript object with properties of it's components. In JSON representation, the structure would be [object] {x: <value>, y: <value>, w: <value>, h: <value>}
# (m) toplevel.move: Moves the client to the specified position.
# (m) toplevel.resize: Resized the client to the specified size.
# (m) toplevel.setGeometry: Set the geometry of the client to the specified size.
#
# -- For the three functions above --
#
# There are two methods to access each of these methods. One call can be made through using objects:
# NOTE: For passing objects to these methods, the property names MUST match i.e. the move property expects properties
# 'x' and 'y' of the passed object.
#
# (m) client.isTransient : Returns (true) is 'client' is transient, (false) otherwise
# (m) client.transientFor : If the given client is transient, returns it's parent client, otherwise returns an undefin-
# ed scriptvalue.
# (m) client.activate : Attempt to focus the client, also send a parameter whether to force or not. However, focus stealing prevention still is activated and this may or may not actually focus the client.
# (m) client.setCaption : Set caption for the specified client.
# (m) workspace.dimensions : Returns the dimensions of the workspace. Accepts 1 string as a parameter which predates the the exact dimension to be returned. Default is "MaximizeMode"
# (m) workspace.desktopGridSize : Returns the size of the desktop in grid units.
# (m) client.isFullScreen : Returns true if the client is already in full screen mode.
# (m) client.isFullScreenable : Returns true if the client can be set in full screen mode.
# (m) client.setFullScreen : Set or clear full screen mode of the clientActivated
# (e) client.fullScreenSet : Occurs whenever the specified client is set to fullscreen.
# (e) workspace.clientFullScreenSet : Occurs whenever any client is set to fullscreen. Passes three params: client, set, user
# (m) toplevel.opacity : Returns a qsreal denoting the opacity of the cient.
# (m) toplevel.hasAlpha : Returns a boolean signifying whether the client has alpha compositing (porter-duff) enabled or not.
# (m) toplevel.setOpacity : Set the opacity of the client to a specified value. Accepts 1 qsreal parameter, the opacity value.
# (m) clientgroup.ClientGroup (ctor) : Constructor for a new ClientGroup object. Must pass a client object, otherwise returns an invalid scriptvalue.
# (m) clientgroup.add : Add a client to a client group. Expects 1 parameter.
# (m) workspace.activeClient : Returns the active client on the workspace i.e. the client which currently has focus.
# (m) workspace.clientGroups : Returns an array of clientGroups currently present in the workspace.
# (m) clientgroup.remove : Removes the client specified by the parameter which is either a client object or an index of the client in the clientlist.
# (m) clientgroup.clients : Returns an array of clients which are members of the clientgroup.
# (m) client.clientGroup : Returns the clientgroup a given client belongs to, or an undefined scriptvalue otherwise.
# (m) clientgroup.contains : Accepts a client parameter, and returns true the client is contained within the clientgroup
# (m) clientgroup.indexOf : Returns the index of the parameter 'client' within the clientgroup
# (m) clientgroup.move : Move a client within the group. Accepts move(client, client), move(index, index), move(index, client), move(client, index). All calls except move(client, client) are eventually mapped to move(index, index) using indexOf(client)
# (m) clientgroup.removeAll : Removes all clients from a group and assigns them individual groups.
# (m) clientgroup.closeAll : Closes all the clients in a group.
# (m) clientgroup.minSize : Returns the minimum size cumulative of all the clients in the clientgroup.
# (m) clientgroup.maxSize : Returns the maximum size cumulative of all the clients in the clientgroup.
# (p) config.loaded : Returns true if a file corresponding to the script has been found and loaded.
# (m) config.get : Gets the value for the given configuration parameters. Various methods to use this are: get() returns all available values in a value-key pair. get(keys, simple) returns an array of value indexed by keys if simple is 0 or indexed by integers if simple is 1. get(keys) is equivalent of get(keys, 0). get(key1, key2 ... ) is equivalent of get(array(key1, key2 ... ), 0).
# (m) config.exists : Returns true if the provided key exists within the configuration or false otherwise.
# (m) client.desktop : Returns the desktop the client is on. Returns -1 if the client is on all desktops.
# (m) client.isShade : Returns true if the client is shaded, false otherwise.
# (m) client.isShadeable : Returns true if the client can be shaded, false otherwise.
# (m) client.isMinimized : Returns true if the client is minimized, false otherwise.
# (m) client.isMinimizable : Returns true if the client can be minimized, false otherwise.
# (m) client.isMaximizable : Returns true if the client can be maximized, false otherwise.
# (m) client.isResizable : Returns true if the client can be resized, false otherwise.
# (m) client.isMovable : Returns true if the client can be moved, false otherwise.
# (m) client.isMovableAcrossScreens : Returns true if the client can be moved across screens, false otherwise.
# (m) client.isCloseable : Returns true if the client can be closed, false otherwise.