From 491e3ca9d29555642c2533b5b8f830dfe73a4141 Mon Sep 17 00:00:00 2001 From: Matthew Allum Date: Fri, 17 Nov 2006 18:24:28 +0000 Subject: [PATCH] 2006-11-17 Matthew Allum * clutter/clutter-alpha.c: * clutter/clutter-behaviour-opacity.c: More docs. * clutter/clutter-behaviour-path.h: * clutter/clutter-behaviour-path.c: More docs, add clutter_behaviour_path_insert_knot(), clutter_behaviour_path_remove_knot() * clutter/clutter-behaviour-scale.h: * clutter/clutter-behaviour-scale.c: More docs, add clutter_behaviour_scale_newx() taking fixed values. * clutter/Makefile.am: * clutter/pango/Makefile.am: Fix linking warning. --- ChangeLog | 42 ++++++++++++ clutter/Makefile.am | 2 +- clutter/clutter-alpha.c | 4 +- clutter/clutter-behaviour-opacity.c | 21 ++++++ clutter/clutter-behaviour-path.c | 123 +++++++++++++++++++++++++++++++++++- clutter/clutter-behaviour-path.h | 7 ++ clutter/clutter-behaviour-scale.c | 45 +++++++++++-- clutter/clutter-behaviour-scale.h | 5 ++ clutter/pango/Makefile.am | 8 +-- 9 files changed, 242 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index e93f9e3..051102a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,45 @@ +2006-11-17 Matthew Allum + + * clutter/clutter-alpha.c: + * clutter/clutter-behaviour-opacity.c: + More docs. + + * clutter/clutter-behaviour-path.h: + * clutter/clutter-behaviour-path.c: + More docs, add clutter_behaviour_path_insert_knot(), + clutter_behaviour_path_remove_knot() + + * clutter/clutter-behaviour-scale.h: + * clutter/clutter-behaviour-scale.c: + More docs, add clutter_behaviour_scale_newx() taking fixed values. + + * clutter/Makefile.am: + * clutter/pango/Makefile.am: + Fix linking warning. + +2006-11-15 Matthew Allum + + * clutter/clutter-actor.h: + * clutter/clutter-actor.c: + Add new API clutter_actor_move_by(), clutter_actor_get_size() + + * clutter/clutter-alpha.c: + * clutter/clutter-alpha.h: + Add clutter alpha sine func + + * clutter/clutter-behaviours.h: + * clutter/clutter-behaviours.c: + Add a basic scale behaviour (needs work) + + * examples/behave.c: (main): + More playing with new behaviour functionality + + * clutter/clutter-feature.c: + * clutter/clutter-feature.h: + * clutter/clutter-main.c: + Add new experimental sync to vblank code + Set env CLUTTER_VBLANK=none to disable. + 2006-11-16 Emmanuele Bassi * clutter/clutter-private.h: diff --git a/clutter/Makefile.am b/clutter/Makefile.am index a1848d0..e2bb60c 100644 --- a/clutter/Makefile.am +++ b/clutter/Makefile.am @@ -108,7 +108,7 @@ INCLUDES = @GCC_FLAGS@ @CLUTTER_CFLAGS@ -I$(top_srcdir) -I$(top_srcdir)/clutter/ lib_LTLIBRARIES = libclutter-@CLUTTER_MAJORMINOR@.la libclutter_@CLUTTER_MAJORMINOR@_la_LIBADD = \ - @CLUTTER_LIBS@ $(top_srcdir)/clutter/pango/libpangoclutter.a + @CLUTTER_LIBS@ $(top_srcdir)/clutter/pango/libpangoclutter.la libclutter_@CLUTTER_MAJORMINOR@_la_LDFLAGS = @CLUTTER_LT_LDFLAGS@ libclutter_@CLUTTER_MAJORMINOR@_la_DEPENDENCIES = \ $(top_srcdir)/clutter/pango/libpangoclutter.a diff --git a/clutter/clutter-alpha.c b/clutter/clutter-alpha.c index c0adeab..8f5338f 100644 --- a/clutter/clutter-alpha.c +++ b/clutter/clutter-alpha.c @@ -30,8 +30,8 @@ * @short_description: A class for calculating an alpha value as a function * of time. * - * #ClutterAlpha is a class for calculating an alpha value as a function - * of time. + * #ClutterAlpha is a class for calculating an integer value between + * 0 and CLUTTER_ALPHA_MAX_ALPHA as a function of time. */ #ifdef HAVE_CONFIG_H diff --git a/clutter/clutter-behaviour-opacity.c b/clutter/clutter-behaviour-opacity.c index 810f2c0..9efe438 100644 --- a/clutter/clutter-behaviour-opacity.c +++ b/clutter/clutter-behaviour-opacity.c @@ -23,6 +23,15 @@ * Boston, MA 02111-1307, USA. */ +/** + * SECTION:clutter-behaviour-opacity + * @short_description: A behaviour class interpolating actors opacity between + * two values. + * + * #ClutterBehaviourPath interpolates actors opacity between two values. + * + */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -107,6 +116,18 @@ clutter_behaviour_opacity_init (ClutterBehaviourOpacity *self) self->priv = CLUTTER_BEHAVIOUR_OPACITY_GET_PRIVATE (self); } +/** + * clutter_behaviour_opacity_new : + * @alpha: a #ClutterAlpha + * @scale_begin: initial opacity value + * @scale_end: final opacity value + * + * Creates a new #ClutterBehaviourOpacity instance. + * + * Return value: the newly created #ClutterBehaviourOpacity + * + * Since: 0.2 + */ ClutterBehaviour* clutter_behaviour_opacity_new (ClutterAlpha *alpha, guint8 opacity_start, diff --git a/clutter/clutter-behaviour-path.c b/clutter/clutter-behaviour-path.c index b3767a6..982b964 100644 --- a/clutter/clutter-behaviour-path.c +++ b/clutter/clutter-behaviour-path.c @@ -23,6 +23,16 @@ * Boston, MA 02111-1307, USA. */ +/** + * SECTION:clutter-behaviour-path + * @short_description: A behaviour class interpolating actors along a defined + * path. + * + * #ClutterBehaviourPath interpolates actors along a defined path of points. + * + */ + + #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -233,12 +243,14 @@ clutter_behaviour_path_init (ClutterBehaviourPath *self) /** * clutter_behaviour_path_new: * @alpha: a #ClutterAlpha - * @knots: a list of #ClutterKnots - * @n_knots: the number of nodes in the path + * @knots: a list of #ClutterKnots + * @n_knots: the number of nodes in the path * - * FIXME + * Creates a new #ClutterBehaviourPath instance for supplied knots. * * Return value: a #ClutterBehaviour + * + * Since: 0.2 */ ClutterBehaviour * clutter_behaviour_path_new (ClutterAlpha *alpha, @@ -262,6 +274,16 @@ clutter_behaviour_path_new (ClutterAlpha *alpha, return CLUTTER_BEHAVIOUR (behave); } +/** + * clutter_behaviour_path_get_knots: + * @behave: a #ClutterBehvaiourPath + * + * Returns a copy of the list of knots contained by the #ClutterBehvaiourPath + * + * Return value: a #GSList of the paths knots. + * + * Since: 0.2 + */ GSList * clutter_behaviour_path_get_knots (ClutterBehaviourPath *behave) { @@ -276,6 +298,15 @@ clutter_behaviour_path_get_knots (ClutterBehaviourPath *behave) return g_slist_reverse (retval); } +/** + * clutter_behaviour_path_append_knot: + * @pathb: a #ClutterBehvaiourPath + * @knot: a #ClutterKnot to append. + * + * Appends a #ClutterKnot to the path + * + * Since: 0.2 + */ void clutter_behaviour_path_append_knot (ClutterBehaviourPath *pathb, const ClutterKnot *knot) @@ -289,6 +320,72 @@ clutter_behaviour_path_append_knot (ClutterBehaviourPath *pathb, priv->knots = g_slist_append (priv->knots, clutter_knot_copy (knot)); } +/** + * clutter_behaviour_path_append_knot: + * @pathb: a #ClutterBehvaiourPath + * @offset: position in path to insert knot. + * @knot: a #ClutterKnot to append. + * + * Inserts a #ClutterKnot in the path at specified position. Values greater + * than total number of knots will append the knot at the end of path. + * + * Since: 0.2 + */ +void +clutter_behaviour_path_insert_knot (ClutterBehaviourPath *pathb, + guint offset, + const ClutterKnot *knot) +{ + ClutterBehaviourPathPrivate *priv; + + g_return_if_fail (CLUTTER_IS_BEHAVIOUR_PATH (pathb)); + g_return_if_fail (knot != NULL); + + priv = pathb->priv; + priv->knots = g_slist_insert (priv->knots, clutter_knot_copy (knot), offset); +} + +/** + * 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. + * + * Since: 0.2 + */ +void +clutter_behaviour_path_remove_knot (ClutterBehaviourPath *pathb, + guint offset) +{ + ClutterBehaviourPathPrivate *priv; + GSList *togo; + + g_return_if_fail (CLUTTER_IS_BEHAVIOUR_PATH (pathb)); + + priv = pathb->priv; + + togo = g_slist_nth (priv->knots, offset); + + if (togo) + { + clutter_knot_free ((ClutterKnot*)togo->data); + priv->knots = g_slist_delete_link (priv->knots, togo); + } +} + +/** + * 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, @@ -304,6 +401,18 @@ 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 + * @Varargs: additional knots to add to the path + * + * Adds a NULL-terminated list of knots to a path. This function is + * equivalent to calling clutter_behaviour_path_append_knot() for each + * member of the list. + * + * Since: 0.2 + */ void clutter_behaviour_path_append_knots (ClutterBehaviourPath *pathb, const ClutterKnot *first_knot, @@ -319,6 +428,14 @@ clutter_behaviour_path_append_knots (ClutterBehaviourPath *pathb, va_end (args); } +/** + * clutter_behaviour_path_clear: + * @pathb: a #ClutterBehvaiourPath + * + * Removes all knots from a path + * + * Since: 0.2 + */ void clutter_behaviour_path_clear (ClutterBehaviourPath *pathb) { diff --git a/clutter/clutter-behaviour-path.h b/clutter/clutter-behaviour-path.h index 52246e0..09100c2 100644 --- a/clutter/clutter-behaviour-path.h +++ b/clutter/clutter-behaviour-path.h @@ -93,6 +93,13 @@ void clutter_behaviour_path_append_knot (ClutterBehaviourPath *beh void clutter_behaviour_path_append_knots (ClutterBehaviourPath *pathb, const ClutterKnot *first_knot, ...) G_GNUC_NULL_TERMINATED; + +void clutter_behaviour_path_insert_knot (ClutterBehaviourPath *pathb, + guint offset, + const ClutterKnot *knot); +void clutter_behaviour_path_remove_knot (ClutterBehaviourPath *pathb, + guint offset); + void clutter_behaviour_path_clear (ClutterBehaviourPath *path); G_END_DECLS diff --git a/clutter/clutter-behaviour-scale.c b/clutter/clutter-behaviour-scale.c index 425614d..4cf62ce 100644 --- a/clutter/clutter-behaviour-scale.c +++ b/clutter/clutter-behaviour-scale.c @@ -23,6 +23,15 @@ * Boston, MA 02111-1307, USA. */ +/** + * SECTION:clutter-behaviour-scale + * @short_description: A behaviour class interpolating actors size between + * two values. + * + * #ClutterBehaviourPath interpolates actors size between two values. + * + */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -143,12 +152,14 @@ clutter_behaviour_scale_init (ClutterBehaviourScale *self) /** * clutter_behaviour_scale_new: * @alpha: a #ClutterAlpha - * @scale_begin: FIXME - * @scale_end: FIXME + * @scale_begin: initial scale factor + * @scale_end: final scale factor * - * FIXME + * Creates a new #ClutterBehaviourScale instance. * * Return value: the newly created #ClutterBehaviourScale + * + * Since: 0.2 */ ClutterBehaviour * clutter_behaviour_scale_new (ClutterAlpha *alpha, @@ -156,14 +167,38 @@ clutter_behaviour_scale_new (ClutterAlpha *alpha, gdouble scale_end, ClutterGravity gravity) { + return clutter_behaviour_scale_newx (alpha, + CLUTTER_FLOAT_TO_FIXED (scale_begin), + CLUTTER_FLOAT_TO_FIXED (scale_end), + gravity); +} + +/** + * clutter_behaviour_scale_newx: + * @alpha: a #ClutterAlpha + * @scale_begin: initial scale factor + * @scale_end: final scale factor + * + * A fixed point implementation of clutter_behaviour_scale_new() + * + * Return value: the newly created #ClutterBehaviourScale + * + * Since: 0.2 + */ +ClutterBehaviour * +clutter_behaviour_scale_newx (ClutterAlpha *alpha, + ClutterFixed scale_begin, + ClutterFixed scale_end, + ClutterGravity gravity) +{ ClutterBehaviourScale *behave; behave = g_object_new (CLUTTER_TYPE_BEHAVIOUR_SCALE, "alpha", alpha, NULL); - behave->priv->scale_begin = CLUTTER_FLOAT_TO_FIXED (scale_begin); - behave->priv->scale_end = CLUTTER_FLOAT_TO_FIXED (scale_end); + behave->priv->scale_begin = scale_begin; + behave->priv->scale_end = scale_end; behave->priv->gravity = gravity; return CLUTTER_BEHAVIOUR (behave); diff --git a/clutter/clutter-behaviour-scale.h b/clutter/clutter-behaviour-scale.h index fb2c6ba..fe34374 100644 --- a/clutter/clutter-behaviour-scale.h +++ b/clutter/clutter-behaviour-scale.h @@ -91,6 +91,11 @@ clutter_behaviour_scale_new (ClutterAlpha *alpha, gdouble scale_end, ClutterGravity gravity); +ClutterBehaviour* +clutter_behaviour_scale_newx (ClutterAlpha *alpha, + ClutterFixed scale_begin, + ClutterFixed scale_end, + ClutterGravity gravity); G_END_DECLS diff --git a/clutter/pango/Makefile.am b/clutter/pango/Makefile.am index adb5784..ea425b1 100644 --- a/clutter/pango/Makefile.am +++ b/clutter/pango/Makefile.am @@ -6,11 +6,11 @@ source_h = pangoclutter.h source_h_priv = pangoclutter-private.h -noinst_LIBRARIES = libpangoclutter.a +noinst_LTLIBRARIES = libpangoclutter.la -libpangoclutter_a_SOURCES = $(source_c) \ - $(source_h) \ - $(source_h_priv) +libpangoclutter_la_SOURCES = $(source_c) \ + $(source_h) \ + $(source_h_priv) INCLUDES = @GCC_FLAGS@ @CLUTTER_CFLAGS@ -I$(top_srcdir) -- 2.7.4