widget: Remove scrollable_children from EO
authorJean-Philippe Andre <jp.andre@samsung.com>
Tue, 8 Aug 2017 13:53:58 +0000 (22:53 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Wed, 9 Aug 2017 03:25:45 +0000 (12:25 +0900)
It's an internal only function, which IMHO was not required and an
overhead over the simple loop.

Ref T5363

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

index 8c58026..505d545 100644 (file)
@@ -3510,25 +3510,6 @@ _elm_widget_parents_bounce_get(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED,
    while (parent_obj);
 }
 
-EOLIAN static Eina_List*
-_elm_widget_scrollable_children_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
-{
-   Eina_List *ret;
-   ret = NULL;
-
-   Eina_List *l;
-   Evas_Object *child;
-
-
-   EINA_LIST_FOREACH(sd->subobjs, l, child)
-     {
-        if (elm_widget_is(child) && _elm_scrollable_is(child))
-          ret = eina_list_append(ret, child);
-     }
-
-   return ret;
-}
-
 EOLIAN static void
 _elm_widget_scroll_hold_push(Eo *obj, Elm_Widget_Smart_Data *sd)
 {
@@ -3539,15 +3520,14 @@ _elm_widget_scroll_hold_push(Eo *obj, Elm_Widget_Smart_Data *sd)
            elm_interface_scrollable_hold_set(obj, EINA_TRUE);
         else
           {
-             Eina_List *scr_children, *l;
              Evas_Object *child;
+             Eina_List *l;
 
-             scr_children = elm_widget_scrollable_children_get(obj);
-             EINA_LIST_FOREACH(scr_children, l, child)
+             EINA_LIST_FOREACH(sd->subobjs, l, child)
                {
-                  elm_interface_scrollable_hold_set(child, EINA_TRUE);
+                  if (elm_widget_is(child) && _elm_scrollable_is(child))
+                    elm_interface_scrollable_hold_set(child, EINA_TRUE);
                }
-             eina_list_free(scr_children);
           }
      }
    if (sd->parent_obj) elm_obj_widget_scroll_hold_push(sd->parent_obj);
@@ -3564,15 +3544,14 @@ _elm_widget_scroll_hold_pop(Eo *obj, Elm_Widget_Smart_Data *sd)
            elm_interface_scrollable_hold_set(obj, EINA_FALSE);
         else
           {
-             Eina_List *scr_children, *l;
              Evas_Object *child;
+             Eina_List *l;
 
-             scr_children = elm_widget_scrollable_children_get(obj);
-             EINA_LIST_FOREACH(scr_children, l, child)
+             EINA_LIST_FOREACH(sd->subobjs, l, child)
                {
-                  elm_interface_scrollable_hold_set(child, EINA_FALSE);
+                  if (elm_widget_is(child) && _elm_scrollable_is(child))
+                    elm_interface_scrollable_hold_set(child, EINA_FALSE);
                }
-             eina_list_free(scr_children);
           }
      }
    if (sd->parent_obj) elm_obj_widget_scroll_hold_pop(sd->parent_obj);
@@ -3595,15 +3574,14 @@ _elm_widget_scroll_freeze_push(Eo *obj, Elm_Widget_Smart_Data *sd)
            elm_interface_scrollable_freeze_set(obj, EINA_TRUE);
         else
           {
-             Eina_List *scr_children, *l;
              Evas_Object *child;
+             Eina_List *l;
 
-             scr_children = elm_widget_scrollable_children_get(obj);
-             EINA_LIST_FOREACH(scr_children, l, child)
+             EINA_LIST_FOREACH(sd->subobjs, l, child)
                {
-                  elm_interface_scrollable_freeze_set(child, EINA_TRUE);
+                  if (elm_widget_is(child) && _elm_scrollable_is(child))
+                    elm_interface_scrollable_freeze_set(child, EINA_TRUE);
                }
-             eina_list_free(scr_children);
           }
      }
    if (sd->parent_obj) elm_obj_widget_scroll_freeze_push(sd->parent_obj);
@@ -3620,15 +3598,14 @@ _elm_widget_scroll_freeze_pop(Eo *obj, Elm_Widget_Smart_Data *sd)
            elm_interface_scrollable_freeze_set(obj, EINA_FALSE);
         else
           {
-             Eina_List *scr_children, *l;
              Evas_Object *child;
+             Eina_List *l;
 
-             scr_children = elm_widget_scrollable_children_get(obj);
-             EINA_LIST_FOREACH(scr_children, l, child)
+             EINA_LIST_FOREACH(sd->subobjs, l, child)
                {
-                  elm_interface_scrollable_freeze_set(child, EINA_FALSE);
+                  if (elm_widget_is(child) && _elm_scrollable_is(child))
+                    elm_interface_scrollable_freeze_set(child, EINA_FALSE);
                }
-             eina_list_free(scr_children);
           }
      }
    if (sd->parent_obj) elm_obj_widget_scroll_freeze_pop(sd->parent_obj);
@@ -4045,13 +4022,12 @@ _elm_widget_drag_child_locked_y_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *
 EOLIAN static void
 _elm_widget_item_loop_enabled_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd EINA_UNUSED, Eina_Bool enable EINA_UNUSED)
 {
-       return;
 }
 
 EOLIAN static Eina_Bool
 _elm_widget_item_loop_enabled_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd EINA_UNUSED)
 {
-       return EINA_FALSE;
+   return EINA_FALSE;
 }
 
 EOLIAN static Elm_Theme_Apply
index 1721493..121d6ff 100644 (file)
@@ -235,6 +235,8 @@ abstract Elm.Widget (Efl.Canvas.Group, Elm.Interface.Atspi_Accessible,
             sobj: Efl.Canvas.Object @nullable; [[Hover sub object]]
          }
       }
+      /* internal only - most objects use data = null as they work on
+         themselves except scroller itself */
       @property on_show_region_hook {
         [[Region hook on show property]]
          set {
@@ -244,6 +246,7 @@ abstract Elm.Widget (Efl.Canvas.Group, Elm.Interface.Atspi_Accessible,
             data: void_ptr @optional; [[Data pointer]]
          }
       }
+      /* this is a part api */
       @property domain_part_text_translatable {
         [[Translate domain text part property]]
          set {
@@ -272,14 +275,6 @@ abstract Elm.Widget (Efl.Canvas.Group, Elm.Interface.Atspi_Accessible,
             label: string; [[Label]]
          }
       }
-      @property scrollable_children {
-         get {
-            [[Function to operate on a given widget's scrollable children when necessary.
-
-              Warning: free the returned list with eina_list_free().]]
-            return: free(own(list<Efl.Canvas.Object>), eina_list_free) @warn_unused; [[List of scrollable children]]
-         }
-      }
       @property scroll_hold {
         [[Scroll hold property]]
          get {
index f653232..40579b8 100644 (file)
@@ -785,12 +785,6 @@ EAPI void             elm_widget_focus_region_show_mode_set(Evas_Object *obj, El
 EAPI Elm_Focus_Region_Show_Mode elm_widget_focus_region_show_mode_get(const Evas_Object *obj);
 EAPI void             elm_widget_focus_reconfigure(Evas_Object *obj);
 
-/**
- * Function to operate on a given widget's scrollabe children when necessary.
- * @warning free the returned list with eina_list_free().
- */
-EAPI Eina_List       *elm_widget_scrollable_children_get(const Evas_Object *obj);
-
 /* debug function. don't use it unless you are tracking parenting issues */
 EAPI void             elm_widget_tree_dump(const Evas_Object *top);
 EAPI void             elm_widget_tree_dot_dump(const Evas_Object *top, FILE *output);