diff options
author | David 'Digit' Turner <digit@android.com> | 2010-10-08 16:22:10 +0200 |
---|---|---|
committer | David 'Digit' Turner <digit@android.com> | 2010-10-08 16:49:41 +0200 |
commit | f59442f0e576abe1f1357135024d44e8bf66a36a (patch) | |
tree | 5fc1a850167e0f330ee94e0937688a134b975cd6 /user-events-ui.c | |
parent | 7746af04f1c7a44253ce49cf7cf1914757faaafe (diff) | |
download | external_qemu-f59442f0e576abe1f1357135024d44e8bf66a36a.zip external_qemu-f59442f0e576abe1f1357135024d44e8bf66a36a.tar.gz external_qemu-f59442f0e576abe1f1357135024d44e8bf66a36a.tar.bz2 |
Build standalone UI program (emulator-ui).
This changes introduces a new program, called emulator-ui
that only contains parts necessary to display the UI (and
removes anything related to CPU emulation).
This is only a skeleton right now, since it is not capable
of launching a core, or displaying anything meaningful,
except the skin, trackball, respond to commands (e.g.
change layouts with KP-7 and KP-9).
Later changes will introduce core launching, communication,
etc...
Change-Id: Icef9deb8a3a256532655e1cd409b4aab52565d03
Diffstat (limited to 'user-events-ui.c')
-rw-r--r-- | user-events-ui.c | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/user-events-ui.c b/user-events-ui.c new file mode 100644 index 0000000..f295ade --- /dev/null +++ b/user-events-ui.c @@ -0,0 +1,74 @@ +/* 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. +*/ +#include "user-events.h" +#include "android/utils/debug.h" +#include "console.h" +#include <stdio.h> + +void +user_event_keycodes(int *kcodes, int count) +{ + int nn; + for (nn = 0; nn < count; nn++) + user_event_keycode(kcodes[nn]); +} + +void +user_event_keycode(int kcode) +{ +#if 0 /* TODO */ + kbd_put_keycode(kcode); +#endif +} + +void +user_event_key(unsigned code, unsigned down) +{ + if(code == 0) { + return; + } + if (VERBOSE_CHECK(keys)) + printf(">> KEY [0x%03x,%s]\n", (code & 0x1ff), down ? "down" : " up " ); + + user_event_keycode((code & 0x1ff) | (down ? 0x200 : 0)); +} + + +void +user_event_mouse(int dx, int dy, int dz, unsigned buttons_state) +{ +#if 0 /* TODO */ + kbd_mouse_event(dx, dy, dz, buttons_state); +#endif +} + +#if 0 +static QEMUPutGenericEvent *generic_event_callback; +static void* generic_event_opaque; +#endif + +void user_event_register_generic(void* opaque, QEMUPutGenericEvent *callback) +{ +#if 0 /* TODO */ + generic_event_callback = callback; + generic_event_opaque = opaque; +#endif +} + +void +user_event_generic(int type, int code, int value) +{ +#if 0 /* TODO */ + if (generic_event_callback) + generic_event_callback(generic_event_opaque, type, code, value); +#endif +} |