e_policy: support sending event aux_message of tizen_policy 54/81454/5
authorMinJeong Kim <minjjj.kim@samsung.com>
Tue, 26 Jul 2016 08:43:19 +0000 (17:43 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Wed, 3 Aug 2016 11:35:22 +0000 (04:35 -0700)
Change-Id: Iaa0d7dbeeb11c3854c2a28ce1bd2912aed2ba66b

src/bin/e_comp_wl.h
src/bin/e_policy.c
src/bin/e_policy.h
src/bin/e_policy_wl.c
src/bin/e_policy_wl.h

index a7c545c74aa723302c637e575b922a4e9446c074..2de7d718ef9f5dfe6091eb1a3076a3b3c182c37e 100644 (file)
@@ -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 */
index 97c70953e804c5eb5eca4a49a661b059ee7daceb..115862c2adf252bd28873c1fc629747ed8557513 100644 (file)
@@ -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)
 {
index e1f202fae09dc22b68e97118222592cb0e2b72a7..d55fcbc1628427b968b256d7086a97378873f4fc 100644 (file)
@@ -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
index 67340df1a50763c197edb64e2fb266038b6983ee..8764cf2a31e4cd68e2373bd9843f5b26b4534b7d 100644 (file)
@@ -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);
@@ -4689,6 +4698,52 @@ e_policy_wl_pixmap_del(E_Pixmap *cp)
    eina_iterator_free(it);
 }
 
+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)
 {
index 5d1ffdb4ba7531e2a5f2b0a05ff6c514d72acc9b..280a783e1133ae027679df72002673efc627013f 100644 (file)
@@ -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 */