forked from enlightenment/efl
tests/elm: add helper function for simplifying getting to event triggering
the usual method is calc -> post render -> job to ensure everything is set up. this simplifies getting to that job. Reviewed-by: Chris Michael <cp.michael@samsung.com> Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D9186
This commit is contained in:
parent
25c86c88be
commit
14ac6a9e9e
|
@ -358,3 +358,28 @@ fail_on_errors_setup(void)
|
||||||
eina_log_abort_on_critical_level_set(2);
|
eina_log_abort_on_critical_level_set(2);
|
||||||
eina_log_abort_on_critical_set(1);
|
eina_log_abort_on_critical_set(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
next_event_job()
|
||||||
|
{
|
||||||
|
ecore_main_loop_quit();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
events_norendered(void *data EINA_UNUSED, Evas *e, void *event_info EINA_UNUSED)
|
||||||
|
{
|
||||||
|
evas_event_callback_del(e, EVAS_CALLBACK_RENDER_POST, events_norendered);
|
||||||
|
ecore_job_add(next_event_job, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
get_me_to_those_events(Eo *obj)
|
||||||
|
{
|
||||||
|
Evas *e = obj;
|
||||||
|
|
||||||
|
if (!efl_isa(obj, EFL_CANVAS_SCENE_INTERFACE))
|
||||||
|
e = evas_object_evas_get(obj);
|
||||||
|
evas_smart_objects_calculate(e);
|
||||||
|
evas_event_callback_add(e, EVAS_CALLBACK_RENDER_POST, events_norendered, NULL);
|
||||||
|
ecore_main_loop_begin();
|
||||||
|
}
|
||||||
|
|
|
@ -10,4 +10,5 @@ void *real_timer_add(double in, Ecore_Task_Cb cb, void *data);
|
||||||
void fail_on_errors_teardown(void);
|
void fail_on_errors_teardown(void);
|
||||||
void fail_on_errors_setup(void);
|
void fail_on_errors_setup(void);
|
||||||
|
|
||||||
|
void get_me_to_those_events(Eo *obj);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue