diff options
author | Daniel Hirt <daniel.hirt@samsung.com> | 2015-06-11 09:58:09 +0200 |
---|---|---|
committer | Cedric BAIL <cedric@osg.samsung.com> | 2015-06-11 09:58:13 +0200 |
commit | ed01a32c136aaba8fb23a12afaf334b4c47fc62e (patch) | |
tree | 55b460bae129537eb90928c5e0174a8ebc246a29 | |
parent | 4730afdba07d8879516de5323ba28f1115800680 (diff) |
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>
-rw-r--r-- | src/lib/evas/canvas/evas_object_image.c | 6 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_object_line.c | 3 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_object_main.c | 2 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_object_polygon.c | 3 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_object_rectangle.c | 6 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_object_smart.c | 3 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_object_text.c | 5 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_object_textblock.c | 4 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_object_textgrid.c | 6 | ||||
-rw-r--r-- | 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 b3e067cf41..f5535fe3bd 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 * | |||
346 | _evas_image_eo_base_constructor(Eo *eo_obj, Evas_Image_Data *o) | 346 | _evas_image_eo_base_constructor(Eo *eo_obj, Evas_Image_Data *o) |
347 | { | 347 | { |
348 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); | 348 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); |
349 | Evas *eo_e; | ||
350 | Eo *parent = NULL; | ||
351 | Evas_Colorspace cspace; | 349 | Evas_Colorspace cspace; |
352 | 350 | ||
353 | eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor()); | 351 | eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor()); |
354 | 352 | ||
355 | eo_do(eo_obj, parent = eo_parent_get()); | ||
356 | eo_e = evas_object_evas_get(parent); | ||
357 | |||
358 | evas_object_image_init(eo_obj); | 353 | evas_object_image_init(eo_obj); |
359 | evas_object_inject(eo_obj, obj, eo_e); | ||
360 | 354 | ||
361 | if (!_init_cow()) | 355 | if (!_init_cow()) |
362 | return NULL; | 356 | return NULL; |
diff --git a/src/lib/evas/canvas/evas_object_line.c b/src/lib/evas/canvas/evas_object_line.c index df9570af22..dc3882b04c 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 | |||
219 | { | 219 | { |
220 | Evas_Object_Protected_Data *obj; | 220 | Evas_Object_Protected_Data *obj; |
221 | Evas_Line_Data *o; | 221 | Evas_Line_Data *o; |
222 | Eo *parent = NULL; | ||
223 | 222 | ||
224 | eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor()); | 223 | eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor()); |
225 | 224 | ||
226 | obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); | 225 | obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); |
227 | evas_object_line_init(eo_obj); | 226 | evas_object_line_init(eo_obj); |
228 | eo_do(eo_obj, parent = eo_parent_get()); | ||
229 | evas_object_inject(eo_obj, obj, evas_object_evas_get(parent)); | ||
230 | 227 | ||
231 | o = class_data; | 228 | o = class_data; |
232 | /* alloc obj private data */ | 229 | /* 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 f6adda729f..21a107c2a1 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) | |||
108 | obj->data_3d = eina_cow_alloc(evas_object_3d_cow); | 108 | obj->data_3d = eina_cow_alloc(evas_object_3d_cow); |
109 | obj->mask = eina_cow_alloc(evas_object_mask_cow); | 109 | obj->mask = eina_cow_alloc(evas_object_mask_cow); |
110 | 110 | ||
111 | evas_object_inject(eo_obj, obj, evas_object_evas_get(parent)); | ||
112 | |||
111 | return eo_obj; | 113 | return eo_obj; |
112 | } | 114 | } |
113 | 115 | ||
diff --git a/src/lib/evas/canvas/evas_object_polygon.c b/src/lib/evas/canvas/evas_object_polygon.c index 4e5c6361f1..40bf934ae8 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 * | |||
105 | _evas_polygon_eo_base_constructor(Eo *eo_obj, Evas_Polygon_Data *class_data EINA_UNUSED) | 105 | _evas_polygon_eo_base_constructor(Eo *eo_obj, Evas_Polygon_Data *class_data EINA_UNUSED) |
106 | { | 106 | { |
107 | Evas_Object_Protected_Data *obj; | 107 | Evas_Object_Protected_Data *obj; |
108 | Eo *parent = NULL; | ||
109 | 108 | ||
110 | eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor()); | 109 | eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor()); |
111 | 110 | ||
112 | obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); | 111 | obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); |
113 | evas_object_polygon_init(eo_obj); | 112 | evas_object_polygon_init(eo_obj); |
114 | eo_do(eo_obj, parent = eo_parent_get()); | ||
115 | evas_object_inject(eo_obj, obj, evas_object_evas_get(parent)); | ||
116 | 113 | ||
117 | return eo_obj; | 114 | return eo_obj; |
118 | } | 115 | } |
diff --git a/src/lib/evas/canvas/evas_object_rectangle.c b/src/lib/evas/canvas/evas_object_rectangle.c index 8f603e6daa..0de959c962 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) | |||
100 | EOLIAN static Eo * | 100 | EOLIAN static Eo * |
101 | _evas_rectangle_eo_base_constructor(Eo *eo_obj, Evas_Rectangle_Data *class_data EINA_UNUSED) | 101 | _evas_rectangle_eo_base_constructor(Eo *eo_obj, Evas_Rectangle_Data *class_data EINA_UNUSED) |
102 | { | 102 | { |
103 | Eo *parent = NULL; | ||
104 | |||
105 | eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor()); | 103 | eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor()); |
106 | 104 | ||
107 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); | ||
108 | evas_object_rectangle_init(eo_obj); | 105 | evas_object_rectangle_init(eo_obj); |
109 | 106 | ||
110 | eo_do(eo_obj, parent = eo_parent_get()); | ||
111 | evas_object_inject(eo_obj, obj, evas_object_evas_get(parent)); | ||
112 | |||
113 | return eo_obj; | 107 | return eo_obj; |
114 | } | 108 | } |
115 | 109 | ||
diff --git a/src/lib/evas/canvas/evas_object_smart.c b/src/lib/evas/canvas/evas_object_smart.c index 357e718784..6506e246da 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 | |||
546 | { | 546 | { |
547 | Evas_Object_Protected_Data *obj; | 547 | Evas_Object_Protected_Data *obj; |
548 | Evas_Smart_Data *smart; | 548 | Evas_Smart_Data *smart; |
549 | Eo *parent = NULL; | ||
550 | 549 | ||
551 | smart = class_data; | 550 | smart = class_data; |
552 | smart->object = eo_obj; | 551 | smart->object = eo_obj; |
@@ -555,8 +554,6 @@ _evas_object_smart_eo_base_constructor(Eo *eo_obj, Evas_Smart_Data *class_data E | |||
555 | evas_object_smart_init(eo_obj); | 554 | evas_object_smart_init(eo_obj); |
556 | 555 | ||
557 | obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); | 556 | obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); |
558 | eo_do(eo_obj, parent = eo_parent_get()); | ||
559 | evas_object_inject(eo_obj, obj, evas_object_evas_get(parent)); | ||
560 | eo_do(eo_obj, | 557 | eo_do(eo_obj, |
561 | evas_obj_type_set(MY_CLASS_NAME_LEGACY), | 558 | evas_obj_type_set(MY_CLASS_NAME_LEGACY), |
562 | evas_obj_smart_add()); | 559 | 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 c28e8a91e7..d7ee55e049 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) | |||
370 | { | 370 | { |
371 | eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor()); | 371 | eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor()); |
372 | evas_object_text_init(eo_obj); | 372 | evas_object_text_init(eo_obj); |
373 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); | ||
374 | Eo *parent = NULL; | ||
375 | |||
376 | eo_do(eo_obj, parent = eo_parent_get()); | ||
377 | evas_object_inject(eo_obj, obj, evas_object_evas_get(parent)); | ||
378 | 373 | ||
379 | o->cur.filter = eina_cow_alloc(evas_object_filter_cow); | 374 | o->cur.filter = eina_cow_alloc(evas_object_filter_cow); |
380 | 375 | ||
diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 054d9d1c92..6a5648e8ca 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 | |||
5808 | { | 5808 | { |
5809 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); | 5809 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); |
5810 | Evas_Textblock_Data *o; | 5810 | Evas_Textblock_Data *o; |
5811 | Eo *eo_parent = NULL; | ||
5812 | 5811 | ||
5813 | eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor()); | 5812 | eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor()); |
5814 | 5813 | ||
@@ -5822,9 +5821,6 @@ _evas_textblock_eo_base_constructor(Eo *eo_obj, Evas_Textblock_Data *class_data | |||
5822 | _format_command_init(); | 5821 | _format_command_init(); |
5823 | evas_object_textblock_init(eo_obj); | 5822 | evas_object_textblock_init(eo_obj); |
5824 | 5823 | ||
5825 | eo_do(eo_obj, eo_parent = eo_parent_get()); | ||
5826 | evas_object_inject(eo_obj, obj, evas_object_evas_get(eo_parent)); | ||
5827 | |||
5828 | return eo_obj; | 5824 | return eo_obj; |
5829 | } | 5825 | } |
5830 | 5826 | ||
diff --git a/src/lib/evas/canvas/evas_object_textgrid.c b/src/lib/evas/canvas/evas_object_textgrid.c index 7dbb739570..c84d0f38d7 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) | |||
1064 | EOLIAN static Eo * | 1064 | EOLIAN static Eo * |
1065 | _evas_textgrid_eo_base_constructor(Eo *eo_obj, Evas_Textgrid_Data *class_data EINA_UNUSED) | 1065 | _evas_textgrid_eo_base_constructor(Eo *eo_obj, Evas_Textgrid_Data *class_data EINA_UNUSED) |
1066 | { | 1066 | { |
1067 | Eo *eo_parent = NULL; | ||
1068 | |||
1069 | eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor()); | 1067 | eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor()); |
1070 | 1068 | ||
1071 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); | ||
1072 | evas_object_textgrid_init(eo_obj); | 1069 | evas_object_textgrid_init(eo_obj); |
1073 | 1070 | ||
1074 | eo_do(eo_obj, eo_parent = eo_parent_get()); | ||
1075 | evas_object_inject(eo_obj, obj, evas_object_evas_get(eo_parent)); | ||
1076 | |||
1077 | return eo_obj; | 1071 | return eo_obj; |
1078 | } | 1072 | } |
1079 | 1073 | ||
diff --git a/src/lib/evas/canvas/evas_object_vg.c b/src/lib/evas/canvas/evas_object_vg.c index 0e3eaa76d0..9cc81e45c8 100644 --- a/src/lib/evas/canvas/evas_object_vg.c +++ b/src/lib/evas/canvas/evas_object_vg.c | |||
@@ -102,7 +102,6 @@ Eo * | |||
102 | _evas_vg_eo_base_constructor(Eo *eo_obj, Evas_VG_Data *pd) | 102 | _evas_vg_eo_base_constructor(Eo *eo_obj, Evas_VG_Data *pd) |
103 | { | 103 | { |
104 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); | 104 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); |
105 | Eo *parent = NULL; | ||
106 | 105 | ||
107 | eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor()); | 106 | eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor()); |
108 | 107 | ||
@@ -115,9 +114,6 @@ _evas_vg_eo_base_constructor(Eo *eo_obj, Evas_VG_Data *pd) | |||
115 | pd->root = eo_add(EFL_VG_ROOT_NODE_CLASS, eo_obj); | 114 | pd->root = eo_add(EFL_VG_ROOT_NODE_CLASS, eo_obj); |
116 | eo_ref(pd->root); | 115 | eo_ref(pd->root); |
117 | 116 | ||
118 | eo_do(eo_obj, parent = eo_parent_get()); | ||
119 | evas_object_inject(eo_obj, obj, evas_object_evas_get(parent)); | ||
120 | |||
121 | return eo_obj; | 117 | return eo_obj; |
122 | } | 118 | } |
123 | 119 | ||