raster pushed a commit to branch master.

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

commit cbf6f94c807556e59007843e40ad8bb6c2021427
Author: Gwanglim Lee <[email protected]>
Date:   Fri Feb 28 07:20:01 2014 +0900

    ecore_evas: Added support for window auxiliary hint
    
    Summary:
    The window auxiliary hint is the value which is used to decide
    which actions should be made available to the user by the WM. If you
    want to set specific hint to your window, then you should check whether
    it exists in the supported auxiliary hints that are registered in the
    root window by the window manager.
    
    Once you've added an auxiliary hint, you can get a new ID which is used
    to change value and delete hint. The window manager sends the response
    message to the application on receiving auxiliary hint change event.
    
    A list of auxiliary hint within the Ecore_Evas has this format:
    
      ID:HINT:VALUE,ID:HINT:VALUE,...
    
    Reviewers: raster, cedric, seoz, Hermet
    
    Reviewed By: raster
    
    CC: cedric
    
    Differential Revision: https://phab.enlightenment.org/D543
---
 src/lib/ecore_evas/Ecore_Evas.h                    |  69 +++++++
 src/lib/ecore_evas/ecore_evas.c                    | 204 +++++++++++++++++++++
 src/lib/ecore_evas/ecore_evas_buffer.c             |   4 +-
 src/lib/ecore_evas/ecore_evas_ews.c                |   4 +-
 src/lib/ecore_evas/ecore_evas_private.h            |  20 ++
 src/lib/ecore_x/Ecore_X_Atoms.h                    |   6 +
 src/lib/ecore_x/ecore_x_atoms_decl.h               |  13 +-
 .../ecore_evas/engines/cocoa/ecore_evas_cocoa.c    |   4 +-
 .../ecore_evas/engines/drm/ecore_evas_drm.c        |   4 +-
 .../ecore_evas/engines/extn/ecore_evas_extn.c      |   8 +-
 src/modules/ecore_evas/engines/fb/ecore_evas_fb.c  |   4 +-
 .../engines/psl1ght/ecore_evas_psl1ght.c           |   4 +-
 .../ecore_evas/engines/sdl/ecore_evas_sdl.c        |   4 +-
 .../engines/wayland/ecore_evas_wayland_egl.c       |   4 +-
 .../engines/wayland/ecore_evas_wayland_shm.c       |   4 +-
 .../ecore_evas/engines/win32/ecore_evas_win32.c    |   4 +-
 src/modules/ecore_evas/engines/x/ecore_evas_x.c    |  96 +++++++++-
 17 files changed, 442 insertions(+), 14 deletions(-)

