2006-06-22 Emmanuele Bassi <ebassi@openedhand.com>
authorEmmanuele Bassi <ebassi@openedhand.com>
Thu, 22 Jun 2006 12:05:51 +0000 (12:05 +0000)
committerEmmanuele Bassi <ebassi@openedhand.com>
Thu, 22 Jun 2006 12:05:51 +0000 (12:05 +0000)
* clutter/clutter-timeline.h:
* clutter/clutter-timeline.c: Add a "started" and a "paused"
signals; add more sanity checks on the public functions.

(clutter_timeline_get_loop): Add a getter function for the
loop property.

* clutter/clutter-marshal.list: Add marshallers.

* clutter/clutter-timeline.h:
* clutter/clutter-actor.h: Add padding for future expansion
without breaking ABI.

19 files changed:
ChangeLog
bindings/ChangeLog
bindings/python/Makefile.am
bindings/python/clutter-base-types.defs
bindings/python/clutter-base.defs
bindings/python/clutter.override
clutter/clutter-actor.h
clutter/clutter-group.c
clutter/clutter-group.h
clutter/clutter-marshal.list
clutter/clutter-timeline.c
clutter/clutter-timeline.h
doc/reference/ChangeLog
doc/reference/Makefile.am
doc/reference/clutter-sections.txt
doc/reference/tmpl/clutter-group.sgml
doc/reference/tmpl/clutter-main.sgml
doc/reference/tmpl/clutter-marshal.sgml
doc/reference/tmpl/clutter-timeline.sgml

index bebb6ca..79909c4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2006-06-22  Emmanuele Bassi  <ebassi@openedhand.com>
+
+       * clutter/clutter-timeline.h:
+       * clutter/clutter-timeline.c: Add a "started" and a "paused"
+       signals; add more sanity checks on the public functions.
+       
+       (clutter_timeline_get_loop): Add a getter function for the
+       loop property.
+
+       * clutter/clutter-marshal.list: Add marshallers.
+
+       * clutter/clutter-timeline.h:
+       * clutter/clutter-actor.h: Add padding for future expansion
+       without breaking ABI.
+       
 2006-06-22  Iain Holmes  <iain@openedhand.com>
 
        * clutter/clutter-util.c: And more
index db4a8de..529d849 100644 (file)
@@ -1,6 +1,14 @@
 2006-06-22  Emmanuele Bassi  <ebassi@openedhand.com>
 
        * python/Makefile.am:
+       * python/clutter.override:
+       * python/clutter-base.defs:
+       * python/clutter-base-types.defs: Bind updated clutter.Timeline API;
+       bind clutter.Media interface and clutter.VideoTexture.
+
+2006-06-22  Emmanuele Bassi  <ebassi@openedhand.com>
+
+       * python/Makefile.am:
        * python/pyclutter.pc.in: Add a pkgconfig file in order to
        check for bindings existence.
 
index 2ac6902..c1224b8 100644 (file)
@@ -48,7 +48,7 @@ clutter-pyglue.c: clutter.defs clutter-types.defs $(CLUTTER_OVERRIDES)
         --register $(PYGTK_DEFSDIR)/gdk-types.defs     \
         --register $(PYGTK_DEFSDIR)/gtk-types.defs     \
         --register $(PYGTK_DEFSDIR)/pango-types.defs   \
-        --register clutter-types.defs                  \
+       --register clutter-types.defs                   \
        --override $(top_srcdir)/bindings/python/$(CLUTTER_OVERRIDES)   \
        --prefix clutter                                \
         clutter.defs > gen-$@ &&                       \
@@ -65,10 +65,12 @@ pkgconfig_DATA = pyclutter.pc
 
 EXTRA_DIST += pyclutter.pc.in
 
-INCLUDES = $(PYTHON_CFLAGS) $(PYGTK_CFLAGS) -I$(top_srcdir) $(CLUTTER_CFLAGS)
+INCLUDES = $(PYTHON_CFLAGS) $(PYGTK_CFLAGS) -I$(top_srcdir) $(GST_CFLAGS) $(CLUTTER_CFLAGS)
 
 clutter_la_SOURCES = clutter-pyglue.c cluttermodule.c
 clutter_la_LIBADD  = $(PYTHON_LIBS) $(PYGTK_LIBS) \
+                    $(GST_LIBS) \
+                    $(CLUTTER_LIBS) \
                      $(top_builddir)/clutter/libclutter-@CLUTTER_MAJORMINOR@.la
 clutter_la_LDFLAGS = -module avoid-version -export-symbols-regex initclutter
 
@@ -80,11 +82,13 @@ update-defs:
        $(PYTHON) $(PYGTK_CODEGENDIR)/h2def.py -v       \
                $(top_srcdir)/clutter/clutter-keysyms.h         \
                $(top_srcdir)/clutter/clutter-timeline.h        \
+               $(top_srcdir)/clutter/clutter-media.h           \
                $(top_srcdir)/clutter/clutter-main.h            \
                $(top_srcdir)/clutter/clutter-event.h           \
                $(top_srcdir)/clutter/clutter-actor.h         \
                $(top_srcdir)/clutter/clutter-rectangle.h       \
                $(top_srcdir)/clutter/clutter-texture.h         \
+               $(top_srcdir)/clutter/clutter-video-texture.h   \
                $(top_srcdir)/clutter/clutter-color.h           \
                $(top_srcdir)/clutter/clutter-clone-texture.h   \
                $(top_srcdir)/clutter/clutter-label.h           \
index 329861a..5f3e5a5 100644 (file)
   )
 )
 
+;; Interfaces
+
+(define-interface Media
+  (in-module "Clutter")
+  (c-name "ClutterMedia")
+  (gtype-id "CLUTTER_TYPE_MEDIA")
+  (vtable "ClutterMediaInterface")
+)
+
 ;; Objects
 
 (define-object CloneTexture
   (gtype-id "CLUTTER_TYPE_TIMELINE")
 )
 
+(define-object VideoTexture
+  (in-module "Clutter")
+  (parent "ClutterTexture")
+  (implements "ClutterMedia")
+  (c-name "ClutterVideoTexture")
+  (gtype-id "CLUTTER_TYPE_VIDEO_TEXTURE")
+)
+
+
 ;; Pointers
 
 
index 25ffb2f..b88c033 100644 (file)
   )
 )
 
