summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi,Limin <liminx.li@intel.com>2013-12-19 10:27:31 +0800
committerLi,Limin <liminx.li@intel.com>2013-12-20 16:09:12 +0800
commit00e564c99da29bdacb3fca608b6dc25532d4b405 (patch)
treefe61be87fc4e9a17678d1b9afab86a133053210e
parent4e6301db9eb0d2abecbfa1899423813e12ebfcbb (diff)
downloadapp-svc-accepted/tizen/ivi/stable.tar.gz
app-svc-accepted/tizen/ivi/stable.tar.bz2
app-svc-accepted/tizen/ivi/stable.zip
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
-rw-r--r--[-rwxr-xr-x]CMakeLists.txt15
-rw-r--r--packaging/app-svc.spec15
-rw-r--r--[-rwxr-xr-x]src/appsvc.c27
3 files changed, 52 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b531550..f6326fa 100755..100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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)
diff --git a/packaging/app-svc.spec b/packaging/app-svc.spec
index e6b930e..57bb777 100644
--- a/packaging/app-svc.spec
+++ b/packaging/app-svc.spec
@@ -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
diff --git a/src/appsvc.c b/src/appsvc.c
index a94ff2d..603b3ab 100755..100644
--- a/src/appsvc.c
+++ b/src/appsvc.c
@@ -28,7 +28,11 @@
#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)
{