diff --git a/clutter/clutter-actor-private.h b/clutter/clutter-actor-private.h index 32da6e0da..2ef6aaafa 100644 --- a/clutter/clutter-actor-private.h +++ b/clutter/clutter-actor-private.h @@ -213,6 +213,7 @@ ClutterTransformInfo * _clutter_actor_get_transform_info typedef struct _AState { guint easing_duration; + guint easing_delay; ClutterAnimationMode easing_mode; } AState; diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index 19761cc4d..753def0fd 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -16764,6 +16764,8 @@ _clutter_actor_create_transition (ClutterActor *actor, clutter_transition_set_interval (res, interval); clutter_transition_set_remove_on_complete (res, TRUE); + clutter_timeline_set_delay (CLUTTER_TIMELINE (res), + info->cur_state->easing_delay); clutter_timeline_set_duration (CLUTTER_TIMELINE (res), info->cur_state->easing_duration); clutter_timeline_set_progress_mode (CLUTTER_TIMELINE (res), @@ -16906,6 +16908,63 @@ clutter_actor_get_easing_mode (ClutterActor *self) return CLUTTER_EASE_OUT_CUBIC; } +/** + * clutter_actor_set_easing_delay: + * @self: a #ClutterActor + * @msecs: the delay before the start of the tweening, in milliseconds + * + * Sets the delay that should be applied before tweening animatable + * properties. + * + * Calling this function will implicitly call + * clutter_actor_save_easing_state() if no previous calls to + * that function were made. + * + * Since: 1.10 + */ +void +clutter_actor_set_easing_delay (ClutterActor *self, + guint msecs) +{ + ClutterAnimationInfo *info; + + g_return_if_fail (CLUTTER_IS_ACTOR (self)); + + info = _clutter_actor_get_animation_info (self); + + if (info->states == NULL) + clutter_actor_save_easing_state (self); + + if (info->cur_state->easing_delay != msecs) + info->cur_state->easing_delay = msecs; +} + +/** + * clutter_actor_get_easing_delay: + * @self: a #ClutterActor + * + * Retrieves the delay that should be applied when tweening animatable + * properties. + * + * Return value: a delay, in milliseconds + * + * Since: 1.10 + */ +guint +clutter_actor_get_easing_delay (ClutterActor *self) +{ + const ClutterAnimationInfo *info; + + g_return_val_if_fail (CLUTTER_IS_ACTOR (self), 0); + + info = _clutter_actor_get_animation_info_or_defaults (self); + + if (info->cur_state != NULL) + return info->cur_state->easing_delay; + + return 0; +} + /** * clutter_actor_get_transition: * @self: a #ClutterActor @@ -16977,6 +17036,7 @@ clutter_actor_save_easing_state (ClutterActor *self) new_state.easing_mode = CLUTTER_EASE_OUT_CUBIC; new_state.easing_duration = 250; + new_state.easing_delay = 0; g_array_append_val (info->states, new_state); diff --git a/clutter/clutter-actor.h b/clutter/clutter-actor.h index 3993a22d5..2e4bd18e8 100644 --- a/clutter/clutter-actor.h +++ b/clutter/clutter-actor.h @@ -651,6 +651,9 @@ ClutterAnimationMode clutter_actor_get_easing_mode void clutter_actor_set_easing_duration (ClutterActor *self, guint msecs); guint clutter_actor_get_easing_duration (ClutterActor *self); +void clutter_actor_set_easing_delay (ClutterActor *self, + guint msecs); +guint clutter_actor_get_easing_delay (ClutterActor *self); ClutterTransition * clutter_actor_get_transition (ClutterActor *self, const char *name); diff --git a/clutter/clutter.symbols b/clutter/clutter.symbols index 662ac14f5..d5748f207 100644 --- a/clutter/clutter.symbols +++ b/clutter/clutter.symbols @@ -92,6 +92,7 @@ clutter_actor_get_constraint clutter_actor_get_constraints clutter_actor_get_default_paint_volume clutter_actor_get_depth +clutter_actor_get_easing_delay clutter_actor_get_easing_duration clutter_actor_get_easing_mode clutter_actor_get_effect @@ -213,6 +214,7 @@ clutter_actor_set_child_at_index clutter_actor_set_clip clutter_actor_set_clip_to_allocation clutter_actor_set_depth +clutter_actor_set_easing_delay clutter_actor_set_easing_duration clutter_actor_set_easing_mode clutter_actor_set_fixed_position_set diff --git a/doc/reference/clutter/clutter-sections.txt b/doc/reference/clutter/clutter-sections.txt index 8de47fdfc..6c2803e2b 100644 --- a/doc/reference/clutter/clutter-sections.txt +++ b/doc/reference/clutter/clutter-sections.txt @@ -454,6 +454,17 @@ clutter_actor_get_anchor_point_gravity clutter_actor_move_anchor_point clutter_actor_move_anchor_point_from_gravity + +clutter_actor_save_easing_state +clutter_actor_restore_easing_state +clutter_actor_set_easing_duration +clutter_actor_get_easing_duration +clutter_actor_set_easing_mode +clutter_actor_get_easing_mode +clutter_actor_set_easing_delay +clutter_actor_get_easing_delay +clutter_actor_get_transition + clutter_actor_set_reactive clutter_actor_get_reactive