summaryrefslogtreecommitdiff
path: root/src/lib/eo
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2017-04-26 15:01:44 +0200
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2017-04-26 16:19:06 +0200
commit20d1cf94c30fa21c823142a37dd7dcf08b69f205 (patch)
tree487961fafbf25a3662fdcf15a13dcf3907578d91 /src/lib/eo
parent67c7eb3134d33c84ba72bb5ba8da6e718a30f511 (diff)
eo: move wref_add/wref_del to C
Diffstat (limited to 'src/lib/eo')
-rw-r--r--src/lib/eo/Eo.h19
-rw-r--r--src/lib/eo/efl_object.eo19
-rw-r--r--src/lib/eo/eo_base_class.c8
3 files changed, 26 insertions, 20 deletions
diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h
index 60258a248e..a89dec6fc1 100644
--- a/src/lib/eo/Eo.h
+++ b/src/lib/eo/Eo.h
@@ -1423,6 +1423,25 @@ EAPI Eo *efl_xref_internal(const char *file, int line, Eo *obj, const Eo *ref_ob
1423EAPI void efl_xunref(Eo *obj, const Eo *ref_obj); 1423EAPI void efl_xunref(Eo *obj, const Eo *ref_obj);
1424 1424
1425/** 1425/**
1426 * @brief Add a new weak reference to obj.
1427 *
1428 * This function registers the object handle pointed by wref to obj so when obj
1429 * is deleted it'll be updated to NULL. This functions should be used when you
1430 * want to keep track of an object in a safe way, but you don't want to prevent
1431 * it from being freed.
1432 *
1433 * @param[in] wref The weak ref
1434 */
1435EOAPI void efl_wref_add(Eo *obj, Efl_Object **wref);
1436
1437/**
1438 * @brief Delete the weak reference passed.
1439 *
1440 * @param[in] wref The weak ref
1441 */
1442EOAPI void efl_wref_del(Eo *obj, Efl_Object **wref);
1443
1444/**
1426 * @brief Enable or disable the manual free feature. 1445 * @brief Enable or disable the manual free feature.
1427 * @param obj the object to work on. 1446 * @param obj the object to work on.
1428 * @param manual_free indicates if the free is manual (EINA_TRUE) or automatic (EINA_FALSE). 1447 * @param manual_free indicates if the free is manual (EINA_TRUE) or automatic (EINA_FALSE).
diff --git a/src/lib/eo/efl_object.eo b/src/lib/eo/efl_object.eo
index 8daa6cd33f..8430b8aec7 100644
--- a/src/lib/eo/efl_object.eo
+++ b/src/lib/eo/efl_object.eo
@@ -156,25 +156,6 @@ abstract Efl.Object ()
156 } 156 }
157 return: Efl.Object; [[The first object found]] 157 return: Efl.Object; [[The first object found]]
158 } 158 }
159 wref_add {
160 [[Add a new weak reference to obj.
161
162 This function registers the object handle pointed by wref to
163 obj so when obj is deleted it'll be updated to NULL. This
164 functions should be used when you want to keep track of an
165 object in a safe way, but you don't want to prevent it from
166 being freed.
167 ]]
168 params {
169 @in wref: ptr(Efl.Object); [[The weak ref]]
170 }
171 }
172 wref_del {
173 [[Delete the weak reference passed.]]
174 params {
175 @in wref: ptr(Efl.Object); [[The weak ref]]
176 }
177 }
178 @property key_data { 159 @property key_data {
179 [[Generic data with string key on an object. 160 [[Generic data with string key on an object.
180 161
diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index fa9efbc30e..964a8c10c9 100644
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -798,6 +798,8 @@ _efl_object_wref_add(Eo *obj, Efl_Object_Data *pd, Eo **wref)
798 } 798 }
799} 799}
800 800
801EOAPI EFL_VOID_FUNC_BODYV(efl_wref_add, EFL_FUNC_CALL(wref), Efl_Object **wref);
802
801EOLIAN static void 803EOLIAN static void
802_efl_object_wref_del(Eo *obj, Efl_Object_Data *pd, Eo **wref) 804_efl_object_wref_del(Eo *obj, Efl_Object_Data *pd, Eo **wref)
803{ 805{
@@ -862,6 +864,8 @@ err_wref_not_obj:
862 return; 864 return;
863} 865}
864 866
867EOAPI EFL_VOID_FUNC_BODYV(efl_wref_del, EFL_FUNC_CALL(wref), Efl_Object **wref);
868
865static inline void 869static inline void
866_wref_destruct(Efl_Object_Data *pd) 870_wref_destruct(Efl_Object_Data *pd)
867{ 871{
@@ -1974,6 +1978,8 @@ _efl_object_future_link(Eo *obj EINA_UNUSED, Efl_Object_Data *pd, Efl_Future *li
1974 EFL_OBJECT_OP_FUNC(efl_event_callback_call, _efl_object_event_callback_call), \ 1978 EFL_OBJECT_OP_FUNC(efl_event_callback_call, _efl_object_event_callback_call), \
1975 EFL_OBJECT_OP_FUNC(efl_event_callback_legacy_call, _efl_object_event_callback_legacy_call), \ 1979 EFL_OBJECT_OP_FUNC(efl_event_callback_legacy_call, _efl_object_event_callback_legacy_call), \
1976 EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _efl_object_dbg_info_get), \ 1980 EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _efl_object_dbg_info_get), \
1977 EFL_OBJECT_OP_FUNC(efl_future_link, _efl_object_future_link) 1981 EFL_OBJECT_OP_FUNC(efl_future_link, _efl_object_future_link), \
1982 EFL_OBJECT_OP_FUNC(efl_wref_add, _efl_object_wref_add), \
1983 EFL_OBJECT_OP_FUNC(efl_wref_del, _efl_object_wref_del)
1978 1984
1979#include "efl_object.eo.c" 1985#include "efl_object.eo.c"