add missing edit method: edje_edit_font_path_get()
authorbarbieri <barbieri@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 22 Nov 2010 22:07:41 +0000 (22:07 +0000)
committerbarbieri <barbieri@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 22 Nov 2010 22:07:41 +0000 (22:07 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@54836 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/Edje_Edit.h
src/lib/edje_edit.c

index c996d6a..1ee7b4f 100644 (file)
@@ -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().
index 7d641ea..249a9cb 100644 (file)
@@ -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;