diff --git a/legacy/edje/src/bin/edje_cc.h b/legacy/edje/src/bin/edje_cc.h index c76795804f..5245448e5b 100644 --- a/legacy/edje/src/bin/edje_cc.h +++ b/legacy/edje/src/bin/edje_cc.h @@ -78,6 +78,7 @@ struct _Code { int l1, l2; char *shared; + char *original; Eina_List *programs; int is_lua; }; @@ -87,6 +88,7 @@ struct _Code_Program int l1, l2; int id; char *script; + char *original; }; struct _SrcFile diff --git a/legacy/edje/src/bin/edje_cc_handlers.c b/legacy/edje/src/bin/edje_cc_handlers.c index 558b3a7a72..30f06e9aa6 100644 --- a/legacy/edje/src/bin/edje_cc_handlers.c +++ b/legacy/edje/src/bin/edje_cc_handlers.c @@ -1937,6 +1937,7 @@ ob_collections_group_script(void) exit(-1); } cd->shared = s; + cd->original = strdup(s); cd->is_lua = 0; set_verbatim(NULL, 0, 0); } @@ -7026,6 +7027,7 @@ ob_collections_group_programs_program_script(void) cp->l1 = get_verbatim_line1(); cp->l2 = get_verbatim_line2(); cp->script = s; + cp->original = strdup(s); if (cd->shared && cd->is_lua) { ERR("%s: Error. parse error %s:%i. You're trying to mix Embryo and Lua scripting in the same group", diff --git a/legacy/edje/src/bin/edje_cc_out.c b/legacy/edje/src/bin/edje_cc_out.c index ecaaa40d64..bd332dc217 100644 --- a/legacy/edje/src/bin/edje_cc_out.c +++ b/legacy/edje/src/bin/edje_cc_out.c @@ -848,8 +848,11 @@ data_write_scripts(Eet_File *ef) { char tmpn[PATH_MAX]; char tmpo[PATH_MAX]; + char buf[PATH_MAX]; int fd; Code *cd = eina_list_data_get(l); + Eina_List *ll; + Code_Program *cp; if (cd->is_lua) continue; @@ -879,6 +882,20 @@ data_write_scripts(Eet_File *ef) unlink(tmpn); unlink(tmpo); + + if (cd->original) + { + snprintf(buf, PATH_MAX, "edje/scripts/embryo/source/%i", i); + eet_write(ef, buf, cd->original, strlen(cd->original) + 1, 1); + } + EINA_LIST_FOREACH(cd->programs, ll, cp) + { + if (!cp->original) + continue; + snprintf(buf, PATH_MAX, "edje/scripts/embryo/source/%i/%i", i, + cp->id); + eet_write(ef, buf, cp->original, strlen(cp->original) + 1, 1); + } } }