win: Move focus_highlight_animate to widget (EO)
authorJean-Philippe Andre <jp.andre@samsung.com>
Thu, 31 Aug 2017 07:08:10 +0000 (16:08 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Fri, 1 Sep 2017 01:09:37 +0000 (10:09 +0900)
Similar to the previous commits. Moved for consistency.

Ref T5363
Ref T5322

src/lib/elementary/efl_ui_win.c
src/lib/elementary/efl_ui_win.eo
src/lib/elementary/elm_widget.c
src/lib/elementary/elm_widget.eo
src/lib/elementary/elm_win_legacy.h

index ddd7d61..6b0ad4d 100644 (file)
@@ -6349,6 +6349,7 @@ _efl_ui_win_elm_widget_theme_apply(Eo *obj, Efl_Ui_Win_Data *sd)
 EOLIAN static Eina_Bool
 _efl_ui_win_elm_widget_focus_highlight_style_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char *style)
 {
+   // Do not call efl_super() here. Only Win handles this property.
    if (!eina_stringshare_replace(&sd->focus_highlight.style, style))
      return EINA_TRUE;
 
@@ -6360,12 +6361,14 @@ _efl_ui_win_elm_widget_focus_highlight_style_set(Eo *obj EINA_UNUSED, Efl_Ui_Win
 EOLIAN static const char*
 _efl_ui_win_elm_widget_focus_highlight_style_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
 {
+   // Do not call efl_super() here. Only Win handles this property.
    return sd->focus_highlight.style;
 }
 
 EOLIAN static void
-_efl_ui_win_focus_highlight_animate_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool animate)
+_efl_ui_win_elm_widget_focus_highlight_animate_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool animate)
 {
+   // Do not call efl_super() here. Only Win handles this property.
    animate = !!animate;
    if (sd->focus_highlight.animate == animate)
      return;
@@ -6376,8 +6379,9 @@ _efl_ui_win_focus_highlight_animate_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd
 }
 
 EOLIAN static Eina_Bool
-_efl_ui_win_focus_highlight_animate_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+_efl_ui_win_elm_widget_focus_highlight_animate_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
 {
+   // Do not call efl_super() here. Only Win handles this property.
    return sd->focus_highlight.animate;
 }
 
@@ -8192,6 +8196,18 @@ elm_win_focus_highlight_enabled_set(Efl_Ui_Win *obj, Eina_Bool enabled)
    elm_obj_widget_focus_highlight_enabled_set(obj, enabled);
 }
 
+EAPI void
+elm_win_focus_highlight_animate_set(Elm_Win *obj, Eina_Bool animate)
+{
+   elm_obj_widget_focus_highlight_animate_set(obj, animate);
+}
+
+EAPI Eina_Bool
+elm_win_focus_highlight_animate_get(const Elm_Win *obj)
+{
+   return elm_obj_widget_focus_highlight_animate_get(obj);
+}
+
 // deprecated
 
 EAPI void
index 80253a5..f7f1d05 100644 (file)
@@ -268,22 +268,6 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Elm.Interface.Atspi.Window,
             constrain: bool; [[$true to restrict the window's maximum size.]]
          }
       }
-      @property focus_highlight_animate {
-         set {
-            [[Set the animate status for the focus highlight for this window.
-
-              This function will enable or disable the animation of focus
-              highlight only for the given window, rof the
-              global setting for it.
-            ]]
-         }
-         get {
-            [[Get the animate value of the focus highlight for this window.]]
-         }
-         values {
-            animate: bool; [[The enabled value for the highlight animation.]]
-         }
-      }
       @property prop_focus_skip {
          set {
             [[Set the window to be skipped by keyboard focus.
@@ -871,6 +855,7 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Elm.Interface.Atspi.Window,
       Elm.Widget.focus { get; }
       Elm.Widget.focus_highlight_style { get; set; }
       Elm.Widget.focus_highlight_enabled { get; set; }
+      Elm.Widget.focus_highlight_animate { get; set; }
       Elm.Widget.on_focus_update;
       Elm.Widget.widget_event;
       Elm.Widget.focus_manager_factory;
index 228abfb..8d5fe3a 100644 (file)
@@ -212,6 +212,28 @@ _elm_widget_focus_highlight_enabled_set(Eo *obj, Elm_Widget_Smart_Data *sd EINA_
      elm_win_focus_highlight_enabled_set(win, enable);
 }
 
+EOLIAN static Eina_Bool
+_elm_widget_focus_highlight_animate_get(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED)
+{
+   // Forward to closest parent Window
+   const Evas_Object *win = elm_widget_top_get(obj);
+
+   if (win && efl_isa(win, EFL_UI_WIN_CLASS))
+     return elm_win_focus_highlight_animate_get(win);
+
+   return EINA_FALSE;
+}
+
+EOLIAN static void
+_elm_widget_focus_highlight_animate_set(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED, Eina_Bool enable)
+{
+   // Forward to closest parent Window
+   Evas_Object *win = elm_widget_top_get(obj);
+
+   if (win && efl_isa(win, EFL_UI_WIN_CLASS))
+     elm_win_focus_highlight_animate_set(win, enable);
+}
+
 static Eina_Bool
 _tree_unfocusable(Eo *obj)
 {
index 6018146..08cbd8f 100644 (file)
@@ -531,6 +531,7 @@ abstract Elm.Widget (Efl.Canvas.Group, Elm.Interface.Atspi_Accessible,
          }
       }
       @property focus_highlight_enabled {
+         [[Whether focus highlight is enabled or not.]]
          set {
             [[Set the enabled status for the focus highlight in a window.
 
@@ -545,6 +546,24 @@ abstract Elm.Widget (Efl.Canvas.Group, Elm.Interface.Atspi_Accessible,
             enabled: bool; [[The enabled value for the highlight.]]
          }
       }
+      @property focus_highlight_animate {
+         [[Whether focus highlight should animate or not.]]
+         set {
+            [[Set the animate status for the focus highlight for this window.
+
+              This function will enable or disable the animation of focus
+              highlight only for the given window. If the widget is not a
+              window, then this call is forwarded to the window (using
+              @.widget_top).
+            ]]
+         }
+         get {
+            [[Get the animate value of the focus highlight for this window.]]
+         }
+         values {
+            animate: bool; [[The enabled value for the highlight animation.]]
+         }
+      }
 
       /* Old focus API. FIXME: Needs massive clean up! */
       @property focus_order @beta {
index 48b0590..061beaf 100644 (file)
@@ -1199,3 +1199,24 @@ EAPI void elm_win_focus_highlight_enabled_set(Elm_Win *obj, Eina_Bool enabled);
  * @ingroup Efl_Ui_Win
  */
 EAPI Eina_Bool elm_win_focus_highlight_enabled_get(const Elm_Win *obj);
+
+/**
+ * @brief Set the animate status for the focus highlight for this window.
+ *
+ * This function will enable or disable the animation of focus highlight only
+ * for the given window, rof the global setting for it.
+ *
+ * @param[in] animate The enabled value for the highlight animation.
+ *
+ * @ingroup Efl_Ui_Win
+ */
+EAPI void elm_win_focus_highlight_animate_set(Elm_Win *obj, Eina_Bool animate);
+
+/**
+ * @brief Get the animate value of the focus highlight for this window.
+ *
+ * @return The enabled value for the highlight animation.
+ *
+ * @ingroup Efl_Ui_Win
+ */
+EAPI Eina_Bool elm_win_focus_highlight_animate_get(const Elm_Win *obj);