From: Enlightenment C. <no...@cv...> - 2007-11-12 01:55:37
|
Enlightenment CVS committal Author : barbieri Project : e17 Module : proto/python-efl Dir : e17/proto/python-efl/python-ecore/include/ecore Modified Files: c_ecore.pxd Log Message: Ecore events support and ecore.x.Window improvements, with examples. ecore now provides event support, it's generic, but types need to be registered with ecore._event_mapping_register(type, class) before they're used. ecore.x was improved to handle almost all events, example were added to examples/x. =================================================================== RCS file: /cvs/e/e17/proto/python-efl/python-ecore/include/ecore/c_ecore.pxd,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- c_ecore.pxd 30 Sep 2007 22:18:52 -0000 1.1 +++ c_ecore.pxd 12 Nov 2007 01:55:05 -0000 1.2 @@ -15,6 +15,7 @@ cdef struct Ecore_Idle_Enterer cdef struct Ecore_Idle_Exiter ctypedef struct Ecore_Fd_Handler + ctypedef void Ecore_Event_Handler int ecore_init() int ecore_shutdown() @@ -50,6 +51,10 @@ int ecore_main_fd_handler_active_get(Ecore_Fd_Handler *fd_handler, Ecore_Fd_Handler_Flags flags) void ecore_main_fd_handler_active_set(Ecore_Fd_Handler *fd_handler, Ecore_Fd_Handler_Flags flags) + Ecore_Event_Handler *ecore_event_handler_add(int type, int (*func) (void *data, int type, void *event), void *data) + void *ecore_event_handler_del(Ecore_Event_Handler *event_handler) + + cdef class Timer: cdef Ecore_Timer *obj @@ -105,3 +110,20 @@ cdef object _prepare_callback cdef object _exec(self) + + +cdef public class Event [object PyEcoreEvent, type PyEcoreEvent_Type]: + cdef int _set_obj(self, void *obj) except 0 + + +cdef class EventHandler: + cdef Ecore_Event_Handler *obj + cdef readonly int type + cdef readonly object event_cls + cdef readonly object func + cdef readonly object args + cdef readonly object kargs + + cdef int _set_obj(self, Ecore_Event_Handler *obj) except 0 + cdef int _unset_obj(self) except 0 + cdef int _exec(self, void *event) except 2 |