2015-04-03 07:15:00 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <Eina.h>
|
|
|
|
#include <Ector.h>
|
|
|
|
|
|
|
|
#include "ector_private.h"
|
|
|
|
|
2015-04-03 07:21:53 -07:00
|
|
|
static void
|
2015-04-03 07:21:59 -07:00
|
|
|
_ector_renderer_generic_shape_fill_set(Eo *obj EINA_UNUSED,
|
|
|
|
Ector_Renderer_Generic_Shape_Data *pd,
|
|
|
|
const Ector_Renderer *r)
|
2015-04-03 07:15:00 -07:00
|
|
|
{
|
|
|
|
_ector_renderer_replace(&pd->fill, r);
|
|
|
|
}
|
|
|
|
|
2015-04-03 07:21:53 -07:00
|
|
|
static const Ector_Renderer *
|
2015-04-03 07:21:59 -07:00
|
|
|
_ector_renderer_generic_shape_fill_get(Eo *obj EINA_UNUSED,
|
|
|
|
Ector_Renderer_Generic_Shape_Data *pd)
|
2015-04-03 07:15:00 -07:00
|
|
|
{
|
|
|
|
return pd->fill;
|
|
|
|
}
|
|
|
|
|
2015-04-03 07:21:53 -07:00
|
|
|
static void
|
2015-04-03 07:21:59 -07:00
|
|
|
_ector_renderer_generic_shape_stroke_fill_set(Eo *obj EINA_UNUSED,
|
|
|
|
Ector_Renderer_Generic_Shape_Data *pd,
|
|
|
|
const Ector_Renderer *r)
|
2015-04-03 07:15:00 -07:00
|
|
|
{
|
|
|
|
_ector_renderer_replace(&pd->stroke.fill, r);
|
|
|
|
}
|
|
|
|
|
2015-04-03 07:21:53 -07:00
|
|
|
static const Ector_Renderer *
|
2015-04-03 07:21:59 -07:00
|
|
|
_ector_renderer_generic_shape_stroke_fill_get(Eo *obj EINA_UNUSED,
|
|
|
|
Ector_Renderer_Generic_Shape_Data *pd)
|
2015-04-03 07:15:00 -07:00
|
|
|
{
|
|
|
|
return pd->stroke.fill;
|
|
|
|
}
|
|
|
|
|
2015-04-03 07:21:53 -07:00
|
|
|
static void
|
2015-04-03 07:21:59 -07:00
|
|
|
_ector_renderer_generic_shape_stroke_marker_set(Eo *obj EINA_UNUSED,
|
|
|
|
Ector_Renderer_Generic_Shape_Data *pd,
|
|
|
|
const Ector_Renderer *r)
|
2015-04-03 07:15:00 -07:00
|
|
|
{
|
|
|
|
_ector_renderer_replace(&pd->stroke.marker, r);
|
|
|
|
}
|
|
|
|
|
2015-04-03 07:21:53 -07:00
|
|
|
static const Ector_Renderer *
|
2015-04-03 07:21:59 -07:00
|
|
|
_ector_renderer_generic_shape_stroke_marker_get(Eo *obj EINA_UNUSED,
|
|
|
|
Ector_Renderer_Generic_Shape_Data *pd)
|
2015-04-03 07:15:00 -07:00
|
|
|
{
|
|
|
|
return pd->stroke.marker;
|
|
|
|
}
|
|
|
|
|
2015-04-03 07:21:53 -07:00
|
|
|
static void
|
2015-04-03 07:23:16 -07:00
|
|
|
_ector_renderer_generic_shape_efl_gfx_shape_stroke_scale_set(Eo *obj EINA_UNUSED,
|
|
|
|
Ector_Renderer_Generic_Shape_Data *pd,
|
|
|
|
double s)
|
2015-04-03 07:15:00 -07:00
|
|
|
{
|
|
|
|
pd->stroke.scale = s;
|
|
|
|
}
|
|
|
|
|
2015-04-03 07:21:53 -07:00
|
|
|
static double
|
2015-04-03 07:23:16 -07:00
|
|
|
_ector_renderer_generic_shape_efl_gfx_shape_stroke_scale_get(Eo *obj EINA_UNUSED,
|
|
|
|
Ector_Renderer_Generic_Shape_Data *pd)
|
2015-04-03 07:15:00 -07:00
|
|
|
{
|
|
|
|
return pd->stroke.scale;
|
|
|
|
}
|
|
|
|
|
2015-04-03 07:21:53 -07:00
|
|
|
static void
|
2015-04-03 07:23:16 -07:00
|
|
|
_ector_renderer_generic_shape_efl_gfx_shape_stroke_color_set(Eo *obj EINA_UNUSED,
|
|
|
|
Ector_Renderer_Generic_Shape_Data *pd,
|
|
|
|
int r, int g, int b, int a)
|
2015-04-03 07:15:00 -07:00
|
|
|
{
|
|
|
|
pd->stroke.color.r = r;
|
|
|
|
pd->stroke.color.g = g;
|
|
|
|
pd->stroke.color.b = b;
|
|
|
|
pd->stroke.color.a = a;
|
|
|
|
}
|
|
|
|
|
2015-04-03 07:21:53 -07:00
|
|
|
static void
|
2015-04-03 07:23:16 -07:00
|
|
|
_ector_renderer_generic_shape_efl_gfx_shape_stroke_color_get(Eo *obj EINA_UNUSED,
|
|
|
|
Ector_Renderer_Generic_Shape_Data *pd,
|
|
|
|
int *r, int *g, int *b, int *a)
|
2015-04-03 07:15:00 -07:00
|
|
|
{
|
|
|
|
if (r) *r = pd->stroke.color.r;
|
|
|
|
if (g) *g = pd->stroke.color.g;
|
|
|
|
if (b) *b = pd->stroke.color.b;
|
|
|
|
if (a) *a = pd->stroke.color.a;
|
|
|
|
}
|
|
|
|
|
2015-04-03 07:21:53 -07:00
|
|
|
static void
|
2015-04-03 07:23:16 -07:00
|
|
|
_ector_renderer_generic_shape_efl_gfx_shape_stroke_width_set(Eo *obj EINA_UNUSED,
|
|
|
|
Ector_Renderer_Generic_Shape_Data *pd,
|
|
|
|
double w)
|
2015-04-03 07:15:00 -07:00
|
|
|
{
|
|
|
|
pd->stroke.width = w;
|
|
|
|
}
|
|
|
|
|
2015-04-03 07:21:53 -07:00
|
|
|
static double
|
2015-04-03 07:23:16 -07:00
|
|
|
_ector_renderer_generic_shape_efl_gfx_shape_stroke_width_get(Eo *obj EINA_UNUSED,
|
|
|
|
Ector_Renderer_Generic_Shape_Data *pd)
|
2015-04-03 07:15:00 -07:00
|
|
|
{
|
|
|
|
return pd->stroke.width;
|
|
|
|
}
|
|
|
|
|
2015-04-03 07:21:53 -07:00
|
|
|
static void
|
2015-04-03 07:23:16 -07:00
|
|
|
_ector_renderer_generic_shape_efl_gfx_shape_stroke_location_set(Eo *obj EINA_UNUSED,
|
|
|
|
Ector_Renderer_Generic_Shape_Data *pd,
|
|
|
|
double centered)
|
2015-04-03 07:15:00 -07:00
|
|
|
{
|
|
|
|
pd->stroke.centered = centered;
|
|
|
|
}
|
|
|
|
|
2015-04-03 07:21:53 -07:00
|
|
|
static double
|
2015-04-03 07:23:16 -07:00
|
|
|
_ector_renderer_generic_shape_efl_gfx_shape_stroke_location_get(Eo *obj EINA_UNUSED,
|
|
|
|
Ector_Renderer_Generic_Shape_Data *pd)
|
2015-04-03 07:15:00 -07:00
|
|
|
{
|
|
|
|
return pd->stroke.centered;
|
|
|
|
}
|
|
|
|
|
2015-04-03 07:21:53 -07:00
|
|
|
static void
|
2015-04-03 07:23:16 -07:00
|
|
|
_ector_renderer_generic_shape_efl_gfx_shape_stroke_dash_set(Eo *obj EINA_UNUSED,
|
|
|
|
Ector_Renderer_Generic_Shape_Data *pd,
|
|
|
|
const Efl_Gfx_Dash *dash,
|
|
|
|
unsigned int length)
|
2015-04-03 07:15:00 -07:00
|
|
|
{
|
2015-04-03 07:23:16 -07:00
|
|
|
Efl_Gfx_Dash *tmp;
|
2015-04-03 07:15:00 -07:00
|
|
|
|
|
|
|
if (!dash)
|
|
|
|
{
|
|
|
|
free(pd->stroke.dash);
|
|
|
|
pd->stroke.dash = NULL;
|
|
|
|
pd->stroke.dash_length = 0;
|
|
|
|
return ;
|
|
|
|
}
|
|
|
|
|
2015-04-03 07:23:16 -07:00
|
|
|
tmp = realloc(pd->stroke.dash, length * sizeof (Efl_Gfx_Dash));
|
2015-04-03 07:33:37 -07:00
|
|
|
if (!tmp && length) return ;
|
2015-04-03 07:23:16 -07:00
|
|
|
memcpy(tmp, dash, length * sizeof (Efl_Gfx_Dash));
|
2015-04-03 07:15:00 -07:00
|
|
|
|
|
|
|
pd->stroke.dash = tmp;
|
|
|
|
pd->stroke.dash_length = length;
|
|
|
|
}
|
|
|
|
|
2015-04-03 07:21:53 -07:00
|
|
|
static void
|
2015-04-03 07:23:16 -07:00
|
|
|
_ector_renderer_generic_shape_efl_gfx_shape_stroke_dash_get(Eo *obj EINA_UNUSED,
|
|
|
|
Ector_Renderer_Generic_Shape_Data *pd,
|
|
|
|
const Efl_Gfx_Dash **dash,
|
|
|
|
unsigned int *length)
|
2015-04-03 07:15:00 -07:00
|
|
|
{
|
|
|
|
if (dash) *dash = pd->stroke.dash;
|
|
|
|
if (length) *length = pd->stroke.dash_length;
|
|
|
|
}
|
|
|
|
|
2015-04-03 07:21:53 -07:00
|
|
|
static void
|
2015-04-03 07:23:16 -07:00
|
|
|
_ector_renderer_generic_shape_efl_gfx_shape_stroke_cap_set(Eo *obj EINA_UNUSED,
|
|
|
|
Ector_Renderer_Generic_Shape_Data *pd,
|
|
|
|
Efl_Gfx_Cap c)
|
2015-04-03 07:15:00 -07:00
|
|
|
{
|
|
|
|
pd->stroke.cap = c;
|
|
|
|
}
|
|
|
|
|
2015-04-03 07:23:16 -07:00
|
|
|
static Efl_Gfx_Cap
|
|
|
|
_ector_renderer_generic_shape_efl_gfx_shape_stroke_cap_get(Eo *obj EINA_UNUSED,
|
|
|
|
Ector_Renderer_Generic_Shape_Data *pd)
|
2015-04-03 07:15:00 -07:00
|
|
|
{
|
|
|
|
return pd->stroke.cap;
|
|
|
|
}
|
|
|
|
|
2015-04-03 07:21:53 -07:00
|
|
|
static void
|
2015-04-03 07:23:16 -07:00
|
|
|
_ector_renderer_generic_shape_efl_gfx_shape_stroke_join_set(Eo *obj EINA_UNUSED,
|
|
|
|
Ector_Renderer_Generic_Shape_Data *pd,
|
|
|
|
Efl_Gfx_Join j)
|
2015-04-03 07:15:00 -07:00
|
|
|
{
|
|
|
|
pd->stroke.join = j;
|
|
|
|
}
|
|
|
|
|
2015-04-03 07:23:16 -07:00
|
|
|
static Efl_Gfx_Join
|
|
|
|
_ector_renderer_generic_shape_efl_gfx_shape_stroke_join_get(Eo *obj EINA_UNUSED,
|
|
|
|
Ector_Renderer_Generic_Shape_Data *pd)
|
2015-04-03 07:15:00 -07:00
|
|
|
{
|
|
|
|
return pd->stroke.join;
|
|
|
|
}
|
|
|
|
|
2015-04-03 07:15:41 -07:00
|
|
|
#include "ector_renderer_generic_shape.eo.c"
|