summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYakov Goldberg <yakov.g@samsung.com>2012-12-09 10:39:41 +0200
committerYakov Goldberg <yakov.g@samsung.com>2012-12-09 10:39:41 +0200
commit88c4f720ba1813fa8a1680e46ba341870987767b (patch)
treebe136eb038ca6723c9aaa674d52e9a79a7ed5faf
parenteaaf1a4a746ace055d6b8e9b2c3e9d5917238cf8 (diff)
DEV_README updated
Signed-off-by: Yakov Goldberg <yakov.g@samsung.com>
-rw-r--r--DEV_README221
1 files changed, 113 insertions, 108 deletions
diff --git a/DEV_README b/DEV_README
index 1feb9f0..c6a2017 100644
--- a/DEV_README
+++ b/DEV_README
@@ -1,4 +1,110 @@
1 1
2Yakov Goldberg <yakov.g@samsung.com>
3
4EO introspection is set of tools to generate high-level
5language bindings for C libraries based on Eo(E Object) library,
6 Usual workflow:
7 - parsing C-sources and generating XML
8 - generating source files, makefiles
9 < include additional modules
10 - compile module
11
12 This document describes current development issues,
13 and supposes, that reader has some knowledge
14 about Eo, Elementary, Python and JS bindings
15
16
17Generating function names
18
19 Issues:
20 Names of funcs to be generated, name clashes.
21
22 In the beginning there was idea to cut func name from OP_ID.
23
24 There is OP_ID 'SOME_CLASS_SUB_ID_COLOR_GET' and public function
25 'some_class_color_get()' which connected with OP_ID,
26 so 'color_get()' will be generated.
27
28 If there is another class ANOTHER_CLASS(SOME_CLASS) with
29 'ANOTHER_CLASS_SUB_ID_COLOR_GET' and 'another_class_color_get()'
30 public function, another 'color_get()' func will be generated.
31
32 I don't check for names clash.
33 There won't be an error and function will be simply overloaded,
34 but it will be completely wrong.
35
36 There shouldn't be function overloading at all, that's all done
37 in library itself, in bindings I call only for most base func.
38
39 Contflict should be resolved in library itself. If we want single
40 'color_set()' for all classes, they need to be overloaded
41 in proper way.
42
43 At the moment full names like some_class_color_set() and
44 another_class_color_set() will be generated.
45
46Properties names parsing
47 If func name ends with '_set'/'_get'
48 parameters are checked on direction 'in' for 'set' prop
49 and on 'out' for 'get' prop.
50 If it's wrong, this function will be generated as a method.
51
52 Too common implementation. Need to provide descriptions(comments).
53
54
55
56Parameter's Types;
57 Basic types can be detected;
58 also "types" file can be provided which says how to cas to basic types:
59 <type from="Evas_Font_Size" to="int"/>
60 <type from="Eo_Callback_Priority" to="short"/>
61 <type from="Evas_Smart" to="Eo"/>
62
63 if some type wasn't found, function will not be generated.
64
65 Issues:
66 Types like Eina_List, arrays, structs?
67 can be done by providing descriptions(comments), but requires work.
68
69 Returning existing Object or new one.
70 Need to check returning instance with eo_base_data_get();
71 if o != NULL:
72 return o
73 else: ( need to create one:)
74 get class name,
75 find constructor
76 create object
77
78 Requires work.
79
80
81Constructing object:
82 Now objects are constructed with default constuctor.
83 Some classes provide custom constructors and some ONLY custom constructors.
84
85 example for window:
86 eo_add_custom(eo, elm_win_constructor("my win", ELM_WIN_BASIC))
87
88 in Python:
89 can be called like this
90 win = ElmWin("my win", ELM_WIN_BASIC)
91
92 in JS??
93 in elev8 - this is hardcoded, ("main" ELM_WIN_BASIC) is created
94
95 Issues:
96 How to fetch custom constructors from source?
97 Add decorators to comments. Looks like fine.
98
99 How to call custom constructors with same signature, but with different name?
100 eo_add_custom(eo, elm_win_constructor_one("my win", ELM_WIN_BASIC))
101 eo_add_custom(eo, elm_win_constructor_two("my win", ELM_WIN_BASIC))
102
103 What to do in Python?
104 Define additional variable?
105 win = ElmWin(win.CONSTR1, "my win", ELM_WIN_BASIC)
106
107 and provide the way to parse argv[] in __init__ func?
2 108
3 109
4Callbacks in Python. 110Callbacks in Python.
@@ -58,69 +164,13 @@ Callbacks in JS:
58 There are some ideas how to put several callbacks and data if needed, but it must be checked. 164 There are some ideas how to put several callbacks and data if needed, but it must be checked.
59 165
60 166
61Constructing object:
62 Now objects are constructed with default constuctor.
63 Some classes provide custom constructors and some ONLY custom constructors.
64
65 example for window:
66 eo_add_custom(eo, elm_win_constructor("my win", ELM_WIN_BASIC))
67
68 in Python:
69 can be called like this
70 win = ElmWin("my win", ELM_WIN_BASIC)
71
72 in JS??
73 in elev8 - this is hardcoded, ("main" ELM_WIN_BASIC) is created
74
75 Issues:
76 How to fetch custom constructors from source?
77 Add decorators to comments. Looks like fine.
78
79 How to call custom constructors with same signature, but with different name?
80 eo_add_custom(eo, elm_win_constructor_one("my win", ELM_WIN_BASIC))
81 eo_add_custom(eo, elm_win_constructor_two("my win", ELM_WIN_BASIC))
82
83 What to do in Python?
84 Define additional variable?
85 win = ElmWin(win.CONSTR1, "my win", ELM_WIN_BASIC)
86
87 and provide the way to parse argv[] in __init__ func?
88
89
90Parameter's Types;
91 Basic types can be detected;
92 also "types" file can be provided which says how to cas to basic types:
93 <type from="Evas_Font_Size" to="int"/>
94 <type from="Eo_Callback_Priority" to="short"/>
95 <type from="Evas_Smart" to="Eo"/>
96
97 if some type wasn't found, function will not be generated.
98
99 Issues:
100 Types like Eina_List, arrays, structs?
101 can be done by providing decorators, but requires work.
102
103 Returning existing Object or new one.
104 Need to check returning instance with eo_base_data_get();
105 if o != NULL:
106 return o
107 else: ( need to create one:)
108 get class name,
109 find constructor
110 create object
111
112 Requires work.
113
114
115Enums from headers.
116 Need to provide decorators, to understand how to fetch it
117
118Adding elm_init() and other additional funcs 167Adding elm_init() and other additional funcs
119 168
120 Sometimes some additional functions like elm_init(), elm_run() 169 Sometimes some additional functions like elm_init(), elm_run()
121 are needed. These functions are not introspectable, 170 are needed. These functions are not introspectable,
122 they must be added manually. 171 they must be added manually.
123 172
173 Example for python:
124 To do this user must provide definitions in *.pxd, *.pxi files, 174 To do this user must provide definitions in *.pxd, *.pxi files,
125 include *.pxi into generated 'module_name.pyx' file and compile. 175 include *.pxi into generated 'module_name.pyx' file and compile.
126 176
@@ -128,47 +178,12 @@ Adding elm_init() and other additional funcs
128 - generating XML 178 - generating XML
129 - generating source files, makefiles 179 - generating source files, makefiles
130 < add files manually 180 < add files manually
131 - run makefile 181 - compile module
132
133
134Generating function names
135 In the beginning there was idea to cut func name from OP_ID.
136
137 There is OP_ID 'SOME_CLASS_SUB_ID_COLOR_GET' and public function
138 'some_class_color_get()' which connected with OP_ID,
139 so 'color_get()' will be generated.
140
141 If there is another class ANOTHER_CLASS(SOME_CLASS) with
142 'ANOTHER_CLASS_SUB_ID_COLOR_GET' and 'another_class_color_get()'
143 public function, another 'color_get()' func will be generated.
144
145 I don't check for names clash.
146 There won't be an error and function will be simply overloaded,
147 but it will be completely wrong.
148 182
149 There shouldn't be function overloading at all, that's all done
150 in library itself, in bindings I call only for most base public func.
151 183
152 Contflict should be resolved in library itself. If we want single 184Enums from headers.
153 'color_set()' for all classes, they need to be overloaded 185 Need to provide descriptions(comments), to understand how to fetch it
154 in proper way.
155
156 At the moment full names like some_class_color_set() and
157 another_class_color_set() will be generated.
158
159
160
161
162Properties names parsing
163 If func name ends with '_set'/'_get'
164 parameters are checked on direction 'in' for 'set' prop
165 and on 'out' for 'get' prop.
166 If it's wrong, this function will be generated as a method
167
168all funcs are public, impossible to override not needed
169 186
170Visibility in CElmObject
171
172Issues about elementary: 187Issues about elementary:
173 After parsing sources, found headers are included 188 After parsing sources, found headers are included
174 into generated files. 189 into generated files.
@@ -179,13 +194,3 @@ Issues about elementary:
179 194
180 195
181 196
182
183
184
185
186
187
188
189
190
191