From 8beb8af8ffd4e83cbe0e85d3b578f371317f15a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sun, 18 Dec 2011 10:29:32 +0100 Subject: [PATCH] Adding properties to Client and Toplevel class This will make it possible to access Clients in scripting, deco and effects without the wrapper classes through the property system. --- client.h | 37 +++++++++++++++++++++++++++++++++++++ toplevel.h | 12 ++++++++++++ 2 files changed, 49 insertions(+) diff --git a/client.h b/client.h index 08cddc97c1..a9f816b32f 100644 --- a/client.h +++ b/client.h @@ -86,6 +86,43 @@ class Client : public Toplevel { Q_OBJECT + // TODO: notify signal + Q_PROPERTY(bool active READ isActive) + // TODO: notify signal + Q_PROPERTY(QString caption READ caption) + // TODO: notify signal + Q_PROPERTY(bool closeable READ isCloseable) + // TODO: notify signal + Q_PROPERTY(int desktop READ desktop WRITE setDesktop) + // TODO: notify signal, proper setter with only one attribute + Q_PROPERTY(bool fullScreen READ isFullScreen) + Q_PROPERTY(bool fullScreenable READ isFullScreenable) + // TODO: notify signal + Q_PROPERTY(QRect geometry READ geometry WRITE setGeometry) + // TODO: notify signal + Q_PROPERTY(bool keepAbove READ keepAbove WRITE setKeepAbove) + // TODO: notify signal + Q_PROPERTY(bool keepBelow READ keepBelow WRITE setKeepBelow) + // TODO: notify signal + Q_PROPERTY(bool maximizable READ isMaximizable) + // TODO: notify signal + Q_PROPERTY(bool minimizable READ isMinimizable) + // TODO: setter and notify signal + Q_PROPERTY(bool minimized READ isMinimized) + Q_PROPERTY(bool modal READ isModal) + Q_PROPERTY(bool moveable READ isMovable) + Q_PROPERTY(bool moveableAcrossScreens READ isMovableAcrossScreens) + // TODO: notify signal + Q_PROPERTY(bool providesContextHelp READ providesContextHelp) + Q_PROPERTY(bool resizeable READ isResizable) + // TODO: notify signal + Q_PROPERTY(bool shadeable READ isShadeable) + // TODO: proper setShade method and notifiy signal + Q_PROPERTY(bool shade READ isShade) + // TODO: notify signal + Q_PROPERTY(bool transient READ isTransient) + // TODO: notify signal, add meta type + Q_PROPERTY(Client *transientFor READ transientFor) public: Client(Workspace* ws); Window wrapperId() const; diff --git a/toplevel.h b/toplevel.h index 693e6f3718..de8501ed21 100644 --- a/toplevel.h +++ b/toplevel.h @@ -46,6 +46,18 @@ class Toplevel : public QObject, public KDecorationDefines { Q_OBJECT + Q_PROPERTY(bool alpha READ hasAlpha CONSTANT) + Q_PROPERTY(qulonglong frameId READ frameId) + Q_PROPERTY(QRect geometry READ geometry NOTIFY geometryChanged) + Q_PROPERTY(int height READ height) + Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged) + Q_PROPERTY(QPoint pos READ pos) + Q_PROPERTY(int screen READ screen) + Q_PROPERTY(QSize size READ size) + Q_PROPERTY(int width READ width) + Q_PROPERTY(qulonglong windowId READ window CONSTANT) + Q_PROPERTY(int x READ x) + Q_PROPERTY(int y READ y) public: Toplevel(Workspace *ws); Window frameId() const;