Make edje_cc store script source snippets (only embryo now) in the generated file.

Yeah... yeah... we are on a freeze and we aren't supposed to be doing things like this, but it's not change anything other than allow edje_edit to know about scripts in order to not screw them up when modifying a file.


SVN revision: 55088
devs/devilhorns/wayland_egl
Iván Briano 12 years ago
parent d3e3b86e29
commit 3f6ada804f
  1. 2
      legacy/edje/src/bin/edje_cc.h
  2. 2
      legacy/edje/src/bin/edje_cc_handlers.c
  3. 17
      legacy/edje/src/bin/edje_cc_out.c

@ -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

@ -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",

@ -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);
}
}
}

Loading…
Cancel
Save