From fe23d6e522008246a1c90d228c35f37f8bf865c5 Mon Sep 17 00:00:00 2001 From: Cedric Bail Date: Wed, 25 Sep 2013 13:33:39 +0900 Subject: [PATCH] elementary: update to new eo_parent_get/set API. --- src/lib/elc_ctxpopup.c | 3 +-- src/lib/elc_fileselector.c | 3 +-- src/lib/elc_fileselector_button.c | 3 +-- src/lib/elc_fileselector_entry.c | 3 +-- src/lib/elc_hoversel.c | 3 +-- src/lib/elc_multibuttonentry.c | 3 +-- src/lib/elc_naviframe.c | 3 +-- src/lib/elc_player.c | 7 +++---- src/lib/elc_popup.c | 3 ++- src/lib/elm_access.c | 3 +-- src/lib/elm_actionslider.c | 3 +-- src/lib/elm_app_client_view.c | 2 +- src/lib/elm_app_server_view.c | 2 +- src/lib/elm_bg.c | 3 +-- src/lib/elm_box.c | 3 +-- src/lib/elm_bubble.c | 3 +-- src/lib/elm_button.c | 3 +-- src/lib/elm_calendar.c | 3 +-- src/lib/elm_check.c | 3 +-- src/lib/elm_clock.c | 3 +-- src/lib/elm_colorselector.c | 3 +-- src/lib/elm_conform.c | 3 +-- src/lib/elm_datetime.c | 8 +++----- src/lib/elm_dayselector.c | 3 +-- src/lib/elm_diskselector.c | 2 +- src/lib/elm_entry.c | 3 +-- src/lib/elm_flip.c | 3 +-- src/lib/elm_flipselector.c | 3 +-- src/lib/elm_frame.c | 3 +-- src/lib/elm_gengrid.c | 3 +-- src/lib/elm_genlist.c | 10 ++++------ src/lib/elm_gesture_layer.c | 7 +++---- src/lib/elm_glview.c | 8 +++++--- src/lib/elm_grid.c | 7 ++++--- src/lib/elm_hover.c | 6 ++---- src/lib/elm_icon.c | 7 +++---- src/lib/elm_image.c | 7 +++---- src/lib/elm_index.c | 3 +-- src/lib/elm_inwin.c | 7 ++++--- src/lib/elm_label.c | 2 +- src/lib/elm_layout.c | 2 +- src/lib/elm_list.c | 3 +-- src/lib/elm_map.c | 2 +- src/lib/elm_mapbuf.c | 3 +-- src/lib/elm_menu.c | 10 ++++++---- src/lib/elm_notify.c | 3 +-- src/lib/elm_panel.c | 6 ++---- src/lib/elm_panes.c | 3 +-- src/lib/elm_photo.c | 3 +-- src/lib/elm_photocam.c | 9 ++++----- src/lib/elm_plug.c | 4 +--- src/lib/elm_prefs.c | 3 +-- src/lib/elm_progressbar.c | 3 +-- src/lib/elm_radio.c | 3 +-- src/lib/elm_route.c | 3 +-- src/lib/elm_scroller.c | 6 ++---- src/lib/elm_segment_control.c | 3 +-- src/lib/elm_separator.c | 3 +-- src/lib/elm_slider.c | 3 +-- src/lib/elm_slideshow.c | 7 +++---- src/lib/elm_spinner.c | 3 +-- src/lib/elm_table.c | 2 +- src/lib/elm_thumb.c | 3 +-- src/lib/elm_toolbar.c | 2 +- src/lib/elm_video.c | 3 +-- src/lib/elm_web.c | 2 +- src/lib/elm_web2.c | 3 +-- src/lib/elm_widget.c | 21 ++++++++++++++++++--- src/lib/elm_widget.h | 1 + src/lib/elm_win.c | 6 ++++-- 70 files changed, 127 insertions(+), 161 deletions(-) diff --git a/src/lib/elc_ctxpopup.c b/src/lib/elc_ctxpopup.c index f9e42c8..3b1af6b 100644 --- a/src/lib/elc_ctxpopup.c +++ b/src/lib/elc_ctxpopup.c @@ -1130,8 +1130,7 @@ _elm_ctxpopup_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) Elm_Ctxpopup_Smart_Data *priv = _pd; eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); if (!elm_layout_theme_set (obj, "ctxpopup", "base", elm_widget_style_get(obj))) diff --git a/src/lib/elc_fileselector.c b/src/lib/elc_fileselector.c index c2d1f64..0787de9 100644 --- a/src/lib/elc_fileselector.c +++ b/src/lib/elc_fileselector.c @@ -919,8 +919,7 @@ _elm_fileselector_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) EINA_REFCOUNT_INIT(priv); eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); elm_widget_can_focus_set(obj, EINA_FALSE); priv->expand = !!_elm_config->fileselector_expand_enable; diff --git a/src/lib/elc_fileselector_button.c b/src/lib/elc_fileselector_button.c index e2182ba..4baef77 100644 --- a/src/lib/elc_fileselector_button.c +++ b/src/lib/elc_fileselector_button.c @@ -174,8 +174,7 @@ _elm_fileselector_button_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED Elm_Fileselector_Button_Smart_Data *priv = _pd; eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); priv->window_title = eina_stringshare_add(DEFAULT_WINDOW_TITLE); if (getenv("HOME")) priv->fsd.path = eina_stringshare_add(getenv("HOME")); diff --git a/src/lib/elc_fileselector_entry.c b/src/lib/elc_fileselector_entry.c index abdf7e5..eac61b7 100644 --- a/src/lib/elc_fileselector_entry.c +++ b/src/lib/elc_fileselector_entry.c @@ -345,8 +345,7 @@ _elm_fileselector_entry_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) Elm_Fileselector_Entry_Smart_Data *priv = _pd; eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); if (!elm_layout_theme_set (obj, "fileselector_entry", "base", elm_widget_style_get(obj))) diff --git a/src/lib/elc_hoversel.c b/src/lib/elc_hoversel.c index cc640a1..2d0f068 100644 --- a/src/lib/elc_hoversel.c +++ b/src/lib/elc_hoversel.c @@ -225,8 +225,7 @@ _elm_hoversel_smart_add(Eo *obj, void *_pd __UNUSED__, va_list *list EINA_UNUSED) { eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); elm_widget_mirrored_automatic_set(obj, EINA_FALSE); diff --git a/src/lib/elc_multibuttonentry.c b/src/lib/elc_multibuttonentry.c index b09c712..b498f2c 100644 --- a/src/lib/elc_multibuttonentry.c +++ b/src/lib/elc_multibuttonentry.c @@ -1452,8 +1452,7 @@ _elm_multibuttonentry_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS); eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); if (!elm_layout_theme_set (obj, "multibuttonentry", "base", elm_widget_style_get(obj))) diff --git a/src/lib/elc_naviframe.c b/src/lib/elc_naviframe.c index 95aab57..af4cdf6 100644 --- a/src/lib/elc_naviframe.c +++ b/src/lib/elc_naviframe.c @@ -1321,6 +1321,7 @@ _elm_naviframe_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS); eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); + elm_widget_sub_object_parent_add(obj); priv->dummy_edje = wd->resize_obj; evas_object_smart_member_add(priv->dummy_edje, obj); @@ -1331,8 +1332,6 @@ _elm_naviframe_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_obj_size_hints_changed, obj); elm_widget_can_focus_set(obj, EINA_TRUE); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); } static Eina_Bool diff --git a/src/lib/elc_player.c b/src/lib/elc_player.c index 2f52ed9..142ca19 100644 --- a/src/lib/elc_player.c +++ b/src/lib/elc_player.c @@ -629,12 +629,11 @@ end: static void _elm_player_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) { + Elm_Player_Smart_Data *priv = _pd; char buf[256]; - eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); - Elm_Player_Smart_Data *priv = _pd; + eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); + elm_widget_sub_object_parent_add(obj); if (!elm_layout_theme_set(obj, "player", "base", elm_widget_style_get(obj))) CRITICAL("Failed to set layout!"); diff --git a/src/lib/elc_popup.c b/src/lib/elc_popup.c index 767b32c..dfc586f 100644 --- a/src/lib/elc_popup.c +++ b/src/lib/elc_popup.c @@ -1490,13 +1490,14 @@ _elm_popup_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) { Elm_Popup_Smart_Data *priv = _pd; Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS); + eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); + elm_widget_sub_object_parent_add(obj); evas_object_size_hint_weight_set (wd->resize_obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set (wd->resize_obj, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_widget_sub_object_add(eo_parent_get(obj), obj); if (!elm_layout_theme_set(obj, "popup", "base", elm_widget_style_get(obj))) CRITICAL("Failed to set layout!"); diff --git a/src/lib/elm_access.c b/src/lib/elm_access.c index 6623e34..398629e 100644 --- a/src/lib/elm_access.c +++ b/src/lib/elm_access.c @@ -37,8 +37,7 @@ static void _elm_access_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) { eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); } static Eina_Bool diff --git a/src/lib/elm_actionslider.c b/src/lib/elm_actionslider.c index 42c94c7..8660a03 100644 --- a/src/lib/elm_actionslider.c +++ b/src/lib/elm_actionslider.c @@ -398,8 +398,7 @@ _elm_actionslider_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS); eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); priv->enabled_position = ELM_ACTIONSLIDER_ALL; diff --git a/src/lib/elm_app_client_view.c b/src/lib/elm_app_client_view.c index 2b8880c..f97bcf7 100644 --- a/src/lib/elm_app_client_view.c +++ b/src/lib/elm_app_client_view.c @@ -164,7 +164,7 @@ _app_client_view_constructor(Eo *eo, void *_pd, va_list *list) EINA_SAFETY_ON_NULL_GOTO(path, error); eo_do_super(eo, MY_CLASS, eo_constructor()); - parent = eo_parent_get(eo); + eo_do(eo, eo_parent_get(&parent)); EINA_SAFETY_ON_TRUE_GOTO((!parent) || (!eo_isa(parent, ELM_APP_CLIENT_CLASS)), error); diff --git a/src/lib/elm_app_server_view.c b/src/lib/elm_app_server_view.c index e734540..d1cfe8c 100644 --- a/src/lib/elm_app_server_view.c +++ b/src/lib/elm_app_server_view.c @@ -362,7 +362,7 @@ _app_server_view_constructor(Eo *obj, void *_pd, va_list *list) eo_do_super(obj, MY_CLASS, eo_constructor()); - server = eo_parent_get(obj); + eo_do(obj, eo_parent_get(&server)); EINA_SAFETY_ON_TRUE_GOTO(!server || !eo_isa(server, ELM_APP_SERVER_CLASS), error); if (!id) diff --git a/src/lib/elm_bg.c b/src/lib/elm_bg.c index ae63607..68e6c0e 100644 --- a/src/lib/elm_bg.c +++ b/src/lib/elm_bg.c @@ -106,8 +106,7 @@ _elm_bg_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) Elm_Bg_Smart_Data *priv = _pd; eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); elm_widget_can_focus_set(obj, EINA_FALSE); priv->option = ELM_BG_OPTION_SCALE; diff --git a/src/lib/elm_box.c b/src/lib/elm_box.c index 1c2b01f..b40c8f1 100644 --- a/src/lib/elm_box.c +++ b/src/lib/elm_box.c @@ -407,8 +407,7 @@ _elm_box_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) _on_size_hints_changed, obj); eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); evas_object_smart_callback_add(wd->resize_obj, SIG_CHILD_ADDED, _child_added_cb_proxy, obj); diff --git a/src/lib/elm_bubble.c b/src/lib/elm_bubble.c index 70169bf..0786596 100644 --- a/src/lib/elm_bubble.c +++ b/src/lib/elm_bubble.c @@ -202,8 +202,7 @@ _elm_bubble_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS); eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); priv->pos = ELM_BUBBLE_POS_TOP_LEFT; //default diff --git a/src/lib/elm_button.c b/src/lib/elm_button.c index 2f8d879..824c9ad 100644 --- a/src/lib/elm_button.c +++ b/src/lib/elm_button.c @@ -289,8 +289,7 @@ _elm_button_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS); eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); edje_object_signal_callback_add (wd->resize_obj, "elm,action,click", "", diff --git a/src/lib/elm_calendar.c b/src/lib/elm_calendar.c index 00741b6..bbaf767 100644 --- a/src/lib/elm_calendar.c +++ b/src/lib/elm_calendar.c @@ -949,8 +949,7 @@ _elm_calendar_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS); eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); priv->first_interval = 0.85; priv->year_min = 2; diff --git a/src/lib/elm_check.c b/src/lib/elm_check.c index 26384aa..0887391 100644 --- a/src/lib/elm_check.c +++ b/src/lib/elm_check.c @@ -292,8 +292,7 @@ _elm_check_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS); eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); edje_object_signal_callback_add (wd->resize_obj, "elm,action,check,on", "", diff --git a/src/lib/elm_clock.c b/src/lib/elm_clock.c index 4424038..a051708 100644 --- a/src/lib/elm_clock.c +++ b/src/lib/elm_clock.c @@ -667,8 +667,7 @@ _elm_clock_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS); eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); priv->cur.ampm = -1; priv->cur.seconds = EINA_TRUE; diff --git a/src/lib/elm_colorselector.c b/src/lib/elm_colorselector.c index 1c1d9b5..511a23a 100644 --- a/src/lib/elm_colorselector.c +++ b/src/lib/elm_colorselector.c @@ -1472,8 +1472,7 @@ _elm_colorselector_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS); eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); if (!elm_layout_theme_set (obj, "colorselector", "palette", elm_object_style_get(obj))) diff --git a/src/lib/elm_conform.c b/src/lib/elm_conform.c index 3dd61bc..47fb2af 100644 --- a/src/lib/elm_conform.c +++ b/src/lib/elm_conform.c @@ -899,8 +899,7 @@ static void _elm_conformant_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) { eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); elm_widget_can_focus_set(obj, EINA_FALSE); if (!elm_layout_theme_set diff --git a/src/lib/elm_datetime.c b/src/lib/elm_datetime.c index 6517588..0789f14 100644 --- a/src/lib/elm_datetime.c +++ b/src/lib/elm_datetime.c @@ -792,14 +792,12 @@ _access_info_cb(void *data, Evas_Object *obj __UNUSED__) static void _elm_datetime_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) { - int idx; - Datetime_Field *field; - Elm_Datetime_Smart_Data *priv = _pd; + Datetime_Field *field; + int idx; eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); if (!elm_layout_theme_set(obj, "datetime", "base", elm_widget_style_get(obj))) diff --git a/src/lib/elm_dayselector.c b/src/lib/elm_dayselector.c index 2e9fdb0..0190050 100644 --- a/src/lib/elm_dayselector.c +++ b/src/lib/elm_dayselector.c @@ -431,8 +431,7 @@ _elm_dayselector_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) Elm_Dayselector_Smart_Data *priv = _pd; eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); if (!elm_layout_theme_set(obj, "dayselector", "base", "dayselector")) CRITICAL("Failed to set layout!"); diff --git a/src/lib/elm_diskselector.c b/src/lib/elm_diskselector.c index a2c8656..7b4c21e 100644 --- a/src/lib/elm_diskselector.c +++ b/src/lib/elm_diskselector.c @@ -1271,7 +1271,7 @@ _elm_diskselector_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) Evas *evas; Evas_Object *blank, *edje; - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); evas = evas_object_evas_get(obj); evas_event_freeze(evas); diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c index 5a3e8a7..eaad53f 100644 --- a/src/lib/elm_entry.c +++ b/src/lib/elm_entry.c @@ -2958,8 +2958,7 @@ _elm_entry_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS); eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); priv->entry_edje = wd->resize_obj; diff --git a/src/lib/elm_flip.c b/src/lib/elm_flip.c index a6a6623..c63cdd3 100644 --- a/src/lib/elm_flip.c +++ b/src/lib/elm_flip.c @@ -1848,8 +1848,7 @@ _elm_flip_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) Elm_Flip_Smart_Data *priv = _pd; eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); priv->clip = evas_object_rectangle_add(evas_object_evas_get(obj)); evas_object_static_clip_set(priv->clip, EINA_TRUE); diff --git a/src/lib/elm_flipselector.c b/src/lib/elm_flipselector.c index ddd930f..ce13661 100644 --- a/src/lib/elm_flipselector.c +++ b/src/lib/elm_flipselector.c @@ -558,8 +558,7 @@ _elm_flipselector_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) Elm_Flipselector_Smart_Data *priv = _pd; eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); if (!elm_layout_theme_set (obj, "flipselector", "base", elm_widget_style_get(obj))) diff --git a/src/lib/elm_frame.c b/src/lib/elm_frame.c index f9feb37..3c6d668 100644 --- a/src/lib/elm_frame.c +++ b/src/lib/elm_frame.c @@ -174,8 +174,7 @@ _elm_frame_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS); eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); edje_object_signal_callback_add (wd->resize_obj, "elm,anim,done", "elm", diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c index cd7d61f..89240a8 100644 --- a/src/lib/elm_gengrid.c +++ b/src/lib/elm_gengrid.c @@ -2382,8 +2382,7 @@ _elm_gengrid_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS); eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); priv->hit_rect = evas_object_rectangle_add(evas_object_evas_get(obj)); evas_object_smart_member_add(priv->hit_rect, obj); diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c index bf24d98..7b459a4 100644 --- a/src/lib/elm_genlist.c +++ b/src/lib/elm_genlist.c @@ -4817,16 +4817,14 @@ _decorate_item_unset(Elm_Genlist_Smart_Data *sd) static void _elm_genlist_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) { - Evas_Coord minw, minh; - Elm_Genlist_Pan_Smart_Data *pan_data; - int i; - Elm_Genlist_Smart_Data *priv = _pd; Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS); + Elm_Genlist_Pan_Smart_Data *pan_data; + Evas_Coord minw, minh; + int i; eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); priv->hit_rect = evas_object_rectangle_add(evas_object_evas_get(obj)); evas_object_smart_member_add(priv->hit_rect, obj); diff --git a/src/lib/elm_gesture_layer.c b/src/lib/elm_gesture_layer.c index 4adbb03..b7ca7fa 100644 --- a/src/lib/elm_gesture_layer.c +++ b/src/lib/elm_gesture_layer.c @@ -3734,12 +3734,11 @@ _elm_gesture_layer_smart_disable(Eo *obj, void *_pd EINA_UNUSED, va_list *list) static void _elm_gesture_layer_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) { - eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); - Elm_Gesture_Layer_Smart_Data *priv = _pd; + eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); + elm_widget_sub_object_parent_add(obj); + priv->line_min_length = _elm_config->glayer_line_min_length * elm_config_finger_size_get(); priv->zoom_distance_tolerance = _elm_config->glayer_zoom_distance_tolerance diff --git a/src/lib/elm_glview.c b/src/lib/elm_glview.c index 91bebc9..91386f4 100644 --- a/src/lib/elm_glview.c +++ b/src/lib/elm_glview.c @@ -197,16 +197,18 @@ _set_render_policy_callback(Evas_Object *obj) static void _elm_glview_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) { - elm_widget_sub_object_add(eo_parent_get(obj), obj); + Elm_Glview_Smart_Data *priv = _pd; + Evas_Object *img; + + elm_widget_sub_object_parent_add(obj); // Create image to render Evas_GL Surface - Evas_Object *img = evas_object_image_filled_add(evas_object_evas_get(obj)); + img = evas_object_image_filled_add(evas_object_evas_get(obj)); elm_widget_resize_object_set(obj, img); evas_object_image_size_set(img, 1, 1); eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - Elm_Glview_Smart_Data *priv = _pd; // Evas_GL priv->evasgl = evas_gl_new(evas_object_evas_get(obj)); if (!priv->evasgl) diff --git a/src/lib/elm_grid.c b/src/lib/elm_grid.c index 80bb446..63faa7b 100644 --- a/src/lib/elm_grid.c +++ b/src/lib/elm_grid.c @@ -131,11 +131,12 @@ _elm_grid_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list) static void _elm_grid_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) { - elm_widget_sub_object_add(eo_parent_get(obj), obj); - Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS); + Evas_Object *grid; + + elm_widget_sub_object_parent_add(obj); - Evas_Object *grid = evas_object_grid_add(evas_object_evas_get(obj)); + grid = evas_object_grid_add(evas_object_evas_get(obj)); elm_widget_resize_object_set(obj, grid); evas_object_grid_size_set(wd->resize_obj, 100, 100); diff --git a/src/lib/elm_hover.c b/src/lib/elm_hover.c index 1e9fd14..783dca9 100644 --- a/src/lib/elm_hover.c +++ b/src/lib/elm_hover.c @@ -540,13 +540,11 @@ _hov_dismiss_cb(void *data, static void _elm_hover_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) { - unsigned int i; - Elm_Hover_Smart_Data *priv = _pd; + unsigned int i; eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); for (i = 0; i < sizeof(priv->subs) / sizeof(priv->subs[0]); i++) priv->subs[i].swallow = _content_aliases[i].alias; diff --git a/src/lib/elm_icon.c b/src/lib/elm_icon.c index d203e07..d28b5da 100644 --- a/src/lib/elm_icon.c +++ b/src/lib/elm_icon.c @@ -607,12 +607,11 @@ _elm_icon_thumb_resize_cb(void *data, static void _elm_icon_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) { - eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); - Elm_Icon_Smart_Data *priv = _pd; + eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); + elm_widget_sub_object_parent_add(obj); + priv->lookup_order = ELM_ICON_LOOKUP_THEME_FDO; #ifdef HAVE_ELEMENTARY_ETHUMB diff --git a/src/lib/elm_image.c b/src/lib/elm_image.c index a826a78..3680493 100644 --- a/src/lib/elm_image.c +++ b/src/lib/elm_image.c @@ -455,12 +455,11 @@ _elm_image_drag_n_drop_cb(void *elm_obj, static void _elm_image_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) { - eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); - Elm_Image_Smart_Data *priv = _pd; + eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); + elm_widget_sub_object_parent_add(obj); + priv->hit_rect = evas_object_rectangle_add(evas_object_evas_get(obj)); evas_object_smart_member_add(priv->hit_rect, obj); elm_widget_sub_object_add(obj, priv->hit_rect); diff --git a/src/lib/elm_index.c b/src/lib/elm_index.c index c302929..7b64c6b 100644 --- a/src/lib/elm_index.c +++ b/src/lib/elm_index.c @@ -907,8 +907,7 @@ _elm_index_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS); eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); if (!elm_layout_theme_set (obj, "index", "base/vertical", elm_widget_style_get(obj))) diff --git a/src/lib/elm_inwin.c b/src/lib/elm_inwin.c index 1c9b5bf..e8d7f45 100644 --- a/src/lib/elm_inwin.c +++ b/src/lib/elm_inwin.c @@ -75,8 +75,7 @@ static void _elm_inwin_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) { eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); elm_widget_can_focus_set(obj, EINA_FALSE); elm_widget_highlight_ignore_set(obj, EINA_TRUE); @@ -115,7 +114,9 @@ elm_win_inwin_add(Evas_Object *parent) static void _constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) { - Evas_Object *parent = eo_parent_get(obj); + Evas_Object *parent; + + eo_do(obj, eo_parent_get(&parent)); if (!eo_isa(parent, ELM_OBJ_WIN_CLASS)) { diff --git a/src/lib/elm_label.c b/src/lib/elm_label.c index b6bf1f7..32fa2bb 100644 --- a/src/lib/elm_label.c +++ b/src/lib/elm_label.c @@ -383,7 +383,7 @@ _elm_label_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); priv->linewrap = ELM_WRAP_NONE; priv->wrap_w = -1; diff --git a/src/lib/elm_layout.c b/src/lib/elm_layout.c index 453b6d0..6c03511 100644 --- a/src/lib/elm_layout.c +++ b/src/lib/elm_layout.c @@ -697,7 +697,7 @@ _elm_layout_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) { Evas_Object *edje; - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); /* has to be there *before* parent's smart_add() */ edje = edje_object_add(evas_object_evas_get(obj)); diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c index 3c8c314..89c0e6c 100644 --- a/src/lib/elm_list.c +++ b/src/lib/elm_list.c @@ -1700,8 +1700,7 @@ _elm_list_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS); eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); elm_widget_can_focus_set(obj, EINA_TRUE); diff --git a/src/lib/elm_map.c b/src/lib/elm_map.c index aa82c32..29e55ed 100644 --- a/src/lib/elm_map.c +++ b/src/lib/elm_map.c @@ -3976,7 +3976,7 @@ _elm_map_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) Elm_Map_Smart_Data *priv = _pd; - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); edje = edje_object_add(evas_object_evas_get(obj)); elm_widget_resize_object_set(obj, edje); diff --git a/src/lib/elm_mapbuf.c b/src/lib/elm_mapbuf.c index 07b3c0e..afcd2e3 100644 --- a/src/lib/elm_mapbuf.c +++ b/src/lib/elm_mapbuf.c @@ -337,8 +337,7 @@ _elm_mapbuf_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) elm_widget_resize_object_set(obj, rect); eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); evas_object_static_clip_set(rect, EINA_TRUE); evas_object_pass_events_set(rect, EINA_TRUE); diff --git a/src/lib/elm_menu.c b/src/lib/elm_menu.c index 0d02169..0a23e7b 100644 --- a/src/lib/elm_menu.c +++ b/src/lib/elm_menu.c @@ -590,8 +590,7 @@ _elm_menu_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) Elm_Menu_Smart_Data *priv = _pd; eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); elm_widget_can_focus_set(obj, EINA_FALSE); @@ -702,12 +701,15 @@ static void _constructor(Eo *obj, void *_pd, va_list *list EINA_UNUSED) { Elm_Menu_Smart_Data *sd = _pd; + Eo *parent; + eo_do_super(obj, MY_CLASS, eo_constructor()); eo_do(obj, evas_obj_type_set(MY_CLASS_NAME), - evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL)); + evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL), + eo_parent_get(&parent)); - elm_menu_parent_set(obj, eo_parent_get(obj)); + 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 diff --git a/src/lib/elm_notify.c b/src/lib/elm_notify.c index 26fb793..912a001 100644 --- a/src/lib/elm_notify.c +++ b/src/lib/elm_notify.c @@ -475,8 +475,7 @@ _elm_notify_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) Elm_Notify_Smart_Data *priv = _pd; eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); priv->allow_events = EINA_TRUE; diff --git a/src/lib/elm_panel.c b/src/lib/elm_panel.c index 13f4051..1e8caf2 100644 --- a/src/lib/elm_panel.c +++ b/src/lib/elm_panel.c @@ -353,11 +353,9 @@ _elm_panel_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) { Elm_Panel_Smart_Data *priv = _pd; Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS); - - eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); + elm_widget_sub_object_parent_add(obj); elm_widget_can_focus_set(obj, EINA_TRUE); /* just to bootstrap and have theme hook to work */ diff --git a/src/lib/elm_panes.c b/src/lib/elm_panes.c index 040bd5e..a226960 100644 --- a/src/lib/elm_panes.c +++ b/src/lib/elm_panes.c @@ -202,8 +202,7 @@ _elm_panes_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) ELM_PANES_DATA_GET(obj, sd); eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); if (!elm_layout_theme_set (obj, "panes", "vertical", elm_widget_style_get(obj))) diff --git a/src/lib/elm_photo.c b/src/lib/elm_photo.c index ae507d7..3d7cd63 100644 --- a/src/lib/elm_photo.c +++ b/src/lib/elm_photo.c @@ -256,8 +256,7 @@ _elm_photo_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS); eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); elm_widget_can_focus_set(obj, EINA_FALSE); diff --git a/src/lib/elm_photocam.c b/src/lib/elm_photocam.c index 2a59dcd..22395cd 100644 --- a/src/lib/elm_photocam.c +++ b/src/lib/elm_photocam.c @@ -1320,14 +1320,13 @@ _g_layer_zoom_end_cb(void *data, static void _elm_photocam_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) { - Evas_Coord minw, minh; - Elm_Photocam_Pan_Smart_Data *pan_data; + Elm_Photocam_Smart_Data *priv = _pd; Eina_Bool bounce = _elm_config->thumbscroll_bounce_enable; + Elm_Photocam_Pan_Smart_Data *pan_data; Evas_Object *edje; + Evas_Coord minw, minh; - Elm_Photocam_Smart_Data *priv = _pd; - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); edje = edje_object_add(evas_object_evas_get(obj)); elm_widget_resize_object_set(obj, edje); diff --git a/src/lib/elm_plug.c b/src/lib/elm_plug.c index 7ae0ef1..3cce46e 100644 --- a/src/lib/elm_plug.c +++ b/src/lib/elm_plug.c @@ -91,12 +91,10 @@ _elm_plug_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) { Evas_Object *p_obj; Ecore_Evas *ee; - Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS); eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj)); if (!ee) return; diff --git a/src/lib/elm_prefs.c b/src/lib/elm_prefs.c index b8bd9da..cf52d29 100644 --- a/src/lib/elm_prefs.c +++ b/src/lib/elm_prefs.c @@ -48,8 +48,7 @@ static void _elm_prefs_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) { eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); } static void _item_free(Elm_Prefs_Item_Node *it); diff --git a/src/lib/elm_progressbar.c b/src/lib/elm_progressbar.c index ef702d8..04e49d9 100644 --- a/src/lib/elm_progressbar.c +++ b/src/lib/elm_progressbar.c @@ -267,8 +267,7 @@ _elm_progressbar_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS); eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); priv->horizontal = EINA_TRUE; priv->units = eina_stringshare_add("%.0f %%"); diff --git a/src/lib/elm_radio.c b/src/lib/elm_radio.c index d29543a..a3e7173 100644 --- a/src/lib/elm_radio.c +++ b/src/lib/elm_radio.c @@ -275,8 +275,7 @@ _elm_radio_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS); eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); if (!elm_layout_theme_set(obj, "radio", "base", elm_widget_style_get(obj))) CRITICAL("Failed to set layout!"); diff --git a/src/lib/elm_route.c b/src/lib/elm_route.c index 2599489..05aa121 100644 --- a/src/lib/elm_route.c +++ b/src/lib/elm_route.c @@ -143,8 +143,7 @@ _elm_route_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) Elm_Route_Smart_Data *priv = _pd; eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); elm_widget_can_focus_set(obj, EINA_FALSE); evas_object_event_callback_add diff --git a/src/lib/elm_scroller.c b/src/lib/elm_scroller.c index f1b97ea..5dce8f7 100644 --- a/src/lib/elm_scroller.c +++ b/src/lib/elm_scroller.c @@ -744,14 +744,12 @@ _elm_scroller_content_viewport_resize_cb(Evas_Object *obj, static void _elm_scroller_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) { - Evas_Coord minw, minh; - Elm_Scroller_Smart_Data *priv = _pd; Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS); + Evas_Coord minw, minh; eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); elm_widget_can_focus_set(obj, EINA_TRUE); if (!elm_layout_theme_set diff --git a/src/lib/elm_segment_control.c b/src/lib/elm_segment_control.c index b0332d2..6722c9e 100644 --- a/src/lib/elm_segment_control.c +++ b/src/lib/elm_segment_control.c @@ -609,8 +609,7 @@ static void _elm_segment_control_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) { eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); if (!elm_layout_theme_set (obj, "segment_control", "base", elm_widget_style_get(obj))) diff --git a/src/lib/elm_separator.c b/src/lib/elm_separator.c index 6398085..3797fc2 100644 --- a/src/lib/elm_separator.c +++ b/src/lib/elm_separator.c @@ -52,8 +52,7 @@ _elm_separator_smart_add(Eo *obj, void *_pd __UNUSED__, va_list *list EINA_UNUSED) { eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); elm_widget_can_focus_set(obj, EINA_FALSE); if (!elm_layout_theme_set diff --git a/src/lib/elm_slider.c b/src/lib/elm_slider.c index 0437c71..24719a4 100644 --- a/src/lib/elm_slider.c +++ b/src/lib/elm_slider.c @@ -798,8 +798,7 @@ _elm_slider_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS); eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); priv->horizontal = EINA_TRUE; priv->indicator_show = EINA_TRUE; diff --git a/src/lib/elm_slideshow.c b/src/lib/elm_slideshow.c index 4a96d21..169d421 100644 --- a/src/lib/elm_slideshow.c +++ b/src/lib/elm_slideshow.c @@ -313,16 +313,15 @@ _item_del_pre_hook(Elm_Object_Item *it) static void _elm_slideshow_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) { - - eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); Elm_Slideshow_Smart_Data *priv = _pd; Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS); + eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); + elm_widget_sub_object_parent_add(obj); + priv->count_item_pre_before = 2; priv->count_item_pre_after = 2; - elm_widget_sub_object_add(eo_parent_get(obj), obj); - if (!elm_layout_theme_set (obj, "slideshow", "base", elm_widget_style_get(obj))) CRITICAL("Failed to set layout!"); diff --git a/src/lib/elm_spinner.c b/src/lib/elm_spinner.c index b38d9bd..7287828 100644 --- a/src/lib/elm_spinner.c +++ b/src/lib/elm_spinner.c @@ -658,8 +658,7 @@ _elm_spinner_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS); eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); priv->val_max = 100.0; priv->step = 1.0; diff --git a/src/lib/elm_table.c b/src/lib/elm_table.c index 93f2c4c..5a00529 100644 --- a/src/lib/elm_table.c +++ b/src/lib/elm_table.c @@ -185,7 +185,7 @@ _elm_table_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) { Evas_Object *table; - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); table = evas_object_table_add(evas_object_evas_get(obj)); elm_widget_resize_object_set(obj, table); diff --git a/src/lib/elm_thumb.c b/src/lib/elm_thumb.c index 7ab8cac..a35bba9 100644 --- a/src/lib/elm_thumb.c +++ b/src/lib/elm_thumb.c @@ -598,8 +598,7 @@ _elm_thumb_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS); eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); elm_widget_resize_object_set(obj, elm_layout_add(obj)); if (!elm_layout_theme_set(wd->resize_obj, "thumb", "base", diff --git a/src/lib/elm_toolbar.c b/src/lib/elm_toolbar.c index fd98804..27f043a 100644 --- a/src/lib/elm_toolbar.c +++ b/src/lib/elm_toolbar.c @@ -2491,7 +2491,7 @@ _elm_toolbar_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) Elm_Toolbar_Smart_Data *priv = _pd; Evas_Object *edje; - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); edje = edje_object_add(evas_object_evas_get(obj)); elm_widget_resize_object_set(obj, edje); diff --git a/src/lib/elm_video.c b/src/lib/elm_video.c index 2d579cf..db5972d 100644 --- a/src/lib/elm_video.c +++ b/src/lib/elm_video.c @@ -250,8 +250,7 @@ _elm_video_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) _elm_emotion_init(); eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); elm_widget_can_focus_set(obj, EINA_TRUE); #ifdef HAVE_EMOTION diff --git a/src/lib/elm_web.c b/src/lib/elm_web.c index 432de0f..aea4489 100644 --- a/src/lib/elm_web.c +++ b/src/lib/elm_web.c @@ -242,7 +242,7 @@ _view_smart_add(Evas_Object *obj) { View_Smart_Data *sd; - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); sd = calloc(1, sizeof(View_Smart_Data)); evas_object_smart_data_set(obj, sd); diff --git a/src/lib/elm_web2.c b/src/lib/elm_web2.c index 9ac867c..fad12af 100644 --- a/src/lib/elm_web2.c +++ b/src/lib/elm_web2.c @@ -37,8 +37,7 @@ _view_smart_add(Evas_Object *obj) sd = calloc(1, sizeof(View_Smart_Data)); evas_object_smart_data_set(obj, sd); - - elm_widget_sub_object_add(eo_parent_get(obj), obj); + elm_widget_sub_object_parent_add(obj); _ewk_view_parent_sc.sc.add(obj); } diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c index 931bac9..ca3d375 100644 --- a/src/lib/elm_widget.c +++ b/src/lib/elm_widget.c @@ -953,6 +953,18 @@ _elm_widget_on_show_region_hook_set(Eo *obj EINA_UNUSED, void *_pd, va_list *lis } EAPI Eina_Bool +elm_widget_sub_object_parent_add(Evas_Object *sobj) +{ + Eina_Bool ret = EINA_FALSE; + Eo *parent; + + eo_do(sobj, eo_parent_get(&parent)); + eo_do(parent, elm_wdg_sub_object_add(sobj, &ret)); + + return ret; +} + +EAPI Eina_Bool elm_widget_sub_object_add(Evas_Object *obj, Evas_Object *sobj) { @@ -963,7 +975,7 @@ elm_widget_sub_object_add(Evas_Object *obj, Eina_Bool ret = EINA_FALSE; eo_do(obj, elm_wdg_sub_object_add(sobj, &ret)); - + // FIXME: better handle the error case in the eo called function than here. if (ret) return EINA_TRUE; err: @@ -6120,12 +6132,15 @@ elm_widget_tree_dot_dump(const Evas_Object *top, static void _constructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED) { + Eo *parent; ELM_WIDGET_DATA_GET(obj, sd); sd->on_create = EINA_TRUE; eo_do_super(obj, MY_CLASS, eo_constructor()); - eo_do(obj, evas_obj_type_set(MY_CLASS_NAME)); - eo_do(obj, elm_wdg_parent_set(eo_parent_get(obj))); + eo_do(obj, + evas_obj_type_set(MY_CLASS_NAME), + eo_parent_get(&parent)); + eo_do(obj, elm_wdg_parent_set(parent)); sd->on_create = EINA_FALSE; } diff --git a/src/lib/elm_widget.h b/src/lib/elm_widget.h index c735b2d..b67feef 100644 --- a/src/lib/elm_widget.h +++ b/src/lib/elm_widget.h @@ -601,6 +601,7 @@ EAPI Eina_Bool elm_widget_theme(Evas_Object *obj); EAPI void elm_widget_theme_specific(Evas_Object *obj, Elm_Theme *th, Eina_Bool force); EAPI void elm_widget_translate(Evas_Object *obj); EAPI void elm_widget_on_show_region_hook_set(Evas_Object *obj, void (*func)(void *data, Evas_Object *obj), void *data); +EAPI Eina_Bool elm_widget_sub_object_parent_add(Evas_Object *sobj); EAPI Eina_Bool elm_widget_sub_object_add(Evas_Object *obj, Evas_Object *sobj); EAPI Eina_Bool elm_widget_sub_object_del(Evas_Object *obj, Evas_Object *sobj); EAPI void elm_widget_resize_object_set(Evas_Object *obj, Evas_Object *sobj); diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c index 0e12e2b..2b6924f 100644 --- a/src/lib/elm_win.c +++ b/src/lib/elm_win.c @@ -2764,13 +2764,15 @@ _win_constructor(Eo *obj, void *_pd, va_list *list) const char *name = va_arg(*list, const char *); Elm_Win_Type type = va_arg(*list, Elm_Win_Type); - Evas_Object *parent = eo_parent_get(obj); + Evas_Object *parent; Evas *e; const Eina_List *l; const char *fontpath, *fallback = NULL; Elm_Win_Smart_Data tmp_sd; + eo_do(obj, eo_parent_get(&parent)); + /* just to store some data while trying out to create a canvas */ memset(&tmp_sd, 0, sizeof(Elm_Win_Smart_Data)); @@ -2959,7 +2961,7 @@ _win_constructor(Eo *obj, void *_pd, va_list *list) return; } - eo_parent_set(obj, ecore_evas_get(tmp_sd.ee)); + eo_do(obj, eo_parent_set(ecore_evas_get(tmp_sd.ee))); eo_do_super(obj, MY_CLASS, eo_constructor()); eo_do(obj, evas_obj_type_set(MY_CLASS_NAME), -- 2.7.4