davemds pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=9f6cf51f80535bba89651ca8f54f6ecbd1a69c15

commit 9f6cf51f80535bba89651ca8f54f6ecbd1a69c15
Author: davemds <[email protected]>
Date:   Sat Mar 1 14:23:42 2014 +0100

    Python-EFL: new 1.9 API: Layout.content_swallow_list_get()
---
 efl/elementary/layout_class.pxd    | 68 +++++++++++++++++++-------------------
 efl/elementary/layout_class.pyx    | 24 +++++++++++++-
 examples/elementary/test_layout.py |  3 ++
 3 files changed, 60 insertions(+), 35 deletions(-)

diff --git a/efl/elementary/layout_class.pxd b/efl/elementary/layout_class.pxd
index 0659167..68f7fe9 100644
--- a/efl/elementary/layout_class.pxd
+++ b/efl/elementary/layout_class.pxd
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU Lesser General Public License
 # along with this Python-EFL.  If not, see <http://www.gnu.org/licenses/>.
 
-from efl.evas cimport Evas_Object, const_Evas_Object, Eina_Bool
+from efl.evas cimport Evas_Object, const_Evas_Object, Eina_Bool, Eina_List
 from object cimport Object
 from libc.string cimport const_char
 
@@ -28,39 +28,39 @@ cdef extern from "Elementary.h":
     Evas_Object *   elm_layout_content_unset(Evas_Object *obj, const_char 
*swallow)
     Eina_Bool       elm_layout_text_set(Evas_Object *obj, const_char *part, 
const_char *text)
     const_char *    elm_layout_text_get(Evas_Object *obj, const_char *part)
-    Eina_Bool           elm_layout_file_set(Evas_Object *obj, const_char 
*file, const_char *group)
-    int                 elm_layout_freeze(Evas_Object *obj)
-    int                 elm_layout_thaw(Evas_Object *obj)
-    Eina_Bool           elm_layout_theme_set(Evas_Object *obj, const_char 
*clas, const_char *group, const_char *style)
-    void                elm_layout_signal_emit(Evas_Object *obj, const_char 
*emission, const_char *source)
-    void                elm_layout_signal_callback_add(Evas_Object *obj, 
const_char *emission, const_char *source, Edje_Signal_Cb func, void *data)
-    void *              elm_layout_signal_callback_del(Evas_Object *obj, 
const_char *emission, const_char *source, Edje_Signal_Cb func)
-    Eina_Bool           elm_layout_box_append(Evas_Object *obj, const_char 
*part, Evas_Object *child)
-    Eina_Bool           elm_layout_box_prepend(Evas_Object *obj, const_char 
*part, Evas_Object *child)
-    Eina_Bool           elm_layout_box_insert_before(Evas_Object *obj, 
const_char *part, Evas_Object *child, Evas_Object *reference)
-    Eina_Bool           elm_layout_box_insert_at(Evas_Object *obj, const_char 
*part, Evas_Object *child, unsigned int pos)
-    Evas_Object *       elm_layout_box_remove(Evas_Object *obj, const_char 
*part, Evas_Object *child)
-    Eina_Bool           elm_layout_box_remove_all(Evas_Object *obj, const_char 
*part, Eina_Bool clear)
-    Eina_Bool           elm_layout_table_pack(Evas_Object *obj, const_char 
*part, Evas_Object *child_obj, unsigned short col, unsigned short row, unsigned 
short colspan, unsigned short rowspan)
-    Evas_Object *       elm_layout_table_unpack(Evas_Object *obj, const_char 
*part, Evas_Object *child_obj)
-    Eina_Bool           elm_layout_table_clear(Evas_Object *obj, const_char 
*part, Eina_Bool clear)
-    Evas_Object *       elm_layout_edje_get(Evas_Object *obj)
-    const_char *        elm_layout_data_get(Evas_Object *obj, const_char *key)
-    void                elm_layout_sizing_eval(Evas_Object *obj)
-    Eina_Bool           elm_layout_part_cursor_set(Evas_Object *obj, 
const_char *part_name, const_char *cursor)
-    const_char *        elm_layout_part_cursor_get(Evas_Object *obj, 
const_char *part_name)
-    Eina_Bool           elm_layout_part_cursor_unset(Evas_Object *obj, 
const_char *part_name)
-    Eina_Bool           elm_layout_part_cursor_style_set(Evas_Object *obj, 
const_char *part_name, const_char *style)
-    const_char *        elm_layout_part_cursor_style_get(Evas_Object *obj, 
const_char *part_name)
-    Eina_Bool           elm_layout_part_cursor_engine_only_set(Evas_Object 
*obj, const_char *part_name, Eina_Bool engine_only)
-    Eina_Bool           elm_layout_part_cursor_engine_only_get(Evas_Object 
*obj, const_char *part_name)
-    Eina_Bool           elm_layout_edje_object_can_access_set(Evas_Object 
*obj, Eina_Bool can_access)
-    Eina_Bool           elm_layout_edje_object_can_access_get(Evas_Object *obj)
-
-    void                elm_layout_icon_set(Evas_Object *obj, Evas_Object 
*icon)
-    Evas_Object *       elm_layout_icon_get(Evas_Object *obj)
-    void                elm_layout_end_set(Evas_Object *obj, Evas_Object *end)
-    Evas_Object *       elm_layout_end_get(Evas_Object *obj)
+    Eina_Bool       elm_layout_file_set(Evas_Object *obj, const_char *file, 
const_char *group)
+    int             elm_layout_freeze(Evas_Object *obj)
+    int             elm_layout_thaw(Evas_Object *obj)
+    Eina_Bool       elm_layout_theme_set(Evas_Object *obj, const_char *clas, 
const_char *group, const_char *style)
+    void            elm_layout_signal_emit(Evas_Object *obj, const_char 
*emission, const_char *source)
+    void            elm_layout_signal_callback_add(Evas_Object *obj, 
const_char *emission, const_char *source, Edje_Signal_Cb func, void *data)
+    void *          elm_layout_signal_callback_del(Evas_Object *obj, 
const_char *emission, const_char *source, Edje_Signal_Cb func)
+    Eina_Bool       elm_layout_box_append(Evas_Object *obj, const_char *part, 
Evas_Object *child)
+    Eina_Bool       elm_layout_box_prepend(Evas_Object *obj, const_char *part, 
Evas_Object *child)
+    Eina_Bool       elm_layout_box_insert_before(Evas_Object *obj, const_char 
*part, Evas_Object *child, Evas_Object *reference)
+    Eina_Bool       elm_layout_box_insert_at(Evas_Object *obj, const_char 
*part, Evas_Object *child, unsigned int pos)
+    Evas_Object *   elm_layout_box_remove(Evas_Object *obj, const_char *part, 
Evas_Object *child)
+    Eina_Bool       elm_layout_box_remove_all(Evas_Object *obj, const_char 
*part, Eina_Bool clear)
+    Eina_Bool       elm_layout_table_pack(Evas_Object *obj, const_char *part, 
Evas_Object *child_obj, unsigned short col, unsigned short row, unsigned short 
colspan, unsigned short rowspan)
+    Evas_Object *   elm_layout_table_unpack(Evas_Object *obj, const_char 
*part, Evas_Object *child_obj)
+    Eina_Bool       elm_layout_table_clear(Evas_Object *obj, const_char *part, 
Eina_Bool clear)
+    Evas_Object *   elm_layout_edje_get(Evas_Object *obj)
+    const_char *    elm_layout_data_get(Evas_Object *obj, const_char *key)
+    void            elm_layout_sizing_eval(Evas_Object *obj)
+    Eina_Bool       elm_layout_part_cursor_set(Evas_Object *obj, const_char 
*part_name, const_char *cursor)
+    const_char *    elm_layout_part_cursor_get(Evas_Object *obj, const_char 
*part_name)
+    Eina_Bool       elm_layout_part_cursor_unset(Evas_Object *obj, const_char 
*part_name)
+    Eina_Bool       elm_layout_part_cursor_style_set(Evas_Object *obj, 
const_char *part_name, const_char *style)
+    const_char *    elm_layout_part_cursor_style_get(Evas_Object *obj, 
const_char *part_name)
+    Eina_Bool       elm_layout_part_cursor_engine_only_set(Evas_Object *obj, 
const_char *part_name, Eina_Bool engine_only)
+    Eina_Bool       elm_layout_part_cursor_engine_only_get(Evas_Object *obj, 
const_char *part_name)
+    Eina_Bool       elm_layout_edje_object_can_access_set(Evas_Object *obj, 
Eina_Bool can_access)
+    Eina_Bool       elm_layout_edje_object_can_access_get(Evas_Object *obj)
+    Eina_List *     elm_layout_content_swallow_list_get(const_Evas_Object *obj)
+    void            elm_layout_icon_set(Evas_Object *obj, Evas_Object *icon)
+    Evas_Object *   elm_layout_icon_get(Evas_Object *obj)
+    void            elm_layout_end_set(Evas_Object *obj, Evas_Object *end)
+    Evas_Object *   elm_layout_end_get(Evas_Object *obj)
 
 cdef class LayoutClass(Object):
     cdef object _elm_layout_signal_cbs
