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 c6e1491474
commit 5c9c5d24b2

View File

@ -128,6 +128,7 @@ clutter_box_real_get_paint_volume (ClutterActor *actor,
ClutterPaintVolume *volume) ClutterPaintVolume *volume)
{ {
gboolean retval = FALSE; gboolean retval = FALSE;
ClutterActorIter iter;
ClutterActor *child; ClutterActor *child;
/* if we have a background color, and an allocation, then we need to /* 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 /* otherwise, union the paint volumes of our children, in case
* any one of them decides to paint outside the parent's allocation * any one of them decides to paint outside the parent's allocation
*/ */
for (child = clutter_actor_get_first_child (actor); clutter_actor_iter_init (&iter, actor);
child != NULL; while (clutter_actor_iter_next (&iter, &child))
child = clutter_actor_get_next_sibling (child))
{ {
const ClutterPaintVolume *child_volume; const ClutterPaintVolume *child_volume;
@ -162,22 +162,6 @@ clutter_box_real_get_paint_volume (ClutterActor *actor,
return retval; 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 static void
clutter_box_set_property (GObject *gobject, clutter_box_set_property (GObject *gobject,
guint prop_id, guint prop_id,
@ -257,7 +241,6 @@ clutter_box_class_init (ClutterBoxClass *klass)
actor_class->destroy = clutter_box_real_destroy; actor_class->destroy = clutter_box_real_destroy;
actor_class->get_paint_volume = clutter_box_real_get_paint_volume; 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->set_property = clutter_box_set_property;
gobject_class->get_property = clutter_box_get_property; gobject_class->get_property = clutter_box_get_property;