cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=ed01a32c136aaba8fb23a12afaf334b4c47fc62e

commit ed01a32c136aaba8fb23a12afaf334b4c47fc62e
Author: Daniel Hirt <daniel.h...@samsung.com>
Date:   Thu Jun 11 09:58:09 2015 +0200

    evas: move evas_object_inject to super's ctor
    
    Summary:
    As we always call evas_object_inject in every Evas Object's ctcor,
    it seems sensible to move this repeated bit of code to the super
    (Evas.Object).
    
    Test Plan: Expedite, Elementary_Test and pretty much everything
    
    Reviewers: cedric, raster
    
    Subscribers: JackDanielZ, cedric
    
    Differential Revision: https://phab.enlightenment.org/D2665
    
    Signed-off-by: Cedric BAIL <ced...@osg.samsung.com>
---
 src/lib/evas/canvas/evas_object_image.c     | 6 ------
 src/lib/evas/canvas/evas_object_line.c      | 3 ---
 src/lib/evas/canvas/evas_object_main.c      | 2 ++
 src/lib/evas/canvas/evas_object_polygon.c   | 3 ---
 src/lib/evas/canvas/evas_object_rectangle.c | 6 ------
 src/lib/evas/canvas/evas_object_smart.c     | 3 ---
 src/lib/evas/canvas/evas_object_text.c      | 5 -----
 src/lib/evas/canvas/evas_object_textblock.c | 4 ----
 src/lib/evas/canvas/evas_object_textgrid.c  | 6 ------
 src/lib/evas/canvas/evas_object_vg.c        | 4 ----
 10 files changed, 2 insertions(+), 40 deletions(-)

diff --git a/src/lib/evas/canvas/evas_object_image.c 
b/src/lib/evas/canvas/evas_object_image.c
index b3e067c..f5535fe 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -346,17 +346,11 @@ EOLIAN static Eo *
 _evas_image_eo_base_constructor(Eo *eo_obj, Evas_Image_Data *o)
 {
    Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, 
EVAS_OBJECT_CLASS);
-   Evas *eo_e;
-   Eo *parent = NULL;
    Evas_Colorspace cspace;
 
    eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor());
 
-   eo_do(eo_obj, parent = eo_parent_get());
-   eo_e = evas_object_evas_get(parent);
-
    evas_object_image_init(eo_obj);
-   evas_object_inject(eo_obj, obj, eo_e);
 
    if (!_init_cow())
      return NULL;
diff --git a/src/lib/evas/canvas/evas_object_line.c 
b/src/lib/evas/canvas/evas_object_line.c
index df9570a..dc3882b 100644
--- a/src/lib/evas/canvas/evas_object_line.c
+++ b/src/lib/evas/canvas/evas_object_line.c
@@ -219,14 +219,11 @@ _evas_line_eo_base_constructor(Eo *eo_obj, Evas_Line_Data 
*class_data EINA_UNUSE
 {
    Evas_Object_Protected_Data *obj;
    Evas_Line_Data *o;
-   Eo *parent = NULL;
 
    eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor());
 
    obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
    evas_object_line_init(eo_obj);
-   eo_do(eo_obj, parent = eo_parent_get());
-   evas_object_inject(eo_obj, obj, evas_object_evas_get(parent));
 
    o = class_data;
    /* alloc obj private data */
diff --git a/src/lib/evas/canvas/evas_object_main.c 
b/src/lib/evas/canvas/evas_object_main.c
index f6adda7..21a107c 100644
--- a/src/lib/evas/canvas/evas_object_main.c
+++ b/src/lib/evas/canvas/evas_object_main.c
@@ -108,6 +108,8 @@ _evas_object_eo_base_constructor(Eo *eo_obj, 
Evas_Object_Protected_Data *obj)
    obj->data_3d = eina_cow_alloc(evas_object_3d_cow);
    obj->mask = eina_cow_alloc(evas_object_mask_cow);
 
+   evas_object_inject(eo_obj, obj, evas_object_evas_get(parent));
+
    return eo_obj;
 }
 
diff --git a/src/lib/evas/canvas/evas_object_polygon.c 
b/src/lib/evas/canvas/evas_object_polygon.c
index 4e5c636..40bf934 100644
--- a/src/lib/evas/canvas/evas_object_polygon.c
+++ b/src/lib/evas/canvas/evas_object_polygon.c
@@ -105,14 +105,11 @@ EOLIAN static Eo *
 _evas_polygon_eo_base_constructor(Eo *eo_obj, Evas_Polygon_Data *class_data 
EINA_UNUSED)
 {
    Evas_Object_Protected_Data *obj;
-   Eo *parent = NULL;
 
    eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor());
 
    obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
    evas_object_polygon_init(eo_obj);
-   eo_do(eo_obj, parent = eo_parent_get());
-   evas_object_inject(eo_obj, obj, evas_object_evas_get(parent));
 
    return eo_obj;
 }
diff --git a/src/lib/evas/canvas/evas_object_rectangle.c 
b/src/lib/evas/canvas/evas_object_rectangle.c
index 8f603e6..0de959c 100644
--- a/src/lib/evas/canvas/evas_object_rectangle.c
+++ b/src/lib/evas/canvas/evas_object_rectangle.c
@@ -100,16 +100,10 @@ evas_object_rectangle_add(Evas *e)
 EOLIAN static Eo *
 _evas_rectangle_eo_base_constructor(Eo *eo_obj, Evas_Rectangle_Data 
*class_data EINA_UNUSED)
 {
-   Eo *parent = NULL;
-
    eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor());
 
