summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-07-22 12:27:20 +0200
committerXavi Artigas <xavierartigas@yahoo.es>2019-07-31 10:18:20 +0200
commitc0082b1c71ed63f982bb4b9aed2af4b50d46dabe (patch)
treecdb98e30f30f4f4c20c52403efdf98f08977a917 /src/lib
parent911eab34207f6f9355f4ed15009d57e079183849 (diff)
efl_ui_range_display: move events from spin
we concluded min,reached and max,reached should be on every widget that implements range_display. This here is the start of that work, the events are moved, next commit fixes all widgets, the last commits enables tests in the spec unit test. ref T7897 ref T7895 Differential Revision: https://phab.enlightenment.org/D9371
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/efl/interfaces/efl_ui_range_display.eo5
-rw-r--r--src/lib/elementary/efl_ui_datepicker.c6
-rw-r--r--src/lib/elementary/efl_ui_progressbar.c2
-rw-r--r--src/lib/elementary/efl_ui_progressbar.eo3
-rw-r--r--src/lib/elementary/efl_ui_slider.c4
-rw-r--r--src/lib/elementary/efl_ui_slider.eo3
-rw-r--r--src/lib/elementary/efl_ui_slider_interval.c8
-rw-r--r--src/lib/elementary/efl_ui_spin.c6
-rw-r--r--src/lib/elementary/efl_ui_spin.eo5
-rw-r--r--src/lib/elementary/efl_ui_timepicker.c4
-rw-r--r--src/lib/elementary/elc_player.c4
-rw-r--r--src/lib/elementary/elm_slider.c4
12 files changed, 25 insertions, 29 deletions
diff --git a/src/lib/efl/interfaces/efl_ui_range_display.eo b/src/lib/efl/interfaces/efl_ui_range_display.eo
index 39ca1b2113..172f58a821 100644
--- a/src/lib/efl/interfaces/efl_ui_range_display.eo
+++ b/src/lib/efl/interfaces/efl_ui_range_display.eo
@@ -48,4 +48,9 @@ interface @beta Efl.Ui.Range_Display
48 } 48 }
49 } 49 }
50 } 50 }
51 events {
52 changed: void; [[Emitted when the $range_value is getting changed]]
53 min,reached: void; [[Emitted when the $range_value has reached the minimum of $range_limits]]
54 max,reached: void; [[Emitted when the $range_value has reached the maximum of $range_limits]]
55 }
51} 56}
diff --git a/src/lib/elementary/efl_ui_datepicker.c b/src/lib/elementary/efl_ui_datepicker.c
index a8cf48d344..1aa472df6e 100644
--- a/src/lib/elementary/efl_ui_datepicker.c
+++ b/src/lib/elementary/efl_ui_datepicker.c
@@ -164,21 +164,21 @@ _fields_init(Eo *obj)
164 efl_ui_spin_button_circulate_set(efl_added, EINA_TRUE), 164 efl_ui_spin_button_circulate_set(efl_added, EINA_TRUE),
165 efl_ui_spin_button_editable_set(efl_added, EINA_TRUE), 165 efl_ui_spin_button_editable_set(efl_added, EINA_TRUE),
166 efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL), 166 efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL),
167 efl_event_callback_add(efl_added, EFL_UI_SPIN_EVENT_CHANGED,_field_changed_cb, obj)); 167 efl_event_callback_add(efl_added, EFL_UI_RANGE_EVENT_CHANGED,_field_changed_cb, obj));
168 168
169 pd->month = efl_add(EFL_UI_SPIN_BUTTON_CLASS, obj, 169 pd->month = efl_add(EFL_UI_SPIN_BUTTON_CLASS, obj,
170 efl_ui_range_limits_set(efl_added, 1, 12), 170 efl_ui_range_limits_set(efl_added, 1, 12),
171 efl_ui_spin_button_circulate_set(efl_added, EINA_TRUE), 171 efl_ui_spin_button_circulate_set(efl_added, EINA_TRUE),
172 efl_ui_spin_button_editable_set(efl_added, EINA_TRUE), 172 efl_ui_spin_button_editable_set(efl_added, EINA_TRUE),
173 efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL), 173 efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL),
174 efl_event_callback_add(efl_added, EFL_UI_SPIN_EVENT_CHANGED,_field_changed_cb, obj)); 174 efl_event_callback_add(efl_added, EFL_UI_RANGE_EVENT_CHANGED,_field_changed_cb, obj));
175 175
176 pd->day = efl_add(EFL_UI_SPIN_BUTTON_CLASS, obj, 176 pd->day = efl_add(EFL_UI_SPIN_BUTTON_CLASS, obj,
177 efl_ui_range_limits_set(efl_added, 1, 31), 177 efl_ui_range_limits_set(efl_added, 1, 31),
178 efl_ui_spin_button_circulate_set(efl_added, EINA_TRUE), 178 efl_ui_spin_button_circulate_set(efl_added, EINA_TRUE),
179 efl_ui_spin_button_editable_set(efl_added, EINA_TRUE), 179 efl_ui_spin_button_editable_set(efl_added, EINA_TRUE),
180 efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL), 180 efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL),
181 efl_event_callback_add(efl_added, EFL_UI_SPIN_EVENT_CHANGED,_field_changed_cb, obj)); 181 efl_event_callback_add(efl_added, EFL_UI_RANGE_EVENT_CHANGED,_field_changed_cb, obj));
182 182
183 DATE_GET(); 183 DATE_GET();
184 //Using system config? 184 //Using system config?
diff --git a/src/lib/elementary/efl_ui_progressbar.c b/src/lib/elementary/efl_ui_progressbar.c
index e206138d99..2386b82293 100644
--- a/src/lib/elementary/efl_ui_progressbar.c
+++ b/src/lib/elementary/efl_ui_progressbar.c
@@ -559,7 +559,7 @@ _progressbar_part_value_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, const char *pa
559 _val_set(obj); 559 _val_set(obj);
560 _units_set(obj); 560 _units_set(obj);
561 efl_event_callback_legacy_call 561 efl_event_callback_legacy_call
562 (obj, EFL_UI_PROGRESSBAR_EVENT_CHANGED, NULL); 562 (obj, EFL_UI_RANGE_EVENT_CHANGED, NULL);
563} 563}
564 564
565static double 565static double
diff --git a/src/lib/elementary/efl_ui_progressbar.eo b/src/lib/elementary/efl_ui_progressbar.eo
index ba8b3e37f2..c14bf2a3fe 100644
--- a/src/lib/elementary/efl_ui_progressbar.eo
+++ b/src/lib/elementary/efl_ui_progressbar.eo
@@ -67,7 +67,4 @@ class @beta Efl.Ui.Progressbar extends Efl.Ui.Layout_Base implements Efl.Ui.Rang
67 Efl.Content.content_unset; 67 Efl.Content.content_unset;
68 Efl.Ui.L10n.l10n_text { get; set; } 68 Efl.Ui.L10n.l10n_text { get; set; }
69 } 69 }
70 events {
71 changed: void; [[Called when progressbar changed]]
72 }
73} 70}
diff --git a/src/lib/elementary/efl_ui_slider.c b/src/lib/elementary/efl_ui_slider.c
index 4bcf1d8df3..40c188241e 100644
--- a/src/lib/elementary/efl_ui_slider.c
+++ b/src/lib/elementary/efl_ui_slider.c
@@ -76,8 +76,8 @@ _efl_ui_slider_val_fetch(Evas_Object *obj, Efl_Ui_Slider_Data *sd, Eina_Bool us
76 sd->val = val; 76 sd->val = val;
77 if (user_event) 77 if (user_event)
78 { 78 {
79 efl_event_callback_call(obj, EFL_UI_SLIDER_EVENT_CHANGED, NULL); 79 efl_event_callback_call(obj, EFL_UI_RANGE_EVENT_CHANGED, NULL);
80 efl_event_callback_legacy_call(obj, EFL_UI_SLIDER_EVENT_CHANGED, NULL); 80 efl_event_callback_legacy_call(obj, EFL_UI_RANGE_EVENT_CHANGED, NULL);
81 ecore_timer_del(sd->delay); 81 ecore_timer_del(sd->delay);
82 sd->delay = ecore_timer_add(SLIDER_DELAY_CHANGED_INTERVAL, _delay_change, obj); 82 sd->delay = ecore_timer_add(SLIDER_DELAY_CHANGED_INTERVAL, _delay_change, obj);
83 } 83 }
diff --git a/src/lib/elementary/efl_ui_slider.eo b/src/lib/elementary/efl_ui_slider.eo
index 364b226db6..480c7076ac 100644
--- a/src/lib/elementary/efl_ui_slider.eo
+++ b/src/lib/elementary/efl_ui_slider.eo
@@ -20,11 +20,10 @@ class @beta Efl.Ui.Slider extends Efl.Ui.Layout_Base implements Efl.Ui.Range_Int
20 Efl.Access.Widget.Action.elm_actions { get; } 20 Efl.Access.Widget.Action.elm_actions { get; }
21 } 21 }
22 events { 22 events {
23 changed: void; [[Called when the slider position has changed.]]
24 steady: void; [[Called when the slider position has changed and has remained unchanged for 0.2s. 23 steady: void; [[Called when the slider position has changed and has remained unchanged for 0.2s.
25 This allows filtering out unwanted "noise" from the slider signal if you are only 24 This allows filtering out unwanted "noise" from the slider signal if you are only
26 interested in the final position of the slider. 25 interested in the final position of the slider.
27 Use this signal instead of @[Efl.Ui.Slider.changed] if you are going to perform a costly operation 26 Use this signal instead of @[Efl.Ui.Range_Display.changed] if you are going to perform a costly operation
28 on its handler.]] 27 on its handler.]]
29 slider,drag,start: void; [[Called when a slider drag operation has started. This means a $press event 28 slider,drag,start: void; [[Called when a slider drag operation has started. This means a $press event
30 has been received on the slider thumb but not the $unpress.]] 29 has been received on the slider thumb but not the $unpress.]]
diff --git a/src/lib/elementary/efl_ui_slider_interval.c b/src/lib/elementary/efl_ui_slider_interval.c
index 0f0f9a5b8d..77f543a51e 100644
--- a/src/lib/elementary/efl_ui_slider_interval.c
+++ b/src/lib/elementary/efl_ui_slider_interval.c
@@ -77,8 +77,8 @@ _efl_ui_slider_interval_val_fetch(Evas_Object *obj, Efl_Ui_Slider_Interval_Data
77 pd->intvl_from = val; 77 pd->intvl_from = val;
78 if (user_event) 78 if (user_event)
79 { 79 {
80 efl_event_callback_call(obj, EFL_UI_SLIDER_EVENT_CHANGED, NULL); 80 efl_event_callback_call(obj, EFL_UI_RANGE_EVENT_CHANGED, NULL);
81 efl_event_callback_legacy_call(obj, EFL_UI_SLIDER_EVENT_CHANGED, NULL); 81 efl_event_callback_legacy_call(obj, EFL_UI_RANGE_EVENT_CHANGED, NULL);
82 ecore_timer_del(pd->delay); 82 ecore_timer_del(pd->delay);
83 pd->delay = ecore_timer_add(SLIDER_DELAY_CHANGED_INTERVAL, _delay_change, obj); 83 pd->delay = ecore_timer_add(SLIDER_DELAY_CHANGED_INTERVAL, _delay_change, obj);
84 } 84 }
@@ -89,8 +89,8 @@ _efl_ui_slider_interval_val_fetch(Evas_Object *obj, Efl_Ui_Slider_Interval_Data
89 pd->intvl_to = val2; 89 pd->intvl_to = val2;
90 if (user_event) 90 if (user_event)
91 { 91 {
92 efl_event_callback_call(obj, EFL_UI_SLIDER_EVENT_CHANGED, NULL); 92 efl_event_callback_call(obj, EFL_UI_RANGE_EVENT_CHANGED, NULL);
93 efl_event_callback_legacy_call(obj, EFL_UI_SLIDER_EVENT_CHANGED, NULL); 93 efl_event_callback_legacy_call(obj, EFL_UI_RANGE_EVENT_CHANGED, NULL);
94 ecore_timer_del(pd->delay); 94 ecore_timer_del(pd->delay);
95 pd->delay = ecore_timer_add(SLIDER_DELAY_CHANGED_INTERVAL, _delay_change, obj); 95 pd->delay = ecore_timer_add(SLIDER_DELAY_CHANGED_INTERVAL, _delay_change, obj);
96 } 96 }
diff --git a/src/lib/elementary/efl_ui_spin.c b/src/lib/elementary/efl_ui_spin.c
index 636e3fec5f..1776fe33f3 100644
--- a/src/lib/elementary/efl_ui_spin.c
+++ b/src/lib/elementary/efl_ui_spin.c
@@ -156,11 +156,11 @@ _efl_ui_spin_efl_ui_range_display_range_value_set(Eo *obj, Efl_Ui_Spin_Data *sd,
156 sd->val = val; 156 sd->val = val;
157 157
158 if (EINA_DBL_EQ(sd->val, sd->val_min)) 158 if (EINA_DBL_EQ(sd->val, sd->val_min))
159 efl_event_callback_call(obj, EFL_UI_SPIN_EVENT_MIN_REACHED, NULL); 159 efl_event_callback_call(obj, EFL_UI_RANGE_EVENT_MIN_REACHED, NULL);
160 else if (EINA_DBL_EQ(sd->val, sd->val_max)) 160 else if (EINA_DBL_EQ(sd->val, sd->val_max))
161 efl_event_callback_call(obj, EFL_UI_SPIN_EVENT_MAX_REACHED, NULL); 161 efl_event_callback_call(obj, EFL_UI_RANGE_EVENT_MAX_REACHED, NULL);
162 162
163 efl_event_callback_call(obj, EFL_UI_SPIN_EVENT_CHANGED, NULL); 163 efl_event_callback_call(obj, EFL_UI_RANGE_EVENT_CHANGED, NULL);
164 164
165 _label_write(obj, sd); 165 _label_write(obj, sd);
166} 166}
diff --git a/src/lib/elementary/efl_ui_spin.eo b/src/lib/elementary/efl_ui_spin.eo
index 7f02d5aeaa..55b1e45572 100644
--- a/src/lib/elementary/efl_ui_spin.eo
+++ b/src/lib/elementary/efl_ui_spin.eo
@@ -15,9 +15,4 @@ class @beta Efl.Ui.Spin extends Efl.Ui.Layout_Base implements Efl.Ui.Range_Inter
15 Efl.Ui.Range_Display.range_value { get; set; } 15 Efl.Ui.Range_Display.range_value { get; set; }
16 Efl.Ui.Format.apply_formatted_value; 16 Efl.Ui.Format.apply_formatted_value;
17 } 17 }
18 events {
19 changed: void; [[Called when spin changed]]
20 min,reached: void; [[Called when spin value reached min]]
21 max,reached: void; [[Called when spin value reached max]]
22 }
23} 18}
diff --git a/src/lib/elementary/efl_ui_timepicker.c b/src/lib/elementary/efl_ui_timepicker.c
index d7dd01a1fb..4e026659cd 100644
--- a/src/lib/elementary/efl_ui_timepicker.c
+++ b/src/lib/elementary/efl_ui_timepicker.c
@@ -126,14 +126,14 @@ _fields_init(Eo *obj)
126 efl_ui_spin_button_circulate_set(efl_added, EINA_TRUE), 126 efl_ui_spin_button_circulate_set(efl_added, EINA_TRUE),
127 efl_ui_spin_button_editable_set(efl_added, EINA_TRUE), 127 efl_ui_spin_button_editable_set(efl_added, EINA_TRUE),
128 efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL), 128 efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL),
129 efl_event_callback_add(efl_added, EFL_UI_SPIN_EVENT_CHANGED,_field_changed_cb, obj)); 129 efl_event_callback_add(efl_added, EFL_UI_RANGE_EVENT_CHANGED,_field_changed_cb, obj));
130 130
131 pd->min = efl_add(EFL_UI_SPIN_BUTTON_CLASS, obj, 131 pd->min = efl_add(EFL_UI_SPIN_BUTTON_CLASS, obj,
132 efl_ui_range_limits_set(efl_added, 0, 59), 132 efl_ui_range_limits_set(efl_added, 0, 59),
133 efl_ui_spin_button_circulate_set(efl_added, EINA_TRUE), 133 efl_ui_spin_button_circulate_set(efl_added, EINA_TRUE),
134 efl_ui_spin_button_editable_set(efl_added, EINA_TRUE), 134 efl_ui_spin_button_editable_set(efl_added, EINA_TRUE),
135 efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL), 135 efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL),
136 efl_event_callback_add(efl_added, EFL_UI_SPIN_EVENT_CHANGED,_field_changed_cb, obj)); 136 efl_event_callback_add(efl_added, EFL_UI_RANGE_EVENT_CHANGED,_field_changed_cb, obj));
137 137
138 pd->ampm = efl_add(EFL_UI_BUTTON_CLASS, obj, 138 pd->ampm = efl_add(EFL_UI_BUTTON_CLASS, obj,
139 efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _field_changed_cb, obj), 139 efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _field_changed_cb, obj),
diff --git a/src/lib/elementary/elc_player.c b/src/lib/elementary/elc_player.c
index c5a17e0b78..1a0c7d52e6 100644
--- a/src/lib/elementary/elc_player.c
+++ b/src/lib/elementary/elc_player.c
@@ -88,7 +88,7 @@ EFL_CALLBACKS_ARRAY_DEFINE(_emotion_cb,
88); 88);
89 89
90EFL_CALLBACKS_ARRAY_DEFINE(_slider_cb, 90EFL_CALLBACKS_ARRAY_DEFINE(_slider_cb,
91 { EFL_UI_SLIDER_EVENT_CHANGED, _update_position }, 91 { EFL_UI_RANGE_EVENT_CHANGED, _update_position },
92 { EFL_UI_SLIDER_EVENT_SLIDER_DRAG_START, _drag_start }, 92 { EFL_UI_SLIDER_EVENT_SLIDER_DRAG_START, _drag_start },
93 { EFL_UI_SLIDER_EVENT_SLIDER_DRAG_STOP, _drag_stop } 93 { EFL_UI_SLIDER_EVENT_SLIDER_DRAG_STOP, _drag_stop }
94); 94);
@@ -630,7 +630,7 @@ _elm_player_efl_canvas_group_group_add(Eo *obj, Elm_Player_Data *priv)
630 elm_layout_content_set(obj, "elm.swallow.media_player.volumeslider", 630 elm_layout_content_set(obj, "elm.swallow.media_player.volumeslider",
631 priv->vslider); 631 priv->vslider);
632 efl_event_callback_add 632 efl_event_callback_add
633 (priv->vslider, EFL_UI_SLIDER_EVENT_CHANGED, _update_volume, obj); 633 (priv->vslider, EFL_UI_RANGE_EVENT_CHANGED, _update_volume, obj);
634 634
635 elm_layout_sizing_eval(obj); 635 elm_layout_sizing_eval(obj);
636 elm_widget_can_focus_set(obj, EINA_TRUE); 636 elm_widget_can_focus_set(obj, EINA_TRUE);
diff --git a/src/lib/elementary/elm_slider.c b/src/lib/elementary/elm_slider.c
index c836723eaa..97b348bdb4 100644
--- a/src/lib/elementary/elm_slider.c
+++ b/src/lib/elementary/elm_slider.c
@@ -603,7 +603,7 @@ _elm_slider_val_fetch(Evas_Object *obj, Elm_Slider_Data *pd, Eina_Bool user_even
603 id->intvl_from = val; 603 id->intvl_from = val;
604 if (user_event) 604 if (user_event)
605 { 605 {
606 efl_event_callback_legacy_call(obj, EFL_UI_SLIDER_EVENT_CHANGED, NULL); 606 efl_event_callback_legacy_call(obj, EFL_UI_RANGE_EVENT_CHANGED, NULL);
607 ecore_timer_del(pd->delay); 607 ecore_timer_del(pd->delay);
608 pd->delay = ecore_timer_add(SLIDER_DELAY_CHANGED_INTERVAL, _delay_change, obj); 608 pd->delay = ecore_timer_add(SLIDER_DELAY_CHANGED_INTERVAL, _delay_change, obj);
609 evented = EINA_TRUE; 609 evented = EINA_TRUE;
@@ -616,7 +616,7 @@ _elm_slider_val_fetch(Evas_Object *obj, Elm_Slider_Data *pd, Eina_Bool user_even
616 /* avoid emitting two events and setting a timer twice */ 616 /* avoid emitting two events and setting a timer twice */
617 if (user_event && (!evented)) 617 if (user_event && (!evented))
618 { 618 {
619 efl_event_callback_legacy_call(obj, EFL_UI_SLIDER_EVENT_CHANGED, NULL); 619 efl_event_callback_legacy_call(obj, EFL_UI_RANGE_EVENT_CHANGED, NULL);
620 ecore_timer_del(pd->delay); 620 ecore_timer_del(pd->delay);
621 pd->delay = ecore_timer_add(SLIDER_DELAY_CHANGED_INTERVAL, _delay_change, obj); 621 pd->delay = ecore_timer_add(SLIDER_DELAY_CHANGED_INTERVAL, _delay_change, obj);
622 } 622 }