cedric pushed a commit to branch master.

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

commit fe734165cb16dd08011127ced4575c313f9b7c4b
Author: Maksym Volodin <[email protected]>
Date:   Thu Jun 12 19:14:42 2014 +0200

    edje: Edje_Edit - add edje_edit_part_items_list_get.
    
    Summary: Get the list of names of all part items in the given edje.
    @feature
    
    Reviewers: cedric, raster, seoz, Hermet
    
    Reviewed By: cedric
    
    CC: reutskiy.v.v, cedric
    
    Differential Revision: https://phab.enlightenment.org/D1018
    
    Signed-off-by: Cedric BAIL <[email protected]>
---
 src/lib/edje/Edje_Edit.h |  8 ++++++++
 src/lib/edje/edje_edit.c | 21 +++++++++++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h
index f6a3b3a..02f3719 100644
--- a/src/lib/edje/Edje_Edit.h
+++ b/src/lib/edje/Edje_Edit.h
@@ -1563,6 +1563,14 @@ EAPI Eina_Bool 
edje_edit_part_drag_threshold_set(Evas_Object *obj, const char *p
  */
 EAPI Eina_Bool edje_edit_part_item_append(Evas_Object *obj, const char *part, 
const char *item_name, const char *source_group);
 
+/** Get the list of all part items in the given edje.
+ *
+ * @param obj Object being edited.
+ *
+ * @return A List containing all part items names found in the edje file.
+ */
+EAPI Eina_List * edje_edit_part_items_list_get(Evas_Object *obj, const char 
*part);
+
 //@}
 
/******************************************************************************/
 /**************************   STATES API   
************************************/
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index 6eee47d..216bd15 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -3703,6 +3703,27 @@ edje_edit_part_item_append(Evas_Object *obj, const char 
*part, const char *item_
    return EINA_TRUE;
 }
 
+EAPI Eina_List *
+edje_edit_part_items_list_get(Evas_Object *obj, const char *part)
+{
+   Edje_Part *ep;
+   unsigned int i;
+   Eina_List *items_list = NULL;
+   GET_RP_OR_RETURN(NULL);
+   /* There is only Box and Table is allowed. */
+   if ((rp->part->type != EDJE_PART_TYPE_BOX) &&
+      (rp->part->type != EDJE_PART_TYPE_TABLE))
+     return NULL;
+   ep = rp->part;
+   if (!ed->file) return NULL;
+
+   for (i = 0; i < ep->items_count; ++i)
+     items_list = eina_list_append(items_list,
+        eina_stringshare_add(ep->items[i]->name));
+
+   return items_list;
+}
+
 /*********************/
 /*  PART STATES API  */
 /*********************/

-- 


Reply via email to