forked from enlightenment/efl
evas: Move move_children_relative to legacy only
While this kind of API seems to make sense with smart objects (relative coordinates), it is currently not used apart from the smart object class itself. So, for now, I'm moving this to legacy to clean up Efl.Canvas.Group and we can later add the equivalent in a clean "group" API.
This commit is contained in:
parent
97c9fa64a4
commit
a0b8408021
|
@ -45,21 +45,6 @@ class Efl.Canvas.Group (Efl.Canvas.Object)
|
|||
]]
|
||||
legacy: evas_object_smart_changed;
|
||||
}
|
||||
group_children_move {
|
||||
[[Move all children of this object using relative coordinates.
|
||||
|
||||
This will make each children move, from where they before, by
|
||||
a certain delta (offsets) in both directions.
|
||||
|
||||
Note: Clipped smart objects already make use of this function on
|
||||
their $move smart function definition.
|
||||
]]
|
||||
params {
|
||||
@in dx: int; [[Horizontal offset (delta).]]
|
||||
@in dy: int; [[Vertical offset (delta).]]
|
||||
}
|
||||
legacy: evas_object_smart_move_children_relative;
|
||||
}
|
||||
group_calculate {
|
||||
[[Triggers an immediate recalculation of this object's geometry.
|
||||
|
||||
|
|
|
@ -594,6 +594,28 @@ _efl_canvas_group_efl_object_constructor(Eo *eo_obj, Evas_Smart_Data *class_data
|
|||
return eo_obj;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
evas_object_smart_move_children_relative(Eo *eo_obj, Evas_Coord dx, Evas_Coord dy)
|
||||
{
|
||||
Evas_Object_Protected_Data *child;
|
||||
const Eina_Inlist *lst;
|
||||
|
||||
if ((dx == 0) && (dy == 0)) return;
|
||||
if (!efl_isa(eo_obj, MY_CLASS)) return;
|
||||
|
||||
lst = evas_object_smart_members_get_direct(eo_obj);
|
||||
EINA_INLIST_FOREACH(lst, child)
|
||||
{
|
||||
Evas_Coord orig_x, orig_y;
|
||||
|
||||
if (child->delete_me) continue;
|
||||
if (child->is_static_clip) continue;
|
||||
orig_x = child->cur->geometry.x;
|
||||
orig_y = child->cur->geometry.y;
|
||||
evas_object_move(child->object, orig_x + dx, orig_y + dy);
|
||||
}
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_canvas_group_group_add(Eo *eo_obj, Evas_Smart_Data *o EINA_UNUSED)
|
||||
{
|
||||
|
|
|
@ -12,29 +12,6 @@
|
|||
CSO_DATA_GET(eo_obj, ptr) \
|
||||
if (!ptr) return;
|
||||
|
||||
EOLIAN void
|
||||
_efl_canvas_group_group_children_move(Eo *eo_obj, Evas_Object_Protected_Data *obj EINA_UNUSED, Evas_Coord dx, Evas_Coord dy)
|
||||
{
|
||||
|
||||
const Eina_Inlist *lst;
|
||||
Evas_Object_Protected_Data *child;
|
||||
|
||||
if ((dx == 0) && (dy == 0))
|
||||
return;
|
||||
|
||||
lst = evas_object_smart_members_get_direct(eo_obj);
|
||||
EINA_INLIST_FOREACH(lst, child)
|
||||
{
|
||||
Evas_Coord orig_x, orig_y;
|
||||
|
||||
if (child->delete_me) continue;
|
||||
if (child->is_static_clip) continue;
|
||||
orig_x = child->cur->geometry.x;
|
||||
orig_y = child->cur->geometry.y;
|
||||
evas_object_move(child->object, orig_x + dx, orig_y + dy);
|
||||
}
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
evas_object_smart_clipped_clipper_get(const Evas_Object *eo_obj)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue