From 186d5698ceb32e3b99d52390e29c5609fa3a8ae2 Mon Sep 17 00:00:00 2001 From: Chris Lord Date: Tue, 26 Oct 2010 17:09:24 +0100 Subject: [PATCH] actor: Use the internal child list for map/unmap Use the internal child list for the default map/unmap vfuncs. This removes the requirement for non-container composite actors to implement their own map/unmap functions. --- clutter/clutter-actor.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index 194793f30..9acb8aeb1 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -1031,6 +1031,8 @@ clutter_actor_update_map_state (ClutterActor *self, static void clutter_actor_real_map (ClutterActor *self) { + GList *c; + g_assert (!CLUTTER_ACTOR_IS_MAPPED (self)); CLUTTER_ACTOR_SET_FLAGS (self, CLUTTER_ACTOR_MAPPED); @@ -1040,10 +1042,11 @@ clutter_actor_real_map (ClutterActor *self) */ _clutter_notify_by_pspec (G_OBJECT (self), obj_props[PROP_MAPPED]); - if (CLUTTER_IS_CONTAINER (self)) - clutter_container_foreach_with_internals (CLUTTER_CONTAINER (self), - CLUTTER_CALLBACK (clutter_actor_map), - NULL); + for (c = self->priv->children; c; c = c->next) + { + ClutterActor *child = c->data; + clutter_actor_map (child); + } } /** @@ -1082,12 +1085,15 @@ clutter_actor_map (ClutterActor *self) static void clutter_actor_real_unmap (ClutterActor *self) { + GList *c; + g_assert (CLUTTER_ACTOR_IS_MAPPED (self)); - if (CLUTTER_IS_CONTAINER (self)) - clutter_container_foreach_with_internals (CLUTTER_CONTAINER (self), - CLUTTER_CALLBACK (clutter_actor_unmap), - NULL); + for (c = self->priv->children; c; c = c->next) + { + ClutterActor *child = c->data; + clutter_actor_unmap (child); + } CLUTTER_ACTOR_UNSET_FLAGS (self, CLUTTER_ACTOR_MAPPED);