diff options
author | David 'Digit' Turner <digit@android.com> | 2011-02-02 17:36:34 +0100 |
---|---|---|
committer | David 'Digit' Turner <digit@android.com> | 2011-02-02 21:11:55 +0100 |
commit | 07db34976ba1dd045a51c4ab2c7f52479cddcc57 (patch) | |
tree | b669e7b99c01bd8aafd2079321c8cb80302454e0 /android | |
parent | 7a5ee57895822a769f48ab40e590711a2459e2d1 (diff) | |
download | external_qemu-07db34976ba1dd045a51c4ab2c7f52479cddcc57.zip external_qemu-07db34976ba1dd045a51c4ab2c7f52479cddcc57.tar.gz external_qemu-07db34976ba1dd045a51c4ab2c7f52479cddcc57.tar.bz2 |
Simplify UI-only sources.
Get rid of console-ui.c, qemu-timer-ui.c and modify vl-android-ui.c
to use a generic Looper object instead of a crummy event loop.
We still need to implement qemu_set_fd_handler for two sources under
android/protocol/ but this will be cleaned up later.
Change-Id: Icd0762675ca2f54e720a9cec40f96caea500b52f
Diffstat (limited to 'android')
-rw-r--r-- | android/framebuffer.c | 9 | ||||
-rw-r--r-- | android/framebuffer.h | 9 | ||||
-rw-r--r-- | android/looper-generic.c | 2 | ||||
-rw-r--r-- | android/main-common.c | 2 | ||||
-rw-r--r-- | android/main-ui.c | 11 | ||||
-rw-r--r-- | android/protocol/ui-commands-impl.c | 4 | ||||
-rw-r--r-- | android/qemulator.c | 6 |
7 files changed, 27 insertions, 16 deletions
diff --git a/android/framebuffer.c b/android/framebuffer.c index 53c6a48..b9b968e 100644 --- a/android/framebuffer.c +++ b/android/framebuffer.c @@ -281,6 +281,15 @@ qframebuffer_check_updates( void ) } void +qframebuffer_pulse( void ) +{ + int nn; + for (nn = 0; nn < framebuffer_fifo_count; nn++) { + qframebuffer_poll(framebuffer_fifo[nn]); + } +} + +void qframebuffer_invalidate_all( void ) { int nn; diff --git a/android/framebuffer.h b/android/framebuffer.h index 9d1f626..faf2f41 100644 --- a/android/framebuffer.h +++ b/android/framebuffer.h @@ -172,6 +172,10 @@ qframebuffer_update( QFrameBuffer* qfbuff, int x, int y, int w, int h ); extern void qframebuffer_rotate( QFrameBuffer* qfbuff, int rotation ); +/* this function is used to poll a framebuffer's client for input + * events. Should be called either explicitely, or through qframebuffer_pulse() + * periodically. + */ extern void qframebuffer_poll( QFrameBuffer* qfbuff ); @@ -188,6 +192,11 @@ qframebuffer_done( QFrameBuffer* qfbuff ); extern void qframebuffer_check_updates( void ); +/* call this function periodically to force a poll on all franebuffers + */ +extern void +qframebuffer_pulse( void ); + /* this is called by the emulator. for each registered framebuffer, call * its producer's Invalidate method, if any */ diff --git a/android/looper-generic.c b/android/looper-generic.c index 6ec0db4..d75fbff 100644 --- a/android/looper-generic.c +++ b/android/looper-generic.c @@ -289,7 +289,7 @@ glooper_addActiveTimer(GLooper* looper, GLoopTimer* tt) pnode = &node->activeNext; } tt->activeNext = *pnode; - *pnode = tt->activeNext; + *pnode = tt; } static void diff --git a/android/main-common.c b/android/main-common.c index 23ba5b9..bcae501 100644 --- a/android/main-common.c +++ b/android/main-common.c @@ -315,7 +315,9 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame) } snprintf(buf, sizeof buf, "width=%d,height=%d", width, height); +#if !defined(CONFIG_STANDALONE_UI) && !defined(CONFIG_STANDALONE_CORE) android_display_init(ds, qframebuffer_fifo_get()); +#endif } /* list of skin aliases */ diff --git a/android/main-ui.c b/android/main-ui.c index 9981b76..daf71cb 100644 --- a/android/main-ui.c +++ b/android/main-ui.c @@ -1507,16 +1507,5 @@ int main(int argc, char **argv) } } - // Connect to the core's framebuffer service - if (implFb_create(attachUiImpl_get_console_socket(), "-raw", - qemulator_get_first_framebuffer(qemulator_get()))) { - return -1; - } - - // Attach the recepient of UI commands. - if (uiCmdImpl_create(attachUiImpl_get_console_socket())) { - return -1; - } - return qemu_main(n, args); } diff --git a/android/protocol/ui-commands-impl.c b/android/protocol/ui-commands-impl.c index f265514..2ca4194 100644 --- a/android/protocol/ui-commands-impl.c +++ b/android/protocol/ui-commands-impl.c @@ -124,7 +124,7 @@ _uiCmdImpl_io_read(void* opaque) status = read(uicmd->sock, uicmd->reader_buffer + uicmd->reader_offset, uicmd->reader_bytes - uicmd->reader_offset); if (status == 0) { - /* Disconnection, meaning that the core process got termonated. */ + /* Disconnection, meaning that the core process got terminated. */ fprintf(stderr, "core-ui-control service got disconnected\n"); uiCmdImpl_destroy(); return; @@ -201,7 +201,7 @@ uiCmdImpl_create(SockAddress* console_socket) return -1; } - // Initialze UI command reader. + // Initialize UI command reader. _uiCmdImpl.sock = core_connection_get_socket(_uiCmdImpl.core_connection); if (qemu_set_fd_handler(_uiCmdImpl.sock, _uiCmdImpl_io_read, NULL, &_uiCmdImpl)) { diff --git a/android/qemulator.c b/android/qemulator.c index 36a9ec8..c90a674 100644 --- a/android/qemulator.c +++ b/android/qemulator.c @@ -97,8 +97,10 @@ qemulator_fb_update( void* _emulator, int x, int y, int w, int h ) { QEmulator* emulator = _emulator; - if (emulator->window) - skin_window_update_display( emulator->window, x, y, w, h ); + if (!emulator->window) { + qemulator_setup( emulator ); + } + skin_window_update_display( emulator->window, x, y, w, h ); } static void |