From a4c48c24116b001524969b15888cfb82e43d10de Mon Sep 17 00:00:00 2001 From: Clement Lefebvre Date: Wed, 24 Apr 2013 13:58:15 +0100 Subject: [PATCH] Revert "Merge pull request #1561 from dalcde/st-deprecated" This reverts commit d04f941a117d2c200093462b938c7705b9534c9f, reversing changes made to bc50928f92d42b60cfef9bafbb67a76de316fe75. --- src/st/st-bin.c | 4 ++-- src/st/st-box-layout.c | 4 ++-- src/st/st-container.c | 4 ++-- src/st/st-entry.c | 7 +++---- src/st/st-icon.c | 3 +-- src/st/st-label.c | 3 +-- src/st/st-scroll-bar.c | 24 ++++++++++++------------ src/st/st-scroll-view.c | 6 +++--- src/st/st-texture-cache.c | 2 +- src/st/st-tooltip.c | 4 ++-- src/st/st-widget.c | 6 +++--- 11 files changed, 32 insertions(+), 35 deletions(-) diff --git a/src/st/st-bin.c b/src/st/st-bin.c index 90330186d3..af6c2f7dd5 100644 --- a/src/st/st-bin.c +++ b/src/st/st-bin.c @@ -462,7 +462,7 @@ st_bin_set_child (StBin *bin, g_object_ref (old_child); priv->child = NULL; - clutter_actor_remove_child (CLUTTER_ACTOR (bin), old_child); + clutter_actor_unparent (old_child); g_signal_emit_by_name (bin, "actor-removed", old_child); @@ -472,7 +472,7 @@ st_bin_set_child (StBin *bin, if (child) { priv->child = child; - clutter_actor_add_child (CLUTTER_ACTOR (bin), child); + clutter_actor_set_parent (child, CLUTTER_ACTOR (bin)); g_signal_emit_by_name (bin, "actor-added", priv->child); } diff --git a/src/st/st-box-layout.c b/src/st/st-box-layout.c index 9757012662..5f9f63931e 100644 --- a/src/st/st-box-layout.c +++ b/src/st/st-box-layout.c @@ -1252,7 +1252,7 @@ st_box_layout_insert_actor (StBoxLayout *self, ClutterActor *actor, int pos) { - clutter_actor_add_child (CLUTTER_ACTOR (self), actor); + clutter_container_add_actor((ClutterContainer*) self, actor); st_container_move_child (ST_CONTAINER (self), actor, pos); } @@ -1273,6 +1273,6 @@ st_box_layout_insert_before (StBoxLayout *self, { g_return_if_fail (ST_IS_BOX_LAYOUT (self)); - clutter_actor_add_child(CLUTTER_ACTOR (self), actor); + clutter_container_add_actor(CLUTTER_CONTAINER (self), actor); st_container_move_before (ST_CONTAINER (self), actor, sibling); } diff --git a/src/st/st-container.c b/src/st/st-container.c index 389b0ead9a..c2494079c4 100644 --- a/src/st/st-container.c +++ b/src/st/st-container.c @@ -241,7 +241,7 @@ st_container_add (ClutterContainer *container, g_object_ref (actor); priv->children = g_list_append (priv->children, actor); - clutter_actor_add_child (CLUTTER_ACTOR (container), actor); + clutter_actor_set_parent (actor, CLUTTER_ACTOR (container)); /* queue a relayout, to get the correct positioning inside * the ::actor-added signal handlers @@ -265,7 +265,7 @@ st_container_remove (ClutterContainer *container, g_object_ref (actor); priv->children = g_list_remove (priv->children, actor); - clutter_actor_remove_child (CLUTTER_ACTOR (container), actor); + clutter_actor_unparent (actor); /* queue a relayout, to get the correct positioning inside * the ::actor-removed signal handlers diff --git a/src/st/st-entry.c b/src/st/st-entry.c index a3cc83ddf4..8d5f1ba850 100644 --- a/src/st/st-entry.c +++ b/src/st/st-entry.c @@ -744,8 +744,7 @@ st_entry_init (StEntry *entry) priv->spacing = 6.0f; - clutter_actor_add_child (CLUTTER_ACTOR (entry), - priv->entry); + clutter_actor_set_parent (priv->entry, CLUTTER_ACTOR (entry)); clutter_actor_set_reactive ((ClutterActor *) entry, TRUE); /* set cursor hidden until we receive focus */ @@ -922,7 +921,7 @@ _st_entry_set_icon (StEntry *entry, g_signal_handlers_disconnect_by_func (*icon, _st_entry_icon_press_cb, entry); - clutter_actor_remove_child (CLUTTER_ACTOR (entry), *icon); + clutter_actor_unparent (*icon); *icon = NULL; } @@ -931,7 +930,7 @@ _st_entry_set_icon (StEntry *entry, *icon = g_object_ref (new_icon); clutter_actor_set_reactive (*icon, TRUE); - clutter_actor_add_child (CLUTTER_ACTOR (entry), *icon); + clutter_actor_set_parent (*icon, CLUTTER_ACTOR (entry)); g_signal_connect (*icon, "button-release-event", G_CALLBACK (_st_entry_icon_press_cb), entry); } diff --git a/src/st/st-icon.c b/src/st/st-icon.c index 9f4ff4a30e..2569573247 100644 --- a/src/st/st-icon.c +++ b/src/st/st-icon.c @@ -439,8 +439,7 @@ st_icon_finish_update (StIcon *icon) { priv->icon_texture = priv->pending_texture; priv->pending_texture = NULL; - clutter_actor_add_child (CLUTTER_ACTOR (icon), - priv->icon_texture); + clutter_actor_set_parent (priv->icon_texture, CLUTTER_ACTOR (icon)); /* Remove the temporary ref we added */ g_object_unref (priv->icon_texture); diff --git a/src/st/st-label.c b/src/st/st-label.c index 9388c5610c..7cbb45da82 100644 --- a/src/st/st-label.c +++ b/src/st/st-label.c @@ -304,8 +304,7 @@ st_label_init (StLabel *label) label->priv->shadow_width = -1.; label->priv->shadow_height = -1.; - clutter_actor_add_child (CLUTTER_ACTOR(label), - priv->label); + clutter_actor_set_parent (priv->label, CLUTTER_ACTOR (label)); } /** diff --git a/src/st/st-scroll-bar.c b/src/st/st-scroll-bar.c index e1e27caec0..4e88170c9f 100644 --- a/src/st/st-scroll-bar.c +++ b/src/st/st-scroll-bar.c @@ -186,25 +186,25 @@ st_scroll_bar_dispose (GObject *gobject) g_signal_handlers_disconnect_by_func (priv->handle, G_CALLBACK (handle_button_press_event_cb), bar); - clutter_actor_remove_child (CLUTTER_ACTOR (bar), priv->handle); + clutter_actor_unparent (priv->handle); priv->handle = NULL; } if (priv->bw_stepper) { - clutter_actor_remove_child (CLUTTER_ACTOR (bar), priv->bw_stepper); + clutter_actor_unparent (priv->bw_stepper); priv->bw_stepper = NULL; } if (priv->fw_stepper) { - clutter_actor_remove_child (CLUTTER_ACTOR (bar), priv->fw_stepper); + clutter_actor_unparent (priv->fw_stepper); priv->fw_stepper = NULL; } if (priv->trough) { - clutter_actor_remove_child (CLUTTER_ACTOR (bar), priv->trough); + clutter_actor_unparent (priv->trough); priv->trough = NULL; } @@ -1138,8 +1138,8 @@ st_scroll_bar_init (StScrollBar *self) self->priv->bw_stepper = (ClutterActor *) st_button_new (); clutter_actor_set_name (CLUTTER_ACTOR (self->priv->bw_stepper), "backward-stepper"); - clutter_actor_add_child (CLUTTER_ACTOR (self), - CLUTTER_ACTOR (self->priv->bw_stepper)); + clutter_actor_set_parent (CLUTTER_ACTOR (self->priv->bw_stepper), + CLUTTER_ACTOR (self)); g_signal_connect (self->priv->bw_stepper, "button-press-event", G_CALLBACK (stepper_button_press_event_cb), self); g_signal_connect (self->priv->bw_stepper, "button-release-event", @@ -1148,8 +1148,8 @@ st_scroll_bar_init (StScrollBar *self) self->priv->fw_stepper = (ClutterActor *) st_button_new (); clutter_actor_set_name (CLUTTER_ACTOR (self->priv->fw_stepper), "forward-stepper"); - clutter_actor_add_child (CLUTTER_ACTOR (self), - CLUTTER_ACTOR (self->priv->fw_stepper)); + clutter_actor_set_parent (CLUTTER_ACTOR (self->priv->fw_stepper), + CLUTTER_ACTOR (self)); g_signal_connect (self->priv->fw_stepper, "button-press-event", G_CALLBACK (stepper_button_press_event_cb), self); g_signal_connect (self->priv->fw_stepper, "button-release-event", @@ -1158,8 +1158,8 @@ st_scroll_bar_init (StScrollBar *self) self->priv->trough = (ClutterActor *) st_bin_new (); clutter_actor_set_reactive ((ClutterActor *) self->priv->trough, TRUE); clutter_actor_set_name (CLUTTER_ACTOR (self->priv->trough), "trough"); - clutter_actor_add_child (CLUTTER_ACTOR (self), - CLUTTER_ACTOR (self->priv->trough)); + clutter_actor_set_parent (CLUTTER_ACTOR (self->priv->trough), + CLUTTER_ACTOR (self)); g_signal_connect (self->priv->trough, "button-press-event", G_CALLBACK (trough_button_press_event_cb), self); g_signal_connect (self->priv->trough, "button-release-event", @@ -1169,8 +1169,8 @@ st_scroll_bar_init (StScrollBar *self) self->priv->handle = (ClutterActor *) st_button_new (); clutter_actor_set_name (CLUTTER_ACTOR (self->priv->handle), "hhandle"); - clutter_actor_add_child (self->priv->trough, - CLUTTER_ACTOR (self->priv->handle)); + clutter_actor_set_parent (CLUTTER_ACTOR (self->priv->handle), + self->priv->trough); g_signal_connect (self->priv->handle, "button-press-event", G_CALLBACK (handle_button_press_event_cb), self); diff --git a/src/st/st-scroll-view.c b/src/st/st-scroll-view.c index d2d7cb9afa..6aea1de928 100644 --- a/src/st/st-scroll-view.c +++ b/src/st/st-scroll-view.c @@ -1006,8 +1006,8 @@ st_scroll_view_init (StScrollView *self) "vertical", TRUE, NULL); - clutter_actor_add_child (CLUTTER_ACTOR (self), priv->hscroll); - clutter_actor_add_child (CLUTTER_ACTOR (self), priv->vscroll); + clutter_actor_set_parent (priv->hscroll, CLUTTER_ACTOR (self)); + clutter_actor_set_parent (priv->vscroll, CLUTTER_ACTOR (self)); /* mouse scroll is enabled by default, so we also need to be reactive */ priv->mouse_scroll = TRUE; @@ -1074,7 +1074,7 @@ st_scroll_view_remove (ClutterContainer *container, else g_assert ("Unknown child removed from StScrollView"); - clutter_actor_remove_child (CLUTTER_ACTOR (container), actor); + clutter_actor_unparent (actor); } } diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c index f6f7c6caac..5b9bb4dfe5 100644 --- a/src/st/st-texture-cache.c +++ b/src/st/st-texture-cache.c @@ -1313,7 +1313,7 @@ on_sliced_image_loaded (GObject *source_object, { ClutterActor *actor = load_from_pixbuf (GDK_PIXBUF (list->data)); clutter_actor_hide (actor); - clutter_actor_add_child (CLUTTER_ACTOR (data->group), actor); + clutter_container_add_actor (CLUTTER_CONTAINER (data->group), actor); } } diff --git a/src/st/st-tooltip.c b/src/st/st-tooltip.c index 1df4fbbce9..063ad379fc 100644 --- a/src/st/st-tooltip.c +++ b/src/st/st-tooltip.c @@ -269,8 +269,8 @@ st_tooltip_init (StTooltip *tooltip) tooltip->priv->tip_area = NULL; - clutter_actor_add_child (CLUTTER_ACTOR (tooltip), - CLUTTER_ACTOR (tooltip->priv->label)); + clutter_actor_set_parent (CLUTTER_ACTOR (tooltip->priv->label), + CLUTTER_ACTOR (tooltip)); g_object_set (tooltip, "show-on-set-parent", FALSE, NULL); diff --git a/src/st/st-widget.c b/src/st/st-widget.c index 0ed09b61b0..1ee0d6a2be 100644 --- a/src/st/st-widget.c +++ b/src/st/st-widget.c @@ -1586,9 +1586,9 @@ st_widget_ensure_tooltip_parented (StWidget *widget, ClutterStage *stage) if (G_UNLIKELY (parent != CLUTTER_ACTOR (ui_root))) { if (parent) - clutter_actor_remove_child (CLUTTER_ACTOR (parent), tooltip); + clutter_container_remove_actor (CLUTTER_CONTAINER (parent), tooltip); - clutter_actor_add_child (CLUTTER_ACTOR (ui_root), tooltip); + clutter_container_add_actor (ui_root, tooltip); } } @@ -1745,7 +1745,7 @@ st_widget_do_show_tooltip (StWidget *widget) { tooltip = CLUTTER_ACTOR (widget->priv->tooltip); st_widget_ensure_tooltip_parented (widget, CLUTTER_STAGE (stage)); - clutter_actor_set_child_above_sibling (stage, tooltip, NULL); + clutter_actor_raise (tooltip, NULL); clutter_actor_show_all (tooltip); } }