mirror of
https://github.com/brl/mutter.git
synced 2024-12-24 12:02:04 +00:00
actor: Add replace_child() method
A simple method that atomically replaces a child actor with another one.
This commit is contained in:
parent
238a6eb03d
commit
bd58694678
@ -10015,6 +10015,36 @@ clutter_actor_remove_child (ClutterActor *self,
|
||||
clutter_actor_remove_child_internal (self, child, TRUE, TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_actor_replace_child:
|
||||
* @self: a #ClutterActor
|
||||
* @old_child: the child of @self to replace
|
||||
* @new_child: the #ClutterActor to replace @old_child
|
||||
*
|
||||
* Replaces @old_child with @new_child in the list of children of @self.
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
void
|
||||
clutter_actor_replace_child (ClutterActor *self,
|
||||
ClutterActor *old_child,
|
||||
ClutterActor *new_child)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
||||
g_return_if_fail (CLUTTER_IS_ACTOR (old_child));
|
||||
g_return_if_fail (old_child->priv->parent == self);
|
||||
g_return_if_fail (CLUTTER_IS_ACTOR (new_child));
|
||||
g_return_if_fail (old_child != new_child);
|
||||
g_return_if_fail (new_child != self);
|
||||
g_return_if_fail (new_child->priv->parent == NULL);
|
||||
|
||||
clutter_actor_add_child_internal (self, new_child,
|
||||
insert_child_above,
|
||||
old_child,
|
||||
TRUE, TRUE);
|
||||
clutter_actor_remove_child_internal (self, old_child, TRUE, TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_actor_unparent:
|
||||
* @self: a #ClutterActor
|
||||
|
@ -461,6 +461,9 @@ void clutter_actor_insert_child_above (ClutterActor
|
||||
void clutter_actor_insert_child_below (ClutterActor *self,
|
||||
ClutterActor *child,
|
||||
ClutterActor *sibling);
|
||||
void clutter_actor_replace_child (ClutterActor *self,
|
||||
ClutterActor *old_child,
|
||||
ClutterActor *new_child);
|
||||
void clutter_actor_remove_child (ClutterActor *self,
|
||||
ClutterActor *child);
|
||||
GList * clutter_actor_get_children (ClutterActor *self);
|
||||
|
Loading…
Reference in New Issue
Block a user