ecore_exe: remove all legacy usage from eo files

this takes the current generated output from eolian for legacy code in
evas and adds it to the tree, then removes legacy references from the
corresponding eo files. in the case where the entire eo file was for
a legacy object, that eo file has been removed from the tree

ref T7724

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8125
This commit is contained in:
Mike Blumenkrantz 2019-03-06 19:06:16 +00:00 committed by Cedric BAIL
parent 774d6c75f6
commit 1cab2e5fde
10 changed files with 266 additions and 95 deletions

View File

@ -6,7 +6,6 @@ ecore_eolian_files_priv = \
lib/ecore/ecore_event_message_handler.eo
ecore_eolian_files_legacy = \
lib/ecore/ecore_exe.eo \
lib/ecore/efl_loop_timer.eo
ecore_eolian_files_public = \
@ -82,9 +81,17 @@ BUILT_SOURCES += \
ecoreeolianfilesdir = $(datadir)/eolian/include/ecore-@VMAJ@
ecoreeolianfiles_DATA = $(ecore_eolian_files_public) lib/ecore/efl_loop_timer.eo
ecore_legacy_eo_c = \
lib/ecore/ecore_exe_eo.c
ecore_legacy_eo_h = \
lib/ecore/ecore_exe_eo.h \
lib/ecore/ecore_exe_eo.legacy.h
EXTRA_DIST2 += $(ecore_eolian_files)
EXTRA_DIST2 += $(ecore_eolian_files_priv)
EXTRA_DIST2 += $(ecore_test_eolian_files)
EXTRA_DIST2 += $(ecore_legacy_eo_c)
lib_LTLIBRARIES += lib/ecore/libecore.la
@ -96,7 +103,8 @@ lib/ecore/Ecore_Legacy.h \
lib/ecore/Ecore_Eo.h \
lib/ecore/Efl_Core.h \
lib/ecore/efl_general.h \
lib/ecore/Ecore_Getopt.h
lib/ecore/Ecore_Getopt.h \
$(ecore_legacy_eo_h)
nodist_installed_ecoremainheaders_DATA = \
$(ecore_eolian_h)

View File

@ -1032,7 +1032,7 @@ enum _Ecore_Exe_Win32_Priority
};
typedef enum _Ecore_Exe_Win32_Priority Ecore_Exe_Win32_Priority;
#include "ecore_exe.eo.legacy.h"
#include "ecore_exe_eo.legacy.h"
#define _ECORE_EXE_EO_CLASS_TYPE

View File

