From 2f4eb2cc2f23b807d3f989ea87382d902e3d69e0 Mon Sep 17 00:00:00 2001 From: barbieri Date: Mon, 22 Nov 2010 22:07:41 +0000 Subject: [PATCH] add missing edit method: edje_edit_font_path_get() git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@54836 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/Edje_Edit.h | 12 ++++++++++++ src/lib/edje_edit.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/src/lib/Edje_Edit.h b/src/lib/Edje_Edit.h index c996d6a..1ee7b4f 100644 --- a/src/lib/Edje_Edit.h +++ b/src/lib/Edje_Edit.h @@ -2316,6 +2316,18 @@ EAPI Eina_Bool edje_edit_font_add(Evas_Object *obj, const char *path, const char */ EAPI Eina_Bool edje_edit_font_del(Evas_Object *obj, const char* alias); +/** Get font path for a given font alias. + * + * Remember to free the string with edje_edit_string_free() + * + * @param obj Object being edited. + * @param alias The font alias. + * + * @return The path of the given font alias. + */ +EAPI const char *edje_edit_font_path_get(Evas_Object *obj, const char *alias); + + /** Get font name for a given part state. * * Remember to free the returned string using edje_edit_string_free(). diff --git a/src/lib/edje_edit.c b/src/lib/edje_edit.c index 7d641ea..249a9cb 100644 --- a/src/lib/edje_edit.c +++ b/src/lib/edje_edit.c @@ -4318,6 +4318,34 @@ edje_edit_font_del(Evas_Object *obj, const char* alias) } EAPI const char * +edje_edit_font_path_get(Evas_Object *obj, const char *alias) +{ + Eina_Iterator *it; + Edje_Font_Directory_Entry *f; + const char *str = NULL; + + eina_error_set(0); + + if (!alias) return NULL; + GET_ED_OR_RETURN(NULL); + + if (!ed->file || !ed->file->fonts) return NULL; + + it = eina_hash_iterator_data_new(ed->file->fonts); + if (!it) return NULL; + + EINA_ITERATOR_FOREACH(it, f) + if (!strcmp(f->entry, alias)) + { + str = f->file; + break; + } + + eina_iterator_free(it); + return eina_stringshare_add(str); +} + +EAPI const char * edje_edit_state_font_get(Evas_Object *obj, const char *part, const char *state, double value) { Edje_Part_Description_Text *txt; -- 2.7.4