Enlightenment CVS committal Author : cmarcelo Project : e17 Module : proto/python-efl
Dir : e17/proto/python-efl/python-evas/include/evas Modified Files: c_evas.pxd Log Message: Add protection code for event objects, avoiding invalid references. Event objects are meant to be used only inside the callbacks, so any access after the callback returns will be considered invalid and raise a ValueError. The first idea (reverted by previous patch) was to make these objects without any reference to original event (copying data), so they couldn't cause trouble. But now we will have event_flags field, which is writeable by the callbacks, so it's better just keep the reference and invalidate the object as we do. =================================================================== RCS file: /cvs/e/e17/proto/python-efl/python-evas/include/evas/c_evas.pxd,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- c_evas.pxd 26 Mar 2008 04:36:27 -0000 1.9 +++ c_evas.pxd 26 Mar 2008 04:41:15 -0000 1.10 @@ -551,6 +551,8 @@ cdef Evas_Point *obj cdef void _set_obj(self, Evas_Point *obj) + cdef void _unset_obj(self) + cdef void _check_validity(self) except * cdef class EventPosition: @@ -558,6 +560,7 @@ cdef readonly EventPoint canvas cdef void _set_objs(self, void *output, void *canvas) + cdef void _unset_objs(self) cdef class EventMouseIn: @@ -565,6 +568,8 @@ cdef readonly EventPosition position cdef void _set_obj(self, void *ptr) + cdef void _unset_obj(self) + cdef void _check_validity(self) except * cdef class EventMouseOut: @@ -572,6 +577,8 @@ cdef readonly EventPosition position cdef void _set_obj(self, void *ptr) + cdef void _unset_obj(self) + cdef void _check_validity(self) except * cdef class EventMouseDown: @@ -579,6 +586,8 @@ cdef readonly EventPosition position cdef void _set_obj(self, void *ptr) + cdef void _unset_obj(self) + cdef void _check_validity(self) except * cdef class EventMouseUp: @@ -586,6 +595,8 @@ cdef readonly EventPosition position cdef void _set_obj(self, void *ptr) + cdef void _unset_obj(self) + cdef void _check_validity(self) except * cdef class EventMouseMove: @@ -594,6 +605,8 @@ cdef readonly EventPosition prev_position cdef void _set_obj(self, void *ptr) + cdef void _unset_obj(self) + cdef void _check_validity(self) except * cdef class EventMouseWheel: @@ -601,18 +614,24 @@ cdef readonly EventPosition position cdef void _set_obj(self, void *ptr) + cdef void _unset_obj(self) + cdef void _check_validity(self) except * cdef class EventKeyDown: cdef Evas_Event_Key_Down *obj cdef void _set_obj(self, void *ptr) + cdef void _unset_obj(self) + cdef void _check_validity(self) except * cdef class EventKeyUp: cdef Evas_Event_Key_Up *obj cdef void _set_obj(self, void *ptr) + cdef void _unset_obj(self) + cdef void _check_validity(self) except * cdef public class Canvas [object PyEvasCanvas, type PyEvasCanvas_Type]: ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs