2015-04-03 07:12:59 -07:00
|
|
|
#ifndef EVAS_VG_PRIVATE_H_
|
|
|
|
# define EVAS_VG_PRIVATE_H_
|
|
|
|
|
2015-04-03 07:22:58 -07:00
|
|
|
#include <Ector.h>
|
|
|
|
|
2015-04-03 07:30:59 -07:00
|
|
|
typedef struct _Efl_VG_Base_Data Efl_VG_Base_Data;
|
|
|
|
typedef struct _Efl_VG_Container_Data Efl_VG_Container_Data;
|
|
|
|
typedef struct _Efl_VG_Gradient_Data Efl_VG_Gradient_Data;
|
2015-04-03 07:22:58 -07:00
|
|
|
|
2015-04-03 07:30:59 -07:00
|
|
|
struct _Efl_VG_Base_Data
|
2015-04-03 07:14:48 -07:00
|
|
|
{
|
|
|
|
Eina_Matrix3 *m;
|
2015-04-03 07:30:59 -07:00
|
|
|
Efl_VG *mask;
|
2015-04-03 07:22:58 -07:00
|
|
|
Ector_Renderer *renderer;
|
2015-04-03 07:14:48 -07:00
|
|
|
|
2015-04-03 07:30:59 -07:00
|
|
|
void (*render_pre)(Eo *obj, Eina_Matrix3 *parent, Ector_Surface *s, void *data, Efl_VG_Base_Data *nd);
|
2015-04-03 07:22:57 -07:00
|
|
|
void *data;
|
2015-04-03 07:14:48 -07:00
|
|
|
|
|
|
|
double x, y;
|
|
|
|
int r, g, b, a;
|
2015-04-03 07:22:57 -07:00
|
|
|
|
|
|
|
Eina_Bool visibility : 1;
|
|
|
|
Eina_Bool changed : 1;
|
2015-04-03 07:14:48 -07:00
|
|
|
};
|
|
|
|
|
2015-04-03 07:30:59 -07:00
|
|
|
struct _Efl_VG_Container_Data
|
2015-04-03 07:12:59 -07:00
|
|
|
{
|
|
|
|
Eina_List *children;
|
|
|
|
};
|
|
|
|
|
2015-04-03 07:30:59 -07:00
|
|
|
struct _Efl_VG_Gradient_Data
|
2015-04-03 07:22:58 -07:00
|
|
|
{
|
|
|
|
// FIXME: Later on we should deduplicate it somehow (Using Ector ?).
|
2015-04-03 07:23:16 -07:00
|
|
|
Efl_Gfx_Gradient_Stop *colors;
|
2015-04-03 07:22:58 -07:00
|
|
|
unsigned int colors_count;
|
|
|
|
|
2015-04-03 07:23:16 -07:00
|
|
|
Efl_Gfx_Gradient_Spread s;
|
2015-04-03 07:22:58 -07:00
|
|
|
};
|
|
|
|
|
2015-04-03 07:30:59 -07:00
|
|
|
static inline Efl_VG_Base_Data *
|
|
|
|
_evas_vg_render_pre(Efl_VG *child, Ector_Surface *s, Eina_Matrix3 *m)
|
2015-04-03 07:22:58 -07:00
|
|
|
{
|
2015-04-03 07:30:59 -07:00
|
|
|
Efl_VG_Base_Data *child_nd = NULL;
|
2015-04-03 07:22:58 -07:00
|
|
|
|
|
|
|
// FIXME: Prevent infinite loop
|
2015-04-03 07:23:04 -07:00
|
|
|
if (child)
|
2015-04-03 07:30:59 -07:00
|
|
|
child_nd = eo_data_scope_get(child, EFL_VG_BASE_CLASS);
|
2015-04-03 07:23:04 -07:00
|
|
|
if (child_nd)
|
|
|
|
child_nd->render_pre(child, m, s, child_nd->data, child_nd);
|
|
|
|
|
|
|
|
return child_nd;
|
2015-04-03 07:22:58 -07:00
|
|
|
}
|
|
|
|
|
2015-04-03 07:30:42 -07:00
|
|
|
static inline void
|
2015-04-03 07:30:59 -07:00
|
|
|
_efl_vg_base_changed(Eo *obj)
|
2015-04-03 07:30:42 -07:00
|
|
|
{
|
|
|
|
eo_do(obj, eo_event_callback_call(EFL_GFX_CHANGED, NULL));
|
|
|
|
}
|
|
|
|
|
2015-04-03 07:30:59 -07:00
|
|
|
#define EFL_VG_COMPUTE_MATRIX(Current, Parent, Nd) \
|
2015-04-03 07:23:03 -07:00
|
|
|
Eina_Matrix3 *Current = Nd->m; \
|
|
|
|
Eina_Matrix3 _matrix_tmp; \
|
|
|
|
\
|
|
|
|
if (Parent) \
|
|
|
|
{ \
|
|
|
|
if (Current) \
|
|
|
|
{ \
|
|
|
|
eina_matrix3_compose(Parent, Current, &_matrix_tmp); \
|
|
|
|
Current = &_matrix_tmp; \
|
|
|
|
} \
|
|
|
|
else \
|
|
|
|
{ \
|
|
|
|
Current = Parent; \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-04-03 07:12:59 -07:00
|
|
|
#endif
|