forked from enlightenment/efl
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
This commit is contained in:
parent
37f1a46c4a
commit
e19292aa2b
|
@ -291,8 +291,9 @@ _edje_edit_efl_file_mmap_set(Eo *obj, Edje_Edit *eed, const Eina_File *mmap, con
|
|||
EAPI Evas_Object *
|
||||
edje_edit_object_add(Evas *evas)
|
||||
{
|
||||
evas = evas_find(evas);
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(evas, EVAS_CANVAS_CLASS), NULL);
|
||||
return efl_add(MY_CLASS, evas_find(evas), efl_canvas_object_legacy_ctor(efl_added));
|
||||
return efl_add(MY_CLASS, evas, efl_canvas_object_legacy_ctor(efl_added));
|
||||
}
|
||||
|
||||
EOLIAN static Eo *
|
||||
|
|
|
@ -22,8 +22,9 @@ Eina_Inlist *_edje_edjes = NULL;
|
|||
EAPI Evas_Object *
|
||||
edje_object_add(Evas *evas)
|
||||
{
|
||||
evas = evas_find(evas);
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(evas, EVAS_CANVAS_CLASS), NULL);
|
||||
return efl_add(MY_CLASS, evas_find(evas), efl_canvas_object_legacy_ctor(efl_added));
|
||||
return efl_add(MY_CLASS, evas, efl_canvas_object_legacy_ctor(efl_added));
|
||||
}
|
||||
|
||||
EOLIAN static Eo *
|
||||
|
|
|
@ -232,8 +232,9 @@ _clipper_position_size_update(Evas_Object *obj, int x, int y, int w, int h, int
|
|||
EAPI Evas_Object *
|
||||
emotion_object_add(Evas *evas)
|
||||
{
|
||||
evas = evas_find(evas);
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(evas, EVAS_CANVAS_CLASS), NULL);
|
||||
return efl_add(MY_CLASS, evas_find(evas), efl_canvas_object_legacy_ctor(efl_added));
|
||||
return efl_add(MY_CLASS, evas, efl_canvas_object_legacy_ctor(efl_added));
|
||||
}
|
||||
|
||||
EOLIAN static Eo *
|
||||
|
|
|
@ -403,8 +403,9 @@ _efl_canvas_event_grabber_freeze_when_visible_get(const Eo *eo_obj EINA_UNUSED,
|
|||
EAPI Evas_Object *
|
||||
evas_object_event_grabber_add(Evas *eo_e)
|
||||
{
|
||||
eo_e = evas_find(eo_e);
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(eo_e, EVAS_CANVAS_CLASS), NULL);
|
||||
return efl_add(MY_CLASS, evas_find(eo_e), efl_canvas_object_legacy_ctor(efl_added));
|
||||
return efl_add(MY_CLASS, eo_e, efl_canvas_object_legacy_ctor(efl_added));
|
||||
}
|
||||
|
||||
#include "efl_canvas_event_grabber.eo.c"
|
||||
|
|
|
@ -124,9 +124,10 @@ _evas_vg_resize(void *data, const Efl_Event *ev)
|
|||
EAPI Evas_Object *
|
||||
evas_object_vg_add(Evas *e)
|
||||
{
|
||||
e = evas_find(e);
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(e, EVAS_CANVAS_CLASS), NULL);
|
||||
// TODO: Ask backend to return the main Ector_Surface
|
||||
return efl_add(MY_CLASS, evas_find(e), efl_canvas_object_legacy_ctor(efl_added));
|
||||
return efl_add(MY_CLASS, e, efl_canvas_object_legacy_ctor(efl_added));
|
||||
}
|
||||
|
||||
EOLIAN static Efl_VG *
|
||||
|
|
|
@ -25,8 +25,9 @@ struct _Evas_Image_Legacy_Pixels_Entry
|
|||
EAPI Evas_Object *
|
||||
evas_object_image_add(Evas *eo_e)
|
||||
{
|
||||
eo_e = evas_find(eo_e);
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(eo_e, EVAS_CANVAS_CLASS), NULL);
|
||||
return efl_add(EVAS_IMAGE_CLASS, evas_find(eo_e),
|
||||
return efl_add(EVAS_IMAGE_CLASS, eo_e,
|
||||
efl_gfx_fill_auto_set(efl_added, EINA_FALSE),
|
||||
efl_canvas_object_legacy_ctor(efl_added));
|
||||
}
|
||||
|
@ -34,8 +35,9 @@ evas_object_image_add(Evas *eo_e)
|
|||
EAPI Evas_Object *
|
||||
evas_object_image_filled_add(Evas *eo_e)
|
||||
{
|
||||
eo_e = evas_find(eo_e);
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(eo_e, EVAS_CANVAS_CLASS), NULL);
|
||||
return efl_add(EVAS_IMAGE_CLASS, evas_find(eo_e),
|
||||
return efl_add(EVAS_IMAGE_CLASS, eo_e,
|
||||
efl_canvas_object_legacy_ctor(efl_added));
|
||||
}
|
||||
|
||||
|
|
|
@ -475,8 +475,9 @@ _evas_box_efl_canvas_group_group_calculate(Eo *o, Evas_Object_Box_Data *priv)
|
|||
EAPI Evas_Object *
|
||||
evas_object_box_add(Evas *evas)
|
||||
{
|
||||
evas = evas_find(evas);
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(evas, EVAS_CANVAS_CLASS), NULL);
|
||||
return efl_add(MY_CLASS, evas_find(evas), efl_canvas_object_legacy_ctor(efl_added));
|
||||
return efl_add(MY_CLASS, evas, efl_canvas_object_legacy_ctor(efl_added));
|
||||
}
|
||||
|
||||
EOLIAN static Eo *
|
||||
|
|
|
@ -273,8 +273,9 @@ _evas_object_grid_smart_set_user(Evas_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
evas_object_grid_add(Evas *evas)
|
||||
{
|
||||
evas = evas_find(evas);
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(evas, EVAS_CANVAS_CLASS), NULL);
|
||||
return efl_add(MY_CLASS, evas_find(evas), efl_canvas_object_legacy_ctor(efl_added));
|
||||
return efl_add(MY_CLASS, evas, efl_canvas_object_legacy_ctor(efl_added));
|
||||
}
|
||||
|
||||
EOLIAN static Eo *
|
||||
|
|
|
@ -94,8 +94,9 @@ static const Evas_Object_Func object_func =
|
|||
EAPI Evas_Object *
|
||||
evas_object_line_add(Evas *e)
|
||||
{
|
||||
e = evas_find(e);
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(e, EVAS_CANVAS_CLASS), NULL);
|
||||
return efl_add(EVAS_LINE_CLASS, evas_find(e), efl_canvas_object_legacy_ctor(efl_added));
|
||||
return efl_add(EVAS_LINE_CLASS, e, efl_canvas_object_legacy_ctor(efl_added));
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
|
|
|
@ -84,8 +84,9 @@ static const Evas_Object_Func object_func =
|
|||
EAPI Evas_Object *
|
||||
evas_object_polygon_add(Evas *e)
|
||||
{
|
||||
e = evas_find(e);
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(e, EVAS_CANVAS_CLASS), NULL);
|
||||
return efl_add(MY_CLASS, evas_find(e), efl_canvas_object_legacy_ctor(efl_added));
|
||||
return efl_add(MY_CLASS, e, efl_canvas_object_legacy_ctor(efl_added));
|
||||
}
|
||||
|
||||
EOLIAN static Eo *
|
||||
|
|
|
@ -83,8 +83,9 @@ static const Evas_Object_Func object_func =
|
|||
EAPI Evas_Object *
|
||||
evas_object_rectangle_add(Evas *e)
|
||||
{
|
||||
e = evas_find(e);
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(e, EVAS_CANVAS_CLASS), NULL);
|
||||
return efl_add(EFL_CANVAS_RECTANGLE_CLASS, evas_find(e), efl_canvas_object_legacy_ctor(efl_added));
|
||||
return efl_add(EFL_CANVAS_RECTANGLE_CLASS, e, efl_canvas_object_legacy_ctor(efl_added));
|
||||
}
|
||||
|
||||
EOLIAN static Eo *
|
||||
|
|
|
@ -675,8 +675,9 @@ evas_object_smart_add(Evas *eo_e, Evas_Smart *s)
|
|||
{
|
||||
Evas_Object *eo_obj;
|
||||
|
||||
eo_e = evas_find(eo_e);
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(eo_e, EVAS_CANVAS_CLASS), NULL);
|
||||
eo_obj = efl_add(EFL_CANVAS_GROUP_CLASS, evas_find(eo_e), efl_canvas_object_legacy_ctor(efl_added));
|
||||
eo_obj = efl_add(EFL_CANVAS_GROUP_CLASS, eo_e, efl_canvas_object_legacy_ctor(efl_added));
|
||||
evas_object_smart_attach(eo_obj, s);
|
||||
return eo_obj;
|
||||
}
|
||||
|
|
|
@ -979,8 +979,9 @@ _evas_table_efl_canvas_group_group_calculate(Eo *o, Evas_Table_Data *priv)
|
|||
EAPI Evas_Object *
|
||||
evas_object_table_add(Evas *evas)
|
||||
{
|
||||
evas = evas_find(evas);
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(evas, EVAS_CANVAS_CLASS), NULL);
|
||||
return efl_add(MY_CLASS, evas_find(evas), efl_canvas_object_legacy_ctor(efl_added));
|
||||
return efl_add(MY_CLASS, evas, efl_canvas_object_legacy_ctor(efl_added));
|
||||
}
|
||||
|
||||
EOLIAN static Eo *
|
||||
|
|
|
@ -376,8 +376,9 @@ _evas_object_text_vert_advance_get(const Evas_Object *obj EINA_UNUSED,
|
|||
EAPI Evas_Object *
|
||||
evas_object_text_add(Evas *e)
|
||||
{
|
||||
e = evas_find(e);
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(e, EVAS_CANVAS_CLASS), NULL);
|
||||
return efl_add(EVAS_TEXT_CLASS, evas_find(e), efl_canvas_object_legacy_ctor(efl_added));
|
||||
return efl_add(EVAS_TEXT_CLASS, e, efl_canvas_object_legacy_ctor(efl_added));
|
||||
}
|
||||
|
||||
EOLIAN static Eo *
|
||||
|
|
|
@ -899,8 +899,9 @@ _evas_textgrid_efl_gfx_entity_scale_set(Evas_Object *eo_obj, Evas_Textgrid_Data
|
|||
EAPI Evas_Object *
|
||||
evas_object_textgrid_add(Evas *e)
|
||||
{
|
||||
e = evas_find(e);
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(e, EVAS_CANVAS_CLASS), NULL);
|
||||
return efl_add(EVAS_TEXTGRID_CLASS, evas_find(e), efl_canvas_object_legacy_ctor(efl_added));
|
||||
return efl_add(EVAS_TEXTGRID_CLASS, e, efl_canvas_object_legacy_ctor(efl_added));
|
||||
}
|
||||
|
||||
EOLIAN static Eo *
|
||||
|
|
Loading…
Reference in New Issue