@ -392,7 +392,7 @@ EAPI void *ecore_idle_exiter_del(Ecore_Idle_Exiter *idle_exiter);
* @{
*/
#include "ecore_exe.eo.legacy.h"
#include "ecore_exe_eo.legacy.h"
/**
* @}

View File

@ -414,4 +414,4 @@ _ecore_exe_event_add_free(void *data EINA_UNUSED,
free(e);
}
#include "ecore_exe.eo.c"
#include "ecore_exe_eo.c"

View File

@ -1,87 +0,0 @@
/* FIXME: The structures are not namespaced correctly. */
struct Ecore.Exe.Event_Data.Line
{
[[A structure which stores information on 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 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 set the executed process as 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 extends Efl.Object implements Efl.Control
{
[[Ecore.Exe is responsible for managing portable process spawning.
With this module you are able to spawn, pause and quit spawned processes.
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.
*/

View File

@ -0,0 +1,57 @@
EWAPI const Efl_Event_Description _ECORE_EXE_EVENT_DATA_GET =
EFL_EVENT_DESCRIPTION("data,get");
EWAPI const Efl_Event_Description _ECORE_EXE_EVENT_DATA_ERROR =
EFL_EVENT_DESCRIPTION("data,error");
void _ecore_exe_command_set(Eo *obj, Ecore_Exe_Data *pd, const char *exe_cmd, Ecore_Exe_Flags flags);
EOAPI EFL_VOID_FUNC_BODYV(ecore_obj_exe_command_set, EFL_FUNC_CALL(exe_cmd, flags), const char *exe_cmd, Ecore_Exe_Flags flags);
void _ecore_exe_command_get(const Eo *obj, Ecore_Exe_Data *pd, const char **exe_cmd, Ecore_Exe_Flags *flags);
EOAPI EFL_VOID_FUNC_BODYV_CONST(ecore_obj_exe_command_get, EFL_FUNC_CALL(exe_cmd, flags), const char **exe_cmd, Ecore_Exe_Flags *flags);
void _ecore_exe_efl_object_destructor(Eo *obj, Ecore_Exe_Data *pd);
Efl_Object *_ecore_exe_efl_object_finalize(Eo *obj, Ecore_Exe_Data *pd);
void _ecore_exe_efl_control_suspend_set(Eo *obj, Ecore_Exe_Data *pd, Eina_Bool suspend);
static Eina_Bool
_ecore_exe_class_initializer(Efl_Class *klass)
{
const Efl_Object_Ops *opsp = NULL;
const Efl_Object_Property_Reflection_Ops *ropsp = NULL;
#ifndef ECORE_EXE_EXTRA_OPS
#define ECORE_EXE_EXTRA_OPS
#endif
EFL_OPS_DEFINE(ops,
EFL_OBJECT_OP_FUNC(ecore_obj_exe_command_set, _ecore_exe_command_set),
EFL_OBJECT_OP_FUNC(ecore_obj_exe_command_get, _ecore_exe_command_get),
EFL_OBJECT_OP_FUNC(efl_destructor, _ecore_exe_efl_object_destructor),
EFL_OBJECT_OP_FUNC(efl_finalize, _ecore_exe_efl_object_finalize),
EFL_OBJECT_OP_FUNC(efl_control_suspend_set, _ecore_exe_efl_control_suspend_set),
ECORE_EXE_EXTRA_OPS
);
opsp = &ops;
return efl_class_functions_set(klass, opsp, ropsp);
}
static const Efl_Class_Description _ecore_exe_class_desc = {
EO_VERSION,
"Ecore.Exe",
EFL_CLASS_TYPE_REGULAR,
sizeof(Ecore_Exe_Data),
_ecore_exe_class_initializer,
NULL,
NULL
};
EFL_DEFINE_CLASS(ecore_exe_class_get, &_ecore_exe_class_desc, EFL_OBJECT_CLASS, EFL_CONTROL_INTERFACE, NULL);

View File

@ -0,0 +1,121 @@
#ifndef _ECORE_EXE_EO_H_
#define _ECORE_EXE_EO_H_
#ifndef _ECORE_EXE_EO_CLASS_TYPE
#define _ECORE_EXE_EO_CLASS_TYPE
typedef Eo Ecore_Exe;
#endif
#ifndef _ECORE_EXE_EO_TYPES
#define _ECORE_EXE_EO_TYPES
/** A structure which stores information on lines data from a child process.
*
* @ingroup Ecore_Exe_Event_Data
*/
typedef struct _Ecore_Exe_Event_Data_Line
{
char *line; /**< The bytes of a line of buffered data */
int size; /**< The size of the line buffer in bytes */
} Ecore_Exe_Event_Data_Line;
/** Ecore exe event data structure
*
* @ingroup Ecore_Exe
*/
typedef struct _Ecore_Exe_Event_Data
{
Efl_Object *exe; /**< The handle to the process. FIXME: should actually be
* Ecore.Exe, workaround cyclic */
void *data; /**< The raw binary data from the child process received */
int size; /**< The size of this data in bytes */
Ecore_Exe_Event_Data_Line *lines; /**< An array of line data if line buffered.
* The last one has its line member set to
* @c NULL */
} Ecore_Exe_Event_Data;
/** Flags for executing a child with its stdin and/or stdout piped back.
*
* @ingroup Ecore
*/
typedef enum
{
ECORE_EXE_NONE = 0, /**< No exe flags at all */
ECORE_EXE_PIPE_READ = 1, /**< Exe Pipe Read mask */
ECORE_EXE_PIPE_WRITE = 2, /**< Exe Pipe Write mask */
ECORE_EXE_PIPE_ERROR = 4, /**< Exe Pipe error mask */
ECORE_EXE_PIPE_READ_LINE_BUFFERED = 8, /**< Reads are buffered until a newline
* and split 1 line per
* Ecore_Exe_Event_Data_Line */
ECORE_EXE_PIPE_ERROR_LINE_BUFFERED = 16, /**< Errors are buffered until a
* newline and split 1 line per
* Ecore_Exe_Event_Data_Line */
ECORE_EXE_PIPE_AUTO = 32, /**< stdout and stderr are buffered automatically */
ECORE_EXE_RESPAWN = 64, /**< FIXME: Exe is restarted if it dies */
ECORE_EXE_USE_SH = 128, /**< Use /bin/sh to run the command. */
ECORE_EXE_NOT_LEADER = 256, /**< Do not use setsid() to set the executed
* process as its own session leader */
ECORE_EXE_TERM_WITH_PARENT = 512, /**< Makes child receive SIGTERM when parent
* dies. */
ECORE_EXE_ISOLATE_IO = 1024 /**< Try and isolate stdin/out and err of the
* process so it isn't shared with the parent. */
} Ecore_Exe_Flags;
#endif
/**
* @brief Ecore.Exe is responsible for managing portable process spawning.
*
* With this module you are able to spawn, pause and quit spawned processes.
* Interaction between your process and those spawned is possible using pipes
* or signals.
*
* @ingroup Ecore_Exe
*/
#define ECORE_EXE_CLASS ecore_exe_class_get()
EWAPI const Efl_Class *ecore_exe_class_get(void);
/**
* @brief Controls the command that's executed. FIXME: May need a split/rename.
*
* @param[in] obj The object.
* @param[in] exe_cmd The command to execute.
* @param[in] flags The execution flags.
*
* @ingroup Ecore_Exe
*/
EOAPI void ecore_obj_exe_command_set(Eo *obj, const char *exe_cmd, Ecore_Exe_Flags flags);
/**
* @brief Controls the command that's executed. FIXME: May need a split/rename.
*
* @param[in] obj The object.
* @param[out] exe_cmd The command to execute.
* @param[out] flags The execution flags.
*
* @ingroup Ecore_Exe
*/
EOAPI void ecore_obj_exe_command_get(const Eo *obj, const char **exe_cmd, Ecore_Exe_Flags *flags);
EWAPI extern const Efl_Event_Description _ECORE_EXE_EVENT_DATA_GET;
/** Data received event from the child process
* @return Ecore_Exe_Event_Data
*
* @ingroup Ecore_Exe
*/
#define ECORE_EXE_EVENT_DATA_GET (&(_ECORE_EXE_EVENT_DATA_GET))
EWAPI extern const Efl_Event_Description _ECORE_EXE_EVENT_DATA_ERROR;
/** Error received event from the child process
* @return Ecore_Exe_Event_Data
*
* @ingroup Ecore_Exe
*/
#define ECORE_EXE_EVENT_DATA_ERROR (&(_ECORE_EXE_EVENT_DATA_ERROR))
#endif

View File

@ -0,0 +1,71 @@
#ifndef _ECORE_EXE_EO_LEGACY_H_
#define _ECORE_EXE_EO_LEGACY_H_
#ifndef _ECORE_EXE_EO_CLASS_TYPE
#define _ECORE_EXE_EO_CLASS_TYPE
typedef Eo Ecore_Exe;
#endif
#ifndef _ECORE_EXE_EO_TYPES
#define _ECORE_EXE_EO_TYPES
/** A structure which stores information on lines data from a child process.
*
* @ingroup Ecore_Exe_Event_Data
*/
typedef struct _Ecore_Exe_Event_Data_Line
{
char *line; /**< The bytes of a line of buffered data */
int size; /**< The size of the line buffer in bytes */
} Ecore_Exe_Event_Data_Line;
/** Ecore exe event data structure
*
* @ingroup Ecore_Exe
*/
typedef struct _Ecore_Exe_Event_Data
{
Efl_Object *exe; /**< The handle to the process. FIXME: should actually be
* Ecore.Exe, workaround cyclic */
void *data; /**< The raw binary data from the child process received */
int size; /**< The size of this data in bytes */
Ecore_Exe_Event_Data_Line *lines; /**< An array of line data if line buffered.
* The last one has its line member set to
* @c NULL */
} Ecore_Exe_Event_Data;
/** Flags for executing a child with its stdin and/or stdout piped back.
*
* @ingroup Ecore
*/
typedef enum
{
ECORE_EXE_NONE = 0, /**< No exe flags at all */
ECORE_EXE_PIPE_READ = 1, /**< Exe Pipe Read mask */
ECORE_EXE_PIPE_WRITE = 2, /**< Exe Pipe Write mask */
ECORE_EXE_PIPE_ERROR = 4, /**< Exe Pipe error mask */
ECORE_EXE_PIPE_READ_LINE_BUFFERED = 8, /**< Reads are buffered until a newline
* and split 1 line per
* Ecore_Exe_Event_Data_Line */
ECORE_EXE_PIPE_ERROR_LINE_BUFFERED = 16, /**< Errors are buffered until a
* newline and split 1 line per
* Ecore_Exe_Event_Data_Line */
ECORE_EXE_PIPE_AUTO = 32, /**< stdout and stderr are buffered automatically */
ECORE_EXE_RESPAWN = 64, /**< FIXME: Exe is restarted if it dies */
ECORE_EXE_USE_SH = 128, /**< Use /bin/sh to run the command. */
ECORE_EXE_NOT_LEADER = 256, /**< Do not use setsid() to set the executed
* process as its own session leader */
ECORE_EXE_TERM_WITH_PARENT = 512, /**< Makes child receive SIGTERM when parent
* dies. */
ECORE_EXE_ISOLATE_IO = 1024 /**< Try and isolate stdin/out and err of the
* process so it isn't shared with the parent. */
} Ecore_Exe_Flags;
#endif
#endif

View File

@ -5,7 +5,7 @@
#include "ecore_internal.h"
#include "ecore_exe.eo.h"
#include "ecore_exe_eo.h"
#include "ecore_event_message.eo.h"
#include "ecore_event_message_handler.eo.h"

View File

@ -2,7 +2,6 @@ ecore_deps = [intl]
ecore_pub_deps = [eina, eo, efl]
pub_legacy_eo_files = [
'ecore_exe.eo',
'ecore_event_message.eo',
'ecore_event_message_handler.eo',
'efl_loop_timer.eo'
@ -107,7 +106,9 @@ ecore_header_src = [
'Ecore_Eo.h',
'Efl_Core.h',
'efl_general.h',
'Ecore_Getopt.h'
'Ecore_Getopt.h',
'ecore_exe_eo.h',
'ecore_exe_eo.legacy.h',
]
ecore_src = [