AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} CLIENT_SRCS)
-pkg_check_modules(client_pkgs REQUIRED security-server dlog ecore-x vconf libtzplatform-config neardal
- libssl ecore-x appsvc svi capi-media-wav-player)
+IF(X11_SUPPORT)
+ SET(WIN_PKG "ecore-x")
+ENDIF(X11_SUPPORT)
+IF(WAYLAND_SUPPORT)
+ SET(WIN_PKG "${WIN_PKG} ecore-wayland")
+ENDIF(WAYLAND_SUPPORT)
+INCLUDE(FindPkgConfig)
+pkg_check_modules(client_pkgs REQUIRED security-server dlog vconf libtzplatform-config neardal
+ libssl appsvc svi capi-media-wav-player ${WIN_PKG})
+
+IF(WAYLAND_SUPPORT)
+ ADD_DEFINITIONS("-DHAVE_WAYLAND")
+ENDIF(WAYLAND_SUPPORT)
+
+IF(X11_SUPPORT)
+ ADD_DEFINITIONS("-DHAVE_X11")
+ENDIF(X11_SUPPORT)
FOREACH(flag ${client_pkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
* limitations under the License.
*/
-#include "Ecore_X.h"
+#ifdef USE_X11
+#include <Ecore_X.h>
+#endif
+#ifdef USE_WAYLAND
+#include <Ecore.h>
+#include <Ecore_Wayland.h>
+#endif
#include "net_nfc_typedef_internal.h"
#include "net_nfc_debug_internal.h"
#include <wav_player.h>
#include <appsvc.h>
#include <aul.h>
+
+#ifdef USE_X11
#include <Ecore_X.h>
+#endif
+#ifdef USE_WAYLAND
+#include <Ecore.h>
+#include <Ecore_Wayland.h>
+#endif
#include "net_nfc_typedef.h"
#include "net_nfc_typedef_internal.h"
pid_t net_nfc_app_util_get_focus_app_pid()
{
pid_t pid;
+#ifdef USE_X11
Ecore_X_Window focus;
ecore_x_init(":0");
focus = ecore_x_window_focus_get();
if (ecore_x_netwm_pid_get(focus, &pid))
return pid;
-
+#endif
+#ifdef USE_WAYLAND // TO_DO_WAYLAND
+ NFC_DBG("To implement: Wayland support");
+#endif
return -1;
}
FILE(GLOB DAEMON_SRCS *.c)
+IF(X11_SUPPORT)
+ SET(WIN_PKG "ecore-x")
+ENDIF(X11_SUPPORT)
+IF(WAYLAND_SUPPORT)
+ SET(WIN_PKG "${WIN_PKG} ecore-wayland")
+ENDIF(WAYLAND_SUPPORT)
+INCLUDE(FindPkgConfig)
IF(ARM_TARGET)
pkg_check_modules(daemon_pkgs REQUIRED aul glib-2.0 gio-unix-2.0 security-server
vconf dlog tapi appsvc libcurl bluetooth-api libssl svi capi-media-wav-player
- pkgmgr pkgmgr-info capi-network-wifi ecore-x pmapi wifi-direct
- libtzplatform-config neardal)
+ pkgmgr pkgmgr-info capi-network-wifi pmapi wifi-direct
+ libtzplatform-config neardal ${WIN_PKG})
ELSE(ARM_TARGET)
pkg_check_modules(daemon_pkgs REQUIRED aul glib-2.0 gio-unix-2.0 security-server
vconf dlog tapi appsvc libcurl bluetooth-api libssl svi capi-media-wav-player
- pkgmgr pkgmgr-info capi-network-wifi ecore-x pmapi libtzplatform-config neardal)
+ pkgmgr pkgmgr-info capi-network-wifi pmapi libtzplatform-config neardal
+ ${WIN_PKG})
ENDIF(ARM_TARGET)
+IF(WAYLAND_SUPPORT)
+ ADD_DEFINITIONS("-DHAVE_WAYLAND")
+ENDIF(WAYLAND_SUPPORT)
+
+IF(X11_SUPPORT)
+ ADD_DEFINITIONS("-DHAVE_X11")
+ENDIF(X11_SUPPORT)
+
FOREACH(flag ${daemon_pkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
ENDFOREACH(flag)
#include <wav_player.h>
#include <appsvc.h>
#include <aul.h>
+
+#ifdef USE_X11
#include <Ecore_X.h>
+#endif
+#ifdef USE_WAYLAND
+#include <Ecore.h>
+#include <Ecore_Wayland.h>
+#endif
+
#include "net_nfc_typedef.h"
#include "net_nfc_typedef_internal.h"
pid_t net_nfc_app_util_get_focus_app_pid()
{
pid_t pid;
+#ifdef USE_X11
Ecore_X_Window focus;
ecore_x_init(":0");
focus = ecore_x_window_focus_get();
if (ecore_x_netwm_pid_get(focus, &pid))
return pid;
-
+#endif
+#ifdef USE_WAYLAND // TO_DO_WAYLAND
+ NFC_DBG("To implement: Wayland support");
+#endif
return -1;
}
+%bcond_with wayland 1
+%bcond_with x
+
Name: nfc-manager-neard
Summary: NFC framework manager
Version: 0.1.6
BuildRequires: pkgconfig(libcurl)
BuildRequires: pkgconfig(pkgmgr)
BuildRequires: pkgconfig(pkgmgr-info)
-BuildRequires: pkgconfig(ecore-x)
+%if %{with x}
+BuildRequires: pkgconfig(ecore-x)
+%endif
+%if %{with wayland}
+BuildRequires: pkgconfig(ecore-wayland)
+%endif
BuildRequires: pkgconfig(pmapi)
BuildRequires: pkgconfig(libtzplatform-config)
BuildRequires: pkgconfig(neardal)
%build
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-%cmake . -DMAJORVER=${MAJORVER} -DFULLVER=%{version} %{?ARM_DEF}
+%cmake . -DMAJORVER=${MAJORVER} -DFULLVER=%{version} %{?ARM_DEF} \
+%if %{with wayland}
+-DWAYLAND_SUPPORT=On \
+%else
+-DWAYLAND_SUPPORT=Off \
+%endif
+%if %{with x}
+-DX11_SUPPORT=On
+%else
+-DX11_SUPPORT=Off
+%endif
%install
SET(CMAKE_BUILD_TYPE "Release")
ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+IF(X11_SUPPORT)
+ SET(WIN_PKG "ecore-x")
+ENDIF(X11_SUPPORT)
+IF(WAYLAND_SUPPORT)
+ SET(WIN_PKG "${WIN_PKG} ecore-wayland")
+ENDIF(WAYLAND_SUPPORT)
INCLUDE(FindPkgConfig)
-pkg_check_modules(manager_pkges REQUIRED aul glib-2.0 gobject-2.0 security-server dbus-glib-1 vconf dlog tapi appsvc libcurl bluetooth-api heynoti smartcard-service smartcard-service-common libssl pmapi svi capi-media-wav-player pkgmgr pkgmgr-info ecore-x)
+pkg_check_modules(manager_pkges REQUIRED aul glib-2.0 gobject-2.0 security-server dbus-glib-1 vconf dlog tapi appsvc libcurl bluetooth-api heynoti smartcard-service smartcard-service-common libssl pmapi svi capi-media-wav-player pkgmgr pkgmgr-info ${WIN_PKG})
+
+IF(WAYLAND_SUPPORT)
+ ADD_DEFINITIONS("-DHAVE_WAYLAND")
+ENDIF(WAYLAND_SUPPORT)
+
+IF(X11_SUPPORT)
+ ADD_DEFINITIONS("-DHAVE_X11")
+ENDIF(X11_SUPPORT)
FOREACH(flag ${manager_pkges_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")