#include <string.h>
#include <math.h>
-#define MY_CLASS EFL_VG_BASE_CLASS
+#define MY_CLASS EFL_VG_CLASS
static const Efl_VG_Interpolation interpolation_identity = {
{ 0, 0, 0, 1 },
};
static Eina_Bool
-_efl_vg_base_property_changed(void *data, const Eo_Event *event)
+_efl_vg_property_changed(void *data, const Eo_Event *event)
{
- Efl_VG_Base_Data *pd = data;
+ Efl_VG_Data *pd = data;
Eo *parent;
if (pd->changed) return EINA_TRUE;
}
static void
-_efl_vg_base_transformation_set(Eo *obj,
- Efl_VG_Base_Data *pd,
+_efl_vg_transformation_set(Eo *obj,
+ Efl_VG_Data *pd,
const Eina_Matrix3 *m)
{
if (pd->intp)
pd->m = NULL;
}
- _efl_vg_base_changed(obj);
+ _efl_vg_changed(obj);
}
const Eina_Matrix3 *
-_efl_vg_base_transformation_get(Eo *obj EINA_UNUSED, Efl_VG_Base_Data *pd)
+_efl_vg_transformation_get(Eo *obj EINA_UNUSED, Efl_VG_Data *pd)
{
return pd->m;
}
static void
-_efl_vg_base_origin_set(Eo *obj,
- Efl_VG_Base_Data *pd,
+_efl_vg_origin_set(Eo *obj,
+ Efl_VG_Data *pd,
double x, double y)
{
pd->x = x;
pd->y = y;
- _efl_vg_base_changed(obj);
+ _efl_vg_changed(obj);
}
static void
-_efl_vg_base_origin_get(Eo *obj EINA_UNUSED,
- Efl_VG_Base_Data *pd,
+_efl_vg_origin_get(Eo *obj EINA_UNUSED,
+ Efl_VG_Data *pd,
double *x, double *y)
{
if (x) *x = pd->x;
}
static void
-_efl_vg_base_efl_gfx_position_set(Eo *obj EINA_UNUSED,
- Efl_VG_Base_Data *pd,
+_efl_vg_efl_gfx_position_set(Eo *obj EINA_UNUSED,
+ Efl_VG_Data *pd,
int x, int y)
{
pd->x = lrint(x);
pd->y = lrint(y);
- _efl_vg_base_changed(obj);
+ _efl_vg_changed(obj);
}
static void
-_efl_vg_base_efl_gfx_position_get(Eo *obj EINA_UNUSED,
- Efl_VG_Base_Data *pd,
+_efl_vg_efl_gfx_position_get(Eo *obj EINA_UNUSED,
+ Efl_VG_Data *pd,
int *x, int *y)
{
if (x) *x = pd->x;
}
static void
-_efl_vg_base_efl_gfx_visible_set(Eo *obj EINA_UNUSED,
- Efl_VG_Base_Data *pd, Eina_Bool v)
+_efl_vg_efl_gfx_visible_set(Eo *obj EINA_UNUSED,
+ Efl_VG_Data *pd, Eina_Bool v)
{
pd->visibility = v;
- _efl_vg_base_changed(obj);
+ _efl_vg_changed(obj);
}
static Eina_Bool
-_efl_vg_base_efl_gfx_visible_get(Eo *obj EINA_UNUSED,
- Efl_VG_Base_Data *pd)
+_efl_vg_efl_gfx_visible_get(Eo *obj EINA_UNUSED,
+ Efl_VG_Data *pd)
{
return pd->visibility;
}
static void
-_efl_vg_base_efl_gfx_color_set(Eo *obj EINA_UNUSED,
- Efl_VG_Base_Data *pd,
+_efl_vg_efl_gfx_color_set(Eo *obj EINA_UNUSED,
+ Efl_VG_Data *pd,
int r, int g, int b, int a)
{
if (r > 255) r = 255; if (r < 0) r = 0;
pd->b = b;
pd->a = a;
- _efl_vg_base_changed(obj);
+ _efl_vg_changed(obj);
}
static Eina_Bool
-_efl_vg_base_efl_gfx_color_part_set(Eo *obj, Efl_VG_Base_Data *pd,
+_efl_vg_efl_gfx_color_part_set(Eo *obj, Efl_VG_Data *pd,
const char *part,
int r, int g, int b, int a)
{
if (part) return EINA_FALSE;
- _efl_vg_base_efl_gfx_color_set(obj, pd, r, g, b, a);
+ _efl_vg_efl_gfx_color_set(obj, pd, r, g, b, a);
return EINA_TRUE;
}
static void
-_efl_vg_base_efl_gfx_color_get(Eo *obj EINA_UNUSED,
- Efl_VG_Base_Data *pd,
+_efl_vg_efl_gfx_color_get(Eo *obj EINA_UNUSED,
+ Efl_VG_Data *pd,
int *r, int *g, int *b, int *a)
{
if (r) *r = pd->r;
}
static Eina_Bool
-_efl_vg_base_efl_gfx_color_part_get(Eo *obj, Efl_VG_Base_Data *pd,
+_efl_vg_efl_gfx_color_part_get(Eo *obj, Efl_VG_Data *pd,
const char *part,
int *r, int *g, int *b, int *a)
{
if (part) return EINA_FALSE;
- _efl_vg_base_efl_gfx_color_get(obj, pd, r, g, b, a);
+ _efl_vg_efl_gfx_color_get(obj, pd, r, g, b, a);
return EINA_TRUE;
}
static void
-_efl_vg_base_mask_set(Eo *obj EINA_UNUSED,
- Efl_VG_Base_Data *pd,
- Efl_VG_Base *r)
+_efl_vg_mask_set(Eo *obj EINA_UNUSED,
+ Efl_VG_Data *pd,
+ Efl_VG *r)
{
- Efl_VG_Base *tmp = pd->mask;
+ Efl_VG *tmp = pd->mask;
pd->mask = eo_ref(r);
eo_unref(tmp);
- _efl_vg_base_changed(obj);
+ _efl_vg_changed(obj);
}
-static Efl_VG_Base*
-_efl_vg_base_mask_get(Eo *obj EINA_UNUSED, Efl_VG_Base_Data *pd)
+static Efl_VG*
+_efl_vg_mask_get(Eo *obj EINA_UNUSED, Efl_VG_Data *pd)
{
return pd->mask;
}
static void
-_efl_vg_base_efl_gfx_size_get(Eo *obj,
- Efl_VG_Base_Data *pd EINA_UNUSED,
+_efl_vg_efl_gfx_size_get(Eo *obj,
+ Efl_VG_Data *pd EINA_UNUSED,
int *w, int *h)
{
Eina_Rectangle r = { 0, 0, 0, 0 };
// Parent should be a container otherwise dismissing the stacking operation
static Eina_Bool
-_efl_vg_base_parent_checked_get(Eo *obj,
+_efl_vg_parent_checked_get(Eo *obj,
Eo **parent,
Efl_VG_Container_Data **cd)
{
}
static Eo *
-_efl_vg_base_eo_base_constructor(Eo *obj,
- Efl_VG_Base_Data *pd)
+_efl_vg_eo_base_constructor(Eo *obj,
+ Efl_VG_Data *pd)
{
Efl_VG_Container_Data *cd = NULL;
Eo *parent;
obj = eo_constructor(eo_super(obj, MY_CLASS));
- if (!_efl_vg_base_parent_checked_get(obj, &parent, &cd)) {
+ if (!_efl_vg_parent_checked_get(obj, &parent, &cd)) {
ERR("Failed");
return NULL;
}
- eo_event_callback_add(obj, EFL_GFX_CHANGED, _efl_vg_base_property_changed, pd);
+ eo_event_callback_add(obj, EFL_GFX_CHANGED, _efl_vg_property_changed, pd);
pd->changed = EINA_TRUE;
return obj;
}
static void
-_efl_vg_base_eo_base_destructor(Eo *obj, Efl_VG_Base_Data *pd)
+_efl_vg_eo_base_destructor(Eo *obj, Efl_VG_Data *pd)
{
if (pd->m)
{
}
static void
-_efl_vg_base_name_insert(Eo *obj, Efl_VG_Base_Data *pd, Efl_VG_Container_Data *cd)
+_efl_vg_name_insert(Eo *obj, Efl_VG_Data *pd, Efl_VG_Container_Data *cd)
{
Eo *set;
}
static void
-_efl_vg_base_name_set(Eo *obj, Efl_VG_Base_Data *pd, const char *name)
+_efl_vg_name_set(Eo *obj, Efl_VG_Data *pd, const char *name)
{
Efl_VG_Container_Data *cd = NULL;
Eo *parent = NULL;
- if (_efl_vg_base_parent_checked_get(obj, &parent, &cd))
+ if (_efl_vg_parent_checked_get(obj, &parent, &cd))
{
if (pd->name) eina_hash_del(cd->names, pd->name, obj);
}
eina_stringshare_replace(&pd->name, name);
- if (cd) _efl_vg_base_name_insert(obj, pd, cd);
+ if (cd) _efl_vg_name_insert(obj, pd, cd);
}
static const char *
-_efl_vg_base_name_get(Eo *obj EINA_UNUSED, Efl_VG_Base_Data *pd)
+_efl_vg_name_get(Eo *obj EINA_UNUSED, Efl_VG_Data *pd)
{
return pd->name;
}
static void
-_efl_vg_base_eo_base_parent_set(Eo *obj,
- Efl_VG_Base_Data *pd EINA_UNUSED,
+_efl_vg_eo_base_parent_set(Eo *obj,
+ Efl_VG_Data *pd EINA_UNUSED,
Eo *parent)
{
Efl_VG_Container_Data *cd = NULL;
goto on_error;
}
- if (!_efl_vg_base_parent_checked_get(obj, &old_parent, &old_cd))
+ if (!_efl_vg_parent_checked_get(obj, &old_parent, &old_cd))
{
ERR("Can't check the old parent of %p.", obj);
goto on_error;
{
cd->children = eina_list_append(cd->children, obj);
- _efl_vg_base_name_insert(obj, pd, cd);
+ _efl_vg_name_insert(obj, pd, cd);
}
- _efl_vg_base_changed(old_parent);
- _efl_vg_base_changed(obj);
- _efl_vg_base_changed(parent);
+ _efl_vg_changed(old_parent);
+ _efl_vg_changed(obj);
+ _efl_vg_changed(parent);
return ;
}
static void
-_efl_vg_base_efl_gfx_stack_raise(Eo *obj, Efl_VG_Base_Data *pd EINA_UNUSED)
+_efl_vg_efl_gfx_stack_raise(Eo *obj, Efl_VG_Data *pd EINA_UNUSED)
{
Efl_VG_Container_Data *cd;
Eina_List *lookup, *next;
cd->children = eina_list_remove_list(cd->children, lookup);
cd->children = eina_list_append_relative_list(cd->children, obj, next);
- _efl_vg_base_changed(parent);
+ _efl_vg_changed(parent);
return ;
on_error:
}
static void
-_efl_vg_base_efl_gfx_stack_stack_above(Eo *obj,
- Efl_VG_Base_Data *pd EINA_UNUSED,
+_efl_vg_efl_gfx_stack_stack_above(Eo *obj,
+ Efl_VG_Data *pd EINA_UNUSED,
Efl_Gfx_Stack *above)
{
Efl_VG_Container_Data *cd;
cd->children = eina_list_remove_list(cd->children, lookup);
cd->children = eina_list_append_relative_list(cd->children, obj, ref);
- _efl_vg_base_changed(parent);
+ _efl_vg_changed(parent);
return ;
on_error:
}
static void
-_efl_vg_base_efl_gfx_stack_stack_below(Eo *obj,
- Efl_VG_Base_Data *pd EINA_UNUSED,
+_efl_vg_efl_gfx_stack_stack_below(Eo *obj,
+ Efl_VG_Data *pd EINA_UNUSED,
Efl_Gfx_Stack *below)
{
Efl_VG_Container_Data *cd;
cd->children = eina_list_remove_list(cd->children, lookup);
cd->children = eina_list_prepend_relative_list(cd->children, obj, ref);
- _efl_vg_base_changed(parent);
+ _efl_vg_changed(parent);
return ;
on_error:
}
static void
-_efl_vg_base_efl_gfx_stack_lower(Eo *obj, Efl_VG_Base_Data *pd EINA_UNUSED)
+_efl_vg_efl_gfx_stack_lower(Eo *obj, Efl_VG_Data *pd EINA_UNUSED)
{
Efl_VG_Container_Data *cd;
Eina_List *lookup, *prev;
cd->children = eina_list_remove_list(cd->children, lookup);
cd->children = eina_list_prepend_relative_list(cd->children, obj, prev);
- _efl_vg_base_changed(parent);
+ _efl_vg_changed(parent);
return ;
on_error:
}
static Eo *
-_efl_vg_base_root_parent_get(Eo *obj)
+_efl_vg_root_parent_get(Eo *obj)
{
Eo *parent;
parent = eo_parent_get(obj);
if (!parent) return NULL;
- return _efl_vg_base_root_parent_get(parent);
+ return _efl_vg_root_parent_get(parent);
}
static void
-_efl_vg_base_walk_down_at(Eo *root, Eina_Array *a, Eina_Rectangle *r)
+_efl_vg_walk_down_at(Eo *root, Eina_Array *a, Eina_Rectangle *r)
{
Eina_Rectangle bounds;
cd = eo_data_scope_get(root, EFL_VG_CONTAINER_CLASS);
EINA_LIST_FOREACH(cd->children, l, child)
- _efl_vg_base_walk_down_at(child, a, r);
+ _efl_vg_walk_down_at(child, a, r);
}
}
static void
-_efl_vg_base_object_at(Eo *obj, Eina_Array *a, Eina_Rectangle *r)
+_efl_vg_object_at(Eo *obj, Eina_Array *a, Eina_Rectangle *r)
{
Eo *root;
- root = _efl_vg_base_root_parent_get(obj);
+ root = _efl_vg_root_parent_get(obj);
if (!root) return ;
- _efl_vg_base_walk_down_at(root, a, r);
+ _efl_vg_walk_down_at(root, a, r);
}
static Efl_Gfx_Stack *
-_efl_vg_base_efl_gfx_stack_below_get(Eo *obj, Efl_VG_Base_Data *pd EINA_UNUSED)
+_efl_vg_efl_gfx_stack_below_get(Eo *obj, Efl_VG_Data *pd EINA_UNUSED)
{
Eina_Rectangle r;
Eina_Array a;
eina_array_step_set(&a, sizeof (Eina_Array), 8);
- _efl_vg_base_object_at(obj, &a, &r);
+ _efl_vg_object_at(obj, &a, &r);
EINA_ARRAY_ITER_NEXT(&a, i, current, iterator)
if (current == obj)
}
static Efl_Gfx_Stack *
-_efl_vg_base_efl_gfx_stack_above_get(Eo *obj, Efl_VG_Base_Data *pd EINA_UNUSED)
+_efl_vg_efl_gfx_stack_above_get(Eo *obj, Efl_VG_Data *pd EINA_UNUSED)
{
Eina_Rectangle r;
Eina_Array a;
eina_array_step_set(&a, sizeof (Eina_Array), 8);
- _efl_vg_base_object_at(obj, &a, &r);
+ _efl_vg_object_at(obj, &a, &r);
EINA_ARRAY_ITER_NEXT(&a, i, current, iterator)
if (current == obj)
}
static Efl_VG_Interpolation *
-_efl_vg_interpolation_get(Efl_VG_Base_Data *pd)
+_efl_vg_interpolation_get(Efl_VG_Data *pd)
{
Eina_Matrix4 m;
}
static Eina_Bool
-_efl_vg_base_interpolate(Eo *obj,
- Efl_VG_Base_Data *pd, const Efl_VG_Base *from, const Efl_VG_Base *to,
+_efl_vg_interpolate(Eo *obj,
+ Efl_VG_Data *pd, const Efl_VG *from, const Efl_VG *to,
double pos_map)
{
- Efl_VG_Base_Data *fromd, *tod;
+ Efl_VG_Data *fromd, *tod;
double from_map;
Eina_Bool r = EINA_TRUE;
- fromd = eo_data_scope_get(from, EFL_VG_BASE_CLASS);
- tod = eo_data_scope_get(to, EFL_VG_BASE_CLASS);
+ fromd = eo_data_scope_get(from, EFL_VG_CLASS);
+ tod = eo_data_scope_get(to, EFL_VG_CLASS);
from_map = 1.0 - pos_map;
eo_del(pd->renderer);
r &= efl_vg_interpolate(pd->mask, fromd->mask, tod->mask, pos_map);
}
- _efl_vg_base_changed(obj);
+ _efl_vg_changed(obj);
return r;
}
static void
-_efl_vg_base_dup(Eo *obj, Efl_VG_Base_Data *pd, const Efl_VG_Base *from)
+_efl_vg_dup(Eo *obj, Efl_VG_Data *pd, const Efl_VG *from)
{
Efl_VG_Container_Data *cd = NULL;
- Efl_VG_Base_Data *fromd;
+ Efl_VG_Data *fromd;
Eo *parent = NULL;
- fromd = eo_data_scope_get(from, EFL_VG_BASE_CLASS);
+ fromd = eo_data_scope_get(from, EFL_VG_CLASS);
if (pd->name != fromd->name)
{
eina_stringshare_del(pd->name);
pd->name = eina_stringshare_ref(fromd->name);
}
- _efl_vg_base_parent_checked_get(obj, &parent, &cd);
- if (cd) _efl_vg_base_name_insert(obj, pd, cd);
+ _efl_vg_parent_checked_get(obj, &parent, &cd);
+ if (cd) _efl_vg_name_insert(obj, pd, cd);
if (pd->intp)
{
pd->a = fromd->a;
pd->visibility = fromd->visibility;
- _efl_vg_base_changed(obj);
+ _efl_vg_changed(obj);
}
EAPI Eina_Bool
efl_gfx_stack_lower(obj);
}
-#include "efl_vg_base.eo.c"
+#include "efl_vg.eo.c"