4#ifndef QWASMINTEGRATION_H
5#define QWASMINTEGRATION_H
11#include <qpa/qplatformintegration.h>
12#include <qpa/qplatformscreen.h>
13#include <qpa/qplatforminputcontext.h>
15#include <QtCore/qhash.h>
17#include <private/qstdweb_p.h>
19#include <emscripten.h>
20#include <emscripten/html5.h>
21#include <emscripten/val.h>
27class QWasmEventTranslator;
28class QWasmFontDatabase;
35class QWasmAccessibility;
38class QWasmSuspendResumeControl;
47 bool hasCapability(QPlatformIntegration::Capability cap)
const override;
63#ifndef QT_NO_ACCESSIBILITY
70#if QT_CONFIG(draganddrop)
91 QWasmWindow *createWindow(QWindow *, WId nativeHandle)
const;
93 struct ScreenMapping {
98 mutable QWasmFontDatabase *m_fontDb;
100 mutable QHash<QWindow *, QWasmBackingStore *> m_backingStores;
101 QList<ScreenMapping> m_screens;
103 mutable QWasmAccessibility *m_accessibility;
105 qreal m_fontDpi = -1;
106 mutable QScopedPointer<QPlatformInputContext> m_inputContext;
109 QWasmInputContext *m_wasmInputContext =
nullptr;
110 std::shared_ptr<QWasmSuspendResumeControl> m_suspendResume;
112#if QT_CONFIG(draganddrop)
QWasmCompositor(QWasmScreen *screen)
QPlatformInputContext * inputContext() const override
Returns the platforms input context.
void setContainerElements(emscripten::val elementArray)
static QWasmIntegration * get()
Qt::WindowState defaultWindowState(Qt::WindowFlags flags) const override
QPlatformFontDatabase * fontDatabase() const override
Accessor for the platform integration's fontdatabase.
QPlatformOffscreenSurface * createPlatformOffscreenSurface(QOffscreenSurface *surface) const override
Factory function for QOffscreenSurface.
void addContainerElement(emscripten::val elementArray)
void initialize() override
Performs initialization steps that depend on having an event dispatcher available.
QWasmClipboard * getWasmClipboard()
void removeContainerElement(emscripten::val elementArray)
QAbstractEventDispatcher * createEventDispatcher() const override
Factory function for the GUI event dispatcher.
QStringList themeNames() const override
void releaseRequesetUpdateHold()
void loadLocalFontFamilies(emscripten::val families)
QPlatformOpenGLContext * createPlatformOpenGLContext(QOpenGLContext *context) const override
Factory function for QPlatformOpenGLContext.
QWasmInputContext * wasmInputContext() const
void removeBackingStore(QWindow *window)
QPlatformBackingStore * createPlatformBackingStore(QWindow *window) const override
Factory function for QPlatformBackingStore.
static quint64 getTimestamp()
QPlatformServices * services() const override
QPlatformWindow * createForeignWindow(QWindow *window, WId nativeHandle) const override
QPlatformClipboard * clipboard() const override
Accessor for the platform integration's clipboard.
QPlatformTheme * createPlatformTheme(const QString &name) const override
void resizeScreen(const emscripten::val &canvas)
QVariant styleHint(QPlatformIntegration::StyleHint hint) const override
bool hasCapability(QPlatformIntegration::Capability cap) const override
QPlatformWindow * createPlatformWindow(QWindow *window) const override
Factory function for QPlatformWindow.
QPlatformAccessibility * accessibility() const override
friend class QWasmCompositor
Combined button and popup list for selecting options.