2006-11-17 Emmanuele Bassi <ebassi@openedhand.com>
authorEmmanuele Bassi <ebassi@openedhand.com>
Fri, 17 Nov 2006 19:17:40 +0000 (19:17 +0000)
committerEmmanuele Bassi <ebassi@openedhand.com>
Fri, 17 Nov 2006 19:17:40 +0000 (19:17 +0000)
* 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.

ChangeLog
clutter/clutter-alpha.c
clutter/clutter-behaviour-opacity.c
clutter/clutter-behaviour-path.c
clutter/clutter-behaviour-path.h
clutter/clutter-feature.c
doc/reference/tmpl/clutter-behaviour-opacity.sgml
doc/reference/tmpl/clutter-behaviour-path.sgml
doc/reference/tmpl/clutter-main.sgml

index 2dbfe86..3deb7af 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,20 @@
 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
index 8204627..86a069f 100644 (file)
@@ -41,6 +41,8 @@
  * the #ClutterTimeline object.
  *
  * #ClutterAlpha is used to "drive" a #ClutterBehaviour instance.
+ *
+ * Since: 0.2
  */
 
 #ifdef HAVE_CONFIG_H
@@ -187,6 +189,8 @@ clutter_alpha_class_init (ClutterAlphaClass *klass)
    * ClutterAlpha:timeline:
    *
    * A #ClutterTimeline instance used to drive the alpha function.
+   *
+   * Since: 0.2
    */
   g_object_class_install_property (object_class,
                                    PROP_TIMELINE,
@@ -199,6 +203,8 @@ clutter_alpha_class_init (ClutterAlphaClass *klass)
    * ClutterAlpha:alpha:
    *
    * The alpha value as computed by the alpha function.
+   *
+   * Since: 0.2
    */
   g_object_class_install_property (object_class,
                                    PROP_ALPHA,
@@ -226,6 +232,8 @@ clutter_alpha_init (ClutterAlpha *self)
  * Query the current alpha value.
  *
  * Return Value: The current alpha value for the alpha
+ *
+ * Since: 0.2
  */
 guint32
 clutter_alpha_get_alpha (ClutterAlpha *alpha)
@@ -245,6 +253,8 @@ 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,
@@ -277,6 +287,8 @@ clutter_alpha_set_func (ClutterAlpha    *alpha,
  * @timeline: A #ClutterTimeline
  *
  * Binds @alpha to @timeline.
+ *
+ * Since: 0.2
  */
 void
 clutter_alpha_set_timeline (ClutterAlpha    *alpha,
@@ -316,6 +328,8 @@ 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)
@@ -337,6 +351,8 @@ 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)
@@ -355,6 +371,8 @@ clutter_alpha_new (void)
  * and alpha function.
  *
  * Return Value: the newly created #ClutterAlpha
+ *
+ * Since: 0.2
  */
 ClutterAlpha *
 clutter_alpha_new_full (ClutterTimeline  *timeline,
@@ -384,6 +402,8 @@ 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,
@@ -409,6 +429,8 @@ 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,
@@ -437,6 +459,8 @@ 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,
@@ -473,6 +497,8 @@ 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,
index 25e923b..96b2d35 100644 (file)
@@ -49,6 +49,8 @@
  * @short_description: Behaviour controlling the opacity
  *
  * #ClutterBehaviourOpacity controls the opacity of a set of actors.
+ *
+ * Since: 0.2
  */
 
 G_DEFINE_TYPE (ClutterBehaviourOpacity,
@@ -66,6 +68,14 @@ struct _ClutterBehaviourOpacityPrivate
                CLUTTER_TYPE_BEHAVIOUR_OPACITY,        \
                ClutterBehaviourOpacityPrivate))
 
+enum
+{
+  PROP_0,
+
+  PROP_OPACITY_START,
+  PROP_OPACITY_END
+};
+
 static void
 opacity_frame_foreach (ClutterActor            *actor,
                        ClutterBehaviourOpacity *behave)
@@ -105,13 +115,92 @@ clutter_behaviour_opacity_finalize (GObject *object)
   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;
 
@@ -135,21 +224,18 @@ clutter_behaviour_opacity_init (ClutterBehaviourOpacity *self)
  * 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);
 }
 
index 45a0767..8adfaa7 100644 (file)
  * @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)
 {
@@ -116,6 +111,13 @@ enum
 
 static guint path_signals[LAST_SIGNAL] = { 0, };
 
+enum
+{
+  PROP_0,
+
+  PROP_KNOT
+};
+
 static void 
 clutter_behaviour_path_finalize (GObject *object)
 {
@@ -246,20 +248,57 @@ clutter_behaviour_path_alpha_notify (ClutterBehaviour *behave,
 }
 
 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",
@@ -366,7 +405,7 @@ clutter_behaviour_path_append_knot (ClutterBehaviourPath  *pathb,
 }
 
 /**
- * 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.
@@ -394,7 +433,6 @@ clutter_behaviour_path_insert_knot (ClutterBehaviourPath  *pathb,
  * 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.
  *
@@ -420,17 +458,6 @@ clutter_behaviour_path_remove_knot (ClutterBehaviourPath  *pathb,
     }
 }
 
-/**
- * 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,
@@ -449,7 +476,7 @@ clutter_behaviour_path_append_knots_valist (ClutterBehaviourPath *pathb,
 /**
  * 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
index 179b553..c5aec88 100644 (file)
@@ -107,7 +107,7 @@ void              clutter_behaviour_path_insert_knot  (ClutterBehaviourPath  *pa
 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
 
index a9995fd..02c4240 100644 (file)
@@ -291,6 +291,13 @@ clutter_feature_get_all (void)
   return __features->flags;
 }
 
+/**
+ * clutter_feature_wait_for_vblank:
+ *
+ * FIXME
+ *
+ * Since: 0.2
+ */
 void
 clutter_feature_wait_for_vblank (void)
 {
index 1bce93f..45c02d6 100644 (file)
@@ -23,6 +23,16 @@ ClutterBehaviourOpacity
 </para>
 
 
+<!-- ##### ARG ClutterBehaviourOpacity:opacity-end ##### -->
+<para>
+
+</para>
+
+<!-- ##### ARG ClutterBehaviourOpacity:opacity-start ##### -->
+<para>
+
+</para>
+
 <!-- ##### STRUCT ClutterBehaviourOpacityClass ##### -->
 <para>
 
index 292fc2f..b91d95b 100644 (file)
@@ -46,6 +46,11 @@ ClutterBehaviourPath
 @clutterbehaviourpath: the object which received the signal.
 @arg1: 
 
+<!-- ##### ARG ClutterBehaviourPath:knot ##### -->
+<para>
+
+</para>
+
 <!-- ##### STRUCT ClutterBehaviourPathClass ##### -->
 <para>
 
@@ -102,6 +107,6 @@ ClutterBehaviourPath
 
 </para>
 
-@path: 
+@pathb
 
 
index 440500d..d242f98 100644 (file)
@@ -53,6 +53,9 @@ clutter-main
 @a...:
 @a...:
 @a...:
+@a...:
+@a...:
+@a...:
 @a...: