aboutsummaryrefslogtreecommitdiffstats
path: root/android
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 /android
parenteb8382507c6b802f378cf940fae4775633c1d84e (diff)
downloadexternal_qemu-2fa5173bd1ce7341c50adac676a317945f0969c7.zip
external_qemu-2fa5173bd1ce7341c50adac676a317945f0969c7.tar.gz
external_qemu-2fa5173bd1ce7341c50adac676a317945f0969c7.tar.bz2
Moved dependency on android_ui_set_window_scale to ui-core-protocol.h
Also cleaned up dependency on android_base_port variable Change-Id: I8c1675a859e3d24e9bb174471dd03556c696aff1
Diffstat (limited to 'android')
-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
8 files changed, 73 insertions, 7 deletions
diff --git a/android/console.c b/android/console.c
index 8dc8c98..a7b55e9 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 0000000..a10812d
--- /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 0000000..5fc2372
--- /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 08e2966..04d715c 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 4a57b42..0b6b564 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 06b07f7..7d2d2e8 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 e61cd86..c62f09e 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 e454b14..7b12f24 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