[mutter/gbsneto/clutter-cleanups-part1: 4/19] clutter/actor: Remove clutter_actor_set_parent
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/gbsneto/clutter-cleanups-part1: 4/19] clutter/actor: Remove clutter_actor_set_parent
- Date: Fri, 26 Jun 2020 22:38:05 +0000 (UTC)
commit c3fb77f07ec978e3b6cfb64cc4898c07ef13d089
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Fri Jun 26 14:18:10 2020 -0300
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
clutter/clutter/clutter-actor.c | 43 ------------------------------
clutter/clutter/deprecated/clutter-actor.h | 4 ---
clutter/clutter/deprecated/clutter-group.c | 6 +----
src/tests/clutter/conform/actor-destroy.c | 2 +-
4 files changed, 2 insertions(+), 53 deletions(-)
---
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index 86e8478fd5..74e7dd7566 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -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
diff --git a/clutter/clutter/deprecated/clutter-actor.h b/clutter/clutter/deprecated/clutter-actor.h
index 1a5e018cac..f52584f996 100644
--- a/clutter/clutter/deprecated/clutter-actor.h
+++ b/clutter/clutter/deprecated/clutter-actor.h
@@ -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);
diff --git a/clutter/clutter/deprecated/clutter-group.c b/clutter/clutter/deprecated/clutter-group.c
index 08e5476e4f..3d7260e9c7 100644
--- a/clutter/clutter/deprecated/clutter-group.c
+++ b/clutter/clutter/deprecated/clutter-group.c
@@ -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);
diff --git a/src/tests/clutter/conform/actor-destroy.c b/src/tests/clutter/conform/actor-destroy.c
index 64ef94e5f6..d19bb20650 100644
--- a/src/tests/clutter/conform/actor-destroy.c
+++ b/src/tests/clutter/conform/actor-destroy.c
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]