summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaehyeon Jung <darrenh.jung@samsung.com>2016-04-18 18:13:07 +0900
committerDaehyeon Jung <darrenh.jung@samsung.com>2016-04-18 18:15:06 +0900
commit49cfed7131365b3b6a23594a619752a343cd027b (patch)
tree77c3043f66d5bfb729500d6f29eb7b9173992a27
parented46e42fcfe01b3d38459e06c6bf572848666495 (diff)
downloadappcore-widget-49cfed7131365b3b6a23594a619752a343cd027b.tar.gz
appcore-widget-49cfed7131365b3b6a23594a619752a343cd027b.tar.bz2
appcore-widget-49cfed7131365b3b6a23594a619752a343cd027b.zip
Change-Id: I112c0e502ae7906e8cf4614377b32f7f4ac5f231 Signed-off-by: Daehyeon Jung <darrenh.jung@samsung.com>
-rwxr-xr-xsrc/widget_app.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/widget_app.c b/src/widget_app.c
index 38cda3d..96212dc 100755
--- a/src/widget_app.c
+++ b/src/widget_app.c
@@ -293,6 +293,41 @@ static void __show_all()
LOGD("resume");
}
+static Eina_Bool __show_cb(void *data, int type, void *event)
+{
+ Ecore_Wl_Event_Window_Show *ev = event;
+ LOGD("show %d %d", (unsigned int)ev->win, (unsigned int)ev->data[0]);
+ return ECORE_CALLBACK_RENEW;
+}
+
+static Eina_Bool __hide_cb(void *data, int type, void *event)
+{
+ Ecore_Wl_Event_Window_Hide *ev = event;
+ LOGD("hide %d", (unsigned int)ev->win);
+ return ECORE_CALLBACK_RENEW;
+}
+
+static Eina_Bool __visibility_cb(void *data, int type, void *event)
+{
+ Ecore_Wl_Event_Window_Visibility_Change *ev = event;
+ LOGD("visiblity change: %d %d", (unsigned int)ev->win, (unsigned int)ev->fully_obscured);
+ return ECORE_CALLBACK_RENEW;
+}
+
+static Eina_Bool __lower_cb(void *data, int type, void *event)
+{
+ LOGD("lower");
+ return ECORE_CALLBACK_RENEW;
+}
+
+static void __add_climsg()
+{
+ 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 int __aul_handler(aul_type type, bundle *b, void *data)
{
char *caller = NULL;
@@ -421,6 +456,8 @@ static int __before_loop(int argc, char **argv)
"Fail to call _set_i18n");
}
+ __add_climsg();
+
class_provider = app_ops->create(app_user_data);
if (class_provider == NULL) {
return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER,
@@ -528,6 +565,9 @@ EXPORT_API int widget_app_terminate_context(widget_context_h context)
EXPORT_API int widget_app_foreach_context(widget_context_cb cb, void *data)
{
+ GList *list;
+ widget_context_s *wc;
+
if (!_is_widget_feature_enabled()) {
_E("not supported");
return WIDGET_ERROR_NOT_SUPPORTED;
@@ -536,6 +576,17 @@ EXPORT_API int widget_app_foreach_context(widget_context_cb cb, void *data)
if (!cb)
return WIDGET_ERROR_INVALID_PARAMETER;
+ list = g_list_first(contexts);
+
+ while (list) {
+ wc = (widget_context_s *)list->data;
+ if (wc) {
+ if (!cb(wc, data))
+ break;
+ }
+ list = list->next;
+ }
+
return WIDGET_ERROR_NONE;
}