cedric pushed a commit to branch master.

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

commit 8400859213fcfae30e4c9ae26e66e5589cb93f01
Author: Cedric BAIL <ced...@osg.samsung.com>
Date:   Mon Sep 18 13:33:34 2017 -0700

    ecore: make efl_loop_future_scheduler_get shouldn't be exposed in the 
object function.
    
    Function declared in a .eo are something that we want to allow people to 
inherit from
    or use in a binding. I can't think of a situation where that would be the 
case for
    this function and it solves at the same time problem of needing a shared 
interface
    for both loop and loop_user.
---
 src/lib/ecore/Ecore_Eo.h       |  2 ++
 src/lib/ecore/ecore_main.c     | 13 ++++++++-----
 src/lib/ecore/efl_loop.eo      | 12 ------------
 src/lib/ecore/efl_loop_user.c  |  6 ------
 src/lib/ecore/efl_loop_user.eo | 12 ------------
 5 files changed, 10 insertions(+), 35 deletions(-)

diff --git a/src/lib/ecore/Ecore_Eo.h b/src/lib/ecore/Ecore_Eo.h
index aadd2ba136..1be6dbc237 100644
--- a/src/lib/ecore/Ecore_Eo.h
+++ b/src/lib/ecore/Ecore_Eo.h
@@ -40,6 +40,8 @@ extern "C" {
 
 #include "efl_loop_user.eo.h"
 
+EAPI Eina_Future_Scheduler *efl_loop_future_scheduler_get(Eo *obj);
+
 #include "efl_loop_fd.eo.h"
 
 #include "efl_promise.eo.h"
diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c
index 6819a05d7e..967ee721fd 100644
--- a/src/lib/ecore/ecore_main.c
+++ b/src/lib/ecore/ecore_main.c
@@ -3390,12 +3390,15 @@ _efl_loop_efl_version_get(Eo *obj EINA_UNUSED, 
Efl_Loop_Data *pd EINA_UNUSED)
    return &version;
 }
 
-EOLIAN static Eina_Future_Scheduler *
-_efl_loop_future_scheduler_get(Eo *obj EINA_UNUSED,
-                               Efl_Loop_Data *pd EINA_UNUSED)
+EAPI Eina_Future_Scheduler *
+efl_loop_future_scheduler_get(Eo *obj)
 {
-   return _ecore_event_future_scheduler_get();
-}
+   if (!obj) return NULL;
 
+   if (efl_isa(obj, EFL_LOOP_CLASS))
+     return _ecore_event_future_scheduler_get();
+
+   return efl_loop_future_scheduler_get(efl_loop_get(obj));
+}
 
 #include "efl_loop.eo.c"
diff --git a/src/lib/ecore/efl_loop.eo b/src/lib/ecore/efl_loop.eo
index 1fc0fac9ff..2a24ae737d 100644
--- a/src/lib/ecore/efl_loop.eo
+++ b/src/lib/ecore/efl_loop.eo
@@ -70,18 +70,6 @@ class Efl.Loop (Efl.Object)
             @in exit_code: ubyte; [[Returned value by begin()]]
          }
       }
-      @property future_scheduler {
-         [[Gets the Eina_Future_Scheduler for a given mainloop.
-
-           The Eina_Future_Scheduler returned by this function
-           should be used for creating promises (eina_promise_new())
-           so then can properly schedule resolve/reject events.
-         ]]
-         get {}
-         values {
-             scheduler: ptr(Eina.Future.Scheduler); [[The scheduler.]]
-         }
-      }
       Eina_FutureXXX_job {
          [[A future promise that will be resolved from a clean main
            loop context as soon as possible.
diff --git a/src/lib/ecore/efl_loop_user.c b/src/lib/ecore/efl_loop_user.c
index 4bcfaad41d..530772fc64 100644
--- a/src/lib/ecore/efl_loop_user.c
+++ b/src/lib/ecore/efl_loop_user.c
@@ -29,10 +29,4 @@ _efl_loop_user_efl_object_parent_set(Eo *obj, 
Efl_Loop_User_Data *pd EINA_UNUSED
    efl_parent_set(efl_super(obj, EFL_LOOP_USER_CLASS), parent);
 }
 
-static Eina_Future_Scheduler *
-_efl_loop_user_future_scheduler_get(Eo *obj, Efl_Loop_User_Data *pd 
EINA_UNUSED)
-{
-   return efl_loop_future_scheduler_get(efl_loop_get(obj));
-}
-
 #include "efl_loop_user.eo.c"
diff --git a/src/lib/ecore/efl_loop_user.eo b/src/lib/ecore/efl_loop_user.eo
index 67cc9b3e7d..048888bbca 100644
--- a/src/lib/ecore/efl_loop_user.eo
+++ b/src/lib/ecore/efl_loop_user.eo
@@ -14,18 +14,6 @@ class Efl.Loop_User (Efl.Object)
             loop: Efl.Loop; [[Efl loop]]
          }
       }
-      @property future_scheduler {
-         [[Gets the Eina_Future_Scheduler for a given mainloop.
-
-           The Eina_Future_Scheduler returned by this function
-           should be used for creating promises (eina_promise_new())
-           so then can properly schedule resolve/reject events.
-         ]]
-         get {}
-         values {
-            scheduler: ptr(Eina.Future.Scheduler); [[The scheduler.]]
-         }
-      }
    }
    implements {
       Efl.Object.parent { set; }

-- 


Reply via email to