+(define-method get_loop
+  (of-object "ClutterTimeline")
+  (c-name "clutter_timeline_get_loop")
+  (return-type "gboolean")
+)
+
 (define-method rewind
   (of-object "ClutterTimeline")
   (c-name "clutter_timeline_rewind")
 
 
 
+;; From ../../clutter/clutter-media.h
+
+(define-function clutter_media_get_type
+  (c-name "clutter_media_get_type")
+  (return-type "GType")
+)
+
+(define-method set_uri
+  (of-object "ClutterMedia")
+  (c-name "clutter_media_set_uri")
+  (return-type "none")
+  (parameters
+    '("const-char*" "uri")
+  )
+)
+
+(define-method get_uri
+  (of-object "ClutterMedia")
+  (c-name "clutter_media_get_uri")
+  (return-type "const-char*")
+)
+
+(define-method set_playing
+  (of-object "ClutterMedia")
+  (c-name "clutter_media_set_playing")
+  (return-type "none")
+  (parameters
+    '("gboolean" "playing")
+  )
+)
+
+(define-method get_playing
+  (of-object "ClutterMedia")
+  (c-name "clutter_media_get_playing")
+  (return-type "gboolean")
+)
+
+(define-method set_position
+  (of-object "ClutterMedia")
+  (c-name "clutter_media_set_position")
+  (return-type "none")
+  (parameters
+    '("int" "position")
+  )
+)
+
+(define-method get_position
+  (of-object "ClutterMedia")
+  (c-name "clutter_media_get_position")
+  (return-type "int")
+)
+
+(define-method set_volume
+  (of-object "ClutterMedia")
+  (c-name "clutter_media_set_volume")
+  (return-type "none")
+  (parameters
+    '("double" "volume")
+  )
+)
+
+(define-method get_volume
+  (of-object "ClutterMedia")
+  (c-name "clutter_media_get_volume")
+  (return-type "double")
+)
+
+(define-method get_can_seek
+  (of-object "ClutterMedia")
+  (c-name "clutter_media_get_can_seek")
+  (return-type "gboolean")
+)
+
+(define-method get_buffer_percent
+  (of-object "ClutterMedia")
+  (c-name "clutter_media_get_buffer_percent")
+  (return-type "int")
+)
+
+(define-method get_duration
+  (of-object "ClutterMedia")
+  (c-name "clutter_media_get_duration")
+  (return-type "int")
+)
+
+(define-method set_filename
+  (of-object "ClutterMedia")
+  (c-name "clutter_media_set_filename")
+  (return-type "none")
+  (parameters
+    '("const-gchar*" "filename")
+  )
+)
+
+
+
 ;; From ../../clutter/clutter-event.h
 
 (define-function clutter_event_new
 
 
 
+;; From ../../clutter/clutter-video-texture.h
+
+(define-function clutter_video_texture_get_type
+  (c-name "clutter_video_texture_get_type")
+  (return-type "GType")
+)
+
+(define-function clutter_video_texture_new
+  (c-name "clutter_video_texture_new")
+  (is-constructor-of "ClutterVideoTexture")
+  (return-type "ClutterActor*")
+)
+
+
+
 ;; From ../../clutter/clutter-color.h
 
 (define-function clutter_color_get_type
index f5784ee..8f1f254 100644 (file)
@@ -5,6 +5,7 @@ headers
 #include "pygobject.h"
 #include <clutter/clutter-keysyms.h>
 #include <clutter/clutter-event.h>
+#include <clutter/clutter-media.h>
 #include <clutter/clutter-main.h>
 #include <clutter/clutter-timeline.h>
 #include <clutter/clutter-stage.h>
@@ -13,6 +14,7 @@ headers
 #include <clutter/clutter-rectangle.h>
 #include <clutter/clutter-group.h>
 #include <clutter/clutter-texture.h>
+#include <clutter/clutter-video-texture.h>
 #include <clutter/clutter-clone-texture.h>
 #include <clutter/clutter-label.h>
 #include <clutter/clutter-util.h>
index 4709c1c..c997afd 100644 (file)
@@ -115,6 +115,14 @@ struct _ClutterActorClass
   void (* show_all)            (ClutterActor        *actor);
   void (* hide_all)            (ClutterActor        *actor);
   void (* queue_redraw)        (ClutterActor        *actor);
+
+  /* padding for future expansion */
+  void (*_clutter_actor_1)     (void);
+  void (*_clutter_actor_2)     (void);
+  void (*_clutter_actor_3)     (void);
+  void (*_clutter_actor_4)     (void);
+  void (*_clutter_actor_5)     (void);
+  void (*_clutter_actor_6)     (void);
 };
 
 GType clutter_actor_get_type (void);
index 5b34034..a7fefef 100644 (file)
@@ -469,7 +469,7 @@ clutter_group_add_many (ClutterGroup   *self,
  * Remove a child #ClutterActor from the #ClutterGroup.
  **/
 void
-clutter_group_remove (ClutterGroup   *self,
+clutter_group_remove (ClutterGroup *self,
                      ClutterActor *actor)
 {
   ClutterActor *parent;
index 88c12da..1cd330d 100644 (file)
@@ -75,6 +75,7 @@ struct _ClutterGroupClass
   void (*remove) (ClutterGroup   *group,
                  ClutterActor *child);
 
+  /* padding for future expansion */
   void (*_clutter_group_1) (void);
   void (*_clutter_group_2) (void);
   void (*_clutter_group_3) (void);
@@ -91,25 +92,26 @@ GList*
 clutter_group_get_children (ClutterGroup *self);
 
 void
-clutter_group_foreach (ClutterGroup      *self,
-                      ClutterCallback   callback,
-                      gpointer          user_data);
+clutter_group_foreach (ClutterGroup    *self,
+                      ClutterCallback  callback,
+                      gpointer         user_data);
 
 void
-clutter_group_add (ClutterGroup *group, ClutterActor *actor); 
+clutter_group_add (ClutterGroup *self,
+                  ClutterActor *actor); 
 
 void
-clutter_group_add_many_valist (ClutterGroup   *group,
+clutter_group_add_many_valist (ClutterGroup *self,
                               ClutterActor *first_actor,
-                              va_list         args);
+                              va_list       args);
 
 void
-clutter_group_add_many (ClutterGroup   *group,
+clutter_group_add_many (ClutterGroup *self,
                        ClutterActor *first_actor,
                        ...) G_GNUC_NULL_TERMINATED;
 
 void
-clutter_group_remove (ClutterGroup   *group,
+clutter_group_remove (ClutterGroup *self,
                      ClutterActor *actor); 
 
 void
index 51c291e..fdbbf5a 100644 (file)
@@ -1,5 +1,7 @@
 VOID:INT64,INT64,FLOAT,BOOLEAN
 VOID:STRING,BOOLEAN,BOOLEAN
+VOID:INT
 VOID:INT,INT
 VOID:BOXED
 VOID:OBJECT
+VOID:VOID
index ffc1b1d..78964cc 100644 (file)
@@ -36,6 +36,7 @@
 #include "clutter-timeline.h"
 #include "clutter-main.h"
 #include "clutter-private.h"   /* for DBG */
+#include "clutter-marshal.h"
 
 G_DEFINE_TYPE (ClutterTimeline, clutter_timeline, G_TYPE_OBJECT);
 
@@ -49,7 +50,8 @@ struct ClutterTimelinePrivate
   guint    current_frame_num;
   gulong   last_frame_msecs;
   gulong   start_frame_secs;
-  gboolean loop;
+  
+  guint    loop : 1;
 };
 
 enum
@@ -63,6 +65,8 @@ enum
 enum
 {
   SIGNAL_NEW_FRAME,
+  SIGNAL_STARTED,
+  SIGNAL_PAUSED,
   SIGNAL_COMPLETED,
   LAST_SIGNAL
 };
@@ -202,19 +206,33 @@ clutter_timeline_class_init (ClutterTimelineClass *klass)
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (ClutterTimelineClass, new_frame),
                  NULL, NULL,
-                 g_cclosure_marshal_VOID__INT,
+                 clutter_marshal_VOID__INT,
                  G_TYPE_NONE, 
                  1, G_TYPE_INT);
-
   timeline_signals[SIGNAL_COMPLETED] =
     g_signal_new ("completed",
                  G_TYPE_FROM_CLASS (object_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (ClutterTimelineClass, completed),
                  NULL, NULL,
-                 g_cclosure_marshal_VOID__VOID,
+                 clutter_marshal_VOID__VOID,
+                 G_TYPE_NONE, 0);
+  timeline_signals[SIGNAL_STARTED] =
+    g_signal_new ("started",
+                 G_TYPE_FROM_CLASS (object_class),
+                 G_SIGNAL_RUN_LAST,
+                 G_STRUCT_OFFSET (ClutterTimelineClass, started),
+                 NULL, NULL,
+                 clutter_marshal_VOID__VOID,
+                 G_TYPE_NONE, 0);
+  timeline_signals[SIGNAL_PAUSED] =
+    g_signal_new ("paused",
+                 G_TYPE_FROM_CLASS (object_class),
+                 G_SIGNAL_RUN_LAST,
+                 G_STRUCT_OFFSET (ClutterTimelineClass, paused),
+                 NULL, NULL,
+                 clutter_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
-
 }
 
 static void
@@ -313,12 +331,16 @@ clutter_timeline_start (ClutterTimeline *timeline)
 {
   ClutterTimelinePrivate *priv;
 
+  g_return_if_fail (CLUTTER_IS_TIMELINE (timeline));
+  
   priv = timeline->priv;
 
   if (!priv->timeout_id)
     priv->timeout_id = g_timeout_add (FPS_TO_INTERVAL(priv->fps),
                                      timeline_timeout_func,
                                      (gpointer)timeline);
+
+  g_signal_emit (timeline, timeline_signals[SIGNAL_STARTED], 0);
 }
 
 /**
@@ -337,6 +359,8 @@ clutter_timeline_pause (ClutterTimeline *timeline)
 
   timeline->priv->timeout_id = 0;
   timeline->priv->last_frame_msecs = 0;
+
+  g_signal_emit (timeline, timeline_signals[SIGNAL_PAUSED], 0);
 }
 
 /**
@@ -352,10 +376,41 @@ clutter_timeline_stop (ClutterTimeline *timeline)
   clutter_timeline_rewind (timeline);
 }
 
+/**
+ * clutter_timeline_set_loop:
+ * @timeline: a #ClutterTimeline
+ * @loop: %TRUE for enable looping
+ *
+ * Sets whether @timeline should loop.
+ */
 void
-clutter_timeline_set_loop (ClutterTimeline *timeline, gboolean loop)
+clutter_timeline_set_loop (ClutterTimeline *timeline,
+                          gboolean         loop)
 {
-  timeline->priv->loop = loop;
+  g_return_if_fail (CLUTTER_IS_TIMELINE (timeline));
+  
+  if (timeline->priv->loop != loop)
+    {
+      timeline->priv->loop = loop;
+
+      g_object_notify (G_OBJECT (timeline), "loop");
+    }
+}
+
+/**
+ * clutter_timeline_get_loop:
+ * @timeline: a #ClutterTimeline
+ *
+ * Gets whether @timeline is looping
+ *
+ * Return value: %TRUE if the timeline is looping
+ */
+gboolean
+clutter_timeline_get_loop (ClutterTimeline *timeline)
+{
+  g_return_val_if_fail (CLUTTER_IS_TIMELINE (timeline), FALSE);
+
+  return timeline->priv->loop;
 }
 
 /**
@@ -367,6 +422,8 @@ clutter_timeline_set_loop (ClutterTimeline *timeline, gboolean loop)
 void
 clutter_timeline_rewind (ClutterTimeline *timeline)
 {
+  g_return_if_fail (CLUTTER_IS_TIMELINE (timeline));
+  
   clutter_timeline_advance (timeline, 0);
 }
 
@@ -483,6 +540,8 @@ clutter_timeline_set_speed (ClutterTimeline *timeline, guint fps)
 gboolean
 clutter_timeline_is_playing (ClutterTimeline *timeline)
 {
+  g_return_val_if_fail (CLUTTER_IS_TIMELINE (timeline), FALSE);
+  
   return (timeline->priv->timeout_id != 0);
 }
 
index f916773..84faade 100644 (file)
@@ -68,8 +68,18 @@ struct _ClutterTimelineClass
 {
   GObjectClass parent_class;
   
-  void (*new_frame) (ClutterTimeline *timeline, gint frame_num);
+  void (*started)   (ClutterTimeline *timeline);
   void (*completed) (ClutterTimeline *timeline);
+  void (*paused)    (ClutterTimeline *timeline);
+  
+  void (*new_frame) (ClutterTimeline *timeline,
+                    gint             frame_num);
+
+  void (*_clutter_timeline_1) (void);
+  void (*_clutter_timeline_2) (void);
+  void (*_clutter_timeline_3) (void);
+  void (*_clutter_timeline_4) (void);
+  void (*_clutter_timeline_5) (void);
 }; 
 
 GType clutter_timeline_get_type (void);
@@ -92,6 +102,9 @@ clutter_timeline_stop (ClutterTimeline *timeline);
 void
 clutter_timeline_set_loop (ClutterTimeline *timeline, gboolean loop);
 
+gboolean
+clutter_timeline_get_loop (ClutterTimeline *timeline);
+
 void
 clutter_timeline_rewind (ClutterTimeline *timeline);
 
index 90081b2..2bf71b7 100644 (file)
@@ -1,5 +1,12 @@
 2006-06-22  Emmanuele Bassi <ebassi@openedhand.com>
 
+       * clutter-sections.txt: Add clutter_timeline_get_loop().
+
+       * Makefile.am: Add clutter-marshal.h to the ignored header
+       files.
+
+2006-06-22  Emmanuele Bassi <ebassi@openedhand.com>
+
        * clutter-docs.sgml: Fix typos.
 
 2006-06-22  Ross Burton  <ross@openedhand.com>
index b4ed0dc..24bda45 100644 (file)
@@ -47,7 +47,11 @@ CFILE_GLOB=$(top_srcdir)/clutter/*.c
 
 # Header files to ignore when scanning.
 # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h
-IGNORE_HFILES=clutter-private.h stamp-clutter-enum-types.h clutter-keysyms.h
+IGNORE_HFILES=\
+       clutter-private.h \
+       clutter-marshal.h \
+       clutter-keysyms.h \
+       stamp-clutter-enum-types.h
 
 # Images to copy into HTML directory.
 # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png
index 410de02..8725405 100644 (file)
@@ -176,6 +176,7 @@ clutter_timeline_start
 clutter_timeline_pause
 clutter_timeline_stop
 clutter_timeline_set_loop
+clutter_timeline_get_loop
 clutter_timeline_rewind
 clutter_timeline_skip
 clutter_timeline_advance
index 71d8f97..d1baee3 100644 (file)
@@ -80,7 +80,7 @@ ClutterGroup
 
 </para>
 
-@group
+@self
 @first_actor: 
 @args: 
 
index cc51041..b64dc4e 100644 (file)
@@ -62,6 +62,11 @@ clutter-main
 @a...:
 @a...:
 @a...:
+@a...:
+@a...:
+@a...:
+@a...:
+@a...:
 @a...: 
 
 
index 965a185..5bc8daf 100644 (file)
@@ -17,56 +17,3 @@ clutter-marshal
 <!-- ##### SECTION Stability_Level ##### -->
 
 
-<!-- ##### FUNCTION clutter_marshal_VOID__INT64_INT64_FLOAT_BOOLEAN ##### -->
-<para>
-
-</para>
-
-@closure: 
-@return_value: 
-@n_param_values: 
-@param_values: 
-@invocation_hint: 
-@marshal_data: 
-
-
-<!-- ##### FUNCTION clutter_marshal_VOID__STRING_BOOLEAN_BOOLEAN ##### -->
-<para>
-
-</para>
-
-@closure: 
-@return_value: 
-@n_param_values: 
-@param_values: 
-@invocation_hint: 
-@marshal_data: 
-
-
-<!-- ##### FUNCTION clutter_marshal_VOID__INT_INT ##### -->
-<para>
-
-</para>
-
-@closure: 
-@return_value: 
-@n_param_values: 
-@param_values: 
-@invocation_hint: 
-@marshal_data: 
-
-
-<!-- ##### MACRO clutter_marshal_VOID__BOXED ##### -->
-<para>
-
-</para>
-
-
-
-<!-- ##### MACRO clutter_marshal_VOID__OBJECT ##### -->
-<para>
-
-</para>
-
-
-
index 82cc46f..2aadb01 100644 (file)
@@ -38,6 +38,20 @@ ClutterTimeline
 @cluttertimeline: the object which received the signal.
 @arg1: 
 
+<!-- ##### SIGNAL ClutterTimeline::paused ##### -->
+<para>
+
+</para>
+
+@cluttertimeline: the object which received the signal.
+
+<!-- ##### SIGNAL ClutterTimeline::started ##### -->
+<para>
+
+</para>
+
+@cluttertimeline: the object which received the signal.
+
 <!-- ##### ARG ClutterTimeline:fps ##### -->
 <para>
 
@@ -105,6 +119,15 @@ ClutterTimeline
 @loop: 
 
 
+<!-- ##### FUNCTION clutter_timeline_get_loop ##### -->
+<para>
+
+</para>
+
+@timeline: 
+@Returns: 
+
+
 <!-- ##### FUNCTION clutter_timeline_rewind ##### -->
 <para>