summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2019-03-06 19:06:16 +0000
committerCedric BAIL <cedric.bail@free.fr>2019-03-06 13:02:49 -0800
commit1cab2e5fde3ac0c8542e8e42b143593ea2ffb314 (patch)
tree9090e32333a6fa3905c6d2b31f2239e66dcd3545
parent774d6c75f6c26730e6bf1b3d8c905813c91e7cfe (diff)
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
-rw-r--r--src/Makefile_Ecore.am12
-rw-r--r--src/lib/ecore/Ecore_Common.h2
-rw-r--r--src/lib/ecore/Ecore_Legacy.h2
-rw-r--r--src/lib/ecore/ecore_exe.c2
-rw-r--r--src/lib/ecore/ecore_exe.eo87
-rw-r--r--src/lib/ecore/ecore_exe_eo.c57
-rw-r--r--src/lib/ecore/ecore_exe_eo.h121
-rw-r--r--src/lib/ecore/ecore_exe_eo.legacy.h71
-rw-r--r--src/lib/ecore/ecore_private.h2
-rw-r--r--src/lib/ecore/meson.build5
10 files changed, 266 insertions, 95 deletions
diff --git a/src/Makefile_Ecore.am b/src/Makefile_Ecore.am
index bb96907..70f5692 100644
--- a/src/Makefile_Ecore.am
+++ b/src/Makefile_Ecore.am
@@ -6,7 +6,6 @@ ecore_eolian_files_priv = \
6 lib/ecore/ecore_event_message_handler.eo 6 lib/ecore/ecore_event_message_handler.eo
7 7
8ecore_eolian_files_legacy = \ 8ecore_eolian_files_legacy = \
9 lib/ecore/ecore_exe.eo \
10 lib/ecore/efl_loop_timer.eo 9 lib/ecore/efl_loop_timer.eo
11 10
12ecore_eolian_files_public = \ 11ecore_eolian_files_public = \
@@ -82,9 +81,17 @@ BUILT_SOURCES += \
82ecoreeolianfilesdir = $(datadir)/eolian/include/ecore-@VMAJ@ 81ecoreeolianfilesdir = $(datadir)/eolian/include/ecore-@VMAJ@
83ecoreeolianfiles_DATA = $(ecore_eolian_files_public) lib/ecore/efl_loop_timer.eo 82ecoreeolianfiles_DATA = $(ecore_eolian_files_public) lib/ecore/efl_loop_timer.eo
84 83
84ecore_legacy_eo_c = \
85lib/ecore/ecore_exe_eo.c
86
87ecore_legacy_eo_h = \
88lib/ecore/ecore_exe_eo.h \
89lib/ecore/ecore_exe_eo.legacy.h
90
85EXTRA_DIST2 += $(ecore_eolian_files) 91EXTRA_DIST2 += $(ecore_eolian_files)
86EXTRA_DIST2 += $(ecore_eolian_files_priv) 92EXTRA_DIST2 += $(ecore_eolian_files_priv)
87EXTRA_DIST2 += $(ecore_test_eolian_files) 93EXTRA_DIST2 += $(ecore_test_eolian_files)
94EXTRA_DIST2 += $(ecore_legacy_eo_c)
88 95
89lib_LTLIBRARIES += lib/ecore/libecore.la 96lib_LTLIBRARIES += lib/ecore/libecore.la
90 97
@@ -96,7 +103,8 @@ lib/ecore/Ecore_Legacy.h \
96lib/ecore/Ecore_Eo.h \ 103lib/ecore/Ecore_Eo.h \
97lib/ecore/Efl_Core.h \ 104lib/ecore/Efl_Core.h \
98lib/ecore/efl_general.h \ 105lib/ecore/efl_general.h \
99lib/ecore/Ecore_Getopt.h 106lib/ecore/Ecore_Getopt.h \
107$(ecore_legacy_eo_h)
100 108
101nodist_installed_ecoremainheaders_DATA = \ 109nodist_installed_ecoremainheaders_DATA = \
102 $(ecore_eolian_h) 110 $(ecore_eolian_h)
diff --git a/src/lib/ecore/Ecore_Common.h b/src/lib/ecore/Ecore_Common.h
index 060ffe8..6b0d949 100644
--- a/src/lib/ecore/Ecore_Common.h
+++ b/src/lib/ecore/Ecore_Common.h
@@ -1032,7 +1032,7 @@ enum _Ecore_Exe_Win32_Priority
1032}; 1032};
1033typedef enum _Ecore_Exe_Win32_Priority Ecore_Exe_Win32_Priority; 1033typedef enum _Ecore_Exe_Win32_Priority Ecore_Exe_Win32_Priority;
1034 1034
1035#include "ecore_exe.eo.legacy.h" 1035#include "ecore_exe_eo.legacy.h"
1036 1036
1037#define _ECORE_EXE_EO_CLASS_TYPE 1037#define _ECORE_EXE_EO_CLASS_TYPE
1038 1038
diff --git a/src/lib/ecore/Ecore_Legacy.h b/src/lib/ecore/Ecore_Legacy.h
index 94c4250..e47f07b 100644
--- a/src/lib/ecore/Ecore_Legacy.h
+++ b/src/lib/ecore/Ecore_Legacy.h
@@ -392,7 +392,7 @@ EAPI void *ecore_idle_exiter_del(Ecore_Idle_Exiter *idle_exiter);
392 * @{ 392 * @{
393 */ 393 */
394 394
395#include "ecore_exe.eo.legacy.h" 395#include "ecore_exe_eo.legacy.h"
396 396
397/** 397/**
398 * @} 398 * @}
diff --git a/src/lib/ecore/ecore_exe.c b/src/lib/ecore/ecore_exe.c
index 674ca51..9bd1dec 100644
--- a/src/lib/ecore/ecore_exe.c
+++ b/src/lib/ecore/ecore_exe.c
@@ -414,4 +414,4 @@ _ecore_exe_event_add_free(void *data EINA_UNUSED,
414 free(e); 414 free(e);
415} 415}
416 416
417#include "ecore_exe.eo.c" 417#include "ecore_exe_eo.c"
diff --git a/src/lib/ecore/ecore_exe.eo b/src/lib/ecore/ecore_exe.eo
deleted file mode 100644
index 899d8a0..0000000
--- a/src/lib/ecore/ecore_exe.eo
+++ /dev/null
@@ -1,87 +0,0 @@
1/* FIXME: The structures are not namespaced correctly. */
2
3struct Ecore.Exe.Event_Data.Line
4{
5 [[A structure which stores information on lines data from a child process.]]
6 line: ptr(char); [[The bytes of a line of buffered data]]
7 size: int; [[The size of the line buffer in bytes]]
8}
9
10/**
11 * @struct _Ecore_Exe_Event_Data
12 * @brief A structure that stores information of data from a child process event.
13 */
14struct Ecore.Exe.Event_Data
15{
16 [[Ecore exe event data structure]]
17 exe: Efl.Object; [[The handle to the process. FIXME: should actually be Ecore.Exe, workaround cyclic]]
18 data: void_ptr; [[The raw binary data from the child process received]]
19 size: int; [[The size of this data in bytes]]
20 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]]
21}
22
23enum Ecore.Exe_Flags
24{
25 [[Flags for executing a child with its stdin and/or stdout piped back.]]
26 legacy: ECORE_EXE;
27
28 none = 0, [[No exe flags at all]]
29 pipe_read = 1, [[Exe Pipe Read mask]]
30 pipe_write = 2, [[Exe Pipe Write mask]]
31 pipe_error = 4, [[Exe Pipe error mask]]
32 pipe_read_line_buffered = 8, [[Reads are buffered until a newline and split 1 line per Ecore_Exe_Event_Data_Line]]
33 pipe_error_line_buffered = 16, [[Errors are buffered until a newline and split 1 line per Ecore_Exe_Event_Data_Line]]
34 pipe_auto = 32, [[stdout and stderr are buffered automatically]]
35 respawn = 64, [[FIXME: Exe is restarted if it dies]]
36 use_sh = 128, [[Use /bin/sh to run the command.]]
37 not_leader = 256, [[Do not use setsid() to set the executed process as its own session leader]]
38 term_with_parent = 512, [[Makes child receive SIGTERM when parent dies.]]
39 isolate_io = 1024, [[Try and isolate stdin/out and err of the process so it isn't shared with the parent.]]
40}
41
42class Ecore.Exe extends Efl.Object implements Efl.Control
43{
44 [[Ecore.Exe is responsible for managing portable process spawning.
45
46 With this module you are able to spawn, pause and quit spawned processes.
47 Interaction between your process and those spawned is possible using pipes or signals.
48 ]]
49
50 legacy_prefix: ecore_exe;
51 eo_prefix: ecore_obj_exe;
52 event_prefix: ecore_exe;
53 methods {
54 @property command {
55 [[Controls the command that's executed. FIXME: May need a split/rename.]]
56 set {
57 legacy: null;
58 }
59 get {
60 legacy: null;
61 }
62 values {
63 exe_cmd: string; [[The command to execute.]]
64 flags: Ecore.Exe_Flags; [[The execution flags.]]
65 }
66 }
67 }
68 implements {
69 Efl.Object.destructor;
70 Efl.Object.finalize;
71 Efl.Control.suspend { set; }
72 }
73 constructors {
74 .command;
75 }
76 events {
77 data,get: Ecore.Exe.Event_Data; [[Data received event from the child process]]
78 data,error: Ecore.Exe.Event_Data; [[Error received event from the child process]]
79 }
80}
81
82/* FIXME: Notes:
83 Should run_priority be a class function?
84 Instead of having quit, interrupt, bla bla bla, just have an enum and one function? As it's essentially a signal send.
85
86 Rename the events.
87*/
diff --git a/src/lib/ecore/ecore_exe_eo.c b/src/lib/ecore/ecore_exe_eo.c
new file mode 100644
index 0000000..6a1775a
--- /dev/null
+++ b/src/lib/ecore/ecore_exe_eo.c
@@ -0,0 +1,57 @@
1EWAPI const Efl_Event_Description _ECORE_EXE_EVENT_DATA_GET =
2 EFL_EVENT_DESCRIPTION("data,get");
3EWAPI const Efl_Event_Description _ECORE_EXE_EVENT_DATA_ERROR =
4 EFL_EVENT_DESCRIPTION("data,error");
5
6void _ecore_exe_command_set(Eo *obj, Ecore_Exe_Data *pd, const char *exe_cmd, Ecore_Exe_Flags flags);
7
8EOAPI EFL_VOID_FUNC_BODYV(ecore_obj_exe_command_set, EFL_FUNC_CALL(exe_cmd, flags), const char *exe_cmd, Ecore_Exe_Flags flags);
9
10void _ecore_exe_command_get(const Eo *obj, Ecore_Exe_Data *pd, const char **exe_cmd, Ecore_Exe_Flags *flags);
11
12EOAPI EFL_VOID_FUNC_BODYV_CONST(ecore_obj_exe_command_get, EFL_FUNC_CALL(exe_cmd, flags), const char **exe_cmd, Ecore_Exe_Flags *flags);
13
14void _ecore_exe_efl_object_destructor(Eo *obj, Ecore_Exe_Data *pd);
15
16
17Efl_Object *_ecore_exe_efl_object_finalize(Eo *obj, Ecore_Exe_Data *pd);
18
19
20void _ecore_exe_efl_control_suspend_set(Eo *obj, Ecore_Exe_Data *pd, Eina_Bool suspend);
21
22
23static Eina_Bool
24_ecore_exe_class_initializer(Efl_Class *klass)
25{
26 const Efl_Object_Ops *opsp = NULL;
27
28 const Efl_Object_Property_Reflection_Ops *ropsp = NULL;
29
30#ifndef ECORE_EXE_EXTRA_OPS
31#define ECORE_EXE_EXTRA_OPS
32#endif
33
34 EFL_OPS_DEFINE(ops,
35 EFL_OBJECT_OP_FUNC(ecore_obj_exe_command_set, _ecore_exe_command_set),
36 EFL_OBJECT_OP_FUNC(ecore_obj_exe_command_get, _ecore_exe_command_get),
37 EFL_OBJECT_OP_FUNC(efl_destructor, _ecore_exe_efl_object_destructor),
38 EFL_OBJECT_OP_FUNC(efl_finalize, _ecore_exe_efl_object_finalize),
39 EFL_OBJECT_OP_FUNC(efl_control_suspend_set, _ecore_exe_efl_control_suspend_set),
40 ECORE_EXE_EXTRA_OPS
41 );
42 opsp = &ops;
43
44 return efl_class_functions_set(klass, opsp, ropsp);
45}
46
47static const Efl_Class_Description _ecore_exe_class_desc = {
48 EO_VERSION,
49 "Ecore.Exe",
50 EFL_CLASS_TYPE_REGULAR,
51 sizeof(Ecore_Exe_Data),
52 _ecore_exe_class_initializer,
53 NULL,
54 NULL
55};
56
57EFL_DEFINE_CLASS(ecore_exe_class_get, &_ecore_exe_class_desc, EFL_OBJECT_CLASS, EFL_CONTROL_INTERFACE, NULL);
diff --git a/src/lib/ecore/ecore_exe_eo.h b/src/lib/ecore/ecore_exe_eo.h
new file mode 100644
index 0000000..fa8ecb0
--- /dev/null
+++ b/src/lib/ecore/ecore_exe_eo.h
@@ -0,0 +1,121 @@
1#ifndef _ECORE_EXE_EO_H_
2#define _ECORE_EXE_EO_H_
3
4#ifndef _ECORE_EXE_EO_CLASS_TYPE
5#define _ECORE_EXE_EO_CLASS_TYPE
6
7typedef Eo Ecore_Exe;
8
9#endif
10
11#ifndef _ECORE_EXE_EO_TYPES
12#define _ECORE_EXE_EO_TYPES
13
14/** A structure which stores information on lines data from a child process.
15 *
16 * @ingroup Ecore_Exe_Event_Data
17 */
18typedef struct _Ecore_Exe_Event_Data_Line
19{
20 char *line; /**< The bytes of a line of buffered data */
21 int size; /**< The size of the line buffer in bytes */
22} Ecore_Exe_Event_Data_Line;
23
24/** Ecore exe event data structure
25 *
26 * @ingroup Ecore_Exe
27 */
28typedef struct _Ecore_Exe_Event_Data
29{
30 Efl_Object *exe; /**< The handle to the process. FIXME: should actually be
31 * Ecore.Exe, workaround cyclic */
32 void *data; /**< The raw binary data from the child process received */
33 int size; /**< The size of this data in bytes */
34 Ecore_Exe_Event_Data_Line *lines; /**< An array of line data if line buffered.
35 * The last one has its line member set to
36 * @c NULL */
37} Ecore_Exe_Event_Data;
38
39/** Flags for executing a child with its stdin and/or stdout piped back.
40 *
41 * @ingroup Ecore
42 */
43typedef enum
44{
45 ECORE_EXE_NONE = 0, /**< No exe flags at all */
46 ECORE_EXE_PIPE_READ = 1, /**< Exe Pipe Read mask */
47 ECORE_EXE_PIPE_WRITE = 2, /**< Exe Pipe Write mask */
48 ECORE_EXE_PIPE_ERROR = 4, /**< Exe Pipe error mask */
49 ECORE_EXE_PIPE_READ_LINE_BUFFERED = 8, /**< Reads are buffered until a newline
50 * and split 1 line per
51 * Ecore_Exe_Event_Data_Line */
52 ECORE_EXE_PIPE_ERROR_LINE_BUFFERED = 16, /**< Errors are buffered until a
53 * newline and split 1 line per
54 * Ecore_Exe_Event_Data_Line */
55 ECORE_EXE_PIPE_AUTO = 32, /**< stdout and stderr are buffered automatically */
56 ECORE_EXE_RESPAWN = 64, /**< FIXME: Exe is restarted if it dies */
57 ECORE_EXE_USE_SH = 128, /**< Use /bin/sh to run the command. */
58 ECORE_EXE_NOT_LEADER = 256, /**< Do not use setsid() to set the executed
59 * process as its own session leader */
60 ECORE_EXE_TERM_WITH_PARENT = 512, /**< Makes child receive SIGTERM when parent
61 * dies. */
62 ECORE_EXE_ISOLATE_IO = 1024 /**< Try and isolate stdin/out and err of the
63 * process so it isn't shared with the parent. */
64} Ecore_Exe_Flags;
65
66
67#endif
68/**
69 * @brief Ecore.Exe is responsible for managing portable process spawning.
70 *
71 * With this module you are able to spawn, pause and quit spawned processes.
72 * Interaction between your process and those spawned is possible using pipes
73 * or signals.
74 *
75 * @ingroup Ecore_Exe
76 */
77#define ECORE_EXE_CLASS ecore_exe_class_get()
78
79EWAPI const Efl_Class *ecore_exe_class_get(void);
80
81/**
82 * @brief Controls the command that's executed. FIXME: May need a split/rename.
83 *
84 * @param[in] obj The object.
85 * @param[in] exe_cmd The command to execute.
86 * @param[in] flags The execution flags.
87 *
88 * @ingroup Ecore_Exe
89 */
90EOAPI void ecore_obj_exe_command_set(Eo *obj, const char *exe_cmd, Ecore_Exe_Flags flags);
91
92/**
93 * @brief Controls the command that's executed. FIXME: May need a split/rename.
94 *
95 * @param[in] obj The object.
96 * @param[out] exe_cmd The command to execute.
97 * @param[out] flags The execution flags.
98 *
99 * @ingroup Ecore_Exe
100 */
101EOAPI void ecore_obj_exe_command_get(const Eo *obj, const char **exe_cmd, Ecore_Exe_Flags *flags);
102
103EWAPI extern const Efl_Event_Description _ECORE_EXE_EVENT_DATA_GET;
104
105/** Data received event from the child process
106 * @return Ecore_Exe_Event_Data
107 *
108 * @ingroup Ecore_Exe
109 */
110#define ECORE_EXE_EVENT_DATA_GET (&(_ECORE_EXE_EVENT_DATA_GET))
111
112EWAPI extern const Efl_Event_Description _ECORE_EXE_EVENT_DATA_ERROR;
113
114/** Error received event from the child process
115 * @return Ecore_Exe_Event_Data
116 *
117 * @ingroup Ecore_Exe
118 */
119#define ECORE_EXE_EVENT_DATA_ERROR (&(_ECORE_EXE_EVENT_DATA_ERROR))
120
121#endif
diff --git a/src/lib/ecore/ecore_exe_eo.legacy.h b/src/lib/ecore/ecore_exe_eo.legacy.h
new file mode 100644
index 0000000..e4dfca8
--- /dev/null
+++ b/src/lib/ecore/ecore_exe_eo.legacy.h
@@ -0,0 +1,71 @@
1#ifndef _ECORE_EXE_EO_LEGACY_H_
2#define _ECORE_EXE_EO_LEGACY_H_
3
4#ifndef _ECORE_EXE_EO_CLASS_TYPE
5#define _ECORE_EXE_EO_CLASS_TYPE
6
7typedef Eo Ecore_Exe;
8
9#endif
10
11#ifndef _ECORE_EXE_EO_TYPES
12#define _ECORE_EXE_EO_TYPES
13
14/** A structure which stores information on lines data from a child process.
15 *
16 * @ingroup Ecore_Exe_Event_Data
17 */
18typedef struct _Ecore_Exe_Event_Data_Line
19{
20 char *line; /**< The bytes of a line of buffered data */
21 int size; /**< The size of the line buffer in bytes */
22} Ecore_Exe_Event_Data_Line;
23
24/** Ecore exe event data structure
25 *
26 * @ingroup Ecore_Exe
27 */
28typedef struct _Ecore_Exe_Event_Data
29{
30 Efl_Object *exe; /**< The handle to the process. FIXME: should actually be
31 * Ecore.Exe, workaround cyclic */
32 void *data; /**< The raw binary data from the child process received */
33 int size; /**< The size of this data in bytes */
34 Ecore_Exe_Event_Data_Line *lines; /**< An array of line data if line buffered.
35 * The last one has its line member set to
36 * @c NULL */
37} Ecore_Exe_Event_Data;
38
39/** Flags for executing a child with its stdin and/or stdout piped back.
40 *
41 * @ingroup Ecore
42 */
43typedef enum
44{
45 ECORE_EXE_NONE = 0, /**< No exe flags at all */
46 ECORE_EXE_PIPE_READ = 1, /**< Exe Pipe Read mask */
47 ECORE_EXE_PIPE_WRITE = 2, /**< Exe Pipe Write mask */
48 ECORE_EXE_PIPE_ERROR = 4, /**< Exe Pipe error mask */
49 ECORE_EXE_PIPE_READ_LINE_BUFFERED = 8, /**< Reads are buffered until a newline
50 * and split 1 line per
51 * Ecore_Exe_Event_Data_Line */
52 ECORE_EXE_PIPE_ERROR_LINE_BUFFERED = 16, /**< Errors are buffered until a
53 * newline and split 1 line per
54 * Ecore_Exe_Event_Data_Line */
55 ECORE_EXE_PIPE_AUTO = 32, /**< stdout and stderr are buffered automatically */
56 ECORE_EXE_RESPAWN = 64, /**< FIXME: Exe is restarted if it dies */
57 ECORE_EXE_USE_SH = 128, /**< Use /bin/sh to run the command. */
58 ECORE_EXE_NOT_LEADER = 256, /**< Do not use setsid() to set the executed
59 * process as its own session leader */
60 ECORE_EXE_TERM_WITH_PARENT = 512, /**< Makes child receive SIGTERM when parent
61 * dies. */
62 ECORE_EXE_ISOLATE_IO = 1024 /**< Try and isolate stdin/out and err of the
63 * process so it isn't shared with the parent. */
64} Ecore_Exe_Flags;
65
66
67#endif
68
69
70
71#endif
diff --git a/src/lib/ecore/ecore_private.h b/src/lib/ecore/ecore_private.h
index 7311aef..2022526 100644
--- a/src/lib/ecore/ecore_private.h
+++ b/src/lib/ecore/ecore_private.h
@@ -5,7 +5,7 @@
5 5
6#include "ecore_internal.h" 6#include "ecore_internal.h"
7 7
8#include "ecore_exe.eo.h" 8#include "ecore_exe_eo.h"
9#include "ecore_event_message.eo.h" 9#include "ecore_event_message.eo.h"
10#include "ecore_event_message_handler.eo.h" 10#include "ecore_event_message_handler.eo.h"
11 11
diff --git a/src/lib/ecore/meson.build b/src/lib/ecore/meson.build
index 88dcc71..959a8bb 100644
--- a/src/lib/ecore/meson.build
+++ b/src/lib/ecore/meson.build
@@ -2,7 +2,6 @@ ecore_deps = [intl]
2ecore_pub_deps = [eina, eo, efl] 2ecore_pub_deps = [eina, eo, efl]
3 3
4pub_legacy_eo_files = [ 4pub_legacy_eo_files = [
5 'ecore_exe.eo',
6 'ecore_event_message.eo', 5 'ecore_event_message.eo',
7 'ecore_event_message_handler.eo', 6 'ecore_event_message_handler.eo',
8 'efl_loop_timer.eo' 7 'efl_loop_timer.eo'
@@ -107,7 +106,9 @@ ecore_header_src = [
107 'Ecore_Eo.h', 106 'Ecore_Eo.h',
108 'Efl_Core.h', 107 'Efl_Core.h',
109 'efl_general.h', 108 'efl_general.h',
110 'Ecore_Getopt.h' 109 'Ecore_Getopt.h',
110 'ecore_exe_eo.h',
111 'ecore_exe_eo.legacy.h',
111] 112]
112 113
113ecore_src = [ 114ecore_src = [