summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaehyeon Jung <darrenh.jung@samsung.com>2016-05-19 08:30:01 +0900
committerDaehyeon Jung <darrenh.jung@samsung.com>2016-05-19 08:41:28 +0900
commit445c2fa83f61a5891c3b06a5ed55ca37ea758814 (patch)
treed5c1144f5989c777612cb37a9f11dc1942496b16
parenta6006cbe7370e62ed763e38406deee03563e1e2f (diff)
downloadappcore-watch-445c2fa83f61a5891c3b06a5ed55ca37ea758814.tar.gz
appcore-watch-445c2fa83f61a5891c3b06a5ed55ca37ea758814.tar.bz2
appcore-watch-445c2fa83f61a5891c3b06a5ed55ca37ea758814.zip
Change-Id: I6a146efbfc5c0a7dc2706fdfa69aa72d5bbe2f74 Signed-off-by: Daehyeon Jung <darrenh.jung@samsung.com>
-rw-r--r--CMakeLists.txt1
-rw-r--r--packaging/appcore-watch.spec1
-rwxr-xr-xsrc/appcore-watch.c54
3 files changed, 56 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b068da0..5c27e0d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,6 +42,7 @@ pkg_check_modules(pkg_watch REQUIRED
capi-appfw-app-common
vconf
elementary
+ ecore-wayland
vconf-internal-keys
libtzplatform-config
capi-appfw-widget-application
diff --git a/packaging/appcore-watch.spec b/packaging/appcore-watch.spec
index a59d439..fa9c568 100644
--- a/packaging/appcore-watch.spec
+++ b/packaging/appcore-watch.spec
@@ -17,6 +17,7 @@ BuildRequires: pkgconfig(capi-appfw-app-common)
BuildRequires: pkgconfig(capi-appfw-widget-application)
BuildRequires: pkgconfig(libtzplatform-config)
BuildRequires: pkgconfig(icu-uc)
+BuildRequires: pkgconfig(ecore-wayland)
BuildRequires: cmake
diff --git a/src/appcore-watch.c b/src/appcore-watch.c
index 5f728df..2b99174 100755
--- a/src/appcore-watch.c
+++ b/src/appcore-watch.c
@@ -33,6 +33,7 @@
#include <vconf.h>
#include <alarm.h>
#include <glib-object.h>
+#include <Ecore_Wayland.h>
#include <widget_app.h>
#include "appcore-watch.h"
@@ -966,6 +967,57 @@ static int __signal_alpm_handler(int ambient, void *data)
return 0;
}
+static Eina_Bool __show_cb(void *data, int type, void *event)
+{
+ Ecore_Wl_Event_Window_Show *ev = event;
+
+ _D("show %d %d", (unsigned int)ev->win, (unsigned int)ev->data[0]);
+
+ __do_app(WE_RESUME, &priv, NULL);
+
+ return ECORE_CALLBACK_RENEW;
+}
+
+static Eina_Bool __hide_cb(void *data, int type, void *event)
+{
+ Ecore_Wl_Event_Window_Hide *ev = event;
+
+ _D("hide %d", (unsigned int)ev->win);
+
+ __do_app(WE_PAUSE, &priv, NULL);
+
+ return ECORE_CALLBACK_RENEW;
+}
+
+static Eina_Bool __visibility_cb(void *data, int type, void *event)
+{
+ Ecore_Wl_Event_Window_Visibility_Change *ev = event;
+
+ _D("visibility %d %d", (unsigned int)ev->win, (unsigned int)ev->fully_obscured);
+
+ if (ev->fully_obscured)
+ __do_app(WE_PAUSE, &priv, NULL);
+ else
+ __do_app(WE_RESUME, &priv, NULL);
+
+ return ECORE_CALLBACK_RENEW;
+}
+
+static Eina_Bool __lower_cb(void *data, int type, void *event)
+{
+ _D("lower");
+
+ return ECORE_CALLBACK_RENEW;
+}
+
+static void __add_climsg(void)
+{
+ ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_SHOW, __show_cb, NULL);
+ ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_HIDE, __hide_cb, NULL);
+ ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_VISIBILITY_CHANGE, __visibility_cb, NULL);
+ ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_LOWER, __lower_cb, NULL);
+}
+
static void __watch_core_signal_init(void)
{
_watch_core_listen_alpm_handler(__signal_alpm_handler, NULL);
@@ -1030,6 +1082,8 @@ static int __before_loop(struct watch_priv *watch, int argc, char **argv)
elm_init(argc, argv);
+ __add_climsg();
+
r = watch_core_init(watch->name, &w_ops, argc, argv);
_retv_if(r < 0, -1);