summaryrefslogtreecommitdiff
path: root/tizen/src/emul_state.c
diff options
context:
space:
mode:
authorSeokYeon Hwang <syeon.hwang@samsung.com>2015-08-11 16:30:22 +0900
committerSeokYeon Hwang <syeon.hwang@samsung.com>2015-08-11 16:31:13 +0900
commite4ad1ff20d33d8d1fed8393873e6e7e11ba059bb (patch)
tree023232eb5f4349019c700e4ab3880f8f0eeb2437 /tizen/src/emul_state.c
parent7e8d41619b251177196f62a6c44ecdce047aaadc (diff)
parent933aac74b478bd50b5516c2f018669fb72c0f675 (diff)
downloadqemu-e4ad1ff20d33d8d1fed8393873e6e7e11ba059bb.tar.gz
qemu-e4ad1ff20d33d8d1fed8393873e6e7e11ba059bb.tar.bz2
qemu-e4ad1ff20d33d8d1fed8393873e6e7e11ba059bb.zip
Merge branch 'tizen_2.4_develop' into tizen_3.0_develop
Change-Id: Ibe175099ae8f1db0d5b48bb61e13efc72340282a Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
Diffstat (limited to 'tizen/src/emul_state.c')
-rw-r--r--tizen/src/emul_state.c92
1 files changed, 71 insertions, 21 deletions
diff --git a/tizen/src/emul_state.c b/tizen/src/emul_state.c
index af5e593037..7dfc2a8da6 100644
--- a/tizen/src/emul_state.c
+++ b/tizen/src/emul_state.c
@@ -44,6 +44,7 @@ extern bool hax_allowed;
extern bool hax_allowed;
#endif
+#include "ui/console.h"
#include "sysemu/sysemu.h"
#include "block/block_int.h"
#include "sysemu/block-backend.h"
@@ -51,11 +52,14 @@ extern bool hax_allowed;
#include "qmp-commands.h"
#include "emulator_options.h"
-#include "skin/maruskin_server.h"
#include "hw/virtio/maru_virtio_touchscreen.h"
#include "hw/virtio/maru_virtio_evdi.h"
#include "util/new_debug_ch.h"
+#ifdef CONFIG_JAVA_UI
+#include "skin/maruskin_server.h"
+#endif
+
DECLARE_DEBUG_CHANNEL(emul_state);
static EmulatorConfigInfo _emul_info = {0,};
@@ -95,26 +99,6 @@ const char *get_log_path(void)
return log_path;
}
-/* display screen resolution */
-void set_emul_resolution(int width, int height)
-{
- _emul_info.resolution_w = width;
- _emul_info.resolution_h = height;
-
- LOG_INFO("emulator graphic resolution : %dx%d\n",
- _emul_info.resolution_w, _emul_info.resolution_h);
-}
-
-int get_emul_resolution_width(void)
-{
- return _emul_info.resolution_w;
-}
-
-int get_emul_resolution_height(void)
-{
- return _emul_info.resolution_h;
-}
-
/* sdl bits per pixel */
void set_emul_sdl_bpp(int bpp)
{
@@ -649,6 +633,72 @@ const char* get_vm_data_path(void)
return vm_data_path;
}
+// display resolution
+int initial_resolution_width = -1;
+int initial_resolution_height = -1;
+
+#ifdef CONFIG_JAVA_UI
+static void set_resolution_legacy(void)
+{
+ char *resolution = get_variable("resolution");
+ if (!resolution) {
+ error_report("variable [resolution] is required.");
+ exit(1);
+ }
+ char **splitted = g_strsplit(resolution, "x", 2);
+ if (!splitted[0] || !splitted[1]) {
+ error_report("resolution value [%s] is weird. Please use format \"WIDTHxHEIGHT\"", resolution);
+ g_strfreev(splitted);
+ exit(1);
+ }
+ else {
+ set_initial_display_resolution(g_ascii_strtoull(splitted[0], NULL, 0),
+ g_ascii_strtoull(splitted[1], NULL, 0));
+ }
+ g_strfreev(splitted);
+ }
+#endif
+
+void set_initial_display_resolution(int width, int height)
+{
+ initial_resolution_width = width;
+ initial_resolution_height = height;
+}
+
+int get_display_resolution_width(void)
+{
+#ifndef CONFIG_JAVA_UI
+ return qemu_console_get_width(NULL, -1);
+#else
+ if (display_type == DT_MARU_QT_ONSCREEN ||
+ display_type == DT_MARU_QT_OFFSCREEN) {
+ return qemu_console_get_width(NULL, -1);
+ }
+ if (initial_resolution_width == -1) {
+ set_resolution_legacy();
+ }
+ // for JAVA_UI
+ return initial_resolution_width;
+#endif
+}
+
+int get_display_resolution_height(void)
+{
+#ifndef CONFIG_JAVA_UI
+ return qemu_console_get_height(NULL, -1);
+#else
+ if (display_type == DT_MARU_QT_ONSCREEN ||
+ display_type == DT_MARU_QT_OFFSCREEN) {
+ return qemu_console_get_height(NULL, -1);
+ }
+ if (initial_resolution_height == -1) {
+ set_resolution_legacy();
+ }
+ // for JAVA_UI
+ return initial_resolution_height;
+#endif
+}
+
#ifdef CONFIG_JAVA_UI
/* skin enabled */
static bool skin_enabled = true;