davemds pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=3de1d7be24840439bea5352b68236df5c44db859

commit 3de1d7be24840439bea5352b68236df5c44db859
Author: Dave Andreoli <d...@gurumeditation.it>
Date:   Mon Aug 3 18:53:19 2015 +0200

    New 1.15 API: evas.Textblock.obstacle_* functions
    
    untested, but quite simple api, should work
---
 efl/evas/efl.evas_object_textblock.pxi | 46 ++++++++++++++++++++++++++++++++++
 include/efl.evas.pxd                   |  3 +++
 2 files changed, 49 insertions(+)

diff --git a/efl/evas/efl.evas_object_textblock.pxi 
b/efl/evas/efl.evas_object_textblock.pxi
index 6847848..62233c0 100644
--- a/efl/evas/efl.evas_object_textblock.pxi
+++ b/efl/evas/efl.evas_object_textblock.pxi
@@ -182,6 +182,52 @@ cdef class Textblock(Object):
         evas_object_textblock_style_insets_get(self.obj, &l, &r, &t, &b)
         return (l, r, t, b)
 
+    def obstacle_add(self, Object obstacle):
+        """
+        Add obstacle evas object to be observed during layout of text.
+        The textblock does the layout of the text according to the position
+        of the obstacle.
+
+        :param obstacle: An evas object to be used as an obstacle
+        :type obstacle: :class:`Object`
+
+        :return: ``True`` on success or ``False`` on failure
+        :rtype: bool
+
+        .. versionadded:: 1.15
+
+        """
+        return bool(evas_object_textblock_obstacle_add(self.obj, obstacle.obj))
+
+    def obstacle_del(self, Object obstacle):
+        """Removes an object from observation during text layout.
+
+        :param obstacle: An evas object to be removed as an obstacle
+        :type obstacle: :class:`Object`
+
+        :return: ``True`` on success or ``False`` on failure
+        :rtype: bool
+
+        .. versionadded:: 1.15
+
+
+        """
+        return bool(evas_object_textblock_obstacle_del(self.obj, obstacle.obj))
+
+    def obstacles_update(self):
+        """Triggers for relayout due to obstacles' state change. 
+
+        The obstacles alone don't affect the layout, until this is called. Use 
+        this after doing changes (moving, positioning etc.) in the obstacles 
+        that you would like to be considered in the layout. For example: if 
you 
+        have just repositioned the obstacles to differrent coordinates 
relative 
+        to the textblock, you need to call this so it will consider this new 
+        state and will relayout the text.
+
+        .. versionadded:: 1.15
+
+        """
+        evas_object_textblock_obstacles_update(self.obj)
 
 _object_mapping_register("Evas_Textblock", Textblock)
 
diff --git a/include/efl.evas.pxd b/include/efl.evas.pxd
index 98d13bd..6eac7ba 100644
--- a/include/efl.evas.pxd
+++ b/include/efl.evas.pxd
@@ -1027,6 +1027,9 @@ cdef extern from "Evas.h":
     void evas_object_textblock_size_formatted_get(const Evas_Object *obj, 
Evas_Coord *w, Evas_Coord *h)
     void evas_object_textblock_size_native_get(const Evas_Object *obj, 
Evas_Coord *w, Evas_Coord *h)
     void evas_object_textblock_style_insets_get(const Evas_Object *obj, 
Evas_Coord *l, Evas_Coord *r, Evas_Coord *t, Evas_Coord *b)
+    Eina_Bool evas_object_textblock_obstacle_add(const Evas_Object *obj, 
Evas_Object *obstacle)
+    Eina_Bool evas_object_textblock_obstacle_del(const Evas_Object *obj, 
Evas_Object *obstacle)
+    Eina_Bool evas_object_textblock_obstacles_update(const Evas_Object *obj)
 
 
     ####################################################################

-- 


Reply via email to