From 861a0b6d55fb561af7c5c9e9ad92791d1477580b Mon Sep 17 00:00:00 2001 From: Vitalii Vorobiov Date: Tue, 23 Feb 2016 11:50:12 +0000 Subject: [PATCH] Edje_Edit: update source generation to print text classes --- src/lib/edje/edje_edit.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c index 5af8ebf..d9545bc 100644 --- a/src/lib/edje/edje_edit.c +++ b/src/lib/edje/edje_edit.c @@ -10986,6 +10986,25 @@ edje_edit_source_generate(Evas_Object *obj) BUF_APPEND(I0 "}\n\n"); } + if (ed->file->text_classes) + { + BUF_APPEND(I0 "text_classes {\n"); + Edje_Text_Class *tc; + + EINA_LIST_FOREACH(ed->file->text_classes, l, tc) + { + BUF_APPENDF(I1 "text_class {\n"); + BUF_APPENDF(I2 "name: \"%s\";\n", tc->name); + if (tc->font) + BUF_APPENDF(I2 "font: \"%s\";\n", tc->font); + if (tc->size > 0) + BUF_APPENDF(I2 "size: %d;\n", tc->size); + BUF_APPENDF(I1 "}\n"); + } + + BUF_APPEND(I0 "}\n\n"); + } + /* if images were found, print them */ if (images) { @@ -11039,6 +11058,7 @@ edje_edit_source_generate(Evas_Object *obj) eina_list_free(color_classes); } + /* print the main code of group collections */ BUF_APPEND(I0 "collections {\n"); /* if sounds were found, print them */ @@ -11103,6 +11123,28 @@ edje_edit_source_generate(Evas_Object *obj) #undef COLLECT_RESOURCE static Eina_Bool +_edje_generate_source_of_textclass(Edje *ed, const char *name, Eina_Strbuf *buf) +{ + Eina_List *l; + Edje_Text_Class *tc; + Eina_Bool ret = EINA_TRUE; + + EINA_LIST_FOREACH(ed->file->text_classes, l, tc) + if (!strcmp(tc->name, name)) + { + BUF_APPENDF(I1 "text_class {\n"); + BUF_APPENDF(I2 "name: \"%s\";\n", tc->name); + if (tc->font) + BUF_APPENDF(I2 "font: \"%s\";\n", tc->font); + if (tc->size > 0) + BUF_APPENDF(I2 "size: %d;\n", tc->size); + BUF_APPENDF(I1 "}\n"); + } + + return ret; +} + +static Eina_Bool _edje_generate_source_of_colorclass(Edje *ed, const char *name, Eina_Strbuf *buf) { Eina_List *l; @@ -12610,6 +12652,25 @@ _edje_generate_source(Evas_Object *obj) } } + /* Text Classes */ + if ((ll = edje_edit_text_classes_list_get(obj))) + { + BUF_APPEND(I0 "text_classes {\n"); + + EINA_LIST_FOREACH(ll, l, entry) + _edje_generate_source_of_textclass(ed, entry, buf); + + BUF_APPEND(I0 "}\n\n"); + edje_edit_string_list_free(ll); + + if (!ret) + { + ERR("Generating EDC for Text Classes"); + eina_strbuf_free(buf); + return NULL; + } + } + /* Color Classes */ if ((ll = edje_edit_color_classes_list_get(obj))) { -- 2.7.4