aboutsummaryrefslogtreecommitdiffstats
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
parentevas cache - fix return val to fix warning (diff)
downloadefl-b762743bb9b3220ce03484cb955566cb6a87ee6a.tar.gz
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
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(120, 0)),
efl_ui_format_string_set(efl_added, "%1.1f units"),
efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.1f"),
- efl_ui_slider_step_set(efl_added, step),
+ efl_ui_range_step_set(efl_added, step),
efl_pack(bx, efl_added));
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
efl_ui_format_string_set(efl_added, "%1.0f units"),
efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
efl_ui_range_min_max_set(efl_added, 10, 145),
- efl_ui_slider_step_set(efl_added, step),
+ efl_ui_range_step_set(efl_added, step),
elm_object_disabled_set(efl_added, EINA_TRUE),
efl_pack(bx, efl_added));
@@ -83,7 +83,7 @@ test_ui_slider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
efl_ui_format_string_set(efl_added, "%1.0f units"),
efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
efl_ui_range_min_max_set(efl_added, 10, 145),
- efl_ui_slider_step_set(efl_added, step),
+ efl_ui_range_step_set(efl_added, step),
efl_ui_range_value_set(efl_added, 70),
efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL),
efl_pack(hbx, efl_added));
@@ -94,7 +94,7 @@ test_ui_slider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
efl_ui_format_string_set(efl_added, "%1.0f units"),
efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
efl_ui_range_min_max_set(efl_added, 10, 145),
- efl_ui_slider_step_set(efl_added, step),
+ efl_ui_range_step_set(efl_added, step),
efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL),
elm_object_disabled_set(efl_added, EINA_TRUE),
efl_pack(hbx, efl_added));
@@ -108,7 +108,7 @@ test_ui_slider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
efl_ui_range_min_max_set(efl_added, 10, 145),
efl_ui_range_value_set(efl_added, 35),
- efl_ui_slider_step_set(efl_added, step),
+ efl_ui_range_step_set(efl_added, step),
efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL),
efl_pack(hbx, efl_added));
@@ -120,7 +120,7 @@ test_ui_slider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
efl_ui_format_string_set(efl_added, "%1.0f units"),
efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
efl_ui_range_min_max_set(efl_added, 0, 150),
- efl_ui_slider_step_set(efl_added, step),
+ efl_ui_range_step_set(efl_added, step),
efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED, _slider_changed_cb, NULL),
efl_pack(bx, efl_added));
}
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
efl_ui_format_string_set(efl_added, "%1.1f units"),
efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.1f"),
efl_ui_slider_interval_value_set(efl_added, 0.4, 0.9),
- efl_ui_slider_step_set(efl_added, step),
+ efl_ui_range_step_set(efl_added, step),
efl_pack(bx, efl_added));
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
efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
efl_ui_range_min_max_set(efl_added, 10, 145),
efl_ui_slider_interval_value_set(efl_added, 50, 100),
- efl_ui_slider_step_set(efl_added, step),
+ efl_ui_range_step_set(efl_added, step),
elm_object_disabled_set(efl_added, EINA_TRUE),
efl_pack(bx, efl_added));
@@ -81,7 +81,7 @@ test_slider_interval(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
efl_ui_range_min_max_set(efl_added, 10, 145),
efl_ui_slider_interval_value_set(efl_added, 50, 100),
- efl_ui_slider_step_set(efl_added, step),
+ efl_ui_range_step_set(efl_added, step),
efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL),
efl_pack(hbx, efl_added));
@@ -91,7 +91,7 @@ test_slider_interval(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
efl_ui_format_string_set(efl_added, "%1.0f units"),
efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
efl_ui_range_min_max_set(efl_added, 10, 145),
- efl_ui_slider_step_set(efl_added, step),
+ efl_ui_range_step_set(efl_added, step),
efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL),
elm_object_disabled_set(efl_added, EINA_TRUE),
efl_pack(hbx, efl_added));
@@ -104,7 +104,7 @@ test_slider_interval(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
efl_ui_format_string_set(efl_added, "%1.0f units"),
efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
efl_ui_range_min_max_set(efl_added, 10, 145),
- efl_ui_slider_step_set(efl_added, step),
+ efl_ui_range_step_set(efl_added, step),
efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL),
efl_pack(hbx, efl_added));
@@ -117,7 +117,7 @@ test_slider_interval(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
efl_ui_range_min_max_set(efl_added, 0, 600),
efl_ui_slider_interval_value_set(efl_added, 100, 500),
- efl_ui_slider_step_set(efl_added, step),
+ efl_ui_range_step_set(efl_added, step),
efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED, _intv_slider_changed_cb, NULL),
efl_pack(bx, efl_added));
}
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
return sd->val;
}
+EOLIAN static double
+_efl_ui_slider_efl_ui_range_range_step_get(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd)
+{
+ return sd->step;
+}
+
EOLIAN static void
-_efl_ui_slider_step_set(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd, double step)
+_efl_ui_slider_efl_ui_range_range_step_set(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd, double step)
{
if (sd->step == step) return;
@@ -1290,12 +1296,6 @@ _efl_ui_slider_step_set(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd, double step
sd->step = step;
}
-EOLIAN static double
-_efl_ui_slider_step_get(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd)
-{
- return sd->step;
-}
-
EOLIAN static Eina_Bool
_efl_ui_slider_efl_ui_focus_object_on_focus_update(Eo *obj, Efl_Ui_Slider_Data *sd EINA_UNUSED)
{
@@ -1843,4 +1843,16 @@ elm_slider_indicator_visible_mode_get(const Evas_Object *obj)
return efl_ui_slider_part_indicator_visible_mode_get(efl_part(obj, "indicator"));
}
+EAPI double
+elm_slider_step_get(const Evas_Object *obj)
+{
+ return efl_ui_range_step_get(obj);
+}
+
+EAPI void
+elm_slider_step_set(Evas_Object *obj, double step)
+{
+ efl_ui_range_step_set(obj, step);
+}
+
#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,
[[Elementary slider class]]
legacy_prefix: elm_slider;
methods {
- @property step {
- set {
- [[Set the step by which slider indicator will move.
-
- This value is used when a draggable object is moved automatically
- such as when key events like the up/down/left/right key are pressed
- or in case accessibility is set and flick event is used to
- inc/dec slider values. By default step value is 0.05.
-
- @since 1.8
- ]]
- }
- get {
- [[Get the step by which slider indicator moves.
-
- @since 1.8
- ]]
- }
- values {
- step: double; [[The step value.]]
- }
- }
}
parts {
indicator: Efl.Ui.Slider.Part_Indicator;
@@ -42,6 +20,7 @@ class Efl.Ui.Slider (Efl.Ui.Layout, Efl.Ui.Range, Efl.Ui.Direction,
Efl.Ui.Widget.widget_event;
Efl.Ui.Range.range_value { get; set; }
Efl.Ui.Range.range_min_max {get; set; }
+ Efl.Ui.Range.range_step { get; set; }
Efl.Ui.Direction.direction { get; set; }
Efl.Access.Value.value_and_text { get; set; }
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
*/
EAPI Elm_Slider_Indicator_Visible_Mode elm_slider_indicator_visible_mode_get(const Evas_Object *obj);
+/**
+ * @brief Get the step by which slider indicator moves.
+ *
+ * @param[in] obj The object.
+ *
+ * @return The step value.
+ *
+ * @since 1.8
+ *
+ * @ingroup Elm_Slider
+ */
+EAPI double elm_slider_step_get(const Evas_Object *obj);
+
+/**
+ * @brief Set the step by which slider indicator will move.
+ *
+ * This value is used when a draggable object is moved automatically such as
+ * when key events like the up/down/left/right key are pressed or in case
+ * accessibility is set and flick event is used to inc/dec slider values. By
+ * default step value is 0.05.
+ *
+ * @param[in] obj The object.
+ * @param[in] step The step value.
+ *
+ * @since 1.8
+ *
+ * @ingroup Elm_Slider
+ */
+EAPI void elm_slider_step_set(Evas_Object *obj, double step);
+
#include "efl_ui_slider.eo.legacy.h"