davemds pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=2751ef6025663ce1253123e5c4472ac675772644

commit 2751ef6025663ce1253123e5c4472ac675772644
Author: davemds <d...@gurumeditation.it>
Date:   Sat Mar 1 18:24:23 2014 +0100

    Python-ELF: new 1.9 API for GenlistItem
---
 efl/elementary/genlist.pxd      |  6 ++++--
 efl/elementary/genlist_item.pxi | 34 ++++++++++++++++++++++++++++++++++
 2 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/efl/elementary/genlist.pxd b/efl/elementary/genlist.pxd
index 2072c13..c6a976c 100644
--- a/efl/elementary/genlist.pxd
+++ b/efl/elementary/genlist.pxd
@@ -1,7 +1,7 @@
-from efl.evas cimport Eina_Bool, Eina_List, Eina_Compare_Cb, \
+from efl.evas cimport Eina_Bool, Eina_List, const_Eina_List, Eina_Compare_Cb, \
     Evas_Object, const_Evas_Object, Evas_Smart_Cb, Evas_Coord
 from object cimport Object
-from object_item cimport Elm_Object_Item
+from object_item cimport Elm_Object_Item, const_Elm_Object_Item
 from general cimport Elm_Tooltip_Item_Content_Cb
 from enums cimport Elm_Scroller_Policy, Elm_List_Mode, Elm_Object_Select_Mode, 
\
     Elm_Genlist_Item_Type, Elm_Genlist_Item_Scrollto_Type, \
@@ -87,6 +87,8 @@ cdef extern from "Elementary.h":
 
     Elm_Object_Item *       elm_genlist_item_parent_get(Elm_Object_Item *it)
     void                    elm_genlist_item_subitems_clear(Elm_Object_Item 
*item)
+    unsigned int            
elm_genlist_item_subitems_count(const_Elm_Object_Item *it)
+    const_Eina_List *       
elm_genlist_item_subitems_get(const_Elm_Object_Item *it)
     void                    elm_genlist_item_expanded_set(Elm_Object_Item 
*item, Eina_Bool expanded)
     Eina_Bool               elm_genlist_item_expanded_get(Elm_Object_Item 
*item)
     int                     
elm_genlist_item_expanded_depth_get(Elm_Object_Item *it)
diff --git a/efl/elementary/genlist_item.pxi b/efl/elementary/genlist_item.pxi
index 68282aa..df8d961 100644
--- a/efl/elementary/genlist_item.pxi
+++ b/efl/elementary/genlist_item.pxi
@@ -602,6 +602,40 @@ cdef class GenlistItem(ObjectItem):
         """
         elm_genlist_item_subitems_clear(self.item)
 
+    def subitems_count(self):
+        """subitems_count() -> int
+
+        Get the number of subitems.
+
+        :return: The number of subitems, 0 on error.
+        :rtype: int
+
+        .. versionadded:: 1.9
+
+        """
+        elm_genlist_item_subitems_count(self.item)
+
+    def subitems_get(self):
+        """subitems_get() -> list
+
+        Get the list of subitems.
+
+        :return: The list of subitems.
+        :rype: list of :py:class:`GenlistItem`
+
+        .. versionadded:: 1.9
+
+        """
+        cdef:
+            Eina_List *l = elm_genlist_item_subitems_get(self.item)
+            list ret = list()
+
+        while l:
+            ret.append(object_from_instance(<Evas_Object*>l.data))
+            l = l.next
+
+        return ret
+
     property expanded:
         """This function flags the item of type #ELM_GENLIST_ITEM_TREE as
         expanded or not.

-- 


Reply via email to