parent
53f435f62b
commit
06ea50650b
|
@ -184,6 +184,8 @@ extern "C" {
|
|||
EAPI void edje_color_class_del(const char *color_class);
|
||||
EAPI Evas_List * edje_color_class_list(void);
|
||||
EAPI void edje_text_class_set(const char *text_class, const char *font, Evas_Font_Size size);
|
||||
EAPI void edje_text_class_del(const char *text_class);
|
||||
EAPI Evas_List * edje_text_class_list(void);
|
||||
EAPI void edje_extern_object_min_size_set (Evas_Object *obj, Evas_Coord minw, Evas_Coord minh);
|
||||
EAPI void edje_extern_object_max_size_set (Evas_Object *obj, Evas_Coord maxw, Evas_Coord maxh);
|
||||
EAPI void edje_extern_object_aspect_set(Evas_Object *obj, Edje_Aspect_Control aspect, Evas_Coord aw, Evas_Coord ah);
|
||||
|
|
|
@ -20,6 +20,7 @@ struct _Edje_List_Foreach_Data
|
|||
};
|
||||
|
||||
static Evas_Bool _edje_color_class_list_foreach(Evas_Hash *hash, const char *key, void *data, void *fdata);
|
||||
static Evas_Bool _edje_text_class_list_foreach(Evas_Hash *hash, const char *key, void *data, void *fdata);
|
||||
|
||||
/************************** API Routines **************************/
|
||||
|
||||
|
@ -484,6 +485,71 @@ edje_text_class_set(const char *text_class, const char *font, Evas_Font_Size siz
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param text_class
|
||||
*
|
||||
* Deletes any values at the process level for the specified text class.
|
||||
*/
|
||||
void
|
||||
edje_text_class_del(const char *text_class)
|
||||
{
|
||||
Edje_Text_Class *tc;
|
||||
Evas_List *members;
|
||||
|
||||
if (!text_class) return;
|
||||
|
||||
tc = evas_hash_find(_edje_text_class_hash, text_class);
|
||||
if (!tc) return;
|
||||
|
||||
_edje_text_class_hash = evas_hash_del(_edje_text_class_hash, text_class, tc);
|
||||
evas_stringshare_del(tc->name);
|
||||
evas_stringshare_del(tc->font);
|
||||
free(tc);
|
||||
|
||||
members = evas_hash_find(_edje_text_class_member_hash, text_class);
|
||||
while (members)
|
||||
{
|
||||
Edje *ed;
|
||||
|
||||
ed = members->data;
|
||||
ed->dirty = 1;
|
||||
_edje_textblock_style_all_update(ed);
|
||||
_edje_recalc(ed);
|
||||
members = members->next;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all text classes known about by the current process.
|
||||
*
|
||||
* @return A list of text class names (strings). These strings are stringshares and
|
||||
* the list must be free()'d by the caller.
|
||||
*/
|
||||
Evas_List *
|
||||
edje_text_class_list(void)
|
||||
{
|
||||
Edje_List_Foreach_Data *fdata;
|
||||
Evas_List *list;
|
||||
|
||||
fdata = calloc(1, sizeof(Edje_List_Foreach_Data));
|
||||
evas_hash_foreach(_edje_text_class_member_hash, _edje_text_class_list_foreach, fdata);
|
||||
|
||||
list = fdata->list;
|
||||
free(fdata);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
static Evas_Bool
|
||||
_edje_text_class_list_foreach(Evas_Hash *hash, const char *key, void *data, void *fdata)
|
||||
{
|
||||
Edje_List_Foreach_Data *fd;
|
||||
|
||||
fd = fdata;
|
||||
fd->list = evas_list_append(fd->list, evas_stringshare_add(key));
|
||||
return 1;
|
||||
}
|
||||
|
||||
/** Sets Edje text class
|
||||
* @param obj A valid Evas_Object handle
|
||||
* @param text_class The text class name
|
||||
|
|
Loading…
Reference in New Issue