diff --git a/src/lib/ecore_evas/Ecore_Evas.h b/src/lib/ecore_evas/Ecore_Evas.h
index 2ef08e5..bdc187a 100644
--- a/src/lib/ecore_evas/Ecore_Evas.h
+++ b/src/lib/ecore_evas/Ecore_Evas.h
@@ -765,6 +765,75 @@ EAPI Eina_Bool   
ecore_evas_wm_rotation_manual_rotation_done_get(const Ecore_Eva
  */
 EAPI void        ecore_evas_wm_rotation_manual_rotation_done(Ecore_Evas *ee);
 /**
+ * @brief Get the list of supported auxiliary hint strings.
+ *
+ * @param ee The Ecore_Evas
+ * @return List of supported auxiliary hint strings.
+ * @note Do not change the returned list of its contents. Auxiliary hint
+ * strings are internal and should be considered constants, do not free or
+ * modify them.
+ * @warning Support for this depends on the underlying windowing system.
+ *
+ * The window auxiliary hint is the value which is used to decide which 
actions should
+ * be made available to the user by the window manager. If you want to set 
specific hint
+ * to your window, then you should check whether it exists in the supported 
auxiliary
+ * hints that are registered in the root window by the window manager. Once 
you've added
+ * an auxiliary hint, you can get a new ID which is used to change value and 
delete hint.
+ * The window manager sends the response message to the application on 
receiving auxiliary
+ * hint change event. A list of auxiliary hint within the Ecore_Evas has this 
format:
+ * ID:HINT:VALUE,ID:HINT:VALUE,...
+ *
+ * @since 1.9.0
+ */
+EAPI const Eina_List *ecore_evas_aux_hints_supported_get(const Ecore_Evas *ee);
+/**
+ * @brief Get the list of allowed auxiliary hint ID.
+ *
+ * @param ee The Ecore_Evas
+ * @return List of allowed auxiliary hint ID.
+ * @note This function is low level. Instead of using it directly, consider
+ * using the callback mechanism in Elementary such as "aux,hint,allowed".
+ * @warning Support for this depends on the underlying windowing system.
+ *
+ * @since 1.9.0
+ */
+EAPI Eina_List       *ecore_evas_aux_hints_allowed_get(const Ecore_Evas *ee);
+/**
+ * @brief Create an auxiliary hint of the Ecore_Evas.
+ *
+ * @param ee The Ecore_Evas
+ * @param hint The auxiliary hint string.
+ * @param val The value string.
+ * @return The ID of created auxiliary hint, or -1 on failure.
+ * @warning Support for this depends on the underlying windowing system.
+ *
+ * @since 1.9.0
+ */
+EAPI int              ecore_evas_aux_hint_add(Ecore_Evas *ee, const char 
*hint, const char *val);
+/**
+ * @brief Delete an auxiliary hint of the Ecore_Evas.
+ *
+ * @param ee The Ecore_Evas
+ * @param id The ID of the auxiliary hint.
+ * @return EINA_TRUE if no error occurred, EINA_FALSE otherwise.
+ * @warning Support for this depends on the underlying windowing system.
+ *
+ * @since 1.9.0
+ */
+EAPI Eina_Bool        ecore_evas_aux_hint_del(Ecore_Evas *ee, const int id);
+/**
+ * @brief Change a value of the auxiliary hint.
+ *
+ * @param ee The Ecore_Evas
+ * @param id The auxiliary hint ID.
+ * @param val The value string to be set.
+ * @return EINA_TRUE if no error occurred, EINA_FALSE otherwise.
+ * @warning Support for this depends on the underlying windowing system.
+ *
+ * @since 1.9.0
+ */
+EAPI Eina_Bool        ecore_evas_aux_hint_val_set(Ecore_Evas *ee, const int 
id, const char *val);
+/**
  * @brief Send message to parent ecore
  *
  * @param ee The Ecore_Evas to set
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index 43e4b86..42564bd 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -2093,6 +2093,167 @@ ecore_evas_wm_rotation_manual_rotation_done(Ecore_Evas 
*ee)
    IFE;
 }
 
+EAPI const Eina_List *
+ecore_evas_aux_hints_supported_get(const Ecore_Evas *ee)
+{
+   if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
+     {
+        ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
+                         "ecore_evas_aux_hints_supported_get");
+        return NULL;
+     }
+   return ee->prop.aux_hint.supported_list;
+}
+
+EAPI Eina_List *
+ecore_evas_aux_hints_allowed_get(const Ecore_Evas *ee)
+{
+   if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
+     {
+        ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
+                         "ecore_evas_aux_hints_allowed_get");
+        return NULL;
+     }
+
+   Eina_List *list = NULL, *ll;
+   Ecore_Evas_Aux_Hint *aux;
+   EINA_LIST_FOREACH(ee->prop.aux_hint.hints, ll, aux)
+     {
+        if ((aux->allowed) && !(aux->notified))
+          {
+             list = eina_list_append(list, aux->id);
+          }
+     }
+
+   return list;
+}
+
+EAPI int
+ecore_evas_aux_hint_add(Ecore_Evas *ee, const char *hint, const char *val)
+{
+   if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
+     {
+        ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
+                         "ecore_evas_aux_hint_add");
+        return -1;
+     }
+
+   Eina_List *ll;
+   char *supported_hint;
+   EINA_LIST_FOREACH(ee->prop.aux_hint.supported_list, ll, supported_hint)
+     {
+        if (!strncmp(supported_hint, hint, strlen(hint)))
+          {
+             Ecore_Evas_Aux_Hint *aux= (Ecore_Evas_Aux_Hint *)calloc(1, 
sizeof(Ecore_Evas_Aux_Hint));
+             if (aux)
+               {
+                  aux->id = ee->prop.aux_hint.id;
+                  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);
+
+                  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);
+                  free(aux);
+               }
+             break;
+          }
+     }
+
+   return -1;
+}
+
+EAPI Eina_Bool
+ecore_evas_aux_hint_del(Ecore_Evas *ee, const int id)
+{
+   if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
+     {
+        ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
+                         "ecore_evas_aux_hint_del");
+        return EINA_FALSE;
+     }
+
+   Eina_List *ll;
+   Ecore_Evas_Aux_Hint *aux;
+   EINA_LIST_FOREACH(ee->prop.aux_hint.hints, ll, aux)
+     {
+        if (id == aux->id)
+          {
+             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 (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;
+          }
+     }
+
+   return EINA_FALSE;
+}
+
+EAPI Eina_Bool
+ecore_evas_aux_hint_val_set(Ecore_Evas *ee, const int id, const char *val)
+{
+   if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
+     {
+        ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
+                         "ecore_evas_aux_hint_val_set");
+        return EINA_FALSE;
+     }
+
+   Eina_List *ll;
+   Ecore_Evas_Aux_Hint *aux;
+   EINA_LIST_FOREACH(ee->prop.aux_hint.hints, ll, aux)
+     {
+        if (id == aux->id)
+          {
+             eina_stringshare_del(aux->val);
+             aux->val = eina_stringshare_add(val);
+                        aux->allowed = 0;
+                        aux->notified = 0;
+
+             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;
+          }
+     }
+
+   return EINA_TRUE;
+}
+
 EAPI void
 ecore_evas_fullscreen_set(Ecore_Evas *ee, Eina_Bool on)
 {
@@ -2854,6 +3015,7 @@ _ecore_evas_free(Ecore_Evas *ee)
    ee->prop.wm_rot.available_rots = NULL;
    if (ee->prop.wm_rot.manual_mode.timer)
      ecore_timer_del(ee->prop.wm_rot.manual_mode.timer);
+   _ecore_evas_aux_hint_free(ee);
    ee->prop.wm_rot.manual_mode.timer = NULL;
    if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object);
    ee->prop.cursor.object = NULL;
@@ -3157,6 +3319,48 @@ ecore_evas_input_event_unregister(Ecore_Evas *ee)
    ecore_event_window_unregister((Ecore_Window)ee);
 }
 
+EAPI Eina_Strbuf *
+_ecore_evas_aux_hints_string_get(Ecore_Evas *ee)
+{
+   Eina_Strbuf *buf = eina_strbuf_new();
+   if (buf)
+     {
+        if (eina_list_count(ee->prop.aux_hint.hints) > 0)
+          {
+             Eina_List *l;
+             Ecore_Evas_Aux_Hint *aux;
+             int i = 0;
+
+             EINA_LIST_FOREACH(ee->prop.aux_hint.hints, l, aux)
+               {
+                  /* add delimiter */
+                  if (i > 0) eina_strbuf_append_char(buf, ',');
+                  eina_strbuf_append_printf(buf, "%d:%s:%s", aux->id, 
aux->hint, aux->val);
+                  i++;
+               }
+          }
+     }
+   return buf;
+}
+
+void
+_ecore_evas_aux_hint_free(Ecore_Evas *ee)
+{
+   char *hint;
+   EINA_LIST_FREE(ee->prop.aux_hint.supported_list, hint)
+     {
+        eina_stringshare_del(hint);
+     }
+
+   Ecore_Evas_Aux_Hint *aux;
+   EINA_LIST_FREE(ee->prop.aux_hint.hints, aux)
+     {
+        eina_stringshare_del(aux->hint);
+        eina_stringshare_del(aux->val);
+        free(aux);
+     }
+}
+
 /**
  * @brief Create Ecore_Evas using fb backend.
  * @param disp_name The name of the display to be used.
diff --git a/src/lib/ecore_evas/ecore_evas_buffer.c 
b/src/lib/ecore_evas/ecore_evas_buffer.c
index 5c4a739..4f0211c 100644
--- a/src/lib/ecore_evas/ecore_evas_buffer.c
+++ b/src/lib/ecore_evas/ecore_evas_buffer.c
@@ -589,7 +589,9 @@ static Ecore_Evas_Engine_Func _ecore_buffer_engine_func =
      NULL, // wm_rot_preferred_rotation_set
      NULL, // wm_rot_available_rotations_set
      NULL, // wm_rot_manual_rotation_done_set
-     NULL  // wm_rot_manual_rotation_done
+     NULL, // wm_rot_manual_rotation_done
+
+     NULL  // aux_hints_set
 };
 
 static void *
diff --git a/src/lib/ecore_evas/ecore_evas_ews.c 
b/src/lib/ecore_evas/ecore_evas_ews.c
index 84c9a0f..afffa5e 100644
--- a/src/lib/ecore_evas/ecore_evas_ews.c
+++ b/src/lib/ecore_evas/ecore_evas_ews.c
@@ -706,7 +706,9 @@ static const Ecore_Evas_Engine_Func _ecore_ews_engine_func =
      NULL,  // wm_rot_preferred_rotation_set
      NULL,  // wm_rot_available_rotations_set
      NULL, // wm_rot_manual_rotation_done_set
-     NULL  // wm_rot_manual_rotation_done
+     NULL, // wm_rot_manual_rotation_done
+
+     NULL  // aux_hints_set
 };
 
 void
diff --git a/src/lib/ecore_evas/ecore_evas_private.h 
b/src/lib/ecore_evas/ecore_evas_private.h
index cc514d5..e84550b 100644
--- a/src/lib/ecore_evas/ecore_evas_private.h
+++ b/src/lib/ecore_evas/ecore_evas_private.h
@@ -46,6 +46,7 @@ typedef void   (*Ecore_Evas_Event_Cb) (Ecore_Evas *ee);
 typedef struct _Ecore_Evas_Engine Ecore_Evas_Engine;
 typedef struct _Ecore_Evas_Engine_Func Ecore_Evas_Engine_Func;
 typedef struct _Ecore_Evas_Interface Ecore_Evas_Interface;
+typedef struct _Ecore_Evas_Aux_Hint Ecore_Evas_Aux_Hint;
 
 /* Engines interfaces */
 struct _Ecore_Evas_Engine_Func
