summaryrefslogtreecommitdiff
path: root/include/efl.edje.pxd
diff options
context:
space:
mode:
authorDavide Andreoli <dave@gurumeditation.it>2013-02-11 22:32:50 +0000
committerDavide Andreoli <dave@gurumeditation.it>2013-02-11 22:32:50 +0000
commit8b8639886059814a36f57164d5572e97bcb00a47 (patch)
tree1c5a170de002793c1402d6afcc16c63115d81caa /include/efl.edje.pxd
Put in a first, still wip, version of the python bindings in a merged tree.
This is meant to be the 1.8 version of the wrappers and will include everything that now is in the python folder. Atm this include evas, ecore, edje, elementary and emotion (emotion still commented in the build couse it need some more testing). Eo is used as a base for all the objects that inherit from it in C, but in real nothing is used from Eo, it is used more like a container to share code between the libs. All the docs has been stripped out because we want to use the new sphinx style docs that Kay has done in his git repo. (Kay: please wait a little bit to include it, as working on the libs without docs is much more easy) The new wrappers include a new container module called efl and thus you can live with both the old and the new installation. This also means that you need to import the new modules as: "from efl import evas" (instead of the old "import evas") The idea here is that you can make your code works with both version doing something like: try: import evas except: from efl import evas ...like is done in the gtk bindings Some stuff has been leaved out on purpose, because was old stuff (like the hacked evas rotation stuff) or because was not working as expected (like all the ecore.evas.XXX modules). See the TODO.txt file for more info. Probably some stuff is out just because I missed them, let me know if you miss something. Improvements from the old version: - Py3 compatible (still some work to be done, but really only TODO, no problems to resolv) - Should also works on other platforms, like windoz (but not tested) - Unittests greatly improved, you can also run ALL tests at once - much more simpler :) I will contine the works in the next weeks and hope someone will help too. NOTE: I switched back to setup.py instead of autotools, because that is the right way to compile python stuff. So to build just use: python setup.py install or python3 setup.py install Enjoy davemds SVN revision: 83831
Diffstat (limited to 'include/efl.edje.pxd')
-rw-r--r--include/efl.edje.pxd398
1 files changed, 398 insertions, 0 deletions
diff --git a/include/efl.edje.pxd b/include/efl.edje.pxd
new file mode 100644
index 0000000..e0ae5d8
--- /dev/null
+++ b/include/efl.edje.pxd
@@ -0,0 +1,398 @@
1# Copyright (C) 2007-2008 Gustavo Sverzut Barbieri, Ulisses Furquim
2#
3# This file is part of Python-Edje.
4#
5# Python-Edje is free software; you can redistribute it and/or
6# modify it under the terms of the GNU Lesser General Public
7# License as published by the Free Software Foundation; either
8# version 2.1 of the License, or (at your option) any later version.
9#
10# Python-Edje is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# Lesser General Public License for more details.
14#
15# You should have received a copy of the GNU Lesser General Public License
16# along with this Python-Edje. If not, see <http://www.gnu.org/licenses/>.
17
18from efl cimport *
19from efl.evas cimport Object, Canvas
20from efl.evas cimport Evas_Object, Evas, Evas_Font_Size, Evas_Coord
21
22
23cdef extern from "Edje.h":
24 ####################################################################
25 # Enumerations
26 #
27 ctypedef enum Edje_Message_Type:
28 pass
29
30 ctypedef enum Edje_Aspect_Control:
31 pass
32
33 ctypedef enum Edje_Drag_Dir:
34 pass
35
36 ctypedef enum Edje_Load_Error:
37 pass
38
39 ctypedef enum Edje_Part_Type:
40 pass
41
42 ctypedef enum Edje_Text_Effect:
43 pass
44
45 ctypedef enum Edje_Action_Type:
46 pass
47
48 ctypedef enum Edje_Tween_Mode:
49 pass
50
51 ctypedef enum Edje_External_Param_Type:
52 pass
53
54 cdef int EDJE_EXTERNAL_INT_UNSET
55 cdef double EDJE_EXTERNAL_DOUBLE_UNSET
56 cdef unsigned int EDJE_EXTERNAL_TYPE_ABI_VERSION
57
58 ####################################################################
59 # Structures
60 #
61 ctypedef struct Edje_Message_String:
62 char *str
63
64 ctypedef struct Edje_Message_Int:
65 int val
66
67 ctypedef struct Edje_Message_Float:
68 double val
69
70 ctypedef struct Edje_Message_String_Set:
71 int count
72 char *str[1]
73
74 ctypedef struct Edje_Message_Int_Set:
75 int count
76 int val[1]
77
78 ctypedef struct Edje_Message_Float_Set:
79 int count
80 double val[1]
81
82 ctypedef struct Edje_Message_String_Int:
83 char *str
84 int val
85
86 ctypedef struct Edje_Message_String_Float:
87 char *str
88 double val
89
90 ctypedef struct Edje_Message_String_Int_Set:
91 char *str
92 int count
93 int val[1]
94
95 ctypedef struct Edje_Message_String_Float_Set:
96 char *str
97 int count
98 double val[1]
99
100 ctypedef struct Edje_External_Param:
101 char *name
102 Edje_External_Param_Type type
103 int i
104 double d
105 char *s
106
107 ctypedef struct aux_external_param_info_int:
108 int default "def", min, max, step
109
110 ctypedef struct aux_external_param_info_double:
111 double default "def", min, max, step
112
113 ctypedef struct aux_external_param_info_string:
114 char *default "def", *accept_fmt, *deny_fmt
115
116 ctypedef struct aux_external_param_info_bool:
117 unsigned int default "def"
118 char *false_str, *true_str
119
120 ctypedef struct aux_external_param_info_choice:
121 char *default "def", **choices
122
123 ctypedef union aux_external_param_info:
124 aux_external_param_info_int i
125 aux_external_param_info_double d
126 aux_external_param_info_string s
127 aux_external_param_info_bool b
128 aux_external_param_info_choice c
129
130 ctypedef struct Edje_External_Param_Info:
131 char *name
132 Edje_External_Param_Type type
133 aux_external_param_info info
134
135 ctypedef struct Edje_External_Type:
136 unsigned int abi_version
137 char *module
138 char *module_name
139 Evas_Object *(*add)(void *data, Evas *evas, Evas_Object *parent, Eina_List *params, char *part_name)
140 void (*state_set)(void *data, Evas_Object *obj, void *from_params, void *to_params, float pos)
141 void (*signal_emit)(void *data, Evas_Object *obj, char *emission, char *source)
142 Eina_Bool (*param_set)(void *data, Evas_Object *obj, Edje_External_Param *param)
143 Eina_Bool (*param_get)(void *data, Evas_Object *obj, Edje_External_Param *param)
144 void *(*params_parse)(void *data, Evas_Object *obj, Eina_List *params)
145 void (*params_free)(void *params)
146 Evas_Object *(*icon_add)(void *data, Evas *e)
147 Evas_Object *(*preview_add)(void *data, Evas *e)
148 char *(*label_get)(void *data)
149 char *(*description_get)(void *data)
150 char *(*translate)(void *data, char *orig)
151 Edje_External_Param_Info *parameters_info
152 void *data
153
154
155 ctypedef Edje_External_Type const_Edje_External_Type "const Edje_External_Type"
156 ctypedef void (*Edje_Signal_Cb)(void *data, Evas_Object *obj, const_char_ptr emission, const_char_ptr source)
157
158 ####################################################################
159 # Engine
160 #
161 int edje_init()
162 int edje_shutdown()
163
164 void edje_frametime_set(double t)
165 double edje_frametime_get()
166
167 void edje_freeze()
168 void edje_thaw()
169 void edje_fontset_append_set(char *fonts)
170 char *edje_fontset_append_get()
171
172 Eina_List *edje_file_collection_list(char *file)
173 void edje_file_collection_list_free(Eina_List *lst)
174 int edje_file_group_exists(char *file, char *glob)
175 char *edje_file_data_get(char *file, char *key)
176 void edje_file_cache_set(int count)
177 int edje_file_cache_get()
178 void edje_file_cache_flush()
179 void edje_collection_cache_set(int count)
180 int edje_collection_cache_get()
181 void edje_collection_cache_flush()
182
183 void edje_color_class_set(char *color_class, int r, int g, int b, int a, int r2, int g2, int b2, int a2, int r3, int g3, int b3, int a3)
184 void edje_color_class_get(char *color_class, int *r, int *g, int *b, int *a, int *r2, int *g2, int *b2, int *a2, int *r3, int *g3, int *b3, int *a3)
185 void edje_color_class_del(char *color_class)
186 Eina_List * edje_color_class_list()
187
188 void edje_text_class_set(char *text_class, char *font, Evas_Font_Size size)
189 void edje_text_class_del(char *text_class)
190 Eina_List * edje_text_class_list()
191
192 void edje_extern_object_min_size_set(Evas_Object *obj, Evas_Coord minw, Evas_Coord minh)
193 void edje_extern_object_max_size_set(Evas_Object *obj, Evas_Coord maxw, Evas_Coord maxh)
194 void edje_extern_object_aspect_set(Evas_Object *obj, Edje_Aspect_Control aspect, Evas_Coord aw, Evas_Coord ah)
195
196 Evas_Object *edje_object_add(Evas *)
197
198 char *edje_object_data_get(Evas_Object *obj, char *key)
199
200 int edje_object_file_set(Evas_Object *obj, char *file, char *part)
201 void edje_object_file_get(Evas_Object *obj, char **file, char **part)
202 int edje_object_load_error_get(Evas_Object *obj)
203
204 void edje_object_signal_callback_add(Evas_Object *obj, char *emission, char *source, void(*func)(void *data, Evas_Object *obj, char *emission, char *source), void *data)
205 void *edje_object_signal_callback_del(Evas_Object *obj, char *emission, char *source, void(*func)(void *data, Evas_Object *obj, char *emission, char *source))
206 void edje_object_signal_emit(Evas_Object *obj, char *emission, char *source)
207
208 void edje_object_play_set(Evas_Object *obj, int play)
209 int edje_object_play_get(Evas_Object *obj)
210 void edje_object_animation_set(Evas_Object *obj, int on)
211 int edje_object_animation_get(Evas_Object *obj)
212
213 int edje_object_freeze(Evas_Object *obj)
214 int edje_object_thaw(Evas_Object *obj)
215
216 void edje_object_color_class_set(Evas_Object *obj, char *color_class, int r, int g, int b, int a, int r2, int g2, int b2, int a2, int r3, int g3, int b3, int a3)
217 void edje_object_color_class_get(Evas_Object *obj, char *color_class, int *r, int *g, int *b, int *a, int *r2, int *g2, int *b2, int *a2, int *r3, int *g3, int *b3, int *a3)
218 void edje_object_color_class_del(Evas_Object *obj, char *color_class)
219 void edje_object_text_class_set(Evas_Object *obj, char *text_class, char *font, Evas_Font_Size size)
220
221 void edje_object_size_min_get(Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh)
222 void edje_object_size_max_get(Evas_Object *obj, Evas_Coord *maxw, Evas_Coord *maxh)
223 void edje_object_calc_force(Evas_Object *obj)
224 void edje_object_size_min_calc(Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh)
225 Eina_Bool edje_object_parts_extends_calc(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
226
227 int edje_object_part_exists(Evas_Object *obj, char *part)
228 Evas_Object *edje_object_part_object_get(Evas_Object *obj, char *part)
229 void edje_object_part_geometry_get(Evas_Object *obj, char *part, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
230
231 void edje_object_text_change_cb_set(Evas_Object *obj, void(*func)(void *data, Evas_Object *obj, char *part), void *data)
232 void edje_object_part_text_set(Evas_Object *obj, char *part, char *text)
233 char *edje_object_part_text_get(Evas_Object *obj, char *part)
234
235 void edje_object_part_text_select_all(Evas_Object *obj, char *part)
236 void edje_object_part_text_select_none(Evas_Object *obj, char *part)
237
238 void edje_object_part_text_unescaped_set(Evas_Object *obj, char *part, char *text_to_escape)
239 char *edje_object_part_text_unescaped_get(Evas_Object *obj, char *part)
240
241
242 void edje_object_part_swallow(Evas_Object *obj, char *part, Evas_Object *obj_swallow)
243 void edje_object_part_unswallow(Evas_Object *obj, Evas_Object *obj_swallow)
244 Evas_Object *edje_object_part_swallow_get(Evas_Object *obj, char *part)
245
246 Eina_Bool edje_object_part_box_append(Evas_Object *obj, char *part, Evas_Object *child)
247 Eina_Bool edje_object_part_box_prepend(Evas_Object *obj, char *part, Evas_Object *child)
248 Eina_Bool edje_object_part_box_insert_at(Evas_Object *obj, char *part, Evas_Object *child, unsigned int pos)
249 Eina_Bool edje_object_part_box_insert_before(Evas_Object *obj, char *part, Evas_Object *child, Evas_Object *reference)
250 Evas_Object *edje_object_part_box_remove(Evas_Object *obj, char *part, Evas_Object *child)
251 Evas_Object *edje_object_part_box_remove_at(Evas_Object *obj, char *part, unsigned int pos)
252 Eina_Bool edje_object_part_box_remove_all(Evas_Object *obj, char *part, int clear)
253
254 Eina_Bool edje_object_part_table_pack(Evas_Object *obj, char *part, Evas_Object *child, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan)
255 Eina_Bool edje_object_part_table_unpack(Evas_Object *obj, char *part, Evas_Object *child)
256 Eina_Bool edje_object_part_table_col_row_size_get(Evas_Object *obj, char *part, int *cols, int *rows)
257 Eina_Bool edje_object_part_table_clear(Evas_Object *obj, char *part, int clear)
258 Evas_Object *edje_object_part_table_child_get(Evas_Object *obj, char *part, unsigned int col, unsigned int row)
259
260 char *edje_object_part_state_get(Evas_Object *obj, char *part, double *val_ret)
261
262 int edje_object_part_drag_dir_get(Evas_Object *obj, char *part)
263 void edje_object_part_drag_value_set(Evas_Object *obj, char *part, double dx, double dy)
264 void edje_object_part_drag_value_get(Evas_Object *obj, char *part, double *dx, double *dy)
265 void edje_object_part_drag_size_set(Evas_Object *obj, char *part, double dw, double dh)
266 void edje_object_part_drag_size_get(Evas_Object *obj, char *part, double *dw, double *dh)
267 void edje_object_part_drag_step_set(Evas_Object *obj, char *part, double dx, double dy)
268 void edje_object_part_drag_step_get(Evas_Object *obj, char *part, double *dx, double *dy)
269 void edje_object_part_drag_page_set(Evas_Object *obj, char *part, double dx, double dy)
270 void edje_object_part_drag_page_get(Evas_Object *obj, char *part, double *dx, double *dy)
271 void edje_object_part_drag_step(Evas_Object *obj, char *part, double dx, double dy)
272 void edje_object_part_drag_page(Evas_Object *obj, char *part, double dx, double dy)
273
274 Evas_Object *edje_object_part_external_object_get(Evas_Object *obj, char *part)
275 Eina_Bool edje_object_part_external_param_set(Evas_Object *obj, char *part, Edje_External_Param *param)
276 Eina_Bool edje_object_part_external_param_get(Evas_Object *obj, char *part, Edje_External_Param *param)
277 Edje_External_Param_Type edje_object_part_external_param_type_get(Evas_Object *obj, char *part, char *param)
278
279 char *edje_external_param_type_str(Edje_External_Param_Type type)
280
281 void edje_object_message_send(Evas_Object *obj, Edje_Message_Type type, int id, void *msg)
282 void edje_object_message_handler_set(Evas_Object *obj, void(*func)(void *data, Evas_Object *obj, Edje_Message_Type type, int id, void *msg), void *data)
283 void edje_object_message_signal_process(Evas_Object *obj)
284
285 void edje_message_signal_process()
286
287 unsigned int edje_external_type_abi_version_get()
288
289 Eina_Iterator *edje_external_iterator_get()
290 Edje_External_Param_Info *edje_external_param_info_get(char *type_name)
291 Edje_External_Type *edje_external_type_get(char *type_name)
292
293 Eina_Bool edje_module_load(char *name)
294 Eina_List *edje_available_modules_get()
295
296
297cdef class Message:
298 cdef int _type
299 cdef int _id
300
301
302cdef class MessageSignal(Message):
303 pass
304
305
306cdef class MessageString(Message):
307 cdef Edje_Message_String *obj
308
309
310cdef class MessageInt(Message):
311 cdef Edje_Message_Int *obj
312
313
314cdef class MessageFloat(Message):
315 cdef Edje_Message_Float *obj
316
317
318cdef class MessageStringSet(Message):
319 cdef Edje_Message_String_Set *obj
320
321
322cdef class MessageIntSet(Message):
323 cdef Edje_Message_Int_Set *obj
324
325
326cdef class MessageFloatSet(Message):
327 cdef Edje_Message_Float_Set *obj
328
329
330cdef class MessageStringInt(Message):
331 cdef Edje_Message_String_Int *obj
332
333
334cdef class MessageStringFloat(Message):
335 cdef Edje_Message_String_Float *obj
336
337
338cdef class MessageStringIntSet(Message):
339 cdef Edje_Message_String_Int_Set *obj
340
341
342cdef class MessageStringFloatSet(Message):
343 cdef Edje_Message_String_Float_Set *obj
344
345
346cdef class ExternalParam:
347 cdef Edje_External_Param *obj
348
349
350cdef class ExternalParamInfo:
351 cdef Edje_External_Param_Info *obj
352 cdef readonly object external_type
353 cdef const_Edje_External_Type *_external_type_obj
354 cdef _set_external_type(self, t)
355
356
357cdef class ExternalParamInfoInt(ExternalParamInfo):
358 pass
359
360
361cdef class ExternalParamInfoDouble(ExternalParamInfo):
362 pass
363
364
365cdef class ExternalParamInfoString(ExternalParamInfo):
366 pass
367
368
369cdef class ExternalParamInfoBool(ExternalParamInfo):
370 pass
371
372
373cdef class ExternalParamInfoChoice(ExternalParamInfo):
374 pass
375
376
377cdef class ExternalType:
378 cdef object _name
379 cdef object _parameters_info
380 cdef const_Edje_External_Type *_obj
381
382
383cdef class Edje(Object):
384 cdef object _text_change_cb
385 cdef object _message_handler_cb
386 cdef object _signal_callbacks
387
388 cdef void message_send_int(self, int id, int data)
389 cdef void message_send_float(self, int id, float data)
390 cdef void message_send_str(self, int id, data)
391 cdef void message_send_str_set(self, int id, data)
392 cdef void message_send_str_int(self, int id, s, int i)
393 cdef void message_send_str_float(self, int id, s, float f)
394 cdef void message_send_str_int_set(self, int id, s, data)
395 cdef void message_send_str_float_set(self, int id, s, data)
396 cdef void message_send_int_set(self, int id, data)
397 cdef void message_send_float_set(self, int id, data)
398 cdef message_send_set(self, int id, data)