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>
* clutter/clutter-actor.c:

View File

@ -154,8 +154,8 @@ clutter_actor_show (ClutterActor *self)
* clutter_actor_show_all:
* @self: a #ClutterActor
*
* Recursively show an actor, and any child actor if @self is a
* #ClutterGroup.
* Recursively show an actor, and any child actor if @self has
* child actors.
*
* Since: 0.2
*/
@ -207,7 +207,7 @@ clutter_actor_hide (ClutterActor *self)
* @self: a #ClutterActor
*
* Recursively hides an actor, and any child actor if @self
* is a #ClutterGroup.
* has child actors.
*
* Since: 0.2
*/
@ -473,7 +473,7 @@ clutter_actor_allocate_coords (ClutterActor *self,
box->x2 = self->priv->coords.x2;
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*
* co-ords down to any subclasses so they can modify
@ -1434,7 +1434,7 @@ clutter_actor_get_opacity (ClutterActor *self)
/* Factor in the actual actors opacity with parents */
if (parent && clutter_actor_get_opacity (parent) != 0xff)
return (clutter_actor_get_opacity(parent) * self->priv->opacity) / 0xff;
return (clutter_actor_get_opacity(parent) * self->priv->opacity) / 0xff;
return self->priv->opacity;
}

View File

@ -94,11 +94,13 @@ clutter_behaviour_alpha_notify (ClutterBehaviour *behave,
ClutterBehaviourOpacityPrivate *priv;
priv = CLUTTER_BEHAVIOUR_OPACITY (behave)->priv;
opacity = alpha_value
* (priv->opacity_end - priv->opacity_start)
/ CLUTTER_ALPHA_MAX_ALPHA;
opacity += priv->opacity_start;
CLUTTER_NOTE (BEHAVIOUR, "alpha: %i, opacity: %i",
alpha_value,
opacity);

View File

@ -28,7 +28,7 @@
* @short_description: Base class for actors which contain multiple child
* 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"
@ -247,12 +247,50 @@ clutter_group_new (void)
GList*
clutter_group_get_children (ClutterGroup *self)
{
/* FIXME: remane get_actors() */
g_return_val_if_fail (CLUTTER_IS_GROUP (self), NULL);
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:
* @self: A #ClutterGroup