This document highlights the main differences between the original EFL API (known from now on as Legacy API) and the new EFL API based on Eo objects (dubbed Unified API). The Unified API was introduced in EFL 1.21, early in 2018.
Both APIs can be used simultaneously, but support for the Legacy one will be dropped in the future, and therefore usage of the Unified API is strongly recommended in new code.
NOTE: Meanwhile the Legacy API is still the default, enabling the Unified API requires defining two compilation symbols,
EFL_BETA_API_SUPPORT, as can be seen in the tutorials and examples.
In the Unified EFL you no longer access the main loop directly. Each application may run in a different loop and therefor there be no single main loop. To access the main loop for your application retain a reference to the loop that was passed in to your main function as
event->object. To retain a reference, add the following code to your application:
Efl_Loop *main_loop = event->object
efl_add(EFL_LOOP_TIMER_CLASS, ...)and destroyed with
efl_event_callback_add(timer_object, EFL_LOOP_TIMER_EVENT_TICK, ...).
ECORE_CALLBACK_CANCELanymore. If you want a one-shot timer, remove it from the callback after it has fired once.
ecore_timer_*()methods should not be used in new code.
efl_add(EFL_LOOP_FD_CLASS, ...)and destroyed with
efl_event_callback_add(), possible events are
ecore_main_fd_*()methods should not be used in new code.
efl_event_callback_add(loop_object, EFL_LOOP_EVENT_IDLE, ...)
efl_event_callback_add(loop_object, EFL_LOOP_EVENT_IDLE_ENTER, ...)
efl_event_callback_add(loop_object, EFL_LOOP_EVENT_IDLE_EXIT, ...)
ecore_idler_*()methods should not be used in new code.
In the Unified Efl.Ui widgets are visible and set to expand by default whilst in Legacy EFL they had to be shown after the correct weight and alignment were set. This should not cause any need for code changes but should mean that UI setup code is much shorter.