From cf5b70bd2cf1b4fdc77520005ace2a4b9aeda3c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 26 Jan 2012 16:53:07 +0100 Subject: [PATCH] Export displayWidth/height/size as properties of workspace --- scripting/workspace_wrapper.cpp | 15 +++++++++++++++ scripting/workspace_wrapper.h | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/scripting/workspace_wrapper.cpp b/scripting/workspace_wrapper.cpp index 8804f5d50d..6e487b5e59 100644 --- a/scripting/workspace_wrapper.cpp +++ b/scripting/workspace_wrapper.cpp @@ -76,6 +76,21 @@ QSize WorkspaceWrapper::workspaceSize() const return QSize(workspaceWidth(), workspaceHeight()); } +QSize WorkspaceWrapper::displaySize() const +{ + return QSize(KWin::displayWidth(), KWin::displayHeight()); +} + +int WorkspaceWrapper::displayWidth() const +{ + return KWin::displayWidth(); +} + +int WorkspaceWrapper::displayHeight() const +{ + return KWin::displayWidth(); +} + void WorkspaceWrapper::setupClientConnections(KWin::Client *client) { connect(client, SIGNAL(clientMinimized(KWin::Client*,bool)), SIGNAL(clientMinimized(KWin::Client*))); diff --git a/scripting/workspace_wrapper.h b/scripting/workspace_wrapper.h index edd554014b..5562d2a5af 100644 --- a/scripting/workspace_wrapper.h +++ b/scripting/workspace_wrapper.h @@ -46,6 +46,18 @@ class WorkspaceWrapper : public QObject * The number of desktops currently used. Minimum number of desktops is 1, maximum 20. **/ Q_PROPERTY(int desktops READ numberOfDesktops WRITE setNumberOfDesktops NOTIFY numberDesktopsChanged) + /** + * The same of the display, that is all screens. + **/ + Q_PROPERTY(QSize displaySize READ displaySize) + /** + * The width of the display, that is width of all combined screens. + **/ + Q_PROPERTY(int displayWidth READ displayWidth) + /** + * The height of the display, that is height of all combined screens. + **/ + Q_PROPERTY(int displayHeight READ displayHeight) private: Q_DISABLE_COPY(WorkspaceWrapper) @@ -86,6 +98,9 @@ void setter( rettype val ); int workspaceWidth() const; int workspaceHeight() const; QSize workspaceSize() const; + int displayWidth() const; + int displayHeight() const; + QSize displaySize() const; Q_INVOKABLE QList< KWin::Client* > clientList() const;