* edje: add back anonymous script.

SVN revision: 51617
devs/devilhorns/wayland_egl
Cedric BAIL 13 years ago
parent 1959f2cfa7
commit b10e598f52
  1. 1
      legacy/edje/src/bin/edje_cc.h
  2. 4
      legacy/edje/src/bin/edje_cc_handlers.c
  3. 44
      legacy/edje/src/bin/edje_cc_out.c

@ -105,6 +105,7 @@ void data_setup(void);
void data_write(void);
void data_queue_part_lookup(Edje_Part_Collection *pc, const char *name, int *dest);
void data_queue_program_lookup(Edje_Part_Collection *pc, const char *name, int *dest);
void data_queue_anonymous_lookup(Edje_Part_Collection *pc, Edje_Program *ep, int *dest);
void data_queue_image_lookup(char *name, int *dest, Eina_Bool *set);
void data_queue_part_slave_lookup(int *master, int *slave);
void data_queue_image_slave_lookup(int *master, int *slave);

@ -7050,7 +7050,7 @@ ob_collections_group_programs_program_script(void)
}
cd->is_lua = 0;
cd->programs = eina_list_append(cd->programs, cp);
data_queue_program_lookup(pc, current_program->name, &(cp->id));
data_queue_anonymous_lookup(pc, current_program, &(cp->id));
set_verbatim(NULL, 0, 0);
current_program->action = EDJE_ACTION_TYPE_SCRIPT;
@ -7089,7 +7089,7 @@ ob_collections_group_programs_program_lua_script(void)
}
cd->is_lua = 1;
cd->programs = eina_list_append(cd->programs, cp);
data_queue_program_lookup(pc, current_program->name, &(cp->id));
data_queue_anonymous_lookup(pc, current_program, &(cp->id));
set_verbatim(NULL, 0, 0);
current_program->action = EDJE_ACTION_TYPE_LUA_SCRIPT;
}

@ -57,8 +57,16 @@ struct _Part_Lookup
struct _Program_Lookup
{
Edje_Part_Collection *pc;
char *name;
union
{
char *name;
Edje_Program *ep;
} u;
int *dest;
Eina_Bool anonymous : 1;
};
struct _Group_Lookup
@ -1117,16 +1125,34 @@ data_queue_part_lookup(Edje_Part_Collection *pc, const char *name, int *dest)
pl->dest = dest;
}
void
data_queue_anonymous_lookup(Edje_Part_Collection *pc, Edje_Program *ep, int *dest)
{
Program_Lookup *pl;
if (!ep) return ; /* FIXME: should we stop compiling ? */
pl = mem_alloc(SZ(Program_Lookup));
program_lookups = eina_list_append(program_lookups, pl);
pl->pc = pc;
pl->u.ep = ep;
pl->dest = dest;
pl->anonymous = EINA_TRUE;
}
void
data_queue_program_lookup(Edje_Part_Collection *pc, const char *name, int *dest)
{
Program_Lookup *pl;
if (!name) return ; /* FIXME: should we stop compiling ? */
pl = mem_alloc(SZ(Program_Lookup));
program_lookups = eina_list_append(program_lookups, pl);
pl->pc = pc;
pl->name = mem_strdup(name);
pl->u.name = mem_strdup(name);
pl->dest = dest;
pl->anonymous = EINA_FALSE;
}
void
@ -1245,7 +1271,8 @@ data_process_lookups(void)
\
ep = Pl->pc->programs.Type[It]; \
\
if ((ep->name) && (!strcmp(ep->name, Pl->name))) \
if ((Pl->anonymous && ep == Pl->u.ep) || \
((!Pl->anonymous) && (ep->name) && (!strcmp(ep->name, Pl->u.name)))) \
{ \
*(Pl->dest) = ep->id; \
find = EINA_TRUE; \
@ -1263,12 +1290,17 @@ data_process_lookups(void)
if (!find)
{
ERR("%s: Error. Unable to find program name \"%s\".",
progname, program->name);
if (!program->anonymous)
ERR("%s: Error. Unable to find program name \"%s\".",
progname, program->u.name);
else
ERR("%s: Error. Unable to find anonymous program.",
progname);
exit(-1);
}
free(program->name);
if (!program->anonymous)
free(program->u.name);
free(program);
}

Loading…
Cancel
Save