diff options
author | Vitalii Vorobiov <vi.vorobiov@samsung.com> | 2016-02-23 11:50:12 +0000 |
---|---|---|
committer | Vitalii Vorobiov <vi.vorobiov@samsung.com> | 2016-02-23 14:02:57 +0000 |
commit | 861a0b6d55fb561af7c5c9e9ad92791d1477580b (patch) | |
tree | d45c940ed2388fe4395a98d28f2dac3f2ee567fc | |
parent | 559cf1e73c6efe8a38ce7b1165ec0191284c6e78 (diff) | |
download | efl-861a0b6d55fb561af7c5c9e9ad92791d1477580b.tar.gz |
Edje_Edit: update source generation to print text classes
-rw-r--r-- | src/lib/edje/edje_edit.c | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c index 5af8ebfc9c..d9545bcc8a 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))) { |