1 #include "evas_common_private.h"
2 #include "evas_private.h"
3 
4 #include "evas_vg_private.h"
5 
6 #define MY_CLASS EFL_CANVAS_VG_SHAPE_CLASS
7 
8 typedef struct _Efl_Canvas_Vg_Shape_Data Efl_Canvas_Vg_Shape_Data;
9 struct _Efl_Canvas_Vg_Shape_Data
10 {
11    Efl_Canvas_Vg_Node *fill;
12 
13    struct {
14       Efl_Canvas_Vg_Node *fill;
15       Efl_Canvas_Vg_Node *marker;
16    } stroke;
17 };
18 
19 // FIXME: Use the renderer bounding box when it has been created instead of an estimation
20 
21 static void
_efl_canvas_vg_shape_fill_set(Eo * obj EINA_UNUSED,Efl_Canvas_Vg_Shape_Data * pd,Efl_Canvas_Vg_Node * f)22 _efl_canvas_vg_shape_fill_set(Eo *obj EINA_UNUSED,
23                        Efl_Canvas_Vg_Shape_Data *pd,
24                        Efl_Canvas_Vg_Node *f)
25 {
26    if (pd->fill == f) return;
27 
28    Efl_Canvas_Vg_Node *tmp = pd->fill;
29 
30    pd->fill = efl_ref(f);
31    efl_unref(tmp);
32 }
33 
34 static Efl_Canvas_Vg_Node *
_efl_canvas_vg_shape_fill_get(const Eo * obj EINA_UNUSED,Efl_Canvas_Vg_Shape_Data * pd)35 _efl_canvas_vg_shape_fill_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Vg_Shape_Data *pd)
36 {
37    return pd->fill;
38 }
39 
40 static void
_efl_canvas_vg_shape_stroke_fill_set(Eo * obj EINA_UNUSED,Efl_Canvas_Vg_Shape_Data * pd,Efl_Canvas_Vg_Node * f)41 _efl_canvas_vg_shape_stroke_fill_set(Eo *obj EINA_UNUSED,
42                               Efl_Canvas_Vg_Shape_Data *pd,
43                               Efl_Canvas_Vg_Node *f)
44 {
45    if (pd->stroke.fill == f) return;
46 
47    Efl_Canvas_Vg_Node *tmp = pd->stroke.fill;
48    pd->stroke.fill = efl_ref(f);
49    efl_unref(tmp);
50 }
51 
52 static Efl_Canvas_Vg_Node *
_efl_canvas_vg_shape_stroke_fill_get(const Eo * obj EINA_UNUSED,Efl_Canvas_Vg_Shape_Data * pd)53 _efl_canvas_vg_shape_stroke_fill_get(const Eo *obj EINA_UNUSED,
54                               Efl_Canvas_Vg_Shape_Data *pd)
55 {
56    return pd->stroke.fill;
57 }
58 
59 static void
_efl_canvas_vg_shape_stroke_marker_set(Eo * obj EINA_UNUSED,Efl_Canvas_Vg_Shape_Data * pd,Efl_Canvas_Vg_Shape * m)60 _efl_canvas_vg_shape_stroke_marker_set(Eo *obj EINA_UNUSED,
61                                 Efl_Canvas_Vg_Shape_Data *pd,
62                                 Efl_Canvas_Vg_Shape *m)
63 {
64    Efl_Canvas_Vg_Node *tmp = pd->stroke.marker;
65 
66    pd->stroke.marker = efl_ref(m);
67    efl_unref(tmp);
68 }
69 
70 static Efl_Canvas_Vg_Shape *
_efl_canvas_vg_shape_stroke_marker_get(const Eo * obj EINA_UNUSED,Efl_Canvas_Vg_Shape_Data * pd)71 _efl_canvas_vg_shape_stroke_marker_get(const Eo *obj EINA_UNUSED,
72                                 Efl_Canvas_Vg_Shape_Data *pd)
73 {
74    return pd->stroke.marker;
75 }
76 
77 static void
_efl_canvas_vg_shape_render_pre(Evas_Object_Protected_Data * vg_pd,Efl_VG * obj,Efl_Canvas_Vg_Node_Data * nd,void * engine,void * output,void * context,Ector_Surface * surface,Eina_Matrix3 * ptransform,int p_opacity,Ector_Buffer * comp,Efl_Gfx_Vg_Composite_Method comp_method,void * data)78 _efl_canvas_vg_shape_render_pre(Evas_Object_Protected_Data *vg_pd,
79                                 Efl_VG *obj,
80                                 Efl_Canvas_Vg_Node_Data *nd,
81                                 void *engine, void *output, void *context,
82                                 Ector_Surface *surface,
83                                 Eina_Matrix3 *ptransform,
84                                 int p_opacity,
85                                 Ector_Buffer *comp,
86                                 Efl_Gfx_Vg_Composite_Method comp_method,
87                                 void *data)
88 {
89    Efl_Canvas_Vg_Shape_Data *pd = data;
90    Efl_Canvas_Vg_Node_Data *fill, *stroke_fill, *stroke_marker;
91 
92    if (nd->flags == EFL_GFX_CHANGE_FLAG_NONE) return;
93 
94    nd->flags = EFL_GFX_CHANGE_FLAG_NONE;
95 
96    EFL_CANVAS_VG_COMPUTE_MATRIX(ctransform, ptransform, nd);
97    EFL_CANVAS_VG_COMPUTE_ALPHA(c_r, c_g, c_b, c_a, p_opacity, nd);
98 
99    fill = _evas_vg_render_pre(vg_pd, pd->fill,
100                               engine, output, context,
101                               surface, ctransform, c_a, comp, comp_method);
102    stroke_fill = _evas_vg_render_pre(vg_pd, pd->stroke.fill,
103                                      engine, output, context,
104                                      surface, ctransform, c_a, comp, comp_method);
105    stroke_marker = _evas_vg_render_pre(vg_pd, pd->stroke.marker,
106                                        engine, output, context,
107                                        surface, ctransform, c_a, comp, comp_method);
108 
109    if (!nd->renderer)
110      {
111         efl_domain_current_push(EFL_ID_DOMAIN_SHARED);
112         nd->renderer = ector_surface_renderer_factory_new(surface, ECTOR_RENDERER_SHAPE_MIXIN);
113         efl_domain_current_pop();
114      }
115    ector_renderer_transformation_set(nd->renderer, ctransform);
116    ector_renderer_origin_set(nd->renderer, nd->x, nd->y);
117    ector_renderer_color_set(nd->renderer, c_r, c_g, c_b, c_a);
118    ector_renderer_visibility_set(nd->renderer, nd->visibility);
119    ector_renderer_shape_fill_set(nd->renderer, fill ? fill->renderer : NULL);
120    ector_renderer_shape_stroke_fill_set(nd->renderer, stroke_fill ? stroke_fill->renderer : NULL);
121    ector_renderer_shape_stroke_marker_set(nd->renderer, stroke_marker ? stroke_marker->renderer : NULL);
122    efl_gfx_path_copy_from(nd->renderer, obj);
123    efl_gfx_path_commit(nd->renderer);
124    ector_renderer_prepare(nd->renderer);
125    ector_renderer_comp_method_set(nd->renderer, comp, comp_method);
126 }
127 
128 static Eo *
_efl_canvas_vg_shape_efl_object_constructor(Eo * obj,Efl_Canvas_Vg_Shape_Data * pd)129 _efl_canvas_vg_shape_efl_object_constructor(Eo *obj, Efl_Canvas_Vg_Shape_Data *pd)
130 {
131    Efl_Canvas_Vg_Node_Data *nd;
132 
133    obj = efl_constructor(efl_super(obj, MY_CLASS));
134 
135    efl_gfx_shape_stroke_scale_set(obj, 1);
136    efl_gfx_shape_stroke_location_set(obj, 0.5);
137    efl_gfx_shape_stroke_cap_set(obj, EFL_GFX_CAP_BUTT);
138    efl_gfx_shape_stroke_join_set(obj, EFL_GFX_JOIN_MITER);
139 
140    //NOTE: The default value is 4. It only refers to the standard of web svg.
141    //      https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-miterlimit
142    efl_gfx_shape_stroke_miterlimit_set(obj, 4);
143 
144    nd = efl_data_scope_get(obj, EFL_CANVAS_VG_NODE_CLASS);
145    nd->render_pre = _efl_canvas_vg_shape_render_pre;
146    nd->data = pd;
147 
148    return obj;
149 }
150 
151 static void
_efl_canvas_vg_shape_efl_object_destructor(Eo * obj,Efl_Canvas_Vg_Shape_Data * pd)152 _efl_canvas_vg_shape_efl_object_destructor(Eo *obj, Efl_Canvas_Vg_Shape_Data *pd)
153 {
154    if (pd->fill) efl_unref(pd->fill);
155    if (pd->stroke.fill) efl_unref(pd->stroke.fill);
156    if (pd->stroke.marker) efl_unref(pd->stroke.marker);
157 
158    efl_gfx_path_reset(obj);
159    efl_destructor(efl_super(obj, MY_CLASS));
160 }
161 
162 static Eina_Bool
_efl_canvas_vg_shape_efl_gfx_path_interpolate(Eo * obj,Efl_Canvas_Vg_Shape_Data * pd,const Efl_Canvas_Vg_Node * from,const Efl_Canvas_Vg_Node * to,double pos_map)163 _efl_canvas_vg_shape_efl_gfx_path_interpolate(Eo *obj,
164                                               Efl_Canvas_Vg_Shape_Data *pd,
165                                               const Efl_Canvas_Vg_Node *from,
166                                               const Efl_Canvas_Vg_Node *to,
167                                               double pos_map)
168 {
169    Efl_Canvas_Vg_Shape_Data *fromd, *tod;
170    Eina_Bool r = EINA_TRUE;
171 
172    //Check if both objects have same type
173    if (!(efl_isa(from, MY_CLASS) && efl_isa(to, MY_CLASS)))
174      return EINA_FALSE;
175 
176    //Is this the best way?
177    r &= efl_gfx_path_interpolate(efl_cast(obj, EFL_CANVAS_VG_NODE_CLASS),
178                                  from, to, pos_map);
179    r &= efl_gfx_path_interpolate(efl_super(obj, MY_CLASS), from, to, pos_map);
180 
181    fromd = efl_data_scope_get(from, MY_CLASS);
182    tod = efl_data_scope_get(to, MY_CLASS);
183 
184    //Fill
185    if (fromd->fill && tod->fill && pd->fill)
186      r &= efl_gfx_path_interpolate(pd->fill, fromd->fill, tod->fill, pos_map);
187 
188    //Stroke Fill
189    if (fromd->stroke.fill && tod->stroke.fill && pd->stroke.fill)
190      r &= efl_gfx_path_interpolate(pd->stroke.fill, fromd->stroke.fill, tod->stroke.fill, pos_map);
191 
192    //Stroke Marker
193    if (fromd->stroke.marker && tod->stroke.marker && pd->stroke.marker)
194      r &= efl_gfx_path_interpolate(pd->stroke.marker, fromd->stroke.marker, tod->stroke.marker, pos_map);
195 
196    return r;
197 }
198 
199 EOLIAN static void
_efl_canvas_vg_shape_efl_gfx_path_commit(Eo * obj,Efl_Canvas_Vg_Shape_Data * pd EINA_UNUSED)200 _efl_canvas_vg_shape_efl_gfx_path_commit(Eo *obj,
201                                          Efl_Canvas_Vg_Shape_Data *pd EINA_UNUSED)
202 {
203    efl_canvas_vg_node_change(obj);
204 }
205 
206 EOLIAN static Efl_Canvas_Vg_Node *
_efl_canvas_vg_shape_efl_duplicate_duplicate(const Eo * obj,Efl_Canvas_Vg_Shape_Data * pd)207 _efl_canvas_vg_shape_efl_duplicate_duplicate(const Eo *obj, Efl_Canvas_Vg_Shape_Data *pd)
208 {
209    Efl_Canvas_Vg_Node *node;
210    Efl_Canvas_Vg_Shape_Data *sd;
211 
212    node = efl_duplicate(efl_super(obj, MY_CLASS));
213    sd = efl_data_scope_get(node, MY_CLASS);
214 
215    if (pd->fill)
216      {
217         sd->fill = efl_duplicate(pd->fill);
218         efl_parent_set(sd->fill, efl_parent_get(node));
219      }
220 
221    if (pd->stroke.fill)
222      {
223         sd->stroke.fill = efl_duplicate(pd->stroke.fill);
224         efl_parent_set(sd->stroke.fill, efl_parent_get(node));
225      }
226 
227    if (pd->stroke.marker)
228      {
229         sd->stroke.marker = efl_duplicate(pd->stroke.marker);
230         efl_parent_set(sd->stroke.marker, efl_parent_get(node));
231      }
232 
233    efl_gfx_path_copy_from(node, obj);
234 
235    return node;
236 }
237 
238 EAPI double
evas_vg_shape_stroke_scale_get(Evas_Vg_Shape * obj)239 evas_vg_shape_stroke_scale_get(Evas_Vg_Shape *obj)
240 {
241    return efl_gfx_shape_stroke_scale_get(obj);
242 }
243 
244 EAPI void
evas_vg_shape_stroke_scale_set(Evas_Vg_Shape * obj,double s)245 evas_vg_shape_stroke_scale_set(Evas_Vg_Shape *obj, double s)
246 {
247    efl_gfx_shape_stroke_scale_set(obj, s);
248    efl_canvas_vg_node_change(obj);
249 }
250 
251 EAPI void
evas_vg_shape_stroke_color_get(Evas_Vg_Shape * obj,int * r,int * g,int * b,int * a)252 evas_vg_shape_stroke_color_get(Evas_Vg_Shape *obj, int *r, int *g, int *b, int *a)
253 {
254    efl_gfx_shape_stroke_color_get(obj, r, g, b, a);
255 }
256 
257 EAPI void
evas_vg_shape_stroke_color_set(Evas_Vg_Shape * obj,int r,int g,int b,int a)258 evas_vg_shape_stroke_color_set(Evas_Vg_Shape *obj, int r, int g, int b, int a)
259 {
260    efl_gfx_shape_stroke_color_set(obj, r, g, b, a);
261    efl_canvas_vg_node_change(obj);
262 }
263 
264 EAPI double
evas_vg_shape_stroke_width_get(Evas_Vg_Shape * obj)265 evas_vg_shape_stroke_width_get(Evas_Vg_Shape *obj)
266 {
267    return efl_gfx_shape_stroke_width_get(obj);
268 }
269 
270 EAPI void
evas_vg_shape_stroke_width_set(Evas_Vg_Shape * obj,double w)271 evas_vg_shape_stroke_width_set(Evas_Vg_Shape *obj, double w)
272 {
273    efl_gfx_shape_stroke_width_set(obj, w);
274    efl_canvas_vg_node_change(obj);
275 }
276 
277 EAPI double
evas_vg_shape_stroke_location_get(Evas_Vg_Shape * obj)278 evas_vg_shape_stroke_location_get(Evas_Vg_Shape *obj)
279 {
280    return efl_gfx_shape_stroke_location_get(obj);
281 }
282 
283 EAPI void
evas_vg_shape_stroke_location_set(Evas_Vg_Shape * obj,double centered)284 evas_vg_shape_stroke_location_set(Evas_Vg_Shape *obj, double centered)
285 {
286    efl_gfx_shape_stroke_location_set(obj, centered);
287    efl_canvas_vg_node_change(obj);
288 }
289 
290 EAPI void
evas_vg_shape_stroke_dash_get(Evas_Vg_Shape * obj,const Evas_Vg_Dash ** dash,unsigned int * length)291 evas_vg_shape_stroke_dash_get(Evas_Vg_Shape *obj, const Evas_Vg_Dash **dash, unsigned int *length)
292 {
293    efl_gfx_shape_stroke_dash_get(obj, (const Efl_Gfx_Dash **)dash, length);
294 }
295 
296 EAPI void
evas_vg_shape_stroke_dash_set(Evas_Vg_Shape * obj,const Evas_Vg_Dash * dash,unsigned int length)297 evas_vg_shape_stroke_dash_set(Evas_Vg_Shape *obj, const Evas_Vg_Dash *dash, unsigned int length)
298 {
299    efl_gfx_shape_stroke_dash_set(obj, (const Efl_Gfx_Dash *)dash, length);
300    efl_canvas_vg_node_change(obj);
301 }
302 
303 EAPI Evas_Vg_Cap
evas_vg_shape_stroke_cap_get(Evas_Vg_Shape * obj)304 evas_vg_shape_stroke_cap_get(Evas_Vg_Shape *obj)
305 {
306    return (Evas_Vg_Cap)efl_gfx_shape_stroke_cap_get(obj);
307 }
308 
309 EAPI void
evas_vg_shape_stroke_cap_set(Evas_Vg_Shape * obj,Evas_Vg_Cap c)310 evas_vg_shape_stroke_cap_set(Evas_Vg_Shape *obj, Evas_Vg_Cap c)
311 {
312    efl_gfx_shape_stroke_cap_set(obj, (Efl_Gfx_Cap)c);
313    efl_canvas_vg_node_change(obj);
314 }
315 
316 EAPI Evas_Vg_Join
evas_vg_shape_stroke_join_get(Evas_Vg_Shape * obj)317 evas_vg_shape_stroke_join_get(Evas_Vg_Shape *obj)
318 {
319    return (Evas_Vg_Join)efl_gfx_shape_stroke_join_get(obj);
320 }
321 
322 EAPI void
evas_vg_shape_stroke_join_set(Evas_Vg_Shape * obj,Evas_Vg_Join j)323 evas_vg_shape_stroke_join_set(Evas_Vg_Shape *obj, Evas_Vg_Join j)
324 {
325    efl_gfx_shape_stroke_join_set(obj, (Efl_Gfx_Join)j);
326    efl_canvas_vg_node_change(obj);
327 }
328 
329 EAPI void
evas_vg_shape_path_set(Evas_Vg_Shape * obj,const Evas_Vg_Path_Command * op,const double * points)330 evas_vg_shape_path_set(Evas_Vg_Shape *obj, const Evas_Vg_Path_Command *op, const double *points)
331 {
332    efl_gfx_path_set(obj, (const Efl_Gfx_Path_Command *)op, points);
333    efl_canvas_vg_node_change(obj);
334 }
335 
336 EAPI void
evas_vg_shape_path_get(Evas_Vg_Shape * obj,const Evas_Vg_Path_Command ** op,const double ** points)337 evas_vg_shape_path_get(Evas_Vg_Shape *obj, const Evas_Vg_Path_Command **op, const double **points)
338 {
339    efl_gfx_path_get(obj, (const Efl_Gfx_Path_Command **)op, points);
340 }
341 
342 EAPI void
evas_vg_shape_path_length_get(Evas_Vg_Shape * obj,unsigned int * commands,unsigned int * points)343 evas_vg_shape_path_length_get(Evas_Vg_Shape *obj, unsigned int *commands, unsigned int *points)
344 {
345    efl_gfx_path_length_get(obj, commands, points);
346 }
347 
348 EAPI void
evas_vg_shape_current_get(Evas_Vg_Shape * obj,double * x,double * y)349 evas_vg_shape_current_get(Evas_Vg_Shape *obj, double *x, double *y)
350 {
351    efl_gfx_path_current_get(obj, x, y);
352 }
353 
354 EAPI void
evas_vg_shape_current_ctrl_get(Evas_Vg_Shape * obj,double * x,double * y)355 evas_vg_shape_current_ctrl_get(Evas_Vg_Shape *obj, double *x, double *y)
356 {
357    efl_gfx_path_current_ctrl_get(obj, x, y);
358 }
359 
360 EAPI void
evas_vg_shape_dup(Evas_Vg_Shape * obj,Evas_Vg_Shape * dup_from)361 evas_vg_shape_dup(Evas_Vg_Shape *obj, Evas_Vg_Shape *dup_from)
362 {
363    efl_gfx_path_copy_from(obj, dup_from);
364    efl_canvas_vg_node_change(obj);
365 }
366 
367 EAPI void
evas_vg_shape_reset(Evas_Vg_Shape * obj)368 evas_vg_shape_reset(Evas_Vg_Shape *obj)
369 {
370    efl_gfx_path_reset(obj);
371    efl_canvas_vg_node_change(obj);
372 }
373 
374 EAPI void
evas_vg_shape_append_move_to(Evas_Vg_Shape * obj,double x,double y)375 evas_vg_shape_append_move_to(Evas_Vg_Shape *obj, double x, double y)
376 {
377    efl_gfx_path_append_move_to(obj, x, y);
378    efl_canvas_vg_node_change(obj);
379 }
380 
381 EAPI void
evas_vg_shape_append_line_to(Evas_Vg_Shape * obj,double x,double y)382 evas_vg_shape_append_line_to(Evas_Vg_Shape *obj, double x, double y)
383 {
384    efl_gfx_path_append_line_to(obj, x, y);
385    efl_canvas_vg_node_change(obj);
386 }
387 
388 EAPI void
evas_vg_shape_append_quadratic_to(Evas_Vg_Shape * obj,double x,double y,double ctrl_x,double ctrl_y)389 evas_vg_shape_append_quadratic_to(Evas_Vg_Shape *obj, double x, double y, double ctrl_x, double ctrl_y)
390 {
391    efl_gfx_path_append_quadratic_to(obj, x, y, ctrl_x, ctrl_y);
392    efl_canvas_vg_node_change(obj);
393 }
394 
395 EAPI void
evas_vg_shape_append_squadratic_to(Evas_Vg_Shape * obj,double x,double y)396 evas_vg_shape_append_squadratic_to(Evas_Vg_Shape *obj, double x, double y)
397 {
398    efl_gfx_path_append_squadratic_to(obj, x, y);
399    efl_canvas_vg_node_change(obj);
400 }
401 
402 EAPI void
evas_vg_shape_append_cubic_to(Evas_Vg_Shape * obj,double x,double y,double ctrl_x0,double ctrl_y0,double ctrl_x1,double ctrl_y1)403 evas_vg_shape_append_cubic_to(Evas_Vg_Shape *obj, double x, double y, double ctrl_x0, double ctrl_y0, double ctrl_x1, double ctrl_y1)
404 {
405    efl_gfx_path_append_cubic_to(obj, ctrl_x0, ctrl_y0, ctrl_x1, ctrl_y1, x, y);
406    efl_canvas_vg_node_change(obj);
407 }
408 
409 EAPI void
evas_vg_shape_append_scubic_to(Evas_Vg_Shape * obj,double x,double y,double ctrl_x,double ctrl_y)410 evas_vg_shape_append_scubic_to(Evas_Vg_Shape *obj, double x, double y, double ctrl_x, double ctrl_y)
411 {
412    efl_gfx_path_append_scubic_to(obj, x, y, ctrl_x, ctrl_y);
413    efl_canvas_vg_node_change(obj);
414 }
415 
416 EAPI void
evas_vg_shape_append_arc_to(Evas_Vg_Shape * obj,double x,double y,double rx,double ry,double angle,Eina_Bool large_arc,Eina_Bool sweep)417 evas_vg_shape_append_arc_to(Evas_Vg_Shape *obj, double x, double y, double rx, double ry, double angle, Eina_Bool large_arc, Eina_Bool sweep)
418 {
419    efl_gfx_path_append_arc_to(obj, x, y, rx, ry, angle, large_arc, sweep);
420    efl_canvas_vg_node_change(obj);
421 }
422 
423 EAPI void
evas_vg_shape_append_arc(Evas_Vg_Shape * obj,double x,double y,double w,double h,double start_angle,double sweep_length)424 evas_vg_shape_append_arc(Evas_Vg_Shape *obj, double x, double y, double w, double h, double start_angle, double sweep_length)
425 {
426    efl_gfx_path_append_arc(obj, x, y, w, h, start_angle, sweep_length);
427    efl_canvas_vg_node_change(obj);
428 }
429 
430 EAPI void
evas_vg_shape_append_close(Evas_Vg_Shape * obj)431 evas_vg_shape_append_close(Evas_Vg_Shape *obj)
432 {
433    efl_gfx_path_append_close(obj);
434    efl_canvas_vg_node_change(obj);
435 }
436 
437 EAPI void
evas_vg_shape_append_circle(Evas_Vg_Shape * obj,double x,double y,double radius)438 evas_vg_shape_append_circle(Evas_Vg_Shape *obj, double x, double y, double radius)
439 {
440    efl_gfx_path_append_circle(obj, x, y, radius);
441    efl_canvas_vg_node_change(obj);
442 }
443 
444 EAPI void
evas_vg_shape_append_rect(Evas_Vg_Shape * obj,double x,double y,double w,double h,double rx,double ry)445 evas_vg_shape_append_rect(Evas_Vg_Shape *obj, double x, double y, double w, double h, double rx, double ry)
446 {
447    efl_gfx_path_append_rect(obj, x, y, w, h, rx, ry);
448    efl_canvas_vg_node_change(obj);
449 }
450 
451 EAPI void
evas_vg_shape_append_svg_path(Evas_Vg_Shape * obj,const char * svg_path_data)452 evas_vg_shape_append_svg_path(Evas_Vg_Shape *obj, const char *svg_path_data)
453 {
454    efl_gfx_path_append_svg_path(obj, svg_path_data);
455    efl_canvas_vg_node_change(obj);
456 }
457 
458 EAPI Eina_Bool
evas_vg_shape_interpolate(Evas_Vg_Shape * obj,const Evas_Vg_Shape * from,const Evas_Vg_Shape * to,double pos_map)459 evas_vg_shape_interpolate(Evas_Vg_Shape *obj, const Evas_Vg_Shape *from, const Evas_Vg_Shape *to, double pos_map)
460 {
461    Eina_Bool ret = efl_gfx_path_interpolate(obj, from, to, pos_map);
462    efl_canvas_vg_node_change(obj);
463    return ret;
464 }
465 
466 EAPI Eina_Bool
evas_vg_shape_equal_commands(Evas_Vg_Shape * obj,const Evas_Vg_Shape * with)467 evas_vg_shape_equal_commands(Evas_Vg_Shape *obj, const Evas_Vg_Shape *with)
468 {
469    return efl_gfx_path_equal_commands(obj, with);
470 }
471 
472 EAPI Efl_Canvas_Vg_Shape*
evas_vg_shape_add(Efl_Canvas_Vg_Node * parent)473 evas_vg_shape_add(Efl_Canvas_Vg_Node *parent)
474 {
475    /* Warn it because the usage has been changed.
476       We can remove this message after v1.21. */
477    if (!parent)
478      {
479         ERR("Efl_Canvas_Vg_Shape only allow Efl_Canvas_Vg_Node as the parent");
480         return NULL;
481      }
482 
483    return efl_add(MY_CLASS, parent);
484 }
485 
486 #include "efl_canvas_vg_shape.eo.c"
487 #include "efl_canvas_vg_shape_eo.legacy.c"
488