forked from enlightenment/efl
edje: filter means, we can't change any state when we check for match. Delay, we should.
SVN revision: 67763
This commit is contained in:
parent
26c7ebd1e7
commit
ed1558ff84
|
@ -327,4 +327,5 @@
|
|||
|
||||
* Fix bug when using EDJE_CALC_CACHE and using relative to x and y
|
||||
on separate part.
|
||||
* Fix bug with filter preventing any action to be triggered.
|
||||
|
||||
|
|
|
@ -613,6 +613,8 @@ struct _Edje_Program /* a conditional program to be run */
|
|||
int src; /* part where parameter is being retrieved */
|
||||
int dst; /* part where parameter is being stored */
|
||||
} param;
|
||||
|
||||
Eina_Bool exec : 1;
|
||||
};
|
||||
|
||||
struct _Edje_Program_Target /* the target of an action */
|
||||
|
|
|
@ -1039,10 +1039,8 @@ struct _Edje_Program_Data
|
|||
{
|
||||
#ifdef EDJE_PROGRAM_CACHE
|
||||
Eina_List *matches;
|
||||
int matched;
|
||||
#endif
|
||||
Edje *ed;
|
||||
const char *signal;
|
||||
const char *source;
|
||||
};
|
||||
|
||||
|
@ -1059,21 +1057,7 @@ static Eina_Bool _edje_glob_callback(Edje_Program *pr, void *dt)
|
|||
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);
|
||||
|
@ -1082,7 +1066,6 @@ static Eina_Bool _edje_glob_callback(Edje_Program *pr, void *dt)
|
|||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_edje_callbacks_patterns_clean(Edje *ed)
|
||||
{
|
||||
|
@ -1169,15 +1152,12 @@ _edje_emit_handle(Edje *ed, const char *sig, const char *src,
|
|||
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
|
||||
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);
|
||||
|
@ -1186,7 +1166,19 @@ _edje_emit_handle(Edje *ed, const char *sig, const char *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;
|
||||
}
|
||||
}
|
||||
|
@ -1197,9 +1189,7 @@ _edje_emit_handle(Edje *ed, const char *sig, const char *src,
|
|||
|
||||
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)
|
||||
|
@ -1223,12 +1213,31 @@ _edje_emit_handle(Edje *ed, const char *sig, const char *src,
|
|||
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);
|
||||
|
|
Loading…
Reference in New Issue