aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.android4
-rw-r--r--android/qemulator.c3
-rw-r--r--android/ui_core_protocol.c29
-rw-r--r--android/ui_core_protocol.h27
4 files changed, 61 insertions, 2 deletions
diff --git a/Makefile.android b/Makefile.android
index 1e83e3b..3c0625c 100644
--- a/Makefile.android
+++ b/Makefile.android
@@ -604,6 +604,7 @@ endif
#
CORE_MISC_SOURCES = android/boot-properties.c \
android/hw-kmsg.c \
+ android/hw-lcd.c \
ifeq ($(HOST_ARCH),x86)
CORE_MISC_SOURCES += i386-dis.c
@@ -628,6 +629,8 @@ endif
CORE_SOURCES = $(CORE_BLOCK_SOURCES) $(CORE_HW_SOURCES)
CORE_SOURCES += $(CORE_MIGRATION_SOURCES) $(CORE_MISC_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
@@ -638,7 +641,6 @@ UI_SOURCES = android/user-config.c \
android/charmap.c \
android/qemulator.c \
android/keycode.c \
- android/hw-lcd.c \
##############################################################################
# now build the emulator itself
diff --git a/android/qemulator.c b/android/qemulator.c
index 1671bdd..615f058 100644
--- a/android/qemulator.c
+++ b/android/qemulator.c
@@ -15,6 +15,7 @@
#include "android/utils/bufprint.h"
#include "android/globals.h"
#include "android/qemulator.h"
+#include "android/ui_core_protocol.h"
#define D(...) do { if (VERBOSE_CHECK(init)) dprint(__VA_ARGS__); } while (0)
static double get_default_scale( AndroidOptions* opts );
@@ -230,7 +231,7 @@ qemulator_set_title(QEmulator* emulator)
int
get_device_dpi( AndroidOptions* opts )
{
- int dpi_device = android_hw->hw_lcd_density;
+ int dpi_device = android_core_get_hw_lcd_density();
if (opts->dpi_device != NULL) {
char* end;
diff --git a/android/ui_core_protocol.c b/android/ui_core_protocol.c
new file mode 100644
index 0000000..fec2f14
--- /dev/null
+++ b/android/ui_core_protocol.c
@@ -0,0 +1,29 @@
+/* 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 UI and Core components of the emulator. This is a temporary file
+ * where we will collect functional dependencies between UI and Core in the
+ * process of separating UI and Core in the emulator build. Ideally at the
+ * end this will be replaced with a message protocol over sockets, or other
+ * means of interprocess communication.
+ */
+
+#include "android/globals.h"
+#include "android/ui_core_protocol.h"
+
+int
+android_core_get_hw_lcd_density(void)
+{
+ return android_hw->hw_lcd_density;
+}
diff --git a/android/ui_core_protocol.h b/android/ui_core_protocol.h
new file mode 100644
index 0000000..e8f6489
--- /dev/null
+++ b/android/ui_core_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 UI and Core components of the emulator.
+ * This is a temporary file where we will collect functional dependencies
+ * between UI and Core in the process of separating UI and Core in the
+ * emulator build.
+ */
+
+#ifndef QEMU_ANDROID_UI_CORE_PROTOCOL_H
+#define QEMU_ANDROID_UI_CORE_PROTOCOL_H
+
+/* Gets LCD density property from the core properties. */
+int android_core_get_hw_lcd_density(void);
+
+#endif // QEMU_ANDROID_UI_CORE_PROTOCOL_H