From c42fa34b0145f8f6c1a8f3b418e898a6fee3c14f Mon Sep 17 00:00:00 2001 From: Zander Brown Date: Tue, 14 Nov 2023 09:47:18 +0000 Subject: [PATCH] clutter/actor: Rename ::actor-{added,removed} to ::child-{added,removed} Part-of: --- clutter/clutter/cally/cally-actor.c | 4 +- clutter/clutter/cally/cally-actor.h | 10 ++-- clutter/clutter/clutter-actor.c | 62 ++++++++++++------------- clutter/clutter/clutter-actor.h | 4 +- src/tests/clutter/conform/actor-graph.c | 12 ++--- 5 files changed, 45 insertions(+), 47 deletions(-) diff --git a/clutter/clutter/cally/cally-actor.c b/clutter/clutter/cally/cally-actor.c index cf5431225..564740730 100644 --- a/clutter/clutter/cally/cally-actor.c +++ b/clutter/clutter/cally/cally-actor.c @@ -240,13 +240,13 @@ cally_actor_initialize (AtkObject *obj, * need to remove these handlers. */ handler_id = g_signal_connect (actor, - "actor-added", + "child-added", G_CALLBACK (cally_actor_add_actor), obj); g_object_set_data (G_OBJECT (obj), "cally-add-handler-id", GUINT_TO_POINTER (handler_id)); handler_id = g_signal_connect (actor, - "actor-removed", + "child-removed", G_CALLBACK (cally_actor_remove_actor), obj); g_object_set_data (G_OBJECT (obj), "cally-remove-handler-id", diff --git a/clutter/clutter/cally/cally-actor.h b/clutter/clutter/cally/cally-actor.h index 3ce21be60..1f7d0491c 100644 --- a/clutter/clutter/cally/cally-actor.h +++ b/clutter/clutter/cally/cally-actor.h @@ -61,8 +61,8 @@ typedef void (* CallyActionFunc) (CallyActor *cally_actor); * * Action function, to be used on #AtkAction implementations as * an individual action. - * - * Unlike #CallyActionFunc, this function uses the @user_data + * + * Unlike #CallyActionFunc, this function uses the @user_data * argument passed to [method@Actor.add_action_full]. */ typedef void (* CallyActionCallback) (CallyActor *cally_actor, @@ -79,10 +79,8 @@ struct _CallyActor /** * CallyActorClass: * @notify_clutter: Signal handler for notify signal on Clutter actor - * @add_actor: Signal handler for actor-added signal on - * ClutterContainer interface - * @remove_actor: Signal handler for actor-added signal on - * ClutterContainer interface + * @add_actor: Signal handler for child-added signal on Clutter actor + * @remove_actor: Signal handler for child-removed signal on Clutter actor * * The CallyActorClass structure contains * only private data diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c index 41a80e894..0e19b4a76 100644 --- a/clutter/clutter/clutter-actor.c +++ b/clutter/clutter/clutter-actor.c @@ -103,10 +103,10 @@ * clutter_actor_get_children(), as well as retrieving a specific child at a * given index by using clutter_actor_get_child_at_index(). * - * If you need to track additions of children to a #ClutterActor, use - * the #ClutterActor::actor-added signal; similarly, to track removals - * of children from a ClutterActor, use the #ClutterActor::actor-removed - * signal. + * If you need to track additions of children to a [type@Clutter.Actor], use + * the [signal@Clutter.Actor::child-added] signal; similarly, to track + * removals of children from a ClutterActor, use the + * [signal@Clutter.Actor::child-removed] signal. * * See [basic-actor.c](https://git.gnome.org/browse/clutter/tree/examples/basic-actor.c?h=clutter-1.18). * @@ -926,8 +926,8 @@ enum TRANSITION_STOPPED, STAGE_VIEWS_CHANGED, RESOURCE_SCALE_CHANGED, - ACTOR_ADDED, - ACTOR_REMOVED, + CHILD_ADDED, + CHILD_REMOVED, CLONED, DECLONED, @@ -4087,7 +4087,7 @@ typedef enum { REMOVE_CHILD_DESTROY_META = 1 << 0, REMOVE_CHILD_EMIT_PARENT_SET = 1 << 1, - REMOVE_CHILD_EMIT_ACTOR_REMOVED = 1 << 2, + REMOVE_CHILD_EMIT_CHILD_REMOVED = 1 << 2, REMOVE_CHILD_CHECK_STATE = 1 << 3, REMOVE_CHILD_NOTIFY_FIRST_LAST = 1 << 4, REMOVE_CHILD_STOP_TRANSITIONS = 1 << 5, @@ -4097,7 +4097,7 @@ typedef enum REMOVE_CHILD_DEFAULT_FLAGS = REMOVE_CHILD_STOP_TRANSITIONS | REMOVE_CHILD_DESTROY_META | REMOVE_CHILD_EMIT_PARENT_SET | - REMOVE_CHILD_EMIT_ACTOR_REMOVED | + REMOVE_CHILD_EMIT_CHILD_REMOVED | REMOVE_CHILD_CHECK_STATE | REMOVE_CHILD_NOTIFY_FIRST_LAST | REMOVE_CHILD_CLEAR_STAGE_VIEWS, @@ -4117,7 +4117,7 @@ clutter_actor_remove_child_internal (ClutterActor *self, ClutterActorRemoveChildFlags flags) { ClutterActor *old_first, *old_last; - gboolean destroy_meta, emit_parent_set, emit_actor_removed, check_state; + gboolean destroy_meta, emit_parent_set, emit_child_removed, check_state; gboolean notify_first_last; gboolean stop_transitions; gboolean clear_stage_views; @@ -4132,7 +4132,7 @@ clutter_actor_remove_child_internal (ClutterActor *self, destroy_meta = (flags & REMOVE_CHILD_DESTROY_META) != 0; emit_parent_set = (flags & REMOVE_CHILD_EMIT_PARENT_SET) != 0; - emit_actor_removed = (flags & REMOVE_CHILD_EMIT_ACTOR_REMOVED) != 0; + emit_child_removed = (flags & REMOVE_CHILD_EMIT_CHILD_REMOVED) != 0; check_state = (flags & REMOVE_CHILD_CHECK_STATE) != 0; notify_first_last = (flags & REMOVE_CHILD_NOTIFY_FIRST_LAST) != 0; stop_transitions = (flags & REMOVE_CHILD_STOP_TRANSITIONS) != 0; @@ -4198,8 +4198,8 @@ clutter_actor_remove_child_internal (ClutterActor *self, g_signal_emit (child, actor_signals[PARENT_SET], 0, self); /* we need to emit the signal before dropping the reference */ - if (emit_actor_removed) - g_signal_emit (self, actor_signals[ACTOR_REMOVED], 0, child); + if (emit_child_removed) + g_signal_emit (self, actor_signals[CHILD_REMOVED], 0, child); if (notify_first_last) { @@ -7426,34 +7426,34 @@ clutter_actor_class_init (ClutterActorClass *klass) G_TYPE_NONE, 0); /** - * ClutterActor::actor-added: + * ClutterActor::child-added: * @actor: the actor which received the signal * @child: the new child that has been added to @actor * * The signal is emitted each time an actor * has been added to @actor. */ - actor_signals[ACTOR_ADDED] = - g_signal_new (I_("actor-added"), + actor_signals[CHILD_ADDED] = + g_signal_new (I_("child-added"), G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (ClutterActorClass, actor_added), + G_STRUCT_OFFSET (ClutterActorClass, child_added), NULL, NULL, NULL, G_TYPE_NONE, 1, CLUTTER_TYPE_ACTOR); /** - * ClutterActor::actor-removed: + * ClutterActor::child-removed: * @actor: the actor which received the signal * @child: the child that has been removed from @actor * * The signal is emitted each time an actor * is removed from @actor. */ - actor_signals[ACTOR_REMOVED] = - g_signal_new (I_("actor-removed"), + actor_signals[CHILD_REMOVED] = + g_signal_new (I_("child-removed"), G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (ClutterActorClass, actor_removed), + G_STRUCT_OFFSET (ClutterActorClass, child_removed), NULL, NULL, NULL, G_TYPE_NONE, 1, CLUTTER_TYPE_ACTOR); @@ -10996,7 +10996,7 @@ typedef enum { ADD_CHILD_CREATE_META = 1 << 0, ADD_CHILD_EMIT_PARENT_SET = 1 << 1, - ADD_CHILD_EMIT_ACTOR_ADDED = 1 << 2, + ADD_CHILD_EMIT_CHILD_ADDED = 1 << 2, ADD_CHILD_CHECK_STATE = 1 << 3, ADD_CHILD_NOTIFY_FIRST_LAST = 1 << 4, ADD_CHILD_SHOW_ON_SET_PARENT = 1 << 5, @@ -11004,7 +11004,7 @@ typedef enum /* default flags for public API */ ADD_CHILD_DEFAULT_FLAGS = ADD_CHILD_CREATE_META | ADD_CHILD_EMIT_PARENT_SET | - ADD_CHILD_EMIT_ACTOR_ADDED | + ADD_CHILD_EMIT_CHILD_ADDED | ADD_CHILD_CHECK_STATE | ADD_CHILD_NOTIFY_FIRST_LAST | ADD_CHILD_SHOW_ON_SET_PARENT, @@ -11035,7 +11035,7 @@ clutter_actor_add_child_internal (ClutterActor *self, { ClutterTextDirection text_dir; gboolean create_meta; - gboolean emit_parent_set, emit_actor_added; + gboolean emit_parent_set, emit_child_added; gboolean check_state; gboolean notify_first_last; gboolean show_on_set_parent; @@ -11116,7 +11116,7 @@ clutter_actor_add_child_internal (ClutterActor *self, create_meta = (flags & ADD_CHILD_CREATE_META) != 0; emit_parent_set = (flags & ADD_CHILD_EMIT_PARENT_SET) != 0; - emit_actor_added = (flags & ADD_CHILD_EMIT_ACTOR_ADDED) != 0; + emit_child_added = (flags & ADD_CHILD_EMIT_CHILD_ADDED) != 0; check_state = (flags & ADD_CHILD_CHECK_STATE) != 0; notify_first_last = (flags & ADD_CHILD_NOTIFY_FIRST_LAST) != 0; show_on_set_parent = (flags & ADD_CHILD_SHOW_ON_SET_PARENT) != 0; @@ -11210,8 +11210,8 @@ clutter_actor_add_child_internal (ClutterActor *self, clutter_actor_queue_relayout (self); } - if (emit_actor_added) - g_signal_emit (self, actor_signals[ACTOR_ADDED], 0, child); + if (emit_child_added) + g_signal_emit (self, actor_signals[CHILD_ADDED], 0, child); if (notify_first_last) { @@ -11238,7 +11238,7 @@ clutter_actor_add_child_internal (ClutterActor *self, * This function will take into consideration the #ClutterActor:depth * of @child, and will keep the list of children sorted. * - * This function will emit the #ClutterActor::actor-added signal + * This function will emit the [signal@Clutter.Actor::child-added] signal * on @self. */ void @@ -11272,7 +11272,7 @@ clutter_actor_add_child (ClutterActor *self, * This function will not take into consideration the #ClutterActor:depth * of @child. * - * This function will emit the #ClutterActor::actor-added signal + * This function will emit the [signal@Clutter.Actor::child-added] signal * on @self. */ void @@ -11307,7 +11307,7 @@ clutter_actor_insert_child_at_index (ClutterActor *self, * This function will not take into consideration the #ClutterActor:depth * of @child. * - * This function will emit the #ClutterActor::actor-added signal + * This function will emit the [signal@Clutter.Actor::child-added] signal * on @self. */ void @@ -11346,7 +11346,7 @@ clutter_actor_insert_child_above (ClutterActor *self, * This function will not take into consideration the #ClutterActor:depth * of @child. * - * This function will emit the #ClutterActor::actor-added signal + * This function will emit the [signal@Clutter.Actor::child-added] signal * on @self. */ void @@ -11417,7 +11417,7 @@ clutter_actor_get_paint_visibility (ClutterActor *actor) * you will have to acquire a referenced on it before calling this * function. * - * This function will emit the #ClutterActor::actor-removed + * This function will emit the [signal@Clutter.Actor::child-removed] * signal on @self. */ void diff --git a/clutter/clutter/clutter-actor.h b/clutter/clutter/clutter-actor.h index 2cfe5d3ca..c10a7f326 100644 --- a/clutter/clutter/clutter-actor.h +++ b/clutter/clutter/clutter-actor.h @@ -247,9 +247,9 @@ struct _ClutterActorClass float (* calculate_resource_scale) (ClutterActor *self, int phase); - void (* actor_added) (ClutterActor *self, + void (* child_added) (ClutterActor *self, ClutterActor *child); - void (* actor_removed) (ClutterActor *self, + void (* child_removed) (ClutterActor *self, ClutterActor *child); }; diff --git a/src/tests/clutter/conform/actor-graph.c b/src/tests/clutter/conform/actor-graph.c index 5110c303f..313b2eb47 100644 --- a/src/tests/clutter/conform/actor-graph.c +++ b/src/tests/clutter/conform/actor-graph.c @@ -400,7 +400,7 @@ actor_remove_all (void) } static void -actor_added (ClutterActor *container, +child_added (ClutterActor *container, ClutterActor *child, gpointer data) { @@ -419,7 +419,7 @@ actor_added (ClutterActor *container, } static void -actor_removed (ClutterActor *container, +child_removed (ClutterActor *container, ClutterActor *child, gpointer data) { @@ -442,10 +442,10 @@ actor_container_signals (void) add_count = remove_count = 0; g_signal_connect (actor, - "actor-added", G_CALLBACK (actor_added), + "child-added", G_CALLBACK (child_added), &add_count); g_signal_connect (actor, - "actor-removed", G_CALLBACK (actor_removed), + "child-removed", G_CALLBACK (child_removed), &remove_count); clutter_actor_add_child (actor, g_object_new (CLUTTER_TYPE_ACTOR, @@ -464,9 +464,9 @@ actor_container_signals (void) g_assert_cmpint (remove_count, ==, 1); g_assert_cmpint (clutter_actor_get_n_children (actor), ==, 1); - g_signal_handlers_disconnect_by_func (actor, G_CALLBACK (actor_added), + g_signal_handlers_disconnect_by_func (actor, G_CALLBACK (child_added), &add_count); - g_signal_handlers_disconnect_by_func (actor, G_CALLBACK (actor_removed), + g_signal_handlers_disconnect_by_func (actor, G_CALLBACK (child_removed), &remove_count); clutter_actor_destroy (actor);