cedric pushed a commit to branch master.

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

commit c1141c7b0b09b23c802b27d8c2c2bbe91919121b
Author: Cedric BAIL <ced...@osg.samsung.com>
Date:   Tue May 3 13:31:16 2016 -0700

    ecore: remove dead Ecore_Job eo object.
---
 src/Makefile_Ecore.am        |  1 -
 src/lib/ecore/Ecore_Common.h |  2 +-
 src/lib/ecore/Ecore_Eo.h     | 12 -------
 src/lib/ecore/Ecore_Legacy.h |  2 --
 src/lib/ecore/ecore_job.c    | 74 +++++++++++++-------------------------------
 src/lib/ecore/ecore_job.eo   | 29 -----------------
 6 files changed, 22 insertions(+), 98 deletions(-)

diff --git a/src/Makefile_Ecore.am b/src/Makefile_Ecore.am
index e890c75..2eefeaa 100644
--- a/src/Makefile_Ecore.am
+++ b/src/Makefile_Ecore.am
@@ -4,7 +4,6 @@
 ecore_eolian_files_legacy = \
        lib/ecore/ecore_timer.eo \
        lib/ecore/ecore_poller.eo \
-       lib/ecore/ecore_job.eo \
        lib/ecore/ecore_exe.eo \
        lib/ecore/ecore_animator.eo
 
diff --git a/src/lib/ecore/Ecore_Common.h b/src/lib/ecore/Ecore_Common.h
index 04ee28d..7d7164a 100644
--- a/src/lib/ecore/Ecore_Common.h
+++ b/src/lib/ecore/Ecore_Common.h
@@ -3076,7 +3076,7 @@ typedef struct _Ecore_Factorized_Idle Ecore_Idle_Exiter; 
/**< A handle for idle
 /**
  * @since 1.8
  */
-typedef Eo Ecore_Job;    /**< A job handle */
+typedef struct _Ecore_Job Ecore_Job;    /**< A job handle */
 
 #define _ECORE_JOB_EO_CLASS_TYPE
 /**
diff --git a/src/lib/ecore/Ecore_Eo.h b/src/lib/ecore/Ecore_Eo.h
index 04bc2f6..edd352a 100644
--- a/src/lib/ecore/Ecore_Eo.h
+++ b/src/lib/ecore/Ecore_Eo.h
@@ -55,18 +55,6 @@ extern "C" {
 
 
 /**
- * @ingroup Ecore_Job_Group
- *
- * @{
- */
-
-#include "ecore_job.eo.h"
-
-/**
- * @}
- */
-
-/**
  * @ingroup Ecore_MainLoop_Group
  *
  * @{
diff --git a/src/lib/ecore/Ecore_Legacy.h b/src/lib/ecore/Ecore_Legacy.h
index f0acb5d..4c5145c 100644
--- a/src/lib/ecore/Ecore_Legacy.h
+++ b/src/lib/ecore/Ecore_Legacy.h
@@ -361,8 +361,6 @@ EAPI Ecore_Job *ecore_job_add(Ecore_Cb func, const void 
*data);
  */
 EAPI void *ecore_job_del(Ecore_Job *obj);
 
-#include "ecore_job.eo.legacy.h"
-
 /**
  * @}
  */
diff --git a/src/lib/ecore/ecore_job.c b/src/lib/ecore/ecore_job.c
index 91e634f..302b767 100644
--- a/src/lib/ecore/ecore_job.c
+++ b/src/lib/ecore/ecore_job.c
@@ -9,10 +9,6 @@
 #include "Ecore.h"
 #include "ecore_private.h"
 
-#define MY_CLASS ECORE_JOB_CLASS
-
-#define MY_CLASS_NAME "Ecore_Job"
-
 static Eina_Bool _ecore_job_event_handler(void *data,
                                           int   type,
                                           void *ev);
