diff options
author | Vladimir Chtchetkine <vchtchetkine@google.com> | 2010-07-16 11:19:48 -0700 |
---|---|---|
committer | Vladimir Chtchetkine <vchtchetkine@google.com> | 2010-07-16 11:25:16 -0700 |
commit | 2fa5173bd1ce7341c50adac676a317945f0969c7 (patch) | |
tree | 560d67a9e25138e8139888c3ed81fb77771ce5ea | |
parent | eb8382507c6b802f378cf940fae4775633c1d84e (diff) | |
download | qemu-gingerbread-release.tar.gz |
Moved dependency on android_ui_set_window_scale to ui-core-protocol.handroid-sdk-tools_r7android-sdk-2.3.4_r1android-cts-2.3_r5android-cts-2.3_r4android-cts-2.3_r3android-cts-2.3_r2android-cts-2.3_r12android-cts-2.3_r11android-cts-2.3_r10android-cts-2.3_r1android-adt-0.9.9android-adt-0.9.8android-2.3_r1android-2.3.7_r1android-2.3.6_r1android-2.3.6_r0.9android-2.3.5_r1android-2.3.4_r1android-2.3.4_r0.9android-2.3.3_r1aandroid-2.3.3_r1.1android-2.3.3_r1android-2.3.2_r1android-2.3.1_r1tools_r7gingerbread-releasegingerbread-mr4-release
Also cleaned up dependency on android_base_port variable
Change-Id: I8c1675a859e3d24e9bb174471dd03556c696aff1
-rw-r--r-- | Makefile.android | 6 | ||||
-rw-r--r-- | android/console.c | 5 | ||||
-rw-r--r-- | android/core-ui-protocol.c | 31 | ||||
-rw-r--r-- | android/core-ui-protocol.h | 27 | ||||
-rw-r--r-- | android/main.c | 2 | ||||
-rw-r--r-- | android/qemu-setup.c | 3 | ||||
-rw-r--r-- | android/qemulator.c | 2 | ||||
-rw-r--r-- | android/ui-core-protocol.c | 7 | ||||
-rw-r--r-- | android/ui-core-protocol.h | 3 |
9 files changed, 77 insertions, 9 deletions
diff --git a/Makefile.android b/Makefile.android index 533fc2b062..2eb39c4bfa 100644 --- a/Makefile.android +++ b/Makefile.android @@ -681,8 +681,6 @@ CORE_UPSTREAM_SOURCES = json-lexer.c \ CORE_SOURCES = $(CORE_BLOCK_SOURCES) $(CORE_HW_SOURCES) CORE_SOURCES += $(CORE_MIGRATION_SOURCES) $(CORE_MISC_SOURCES) CORE_SOURCES += $(CORE_UPSTREAM_SOURCES) -# temp file used to collect UI->Core exchange protocol. -CORE_SOURCES += android/ui-core-protocol.c ############################################################################## # lists of source files used to build the emulator UI @@ -719,11 +717,15 @@ UI_AND_CORE_SOURCES = osdep.c \ android/utils/timezone.c \ android/utils/mapfile.c \ +# temp files used to collect UI->Core exchange protocol. +UI_AND_CORE_SOURCES += android/ui-core-protocol.c android/core-ui-protocol.c + ############################################################################## # now build the emulator itself # include $(CLEAR_VARS) +LOCAL_GENERATED_SOURCES := LOCAL_NO_DEFAULT_COMPILER_FLAGS := true LOCAL_CC := $(MY_CC) LOCAL_MODULE := emulator diff --git a/android/console.c b/android/console.c index 8dc8c98a0c..a7b55e983a 100644 --- a/android/console.c +++ b/android/console.c @@ -49,6 +49,7 @@ #include "user-events.h" #include "android/keycode-array.h" #include "android/charmap.h" +#include "android/core-ui-protocol.h" #if defined(CONFIG_SLIRP) #include "libslirp.h" @@ -2078,8 +2079,6 @@ static const CommandDefRec geo_commands[] = /********************************************************************************************/ /********************************************************************************************/ -extern void android_emulator_set_window_scale( double, int ); - static int do_window_scale( ControlClient client, char* args ) { @@ -2104,7 +2103,7 @@ do_window_scale( ControlClient client, char* args ) } } - android_emulator_set_window_scale( scale, is_dpi ); + android_ui_set_window_scale( scale, is_dpi ); return 0; } diff --git a/android/core-ui-protocol.c b/android/core-ui-protocol.c new file mode 100644 index 0000000000..a10812da21 --- /dev/null +++ b/android/core-ui-protocol.c @@ -0,0 +1,31 @@ +/* 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. +*/ + +/* + * This file contains helper routines that are used to establish communication + * between Core and UI components of the emulator. This is a temporary file + * where we will collect functional dependencies between Core and UI in the + * process of separating UI and Core in the emulator build. + */ + +#include "android/globals.h" +#include "android/core-ui-protocol.h" + +extern void android_emulator_set_window_scale( double, int ); + +void +android_ui_set_window_scale(double scale, int is_dpi) +{ +#if !defined(CONFIG_STANDALONE_CORE) + android_emulator_set_window_scale(scale, is_dpi); +#endif +} diff --git a/android/core-ui-protocol.h b/android/core-ui-protocol.h new file mode 100644 index 0000000000..5fc2372fa2 --- /dev/null +++ b/android/core-ui-protocol.h @@ -0,0 +1,27 @@ +/* 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. +*/ + +/* + * This file contains declarations of helper routines that are used to + * establish communication between Core and UI components of the emulator. + * This is a temporary file where we will collect functional dependencies + * between Core and UI in the process of separating UI and Core in the + * emulator build. + */ + +#ifndef QEMU_ANDROID_CORE_UI_PROTOCOL_H +#define QEMU_ANDROID_CORE_UI_PROTOCOL_H + +/* Changes the scale of the emulator window at runtime. */ +void android_ui_set_window_scale(double scale, int is_dpi); + +#endif // QEMU_ANDROID_CORE_UI_PROTOCOL_H diff --git a/android/main.c b/android/main.c index 08e296616e..04d715cf45 100644 --- a/android/main.c +++ b/android/main.c @@ -99,8 +99,6 @@ extern int qemu_milli_needed; */ #define DEFAULT_DEVICE_DPI 165 -int android_base_port; - #if 0 static int opts->flashkeys; /* forward */ #endif diff --git a/android/qemu-setup.c b/android/qemu-setup.c index 4a57b428dd..0b6b5645ab 100644 --- a/android/qemu-setup.c +++ b/android/qemu-setup.c @@ -42,7 +42,8 @@ char* android_op_port = NULL; char* android_op_report_console = NULL; /* Contains arguments for -http-proxy option. */ char* op_http_proxy = NULL; - +/* Base port for the emulated system. */ +int android_base_port; /*** APPLICATION DIRECTORY *** Where are we ? diff --git a/android/qemulator.c b/android/qemulator.c index 06b07f7071..7d2d2e8479 100644 --- a/android/qemulator.c +++ b/android/qemulator.c @@ -213,7 +213,7 @@ qemulator_set_title(QEmulator* emulator) } p = bufprint(p, end, "%d:%s", - android_base_port, + android_core_get_base_port(), avdInfo_getName( android_avdInfo )); skin_window_set_title( emulator->window, temp ); diff --git a/android/ui-core-protocol.c b/android/ui-core-protocol.c index e61cd86f4d..c62f09e096 100644 --- a/android/ui-core-protocol.c +++ b/android/ui-core-protocol.c @@ -19,6 +19,7 @@ * means of interprocess communication. */ +#include "android/android.h" #include "android/globals.h" #include "android/hw-control.h" #include "android/ui-core-protocol.h" @@ -38,3 +39,9 @@ android_core_set_brightness_change_callback(AndroidHwLightBrightnessCallback cal funcs.light_brightness = callback; android_hw_control_init( opaque, &funcs ); } + +int +android_core_get_base_port(void) +{ + return android_base_port; +} diff --git a/android/ui-core-protocol.h b/android/ui-core-protocol.h index e454b147a8..7b12f24154 100644 --- a/android/ui-core-protocol.h +++ b/android/ui-core-protocol.h @@ -37,4 +37,7 @@ typedef void (*AndroidHwLightBrightnessCallback)( void* opaque, void android_core_set_brightness_change_callback(AndroidHwLightBrightnessCallback callback, void* opaque); +/* Returns base port assigned for the emulated system. */ +int android_core_get_base_port(void); + #endif // QEMU_ANDROID_UI_CORE_PROTOCOL_H |