From fe85360a2470543425d75556616d4cc60b155365 Mon Sep 17 00:00:00 2001 From: Jin Yoon Date: Thu, 14 Mar 2013 20:05:22 +0900 Subject: [PATCH] If Menu-screen is working on the Emulator, it'll be launched with the software backend. --- CMakeLists.txt | 1 + debian/control | 4 ++-- packaging/org.tizen.menu-screen.spec | 1 + src/menu_screen.c | 44 +++++++++++++++++++++++++++--------- 4 files changed, 37 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cb4b565..844d971 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,7 @@ pkg_check_modules(MENU_PKGS REQUIRED badge bundle capi-appfw-application + capi-system-info dlog ecore ecore-evas diff --git a/debian/control b/debian/control index 4f38e1f..deb339f 100644 --- a/debian/control +++ b/debian/control @@ -2,14 +2,14 @@ Source: menu-screen Section: utils Priority: extra Maintainer: Jin Yoon -Build-Depends: debhelper (>= 5), libelm-dev, libslp-utilx-dev, libslp-setting-dev, libefreet-dev, libslp-sysman-dev, libslp-pm-dev, dlog-dev, libecore-dev, libaul-1-dev, libpkgmgr-client-dev, syspopup-caller-dev, libheynoti-dev, libail-0-dev, librua-dev, libslp-shortcut-dev, menu-daemon, capi-appfw-application-dev, libbadge-dev, pkgmgr-info-dev +Build-Depends: debhelper (>= 5), libelm-dev, libslp-utilx-dev, libslp-setting-dev, libefreet-dev, libslp-sysman-dev, libslp-pm-dev, dlog-dev, libecore-dev, libaul-1-dev, libpkgmgr-client-dev, syspopup-caller-dev, libheynoti-dev, libail-0-dev, librua-dev, libslp-shortcut-dev, menu-daemon, capi-appfw-application-dev, libbadge-dev, pkgmgr-info-dev, capi-system-info-dev Homepage: N/A Standards-Version: 0.1.0 Package: org.tizen.menu-screen Section: utils Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, libelm, libeina, libslp-utilx-0, libslp-setting-0, libefreet, libslp-sysman, libslp-pm-0, libdlog-0, libaul-1, libpkgmgr-client-0, syspopup-caller-0, libheynoti-0, libail-0, menu-daemon, capi-appfw-application, libbadge, pkgmgr-info +Depends: ${shlibs:Depends}, ${misc:Depends}, libelm, libeina, libslp-utilx-0, libslp-setting-0, libefreet, libslp-sysman, libslp-pm-0, libdlog-0, libaul-1, libpkgmgr-client-0, syspopup-caller-0, libheynoti-0, libail-0, menu-daemon, capi-appfw-application, libbadge, pkgmgr-info, capi-system-info Description: inhouse menu-screen Package: org.tizen.menu-screen-dbg diff --git a/packaging/org.tizen.menu-screen.spec b/packaging/org.tizen.menu-screen.spec index 8415cd9..b54c6f8 100644 --- a/packaging/org.tizen.menu-screen.spec +++ b/packaging/org.tizen.menu-screen.spec @@ -25,6 +25,7 @@ BuildRequires: pkgconfig(aul) BuildRequires: pkgconfig(badge) BuildRequires: pkgconfig(bundle) BuildRequires: pkgconfig(capi-appfw-application) +BuildRequires: pkgconfig(capi-system-info) BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(ecore) BuildRequires: pkgconfig(ecore-evas) diff --git a/src/menu_screen.c b/src/menu_screen.c index 8f4f5b4..411768d 100644 --- a/src/menu_screen.c +++ b/src/menu_screen.c @@ -16,14 +16,15 @@ -#include -#include #include #include +#include +#include +#include #include -#include +#include #include -#include +#include #include "conf.h" #include "item.h" @@ -523,19 +524,40 @@ static void _fini(void) +#define QP_EMUL_STR "Emulator" +static bool _is_emulator_on(void) +{ + char *info; + + if (system_info_get_value_string(SYSTEM_INFO_KEY_MODEL, &info) == 0) { + if (info == NULL) return false; + if (!strncmp(QP_EMUL_STR, info, strlen(info))) { + return true; + } + } + + return false; +} + + + int main(int argc, char *argv[]) { char *buf; app_event_callback_s event_callback; - buf = vconf_get_str(MENU_SCREEN_ENGINE); - if (buf) { - _D("ELM_ENGINE is set as [%s]\n", buf); - setenv("ELM_ENGINE", buf, 1); - free(buf); + if (_is_emulator_on()) { + _D("ELM_ENGINE is set as [software_x11]"); } else { - _D("ELM_ENGINE is set as [%s]", "gl"); - setenv("ELM_ENGINE", "gl", 1); + buf = vconf_get_str(MENU_SCREEN_ENGINE); + if (buf) { + _D("ELM_ENGINE is set as [%s]", buf); + setenv("ELM_ENGINE", buf, 1); + free(buf); + } else { + _D("ELM_ENGINE is set as [gl]"); + setenv("ELM_ENGINE", "gl", 1); + } } _init(&event_callback); -- 2.7.4