From 33d0c989ca0e0c371f037f0c624f90e4385c8e82 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 22 Jun 2006 12:05:51 +0000 Subject: [PATCH] 2006-06-22 Emmanuele Bassi * 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. --- ChangeLog | 15 +++ bindings/ChangeLog | 8 ++ bindings/python/Makefile.am | 8 +- bindings/python/clutter-base-types.defs | 18 ++++ bindings/python/clutter-base.defs | 117 +++++++++++++++++++++++ bindings/python/clutter.override | 2 + clutter/clutter-actor.h | 8 ++ clutter/clutter-group.c | 2 +- clutter/clutter-group.h | 18 ++-- clutter/clutter-marshal.list | 2 + clutter/clutter-timeline.c | 73 ++++++++++++-- clutter/clutter-timeline.h | 15 ++- doc/reference/ChangeLog | 7 ++ doc/reference/Makefile.am | 6 +- doc/reference/clutter-sections.txt | 1 + doc/reference/tmpl/clutter-group.sgml | 2 +- doc/reference/tmpl/clutter-main.sgml | 5 + doc/reference/tmpl/clutter-marshal.sgml | 53 ---------- doc/reference/tmpl/clutter-timeline.sgml | 23 +++++ 19 files changed, 309 insertions(+), 74 deletions(-) diff --git a/ChangeLog b/ChangeLog index bebb6cabc..79909c46d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2006-06-22 Emmanuele Bassi + + * 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 * clutter/clutter-util.c: And more diff --git a/bindings/ChangeLog b/bindings/ChangeLog index db4a8dec7..529d84980 100644 --- a/bindings/ChangeLog +++ b/bindings/ChangeLog @@ -1,3 +1,11 @@ +2006-06-22 Emmanuele Bassi + + * 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 * python/Makefile.am: diff --git a/bindings/python/Makefile.am b/bindings/python/Makefile.am index 2ac69026b..c1224b886 100644 --- a/bindings/python/Makefile.am +++ b/bindings/python/Makefile.am @@ -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 \ diff --git a/bindings/python/clutter-base-types.defs b/bindings/python/clutter-base-types.defs index 329861ae1..5f3e5a5c1 100644 --- a/bindings/python/clutter-base-types.defs +++ b/bindings/python/clutter-base-types.defs @@ -77,6 +77,15 @@ ) ) +;; Interfaces + +(define-interface Media + (in-module "Clutter") + (c-name "ClutterMedia") + (gtype-id "CLUTTER_TYPE_MEDIA") + (vtable "ClutterMediaInterface") +) + ;; Objects (define-object CloneTexture @@ -135,6 +144,15 @@ (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 diff --git a/bindings/python/clutter-base.defs b/bindings/python/clutter-base.defs index 25ffb2f8d..b88c033ca 100644 --- a/bindings/python/clutter-base.defs +++ b/bindings/python/clutter-base.defs @@ -59,6 +59,12 @@ ) ) +(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") @@ -162,6 +168,102 @@ +;; 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 @@ -685,6 +787,21 @@ +;; 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 diff --git a/bindings/python/clutter.override b/bindings/python/clutter.override index f5784ee68..8f1f25451 100644 --- a/bindings/python/clutter.override +++ b/bindings/python/clutter.override @@ -5,6 +5,7 @@ headers #include "pygobject.h" #include #include +#include #include #include #include @@ -13,6 +14,7 @@ headers #include #include #include +#include #include #include #include diff --git a/clutter/clutter-actor.h b/clutter/clutter-actor.h index 4709c1c36..c997afdc8 100644 --- a/clutter/clutter-actor.h +++ b/clutter/clutter-actor.h @@ -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); diff --git a/clutter/clutter-group.c b/clutter/clutter-group.c index 5b3403420..a7fefef96 100644 --- a/clutter/clutter-group.c +++ b/clutter/clutter-group.c @@ -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; diff --git a/clutter/clutter-group.h b/clutter/clutter-group.h index 88c12da4e..1cd330dbc 100644 --- a/clutter/clutter-group.h +++ b/clutter/clutter-group.h @@ -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 diff --git a/clutter/clutter-marshal.list b/clutter/clutter-marshal.list index 51c291eeb..fdbbf5afd 100644 --- a/clutter/clutter-marshal.list +++ b/clutter/clutter-marshal.list @@ -1,5 +1,7 @@ VOID:INT64,INT64,FLOAT,BOOLEAN VOID:STRING,BOOLEAN,BOOLEAN +VOID:INT VOID:INT,INT VOID:BOXED VOID:OBJECT +VOID:VOID diff --git a/clutter/clutter-timeline.c b/clutter/clutter-timeline.c index ffc1b1dbb..78964cc1f 100644 --- a/clutter/clutter-timeline.c +++ b/clutter/clutter-timeline.c @@ -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); } diff --git a/clutter/clutter-timeline.h b/clutter/clutter-timeline.h index f91677380..84faadeeb 100644 --- a/clutter/clutter-timeline.h +++ b/clutter/clutter-timeline.h @@ -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); diff --git a/doc/reference/ChangeLog b/doc/reference/ChangeLog index 90081b231..2bf71b742 100644 --- a/doc/reference/ChangeLog +++ b/doc/reference/ChangeLog @@ -1,3 +1,10 @@ +2006-06-22 Emmanuele Bassi + + * clutter-sections.txt: Add clutter_timeline_get_loop(). + + * Makefile.am: Add clutter-marshal.h to the ignored header + files. + 2006-06-22 Emmanuele Bassi * clutter-docs.sgml: Fix typos. diff --git a/doc/reference/Makefile.am b/doc/reference/Makefile.am index b4ed0dcb3..24bda45ab 100644 --- a/doc/reference/Makefile.am +++ b/doc/reference/Makefile.am @@ -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 diff --git a/doc/reference/clutter-sections.txt b/doc/reference/clutter-sections.txt index 410de02ed..8725405b9 100644 --- a/doc/reference/clutter-sections.txt +++ b/doc/reference/clutter-sections.txt @@ -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 diff --git a/doc/reference/tmpl/clutter-group.sgml b/doc/reference/tmpl/clutter-group.sgml index 71d8f977a..d1baee374 100644 --- a/doc/reference/tmpl/clutter-group.sgml +++ b/doc/reference/tmpl/clutter-group.sgml @@ -80,7 +80,7 @@ ClutterGroup -@group: +@self: @first_actor: @args: diff --git a/doc/reference/tmpl/clutter-main.sgml b/doc/reference/tmpl/clutter-main.sgml index cc510414b..b64dc4e88 100644 --- a/doc/reference/tmpl/clutter-main.sgml +++ b/doc/reference/tmpl/clutter-main.sgml @@ -62,6 +62,11 @@ clutter-main @a...: @a...: @a...: +@a...: +@a...: +@a...: +@a...: +@a...: @a...: diff --git a/doc/reference/tmpl/clutter-marshal.sgml b/doc/reference/tmpl/clutter-marshal.sgml index 965a1853c..5bc8daf4d 100644 --- a/doc/reference/tmpl/clutter-marshal.sgml +++ b/doc/reference/tmpl/clutter-marshal.sgml @@ -17,56 +17,3 @@ clutter-marshal - - - - - -@closure: -@return_value: -@n_param_values: -@param_values: -@invocation_hint: -@marshal_data: - - - - - - - -@closure: -@return_value: -@n_param_values: -@param_values: -@invocation_hint: -@marshal_data: - - - - - - - -@closure: -@return_value: -@n_param_values: -@param_values: -@invocation_hint: -@marshal_data: - - - - - - - - - - - - - - - - diff --git a/doc/reference/tmpl/clutter-timeline.sgml b/doc/reference/tmpl/clutter-timeline.sgml index 82cc46f9d..2aadb011a 100644 --- a/doc/reference/tmpl/clutter-timeline.sgml +++ b/doc/reference/tmpl/clutter-timeline.sgml @@ -38,6 +38,20 @@ ClutterTimeline @cluttertimeline: the object which received the signal. @arg1: + + + + + +@cluttertimeline: the object which received the signal. + + + + + + +@cluttertimeline: the object which received the signal. + @@ -105,6 +119,15 @@ ClutterTimeline @loop: + + + + + +@timeline: +@Returns: + +