summaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
authorAndrew Williams <andy@andywilliams.me>2018-01-05 03:28:30 -0800
committerapache <apache@e5-web1.enlightenment.org>2018-01-05 03:28:30 -0800
commit296a1731c6fcb3ffdbcb80639e5db9726fdb9a6f (patch)
treecc325e8014e7b8b2e45431f54947812e5edf3a6b /pages
parenta46efc00de4e6252a8f2eb356b29c40be6e86240 (diff)
Wiki page porting-guide.md changed with summary [Add main loop and widget notes] by Andrew Williams
Diffstat (limited to 'pages')
-rw-r--r--pages/develop/guides/c/porting-guide.md.txt30
1 files changed, 13 insertions, 17 deletions
diff --git a/pages/develop/guides/c/porting-guide.md.txt b/pages/develop/guides/c/porting-guide.md.txt
index 66548566a..6061154da 100644
--- a/pages/develop/guides/c/porting-guide.md.txt
+++ b/pages/develop/guides/c/porting-guide.md.txt
@@ -4,33 +4,32 @@
4 4
5# EFL C Porting Guide # 5# EFL C Porting Guide #
6 6
7This 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.22, around December 2017. 7This 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.
8 8
9Both 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. 9Both 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.
10 10
11> **NOTE:** 11> **NOTE:**
12> Meanwhile the Legacy API is not completely removed, enabling the Unified API requires defining two compilation symbols, ``EFL_EO_API_SUPPORT`` and ``EFL_BETA_API_SUPPORT``, as can be seen in the tutorials and examples. 12> Meanwhile the Legacy API is still the default, enabling the Unified API requires defining two compilation symbols, ``EFL_EO_API_SUPPORT`` and ``EFL_BETA_API_SUPPORT``, as can be seen in the tutorials and examples.
13 13
14## Main Loop ## 14## Main Loop ##
15 15
16In 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:
17
18```
19Efl_Loop *main_loop = event->object
20```
21
16### Timers ### 22### Timers ###
17 23
18Programming guides: [Unified EFL](/develop/guides/c/core/main-loop.md#Timers), [Legacy EFL](/develop/legacy/program_guide/main_loop/timers) 24Programming guides: [Unified EFL](/develop/guides/c/core/main-loop.md#Timers), [Legacy EFL](/develop/legacy/program_guide/main_loop/timers)
19 25
20* Timers are now regular Eo objects created with ``efl_add(EFL_LOOP_TIMER_CLASS, ...)`` and destroyed with ``efl_unref()``. 26* Timers are now regular Eo objects created with ``efl_add(EFL_LOOP_TIMER_CLASS, ...)`` and destroyed with ``efl_unref()``.
21
22* The timer callback is registered with ``efl_event_callback_add(timer_object, EFL_LOOP_TIMER_EVENT_TICK, ...)``. 27* The timer callback is registered with ``efl_event_callback_add(timer_object, EFL_LOOP_TIMER_EVENT_TICK, ...)``.
23
24* Timers are always periodic. The callback does not return ``ECORE_CALLBACK_RENEW`` or ``ECORE_CALLBACK_CANCEL`` anymore. If you want a one-shot timer, remove it from the callback after it has fired once. 28* Timers are always periodic. The callback does not return ``ECORE_CALLBACK_RENEW`` or ``ECORE_CALLBACK_CANCEL`` anymore. If you want a one-shot timer, remove it from the callback after it has fired once.
25
26* ``ecore_timer_interval_set/get()`` -> ``efl_loop_timer_interval_set/get()`` 29* ``ecore_timer_interval_set/get()`` -> ``efl_loop_timer_interval_set/get()``
27
28* ``ecore_timer_pending_get()`` -> ``efl_loop_timer_pending_get()`` 30* ``ecore_timer_pending_get()`` -> ``efl_loop_timer_pending_get()``
29
30* ``ecore_timer_reset()`` -> ``efl_loop_timer_reset()`` 31* ``ecore_timer_reset()`` -> ``efl_loop_timer_reset()``
31
32* ``ecore_timer_freeze/thaw()`` -> ``efl_event_freeze/thaw()`` 32* ``ecore_timer_freeze/thaw()`` -> ``efl_event_freeze/thaw()``
33
34* ``ecore_timer_*()`` methods should not be used in new code. 33* ``ecore_timer_*()`` methods should not be used in new code.
35 34
36### File Descriptors ### 35### File Descriptors ###
@@ -38,11 +37,8 @@ Programming guides: [Unified EFL](/develop/guides/c/core/main-loop.md#Timers), [
38Programming guides: [Unified EFL](/develop/guides/c/core/main-loop.md#File_Descriptor_Monitors), [Legacy EFL](/develop/legacy/program_guide/main_loop/file_descriptors) 37Programming guides: [Unified EFL](/develop/guides/c/core/main-loop.md#File_Descriptor_Monitors), [Legacy EFL](/develop/legacy/program_guide/main_loop/file_descriptors)
39 38
40* File Descriptors are now regular Eo objects created with ``efl_add(EFL_LOOP_FD_CLASS, ...)`` and destroyed with ``efl_unref()``. 39* File Descriptors are now regular Eo objects created with ``efl_add(EFL_LOOP_FD_CLASS, ...)`` and destroyed with ``efl_unref()``.
41
42* Register to FD events with ``efl_event_callback_add()``, possible events are ``EFL_LOOP_FD_EVENT_READ``, ``_WRITE`` and ``_ERROR``. 40* Register to FD events with ``efl_event_callback_add()``, possible events are ``EFL_LOOP_FD_EVENT_READ``, ``_WRITE`` and ``_ERROR``.
43
44* Retrieve the internal FDs through the ``fd`` and ``fd_file`` properties . 41* Retrieve the internal FDs through the ``fd`` and ``fd_file`` properties .
45
46* ``ecore_main_fd_*()`` methods should not be used in new code. 42* ``ecore_main_fd_*()`` methods should not be used in new code.
47 43
48### Idlers ### 44### Idlers ###
@@ -50,21 +46,21 @@ Programming guides: [Unified EFL](/develop/guides/c/core/main-loop.md#File_Descr
50Programming guides: [Unified EFL](/develop/guides/c/core/main-loop.md#Idlers), [Legacy EFL](/develop/legacy/program_guide/main_loop/idlers) 46Programming guides: [Unified EFL](/develop/guides/c/core/main-loop.md#Idlers), [Legacy EFL](/develop/legacy/program_guide/main_loop/idlers)
51 47
52* All idler functions are handled through regular events on the Loop object. 48* All idler functions are handled through regular events on the Loop object.
53
54* ``ecore_idler_add()`` -> ``efl_event_callback_add(loop_object, EFL_LOOP_EVENT_IDLE, ...)`` 49* ``ecore_idler_add()`` -> ``efl_event_callback_add(loop_object, EFL_LOOP_EVENT_IDLE, ...)``
55
56* ``ecore_idler_enterer_add()`` -> ``efl_event_callback_add(loop_object, EFL_LOOP_EVENT_IDLE_ENTER, ...)`` 50* ``ecore_idler_enterer_add()`` -> ``efl_event_callback_add(loop_object, EFL_LOOP_EVENT_IDLE_ENTER, ...)``
57
58* ``ecore_idler_exiter_add()`` -> ``efl_event_callback_add(loop_object, EFL_LOOP_EVENT_IDLE_EXIT, ...)`` 51* ``ecore_idler_exiter_add()`` -> ``efl_event_callback_add(loop_object, EFL_LOOP_EVENT_IDLE_EXIT, ...)``
59
60* ``ecore_idler_*()`` methods should not be used in new code. 52* ``ecore_idler_*()`` methods should not be used in new code.
61 53
62## User Interface ## 54## User Interface ##
63 55
56### Widgets ###
57
58In 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.
59
64### Sizing ### 60### Sizing ###
65 61
66Programming guides: [Unified EFL](/develop/guides/c/ui/sizing.md), [Legacy EFL](/develop/legacy/samples/elm_min_size_control) 62Programming guides: [Unified EFL](/develop/guides/c/ui/sizing.md), [Legacy EFL](/develop/legacy/samples/elm_min_size_control)
67 63
64* ``evas_object_resize()`` -> ``efl_gfk_size_set()``
68* ``evas_object_size_hint_min_set/get()`` -> ``efl_gfx_size_hint_min_set/get()`` 65* ``evas_object_size_hint_min_set/get()`` -> ``efl_gfx_size_hint_min_set/get()``
69
70* ``evas_object_size_hint_max_set/get()`` -> ``efl_gfx_size_hint_max_set/get()`` 66* ``evas_object_size_hint_max_set/get()`` -> ``efl_gfx_size_hint_max_set/get()``