summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCedric Bail <cedric@osg.samsung.com>2017-10-27 15:31:57 -0700
committerCedric Bail <cedric@osg.samsung.com>2017-10-27 15:34:42 -0700
commit1c8225099414109c8360b078cc27410f2215040a (patch)
tree04188784f2a95b0c421478c5e9d412666b6f34bc /src/lib
parent64fb807b63362fb922caf4a0a917b8f34c3eec10 (diff)
ecore: efl_loop should actually handle exit via Eina_Value.
This is for binding consistency. Example with python : sys.exit("Bye, world") Which with efl would be : loop.quit("Bye, world") T6228
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ecore/ecore_main.c9
-rw-r--r--src/lib/ecore/efl_loop.eo4
2 files changed, 7 insertions, 6 deletions
diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c
index 8fef249cfe..149df63006 100644
--- a/src/lib/ecore/ecore_main.c
+++ b/src/lib/ecore/ecore_main.c
@@ -285,7 +285,7 @@ int in_main_loop = 0;
285 285
286static Eina_List *_pending_futures = NULL; 286static Eina_List *_pending_futures = NULL;
287static Eina_List *_pending_promises = NULL; 287static Eina_List *_pending_promises = NULL;
288static unsigned char _ecore_exit_code = 0; 288static Eina_Value _ecore_exit_code = EINA_VALUE_EMPTY;
289static int do_quit = 0; 289static int do_quit = 0;
290static Ecore_Fd_Handler *fd_handlers = NULL; 290static Ecore_Fd_Handler *fd_handlers = NULL;
291static Ecore_Fd_Handler *fd_handler_current = NULL; 291static Ecore_Fd_Handler *fd_handler_current = NULL;
@@ -2852,15 +2852,16 @@ EOLIAN static int _efl_loop_iterate_may_block(Eo *obj EINA_UNUSED, Efl_Loop_Data
2852 return ecore_main_loop_iterate_may_block(may_block); 2852 return ecore_main_loop_iterate_may_block(may_block);
2853} 2853}
2854 2854
2855EOLIAN static unsigned char 2855// FIXME: This should return an Eina_Value, but that doesn't work at the moment
2856EOLIAN static Eina_Value *
2856_efl_loop_begin(Eo *obj EINA_UNUSED, Efl_Loop_Data *pd EINA_UNUSED) 2857_efl_loop_begin(Eo *obj EINA_UNUSED, Efl_Loop_Data *pd EINA_UNUSED)
2857{ 2858{
2858 ecore_main_loop_begin(); 2859 ecore_main_loop_begin();
2859 return _ecore_exit_code; 2860 return &_ecore_exit_code;
2860} 2861}
2861 2862
2862EOLIAN static void 2863EOLIAN static void
2863_efl_loop_quit(Eo *obj EINA_UNUSED, Efl_Loop_Data *pd EINA_UNUSED, unsigned char exit_code) 2864_efl_loop_quit(Eo *obj EINA_UNUSED, Efl_Loop_Data *pd EINA_UNUSED, Eina_Value exit_code)
2864{ 2865{
2865 ecore_main_loop_quit(); 2866 ecore_main_loop_quit();
2866 _ecore_exit_code = exit_code; 2867 _ecore_exit_code = exit_code;
diff --git a/src/lib/ecore/efl_loop.eo b/src/lib/ecore/efl_loop.eo
index b1e725de5d..bb70a8f377 100644
--- a/src/lib/ecore/efl_loop.eo
+++ b/src/lib/ecore/efl_loop.eo
@@ -61,13 +61,13 @@ class Efl.Loop (Efl.Object)
61 } 61 }
62 begin { 62 begin {
63 [[Runs the application main loop.]] 63 [[Runs the application main loop.]]
64 return: ubyte; [[Value set by quit()]] 64 return: any_value_ptr; [[Value set by quit()]]
65 } 65 }
66 quit { 66 quit {
67 [[Quits the main loop once all the events currently on the queue have 67 [[Quits the main loop once all the events currently on the queue have
68 been processed.]] 68 been processed.]]
69 params { 69 params {
70 @in exit_code: ubyte; [[Returned value by begin()]] 70 @in exit_code: any_value; [[Returned value by begin()]]
71 } 71 }
72 } 72 }
73 Eina_FutureXXX_job { 73 Eina_FutureXXX_job {