aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Chtchetkine <vchtchetkine@google.com>2010-07-16 11:19:48 -0700
committerVladimir Chtchetkine <vchtchetkine@google.com>2010-07-16 11:25:16 -0700
commit2fa5173bd1ce7341c50adac676a317945f0969c7 (patch)
tree560d67a9e25138e8139888c3ed81fb77771ce5ea
parenteb8382507c6b802f378cf940fae4775633c1d84e (diff)
downloadqemu-gingerbread-release.tar.gz
Also cleaned up dependency on android_base_port variable Change-Id: I8c1675a859e3d24e9bb174471dd03556c696aff1
-rw-r--r--Makefile.android6
-rw-r--r--android/console.c5
-rw-r--r--android/core-ui-protocol.c31
-rw-r--r--android/core-ui-protocol.h27
-rw-r--r--android/main.c2
-rw-r--r--android/qemu-setup.c3
-rw-r--r--android/qemulator.c2
-rw-r--r--android/ui-core-protocol.c7
-rw-r--r--android/ui-core-protocol.h3
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