Evas_Object_Vg

Evas_Object_Vg is the scene graph for managing vector graphics objects. User can create shape objects as well as fill objects and give it to the Evas_Object_Vg for drawing on the screen as well as managing the lifecycle of the objects. enabling reuse of shape objects.

As Evas_Object_Vg is a Evas_Object all the operation that applicable to a Evas_Object can be performed on it(clipping , map, etc).

To create any complex vector graphics you can create a hirarchy of shape and fill objects and give the hirarchy to Evas_Object which will be responsible for drawing and showing on the screen.

As the shape object and fill object (linear and radial gradient) have retain mode API, you only have to create it once and set the properties and give it to evas_object_vg.

Any change in the property of shape/fill object will automaticaly notified to the evas_object_vg which will trigger a redrawing to reflect the change.

To create a vector path, you can give list of path commands to the shape object using efl_gfx_shape_path_set() API.

Enabling graphical shapes to be constructed and reused.

Below are the list of feature currently supported by Vector object.

Example:

vector = evas_object_vg_add(canvas);
root = evas_obj_vg_root_node_get(vector);
shape = efl_add(EVAS_VG_SHAPE_CLASS, root);
Efl_Gfx_Path_Command *path_cmd = NULL;
double *points = NULL;
efl_gfx_path_append_circle(&path_cmd, &points);
* evas_vg_node_origin_set(shape, 10, 10);
* efl_gfx_shape_stroke_width_set(shape, 1.0);
* evas_vg_node_color_set(shape, 128, 128, 128, 80);
* efl_gfx_shape_path_set(shape, path_cmd, points);
Since
1.14
efl_add
#define efl_add(klass, parent,...)
Create a new object and add it to an existing parent object.
Definition: Eo.h:1542
evas_vg_node_color_set
void evas_vg_node_color_set(Eo *obj, int r, int g, int b, int a)
Sets the general/main color of the given Efl_Vg object to the given one.
Definition: efl_canvas_vg_node.c:802