@@ -22,9 +18,7 @@ static void _ecore_job_event_free(void *data,
 static int ecore_event_job_type = 0;
 static Ecore_Event_Handler *_ecore_job_handler = NULL;
 
-typedef struct _Ecore_Job_Data Ecore_Job_Data;
-
-struct _Ecore_Job_Data
+struct _Ecore_Job
 {
    Ecore_Event *event;
    Ecore_Cb     func;
@@ -49,65 +43,48 @@ EAPI Ecore_Job *
 ecore_job_add(Ecore_Cb    func,
               const void *data)
 {
-   Ecore_Job *job = eo_add(MY_CLASS, _ecore_parent, 
ecore_job_constructor(eo_self, func, data));
-   return job;
-}
+   Ecore_Job *job;
 
-EOLIAN static void
-_ecore_job_constructor(Eo *obj, Ecore_Job_Data *job, Ecore_Cb func, const void 
*data)
-{
    if (EINA_UNLIKELY(!eina_main_loop_is()))
      {
-        EINA_MAIN_LOOP_CHECK_RETURN;
+        EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
      }
-   eo_manual_free_set(obj, EINA_TRUE);
 
    if (!func)
      {
-        ERR("callback function must be set up for an object of class: '%s'", 
MY_CLASS_NAME);
-        return;
+        ERR("Callback function must be set up for an Ecore_Job object");
+        return NULL;
      }
 
-   job->event = ecore_event_add(ecore_event_job_type, job, 
_ecore_job_event_free, obj);
+   job = calloc(1, sizeof (Ecore_Job));
+   if (!job) return NULL;
+
+   job->event = ecore_event_add(ecore_event_job_type, job, 
_ecore_job_event_free, job);
    if (!job->event)
      {
-        ERR("no event was assigned to object '%p' of class '%s'", obj, 
MY_CLASS_NAME);
-        return;
+        ERR("No event was assigned to Ecore_Job '%p'", job);
+        free(job);
+        return NULL;
      }
    job->func = func;
    job->data = (void *)data;
+
+   return job;
 }
 
 EAPI void *
-ecore_job_del(Ecore_Job *obj)
+ecore_job_del(Ecore_Job *job)
 {
    void *data;
 
-   if (!obj) return NULL;
+   if (!job) return NULL;
+
    EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
-   Ecore_Job_Data *job = eo_data_scope_get(obj, MY_CLASS);
+
    data = job->data;
    ecore_event_del(job->event);
-   eo_parent_set(obj, NULL);
-   return data;
-}
-
-EOLIAN static void
-_ecore_job_eo_base_destructor(Eo *obj, Ecore_Job_Data *_pd EINA_UNUSED)
-{
-   /*FIXME: check if ecore_event_del should be called from here*/
-   eo_destructor(eo_super(obj, MY_CLASS));
-}
 
-EOLIAN static Eo *
-_ecore_job_eo_base_finalize(Eo *obj, Ecore_Job_Data *pd)
-{
-   if (!pd->func)
-     {
-        return NULL;
-     }
-
-   return eo_finalize(eo_super(obj, MY_CLASS));
+   return data;
 }
 
 static Eina_Bool
@@ -115,7 +92,7 @@ _ecore_job_event_handler(void *data EINA_UNUSED,
                          int   type EINA_UNUSED,
                          void *ev)
 {
-   Ecore_Job_Data *job;
+   Ecore_Job *job;
 
    job = ev;
    job->func(job->data);
@@ -126,14 +103,5 @@ static void
 _ecore_job_event_free(void *data,
                       void *job EINA_UNUSED)
 {
-   eo_parent_set(data, NULL);
-
-   Ecore_Job *obj = data;
-
-   if (eo_destructed_is(obj))
-      eo_manual_free(obj);
-   else
-      eo_manual_free_set(obj, EINA_FALSE);
+   ecore_job_del(data);
 }
-
-#include "ecore_job.eo.c"
diff --git a/src/lib/ecore/ecore_job.eo b/src/lib/ecore/ecore_job.eo
deleted file mode 100644
index 26dedec..0000000
--- a/src/lib/ecore/ecore_job.eo
+++ /dev/null
@@ -1,29 +0,0 @@
-import ecore_types;
-
-class Ecore.Job (Eo.Base)
-{
-   [[Ecore Jobs are queued until the main loop dealt with the current event.
-
-   Jobs are processed by the main loop similarly to events. They also will
-   be executed in the order in which they were added.
-   ]]
-
-   eo_prefix: ecore_job;
-   methods {
-      constructor {
-         [[Constructor.]]
-         legacy: null;
-         params {
-            @in func: Ecore_Cb; [[Ecore job to be queued callback function.]]
-            @in data: const(void)*; [[Private data passed to callback 
function.]]
-         }
-      }
-   }
-   implements {
-      Eo.Base.destructor;
-      Eo.Base.finalize;
-   }
-   constructors {
-      .constructor;
-   }
-}

-- 


Reply via email to