forked from enlightenment/efl
evas: align naming with ector, use bounds.
This commit is contained in:
parent
65fb92831b
commit
990c088f6b
|
@ -59,14 +59,13 @@ abstract Efl.VG.Base (Eo.Base, Efl.Gfx.Base, Efl.Gfx.Stack)
|
|||
} */
|
||||
}
|
||||
methods {
|
||||
bound_get {
|
||||
bounds_get {
|
||||
/*@
|
||||
Give the bounding box in screen coordinate as being drawn.
|
||||
It will start as the control box until it is refined once the shape
|
||||
is computed.
|
||||
@since 1.14
|
||||
*/
|
||||
return: bool @warn_unused;
|
||||
params {
|
||||
@out Eina_Rectangle r; /*@ bounding box to be returned */
|
||||
}
|
||||
|
@ -90,6 +89,6 @@ abstract Efl.VG.Base (Eo.Base, Efl.Gfx.Base, Efl.Gfx.Stack)
|
|||
Efl.Gfx.Stack.stack_above;
|
||||
Efl.Gfx.Stack.raise;
|
||||
Efl.Gfx.Stack.lower;
|
||||
@virtual .bound_get;
|
||||
@virtual .bounds_get;
|
||||
}
|
||||
}
|
|
@ -4,6 +4,6 @@ class Efl.VG.Container (Efl.VG.Base)
|
|||
implements {
|
||||
Eo.Base.constructor;
|
||||
Eo.Base.destructor;
|
||||
Efl.VG.Base.bound_get;
|
||||
Efl.VG.Base.bounds_get;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ class Efl.VG.Gradient_Linear (Efl.VG.Gradient, Efl.Gfx.Gradient.Linear)
|
|||
Efl.Gfx.Gradient.Linear.start.get;
|
||||
Efl.Gfx.Gradient.Linear.end.set;
|
||||
Efl.Gfx.Gradient.Linear.end.get;
|
||||
Efl.VG.Base.bound_get;
|
||||
Efl.VG.Base.bounds_get;
|
||||
Eo.Base.constructor;
|
||||
Eo.Base.destructor;
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ class Efl.VG.Gradient_Radial (Efl.VG.Gradient, Efl.Gfx.Gradient.Radial)
|
|||
Efl.Gfx.Gradient.Radial.radius.get;
|
||||
Efl.Gfx.Gradient.Radial.focal.set;
|
||||
Efl.Gfx.Gradient.Radial.focal.get;
|
||||
Efl.VG.Base.bound_get;
|
||||
Efl.VG.Base.bounds_get;
|
||||
Eo.Base.constructor;
|
||||
Eo.Base.destructor;
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ class Efl.VG.Shape (Efl.VG.Base, Efl.Gfx.Shape)
|
|||
Efl.Gfx.Shape.stroke_join;
|
||||
Efl.Gfx.Base.color_part.set;
|
||||
Efl.Gfx.Base.color_part.get;
|
||||
Efl.VG.Base.bound_get;
|
||||
Efl.VG.Base.bounds_get;
|
||||
Eo.Base.constructor;
|
||||
Eo.Base.destructor;
|
||||
}
|
||||
|
|
|
@ -45,8 +45,8 @@ _efl_vg_container_eo_base_destructor(Eo *obj,
|
|||
eo_do_super(obj, MY_CLASS, eo_destructor());
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_efl_vg_container_efl_vg_base_bound_get(Eo *obj EINA_UNUSED,
|
||||
static void
|
||||
_efl_vg_container_efl_vg_base_bounds_get(Eo *obj EINA_UNUSED,
|
||||
Efl_VG_Container_Data *pd,
|
||||
Eina_Rectangle *r)
|
||||
{
|
||||
|
@ -55,25 +55,21 @@ _efl_vg_container_efl_vg_base_bound_get(Eo *obj EINA_UNUSED,
|
|||
Eina_List *l;
|
||||
Eo *child;
|
||||
|
||||
if (!r) return EINA_FALSE;
|
||||
|
||||
EINA_RECTANGLE_SET(&s, -1, -1, 0, 0);
|
||||
|
||||
EINA_LIST_FOREACH(pd->children, l, child)
|
||||
{
|
||||
if (first)
|
||||
{
|
||||
eo_do(child, efl_vg_bound_get(r));
|
||||
eo_do(child, efl_vg_bounds_get(r));
|
||||
first = EINA_FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
eo_do(child, efl_vg_bound_get(&s));
|
||||
eo_do(child, efl_vg_bounds_get(&s));
|
||||
eina_rectangle_union(r, &s);
|
||||
}
|
||||
}
|
||||
// returning EINA_FALSE if no bouding box was found
|
||||
return first ? EINA_FALSE : EINA_TRUE;
|
||||
}
|
||||
|
||||
EAPI Efl_VG*
|
||||
|
|
|
@ -107,8 +107,8 @@ _efl_vg_gradient_linear_eo_base_destructor(Eo *obj, Efl_VG_Gradient_Linear_Data
|
|||
eo_do_super(obj, MY_CLASS, eo_destructor());
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_efl_vg_gradient_linear_efl_vg_base_bound_get(Eo *obj, Efl_VG_Gradient_Linear_Data *pd, Eina_Rectangle *r)
|
||||
static void
|
||||
_efl_vg_gradient_linear_efl_vg_base_bounds_get(Eo *obj, Efl_VG_Gradient_Linear_Data *pd, Eina_Rectangle *r)
|
||||
{
|
||||
Efl_VG_Base_Data *nd;
|
||||
|
||||
|
@ -116,7 +116,6 @@ _efl_vg_gradient_linear_efl_vg_base_bound_get(Eo *obj, Efl_VG_Gradient_Linear_Da
|
|||
EINA_RECTANGLE_SET(r,
|
||||
nd->x + pd->start.x, nd->y + pd->start.y,
|
||||
pd->end.x - pd->start.x, pd->end.y - pd->start.x);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
|
|
@ -124,8 +124,8 @@ _efl_vg_gradient_radial_eo_base_destructor(Eo *obj,
|
|||
eo_do_super(obj, MY_CLASS, eo_destructor());
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_efl_vg_gradient_radial_efl_vg_base_bound_get(Eo *obj, Efl_VG_Gradient_Radial_Data *pd, Eina_Rectangle *r)
|
||||
static void
|
||||
_efl_vg_gradient_radial_efl_vg_base_bounds_get(Eo *obj, Efl_VG_Gradient_Radial_Data *pd, Eina_Rectangle *r)
|
||||
{
|
||||
Efl_VG_Base_Data *nd;
|
||||
|
||||
|
@ -134,7 +134,6 @@ _efl_vg_gradient_radial_efl_vg_base_bound_get(Eo *obj, Efl_VG_Gradient_Radial_Da
|
|||
nd->x + pd->center.x - pd->radius,
|
||||
nd->y + pd->center.y - pd->radius,
|
||||
pd->radius * 2, pd->radius * 2);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
|
|
@ -191,11 +191,11 @@ _efl_vg_base_efl_gfx_base_size_get(Eo *obj,
|
|||
Efl_VG_Base_Data *pd EINA_UNUSED,
|
||||
int *w, int *h)
|
||||
{
|
||||
Eina_Rectangle bound = { 0, 0, 0, 0 };
|
||||
Eina_Rectangle r = { 0, 0, 0, 0 };
|
||||
|
||||
eo_do(obj, efl_vg_bound_get(&bound));
|
||||
if (w) *w = bound.w;
|
||||
if (h) *h = bound.h;
|
||||
eo_do(obj, efl_vg_bounds_get(&r));
|
||||
if (w) *w = r.w;
|
||||
if (h) *h = r.h;
|
||||
}
|
||||
|
||||
// Parent should be a container otherwise dismissing the stacking operation
|
||||
|
@ -425,10 +425,10 @@ _efl_vg_base_root_parent_get(Eo *obj)
|
|||
static void
|
||||
_efl_vg_base_walk_down_at(Eo *root, Eina_Array *a, Eina_Rectangle *r)
|
||||
{
|
||||
Eina_Rectangle bound;
|
||||
Eina_Rectangle bounds;
|
||||
|
||||
eo_do(root, efl_vg_bound_get(&bound));
|
||||
if (!eina_rectangles_intersect(&bound, r)) return ;
|
||||
eo_do(root, efl_vg_bounds_get(&bounds));
|
||||
if (!eina_rectangles_intersect(&bounds, r)) return ;
|
||||
|
||||
eina_array_push(a, root);
|
||||
|
||||
|
@ -465,7 +465,7 @@ _efl_vg_base_efl_gfx_stack_below_get(Eo *obj, Efl_VG_Base_Data *pd EINA_UNUSED)
|
|||
Eina_Array_Iterator iterator;
|
||||
unsigned int i;
|
||||
|
||||
eo_do(obj, efl_vg_bound_get(&r));
|
||||
eo_do(obj, efl_vg_bounds_get(&r));
|
||||
|
||||
eina_array_step_set(&a, sizeof (Eina_Array), 8);
|
||||
|
||||
|
@ -497,7 +497,7 @@ _efl_vg_base_efl_gfx_stack_above_get(Eo *obj, Efl_VG_Base_Data *pd EINA_UNUSED)
|
|||
Eina_Array_Iterator iterator;
|
||||
unsigned int i;
|
||||
|
||||
eo_do(obj, efl_vg_bound_get(&r));
|
||||
eo_do(obj, efl_vg_bounds_get(&r));
|
||||
|
||||
eina_array_step_set(&a, sizeof (Eina_Array), 8);
|
||||
|
||||
|
|
|
@ -28,14 +28,13 @@ struct _Efl_VG_Shape_Data
|
|||
} stroke;
|
||||
};
|
||||
|
||||
static Eina_Bool
|
||||
_efl_vg_shape_efl_vg_base_bound_get(Eo *obj,
|
||||
static void
|
||||
_efl_vg_shape_efl_vg_base_bounds_get(Eo *obj,
|
||||
Efl_VG_Shape_Data *pd EINA_UNUSED,
|
||||
Eina_Rectangle *r)
|
||||
{
|
||||
// FIXME: Use the renderer bounding box when it has been created instead of an estimation
|
||||
eo_do(obj, efl_gfx_shape_bounding_box_get(r));
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in New Issue