Skip to contentSkip to conversation

ui/touch: Move event handling to a common helper

PATCH New Bilal Elmoussaoui 1 participant 1 message Jun 13, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ui/touch: Move event handling to a common helper

To share code between the GTK and DBus UI bakcends see the next commit for details

---
 include/ui/console.h | 14 ++++++++++
 ui/console.c         | 65 ++++++++++++++++++++++++++++++++++++++++++++
 ui/gtk.c             | 62 ++++--------------------------------------
 3 files changed, 84 insertions(+), 57 deletions(-)
include/ui/console.h +14 -0
index ae5ec46..04d4317 100644
@@ -5,6 +5,7 @@
 #include "qom/object.h"
 #include "qemu/notify.h"
 #include "qapi/qapi-types-ui.h"
+#include "ui/input.h"
 
 #ifdef CONFIG_OPENGL
 # include <epoxy/gl.h>
@@ -95,6 +96,19 @@ bool kbd_put_qcode_console(QemuConsole *s, int qcode, bool ctrl);
 void kbd_put_string_console(QemuConsole *s, const char *str, int len);
 void kbd_put_keysym(int keysym);
 
+/* Touch devices */
+typedef struct touch_slot {
+    int x;
+    int y;
+    int tracking_id;
+} touch_slot;
+
+bool console_handle_touch_event(QemuConsole *con,
+                                struct touch_slot touch_slots[INPUT_EVENT_SLOTS_MAX],
+                                uint64_t num_slot,
+                                int width, int height,
+                                double x, double y,
+                                InputMultiTouchType type);
 /* consoles */
 
 #define TYPE_QEMU_CONSOLE "qemu-console"
ui/console.c +65 -0

71 lines not on this page · raw message

ui/gtk.c +5 -57

88 lines not on this page · raw message

Signature · 1 line
2.40.1