Tizen Native API
Canvas Functions

This group provides low level Evas canvas functions. Sub-groups present more high level ones, though.

Remarks:
Most of these functions deal with low level Evas actions, like:
  • creating or destroying raw canvases, not bound to any displaying engine
  • telling a canvas that it got focused (in a windowing context, for example)
  • telling a canvas that a region should not be calculated anymore in rendering
  • telling a canvas to render its contents, immediately
You mostly use Evas with the Ecore_Evas wrapper, which deals with all the above mentioned issues automatically. Thus, you need this section only if you are building low level stuff.
The groups present you functions that deal with the canvas directly, too, and not yet with its objects. They are the functions you need to use at a minimum to get a working canvas.

Functions

Evasevas_new (void)
 Creates a new empty evas.
void evas_free (Evas *e)
 Frees the given evas and any objects created on it.
void evas_focus_in (Evas *e)
 Informs evas that it has got focus.
void evas_focus_out (Evas *e)
 Informs the evas that it has lost focus.
Eina_Bool evas_focus_state_get (const Evas *e)
 Gets the focus state of the given evas.
void evas_nochange_push (Evas *e)
 Pushes the nochange flag up 1.
void evas_nochange_pop (Evas *e)
 Pops the nochange flag down 1.
void evas_data_attach_set (Evas *e, void *data)
 Attaches a specific pointer to evas for fetching later.
void * evas_data_attach_get (const Evas *e)
 Gets the pointer attached by evas_data_attach_set().
void evas_damage_rectangle_add (Evas *e, int x, int y, int w, int h)
 Adds a damage rectangle.
void evas_obscured_rectangle_add (Evas *e, int x, int y, int w, int h)
 Adds an "obscured region" to an Evas canvas.
void evas_obscured_clear (Evas *e)
 Removes all "obscured regions" from an Evas canvas.
Eina_Listevas_render_updates (Evas *e)
 Forces immediate renderization of the given Evas canvas.
void evas_render_updates_free (Eina_List *updates)
 Frees the rectangles returned by evas_render_updates().
void evas_render (Evas *e)
 Forces rendering of the given canvas.
void evas_norender (Evas *e)
 Updates the canvas internal objects but does not trigger immediate rendering.
void evas_render_idle_flush (Evas *e)
 Makes the canvas discard internally cached data used for rendering.
void evas_render_dump (Evas *e)
 Makes the canvas discard as much data as possible used by the engine at runtime.

Typedefs

typedef struct _Evas Evas
 An opaque handle to an Evas canvas.

Typedef Documentation

An opaque handle to an Evas canvas.

See also:
evas_new()
evas_free()

Function Documentation

void evas_damage_rectangle_add ( Evas e,
int  x,
int  y,
int  w,
int  h 
)

Adds a damage rectangle.

You can use this function to inform evas that a part of the canvas has to be repainted.

Since :
2.3.1
Remarks:
All newly created Evas rectangles get the default color values of 255 255 255 255 (opaque white).
Parameters:
[in]eThe given canvas pointer
[in]xThe rectangle's left position
[in]yThe rectangle's top position
[in]wThe rectangle's width
[in]hThe rectangle's height
void* evas_data_attach_get ( const Evas e)

Gets the pointer attached by evas_data_attach_set().

Since :
2.3.1
Parameters:
[in]eThe canvas to attach the pointer to
Returns:
The pointer attached
void evas_data_attach_set ( Evas e,
void *  data 
)

Attaches a specific pointer to evas for fetching later.

Since :
2.3.1
Parameters:
[in]eThe canvas to attach the pointer to
[in]dataThe pointer to attach
void evas_focus_in ( Evas e)

Informs evas that it has got focus.

Since :
2.3.1
Parameters:
[in]eThe evas to inform
void evas_focus_out ( Evas e)

Informs the evas that it has lost focus.

Since :
2.3.1
Parameters:
[in]eThe evas to inform

Gets the focus state of the given evas.

Since :
2.3.1
Parameters:
[in]eThe evas to query information
Returns:
EINA_TRUE if it is focused, otherwise EINA_FALSE.
void evas_free ( Evas e)

Frees the given evas and any objects created on it.

Since :
2.3.1
Remarks:
Any objects with 'free' callbacks have those callbacks called in this function.
Parameters:
[in]eThe given evas
Evas* evas_new ( void  )

Creates a new empty evas.

Since :
2.3.1
Remarks:
This function should only fail if the memory allocation fails.
This function is a very low level function.
Returns:
A new uninitialised Evas canvas on success,
otherwise NULL on failure
Precondition:
Note that before you can use evas, you have to:
void evas_nochange_pop ( Evas e)

