summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoram Park <boram1288.park@samsung.com>2015-02-04 15:25:01 +0900
committerBoram Park <boram1288.park@samsung.com>2015-02-04 15:37:59 +0900
commitb54c1f7121b30e01cc3f2cee84a9818d0473aaa5 (patch)
tree1abe835114a6415d645408d684f770330ef0ff21
parentbecd934a2f1d620dbe1c7ae0915d574478c3eba8 (diff)
downloadmedia-key-b54c1f7121b30e01cc3f2cee84a9818d0473aaa5.tar.gz
media-key-b54c1f7121b30e01cc3f2cee84a9818d0473aaa5.tar.bz2
media-key-b54c1f7121b30e01cc3f2cee84a9818d0473aaa5.zip
Change-Id: I8b64952a52a4b85566341ec40ed9dd0a2be80405
-rw-r--r--CMakeLists.txt10
-rw-r--r--packaging/capi-system-media-key.spec16
-rw-r--r--src/media_key.c8
3 files changed, 30 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0085604..53e45d2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,7 +10,15 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX})
SET(INC_DIR include)
INCLUDE_DIRECTORIES(${INC_DIR})
-SET(requires "dlog capi-base-common aul capi-ui-efl-util")
+SET(requires "dlog capi-base-common aul")
+IF (WITH_WAYLAND)
+ ADD_DEFINITIONS("-DWAYLAND")
+ENDIF (WITH_WAYLAND)
+IF (WITH_X11)
+ ADD_DEFINITIONS("-DX11")
+ SET(requires "${requires} utilX")
+ENDIF (WITH_X11)
+
SET(pc_requires "capi-base-common")
INCLUDE(FindPkgConfig)
diff --git a/packaging/capi-system-media-key.spec b/packaging/capi-system-media-key.spec
index 7510e9a..a0ed681 100644
--- a/packaging/capi-system-media-key.spec
+++ b/packaging/capi-system-media-key.spec
@@ -1,3 +1,6 @@
+%bcond_with x
+%bcond_with wayland
+
Name: capi-system-media-key
Summary: A System Information library in SLP C API
Version: 0.1.0
@@ -11,7 +14,10 @@ BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(capi-base-common)
BuildRequires: pkgconfig(aul)
-BuildRequires: pkgconfig(capi-ui-efl-util)
+%if %{with x}
+BuildRequires: pkgconfig(x11)
+BuildRequires: pkgconfig(utilX)
+%endif
%description
%{summary}.
@@ -31,7 +37,13 @@ cp %{SOURCE1001} .
%build
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
+%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} \
+%if %{with wayland}
+-DWITH_WAYLAND=TRUE
+%endif
+%if %{with x}
+-DWITH_X11=TRUE
+%endif
make %{?jobs:-j%jobs}
diff --git a/src/media_key.c b/src/media_key.c
index bb1325e..1afc54e 100644
--- a/src/media_key.c
+++ b/src/media_key.c
@@ -18,7 +18,9 @@
#include <aul.h>
#include <media_key.h>
#include <string.h>
-#include <efl_util.h>
+#if X11
+#include <utilX.h>
+#endif
#include <dlog.h>
#ifdef LOG_TAG
@@ -47,6 +49,7 @@ static int __aul_key_handler(bundle *b, void *data)
key_str = (char *)bundle_get_val(b, AUL_K_MULTI_KEY);
event_str = (char *)bundle_get_val(b, AUL_K_MULTI_KEY_EVENT);
+#if X11
if (!strcmp(key_str, KEY_PLAYCD)) {
key = MEDIA_KEY_PLAY;
} else if (!strcmp(key_str, KEY_STOPCD)) {
@@ -62,6 +65,9 @@ static int __aul_key_handler(bundle *b, void *data)
} else if (!strcmp(key_str, KEY_FASTFORWARD)) {
key = MEDIA_KEY_FASTFORWARD;
}
+#else
+ LOGE("[%s] not implemented for wayland", __FUNCTION__);
+#endif
if (!strcmp(event_str, AUL_V_KEY_RELEASED)) {
event = MEDIA_KEY_STATUS_RELEASED;