diff options
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmcompositor.h')
-rw-r--r-- | src/plugins/platforms/wasm/qwasmcompositor.h | 61 |
1 files changed, 15 insertions, 46 deletions
diff --git a/src/plugins/platforms/wasm/qwasmcompositor.h b/src/plugins/platforms/wasm/qwasmcompositor.h index 95e5de818d..0f24a6690e 100644 --- a/src/plugins/platforms/wasm/qwasmcompositor.h +++ b/src/plugins/platforms/wasm/qwasmcompositor.h @@ -7,25 +7,16 @@ #include "qwasmwindowstack.h" #include <qpa/qplatformwindow.h> -#include <QMap> - -#include <QtGui/qinputdevice.h> -#include <QtCore/private/qstdweb_p.h> - -#include <QPointer> -#include <QPointingDevice> -#include <emscripten/html5.h> -#include <emscripten/emscripten.h> -#include <emscripten/bind.h> +#include <QMap> +#include <tuple> QT_BEGIN_NAMESPACE -struct PointerEvent; class QWasmWindow; class QWasmScreen; -class QOpenGLContext; -class QOpenGLTexture; + +enum class QWasmWindowTreeNodeChangeType; class QWasmCompositor final : public QObject { @@ -34,57 +25,35 @@ public: QWasmCompositor(QWasmScreen *screen); ~QWasmCompositor() final; - void initEventHandlers(); - - void addWindow(QWasmWindow *window); - void removeWindow(QWasmWindow *window); - void setVisible(QWasmWindow *window, bool visible); - void raise(QWasmWindow *window); - void lower(QWasmWindow *window); void onScreenDeleting(); - QWindow *windowAt(QPoint globalPoint, int padding = 0) const; - QWindow *keyWindow() const; - QWasmScreen *screen(); + void setEnabled(bool enabled); + + static bool releaseRequestUpdateHold(); + void requestUpdate(); enum UpdateRequestDeliveryType { ExposeEventDelivery, UpdateRequestDelivery }; - void requestUpdateAllWindows(); - void requestUpdateWindow(QWasmWindow *window, UpdateRequestDeliveryType updateType = ExposeEventDelivery); + void requestUpdateWindow(QWasmWindow *window, const QRect &updateRect, UpdateRequestDeliveryType updateType = ExposeEventDelivery); - void handleBackingStoreFlush(QWindow *window); + void handleBackingStoreFlush(QWindow *window, const QRect &updateRect); + void onWindowTreeChanged(QWasmWindowTreeNodeChangeType changeType, QWasmWindow *window); private: - void frame(bool all, const QList<QWasmWindow *> &windows); - - void onTopWindowChanged(); + void frame(const QList<QWasmWindow *> &windows); void deregisterEventHandlers(); - void destroy(); - void requestUpdate(); void deliverUpdateRequests(); - void deliverUpdateRequest(QWasmWindow *window, UpdateRequestDeliveryType updateType); - - static int touchCallback(int eventType, const EmscriptenTouchEvent *ev, void *userData); - - bool processTouch(int eventType, const EmscriptenTouchEvent *touchEvent); - - void updateEnabledState(); - - QWasmWindowStack m_windowStack; + void deliverUpdateRequest(QWasmWindow *window, const QRect &updateRect, UpdateRequestDeliveryType updateType); bool m_isEnabled = true; - QMap<QWasmWindow *, UpdateRequestDeliveryType> m_requestUpdateWindows; - bool m_requestUpdateAllWindows = false; + QMap<QWasmWindow *, std::tuple<QRect, UpdateRequestDeliveryType>> m_requestUpdateWindows; int m_requestAnimationFrameId = -1; bool m_inDeliverUpdateRequest = false; - - std::unique_ptr<QPointingDevice> m_touchDevice; - - QMap<int, QPointF> m_pressedTouchIds; + static bool m_requestUpdateHoldEnabled; }; QT_END_NAMESPACE |