efl/src/lib/ecore/ecore_exe.eo

88 lines
3.2 KiB
Plaintext

/* FIXME: The structures are not namespaced correctly. */
struct Ecore.Exe.Event_Data.Line
{
[[A structure that stores information of lines data from a child process.]]
line: ptr(char); [[The bytes of a line of buffered data]]
size: int; [[The size of the line buffer in bytes]]
}
/**
* @struct _Ecore_Exe_Event_Data
* @brief A structure that stores information of data from a child process event.
*/
struct Ecore.Exe.Event_Data
{
[[Ecore exe event data structure]]
exe: Efl.Object; [[The handle to the process. FIXME: should actually be Ecore.Exe, workaround cyclic]]
data: void_ptr; [[The raw binary data from the child process that was received]]
size: int; [[The size of this data in bytes]]
lines: ptr(Ecore.Exe.Event_Data.Line); [[An array of line data if line buffered, the last one has its line member set to $NULL]]
}
enum Ecore.Exe_Flags
{
[[Flags for executing a child with its stdin and/or stdout piped back.]]
legacy: ECORE_EXE;
none = 0, [[No exe flags at all]]
pipe_read = 1, [[Exe Pipe Read mask]]
pipe_write = 2, [[Exe Pipe Write mask]]
pipe_error = 4, [[Exe Pipe error mask]]
pipe_read_line_buffered = 8, [[Reads are buffered until a newline and split 1 line per Ecore_Exe_Event_Data_Line]]
pipe_error_line_buffered = 16, [[Errors are buffered until a newline and split 1 line per Ecore_Exe_Event_Data_Line]]
pipe_auto = 32, [[stdout and stderr are buffered automatically]]
respawn = 64, [[FIXME: Exe is restarted if it dies]]
use_sh = 128, [[Use /bin/sh to run the command.]]
not_leader = 256, [[Do not use setsid() to have the executed process be its own session leader]]
term_with_parent = 512, [[Makes child receive SIGTERM when parent dies.]]
isolate_io = 1024, [[Try and isolate stdin/out and err of the process so it isn't shared with the parent.]]
}
class Ecore.Exe (Efl.Object, Efl.Control)
{
[[Ecore.Exe is responsible for managing portable process spawning.
With this module you are able to spawn, pause and quit the spawned processes.
An interaction between your process and those spawned is possible using pipes or signals.
]]
legacy_prefix: ecore_exe;
eo_prefix: ecore_obj_exe;
event_prefix: ecore_exe;
methods {
@property command {
[[Controls the command that's executed. FIXME: May need a split/rename.]]
set {
legacy: null;
}
get {
legacy: null;
}
values {
exe_cmd: string; [[The command to execute.]]
flags: Ecore.Exe_Flags; [[The execution flags.]]
}
}
}
implements {
Efl.Object.destructor;
Efl.Object.finalize;
Efl.Control.suspend { set; }
}
constructors {
.command;
}
events {
data,get: Ecore.Exe.Event_Data; [[Data received event from the child process]]
data,error: Ecore.Exe.Event_Data; [[Error received event from the child process]]
}
}
/* FIXME: Notes:
Should run_priority be a class function?
Instead of having quit, interrupt, bla bla bla, just have an enum and one function? As it's essentially a signal send.
Rename the events.
*/