-   Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, 
EVAS_OBJECT_CLASS);
    evas_object_rectangle_init(eo_obj);
 
-   eo_do(eo_obj, parent = eo_parent_get());
-   evas_object_inject(eo_obj, obj, evas_object_evas_get(parent));
-
    return eo_obj;
 }
 
diff --git a/src/lib/evas/canvas/evas_object_smart.c 
b/src/lib/evas/canvas/evas_object_smart.c
index 357e718..6506e24 100644
--- a/src/lib/evas/canvas/evas_object_smart.c
+++ b/src/lib/evas/canvas/evas_object_smart.c
@@ -546,7 +546,6 @@ _evas_object_smart_eo_base_constructor(Eo *eo_obj, 
Evas_Smart_Data *class_data E
 {
    Evas_Object_Protected_Data *obj;
    Evas_Smart_Data *smart;
-   Eo *parent = NULL;
 
    smart = class_data;
    smart->object = eo_obj;
@@ -555,8 +554,6 @@ _evas_object_smart_eo_base_constructor(Eo *eo_obj, 
Evas_Smart_Data *class_data E
    evas_object_smart_init(eo_obj);
 
    obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
-   eo_do(eo_obj, parent = eo_parent_get());
-   evas_object_inject(eo_obj, obj, evas_object_evas_get(parent));
    eo_do(eo_obj,
          evas_obj_type_set(MY_CLASS_NAME_LEGACY),
          evas_obj_smart_add());
diff --git a/src/lib/evas/canvas/evas_object_text.c 
b/src/lib/evas/canvas/evas_object_text.c
index c28e8a9..d7ee55e 100644
--- a/src/lib/evas/canvas/evas_object_text.c
+++ b/src/lib/evas/canvas/evas_object_text.c
@@ -370,11 +370,6 @@ _evas_text_eo_base_constructor(Eo *eo_obj, Evas_Text_Data 
*o)
 {
    eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor());
    evas_object_text_init(eo_obj);
-   Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, 
EVAS_OBJECT_CLASS);
-   Eo *parent = NULL;
-
-   eo_do(eo_obj, parent = eo_parent_get());
-   evas_object_inject(eo_obj, obj, evas_object_evas_get(parent));
 
    o->cur.filter = eina_cow_alloc(evas_object_filter_cow);
 
diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index 054d9d1..6a5648e 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -5808,7 +5808,6 @@ _evas_textblock_eo_base_constructor(Eo *eo_obj, 
Evas_Textblock_Data *class_data
 {
    Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, 
EVAS_OBJECT_CLASS);
    Evas_Textblock_Data *o;
-   Eo *eo_parent = NULL;
 
    eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor());
 
@@ -5822,9 +5821,6 @@ _evas_textblock_eo_base_constructor(Eo *eo_obj, 
Evas_Textblock_Data *class_data
    _format_command_init();
    evas_object_textblock_init(eo_obj);
 
-   eo_do(eo_obj, eo_parent = eo_parent_get());
-   evas_object_inject(eo_obj, obj, evas_object_evas_get(eo_parent));
-
    return eo_obj;
 }
 
diff --git a/src/lib/evas/canvas/evas_object_textgrid.c 
b/src/lib/evas/canvas/evas_object_textgrid.c
index 7dbb739..c84d0f3 100644
--- a/src/lib/evas/canvas/evas_object_textgrid.c
+++ b/src/lib/evas/canvas/evas_object_textgrid.c
@@ -1064,16 +1064,10 @@ evas_object_textgrid_add(Evas *e)
 EOLIAN static Eo *
 _evas_textgrid_eo_base_constructor(Eo *eo_obj, Evas_Textgrid_Data *class_data 
EINA_UNUSED)
 {
-   Eo *eo_parent = NULL;
-
    eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor());
 
-   Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, 
EVAS_OBJECT_CLASS);
    evas_object_textgrid_init(eo_obj);
 
-   eo_do(eo_obj, eo_parent = eo_parent_get());
-   evas_object_inject(eo_obj, obj, evas_object_evas_get(eo_parent));
-
    return eo_obj;
 }
 
diff --git a/src/lib/evas/canvas/evas_object_vg.c 
b/src/lib/evas/canvas/evas_object_vg.c
index 0e3eaa7..9cc81e4 100644
--- a/src/lib/evas/canvas/evas_object_vg.c
+++ b/src/lib/evas/canvas/evas_object_vg.c
@@ -102,7 +102,6 @@ Eo *
 _evas_vg_eo_base_constructor(Eo *eo_obj, Evas_VG_Data *pd)
 {
    Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, 
EVAS_OBJECT_CLASS);
-   Eo *parent = NULL;
 
    eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor());
 
@@ -115,9 +114,6 @@ _evas_vg_eo_base_constructor(Eo *eo_obj, Evas_VG_Data *pd)
    pd->root = eo_add(EFL_VG_ROOT_NODE_CLASS, eo_obj);
    eo_ref(pd->root);
 
-   eo_do(eo_obj, parent = eo_parent_get());
-   evas_object_inject(eo_obj, obj, evas_object_evas_get(parent));
-
    return eo_obj;
 }
 

-- 


Reply via email to