aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/libLumina/NativeEmbedWidget.h
diff options
context:
space:
mode:
authorWeblate <noreply@weblate.org>2017-07-19 19:01:31 +0000
committerWeblate <noreply@weblate.org>2017-07-19 19:01:31 +0000
commitb687e491eea208afba43b67a072ddf430bfeb1fc (patch)
tree80c24ebc2a04e3d20e74004ebf9e5411252a697d /src-qt5/core/libLumina/NativeEmbedWidget.h
parentPush local changes (diff)
parentMerge branch 'master' of github.com:trueos/lumina (diff)
downloadlumina-b687e491eea208afba43b67a072ddf430bfeb1fc.tar.gz
lumina-b687e491eea208afba43b67a072ddf430bfeb1fc.tar.bz2
lumina-b687e491eea208afba43b67a072ddf430bfeb1fc.zip
Merge branch 'master' of github.com:trueos/lumina
Diffstat (limited to 'src-qt5/core/libLumina/NativeEmbedWidget.h')
-rw-r--r--src-qt5/core/libLumina/NativeEmbedWidget.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/src-qt5/core/libLumina/NativeEmbedWidget.h b/src-qt5/core/libLumina/NativeEmbedWidget.h
new file mode 100644
index 00000000..78c11dfc
--- /dev/null
+++ b/src-qt5/core/libLumina/NativeEmbedWidget.h
@@ -0,0 +1,55 @@
+//===========================================
+// Lumina-DE source code
+// Copyright (c) 2017, Ken Moore
+// Available under the 3-clause BSD license
+// See the LICENSE file for full details
+//===========================================
+// This is a container object for embedding a native window into a QWidget
+// and maintaining a 1-to-1 mapping of sizing and other properties
+// while also providing compositing effects between the two windows
+//===========================================
+#ifndef _LUMINA_NATIVE_EMBED_WIDGET_H
+#define _LUMINA_NATIVE_EMBED_WIDGET_H
+
+#include "NativeWindow.h"
+#include <QWidget>
+#include <QTimer>
+#include <QResizeEvent>
+#include <QShowEvent>
+#include <QHideEvent>
+#include <QPaintEvent>
+
+class NativeEmbedWidget : public QWidget{
+ Q_OBJECT
+private:
+ NativeWindow *WIN;
+ QSize winSize;
+
+private slots:
+ //Simplification functions
+ void syncWinSize(QSize sz = QSize());
+ void syncWidgetSize(QSize sz);
+ void hideWindow();
+ void showWindow();
+ QImage windowImage(QRect geom);
+
+
+public:
+ NativeEmbedWidget(QWidget *parent);
+
+ bool embedWindow(NativeWindow *window);
+ bool detachWindow();
+ bool isEmbedded(); //status of the embed
+
+public slots:
+ void resyncWindow();
+ void repaintWindow();
+
+protected:
+ void resizeEvent(QResizeEvent *ev);
+ void showEvent(QShowEvent *ev);
+ void hideEvent(QHideEvent *ev);
+ void paintEvent(QPaintEvent *ev);
+};
+
+#endif
bgstack15