aboutsummaryrefslogtreecommitdiffstats
path: root/android/protocol/user-events-protocol.h
diff options
context:
space:
mode:
authorVladimir Chtchetkine <vchtchetkine@google.com>2011-01-28 10:56:16 -0800
committerVladimir Chtchetkine <vchtchetkine@google.com>2011-01-28 10:56:16 -0800
commit250b2e00af04f8407dea564e643dad4ef08b8a88 (patch)
treea9aac104fcd0752b3ba93246bf0fa98ac142ece0 /android/protocol/user-events-protocol.h
parent138f690b8c80a0d0e06a0549d4715243c12a0c96 (diff)
downloadexternal_qemu-250b2e00af04f8407dea564e643dad4ef08b8a88.zip
external_qemu-250b2e00af04f8407dea564e643dad4ef08b8a88.tar.gz
external_qemu-250b2e00af04f8407dea564e643dad4ef08b8a88.tar.bz2
Refactored user-events protocol
Change-Id: I08afb96ef17a52c3795f5029acfc244a93ab57c7
Diffstat (limited to 'android/protocol/user-events-protocol.h')
-rw-r--r--android/protocol/user-events-protocol.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/android/protocol/user-events-protocol.h b/android/protocol/user-events-protocol.h
new file mode 100644
index 0000000..c1e64e2
--- /dev/null
+++ b/android/protocol/user-events-protocol.h
@@ -0,0 +1,58 @@
+/* Copyright (C) 2010 The Android Open Source Project
+**
+** This software is licensed under the terms of the GNU General Public
+** License version 2, as published by the Free Software Foundation, and
+** may be copied, distributed, and modified under those terms.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+*/
+
+#ifndef _ANDROID_PROTOCOL_USER_EVENTS_H
+#define _ANDROID_PROTOCOL_USER_EVENTS_H
+
+/*
+ * Contains declarations related to the UI events handled by the Core.
+ */
+
+#include "android/globals.h"
+
+/* Mouse event. */
+#define AUSER_EVENT_MOUSE 0
+/* Keycode event. */
+#define AUSER_EVENT_KEYCODE 1
+/* Generic event. */
+#define AUSER_EVENT_GENERIC 2
+
+/* Header for user event message sent from the UI to the Core.
+ * Every user event sent by the UI begins with this header, immediately followed
+ * by the event parameters (if there are any).
+ */
+typedef struct UserEventHeader {
+ /* Event type. See AUSER_EVENT_XXX for possible values. */
+ uint8_t event_type;
+} UserEventHeader;
+
+/* Formats mouse event message (AUSER_EVENT_MOUSE) */
+typedef struct UserEventMouse {
+ int dx;
+ int dy;
+ int dz;
+ unsigned buttons_state;
+} UserEventMouse;
+
+/* Formats keycode event message (AUSER_EVENT_KEYCODE) */
+typedef struct UserEventKeycode {
+ int keycode;
+} UserEventKeycode;
+
+/* Formats generic event message (AUSER_EVENT_GENERIC) */
+typedef struct UserEventGeneric {
+ int type;
+ int code;
+ int value;
+} UserEventGeneric;
+
+#endif /* _ANDROID_PROTOCOL_USER_EVENTS_H */