2007-01-07 Matthew Allum <mallum@openedhand.com>

* clutter/clutter-actor.c: (clutter_actor_allocate_coords):
        Fix an amazingly not noticed until now typo.
        Minor doc tweaks.

        * clutter/clutter-behaviour-opacity.c:
        (clutter_behaviour_alpha_notify):
        Take into account initial opacity value when calculating from alpha.

        * clutter/clutter-group.c:
        Add new get_nth_child() and get_n_children() api calls.
This commit is contained in:
Matthew Allum 2007-01-07 00:36:41 +00:00
parent 83700e97c7
commit 097bb235db
4 changed files with 61 additions and 8 deletions

View File

@ -1,3 +1,16 @@
2007-01-07 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-actor.c: (clutter_actor_allocate_coords):
Fix an amazingly not noticed until now typo.
Minor doc tweaks.
* clutter/clutter-behaviour-opacity.c:
(clutter_behaviour_alpha_notify):
Take into account initial opacity value when calculating from alpha.
* clutter/clutter-group.c:
Add new get_nth_child() and get_n_children() api calls.
2007-01-04 Matthew Allum <mallum@openedhand.com> 2007-01-04 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-actor.c: * clutter/clutter-actor.c:

View File

@ -154,8 +154,8 @@ clutter_actor_show (ClutterActor *self)
* clutter_actor_show_all: * clutter_actor_show_all:
* @self: a #ClutterActor * @self: a #ClutterActor
* *
* Recursively show an actor, and any child actor if @self is a * Recursively show an actor, and any child actor if @self has
* #ClutterGroup. * child actors.
* *
* Since: 0.2 * Since: 0.2
*/ */
@ -207,7 +207,7 @@ clutter_actor_hide (ClutterActor *self)
* @self: a #ClutterActor * @self: a #ClutterActor
* *
* Recursively hides an actor, and any child actor if @self * Recursively hides an actor, and any child actor if @self
* is a #ClutterGroup. * has child actors.
* *
* Since: 0.2 * Since: 0.2
*/ */
@ -473,7 +473,7 @@ clutter_actor_allocate_coords (ClutterActor *self,
box->x2 = self->priv->coords.x2; box->x2 = self->priv->coords.x2;
box->y2 = self->priv->coords.y2; box->y2 = self->priv->coords.y2;
if (klass->request_coords) if (klass->allocate_coords)
{ {
/* FIXME: This is kind of a cludge - we pass out *private* /* FIXME: This is kind of a cludge - we pass out *private*
* co-ords down to any subclasses so they can modify * co-ords down to any subclasses so they can modify

View File

@ -99,6 +99,8 @@ clutter_behaviour_alpha_notify (ClutterBehaviour *behave,
* (priv->opacity_end - priv->opacity_start) * (priv->opacity_end - priv->opacity_start)
/ CLUTTER_ALPHA_MAX_ALPHA; / CLUTTER_ALPHA_MAX_ALPHA;
opacity += priv->opacity_start;
CLUTTER_NOTE (BEHAVIOUR, "alpha: %i, opacity: %i", CLUTTER_NOTE (BEHAVIOUR, "alpha: %i, opacity: %i",
alpha_value, alpha_value,
opacity); opacity);

View File

@ -28,7 +28,7 @@
* @short_description: Base class for actors which contain multiple child * @short_description: Base class for actors which contain multiple child
* actors. * actors.
* *
* #ClutterGroup is an Actor which can contain multiple child actors. * A #ClutterGroup is an Actor which can contain multiple child actors.
*/ */
#include "config.h" #include "config.h"
@ -247,12 +247,50 @@ clutter_group_new (void)
GList* GList*
clutter_group_get_children (ClutterGroup *self) clutter_group_get_children (ClutterGroup *self)
{ {
/* FIXME: remane get_actors() */
g_return_val_if_fail (CLUTTER_IS_GROUP (self), NULL); g_return_val_if_fail (CLUTTER_IS_GROUP (self), NULL);
return g_list_copy(self->priv->children); return g_list_copy(self->priv->children);
} }
/**
* clutter_group_get_nth_child:
* @self: A #ClutterGroup
*
* Gets the number of actors held in the group.
*
* Return value: The number of child actors held in the group.
*
* Since: 0.2
**/
gint
clutter_group_get_n_children (ClutterGroup *self)
{
g_return_val_if_fail (CLUTTER_IS_GROUP (self), NULL);
return g_list_length (self->priv->children);
}
/**
* clutter_group_get_nth_child:
* @self: A #ClutterGroup
* @index: the position of the requested actor.
*
* Gets a groups child held at position index in stack.
*
* Return value: A Clutter actor or NULL if index is invalid.
*
* Since: 0.2
**/
ClutterActor*
clutter_group_get_nth_child (ClutterGroup *self,
gint index)
{
g_return_val_if_fail (CLUTTER_IS_GROUP (self), NULL);
return g_list_nth_data (self->priv->children, index);
}
/** /**
* clutter_group_foreach: * clutter_group_foreach:
* @self: A #ClutterGroup * @self: A #ClutterGroup