forked from enlightenment/efl
edje: switch to use per window animator.
This commit is contained in:
parent
0812fc8f6c
commit
a13752dcc7
|
@ -374,27 +374,21 @@ _edje_mouse_wheel_signal_cb(void *data, Eo *obj, const Eo_Event_Description *des
|
||||||
}
|
}
|
||||||
|
|
||||||
Eina_Bool
|
Eina_Bool
|
||||||
_edje_timer_cb(void *data EINA_UNUSED)
|
_edje_timer_cb(void *data,
|
||||||
|
Eo *obj EINA_UNUSED,
|
||||||
|
const Eo_Event_Description *desc EINA_UNUSED,
|
||||||
|
void *event_info EINA_UNUSED) // FIXME: figure out how to use event_info
|
||||||
{
|
{
|
||||||
double t;
|
double t;
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
Eina_List *animl = NULL;
|
Eina_List *newl = NULL;
|
||||||
Edje *ed;
|
Edje *ed = data;
|
||||||
|
|
||||||
t = ecore_loop_time_get();
|
t = ecore_loop_time_get();
|
||||||
EINA_LIST_FOREACH(_edje_animators, l, ed)
|
|
||||||
{
|
|
||||||
_edje_ref(ed);
|
_edje_ref(ed);
|
||||||
animl = eina_list_append(animl, ed);
|
|
||||||
}
|
|
||||||
while (animl)
|
|
||||||
{
|
|
||||||
Eina_List *newl = NULL;
|
|
||||||
|
|
||||||
ed = eina_list_data_get(animl);
|
|
||||||
_edje_block(ed);
|
_edje_block(ed);
|
||||||
_edje_util_freeze(ed);
|
_edje_util_freeze(ed);
|
||||||
animl = eina_list_remove(animl, eina_list_data_get(animl));
|
|
||||||
if ((!ed->paused) && (!ed->delete_me))
|
if ((!ed->paused) && (!ed->delete_me))
|
||||||
{
|
{
|
||||||
const void *tmp;
|
const void *tmp;
|
||||||
|
@ -427,12 +421,7 @@ _edje_timer_cb(void *data EINA_UNUSED)
|
||||||
newl = eina_list_remove(newl, eina_list_data_get(newl));
|
newl = eina_list_remove(newl, eina_list_data_get(newl));
|
||||||
if (runp->delete_me)
|
if (runp->delete_me)
|
||||||
{
|
{
|
||||||
_edje_anim_count--;
|
_edje_program_run_cleanup(ed, runp);
|
||||||
runp->edje->actions =
|
|
||||||
eina_list_remove(runp->edje->actions, runp);
|
|
||||||
if (!runp->edje->actions)
|
|
||||||
_edje_animators =
|
|
||||||
eina_list_remove(_edje_animators, runp->edje);
|
|
||||||
free(runp);
|
free(runp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -442,10 +431,8 @@ break_prog:
|
||||||
_edje_unblock(ed);
|
_edje_unblock(ed);
|
||||||
_edje_util_thaw(ed);
|
_edje_util_thaw(ed);
|
||||||
_edje_unref(ed);
|
_edje_unref(ed);
|
||||||
}
|
|
||||||
if (_edje_anim_count > 0) return ECORE_CALLBACK_RENEW;
|
return EO_CALLBACK_CONTINUE;
|
||||||
_edje_timer = NULL;
|
|
||||||
return ECORE_CALLBACK_CANCEL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Eina_Bool
|
Eina_Bool
|
||||||
|
|
|
@ -1641,17 +1641,18 @@ _edje_file_del(Edje *ed)
|
||||||
_edje_cache_file_unref(ed->file);
|
_edje_cache_file_unref(ed->file);
|
||||||
ed->file = NULL;
|
ed->file = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Cleanup all animator
|
||||||
if (ed->actions)
|
if (ed->actions)
|
||||||
{
|
{
|
||||||
Edje_Running_Program *runp;
|
Edje_Running_Program *runp;
|
||||||
|
|
||||||
EINA_LIST_FREE(ed->actions, runp)
|
EINA_LIST_FREE(ed->actions, runp)
|
||||||
{
|
|
||||||
_edje_anim_count--;
|
|
||||||
free(runp);
|
free(runp);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
_edje_animators = eina_list_remove(_edje_animators, ed);
|
_edje_animators = eina_list_remove(_edje_animators, ed);
|
||||||
|
eo_do(ed->obj, eo_event_callback_del(EFL_CORE_ANIMATOR_EVENT_ANIMATOR_TICK, _edje_timer_cb, ed));
|
||||||
|
|
||||||
if (ed->pending_actions)
|
if (ed->pending_actions)
|
||||||
{
|
{
|
||||||
Edje_Pending_Program *pp;
|
Edje_Pending_Program *pp;
|
||||||
|
|
|
@ -233,12 +233,6 @@ edje_shutdown(void)
|
||||||
if (--_edje_init_count != 0)
|
if (--_edje_init_count != 0)
|
||||||
return _edje_init_count;
|
return _edje_init_count;
|
||||||
|
|
||||||
if (_edje_timer)
|
|
||||||
{
|
|
||||||
ecore_animator_del(_edje_timer);
|
|
||||||
_edje_timer = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
_edje_shutdown_core();
|
_edje_shutdown_core();
|
||||||
|
|
||||||
return _edje_init_count;
|
return _edje_init_count;
|
||||||
|
@ -248,8 +242,6 @@ edje_shutdown(void)
|
||||||
void
|
void
|
||||||
_edje_del(Edje *ed)
|
_edje_del(Edje *ed)
|
||||||
{
|
{
|
||||||
Edje_Running_Program *runp;
|
|
||||||
Edje_Pending_Program *pp;
|
|
||||||
Edje_Text_Insert_Filter_Callback *cb;
|
Edje_Text_Insert_Filter_Callback *cb;
|
||||||
|
|
||||||
if (ed->processing_messages)
|
if (ed->processing_messages)
|
||||||
|
@ -265,14 +257,6 @@ _edje_del(Edje *ed)
|
||||||
if (ed->parent) eina_stringshare_del(ed->parent);
|
if (ed->parent) eina_stringshare_del(ed->parent);
|
||||||
ed->path = NULL;
|
ed->path = NULL;
|
||||||
ed->group = NULL;
|
ed->group = NULL;
|
||||||
if ((ed->actions) || (ed->pending_actions))
|
|
||||||
{
|
|
||||||
_edje_animators = eina_list_remove(_edje_animators, ed);
|
|
||||||
}
|
|
||||||
EINA_LIST_FREE(ed->actions, runp)
|
|
||||||
free(runp);
|
|
||||||
EINA_LIST_FREE(ed->pending_actions, pp)
|
|
||||||
free(pp);
|
|
||||||
eina_hash_free(ed->color_classes);
|
eina_hash_free(ed->color_classes);
|
||||||
eina_hash_free(ed->text_classes);
|
eina_hash_free(ed->text_classes);
|
||||||
eina_hash_free(ed->size_classes);
|
eina_hash_free(ed->size_classes);
|
||||||
|
|
|
@ -2220,8 +2220,6 @@ EAPI void _edje_edd_shutdown(void);
|
||||||
EAPI extern Eet_Data_Descriptor *_edje_edd_edje_file;
|
EAPI extern Eet_Data_Descriptor *_edje_edd_edje_file;
|
||||||
EAPI extern Eet_Data_Descriptor *_edje_edd_edje_part_collection;
|
EAPI extern Eet_Data_Descriptor *_edje_edd_edje_part_collection;
|
||||||
|
|
||||||
extern int _edje_anim_count;
|
|
||||||
extern Ecore_Animator *_edje_timer;
|
|
||||||
extern Eina_List *_edje_animators;
|
extern Eina_List *_edje_animators;
|
||||||
extern Eina_List *_edje_edjes;
|
extern Eina_List *_edje_edjes;
|
||||||
|
|
||||||
|
@ -2279,7 +2277,7 @@ void _edje_recalc_do(Edje *ed);
|
||||||
int _edje_part_dragable_calc(Edje *ed, Edje_Real_Part *ep, FLOAT_T *x, FLOAT_T *y);
|
int _edje_part_dragable_calc(Edje *ed, Edje_Real_Part *ep, FLOAT_T *x, FLOAT_T *y);
|
||||||
void _edje_dragable_pos_set(Edje *ed, Edje_Real_Part *ep, FLOAT_T x, FLOAT_T y);
|
void _edje_dragable_pos_set(Edje *ed, Edje_Real_Part *ep, FLOAT_T x, FLOAT_T y);
|
||||||
|
|
||||||
Eina_Bool _edje_timer_cb(void *data);
|
Eina_Bool _edje_timer_cb(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info);
|
||||||
Eina_Bool _edje_pending_timer_cb(void *data);
|
Eina_Bool _edje_pending_timer_cb(void *data);
|
||||||
void _edje_callbacks_add(Evas_Object *obj, Edje *ed, Edje_Real_Part *rp);
|
void _edje_callbacks_add(Evas_Object *obj, Edje *ed, Edje_Real_Part *rp);
|
||||||
void _edje_callbacks_focus_add(Evas_Object *obj, Edje *ed, Edje_Real_Part *rp);
|
void _edje_callbacks_focus_add(Evas_Object *obj, Edje *ed, Edje_Real_Part *rp);
|
||||||
|
@ -2322,6 +2320,7 @@ void _edje_clean_objects(Edje *ed);
|
||||||
void _edje_ref(Edje *ed);
|
void _edje_ref(Edje *ed);
|
||||||
void _edje_unref(Edje *ed);
|
void _edje_unref(Edje *ed);
|
||||||
|
|
||||||
|
void _edje_program_run_cleanup(Edje *ed, Edje_Running_Program *runp);
|
||||||
Eina_Bool _edje_program_run_iterate(Edje_Running_Program *runp, double tim);
|
Eina_Bool _edje_program_run_iterate(Edje_Running_Program *runp, double tim);
|
||||||
void _edje_program_end(Edje *ed, Edje_Running_Program *runp);
|
void _edje_program_end(Edje *ed, Edje_Running_Program *runp);
|
||||||
void _edje_program_run(Edje *ed, Edje_Program *pr, Eina_Bool force, const char *ssig, const char *ssrc);
|
void _edje_program_run(Edje *ed, Edje_Program *pr, Eina_Bool force, const char *ssig, const char *ssrc);
|
||||||
|
|
|
@ -4,8 +4,6 @@ static void _edje_emit_cb(Edje *ed, const char *sig, const char *src, Edje_Messa
|
||||||
static void _edje_param_copy(Edje *ed, Edje_Real_Part *src_part, const char *src_param, Edje_Real_Part *dst_part, const char *dst_param);
|
static void _edje_param_copy(Edje *ed, Edje_Real_Part *src_part, const char *src_param, Edje_Real_Part *dst_part, const char *dst_param);
|
||||||
static void _edje_param_set(Edje *ed, Edje_Real_Part *part, const char *param, const char *value);
|
static void _edje_param_set(Edje *ed, Edje_Real_Part *part, const char *param, const char *value);
|
||||||
|
|
||||||
int _edje_anim_count = 0;
|
|
||||||
Ecore_Animator *_edje_timer = NULL;
|
|
||||||
Eina_List *_edje_animators = NULL;
|
Eina_List *_edje_animators = NULL;
|
||||||
static double _edje_transition_duration_scale = 0;
|
static double _edje_transition_duration_scale = 0;
|
||||||
|
|
||||||
|
@ -421,6 +419,15 @@ _edje_object_animation_get(Eo *obj EINA_UNUSED, Edje *ed)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Private Routines */
|
/* Private Routines */
|
||||||
|
void
|
||||||
|
_edje_program_run_cleanup(Edje *ed, Edje_Running_Program *runp)
|
||||||
|
{
|
||||||
|
ed->actions = eina_list_remove(ed->actions, runp);
|
||||||
|
if (!ed->actions)
|
||||||
|
{
|
||||||
|
eo_do(ed->obj, eo_event_callback_del(EFL_CORE_ANIMATOR_EVENT_ANIMATOR_TICK, _edje_timer_cb, ed));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Eina_Bool
|
Eina_Bool
|
||||||
_edje_program_run_iterate(Edje_Running_Program *runp, double tim)
|
_edje_program_run_iterate(Edje_Running_Program *runp, double tim)
|
||||||
|
@ -486,12 +493,7 @@ _edje_program_run_iterate(Edje_Running_Program *runp, double tim)
|
||||||
_edje_recalc(ed);
|
_edje_recalc(ed);
|
||||||
runp->delete_me = EINA_TRUE;
|
runp->delete_me = EINA_TRUE;
|
||||||
if (!ed->walking_actions)
|
if (!ed->walking_actions)
|
||||||
{
|
_edje_program_run_cleanup(ed, runp);
|
||||||
_edje_anim_count--;
|
|
||||||
ed->actions = eina_list_remove(ed->actions, runp);
|
|
||||||
if (!ed->actions)
|
|
||||||
_edje_animators = eina_list_remove(_edje_animators, ed);
|
|
||||||
}
|
|
||||||
// _edje_emit(ed, "program,stop", runp->program->name);
|
// _edje_emit(ed, "program,stop", runp->program->name);
|
||||||
if (_edje_block_break(ed))
|
if (_edje_block_break(ed))
|
||||||
{
|
{
|
||||||
|
@ -568,13 +570,8 @@ _edje_program_end(Edje *ed, Edje_Running_Program *runp)
|
||||||
// pname = runp->program->name;
|
// pname = runp->program->name;
|
||||||
if (!ed->walking_actions)
|
if (!ed->walking_actions)
|
||||||
{
|
{
|
||||||
_edje_anim_count--;
|
_edje_program_run_cleanup(ed, runp);
|
||||||
ed->actions = eina_list_remove(ed->actions, runp);
|
|
||||||
free_runp = 1;
|
free_runp = 1;
|
||||||
if (!ed->actions)
|
|
||||||
{
|
|
||||||
_edje_animators = eina_list_remove(_edje_animators, ed);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// _edje_emit(ed, "program,stop", pname);
|
// _edje_emit(ed, "program,stop", pname);
|
||||||
_edje_util_thaw(ed);
|
_edje_util_thaw(ed);
|
||||||
|
@ -726,15 +723,16 @@ low_mem_current:
|
||||||
ed->actions = eina_list_append(ed->actions, runp);
|
ed->actions = eina_list_append(ed->actions, runp);
|
||||||
goto break_prog;
|
goto break_prog;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ed->actions)
|
if (!ed->actions)
|
||||||
_edje_animators = eina_list_append(_edje_animators, ed);
|
{
|
||||||
|
eo_do(ed->obj, eo_event_callback_add(EFL_CORE_ANIMATOR_EVENT_ANIMATOR_TICK, _edje_timer_cb, ed));
|
||||||
|
}
|
||||||
ed->actions = eina_list_append(ed->actions, runp);
|
ed->actions = eina_list_append(ed->actions, runp);
|
||||||
|
|
||||||
runp->start_time = ecore_loop_time_get();
|
runp->start_time = ecore_loop_time_get();
|
||||||
runp->edje = ed;
|
runp->edje = ed;
|
||||||
runp->program = pr;
|
runp->program = pr;
|
||||||
if (!_edje_timer)
|
|
||||||
_edje_timer = ecore_animator_add(_edje_timer_cb, NULL);
|
|
||||||
_edje_anim_count++;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue