Efl.Ui.Slider: make indicator_show_on_focus/indicator_show() legacy APIs
authorAmitesh Singh <amitesh.sh@samsung.com>
Thu, 16 Nov 2017 01:12:51 +0000 (10:12 +0900)
committerAmitesh Singh <amitesh.sh@samsung.com>
Fri, 17 Nov 2017 05:38:32 +0000 (14:38 +0900)
Ref T6376

src/lib/elementary/efl_ui_slider.c
src/lib/elementary/efl_ui_slider.eo
src/lib/elementary/elm_slider_legacy.h

index ad5ed4b..43c4441 100644 (file)
@@ -1230,37 +1230,6 @@ _efl_ui_slider_efl_ui_range_range_value_get(Eo *obj EINA_UNUSED, Efl_Ui_Slider_D
 }
 
 EOLIAN static void
-_efl_ui_slider_indicator_show_set(Eo *obj, Efl_Ui_Slider_Data *sd, Eina_Bool show)
-{
-   if (show)
-     {
-        sd->indicator_show = EINA_TRUE;
-        elm_layout_signal_emit(obj, "elm,state,val,show", "elm");
-        if (sd->popup)
-          edje_object_signal_emit(sd->popup, "elm,state,val,show", "elm");
-        if (sd->popup2)
-          edje_object_signal_emit(sd->popup2, "elm,state,val,show", "elm");
-     }
-   else
-     {
-        sd->indicator_show = EINA_FALSE;
-        elm_layout_signal_emit(obj, "elm,state,val,hide", "elm");
-        if (sd->popup)
-          edje_object_signal_emit(sd->popup, "elm,state,val,hide", "elm");
-        if (sd->popup2)
-          edje_object_signal_emit(sd->popup2, "elm,state,val,hide", "elm");
-     }
-
-   evas_object_smart_changed(obj);
-}
-
-EOLIAN static Eina_Bool
-_efl_ui_slider_indicator_show_get(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd)
-{
-   return sd->indicator_show;
-}
-
-EOLIAN static void
 _efl_ui_slider_step_set(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd, double step)
 {
    if (sd->step == step) return;
@@ -1278,21 +1247,6 @@ _efl_ui_slider_step_get(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd)
 }
 
 EOLIAN static void
-_efl_ui_slider_indicator_show_on_focus_set(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd, Eina_Bool flag)
-{
-   if (flag)
-     sd->indicator_visible_mode = ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS;
-   else
-     sd->indicator_visible_mode = ELM_SLIDER_INDICATOR_VISIBLE_MODE_DEFAULT;
-}
-
-EOLIAN static Eina_Bool
-_efl_ui_slider_indicator_show_on_focus_get(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd)
-{
-   return (sd->indicator_visible_mode == ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS);
-}
-
-EOLIAN static void
 _efl_ui_slider_indicator_visible_mode_set(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd, Elm_Slider_Indicator_Visible_Mode indicator_visible_mode)
 {
    if (sd->indicator_visible_mode == indicator_visible_mode) return;
@@ -1740,6 +1694,58 @@ elm_slider_indicator_format_function_set(Evas_Object *obj, slider_func_type func
                         _format_legacy_to_format_eo_free_cb);
 }
 
+EAPI void
+elm_slider_indicator_show_on_focus_set(Evas_Object *obj, Eina_Bool flag)
+{
+   EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd);
+
+   if (flag)
+     sd->indicator_visible_mode = ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS;
+   else
+     sd->indicator_visible_mode = ELM_SLIDER_INDICATOR_VISIBLE_MODE_DEFAULT;
+}
+
+EAPI Eina_Bool
+elm_slider_indicator_show_on_focus_get(const Evas_Object *obj)
+{
+   EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd, EINA_FALSE);
+
+   return (sd->indicator_visible_mode == ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS);
+}
+
+EAPI void
+elm_slider_indicator_show_set(Evas_Object *obj, Eina_Bool show)
+{
+   EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd);
+
+   if (show)
+     {
+        sd->indicator_show = EINA_TRUE;
+        elm_layout_signal_emit(obj, "elm,state,val,show", "elm");
+        if (sd->popup)
+          edje_object_signal_emit(sd->popup, "elm,state,val,show", "elm");
+        if (sd->popup2)
+          edje_object_signal_emit(sd->popup2, "elm,state,val,show", "elm");
+     }
+   else
+     {
+        sd->indicator_show = EINA_FALSE;
+        elm_layout_signal_emit(obj, "elm,state,val,hide", "elm");
+        if (sd->popup)
+          edje_object_signal_emit(sd->popup, "elm,state,val,hide", "elm");
+        if (sd->popup2)
+          edje_object_signal_emit(sd->popup2, "elm,state,val,hide", "elm");
+     }
+
+   evas_object_smart_changed(obj);
+}
+
+EAPI Eina_Bool
+elm_slider_indicator_show_get(const Evas_Object *obj)
+{
+   EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd, EINA_FALSE);
+   return sd->indicator_show;
+}
 /* Internal EO APIs and hidden overrides */
 
 ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(efl_ui_slider)
index 7db56f4..845e5b0 100644 (file)
@@ -8,33 +8,6 @@ class Efl.Ui.Slider (Efl.Ui.Layout, Efl.Ui.Range, Efl.Ui.Direction,
    [[Elementary slider class]]
    legacy_prefix: elm_slider;
    methods {
-      @property indicator_show {
-         set {
-            [[Set whether to enlarge slider indicator (augmented knob) or not.
-
-              By default, indicator will be bigger while dragged by the user.
-
-            ]]
-         }
-         get {
-            [[Get whether a given slider widget's enlarging indicator or not.]]
-         }
-         values {
-            show: bool; [[$true will make it enlarge, $false will
-                          let the knob always at default size.]]
-         }
-      }
-      @property indicator_show_on_focus {
-         set {
-            [[Show the indicator of slider on focus.]]
-         }
-         get {
-            [[Get whether the indicator of the slider is set or not.]]
-         }
-         values {
-            flag: bool; [[$true if indicator is shown on focus, $false otherwise]]
-         }
-      }
       @property step {
          set {
             [[Set the step by which slider indicator will move.
index a98324f..312b087 100644 (file)
@@ -283,4 +283,50 @@ EAPI void elm_slider_range_get(const Evas_Object *obj, double *from, double *to)
  */
 EAPI void elm_slider_indicator_format_function_set(Evas_Object *obj, slider_func_type func, slider_freefunc_type free_func);
 
+/**
+ * @brief Show the indicator of slider on focus.
+ *
+ * @param[in] obj The object.
+ * @param[in] flag @c true if indicator is shown on focus, @c false otherwise
+ *
+ * @ingroup Elm_Slider
+ */
+EAPI void elm_slider_indicator_show_on_focus_set(Evas_Object *obj, Eina_Bool flag);
+
+/**
+ * @brief Get whether the indicator of the slider is set or not.
+ *
+ * @param[in] obj The object.
+ *
+ * @return @c true if indicator is shown on focus, @c false otherwise
+ *
+ * @ingroup Elm_Slider
+ */
+EAPI Eina_Bool elm_slider_indicator_show_on_focus_get(const Evas_Object *obj);
+
+/**
+ * @brief Set whether to enlarge slider indicator (augmented knob) or not.
+ *
+ * By default, indicator will be bigger while dragged by the user.
+ *
+ * @param[in] obj The object.
+ * @param[in] show @c true will make it enlarge, @c false will let the knob
+ * always at default size.
+ *
+ * @ingroup Elm_Slider
+ */
+EAPI void elm_slider_indicator_show_set(Evas_Object *obj, Eina_Bool show);
+
+/**
+ * @brief Get whether a given slider widget's enlarging indicator or not.
+ *
+ * @param[in] obj The object.
+ *
+ * @return @c true will make it enlarge, @c false will let the knob always at
+ * default size.
+ *
+ * @ingroup Elm_Slider
+ */
+EAPI Eina_Bool elm_slider_indicator_show_get(const Evas_Object *obj);
+
 #include "efl_ui_slider.eo.legacy.h"