group: Replace group_no_render by object no_render
authorJean-Philippe Andre <jp.andre@samsung.com>
Tue, 6 Sep 2016 11:02:34 +0000 (20:02 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Wed, 12 Oct 2016 02:25:55 +0000 (11:25 +0900)
Most of the smart functions "Efl.Canvas.Group.group_xxx" should
not exist and be overrides of the base object function instead.
Cleaning this up is necessary if we want an EO API for custom
smart objects. This patch is the first attempt at removing a
method (the simplest one).

As for no_render, I wonder if propagating to the children
really is necessary. evas_render should skip them already.

src/lib/edje/edje_object.eo
src/lib/edje/edje_smart.c
src/lib/elementary/elm_widget.c
src/lib/elementary/elm_widget.eo
src/lib/evas/canvas/efl_canvas_group.eo
src/lib/evas/canvas/efl_canvas_group_clipped.eo
src/lib/evas/canvas/evas_clip.c
src/lib/evas/canvas/evas_object_smart.c
src/lib/evas/canvas/evas_object_smart_clipped.c

index 7474ace..1144e97 100644 (file)
@@ -2069,6 +2069,7 @@ class Edje.Object (Efl.Canvas.Group.Clipped, Efl.File, Efl.Container, Efl.Part)
       Efl.Object.constructor;
       Efl.Object.destructor;
       Efl.Object.dbg_info_get;
+      Efl.Canvas.Object.no_render.set;
       Efl.Canvas.Object.paragraph_direction.set;
       Efl.Canvas.Group.group_hide;
       Efl.Canvas.Group.group_show;
@@ -2076,7 +2077,6 @@ class Edje.Object (Efl.Canvas.Group.Clipped, Efl.File, Efl.Container, Efl.Part)
       Efl.Canvas.Group.group_add;
       Efl.Canvas.Group.group_del;
       Efl.Canvas.Group.group_resize;
-      Efl.Canvas.Group.group_no_render.set;
       Efl.Canvas.Group.group_calculate;
       Efl.File.file.set;
       Efl.File.file.get;
index 77c31b6..0079c43 100644 (file)
@@ -329,16 +329,17 @@ _edje_object_efl_canvas_group_group_hide(Eo *obj, Edje *ed)
 }
 
 EOLIAN static void
-_edje_object_efl_canvas_group_group_no_render_set(Eo *obj, Edje *ed, Eina_Bool hide)
+_edje_object_efl_canvas_object_no_render_set(Eo *obj, Edje *ed, Eina_Bool enable)
 {
    Eina_List *l;
    Edje *edg;
 
-   efl_canvas_group_no_render_set(efl_super(obj, MY_CLASS), hide);
-   if (efl_canvas_object_no_render_get(obj) == hide) return;
+   enable = !!enable;
+   if (efl_canvas_object_no_render_get(obj) == enable) return;
+   efl_canvas_object_no_render_set(efl_super(obj, MY_CLASS), enable);
 
    EINA_LIST_FOREACH(ed->groups, l, edg)
-     if (edg != ed) efl_canvas_group_no_render_set(edg->obj, hide);
+     if (edg != ed) efl_canvas_object_no_render_set(edg->obj, enable);
 }
 
 EOLIAN static void
index 86514a3..ee3da4d 100644 (file)
@@ -574,11 +574,15 @@ _elm_widget_efl_canvas_group_group_color_set(Eo *obj, Elm_Widget_Smart_Data *_pd
 }
 
 EOLIAN static void