@@ -120,6 +121,8 @@ struct _Ecore_Evas_Engine_Func
    void (*fn_wm_rot_available_rotations_set) (Ecore_Evas *ee, const int *rots, 
unsigned int count);
    void (*fn_wm_rot_manual_rotation_done_set) (Ecore_Evas *ee, Eina_Bool set);
    void (*fn_wm_rot_manual_rotation_done) (Ecore_Evas *ee);
+
+   void (*fn_aux_hints_set) (Ecore_Evas *ee, const char *hints);
 };
 
 struct _Ecore_Evas_Interface
@@ -206,6 +209,11 @@ struct _Ecore_Evas
             Ecore_Timer *timer;
          } manual_mode;
       } wm_rot;
+      struct {
+         Eina_List      *supported_list;
+         Eina_List      *hints;
+         int             id;
+      } aux_hint;
       int             layer;
       Ecore_Window    window;
       unsigned char   avoid_damage;
@@ -298,6 +306,15 @@ struct _Ecore_Evas
    unsigned char can_async_render : 1;
 };
 
+struct _Ecore_Evas_Aux_Hint
+{
+   int           id;           // ID of aux hint
+   const char   *hint;         // hint string
+   const char   *val;          // value string
+   unsigned char allowed : 1;  // received allowed event from the window 
manager
+   unsigned char notified : 1; // let caller know ee has got response for this 
aux hint
+};
+
 EAPI void _ecore_evas_ref(Ecore_Evas *ee);
 EAPI void _ecore_evas_unref(Ecore_Evas *ee);
 EAPI int ecore_evas_buffer_render(Ecore_Evas *ee);
