diff options
author | MinJeong Kim <minjjj.kim@samsung.com> | 2016-07-26 17:43:19 +0900 |
---|---|---|
committer | Gwanglim Lee <gl77.lee@samsung.com> | 2016-08-03 04:35:22 -0700 |
commit | 2c5593325c3f32efa92da3c371a780e434a30efd (patch) | |
tree | 97caa0a6f6079a0d0ac96b930b0084d35d2ef008 | |
parent | e938be2daff801f0e8f8f4b18055c1f96905efe7 (diff) | |
download | enlightenment-2c5593325c3f32efa92da3c371a780e434a30efd.tar.gz enlightenment-2c5593325c3f32efa92da3c371a780e434a30efd.tar.bz2 enlightenment-2c5593325c3f32efa92da3c371a780e434a30efd.zip |
e_policy: support sending event aux_message of tizen_policy
Change-Id: Iaa0d7dbeeb11c3854c2a28ce1bd2912aed2ba66b
-rw-r--r-- | src/bin/e_comp_wl.h | 1 | ||||
-rw-r--r-- | src/bin/e_policy.c | 24 | ||||
-rw-r--r-- | src/bin/e_policy.h | 7 | ||||
-rw-r--r-- | src/bin/e_policy_wl.c | 55 | ||||
-rw-r--r-- | src/bin/e_policy_wl.h | 1 |
5 files changed, 86 insertions, 2 deletions
diff --git a/src/bin/e_comp_wl.h b/src/bin/e_comp_wl.h index a7c545c74..2de7d718e 100644 --- a/src/bin/e_comp_wl.h +++ b/src/bin/e_comp_wl.h @@ -420,6 +420,7 @@ struct _E_Comp_Wl_Client_Data { Eina_Bool changed : 1; Eina_List *hints; + Eina_Bool use_msg : 1; } aux_hint; /* before applying viewport */ diff --git a/src/bin/e_policy.c b/src/bin/e_policy.c index 97c70953e..115862c2a 100644 --- a/src/bin/e_policy.c +++ b/src/bin/e_policy.c @@ -1323,6 +1323,30 @@ e_policy_client_is_cursor(E_Client *ec) return EINA_FALSE; } +E_API Eina_Bool +e_policy_aux_message_use_get(E_Client *ec) +{ + E_OBJECT_CHECK_RETURN(ec, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE); + + E_Comp_Wl_Client_Data *cdata = (E_Comp_Wl_Client_Data *)ec->comp_data; + if (cdata->aux_hint.use_msg) + { + return EINA_TRUE; + } + + return EINA_FALSE; +} + +E_API void +e_policy_aux_message_send(E_Client *ec, const char *key, const char *val, Eina_List *options) +{ + E_OBJECT_CHECK(ec); + E_OBJECT_TYPE_CHECK(ec, E_CLIENT_TYPE); + + e_policy_wl_aux_message_send(ec, key, val, options); +} + E_API void e_policy_deferred_job(void) { diff --git a/src/bin/e_policy.h b/src/bin/e_policy.h index e1f202fae..d55fcbc16 100644 --- a/src/bin/e_policy.h +++ b/src/bin/e_policy.h @@ -141,8 +141,11 @@ EINTERN Eina_Bool e_policy_stack_check_above_lockscreen(E_Client *ec, E_L EINTERN Eina_Bool e_policy_conf_rot_enable_get(int angle); +E_API Eina_Bool e_policy_aux_message_use_get(E_Client *ec); +E_API void e_policy_aux_message_send(E_Client *ec, const char *key, const char *val, Eina_List *options); + E_API void e_policy_deferred_job(void); -E_API int e_policy_init(void); -E_API int e_policy_shutdown(void); +E_API int e_policy_init(void); +E_API int e_policy_shutdown(void); #endif #endif diff --git a/src/bin/e_policy_wl.c b/src/bin/e_policy_wl.c index 67340df1a..8764cf2a3 100644 --- a/src/bin/e_policy_wl.c +++ b/src/bin/e_policy_wl.c @@ -195,6 +195,7 @@ enum _E_Policy_Hint_Type E_POLICY_HINT_ABOVE_LOCKSCREEN = 4, E_POLICY_HINT_GESTURE_DISABLE = 5, E_POLICY_HINT_EFFECT_DISABLE = 6, + E_POLICY_HINT_MSG_USE = 7, }; static const char *hint_names[] = @@ -206,6 +207,7 @@ static const char *hint_names[] = "wm.policy.win.above.lock", "wm.policy.win.gesture.disable", "wm.policy.win.effect.disable", + "wm.policy.win.msg.use", }; static void _e_policy_wl_surf_del(E_Policy_Wl_Surface *psurf); @@ -2139,6 +2141,13 @@ _e_policy_wl_aux_hint_apply(E_Client *ec) ec->animatable = 0; } } + else if (!strcmp(hint->hint, hint_names[E_POLICY_HINT_MSG_USE])) + { + if ((hint->deleted) || (!strcmp(hint->val, "0"))) + ec->comp_data->aux_hint.use_msg = EINA_FALSE; + else if (!strcmp(hint->val, "1")) + ec->comp_data->aux_hint.use_msg = EINA_TRUE; + } if (send) _e_policy_wl_allowed_aux_hint_send(ec, hint->id); @@ -4690,6 +4699,52 @@ e_policy_wl_pixmap_del(E_Pixmap *cp) } void +e_policy_wl_aux_message_send(E_Client *ec, + const char *key, + const char *val, + Eina_List *options) +{ + E_Policy_Wl_Tzpol *tzpol; + E_Policy_Wl_Surface *psurf; + Eina_List *l; + Eina_Iterator *it; + struct wl_array opt_array; + const char *option; + int len; + char *p; + + if (!ec->comp_data->aux_hint.use_msg) return; + + wl_array_init(&opt_array); + EINA_LIST_FOREACH(options, l, option) + { + len = strlen(option) + 1; + p = wl_array_add(&opt_array, len); + + if (p == NULL) + break; + strncpy(p, option, len); + } + + it = eina_hash_iterator_data_new(polwl->tzpols); + EINA_ITERATOR_FOREACH(it, tzpol) + EINA_LIST_FOREACH(tzpol->psurfs, l, psurf) + { + if (e_pixmap_client_get(psurf->cp) != ec) continue; + tizen_policy_send_aux_message(tzpol->res_tzpol, + psurf->surf, + key, val, &opt_array); + ELOGF("TZPOL", + "SEND |res_tzpol:0x%08x|aux message key:%s val:%s opt_count:%d", + ec->pixmap, ec, + (unsigned int)tzpol->res_tzpol, + key, val, eina_list_count(options)); + } + eina_iterator_free(it); + wl_array_release(&opt_array); +} + +void e_policy_wl_aux_hint_init(void) { int i, n; diff --git a/src/bin/e_policy_wl.h b/src/bin/e_policy_wl.h index 5d1ffdb4b..280a783e1 100644 --- a/src/bin/e_policy_wl.h +++ b/src/bin/e_policy_wl.h @@ -29,6 +29,7 @@ void e_policy_wl_win_scrmode_apply(void); /* aux_hint */ void e_policy_wl_aux_hint_init(void); +void e_policy_wl_aux_message_send(E_Client *ec, const char *key, const char *val, Eina_List *options); void e_policy_wl_eval_pre_post_fetch(E_Client *ec); /* window brightness */ |