diff options
author | Cedric BAIL <cedric@osg.samsung.com> | 2018-05-03 16:34:17 -0700 |
---|---|---|
committer | Cedric BAIL <cedric@osg.samsung.com> | 2018-05-24 16:02:18 -0700 |
commit | 8a513a522e90253ce7ec85e92c7bc58dfb22a2bc (patch) | |
tree | abeafb5e5bce67ed685e4e82f0d756de46ef60ec /src/lib/efl/Efl.h | |
parent | c28eb28728c280d3fd19ef46790fce6f9465d4f5 (diff) |
efl: major rewrite of efl_part.
The interface efl_part_get should not be directly called from C, but the efl_part
wrapper should. It rely on efl_noref to properly destroy the object. Binding can
control the lifecycle of the reference the way they want by either calling the
wrapper or efl_part_get directly. It also means that the ugly ___efl_auto_unref_set
doesn't need to be exposed outside of EFL anymore.
Differential Revision: https://phab.enlightenment.org/D6098
Diffstat (limited to '')
-rw-r--r-- | src/lib/efl/Efl.h | 29 | ||||
-rw-r--r-- | src/lib/efl/Efl.hh | 2 |
2 files changed, 31 insertions, 0 deletions
diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h index e9b00b1d50..6cebb21dae 100644 --- a/src/lib/efl/Efl.h +++ b/src/lib/efl/Efl.h | |||
@@ -10,6 +10,12 @@ extern "C" { | |||
10 | #ifdef EAPI | 10 | #ifdef EAPI |
11 | # undef EAPI | 11 | # undef EAPI |
12 | #endif | 12 | #endif |
13 | #ifdef EWAPI | ||
14 | # undef EWAPI | ||
15 | #endif | ||
16 | #ifdef EOAPI | ||
17 | # undef EOAPI | ||
18 | #endif | ||
13 | 19 | ||
14 | #ifdef _WIN32 | 20 | #ifdef _WIN32 |
15 | # ifdef EFL_BUILD | 21 | # ifdef EFL_BUILD |
@@ -21,18 +27,25 @@ extern "C" { | |||
21 | # else | 27 | # else |
22 | # define EAPI __declspec(dllimport) | 28 | # define EAPI __declspec(dllimport) |
23 | # endif | 29 | # endif |
30 | # define EAPI_WEAK | ||
24 | #else | 31 | #else |
25 | # ifdef __GNUC__ | 32 | # ifdef __GNUC__ |
26 | # if __GNUC__ >= 4 | 33 | # if __GNUC__ >= 4 |
27 | # define EAPI __attribute__ ((visibility("default"))) | 34 | # define EAPI __attribute__ ((visibility("default"))) |
35 | # define EAPI_WEAK __attribute__ ((weak)) | ||
28 | # else | 36 | # else |
29 | # define EAPI | 37 | # define EAPI |
38 | # define EAPI_WEAK | ||
30 | # endif | 39 | # endif |
31 | # else | 40 | # else |
32 | # define EAPI | 41 | # define EAPI |
42 | # define EAPI_WEAK | ||
33 | # endif | 43 | # endif |
34 | #endif | 44 | #endif |
35 | 45 | ||
46 | #define EWAPI EAPI EAPI_WEAK | ||
47 | #define EOAPI EAPI EAPI_WEAK | ||
48 | |||
36 | #define EFL_VERSION_1_18 1 | 49 | #define EFL_VERSION_1_18 1 |
37 | #define EFL_VERSION_1_19 1 | 50 | #define EFL_VERSION_1_19 1 |
38 | #define EFL_VERSION_1_20 1 | 51 | #define EFL_VERSION_1_20 1 |
@@ -167,6 +180,22 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command; | |||
167 | #include "interfaces/efl_text_markup.eo.h" | 180 | #include "interfaces/efl_text_markup.eo.h" |
168 | #include "interfaces/efl_text_markup_util.eo.h" | 181 | #include "interfaces/efl_text_markup_util.eo.h" |
169 | 182 | ||
183 | /** | ||
184 | * @brief Get a proxy object referring to a part of an object. | ||
185 | * | ||
186 | * The returned object is valid for only a single function call. | ||
187 | * Of course, if the first call is @ref efl_ref, it will last | ||
188 | * until @ref efl_unref. | ||
189 | * | ||
190 | * @param[in] obj The object. | ||
191 | * @param[in] name The part name. | ||
192 | * | ||
193 | * @return A (proxy) object, valid for a single call. | ||
194 | * | ||
195 | * @since 1.21 | ||
196 | */ | ||
197 | EAPI Efl_Object *efl_part(const Eo *obj, const char *name); | ||
198 | |||
170 | #else | 199 | #else |
171 | 200 | ||
172 | #ifndef EFL_NOLEGACY_API_SUPPORT | 201 | #ifndef EFL_NOLEGACY_API_SUPPORT |
diff --git a/src/lib/efl/Efl.hh b/src/lib/efl/Efl.hh index e6473eafce..19cfb37c60 100644 --- a/src/lib/efl/Efl.hh +++ b/src/lib/efl/Efl.hh | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef EFL_EFL_HH | 1 | #ifndef EFL_EFL_HH |
2 | #define EFL_EFL_HH | 2 | #define EFL_EFL_HH |
3 | 3 | ||
4 | #define EFL_PART_PROTECTED | ||
5 | |||
4 | #include "cxx/efl_part_impl.hh" | 6 | #include "cxx/efl_part_impl.hh" |
5 | 7 | ||
6 | #include <Eo.hh> | 8 | #include <Eo.hh> |