aboutsummaryrefslogtreecommitdiff
path: root/include/ui
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2013-11-27 10:35:26 +0100
committerGerd Hoffmann <kraxel@redhat.com>2014-03-05 09:50:17 +0100
commitc8b405b6798e3731eb9a71fcd753745f224ce698 (patch)
treec36fd8994d4bb05fa33c66b003e0ed27bb8f84ee /include/ui
parent8b6b0c59a600d8254a409b837d5358d16e881fd0 (diff)
downloadqemu-c8b405b6798e3731eb9a71fcd753745f224ce698.zip
qemu-c8b405b6798e3731eb9a71fcd753745f224ce698.tar.gz
qemu-c8b405b6798e3731eb9a71fcd753745f224ce698.tar.bz2
input: add core bits of the new input layer
Register and unregister handlers. Event dispatcher code. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'include/ui')
-rw-r--r--include/ui/input.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/ui/input.h b/include/ui/input.h
new file mode 100644
index 0000000..3cf3641
--- /dev/null
+++ b/include/ui/input.h
@@ -0,0 +1,32 @@
+#ifndef INPUT_H
+#define INPUT_H
+
+#include "qapi-types.h"
+
+#define INPUT_EVENT_MASK_KEY (1<<INPUT_EVENT_KIND_KEY)
+#define INPUT_EVENT_MASK_BTN (1<<INPUT_EVENT_KIND_BTN)
+#define INPUT_EVENT_MASK_REL (1<<INPUT_EVENT_KIND_REL)
+#define INPUT_EVENT_MASK_ABS (1<<INPUT_EVENT_KIND_ABS)
+
+typedef struct QemuInputHandler QemuInputHandler;
+typedef struct QemuInputHandlerState QemuInputHandlerState;
+
+typedef void (*QemuInputHandlerEvent)(DeviceState *dev, QemuConsole *src,
+ InputEvent *evt);
+typedef void (*QemuInputHandlerSync)(DeviceState *dev);
+
+struct QemuInputHandler {
+ const char *name;
+ uint32_t mask;
+ QemuInputHandlerEvent event;
+ QemuInputHandlerSync sync;
+};
+
+QemuInputHandlerState *qemu_input_handler_register(DeviceState *dev,
+ QemuInputHandler *handler);
+void qemu_input_handler_activate(QemuInputHandlerState *s);
+void qemu_input_handler_unregister(QemuInputHandlerState *s);
+void qemu_input_event_send(QemuConsole *src, InputEvent *evt);
+void qemu_input_event_sync(void);
+
+#endif /* INPUT_H */