From 9c601d5436f0b7184b5aa43435be451c88a1fbbb Mon Sep 17 00:00:00 2001 From: Tiago Rezende Campos Falcao Date: Wed, 27 Oct 2010 14:38:45 +0000 Subject: [PATCH] Add missing getters to elm_button SVN revision: 53920 --- src/lib/Elementary.h.in | 3 +++ src/lib/elm_button.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in index 5969df0..b79a0df 100644 --- a/src/lib/Elementary.h.in +++ b/src/lib/Elementary.h.in @@ -599,8 +599,11 @@ extern "C" { EAPI Evas_Object *elm_button_icon_get(const Evas_Object *obj); EAPI Evas_Object *elm_button_icon_unset(Evas_Object *obj); EAPI void elm_button_autorepeat_set(Evas_Object *obj, Eina_Bool on); + EAPI Eina_Bool elm_button_autorepeat_get(const Evas_Object *obj); EAPI void elm_button_autorepeat_initial_timeout_set(Evas_Object *obj, double t); + EAPI double elm_button_autorepeat_initial_timeout_get(const Evas_Object *obj); EAPI void elm_button_autorepeat_gap_timeout_set(Evas_Object *obj, double t); + EAPI double elm_button_autorepeat_gap_timeout_get(const Evas_Object *obj); EAPI Evas_Object *elm_fileselector_button_add(Evas_Object *parent); EAPI void elm_fileselector_button_label_set(Evas_Object *obj, const char *label); diff --git a/src/lib/elm_button.c b/src/lib/elm_button.c index 04a84ee..c1dc59e 100644 --- a/src/lib/elm_button.c +++ b/src/lib/elm_button.c @@ -468,6 +468,23 @@ elm_button_autorepeat_set(Evas_Object *obj, Eina_Bool on) } /** + * Get if autorepeat event is on + * + * @param obj The button object + * @return If autorepeat is on + * + * @ingroup Button + */ +EAPI Eina_Bool +elm_button_autorepeat_get(const Evas_Object *obj) +{ + ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return EINA_FALSE; + return wd->autorepeat; +} + +/** * Set the initial timeout before the autorepeat event is generated * * @param obj The button object @@ -491,6 +508,23 @@ elm_button_autorepeat_initial_timeout_set(Evas_Object *obj, double t) } /** + * Get the initial timeout before the autorepeat event is generated + * + * @param obj The button object + * @return Timeout + * + * @ingroup Button + */ +EAPI double +elm_button_autorepeat_initial_timeout_get(const Evas_Object *obj) +{ + ELM_CHECK_WIDTYPE(obj, widtype) 0.0; + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return 0.0; + return wd->ar_threshold; +} + +/** * Set the interval between each generated autorepeat event * * @param obj The button object @@ -498,7 +532,7 @@ elm_button_autorepeat_initial_timeout_set(Evas_Object *obj, double t) * * @ingroup Button */ -EAPI void +EAPI void elm_button_autorepeat_gap_timeout_set(Evas_Object *obj, double t) { ELM_CHECK_WIDTYPE(obj, widtype); @@ -509,3 +543,20 @@ elm_button_autorepeat_gap_timeout_set(Evas_Object *obj, double t) wd->ar_interval = t; if ((wd->repeating) && (wd->timer)) ecore_timer_interval_set(wd->timer, t); } + +/** + * Get the interval between each generated autorepeat event + * + * @param obj The button object + * @return Interval + * + * @ingroup Button + */ +EAPI double +elm_button_autorepeat_gap_timeout_get(const Evas_Object *obj) +{ + ELM_CHECK_WIDTYPE(obj, widtype) 0.0; + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return 0.0; + return wd->ar_interval; +} -- 2.7.4