From 7b03f5af04943e2de6f3041e67be23280219a238 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 19 Dec 2017 23:54:07 -0500 Subject: Add a new C++ object: PanelObject This is tied into the RootDesktopObject as well as the ScreenObject, resulting in global-session panels as well as per-screen panels. --- .../src-desktop/src-cpp/RootDesktopObject.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.h') diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.h b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.h index ba586701..93beb6e4 100644 --- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.h +++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.h @@ -17,6 +17,7 @@ class RootDesktopObject : public QObject{ Q_OBJECT //Define all the QML Properties here (interface between QML and the C++ methods below) Q_PROPERTY( QStringList screens READ screens NOTIFY screensChanged) + Q_PROPERTY( QStringList panels READ panels NOTIFY panelsChanged) public: //main contructor/destructor @@ -31,13 +32,19 @@ public: //QML Read Functions QStringList screens(); Q_INVOKABLE ScreenObject* screen(QString id); + Q_INVOKABLE QStringList panels(); + Q_INVOKABLE PanelObject* panel(QString id); + + void setPanels(QList list); //QML Access Functions Q_INVOKABLE void logout(); Q_INVOKABLE void lockscreen(); Q_INVOKABLE void mousePositionChanged(); + private: QList s_objects; + QList panel_objects; public slots: void updateScreens(); //rescan/update screen objects @@ -47,6 +54,7 @@ private slots: signals: void screensChanged(); + void panelsChanged(); void startLogout(); void mouseMoved(); void lockScreen(); -- cgit From 70a95acc3d3cae25fd99a027d932960cce819299 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 20 Dec 2017 00:28:17 -0500 Subject: Setup the RootDesktopObject to start providing NativeWindow objects to the QML interface. --- .../src-desktop/src-cpp/RootDesktopObject.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.h') diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.h b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.h index 93beb6e4..838b5f7d 100644 --- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.h +++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.h @@ -10,6 +10,7 @@ #define _LUMINA_DESKTOP_QML_BACKEND_ROOT_DESKTOP_OBJECT_H #include #include +#include #include "ScreenObject.h" @@ -18,6 +19,7 @@ class RootDesktopObject : public QObject{ //Define all the QML Properties here (interface between QML and the C++ methods below) Q_PROPERTY( QStringList screens READ screens NOTIFY screensChanged) Q_PROPERTY( QStringList panels READ panels NOTIFY panelsChanged) + Q_PROPERTY( QStringList windows READ windows NOTIFY windowsChanged); public: //main contructor/destructor @@ -30,12 +32,15 @@ public: static RootDesktopObject* instance(); //QML Read Functions - QStringList screens(); + Q_INVOKABLE QStringList screens(); Q_INVOKABLE ScreenObject* screen(QString id); Q_INVOKABLE QStringList panels(); Q_INVOKABLE PanelObject* panel(QString id); + Q_INVOKABLE QStringList windows(); + Q_INVOKABLE NativeWindow* window(QString id); void setPanels(QList list); + void setWindows(QList list); //QML Access Functions Q_INVOKABLE void logout(); @@ -45,6 +50,7 @@ public: private: QList s_objects; QList panel_objects; + QList window_objects; public slots: void updateScreens(); //rescan/update screen objects @@ -55,6 +61,8 @@ private slots: signals: void screensChanged(); void panelsChanged(); + void windowsChanged(); + void startLogout(); void mouseMoved(); void lockScreen(); -- cgit