efl.evas.Canvas Class¶Canvas is the base drawing area and scene manager, it should have a number of objects (or actors) that will be managed. Object state is monitored and redraw is optimized based on changes.
rect – Rect describing object geometry, for
easy manipulation. Changing this Rect will not
affect current geometry, you have to set it again to have this
behavior.
Attention
Canvas must be associated with an Input/Output system in
order to be functional. So far it’s impossible to do this
association directly from Python, so you should create Canvas
indirectly using efl.elementary classes, like
efl.elementary.window.Window.
Factory of efl.evas.Box associated with this
canvas.
Factory of efl.evas.FilledImage associated with this
canvas.
Factory of efl.evas.Image associated with this
canvas.
Factory of efl.evas.Line associated with this
canvas.
Factory of efl.evas.Polygon associated with this
canvas.
Factory of efl.evas.Rectangle associated with this
canvas.
Factory of efl.evas.Text associated with this
canvas.
Factory of efl.evas.Textblock associated with this
canvas.
int
int
int
int
Get the engine information pointer.
Note that given value is a pointer and is totally engine and platform dependent.
This call is very low level and is meant for extension to use, they usually do the machinery in C and just handle pointers as integers.
If in doubt, don’t mess with it.
pointer as integer (uintptr_t).
Set the engine information pointer.
Note that given value is a pointer, usually acquired with
engine_info_get() and is totally engine and platform
dependent.
This call is very low level and is meant for extension to use, they usually do the machinery in C and just handle pointers as integers.
If in doubt, don’t mess with it.
Add a new callback for the given event.
type – an integer with event type code, like EVAS_CALLBACK_CANVAS_FOCUS_IN, EVAS_CALLBACK_RENDER_FLUSH_PRE and other EVAS_CALLBACK_ constants.
func –
function to call back, this function will have one of the following signatures:
function(object, event, *args, **kargs)
function(object, *args, **kargs)
The former is used by events that provide more data (none so far), while the second is used by events without. Parameters given at the end of event_callback_add() will be given to the callback. Note that the object passed to the callback in event parameter will only be valid during the callback, using it after callback returns will raise an ValueError.
ValueError – if type is unknown.
TypeError – if func is not callable.
Remove callback for the given event.
type – an integer with event type code.
func – function used with event_callback_add().
type and func must be used as parameter for
event_callback_add().
ValueError – if type is unknown or if there was no func connected with this type.
Pause event propagation for this object.
Get the event freeze count for this object.
the freeze count
int
Restart event propagation for this object.
Emit a feed_hold event in the canvas
Emit a key_down event in the canvas
Emit a key_up event in the canvas
Emit a mouse_cancel event in the canvas
Emit a mouse_down event in the canvas
Emit a mouse_in event in the canvas
Emit a mouse_move event in the canvas
Emit a mouse_out event in the canvas
Emit a mouse_up event in the canvas
Emit a mouse_wheel event in the canvas
Emit a multi_down event in the canvas
Emit a multi_move event in the canvas
Emit a multi_up event in the canvas
list of str
int
bool
int
flags –
One of
EVAS_FONT_HINTING_NONE
EVAS_FONT_HINTING_AUTO
EVAS_FONT_HINTING_BYTECODE
list of str
Freeze event processing
int
int
Check if the object has been deleted thus leaving the object shallow.
True if the object has been deleted yet, False otherwise.
bool
bool
Find object by name.
name –
Get all children at (x, y).
x –
y –
include_pass_events_objects – if to include objects passing events.
include_hidden_objects – if to include hidden objects.
children objects.
List of efl.evas.Object
Get all children at given geometry.
x –
y –
w –
h –
include_pass_events_objects – if to include objects passing events.
include_hidden_objects – if to include hidden objects.
children objects.
List of efl.evas.Object
Same as event_callback_add(EVAS_CALLBACK_CANVAS_FOCUS_IN, …)
Expected signature:
function(object, *args, **kargs)
Same as event_callback_del(EVAS_CALLBACK_CANVAS_FOCUS_IN, …)
Same as event_callback_add(EVAS_CALLBACK_CANVAS_FOCUS_OUT, …)
Expected signature:
function(object, *args, **kargs)
Same as event_callback_del(EVAS_CALLBACK_CANVAS_FOCUS_OUT, …)
Same as event_callback_add(EVAS_CALLBACK_RENDER_FLUSH_POST, …)
Expected signature:
function(object, *args, **kargs)
Same as event_callback_del(EVAS_CALLBACK_RENDER_FLUSH_POST, …)
Same as event_callback_add(EVAS_CALLBACK_RENDER_FLUSH_PRE, …)
Expected signature:
function(object, *args, **kargs)
Same as event_callback_del(EVAS_CALLBACK_RENDER_FLUSH_PRE, …)
Set canvas render method, can be either a name or id.
method – name(str) or id(int) of the method to set
The parent object
Eo
Returns a bitmask with the mouse buttons currently pressed set to 1.
The least significant bit corresponds to the first mouse button (button 1) and the most significant bit corresponds to the last mouse button (button 32).
int
Returns the pointer’s (x, y) relative to canvas.
Returns whether the mouse pointer is logically inside the canvas.
bool
Returns the pointer’s (x, y) relative to output.
Force canvas to redraw pending updates.
the tuple of int: (w, h)
Set canvas size.
w –
h –
Thaw (unfreeze) event processing
Get the topmost object at pointer position.
child object.
Get the topmost object at (x, y).
x –
y –
include_pass_events_objects – if to include objects passing events.
include_hidden_objects – if to include hidden objects.
child object.
Get the topmost object at given geometry.
x –
y –
w –
h –
include_pass_events_objects – if to include objects passing events.
include_hidden_objects – if to include hidden objects.
child object.
the tuple of int: (x, y, w, h)
Sets the output viewport of the given evas in evas units.
x –
y –
w –
h –
The output viewport is the area of the evas that will be visible to the viewer. The viewport will be stretched to fit the output target of the evas when rendering is performed.
Note
The coordinate values do not have to map 1-to-1 with the output target. However, it is generally advised that it is done for ease of use.