summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2015-08-03 18:53:19 +0200
committerDave Andreoli <dave@gurumeditation.it>2015-08-03 18:53:19 +0200
commit3de1d7be24840439bea5352b68236df5c44db859 (patch)
tree567852fb76451a3f3297e760ccdac0b8d191dc51
parent634c56d14ca142e46f9bcfc380aded081a5ef3be (diff)
New 1.15 API: evas.Textblock.obstacle_* functions
untested, but quite simple api, should work
-rw-r--r--efl/evas/efl.evas_object_textblock.pxi46
-rw-r--r--include/efl.evas.pxd3
2 files changed, 49 insertions, 0 deletions
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):
182 evas_object_textblock_style_insets_get(self.obj, &l, &r, &t, &b) 182 evas_object_textblock_style_insets_get(self.obj, &l, &r, &t, &b)
183 return (l, r, t, b) 183 return (l, r, t, b)
184 184
185 def obstacle_add(self, Object obstacle):
186 """
187 Add obstacle evas object to be observed during layout of text.
188 The textblock does the layout of the text according to the position
189 of the obstacle.
190
191 :param obstacle: An evas object to be used as an obstacle
192 :type obstacle: :class:`Object`
193
194 :return: ``True`` on success or ``False`` on failure
195 :rtype: bool
196
197 .. versionadded:: 1.15
198
199 """
200 return bool(evas_object_textblock_obstacle_add(self.obj, obstacle.obj))
201
202 def obstacle_del(self, Object obstacle):
203 """Removes an object from observation during text layout.
204
205 :param obstacle: An evas object to be removed as an obstacle
206 :type obstacle: :class:`Object`
207
208 :return: ``True`` on success or ``False`` on failure
209 :rtype: bool
210
211 .. versionadded:: 1.15
212
213
214 """
215 return bool(evas_object_textblock_obstacle_del(self.obj, obstacle.obj))
216
217 def obstacles_update(self):
218 """Triggers for relayout due to obstacles' state change.
219
220 The obstacles alone don't affect the layout, until this is called. Use
221 this after doing changes (moving, positioning etc.) in the obstacles
222 that you would like to be considered in the layout. For example: if you
223 have just repositioned the obstacles to differrent coordinates relative
224 to the textblock, you need to call this so it will consider this new
225 state and will relayout the text.
226
227 .. versionadded:: 1.15
228
229 """
230 evas_object_textblock_obstacles_update(self.obj)
185 231
186_object_mapping_register("Evas_Textblock", Textblock) 232_object_mapping_register("Evas_Textblock", Textblock)
187 233
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":
1027 void evas_object_textblock_size_formatted_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) 1027 void evas_object_textblock_size_formatted_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
1028 void evas_object_textblock_size_native_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) 1028 void evas_object_textblock_size_native_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
1029 void evas_object_textblock_style_insets_get(const Evas_Object *obj, Evas_Coord *l, Evas_Coord *r, Evas_Coord *t, Evas_Coord *b) 1029 void evas_object_textblock_style_insets_get(const Evas_Object *obj, Evas_Coord *l, Evas_Coord *r, Evas_Coord *t, Evas_Coord *b)
1030 Eina_Bool evas_object_textblock_obstacle_add(const Evas_Object *obj, Evas_Object *obstacle)
1031 Eina_Bool evas_object_textblock_obstacle_del(const Evas_Object *obj, Evas_Object *obstacle)
1032 Eina_Bool evas_object_textblock_obstacles_update(const Evas_Object *obj)
1030 1033
1031 1034
1032 #################################################################### 1035 ####################################################################