If Menu-screen is working on the Emulator, it'll be launched with the software backend.
authorJin Yoon <jinny.yoon@samsung.com>
Thu, 14 Mar 2013 11:05:22 +0000 (20:05 +0900)
committerJin Yoon <jinny.yoon@samsung.com>
Thu, 14 Mar 2013 11:05:22 +0000 (20:05 +0900)
CMakeLists.txt
debian/control
packaging/org.tizen.menu-screen.spec
src/menu_screen.c

index cb4b565..844d971 100644 (file)
@@ -19,6 +19,7 @@ pkg_check_modules(MENU_PKGS REQUIRED
        badge
        bundle
        capi-appfw-application
+       capi-system-info
        dlog
        ecore
        ecore-evas
index 4f38e1f..deb339f 100644 (file)
@@ -2,14 +2,14 @@ Source: menu-screen
 Section: utils
 Priority: extra
 Maintainer: Jin Yoon <jinny.yoon@samsung.com>
-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
index 8415cd9..b54c6f8 100644 (file)
@@ -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)
index 8f4f5b4..411768d 100644 (file)
 
 
 
-#include <Elementary.h>
-#include <Ecore_X.h>
 #include <ail.h>
 #include <app.h>
+#include <aul.h>
+#include <Ecore_X.h>
+#include <Elementary.h>
 #include <stdbool.h>
-#include <vconf.h>
+#include <system_info.h>
 #include <utilX.h>
-#include <aul.h>
+#include <vconf.h>
 
 #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);