1
0
Fork 0

clutter/actor: Remove clutter_actor_set_parent

Replace it by clutter_actor_add_child(), and update ClutterGroup
to not emit the 'actor-added' anymore.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1332
This commit is contained in:
Georges Basile Stavracas Neto 2020-06-26 14:18:10 -03:00 committed by Robert Mader
parent 0b4cf9c65f
commit 59e454f01e
4 changed files with 2 additions and 53 deletions

View file

@ -12698,12 +12698,6 @@ typedef enum
ADD_CHILD_CHECK_STATE |
ADD_CHILD_NOTIFY_FIRST_LAST |
ADD_CHILD_SHOW_ON_SET_PARENT,
/* flags for legacy/deprecated API */
ADD_CHILD_LEGACY_FLAGS = ADD_CHILD_EMIT_PARENT_SET |
ADD_CHILD_CHECK_STATE |
ADD_CHILD_NOTIFY_FIRST_LAST |
ADD_CHILD_SHOW_ON_SET_PARENT
} ClutterActorAddChildFlags;
/*< private >
@ -13084,43 +13078,6 @@ clutter_actor_insert_child_below (ClutterActor *self,
sibling);
}
/**
* clutter_actor_set_parent:
* @self: A #ClutterActor
* @parent: A new #ClutterActor parent
*
* Sets the parent of @self to @parent.
*
* This function will result in @parent acquiring a reference on @self,
* eventually by sinking its floating reference first. The reference
* will be released by clutter_actor_unparent().
*
* This function should only be called by legacy #ClutterActor<!-- -->s
* implementing the #ClutterContainer interface.
*
* Deprecated: 1.10: Use clutter_actor_add_child() instead.
*/
void
clutter_actor_set_parent (ClutterActor *self,
ClutterActor *parent)
{
g_return_if_fail (CLUTTER_IS_ACTOR (self));
g_return_if_fail (CLUTTER_IS_ACTOR (parent));
g_return_if_fail (self != parent);
g_return_if_fail (self->priv->parent == NULL);
/* as this function will be called inside ClutterContainer::add
* implementations or when building up a composite actor, we have
* to preserve the old behaviour, and not create child meta or
* emit the ::actor-added signal, to avoid recursion or double
* emissions
*/
clutter_actor_add_child_internal (parent, self,
ADD_CHILD_LEGACY_FLAGS,
insert_child_at_depth,
NULL);
}
/**
* clutter_actor_get_parent:
* @self: A #ClutterActor

View file

@ -33,10 +33,6 @@
G_BEGIN_DECLS
CLUTTER_DEPRECATED_FOR(clutter_actor_add_child)
void clutter_actor_set_parent (ClutterActor *self,
ClutterActor *parent);
CLUTTER_DEPRECATED_FOR(clutter_actor_remove_child)
void clutter_actor_unparent (ClutterActor *self);

View file

@ -105,11 +105,7 @@ clutter_group_real_add (ClutterContainer *container,
g_object_ref (actor);
priv->children = g_list_append (priv->children, actor);
clutter_actor_set_parent (actor, CLUTTER_ACTOR (container));
clutter_actor_queue_relayout (CLUTTER_ACTOR (container));
g_signal_emit_by_name (container, "actor-added", actor);
clutter_actor_add_child (CLUTTER_ACTOR (container), actor);
clutter_container_sort_depth_order (container);

View file

@ -45,7 +45,7 @@ test_destroy_add (ClutterContainer *container,
G_OBJECT_TYPE_NAME (actor));
self->children = g_list_prepend (self->children, actor);
clutter_actor_set_parent (actor, CLUTTER_ACTOR (container));
clutter_actor_add_child (CLUTTER_ACTOR (container), actor);
}
static void