From ec6873958b2fbf820686006677da1e44647b910c Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Sun, 18 Dec 2011 22:34:51 +0000 Subject: [PATCH] fixed-layout: Use the Actor iteration API Forgot to migrate the FixedLayout layout manager like we did for the other layout managers provided by Clutter. --- clutter/clutter-fixed-layout.c | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/clutter/clutter-fixed-layout.c b/clutter/clutter-fixed-layout.c index 35d5a6ac0..3bb890ebe 100644 --- a/clutter/clutter-fixed-layout.c +++ b/clutter/clutter-fixed-layout.c @@ -53,18 +53,19 @@ clutter_fixed_layout_get_preferred_width (ClutterLayoutManager *manager, gfloat *min_width_p, gfloat *nat_width_p) { - GList *children, *l; + ClutterActor *actor, *child; gdouble min_right; gdouble natural_right; min_right = 0; natural_right = 0; - children = clutter_container_get_children (container); + actor = CLUTTER_ACTOR (container); - for (l = children; l != NULL; l = l->next) + for (child = clutter_actor_get_first_child (actor); + child != NULL; + child = clutter_actor_get_next_sibling (child)) { - ClutterActor *child = l->data; gfloat child_x, child_min, child_natural; child_x = clutter_actor_get_x (child); @@ -80,8 +81,6 @@ clutter_fixed_layout_get_preferred_width (ClutterLayoutManager *manager, natural_right = child_x + child_natural; } - g_list_free (children); - if (min_width_p) *min_width_p = min_right; @@ -96,18 +95,19 @@ clutter_fixed_layout_get_preferred_height (ClutterLayoutManager *manager, gfloat *min_height_p, gfloat *nat_height_p) { - GList *children, *l; + ClutterActor *actor, *child; gdouble min_bottom; gdouble natural_bottom; min_bottom = 0; natural_bottom = 0; - children = clutter_container_get_children (container); + actor = CLUTTER_ACTOR (container); - for (l = children; l != NULL; l = l->next) + for (child = clutter_actor_get_first_child (actor); + child != NULL; + child = clutter_actor_get_next_sibling (child)) { - ClutterActor *child = l->data; gfloat child_y, child_min, child_natural; child_y = clutter_actor_get_y (child); @@ -123,8 +123,6 @@ clutter_fixed_layout_get_preferred_height (ClutterLayoutManager *manager, natural_bottom = child_y + child_natural; } - g_list_free (children); - if (min_height_p) *min_height_p = min_bottom; @@ -138,18 +136,14 @@ clutter_fixed_layout_allocate (ClutterLayoutManager *manager, const ClutterActorBox *allocation, ClutterAllocationFlags flags) { - GList *children, *l; + ClutterActor *child; - children = clutter_container_get_children (container); - - for (l = children; l != NULL; l = l->next) + for (child = clutter_actor_get_first_child (CLUTTER_ACTOR (container)); + child != NULL; + child = clutter_actor_get_next_sibling (child)) { - ClutterActor *child = l->data; - clutter_actor_allocate_preferred_size (child, flags); } - - g_list_free (children); } void