From e6924b9c72d1658f352a98d768a6a93293ac5187 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Tue, 23 Oct 2018 20:43:17 +0900 Subject: [PATCH] elementary transit: add a convenient API. Summary: elm_transit_current_repeat_times_get() returns current repeating count of transition. @feature Reviewers: #committers, devilhorns Reviewed By: #committers, devilhorns Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7200 --- src/lib/elementary/elm_transit.c | 7 +++++++ src/lib/elementary/elm_transit.h | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/lib/elementary/elm_transit.c b/src/lib/elementary/elm_transit.c index 28a48a4103..d5fe10bde9 100644 --- a/src/lib/elementary/elm_transit.c +++ b/src/lib/elementary/elm_transit.c @@ -739,6 +739,13 @@ elm_transit_repeat_times_set(Elm_Transit *transit, int repeat) transit->repeat.current = 0; } +EAPI int +elm_transit_current_repeat_times_get(const Elm_Transit *transit) +{ + ELM_TRANSIT_CHECK_OR_RETURN(transit, 0); + return transit->repeat.current; +} + EAPI int elm_transit_repeat_times_get(const Elm_Transit *transit) { diff --git a/src/lib/elementary/elm_transit.h b/src/lib/elementary/elm_transit.h index abfeaea7ad..fb90def0d1 100644 --- a/src/lib/elementary/elm_transit.h +++ b/src/lib/elementary/elm_transit.h @@ -418,6 +418,22 @@ EAPI void elm_transit_repeat_times_set(Elm_Transit *transit, i */ EAPI int elm_transit_repeat_times_get(const Elm_Transit *transit); +/** + * Get current transit repeated count. + * + * @see elm_transit_repeat_times_set() + * + * @param transit The Transit object. + * @return Current repeated count. If @p transit is NULL + * 0 is returned + * + * @warning Return value is only valid when repeat times is set. + * @since 1.22 + * + * @ingroup Elm_Transit + */ +EAPI int elm_transit_current_repeat_times_get(const Elm_Transit *transit); + /** * Set the transit animation acceleration type. *