From ccbc27f24da1f6fd1494f478f36359aaf1502dc2 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Wed, 27 Feb 2019 17:46:16 +0100 Subject: [PATCH] efl_ui_widget: remove widget_parent overwritting before the widget_parent have been only set once. The call to the set was in the constructor and carried the efl_parent. In the next commit widget_parent is getting a refactor, which gives it more meaning, where it is actaully called, which means, the behaviour will change. In order to not break every existing usage of the here changed widgets, we move the code to the constructor, and feed it with the efl_parent, just like before. Differential Revision: https://phab.enlightenment.org/D8041 --- src/lib/elementary/elc_ctxpopup.c | 10 +-- src/lib/elementary/elc_hoversel.c | 7 +- src/lib/elementary/elc_popup.c | 6 +- src/lib/elementary/elm_conform.c | 25 +++--- src/lib/elementary/elm_conformant_eo.c | 4 - src/lib/elementary/elm_ctxpopup_eo.c | 4 - src/lib/elementary/elm_hover.c | 57 +++++++------- src/lib/elementary/elm_hover_eo.c | 8 -- src/lib/elementary/elm_hoversel_eo.c | 4 - src/lib/elementary/elm_inwin.c | 10 +-- src/lib/elementary/elm_inwin_eo.c | 4 - src/lib/elementary/elm_menu.c | 105 ++++++++++++------------- src/lib/elementary/elm_menu_eo.c | 8 -- src/lib/elementary/elm_notify.c | 48 ++++++----- src/lib/elementary/elm_notify_eo.c | 8 -- src/lib/elementary/elm_popup_eo.c | 4 - 16 files changed, 122 insertions(+), 190 deletions(-) diff --git a/src/lib/elementary/elc_ctxpopup.c b/src/lib/elementary/elc_ctxpopup.c index 926c80e563..ac5a91905a 100644 --- a/src/lib/elementary/elc_ctxpopup.c +++ b/src/lib/elementary/elc_ctxpopup.c @@ -1101,13 +1101,6 @@ _elm_ctxpopup_efl_canvas_group_group_del(Eo *obj, Elm_Ctxpopup_Data *sd) efl_canvas_group_del(efl_super(obj, MY_CLASS)); } -EOLIAN static void -_elm_ctxpopup_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Ctxpopup_Data *_pd EINA_UNUSED, Evas_Object *parent) -{ - //default parent is to be hover parent - elm_ctxpopup_hover_parent_set(obj, parent); -} - EAPI Evas_Object * elm_ctxpopup_add(Evas_Object *parent) { @@ -1129,7 +1122,8 @@ _elm_ctxpopup_efl_object_constructor(Eo *obj, Elm_Ctxpopup_Data *_pd EINA_UNUSED efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); efl_access_object_role_set(obj, EFL_ACCESS_ROLE_POPUP_MENU); - + //default parent is to be hover parent + elm_ctxpopup_hover_parent_set(obj, efl_parent_get(obj)); return obj; } diff --git a/src/lib/elementary/elc_hoversel.c b/src/lib/elementary/elc_hoversel.c index b67d211503..0e45d16a85 100644 --- a/src/lib/elementary/elc_hoversel.c +++ b/src/lib/elementary/elc_hoversel.c @@ -682,12 +682,6 @@ _elm_hoversel_efl_gfx_entity_visible_set(Eo *obj, Elm_Hoversel_Data *sd, Eina_Bo efl_gfx_entity_visible_set(sd->hover, vis); } -EOLIAN static void -_elm_hoversel_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Hoversel_Data *_pd EINA_UNUSED, Evas_Object *parent) -{ - elm_hoversel_hover_parent_set(obj, parent); -} - EOLIAN static Eina_Bool _elm_hoversel_efl_ui_autorepeat_autorepeat_supported_get(const Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd EINA_UNUSED) { @@ -709,6 +703,7 @@ _elm_hoversel_efl_object_constructor(Eo *obj, Elm_Hoversel_Data *_pd EINA_UNUSED evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); efl_access_object_role_set(obj, EFL_ACCESS_ROLE_PUSH_BUTTON); legacy_object_focus_handle(obj); + elm_hoversel_hover_parent_set(obj, efl_parent_get(obj)); return obj; } diff --git a/src/lib/elementary/elc_popup.c b/src/lib/elementary/elc_popup.c index 7c011b740a..a967661e61 100644 --- a/src/lib/elementary/elc_popup.c +++ b/src/lib/elementary/elc_popup.c @@ -1496,10 +1496,11 @@ _parent_geom_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_i evas_object_resize(popup, w, h); } -EOLIAN static void -_elm_popup_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Popup_Data *sd, Evas_Object *parent) +static void +_parent_setup(Eo *obj, Elm_Popup_Data *sd, Evas_Object *parent) { Evas_Coord x, y, w, h; + evas_object_geometry_get(parent, &x, &y, &w, &h); if (efl_isa(parent, EFL_UI_WIN_CLASS)) @@ -1541,6 +1542,7 @@ _elm_popup_efl_object_constructor(Eo *obj, Elm_Popup_Data *_pd EINA_UNUSED) evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); efl_access_object_role_set(obj, EFL_ACCESS_ROLE_DIALOG); legacy_object_focus_handle(obj); + _parent_setup(obj, _pd, efl_parent_get(obj)); return obj; } diff --git a/src/lib/elementary/elm_conform.c b/src/lib/elementary/elm_conform.c index a3c87cd5fa..3f3549f1dc 100644 --- a/src/lib/elementary/elm_conform.c +++ b/src/lib/elementary/elm_conform.c @@ -965,9 +965,19 @@ _elm_conformant_efl_canvas_group_group_del(Eo *obj, Elm_Conformant_Data *sd) efl_canvas_group_del(efl_super(obj, MY_CLASS)); } -EOLIAN static void -_elm_conformant_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Conformant_Data *sd, Evas_Object *parent) +EAPI Evas_Object * +elm_conformant_add(Evas_Object *parent) { + EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); + return elm_legacy_add(MY_CLASS, parent); +} + +EOLIAN static Eo * +_elm_conformant_efl_object_constructor(Eo *obj, Elm_Conformant_Data *sd) +{ + Eo *parent; + obj = efl_constructor(efl_super(obj, MY_CLASS)); + parent = efl_parent_get(obj); #ifdef HAVE_ELEMENTARY_X Evas_Object *top = elm_widget_top_get(parent); Ecore_X_Window xwin = elm_win_xwindow_get(parent); @@ -986,18 +996,7 @@ _elm_conformant_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Conformant_Data *sd (void)sd; (void)parent; #endif -} -EAPI Evas_Object * -elm_conformant_add(Evas_Object *parent) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - return elm_legacy_add(MY_CLASS, parent); -} - -EOLIAN static Eo * -_elm_conformant_efl_object_constructor(Eo *obj, Elm_Conformant_Data *sd) -{ obj = efl_constructor(efl_super(obj, MY_CLASS)); efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); diff --git a/src/lib/elementary/elm_conformant_eo.c b/src/lib/elementary/elm_conformant_eo.c index 188cc208ac..379426c52f 100644 --- a/src/lib/elementary/elm_conformant_eo.c +++ b/src/lib/elementary/elm_conformant_eo.c @@ -10,9 +10,6 @@ EWAPI const Efl_Event_Description _ELM_CONFORMANT_EVENT_CLIPBOARD_STATE_OFF = Efl_Object *_elm_conformant_efl_object_constructor(Eo *obj, Elm_Conformant_Data *pd); -void _elm_conformant_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Conformant_Data *pd, Efl_Ui_Widget *parent); - - Eina_Error _elm_conformant_efl_ui_widget_theme_apply(Eo *obj, Elm_Conformant_Data *pd); @@ -29,7 +26,6 @@ _elm_conformant_class_initializer(Efl_Class *klass) EFL_OPS_DEFINE(ops, EFL_OBJECT_OP_FUNC(efl_constructor, _elm_conformant_efl_object_constructor), - EFL_OBJECT_OP_FUNC(efl_ui_widget_parent_set, _elm_conformant_efl_ui_widget_widget_parent_set), EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_conformant_efl_ui_widget_theme_apply), ELM_CONFORMANT_EXTRA_OPS ); diff --git a/src/lib/elementary/elm_ctxpopup_eo.c b/src/lib/elementary/elm_ctxpopup_eo.c index 890d96015d..ebd83c53fb 100644 --- a/src/lib/elementary/elm_ctxpopup_eo.c +++ b/src/lib/elementary/elm_ctxpopup_eo.c @@ -130,9 +130,6 @@ EOAPI EFL_FUNC_BODYV(elm_obj_ctxpopup_item_prepend, Elm_Widget_Item *, NULL, EFL Efl_Object *_elm_ctxpopup_efl_object_constructor(Eo *obj, Elm_Ctxpopup_Data *pd); -void _elm_ctxpopup_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Ctxpopup_Data *pd, Efl_Ui_Widget *parent); - - Eina_Bool _elm_ctxpopup_efl_ui_widget_widget_sub_object_add(Eo *obj, Elm_Ctxpopup_Data *pd, Efl_Canvas_Object *sub_obj); @@ -189,7 +186,6 @@ _elm_ctxpopup_class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_item_append, _elm_ctxpopup_item_append), EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_item_prepend, _elm_ctxpopup_item_prepend), EFL_OBJECT_OP_FUNC(efl_constructor, _elm_ctxpopup_efl_object_constructor), - EFL_OBJECT_OP_FUNC(efl_ui_widget_parent_set, _elm_ctxpopup_efl_ui_widget_widget_parent_set), EFL_OBJECT_OP_FUNC(efl_ui_widget_sub_object_add, _elm_ctxpopup_efl_ui_widget_widget_sub_object_add), EFL_OBJECT_OP_FUNC(efl_ui_l10n_translation_update, _elm_ctxpopup_efl_ui_l10n_translation_update), EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_ctxpopup_efl_ui_widget_theme_apply), diff --git a/src/lib/elementary/elm_hover.c b/src/lib/elementary/elm_hover.c index e831ca5f8b..e5019fed78 100644 --- a/src/lib/elementary/elm_hover.c +++ b/src/lib/elementary/elm_hover.c @@ -689,6 +689,29 @@ elm_hover_add(Evas_Object *parent) return elm_legacy_add(MY_CLASS, parent); } +static void +_parent_setup(Eo *obj, Elm_Hover_Data *sd, Evas_Object *parent) +{ + _elm_hover_parent_detach(obj); + + sd->parent = parent; + if (sd->parent) + { + evas_object_event_callback_add + (sd->parent, EVAS_CALLBACK_MOVE, _parent_move_cb, obj); + evas_object_event_callback_add + (sd->parent, EVAS_CALLBACK_RESIZE, _parent_resize_cb, obj); + evas_object_event_callback_add + (sd->parent, EVAS_CALLBACK_SHOW, _parent_show_cb, obj); + evas_object_event_callback_add + (sd->parent, EVAS_CALLBACK_HIDE, _parent_hide_cb, obj); + evas_object_event_callback_add + (sd->parent, EVAS_CALLBACK_DEL, _parent_del_cb, obj); + } + + elm_layout_sizing_eval(obj); +} + EOLIAN static Eo * _elm_hover_efl_object_constructor(Eo *obj, Elm_Hover_Data *pd EINA_UNUSED) { @@ -697,6 +720,7 @@ _elm_hover_efl_object_constructor(Eo *obj, Elm_Hover_Data *pd EINA_UNUSED) evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); efl_access_object_role_set(obj, EFL_ACCESS_ROLE_POPUP_MENU); legacy_child_focus_handle(obj); + _parent_setup(obj, pd, efl_parent_get(obj)); return obj; } @@ -735,30 +759,9 @@ elm_hover_parent_set(Evas_Object *obj, Evas_Object *parent) { ELM_HOVER_CHECK(obj); - efl_ui_widget_parent_set(obj, parent); -} - -EOLIAN static void -_elm_hover_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Hover_Data *sd, Evas_Object *parent) -{ - _elm_hover_parent_detach(obj); - - sd->parent = parent; - if (sd->parent) - { - evas_object_event_callback_add - (sd->parent, EVAS_CALLBACK_MOVE, _parent_move_cb, obj); - evas_object_event_callback_add - (sd->parent, EVAS_CALLBACK_RESIZE, _parent_resize_cb, obj); - evas_object_event_callback_add - (sd->parent, EVAS_CALLBACK_SHOW, _parent_show_cb, obj); - evas_object_event_callback_add - (sd->parent, EVAS_CALLBACK_HIDE, _parent_hide_cb, obj); - evas_object_event_callback_add - (sd->parent, EVAS_CALLBACK_DEL, _parent_del_cb, obj); - } - - elm_layout_sizing_eval(obj); + ELM_HOVER_DATA_GET(obj, sd); + efl_ui_widget_sub_object_add(parent, obj); + _parent_setup(obj, sd, parent); } EOLIAN static Evas_Object* @@ -774,12 +777,6 @@ elm_hover_parent_get(const Evas_Object *obj) return efl_ui_widget_parent_get((Eo *) obj); } -EOLIAN static Evas_Object* -_elm_hover_efl_ui_widget_widget_parent_get(const Eo *obj EINA_UNUSED, Elm_Hover_Data *sd) -{ - return sd->parent; -} - EOLIAN static const char* _elm_hover_best_content_location_get(const Eo *obj EINA_UNUSED, Elm_Hover_Data *sd, Elm_Hover_Axis pref_axis) { diff --git a/src/lib/elementary/elm_hover_eo.c b/src/lib/elementary/elm_hover_eo.c index 41abfd3865..5ca798a132 100644 --- a/src/lib/elementary/elm_hover_eo.c +++ b/src/lib/elementary/elm_hover_eo.c @@ -37,12 +37,6 @@ Eina_Error _elm_hover_efl_ui_widget_theme_apply(Eo *obj, Elm_Hover_Data *pd); Eina_Bool _elm_hover_efl_ui_widget_widget_sub_object_add(Eo *obj, Elm_Hover_Data *pd, Efl_Canvas_Object *sub_obj); -void _elm_hover_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Hover_Data *pd, Efl_Ui_Widget *parent); - - -Efl_Ui_Widget *_elm_hover_efl_ui_widget_widget_parent_get(const Eo *obj, Elm_Hover_Data *pd); - - Eina_Bool _elm_hover_efl_ui_widget_widget_sub_object_del(Eo *obj, Elm_Hover_Data *pd, Efl_Canvas_Object *sub_obj); @@ -77,8 +71,6 @@ _elm_hover_class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(efl_gfx_entity_size_set, _elm_hover_efl_gfx_entity_size_set), EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_hover_efl_ui_widget_theme_apply), EFL_OBJECT_OP_FUNC(efl_ui_widget_sub_object_add, _elm_hover_efl_ui_widget_widget_sub_object_add), - EFL_OBJECT_OP_FUNC(efl_ui_widget_parent_set, _elm_hover_efl_ui_widget_widget_parent_set), - EFL_OBJECT_OP_FUNC(efl_ui_widget_parent_get, _elm_hover_efl_ui_widget_widget_parent_get), EFL_OBJECT_OP_FUNC(efl_ui_widget_sub_object_del, _elm_hover_efl_ui_widget_widget_sub_object_del), EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_hover_efl_access_widget_action_elm_actions_get), EFL_OBJECT_OP_FUNC(efl_access_object_state_set_get, _elm_hover_efl_access_object_state_set_get), diff --git a/src/lib/elementary/elm_hoversel_eo.c b/src/lib/elementary/elm_hoversel_eo.c index 5d578710fc..a9a04effc4 100644 --- a/src/lib/elementary/elm_hoversel_eo.c +++ b/src/lib/elementary/elm_hoversel_eo.c @@ -112,9 +112,6 @@ void _elm_hoversel_efl_object_destructor(Eo *obj, Elm_Hoversel_Data *pd); void _elm_hoversel_efl_gfx_entity_visible_set(Eo *obj, Elm_Hoversel_Data *pd, Eina_Bool v); -void _elm_hoversel_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Hoversel_Data *pd, Efl_Ui_Widget *parent); - - Eina_Error _elm_hoversel_efl_ui_widget_theme_apply(Eo *obj, Elm_Hoversel_Data *pd); @@ -160,7 +157,6 @@ _elm_hoversel_class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(efl_constructor, _elm_hoversel_efl_object_constructor), EFL_OBJECT_OP_FUNC(efl_destructor, _elm_hoversel_efl_object_destructor), EFL_OBJECT_OP_FUNC(efl_gfx_entity_visible_set, _elm_hoversel_efl_gfx_entity_visible_set), - EFL_OBJECT_OP_FUNC(efl_ui_widget_parent_set, _elm_hoversel_efl_ui_widget_widget_parent_set), EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_hoversel_efl_ui_widget_theme_apply), EFL_OBJECT_OP_FUNC(efl_ui_l10n_translation_update, _elm_hoversel_efl_ui_l10n_translation_update), EFL_OBJECT_OP_FUNC(efl_ui_widget_input_event_handler, _elm_hoversel_efl_ui_widget_widget_input_event_handler), diff --git a/src/lib/elementary/elm_inwin.c b/src/lib/elementary/elm_inwin.c index bb6db93217..54d2c4d775 100644 --- a/src/lib/elementary/elm_inwin.c +++ b/src/lib/elementary/elm_inwin.c @@ -57,14 +57,6 @@ _elm_inwin_efl_canvas_group_group_add(Eo *obj, Elm_Inwin_Data *pd EINA_UNUSED) CRI("Failed to set layout!"); } -EOLIAN static void -_elm_inwin_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Inwin_Data *pd EINA_UNUSED, Evas_Object *parent) -{ - elm_win_resize_object_add(parent, obj); - - elm_layout_sizing_eval(obj); -} - EAPI Evas_Object * elm_win_inwin_add(Evas_Object *parent) { @@ -86,6 +78,8 @@ _elm_inwin_efl_object_constructor(Eo *obj, Elm_Inwin_Data *pd EINA_UNUSED) } obj = efl_constructor(efl_super(obj, MY_CLASS)); + elm_win_resize_object_add(efl_parent_get(obj), obj); + elm_layout_sizing_eval(obj); efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); efl_access_object_role_set(obj, EFL_ACCESS_ROLE_GLASS_PANE); diff --git a/src/lib/elementary/elm_inwin_eo.c b/src/lib/elementary/elm_inwin_eo.c index 0cd70e6640..887f9ee453 100644 --- a/src/lib/elementary/elm_inwin_eo.c +++ b/src/lib/elementary/elm_inwin_eo.c @@ -6,9 +6,6 @@ EOAPI EFL_VOID_FUNC_BODY(elm_obj_win_inwin_activate); Efl_Object *_elm_inwin_efl_object_constructor(Eo *obj, Elm_Inwin_Data *pd); -void _elm_inwin_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Inwin_Data *pd, Efl_Ui_Widget *parent); - - Eina_Bool _elm_inwin_efl_content_content_set(Eo *obj, Elm_Inwin_Data *pd, Efl_Gfx_Entity *content); @@ -32,7 +29,6 @@ _elm_inwin_class_initializer(Efl_Class *klass) EFL_OPS_DEFINE(ops, EFL_OBJECT_OP_FUNC(elm_obj_win_inwin_activate, _elm_inwin_activate), EFL_OBJECT_OP_FUNC(efl_constructor, _elm_inwin_efl_object_constructor), - EFL_OBJECT_OP_FUNC(efl_ui_widget_parent_set, _elm_inwin_efl_ui_widget_widget_parent_set), EFL_OBJECT_OP_FUNC(efl_content_set, _elm_inwin_efl_content_content_set), EFL_OBJECT_OP_FUNC(efl_content_get, _elm_inwin_efl_content_content_get), EFL_OBJECT_OP_FUNC(efl_content_unset, _elm_inwin_efl_content_content_unset), diff --git a/src/lib/elementary/elm_menu.c b/src/lib/elementary/elm_menu.c index 767d3d68f0..df38939c1c 100644 --- a/src/lib/elementary/elm_menu.c +++ b/src/lib/elementary/elm_menu.c @@ -815,54 +815,8 @@ _elm_menu_efl_ui_widget_focus_manager_focus_manager_create(Eo *obj EINA_UNUSED, return manager; } -EOLIAN static Eo * -_elm_menu_efl_object_constructor(Eo *obj, Elm_Menu_Data *sd) -{ - Eo *parent = NULL; - - obj = efl_constructor(efl_super(obj, MY_CLASS)); - efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); - evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); - parent = efl_parent_get(obj); - efl_access_object_role_set(obj, EFL_ACCESS_ROLE_MENU); - - elm_menu_parent_set(obj, parent); - elm_hover_target_set(sd->hv, sd->location); - elm_layout_content_set - (sd->hv, elm_hover_best_content_location_get - (sd->hv, ELM_HOVER_AXIS_VERTICAL), sd->bx); - - _sizing_eval(obj); - efl_event_callback_add - (obj, ELM_MENU_EVENT_ELM_ACTION_BLOCK_MENU, _block_menu, sd); - efl_event_callback_add - (obj, ELM_MENU_EVENT_ELM_ACTION_UNBLOCK_MENU, _unblock_menu, sd); - - sd->obj = obj; - return obj; -} - -EOLIAN static void -_elm_menu_efl_object_destructor(Eo *obj, Elm_Menu_Data *sd) -{ - Eina_List *itr, *itr2; - Elm_Object_Item *eo_item; - EINA_LIST_FOREACH_SAFE(sd->items, itr, itr2, eo_item) - efl_del(eo_item); - - efl_destructor(efl_super(obj, MY_CLASS)); -} - -EAPI void -elm_menu_parent_set(Evas_Object *obj, - Evas_Object *parent) -{ - ELM_MENU_CHECK(obj); - efl_ui_widget_parent_set(obj, parent); -} - -EOLIAN static void -_elm_menu_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Menu_Data *sd, Evas_Object *parent) +static void +_parent_setup(Eo *obj, Elm_Menu_Data *sd, Evas_Object *parent) { Eina_List *l, *_l, *_ll, *ll = NULL; Elm_Object_Item *eo_item; @@ -904,6 +858,55 @@ _elm_menu_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Menu_Data *sd, Evas_Objec _sizing_eval(obj); } +EOLIAN static Eo * +_elm_menu_efl_object_constructor(Eo *obj, Elm_Menu_Data *sd) +{ + Eo *parent = NULL; + + obj = efl_constructor(efl_super(obj, MY_CLASS)); + _parent_setup(obj, sd, efl_parent_get(obj)); + efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); + evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); + parent = efl_parent_get(obj); + efl_access_object_role_set(obj, EFL_ACCESS_ROLE_MENU); + + elm_menu_parent_set(obj, parent); + elm_hover_target_set(sd->hv, sd->location); + elm_layout_content_set + (sd->hv, elm_hover_best_content_location_get + (sd->hv, ELM_HOVER_AXIS_VERTICAL), sd->bx); + + _sizing_eval(obj); + efl_event_callback_add + (obj, ELM_MENU_EVENT_ELM_ACTION_BLOCK_MENU, _block_menu, sd); + efl_event_callback_add + (obj, ELM_MENU_EVENT_ELM_ACTION_UNBLOCK_MENU, _unblock_menu, sd); + + sd->obj = obj; + return obj; +} + +EOLIAN static void +_elm_menu_efl_object_destructor(Eo *obj, Elm_Menu_Data *sd) +{ + Eina_List *itr, *itr2; + Elm_Object_Item *eo_item; + EINA_LIST_FOREACH_SAFE(sd->items, itr, itr2, eo_item) + efl_del(eo_item); + + efl_destructor(efl_super(obj, MY_CLASS)); +} + +EAPI void +elm_menu_parent_set(Evas_Object *obj, + Evas_Object *parent) +{ + ELM_MENU_CHECK(obj); + ELM_MENU_DATA_GET(obj, sd); + efl_ui_widget_sub_object_add(parent, obj); + _parent_setup(obj, sd, parent); +} + EAPI Evas_Object * elm_menu_parent_get(const Evas_Object *obj) { @@ -911,12 +914,6 @@ elm_menu_parent_get(const Evas_Object *obj) return efl_ui_widget_parent_get(obj); } -EOLIAN static Evas_Object* -_elm_menu_efl_ui_widget_widget_parent_get(const Eo *obj EINA_UNUSED, Elm_Menu_Data *sd) -{ - return sd->parent; -} - EOLIAN static void _elm_menu_relative_move(Eo *obj, Elm_Menu_Data *sd, Evas_Coord x, Evas_Coord y) { diff --git a/src/lib/elementary/elm_menu_eo.c b/src/lib/elementary/elm_menu_eo.c index e0440405b8..1bc7f988da 100644 --- a/src/lib/elementary/elm_menu_eo.c +++ b/src/lib/elementary/elm_menu_eo.c @@ -50,12 +50,6 @@ void _elm_menu_efl_object_destructor(Eo *obj, Elm_Menu_Data *pd); void _elm_menu_efl_gfx_entity_visible_set(Eo *obj, Elm_Menu_Data *pd, Eina_Bool v); -void _elm_menu_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Menu_Data *pd, Efl_Ui_Widget *parent); - - -Efl_Ui_Widget *_elm_menu_efl_ui_widget_widget_parent_get(const Eo *obj, Elm_Menu_Data *pd); - - Eina_Error _elm_menu_efl_ui_widget_theme_apply(Eo *obj, Elm_Menu_Data *pd); @@ -101,8 +95,6 @@ _elm_menu_class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(efl_constructor, _elm_menu_efl_object_constructor), EFL_OBJECT_OP_FUNC(efl_destructor, _elm_menu_efl_object_destructor), EFL_OBJECT_OP_FUNC(efl_gfx_entity_visible_set, _elm_menu_efl_gfx_entity_visible_set), - EFL_OBJECT_OP_FUNC(efl_ui_widget_parent_set, _elm_menu_efl_ui_widget_widget_parent_set), - EFL_OBJECT_OP_FUNC(efl_ui_widget_parent_get, _elm_menu_efl_ui_widget_widget_parent_get), EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_menu_efl_ui_widget_theme_apply), EFL_OBJECT_OP_FUNC(efl_ui_l10n_translation_update, _elm_menu_efl_ui_l10n_translation_update), EFL_OBJECT_OP_FUNC(efl_ui_widget_focus_manager_create, _elm_menu_efl_ui_widget_focus_manager_focus_manager_create), diff --git a/src/lib/elementary/elm_notify.c b/src/lib/elementary/elm_notify.c index f5e9122668..8a98c32f9b 100644 --- a/src/lib/elementary/elm_notify.c +++ b/src/lib/elementary/elm_notify.c @@ -474,26 +474,9 @@ elm_notify_add(Evas_Object *parent) return elm_legacy_add(MY_CLASS, parent); } -EOLIAN static Eo * -_elm_notify_efl_object_constructor(Eo *obj, Elm_Notify_Data *sd EINA_UNUSED) -{ - obj = efl_constructor(efl_super(obj, MY_CLASS)); - efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); - efl_access_object_role_set(obj, EFL_ACCESS_ROLE_NOTIFICATION); - return obj; -} - -EAPI void -elm_notify_parent_set(Evas_Object *obj, - Evas_Object *parent) -{ - ELM_NOTIFY_CHECK(obj); - efl_ui_widget_parent_set(obj, parent); -} - -EOLIAN static void -_elm_notify_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Notify_Data *sd, Evas_Object *parent) +static void +_parent_setup(Eo *obj, Elm_Notify_Data *sd, Evas_Object *parent) { if (sd->parent) { @@ -530,6 +513,27 @@ _elm_notify_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Notify_Data *sd, Evas_O _calc(obj); } +EOLIAN static Eo * +_elm_notify_efl_object_constructor(Eo *obj, Elm_Notify_Data *sd EINA_UNUSED) +{ + obj = efl_constructor(efl_super(obj, MY_CLASS)); + efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); + efl_access_object_role_set(obj, EFL_ACCESS_ROLE_NOTIFICATION); + _parent_setup(obj, sd, efl_parent_get(obj)); + + return obj; +} + +EAPI void +elm_notify_parent_set(Evas_Object *obj, + Evas_Object *parent) +{ + ELM_NOTIFY_CHECK(obj); + ELM_NOTIFY_DATA_GET(obj, sd); + efl_ui_widget_sub_object_add(parent, obj); + _parent_setup(obj, sd, parent); +} + EAPI Evas_Object * elm_notify_parent_get(const Evas_Object *obj) { @@ -539,12 +543,6 @@ elm_notify_parent_get(const Evas_Object *obj) return ret; } -EOLIAN static Evas_Object* -_elm_notify_efl_ui_widget_widget_parent_get(const Eo *obj EINA_UNUSED, Elm_Notify_Data *sd) -{ - return sd->parent; -} - EINA_DEPRECATED EAPI void elm_notify_orient_set(Evas_Object *obj, Elm_Notify_Orient orient) diff --git a/src/lib/elementary/elm_notify_eo.c b/src/lib/elementary/elm_notify_eo.c index fb64698d46..b38b2a02a5 100644 --- a/src/lib/elementary/elm_notify_eo.c +++ b/src/lib/elementary/elm_notify_eo.c @@ -93,12 +93,6 @@ void _elm_notify_efl_gfx_entity_position_set(Eo *obj, Elm_Notify_Data *pd, Eina_ void _elm_notify_efl_gfx_entity_size_set(Eo *obj, Elm_Notify_Data *pd, Eina_Size2D size); -void _elm_notify_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Notify_Data *pd, Efl_Ui_Widget *parent); - - -Efl_Ui_Widget *_elm_notify_efl_ui_widget_widget_parent_get(const Eo *obj, Elm_Notify_Data *pd); - - Eina_Error _elm_notify_efl_ui_widget_theme_apply(Eo *obj, Elm_Notify_Data *pd); @@ -140,8 +134,6 @@ _elm_notify_class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(efl_gfx_entity_visible_set, _elm_notify_efl_gfx_entity_visible_set), EFL_OBJECT_OP_FUNC(efl_gfx_entity_position_set, _elm_notify_efl_gfx_entity_position_set), EFL_OBJECT_OP_FUNC(efl_gfx_entity_size_set, _elm_notify_efl_gfx_entity_size_set), - EFL_OBJECT_OP_FUNC(efl_ui_widget_parent_set, _elm_notify_efl_ui_widget_widget_parent_set), - EFL_OBJECT_OP_FUNC(efl_ui_widget_parent_get, _elm_notify_efl_ui_widget_widget_parent_get), EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_notify_efl_ui_widget_theme_apply), EFL_OBJECT_OP_FUNC(efl_ui_widget_sub_object_del, _elm_notify_efl_ui_widget_widget_sub_object_del), EFL_OBJECT_OP_FUNC(efl_content_set, _elm_notify_efl_content_content_set), diff --git a/src/lib/elementary/elm_popup_eo.c b/src/lib/elementary/elm_popup_eo.c index 9ae0786357..928638419d 100644 --- a/src/lib/elementary/elm_popup_eo.c +++ b/src/lib/elementary/elm_popup_eo.c @@ -146,9 +146,6 @@ Eina_Error _elm_popup_efl_ui_widget_theme_apply(Eo *obj, Elm_Popup_Data *pd); void _elm_popup_efl_ui_widget_on_access_update(Eo *obj, Elm_Popup_Data *pd, Eina_Bool enable); -void _elm_popup_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Popup_Data *pd, Efl_Ui_Widget *parent); - - void _elm_popup_efl_ui_l10n_translation_update(Eo *obj, Elm_Popup_Data *pd); @@ -202,7 +199,6 @@ _elm_popup_class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(efl_constructor, _elm_popup_efl_object_constructor), EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_popup_efl_ui_widget_theme_apply), EFL_OBJECT_OP_FUNC(efl_ui_widget_on_access_update, _elm_popup_efl_ui_widget_on_access_update), - EFL_OBJECT_OP_FUNC(efl_ui_widget_parent_set, _elm_popup_efl_ui_widget_widget_parent_set), EFL_OBJECT_OP_FUNC(efl_ui_l10n_translation_update, _elm_popup_efl_ui_l10n_translation_update), EFL_OBJECT_OP_FUNC(efl_ui_widget_sub_object_del, _elm_popup_efl_ui_widget_widget_sub_object_del), EFL_OBJECT_OP_FUNC(efl_ui_widget_input_event_handler, _elm_popup_efl_ui_widget_widget_input_event_handler),