@@ -363,6 +380,9 @@ int _ecore_evas_ews_shutdown(void);
 void _ecore_evas_extn_init(void);
 void _ecore_evas_extn_shutdown(void);
 
+EAPI Eina_Strbuf *_ecore_evas_aux_hints_string_get(Ecore_Evas *ee);
+void              _ecore_evas_aux_hint_free(Ecore_Evas *ee);
+
 Eina_Module *_ecore_evas_engine_load(const char *engine);
 const Eina_List *_ecore_evas_available_engines_get(void);
 void _ecore_evas_engine_init(void);
diff --git a/src/lib/ecore_x/Ecore_X_Atoms.h b/src/lib/ecore_x/Ecore_X_Atoms.h
index 6c028e6..865bb02 100644
--- a/src/lib/ecore_x/Ecore_X_Atoms.h
+++ b/src/lib/ecore_x/Ecore_X_Atoms.h
@@ -322,4 +322,10 @@ EAPI extern Ecore_X_Atom 
ECORE_X_ATOM_E_WINDOW_ROTATION_CHANGE_PREPARE;
 EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_WINDOW_ROTATION_CHANGE_PREPARE_DONE;
 EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_WINDOW_ROTATION_CHANGE_REQUEST;
 EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_WINDOW_ROTATION_CHANGE_DONE;
