diff options
author | David 'Digit' Turner <digit@android.com> | 2010-05-25 18:16:10 -0700 |
---|---|---|
committer | David 'Digit' Turner <digit@android.com> | 2010-05-25 18:45:33 -0700 |
commit | 34f2974ce7ec7c71beb47b5daf9089d5c8c40c79 (patch) | |
tree | 0a8291f99ace9a1c770ddd701c08dc581609825d /user-events.h | |
parent | 3bca7734dc4b3a9e1e24964183d9765780dee4ea (diff) | |
download | external_qemu-34f2974ce7ec7c71beb47b5daf9089d5c8c40c79.zip external_qemu-34f2974ce7ec7c71beb47b5daf9089d5c8c40c79.tar.gz external_qemu-34f2974ce7ec7c71beb47b5daf9089d5c8c40c79.tar.bz2 |
Add small user-event abstraction interface.
Preparation for future UI frontend/backend separation.
This is done to ensure that the code under android/skin/ does not depend
on any QEMU-specific header. We achieve this by adding a new abstract header
"user-events.h" and one QEMU-specific implementations for the functions
defined here.
This also modifies console.h and vl-android.c to make them closer to
upstream (by removing Android-specific changes).
+ fix Makefile.android to always build SDL from sources in standalone mode.
Change-Id: I0d152741e7bb2c9cd283f5c35bd054385c7c1eb3
Diffstat (limited to 'user-events.h')
-rw-r--r-- | user-events.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/user-events.h b/user-events.h new file mode 100644 index 0000000..608134a --- /dev/null +++ b/user-events.h @@ -0,0 +1,33 @@ +/* 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 _QEMU_USEREVENTS_H +#define _QEMU_USEREVENTS_H + +/* A simple abstract interface to user-events. This is used to de-couple + * QEMU-specific and UI-specific code. + * + * QEMU-specific implementation in user-events-qemu.c + */ + +void user_event_key(unsigned key, unsigned down); +void user_event_keycode(int kcode); +void user_event_keycodes(int *kcodes, int count); +void user_event_mouse(int dx, int dy, int dz, unsigned buttons_state); +void user_event_generic(int type, int code, int value); + +/* The following is used to register a callback function that will receive + * user_event_generic() calls. This is used by hw/goldfish_events_device.c + */ +typedef void QEMUPutGenericEvent(void* opaque, int type, int code, int value); +void user_event_register_generic(void* opaque, QEMUPutGenericEvent callback); + +#endif /* _QEMU_USEREVENTS_H */ |