aboutsummaryrefslogtreecommitdiffstats
path: root/android
diff options
context:
space:
mode:
authorVladimir Chtchetkine <vchtchetkine@google.com>2010-06-28 10:47:18 -0700
committerVladimir Chtchetkine <vchtchetkine@google.com>2010-06-29 08:58:03 -0700
commita21ac6912568a1d36a2919669f905bc58be21244 (patch)
treeea7c050ab63933e9d9eae2c989a164da81cb010a /android
parent83f82216024e9b5623d9f2b3b90e9c2e954412e9 (diff)
downloadexternal_qemu-a21ac6912568a1d36a2919669f905bc58be21244.zip
external_qemu-a21ac6912568a1d36a2919669f905bc58be21244.tar.gz
external_qemu-a21ac6912568a1d36a2919669f905bc58be21244.tar.bz2
Add ui_core_protocol.* to simulate UI->Core exchange.
Change-Id: I969bb097fcd9be55d83368ddee0e377a0f0af896
Diffstat (limited to 'android')
-rw-r--r--android/qemulator.c3
-rw-r--r--android/ui_core_protocol.c29
-rw-r--r--android/ui_core_protocol.h27
3 files changed, 58 insertions, 1 deletions
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