summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm/qwasmscreen.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmscreen.h')
-rw-r--r--src/plugins/platforms/wasm/qwasmscreen.h23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/plugins/platforms/wasm/qwasmscreen.h b/src/plugins/platforms/wasm/qwasmscreen.h
index 98be384522..da171d3f50 100644
--- a/src/plugins/platforms/wasm/qwasmscreen.h
+++ b/src/plugins/platforms/wasm/qwasmscreen.h
@@ -6,6 +6,8 @@
#include "qwasmcursor.h"
+#include "qwasmwindowtreenode.h"
+
#include <qpa/qplatformscreen.h>
#include <QtCore/qscopedpointer.h>
@@ -23,7 +25,7 @@ class QWasmCompositor;
class QWasmDeadKeySupport;
class QOpenGLContext;
-class QWasmScreen : public QObject, public QPlatformScreen
+class QWasmScreen : public QObject, public QPlatformScreen, public QWasmWindowTreeNode
{
Q_OBJECT
public:
@@ -36,10 +38,14 @@ public:
emscripten::val element() const;
QString eventTargetId() const;
QString outerScreenId() const;
+ QPointingDevice *touchDevice() { return m_touchDevice.get(); }
+ QPointingDevice *tabletDevice() { return m_tabletDevice.get(); }
QWasmCompositor *compositor();
QWasmDeadKeySupport *deadKeySupport() { return m_deadKeySupport.get(); }
+ QList<QWasmWindow *> allWindows();
+
QRect geometry() const override;
int depth() const override;
QImage::Format format() const override;
@@ -52,8 +58,12 @@ public:
QWindow *topWindow() const;
QWindow *topLevelAt(const QPoint &p) const override;
- QPoint mapFromLocal(const QPoint &p) const;
- QPoint clipPoint(const QPoint &p) const;
+ // QWasmWindowTreeNode:
+ emscripten::val containerElement() final;
+ QWasmWindowTreeNode *parentNode() final;
+
+ QPointF mapFromLocal(const QPointF &p) const;
+ QPointF clipPoint(const QPointF &p) const;
void invalidateSize();
void updateQScreenAndCanvasRenderSize();
@@ -64,9 +74,16 @@ public slots:
void setGeometry(const QRect &rect);
private:
+ // QWasmWindowTreeNode:
+ void onSubtreeChanged(QWasmWindowTreeNodeChangeType changeType, QWasmWindowTreeNode *parent,
+ QWasmWindow *child) final;
+
emscripten::val m_container;
+ emscripten::val m_intermediateContainer;
emscripten::val m_shadowContainer;
std::unique_ptr<QWasmCompositor> m_compositor;
+ std::unique_ptr<QPointingDevice> m_touchDevice;
+ std::unique_ptr<QPointingDevice> m_tabletDevice;
std::unique_ptr<QWasmDeadKeySupport> m_deadKeySupport;
QRect m_geometry = QRect(0, 0, 100, 100);
int m_depth = 32;