From 0d287fc4d407d0ce1cf7d9d00cad0494d4ebd3ed Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Sun, 29 Jul 2007 08:54:24 +0000 Subject: [PATCH] 2007-07-29 Emmanuele Bassi * clutter/clutter-behaviour-ellipse.c: Documentation fixes; kill some indirections; freeze the notification queue when (potentially) emitting multiple notify signals. * clutter/clutter-alpha.h: Remove the unused macro CLUTTER_TYPE_SMOOTHSTEP. --- ChangeLog | 10 +++++++++ clutter/clutter-alpha.h | 2 -- clutter/clutter-behaviour-ellipse.c | 32 ++++++++++++++--------------- doc/reference/clutter-sections.txt | 1 - 4 files changed, 26 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index b1ac4fc73..2557efd5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2007-07-29 Emmanuele Bassi + + * clutter/clutter-behaviour-ellipse.c: Documentation + fixes; kill some indirections; freeze the notification + queue when (potentially) emitting multiple notify + signals. + + * clutter/clutter-alpha.h: Remove the unused macro + CLUTTER_TYPE_SMOOTHSTEP. + 2007-07-28 Emmanuele Bassi * clutter/clutter-actor.[ch]: Use GInitiallyUnowned diff --git a/clutter/clutter-alpha.h b/clutter/clutter-alpha.h index 8c3bbd259..c6a65b0f4 100644 --- a/clutter/clutter-alpha.h +++ b/clutter/clutter-alpha.h @@ -115,8 +115,6 @@ ClutterTimeline *clutter_alpha_get_timeline (ClutterAlpha *alpha); #define CLUTTER_ALPHA_EXP_INC clutter_exp_inc_func #define CLUTTER_ALPHA_EXP_DEC clutter_exp_dec_func -#define CLUTTER_TYPE_SMOOTHSTEP (clutter_smoothstep_get_type ()) - guint32 clutter_ramp_inc_func (ClutterAlpha *alpha, gpointer dummy); guint32 clutter_ramp_dec_func (ClutterAlpha *alpha, diff --git a/clutter/clutter-behaviour-ellipse.c b/clutter/clutter-behaviour-ellipse.c index 9bdcbee57..c1168334e 100644 --- a/clutter/clutter-behaviour-ellipse.c +++ b/clutter/clutter-behaviour-ellipse.c @@ -109,7 +109,7 @@ clutter_behaviour_ellipse_advance (ClutterBehaviourEllipse *e, y = CLUTTER_FIXED_INT (priv->b * clutter_sini (angle)); z = 0; - if (e->priv->angle_tilt_z) + if (priv->angle_tilt_z) { /* * x2 = r * cos (angle + tilt_z) @@ -131,7 +131,7 @@ clutter_behaviour_ellipse_advance (ClutterBehaviourEllipse *e, y = CLUTTER_FIXED_INT (y2); } - if (e->priv->angle_tilt_x) + if (priv->angle_tilt_x) { ClutterFixed z2, y2; @@ -143,7 +143,7 @@ clutter_behaviour_ellipse_advance (ClutterBehaviourEllipse *e, y = CLUTTER_FIXED_INT (y2); } - if (e->priv->angle_tilt_y) + if (priv->angle_tilt_y) { ClutterFixed x2, z2; @@ -197,7 +197,7 @@ clutter_behaviour_ellipse_alpha_notify (ClutterBehaviour *behave, else { angle = priv->angle_begin - - (abs(priv->angle_begin - priv->angle_end) * alpha) + - (abs (priv->angle_begin - priv->angle_end) * alpha) / CLUTTER_ALPHA_MAX_ALPHA; } @@ -492,11 +492,12 @@ clutter_behaviour_ellipse_init (ClutterBehaviourEllipse * self) * @end: angle in degrees at which movement ends * * Creates a behaviour that drives actors along an elliptical path with - * given center, width and height; the movement begins at angle_begin (with 0 - * corresponding to 12 o'clock) and ends at angle_end; if angle_end > angle_begin, - * the movement is in clockwise direction, counter-clockwise otherwise. + * given center, width and height; the movement begins at @angle_begin + * degrees (with 0 corresponding to 12 o'clock) and ends at @angle_end degrees; + * if @angle_end is greater than @angle_begin, the movement is in clockwise + * direction, counter-clockwise otherwise. * - * Return value: a #ClutterBehaviour + * Return value: the newly created #ClutterBehaviourEllipse * * Since: 0.4 */ @@ -536,12 +537,10 @@ clutter_behaviour_ellipse_new (ClutterAlpha *alpha, * @begin: #ClutterFixed angle in degrees at which movement begins * @end: #ClutterFixed angle in degrees at which movement ends * - * Creates a behaviour that drives actors along an elliptical path with - * given center, width and height; the movement begins at angle_begin (with 0 - * corresponding to 12 o'clock) and ends at angle_end; if angle_end > angle_begin, - * the movement is in clockwise direction, counter-clockwise otherwise. + * Creates a behaviour that drives actors along an elliptical path. This + * is the fixed point variant of clutter_behaviour_ellipse_new(). * - * Return value: a #ClutterBehaviour + * Return value: the newly created #ClutterBehaviourEllipse * * Since: 0.4 */ @@ -1074,6 +1073,8 @@ clutter_behaviour_ellipse_set_tiltx (ClutterBehaviourEllipse *self, priv = self->priv; + g_object_freeze_notify (G_OBJECT (self)); + if (priv->angle_tilt_x != new_angle_x) { priv->angle_tilt_x = new_angle_x; @@ -1094,6 +1095,8 @@ clutter_behaviour_ellipse_set_tiltx (ClutterBehaviourEllipse *self, g_object_notify (G_OBJECT (self), "angle-tilt-z"); } + + g_object_thaw_notify (G_OBJECT (self)); } /** @@ -1211,11 +1214,8 @@ clutter_behaviour_ellipse_set_direction (ClutterBehaviourEllipse *self, if (priv->direction != direction) { - g_object_ref (self); - priv->direction = direction; g_object_notify (G_OBJECT (self), "direction"); - g_object_unref (self); } } diff --git a/doc/reference/clutter-sections.txt b/doc/reference/clutter-sections.txt index 798d0bc2b..d0ec6aec6 100644 --- a/doc/reference/clutter-sections.txt +++ b/doc/reference/clutter-sections.txt @@ -152,7 +152,6 @@ CLUTTER_TYPE_ALPHA CLUTTER_ALPHA_CLASS CLUTTER_IS_ALPHA_CLASS CLUTTER_ALPHA_GET_CLASS -CLUTTER_TYPE_SMOOTHSTEP ClutterAlphaPrivate clutter_alpha_get_type