[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().
This commit is contained in:
parent
e260296cb5
commit
5d2d8297e2
@ -814,7 +814,7 @@ clutter_actor_real_map (ClutterActor *self)
|
||||
clutter_actor_queue_redraw (self);
|
||||
|
||||
if (CLUTTER_IS_CONTAINER (self))
|
||||
clutter_container_foreach (CLUTTER_CONTAINER (self),
|
||||
clutter_container_foreach_with_internals (CLUTTER_CONTAINER (self),
|
||||
CLUTTER_CALLBACK (clutter_actor_map),
|
||||
NULL);
|
||||
}
|
||||
@ -823,22 +823,21 @@ clutter_actor_real_map (ClutterActor *self)
|
||||
* 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,7 +858,7 @@ 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_container_foreach_with_internals (CLUTTER_CONTAINER (self),
|
||||
CLUTTER_CALLBACK (clutter_actor_unmap),
|
||||
NULL);
|
||||
|
||||
@ -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,7 +1140,7 @@ 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_container_foreach_with_internals (CLUTTER_CONTAINER (self),
|
||||
CLUTTER_CALLBACK (clutter_actor_unrealize_not_hiding),
|
||||
NULL);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user