New 1.14 API: edje.text_class_get() and edje.Edje.text_class_get()

This commit is contained in:
Davide Andreoli 2015-04-16 22:36:22 +02:00
parent f183fc171f
commit b3833978c8
3 changed files with 50 additions and 0 deletions

View File

@ -206,6 +206,29 @@ def text_class_set(text_class, font, int size):
size)
def text_class_get(text_class):
""" Get the font and the font size from Edje text class.
This function gets the font and the font name from the specified Edje
text class.
:param string text_class: The text class name to query
:return: The font name and the font size
:rtype: (font_name, font_size)
.. versionadded:: 1.14
"""
cdef:
const char *font
int size
if isinstance(text_class, unicode): text_class = PyUnicode_AsUTF8String(text_class)
edje_text_class_get(
<const char *>text_class if text_class is not None else NULL,
&font, &size)
return (_ctouni(font), size)
def text_class_del(text_class):
if isinstance(text_class, unicode): text_class = PyUnicode_AsUTF8String(text_class)
edje_text_class_del(

View File

@ -347,6 +347,31 @@ cdef class Edje(Object):
<const char *>font if font is not None else NULL,
size)
def text_class_get(self, text_class):
""" Gets font and font size from edje text class.
This function gets the font and the font size from the object
text class.
:param string text_class: The text class name to query
:return: The font name and the font size
:rtype: (font_name, font_size)
.. versionadded:: 1.14
"""
cdef:
const char *font
int size
if isinstance(text_class, unicode):
text_class = PyUnicode_AsUTF8String(text_class)
edje_object_text_class_get(self.obj,
<const char *>text_class if text_class is not None else NULL,
&font, &size)
return (_ctouni(font), size)
property scale:
"""The scaling factor for a given Edje object.

View File

@ -321,6 +321,7 @@ cdef extern from "Edje.h":
Eina_List * edje_color_class_list()
void edje_text_class_set(char *text_class, char *font, Evas_Font_Size size)
Eina_Bool edje_text_class_get(const char *text_class, const char **font, Evas_Font_Size *size)
void edje_text_class_del(char *text_class)
Eina_List * edje_text_class_list()
@ -369,6 +370,7 @@ cdef extern from "Edje.h":
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)
void edje_object_color_class_del(Evas_Object *obj, char *color_class)
void edje_object_text_class_set(Evas_Object *obj, char *text_class, char *font, Evas_Font_Size size)
Eina_Bool edje_object_text_class_get(Evas_Object *obj, const char *text_class, const char **font, Evas_Font_Size *size)
void edje_object_size_min_get(Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh)
void edje_object_size_max_get(Evas_Object *obj, Evas_Coord *maxw, Evas_Coord *maxh)