+
+/* E window auxiliary hint */
+EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_WINDOW_AUX_HINT_SUPPORTED_LIST;
+EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_WINDOW_AUX_HINT_SUPPORT;
+EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_WINDOW_AUX_HINT;
+EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_WINDOW_AUX_HINT_ALLOWED;
 #endif /* _ECORE_X_ATOMS_H */
diff --git a/src/lib/ecore_x/ecore_x_atoms_decl.h 
b/src/lib/ecore_x/ecore_x_atoms_decl.h
index a1f7ecb..5b048f3 100644
--- a/src/lib/ecore_x/ecore_x_atoms_decl.h
+++ b/src/lib/ecore_x/ecore_x_atoms_decl.h
@@ -352,6 +352,12 @@ EAPI Ecore_X_Atom 
ECORE_X_ATOM_E_WINDOW_ROTATION_CHANGE_PREPARE_DONE = 0;
 EAPI Ecore_X_Atom ECORE_X_ATOM_E_WINDOW_ROTATION_CHANGE_REQUEST = 0;
 EAPI Ecore_X_Atom ECORE_X_ATOM_E_WINDOW_ROTATION_CHANGE_DONE = 0;
 
+/* E window auxiliary hint */
+EAPI Ecore_X_Atom ECORE_X_ATOM_E_WINDOW_AUX_HINT_SUPPORTED_LIST = 0;
+EAPI Ecore_X_Atom ECORE_X_ATOM_E_WINDOW_AUX_HINT_SUPPORT = 0;
+EAPI Ecore_X_Atom ECORE_X_ATOM_E_WINDOW_AUX_HINT = 0;
+EAPI Ecore_X_Atom ECORE_X_ATOM_E_WINDOW_AUX_HINT_ALLOWED = 0;
+
 typedef struct _Atom_Item Atom_Item;
 
 struct _Atom_Item
@@ -660,6 +666,11 @@ const Atom_Item atom_items[] =
    { "_E_WINDOW_ROTATION_CHANGE_PREPARE", 
&ECORE_X_ATOM_E_WINDOW_ROTATION_CHANGE_PREPARE },
    { "_E_WINDOW_ROTATION_CHANGE_PREPARE_DONE", 
&ECORE_X_ATOM_E_WINDOW_ROTATION_CHANGE_PREPARE_DONE },
    { "_E_WINDOW_ROTATION_CHANGE_REQUEST", 
&ECORE_X_ATOM_E_WINDOW_ROTATION_CHANGE_REQUEST },
-   { "_E_WINDOW_ROTATION_CHANGE_DONE", 
&ECORE_X_ATOM_E_WINDOW_ROTATION_CHANGE_DONE }
+   { "_E_WINDOW_ROTATION_CHANGE_DONE", 
&ECORE_X_ATOM_E_WINDOW_ROTATION_CHANGE_DONE },
+
+   { "_E_WINDOW_AUX_HINT_SUPPORTED_LIST", 
&ECORE_X_ATOM_E_WINDOW_AUX_HINT_SUPPORTED_LIST },
+   { "_E_WINDOW_AUX_HINT_SUPPORT", &ECORE_X_ATOM_E_WINDOW_AUX_HINT_SUPPORT },
+   { "_E_WINDOW_AUX_HINT", &ECORE_X_ATOM_E_WINDOW_AUX_HINT },
+   { "_E_WINDOW_AUX_HINT_ALLOWED", &ECORE_X_ATOM_E_WINDOW_AUX_HINT_ALLOWED }
 };
 
diff --git a/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c 
b/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
index d54737e..6722f71 100644
--- a/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
+++ b/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
@@ -481,7 +481,9 @@ static Ecore_Evas_Engine_Func _ecore_cocoa_engine_func =
      NULL, // wm_rot_preferred_rotation_set
      NULL, // wm_rot_available_rotations_set
      NULL, // wm_rot_manual_rotation_done_set
-     NULL  // wm_rot_manual_rotation_done
+     NULL, // wm_rot_manual_rotation_done
+
+     NULL  // aux_hints_set
   };
 
 EAPI Ecore_Evas *
