Make ClutterActor use ClutterContainer methods

Every direct reference to ClutterGroup has been removed, in favour of
ClutterContainer - which is the official way of creating container
actors as of 0.4.
This commit is contained in:
Emmanuele Bassi 2007-08-13 17:01:07 +00:00
parent 27ce96150e
commit a60dcb9889

View File

@ -1179,9 +1179,9 @@ clutter_actor_init (ClutterActor *self)
* *
* Destroys an actor. When an actor is destroyed, it will break any * Destroys an actor. When an actor is destroyed, it will break any
* references it holds to other objects. If the actor is inside a * references it holds to other objects. If the actor is inside a
* group, the actor will be removed from the group. * container, the actor will be removed.
* *
* When you destroy a group its children will be destroyed as well. * When you destroy a container its children will be destroyed as well.
*/ */
void void
clutter_actor_destroy (ClutterActor *self) clutter_actor_destroy (ClutterActor *self)
@ -1977,15 +1977,15 @@ clutter_actor_set_depth (ClutterActor *self,
/* Sets Z value. - FIXME: should invert ?*/ /* Sets Z value. - FIXME: should invert ?*/
priv->z = depth; priv->z = depth;
if (priv->parent_actor && CLUTTER_IS_GROUP (priv->parent_actor)) if (priv->parent_actor && CLUTTER_IS_CONTAINER (priv->parent_actor))
{ {
/* We need to resort the group stacking order as to /* We need to resort the container stacking order as to
* correctly render alpha values. * correctly render alpha values.
* *
* FIXME: This is sub optimal. maybe queue the the sort * FIXME: This is sub optimal. maybe queue the the sort
* before stacking * before stacking
*/ */
clutter_group_sort_depth_order (CLUTTER_GROUP (priv->parent_actor)); clutter_container_sort_depth_order (CLUTTER_CONTAINER (priv->parent_actor));
} }
if (CLUTTER_ACTOR_IS_VISIBLE (self)) if (CLUTTER_ACTOR_IS_VISIBLE (self))
@ -2403,7 +2403,8 @@ clutter_actor_get_parent (ClutterActor *self)
* @self: a #ClutterActor * @self: a #ClutterActor
* *
* This function should not be used in applications. It should be called by * This function should not be used in applications. It should be called by
* implementations of group actors, to dissociate a child from the container. * implementations of container actors, to dissociate a child from the
* container.
* *
* Since: 0.1.1 * Since: 0.1.1
*/ */
@ -2514,7 +2515,7 @@ clutter_actor_raise (ClutterActor *self,
parent = clutter_actor_get_parent (self); parent = clutter_actor_get_parent (self);
if (!parent) if (!parent)
{ {
g_warning ("Actor of type %s is not inside a group", g_warning ("Actor of type %s is not inside a container",
g_type_name (G_OBJECT_TYPE (self))); g_type_name (G_OBJECT_TYPE (self)));
return; return;
} }
@ -2524,14 +2525,14 @@ clutter_actor_raise (ClutterActor *self,
if (parent != clutter_actor_get_parent (below)) if (parent != clutter_actor_get_parent (below))
{ {
g_warning ("Actor of type %s is not in the same " g_warning ("Actor of type %s is not in the same "
"group of actor of type %s", "container of actor of type %s",
g_type_name (G_OBJECT_TYPE (self)), g_type_name (G_OBJECT_TYPE (self)),
g_type_name (G_OBJECT_TYPE (below))); g_type_name (G_OBJECT_TYPE (below)));
return; return;
} }
} }
clutter_group_raise (CLUTTER_GROUP (parent), self, below); clutter_container_raise (CLUTTER_CONTAINER (parent), self, below);
} }
/** /**
@ -2553,7 +2554,7 @@ clutter_actor_lower (ClutterActor *self,
parent = clutter_actor_get_parent (self); parent = clutter_actor_get_parent (self);
if (!parent) if (!parent)
{ {
g_warning ("Actor of type %s is not inside a group", g_warning ("Actor of type %s is not inside a container",
g_type_name (G_OBJECT_TYPE (self))); g_type_name (G_OBJECT_TYPE (self)));
return; return;
} }
@ -2563,15 +2564,14 @@ clutter_actor_lower (ClutterActor *self,
if (parent != clutter_actor_get_parent (above)) if (parent != clutter_actor_get_parent (above))
{ {
g_warning ("Actor of type %s is not in the same " g_warning ("Actor of type %s is not in the same "
"group of actor of type %s", "container of actor of type %s",
g_type_name (G_OBJECT_TYPE (self)), g_type_name (G_OBJECT_TYPE (self)),
g_type_name (G_OBJECT_TYPE (above))); g_type_name (G_OBJECT_TYPE (above)));
return; return;
} }
} }
/* FIXME: group_lower should be an overidable method ? */ clutter_container_lower (CLUTTER_CONTAINER (parent), self, above);
clutter_group_lower (CLUTTER_GROUP (parent), self, above);
} }
/** /**