From a40eb658890da0ee142c91ff9f900ae797521252 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 Change-Id: Id39fb73831c45d33b6c419316e806fafec9cbfaf --- 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 | 45 ++++++++-------- 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 | 97 ++++++++++++++++------------------ 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, 128 insertions(+), 196 deletions(-) diff --git a/src/lib/elementary/elc_ctxpopup.c b/src/lib/elementary/elc_ctxpopup.c index b6a4d35..c6aa221 100644 --- a/src/lib/elementary/elc_ctxpopup.c +++ b/src/lib/elementary/elc_ctxpopup.c @@ -1250,13 +1250,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) { @@ -1278,7 +1271,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 bfc27af..a473329 100644 --- a/src/lib/elementary/elc_hoversel.c +++ b/src/lib/elementary/elc_hoversel.c @@ -737,12 +737,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) { @@ -764,6 +758,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 8e10875..54c8b26 100644 --- a/src/lib/elementary/elc_popup.c +++ b/src/lib/elementary/elc_popup.c @@ -2267,10 +2267,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)) @@ -2343,6 +2344,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 82494b2..101fdf1 100644 --- a/src/lib/elementary/elm_conform.c +++ b/src/lib/elementary/elm_conform.c @@ -1619,29 +1619,6 @@ _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) -{ -#ifdef HAVE_ELEMENTARY_X - Evas_Object *top = elm_widget_top_get(parent); - Ecore_X_Window xwin = elm_win_xwindow_get(parent); - - if ((xwin) && (!elm_win_inlined_image_object_get(top))) - { - - sd->prop_hdl = ecore_event_handler_add - (ECORE_X_EVENT_WINDOW_PROPERTY, _on_prop_change, obj); - sd->vkb_state = ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF; - sd->clipboard_state = ECORE_X_ILLUME_CLIPBOARD_STATE_OFF; - } - // FIXME: get kbd region prop -#else - (void)obj; - (void)sd; - (void)parent; -#endif -} - // TIZEN_ONLY(20160218): Improve launching performance. EAPI void elm_conformant_precreated_object_set(Evas_Object *obj) @@ -1686,6 +1663,28 @@ elm_conformant_add(Evas_Object *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); + + if ((xwin) && (!elm_win_inlined_image_object_get(top))) + { + + sd->prop_hdl = ecore_event_handler_add + (ECORE_X_EVENT_WINDOW_PROPERTY, _on_prop_change, obj); + sd->vkb_state = ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF; + sd->clipboard_state = ECORE_X_ILLUME_CLIPBOARD_STATE_OFF; + } + // FIXME: get kbd region prop +#else + (void)obj; + (void)sd; + (void)parent; +#endif + 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 188cc20..379426c 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 890d960..ebd83c5 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 c14474e..69c34cc 100644 --- a/src/lib/elementary/elm_hover.c +++ b/src/lib/elementary/elm_hover.c @@ -691,6 +691,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) { @@ -699,6 +722,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; } @@ -737,30 +761,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* @@ -776,12 +779,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 41abfd3..5ca798a 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 5d57871..a9a04ef 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 bb6db93..54d2c4d 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 0cd70e6..887f9ee 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 04f951c..a13c386 100644 --- a/src/lib/elementary/elm_menu.c +++ b/src/lib/elementary/elm_menu.c @@ -808,12 +808,56 @@ _elm_menu_efl_ui_widget_focus_manager_focus_manager_create(Eo *obj EINA_UNUSED, return manager; } +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; + + if (sd->parent == parent) return; + if (sd->parent) + { + evas_object_event_callback_del_full + (sd->parent, EVAS_CALLBACK_RESIZE, _parent_resize_cb, obj); + evas_object_event_callback_del_full + (sd->parent, EVAS_CALLBACK_DEL, _parent_del_cb, obj); + } + sd->parent = parent; + if (sd->parent) + { + evas_object_event_callback_add + (sd->parent, EVAS_CALLBACK_RESIZE, _parent_resize_cb, obj); + evas_object_event_callback_add + (sd->parent, EVAS_CALLBACK_DEL, _parent_del_cb, obj); + } + elm_hover_parent_set(sd->hv, parent); + + ll = eina_list_append(ll, sd->items); + EINA_LIST_FOREACH(ll, _ll, l) + { + EINA_LIST_FOREACH(l, _l, eo_item) + { + ELM_MENU_ITEM_DATA_GET(eo_item, item); + if (item->submenu.hv) + { + elm_hover_parent_set(item->submenu.hv, parent); + ll = eina_list_append(ll, item->submenu.items); + } + } + } + + eina_list_free(ll); + + _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); @@ -851,50 +895,9 @@ 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) -{ - Eina_List *l, *_l, *_ll, *ll = NULL; - Elm_Object_Item *eo_item; - - if (sd->parent == parent) return; - if (sd->parent) - { - evas_object_event_callback_del_full - (sd->parent, EVAS_CALLBACK_RESIZE, _parent_resize_cb, obj); - evas_object_event_callback_del_full - (sd->parent, EVAS_CALLBACK_DEL, _parent_del_cb, obj); - } - sd->parent = parent; - if (sd->parent) - { - evas_object_event_callback_add - (sd->parent, EVAS_CALLBACK_RESIZE, _parent_resize_cb, obj); - evas_object_event_callback_add - (sd->parent, EVAS_CALLBACK_DEL, _parent_del_cb, obj); - } - elm_hover_parent_set(sd->hv, parent); - - ll = eina_list_append(ll, sd->items); - EINA_LIST_FOREACH(ll, _ll, l) - { - EINA_LIST_FOREACH(l, _l, eo_item) - { - ELM_MENU_ITEM_DATA_GET(eo_item, item); - if (item->submenu.hv) - { - elm_hover_parent_set(item->submenu.hv, parent); - ll = eina_list_append(ll, item->submenu.items); - } - } - } - - eina_list_free(ll); - - _sizing_eval(obj); + ELM_MENU_DATA_GET(obj, sd); + efl_ui_widget_sub_object_add(parent, obj); + _parent_setup(obj, sd, parent); } EAPI Evas_Object * @@ -904,12 +907,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 e044040..1bc7f98 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 6a26f8d..b1ccfcd 100644 --- a/src/lib/elementary/elm_notify.c +++ b/src/lib/elementary/elm_notify.c @@ -611,26 +611,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) { @@ -667,6 +650,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) { @@ -676,12 +680,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 24aa9ea..44c2b88 100644 --- a/src/lib/elementary/elm_notify_eo.c +++ b/src/lib/elementary/elm_notify_eo.c @@ -97,12 +97,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); @@ -144,8 +138,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 df857f9..462fd29 100644 --- a/src/lib/elementary/elm_popup_eo.c +++ b/src/lib/elementary/elm_popup_eo.c @@ -150,9 +150,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); @@ -206,7 +203,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), -- 2.7.4