diff options
author | Davide Andreoli <dave@gurumeditation.it> | 2013-02-11 22:32:50 +0000 |
---|---|---|
committer | Davide Andreoli <dave@gurumeditation.it> | 2013-02-11 22:32:50 +0000 |
commit | 8b8639886059814a36f57164d5572e97bcb00a47 (patch) | |
tree | 1c5a170de002793c1402d6afcc16c63115d81caa /include/efl.ecore.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.ecore.pxd')
-rw-r--r-- | include/efl.ecore.pxd | 338 |
1 files changed, 338 insertions, 0 deletions
diff --git a/include/efl.ecore.pxd b/include/efl.ecore.pxd new file mode 100644 index 0000000..c15231e --- /dev/null +++ b/include/efl.ecore.pxd | |||
@@ -0,0 +1,338 @@ | |||
1 | ###################################################################### | ||
2 | # Copyright (C) 2007-2013 Gustavo Sverzut Barbieri | ||
3 | # | ||
4 | # This file is part of Python-Ecore. | ||
5 | # | ||
6 | # Python-Ecore is free software; you can redistribute it and/or | ||
7 | # modify it under the terms of the GNU Lesser General Public | ||
8 | # License as published by the Free Software Foundation; either | ||
9 | # version 2.1 of the License, or (at your option) any later version. | ||
10 | # | ||
11 | # Python-Ecore is distributed in the hope that it will be useful, | ||
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
14 | # Lesser General Public License for more details. | ||
15 | # | ||
16 | # You should have received a copy of the GNU Lesser General Public License | ||
17 | # along with this Python-Ecore. If not, see <http://www.gnu.org/licenses/>. | ||
18 | ###################################################################### | ||
19 | |||
20 | from efl cimport * | ||
21 | from efl.c_eo cimport Eo as cEo | ||
22 | from efl.eo cimport Eo | ||
23 | |||
24 | |||
25 | |||
26 | cdef extern from "Ecore.h": | ||
27 | #################################################################### | ||
28 | # Basic Types | ||
29 | # | ||
30 | ctypedef cEo Ecore_Timer | ||
31 | ctypedef cEo Ecore_Animator | ||
32 | ctypedef cEo Ecore_Idler | ||
33 | ctypedef cEo Ecore_Idle_Enterer | ||
34 | ctypedef cEo Ecore_Idle_Exiter | ||
35 | |||
36 | ctypedef struct Ecore_Event_Handler | ||
37 | ctypedef struct Ecore_Event | ||
38 | |||
39 | ctypedef struct Ecore_Event_Signal_User: | ||
40 | int number | ||
41 | |||
42 | ctypedef struct Ecore_Event_Signal_Exit: | ||
43 | unsigned int interrupt | ||
44 | unsigned int quit | ||
45 | unsigned int terminate | ||
46 | |||
47 | ctypedef struct Ecore_Event_Signal_Realtime: | ||
48 | int num | ||
49 | |||
50 | ctypedef struct Ecore_Exe_Event_Add: | ||
51 | Ecore_Exe *exe | ||
52 | void *ext_data | ||
53 | |||
54 | ctypedef struct Ecore_Exe_Event_Del: | ||
55 | int pid | ||
56 | int exit_code | ||
57 | Ecore_Exe *exe | ||
58 | int exit_signal | ||
59 | unsigned int exited | ||
60 | unsigned int signalled | ||
61 | void *ext_data | ||
62 | |||
63 | ctypedef struct Ecore_Exe_Event_Data: | ||
64 | Ecore_Exe *exe | ||
65 | void *data | ||
66 | int size | ||
67 | Ecore_Exe_Event_Data_Line *lines | ||
68 | |||
69 | ctypedef struct Ecore_Exe_Event_Data_Line: | ||
70 | char *line | ||
71 | int size | ||
72 | |||
73 | ctypedef struct Ecore_Fd_Handler | ||
74 | ctypedef struct Ecore_Exe | ||
75 | ctypedef Ecore_Exe const_Ecore_Exe "const Ecore_Exe" | ||
76 | |||
77 | int ECORE_EVENT_SIGNAL_USER | ||
78 | int ECORE_EVENT_SIGNAL_HUP | ||
79 | int ECORE_EVENT_SIGNAL_EXIT | ||
80 | int ECORE_EVENT_SIGNAL_POWER | ||
81 | int ECORE_EVENT_SIGNAL_REALTIME | ||
82 | |||
83 | int ECORE_EXE_EVENT_ADD | ||
84 | int ECORE_EXE_EVENT_DEL | ||
85 | int ECORE_EXE_EVENT_DATA | ||
86 | int ECORE_EXE_EVENT_ERROR | ||
87 | |||
88 | |||
89 | #################################################################### | ||
90 | # Enumerations | ||
91 | # | ||
92 | ctypedef enum Ecore_Fd_Handler_Flags: | ||
93 | pass | ||
94 | |||
95 | ctypedef enum Ecore_Exe_Flags: | ||
96 | pass | ||
97 | |||
98 | #################################################################### | ||
99 | # Other typedefs | ||
100 | # | ||
101 | ctypedef void (*Ecore_Cb)(void *data) | ||
102 | ctypedef Eina_Bool (*Ecore_Task_Cb)(void *data) | ||
103 | ctypedef Eina_Bool (*Ecore_Fd_Cb)(void *data, Ecore_Fd_Handler *fd_handler) | ||
104 | ctypedef void (*Ecore_Fd_Prep_Cb)(void *data, Ecore_Fd_Handler *fd_handler) | ||
105 | ctypedef Eina_Bool (*Ecore_Event_Handler_Cb)(void *data, int type, void *event) | ||
106 | ctypedef void (*Ecore_End_Cb)(void *user_data, void *func_data) | ||
107 | ctypedef void (*Ecore_Exe_Cb)(void *data, const_Ecore_Exe *exe) | ||
108 | |||
109 | #################################################################### | ||
110 | # Functions | ||
111 | # | ||
112 | int ecore_init() | ||
113 | int ecore_shutdown() | ||
114 | |||
115 | void ecore_main_loop_iterate() nogil | ||
116 | void ecore_main_loop_begin() nogil | ||
117 | void ecore_main_loop_quit() | ||
118 | |||
119 | int ecore_main_loop_glib_integrate() | ||
120 | |||
121 | double ecore_time_get() | ||
122 | double ecore_loop_time_get() | ||
123 | |||
124 | Ecore_Animator *ecore_animator_add(Ecore_Task_Cb func, void *data) | ||
125 | void *ecore_animator_del(Ecore_Animator *animator) | ||
126 | void ecore_animator_frametime_set(double frametime) | ||
127 | double ecore_animator_frametime_get() | ||
128 | |||
129 | Ecore_Timer *ecore_timer_add(double t, Ecore_Task_Cb func, void *data) | ||
130 | void *ecore_timer_del(Ecore_Timer *timer) | ||
131 | void ecore_timer_freeze(Ecore_Timer *timer) | ||
132 | void ecore_timer_thaw(Ecore_Timer *timer) | ||
133 | void ecore_timer_interval_set(Ecore_Timer *timer, double t) | ||
134 | double ecore_timer_interval_get(Ecore_Timer *timer) | ||
135 | void ecore_timer_delay(Ecore_Timer *timer, double add) | ||
136 | void ecore_timer_reset(Ecore_Timer *timer) | ||
137 | double ecore_timer_pending_get(Ecore_Timer *timer) | ||
138 | double ecore_timer_precision_get() | ||
139 | double ecore_timer_precision_set(double value) | ||
140 | |||
141 | Ecore_Idler *ecore_idler_add(Ecore_Task_Cb func, void *data) | ||
142 | void *ecore_idler_del(Ecore_Idler *idler) | ||
143 | Ecore_Idler *ecore_idle_enterer_add(Ecore_Task_Cb func, void *data) | ||
144 | void *ecore_idle_enterer_del(Ecore_Idler *idler) | ||
145 | Ecore_Idler *ecore_idle_exiter_add(Ecore_Task_Cb func, void *data) | ||
146 | void *ecore_idle_exiter_del(Ecore_Idler *idler) | ||
147 | |||
148 | Ecore_Fd_Handler *ecore_main_fd_handler_add(int fd, Ecore_Fd_Handler_Flags flags, Ecore_Fd_Cb func, void *data, Ecore_Fd_Cb buf_func, void *buf_data) | ||
149 | void ecore_main_fd_handler_prepare_callback_set(Ecore_Fd_Handler *fd_handler, Ecore_Fd_Prep_Cb func, void *data) | ||
150 | void *ecore_main_fd_handler_del(Ecore_Fd_Handler *fd_handler) | ||
151 | int ecore_main_fd_handler_fd_get(Ecore_Fd_Handler *fd_handler) | ||
152 | int ecore_main_fd_handler_active_get(Ecore_Fd_Handler *fd_handler, Ecore_Fd_Handler_Flags flags) | ||
153 | void ecore_main_fd_handler_active_set(Ecore_Fd_Handler *fd_handler, Ecore_Fd_Handler_Flags flags) | ||
154 | |||
155 | Ecore_Event_Handler *ecore_event_handler_add(int type, Ecore_Event_Handler_Cb func, void *data) | ||
156 | void *ecore_event_handler_del(Ecore_Event_Handler *event_handler) | ||
157 | int ecore_event_type_new() | ||
158 | Ecore_Event *ecore_event_add(int type, void *ev, Ecore_End_Cb func_free, void *data) | ||
159 | void *ecore_event_del(Ecore_Event *ev) | ||
160 | |||
161 | void ecore_exe_run_priority_set(int pri) | ||
162 | int ecore_exe_run_priority_get() | ||
163 | Ecore_Exe *ecore_exe_pipe_run(char *exe_cmd, Ecore_Exe_Flags flags, void *data) | ||
164 | void ecore_exe_callback_pre_free_set(Ecore_Exe *exe, Ecore_Exe_Cb func) | ||
165 | int ecore_exe_send(Ecore_Exe *exe, const_void *data, int size) | ||
166 | void ecore_exe_close_stdin(Ecore_Exe *exe) | ||
167 | void ecore_exe_auto_limits_set(Ecore_Exe *exe, int start_bytes, int end_bytes, int start_lines, int end_lines) | ||
168 | Ecore_Exe_Event_Data *ecore_exe_event_data_get(Ecore_Exe *exe, Ecore_Exe_Flags flags) | ||
169 | void ecore_exe_event_data_free(Ecore_Exe_Event_Data *data) | ||
170 | void *ecore_exe_free(Ecore_Exe *exe) | ||
171 | int ecore_exe_pid_get(Ecore_Exe *exe) | ||
172 | void ecore_exe_tag_set(Ecore_Exe *exe, char *tag) | ||
173 | const_char_ptr ecore_exe_tag_get(Ecore_Exe *exe) | ||
174 | const_char_ptr ecore_exe_cmd_get(Ecore_Exe *exe) | ||
175 | void *ecore_exe_data_get(Ecore_Exe *exe) | ||
176 | Ecore_Exe_Flags ecore_exe_flags_get(Ecore_Exe *exe) | ||
177 | void ecore_exe_pause(Ecore_Exe *exe) | ||
178 | void ecore_exe_continue(Ecore_Exe *exe) | ||
179 | void ecore_exe_interrupt(Ecore_Exe *exe) | ||
180 | void ecore_exe_quit(Ecore_Exe *exe) | ||
181 | void ecore_exe_terminate(Ecore_Exe *exe) | ||
182 | void ecore_exe_kill(Ecore_Exe *exe) | ||
183 | void ecore_exe_signal(Ecore_Exe *exe, int num) | ||
184 | void ecore_exe_hup(Ecore_Exe *exe) | ||
185 | |||
186 | |||
187 | cdef extern from "Ecore_File.h": | ||
188 | |||
189 | ctypedef struct Ecore_File_Download_Job | ||
190 | |||
191 | ctypedef void (*Ecore_File_Download_Completion_Cb)(void *data, const_char_ptr file, int status) | ||
192 | ctypedef int (*Ecore_File_Download_Progress_Cb)(void *data, const_char_ptr file, long int dltotal, long int dlnow, long int ultotal, long int ulnow) | ||
193 | |||
194 | int ecore_file_init() | ||
195 | int ecore_file_shutdown() | ||
196 | void ecore_file_download_abort(Ecore_File_Download_Job *job) | ||
197 | void ecore_file_download_abort_all() | ||
198 | Eina_Bool ecore_file_download_protocol_available(const_char_ptr protocol) | ||
199 | Eina_Bool ecore_file_download(const_char_ptr url, const_char_ptr dst, | ||
200 | Ecore_File_Download_Completion_Cb completion_cb, | ||
201 | Ecore_File_Download_Progress_Cb progress_cb, | ||
202 | void *data, | ||
203 | Ecore_File_Download_Job **job_ret) | ||
204 | |||
205 | |||
206 | #################################################################### | ||
207 | # Python classes | ||
208 | # | ||
209 | cdef class Timer(Eo): | ||
210 | cdef double _interval | ||
211 | cdef readonly object func, args, kargs | ||
212 | cpdef object _task_exec(self) | ||
213 | |||
214 | |||
215 | cdef class Animator(Eo): | ||
216 | cdef readonly object func, args, kargs | ||
217 | cpdef object _task_exec(self) | ||
218 | |||
219 | |||
220 | cdef class Idler(Eo): | ||
221 | cdef readonly object func, args, kargs | ||
222 | cpdef object _task_exec(self) | ||
223 | |||
224 | |||
225 | cdef class IdleEnterer(Idler): | ||
226 | pass | ||
227 | |||
228 | |||
229 | cdef class IdleExiter(Idler): | ||
230 | pass | ||
231 | |||
232 | |||
233 | cdef class FdHandler(object): | ||
234 | cdef Ecore_Fd_Handler *obj | ||
235 | cdef readonly object func | ||
236 | cdef readonly object args | ||
237 | cdef readonly object kargs | ||
238 | cdef readonly object _prepare_callback | ||
239 | |||
240 | cdef object _exec(self) | ||
241 | |||
242 | |||
243 | cdef class Exe(object): | ||
244 | cdef Ecore_Exe *exe | ||
245 | cdef readonly object __data | ||
246 | cdef object __callbacks | ||
247 | |||
248 | cdef int _set_obj(self, char *exe_cmd, int flags) except 0 | ||
249 | cdef int _unset_obj(self) except 0 | ||
250 | |||
251 | |||
252 | cdef class ExeEventFilter(object): | ||
253 | cdef Ecore_Exe *exe | ||
254 | cdef Ecore_Event_Handler *handler | ||
255 | cdef readonly object owner | ||
256 | cdef readonly object event_type | ||
257 | cdef object callbacks | ||
258 | |||
259 | |||
260 | cdef class EventHandler(object): | ||
261 | cdef Ecore_Event_Handler *obj | ||
262 | cdef readonly int type | ||
263 | cdef readonly object event_cls | ||
264 | cdef readonly object func | ||
265 | cdef readonly object args | ||
266 | cdef readonly object kargs | ||
267 | |||
268 | cdef int _set_obj(self, Ecore_Event_Handler *obj) except 0 | ||
269 | cdef int _unset_obj(self) except 0 | ||
270 | cdef Eina_Bool _exec(self, void *event) except 2 | ||
271 | |||
272 | |||
273 | cdef class Event(object): | ||
274 | cdef int _set_obj(self, void *obj) except 0 | ||
275 | |||
276 | |||
277 | cdef class EventSignalUser(Event): | ||
278 | cdef readonly object number | ||
279 | |||
280 | |||
281 | cdef class EventSignalHup(Event): | ||
282 | pass | ||
283 | |||
284 | |||
285 | cdef class EventSignalExit(Event): | ||
286 | cdef readonly object interrupt | ||
287 | cdef readonly object quit | ||
288 | cdef readonly object terminate | ||
289 | |||
290 | |||
291 | cdef class EventSignalPower(Event): | ||
292 | pass | ||
293 | |||
294 | |||
295 | cdef class CustomEvent(Event): | ||
296 | cdef readonly object obj | ||
297 | |||
298 | |||
299 | cdef class QueuedEvent: | ||
300 | cdef Ecore_Event *obj | ||
301 | cdef readonly object args | ||
302 | |||
303 | cdef int _set_obj(self, Ecore_Event *ev) except 0 | ||
304 | cdef int _unset_obj(self) except 0 | ||
305 | |||
306 | |||
307 | cdef class EventExeAdd(Event): | ||
308 | cdef readonly object exe | ||
309 | |||
310 | |||
311 | cdef class EventExeDel(Event): | ||
312 | cdef readonly object exe | ||
313 | cdef readonly object pid | ||
314 | cdef readonly object exit_code | ||
315 | cdef readonly object exit_signal | ||
316 | cdef readonly object exited | ||
317 | cdef readonly object signalled | ||
318 | |||
319 | |||
320 | cdef class EventExeData(Event): | ||
321 | cdef readonly object exe | ||
322 | cdef readonly object data | ||
323 | cdef readonly object size | ||
324 | cdef readonly object lines | ||
325 | |||
326 | |||
327 | cdef class FileDownload: | ||
328 | cdef Ecore_File_Download_Job *job | ||
329 | cdef readonly object completion_cb | ||
330 | cdef readonly object progress_cb | ||
331 | cdef readonly object args | ||
332 | cdef readonly object kargs | ||
333 | |||
334 | cdef object _exec_completion(self, const_char_ptr file, int status) | ||
335 | cdef object _exec_progress(self, const_char_ptr file, | ||
336 | long int dltotal, long int dlnow, | ||
337 | long int ultotal, long int ulnow) | ||
338 | |||