[gnome-shell/wip/clutter-deprecation-fixes: 6/21] st-widget: Don't use deprecated APIs
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/clutter-deprecation-fixes: 6/21] st-widget: Don't use deprecated APIs
- Date: Tue, 14 Feb 2012 22:01:56 +0000 (UTC)
commit e88527cc9114abb34c571bd09d8c1342c77cb9a2
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Mon Feb 13 19:54:43 2012 -0500
st-widget: Don't use deprecated APIs
clutter_container_foreach is deprecated
https://bugzilla.gnome.org/show_bug.cgi?id=670034
src/st/st-widget.c | 33 +++++++++++++--------------------
1 files changed, 13 insertions(+), 20 deletions(-)
---
diff --git a/src/st/st-widget.c b/src/st/st-widget.c
index c5cc724..9522ec6 100644
--- a/src/st/st-widget.c
+++ b/src/st/st-widget.c
@@ -472,25 +472,20 @@ st_widget_unmap (ClutterActor *actor)
st_widget_do_hide_tooltip (self);
}
-static void notify_children_of_style_change (ClutterContainer *container);
-
static void
-notify_children_of_style_change_foreach (ClutterActor *actor,
- gpointer user_data)
+notify_children_of_style_change (ClutterActor *self)
{
- if (ST_IS_WIDGET (actor))
- st_widget_style_changed (ST_WIDGET (actor));
- else if (CLUTTER_IS_CONTAINER (actor))
- notify_children_of_style_change ((ClutterContainer *)actor);
-}
+ ClutterActorIter iter;
+ ClutterActor *actor;
-static void
-notify_children_of_style_change (ClutterContainer *container)
-{
- /* notify our children that their parent stylable has changed */
- clutter_container_foreach (container,
- notify_children_of_style_change_foreach,
- NULL);
+ clutter_actor_iter_init (&iter, self);
+ while (clutter_actor_iter_next (&iter, &actor))
+ {
+ if (ST_IS_WIDGET (actor))
+ st_widget_style_changed (ST_WIDGET (actor));
+ else
+ notify_children_of_style_change (actor);
+ }
}
static void
@@ -503,9 +498,7 @@ st_widget_real_style_changed (StWidget *self)
return;
clutter_actor_queue_redraw ((ClutterActor *) self);
-
- if (CLUTTER_IS_CONTAINER (self))
- notify_children_of_style_change ((ClutterContainer *)self);
+ notify_children_of_style_change ((ClutterActor *) self);
}
void
@@ -532,7 +525,7 @@ static void
on_theme_context_changed (StThemeContext *context,
ClutterStage *stage)
{
- notify_children_of_style_change (CLUTTER_CONTAINER (stage));
+ notify_children_of_style_change (CLUTTER_ACTOR (stage));
}
static StThemeNode *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]