summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmitesh Singh <amitesh.sh@samsung.com>2018-03-06 15:52:35 +0900
committerAmitesh Singh <amitesh.sh@samsung.com>2018-03-06 16:21:25 +0900
commitb762743bb9b3220ce03484cb955566cb6a87ee6a (patch)
tree515d5062dfa3853a118a41ef2a3924d6d6551e6c
parent6d9d978fafc2e970c4b5805a84b1d93fec731d86 (diff)
Efl.Ui.Slider: implement Efl.Ui.Range.range_step_set/get()devs/ami/slider_range
and move elm_slider_step_set/get() as legacy APIs.
-rw-r--r--src/bin/elementary/test_ui_slider.c12
-rw-r--r--src/bin/elementary/test_ui_slider_interval.c12
-rw-r--r--src/lib/elementary/efl_ui_slider.c26
-rw-r--r--src/lib/elementary/efl_ui_slider.eo23
-rw-r--r--src/lib/elementary/elm_slider_legacy.h30
5 files changed, 62 insertions, 41 deletions
diff --git a/src/bin/elementary/test_ui_slider.c b/src/bin/elementary/test_ui_slider.c
index a47fa09675..eea45b0096 100644
--- a/src/bin/elementary/test_ui_slider.c
+++ b/src/bin/elementary/test_ui_slider.c
@@ -60,7 +60,7 @@ test_ui_slider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
60 efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(120, 0)), 60 efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(120, 0)),
61 efl_ui_format_string_set(efl_added, "%1.1f units"), 61 efl_ui_format_string_set(efl_added, "%1.1f units"),
62 efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.1f"), 62 efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.1f"),
63 efl_ui_slider_step_set(efl_added, step), 63 efl_ui_range_step_set(efl_added, step),
64 efl_pack(bx, efl_added)); 64 efl_pack(bx, efl_added));
65 65
66 efl_add(EFL_UI_SLIDER_CLASS, bx, 66 efl_add(EFL_UI_SLIDER_CLASS, bx,
@@ -69,7 +69,7 @@ test_ui_slider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
69 efl_ui_format_string_set(efl_added, "%1.0f units"), 69 efl_ui_format_string_set(efl_added, "%1.0f units"),
70 efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"), 70 efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
71 efl_ui_range_min_max_set(efl_added, 10, 145), 71 efl_ui_range_min_max_set(efl_added, 10, 145),
72 efl_ui_slider_step_set(efl_added, step), 72 efl_ui_range_step_set(efl_added, step),
73 elm_object_disabled_set(efl_added, EINA_TRUE), 73 elm_object_disabled_set(efl_added, EINA_TRUE),
74 efl_pack(bx, efl_added)); 74 efl_pack(bx, efl_added));
75 75
@@ -83,7 +83,7 @@ test_ui_slider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
83 efl_ui_format_string_set(efl_added, "%1.0f units"), 83 efl_ui_format_string_set(efl_added, "%1.0f units"),
84 efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"), 84 efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
85 efl_ui_range_min_max_set(efl_added, 10, 145), 85 efl_ui_range_min_max_set(efl_added, 10, 145),
86 efl_ui_slider_step_set(efl_added, step), 86 efl_ui_range_step_set(efl_added, step),
87 efl_ui_range_value_set(efl_added, 70), 87 efl_ui_range_value_set(efl_added, 70),
88 efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL), 88 efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL),
89 efl_pack(hbx, efl_added)); 89 efl_pack(hbx, efl_added));
@@ -94,7 +94,7 @@ test_ui_slider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
94 efl_ui_format_string_set(efl_added, "%1.0f units"), 94 efl_ui_format_string_set(efl_added, "%1.0f units"),
95 efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"), 95 efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
96 efl_ui_range_min_max_set(efl_added, 10, 145), 96 efl_ui_range_min_max_set(efl_added, 10, 145),
97 efl_ui_slider_step_set(efl_added, step), 97 efl_ui_range_step_set(efl_added, step),
98 efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL), 98 efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL),
99 elm_object_disabled_set(efl_added, EINA_TRUE), 99 elm_object_disabled_set(efl_added, EINA_TRUE),
100 efl_pack(hbx, efl_added)); 100 efl_pack(hbx, efl_added));
@@ -108,7 +108,7 @@ test_ui_slider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
108 efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"), 108 efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
109 efl_ui_range_min_max_set(efl_added, 10, 145), 109 efl_ui_range_min_max_set(efl_added, 10, 145),
110 efl_ui_range_value_set(efl_added, 35), 110 efl_ui_range_value_set(efl_added, 35),
111 efl_ui_slider_step_set(efl_added, step), 111 efl_ui_range_step_set(efl_added, step),
112 efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL), 112 efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL),
113 efl_pack(hbx, efl_added)); 113 efl_pack(hbx, efl_added));
114 114
@@ -120,7 +120,7 @@ test_ui_slider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
120 efl_ui_format_string_set(efl_added, "%1.0f units"), 120 efl_ui_format_string_set(efl_added, "%1.0f units"),
121 efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"), 121 efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
122 efl_ui_range_min_max_set(efl_added, 0, 150), 122 efl_ui_range_min_max_set(efl_added, 0, 150),
123 efl_ui_slider_step_set(efl_added, step), 123 efl_ui_range_step_set(efl_added, step),
124 efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED, _slider_changed_cb, NULL), 124 efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED, _slider_changed_cb, NULL),
125 efl_pack(bx, efl_added)); 125 efl_pack(bx, efl_added));
126} 126}
diff --git a/src/bin/elementary/test_ui_slider_interval.c b/src/bin/elementary/test_ui_slider_interval.c
index 1e7f4cf063..46b202b0f7 100644
--- a/src/bin/elementary/test_ui_slider_interval.c
+++ b/src/bin/elementary/test_ui_slider_interval.c
@@ -56,7 +56,7 @@ test_slider_interval(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
56 efl_ui_format_string_set(efl_added, "%1.1f units"), 56 efl_ui_format_string_set(efl_added, "%1.1f units"),
57 efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.1f"), 57 efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.1f"),
58 efl_ui_slider_interval_value_set(efl_added, 0.4, 0.9), 58 efl_ui_slider_interval_value_set(efl_added, 0.4, 0.9),
59 efl_ui_slider_step_set(efl_added, step), 59 efl_ui_range_step_set(efl_added, step),
60 efl_pack(bx, efl_added)); 60 efl_pack(bx, efl_added));
61 61
62 efl_add(EFL_UI_SLIDER_INTERVAL_CLASS, bx, 62 efl_add(EFL_UI_SLIDER_INTERVAL_CLASS, bx,
@@ -66,7 +66,7 @@ test_slider_interval(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
66 efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"), 66 efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
67 efl_ui_range_min_max_set(efl_added, 10, 145), 67 efl_ui_range_min_max_set(efl_added, 10, 145),
68 efl_ui_slider_interval_value_set(efl_added, 50, 100), 68 efl_ui_slider_interval_value_set(efl_added, 50, 100),
69 efl_ui_slider_step_set(efl_added, step), 69 efl_ui_range_step_set(efl_added, step),
70 elm_object_disabled_set(efl_added, EINA_TRUE), 70 elm_object_disabled_set(efl_added, EINA_TRUE),
71 efl_pack(bx, efl_added)); 71 efl_pack(bx, efl_added));
72 72
@@ -81,7 +81,7 @@ test_slider_interval(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
81 efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"), 81 efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
82 efl_ui_range_min_max_set(efl_added, 10, 145), 82 efl_ui_range_min_max_set(efl_added, 10, 145),
83 efl_ui_slider_interval_value_set(efl_added, 50, 100), 83 efl_ui_slider_interval_value_set(efl_added, 50, 100),
84 efl_ui_slider_step_set(efl_added, step), 84 efl_ui_range_step_set(efl_added, step),
85 efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL), 85 efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL),
86 efl_pack(hbx, efl_added)); 86 efl_pack(hbx, efl_added));
87 87
@@ -91,7 +91,7 @@ test_slider_interval(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
91 efl_ui_format_string_set(efl_added, "%1.0f units"), 91 efl_ui_format_string_set(efl_added, "%1.0f units"),
92 efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"), 92 efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
93 efl_ui_range_min_max_set(efl_added, 10, 145), 93 efl_ui_range_min_max_set(efl_added, 10, 145),
94 efl_ui_slider_step_set(efl_added, step), 94 efl_ui_range_step_set(efl_added, step),
95 efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL), 95 efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL),
96 elm_object_disabled_set(efl_added, EINA_TRUE), 96 elm_object_disabled_set(efl_added, EINA_TRUE),
97 efl_pack(hbx, efl_added)); 97 efl_pack(hbx, efl_added));
@@ -104,7 +104,7 @@ test_slider_interval(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
104 efl_ui_format_string_set(efl_added, "%1.0f units"), 104 efl_ui_format_string_set(efl_added, "%1.0f units"),
105 efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"), 105 efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
106 efl_ui_range_min_max_set(efl_added, 10, 145), 106 efl_ui_range_min_max_set(efl_added, 10, 145),
107 efl_ui_slider_step_set(efl_added, step), 107 efl_ui_range_step_set(efl_added, step),
108 efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL), 108 efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL),
109 efl_pack(hbx, efl_added)); 109 efl_pack(hbx, efl_added));
110 110
@@ -117,7 +117,7 @@ test_slider_interval(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
117 efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"), 117 efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
118 efl_ui_range_min_max_set(efl_added, 0, 600), 118 efl_ui_range_min_max_set(efl_added, 0, 600),
119 efl_ui_slider_interval_value_set(efl_added, 100, 500), 119 efl_ui_slider_interval_value_set(efl_added, 100, 500),
120 efl_ui_slider_step_set(efl_added, step), 120 efl_ui_range_step_set(efl_added, step),
121 efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED, _intv_slider_changed_cb, NULL), 121 efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED, _intv_slider_changed_cb, NULL),
122 efl_pack(bx, efl_added)); 122 efl_pack(bx, efl_added));
123} 123}
diff --git a/src/lib/elementary/efl_ui_slider.c b/src/lib/elementary/efl_ui_slider.c
index 00e33fe42f..59a63e4f3a 100644
--- a/src/lib/elementary/efl_ui_slider.c
+++ b/src/lib/elementary/efl_ui_slider.c
@@ -1279,8 +1279,14 @@ _efl_ui_slider_efl_ui_range_range_value_get(Eo *obj EINA_UNUSED, Efl_Ui_Slider_D
1279 return sd->val; 1279 return sd->val;
1280} 1280}
1281 1281
1282EOLIAN static double
1283_efl_ui_slider_efl_ui_range_range_step_get(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd)
1284{
1285 return sd->step;
1286}
1287
1282EOLIAN static void 1288EOLIAN static void
1283_efl_ui_slider_step_set(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd, double step) 1289_efl_ui_slider_efl_ui_range_range_step_set(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd, double step)
1284{ 1290{
1285 if (sd->step == step) return; 1291 if (sd->step == step) return;
1286 1292
@@ -1290,12 +1296,6 @@ _efl_ui_slider_step_set(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd, double step
1290 sd->step = step; 1296 sd->step = step;
1291} 1297}
1292 1298
1293EOLIAN static double
1294_efl_ui_slider_step_get(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd)
1295{
1296 return sd->step;
1297}
1298
1299EOLIAN static Eina_Bool 1299EOLIAN static Eina_Bool
1300_efl_ui_slider_efl_ui_focus_object_on_focus_update(Eo *obj, Efl_Ui_Slider_Data *sd EINA_UNUSED) 1300_efl_ui_slider_efl_ui_focus_object_on_focus_update(Eo *obj, Efl_Ui_Slider_Data *sd EINA_UNUSED)
1301{ 1301{
@@ -1843,4 +1843,16 @@ elm_slider_indicator_visible_mode_get(const Evas_Object *obj)
1843 return efl_ui_slider_part_indicator_visible_mode_get(efl_part(obj, "indicator")); 1843 return efl_ui_slider_part_indicator_visible_mode_get(efl_part(obj, "indicator"));
1844} 1844}
1845 1845
1846EAPI double
1847elm_slider_step_get(const Evas_Object *obj)
1848{
1849 return efl_ui_range_step_get(obj);
1850}
1851
1852EAPI void
1853elm_slider_step_set(Evas_Object *obj, double step)
1854{
1855 efl_ui_range_step_set(obj, step);
1856}
1857
1846#include "efl_ui_slider_legacy.eo.c" 1858#include "efl_ui_slider_legacy.eo.c"
diff --git a/src/lib/elementary/efl_ui_slider.eo b/src/lib/elementary/efl_ui_slider.eo
index 002204db8e..e9a994590e 100644
--- a/src/lib/elementary/efl_ui_slider.eo
+++ b/src/lib/elementary/efl_ui_slider.eo
@@ -6,28 +6,6 @@ class Efl.Ui.Slider (Efl.Ui.Layout, Efl.Ui.Range, Efl.Ui.Direction,
6 [[Elementary slider class]] 6 [[Elementary slider class]]
7 legacy_prefix: elm_slider; 7 legacy_prefix: elm_slider;
8 methods { 8 methods {
9 @property step {
10 set {
11 [[Set the step by which slider indicator will move.
12
13 This value is used when a draggable object is moved automatically
14 such as when key events like the up/down/left/right key are pressed
15 or in case accessibility is set and flick event is used to
16 inc/dec slider values. By default step value is 0.05.
17
18 @since 1.8
19 ]]
20 }
21 get {
22 [[Get the step by which slider indicator moves.
23
24 @since 1.8
25 ]]
26 }
27 values {
28 step: double; [[The step value.]]
29 }
30 }
31 } 9 }
32 parts { 10 parts {
33 indicator: Efl.Ui.Slider.Part_Indicator; 11 indicator: Efl.Ui.Slider.Part_Indicator;
@@ -42,6 +20,7 @@ class Efl.Ui.Slider (Efl.Ui.Layout, Efl.Ui.Range, Efl.Ui.Direction,
42 Efl.Ui.Widget.widget_event; 20 Efl.Ui.Widget.widget_event;
43 Efl.Ui.Range.range_value { get; set; } 21 Efl.Ui.Range.range_value { get; set; }
44 Efl.Ui.Range.range_min_max {get; set; } 22 Efl.Ui.Range.range_min_max {get; set; }
23 Efl.Ui.Range.range_step { get; set; }
45 Efl.Ui.Direction.direction { get; set; } 24 Efl.Ui.Direction.direction { get; set; }
46 Efl.Access.Value.value_and_text { get; set; } 25 Efl.Access.Value.value_and_text { get; set; }
47 Efl.Access.Value.range { get; } 26 Efl.Access.Value.range { get; }
diff --git a/src/lib/elementary/elm_slider_legacy.h b/src/lib/elementary/elm_slider_legacy.h
index f117e15af0..37c04c0fb9 100644
--- a/src/lib/elementary/elm_slider_legacy.h
+++ b/src/lib/elementary/elm_slider_legacy.h
@@ -350,4 +350,34 @@ EAPI void elm_slider_indicator_visible_mode_set(Evas_Object *obj, Elm_Slider_Ind
350 */ 350 */
351EAPI Elm_Slider_Indicator_Visible_Mode elm_slider_indicator_visible_mode_get(const Evas_Object *obj); 351EAPI Elm_Slider_Indicator_Visible_Mode elm_slider_indicator_visible_mode_get(const Evas_Object *obj);
352 352
353/**
354 * @brief Get the step by which slider indicator moves.
355 *
356 * @param[in] obj The object.
357 *
358 * @return The step value.
359 *
360 * @since 1.8
361 *
362 * @ingroup Elm_Slider
363 */
364EAPI double elm_slider_step_get(const Evas_Object *obj);
365
366/**
367 * @brief Set the step by which slider indicator will move.
368 *
369 * This value is used when a draggable object is moved automatically such as
370 * when key events like the up/down/left/right key are pressed or in case
371 * accessibility is set and flick event is used to inc/dec slider values. By
372 * default step value is 0.05.
373 *
374 * @param[in] obj The object.
375 * @param[in] step The step value.
376 *
377 * @since 1.8
378 *
379 * @ingroup Elm_Slider
380 */
381EAPI void elm_slider_step_set(Evas_Object *obj, double step);
382
353#include "efl_ui_slider.eo.legacy.h" 383#include "efl_ui_slider.eo.legacy.h"