diff options
author | Cedric Bail <cedric.bail@samsung.com> | 2013-09-25 13:33:39 +0900 |
---|---|---|
committer | Cedric Bail <cedric.bail@samsung.com> | 2013-09-25 13:34:27 +0900 |
commit | fe23d6e522008246a1c90d228c35f37f8bf865c5 (patch) | |
tree | 42c09197e433c069e025ee2501192c8f73b3f27c /src | |
parent | bac98dd0e1e39e465fac43c9a7fecc726e0d4c12 (diff) | |
download | elementary-fe23d6e522008246a1c90d228c35f37f8bf865c5.tar.gz |
elementary: update to new eo_parent_get/set API.
Diffstat (limited to 'src')
70 files changed, 127 insertions, 161 deletions
diff --git a/src/lib/elc_ctxpopup.c b/src/lib/elc_ctxpopup.c index f9e42c842..3b1af6b27 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 c2d1f649d..0787de9b4 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 e2182badd..4baef7771 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 abdf7e59d..eac61b755 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 cc640a197..2d0f06804 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 b09c712c0..b498f2c4b 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 95aab57db..af4cdf66d 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 2f52ed986..142ca1913 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 767b32ce5..dfc586f25 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 6623e346e..398629ed8 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 42c94c70e..8660a0381 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 2b8880cc9..f97bcf794 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 e734540bf..d1cfe8cd2 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 ae63607e0..68e6c0e6b 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 1c2b01f0f..b40c8f17a 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 70169bf98..07865963d 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 2f8d879f1..824c9ad98 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 00741b6d0..bbaf767fc 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 26384aa8e..08873913d 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 442403881..a05170859 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 1c1d9b542..511a23a20 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 3dd61bc02..47fb2afc8 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 6517588db..0789f1486 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 2e9fdb0d0..019005059 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 a2c8656eb..7b4c21e44 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 5a3e8a796..eaad53fc1 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 a6a662305..c63cdd3c9 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 ddd930f51..ce136610c 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 f9feb379a..3c6d668a3 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 cd7d61fe3..89240a839 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 bf24d98ab..7b459a4a6 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 4adbb03ba..b7ca7fa38 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 91bebc93d..91386f455 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 80bb446ec..63faa7ba9 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 1e9fd14cb..783dca9a4 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 d203e07c5..d28b5da4b 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 a826a78bc..3680493ba 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 c302929dd..7b64c6b83 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 1c9b5bfe9..e8d7f4520 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 b6bf1f7a0..32fa2bb46 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 453b6d018..6c0351117 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 3c8c3140a..89c0e6c95 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 aa82c32a8..29e55ed86 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 07b3c0e77..afcd2e31a 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 0d02169c3..0a23e7b2e 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 26fb7933c..912a001a7 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 13f4051ab..1e8caf238 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 040bd5eff..a22696088 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 ae507d7a5..3d7cd63fe 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 2a59dcda6..22395cda5 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 7ae0ef178..3cce46ec6 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 b8bd9daf0..cf52d2950 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 ef702d827..04e49d976 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 d29543ad2..a3e7173d3 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 2599489cd..05aa1217e 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 f1b97ea4d..5dce8f7de 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 b0332d29a..6722c9ead 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 639808508..3797fc2c9 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 0437c714d..24719a412 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 4a96d2190..169d4218a 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 b38d9bd04..7287828ac 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 93f2c4cb4..5a005298f 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 7ab8cace9..a35bba949 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 fd9880407..27f043a06 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 2d579cfe0..db5972dae 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 432de0fce..aea44893a 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 9ac867c39..fad12af84 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 931bac9a5..ca3d375c0 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 c735b2d7d..b67feef61 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 0e12e2b9b..2b6924f41 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), |