diff --git a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c 
b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
index ec6afa6..8a7160b 100644
--- a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
+++ b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
@@ -104,7 +104,9 @@ static Ecore_Evas_Engine_Func _ecore_evas_drm_engine_func =
    NULL, // wm_rot_preferred_rotation_set
    NULL, // wm_rot_available_rotations_set
    NULL, // wm_rot_manual_rotation_done_set
-   NULL  // wm_rot_manual_rotation_done
+   NULL, // wm_rot_manual_rotation_done
+
+   NULL  // aux_hints_set
 };
 
 EAPI Ecore_Evas *
diff --git a/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c 
b/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c
index 221a7de..4b2aaeb 100644
--- a/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c
+++ b/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c
@@ -882,7 +882,9 @@ static const Ecore_Evas_Engine_Func 
_ecore_extn_plug_engine_func =
    NULL, // wm_rot_preferred_rotation_set
    NULL, // wm_rot_available_rotations_set
    NULL, // wm_rot_manual_rotation_done_set
-   NULL  // wm_rot_manual_rotation_done
+   NULL, // wm_rot_manual_rotation_done
+
+   NULL  // aux_hints_set
 };
 
 static Eina_Bool
@@ -2007,7 +2009,9 @@ static const Ecore_Evas_Engine_Func 
_ecore_extn_socket_engine_func =
    NULL, // wm_rot_preferred_rotation_set
    NULL, // wm_rot_available_rotations_set
    NULL, // wm_rot_manual_rotation_done_set
-   NULL  // wm_rot_manual_rotation_done
+   NULL, // wm_rot_manual_rotation_done
+
+   NULL  // aux_hints_set
 };
 
 EAPI Ecore_Evas *
diff --git a/src/modules/ecore_evas/engines/fb/ecore_evas_fb.c 
b/src/modules/ecore_evas/engines/fb/ecore_evas_fb.c
index aba3127..4fb69c4 100644
--- a/src/modules/ecore_evas/engines/fb/ecore_evas_fb.c
+++ b/src/modules/ecore_evas/engines/fb/ecore_evas_fb.c
@@ -577,7 +577,9 @@ static Ecore_Evas_Engine_Func _ecore_fb_engine_func =
      NULL, // wm_rot_preferred_rotation_set
      NULL, // wm_rot_available_rotations_set
      NULL, // wm_rot_manual_rotation_done_set
-     NULL  // wm_rot_manual_rotation_done
+     NULL, // wm_rot_manual_rotation_done
+
+     NULL  // aux_hints_set
  };
 
 EAPI Ecore_Evas *
diff --git a/src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c 
b/src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c
index bd09d14..032dbba 100644
--- a/src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c
+++ b/src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c
@@ -415,7 +415,9 @@ static Ecore_Evas_Engine_Func _ecore_psl1ght_engine_func =
    NULL, // wm_rot_preferred_rotation_set
    NULL, // wm_rot_available_rotations_set
    NULL, // wm_rot_manual_rotation_done_set
-   NULL  // wm_rot_manual_rotation_done
+   NULL, // wm_rot_manual_rotation_done
+
+   NULL  // aux_hints_set
 };
 
 EAPI Ecore_Evas *
diff --git a/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c 
b/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c
index 33da518..98bd98a 100644
--- a/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c
+++ b/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c
@@ -455,7 +455,9 @@ static Ecore_Evas_Engine_Func _ecore_sdl_engine_func =
    NULL, // wm_rot_preferred_rotation_set
    NULL, // wm_rot_available_rotations_set
    NULL, // wm_rot_manual_rotation_done_set
-   NULL  // wm_rot_manual_rotation_done
+   NULL, // wm_rot_manual_rotation_done
+
+   NULL  // aux_hints_set
 };
 
 static Ecore_Evas*
diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c 
b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c
index eaaa16b..592609f 100644
--- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c
+++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c
@@ -84,7 +84,9 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
    NULL, // wm_rot_preferred_rotation_set
    NULL, // wm_rot_available_rotations_set
    NULL, // wm_rot_manual_rotation_done_set
-   NULL  // wm_rot_manual_rotation_done
+   NULL, // wm_rot_manual_rotation_done
+
+   NULL  // aux_hints_set
 };
 
 /* external variables */
diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c 
b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c
index c873ace..90ab66f 100644
--- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c
+++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c
@@ -84,7 +84,9 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
    NULL, // wm_rot_preferred_rotation_set
    NULL, // wm_rot_available_rotations_set
    NULL, // wm_rot_manual_rotation_done_set
