forked from enlightenment/efl
ecore: add the possibility to return an exit code when leaving the main loop.
This commit is contained in:
parent
9bc1ad102a
commit
f441859bfb
|
@ -273,6 +273,7 @@ static int _ecore_main_win32_select(int nfds,
|
|||
static void _ecore_main_win32_handlers_cleanup(void);
|
||||
#endif
|
||||
|
||||
static unsigned char _ecore_exit_code = 0;
|
||||
static int in_main_loop = 0;
|
||||
static int do_quit = 0;
|
||||
static Ecore_Fd_Handler *fd_handlers = NULL;
|
||||
|
@ -2733,16 +2734,18 @@ EOLIAN static int _efl_loop_iterate_may_block(Eo *obj EINA_UNUSED, Efl_Loop_Data
|
|||
return ecore_main_loop_iterate_may_block(may_block);
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
EOLIAN static unsigned char
|
||||
_efl_loop_begin(Eo *obj EINA_UNUSED, Efl_Loop_Data *pd EINA_UNUSED)
|
||||
{
|
||||
ecore_main_loop_begin();
|
||||
return _ecore_exit_code;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_loop_quit(Eo *obj EINA_UNUSED, Efl_Loop_Data *pd EINA_UNUSED)
|
||||
_efl_loop_quit(Eo *obj EINA_UNUSED, Efl_Loop_Data *pd EINA_UNUSED, unsigned char exit_code)
|
||||
{
|
||||
ecore_main_loop_quit();
|
||||
_ecore_exit_code = exit_code;
|
||||
}
|
||||
|
||||
EOLIAN static Eo_Base *
|
||||
|
|
|
@ -29,10 +29,14 @@ class Efl.Loop (Eo.Base)
|
|||
}
|
||||
begin {
|
||||
[[Runs the application main loop.]]
|
||||
return: ubyte; [[Value set by quit()]]
|
||||
}
|
||||
quit {
|
||||
[[Quits the main loop once all the events currently on the queue have
|
||||
been processed.]]
|
||||
params {
|
||||
@in exit_code: ubyte; [[Returned value by begin()]]
|
||||
}
|
||||
}
|
||||
job {
|
||||
[[Will execute that promise in the near future.]]
|
||||
|
|
Loading…
Reference in New Issue