summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm/qwasmwindow.h
diff options
context:
space:
mode:
authorPiotr Wierciński <[email protected]>2023-05-03 17:07:06 +0200
committerPiotr Wierciński <[email protected]>2023-05-05 12:27:36 +0200
commitfb2fccc534d8dc0bf4e5a1b71cd5572fd6da325f (patch)
tree1e426711d04a53e1be6568ad98b7ca7ed1d3725e /src/plugins/platforms/wasm/qwasmwindow.h
parenta1f7fb73c273ea858a9eb81bdb48874bfcdf9858 (diff)
wasm: Add DOM accessors functions through NativeInterface
Expose document and clientArea emscripten objects through NativeInterface. This is required by WebView implementation for wasm platform. Task-number: QTBUG-75183 Change-Id: I6f2f084a9dbceb80d2186c7395c008f268a91e39 Reviewed-by: Tor Arne Vestbø <[email protected]> Reviewed-by: Mikołaj Boc <[email protected]>
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmwindow.h')
-rw-r--r--src/plugins/platforms/wasm/qwasmwindow.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/platforms/wasm/qwasmwindow.h b/src/plugins/platforms/wasm/qwasmwindow.h
index 661a5160e89..f191c909542 100644
--- a/src/plugins/platforms/wasm/qwasmwindow.h
+++ b/src/plugins/platforms/wasm/qwasmwindow.h
@@ -6,6 +6,7 @@
#include "qwasmintegration.h"
#include <qpa/qplatformwindow.h>
+#include <qpa/qplatformwindow_p.h>
#include <emscripten/html5.h>
#include "qwasmbackingstore.h"
#include "qwasmscreen.h"
@@ -37,7 +38,7 @@ struct PointerEvent;
class QWasmDeadKeySupport;
struct WheelEvent;
-class QWasmWindow final : public QPlatformWindow
+class QWasmWindow final : public QPlatformWindow, public QNativeInterface::Private::QWasmWindow
{
public:
QWasmWindow(QWindow *w, QWasmDeadKeySupport *deadKeySupport, QWasmCompositor *compositor,
@@ -91,6 +92,10 @@ public:
emscripten::val a11yContainer() const { return m_a11yContainer; }
emscripten::val inputHandlerElement() const { return m_windowContents; }
+ // QNativeInterface::Private::QWasmWindow
+ emscripten::val document() const override { return m_document; }
+ emscripten::val clientArea() const override { return m_qtWindow; }
+
private:
friend class QWasmScreen;
static constexpr auto minSizeForRegularWindows = 100;