forked from enlightenment/efl
efl: make path a property actually.
This commit is contained in:
parent
091fd5f31d
commit
ba47b47eb2
|
@ -180,20 +180,16 @@ _ector_renderer_cairo_shape_ector_renderer_cairo_base_fill(Eo *obj, Ector_Render
|
||||||
// I need to read SVG specification and see how to map that with cairo.
|
// I need to read SVG specification and see how to map that with cairo.
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static void
|
||||||
_ector_renderer_cairo_shape_efl_graphics_shape_path_set(Eo *obj, Ector_Renderer_Cairo_Shape_Data *pd,
|
_ector_renderer_cairo_shape_efl_gfx_shape_path_set(Eo *obj, Ector_Renderer_Cairo_Shape_Data *pd,
|
||||||
const Efl_Graphics_Path_Command *op, const double *points)
|
const Efl_Gfx_Path_Command *op, const double *points)
|
||||||
{
|
{
|
||||||
Eina_Bool r;
|
USE(obj, cairo_path_destroy, );
|
||||||
|
|
||||||
USE(obj, cairo_path_destroy, EINA_FALSE);
|
|
||||||
|
|
||||||
if (pd->path) cairo_path_destroy(pd->path);
|
if (pd->path) cairo_path_destroy(pd->path);
|
||||||
pd->path = NULL;
|
pd->path = NULL;
|
||||||
|
|
||||||
eo_do_super(obj, ECTOR_RENDERER_CAIRO_SHAPE_CLASS, r = efl_graphics_shape_path_set(op, points));
|
eo_do_super(obj, ECTOR_RENDERER_CAIRO_SHAPE_CLASS, efl_graphics_shape_path_set(op, points));
|
||||||
|
|
||||||
return r;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ class Ector.Renderer.Cairo.Shape (Ector.Renderer.Cairo.Base, Ector.Renderer.Gene
|
||||||
Ector.Renderer.Generic.Base.prepare;
|
Ector.Renderer.Generic.Base.prepare;
|
||||||
Ector.Renderer.Generic.Base.draw;
|
Ector.Renderer.Generic.Base.draw;
|
||||||
Ector.Renderer.Cairo.Base.fill;
|
Ector.Renderer.Cairo.Base.fill;
|
||||||
Efl.Graphics.Shape.path_set;
|
Efl.Graphics.Shape.path.set;
|
||||||
Eo.Base.constructor;
|
Eo.Base.constructor;
|
||||||
Eo.Base.destructor;
|
Eo.Base.destructor;
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ class Ector.Renderer.Generic.Shape (Ector.Renderer.Generic.Base, Efl.Graphics.Sh
|
||||||
Efl.Graphics.Shape.stroke_dash;
|
Efl.Graphics.Shape.stroke_dash;
|
||||||
Efl.Graphics.Shape.stroke_cap;
|
Efl.Graphics.Shape.stroke_cap;
|
||||||
Efl.Graphics.Shape.stroke_join;
|
Efl.Graphics.Shape.stroke_join;
|
||||||
Efl.Graphics.Shape.path_set;
|
Efl.Graphics.Shape.path;
|
||||||
Eo.Base.constructor;
|
Eo.Base.constructor;
|
||||||
Eo.Base.destructor;
|
Eo.Base.destructor;
|
||||||
}
|
}
|
||||||
|
|
|
@ -183,7 +183,7 @@ _ector_renderer_generic_shape_efl_graphics_shape_stroke_join_get(Eo *obj EINA_UN
|
||||||
return pd->stroke.join;
|
return pd->stroke.join;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static void
|
||||||
_ector_renderer_generic_shape_efl_graphics_shape_path_set(Eo *obj EINA_UNUSED,
|
_ector_renderer_generic_shape_efl_graphics_shape_path_set(Eo *obj EINA_UNUSED,
|
||||||
Ector_Renderer_Generic_Shape_Data *pd,
|
Ector_Renderer_Generic_Shape_Data *pd,
|
||||||
const Efl_Graphics_Path_Command *cmd,
|
const Efl_Graphics_Path_Command *cmd,
|
||||||
|
@ -194,7 +194,17 @@ _ector_renderer_generic_shape_efl_graphics_shape_path_set(Eo *obj EINA_UNUSED,
|
||||||
free(pd->path.pts);
|
free(pd->path.pts);
|
||||||
pd->path.pts = NULL;
|
pd->path.pts = NULL;
|
||||||
|
|
||||||
return efl_graphics_path_dup(&pd->path.cmd, &pd->path.pts, cmd, points);
|
efl_graphics_path_dup(&pd->path.cmd, &pd->path.pts, cmd, points);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_ector_renderer_generic_shape_efl_graphics_shape_path_get(Eo *obj EINA_UNUSED,
|
||||||
|
Ector_Renderer_Generic_Shape_Data *pd,
|
||||||
|
const Efl_Graphics_Path_Command **op,
|
||||||
|
const double **points)
|
||||||
|
{
|
||||||
|
if (op) *op = pd->path.cmd;
|
||||||
|
if (points) *points = pd->path.pts;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -69,13 +69,14 @@ interface Efl.Graphics.Shape
|
||||||
Efl_Graphics_Join j;
|
Efl_Graphics_Join j;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
path {
|
||||||
methods {
|
set {
|
||||||
path_set {
|
}
|
||||||
return: bool;
|
get {
|
||||||
params {
|
}
|
||||||
@in const(Efl_Graphics_Path_Command) *op;
|
values {
|
||||||
@in const(double) *points;
|
const(Efl_Graphics_Path_Command) *op;
|
||||||
|
const(double) *points;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ struct _Evas_VG_Shape_Data
|
||||||
} stroke;
|
} stroke;
|
||||||
};
|
};
|
||||||
|
|
||||||
static Eina_Bool
|
static void
|
||||||
_evas_vg_shape_efl_graphics_shape_path_set(Eo *obj EINA_UNUSED,
|
_evas_vg_shape_efl_graphics_shape_path_set(Eo *obj EINA_UNUSED,
|
||||||
Evas_VG_Shape_Data *pd,
|
Evas_VG_Shape_Data *pd,
|
||||||
const Efl_Graphics_Path_Command *ops,
|
const Efl_Graphics_Path_Command *ops,
|
||||||
|
@ -42,7 +42,17 @@ _evas_vg_shape_efl_graphics_shape_path_set(Eo *obj EINA_UNUSED,
|
||||||
free(pd->ops);
|
free(pd->ops);
|
||||||
pd->ops = NULL;
|
pd->ops = NULL;
|
||||||
|
|
||||||
return efl_graphics_path_dup(&pd->ops, &pd->points, ops, points);
|
efl_graphics_path_dup(&pd->ops, &pd->points, ops, points);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_evas_vg_shape_efl_graphics_shape_path_get(Eo *obj EINA_UNUSED,
|
||||||
|
Evas_VG_Shape_Data *pd,
|
||||||
|
const Efl_Graphics_Path_Command **op,
|
||||||
|
const double **points)
|
||||||
|
{
|
||||||
|
if (op) *op = pd->ops;
|
||||||
|
if (points) *points = pd->points;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
|
|
|
@ -39,7 +39,7 @@ class Evas.VG_Shape (Evas.VG_Node, Efl.Graphics.Shape)
|
||||||
Efl.Graphics.Shape.stroke_dash;
|
Efl.Graphics.Shape.stroke_dash;
|
||||||
Efl.Graphics.Shape.stroke_cap;
|
Efl.Graphics.Shape.stroke_cap;
|
||||||
Efl.Graphics.Shape.stroke_join;
|
Efl.Graphics.Shape.stroke_join;
|
||||||
Efl.Graphics.Shape.path_set;
|
Efl.Graphics.Shape.path;
|
||||||
Evas.VG_Node.bound_get;
|
Evas.VG_Node.bound_get;
|
||||||
Eo.Base.constructor;
|
Eo.Base.constructor;
|
||||||
Eo.Base.destructor;
|
Eo.Base.destructor;
|
||||||
|
|
Loading…
Reference in New Issue