edje: Edje_Edit - add data items into generated code for the group.

Summary:
Include data items, that present in edje object.
Data items, which data ends with '\n' recognized as data.file item and not included into the generated source code.
@fix

Reviewers: Hermet, reutskiy.v.v, raster, cedric

Reviewed By: cedric

Subscribers: cedric

Projects: #efl

Differential Revision: https://phab.enlightenment.org/D1858

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
Mykyta Biliavskyi 2015-03-13 09:43:11 +01:00 committed by Cedric BAIL
parent 1689564958
commit 1690c58680
1 changed files with 29 additions and 0 deletions

View File

@ -10154,6 +10154,35 @@ edje_edit_source_generate(Evas_Object *obj)
buf = eina_strbuf_new();
/* If data items exist, print them */
if (ed->file->data)
{
Edje_String *es;
size_t data_len = 0;
char *escaped_entry = NULL;
char *escaped_string = NULL;
BUF_APPEND(I0 "data {\n");
Eina_Iterator *it = eina_hash_iterator_key_new(ed->file->data);
EINA_ITERATOR_FOREACH(it, entry)
{
es = eina_hash_find(ed->file->data, entry);
str = edje_string_get(es);
data_len = strlen(str);
/* In case when data ends with '\n' character, this item recognize
* as data.file. This data will not generated into the source code
* of group. */
if (str[data_len - 1] == '\n') continue;
escaped_entry = eina_str_escape(entry);
escaped_string = eina_str_escape(str);
BUF_APPENDF(I1"item: \"%s\" \"%s\";\n", escaped_entry, escaped_string);
free(escaped_entry);
free(escaped_string);
}
eina_iterator_free(it);
BUF_APPEND(I0 "}\n\n");
}
/* if images were found, print them */
if (images)
{