Ecore exe: Start using the control interface.

This commit is contained in:
Tom Hacohen 2014-08-08 15:13:05 +01:00
parent cc6b02bc22
commit 6e5a35e43e
3 changed files with 17 additions and 12 deletions

View File

@ -2196,6 +2196,7 @@ fi
EFL_PLATFORM_DEPEND([ECORE], [all])
EFL_INTERNAL_DEPEND_PKG([ECORE], [eo])
EFL_INTERNAL_DEPEND_PKG([ECORE], [eina])
EFL_INTERNAL_DEPEND_PKG([ECORE], [efl])
EFL_ADD_LIBS([ECORE], [-lm])

View File

@ -25,6 +25,8 @@
#define MY_CLASS ECORE_EXE_CLASS
#include <Efl.h>
/* FIXME: Getting respawn to work
*
* There is no way that we can do anything about the internal state info of
@ -1062,23 +1064,24 @@ ecore_exe_flags_get(const Ecore_Exe *obj)
EAPI void
ecore_exe_pause(Ecore_Exe *obj)
{
EINA_MAIN_LOOP_CHECK_RETURN;
Ecore_Exe_Data *exe = eo_data_scope_get(obj, MY_CLASS);
if (!eo_isa(obj, MY_CLASS))
return;
kill(exe->pid, SIGSTOP);
eo_do(obj, efl_control_suspend_set(EINA_TRUE));
}
EAPI void
ecore_exe_continue(Ecore_Exe *obj)
{
EINA_MAIN_LOOP_CHECK_RETURN;
Ecore_Exe_Data *exe = eo_data_scope_get(obj, MY_CLASS);
if (!eo_isa(obj, MY_CLASS))
return;
eo_do(obj, efl_control_suspend_set(EINA_FALSE));
}
kill(exe->pid, SIGCONT);
EOLIAN static void
_ecore_exe_efl_control_suspend_set(Eo *obj EINA_UNUSED, Ecore_Exe_Data *exe, Eina_Bool suspend)
{
EINA_MAIN_LOOP_CHECK_RETURN;
if (suspend)
kill(exe->pid, SIGSTOP);
else
kill(exe->pid, SIGCONT);
}
EAPI void

View File

@ -1,4 +1,4 @@
class Ecore.Exe (Eo.Base)
class Ecore.Exe (Eo.Base, Efl.Control)
{
eo_prefix: ecore_obj_exe;
properties {
@ -21,6 +21,7 @@ class Ecore.Exe (Eo.Base)
}
implements {
Eo.Base.finalize;
Efl.Control.suspend.set;
}
events {
data,get: Ecore_Exe_Event_Data;