From 34f2974ce7ec7c71beb47b5daf9089d5c8c40c79 Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Tue, 25 May 2010 18:16:10 -0700 Subject: 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 --- user-events.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 user-events.h (limited to 'user-events.h') 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 */ -- cgit v1.1