eo: move wref_add/wref_del to C
authorDaniel Kolesa <d.kolesa@osg.samsung.com>
Wed, 26 Apr 2017 13:01:44 +0000 (15:01 +0200)
committerDaniel Kolesa <d.kolesa@osg.samsung.com>
Wed, 26 Apr 2017 14:19:06 +0000 (16:19 +0200)
src/lib/eo/Eo.h
src/lib/eo/efl_object.eo
src/lib/eo/eo_base_class.c

index 60258a2..a89dec6 100644 (file)
@@ -1423,6 +1423,25 @@ EAPI Eo *efl_xref_internal(const char *file, int line, Eo *obj, const Eo *ref_ob
 EAPI void efl_xunref(Eo *obj, const Eo *ref_obj);
 
 /**
+ * @brief Add a new weak reference to obj.
+ *
+ * This function registers the object handle pointed by wref to obj so when obj
+ * is deleted it'll be updated to NULL. This functions should be used when you
+ * want to keep track of an object in a safe way, but you don't want to prevent
+ * it from being freed.
+ *
+ * @param[in] wref The weak ref
+ */
+EOAPI void efl_wref_add(Eo *obj, Efl_Object **wref);
+
+/**
+ * @brief Delete the weak reference passed.
+ *
+ * @param[in] wref The weak ref
+ */
+EOAPI void efl_wref_del(Eo *obj, Efl_Object **wref);
+
+/**
  * @brief Enable or disable the manual free feature.
  * @param obj the object to work on.
  * @param manual_free indicates if the free is manual (EINA_TRUE) or automatic (EINA_FALSE).
index 8daa6cd..8430b8a 100644 (file)
@@ -156,25 +156,6 @@ abstract Efl.Object ()
          }
          return: Efl.Object; [[The first object found]]
       }
-      wref_add {
-         [[Add a new weak reference to obj.
-
-           This function registers the object handle pointed by wref to
-           obj so when obj is deleted it'll be updated to NULL. This
-           functions should be used when you want to keep track of an
-           object in a safe way, but you don't want to prevent it from
-           being freed.
-         ]]
-         params {
-            @in wref: ptr(Efl.Object); [[The weak ref]]
-         }
-      }
-      wref_del {
-         [[Delete the weak reference passed.]]
-         params {
-            @in wref: ptr(Efl.Object); [[The weak ref]]
-         }
-      }
       @property key_data {
          [[Generic data with string key on an object.
 
index fa9efbc..964a8c1 100644 (file)
@@ -798,6 +798,8 @@ _efl_object_wref_add(Eo *obj, Efl_Object_Data *pd, Eo **wref)
      }
 }
 
+EOAPI EFL_VOID_FUNC_BODYV(efl_wref_add, EFL_FUNC_CALL(wref), Efl_Object **wref);
+
 EOLIAN static void
 _efl_object_wref_del(Eo *obj, Efl_Object_Data *pd, Eo **wref)
 {
@@ -862,6 +864,8 @@ err_wref_not_obj:
    return;
 }
 
+EOAPI EFL_VOID_FUNC_BODYV(efl_wref_del, EFL_FUNC_CALL(wref), Efl_Object **wref);
+
 static inline void
 _wref_destruct(Efl_Object_Data *pd)
 {
@@ -1974,6 +1978,8 @@ _efl_object_future_link(Eo *obj EINA_UNUSED, Efl_Object_Data *pd, Efl_Future *li
    EFL_OBJECT_OP_FUNC(efl_event_callback_call, _efl_object_event_callback_call), \
    EFL_OBJECT_OP_FUNC(efl_event_callback_legacy_call, _efl_object_event_callback_legacy_call), \
    EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _efl_object_dbg_info_get), \
-   EFL_OBJECT_OP_FUNC(efl_future_link, _efl_object_future_link)
+   EFL_OBJECT_OP_FUNC(efl_future_link, _efl_object_future_link), \
+   EFL_OBJECT_OP_FUNC(efl_wref_add, _efl_object_wref_add), \
+   EFL_OBJECT_OP_FUNC(efl_wref_del, _efl_object_wref_del)
 
 #include "efl_object.eo.c"