diff options
Diffstat (limited to 'src-qt5/core/libLumina/NativeWindowSystem.h')
-rw-r--r-- | src-qt5/core/libLumina/NativeWindowSystem.h | 63 |
1 files changed, 38 insertions, 25 deletions
diff --git a/src-qt5/core/libLumina/NativeWindowSystem.h b/src-qt5/core/libLumina/NativeWindowSystem.h index 59e54ca4..97208c2f 100644 --- a/src-qt5/core/libLumina/NativeWindowSystem.h +++ b/src-qt5/core/libLumina/NativeWindowSystem.h @@ -14,6 +14,7 @@ #include "NativeWindow.h" #include <QDateTime> #include <QTimer> +#include <QDebug> class NativeWindowSystem : public QObject{ Q_OBJECT @@ -22,21 +23,11 @@ private: QList<NativeWindow*> TWindows; //Simplifications to find an already-created window object - NativeWindow* findWindow(WId id){ - for(int i=0; i<NWindows.length(); i++){ - if(id==NWindows[i]->id()){ return NWindows[i]; } - } - return 0; - } + NativeWindow* findWindow(WId id, bool checkRelated = true); - NativeWindow* findTrayWindow(WId id){ - for(int i=0; i<TWindows.length(); i++){ - if(id==TWindows[i]->id()){ return TWindows[i]; } - } - return 0; - } + NativeWindow* findTrayWindow(WId id); - //Now define a simple private_objects class so that each implementation + //Now define a simple private_objects class so that each implementation // has a storage container for defining/placing private objects as needed class p_objects; p_objects* obj; @@ -58,12 +49,16 @@ private: } } - // Since some properties may be easier to update in bulk + // Since some properties may be easier to update in bulk // let the native system interaction do them in whatever logical groups are best void UpdateWindowProperties(NativeWindow* win, QList< NativeWindow::Property > props); + void ChangeWindowProperties(NativeWindow* win, QList< NativeWindow::Property > props, QList<QVariant> vals); + + //Generic private variables + bool screenLocked; public: - enum Property{ None, CurrentWorkspace, Workspaces, VirtualRoots, WorkAreas }; + //enum Property{ None, CurrentWorkspace, Workspaces, VirtualRoots, WorkAreas }; enum MouseButton{NoButton, LeftButton, RightButton, MidButton, BackButton, ForwardButton, TaskButton, WheelUp, WheelDown, WheelLeft, WheelRight}; NativeWindowSystem(); @@ -84,11 +79,25 @@ public: public slots: //These are the slots which are typically only used by the desktop system itself or the NativeWindowEventFilter - //RootWindow interactions + //This is called by the lock screen to keep the NWS aware of the current status + // it is **NOT** the function to call for the user to actually lock the session (that is in the screensaver/lockscreen class) + void ScreenLockChanged(bool lock){ + screenLocked = lock; + } + + //Root Window property registrations void RegisterVirtualRoot(WId); + void setRoot_supportedActions(); + void setRoot_numberOfWorkspaces(QStringList names); + void setRoot_currentWorkspace(int); + void setRoot_clientList(QList<WId>, bool stackorder = false); + void setRoot_desktopGeometry(QRect); + void setRoot_desktopWorkarea(QList<QRect>); + void setRoot_activeWindow(WId); + + // - Workspaces + int currentWorkspace(); //void GoToWorkspace(int); - //void RegisterWorkspaces(QStringList); //Names of workspaces, in ascending order - //void RegisterKnownInteractions(); //NativeWindowEventFilter interactions @@ -96,29 +105,33 @@ public slots: void NewTrayWindowDetected(WId); //will automatically create the new NativeWindow object void WindowCloseDetected(WId); //will update the lists and make changes if needed void WindowPropertyChanged(WId, NativeWindow::Property); //will rescan the window and update the object as needed + void WindowPropertyChanged(WId, NativeWindow::Property, QVariant); //will save that property/value to the right object + void WindowPropertiesChanged(WId, QList<NativeWindow::Property>, QList<QVariant>); + void RequestPropertyChange(WId, NativeWindow::Property, QVariant); + void RequestPropertiesChange(WId, QList<NativeWindow::Property>, QList<QVariant>); void GotPong(WId); -/* void NewKeyPress(int keycode, WId win = 0); + void NewKeyPress(int keycode, WId win = 0); void NewKeyRelease(int keycode, WId win = 0); void NewMousePress(int buttoncode, WId win = 0); - void NewMouseRelease(int buttoncode, WId win = 0);*/ + void NewMouseRelease(int buttoncode, WId win = 0); void CheckDamageID(WId); private slots: //These are the slots which are built-in and automatically connected when a new NativeWindow is created - void RequestPropertiesChange(WId, QList<NativeWindow::Property>, QList<QVariant>); void RequestClose(WId); void RequestKill(WId); void RequestPing(WId); + void RequestReparent(WId, WId, QPoint); //client, parent, relative origin point in parent signals: void NewWindowAvailable(NativeWindow*); void NewTrayWindowAvailable(NativeWindow*); void NewInputEvent(); //a mouse or keypress was detected (lock-state independent); - void KeyPressDetected(Qt::Key, WId); //only emitted if lockstate = false - void KeyReleaseDetected(Qt::Key, WId); //only emitted if lockstate = false - void MousePressDetected(Qt::MouseButton, WId); //only emitted if lockstate = false - void MouseReleaseDetected(Qt::MouseButton, WId); //only emitted if lockstate = false + void KeyPressDetected(WId, Qt::Key); //only emitted if lockstate = false + void KeyReleaseDetected(WId, Qt::Key); //only emitted if lockstate = false + void MousePressDetected(WId, NativeWindowSystem::MouseButton); //only emitted if lockstate = false + void MouseReleaseDetected(WId, NativeWindowSystem::MouseButton); //only emitted if lockstate = false }; |