-_elm_widget_efl_canvas_group_group_no_render_set(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Eina_Bool hide)
+_elm_widget_efl_canvas_object_no_render_set(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Eina_Bool hide)
 {
    Eina_Iterator *it;
    Evas_Object *o;
 
+   hide = !!hide;
+   if (efl_canvas_object_no_render_get(obj) == hide)
+     return;
+
    it = evas_object_smart_iterator_new(obj);
    EINA_ITERATOR_FOREACH(it, o)
      {
@@ -586,6 +590,9 @@ _elm_widget_efl_canvas_group_group_no_render_set(Eo *obj, Elm_Widget_Smart_Data
        efl_canvas_object_no_render_set(o, hide);
      }
    eina_iterator_free(it);
+
+   // bypass implementation in Efl.Canvas.Group
+   efl_canvas_object_no_render_set(efl_super(obj, EFL_CANVAS_GROUP_CLASS), hide);
 }
 
 EOLIAN static void
index 63f6d38..e9adc4b 100644 (file)
@@ -847,6 +847,7 @@ abstract Elm.Widget (Efl.Canvas.Group, Elm.Interface.Atspi_Accessible, Elm.Inter
       Efl.Object.destructor;
       Efl.Object.dbg_info_get;
       Efl.Object.provider_find;
+      Efl.Canvas.Object.no_render.set;
       Efl.Canvas.Group.group_hide;
       Efl.Canvas.Group.group_calculate;
       Efl.Canvas.Group.group_clip_unset;
@@ -859,7 +860,6 @@ abstract Elm.Widget (Efl.Canvas.Group, Elm.Interface.Atspi_Accessible, Elm.Inter
       Efl.Canvas.Group.group_clip.set;
       Efl.Canvas.Group.group_member_add;
       Efl.Canvas.Group.group_resize;
-      Efl.Canvas.Group.group_no_render.set;
       Elm.Interface.Atspi_Accessible.name.get;
       Elm.Interface.Atspi_Accessible.state_set.get;
       Elm.Interface.Atspi_Accessible.children.get;
index da076a3..0a3657a 100644 (file)
@@ -111,11 +111,6 @@ class Efl.Canvas.Group (Efl.Canvas.Object)
             @in y: Evas.Coord;
          }
       }
-      @property group_no_render {
-         [[Propagates the value of no-render to the smart children.]]
-         set { legacy: null; }
-         values { hide: bool; }
-      }
       group_hide {
          [[No description supplied by the EAPI.]]
          legacy: null;
@@ -184,6 +179,7 @@ class Efl.Canvas.Group (Efl.Canvas.Object)
       class.constructor;
       class.destructor;
       Efl.Object.constructor;
+      Efl.Canvas.Object.no_render.set;
       Efl.Canvas.Object.paragraph_direction.set;
       Efl.Canvas.Object.paragraph_direction.get;
    }
index eb5a7b1..8a57f6f 100644 (file)
@@ -3,6 +3,7 @@ abstract Efl.Canvas.Group.Clipped (Efl.Canvas.Group)
    [[Internal class representing a canvas object group with a clipper.]]
    data: Evas_Object_Smart_Clipped_Data;
    implements {
+      Efl.Canvas.Object.no_render.set;
       Efl.Canvas.Group.group_hide;
       Efl.Canvas.Group.group_clip.set;
       Efl.Canvas.Group.group_clip_unset;
index 0ff74d9..9020b12 100644 (file)
@@ -592,14 +592,9 @@ _efl_canvas_object_clipees_has(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Dat
 }
 
 EOLIAN void
-_efl_canvas_object_no_render_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Bool enable)
+_efl_canvas_object_no_render_set(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Eina_Bool enable)
 {
-   enable = !!enable;
-   if (obj->no_render == enable) return;
-
-   obj->no_render = enable;
-   if (obj->is_smart)
-     efl_canvas_group_no_render_set(eo_obj, enable);
+   obj->no_render = !!enable;
 }
 
 EOLIAN Eina_Bool
index cb71711..b09f814 100644 (file)
@@ -680,23 +680,16 @@ _efl_canvas_group_group_clip_unset(Eo *eo_obj, Evas_Smart_Data *o EINA_UNUSED)
 }
 
 EOLIAN static void
-_efl_canvas_group_group_no_render_set(Eo *eo_obj, Evas_Smart_Data *o EINA_UNUSED, Eina_Bool hide)
+_efl_canvas_group_efl_canvas_object_no_render_set(Eo *eo_obj, Evas_Smart_Data *o EINA_UNUSED, Eina_Bool enable)
 {
    Evas_Object_Protected_Data *obj2;
-   Evas_Object_Smart_Clipped_Data *cso;
-   Evas_Object *cso_clipper;
 
-   if (efl_isa(eo_obj, EFL_CANVAS_GROUP_CLIPPED_CLASS))
-     cso = efl_data_scope_get(eo_obj, EFL_CANVAS_GROUP_CLIPPED_CLASS);
-   else
-     cso = evas_object_smart_data_get(eo_obj);
-   cso_clipper = cso ? cso->clipper : NULL;
+   enable = !!enable;
+   if (efl_canvas_object_no_render_get(eo_obj) == enable) return;
+   efl_canvas_object_no_render_set(efl_super(eo_obj, MY_CLASS), enable);
 
    EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(eo_obj), obj2)
-     {
-        if (cso_clipper != obj2->object)
-          efl_canvas_object_no_render_set(obj2->object, hide);
-     }
+     efl_canvas_object_no_render_set(obj2->object, enable);
 }
 
 void
index 834271d..bf80f4f 100644 (file)
@@ -146,6 +146,15 @@ _efl_canvas_group_clipped_efl_canvas_group_group_hide(Eo *eo_obj, Evas_Object_Sm
    evas_object_smart_clipped_group_hide(eo_obj);
 }
 
+EOLIAN static void
+_efl_canvas_group_clipped_efl_canvas_object_no_render_set(Eo *eo_obj, Evas_Object_Smart_Clipped_Data *cso, Eina_Bool enable)
+{
+   enable = !!enable;
+   if (efl_canvas_object_no_render_get(eo_obj) == enable) return;
+   efl_canvas_object_no_render_set(efl_super(eo_obj, MY_CLASS), enable);
+   efl_canvas_object_no_render_set(cso->clipper, 1);
+}
+
 static void
 evas_object_smart_clipped_smart_color_set(Evas_Object *eo_obj, int r, int g, int b, int a)
 {