diff options
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmintegration.h')
-rw-r--r-- | src/plugins/platforms/wasm/qwasmintegration.h | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/src/plugins/platforms/wasm/qwasmintegration.h b/src/plugins/platforms/wasm/qwasmintegration.h index 76296ff1a7..870bd0d16b 100644 --- a/src/plugins/platforms/wasm/qwasmintegration.h +++ b/src/plugins/platforms/wasm/qwasmintegration.h @@ -6,23 +6,20 @@ #include "qwasmwindow.h" +#include "qwasminputcontext.h" + #include <qpa/qplatformintegration.h> #include <qpa/qplatformscreen.h> #include <qpa/qplatforminputcontext.h> #include <QtCore/qhash.h> +#include <private/qstdweb_p.h> + #include <emscripten.h> #include <emscripten/html5.h> #include <emscripten/val.h> -#include "qwasminputcontext.h" -#include <private/qstdweb_p.h> - -#if QT_CONFIG(draganddrop) -#include "qwasmdrag.h" -#endif - QT_BEGIN_NAMESPACE class QWasmEventTranslator; @@ -35,6 +32,7 @@ class QWasmBackingStore; class QWasmClipboard; class QWasmAccessibility; class QWasmServices; +class QWasmDrag; class QWasmIntegration : public QObject, public QPlatformIntegration { @@ -72,21 +70,29 @@ public: QWasmInputContext *getWasmInputContext() { return m_platformInputContext; } static QWasmIntegration *get() { return s_instance; } - void addScreen(const emscripten::val &canvas); - void removeScreen(const emscripten::val &canvas); + void setContainerElements(emscripten::val elementArray); + void addContainerElement(emscripten::val elementArray); + void removeContainerElement(emscripten::val elementArray); void resizeScreen(const emscripten::val &canvas); - void resizeAllScreens(); void updateDpi(); + void resizeAllScreens(); + void loadLocalFontFamilies(emscripten::val families); void removeBackingStore(QWindow* window); + void releaseRequesetUpdateHold(); static quint64 getTimestamp(); int touchPoints; private: + struct ScreenMapping { + emscripten::val emscriptenVal; + QWasmScreen *wasmScreen; + }; + mutable QWasmFontDatabase *m_fontDb; mutable QWasmServices *m_desktopServices; mutable QHash<QWindow *, QWasmBackingStore *> m_backingStores; - QList<QPair<emscripten::val, QWasmScreen *>> m_screens; + QList<ScreenMapping> m_screens; mutable QWasmClipboard *m_clipboard; mutable QWasmAccessibility *m_accessibility; @@ -97,7 +103,7 @@ private: mutable QWasmInputContext *m_platformInputContext = nullptr; #if QT_CONFIG(draganddrop) - QWasmDrag *m_drag; + std::unique_ptr<QWasmDrag> m_drag; #endif }; |