kuuko pushed a commit to branch master. http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=dd5b35ef8fc034ff7b23c708fa63e164b5aa2782
commit dd5b35ef8fc034ff7b23c708fa63e164b5aa2782 Author: Kai Huuhko <[email protected]> Date: Thu Mar 12 18:52:08 2015 +0200 Evas.Object: Re-order the methods into sections, cosmetic --- efl/evas/efl.evas_object.pxi | 1696 +++++++++++++++++++++--------------------- 1 file changed, 859 insertions(+), 837 deletions(-) diff --git a/efl/evas/efl.evas_object.pxi b/efl/evas/efl.evas_object.pxi index ec14248..a38f7e1 100644 --- a/efl/evas/efl.evas_object.pxi +++ b/efl/evas/efl.evas_object.pxi @@ -222,7 +222,6 @@ cdef class Object(Eo): """ evas_object_del(self.obj) - property evas: """ The evas Canvas that owns this object. @@ -255,207 +254,647 @@ cdef class Object(Eo): """Removes this object as a member of a smart object.""" evas_object_smart_member_del(self.obj) - property layer: - """Object's layer number. - - :type: int - - """ - def __set__(self, int layer): - evas_object_layer_set(self.obj, layer) - - def __get__(self): - return evas_object_layer_get(self.obj) - - def layer_set(self, int layer): - evas_object_layer_set(self.obj, layer) - def layer_get(self): - return evas_object_layer_get(self.obj) - - - def raise_(self): - """Raise to the top of its layer.""" - evas_object_raise(self.obj) - - def lower(self): - """Lower to the bottom of its layer. """ - evas_object_lower(self.obj) - def stack_above(self, Object above): - """Reorder to be above the given one. + def show(self): + """show() - :param above: - :type above: :py:class:`efl.evas.Object` + Show the object. """ - evas_object_stack_above(self.obj, above.obj) + evas_object_show(self.obj) - def stack_below(self, Object below): - """Reorder to be below the given one. + def hide(self): + """hide() - :param below: - :type below: :py:class:`efl.evas.Object` + Hide the object. """ - evas_object_stack_below(self.obj, below.obj) + evas_object_hide(self.obj) - property above: - """ The object above this. + property visible: + """Whenever it's visible or not. - :type: :py:class:`efl.evas.Object` + :type: bool """ def __get__(self): - return object_from_instance(evas_object_above_get(self.obj)) - - def above_get(self): - return object_from_instance(evas_object_above_get(self.obj)) + return bool(evas_object_visible_get(self.obj)) - property below: - """ The object below this. + def __set__(self, spec): + if spec: + self.show() + else: + self.hide() - :type: :py:class:`efl.evas.Object` + def visible_get(self): + return bool(evas_object_visible_get(self.obj)) + def visible_set(self, spec): + if spec: + self.show() + else: + self.hide() - """ - def __get__(self): - return object_from_instance(evas_object_below_get(self.obj)) + property precise_is_inside: + """Set whether to use precise (usually expensive) point collision + detection for a given Evas object. - def below_get(self): - return object_from_instance(evas_object_below_get(self.obj)) + Use this function to make Evas treat objects' transparent areas as + **not** belonging to it with regard to mouse pointer events. By + default, all of the object's boundary rectangle will be taken in + account for them. - property top: - """The topmost object. + :type: bool - :type: :py:class:`efl.evas.Object` + .. warning:: By using precise point collision detection you'll be + making Evas more resource intensive. """ + def __set__(self, precise): + evas_object_precise_is_inside_set(self.obj, precise) + def __get__(self): - return self.evas.top_get() + return bool(evas_object_precise_is_inside_get(self.obj)) - def top_get(self): - return self.evas.top_get() + def precise_is_inside_set(self, precise): + evas_object_precise_is_inside_set(self.obj, precise) - property bottom: - """The bottommost object. + def precise_is_inside_get(self): + return bool(evas_object_precise_is_inside_get(self.obj)) - :type: :py:class:`efl.evas.Object` + property static_clip: + """A hint flag on the object, whether this is used as a static clipper + or not. + + :type: bool """ def __get__(self): - return self.evas.bottom_get() + return bool(evas_object_static_clip_get(self.obj)) - def bottom_get(self): - return self.evas.bottom_get() + def __set__(self, value): + evas_object_static_clip_set(self.obj, value) - property geometry: - """Object's position and size. + def static_clip_get(self): + return bool(evas_object_static_clip_get(self.obj)) + def static_clip_set(self, int value): + evas_object_static_clip_set(self.obj, value) - :type: (int **x**, int **y**, int **w**, int **h**) + property render_op: + """Render operation used at drawing. + + :type: Evas_Render_Op """ def __get__(self): - cdef int x, y, w, h - evas_object_geometry_get(self.obj, &x, &y, &w, &h) - return (x, y, w, h) + return evas_object_render_op_get(self.obj) - def __set__(self, spec): - cdef int x, y, w, h - x, y, w, h = spec - evas_object_move(self.obj, x, y) - evas_object_resize(self.obj, w, h) + def __set__(self, int value): + evas_object_render_op_set(self.obj, <Evas_Render_Op>value) - def geometry_get(self): - cdef int x, y, w, h - evas_object_geometry_get(self.obj, &x, &y, &w, &h) - return (x, y, w, h) - def geometry_set(self, int x, int y, int w, int h): - evas_object_move(self.obj, x, y) - evas_object_resize(self.obj, w, h) + def render_op_get(self): + return evas_object_render_op_get(self.obj) + def render_op_set(self, int value): + evas_object_render_op_set(self.obj, <Evas_Render_Op>value) - property size: - """Object's size (width and height). + property anti_alias: + """If anti-aliased primitives should be used. - :type: (int **w**, int **h**) + :type: bool """ def __get__(self): - cdef int w, h - evas_object_geometry_get(self.obj, NULL, NULL, &w, &h) - return (w, h) + return bool(evas_object_anti_alias_get(self.obj)) - def __set__(self, spec): - cdef int w, h - w, h = spec - evas_object_resize(self.obj, w, h) + def __set__(self, int value): + evas_object_anti_alias_set(self.obj, value) - def size_get(self): - cdef int w, h - evas_object_geometry_get(self.obj, NULL, NULL, &w, &h) - return (w, h) - def size_set(self, int w, int h): - evas_object_resize(self.obj, w, h) + def anti_alias_get(self): + return bool(evas_object_anti_alias_get(self.obj)) + def anti_alias_set(self, int value): + evas_object_anti_alias_set(self.obj, value) - def resize(self, int w, int h): - """Same as assigning to :py:attr:`size`. + property scale: + """The scaling factor for an Evas object. Does not affect all objects. - :param w: Width. - :type w: int - :param h: Height. - :type h: int + Value of ``1.0`` means no scaling, default size. - """ - evas_object_resize(self.obj, w, h) + This will multiply the object's dimension by the given factor, thus + altering its geometry (width and height). Useful when you want + scalable UI elements, possibly at run time. - property pos: - """Object's position on the X and Y coordinates. + :type: double - :type: (int **x**, int **y**) + .. note:: Only text and textblock objects have scaling change + handlers. Other objects won't change visually on this call. """ - def __get__(self): # replicated to avoid performance hit - cdef int x, y - evas_object_geometry_get(self.obj, &x, &y, NULL, NULL) - return (x, y) + def __set__(self, scale): + evas_object_scale_set(self.obj, scale) - def __set__(self, spec): - cdef int x, y - x, y = spec - evas_object_move(self.obj, x, y) + def __get__(self): + return evas_object_scale_get(self.obj) - def pos_get(self): - cdef int x, y - evas_object_geometry_get(self.obj, &x, &y, NULL, NULL) - return (x, y) - def pos_set(self, int x, int y): - evas_object_move(self.obj, x, y) + def scale_set(self, double scale): + evas_object_scale_set(self.obj, scale) - property top_left: - """Object's top-left corner coordinates. + def scale_get(self): + return evas_object_scale_get(self.obj) - :type: (int **x**, int **y**) + property color: + """Object's (r, g, b, a) color, in pre-multiply colorspace. + + :type: (int **r**, int **g**, int **b**, int **a**) """ - def __get__(self): # replicated to avoid performance hit - cdef int x, y - evas_object_geometry_get(self.obj, &x, &y, NULL, NULL) - return (x, y) - def __set__(self, spec): - cdef int x, y - x, y = spec - evas_object_move(self.obj, x, y) + def __get__(self): + cdef int r, g, b, a + evas_object_color_get(self.obj, &r, &g, &b, &a) + return (r, g, b, a) - def top_left_get(self): - cdef int x, y - evas_object_geometry_get(self.obj, &x, &y, NULL, NULL) - return (x, y) - def top_left_set(self, int x, int y): - evas_object_move(self.obj, x, y) + def __set__(self, color): + cdef int r, g, b, a + r, g, b, a = color + evas_object_color_set(self.obj, r, g, b, a) - property top_center: - """The coordinates of the top-center position. + def color_set(self, int r, int g, int b, int a): + evas_object_color_set(self.obj, r, g, b, a) + def color_get(self): + cdef int r, g, b, a + evas_object_color_get(self.obj, &r, &g, &b, &a) + return (r, g, b, a) - :type: (int **x**, int **y**) + property clip: + """Object's clipper. + + :type: :py:class:`efl.evas.Object` + + """ + def __get__(self): + return object_from_instance(evas_object_clip_get(self.obj)) + + def __set__(self, value): + cdef Evas_Object *clip + cdef Object o + if value is None: + evas_object_clip_unset(self.obj) + elif isinstance(value, Object): + o = <Object>value + clip = o.obj + evas_object_clip_set(self.obj, clip) + else: + raise ValueError("clip must be evas.Object or None") + + def __del__(self): + evas_object_clip_unset(self.obj) + + def clip_get(self): + return object_from_instance(evas_object_clip_get(self.obj)) + + def clip_set(self, value): + cdef Evas_Object *clip + cdef Object o + if value is None: + evas_object_clip_unset(self.obj) + elif isinstance(value, Object): + o = <Object>value + clip = o.obj + evas_object_clip_set(self.obj, clip) + else: + raise ValueError("clip must be evas.Object or None") + + def clip_unset(self): + evas_object_clip_unset(self.obj) + + property clipees: + """Objects that this object clips. + + :type: tuple of :py:class:`efl.evas.Object` + + """ + def __get__(self): + return self.clipees_get() + + def clipees_get(self): + return eina_list_objects_to_python_list(evas_object_clipees_get(self.obj)) + + property name: + """Object name or *None*. + + :type: string + + """ + def __get__(self): + return _ctouni(evas_object_name_get(self.obj)) + + def __set__(self, value): + if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) + evas_object_name_set(self.obj, + <const char *>value if value is not None else NULL) + + def name_get(self): + return _ctouni(evas_object_name_get(self.obj)) + def name_set(self, value): + if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) + evas_object_name_set(self.obj, + <const char *>value if value is not None else NULL) + + property focus: + """Whenever object currently have the focus. + + :type: bool + + """ + def __get__(self): + return bool(evas_object_focus_get(self.obj)) + + def __set__(self, value): + evas_object_focus_set(self.obj, value) + + def focus_get(self): + return bool(evas_object_focus_get(self.obj)) + def focus_set(self, value): + evas_object_focus_set(self.obj, value) + + property pointer_mode: + """If pointer should be grabbed while processing events. + + If *EVAS_OBJECT_POINTER_MODE_AUTOGRAB*, then when mouse is + down at this object, events will be restricted to it as source, mouse + moves, for example, will be emitted even if outside this object area. + + If *EVAS_OBJECT_POINTER_MODE_NOGRAB*, then events will be emitted + just when inside this object area. + + The default value is *EVAS_OBJECT_POINTER_MODE_AUTOGRAB*. + + :type: Evas_Object_Pointer_Mode + + """ + def __get__(self): + return <int>evas_object_pointer_mode_get(self.obj) + + def __set__(self, int value): + evas_object_pointer_mode_set(self.obj, <Evas_Object_Pointer_Mode>value) + + def pointer_mode_get(self): + return <int>evas_object_pointer_mode_get(self.obj) + def pointer_mode_set(self, int value): + evas_object_pointer_mode_set(self.obj, <Evas_Object_Pointer_Mode>value) + + property smart_parent: + """Object that this object is member of, or *None*. + + :type: :py:class:`efl.evas.Object` + + .. versionchanged:: 1.14 + + This was renamed from ``parent`` as it was clashing with + :py:meth:`efl.eo.Eo.parent_get` and is more correct in regards to + C api naming. + + """ + def __get__(self): + cdef Evas_Object *obj + obj = evas_object_smart_parent_get(self.obj) + return object_from_instance(obj) + + def smart_parent_get(self): + cdef Evas_Object *obj + obj = evas_object_smart_parent_get(self.obj) + return object_from_instance(obj) + + property map_enabled: + """Map enabled state + + :type: bool + + """ + def __get__(self): + return bool(evas_object_map_enable_get(self.obj)) + def __set__(self, value): + evas_object_map_enable_set(self.obj, bool(value)) + + def map_enabled_set(self, enabled): + evas_object_map_enable_set(self.obj, bool(enabled)) + def map_enabled_get(self): + return bool(evas_object_map_enable_get(self.obj)) + + property map: + """Map + + :type: :py:class:`Map` + + """ + def __get__(self): + cdef Map ret = Map.__new__(Map) + ret.map = <Evas_Map *>evas_object_map_get(self.obj) + return ret + def __set__(self, Map m): + evas_object_map_set(self.obj, m.map) + + def map_set(self, Map m): + evas_object_map_set(self.obj, m.map) + + def map_get(self): + cdef Map ret = Map.__new__(Map) + ret.map = <Evas_Map *>evas_object_map_get(self.obj) + return ret + + def key_grab(self, keyname not None, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers, bint exclusive): + """Requests ``keyname`` key events be directed to ``obj``. + + :param keyname: the key to request events for. + :param modifiers: a mask of modifiers that must be present to + trigger the event. + :type modifiers: Evas_Modifier_Mask + :param not_modifiers: a mask of modifiers that must **not** be present + to trigger the event. + :type not_modifiers: Evas_Modifier_Mask + :param exclusive: request that the ``obj`` is the only object + receiving the ``keyname`` events. + :type exclusive: bool + :raise RuntimeError: if grabbing the key was unsuccesful + + Key grabs allow one or more objects to receive key events for + specific key strokes even if other objects have focus. Whenever a + key is grabbed, only the objects grabbing it will get the events + for the given keys. + + ``keyname`` is a platform dependent symbolic name for the key + pressed + + ``modifiers`` and ``not_modifiers`` are bit masks of all the + modifiers that must and mustn't, respectively, be pressed along + with ``keyname`` key in order to trigger this new key + grab. Modifiers can be things such as Shift and Ctrl as well as + user defined types via evas_key_modifier_add(). Retrieve them with + evas_key_modifier_mask_get() or use ``0`` for empty masks. + + ``exclusive`` will make the given object the only one permitted to + grab the given key. If given ``EINA_TRUE``, subsequent calls on this + function with different ``obj`` arguments will fail, unless the key + is ungrabbed again. + + .. warning:: Providing impossible modifier sets creates undefined behavior + + :see: evas_object_key_ungrab + :see: evas_object_focus_set + :see: evas_object_focus_get + :see: evas_focus_get + :see: evas_key_modifier_add + + """ + if isinstance(keyname, unicode): keyname = PyUnicode_AsUTF8String(keyname) + if not evas_object_key_grab(self.obj, <const char *>keyname, modifiers, not_modifiers, exclusive): + raise RuntimeError("Could not grab key.") + + def key_ungrab(self, keyname not None, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers): + """Removes the grab on ``keyname`` key events by ``obj``. + + :param keyname: the key the grab is set for. + :param modifiers: a mask of modifiers that must be present to + trigger the event. + :param not_modifiers: a mask of modifiers that must not not be + present to trigger the event. + + Removes a key grab on ``obj`` if ``keyname``, ``modifiers``, and + ``not_modifiers`` match. + + :see: evas_object_key_grab + :see: evas_object_focus_set + :see: evas_object_focus_get + :see: evas_focus_get + + """ + if isinstance(keyname, unicode): keyname = PyUnicode_AsUTF8String(keyname) + evas_object_key_ungrab(self.obj, <const char *>keyname, modifiers, not_modifiers) + + property is_frame_object: + """:type: bool""" + def __set__(self, bint is_frame): + evas_object_is_frame_object_set(self.obj, is_frame) + + def __get__(self): + return bool(evas_object_is_frame_object_get(self.obj)) + + def is_frame_object_set(self, bint is_frame): + evas_object_is_frame_object_set(self.obj, is_frame) + + def is_frame_object_get(self): + return bool(evas_object_is_frame_object_get(self.obj)) + + + ################## + #### Stacking #### + ################## + + property layer: + """Object's layer number. + + :type: int + + """ + def __set__(self, int layer): + evas_object_layer_set(self.obj, layer) + + def __get__(self): + return evas_object_layer_get(self.obj) + + def layer_set(self, int layer): + evas_object_layer_set(self.obj, layer) + def layer_get(self): + return evas_object_layer_get(self.obj) + + + def raise_(self): + """Raise to the top of its layer.""" + evas_object_raise(self.obj) + + def lower(self): + """Lower to the bottom of its layer. """ + evas_object_lower(self.obj) + + def stack_above(self, Object above): + """Reorder to be above the given one. + + :param above: + :type above: :py:class:`efl.evas.Object` + + """ + evas_object_stack_above(self.obj, above.obj) + + def stack_below(self, Object below): + """Reorder to be below the given one. + + :param below: + :type below: :py:class:`efl.evas.Object` + + """ + evas_object_stack_below(self.obj, below.obj) + + property above: + """ The object above this. + + :type: :py:class:`efl.evas.Object` + + """ + def __get__(self): + return object_from_instance(evas_object_above_get(self.obj)) + + def above_get(self): + return object_from_instance(evas_object_above_get(self.obj)) + + property below: + """ The object below this. + + :type: :py:class:`efl.evas.Object` + + """ + def __get__(self): + return object_from_instance(evas_object_below_get(self.obj)) + + def below_get(self): + return object_from_instance(evas_object_below_get(self.obj)) + + property top: + """The topmost object. + + :type: :py:class:`efl.evas.Object` + + """ + def __get__(self): + return self.evas.top_get() + + def top_get(self): + return self.evas.top_get() + + property bottom: + """The bottommost object. + + :type: :py:class:`efl.evas.Object` + + """ + def __get__(self): + return self.evas.bottom_get() + + def bottom_get(self): + return self.evas.bottom_get() + + + ######################## + #### Pixel geometry #### + ######################## + + property geometry: + """Object's position and size. + + :type: (int **x**, int **y**, int **w**, int **h**) + + """ + def __get__(self): + cdef int x, y, w, h + evas_object_geometry_get(self.obj, &x, &y, &w, &h) + return (x, y, w, h) + + def __set__(self, spec): + cdef int x, y, w, h + x, y, w, h = spec + evas_object_move(self.obj, x, y) + evas_object_resize(self.obj, w, h) + + def geometry_get(self): + cdef int x, y, w, h + evas_object_geometry_get(self.obj, &x, &y, &w, &h) + return (x, y, w, h) + def geometry_set(self, int x, int y, int w, int h): + evas_object_move(self.obj, x, y) + evas_object_resize(self.obj, w, h) + + property size: + """Object's size (width and height). + + :type: (int **w**, int **h**) + + """ + def __get__(self): + cdef int w, h + evas_object_geometry_get(self.obj, NULL, NULL, &w, &h) + return (w, h) + + def __set__(self, spec): + cdef int w, h + w, h = spec + evas_object_resize(self.obj, w, h) + + def size_get(self): + cdef int w, h + evas_object_geometry_get(self.obj, NULL, NULL, &w, &h) + return (w, h) + def size_set(self, int w, int h): + evas_object_resize(self.obj, w, h) + + def resize(self, int w, int h): + """Same as assigning to :py:attr:`size`. + + :param w: Width. + :type w: int + :param h: Height. + :type h: int + + """ + evas_object_resize(self.obj, w, h) + + property pos: + """Object's position on the X and Y coordinates. + + :type: (int **x**, int **y**) + + """ + def __get__(self): # replicated to avoid performance hit + cdef int x, y + evas_object_geometry_get(self.obj, &x, &y, NULL, NULL) + return (x, y) + + def __set__(self, spec): + cdef int x, y + x, y = spec + evas_object_move(self.obj, x, y) + + def pos_get(self): + cdef int x, y + evas_object_geometry_get(self.obj, &x, &y, NULL, NULL) + return (x, y) + def pos_set(self, int x, int y): + evas_object_move(self.obj, x, y) + + property top_left: + """Object's top-left corner coordinates. + + :type: (int **x**, int **y**) + + """ + def __get__(self): # replicated to avoid performance hit + cdef int x, y + evas_object_geometry_get(self.obj, &x, &y, NULL, NULL) + return (x, y) + + def __set__(self, spec): + cdef int x, y + x, y = spec + evas_object_move(self.obj, x, y) + + def top_left_get(self): + cdef int x, y + evas_object_geometry_get(self.obj, &x, &y, NULL, NULL) + return (x, y) + def top_left_set(self, int x, int y): + evas_object_move(self.obj, x, y) + + property top_center: + """The coordinates of the top-center position. + + :type: (int **x**, int **y**) """ def __get__(self): # replicated to avoid performance hit @@ -708,6 +1147,38 @@ cdef class Object(Eo): evas_object_move(self.obj, r.x0, r.y0) evas_object_resize(self.obj, r._w, r._h) + + def move(self, int x, int y): + """Same as assigning to :py:attr:`pos`. + + :param x: + :type x: int + :param y: + :type y: int + + """ + evas_object_move(self.obj, x, y) + + def move_relative(self, int dx, int dy): + """Move relatively to objects current position. + + :param dx: + :type dx: int + :param dy: + :type dy: int + + """ + cdef int x, y, x2, y2 + evas_object_geometry_get(self.obj, &x, &y, NULL, NULL) + x2 = x + dx + y2 = y + dy + evas_object_move(self.obj, x2, y2) + + + #################### + #### Size hints #### + #################### + property size_hint_min: """Hint about minimum size. @@ -926,376 +1397,195 @@ cdef class Object(Eo): This is not an enforcement, just a hint that can be used by other objects like Edje, boxes, tables and others. - Value 0.0 is disabled. - - When this property changes, EVAS_CALLBACK_CHANGED_SIZE_HINTS - will be emitted. - - :type: (double **x**, double **y**) - - .. seealso:: :ref:`evas-size-hints` - - """ - def __get__(self): - cdef double x, y - evas_object_size_hint_weight_get(self.obj, &x, &y) - return (x, y) - - def __set__(self, spec): - x, y = spec - evas_object_size_hint_weight_set(self.obj, x, y) - - def size_hint_weight_get(self): - cdef double x, y - evas_object_size_hint_weight_get(self.obj, &x, &y) - return (x, y) - def size_hint_weight_set(self, float x, float y): - evas_object_size_hint_weight_set(self.obj, x, y) - - property size_hint_expand: - """Hint about expand. - - This is just a convenience property to make it easier to understand - that **weight** is also used for **expand** properties. - This is **exactly** the same as using :attr:`size_hint_weight` - - :type: (double **x**, double **y**) - - .. seealso:: :ref:`evas-size-hints` - - .. versionadded:: 1.13 - - """ - def __get__(self): - cdef double x, y - evas_object_size_hint_expand_get(self.obj, &x, &y) - return (x, y) - - def __set__(self, spec): - x, y = spec - evas_object_size_hint_expand_set(self.obj, x, y) - - def size_hint_expand_get(self): - cdef double x, y - evas_object_size_hint_expand_get(self.obj, &x, &y) - return (x, y) - def size_hint_expand_set(self, float x, float y): - evas_object_size_hint_expand_set(self.obj, x, y) - - property size_hint_padding: - """Hint about padding. - - This is not an enforcement, just a hint that can be used by - other objects like Edje, boxes, tables and others. - - When this property changes, EVAS_CALLBACK_CHANGED_SIZE_HINTS - will be emitted. - - :type: (int **l**, int **r**, int **t**, int **b**) - - """ - def __get__(self): - cdef int l, r, t, b - evas_object_size_hint_padding_get(self.obj, &l, &r, &t, &b) - return (l, r, t, b) - - def __set__(self, spec): - l, r, t, b = spec - evas_object_size_hint_padding_set(self.obj, l, r, t, b) - - def size_hint_padding_get(self): - cdef int l, r, t, b - evas_object_size_hint_padding_get(self.obj, &l, &r, &t, &b) - return (l, r, t, b) - def size_hint_padding_set(self, int l, int r, int t, int b): - evas_object_size_hint_padding_set(self.obj, l, r, t, b) - - def move(self, int x, int y): - """Same as assigning to :py:attr:`pos`. - - :param x: - :type x: int - :param y: - :type y: int - - """ - evas_object_move(self.obj, x, y) - - def move_relative(self, int dx, int dy): - """Move relatively to objects current position. - - :param dx: - :type dx: int - :param dy: - :type dy: int - - """ - cdef int x, y, x2, y2 - evas_object_geometry_get(self.obj, &x, &y, NULL, NULL) - x2 = x + dx - y2 = y + dy - evas_object_move(self.obj, x2, y2) - - def show(self): - """show() - - Show the object. - - """ - evas_object_show(self.obj) - - def hide(self): - """hide() - - Hide the object. - - """ - evas_object_hide(self.obj) - - property visible: - """Whenever it's visible or not. - - :type: bool - - """ - def __get__(self): - return bool(evas_object_visible_get(self.obj)) - - def __set__(self, spec): - if spec: - self.show() - else: - self.hide() - - def visible_get(self): - return bool(evas_object_visible_get(self.obj)) - def visible_set(self, spec): - if spec: - self.show() - else: - self.hide() - - property precise_is_inside: - """Set whether to use precise (usually expensive) point collision - detection for a given Evas object. - - Use this function to make Evas treat objects' transparent areas as - **not** belonging to it with regard to mouse pointer events. By - default, all of the object's boundary rectangle will be taken in - account for them. - - :type: bool - - .. warning:: By using precise point collision detection you'll be - making Evas more resource intensive. - - """ - def __set__(self, precise): - evas_object_precise_is_inside_set(self.obj, precise) - - def __get__(self): - return bool(evas_object_precise_is_inside_get(self.obj)) - - def precise_is_inside_set(self, precise): - evas_object_precise_is_inside_set(self.obj, precise) + Value 0.0 is disabled. - def precise_is_inside_get(self): - return bool(evas_object_precise_is_inside_get(self.obj)) + When this property changes, EVAS_CALLBACK_CHANGED_SIZE_HINTS + will be emitted. - property static_clip: - """A hint flag on the object, whether this is used as a static clipper - or not. + :type: (double **x**, double **y**) - :type: bool + .. seealso:: :ref:`evas-size-hints` """ def __get__(self): - return bool(evas_object_static_clip_get(self.obj)) - - def __set__(self, value): - evas_object_static_clip_set(self.obj, value) - - def static_clip_get(self): - return bool(evas_object_static_clip_get(self.obj)) - def static_clip_set(self, int value): - evas_object_static_clip_set(self.obj, value) + cdef double x, y + evas_object_size_hint_weight_get(self.obj, &x, &y) + return (x, y) - property render_op: - """Render operation used at drawing. + def __set__(self, spec): + x, y = spec + evas_object_size_hint_weight_set(self.obj, x, y) - :type: Evas_Render_Op + def size_hint_weight_get(self): + cdef double x, y + evas_object_size_hint_weight_get(self.obj, &x, &y) + return (x, y) + def size_hint_weight_set(self, float x, float y): + evas_object_size_hint_weight_set(self.obj, x, y) - """ - def __get__(self): - return evas_object_render_op_get(self.obj) + property size_hint_expand: + """Hint about expand. - def __set__(self, int value): - evas_object_render_op_set(self.obj, <Evas_Render_Op>value) + This is just a convenience property to make it easier to understand + that **weight** is also used for **expand** properties. + This is **exactly** the same as using :attr:`size_hint_weight` - def render_op_get(self): - return evas_object_render_op_get(self.obj) - def render_op_set(self, int value): - evas_object_render_op_set(self.obj, <Evas_Render_Op>value) + :type: (double **x**, double **y**) - property anti_alias: - """If anti-aliased primitives should be used. + .. seealso:: :ref:`evas-size-hints` - :type: bool + .. versionadded:: 1.13 """ def __get__(self): - return bool(evas_object_anti_alias_get(self.obj)) - - def __set__(self, int value): - evas_object_anti_alias_set(self.obj, value) + cdef double x, y + evas_object_size_hint_expand_get(self.obj, &x, &y) + return (x, y) - def anti_alias_get(self): - return bool(evas_object_anti_alias_get(self.obj)) - def anti_alias_set(self, int value): - evas_object_anti_alias_set(self.obj, value) + def __set__(self, spec): + x, y = spec + evas_object_size_hint_expand_set(self.obj, x, y) - property scale: - """The scaling factor for an Evas object. Does not affect all objects. + def size_hint_expand_get(self): + cdef double x, y + evas_object_size_hint_expand_get(self.obj, &x, &y) + return (x, y) + def size_hint_expand_set(self, float x, float y): + evas_object_size_hint_expand_set(self.obj, x, y) - Value of ``1.0`` means no scaling, default size. + property size_hint_padding: + """Hint about padding. - This will multiply the object's dimension by the given factor, thus - altering its geometry (width and height). Useful when you want - scalable UI elements, possibly at run time. + This is not an enforcement, just a hint that can be used by + other objects like Edje, boxes, tables and others. - :type: double + When this property changes, EVAS_CALLBACK_CHANGED_SIZE_HINTS + will be emitted. - .. note:: Only text and textblock objects have scaling change - handlers. Other objects won't change visually on this call. + :type: (int **l**, int **r**, int **t**, int **b**) """ - def __set__(self, scale): - evas_object_scale_set(self.obj, scale) - def __get__(self): - return evas_object_scale_get(self.obj) - - def scale_set(self, double scale): - evas_object_scale_set(self.obj, scale) - - def scale_get(self): - return evas_object_scale_get(self.obj) + cdef int l, r, t, b + evas_object_size_hint_padding_get(self.obj, &l, &r, &t, &b) + return (l, r, t, b) - property color: - """Object's (r, g, b, a) color, in pre-multiply colorspace. + def __set__(self, spec): + l, r, t, b = spec + evas_object_size_hint_padding_set(self.obj, l, r, t, b) - :type: (int **r**, int **g**, int **b**, int **a**) + def size_hint_padding_get(self): + cdef int l, r, t, b + evas_object_size_hint_padding_get(self.obj, &l, &r, &t, &b) + return (l, r, t, b) + def size_hint_padding_set(self, int l, int r, int t, int b): + evas_object_size_hint_padding_set(self.obj, l, r, t, b) - """ - def __get__(self): - cdef int r, g, b, a - evas_object_color_get(self.obj, &r, &g, &b, &a) - return (r, g, b, a) + ############################ + #### Evas_Object Events #### + ############################ - def __set__(self, color): - cdef int r, g, b, a - r, g, b, a = color - evas_object_color_set(self.obj, r, g, b, a) + property pass_events: + """Whenever object should ignore and pass events. - def color_set(self, int r, int g, int b, int a): - evas_object_color_set(self.obj, r, g, b, a) - def color_get(self): - cdef int r, g, b, a - evas_object_color_get(self.obj, &r, &g, &b, &a) - return (r, g, b, a) + If True, this will cause events on it to be ignored. They will be + triggered on the next lower object (that is not set to pass events) + instead. - property clip: - """Object's clipper. + Objects that pass events will also not be accounted in some operations + unless explicitly required, like + :py:func:`efl.evas.Canvas.top_at_xy_get`, + :py:func:`efl.evas.Canvas.top_in_rectangle_get`, + :py:func:`efl.evas.Canvas.objects_at_xy_get`, + :py:func:`efl.evas.Canvas.objects_in_rectangle_get`. - :type: :py:class:`efl.evas.Object` + :type: bool """ def __get__(self): - return object_from_instance(evas_object_clip_get(self.obj)) - - def __set__(self, value): - cdef Evas_Object *clip - cdef Object o - if value is None: - evas_object_clip_unset(self.obj) - elif isinstance(value, Object): - o = <Object>value - clip = o.obj - evas_object_clip_set(self.obj, clip) - else: - raise ValueError("clip must be evas.Object or None") - - def __del__(self): - evas_object_clip_unset(self.obj) + return bool(evas_object_pass_events_get(self.obj)) - def clip_get(self): - return object_from_instance(evas_object_clip_get(self.obj)) + def __set__(self, int value): + evas_object_pass_events_set(self.obj, value) - def clip_set(self, value): - cdef Evas_Object *clip - cdef Object o - if value is None: - evas_object_clip_unset(self.obj) - elif isinstance(value, Object): - o = <Object>value - clip = o.obj - evas_object_clip_set(self.obj, clip) - else: - raise ValueError("clip must be evas.Object or None") + def pass_events_get(self): + return bool(evas_object_pass_events_get(self.obj)) + def pass_events_set(self, value): + evas_object_pass_events_set(self.obj, value) - def clip_unset(self): - evas_object_clip_unset(self.obj) + property repeat_events: + """Whenever object should process and then repeat events. - property clipees: - """Objects that this object clips. + If True, this will cause events on it to be processed but then + they will be triggered on the next lower object (that is not set to + pass events). - :type: tuple of :py:class:`efl.evas.Object` + :type: bool """ def __get__(self): - return self.clipees_get() + return bool(evas_object_repeat_events_get(self.obj)) - def clipees_get(self): - return eina_list_objects_to_python_list(evas_object_clipees_get(self.obj)) + def __set__(self, int value): + evas_object_repeat_events_set(self.obj, value) - property name: - """Object name or *None*. + def repeat_events_get(self): + return bool(evas_object_repeat_events_get(self.obj)) + def repeat_events_set(self, value): + evas_object_repeat_events_set(self.obj, value) - :type: string + property propagate_events: + """Whenever object should propagate events to its parent. + + If True, this will cause events on this object to propagate to its + :py:class:`efl.evas.SmartObject` parent, if it's a member + of one. + + :type: bool """ def __get__(self): - return _ctouni(evas_object_name_get(self.obj)) + return bool(evas_object_propagate_events_get(self.obj)) - def __set__(self, value): - if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) - evas_object_name_set(self.obj, - <const char *>value if value is not None else NULL) + def __set__(self, int value): + evas_object_propagate_events_set(self.obj, value) - def name_get(self): - return _ctouni(evas_object_name_get(self.obj)) - def name_set(self, value): - if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) - evas_object_name_set(self.obj, - <const char *>value if value is not None else NULL) + def propagate_events_get(self): + return bool(evas_object_propagate_events_get(self.obj)) + def propagate_events_set(self, value): + evas_object_propagate_events_set(self.obj, value) - property focus: - """Whenever object currently have the focus. + property freeze_events: + """Whether an Evas object is to freeze (discard) events. + + If True, events will be **discarded**. Unlike :py:attr:`pass_events`, + events will not be passed to **next** lower object. This API can be used + for blocking events while the object is on transiting. + + If False, events will be processed as normal. :type: bool + .. seealso:: + + :py:attr:`pass_events` + :py:attr:`repeat_events` + :py:attr:`propagate_events` + """ + def __set__(self, freeze): + evas_object_freeze_events_set(self.obj, freeze) + def __get__(self): - return bool(evas_object_focus_get(self.obj)) + return bool(evas_object_freeze_events_get(self.obj)) + + def freeze_events_set(self, freeze): + evas_object_freeze_events_set(self.obj, freeze) - def __set__(self, value): - evas_object_focus_set(self.obj, value) + def freeze_events_get(self): + return bool(evas_object_freeze_events_get(self.obj)) - def focus_get(self): - return bool(evas_object_focus_get(self.obj)) - def focus_set(self, value): - evas_object_focus_set(self.obj, value) def event_callback_add(self, Evas_Callback_Type type, func, *args, **kargs): """Add a new callback for the given event. @@ -1422,443 +1712,175 @@ cdef class Object(Eo): Expected signature:: - function(object, event_info, *args, **kargs) - """ - self.event_callback_add(EVAS_CALLBACK_MOUSE_WHEEL, func, *a, **k) - - def on_mouse_wheel_del(self, func): - """Same as event_callback_del(EVAS_CALLBACK_MOUSE_WHEEL, ...)""" - self.event_callback_del(EVAS_CALLBACK_MOUSE_WHEEL, func) - - def on_free_add(self, func, *a, **k): - """Same as event_callback_add(EVAS_CALLBACK_FREE, ...) - - This is called after freeing object resources (see - EVAS_CALLBACK_DEL). - - Expected signature:: - - function(object, *args, **kargs) - """ - self.event_callback_add(EVAS_CALLBACK_FREE, func, *a, **k) - - def on_free_del(self, func): - """Same as event_callback_del(EVAS_CALLBACK_FREE, ...)""" - self.event_callback_del(EVAS_CALLBACK_FREE, func) - - def on_key_down_add(self, func, *a, **k): - """Same as event_callback_add(EVAS_CALLBACK_KEY_DOWN, ...) - - Expected signature:: - - function(object, event_info, *args, **kargs) - """ - self.event_callback_add(EVAS_CALLBACK_KEY_DOWN, func, *a, **k) - - def on_key_down_del(self, func): - """Same as event_callback_del(EVAS_CALLBACK_KEY_DOWN, ...)""" - self.event_callback_del(EVAS_CALLBACK_KEY_DOWN, func) - - def on_key_up_add(self, func, *a, **k): - """Same as event_callback_add(EVAS_CALLBACK_KEY_UP, ...) - - Expected signature:: - - function(object, event_info, *args, **kargs) - """ - self.event_callback_add(EVAS_CALLBACK_KEY_UP, func, *a, **k) - - def on_key_up_del(self, func): - """Same as event_callback_del(EVAS_CALLBACK_KEY_UP, ...)""" - self.event_callback_del(EVAS_CALLBACK_KEY_UP, func) - - def on_focus_in_add(self, func, *a, **k): - """Same as event_callback_add(EVAS_CALLBACK_FOCUS_IN, ...) - - Expected signature:: - - function(object, *args, **kargs) - """ - self.event_callback_add(EVAS_CALLBACK_FOCUS_IN, func, *a, **k) - - def on_focus_in_del(self, func): - """Same as event_callback_del(EVAS_CALLBACK_FOCUS_IN, ...)""" - self.event_callback_del(EVAS_CALLBACK_FOCUS_IN, func) - - def on_focus_out_add(self, func, *a, **k): - """Same as event_callback_add(EVAS_CALLBACK_FOCUS_OUT, ...) - - Expected signature:: - - function(object, *args, **kargs) - """ - self.event_callback_add(EVAS_CALLBACK_FOCUS_OUT, func, *a, **k) - - def on_focus_out_del(self, func): - """Same as event_callback_del(EVAS_CALLBACK_FOCUS_OUT, ...)""" - self.event_callback_del(EVAS_CALLBACK_FOCUS_OUT, func) - - def on_show_add(self, func, *a, **k): - """Same as event_callback_add(EVAS_CALLBACK_SHOW, ...) - - Expected signature:: - - function(object, *args, **kargs) - """ - self.event_callback_add(EVAS_CALLBACK_SHOW, func, *a, **k) - - def on_show_del(self, func): - """Same as event_callback_del(EVAS_CALLBACK_SHOW, ...)""" - self.event_callback_del(EVAS_CALLBACK_SHOW, func) - - def on_hide_add(self, func, *a, **k): - """Same as event_callback_add(EVAS_CALLBACK_HIDE, ...) - - Expected signature:: - - function(object, *args, **kargs) - """ - self.event_callback_add(EVAS_CALLBACK_HIDE, func, *a, **k) - - def on_hide_del(self, func): - """Same as event_callback_del(EVAS_CALLBACK_HIDE, ...)""" - self.event_callback_del(EVAS_CALLBACK_HIDE, func) - - def on_move_add(self, func, *a, **k): - """Same as event_callback_add(EVAS_CALLBACK_MOVE, ...) - - Expected signature:: - - function(object, *args, **kargs) - """ - self.event_callback_add(EVAS_CALLBACK_MOVE, func, *a, **k) - - def on_move_del(self, func): - """Same as event_callback_del(EVAS_CALLBACK_MOVE, ...)""" - self.event_callback_del(EVAS_CALLBACK_MOVE, func) - - def on_resize_add(self, func, *a, **k): - """Same as event_callback_add(EVAS_CALLBACK_RESIZE, ...) - - Expected signature:: - - function(object, *args, **kargs) - """ - self.event_callback_add(EVAS_CALLBACK_RESIZE, func, *a, **k) - - def on_resize_del(self, func): - """Same as event_callback_del(EVAS_CALLBACK_RESIZE, ...)""" - self.event_callback_del(EVAS_CALLBACK_RESIZE, func) - - def on_restack_add(self, func, *a, **k): - """Same as event_callback_add(EVAS_CALLBACK_RESTACK, ...) - - Expected signature:: - - function(object, *args, **kargs) - """ - self.event_callback_add(EVAS_CALLBACK_RESTACK, func, *a, **k) - - def on_restack_del(self, func): - """Same as event_callback_del(EVAS_CALLBACK_RESTACK, ...)""" - self.event_callback_del(EVAS_CALLBACK_RESTACK, func) - - def on_del_add(self, func, *a, **k): - """Same as event_callback_add(EVAS_CALLBACK_DEL, ...) - - This is called before freeing object resources (see - EVAS_CALLBACK_FREE). - - Expected signature:: - - function(object, *args, **kargs) - """ - self.event_callback_add(EVAS_CALLBACK_DEL, func, *a, **k) - - def on_del_del(self, func): - """Same as event_callback_del(EVAS_CALLBACK_DEL, ...)""" - self.event_callback_del(EVAS_CALLBACK_DEL, func) - - def on_hold_add(self, func, *a, **k): - """Same as event_callback_add(EVAS_CALLBACK_HOLD, ...)""" - self.event_callback_add(EVAS_CALLBACK_HOLD, func, *a, **k) - - def on_hold_del(self, func): - """Same as event_callback_del(EVAS_CALLBACK_HOLD, ...)""" - self.event_callback_del(EVAS_CALLBACK_HOLD, func) - - def on_changed_size_hints_add(self, func, *a, **k): - """Same as event_callback_add(EVAS_CALLBACK_CHANGED_SIZE_HINTS, ...)""" - self.event_callback_add(EVAS_CALLBACK_CHANGED_SIZE_HINTS, func, *a, **k) - - def on_changed_size_hints_del(self, func): - """Same as event_callback_del(EVAS_CALLBACK_CHANGED_SIZE_HINTS, ...)""" - self.event_callback_del(EVAS_CALLBACK_CHANGED_SIZE_HINTS, func) - - property pass_events: - """Whenever object should ignore and pass events. - - If True, this will cause events on it to be ignored. They will be - triggered on the next lower object (that is not set to pass events) - instead. - - Objects that pass events will also not be accounted in some operations - unless explicitly required, like - :py:func:`efl.evas.Canvas.top_at_xy_get`, - :py:func:`efl.evas.Canvas.top_in_rectangle_get`, - :py:func:`efl.evas.Canvas.objects_at_xy_get`, - :py:func:`efl.evas.Canvas.objects_in_rectangle_get`. - - :type: bool - - """ - def __get__(self): - return bool(evas_object_pass_events_get(self.obj)) - - def __set__(self, int value): - evas_object_pass_events_set(self.obj, value) - - def pass_events_get(self): - return bool(evas_object_pass_events_get(self.obj)) - def pass_events_set(self, value): - evas_object_pass_events_set(self.obj, value) - - property repeat_events: - """Whenever object should process and then repeat events. - - If True, this will cause events on it to be processed but then - they will be triggered on the next lower object (that is not set to - pass events). - - :type: bool - - """ - def __get__(self): - return bool(evas_object_repeat_events_get(self.obj)) - - def __set__(self, int value): - evas_object_repeat_events_set(self.obj, value) - - def repeat_events_get(self): - return bool(evas_object_repeat_events_get(self.obj)) - def repeat_events_set(self, value): - evas_object_repeat_events_set(self.obj, value) - - property propagate_events: - """Whenever object should propagate events to its parent. - - If True, this will cause events on this object to propagate to its - :py:class:`efl.evas.SmartObject` parent, if it's a member - of one. - - :type: bool - - """ - def __get__(self): - return bool(evas_object_propagate_events_get(self.obj)) - - def __set__(self, int value): - evas_object_propagate_events_set(self.obj, value) - - def propagate_events_get(self): - return bool(evas_object_propagate_events_get(self.obj)) - def propagate_events_set(self, value): - evas_object_propagate_events_set(self.obj, value) - - property freeze_events: - """Whether an Evas object is to freeze (discard) events. - - If True, events will be **discarded**. Unlike :py:attr:`pass_events`, - events will not be passed to **next** lower object. This API can be used - for blocking events while the object is on transiting. + function(object, event_info, *args, **kargs) + """ + self.event_callback_add(EVAS_CALLBACK_MOUSE_WHEEL, func, *a, **k) - If False, events will be processed as normal. + def on_mouse_wheel_del(self, func): + """Same as event_callback_del(EVAS_CALLBACK_MOUSE_WHEEL, ...)""" + self.event_callback_del(EVAS_CALLBACK_MOUSE_WHEEL, func) - :type: bool + def on_free_add(self, func, *a, **k): + """Same as event_callback_add(EVAS_CALLBACK_FREE, ...) - .. seealso:: + This is called after freeing object resources (see + EVAS_CALLBACK_DEL). - :py:attr:`pass_events` - :py:attr:`repeat_events` - :py:attr:`propagate_events` + Expected signature:: + function(object, *args, **kargs) """ - def __set__(self, freeze): - evas_object_freeze_events_set(self.obj, freeze) - - def __get__(self): - return bool(evas_object_freeze_events_get(self.obj)) + self.event_callback_add(EVAS_CALLBACK_FREE, func, *a, **k) - def freeze_events_set(self, freeze): - evas_object_freeze_events_set(self.obj, freeze) + def on_free_del(self, func): + """Same as event_callback_del(EVAS_CALLBACK_FREE, ...)""" + self.event_callback_del(EVAS_CALLBACK_FREE, func) - def freeze_events_get(self): - return bool(evas_object_freeze_events_get(self.obj)) + def on_key_down_add(self, func, *a, **k): + """Same as event_callback_add(EVAS_CALLBACK_KEY_DOWN, ...) - property pointer_mode: - """If pointer should be grabbed while processing events. + Expected signature:: - If *EVAS_OBJECT_POINTER_MODE_AUTOGRAB*, then when mouse is - down at this object, events will be restricted to it as source, mouse - moves, for example, will be emitted even if outside this object area. + function(object, event_info, *args, **kargs) + """ + self.event_callback_add(EVAS_CALLBACK_KEY_DOWN, func, *a, **k) - If *EVAS_OBJECT_POINTER_MODE_NOGRAB*, then events will be emitted - just when inside this object area. + def on_key_down_del(self, func): + """Same as event_callback_del(EVAS_CALLBACK_KEY_DOWN, ...)""" + self.event_callback_del(EVAS_CALLBACK_KEY_DOWN, func) - The default value is *EVAS_OBJECT_POINTER_MODE_AUTOGRAB*. + def on_key_up_add(self, func, *a, **k): + """Same as event_callback_add(EVAS_CALLBACK_KEY_UP, ...) - :type: Evas_Object_Pointer_Mode + Expected signature:: + function(object, event_info, *args, **kargs) """ - def __get__(self): - return <int>evas_object_pointer_mode_get(self.obj) + self.event_callback_add(EVAS_CALLBACK_KEY_UP, func, *a, **k) - def __set__(self, int value): - evas_object_pointer_mode_set(self.obj, <Evas_Object_Pointer_Mode>value) + def on_key_up_del(self, func): + """Same as event_callback_del(EVAS_CALLBACK_KEY_UP, ...)""" + self.event_callback_del(EVAS_CALLBACK_KEY_UP, func) - def pointer_mode_get(self): - return <int>evas_object_pointer_mode_get(self.obj) - def pointer_mode_set(self, int value): - evas_object_pointer_mode_set(self.obj, <Evas_Object_Pointer_Mode>value) + def on_focus_in_add(self, func, *a, **k): + """Same as event_callback_add(EVAS_CALLBACK_FOCUS_IN, ...) - property smart_parent: - """Object that this object is member of, or *None*. + Expected signature:: - :type: :py:class:`efl.evas.Object` + function(object, *args, **kargs) + """ + self.event_callback_add(EVAS_CALLBACK_FOCUS_IN, func, *a, **k) - .. versionchanged:: 1.14 + def on_focus_in_del(self, func): + """Same as event_callback_del(EVAS_CALLBACK_FOCUS_IN, ...)""" + self.event_callback_del(EVAS_CALLBACK_FOCUS_IN, func) - This was renamed from ``parent`` as it was clashing with - :py:meth:`efl.eo.Eo.parent_get` and is more correct in regards to - C api naming. + def on_focus_out_add(self, func, *a, **k): + """Same as event_callback_add(EVAS_CALLBACK_FOCUS_OUT, ...) + + Expected signature:: + function(object, *args, **kargs) """ - def __get__(self): - cdef Evas_Object *obj - obj = evas_object_smart_parent_get(self.obj) - return object_from_instance(obj) + self.event_callback_add(EVAS_CALLBACK_FOCUS_OUT, func, *a, **k) - def smart_parent_get(self): - cdef Evas_Object *obj - obj = evas_object_smart_parent_get(self.obj) - return object_from_instance(obj) + def on_focus_out_del(self, func): + """Same as event_callback_del(EVAS_CALLBACK_FOCUS_OUT, ...)""" + self.event_callback_del(EVAS_CALLBACK_FOCUS_OUT, func) - property map_enabled: - """Map enabled state + def on_show_add(self, func, *a, **k): + """Same as event_callback_add(EVAS_CALLBACK_SHOW, ...) - :type: bool + Expected signature:: + function(object, *args, **kargs) """ - def __get__(self): - return bool(evas_object_map_enable_get(self.obj)) - def __set__(self, value): - evas_object_map_enable_set(self.obj, bool(value)) + self.event_callback_add(EVAS_CALLBACK_SHOW, func, *a, **k) - def map_enabled_set(self, enabled): - evas_object_map_enable_set(self.obj, bool(enabled)) - def map_enabled_get(self): - return bool(evas_object_map_enable_get(self.obj)) + def on_show_del(self, func): + """Same as event_callback_del(EVAS_CALLBACK_SHOW, ...)""" + self.event_callback_del(EVAS_CALLBACK_SHOW, func) - property map: - """Map + def on_hide_add(self, func, *a, **k): + """Same as event_callback_add(EVAS_CALLBACK_HIDE, ...) - :type: :py:class:`Map` + Expected signature:: + function(object, *args, **kargs) """ - def __get__(self): - cdef Map ret = Map.__new__(Map) - ret.map = <Evas_Map *>evas_object_map_get(self.obj) - return ret - def __set__(self, Map m): - evas_object_map_set(self.obj, m.map) + self.event_callback_add(EVAS_CALLBACK_HIDE, func, *a, **k) - def map_set(self, Map m): - evas_object_map_set(self.obj, m.map) + def on_hide_del(self, func): + """Same as event_callback_del(EVAS_CALLBACK_HIDE, ...)""" + self.event_callback_del(EVAS_CALLBACK_HIDE, func) - def map_get(self): - cdef Map ret = Map.__new__(Map) - ret.map = <Evas_Map *>evas_object_map_get(self.obj) - return ret + def on_move_add(self, func, *a, **k): + """Same as event_callback_add(EVAS_CALLBACK_MOVE, ...) - def key_grab(self, keyname not None, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers, bint exclusive): - """Requests ``keyname`` key events be directed to ``obj``. + Expected signature:: - :param keyname: the key to request events for. - :param modifiers: a mask of modifiers that must be present to - trigger the event. - :type modifiers: Evas_Modifier_Mask - :param not_modifiers: a mask of modifiers that must **not** be present - to trigger the event. - :type not_modifiers: Evas_Modifier_Mask - :param exclusive: request that the ``obj`` is the only object - receiving the ``keyname`` events. - :type exclusive: bool - :raise RuntimeError: if grabbing the key was unsuccesful + function(object, *args, **kargs) + """ + self.event_callback_add(EVAS_CALLBACK_MOVE, func, *a, **k) - Key grabs allow one or more objects to receive key events for - specific key strokes even if other objects have focus. Whenever a - key is grabbed, only the objects grabbing it will get the events - for the given keys. + def on_move_del(self, func): + """Same as event_callback_del(EVAS_CALLBACK_MOVE, ...)""" + self.event_callback_del(EVAS_CALLBACK_MOVE, func) - ``keyname`` is a platform dependent symbolic name for the key - pressed + def on_resize_add(self, func, *a, **k): + """Same as event_callback_add(EVAS_CALLBACK_RESIZE, ...) - ``modifiers`` and ``not_modifiers`` are bit masks of all the - modifiers that must and mustn't, respectively, be pressed along - with ``keyname`` key in order to trigger this new key - grab. Modifiers can be things such as Shift and Ctrl as well as - user defined types via evas_key_modifier_add(). Retrieve them with - evas_key_modifier_mask_get() or use ``0`` for empty masks. + Expected signature:: - ``exclusive`` will make the given object the only one permitted to - grab the given key. If given ``EINA_TRUE``, subsequent calls on this - function with different ``obj`` arguments will fail, unless the key - is ungrabbed again. + function(object, *args, **kargs) + """ + self.event_callback_add(EVAS_CALLBACK_RESIZE, func, *a, **k) - .. warning:: Providing impossible modifier sets creates undefined behavior + def on_resize_del(self, func): + """Same as event_callback_del(EVAS_CALLBACK_RESIZE, ...)""" + self.event_callback_del(EVAS_CALLBACK_RESIZE, func) - :see: evas_object_key_ungrab - :see: evas_object_focus_set - :see: evas_object_focus_get - :see: evas_focus_get - :see: evas_key_modifier_add + def on_restack_add(self, func, *a, **k): + """Same as event_callback_add(EVAS_CALLBACK_RESTACK, ...) + + Expected signature:: + function(object, *args, **kargs) """ - if isinstance(keyname, unicode): keyname = PyUnicode_AsUTF8String(keyname) - if not evas_object_key_grab(self.obj, <const char *>keyname, modifiers, not_modifiers, exclusive): - raise RuntimeError("Could not grab key.") + self.event_callback_add(EVAS_CALLBACK_RESTACK, func, *a, **k) - def key_ungrab(self, keyname not None, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers): - """Removes the grab on ``keyname`` key events by ``obj``. + def on_restack_del(self, func): + """Same as event_callback_del(EVAS_CALLBACK_RESTACK, ...)""" + self.event_callback_del(EVAS_CALLBACK_RESTACK, func) - :param keyname: the key the grab is set for. - :param modifiers: a mask of modifiers that must be present to - trigger the event. - :param not_modifiers: a mask of modifiers that must not not be - present to trigger the event. + def on_del_add(self, func, *a, **k): + """Same as event_callback_add(EVAS_CALLBACK_DEL, ...) - Removes a key grab on ``obj`` if ``keyname``, ``modifiers``, and - ``not_modifiers`` match. + This is called before freeing object resources (see + EVAS_CALLBACK_FREE). - :see: evas_object_key_grab - :see: evas_object_focus_set - :see: evas_object_focus_get - :see: evas_focus_get + Expected signature:: + function(object, *args, **kargs) """ - if isinstance(keyname, unicode): keyname = PyUnicode_AsUTF8String(keyname) - evas_object_key_ungrab(self.obj, <const char *>keyname, modifiers, not_modifiers) + self.event_callback_add(EVAS_CALLBACK_DEL, func, *a, **k) - property is_frame_object: - """:type: bool""" - def __set__(self, bint is_frame): - evas_object_is_frame_object_set(self.obj, is_frame) + def on_del_del(self, func): + """Same as event_callback_del(EVAS_CALLBACK_DEL, ...)""" + self.event_callback_del(EVAS_CALLBACK_DEL, func) - def __get__(self): - return bool(evas_object_is_frame_object_get(self.obj)) + def on_hold_add(self, func, *a, **k): + """Same as event_callback_add(EVAS_CALLBACK_HOLD, ...)""" + self.event_callback_add(EVAS_CALLBACK_HOLD, func, *a, **k) - def is_frame_object_set(self, bint is_frame): - evas_object_is_frame_object_set(self.obj, is_frame) + def on_hold_del(self, func): + """Same as event_callback_del(EVAS_CALLBACK_HOLD, ...)""" + self.event_callback_del(EVAS_CALLBACK_HOLD, func) - def is_frame_object_get(self): - return bool(evas_object_is_frame_object_get(self.obj)) + def on_changed_size_hints_add(self, func, *a, **k): + """Same as event_callback_add(EVAS_CALLBACK_CHANGED_SIZE_HINTS, ...)""" + self.event_callback_add(EVAS_CALLBACK_CHANGED_SIZE_HINTS, func, *a, **k) + + def on_changed_size_hints_del(self, func): + """Same as event_callback_del(EVAS_CALLBACK_CHANGED_SIZE_HINTS, ...)""" + self.event_callback_del(EVAS_CALLBACK_CHANGED_SIZE_HINTS, func) --
