# 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)
+%bcond_with x
+%bcond_with wayland
+
Name: app-svc
Summary: Application Service
Version: 0.1.53
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)
%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
#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>
ail_appinfo_h handle;
char *submode_mainid = NULL;
+#ifndef WAYLAND
for (iter = *pkg_list; iter != NULL; ) {
find_item = NULL;
submode_mainid = NULL;
iter = g_slist_next(iter);
}
}
+#endif
for (iter = *pkg_list; iter != NULL; iter = g_slist_next(iter)) {
appid = (char *)iter->data;
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;
cb_info->cb_func(cb_info->data);
ecore_main_loop_quit();
}
-
+#endif
return ECORE_CALLBACK_RENEW;
}
return 0;
}
+#ifndef WAYLAND
SLPAPI int appsvc_allow_transient_app(bundle *b, Ecore_X_Window id)
{
char win_id[MAX_LOCAL_BUFSZ];
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;
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)
{