diff options
Diffstat (limited to 'src-qt5/core/libLumina/NativeWindow.cpp')
-rw-r--r-- | src-qt5/core/libLumina/NativeWindow.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src-qt5/core/libLumina/NativeWindow.cpp b/src-qt5/core/libLumina/NativeWindow.cpp new file mode 100644 index 00000000..bd42ecaa --- /dev/null +++ b/src-qt5/core/libLumina/NativeWindow.cpp @@ -0,0 +1,37 @@ +//=========================================== +// Lumina-DE source code +// Copyright (c) 2017, Ken Moore +// Available under the 3-clause BSD license +// See the LICENSE file for full details +//=========================================== +#include "NativeWindow.h" + +// === PUBLIC === +NativeWindow::NativeWindow(WId id) : QObject(){ + winid = id; + WIN = QWindow::fromWinId(winid); +} + +NativeWindow::~NativeWindow(){ + hash.clear(); + //WIN->deleteLater(); //This class only deals with Native windows which were created outside the app - they need to be cleaned up outside the app too +} + +WId NativeWindow::id(){ + return winid; +} + +QWindow* NativeWindow::window(){ + return WIN; +} + +QVariant NativeWindow::property(NativeWindow::Property prop){ + if(hash.contains(prop)){ return hash.value(prop); } + return QVariant(); //null variant +} + +void NativeWindow::setProperty(NativeWindow::Property prop, QVariant val){ + if(prop == NativeWindow::None){ return; } + hash.insert(prop, val); + emit PropertyChanged(prop, val); +} |