diff --git a/ChangeLog b/ChangeLog index be33af3e7..b274278b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2008-01-21 Emmanuele Bassi,,, + + * clutter/clutter-behaviour-depth.h: + * clutter/clutter-behaviour-depth.c: + (clutter_behaviour_depth_set_bounds), + (clutter_behaviour_depth_get_bounds): Add the depth-start and + depth-end accessors. + + * tests/test-depth.c (timeline_completed): Use set_bounds() + instead of g_object_set(). + + * clutter.symbols: Add clutter_behaviour_depth_set_bounds() + and clutter_behaviour_opacity_get_bounds() to the list of + public symbols. + 2008-01-21 Emmanuele Bassi * clutter/clutter-behaviour-scale.c: Use separate variables for diff --git a/clutter.symbols b/clutter.symbols index 6872f2ccb..4499c6d7a 100644 --- a/clutter.symbols +++ b/clutter.symbols @@ -107,8 +107,10 @@ clutter_behaviour_bspline_new clutter_behaviour_bspline_set_origin clutter_behaviour_bspline_split clutter_behaviour_bspline_truncate +clutter_behaviour_depth_get_bounds clutter_behaviour_depth_get_type clutter_behaviour_depth_new +clutter_behaviour_depth_set_bounds clutter_behaviour_ellipse_get_angle_begin clutter_behaviour_ellipse_get_angle_beginx clutter_behaviour_ellipse_get_angle_end diff --git a/clutter/clutter-behaviour-depth.c b/clutter/clutter-behaviour-depth.c index 9e7728f41..028041ffc 100644 --- a/clutter/clutter-behaviour-depth.c +++ b/clutter/clutter-behaviour-depth.c @@ -203,8 +203,8 @@ clutter_behaviour_depth_init (ClutterBehaviourDepth *depth) /** * clutter_behaviour_depth_new: * @alpha: a #ClutterAlpha or %NULL - * @depth_start: start depth - * @depth_end: end depth + * @depth_start: initial value of the depth + * @depth_end: final value of the depth * * Creates a new #ClutterBehaviourDepth which can be used to control * the ClutterActor:depth property of a set of #ClutterActors. @@ -226,3 +226,65 @@ clutter_behaviour_depth_new (ClutterAlpha *alpha, "depth-end", depth_end, NULL); } + +/** + * clutter_behaviour_depth_set_bounds: + * @behaviour: a #ClutterBehaviourDepth + * @depth_start: initial value of the depth + * @depth_end: final value of the depth + * + * Sets the boundaries of the @behaviour. + * + * Since: 0.6 + */ +void +clutter_behaviour_depth_set_bounds (ClutterBehaviourDepth *behaviour, + gint depth_start, + gint depth_end) +{ + ClutterBehaviourDepthPrivate *priv; + + g_return_if_fail (CLUTTER_IS_BEHAVIOUR_DEPTH (behaviour)); + + priv = behaviour->priv; + + g_object_freeze_notify (G_OBJECT (behaviour)); + + if (priv->depth_start != depth_start) + { + priv->depth_start = depth_start; + g_object_notify (G_OBJECT (behaviour), "depth-start"); + } + + if (priv->depth_end != depth_end) + { + priv->depth_end = depth_end; + g_object_notify (G_OBJECT (behaviour), "depth-end"); + } + + g_object_thaw_notify (G_OBJECT (behaviour)); +} + +/** + * clutter_behaviour_depth_get_bounds: + * @behaviour: a #ClutterBehaviourDepth + * @depth_start: return location for the initial depth value, or %NULL + * @depth_end: return location for the final depth value, or %NULL + * + * Gets the boundaries of the @behaviour + * + * Since: 0.6 + */ +void +clutter_behaviour_depth_get_bounds (ClutterBehaviourDepth *behaviour, + gint *depth_start, + gint *depth_end) +{ + g_return_if_fail (CLUTTER_IS_BEHAVIOUR_DEPTH (behaviour)); + + if (depth_start) + *depth_start = behaviour->priv->depth_start; + + if (depth_end) + *depth_end = behaviour->priv->depth_end; +} diff --git a/clutter/clutter-behaviour-depth.h b/clutter/clutter-behaviour-depth.h index 9ff8e2f77..438a3755a 100644 --- a/clutter/clutter-behaviour-depth.h +++ b/clutter/clutter-behaviour-depth.h @@ -62,6 +62,13 @@ ClutterBehaviour *clutter_behaviour_depth_new (ClutterAlpha *alpha, gint depth_start, gint depth_end); +void clutter_behaviour_depth_set_bounds (ClutterBehaviourDepth *behaviour, + gint depth_start, + gint depth_end); +void clutter_behaviour_depth_get_bounds (ClutterBehaviourDepth *behaviour, + gint *depth_start, + gint *depth_end); + G_END_DECLS #endif /* __CLUTTER_BEHAVIOUR_DEPTH__ */ diff --git a/doc/reference/ChangeLog b/doc/reference/ChangeLog index 9da5ad459..7f8e1274f 100644 --- a/doc/reference/ChangeLog +++ b/doc/reference/ChangeLog @@ -1,3 +1,8 @@ +2008-01-21 Emmanuele Bassi + + * clutter-sections.txt: Add ClutterBehaviourDepth properties + accessors. + 2008-01-18 Emmanuele Bassi * subclassing-ClutterActor.sgml: Fix up the wording and the diff --git a/doc/reference/clutter-sections.txt b/doc/reference/clutter-sections.txt index 362e93980..381e55833 100644 --- a/doc/reference/clutter-sections.txt +++ b/doc/reference/clutter-sections.txt @@ -838,12 +838,15 @@ clutter_log2x clutter_pow2x clutter_powx clutter_qmulx +clutter_qdivx clutter_tani + CFX_DIV CFX_INT CFX_MUL CFX_QMUL +CFX_QDIV
@@ -1082,6 +1085,8 @@ clutter_effect_template_get_type ClutterBehaviourDepth ClutterBehaviourDepthClass clutter_behaviour_depth_new +clutter_behaviour_depth_set_bounds +clutter_behaviour_depth_get_bounds CLUTTER_BEHAVIOUR_DEPTH CLUTTER_IS_BEHAVIOUR_DEPTH diff --git a/tests/test-depth.c b/tests/test-depth.c index 3b338c80d..436c95532 100644 --- a/tests/test-depth.c +++ b/tests/test-depth.c @@ -23,10 +23,8 @@ timeline_completed (ClutterTimeline *timeline, zoom_in = TRUE; } - g_object_set (G_OBJECT (d_behave), - "depth-start", depth_start, - "depth-end", depth_end, - NULL); + clutter_behaviour_depth_set_bounds (CLUTTER_BEHAVIOUR_DEPTH (d_behave), + depth_start, depth_end); clutter_timeline_rewind (timeline); clutter_timeline_start (timeline);