2006-11-17 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-behaviour-path.h:
+ * clutter/clutter-behaviour-path.c: Add "since" strings; add
+ a "knot" property which can be used to append a knot to the path;
+ fix apidoc.
+
+ * clutter/clutter-alpha.c: Add "since" strings.
+
+ * clutter/clutter-feature.c: Add apidoc.
+
+ * clutter/clutter-behaviour-opacity.c: Add the "opacity-start"
+ and "opacity-end" properties; rewrite constructor to use them.
+
+2006-11-17 Emmanuele Bassi <ebassi@openedhand.com>
+
+ * clutter/clutter-behaviour-path.h:
* clutter/clutter-behaviour-path.c: Add a "knot-reached" signal,
which is emitted when the path reaches a node in the nodes list;
flesh out the documentation a bit; sync the parameters names
* the #ClutterTimeline object.
*
* #ClutterAlpha is used to "drive" a #ClutterBehaviour instance.
+ *
+ * Since: 0.2
*/
#ifdef HAVE_CONFIG_H
* ClutterAlpha:timeline:
*
* A #ClutterTimeline instance used to drive the alpha function.
+ *
+ * Since: 0.2
*/
g_object_class_install_property (object_class,
PROP_TIMELINE,
* ClutterAlpha:alpha:
*
* The alpha value as computed by the alpha function.
+ *
+ * Since: 0.2
*/
g_object_class_install_property (object_class,
PROP_ALPHA,
* Query the current alpha value.
*
* Return Value: The current alpha value for the alpha
+ *
+ * Since: 0.2
*/
guint32
clutter_alpha_get_alpha (ClutterAlpha *alpha)
* Sets the #ClutterAlphaFunc function used to compute
* the alpha value at each frame of the #ClutterTimeline
* bound to @alpha.
+ *
+ * Since: 0.2
*/
void
clutter_alpha_set_func (ClutterAlpha *alpha,
* @timeline: A #ClutterTimeline
*
* Binds @alpha to @timeline.
+ *
+ * Since: 0.2
*/
void
clutter_alpha_set_timeline (ClutterAlpha *alpha,
* Gets the #ClutterTimeline bound to @alpha.
*
* Return value: a #ClutterTimeline instance
+ *
+ * Since: 0.2
*/
ClutterTimeline *
clutter_alpha_get_timeline (ClutterAlpha *alpha)
* a #ClutterBehaviour object.
*
* Return value: the newly created empty #ClutterAlpha instance.
+ *
+ * Since: 0.2
*/
ClutterAlpha *
clutter_alpha_new (void)
* and alpha function.
*
* Return Value: the newly created #ClutterAlpha
+ *
+ * Since: 0.2
*/
ClutterAlpha *
clutter_alpha_new_full (ClutterTimeline *timeline,
* can use this function as the alpha function for clutter_alpha_set_func().
*
* Return value: an alpha value.
+ *
+ * Since: 0.2
*/
guint32
clutter_ramp_inc_func (ClutterAlpha *alpha,
* can use this function as the alpha function for clutter_alpha_set_func().
*
* Return value: an alpha value.
+ *
+ * Since: 0.2
*/
guint32
clutter_ramp_dec_func (ClutterAlpha *alpha,
* function as the alpha function for clutter_alpha_set_func().
*
* Return value: an alpha value.
+ *
+ * Since: 0.2
*/
guint32
clutter_ramp_func (ClutterAlpha *alpha,
* function as the alpha function for clutter_alpha_set_func().
*
* Return value: an alpha value.
+ *
+ * Since: 0.2
*/
guint32
clutter_sine_func (ClutterAlpha *alpha,
* @short_description: Behaviour controlling the opacity
*
* #ClutterBehaviourOpacity controls the opacity of a set of actors.
+ *
+ * Since: 0.2
*/
G_DEFINE_TYPE (ClutterBehaviourOpacity,
CLUTTER_TYPE_BEHAVIOUR_OPACITY, \
ClutterBehaviourOpacityPrivate))
+enum
+{
+ PROP_0,
+
+ PROP_OPACITY_START,
+ PROP_OPACITY_END
+};
+
static void
opacity_frame_foreach (ClutterActor *actor,
ClutterBehaviourOpacity *behave)
G_OBJECT_CLASS (clutter_behaviour_opacity_parent_class)->finalize (object);
}
+static void
+clutter_behaviour_opacity_set_property (GObject *gobject,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ ClutterBehaviourOpacity *opacityb = CLUTTER_BEHAVIOUR_OPACITY (gobject);
+
+ switch (prop_id)
+ {
+ case PROP_OPACITY_START:
+ opacityb->priv->opacity_start = g_value_get_uint (value);
+ break;
+ case PROP_OPACITY_END:
+ opacityb->priv->opacity_end = g_value_get_uint (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+ break;
+ }
+}
static void
-clutter_behaviour_opacity_class_init (ClutterBehaviourOpacityClass *klass)
+clutter_behaviour_opacity_get_property (GObject *gobject,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
{
- ClutterBehaviourClass *behave_class;
+ ClutterBehaviourOpacity *opacityb = CLUTTER_BEHAVIOUR_OPACITY (gobject);
+
+ switch (prop_id)
+ {
+ case PROP_OPACITY_START:
+ g_value_set_uint (value, opacityb->priv->opacity_start);
+ break;
+ case PROP_OPACITY_END:
+ g_value_set_uint (value, opacityb->priv->opacity_end);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+ break;
+ }
+}
- behave_class = (ClutterBehaviourClass*) klass;
+static void
+clutter_behaviour_opacity_class_init (ClutterBehaviourOpacityClass *klass)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ ClutterBehaviourClass *behave_class = CLUTTER_BEHAVIOUR_CLASS (klass);
+
+ gobject_class->set_property = clutter_behaviour_opacity_set_property;
+ gobject_class->get_property = clutter_behaviour_opacity_get_property;
+
+ /**
+ * ClutterBehaviourOpacity:opacity-start:
+ *
+ * Initial opacity level of the behaviour.
+ *
+ * Since: 0.2
+ */
+ g_object_class_install_property (gobject_class,
+ PROP_OPACITY_START,
+ g_param_spec_uint ("opacity-start",
+ "Opacity Start",
+ "Initial opacity level",
+ 0, 255,
+ 0,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT));
+
+ /**
+ * ClutterBehaviourOpacity:opacity-end:
+ *
+ * Final opacity level of the behaviour.
+ *
+ * Since: 0.2
+ */
+ g_object_class_install_property (gobject_class,
+ PROP_OPACITY_END,
+ g_param_spec_uint ("opacity-end",
+ "Opacity End",
+ "Final opacity level",
+ 0, 255,
+ 0,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT));
behave_class->alpha_notify = clutter_behaviour_alpha_notify;
* change in the interval between @opacity_start and @opacity_end.
*
* Return value: the newly created #ClutterBehaviourOpacity
+ *
+ * Since: 0.2
*/
ClutterBehaviour *
clutter_behaviour_opacity_new (ClutterAlpha *alpha,
guint8 opacity_start,
guint8 opacity_end)
{
- ClutterBehaviourOpacity *behave;
-
- behave = g_object_new (CLUTTER_TYPE_BEHAVIOUR_OPACITY,
- "alpha", alpha,
- NULL);
-
- behave->priv->opacity_start = opacity_start;
- behave->priv->opacity_end = opacity_end;
-
- return CLUTTER_BEHAVIOUR (behave);
+ return g_object_new (CLUTTER_TYPE_BEHAVIOUR_OPACITY,
+ "alpha", alpha,
+ "opacity-start", opacity_start,
+ "opacity-end", opacity_end,
+ NULL);
}
* @short_description: A behaviour class interpolating actors along a defined
* path.
*
- * #ClutterBehaviourPath interpolates actors along a defined path of points.
+ * #ClutterBehaviourPath interpolates actors along a defined path.
*
+ * A path is a set of #ClutterKnots object given when creating a new
+ * #ClutterBehaviourPath instance. Knots can be also added to the path
+ * using clutter_behaviour_path_append_knot(). The whole path can be
+ * cleared using clutter_behaviour_path_clear(). Each time the behaviour
+ * reaches a knot in the path, the "knot-reached" signal is emitted.
+ *
+ * Since: 0.2
*/
#include <math.h>
-/**
- * SECTION:clutter-behaviour-path
- * @short_description: Behaviour for walking on a path
- *
- * #ClutterBehaviourPath makes all the actors driven by it walk on a path.
- * A path is a set of #ClutterKnots object given when creating a new
- * #ClutterBehaviourPath instance. Knots can be also added to the path
- * using clutter_behaviour_path_append_knot(). The whole path can be
- * cleared using clutter_behaviour_path_clear(). Each time the behaviour
- * reaches a knot in the path, the "knot-reached" signal is emitted.
- */
-
static ClutterKnot *
clutter_knot_copy (const ClutterKnot *knot)
{
static guint path_signals[LAST_SIGNAL] = { 0, };
+enum
+{
+ PROP_0,
+
+ PROP_KNOT
+};
+
static void
clutter_behaviour_path_finalize (GObject *object)
{
}
static void
+clutter_behaviour_path_set_property (GObject *gobject,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ ClutterBehaviourPath *pathb = CLUTTER_BEHAVIOUR_PATH (gobject);
+
+ switch (prop_id)
+ {
+ case PROP_KNOT:
+ clutter_behaviour_path_append_knot (pathb, g_value_get_boxed (value));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+ break;
+ }
+}
+
+static void
clutter_behaviour_path_class_init (ClutterBehaviourPathClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
ClutterBehaviourClass *behave_class = CLUTTER_BEHAVIOUR_CLASS (klass);
+ gobject_class->set_property = clutter_behaviour_path_set_property;
gobject_class->finalize = clutter_behaviour_path_finalize;
/**
+ * ClutterBehaviourPath:knot:
+ *
+ * This property can be used to append a new knot to the path.
+ *
+ * Since: 0.2
+ */
+ g_object_class_install_property (gobject_class,
+ PROP_KNOT,
+ g_param_spec_boxed ("knot",
+ "Knot",
+ "Can be used to append a knot to the path",
+ CLUTTER_TYPE_KNOT,
+ G_PARAM_WRITABLE));
+
+ /**
* ClutterBehaviourPath::knot-reached:
* @pathb: the object which received the signal
* @knot: the #ClutterKnot reached
*
* This signal is emitted each time a node defined inside the path
* is reached.
+ *
+ * Since: 0.2
*/
path_signals[KNOT_REACHED] =
g_signal_new ("knot-reached",
}
/**
- * clutter_behaviour_path_append_knot:
+ * clutter_behaviour_path_insert_knot:
* @pathb: a #ClutterBehvaiourPath
* @offset: position in path to insert knot.
* @knot: a #ClutterKnot to append.
* clutter_behaviour_path_remove_knot:
* @pathb: a #ClutterBehvaiourPath
* @offset: position in path to remove knot.
- * @knot: a #ClutterKnot to append.
*
* Removes a #ClutterKnot in the path at specified offset.
*
}
}
-/**
- * clutter_behaviour_path_append_knots_valist:
- * @pathb: a #ClutterBehvaiourPath
- * @first_know: the #ClutterKnot knot to add to the path
- * @args: the knots to be added
- *
- * Similar to clutter_behaviour_path_append_knots() but using a va_list.
- * Use this function inside bindings.
- *
- * Since: 0.2
- */
static void
clutter_behaviour_path_append_knots_valist (ClutterBehaviourPath *pathb,
const ClutterKnot *first_knot,
/**
* clutter_behaviour_path_append_knots:
* @pathb: a #ClutterBehvaiourPath
- * @first_know: the #ClutterKnot knot to add to the path
+ * @first_knot: the #ClutterKnot knot to add to the path
* @Varargs: additional knots to add to the path
*
* Adds a NULL-terminated list of knots to a path. This function is
void clutter_behaviour_path_remove_knot (ClutterBehaviourPath *pathb,
guint offset);
-void clutter_behaviour_path_clear (ClutterBehaviourPath *path);
+void clutter_behaviour_path_clear (ClutterBehaviourPath *pathb);
G_END_DECLS
return __features->flags;
}
+/**
+ * clutter_feature_wait_for_vblank:
+ *
+ * FIXME
+ *
+ * Since: 0.2
+ */
void
clutter_feature_wait_for_vblank (void)
{
</para>
+<!-- ##### ARG ClutterBehaviourOpacity:opacity-end ##### -->
+<para>
+
+</para>
+
+<!-- ##### ARG ClutterBehaviourOpacity:opacity-start ##### -->
+<para>
+
+</para>
+
<!-- ##### STRUCT ClutterBehaviourOpacityClass ##### -->
<para>
@clutterbehaviourpath: the object which received the signal.
@arg1:
+<!-- ##### ARG ClutterBehaviourPath:knot ##### -->
+<para>
+
+</para>
+
<!-- ##### STRUCT ClutterBehaviourPathClass ##### -->
<para>
</para>
-@path:
+@pathb:
@a...:
@a...:
@a...:
+@a...:
+@a...:
+@a...:
@a...: