1/* Copyright (C) 2010 The Android Open Source Project
2**
3** This software is licensed under the terms of the GNU General Public
4** License version 2, as published by the Free Software Foundation, and
5** may be copied, distributed, and modified under those terms.
6**
7** This program is distributed in the hope that it will be useful,
8** but WITHOUT ANY WARRANTY; without even the implied warranty of
9** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10** GNU General Public License for more details.
11*/
12
13#ifndef _ANDROID_PROTOCOL_USER_EVENTS_H
14#define _ANDROID_PROTOCOL_USER_EVENTS_H
15
16/*
17 * Contains declarations related to the UI events handled by the Core.
18 */
19
20#include "android/globals.h"
21
22/* Mouse event. */
23#define AUSER_EVENT_MOUSE     0
24/* Keycode event. */
25#define AUSER_EVENT_KEYCODE   1
26/* Generic event. */
27#define AUSER_EVENT_GENERIC   2
28
29/* Header for user event message sent from the UI to the Core.
30 * Every user event sent by the UI begins with this header, immediately followed
31 * by the event parameters (if there are any).
32 */
33typedef struct UserEventHeader {
34    /* Event type. See AUSER_EVENT_XXX for possible values. */
35    uint8_t event_type;
36} UserEventHeader;
37
38/* Formats mouse event message (AUSER_EVENT_MOUSE) */
39typedef struct UserEventMouse {
40    int         dx;
41    int         dy;
42    int         dz;
43    unsigned    buttons_state;
44} UserEventMouse;
45
46/* Formats keycode event message (AUSER_EVENT_KEYCODE) */
47typedef struct UserEventKeycode {
48    int         keycode;
49} UserEventKeycode;
50
51/* Formats generic event message (AUSER_EVENT_GENERIC) */
52typedef struct UserEventGeneric {
53    int         type;
54    int         code;
55    int         value;
56} UserEventGeneric;
57
58#endif /* _ANDROID_PROTOCOL_USER_EVENTS_H */
59