2015-04-03 07:15:04 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <Eina.h>
|
|
|
|
#include <Ector.h>
|
|
|
|
|
|
|
|
#include "ector_private.h"
|
|
|
|
|
2018-11-14 04:51:24 -08:00
|
|
|
#define MY_CLASS ECTOR_RENDERER_GRADIENT_MIXIN
|
|
|
|
|
2015-04-03 07:21:53 -07:00
|
|
|
static void
|
2016-05-11 04:57:06 -07:00
|
|
|
_ector_renderer_gradient_efl_gfx_gradient_stop_set(Eo *obj EINA_UNUSED,
|
|
|
|
Ector_Renderer_Gradient_Data *pd,
|
2015-04-03 07:30:35 -07:00
|
|
|
const Efl_Gfx_Gradient_Stop *colors,
|
|
|
|
unsigned int length)
|
2015-04-03 07:15:04 -07:00
|
|
|
{
|
2015-04-03 07:23:16 -07:00
|
|
|
pd->colors = realloc(pd->colors, length * sizeof(Efl_Gfx_Gradient_Stop));
|
2015-04-03 07:21:49 -07:00
|
|
|
if (!pd->colors)
|
|
|
|
{
|
|
|
|
pd->colors_count = 0;
|
|
|
|
return ;
|
|
|
|
}
|
|
|
|
|
2015-04-03 07:23:16 -07:00
|
|
|
memcpy(pd->colors, colors, length * sizeof(Efl_Gfx_Gradient_Stop));
|
2015-04-03 07:21:49 -07:00
|
|
|
pd->colors_count = length;
|
2015-04-03 07:15:04 -07:00
|
|
|
}
|
|
|
|
|
2015-04-03 07:21:53 -07:00
|
|
|
static void
|
2018-04-17 11:09:44 -07:00
|
|
|
_ector_renderer_gradient_efl_gfx_gradient_stop_get(const Eo *obj EINA_UNUSED,
|
2016-05-11 04:57:06 -07:00
|
|
|
Ector_Renderer_Gradient_Data *pd,
|
2015-04-03 07:30:35 -07:00
|
|
|
const Efl_Gfx_Gradient_Stop **colors,
|
|
|
|
unsigned int *length)
|
2015-04-03 07:15:04 -07:00
|
|
|
{
|
2015-04-03 07:21:49 -07:00
|
|
|
if (colors) *colors = pd->colors;
|
|
|
|
if (length) *length = pd->colors_count;
|
2015-04-03 07:15:04 -07:00
|
|
|
}
|
|
|
|
|
2015-04-03 07:21:53 -07:00
|
|
|
static void
|
2016-05-11 04:57:06 -07:00
|
|
|
_ector_renderer_gradient_efl_gfx_gradient_spread_set(Eo *obj EINA_UNUSED,
|
|
|
|
Ector_Renderer_Gradient_Data *pd,
|
2015-04-03 07:30:35 -07:00
|
|
|
Efl_Gfx_Gradient_Spread s)
|
2015-04-03 07:15:04 -07:00
|
|
|
{
|
2015-04-03 07:21:49 -07:00
|
|
|
pd->s = s;
|
2015-04-03 07:15:04 -07:00
|
|
|
}
|
|
|
|
|
2015-04-03 07:23:16 -07:00
|
|
|
static Efl_Gfx_Gradient_Spread
|
2018-04-17 11:09:44 -07:00
|
|
|
_ector_renderer_gradient_efl_gfx_gradient_spread_get(const Eo *obj EINA_UNUSED,
|
2016-05-11 04:57:06 -07:00
|
|
|
Ector_Renderer_Gradient_Data *pd)
|
2015-04-03 07:15:04 -07:00
|
|
|
{
|
2015-04-03 07:21:49 -07:00
|
|
|
return pd->s;
|
2015-04-03 07:15:04 -07:00
|
|
|
}
|
|
|
|
|
2018-11-14 04:51:24 -08:00
|
|
|
static void
|
|
|
|
_ector_renderer_gradient_efl_object_invalidate(Eo *obj EINA_UNUSED,
|
|
|
|
Ector_Renderer_Gradient_Data *pd)
|
|
|
|
{
|
|
|
|
if (pd->colors) free(pd->colors);
|
|
|
|
}
|
2015-04-03 07:15:04 -07:00
|
|
|
|
2016-05-11 04:57:06 -07:00
|
|
|
#include "ector_renderer_gradient.eo.c"
|