init wayland support 10/13310/11 accepted/tizen/ivi/stable accepted/tizen/generic/20140106.140353 accepted/tizen/generic/20140108.092543 accepted/tizen/ivi/20140106.204055 accepted/tizen/mobile/20140107.213012 submit/tizen/20140106.040829 submit/tizen/20140108.022347 submit/tizen_ivi_release/20140108.030036
authorLi,Limin <liminx.li@intel.com>
Thu, 19 Dec 2013 02:27:31 +0000 (10:27 +0800)
committerLi,Limin <liminx.li@intel.com>
Fri, 20 Dec 2013 08:09:12 +0000 (16:09 +0800)
The display server based on X or Wayland, is now a choice of different profile in Tizen 3.0.
Basically and consistently, two macros were used "with wayland" and "with x".
Below summarize the combination of the macros:

        | wayland |  x  | meaning
        |---------------------------
        |   0     |  1  | pure X11 platform(no wayland)
        |   1     |  0  | pure wayland platform (no X11)
        |   1     |  1  | wayland but X compatibility
        |   0     |  0  | no X and no wayland

This method unifies the meaning and usage. Deploy this method to app-svc package.

Signed-off-by: Li,Limin <liminx.li@intel.com>
Change-Id: Ic8867f2c35a3192088de91e592ddf6e169511607

CMakeLists.txt [changed mode: 0755->0644]
packaging/app-svc.spec
src/appsvc.c [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index b531550..f6326fa
@@ -22,8 +22,19 @@ MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
 # Set required packages
 INCLUDE(FindPkgConfig)
 
-pkg_check_modules(pkgs REQUIRED dlog ecore x11 libprivilege-control aul)
-pkg_check_modules(libpkgs REQUIRED dlog bundle dbus-glib-1 ail xdgmime aul glib-2.0 ecore-x ecore libsoup-2.4 iniparser pkgmgr-info)
+SET(APPSVC_PKGS_CHECK_MODULES "dlog ecore libprivilege-control aul")
+SET(APPSVC_LIBPKGS_CHECK_MODULES "dlog bundle dbus-glib-1 ail xdgmime aul glib-2.0 ecore libsoup-2.4 iniparser pkgmgr-info")
+
+IF (with_x)
+pkg_check_modules(pkgs REQUIRED ${APPSVC_PKGS_CHECK_MODULES} x11)
+pkg_check_modules(libpkgs REQUIRED ${APPSVC_LIBPKGS_CHECK_MODULES} ecore-x)
+ENDIF(with_x)
+
+IF (with_wayland)
+ADD_DEFINITIONS("-DWAYLAND")
+pkg_check_modules(pkgs REQUIRED ${APPSVC_PKGS_CHECK_MODULES})
+pkg_check_modules(libpkgs REQUIRED ${APPSVC_LIBPKGS_CHECK_MODULES})
+ENDIF (with_wayland)
 
 FIND_LIBRARY(LIB_DL dl)
 
index e6b930e..57bb777 100644 (file)
@@ -1,3 +1,6 @@
+%bcond_with x
+%bcond_with wayland
+
 Name:      app-svc
 Summary:    Application Service
 Version: 0.1.53
@@ -13,7 +16,10 @@ BuildRequires: cmake
 BuildRequires: sqlite3
 BuildRequires: pkgconfig(dlog)
 BuildRequires: pkgconfig(ecore) 
+%if %{with x}
 BuildRequires: pkgconfig(x11)
+BuildRequires:  pkgconfig(ecore-x)
+%endif
 BuildRequires: pkgconfig(libprivilege-control)
 BuildRequires: pkgconfig(bundle)
 BuildRequires: pkgconfig(dbus-glib-1)
@@ -40,9 +46,14 @@ Requires:   %{name} = %{version}-%{release}
 %setup -q
 cp %{SOURCE1001} .
 
-
 %build
-%cmake .
+%cmake . \
+%if %{with wayland} && !%{with x}
+-Dwith_wayland=TRUE
+%else
+-Dwith_x=TRUE
+%endif
+
 make %{?jobs:-j%jobs}
 
 %install
old mode 100755 (executable)
new mode 100644 (file)
index a94ff2d..603b3ab
 #include <ail.h>
 #include <aul.h>
 #include <libsoup/soup.h>
+
+#ifndef WAYLAND
 #include <Ecore_X.h>
+#endif
+
 #include <Ecore.h>
 #include <iniparser.h>
 #include <pkgmgr-info.h>
@@ -612,6 +616,7 @@ static int __get_list_with_submode(char *win_id, GSList **pkg_list)
        ail_appinfo_h handle;
        char *submode_mainid = NULL;
 
+#ifndef WAYLAND
        for (iter = *pkg_list; iter != NULL; ) {
                find_item = NULL;
                submode_mainid = NULL;
@@ -649,6 +654,7 @@ static int __get_list_with_submode(char *win_id, GSList **pkg_list)
                        iter = g_slist_next(iter);
                }
        }
+#endif
 
        for (iter = *pkg_list; iter != NULL; iter = g_slist_next(iter)) {
                appid = (char *)iter->data;
@@ -1049,12 +1055,17 @@ SLPAPI int appsvc_data_is_array(bundle *b, const char *key)
 
 typedef struct _appsvc_transient_cb_info_t{
        appsvc_host_res_fn cb_func;
+
+#ifndef WAYLAND
        Ecore_X_Window win_id;
+#endif
+
        void *data;
 }appsvc_transient_cb_info_t;
 
 static Eina_Bool __transient_cb(void *data, int type, void *event)
 {
+#ifndef WAYLAND
        Ecore_X_Event_Window_Hide *ev;
        appsvc_transient_cb_info_t*  cb_info;
 
@@ -1065,7 +1076,7 @@ static Eina_Bool __transient_cb(void *data, int type, void *event)
                cb_info->cb_func(cb_info->data);
                ecore_main_loop_quit();
        }
-
+#endif
        return ECORE_CALLBACK_RENEW;
 }
 
@@ -1081,6 +1092,7 @@ int __aul_subapp_cb(void *data)
        return 0;
 }
 
+#ifndef WAYLAND
 SLPAPI int appsvc_allow_transient_app(bundle *b, Ecore_X_Window id)
 {
        char win_id[MAX_LOCAL_BUFSZ];
@@ -1094,7 +1106,14 @@ SLPAPI int appsvc_allow_transient_app(bundle *b, Ecore_X_Window id)
 
        return __set_bundle(b, APP_SVC_K_WIN_ID, win_id);
 }
+#else
+SLPAPI int appsvc_allow_transient_app(bundle *b, unsigned int id)
+{
+       return 0;
+}
+#endif
 
+#ifndef WAYLAND
 SLPAPI int appsvc_request_transient_app(bundle *b, Ecore_X_Window callee_id, appsvc_host_res_fn cbfunc, void *data)
 {
        char *caller = NULL;
@@ -1125,6 +1144,12 @@ SLPAPI int appsvc_request_transient_app(bundle *b, Ecore_X_Window callee_id, app
 
        return 0;
 }
+#else
+SLPAPI int appsvc_request_transient_app(bundle *b, unsigned int callee_id, appsvc_host_res_fn cbfunc, void *data)
+{
+       return 0;
+}
+#endif
 
 SLPAPI int appsvc_subapp_terminate_request_pid(int pid)
 {