diff --git a/efl/elementary/layout_class.pyx b/efl/elementary/layout_class.pyx
index 78116cb..5655acc 100644
--- a/efl/elementary/layout_class.pyx
+++ b/efl/elementary/layout_class.pyx
@@ -20,7 +20,7 @@ from cpython cimport PyUnicode_AsUTF8String
 
 from efl.eo cimport object_from_instance
 from efl.utils.conversions cimport _ctouni
-from efl.evas cimport Object as evasObject
+from efl.evas cimport Object as evasObject, eina_list_free
 from object cimport Object
 
 import traceback
@@ -925,6 +925,28 @@ cdef class LayoutClass(Object):
     def edje_object_can_access_get(self):
         return bool(elm_layout_edje_object_can_access_get(self.obj))
 
+    def content_swallow_list_get(self):
+        """content_swallow_list_get() -> list
+
+        Get the list of objects swallowed into the layout.
+
+        :return: a list of swallowed objects.
+        :rtype: list of objects.
+
+        .. versionadded:: 1.9
+        
+        """
+        cdef:
+            Eina_List *l = elm_layout_content_swallow_list_get(self.obj)
+            list ret = list()
+
+        while l:
+            ret.append(object_from_instance(<Evas_Object*>l.data))
+            l = l.next
+        eina_list_free(l)
+
+        return ret
+
     property icon:
         """The icon object in a layout that follows the Elementary naming
         convention for its parts.
diff --git a/examples/elementary/test_layout.py 
b/examples/elementary/test_layout.py
index fcadaaf..1ab7477 100644
--- a/examples/elementary/test_layout.py
+++ b/examples/elementary/test_layout.py
@@ -41,6 +41,9 @@ def layout_clicked(obj):
     ly.part_content_set("element3", bt)
     bt.show()
 
+    for o in ly.content_swallow_list_get():
+        print("Swallowed: " + str(o))
+
     win.show()
 
 

-- 


Reply via email to