summaryrefslogtreecommitdiff
path: root/efl
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2014-05-13 15:00:46 +0300
committerKai Huuhko <kai.huuhko@gmail.com>2014-05-13 15:12:38 +0300
commitd98cd27107ce3588d8f84f4c90ae1f19f2840cbd (patch)
tree25c61083fcc8986d320eb5cd1c47085a8fd175c1 /efl
parent63f69a403903d398d637067441c496f7dc24545f (diff)
efl.ecore: Transform into a package
The old efl.ecore.so module renamed to __init__.so which gets automatically used for the package namespace when there is an empty __init__.py included.
Diffstat (limited to 'efl')
-rw-r--r--efl/ecore/__init__.pxd348
-rw-r--r--efl/ecore/__init__.py0
-rw-r--r--efl/ecore/__init__.pyx (renamed from efl/ecore/efl.ecore.pyx)0
-rw-r--r--efl/ecore/enums.pxd86
4 files changed, 434 insertions, 0 deletions
diff --git a/efl/ecore/__init__.pxd b/efl/ecore/__init__.pxd
new file mode 100644
index 0000000..29758c1
--- /dev/null
+++ b/efl/ecore/__init__.pxd
@@ -0,0 +1,348 @@
1# Copyright (C) 2007-2014 various contributors (see AUTHORS)
2#
3# This file is part of Python-EFL.
4#
5# Python-EFL 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 3 of the License, or (at your option) any later version.
9#
10# Python-EFL 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-EFL. If not, see <http://www.gnu.org/licenses/>.
17
18from efl.eina cimport *
19from efl.c_eo cimport Eo as cEo
20from efl.eo cimport Eo
21from efl.ecore.enums cimport Ecore_Fd_Handler_Flags, Ecore_Exe_Flags, \
22 Ecore_File_Event, Ecore_Poller_Type
23
24
25cdef extern from "Ecore.h":
26 ####################################################################
27 # Basic Types
28 #
29 ctypedef cEo Ecore_Timer
30 ctypedef cEo Ecore_Animator
31 ctypedef cEo Ecore_Poller
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
76 ####################################################################
77 # Other typedefs
78 #
79 ctypedef void (*Ecore_Cb)(void *data)
80 ctypedef Eina_Bool (*Ecore_Task_Cb)(void *data)
81 ctypedef Eina_Bool (*Ecore_Fd_Cb)(void *data, Ecore_Fd_Handler *fd_handler)
82 ctypedef void (*Ecore_Fd_Prep_Cb)(void *data, Ecore_Fd_Handler *fd_handler)
83 ctypedef Eina_Bool (*Ecore_Event_Handler_Cb)(void *data, int type, void *event)
84 ctypedef void (*Ecore_End_Cb)(void *user_data, void *func_data)
85 ctypedef void (*Ecore_Exe_Cb)(void *data, const Ecore_Exe *exe)
86 ctypedef Eina_Bool (*Ecore_Timeline_Cb)(void *data, double pos)
87
88 ####################################################################
89 # Functions
90 #
91 int ecore_init()
92 int ecore_shutdown()
93
94 void ecore_main_loop_iterate() nogil
95 void ecore_main_loop_begin() nogil
96 void ecore_main_loop_quit()
97
98 int ecore_main_loop_glib_integrate()
99 void ecore_main_loop_glib_always_integrate_disable()
100
101 double ecore_time_get()
102 double ecore_loop_time_get()
103
104 Ecore_Animator *ecore_animator_add(Ecore_Task_Cb func, void *data)
105 Ecore_Animator *ecore_animator_timeline_add(double runtime, Ecore_Timeline_Cb func, void *data)
106 void *ecore_animator_del(Ecore_Animator *animator)
107 void ecore_animator_frametime_set(double frametime)
108 double ecore_animator_frametime_get()
109
110 Ecore_Poller *ecore_poller_add(Ecore_Poller_Type type, int interval, Ecore_Task_Cb func, const void *data)
111 void *ecore_poller_del(Ecore_Poller *poller)
112 Eina_Bool ecore_poller_poller_interval_set(Ecore_Poller *poller, int interval)
113 int ecore_poller_poller_interval_get(Ecore_Poller *poller)
114
115 Ecore_Timer *ecore_timer_add(double t, Ecore_Task_Cb func, void *data)
116 void *ecore_timer_del(Ecore_Timer *timer)
117 void ecore_timer_freeze(Ecore_Timer *timer)
118 void ecore_timer_thaw(Ecore_Timer *timer)
119 void ecore_timer_interval_set(Ecore_Timer *timer, double t)
120 double ecore_timer_interval_get(Ecore_Timer *timer)
121 void ecore_timer_delay(Ecore_Timer *timer, double add)
122 void ecore_timer_reset(Ecore_Timer *timer)
123 double ecore_timer_pending_get(Ecore_Timer *timer)
124 double ecore_timer_precision_get()
125 double ecore_timer_precision_set(double value)
126
127 Ecore_Idler *ecore_idler_add(Ecore_Task_Cb func, void *data)
128 void *ecore_idler_del(Ecore_Idler *idler)
129 Ecore_Idler *ecore_idle_enterer_add(Ecore_Task_Cb func, void *data)
130 void *ecore_idle_enterer_del(Ecore_Idler *idler)
131 Ecore_Idler *ecore_idle_exiter_add(Ecore_Task_Cb func, void *data)
132 void *ecore_idle_exiter_del(Ecore_Idler *idler)
133
134 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)
135 void ecore_main_fd_handler_prepare_callback_set(Ecore_Fd_Handler *fd_handler, Ecore_Fd_Prep_Cb func, void *data)
136 void *ecore_main_fd_handler_del(Ecore_Fd_Handler *fd_handler)
137 int ecore_main_fd_handler_fd_get(Ecore_Fd_Handler *fd_handler)
138 int ecore_main_fd_handler_active_get(Ecore_Fd_Handler *fd_handler, Ecore_Fd_Handler_Flags flags)
139 void ecore_main_fd_handler_active_set(Ecore_Fd_Handler *fd_handler, Ecore_Fd_Handler_Flags flags)
140
141 Ecore_Event_Handler *ecore_event_handler_add(int type, Ecore_Event_Handler_Cb func, void *data)
142 void *ecore_event_handler_del(Ecore_Event_Handler *event_handler)
143 int ecore_event_type_new()
144 Ecore_Event *ecore_event_add(int type, void *ev, Ecore_End_Cb func_free, void *data)
145 void *ecore_event_del(Ecore_Event *ev)
146
147 void ecore_exe_run_priority_set(int pri)
148 int ecore_exe_run_priority_get()
149 Ecore_Exe *ecore_exe_pipe_run(char *exe_cmd, Ecore_Exe_Flags flags, void *data)
150 void ecore_exe_callback_pre_free_set(Ecore_Exe *exe, Ecore_Exe_Cb func)
151 int ecore_exe_send(Ecore_Exe *exe, const void *data, int size)
152 void ecore_exe_close_stdin(Ecore_Exe *exe)
153 void ecore_exe_auto_limits_set(Ecore_Exe *exe, int start_bytes, int end_bytes, int start_lines, int end_lines)
154 Ecore_Exe_Event_Data *ecore_exe_event_data_get(Ecore_Exe *exe, Ecore_Exe_Flags flags)
155 void ecore_exe_event_data_free(Ecore_Exe_Event_Data *data)
156 void *ecore_exe_free(Ecore_Exe *exe)
157 int ecore_exe_pid_get(Ecore_Exe *exe)
158 void ecore_exe_tag_set(Ecore_Exe *exe, char *tag)
159 const char * ecore_exe_tag_get(Ecore_Exe *exe)
160 const char * ecore_exe_cmd_get(Ecore_Exe *exe)
161 void *ecore_exe_data_get(Ecore_Exe *exe)
162 Ecore_Exe_Flags ecore_exe_flags_get(Ecore_Exe *exe)
163 void ecore_exe_pause(Ecore_Exe *exe)
164 void ecore_exe_continue(Ecore_Exe *exe)
165 void ecore_exe_interrupt(Ecore_Exe *exe)
166 void ecore_exe_quit(Ecore_Exe *exe)
167 void ecore_exe_terminate(Ecore_Exe *exe)
168 void ecore_exe_kill(Ecore_Exe *exe)
169 void ecore_exe_signal(Ecore_Exe *exe, int num)
170 void ecore_exe_hup(Ecore_Exe *exe)
171
172
173cdef extern from "Ecore_File.h":
174
175 ctypedef struct Ecore_File_Download_Job
176 ctypedef struct Ecore_File_Monitor
177
178 ctypedef void (*Ecore_File_Download_Completion_Cb)(void *data, const char *file, int status)
179 ctypedef int (*Ecore_File_Download_Progress_Cb)(void *data, const char *file, long int dltotal, long int dlnow, long int ultotal, long int ulnow)
180 ctypedef void (*Ecore_File_Monitor_Cb)(void *data, Ecore_File_Monitor *em, Ecore_File_Event event, const char *path)
181
182
183 int ecore_file_init()
184 int ecore_file_shutdown()
185 void ecore_file_download_abort(Ecore_File_Download_Job *job)
186 void ecore_file_download_abort_all()
187 Eina_Bool ecore_file_download_protocol_available(const char *protocol)
188 Eina_Bool ecore_file_download(const char *url, const char *dst,
189 Ecore_File_Download_Completion_Cb completion_cb,
190 Ecore_File_Download_Progress_Cb progress_cb,
191 void *data,
192 Ecore_File_Download_Job **job_ret)
193
194 Ecore_File_Monitor *ecore_file_monitor_add(const char *path, Ecore_File_Monitor_Cb func, void *data)
195 void ecore_file_monitor_del(Ecore_File_Monitor *ecore_file_monitor)
196 const char *ecore_file_monitor_path_get(Ecore_File_Monitor *ecore_file_monitor)
197
198
199####################################################################
200# Python classes
201#
202cdef class Timer(Eo):
203 cdef double _interval
204 cdef readonly object func, args, kargs
205 cpdef bint _task_exec(self) except *
206
207
208cdef class Animator(Eo):
209 cdef readonly object func
210 cdef readonly tuple args
211 cdef readonly dict kargs
212 cpdef bint _task_exec(self) except *
213
214
215cdef class Poller(Eo):
216 cdef readonly object func
217 cdef readonly tuple args
218 cdef readonly dict kargs
219 cpdef bint _task_exec(self) except *
220
221
222cdef class Idler(Eo):
223 cdef readonly object func, args, kargs
224 cpdef bint _task_exec(self) except *
225
226
227cdef class IdleEnterer(Idler):
228 pass
229
230
231cdef class IdleExiter(Idler):
232 pass
233
234
235cdef class FdHandler(object):
236 cdef Ecore_Fd_Handler *obj
237 cdef readonly object func
238 cdef readonly object args
239 cdef readonly object kargs
240 cdef readonly object _prepare_callback
241
242 cdef object _exec(self)
243
244
245cdef class Exe(object):
246 cdef Ecore_Exe *exe
247 cdef readonly object __data
248 cdef object __callbacks
249
250 cdef int _set_obj(self, char *exe_cmd, int flags) except 0
251 cdef int _unset_obj(self) except 0
252
253
254cdef class ExeEventFilter(object):
255 cdef Ecore_Exe *exe
256 cdef Ecore_Event_Handler *handler
257 cdef readonly object owner
258 cdef readonly int event_type
259 cdef object callbacks
260
261
262cdef class EventHandler(object):
263 cdef Ecore_Event_Handler *obj
264 cdef readonly int type
265 cdef readonly object event_cls
266 cdef readonly object func
267 cdef readonly object args
268 cdef readonly object kargs
269
270 cdef int _set_obj(self, Ecore_Event_Handler *obj) except 0
271 cdef int _unset_obj(self) except 0
272 cdef Eina_Bool _exec(self, void *event) except 2
273
274
275cdef class Event(object):
276 cdef int _set_obj(self, void *obj) except 0
277
278
279cdef class EventSignalUser(Event):
280 cdef readonly object number
281
282
283cdef class EventSignalHup(Event):
284 pass
285
286
287cdef class EventSignalExit(Event):
288 cdef readonly object interrupt
289 cdef readonly object quit
290 cdef readonly object terminate
291
292
293cdef class EventSignalPower(Event):
294 pass
295
296
297cdef class CustomEvent(Event):
298 cdef readonly object obj
299
300
301cdef class QueuedEvent:
302 cdef Ecore_Event *obj
303 cdef readonly object args
304
305 cdef int _set_obj(self, Ecore_Event *ev) except 0
306 cdef int _unset_obj(self) except 0
307
308
309cdef class EventExeAdd(Event):
310 cdef readonly object exe
311
312
313cdef class EventExeDel(Event):
314 cdef readonly object exe
315 cdef readonly object pid
316 cdef readonly object exit_code
317 cdef readonly object exit_signal
318 cdef readonly object exited
319 cdef readonly object signalled
320
321
322cdef class EventExeData(Event):
323 cdef readonly object exe
324 cdef readonly object data
325 cdef readonly object size
326 cdef readonly object lines
327
328
329cdef class FileDownload:
330 cdef Ecore_File_Download_Job *job
331 cdef readonly object completion_cb
332 cdef readonly object progress_cb
333 cdef readonly object args
334 cdef readonly object kargs
335
336 cdef object _exec_completion(self, const char *file, int status)
337 cdef object _exec_progress(self, const char *file,
338 long int dltotal, long int dlnow,
339 long int ultotal, long int ulnow)
340
341
342cdef class FileMonitor:
343 cdef Ecore_File_Monitor *mon
344 cdef readonly object monitor_cb
345 cdef readonly object args
346 cdef readonly object kargs
347
348 cdef object _exec_monitor(self, Ecore_File_Event event, const char *path)
diff --git a/efl/ecore/__init__.py b/efl/ecore/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/efl/ecore/__init__.py
diff --git a/efl/ecore/efl.ecore.pyx b/efl/ecore/__init__.pyx
index 45fa24b..45fa24b 100644
--- a/efl/ecore/efl.ecore.pyx
+++ b/efl/ecore/__init__.pyx
diff --git a/efl/ecore/enums.pxd b/efl/ecore/enums.pxd
new file mode 100644
index 0000000..6732fa6
--- /dev/null
+++ b/efl/ecore/enums.pxd
@@ -0,0 +1,86 @@
1# Copyright (C) 2007-2014 various contributors (see AUTHORS)
2#
3# This file is part of Python-EFL.
4#
5# Python-EFL 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 3 of the License, or (at your option) any later version.
9#
10# Python-EFL 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-EFL. If not, see <http://www.gnu.org/licenses/>.
17
18cdef extern from "Ecore.h":
19 enum:
20 ECORE_EVENT_SIGNAL_USER
21 ECORE_EVENT_SIGNAL_HUP
22 ECORE_EVENT_SIGNAL_EXIT
23 ECORE_EVENT_SIGNAL_POWER
24 ECORE_EVENT_SIGNAL_REALTIME
25
26 int ECORE_EXE_EVENT_ADD
27 int ECORE_EXE_EVENT_DEL
28 int ECORE_EXE_EVENT_DATA
29 int ECORE_EXE_EVENT_ERROR
30
31 enum:
32 ECORE_CALLBACK_CANCEL
33 ECORE_CALLBACK_RENEW
34
35 enum:
36 ECORE_CALLBACK_PASS_ON
37 ECORE_CALLBACK_DONE
38
39 ctypedef enum Ecore_Fd_Handler_Flags:
40 ECORE_FD_READ
41 ECORE_FD_WRITE
42 ECORE_FD_ERROR
43
44 ctypedef enum Ecore_Exe_Flags:
45 ECORE_EXE_NONE
46 ECORE_EXE_PIPE_READ
47 ECORE_EXE_PIPE_WRITE
48 ECORE_EXE_PIPE_ERROR
49 ECORE_EXE_PIPE_READ_LINE_BUFFERED
50 ECORE_EXE_PIPE_ERROR_LINE_BUFFERED
51 ECORE_EXE_PIPE_AUTO
52 ECORE_EXE_RESPAWN
53 ECORE_EXE_USE_SH
54 ECORE_EXE_NOT_LEADER
55 ECORE_EXE_TERM_WITH_PARENT
56
57 ctypedef enum Ecore_Pos_Map:
58 ECORE_POS_MAP_LINEAR
59 ECORE_POS_MAP_ACCELERATE
60 ECORE_POS_MAP_DECELERATE
61 ECORE_POS_MAP_SINUSOIDAL
62 ECORE_POS_MAP_ACCELERATE_FACTOR
63 ECORE_POS_MAP_DECELERATE_FACTOR
64 ECORE_POS_MAP_SINUSOIDAL_FACTOR
65 ECORE_POS_MAP_DIVISOR_INTERP
66 ECORE_POS_MAP_BOUNCE
67 ECORE_POS_MAP_SPRING
68
69 ctypedef enum Ecore_Animator_Source:
70 ECORE_ANIMATOR_SOURCE_TIMER
71 ECORE_ANIMATOR_SOURCE_CUSTOM
72
73 ctypedef enum Ecore_Poller_Type:
74 ECORE_POLLER_CORE
75
76
77cdef extern from "Ecore_File.h":
78 ctypedef enum Ecore_File_Event:
79 ECORE_FILE_EVENT_NONE
80 ECORE_FILE_EVENT_CREATED_FILE
81 ECORE_FILE_EVENT_CREATED_DIRECTORY
82 ECORE_FILE_EVENT_DELETED_FILE
83 ECORE_FILE_EVENT_DELETED_DIRECTORY
84 ECORE_FILE_EVENT_DELETED_SELF
85 ECORE_FILE_EVENT_MODIFIED
86 ECORE_FILE_EVENT_CLOSED