From 38a2383e8aea8727803faabadbcd45883c8e0e6d Mon Sep 17 00:00:00 2001 From: Michael BOUCHAUD Date: Fri, 22 Jun 2012 22:45:13 +0000 Subject: [PATCH] elementary: Add to the progressbar widget a changed signal to be emitted when the value is changed. Patch from Daniel Willmann. Thx SVN revision: 72709 --- legacy/elementary/ChangeLog | 10 ++++++++++ legacy/elementary/NEWS | 1 + legacy/elementary/src/lib/elm_progressbar.c | 12 +++++++++++- legacy/elementary/src/lib/elm_progressbar.h | 4 ++++ 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/legacy/elementary/ChangeLog b/legacy/elementary/ChangeLog index b44a213c94..6e2fa2b4fb 100644 --- a/legacy/elementary/ChangeLog +++ b/legacy/elementary/ChangeLog @@ -127,10 +127,12 @@ _Elm_Win_Smart_Data to allow grouping based on engine. 2012-05-29 Rob Bradford + * Move X related cursor items into their own substruct of Elm_Cursor to make supporting cursors on other platforms cleaner. 2012-05-30 Rob Bradford + * Add support for setting the cursor under Wayland: * Introduce a configure option and #define to as per other engines * Add always-built API function to allow identification of running @@ -190,13 +192,21 @@ After the item is long-pressed, it can be moved. 2012-06-14 Michael Bouchaud + * Add an enum to Elm_Calendar_Mark_Repeat_Type: ELM_CALENDAR_LAST_DAY_OF_MONTH 2012-06-15 Michael Bouchaud + * elm_progressbar: elm_progressbar_format_function_set to add a callback function to format the unit string. 2012-06-16 Davide Andreoli + * elm_map: add elm_map_overlay_del_cb_set to be notify when an overlay is deleted. + +2012-06-23 Daniel Willmann + + * elm_progressbar: Add "changed" signal to be emitted when the value + is changed. diff --git a/legacy/elementary/NEWS b/legacy/elementary/NEWS index 65874c6998..4fa906fa8e 100644 --- a/legacy/elementary/NEWS +++ b/legacy/elementary/NEWS @@ -14,6 +14,7 @@ Additions: * Add ELM_CALENDAR_LAST_DAY_OF_MONTH enum type * Add elm_progressbar_format_function_set API function * Add elm_map_overlay_del_cb_set API function + * Add "changed" signal to the progressbar widgets Fixes: diff --git a/legacy/elementary/src/lib/elm_progressbar.c b/legacy/elementary/src/lib/elm_progressbar.c index 1c23e0a218..db531bf01b 100644 --- a/legacy/elementary/src/lib/elm_progressbar.c +++ b/legacy/elementary/src/lib/elm_progressbar.c @@ -4,6 +4,8 @@ static const char PROGRESSBAR_SMART_NAME[] = "elm_progressbar"; +static const char SIG_CHANGED[] = "changed"; + #define MIN_RATIO_LVL 0.0 #define MAX_RATIO_LVL 1.0 @@ -54,11 +56,18 @@ struct _Elm_Progressbar_Smart_Data ((obj), PROGRESSBAR_SMART_NAME, __func__)) \ return +/* smart callbacks coming from elm progressbar objects (besides the + * ones coming from elm layout): */ +static const Evas_Smart_Cb_Description _smart_callbacks[] = { + {SIG_CHANGED, ""}, + {NULL, NULL} +}; + /* Inheriting from elm_layout. Besides, we need no more than what is * there */ EVAS_SMART_SUBCLASS_NEW (PROGRESSBAR_SMART_NAME, _elm_progressbar, Elm_Layout_Smart_Class, - Elm_Layout_Smart_Class, elm_layout_smart_class_get, NULL); + Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks); static const Elm_Layout_Part_Alias_Description _content_aliases[] = { @@ -364,6 +373,7 @@ elm_progressbar_value_set(Evas_Object *obj, _val_set(obj); _units_set(obj); + evas_object_smart_callback_call(obj, SIG_CHANGED, NULL); } EAPI double diff --git a/legacy/elementary/src/lib/elm_progressbar.h b/legacy/elementary/src/lib/elm_progressbar.h index 40b8840e51..75b7a1dd4f 100644 --- a/legacy/elementary/src/lib/elm_progressbar.h +++ b/legacy/elementary/src/lib/elm_progressbar.h @@ -33,6 +33,10 @@ * This widget inherits from the @ref Layout one, so that all the * functions acting on it also work for progress bar objects. * + * This widget emits the following signals, besides the ones sent from + * @ref Layout: + * @li @c "changed" - when the value is changed + * * This widget has the following styles: * - @c "default" * - @c "wheel" (simple style, no text, no progression, only