box: Use the ActorIter API

And remove a useless override of the pick() virtual function while we're
at it.

https://bugzilla.gnome.org/show_bug.cgi?id=668669
This commit is contained in:
Emmanuele Bassi 2012-01-26 17:10:18 +00:00
parent 28a9203ee9
commit bcd156e652
1 changed files with 3 additions and 20 deletions

View File

@ -128,6 +128,7 @@ clutter_box_real_get_paint_volume (ClutterActor *actor,
ClutterPaintVolume *volume)
{
gboolean retval = FALSE;
ClutterActorIter iter;
ClutterActor *child;
/* if we have a background color, and an allocation, then we need to
@ -144,9 +145,8 @@ clutter_box_real_get_paint_volume (ClutterActor *actor,
/* otherwise, union the paint volumes of our children, in case
* any one of them decides to paint outside the parent's allocation
*/
for (child = clutter_actor_get_first_child (actor);
child != NULL;
child = clutter_actor_get_next_sibling (child))
clutter_actor_iter_init (&iter, actor);
while (clutter_actor_iter_next (&iter, &child))
{
const ClutterPaintVolume *child_volume;
@ -162,22 +162,6 @@ clutter_box_real_get_paint_volume (ClutterActor *actor,
return retval;
}
static void
clutter_box_real_pick (ClutterActor *actor,
const ClutterColor *pick)
{
ClutterActor *child;
CLUTTER_ACTOR_CLASS (clutter_box_parent_class)->pick (actor, pick);
for (child = clutter_actor_get_first_child (actor);
child != NULL;
child = clutter_actor_get_next_sibling (child))
{
clutter_actor_paint (child);
}
}
static void
clutter_box_set_property (GObject *gobject,
guint prop_id,
@ -240,7 +224,6 @@ clutter_box_class_init (ClutterBoxClass *klass)
g_type_class_add_private (klass, sizeof (ClutterBoxPrivate));
actor_class->get_paint_volume = clutter_box_real_get_paint_volume;
actor_class->pick = clutter_box_real_pick;
gobject_class->set_property = clutter_box_set_property;
gobject_class->get_property = clutter_box_get_property;