From 5d2d8297e26780d95f46c77d5865c1cb77959d07 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 1 May 2009 12:31:06 +0100 Subject: [PATCH] [actor] Use foreach_with_internals() ClutterContainer provides a foreach_with_internals() vfunc for iterating over all of a container's children, be them added using the Container API or be them internal to the container itself. We should be using the foreach_with_internals() function instead of the plain foreach(). --- clutter/clutter-actor.c | 55 ++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index 28f1749d7..2231434a2 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -814,31 +814,30 @@ clutter_actor_real_map (ClutterActor *self) clutter_actor_queue_redraw (self); if (CLUTTER_IS_CONTAINER (self)) - clutter_container_foreach (CLUTTER_CONTAINER (self), - CLUTTER_CALLBACK (clutter_actor_map), - NULL); + clutter_container_foreach_with_internals (CLUTTER_CONTAINER (self), + CLUTTER_CALLBACK (clutter_actor_map), + NULL); } /** * clutter_actor_map: * @self: A #ClutterActor * - * Sets the #CLUTTER_ACTOR_MAPPED flag on the actor - * and possibly maps and realizes its children - * if they are visible. Does nothing if the + * Sets the #CLUTTER_ACTOR_MAPPED flag on the actor and possibly maps + * and realizes its children if they are visible. Does nothing if the * actor is not visible. * - * Calling this is allowed in only one case: - * you are implementing the "map" virtual function - * in an actor and you need to map the children of - * that actor. It is not necessary to call this - * if you implement #ClutterContainer because the - * default implementation will automatically map - * children of containers. + * Calling this is allowed in only one case: you are implementing the + * #ClutterActor::map virtual function in an actor and you need to map + * the children of that actor. It is not necessary to call this + * if you implement #ClutterContainer because the default implementation + * will automatically map children of containers. * * When overriding map, it is mandatory to chain up to the parent * implementation. - **/ + * + * Since: 1.0 + */ void clutter_actor_map (ClutterActor *self) { @@ -859,9 +858,9 @@ clutter_actor_real_unmap (ClutterActor *self) g_assert (CLUTTER_ACTOR_IS_MAPPED (self)); if (CLUTTER_IS_CONTAINER (self)) - clutter_container_foreach (CLUTTER_CONTAINER (self), - CLUTTER_CALLBACK (clutter_actor_unmap), - NULL); + clutter_container_foreach_with_internals (CLUTTER_CONTAINER (self), + CLUTTER_CALLBACK (clutter_actor_unmap), + NULL); CLUTTER_ACTOR_UNSET_FLAGS (self, CLUTTER_ACTOR_MAPPED); /* notify on parent mapped after potentially unmapping @@ -893,17 +892,17 @@ clutter_actor_real_unmap (ClutterActor *self) * Unsets the #CLUTTER_ACTOR_MAPPED flag on the actor and possibly * unmaps its children if they were mapped. * - * Calling this is allowed in only one case: - * you are implementing the "unmap" virtual function - * in an actor and you need to unmap the children of - * that actor. It is not necessary to call this - * if you implement #ClutterContainer because the - * default implementation will automatically unmap - * children of containers. + * Calling this is allowed in only one case: you are implementing the + * #ClutterActor::unmap virtual function in an actor and you need to + * unmap the children of that actor. It is not necessary to call this + * if you implement #ClutterContainer because the default implementation + * will automatically unmap children of containers. * * When overriding unmap, it is mandatory to chain up to the parent * implementation. - **/ + * + * Since: 1.0 + */ void clutter_actor_unmap (ClutterActor *self) { @@ -1141,9 +1140,9 @@ clutter_actor_real_unrealize (ClutterActor *self) g_assert (!CLUTTER_ACTOR_IS_MAPPED (self)); if (CLUTTER_IS_CONTAINER (self)) - clutter_container_foreach (CLUTTER_CONTAINER (self), - CLUTTER_CALLBACK (clutter_actor_unrealize_not_hiding), - NULL); + clutter_container_foreach_with_internals (CLUTTER_CONTAINER (self), + CLUTTER_CALLBACK (clutter_actor_unrealize_not_hiding), + NULL); } /**