evas: move evas_object_inject to super's ctor
authorDaniel Hirt <daniel.hirt@samsung.com>
Thu, 11 Jun 2015 07:58:09 +0000 (09:58 +0200)
committerCedric BAIL <cedric@osg.samsung.com>
Thu, 11 Jun 2015 07:58:13 +0000 (09:58 +0200)
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 <cedric@osg.samsung.com>
src/lib/evas/canvas/evas_object_image.c
src/lib/evas/canvas/evas_object_line.c
src/lib/evas/canvas/evas_object_main.c
src/lib/evas/canvas/evas_object_polygon.c
src/lib/evas/canvas/evas_object_rectangle.c
src/lib/evas/canvas/evas_object_smart.c
src/lib/evas/canvas/evas_object_text.c
src/lib/evas/canvas/evas_object_textblock.c
src/lib/evas/canvas/evas_object_textgrid.c
src/lib/evas/canvas/evas_object_vg.c

index b3e067c..f5535fe 100644 (file)
@@ -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;
index df9570a..dc3882b 100644 (file)
@@ -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 */
index f6adda7..21a107c 100644 (file)
@@ -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;
 }
 
index 4e5c636..40bf934 100644 (file)
@@ -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;
 }
index 8f603e6..0de959c 100644 (file)
@@ -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;
 }
 
index 357e718..6506e24 100644 (file)
@@ -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());
index c28e8a9..d7ee55e 100644 (file)
@@ -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);
 
index 054d9d1..6a5648e 100644 (file)
@@ -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;
 }
 
index 7dbb739..c84d0f3 100644 (file)
@@ -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;
 }
 
index 0e3eaa7..9cc81e4 100644 (file)
@@ -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;
 }