ecore: make efl_loop_future_scheduler_get shouldn't be exposed in the object function.
authorCedric BAIL <cedric@osg.samsung.com>
Mon, 18 Sep 2017 20:33:34 +0000 (13:33 -0700)
committerCedric BAIL <cedric@osg.samsung.com>
Mon, 18 Sep 2017 20:33:34 +0000 (13:33 -0700)
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
src/lib/ecore/ecore_main.c
src/lib/ecore/efl_loop.eo
src/lib/ecore/efl_loop_user.c
src/lib/ecore/efl_loop_user.eo

index aadd2ba..1be6dbc 100644 (file)
@@ -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"
index 6819a05..967ee72 100644 (file)
@@ -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"
index 1fc0fac..2a24ae7 100644 (file)
@@ -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.
index 4bcfaad..530772f 100644 (file)
@@ -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"
index 67cc9b3..048888b 100644 (file)
@@ -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; }