summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2015-04-16 22:36:22 +0200
committerDave Andreoli <dave@gurumeditation.it>2015-04-16 22:36:22 +0200
commitb3833978c82c7b8445f51af576d7e8869560d426 (patch)
tree1fcaab2c97f5d89e5d15edadf39ec347c3aca6a3
parentf183fc171f314cdafe40a05c3d8fb57a13cf6134 (diff)
New 1.14 API: edje.text_class_get() and edje.Edje.text_class_get()
-rw-r--r--efl/edje/efl.edje.pyx23
-rw-r--r--efl/edje/efl.edje_object.pxi25
-rw-r--r--include/efl.edje.pxd2
3 files changed, 50 insertions, 0 deletions
diff --git a/efl/edje/efl.edje.pyx b/efl/edje/efl.edje.pyx
index 310acdb..b9201c6 100644
--- a/efl/edje/efl.edje.pyx
+++ b/efl/edje/efl.edje.pyx
@@ -206,6 +206,29 @@ def text_class_set(text_class, font, int size):
206 size) 206 size)
207 207
208 208
209def text_class_get(text_class):
210 """ Get the font and the font size from Edje text class.
211
212 This function gets the font and the font name from the specified Edje
213 text class.
214
215 :param string text_class: The text class name to query
216
217 :return: The font name and the font size
218 :rtype: (font_name, font_size)
219
220 .. versionadded:: 1.14
221
222 """
223 cdef:
224 const char *font
225 int size
226 if isinstance(text_class, unicode): text_class = PyUnicode_AsUTF8String(text_class)
227 edje_text_class_get(
228 <const char *>text_class if text_class is not None else NULL,
229 &font, &size)
230 return (_ctouni(font), size)
231
209def text_class_del(text_class): 232def text_class_del(text_class):
210 if isinstance(text_class, unicode): text_class = PyUnicode_AsUTF8String(text_class) 233 if isinstance(text_class, unicode): text_class = PyUnicode_AsUTF8String(text_class)
211 edje_text_class_del( 234 edje_text_class_del(
diff --git a/efl/edje/efl.edje_object.pxi b/efl/edje/efl.edje_object.pxi
index 41bc3be..0c54f1d 100644
--- a/efl/edje/efl.edje_object.pxi
+++ b/efl/edje/efl.edje_object.pxi
@@ -347,6 +347,31 @@ cdef class Edje(Object):
347 <const char *>font if font is not None else NULL, 347 <const char *>font if font is not None else NULL,
348 size) 348 size)
349 349
350 def text_class_get(self, text_class):
351 """ Gets font and font size from edje text class.
352
353 This function gets the font and the font size from the object
354 text class.
355
356 :param string text_class: The text class name to query
357
358 :return: The font name and the font size
359 :rtype: (font_name, font_size)
360
361 .. versionadded:: 1.14
362
363 """
364 cdef:
365 const char *font
366 int size
367 if isinstance(text_class, unicode):
368 text_class = PyUnicode_AsUTF8String(text_class)
369 edje_object_text_class_get(self.obj,
370 <const char *>text_class if text_class is not None else NULL,
371 &font, &size)
372 return (_ctouni(font), size)
373
374
350 property scale: 375 property scale:
351 """The scaling factor for a given Edje object. 376 """The scaling factor for a given Edje object.
352 377
diff --git a/include/efl.edje.pxd b/include/efl.edje.pxd
index ba1309f..4de9e08 100644
--- a/include/efl.edje.pxd
+++ b/include/efl.edje.pxd
@@ -321,6 +321,7 @@ cdef extern from "Edje.h":
321 Eina_List * edje_color_class_list() 321 Eina_List * edje_color_class_list()
322 322
323 void edje_text_class_set(char *text_class, char *font, Evas_Font_Size size) 323 void edje_text_class_set(char *text_class, char *font, Evas_Font_Size size)
324 Eina_Bool edje_text_class_get(const char *text_class, const char **font, Evas_Font_Size *size)
324 void edje_text_class_del(char *text_class) 325 void edje_text_class_del(char *text_class)
325 Eina_List * edje_text_class_list() 326 Eina_List * edje_text_class_list()
326 327
@@ -369,6 +370,7 @@ cdef extern from "Edje.h":
369 void edje_object_color_class_get(Evas_Object *obj, char *color_class, int *r, int *g, int *b, int *a, int *r2, int *g2, int *b2, int *a2, int *r3, int *g3, int *b3, int *a3) 370 void edje_object_color_class_get(Evas_Object *obj, char *color_class, int *r, int *g, int *b, int *a, int *r2, int *g2, int *b2, int *a2, int *r3, int *g3, int *b3, int *a3)
370 void edje_object_color_class_del(Evas_Object *obj, char *color_class) 371 void edje_object_color_class_del(Evas_Object *obj, char *color_class)
371 void edje_object_text_class_set(Evas_Object *obj, char *text_class, char *font, Evas_Font_Size size) 372 void edje_object_text_class_set(Evas_Object *obj, char *text_class, char *font, Evas_Font_Size size)
373 Eina_Bool edje_object_text_class_get(Evas_Object *obj, const char *text_class, const char **font, Evas_Font_Size *size)
372 374
373 void edje_object_size_min_get(Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh) 375 void edje_object_size_min_get(Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh)
374 void edje_object_size_max_get(Evas_Object *obj, Evas_Coord *maxw, Evas_Coord *maxh) 376 void edje_object_size_max_get(Evas_Object *obj, Evas_Coord *maxw, Evas_Coord *maxh)