diff --git a/scripting/documentation-global.xml b/scripting/documentation-global.xml index edfe37908..6ab70cd34 100644 --- a/scripting/documentation-global.xml +++ b/scripting/documentation-global.xml @@ -1,126 +1,134 @@ Global Methods and properties added to the global JavaScript object. KWin::Options options Global property to all configuration values of KWin core. KWin::Workspace workspace Global property to the core wrapper of KWin. + + object + + + KWin + + Provides access to enums defined in KWin::WorkspaceWrapper + Q_SCRIPTABLE void void KWin::Scripting::print (QVariant ... values) print Prints all provided values to kDebug and as a D-Bus signal Q_SCRIPTABLE QVariant QVariant KWin::Scripting::readConfig (QString key, QVariant defaultValue = QVariant()) readConfig Reads the config value for key in the Script's configuration with the optional default value. If not providing a default value and no value stored in the configuration an undefined value is returned. Q_SCRIPTABLE bool bool KWin::Scripting::registerScreenEdge (ElectricBorder border, QScriptValue callback) registerScreenEdge Registers the callback for the screen edge. When the mouse gets pushed against the given edge the callback will be invoked. Q_SCRIPTABLE bool bool KWin::Scripting::registerShortcut (QString title, QString text, QString keySequence, QScriptValue callback) registerShortcut Registers keySequence as a global shortcut. When the shortcut is invoked the callback will be called. Title and text are used to name the shortcut and make it available to the global shortcut configuration module. Q_SCRIPTABLE bool bool KWin::Scripting::assert (bool value, QString message = QString()) assert Aborts the execution of the script if value does not evaluate to true. If message is provided an error is thrown with the given message, if not provided an error with default message is thrown. Q_SCRIPTABLE bool bool KWin::Scripting::assertTrue (bool value, QString message = QString()) assertTrue Aborts the execution of the script if value does not evaluate to true. If message is provided an error is thrown with the given message, if not provided an error with default message is thrown. Q_SCRIPTABLE bool bool KWin::Scripting::assertFalse (bool value, QString message = QString()) assertFalse Aborts the execution of the script if value does not evaluate to false. If message is provided an error is thrown with the given message, if not provided an error with default message is thrown. Q_SCRIPTABLE bool bool KWin::Scripting::assertEquals (QVariant expected, QVariant actual, QString message = QString()) assertEquals Aborts the execution of the script if the actual value is not equal to the expected value. If message is provided an error is thrown with the given message, if not provided an error with default message is thrown. Q_SCRIPTABLE bool bool KWin::Scripting::assertNull (QVariant value, QString message = QString()) assertNull Aborts the execution of the script if value is not null. If message is provided an error is thrown with the given message, if not provided an error with default message is thrown. Q_SCRIPTABLE bool bool KWin::Scripting::assertNotNull (QVariant value, QString message = QString()) assertNotNull Aborts the execution of the script if value is null. If message is provided an error is thrown with the given message, if not provided an error with default message is thrown. Q_SCRIPTABLE void void KWin::Scripting::callDBus (QString service, QString path, QString interface, QString method, QVariant arg..., QScriptValue callback = QScriptValue()) callDBus Call a D-Bus method at (service, path, interface and method). A variable number of arguments can be added to the method call. The D-Bus call is always performed in an async way invoking the callback provided as the last (optional) argument. The reply values of the D-Bus method call are passed to the callback. Q_SCRIPTABLE void void KWin::Scripting::registerUserActionsMenu (QScriptValue callback) registerUserActionsMenu Registers the passed in callback to be invoked whenever the User actions menu (Alt+F3 or right click on window decoration) is about to be shown. The callback is invoked with a reference to the Client for which the menu is shown. The callback can return either a single menu entry to be added to the menu or an own sub menu with multiple entries. The object for a menu entry should be {title: "My Menu entry", checkable: true, checked: false, triggered: function (action) { // callback with triggered QAction}}, for a menu it should be {title: "My menu", items: [{...}, {...}, ...] /*list with entries as described*/}