mirror of
https://github.com/brl/mutter.git
synced 2025-02-23 08:24:09 +00:00
stage: Use the iterator API instead of the DOM one
Whenever we're iterating over the children of the Stage we can now use the ClutterActorIter API. https://bugzilla.gnome.org/show_bug.cgi?id=668669
This commit is contained in:
parent
58ffcfb10e
commit
c6e1491474
@ -234,17 +234,13 @@ clutter_stage_real_foreach (ClutterContainer *container,
|
|||||||
ClutterCallback callback,
|
ClutterCallback callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
ClutterActor *iter;
|
ClutterActorIter iter;
|
||||||
|
ClutterActor *child;
|
||||||
|
|
||||||
iter = clutter_actor_get_first_child (CLUTTER_ACTOR (container));
|
clutter_actor_iter_init (&iter, CLUTTER_ACTOR (container));
|
||||||
while (iter != NULL)
|
|
||||||
{
|
|
||||||
ClutterActor *next = clutter_actor_get_next_sibling (iter);
|
|
||||||
|
|
||||||
callback (iter, user_data);
|
while (clutter_actor_iter_next (&iter, &child))
|
||||||
|
callback (child, user_data);
|
||||||
iter = next;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -678,6 +674,7 @@ clutter_stage_paint (ClutterActor *self)
|
|||||||
ClutterStagePrivate *priv = CLUTTER_STAGE (self)->priv;
|
ClutterStagePrivate *priv = CLUTTER_STAGE (self)->priv;
|
||||||
CoglBufferBit clear_flags;
|
CoglBufferBit clear_flags;
|
||||||
CoglColor stage_color;
|
CoglColor stage_color;
|
||||||
|
ClutterActorIter iter;
|
||||||
ClutterActor *child;
|
ClutterActor *child;
|
||||||
guint8 real_alpha;
|
guint8 real_alpha;
|
||||||
|
|
||||||
@ -732,30 +729,25 @@ clutter_stage_paint (ClutterActor *self)
|
|||||||
cogl_disable_fog ();
|
cogl_disable_fog ();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (child = clutter_actor_get_first_child (self);
|
clutter_actor_iter_init (&iter, self);
|
||||||
child != NULL;
|
while (clutter_actor_iter_next (&iter, &child))
|
||||||
child = clutter_actor_get_next_sibling (child))
|
clutter_actor_paint (child);
|
||||||
{
|
|
||||||
clutter_actor_paint (child);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_stage_pick (ClutterActor *self,
|
clutter_stage_pick (ClutterActor *self,
|
||||||
const ClutterColor *color)
|
const ClutterColor *color)
|
||||||
{
|
{
|
||||||
|
ClutterActorIter iter;
|
||||||
ClutterActor *child;
|
ClutterActor *child;
|
||||||
|
|
||||||
/* Note: we don't chain up to our parent as we don't want any geometry
|
/* Note: we don't chain up to our parent as we don't want any geometry
|
||||||
* emitted for the stage itself. The stage's pick id is effectively handled
|
* emitted for the stage itself. The stage's pick id is effectively handled
|
||||||
* by the call to cogl_clear done in clutter-main.c:_clutter_do_pick_async()
|
* by the call to cogl_clear done in clutter-main.c:_clutter_do_pick_async()
|
||||||
*/
|
*/
|
||||||
for (child = clutter_actor_get_first_child (self);
|
clutter_actor_iter_init (&iter, self);
|
||||||
child != NULL;
|
while (clutter_actor_iter_next (&iter, &child))
|
||||||
child = clutter_actor_get_next_sibling (child))
|
clutter_actor_paint (child);
|
||||||
{
|
|
||||||
clutter_actor_paint (child);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -819,14 +811,12 @@ static void
|
|||||||
clutter_stage_show (ClutterActor *self)
|
clutter_stage_show (ClutterActor *self)
|
||||||
{
|
{
|
||||||
ClutterStagePrivate *priv = CLUTTER_STAGE (self)->priv;
|
ClutterStagePrivate *priv = CLUTTER_STAGE (self)->priv;
|
||||||
|
ClutterActorIter iter;
|
||||||
ClutterActor *child;
|
ClutterActor *child;
|
||||||
|
|
||||||
for (child = clutter_actor_get_first_child (self);
|
clutter_actor_iter_init (&iter, self);
|
||||||
child != NULL;
|
while (clutter_actor_iter_next (&iter, &child))
|
||||||
child = clutter_actor_get_next_sibling (child))
|
clutter_actor_show (child);
|
||||||
{
|
|
||||||
clutter_actor_show (child);
|
|
||||||
}
|
|
||||||
|
|
||||||
CLUTTER_ACTOR_CLASS (clutter_stage_parent_class)->show (self);
|
CLUTTER_ACTOR_CLASS (clutter_stage_parent_class)->show (self);
|
||||||
|
|
||||||
@ -842,17 +832,15 @@ static void
|
|||||||
clutter_stage_hide (ClutterActor *self)
|
clutter_stage_hide (ClutterActor *self)
|
||||||
{
|
{
|
||||||
ClutterStagePrivate *priv = CLUTTER_STAGE (self)->priv;
|
ClutterStagePrivate *priv = CLUTTER_STAGE (self)->priv;
|
||||||
|
ClutterActorIter iter;
|
||||||
ClutterActor *child;
|
ClutterActor *child;
|
||||||
|
|
||||||
g_assert (priv->impl != NULL);
|
g_assert (priv->impl != NULL);
|
||||||
_clutter_stage_window_hide (priv->impl);
|
_clutter_stage_window_hide (priv->impl);
|
||||||
|
|
||||||
for (child = clutter_actor_get_first_child (self);
|
clutter_actor_iter_init (&iter, self);
|
||||||
child != NULL;
|
while (clutter_actor_iter_next (&iter, &child))
|
||||||
child = clutter_actor_get_next_sibling (child))
|
clutter_actor_show (child);
|
||||||
{
|
|
||||||
clutter_actor_show (child);
|
|
||||||
}
|
|
||||||
|
|
||||||
CLUTTER_ACTOR_CLASS (clutter_stage_parent_class)->hide (self);
|
CLUTTER_ACTOR_CLASS (clutter_stage_parent_class)->hide (self);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user