forked from enlightenment/efl
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 <cedric@osg.samsung.com>
This commit is contained in:
parent
4730afdba0
commit
ed01a32c13
|
@ -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;
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue