Package evas :: Module c_evas :: Class Canvas
[hide private]
[frames] | no frames]

Class Canvas

object --+
         |
        Canvas

Evas Canvas.

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.


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 ecore.evas classes, like ecore.evas.SoftwareX11.

See Also: ecore.evas.SoftwareX11, ecore.evas.Buffer, ...

Instance Methods [hide private]
 
__init__(...)
x.__init__(...) initializes x; see help(type(x)) for signature
a new object with type S, a subtype of T
__new__(T, S, ...)
 
__repr__(x)
repr(x)
 
__str__(x)
str(x)
 
_new_evas(...)
Creates an internal (wrapped) 'Evas*' for this object.
 
engine_info_get(...)
Get the engine information pointer.
 
engine_info_set(...)
Set the engine information pointer.
 
event_callback_add(...)
Add a new callback for the given event.
 
event_callback_del(...)
Remove callback for the given event.
 
freeze(...)
Freeze event processing
bool
key_modifier_is_set(...)
 
on_canvas_focus_in_add(...)
Same as event_callback_add(EVAS_CALLBACK_CANVAS_FOCUS_IN, ...)
 
on_canvas_focus_in_del(...)
Same as event_callback_del(EVAS_CALLBACK_CANVAS_FOCUS_IN, ...)
 
on_canvas_focus_out_add(...)
Same as event_callback_add(EVAS_CALLBACK_CANVAS_FOCUS_OUT, ...)
 
on_canvas_focus_out_del(...)
Same as event_callback_del(EVAS_CALLBACK_CANVAS_FOCUS_OUT, ...)
 
on_render_flush_post_add(...)
Same as event_callback_add(EVAS_CALLBACK_RENDER_FLUSH_POST, ...)
 
on_render_flush_post_del(...)
Same as event_callback_del(EVAS_CALLBACK_RENDER_FLUSH_POST, ...)
 
on_render_flush_pre_add(...)
Same as event_callback_add(EVAS_CALLBACK_RENDER_FLUSH_PRE, ...)
 
on_render_flush_pre_del(...)
Same as event_callback_del(EVAS_CALLBACK_RENDER_FLUSH_PRE, ...)
 
thaw(...)
Thaw (unfreeze) event processing

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

    Most used
tuple of int
size_get(...)
 
size_set(...)
Set canvas size.
    Factories
FilledImage
FilledImage(...)
Factory of evas.FilledImage associated with this canvas.
Gradient
Gradient(...)
Factory of evas.Gradient associated with this canvas.
Image
Image(...)
Factory of evas.Image associated with this canvas.
Line
Line(...)
Factory of evas.Line associated with this canvas.
Polygon
Polygon(...)
Factory of evas.Polygon associated with this canvas.
Rectangle
Rectangle(...)
Factory of evas.Rectangle associated with this canvas.
Text
Text(...)
Factory of evas.Text associated with this canvas.
Textblock
Textblock(...)
Factory of evas.Textblock associated with this canvas.
    Children manipulation
Object
bottom_get(...)
Object
focus_get(...)
Object
object_name_find(...)
Find object by name.
list of Object
objects_at_xy_get(...)
Get all children at (x, y).
list of Object
objects_in_rectangle_get(...)
Get all children at given geometry.
Object
top_at_pointer_get(...)
Get the topmost object at pointer position.
Object
top_at_xy_get(...)
Get the topmost object at (x, y).
Object
top_get(...)
Object
top_in_rectangle_get(...)
Get the topmost object at given geometry.
    Coordinates
int
coord_screen_x_to_world(...)
int
coord_screen_y_to_world(...)
int
coord_world_x_to_screen(...)
int
coord_world_y_to_screen(...)
list of int
viewport_get(...)
 
viewport_set(...)
Sets the output viewport of the given evas in evas units.
    Pointer
int
pointer_button_down_mask_get(...)
Returns a bitmask with the mouse buttons currently pressed set to 1.
 
pointer_canvas_xy_get(...)
Returns the pointer's (x, y) relative to canvas.
bool
pointer_inside_get(...)
Returns whether the mouse pointer is logically inside the canvas.
 
pointer_output_xy_get(...)
Returns the pointer's (x, y) relative to output.
    Image settings
 
image_cache_flush(...)
int
image_cache_get(...)
 
image_cache_reload(...)
 
image_cache_set(...)
    Font settings
list of str
font_available_list(...)
 
font_cache_flush(...)
int
font_cache_get(...)
 
font_cache_set(...)
bool
font_hinting_can_hint(...)
int
font_hinting_get(...)
 
font_hinting_set(...)
 
font_path_append(...)
 
font_path_clear(...)
list of str
font_path_list(...)
 
font_path_prepend(...)
    Event feeding
 
feed_hold(...)
    Often unused
 
damage_rectangle_add(...)
int
freeze_get(...)
 
norender(...)
 
obscured_clear(...)
 
obscured_rectangle_add(...)
int
output_method_get(...)
Returns the id of the current output method, or 0 if error happened.
 
output_method_set(...)
Set canvas render method, can be either a name or id.
 
render(...)
Force canvas to redraw pending updates.
 
render_updates(...)
Instance Variables [hide private]
    Most used
  rect
Rect describing object geometry, for easy manipulation.
Properties [hide private]
  engine_info

Inherited from object: __class__

    Most used
  size
    Children manipulation
  bottom
  focus
  top
    Coordinates
  viewport
    Pointer
  pointer_button_down_mask
  pointer_canvas_xy
  pointer_inside
  pointer_output_xy
    Image settings
  image_cache
    Font settings
  font_cache
  font_hinting
    Often unused
  output_method
Method Details [hide private]

__init__(...)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__

__new__(T, S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

__repr__(x)
(Representation operator)

 

repr(x)

Overrides: object.__repr__

__str__(x)
(Informal representation operator)

 

str(x)

Overrides: object.__str__

_new_evas(...)

 

Creates an internal (wrapped) 'Evas*' for this object.

If this Python wrapper is shallow then it allocate a new 'Evas*' using evas_new()

Warning: internal.

engine_info_get(...)

 

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. Use ecore.evas instead, it's the way to go for regular uses.

Returns:
pointer as integer (unsigned long).

engine_info_set(...)

 

Set the engine information pointer.

Note that given value is a pointer, usually acquired with 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. Use ecore.evas instead, it's the way to go for regular uses.

event_callback_add(...)

 

Add a new callback for the given event.

Raises:
  • ValueError - if type is unknown.
  • TypeError - if func is not callable.

event_callback_del(...)

 

Remove callback for the given event.

Raises:
  • ValueError - if type is unknown or if there was no func connected with this type.

Precondition: type and func must be used as parameter for event_callback_add().

objects_at_xy_get(...)

 

Get all children at (x, y).

Returns: list of Object
children objects.

objects_in_rectangle_get(...)

 

Get all children at given geometry.

Returns: list of Object
children objects.

on_canvas_focus_in_add(...)

 

Same as event_callback_add(EVAS_CALLBACK_CANVAS_FOCUS_IN, ...)

Expected signature: function(object, *args, **kargs)

on_canvas_focus_out_add(...)

 

Same as event_callback_add(EVAS_CALLBACK_CANVAS_FOCUS_OUT, ...)

Expected signature: function(object, *args, **kargs)

on_render_flush_post_add(...)

 

Same as event_callback_add(EVAS_CALLBACK_RENDER_FLUSH_POST, ...)

Expected signature: function(object, *args, **kargs)

on_render_flush_pre_add(...)

 

Same as event_callback_add(EVAS_CALLBACK_RENDER_FLUSH_PRE, ...)

Expected signature: function(object, *args, **kargs)

pointer_button_down_mask_get(...)

 

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).

Returns: int

top_at_pointer_get(...)

 

Get the topmost object at pointer position.

Returns: Object
child object.

top_at_xy_get(...)

 

Get the topmost object at (x, y).

Returns: Object
child object.

top_in_rectangle_get(...)

 

Get the topmost object at given geometry.

Returns: Object
child object.

viewport_set(...)

 

Sets the output viewport of the given evas in evas units.

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.


Instance Variable Details [hide private]

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.