8#include <qpa/qplatformwindow.h>
9#include <qpa/qplatformwindow_p.h>
10#include <emscripten/html5.h>
18#include <QtCore/private/qstdweb_p.h>
19#include "QtGui/qopenglcontext.h"
20#include <QtOpenGL/qopengltextureblitter.h>
22#include <emscripten/val.h>
40 public QNativeInterface::Private::QWasmWindow
68 WId
winId()
const override;
71 void raise()
override;
72 void lower()
override;
94 emscripten::val
context2d()
const {
return m_context2d; }
99 emscripten::val
document()
const override {
return m_document; }
100 emscripten::val
clientArea()
const override {
return m_qtWindow; }
108 static constexpr auto defaultWindowSize = 160;
116 bool hasFrame() const;
117 bool hasTitleBar() const;
118 bool hasBorder() const;
119 bool hasShadow() const;
120 bool hasMaximizeButton() const;
121 void applyWindowState();
132 QRect m_normalGeometry {0, 0, 0 ,0};
134 emscripten::val m_document;
135 emscripten::val m_qtWindow;
136 emscripten::val m_windowContents;
137 emscripten::val m_canvasContainer;
138 emscripten::val m_a11yContainer;
139 emscripten::val m_canvas;
140 emscripten::val m_context2d = emscripten::val::undefined();
142 std::unique_ptr<NonClientArea> m_nonClientArea;
143 std::unique_ptr<ClientArea> m_clientArea;
147 std::unique_ptr<qstdweb::EventCallback> m_keyDownCallback;
148 std::unique_ptr<qstdweb::EventCallback> m_keyUpCallback;
150 std::unique_ptr<qstdweb::EventCallback> m_pointerLeaveCallback;
151 std::unique_ptr<qstdweb::EventCallback> m_pointerEnterCallback;
153 std::unique_ptr<qstdweb::EventCallback> m_dropCallback;
155 std::unique_ptr<qstdweb::EventCallback> m_wheelEventCallback;
162 QPoint m_lastPointerMovePoint;
165 bool m_wantCapture =
false;
166 bool m_hasTitle =
false;
167 bool m_needsCompositor =
false;
168 long m_requestAnimationFrameId = -1;
171 bool windowIsPopupType(Qt::WindowFlags
flags)
const;
The QIcon class provides scalable icons in different modes and states.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
The QRegion class specifies a clip region for a painter.
\macro QT_RESTRICTED_CAST_FROM_ASCII
void setVisible(bool visible) override
Reimplemented in subclasses to show the surface if visible is true, and hide it if visible is false.
qreal devicePixelRatio() const override
Reimplement this function in subclass to return the device pixel ratio for the window.
QRect normalGeometry() const override
Returns the geometry of a window in 'normal' state (neither maximized, fullscreen nor minimized) for ...
static QWasmWindow * fromWindow(QWindow *window)
QSurfaceFormat format() const override
Returns the actual surface format of the window.
void setParent(const QPlatformWindow *window) final
This function is called to enable native child window in QPA.
void raise() override
Reimplement to be able to let Qt raise windows to the top of the desktop.
void setWindowTitle(const QString &title) override
Reimplement to set the window title to title.
QWasmWindow(QWindow *w, QWasmDeadKeySupport *deadKeySupport, QWasmCompositor *compositor, QWasmBackingStore *backingStore)
void requestActivateWindow() override
Reimplement to let Qt be able to request activation/focus for a window.
WId winId() const override
Reimplement in subclasses to return a handle to the native window.
emscripten::val clientArea() const override
std::string canvasSelector() const
emscripten::val a11yContainer() const
void onParentChanged(QWasmWindowTreeNode *previous, QWasmWindowTreeNode *current, QWasmWindowStack::PositionPreference positionPreference) final
void onNonClientAreaInteraction()
friend class QWasmEventTranslator
emscripten::val inputHandlerElement() const
void setGeometry(const QRect &) override
This function is called by Qt whenever a window is moved or resized using the QWindow API.
bool setMouseGrabEnabled(bool grab) final
bool onNonClientEvent(const PointerEvent &event)
void setWindowCursor(QByteArray cssCursorName)
void setZOrder(int order)
emscripten::val context2d() const
void setMask(const QRegion ®ion) final
Reimplement to be able to let Qt set the mask of a window.
void setBackingStore(QWasmBackingStore *store)
QWasmWindowTreeNode * parentNode() final
void initialize() override
Called as part of QWindow::create(), after constructing the window.
emscripten::val document() const override
void requestUpdate() override
Requests an QEvent::UpdateRequest event.
QWasmBackingStore * backingStore() const
void lower() override
Reimplement to be able to let Qt lower windows to the bottom of the desktop.
void setOpacity(qreal level) override
Reimplement to be able to let Qt set the opacity level of a window.
void onActivationChanged(bool active)
void setWindowState(Qt::WindowStates state) override
Requests setting the window state of this surface to type.
void setWindowIcon(const QIcon &icon) override
Reimplement to set the window icon to icon.
void propagateSizeHints() override
Reimplement to propagate the size hints of the QWindow.
bool setKeyboardGrabEnabled(bool) override
QMargins frameMargins() const override
QWasmWindow * asWasmWindow() final
bool windowEvent(QEvent *event) final
Reimplement this method to be able to do any platform specific event handling.
QWasmScreen * platformScreen() const
emscripten::val containerElement() final
void setWindowFlags(Qt::WindowFlags flags) override
Requests setting the window flags of this surface to flags.
Combined button and popup list for selecting options.
static QOpenGLCompositor * compositor
GLenum GLuint GLint level
GLfloat GLfloat GLfloat w
[0]
GLfixed GLfixed GLint GLint order