Skip to content

Commit

Permalink
Revert "Merge pull request #1561 from dalcde/st-deprecated"
Browse files Browse the repository at this point in the history
This reverts commit d04f941, reversing
changes made to bc50928.
  • Loading branch information
clefebvre committed Apr 24, 2013
1 parent 4f7be35 commit a4c48c2
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 35 deletions.
4 changes: 2 additions & 2 deletions src/st/st-bin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions src/st/st-box-layout.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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);
}
4 changes: 2 additions & 2 deletions src/st/st-container.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
7 changes: 3 additions & 4 deletions src/st/st-entry.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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;
}

Expand All @@ -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);
}
Expand Down
3 changes: 1 addition & 2 deletions src/st/st-icon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions src/st/st-label.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

/**
Expand Down
24 changes: 12 additions & 12 deletions src/st/st-scroll-bar.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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);

Expand Down
6 changes: 3 additions & 3 deletions src/st/st-scroll-view.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/st/st-texture-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/st/st-tooltip.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
6 changes: 3 additions & 3 deletions src/st/st-widget.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit a4c48c2

Please sign in to comment.