Low level Evas canvas functions. More...
Modules | |
Render Engine Functions | |
Functions that are used to set the render engine for a given function, and then get that engine working. | |
Output and Viewport Resizing Functions | |
Functions that set and retrieve the output and viewport size of an evas. | |
Coordinate Mapping Functions | |
Functions that are used to map coordinates from the canvas to the screen or the screen to the canvas. | |
Pointer (Mouse) Functions | |
Functions that deal with the status of the pointer (mouse cursor). | |
Canvas Events | |
Functions relating to canvas events, which are mainly reports on its internal states changing (an object got focused, the rendering is updated, etc). | |
Image Functions | |
Functions that deals with images at canvas level. | |
Font Functions | |
Functions that deals with fonts. | |
Key Input Functions | |
Functions which feed key events to the canvas. | |
Touch Point List Functions | |
Functions to get information of touched points in the Evas. | |
Rendering GL on Evas | |
Functions that are used to do OpenGL rendering on Evas. | |
Typedefs | |
typedef struct _Evas | Evas |
An opaque handle to an Evas canvas. | |
Functions | |
Evas * | evas_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) |
Inform to the evas that it got the focus. | |
void | evas_focus_out (Evas *e) |
Inform to the evas that it lost the focus. | |
Eina_Bool | evas_focus_state_get (const Evas *e) |
Get the focus state known by the given evas. | |
void | evas_nochange_push (Evas *e) |
Push the nochange flag up 1. | |
void | evas_nochange_pop (Evas *e) |
Pop the nochange flag down 1. | |
void | evas_data_attach_set (Evas *e, void *data) |
Attaches a specific pointer to the evas for fetching later. | |
void * | evas_data_attach_get (const Evas *e) |
Returns the pointer attached by evas_data_attach_set() | |
void | evas_damage_rectangle_add (Evas *e, int x, int y, int w, int h) |
Add a damage rectangle. | |
void | evas_obscured_rectangle_add (Evas *e, int x, int y, int w, int h) |
Add an "obscured region" to an Evas canvas. | |
void | evas_obscured_clear (Evas *e) |
Remove all "obscured regions" from an Evas canvas. | |
Eina_List * | evas_render_updates (Evas *e) |
Force immediate renderization of the given Evas canvas. | |
void | evas_render_updates_free (Eina_List *updates) |
Free the rectangles returned by evas_render_updates(). | |
void | evas_render (Evas *e) |
Force renderization of the given canvas. | |
void | evas_norender (Evas *e) |
Update the canvas internal objects but not triggering immediate renderization. | |
void | evas_render_idle_flush (Evas *e) |
Make the canvas discard internally cached data used for rendering. | |
void | evas_render_dump (Evas *e) |
Make the canvas discard as much data as possible used by the engine at runtime. |
Detailed Description
Low level Evas canvas functions.
Sub groups will present more high level ones, though.
Most of these functions deal with low level Evas actions, like:
- create/destroy raw canvases, not bound to any displaying engine
- tell a canvas i got focused (in a windowing context, for example)
- tell a canvas a region should not be calculated anymore in rendering
- tell a canvas to render its contents, immediately
Most users will be using Evas by means of the Ecore_Evas
wrapper, which deals with all the above mentioned issues automatically for them. Thus, you'll be looking at this section only if you're building low level stuff.
The groups within 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.
Some of the functions in this group are exemplified here.
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 | ||
) |
Add a damage rectangle.
- Parameters:
-
e The given canvas pointer. x The rectangle's left position. y The rectangle's top position. w The rectangle's width. h The rectangle's height.
This is the function by which one tells evas that a part of the canvas has to be repainted.
Referenced by evas_object_clip_set(), evas_object_clip_unset(), evas_object_map_enable_set(), and evas_object_map_set().
void* evas_data_attach_get | ( | const Evas * | e | ) |
Returns the pointer attached by evas_data_attach_set()
- Parameters:
-
e The canvas to attach the pointer to
- Returns:
- The pointer attached
void evas_data_attach_set | ( | Evas * | e, |
void * | data | ||
) |
Attaches a specific pointer to the evas for fetching later.
- Parameters:
-
e The canvas to attach the pointer to data The pointer to attach
void evas_focus_in | ( | Evas * | e | ) |
Inform to the evas that it got the focus.
- Parameters:
-
e The evas to change information.
References EVAS_CALLBACK_CANVAS_FOCUS_IN.
void evas_focus_out | ( | Evas * | e | ) |
Inform to the evas that it lost the focus.
- Parameters:
-
e The evas to change information.
References EVAS_CALLBACK_CANVAS_FOCUS_OUT.
Eina_Bool evas_focus_state_get | ( | const Evas * | e | ) |
Get the focus state known by the given evas.
- Parameters:
-
e The evas to query information.
Frees the given evas and any objects created on it.
Any objects with 'free' callbacks will have those callbacks called in this function.
- Parameters:
-
e The given evas.
References evas_font_path_clear(), and evas_render_idle_flush().
Creates a new empty evas.
Note that before you can use the evas, you will to at a minimum:
- Set its render method with evas_output_method_set .
- Set its viewport size with evas_output_viewport_set .
- Set its size of the canvas with evas_output_size_set .
- Ensure that the render engine is given the correct settings with evas_engine_info_set .
This function should only fail if the memory allocation fails
- Note:
- this function is very low level. Instead of using it directly, consider using the high level functions in Ecore_Evas such as
ecore_evas_new()
. See http://docs.enlightenment.org/auto/ecore/.
- Attention:
- it is recommended that one calls evas_init() before creating new canvas.
- Returns:
- A new uninitialised Evas canvas on success. Otherwise,
NULL
.
References EVAS_FONT_HINTING_BYTECODE.
void evas_nochange_pop | ( | Evas * | e | ) |
Pop the nochange flag down 1.
This tells evas, that while the nochange flag is greater than 0, do not mark objects as "changed" when making changes.
- Parameters:
-
e The evas to change information.
void evas_nochange_push | ( | Evas * | e | ) |
Push the nochange flag up 1.
This tells evas, that while the nochange flag is greater than 0, do not mark objects as "changed" when making changes.
- Parameters:
-
e The evas to change information.
void evas_norender | ( | Evas * | e | ) |
Update the canvas internal objects but not triggering immediate renderization.
- Parameters:
-
e The given canvas pointer.
This function updates the canvas internal objects not triggering renderization. To force renderization function evas_render() should be used.
- See also:
- evas_render.
void evas_obscured_clear | ( | Evas * | e | ) |
Remove all "obscured regions" from an Evas canvas.
- Parameters:
-
e The given canvas pointer.
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.
- Note:
- This is a very low level function, which most of Evas' users wouldn't care about.
- 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()).
- 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 | ||
) |
Add an "obscured region" to an Evas canvas.
- Parameters:
-
e The given canvas pointer. x The rectangle's top left corner's horizontal coordinate. y The rectangle's top left corner's vertical coordinate w The rectangle's width. h The rectangle's height.
This is the function by which one tells 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 won't participate in any form in Evas' calculations and actions during its rendering updates, having its displaying content frozen as it was just after this function took place.
We call it "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 won't have to worry about this function, as they'll be using 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().
- Note:
- This is a very low level function, which most of Evas' users wouldn't care about.
- 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()).
Example code follows.
"\tControl + o - add an obscured rectangle\n" "\th - print help\n"; struct test_data { Ecore_Evas *ee; Evas *canvas; Evas_Object *img, *bg; Ecore_Timer *resize_timer, *freeze_timer; Eina_Bool obscured, focus; }; static struct test_data d = {0}; /* here to keep our example's window size and background image's * size in synchrony */ static void _canvas_resize_cb(Ecore_Evas *ee) { int w, h; ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); evas_object_resize(d.bg, w, h); } /* called when our rectangle gets focus */ static void _object_focus_in_cb(void *data __UNUSED__, Evas *e, void *event_info) { fprintf(stdout, "An object got focused: %s\n", evas_object_name_get(event_info)); fprintf(stdout, "Let's recheck it: %s\n", evas_object_name_get(evas_focus_get(e))); fprintf(stdout, "And again: %s\n", evas_object_focus_get(event_info) ? "OK!" : "Oops, something is bad."); } /* render flush callback */ static void _render_flush_cb(void *data __UNUSED__, Evas *e __UNUSED__, void *event_info __UNUSED__) { fprintf(stdout, "Canvas is about to flush its rendering pipeline!\n"); } /* put some action in the canvas */ static Eina_Bool _resize_cb(void *data __UNUSED__) { int w, h, cw, ch; evas_object_geometry_get(d.img, NULL, NULL, &w, &h); ecore_evas_geometry_get(d.ee, NULL, NULL, &cw, &ch); if (w < cw) evas_object_resize(d.img, cw, ch); else evas_object_resize(d.img, cw / 2, ch / 2); return EINA_TRUE; /* re-issue the timer */ } /* let's have our events back */ static Eina_Bool _thaw_cb(void *data __UNUSED__) { fprintf(stdout, "Canvas was frozen %d times, now thawing.\n", evas_event_freeze_get(d.canvas)); evas_event_thaw(d.canvas); return EINA_FALSE; /* do not re-issue the timer */ } /* mouse enters the object's area */ static void _on_mouse_in(void *data __UNUSED__, Evas *evas __UNUSED__, Evas_Object *o __UNUSED__, void *einfo __UNUSED__) { fprintf(stdout, "Enlightenment logo has had the mouse in.\n"); } static void _on_mouse_out(void *data __UNUSED__, Evas *evas __UNUSED__, Evas_Object *o __UNUSED__, void *einfo __UNUSED__) { fprintf(stdout, "Enlightenment logo has had the mouse out.\n"); } /* mouse exits the object's area */ /* examine the keys pressed */ static void _on_keydown(void *data __UNUSED__, Evas *evas, Evas_Object *o __UNUSED__, void *einfo) { const Evas_Modifier *mods; Evas_Event_Key_Down *ev = einfo; fprintf(stdout, "We've got key input: %s\n", ev->keyname); fprintf(stdout, "It actually came from %s\n", d.focus ? "focus" : "key grab"); if (strcmp(ev->keyname, "h") == 0) /* print help */ { fprintf(stdout, commands); return; } if (strcmp(ev->keyname, "a") == 0) /* toggle animation timer */ { if (d.resize_timer != NULL) { fprintf(stdout, "Stopping animation timer\n"); ecore_timer_del(d.resize_timer); d.resize_timer = NULL; } else { fprintf(stdout, "Re-issuing animation timer\n"); d.resize_timer = ecore_timer_add(2, _resize_cb, NULL); } return; } if (strcmp(ev->keyname, "c") == 0) /* cycle between focus and key * grabs for key input */ { Eina_Bool ret; Evas_Modifier_Mask mask = evas_key_modifier_mask_get(d.canvas, "Control"); fprintf(stdout, "Switching to %s for key input\n", d.focus ? "key grabs" : "focus"); if (d.focus) { evas_object_focus_set(d.bg, EINA_FALSE); fprintf(stdout, "Focused object is now %s\n", evas_focus_get(d.canvas) ? "still valid! Something went wrong." : "none."); ret = evas_object_key_grab(d.bg, "a", 0, 0, EINA_TRUE); if (!ret) { fprintf(stdout, "Something went wrong with key grabs.\n"); goto c_end; } ret = evas_object_key_grab(d.bg, "c", 0, 0, EINA_TRUE); if (!ret) { fprintf(stdout, "Something went wrong with key grabs.\n"); goto c_end; } ret = evas_object_key_grab(d.bg, "d", 0, 0, EINA_TRUE); if (!ret) { fprintf(stdout, "Something went wrong with key grabs.\n"); goto c_end; } ret = evas_object_key_grab(d.bg, "f", 0, 0, EINA_TRUE); if (!ret) { fprintf(stdout, "Something went wrong with key grabs.\n"); goto c_end; } ret = evas_object_key_grab(d.bg, "p", 0, 0, EINA_TRUE); if (!ret) { fprintf(stdout, "Something went wrong with key grabs.\n"); goto c_end; } ret = evas_object_key_grab(d.bg, "o", mask, 0, EINA_TRUE); if (!ret) { fprintf(stdout, "Something went wrong with key grabs.\n"); goto c_end; } ret = evas_object_key_grab(d.bg, "h", 0, 0, EINA_TRUE); if (!ret) { fprintf(stdout, "Something went wrong with key grabs.\n"); goto c_end; } } else /* got here by key grabs */ { evas_object_key_ungrab(d.bg, "a", 0, 0); evas_object_key_ungrab(d.bg, "c", 0, 0); evas_object_key_ungrab(d.bg, "d", 0, 0); evas_object_key_ungrab(d.bg, "f", 0, 0); evas_object_key_ungrab(d.bg, "p", 0, 0); evas_object_key_ungrab(d.bg, "o", mask, 0); evas_object_key_ungrab(d.bg, "h", 0, 0); evas_object_focus_set(d.bg, EINA_TRUE); } c_end: d.focus = !d.focus; return; } if (strcmp(ev->keyname, "d") == 0) /* delete canvas' callbacks */ { fprintf(stdout, "Deleting canvas event callbacks\n"); evas_event_callback_del_full(evas, EVAS_CALLBACK_RENDER_FLUSH_PRE, _render_flush_cb, NULL); evas_event_callback_del_full( evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, _object_focus_in_cb, NULL); return; } if (strcmp(ev->keyname, "f") == 0) /* freeze input for 3 seconds */ { fprintf(stdout, "Freezing input for 3 seconds\n"); evas_event_freeze(evas); d.freeze_timer = ecore_timer_add(3, _thaw_cb, NULL); return; } if (strcmp(ev->keyname, "p") == 0) /* toggle precise point * collision detection */ { Eina_Bool precise = evas_object_precise_is_inside_get(d.img); fprintf(stdout, "Toggling precise point collision detection %s on" " Enlightenment logo\n", precise ? "off" : "on"); evas_object_precise_is_inside_set(d.img, !precise); return; } mods = evas_key_modifier_get(evas); if (evas_key_modifier_is_set(mods, "Control") && (strcmp(ev->keyname, "o") == 0)) /* add an obscured * rectangle to the middle * of the canvas */ { fprintf(stdout, "Toggling obscured rectangle on canvas\n"); if (!d.obscured) { int w, h; evas_output_viewport_get(evas, NULL, NULL, &w, &h); evas_obscured_rectangle_add(evas, w / 4, h / 4, w / 2, h / 2); } else { int w, h; Eina_Rectangle *rect; Eina_List *updates, *l; evas_output_viewport_get(evas, NULL, NULL, &w, &h); evas_obscured_clear(evas);
In that example, pressing the "Ctrl" and "o" keys will impose or remove an obscured region in the middle of the canvas. You'll get the same contents at the time the key was pressed, if toggling it on, until you toggle it off again (make sure the animation is running on to get the idea better). See the full example.
void evas_render | ( | Evas * | e | ) |
Force renderization of the given canvas.
- Parameters:
-
e The given canvas pointer.
void evas_render_dump | ( | Evas * | e | ) |
Make the canvas discard as much data as possible used by the engine at runtime.
- Parameters:
-
e The given canvas pointer.
This function will unload images, delete 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.
void evas_render_idle_flush | ( | Evas * | e | ) |
Make the canvas discard internally cached data used for rendering.
- Parameters:
-
e The given canvas pointer.
This function flushes the arrays of delete, active and render objects. Other things it may also discard are: shared memory segments, temporary scratch buffers, cached data to avoid re-compute of that data etc.
Referenced by evas_free().
Eina_List* evas_render_updates | ( | Evas * | e | ) |
Force immediate renderization of the given Evas canvas.
- Parameters:
-
e The 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().
This function forces an immediate renderization update of the given canvas e
.
- Note:
- This is a very low level function, which most of Evas' users wouldn't care about. One 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 won't see no changes and this call will be a no-op.
Example code follows.
"\tControl + o - add an obscured rectangle\n" "\th - print help\n"; struct test_data { Ecore_Evas *ee; Evas *canvas; Evas_Object *img, *bg; Ecore_Timer *resize_timer, *freeze_timer; Eina_Bool obscured, focus; }; static struct test_data d = {0}; /* here to keep our example's window size and background image's * size in synchrony */ static void _canvas_resize_cb(Ecore_Evas *ee) { int w, h; ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); evas_object_resize(d.bg, w, h); } /* called when our rectangle gets focus */ static void _object_focus_in_cb(void *data __UNUSED__, Evas *e, void *event_info) { fprintf(stdout, "An object got focused: %s\n", evas_object_name_get(event_info)); fprintf(stdout, "Let's recheck it: %s\n", evas_object_name_get(evas_focus_get(e))); fprintf(stdout, "And again: %s\n", evas_object_focus_get(event_info) ? "OK!" : "Oops, something is bad."); } /* render flush callback */ static void _render_flush_cb(void *data __UNUSED__, Evas *e __UNUSED__, void *event_info __UNUSED__) { fprintf(stdout, "Canvas is about to flush its rendering pipeline!\n"); } /* put some action in the canvas */ static Eina_Bool _resize_cb(void *data __UNUSED__) { int w, h, cw, ch; evas_object_geometry_get(d.img, NULL, NULL, &w, &h); ecore_evas_geometry_get(d.ee, NULL, NULL, &cw, &ch); if (w < cw) evas_object_resize(d.img, cw, ch); else evas_object_resize(d.img, cw / 2, ch / 2); return EINA_TRUE; /* re-issue the timer */ } /* let's have our events back */ static Eina_Bool _thaw_cb(void *data __UNUSED__) { fprintf(stdout, "Canvas was frozen %d times, now thawing.\n", evas_event_freeze_get(d.canvas)); evas_event_thaw(d.canvas); return EINA_FALSE; /* do not re-issue the timer */ } /* mouse enters the object's area */ static void _on_mouse_in(void *data __UNUSED__, Evas *evas __UNUSED__, Evas_Object *o __UNUSED__, void *einfo __UNUSED__) { fprintf(stdout, "Enlightenment logo has had the mouse in.\n"); } static void _on_mouse_out(void *data __UNUSED__, Evas *evas __UNUSED__, Evas_Object *o __UNUSED__, void *einfo __UNUSED__) { fprintf(stdout, "Enlightenment logo has had the mouse out.\n"); } /* mouse exits the object's area */ /* examine the keys pressed */ static void _on_keydown(void *data __UNUSED__, Evas *evas, Evas_Object *o __UNUSED__, void *einfo) { const Evas_Modifier *mods; Evas_Event_Key_Down *ev = einfo; fprintf(stdout, "We've got key input: %s\n", ev->keyname); fprintf(stdout, "It actually came from %s\n", d.focus ? "focus" : "key grab"); if (strcmp(ev->keyname, "h") == 0) /* print help */ { fprintf(stdout, commands); return; } if (strcmp(ev->keyname, "a") == 0) /* toggle animation timer */ { if (d.resize_timer != NULL) { fprintf(stdout, "Stopping animation timer\n"); ecore_timer_del(d.resize_timer); d.resize_timer = NULL; } else { fprintf(stdout, "Re-issuing animation timer\n"); d.resize_timer = ecore_timer_add(2, _resize_cb, NULL); } return; } if (strcmp(ev->keyname, "c") == 0) /* cycle between focus and key * grabs for key input */ { Eina_Bool ret; Evas_Modifier_Mask mask = evas_key_modifier_mask_get(d.canvas, "Control"); fprintf(stdout, "Switching to %s for key input\n", d.focus ? "key grabs" : "focus"); if (d.focus) { evas_object_focus_set(d.bg, EINA_FALSE); fprintf(stdout, "Focused object is now %s\n", evas_focus_get(d.canvas) ? "still valid! Something went wrong." : "none."); ret = evas_object_key_grab(d.bg, "a", 0, 0, EINA_TRUE); if (!ret) { fprintf(stdout, "Something went wrong with key grabs.\n"); goto c_end; } ret = evas_object_key_grab(d.bg, "c", 0, 0, EINA_TRUE); if (!ret) { fprintf(stdout, "Something went wrong with key grabs.\n"); goto c_end; } ret = evas_object_key_grab(d.bg, "d", 0, 0, EINA_TRUE); if (!ret) { fprintf(stdout, "Something went wrong with key grabs.\n"); goto c_end; } ret = evas_object_key_grab(d.bg, "f", 0, 0, EINA_TRUE); if (!ret) { fprintf(stdout, "Something went wrong with key grabs.\n"); goto c_end; } ret = evas_object_key_grab(d.bg, "p", 0, 0, EINA_TRUE); if (!ret) { fprintf(stdout, "Something went wrong with key grabs.\n"); goto c_end; } ret = evas_object_key_grab(d.bg, "o", mask, 0, EINA_TRUE); if (!ret) { fprintf(stdout, "Something went wrong with key grabs.\n"); goto c_end; } ret = evas_object_key_grab(d.bg, "h", 0, 0, EINA_TRUE); if (!ret) { fprintf(stdout, "Something went wrong with key grabs.\n"); goto c_end; } } else /* got here by key grabs */ { evas_object_key_ungrab(d.bg, "a", 0, 0); evas_object_key_ungrab(d.bg, "c", 0, 0); evas_object_key_ungrab(d.bg, "d", 0, 0); evas_object_key_ungrab(d.bg, "f", 0, 0); evas_object_key_ungrab(d.bg, "p", 0, 0); evas_object_key_ungrab(d.bg, "o", mask, 0); evas_object_key_ungrab(d.bg, "h", 0, 0); evas_object_focus_set(d.bg, EINA_TRUE); } c_end: d.focus = !d.focus; return; } if (strcmp(ev->keyname, "d") == 0) /* delete canvas' callbacks */ { fprintf(stdout, "Deleting canvas event callbacks\n"); evas_event_callback_del_full(evas, EVAS_CALLBACK_RENDER_FLUSH_PRE, _render_flush_cb, NULL); evas_event_callback_del_full( evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, _object_focus_in_cb, NULL); return; } if (strcmp(ev->keyname, "f") == 0) /* freeze input for 3 seconds */ { fprintf(stdout, "Freezing input for 3 seconds\n"); evas_event_freeze(evas); d.freeze_timer = ecore_timer_add(3, _thaw_cb, NULL); return; } if (strcmp(ev->keyname, "p") == 0) /* toggle precise point * collision detection */ { Eina_Bool precise = evas_object_precise_is_inside_get(d.img); fprintf(stdout, "Toggling precise point collision detection %s on" " Enlightenment logo\n", precise ? "off" : "on"); evas_object_precise_is_inside_set(d.img, !precise); return; } mods = evas_key_modifier_get(evas); if (evas_key_modifier_is_set(mods, "Control") && (strcmp(ev->keyname, "o") == 0)) /* add an obscured * rectangle to the middle * of the canvas */ { fprintf(stdout, "Toggling obscured rectangle on canvas\n"); if (!d.obscured) { int w, h; evas_output_viewport_get(evas, NULL, NULL, &w, &h); evas_obscured_rectangle_add(evas, w / 4, h / 4, w / 2, h / 2); } else { int w, h; Eina_Rectangle *rect; Eina_List *updates, *l; evas_output_viewport_get(evas, NULL, NULL, &w, &h); evas_obscured_clear(evas); /* we have to flag a damage region here because * evas_obscured_clear() doesn't change the canvas' * state. we'd have to wait for an animation step, for * example, to get the result, without it */ evas_damage_rectangle_add(evas, 0, 0, w, h); updates = evas_render_updates(evas); EINA_LIST_FOREACH(updates, l, rect) { fprintf(stdout, "Rectangle (%d, %d, %d, %d) on canvas got a" " rendering update.\n", rect->x, rect->y, rect->w, rect->h); } evas_render_updates_free(updates); } d.obscured = !d.obscured;
See the full example.
void evas_render_updates_free | ( | Eina_List * | updates | ) |
Free the rectangles returned by evas_render_updates().
- Parameters:
-
updates The list of updated rectangles of the canvas.
This function removes the region from the render updates list. It makes the region doesn't be render updated anymore.
- See also:
- evas_render_updates() for an example