mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 10:00:45 -05:00
clutter/actor: Rename ::actor-{added,removed} to ::child-{added,removed}
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3384>
This commit is contained in:
parent
7113ecd86c
commit
c42fa34b01
@ -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",
|
||||
|
@ -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 <structname>CallyActorClass</structname> structure contains
|
||||
* only private data
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
};
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user