-   NULL  // wm_rot_manual_rotation_done
+   NULL, // wm_rot_manual_rotation_done
+
+   NULL  // aux_hints_set
 };
 
 /* external variables */
diff --git a/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c 
b/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
index bbcfae2..2ff8998 100644
--- a/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
+++ b/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
@@ -1141,7 +1141,9 @@ static Ecore_Evas_Engine_Func _ecore_win32_engine_func =
      NULL, // wm_rot_preferred_rotation_set
      NULL, // wm_rot_available_rotations_set
      NULL, // wm_rot_manual_rotation_done_set
-     NULL  // wm_rot_manual_rotation_done
+     NULL, // wm_rot_manual_rotation_done
+
+     NULL  // aux_hints_set
 };
 
 #endif /* BUILD_ECORE_EVAS_WIN32 */
diff --git a/src/modules/ecore_evas/engines/x/ecore_evas_x.c 
b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
index 2a33fc8..c6cc9ec 100644
--- a/src/modules/ecore_evas/engines/x/ecore_evas_x.c
+++ b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
@@ -118,6 +118,7 @@ static Ecore_Evas_Interface_Gl_X11 
*_ecore_evas_x_interface_gl_x11_new(void);
 static void      _ecore_evas_x_rotation_set(Ecore_Evas *ee, int rotation, int 
resize);
 static Eina_Bool _ecore_evas_x_wm_rot_manual_rotation_done_timeout(void *data);
 static void      
_ecore_evas_x_wm_rot_manual_rotation_done_timeout_update(Ecore_Evas *ee);
+static void      _ecore_evas_x_aux_hints_set(Ecore_Evas *ee, const char 
*hints);
 
 static void _resize_shape_do(Ecore_Evas *);
 static void _shaped_do(Ecore_Evas *, int);
@@ -341,6 +342,55 @@ _ecore_evas_x_wm_rot_manual_rotation_done_job(void *data)
    edata->wm_rot.done = 0;
 }
 
+static void
+_ecore_evas_x_aux_hints_supprted_update(Ecore_Evas *ee)
+{
+   Ecore_X_Window root = ecore_x_window_root_first_get();
+   unsigned char *data = NULL;
+   unsigned int num = 0, i = 0;
+   int res = 0, n = 0;
+   char **str;
+   const char *hint;
+
+   EINA_LIST_FREE(ee->prop.aux_hint.supported_list, hint)
+     {
+        eina_stringshare_del(hint);
+     }
+
+   res = ecore_x_window_prop_property_get
+     (root, ECORE_X_ATOM_E_WINDOW_AUX_HINT_SUPPORTED_LIST,
+      ECORE_X_ATOM_STRING, 0, &data, &n);
+
+   if ((res == 8) && (n >0))
+     {
+        str = eina_str_split_full((char *)data, ",", -1, &num);
+        for (i = 0; i < num; i++)
+          {
+             hint = eina_stringshare_add(str[i]);
+             ee->prop.aux_hint.supported_list = 
eina_list_append(ee->prop.aux_hint.supported_list, hint);
+          }
+
+        if (num > 0)
+          {
+             free(str[0]);
+             free(str);
+          }
+     }
+
+   free(data);
+}
+
+static void
+_ecore_evas_x_aux_hints_update(Ecore_Evas *ee)
+{
+   Eina_Strbuf *buf = _ecore_evas_aux_hints_string_get(ee);
+   if (buf)
+     {
+        _ecore_evas_x_aux_hints_set(ee, eina_strbuf_string_get(buf));
+        eina_strbuf_free(buf);
+     }
+}
+
 # ifdef BUILD_ECORE_EVAS_OPENGL_X11
 static Ecore_X_Window
 _ecore_evas_x_gl_window_new(Ecore_Evas *ee, Ecore_X_Window parent, int x, int 
y, int w, int h, Eina_Bool override, int argb, const int *opt)
@@ -1128,6 +1178,28 @@ _ecore_evas_x_event_client_message(void *data 
EINA_UNUSED, int type EINA_UNUSED,
                }
           }
      }
+   else if (e->message_type == ECORE_X_ATOM_E_WINDOW_AUX_HINT_ALLOWED)
+     {
+        ee = ecore_event_window_match(e->win);
+        if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
+
+        int id = e->data.l[1]; /* id of aux hint */
+        Eina_List *l;
+        Ecore_Evas_Aux_Hint *aux;
+        EINA_LIST_FOREACH(ee->prop.aux_hint.hints, l, aux)
+          {
+             if (id == aux->id)
+               {
+                  aux->allowed = 1;
+                  if (!aux->notified)
+                    {
+                       if (ee->func.fn_state_change) 
ee->func.fn_state_change(ee);
+                       aux->notified = 1;
+                    }
+                  break;
+               }
+          }
+     }
    return ECORE_CALLBACK_PASS_ON;
 }
 
@@ -2479,6 +2551,8 @@ _alpha_do(Ecore_Evas *ee, int alpha)
    _ecore_evas_x_protocols_set(ee);
    _ecore_evas_x_window_profile_protocol_set(ee);
    _ecore_evas_x_wm_rotation_protocol_set(ee);
+   _ecore_evas_x_aux_hints_supprted_update(ee);
+   _ecore_evas_x_aux_hints_update(ee);
    _ecore_evas_x_sync_set(ee);
    _ecore_evas_x_size_pos_hints_update(ee);
 #endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 */
@@ -2631,6 +2705,8 @@ _ecore_evas_x_alpha_set(Ecore_Evas *ee, int alpha)
         _ecore_evas_x_protocols_set(ee);
         _ecore_evas_x_window_profile_protocol_set(ee);
         _ecore_evas_x_wm_rotation_protocol_set(ee);
+        _ecore_evas_x_aux_hints_supprted_update(ee);
+        _ecore_evas_x_aux_hints_update(ee);
         _ecore_evas_x_sync_set(ee);
         _ecore_evas_x_size_pos_hints_update(ee);
 #endif /* BUILD_ECORE_EVAS_OPENGL_X11 */
@@ -3403,6 +3479,18 @@ 
_ecore_evas_x_wm_rot_manual_rotation_done_timeout_update(Ecore_Evas *ee)
      (4.0f, _ecore_evas_x_wm_rot_manual_rotation_done_timeout, ee);
 }
 
+static void
+_ecore_evas_x_aux_hints_set(Ecore_Evas *ee, const char *hints)
+{
+   if (hints)
+     ecore_x_window_prop_property_set
+       (ee->prop.window, ECORE_X_ATOM_E_WINDOW_AUX_HINT,
+        ECORE_X_ATOM_STRING, 8, (void *)hints, strlen(hints) + 1);
+   else
+     ecore_x_window_prop_property_del
+       (ee->prop.window, ECORE_X_ATOM_E_WINDOW_AUX_HINT);
+}
+
 static Ecore_Evas_Engine_Func _ecore_x_engine_func =
 {
    _ecore_evas_x_free,
@@ -3473,7 +3561,9 @@ static Ecore_Evas_Engine_Func _ecore_x_engine_func =
    _ecore_evas_x_wm_rot_preferred_rotation_set,
    _ecore_evas_x_wm_rot_available_rotations_set,
    _ecore_evas_x_wm_rot_manual_rotation_done_set,
-   _ecore_evas_x_wm_rot_manual_rotation_done
+   _ecore_evas_x_wm_rot_manual_rotation_done,
+
+   _ecore_evas_x_aux_hints_set
 };
 
 /*
@@ -3873,6 +3963,8 @@ ecore_evas_software_x11_new_internal(const char 
*disp_name, Ecore_X_Window paren
    _ecore_evas_x_protocols_set(ee);
    _ecore_evas_x_window_profile_protocol_set(ee);
    _ecore_evas_x_wm_rotation_protocol_set(ee);
+   _ecore_evas_x_aux_hints_supprted_update(ee);
+   _ecore_evas_x_aux_hints_update(ee);
    _ecore_evas_x_sync_set(ee);
 
    ee->engine.func->fn_render = _ecore_evas_x_render;
@@ -4321,6 +4413,8 @@ ecore_evas_gl_x11_options_new_internal(const char 
*disp_name, Ecore_X_Window par
    _ecore_evas_x_protocols_set(ee);
    _ecore_evas_x_window_profile_protocol_set(ee);
    _ecore_evas_x_wm_rotation_protocol_set(ee);
+   _ecore_evas_x_aux_hints_supprted_update(ee);
+   _ecore_evas_x_aux_hints_update(ee);
    _ecore_evas_x_sync_set(ee);
 
    ee->engine.func->fn_render = _ecore_evas_x_render;

-- 


Reply via email to