efl: move signal events from efl.loop to efl.app

these are process-wide and not loop-specific
This commit is contained in:
Mike Blumenkrantz 2018-02-26 13:40:41 -05:00
parent 3e94be5d73
commit 3dbca39f98
3 changed files with 11 additions and 15 deletions

View File

@ -46,7 +46,7 @@ typedef struct _Signal_Data
} Signal_Data;
static Eina_Bool
_ecore_signal_pipe_read(Eo *obj)
_ecore_signal_pipe_read(Eo *obj EINA_UNUSED)
{
Signal_Data sdata;
int ret;
@ -74,14 +74,10 @@ _ecore_signal_pipe_read(Eo *obj)
ecore_event_add(ECORE_EVENT_SIGNAL_USER, e,
_ecore_signal_generic_free, NULL);
}
Eo *loop = efl_provider_find(obj, EFL_LOOP_CLASS);
if (loop)
{
if (sdata.sig == SIGUSR1)
efl_event_callback_call(loop, EFL_LOOP_EVENT_SIGNAL_USR1, NULL);
else
efl_event_callback_call(loop, EFL_LOOP_EVENT_SIGNAL_USR2, NULL);
}
if (sdata.sig == SIGUSR1)
efl_event_callback_call(_efl_app, EFL_APP_EVENT_SIGNAL_USR1, NULL);
else
efl_event_callback_call(_efl_app, EFL_APP_EVENT_SIGNAL_USR2, NULL);
}
break;
case SIGHUP:
@ -93,9 +89,7 @@ _ecore_signal_pipe_read(Eo *obj)
ecore_event_add(ECORE_EVENT_SIGNAL_HUP, e,
_ecore_signal_generic_free, NULL);
}
Eo *loop = efl_provider_find(obj, EFL_LOOP_CLASS);
if (loop)
efl_event_callback_call(loop, EFL_LOOP_EVENT_SIGNAL_HUP, NULL);
efl_event_callback_call(_efl_app, EFL_APP_EVENT_SIGNAL_HUP, NULL);
}
break;
case SIGQUIT:

View File

@ -38,6 +38,11 @@ class Efl.App (Efl.Object)
}
}
}
events {
signal,usr1; [[System specific, but on unix maps to SIGUSR1 signal to the process - only called on main loop object]]
signal,usr2; [[System specific, but on unix maps to SIGUSR2 signal to the process - only called on main loop object]]
signal,hup; [[System specific, but on unix maps to SIGHUP signal to the process - only called on main loop object]]
}
implements {
Efl.Object.constructor;
Efl.Object.destructor;

View File

@ -124,9 +124,6 @@ class Efl.Loop (Efl.Task)
pause; [[Called when the window is not going be displayed for some time]]
resume; [[Called before a window is rendered after a pause event]]
terminate; [[Called before starting the shutdown of Elementary]]
signal,usr1; [[System specific, but on unix maps to SIGUSR1 signal to the process - only called on main loop object]]
signal,usr2; [[System specific, but on unix maps to SIGUSR2 signal to the process - only called on main loop object]]
signal,hup; [[System specific, but on unix maps to SIGHUP signal to the process - only called on main loop object]]
}
implements {
Efl.Object.constructor;