Bases: efl.eo.Eo
Basic Graphical Object (or actor).
Objects are managed by Canvas in a non- immediate way, that is, all operations, like moving, resizing, changing the color, etc will not trigger immediate repainting, instead it will save the new state and mark both this object and its Canvas as “dirty” so can be redrawn on Canvas.render() (usually called by the underlying system, when you’re entering idle. This means that doesn’t matter how many times you’re moving an object between frame updates: just the last state will be used, that’s why you really should do animations using Animator() instead of Timer, since it will call registered functions in one batch and then trigger redraw, instead of calling one function, then redraw, then the next function, and redraw...
The most important concept for evas object is clipping (clip), usually done by use of Rectangle as clipper. Clip objects will affect the drawing behavior:
Clips respects the hierarchy: the minimum area and the composed color will be used used at the end, if one object is not visible, othe lower objects (clipped by it) will not be visible as well. Clipping is the recommended way of doing fade out/in effect, instead of changing object’s color, clip it to a rectangle and change its color: this will work as expected with every object, unlike directly changing color that just work for Images
As with every evas component, colors should be specified in pre-multiplied format, see efl.evas.color_parse() and efl.evas.color_argb_premul().
Objects can be grouped by means of SmartObject, a virtual class that can have it’s methods implemented in order to apply methods to its children.
Attention
Since we have two systems controlling object’s life (Evas and Python) objects need to be explicitly deleted using delete() call. If this call is not issued, the Python object will not be released, but if the object is deleted by Evas (ie: due parent deletion), the object will become “shallow” and all operations will either have no effect or raise exceptions. You can be notified of object deletion by EVAS_CALLBACK_FREE
The object above this.
| Type : | efl.evas.Object |
|---|
If anti-aliased primitives should be used.
| Type : | bool |
|---|
The object below this.
| Type : | efl.evas.Object |
|---|
The bottommost object.
| Type : | efl.evas.Object |
|---|
Object’s bottom-center coordinates.
| Type : | (int x, int y) |
|---|
Object’s bottom-left corner coordinates.
| Type : | (int x, int y) |
|---|
Object’s bottom-right corner coordinates.
| Type : | (int x, int y) |
|---|
Object’s center coordinates.
| Type : | (int x, int y) |
|---|
Object’s clipper.
| Type : | efl.evas.Object |
|---|
Objects that this object clips.
| Type : | tuple of efl.evas.Object |
|---|
Object’s (r, g, b, a) color, in pre-multiply colorspace.
| Type : | (int r, int g, int b, int a) |
|---|
Delete object and free it’s internal (wrapped) resources.
Note
after this operation the object will be still alive in Python, but it will be shallow and every operation will have no effect (and may raise exceptions).
| Raises ValueError: | |
|---|---|
| if object already deleted. | |
The evas Canvas that owns this object.
| Type : | efl.evas.Canvas |
|---|
Add a new callback for the given event.
| Parameters: |
|
|---|---|
| Raises: |
|
Remove callback for the given event.
| Parameters: |
|
|---|---|
| Precond : | type and func must be used as parameter for event_callback_add(). |
| Raises ValueError: | |
if type is unknown or if there was no func connected with this type. |
|
Whenever object currently have the focus.
| Type : | bool |
|---|
Whether an Evas object is to freeze (discard) events.
If True, events will be discarded. Unlike 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 |
|---|
See also
Object’s position and size.
| Type : | (int x, int y, int w, int h) |
|---|
Hide the object.
Check if the object has been deleted thus leaving the object shallow
| Type : | bool |
|---|
Requests keyname key events be directed to obj.
| Parameters: |
|
|---|---|
| Raises 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 (see Evas_Keys for more information).
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 |
Removes the grab on keyname key events by obj.
| Parameters: |
|
|---|
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 |
Object’s layer number.
| Type : | int |
|---|
The coordinates of the left-center position.
| Type : | (int x, int y) |
|---|
Lower to the bottom of its layer.
Map enabled state
| Type : | bool |
|---|
Move relatively to objects current position.
| Parameters: |
|
|---|
Object name or None.
| Type : | string |
|---|
Same as event_callback_add(EVAS_CALLBACK_CHANGED_SIZE_HINTS, ...)
Same as event_callback_del(EVAS_CALLBACK_CHANGED_SIZE_HINTS, ...)
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)
Same as event_callback_del(EVAS_CALLBACK_DEL, ...)
Same as event_callback_add(EVAS_CALLBACK_FOCUS_IN, ...)
Expected signature:
function(object, *args, **kargs)
Same as event_callback_del(EVAS_CALLBACK_FOCUS_IN, ...)
Same as event_callback_add(EVAS_CALLBACK_FOCUS_OUT, ...)
Expected signature:
function(object, *args, **kargs)
Same as event_callback_del(EVAS_CALLBACK_FOCUS_OUT, ...)
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)
Same as event_callback_del(EVAS_CALLBACK_FREE, ...)
Same as event_callback_add(EVAS_CALLBACK_HIDE, ...)
Expected signature:
function(object, *args, **kargs)
Same as event_callback_del(EVAS_CALLBACK_HIDE, ...)
Same as event_callback_add(EVAS_CALLBACK_HOLD, ...)
Same as event_callback_del(EVAS_CALLBACK_HOLD, ...)
Same as event_callback_add(EVAS_CALLBACK_KEY_DOWN, ...)
Expected signature:
function(object, event_info, *args, **kargs)
Same as event_callback_del(EVAS_CALLBACK_KEY_DOWN, ...)
Same as event_callback_add(EVAS_CALLBACK_KEY_UP, ...)
Expected signature:
function(object, event_info, *args, **kargs)
Same as event_callback_del(EVAS_CALLBACK_KEY_UP, ...)
Same as event_callback_add(EVAS_CALLBACK_MOUSE_DOWN, ...)
Expected signature:
function(object, event_info, *args, **kargs)
Same as event_callback_del(EVAS_CALLBACK_MOUSE_DOWN, ...)
Same as event_callback_add(EVAS_CALLBACK_MOUSE_IN, ...)
Expected signature:
function(object, event_info, *args, **kargs)
Same as event_callback_del(EVAS_CALLBACK_MOUSE_IN, ...)
Same as event_callback_add(EVAS_CALLBACK_MOUSE_MOVE, ...)
Expected signature:
function(object, event_info, *args, **kargs)
Same as event_callback_del(EVAS_CALLBACK_MOUSE_MOVE, ...)
Same as event_callback_add(EVAS_CALLBACK_MOUSE_OUT, ...)
Expected signature:
function(object, event_info, *args, **kargs)
Same as event_callback_del(EVAS_CALLBACK_MOUSE_OUT, ...)
Same as event_callback_add(EVAS_CALLBACK_MOUSE_UP, ...)
Expected signature:
function(object, event_info, *args, **kargs)
Same as event_callback_del(EVAS_CALLBACK_MOUSE_UP, ...)
Same as event_callback_add(EVAS_CALLBACK_MOUSE_WHEEL, ...)
Expected signature:
function(object, event_info, *args, **kargs)
Same as event_callback_del(EVAS_CALLBACK_MOUSE_WHEEL, ...)
Same as event_callback_add(EVAS_CALLBACK_MOVE, ...)
Expected signature:
function(object, *args, **kargs)
Same as event_callback_del(EVAS_CALLBACK_MOVE, ...)
Same as event_callback_add(EVAS_CALLBACK_RESIZE, ...)
Expected signature:
function(object, *args, **kargs)
Same as event_callback_del(EVAS_CALLBACK_RESIZE, ...)
Same as event_callback_add(EVAS_CALLBACK_RESTACK, ...)
Expected signature:
function(object, *args, **kargs)
Same as event_callback_del(EVAS_CALLBACK_RESTACK, ...)
Same as event_callback_add(EVAS_CALLBACK_SHOW, ...)
Expected signature:
function(object, *args, **kargs)
Same as event_callback_del(EVAS_CALLBACK_SHOW, ...)
Object that this object is member of, or None.
| Type : | efl.evas.Object |
|---|
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 efl.evas.Canvas.top_at_xy_get(), efl.evas.Canvas.top_in_rectangle_get(), efl.evas.Canvas.objects_at_xy_get(), efl.evas.Canvas.objects_in_rectangle_get().
| Type : | bool |
|---|
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 |
|---|
Object’s position on the X and Y coordinates.
| Type : | (int x, int y) |
|---|
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.
Whenever object should propagate events to its parent.
If True, this will cause events on this object to propagate to its efl.evas.SmartObject parent, if it’s a member of one.
| Type : | bool |
|---|
Raise to the top of its layer.
A rectangle representing the object’s geometry.
Rectangles have useful operations like clip, clamp, union and also provides various attributes like top_left, center_x, ...
Note
The rectangle you receive is a snapshot of current state, it is not synchronized to the object, so modifying attributes WILL NOT change the object itself! You must assign it back to this property to update object information.
| Type : | efl.evas.Rect |
|---|
Render operation used at drawing.
| Type : | Evas_Render_Op |
|---|
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 |
|---|
The coordinates of the right-center position.
| Type : | (int x, int y) |
|---|
The scaling factor for an Evas object. Does not affect all objects.
Value of 1.0 means no scaling, default size.
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.
| Type : | double |
|---|
Note
Only text and textblock objects have scaling change handlers. Other objects won’t change visually on this call.
Show the object.
Object’s size (width and height).
| Type : | (int w, int h) |
|---|
Hint about alignment.
This is not an enforcement, just a hint that can be used by other objects like Edje, boxes, tables and others.
Accepted values are in the 0.0 to 1.0 range, with the special value -1.0 used to specify”justify” or “fill” by some users. See documentation of possible users.
When this property changes, EVAS_CALLBACK_CHANGED_SIZE_HINTS will be emitted.
| Type : | (double x, double y) |
|---|
Hint about aspect.
This is not an enforcement, just a hint that can be used by other objects like Edje, boxes, tables and others.
Aspect EVAS_ASPECT_CONTROL_NONE is disabled.
When this property changes, EVAS_CALLBACK_CHANGED_SIZE_HINTS will be emitted.
| Type : | (Evas_Aspect_Control aspect, int w, int h) |
|---|
The hints for an object’s display mode
This is not a size enforcement in any way, it’s just a hint that can be used whenever appropriate. This mode can be used objects display mode like compress or expand.
| Type : | Evas_Display_Mode |
|---|
Hint about maximum size.
This is not an enforcement, just a hint that can be used by other objects like Edje, boxes, tables and others.
Value -1 is disabled.
When this property changes, EVAS_CALLBACK_CHANGED_SIZE_HINTS will be emitted.
| Type : | (int w, int h) |
|---|
Hint about minimum size.
This is not an enforcement, just a hint that can be used by other objects like Edje, boxes, tables and others.
Value 0 is disabled.
When this property changes, EVAS_CALLBACK_CHANGED_SIZE_HINTS will be emitted.
| Type : | (int w, int h) |
|---|
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) |
|---|
Hint about request size.
This is not an enforcement, just a hint that can be used by other objects like Edje, boxes, tables and others.
Value 0 is disabled.
When this property changes, EVAS_CALLBACK_CHANGED_SIZE_HINTS will be emitted.
| Type : | (int w, int h) |
|---|
Hint about weight.
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) |
|---|
Reorder to be above the given one.
| Parameters: | above (efl.evas.Object) – |
|---|
Reorder to be below the given one.
| Parameters: | below (efl.evas.Object) – |
|---|
A hint flag on the object, whether this is used as a static clipper or not.
| Type : | bool |
|---|
The topmost object.
| Type : | efl.evas.Object |
|---|
The coordinates of the top-center position.
| Type : | (int x, int y) |
|---|
Object’s top-left corner coordinates.
| Type : | (int x, int y) |
|---|
Object’s top-right corner coordinates.
| Type : | (int x, int y) |
|---|
Whenever it’s visible or not.
| Type : | bool |
|---|