{
#ifdef EDJE_PROGRAM_CACHE
Eina_List *matches;
- int matched;
#endif
Edje *ed;
- const char *signal;
const char *source;
};
{
rp = _edje_real_part_get(data->ed, pr->filter.part ? pr->filter.part : data->source);
if (rp)
- exec = (rp->chosen_description->state.name == pr->filter.state);
+ exec = (rp->chosen_description->state.name == pr->filter.state);
}
-#ifdef EDJE_PROGRAM_CACHE
- data->matched++;
-#endif
-
- if (exec)
- _edje_program_run(data->ed, pr, 0, data->signal, data->source);
-
- if (_edje_block_break(data->ed))
- {
-#ifdef EDJE_PROGRAM_CACHE
- eina_list_free(data->matches);
- data->matches = NULL;
-#endif
- return EINA_TRUE;
- }
+ pr->exec = exec;
#ifdef EDJE_PROGRAM_CACHE
data->matches = eina_list_append(data->matches, pr);
return EINA_FALSE;
}
-
void
_edje_callbacks_patterns_clean(Edje *ed)
{
if (ed->collection && ed->L)
_edje_lua2_script_func_signal(ed, sig, src);
-
+
if (ed->collection)
{
#ifdef EDJE_PROGRAM_CACHE
if (eina_hash_find(ec->prog_cache.no_matches, tmps))
{
- done = 1;
+ done = 1;
}
else if ((matches = eina_hash_find(ec->prog_cache.matches, tmps)))
{
- EINA_LIST_FOREACH(matches, l, pr)
+ EINA_LIST_FOREACH(matches, l, pr)
{
Eina_Bool exec = EINA_TRUE;
Edje_Real_Part *rp;
rp = _edje_real_part_get(ed, pr->filter.part ? pr->filter.part : src);
- if (rp)
- {
- if (rp->program)
- exec = EINA_FALSE;
- else
- exec = (rp->chosen_description->state.name == pr->filter.state);
- }
+ if (rp && !rp->program)
+ exec = (rp->chosen_description->state.name == pr->filter.state);
}
+ pr->exec = exec;
+#if 0
if (exec)
{
_edje_program_run(ed, pr, 0, sig, src);
goto break_prog;
}
}
+#endif
}
+
+ EINA_LIST_FOREACH(matches, l, pr)
+ if (pr->exec)
+ {
+ _edje_program_run(ed, pr, 0, sig, src);
+ if (_edje_block_break(ed))
+ {
+ goto break_prog;
+ }
+ }
+
done = 1;
}
}
data.ed = ed;
data.source = src;
- data.signal = sig;
#ifdef EDJE_PROGRAM_CACHE
- data.matched = 0;
data.matches = NULL;
#endif
if (ed->table_programs_size > 0)
ed->patterns.programs.exact_match);
EINA_LIST_FOREACH(match, l, pr)
_edje_glob_callback(pr, &data);
+
+#ifdef EDJE_PROGRAM_CACHE
+ EINA_LIST_FOREACH(data.matches, l, pr)
+#else
+ EINA_LIST_FREE(data.matches, pr)
+#endif
+ {
+ if (pr->exec)
+ _edje_program_run(ed, pr, 0, sig, src);
+
+ if (_edje_block_break(ed))
+ {
+#ifdef EDJE_PROGRAM_CACHE
+ eina_list_free(data.matches);
+ data.matches = NULL;
+#endif
+ goto break_prog;
+ }
+ }
}
#ifdef EDJE_PROGRAM_CACHE
if (tmps)
{
- if (data.matched == 0)
+ if (data.matches == NULL)
{
if (!ec->prog_cache.no_matches)
ec->prog_cache.no_matches = eina_hash_string_superfast_new(NULL);