summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYeongjong Lee <yj34.lee@samsung.com>2018-08-29 21:11:00 +0900
committerHermet Park <hermetpark@gmail.com>2018-08-29 21:11:00 +0900
commite19292aa2b0a8098f3e6f5c63ba86e80f99df90b (patch)
tree0f39c9d713da0729869d4750ccd2478c5b724681 /src
parent37f1a46c4a23a19e8aeece005b506dd0727f6196 (diff)
evas: call evas_find before safety check
Summary: edje_edit_object_add edje_object_add emotion_object_add evas_object_xxx_add These APIs had allowed to set parent to EFL_CANVAS_OBJECT(Evas_Object) before 8bb11a17. we should call evas_find before safety check for backward compatibility. Test Plan: win = elm_win_add(NULL, "main", ELM_WIN_BASIC); 1. `rect = evas_object_rectangle_add(evas_object_evas_get(win));` 2. `rect = evas_object_rectangle_add(win);` Check that 1. and 2. works. Reviewers: Hermet, zmike Reviewed By: Hermet Subscribers: cedric, #reviewers, CHAN, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D6909
Diffstat (limited to 'src')
-rw-r--r--src/lib/edje/edje_edit.c3
-rw-r--r--src/lib/edje/edje_smart.c3
-rw-r--r--src/lib/emotion/emotion_smart.c3
-rw-r--r--src/lib/evas/canvas/efl_canvas_event_grabber.c3
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_object.c3
-rw-r--r--src/lib/evas/canvas/evas_image_legacy.c6
-rw-r--r--src/lib/evas/canvas/evas_object_box.c3
-rw-r--r--src/lib/evas/canvas/evas_object_grid.c3
-rw-r--r--src/lib/evas/canvas/evas_object_line.c3
-rw-r--r--src/lib/evas/canvas/evas_object_polygon.c3
-rw-r--r--src/lib/evas/canvas/evas_object_rectangle.c3
-rw-r--r--src/lib/evas/canvas/evas_object_smart.c3
-rw-r--r--src/lib/evas/canvas/evas_object_table.c3
-rw-r--r--src/lib/evas/canvas/evas_object_text.c3
-rw-r--r--src/lib/evas/canvas/evas_object_textgrid.c3
15 files changed, 32 insertions, 16 deletions
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index e2bbc8498f..d3e919662a 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -291,8 +291,9 @@ _edje_edit_efl_file_mmap_set(Eo *obj, Edje_Edit *eed, const Eina_File *mmap, con
291EAPI Evas_Object * 291EAPI Evas_Object *
292edje_edit_object_add(Evas *evas) 292edje_edit_object_add(Evas *evas)
293{ 293{
294 evas = evas_find(evas);
294 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(evas, EVAS_CANVAS_CLASS), NULL); 295 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(evas, EVAS_CANVAS_CLASS), NULL);
295 return efl_add(MY_CLASS, evas_find(evas), efl_canvas_object_legacy_ctor(efl_added)); 296 return efl_add(MY_CLASS, evas, efl_canvas_object_legacy_ctor(efl_added));
296} 297}
297 298
298EOLIAN static Eo * 299EOLIAN static Eo *
diff --git a/src/lib/edje/edje_smart.c b/src/lib/edje/edje_smart.c
index 9e405ceb56..5a715b35ed 100644
--- a/src/lib/edje/edje_smart.c
+++ b/src/lib/edje/edje_smart.c
@@ -22,8 +22,9 @@ Eina_Inlist *_edje_edjes = NULL;
22EAPI Evas_Object * 22EAPI Evas_Object *
23edje_object_add(Evas *evas) 23edje_object_add(Evas *evas)
24{ 24{
25 evas = evas_find(evas);
25 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(evas, EVAS_CANVAS_CLASS), NULL); 26 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(evas, EVAS_CANVAS_CLASS), NULL);
26 return efl_add(MY_CLASS, evas_find(evas), efl_canvas_object_legacy_ctor(efl_added)); 27 return efl_add(MY_CLASS, evas, efl_canvas_object_legacy_ctor(efl_added));
27} 28}
28 29
29EOLIAN static Eo * 30EOLIAN static Eo *
diff --git a/src/lib/emotion/emotion_smart.c b/src/lib/emotion/emotion_smart.c
index 5f8f46e186..ac22a873b1 100644
--- a/src/lib/emotion/emotion_smart.c
+++ b/src/lib/emotion/emotion_smart.c
@@ -232,8 +232,9 @@ _clipper_position_size_update(Evas_Object *obj, int x, int y, int w, int h, int
232EAPI Evas_Object * 232EAPI Evas_Object *
233emotion_object_add(Evas *evas) 233emotion_object_add(Evas *evas)
234{ 234{
235 evas = evas_find(evas);
235 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(evas, EVAS_CANVAS_CLASS), NULL); 236 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(evas, EVAS_CANVAS_CLASS), NULL);
236 return efl_add(MY_CLASS, evas_find(evas), efl_canvas_object_legacy_ctor(efl_added)); 237 return efl_add(MY_CLASS, evas, efl_canvas_object_legacy_ctor(efl_added));
237} 238}
238 239
239EOLIAN static Eo * 240EOLIAN static Eo *
diff --git a/src/lib/evas/canvas/efl_canvas_event_grabber.c b/src/lib/evas/canvas/efl_canvas_event_grabber.c
index df7282754b..1cfde42693 100644
--- a/src/lib/evas/canvas/efl_canvas_event_grabber.c
+++ b/src/lib/evas/canvas/efl_canvas_event_grabber.c
@@ -403,8 +403,9 @@ _efl_canvas_event_grabber_freeze_when_visible_get(const Eo *eo_obj EINA_UNUSED,
403EAPI Evas_Object * 403EAPI Evas_Object *
404evas_object_event_grabber_add(Evas *eo_e) 404evas_object_event_grabber_add(Evas *eo_e)
405{ 405{
406 eo_e = evas_find(eo_e);
406 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(eo_e, EVAS_CANVAS_CLASS), NULL); 407 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(eo_e, EVAS_CANVAS_CLASS), NULL);
407 return efl_add(MY_CLASS, evas_find(eo_e), efl_canvas_object_legacy_ctor(efl_added)); 408 return efl_add(MY_CLASS, eo_e, efl_canvas_object_legacy_ctor(efl_added));
408} 409}
409 410
410#include "efl_canvas_event_grabber.eo.c" 411#include "efl_canvas_event_grabber.eo.c"
diff --git a/src/lib/evas/canvas/efl_canvas_vg_object.c b/src/lib/evas/canvas/efl_canvas_vg_object.c
index a3634b83c2..17f822a37b 100644
--- a/src/lib/evas/canvas/efl_canvas_vg_object.c
+++ b/src/lib/evas/canvas/efl_canvas_vg_object.c
@@ -124,9 +124,10 @@ _evas_vg_resize(void *data, const Efl_Event *ev)
124EAPI Evas_Object * 124EAPI Evas_Object *
125evas_object_vg_add(Evas *e) 125evas_object_vg_add(Evas *e)
126{ 126{
127 e = evas_find(e);
127 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(e, EVAS_CANVAS_CLASS), NULL); 128 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(e, EVAS_CANVAS_CLASS), NULL);
128 // TODO: Ask backend to return the main Ector_Surface 129 // TODO: Ask backend to return the main Ector_Surface
129 return efl_add(MY_CLASS, evas_find(e), efl_canvas_object_legacy_ctor(efl_added)); 130 return efl_add(MY_CLASS, e, efl_canvas_object_legacy_ctor(efl_added));
130} 131}
131 132
132EOLIAN static Efl_VG * 133EOLIAN static Efl_VG *
diff --git a/src/lib/evas/canvas/evas_image_legacy.c b/src/lib/evas/canvas/evas_image_legacy.c
index 344408e38a..defd059781 100644
--- a/src/lib/evas/canvas/evas_image_legacy.c
+++ b/src/lib/evas/canvas/evas_image_legacy.c
@@ -25,8 +25,9 @@ struct _Evas_Image_Legacy_Pixels_Entry
25EAPI Evas_Object * 25EAPI Evas_Object *
26evas_object_image_add(Evas *eo_e) 26evas_object_image_add(Evas *eo_e)
27{ 27{
28 eo_e = evas_find(eo_e);
28 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(eo_e, EVAS_CANVAS_CLASS), NULL); 29 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(eo_e, EVAS_CANVAS_CLASS), NULL);
29 return efl_add(EVAS_IMAGE_CLASS, evas_find(eo_e), 30 return efl_add(EVAS_IMAGE_CLASS, eo_e,
30 efl_gfx_fill_auto_set(efl_added, EINA_FALSE), 31 efl_gfx_fill_auto_set(efl_added, EINA_FALSE),
31 efl_canvas_object_legacy_ctor(efl_added)); 32 efl_canvas_object_legacy_ctor(efl_added));
32} 33}
@@ -34,8 +35,9 @@ evas_object_image_add(Evas *eo_e)
34EAPI Evas_Object * 35EAPI Evas_Object *
35evas_object_image_filled_add(Evas *eo_e) 36evas_object_image_filled_add(Evas *eo_e)
36{ 37{
38 eo_e = evas_find(eo_e);
37 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(eo_e, EVAS_CANVAS_CLASS), NULL); 39 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(eo_e, EVAS_CANVAS_CLASS), NULL);
38 return efl_add(EVAS_IMAGE_CLASS, evas_find(eo_e), 40 return efl_add(EVAS_IMAGE_CLASS, eo_e,
39 efl_canvas_object_legacy_ctor(efl_added)); 41 efl_canvas_object_legacy_ctor(efl_added));
40} 42}
41 43
diff --git a/src/lib/evas/canvas/evas_object_box.c b/src/lib/evas/canvas/evas_object_box.c
index 391f849468..fb8177639f 100644
--- a/src/lib/evas/canvas/evas_object_box.c
+++ b/src/lib/evas/canvas/evas_object_box.c
@@ -475,8 +475,9 @@ _evas_box_efl_canvas_group_group_calculate(Eo *o, Evas_Object_Box_Data *priv)
475EAPI Evas_Object * 475EAPI Evas_Object *
476evas_object_box_add(Evas *evas) 476evas_object_box_add(Evas *evas)
477{ 477{
478 evas = evas_find(evas);
478 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(evas, EVAS_CANVAS_CLASS), NULL); 479 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(evas, EVAS_CANVAS_CLASS), NULL);
479 return efl_add(MY_CLASS, evas_find(evas), efl_canvas_object_legacy_ctor(efl_added)); 480 return efl_add(MY_CLASS, evas, efl_canvas_object_legacy_ctor(efl_added));
480} 481}
481 482
482EOLIAN static Eo * 483EOLIAN static Eo *
diff --git a/src/lib/evas/canvas/evas_object_grid.c b/src/lib/evas/canvas/evas_object_grid.c
index 2ff261961c..75c50b9546 100644
--- a/src/lib/evas/canvas/evas_object_grid.c
+++ b/src/lib/evas/canvas/evas_object_grid.c
@@ -273,8 +273,9 @@ _evas_object_grid_smart_set_user(Evas_Smart_Class *sc)
273EAPI Evas_Object * 273EAPI Evas_Object *
274evas_object_grid_add(Evas *evas) 274evas_object_grid_add(Evas *evas)
275{ 275{
276 evas = evas_find(evas);
276 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(evas, EVAS_CANVAS_CLASS), NULL); 277 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(evas, EVAS_CANVAS_CLASS), NULL);
277 return efl_add(MY_CLASS, evas_find(evas), efl_canvas_object_legacy_ctor(efl_added)); 278 return efl_add(MY_CLASS, evas, efl_canvas_object_legacy_ctor(efl_added));
278} 279}
279 280
280EOLIAN static Eo * 281EOLIAN static Eo *
diff --git a/src/lib/evas/canvas/evas_object_line.c b/src/lib/evas/canvas/evas_object_line.c
index f506f758cb..ef6cf14730 100644
--- a/src/lib/evas/canvas/evas_object_line.c
+++ b/src/lib/evas/canvas/evas_object_line.c
@@ -94,8 +94,9 @@ static const Evas_Object_Func object_func =
94EAPI Evas_Object * 94EAPI Evas_Object *
95evas_object_line_add(Evas *e) 95evas_object_line_add(Evas *e)
96{ 96{
97 e = evas_find(e);
97 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(e, EVAS_CANVAS_CLASS), NULL); 98 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(e, EVAS_CANVAS_CLASS), NULL);
98 return efl_add(EVAS_LINE_CLASS, evas_find(e), efl_canvas_object_legacy_ctor(efl_added)); 99 return efl_add(EVAS_LINE_CLASS, e, efl_canvas_object_legacy_ctor(efl_added));
99} 100}
100 101
101EOLIAN static void 102EOLIAN static void
diff --git a/src/lib/evas/canvas/evas_object_polygon.c b/src/lib/evas/canvas/evas_object_polygon.c
index 8f65277be7..c19824f567 100644
--- a/src/lib/evas/canvas/evas_object_polygon.c
+++ b/src/lib/evas/canvas/evas_object_polygon.c
@@ -84,8 +84,9 @@ static const Evas_Object_Func object_func =
84EAPI Evas_Object * 84EAPI Evas_Object *
85evas_object_polygon_add(Evas *e) 85evas_object_polygon_add(Evas *e)
86{ 86{
87 e = evas_find(e);
87 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(e, EVAS_CANVAS_CLASS), NULL); 88 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(e, EVAS_CANVAS_CLASS), NULL);
88 return efl_add(MY_CLASS, evas_find(e), efl_canvas_object_legacy_ctor(efl_added)); 89 return efl_add(MY_CLASS, e, efl_canvas_object_legacy_ctor(efl_added));
89} 90}
90 91
91EOLIAN static Eo * 92EOLIAN static Eo *
diff --git a/src/lib/evas/canvas/evas_object_rectangle.c b/src/lib/evas/canvas/evas_object_rectangle.c
index 3045e7a220..ee9177bbb7 100644
--- a/src/lib/evas/canvas/evas_object_rectangle.c
+++ b/src/lib/evas/canvas/evas_object_rectangle.c
@@ -83,8 +83,9 @@ static const Evas_Object_Func object_func =
83EAPI Evas_Object * 83EAPI Evas_Object *
84evas_object_rectangle_add(Evas *e) 84evas_object_rectangle_add(Evas *e)
85{ 85{
86 e = evas_find(e);
86 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(e, EVAS_CANVAS_CLASS), NULL); 87 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(e, EVAS_CANVAS_CLASS), NULL);
87 return efl_add(EFL_CANVAS_RECTANGLE_CLASS, evas_find(e), efl_canvas_object_legacy_ctor(efl_added)); 88 return efl_add(EFL_CANVAS_RECTANGLE_CLASS, e, efl_canvas_object_legacy_ctor(efl_added));
88} 89}
89 90
90EOLIAN static Eo * 91EOLIAN static Eo *
diff --git a/src/lib/evas/canvas/evas_object_smart.c b/src/lib/evas/canvas/evas_object_smart.c
index 7feea17d38..6b56028e95 100644
--- a/src/lib/evas/canvas/evas_object_smart.c
+++ b/src/lib/evas/canvas/evas_object_smart.c
@@ -675,8 +675,9 @@ evas_object_smart_add(Evas *eo_e, Evas_Smart *s)
675{ 675{
676 Evas_Object *eo_obj; 676 Evas_Object *eo_obj;
677 677
678 eo_e = evas_find(eo_e);
678 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(eo_e, EVAS_CANVAS_CLASS), NULL); 679 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(eo_e, EVAS_CANVAS_CLASS), NULL);
679 eo_obj = efl_add(EFL_CANVAS_GROUP_CLASS, evas_find(eo_e), efl_canvas_object_legacy_ctor(efl_added)); 680 eo_obj = efl_add(EFL_CANVAS_GROUP_CLASS, eo_e, efl_canvas_object_legacy_ctor(efl_added));
680 evas_object_smart_attach(eo_obj, s); 681 evas_object_smart_attach(eo_obj, s);
681 return eo_obj; 682 return eo_obj;
682} 683}
diff --git a/src/lib/evas/canvas/evas_object_table.c b/src/lib/evas/canvas/evas_object_table.c
index 3b8837f6cc..bd694d9611 100644
--- a/src/lib/evas/canvas/evas_object_table.c
+++ b/src/lib/evas/canvas/evas_object_table.c
@@ -979,8 +979,9 @@ _evas_table_efl_canvas_group_group_calculate(Eo *o, Evas_Table_Data *priv)
979EAPI Evas_Object * 979EAPI Evas_Object *
980evas_object_table_add(Evas *evas) 980evas_object_table_add(Evas *evas)
981{ 981{
982 evas = evas_find(evas);
982 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(evas, EVAS_CANVAS_CLASS), NULL); 983 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(evas, EVAS_CANVAS_CLASS), NULL);
983 return efl_add(MY_CLASS, evas_find(evas), efl_canvas_object_legacy_ctor(efl_added)); 984 return efl_add(MY_CLASS, evas, efl_canvas_object_legacy_ctor(efl_added));
984} 985}
985 986
986EOLIAN static Eo * 987EOLIAN static Eo *
diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c
index 5aae419759..fe675c3836 100644
--- a/src/lib/evas/canvas/evas_object_text.c
+++ b/src/lib/evas/canvas/evas_object_text.c
@@ -376,8 +376,9 @@ _evas_object_text_vert_advance_get(const Evas_Object *obj EINA_UNUSED,
376EAPI Evas_Object * 376EAPI Evas_Object *
377evas_object_text_add(Evas *e) 377evas_object_text_add(Evas *e)
378{ 378{
379 e = evas_find(e);
379 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(e, EVAS_CANVAS_CLASS), NULL); 380 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(e, EVAS_CANVAS_CLASS), NULL);
380 return efl_add(EVAS_TEXT_CLASS, evas_find(e), efl_canvas_object_legacy_ctor(efl_added)); 381 return efl_add(EVAS_TEXT_CLASS, e, efl_canvas_object_legacy_ctor(efl_added));
381} 382}
382 383
383EOLIAN static Eo * 384EOLIAN static Eo *
diff --git a/src/lib/evas/canvas/evas_object_textgrid.c b/src/lib/evas/canvas/evas_object_textgrid.c
index 8c5cd63fa1..15a8dff5b3 100644
--- a/src/lib/evas/canvas/evas_object_textgrid.c
+++ b/src/lib/evas/canvas/evas_object_textgrid.c
@@ -899,8 +899,9 @@ _evas_textgrid_efl_gfx_entity_scale_set(Evas_Object *eo_obj, Evas_Textgrid_Data
899EAPI Evas_Object * 899EAPI Evas_Object *
900evas_object_textgrid_add(Evas *e) 900evas_object_textgrid_add(Evas *e)
901{ 901{
902 e = evas_find(e);
902 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(e, EVAS_CANVAS_CLASS), NULL); 903 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(e, EVAS_CANVAS_CLASS), NULL);
903 return efl_add(EVAS_TEXTGRID_CLASS, evas_find(e), efl_canvas_object_legacy_ctor(efl_added)); 904 return efl_add(EVAS_TEXTGRID_CLASS, e, efl_canvas_object_legacy_ctor(efl_added));
904} 905}
905 906
906EOLIAN static Eo * 907EOLIAN static Eo *