Pops the nochange flag down 1.

Since :
2.3.1
Remarks:
This tells evas that while the nochange flag is greater than 0, do not mark objects as "changed" when making changes.
Parameters:
[in]eThe evas to change information
void evas_nochange_push ( Evas e)

Pushes the nochange flag up 1.

Since :
2.3.1
Remarks:
This tells evas that while the nochange flag is greater than 0, do not mark objects as "changed" when making changes.
Parameters:
[in]eThe evas to changes information
void evas_norender ( Evas e)

Updates the canvas internal objects but does not trigger immediate rendering.

This function updates the canvas internal objects not triggering rendering. To force rendering, use evas_render().

Since :
2.3.1
Parameters:
[in]eThe given canvas pointer
See also:
evas_render
void evas_obscured_clear ( Evas e)

Removes all "obscured regions" from an Evas canvas.

This function removes all the rectangles from the obscured regions list of the canvas e. It takes obscured areas added with evas_obscured_rectangle_add() and make them again a regions that have to be repainted on rendering updates.

Since :
2.3.1
Remarks:
This is a very low level function, which you may not use.
This function does not flag the canvas as having its state changed. If you want to re-render it afterwards expecting new contents, you have to add "damage" regions yourself (see evas_damage_rectangle_add()).
Parameters:
[in]eThe given canvas pointer
See also:
evas_obscured_rectangle_add() for an example
evas_render_updates()
void evas_obscured_rectangle_add ( Evas e,
int  x,
int  y,
int  w,
int  h 
)

Adds an "obscured region" to an Evas canvas.

Since :
2.3.1
Remarks:
You can use this function to inform an Evas canvas that a part of it must not be repainted. The region must be rectangular and its coordinates inside the canvas viewport are passed in the call. After this call, the region specified do not participate in any form in Evas' calculations and actions during its rendering updates, having its displaying content frozen as it is just after this function is executed.
This is called "obscured region" because the most common use case for this rendering (partial) freeze is something else (most probably other canvas) being on top of the specified rectangular region, thus shading it completely from the user's final scene in a display. To avoid unnecessary processing, one should indicate to the obscured canvas not to bother about the non-important area.
The majority of users do not have to worry about this function, as they use just one canvas in their applications, with nothing inset or on top of it in any form.
To make this region one that has to be repainted again, call the function evas_obscured_clear().
This is a very low level function, which you may not use.
This function does not flag the canvas as having its state changed. If you want to re-render it afterwards expecting new contents, you have to add "damage" regions yourself (see evas_damage_rectangle_add()).
Parameters:
[in]eThe given canvas pointer
[in]xThe rectangle's top left corner's horizontal coordinate
[in]yThe rectangle's top left corner's vertical coordinate
[in]wThe rectangle's width
[in]hThe rectangle's height
See also:
evas_obscured_clear()
evas_render_updates()
void evas_render ( Evas e)

Forces rendering of the given canvas.

Since :
2.3.1
Parameters:
[in]eThe given canvas pointer
void evas_render_dump ( Evas e)

Makes the canvas discard as much data as possible used by the engine at runtime.

This function unloads images, deletes textures and much more, where possible. You may also want to call evas_render_idle_flush() immediately prior to this to perhaps discard a little more, though evas_render_dump() should implicitly delete most of what evas_render_idle_flush() might discard too.

Since :
2.3.1
Parameters:
[in]eThe given canvas pointer

Makes the canvas discard internally cached data used for rendering.

This function flushes the arrays of delete, active and render objects. The other things it may discard include shared memory segments, temporary scratch buffers, and cached data to avoid re-compute of that data.

Since :
2.3.1
Parameters:
[in]eThe given canvas pointer

Forces immediate renderization of the given Evas canvas.

This function forces an immediate renderization update of the given canvas e.

Since :
2.3.1
Remarks:
This is a very low level function, which you may not use. You would use it, for example, to grab an Evas' canvas update regions and paint them back, using the canvas' pixmap, on a displaying system working below Evas.
Evas is a stateful canvas. If no operations changing its state took place since the last rendering action, you do not see any changes and this call becomes a no-op.
Parameters:
[in]eThe given canvas pointer
Returns:
A newly allocated list of updated rectangles of the canvas (Eina_Rectangle structs)
Free this list with evas_render_updates_free().
void evas_render_updates_free ( Eina_List updates)

Frees the rectangles returned by evas_render_updates().

This function removes the region from the render updates list. The region does not get render updated anymore.

Since :
2.3.1
Parameters:
[in]updatesThe list of updated rectangles of the canvas
See also:
evas_render_updates() for an example