summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm/qwasmevent.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmevent.h')
-rw-r--r--src/plugins/platforms/wasm/qwasmevent.h28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/plugins/platforms/wasm/qwasmevent.h b/src/plugins/platforms/wasm/qwasmevent.h
index 012b1b235b..6ada5393e3 100644
--- a/src/plugins/platforms/wasm/qwasmevent.h
+++ b/src/plugins/platforms/wasm/qwasmevent.h
@@ -5,11 +5,12 @@
#define QWASMEVENT_H
#include "qwasmplatform.h"
+#include "qwasmdom.h"
#include <QtCore/qglobal.h>
#include <QtCore/qnamespace.h>
#include <QtGui/qevent.h>
-
+#include <private/qstdweb_p.h>
#include <QPoint>
#include <emscripten/html5.h>
@@ -18,8 +19,12 @@
QT_BEGIN_NAMESPACE
class QWasmDeadKeySupport;
+class QWindow;
enum class EventType {
+ DragEnd,
+ DragOver,
+ DragStart,
Drop,
KeyDown,
KeyUp,
@@ -35,6 +40,7 @@ enum class EventType {
enum class PointerType {
Mouse,
Touch,
+ Pen,
Other,
};
@@ -119,15 +125,16 @@ QFlags<Qt::KeyboardModifier> getForEvent<EmscriptenKeyboardEvent>(
struct Event
{
- Event(EventType type, emscripten::val target);
+ Event(EventType type, emscripten::val webEvent);
~Event();
Event(const Event &other);
Event(Event &&other);
Event &operator=(const Event &other);
Event &operator=(Event &&other);
+ emscripten::val webEvent;
EventType type;
- emscripten::val target = emscripten::val::undefined();
+ emscripten::val target() const { return webEvent["target"]; }
};
struct KeyEvent : public Event
@@ -214,6 +221,10 @@ struct PointerEvent : public MouseEvent
PointerType pointerType;
int pointerId;
qreal pressure;
+ qreal tiltX;
+ qreal tiltY;
+ qreal tangentialPressure;
+ qreal twist;
qreal width;
qreal height;
bool isPrimary;
@@ -221,17 +232,22 @@ struct PointerEvent : public MouseEvent
struct DragEvent : public MouseEvent
{
- static std::optional<DragEvent> fromWeb(emscripten::val webEvent);
+ static std::optional<DragEvent> fromWeb(emscripten::val webEvent, QWindow *targetQWindow);
- DragEvent(EventType type, emscripten::val webEvent);
+ DragEvent(EventType type, emscripten::val webEvent, QWindow *targetQWindow);
~DragEvent();
DragEvent(const DragEvent &other);
DragEvent(DragEvent &&other);
DragEvent &operator=(const DragEvent &other);
DragEvent &operator=(DragEvent &&other);
+ void cancelDragStart();
+ void acceptDragOver();
+ void acceptDrop();
+
Qt::DropAction dropAction;
- emscripten::val dataTransfer;
+ dom::DataTransfer dataTransfer;
+ QWindow *targetWindow;
};
struct WheelEvent : public MouseEvent