[clutter] fixed-layout: Use the Actor iteration API
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter] fixed-layout: Use the Actor iteration API
- Date: Mon, 16 Jan 2012 23:56:14 +0000 (UTC)
commit ec6873958b2fbf820686006677da1e44647b910c
Author: Emmanuele Bassi <ebassi gnome org>
Date: Sun Dec 18 22:34:51 2011 +0000
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 files changed, 14 insertions(+), 20 deletions(-)
---
diff --git a/clutter/clutter-fixed-layout.c b/clutter/clutter-fixed-layout.c
index 35d5a6a..3bb890e 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;
-
- children = clutter_container_get_children (container);
+ ClutterActor *child;
- 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]