discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=89df60a6cda19e9c9d98553f6fe62acfd9786831

commit 89df60a6cda19e9c9d98553f6fe62acfd9786831
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Sun Feb 21 11:50:23 2016 -0500

    add comp object util callback for closing on Escape key
    
    this is the most common usage for autoclose callbacks, so having it
    available as api saves a lot of typing for the codebase
---
 src/bin/e_comp_object.c | 7 +++++++
 src/bin/e_comp_object.h | 1 +
 2 files changed, 8 insertions(+)

diff --git a/src/bin/e_comp_object.c b/src/bin/e_comp_object.c
index 916fa48..0bc9055 100644
--- a/src/bin/e_comp_object.c
+++ b/src/bin/e_comp_object.c
@@ -4226,6 +4226,13 @@ _e_comp_object_autoclose_del(void *data EINA_UNUSED, 
Evas *e EINA_UNUSED, Evas_O
      e_client_refocus();
 }
 
+
+E_API Eina_Bool
+e_comp_object_util_autoclose_on_escape(void *d EINA_UNUSED, Ecore_Event_Key 
*ev)
+{
+   return strcmp(ev->key, "Escape");
+}
+
 E_API void
 e_comp_object_util_autoclose(Evas_Object *obj, E_Comp_Object_Autoclose_Cb 
del_cb, E_Comp_Object_Key_Cb cb, const void *data)
 {
diff --git a/src/bin/e_comp_object.h b/src/bin/e_comp_object.h
index 8084127..3f01f90 100644
--- a/src/bin/e_comp_object.h
+++ b/src/bin/e_comp_object.h
@@ -50,6 +50,7 @@ E_API E_Client *e_comp_object_client_get(Evas_Object *obj);
 E_API E_Zone *e_comp_object_util_zone_get(Evas_Object *obj);
 E_API void e_comp_object_util_del_list_append(Evas_Object *obj, Evas_Object 
*to_del);
 E_API void e_comp_object_util_del_list_remove(Evas_Object *obj, Evas_Object 
*to_del);
+E_API Eina_Bool e_comp_object_util_autoclose_on_escape(void *d EINA_UNUSED, 
Ecore_Event_Key *ev);
 E_API void e_comp_object_util_autoclose(Evas_Object *obj, 
E_Comp_Object_Autoclose_Cb del_cb, E_Comp_Object_Key_Cb cb, const void *data);
 E_API void e_comp_object_util_center(Evas_Object *obj);
 E_API void e_comp_object_util_center_on(Evas_Object *obj, Evas_Object *on);

-- 


Reply via email to