tasn pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=106951a61de97459a1cc9cdc248408e204c061dc

commit 106951a61de97459a1cc9cdc248408e204c061dc
Author: Tom Hacohen <t...@stosb.com>
Date:   Tue Apr 26 16:19:44 2016 +0100

    Eo: Make eo_del() an eo function.
    
    This was done following a feature request by @raster. There was no real
    reason for it not to be an eo function and this gives us more
    flexibility.
    
    The reason why this done was to provide a way for classes to do special
    things when an object deletion was requested, for example in the case of
    Evas, hide the object.
---
 src/lib/eo/Eo.h            | 12 ------------
 src/lib/eo/eo.c            | 13 -------------
 src/lib/eo/eo_base.eo      |  9 +++++++++
 src/lib/eo/eo_base_class.c | 12 ++++++++++++
 4 files changed, 21 insertions(+), 25 deletions(-)

diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h
index 1d492b1..be78f81 100644
--- a/src/lib/eo/Eo.h
+++ b/src/lib/eo/Eo.h
@@ -855,18 +855,6 @@ EAPI void eo_del_intercept_set(Eo *obj, Eo_Del_Intercept 
del_intercept_func);
 EAPI Eo_Del_Intercept eo_del_intercept_get(const Eo *obj);
 
 /**
- * @brief Unrefs the object and reparents it to NULL.
- * @param obj the object to work on.
- *
- * Because eo_del() unrefs and reparents to NULL, it doesn't really delete the
- * object.
- *
- * @see eo_unref()
- * @see eo_parent_set()
- */
-EAPI void eo_del(const Eo *obj);
-
-/**
  * @def eo_xref(obj, ref_obj)
  * Convenience macro around eo_xref_internal()
  * @see eo_xref()
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index e88d742..7d707a4 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -1371,19 +1371,6 @@ eo_unref(const Eo *obj_id)
    _eo_unref(obj);
 }
 
-EAPI void
-eo_del(const Eo *obj)
-{
-   if (eo_parent_get((Eo *) obj))
-     {
-        eo_parent_set((Eo *) obj, NULL);
-     }
-   else
-     {
-        eo_unref(obj);
-     }
-}
-
 EAPI int
 eo_ref_get(const Eo *obj_id)
 {
diff --git a/src/lib/eo/eo_base.eo b/src/lib/eo/eo_base.eo
index 19c50eb..01ce468 100644
--- a/src/lib/eo/eo_base.eo
+++ b/src/lib/eo/eo_base.eo
@@ -74,6 +74,15 @@ abstract Eo.Base ()
             parent: Eo.Base * @nullable; [[the new parent]]
          }
       }
+      del @const {
+         [[Unrefs the object and reparents it to NULL.
+
+           Because eo_del() unrefs and reparents to NULL, it doesn't really 
delete the object.
+
+           This method accepts a const object for convenience, so all objects
+           could be passed to it easily.
+         ]]
+      }
       @property id {
          [[ The id/name of the object.
 
diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index 7e3c442..d2c7168 100644
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -594,6 +594,18 @@ _eo_base_comment_get(Eo *obj EINA_UNUSED, Eo_Base_Data *pd)
    return pd->ext->comment;
 }
 
+EOLIAN static void
+_eo_base_del(const Eo *obj, Eo_Base_Data *pd EINA_UNUSED)
+{
+   if (eo_parent_get((Eo *) obj))
+     {
+        eo_parent_set((Eo *) obj, NULL);
+     }
+   else
+     {
+        eo_unref(obj);
+     }
+}
 
 EOLIAN static void
 _eo_base_parent_set(Eo *obj, Eo_Base_Data *pd, Eo *parent_id)

-- 


Reply via email to