From 683cdf4cc1ad3e3aa10f1f33103b99ccc3686546 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 18 Jan 2008 11:02:34 +0000 Subject: [PATCH] 2008-01-18 Emmanuele Bassi * clutter.symbols: Add ClutterBehaviourOpacity accessors. * clutter/clutter-behaviour-opacity.h: * clutter/clutter-behaviour-opacity.c: (clutter_behaviour_opacity_set_bounds), (clutter_behaviour_opacity_get_bounds): Add accessors for the opacity-start and opacity-end properties. * clutter/clutter-behaviour-scale.h: Fix the argument name to avoid complaints by gtk-doc. --- ChangeLog | 13 ++++++ clutter.symbols | 2 + clutter/clutter-behaviour-opacity.c | 65 +++++++++++++++++++++++++++++ clutter/clutter-behaviour-opacity.h | 7 ++++ clutter/clutter-behaviour-scale.h | 12 +++--- doc/reference/ChangeLog | 5 +++ doc/reference/clutter-sections.txt | 2 + 7 files changed, 100 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9e73baa9a..c6674523e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2008-01-18 Emmanuele Bassi + + * clutter.symbols: Add ClutterBehaviourOpacity accessors. + + * clutter/clutter-behaviour-opacity.h: + * clutter/clutter-behaviour-opacity.c: + (clutter_behaviour_opacity_set_bounds), + (clutter_behaviour_opacity_get_bounds): Add accessors for the + opacity-start and opacity-end properties. + + * clutter/clutter-behaviour-scale.h: Fix the argument name to + avoid complaints by gtk-doc. + 2008-01-17 Emmanuele Bassi * clutter/clutter-behaviour-scale.c: diff --git a/clutter.symbols b/clutter.symbols index cd8212d14..6872f2ccb 100644 --- a/clutter.symbols +++ b/clutter.symbols @@ -142,8 +142,10 @@ clutter_behaviour_get_n_actors clutter_behaviour_get_nth_actor clutter_behaviour_get_type clutter_behaviour_is_applied +clutter_behaviour_opacity_get_bounds clutter_behaviour_opacity_get_type clutter_behaviour_opacity_new +clutter_behaviour_opacity_set_bounds clutter_behaviour_path_append_knot clutter_behaviour_path_append_knots clutter_behaviour_path_clear diff --git a/clutter/clutter-behaviour-opacity.c b/clutter/clutter-behaviour-opacity.c index 4d7a8ebd7..f31099442 100644 --- a/clutter/clutter-behaviour-opacity.c +++ b/clutter/clutter-behaviour-opacity.c @@ -232,3 +232,68 @@ clutter_behaviour_opacity_new (ClutterAlpha *alpha, NULL); } +/** + * clutter_behaviour_opacity_set_bounds: + * @behaviour: a #ClutterBehaviourOpacity + * @opacity_start: minimum level of opacity + * @opacity_end: maximum level of opacity + * + * Sets the initial and final levels of the opacity applied by @behaviour + * on each actor it controls. + * + * Since: 0.6 + */ +void +clutter_behaviour_opacity_set_bounds (ClutterBehaviourOpacity *behaviour, + guint8 opacity_start, + guint8 opacity_end) +{ + ClutterBehaviourOpacityPrivate *priv; + + g_return_if_fail (CLUTTER_IS_BEHAVIOUR_OPACITY (behaviour)); + + priv = behaviour->priv; + + g_object_freeze_notify (G_OBJECT (behaviour)); + + if (priv->opacity_start != opacity_start) + { + priv->opacity_start = opacity_start; + + g_object_notify (G_OBJECT (behaviour), "opacity-start"); + } + + if (priv->opacity_end != opacity_end) + { + priv->opacity_end = opacity_end; + + g_object_notify (G_OBJECT (behaviour), "opacity-end"); + } + + g_object_thaw_notify (G_OBJECT (behaviour)); +} + +/** + * clutter_behaviour_opacity_get_bounds: + * @behaviour: a #ClutterBehaviourOpacity + * @opacity_start: return location for the minimum level of opacity, or %NULL + * @opacity_end: return location for the maximum level of opacity, or %NULL + * + * Gets the initial and final levels of the opacity applied by @behaviour + * on each actor it controls. + * + * Since: 0.6 + */ +void +clutter_behaviour_opacity_get_bounds (ClutterBehaviourOpacity *behaviour, + guint8 *opacity_start, + guint8 *opacity_end) +{ + g_return_if_fail (CLUTTER_IS_BEHAVIOUR_OPACITY (behaviour)); + + if (opacity_start) + *opacity_start = behaviour->priv->opacity_start; + + if (opacity_end) + *opacity_end = behaviour->priv->opacity_end; +} diff --git a/clutter/clutter-behaviour-opacity.h b/clutter/clutter-behaviour-opacity.h index 488d64090..a888640d2 100644 --- a/clutter/clutter-behaviour-opacity.h +++ b/clutter/clutter-behaviour-opacity.h @@ -77,6 +77,13 @@ ClutterBehaviour *clutter_behaviour_opacity_new (ClutterAlpha *alpha, guint8 opacity_start, guint8 opacity_end); +void clutter_behaviour_opacity_set_bounds (ClutterBehaviourOpacity *behaviour, + guint8 opacity_start, + guint8 opacity_end); +void clutter_behaviour_opacity_get_bounds (ClutterBehaviourOpacity *behaviour, + guint8 *opacity_start, + guint8 *opacity_end); + G_END_DECLS diff --git a/clutter/clutter-behaviour-scale.h b/clutter/clutter-behaviour-scale.h index 7cc4e4cec..138187f3c 100644 --- a/clutter/clutter-behaviour-scale.h +++ b/clutter/clutter-behaviour-scale.h @@ -76,12 +76,12 @@ struct _ClutterBehaviourScaleClass GType clutter_behaviour_scale_get_type (void) G_GNUC_CONST; -ClutterBehaviour *clutter_behaviour_scale_new (ClutterAlpha *alpha, - gdouble x_scale_start, - gdouble y_scale_start, - gdouble x_scale_end, - gdouble z_scale_end, - ClutterGravity gravity); +ClutterBehaviour *clutter_behaviour_scale_new (ClutterAlpha *alpha, + gdouble x_scale_start, + gdouble y_scale_start, + gdouble x_scale_end, + gdouble y_scale_end, + ClutterGravity gravity); ClutterBehaviour *clutter_behaviour_scale_newx (ClutterAlpha *alpha, ClutterFixed x_scale_start, ClutterFixed y_scale_start, diff --git a/doc/reference/ChangeLog b/doc/reference/ChangeLog index 53b6656c6..96f21f2d6 100644 --- a/doc/reference/ChangeLog +++ b/doc/reference/ChangeLog @@ -1,3 +1,8 @@ +2008-01-18 Emmanuele Bassi + + * clutter-sections.txt: Add the new ClutterBehaviourOpacity + accessors. + 2008-01-17 Emmanuele Bassi * clutter-sections.txt: Add the new ClutterBehaviourScale setters. diff --git a/doc/reference/clutter-sections.txt b/doc/reference/clutter-sections.txt index 30c19fdfa..362e93980 100644 --- a/doc/reference/clutter-sections.txt +++ b/doc/reference/clutter-sections.txt @@ -600,6 +600,8 @@ clutter_behaviour_path_get_type ClutterBehaviourOpacity ClutterBehaviourOpacityClass clutter_behaviour_opacity_new +clutter_behaviour_opacity_set_bounds +clutter_behaviour_opacity_get_bounds CLUTTER_BEHAVIOUR_OPACITY CLUTTER_IS_BEHAVIOUR_OPACITY