devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=0d5d15755920a9011d41f7d5af19ff4c212c7b19

commit 0d5d15755920a9011d41f7d5af19ff4c212c7b19
Author: Chris Michael <[email protected]>
Date:   Tue Jun 13 12:54:05 2017 -0400

    ecore-evas: Support auxiliary hints for ecore-evas-wayland
    
    Small patch to support using Ecore_Evas_Interface_Wayland in order to
    add support for setting auxiliary hints on a surface
    
    @feature
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/lib/ecore_evas/ecore_evas.c | 89 ++++++++++++++++++++++++++++++++---------
 1 file changed, 70 insertions(+), 19 deletions(-)

diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index b5c9f35020..f375559c98 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -2304,20 +2304,38 @@ ecore_evas_aux_hint_add(Ecore_Evas *ee, const char 
*hint, const char *val)
                   aux->hint = eina_stringshare_add(hint);
                   aux->val = eina_stringshare_add(val);
 
-                  ee->prop.aux_hint.hints = 
eina_list_append(ee->prop.aux_hint.hints, aux);
+                  ee->prop.aux_hint.hints =
+                    eina_list_append(ee->prop.aux_hint.hints, aux);
 
-                  Eina_Strbuf *buf = _ecore_evas_aux_hints_string_get(ee);
-                  if (buf)
+                  if (!strncmp(ee->driver, "wayland", 7))
                     {
-                       if (ee->engine.func->fn_aux_hints_set)
-                         ee->engine.func->fn_aux_hints_set(ee, 
eina_strbuf_string_get(buf));
+                       Ecore_Evas_Interface_Wayland *iface;
 
-                       eina_strbuf_free(buf);
+                       iface = (Ecore_Evas_Interface_Wayland 
*)_ecore_evas_interface_get(ee, "wayland");
+                       EINA_SAFETY_ON_NULL_RETURN_VAL(iface, -1);
+
+                       if (iface->aux_hint_add)
+                         iface->aux_hint_add(ee, aux->id, hint, val);
 
                        ee->prop.aux_hint.id++;
 
                        return aux->id;
                     }
+                  else
+                    {
+                       Eina_Strbuf *buf = _ecore_evas_aux_hints_string_get(ee);
+                       if (buf)
+                         {
+                            if (ee->engine.func->fn_aux_hints_set)
+                              ee->engine.func->fn_aux_hints_set(ee, 
eina_strbuf_string_get(buf));
+
+                            eina_strbuf_free(buf);
+
+                            ee->prop.aux_hint.id++;
+
+                            return aux->id;
+                         }
+                    }
 
                   eina_stringshare_del(aux->hint);
                   eina_stringshare_del(aux->val);
@@ -2341,22 +2359,39 @@ ecore_evas_aux_hint_del(Ecore_Evas *ee, const int id)
      {
         if (id == aux->id)
           {
-             ee->prop.aux_hint.hints = 
eina_list_remove(ee->prop.aux_hint.hints, aux);
+             ee->prop.aux_hint.hints =
+               eina_list_remove(ee->prop.aux_hint.hints, aux);
 
              eina_stringshare_del(aux->hint);
              eina_stringshare_del(aux->val);
              free(aux);
 
-             Eina_Strbuf *buf = _ecore_evas_aux_hints_string_get(ee);
-             if (buf)
+             if (!strncmp(ee->driver, "wayland", 7))
                {
-                  if (ee->engine.func->fn_aux_hints_set)
-                    ee->engine.func->fn_aux_hints_set(ee, 
eina_strbuf_string_get(buf));
+                  Ecore_Evas_Interface_Wayland *iface;
+
+                  iface = (Ecore_Evas_Interface_Wayland 
*)_ecore_evas_interface_get(ee, "wayland");
+                  EINA_SAFETY_ON_NULL_RETURN_VAL(iface, EINA_FALSE);
 
-                  eina_strbuf_free(buf);
+                  if (iface->aux_hint_del)
+                    iface->aux_hint_del(ee, id);
 
                   return EINA_TRUE;
                }
+             else
+               {
+                  Eina_Strbuf *buf = _ecore_evas_aux_hints_string_get(ee);
+                  if (buf)
+                    {
+                       if (ee->engine.func->fn_aux_hints_set)
+                         ee->engine.func->fn_aux_hints_set(ee, 
eina_strbuf_string_get(buf));
+
+                       eina_strbuf_free(buf);
+
+                       return EINA_TRUE;
+                    }
+               }
+
              break;
           }
      }
@@ -2377,19 +2412,35 @@ ecore_evas_aux_hint_val_set(Ecore_Evas *ee, const int 
id, const char *val)
           {
              eina_stringshare_del(aux->val);
              aux->val = eina_stringshare_add(val);
-                        aux->allowed = 0;
-                        aux->notified = 0;
+             aux->allowed = 0;
+             aux->notified = 0;
 
-             Eina_Strbuf *buf = _ecore_evas_aux_hints_string_get(ee);
-             if (buf)
+             if (!strncmp(ee->driver, "wayland", 7))
                {
-                  if (ee->engine.func->fn_aux_hints_set)
-                    ee->engine.func->fn_aux_hints_set(ee, 
eina_strbuf_string_get(buf));
+                  Ecore_Evas_Interface_Wayland *iface;
+
+                  iface = (Ecore_Evas_Interface_Wayland 
*)_ecore_evas_interface_get(ee, "wayland");
+                  EINA_SAFETY_ON_NULL_RETURN_VAL(iface, EINA_FALSE);
 
-                  eina_strbuf_free(buf);
+                  if (iface->aux_hint_change)
+                    iface->aux_hint_change(ee, id, val);
 
                   return EINA_TRUE;
                }
+             else
+               {
+                  Eina_Strbuf *buf = _ecore_evas_aux_hints_string_get(ee);
+                  if (buf)
+                    {
+                       if (ee->engine.func->fn_aux_hints_set)
+                         ee->engine.func->fn_aux_hints_set(ee, 
eina_strbuf_string_get(buf));
+
+                       eina_strbuf_free(buf);
+
+                       return EINA_TRUE;
+                    }
+               }
+
              break;
           }
      }

-- 


Reply via email to