aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-11-07 14:00:43 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-11-07 14:50:31 +0900
commitd39bbc149113da5d842f30d046dc04302e54275b (patch)
treebf4fb87d6af59bfd2720a15293362a64ad7f3815
parentelm: Don't do anything before construction (diff)
downloadefl-d39bbc149113da5d842f30d046dc04302e54275b.tar.gz
elm: Create legacy widgets with elm_legacy_add
This will be used to solve issues around style_set: if the widget is legacy or pure eo we may need to select a different style. So in the constructor we need to know whether we are legacy or eo. Note that calling style_set in finalize only is too late as we would lose information such as efl_text_set() called inside efl_add().
-rw-r--r--src/lib/elementary/efl_ui_bg.c2
-rw-r--r--src/lib/elementary/efl_ui_button.c2
-rw-r--r--src/lib/elementary/efl_ui_check.c2
-rw-r--r--src/lib/elementary/efl_ui_flip.c2
-rw-r--r--src/lib/elementary/efl_ui_frame.c2
-rw-r--r--src/lib/elementary/efl_ui_image.c2
-rw-r--r--src/lib/elementary/efl_ui_image_zoomable.c2
-rw-r--r--src/lib/elementary/efl_ui_layout.c2
-rw-r--r--src/lib/elementary/efl_ui_multibuttonentry.c2
-rw-r--r--src/lib/elementary/efl_ui_panes.c2
-rw-r--r--src/lib/elementary/efl_ui_progressbar.c2
-rw-r--r--src/lib/elementary/efl_ui_radio.c2
-rw-r--r--src/lib/elementary/efl_ui_slider.c2
-rw-r--r--src/lib/elementary/efl_ui_video.c2
-rw-r--r--src/lib/elementary/efl_ui_win.c44
-rw-r--r--src/lib/elementary/elc_combobox.c27
-rw-r--r--src/lib/elementary/elc_ctxpopup.c2
-rw-r--r--src/lib/elementary/elc_fileselector.c2
-rw-r--r--src/lib/elementary/elc_fileselector_button.c2
-rw-r--r--src/lib/elementary/elc_fileselector_entry.c2
-rw-r--r--src/lib/elementary/elc_hoversel.c2
-rw-r--r--src/lib/elementary/elc_naviframe.c2
-rw-r--r--src/lib/elementary/elc_player.c2
-rw-r--r--src/lib/elementary/elc_popup.c2
-rw-r--r--src/lib/elementary/elm_access.c2
-rw-r--r--src/lib/elementary/elm_actionslider.c2
-rw-r--r--src/lib/elementary/elm_box.c2
-rw-r--r--src/lib/elementary/elm_bubble.c2
-rw-r--r--src/lib/elementary/elm_calendar.c2
-rw-r--r--src/lib/elementary/elm_clock.c2
-rw-r--r--src/lib/elementary/elm_code_widget.c3
-rw-r--r--src/lib/elementary/elm_colorselector.c17
-rw-r--r--src/lib/elementary/elm_conform.c2
-rw-r--r--src/lib/elementary/elm_datetime.c2
-rw-r--r--src/lib/elementary/elm_dayselector.c2
-rw-r--r--src/lib/elementary/elm_diskselector.c2
-rw-r--r--src/lib/elementary/elm_entry.c2
-rw-r--r--src/lib/elementary/elm_flipselector.c2
-rw-r--r--src/lib/elementary/elm_gengrid.c2
-rw-r--r--src/lib/elementary/elm_genlist.c2
-rw-r--r--src/lib/elementary/elm_gesture_layer.c2
-rw-r--r--src/lib/elementary/elm_glview.c10
-rw-r--r--src/lib/elementary/elm_grid.c2
-rw-r--r--src/lib/elementary/elm_hover.c2
-rw-r--r--src/lib/elementary/elm_icon.c2
-rw-r--r--src/lib/elementary/elm_index.c2
-rw-r--r--src/lib/elementary/elm_interface_scrollable.c2
-rw-r--r--src/lib/elementary/elm_inwin.c2
-rw-r--r--src/lib/elementary/elm_label.c2
-rw-r--r--src/lib/elementary/elm_list.c2
-rw-r--r--src/lib/elementary/elm_map.c2
-rw-r--r--src/lib/elementary/elm_mapbuf.c2
-rw-r--r--src/lib/elementary/elm_menu.c2
-rw-r--r--src/lib/elementary/elm_notify.c2
-rw-r--r--src/lib/elementary/elm_panel.c2
-rw-r--r--src/lib/elementary/elm_photo.c2
-rw-r--r--src/lib/elementary/elm_plug.c2
-rw-r--r--src/lib/elementary/elm_prefs.c2
-rw-r--r--src/lib/elementary/elm_route.c2
-rw-r--r--src/lib/elementary/elm_scroller.c2
-rw-r--r--src/lib/elementary/elm_segment_control.c2
-rw-r--r--src/lib/elementary/elm_separator.c2
-rw-r--r--src/lib/elementary/elm_slideshow.c2
-rw-r--r--src/lib/elementary/elm_spinner.c2
-rw-r--r--src/lib/elementary/elm_table.c2
-rw-r--r--src/lib/elementary/elm_thumb.c2
-rw-r--r--src/lib/elementary/elm_toolbar.c2
-rw-r--r--src/lib/elementary/elm_web2.c2
-rw-r--r--src/lib/elementary/elm_widget.c7
-rw-r--r--src/lib/elementary/elm_widget.h12
70 files changed, 126 insertions, 120 deletions
diff --git a/src/lib/elementary/efl_ui_bg.c b/src/lib/elementary/efl_ui_bg.c
index 7bb9e8bd9b..73dcdaeae0 100644
--- a/src/lib/elementary/efl_ui_bg.c
+++ b/src/lib/elementary/efl_ui_bg.c
@@ -114,7 +114,7 @@ EAPI Evas_Object *
elm_bg_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/efl_ui_button.c b/src/lib/elementary/efl_ui_button.c
index 45762380f0..d044b4c3ca 100644
--- a/src/lib/elementary/efl_ui_button.c
+++ b/src/lib/elementary/efl_ui_button.c
@@ -300,7 +300,7 @@ EAPI Evas_Object *
elm_button_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/efl_ui_check.c b/src/lib/elementary/efl_ui_check.c
index 6a23310d92..836cc3a83c 100644
--- a/src/lib/elementary/efl_ui_check.c
+++ b/src/lib/elementary/efl_ui_check.c
@@ -314,7 +314,7 @@ EAPI Evas_Object *
elm_check_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/efl_ui_flip.c b/src/lib/elementary/efl_ui_flip.c
index cdaebad612..c001567b5d 100644
--- a/src/lib/elementary/efl_ui_flip.c
+++ b/src/lib/elementary/efl_ui_flip.c
@@ -1866,7 +1866,7 @@ EAPI Evas_Object *
elm_flip_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/efl_ui_frame.c b/src/lib/elementary/efl_ui_frame.c
index 187b14f784..2ca12ad428 100644
--- a/src/lib/elementary/efl_ui_frame.c
+++ b/src/lib/elementary/efl_ui_frame.c
@@ -139,7 +139,7 @@ EAPI Evas_Object *
elm_frame_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/efl_ui_image.c b/src/lib/elementary/efl_ui_image.c
index 871a268014..d87b4be2b0 100644
--- a/src/lib/elementary/efl_ui_image.c
+++ b/src/lib/elementary/efl_ui_image.c
@@ -850,7 +850,7 @@ EAPI Evas_Object *
elm_image_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- Evas_Object *obj = efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ Evas_Object *obj = elm_legacy_add(MY_CLASS, parent);
EFL_UI_IMAGE_DATA_GET(obj, priv);
efl_event_callback_add(obj, EFL_GFX_EVENT_CHANGE_SIZE_HINTS, _on_size_hints_changed, priv);
diff --git a/src/lib/elementary/efl_ui_image_zoomable.c b/src/lib/elementary/efl_ui_image_zoomable.c
index 84f348a6a2..dc2a5ba2df 100644
--- a/src/lib/elementary/efl_ui_image_zoomable.c
+++ b/src/lib/elementary/efl_ui_image_zoomable.c
@@ -2717,7 +2717,7 @@ EAPI Evas_Object *
elm_photocam_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
static inline void
diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c
index f61d72b96d..e82ef5f19c 100644
--- a/src/lib/elementary/efl_ui_layout.c
+++ b/src/lib/elementary/efl_ui_layout.c
@@ -2050,7 +2050,7 @@ EAPI Evas_Object *
elm_layout_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/efl_ui_multibuttonentry.c b/src/lib/elementary/efl_ui_multibuttonentry.c
index ee019f4ac8..cb489ac4eb 100644
--- a/src/lib/elementary/efl_ui_multibuttonentry.c
+++ b/src/lib/elementary/efl_ui_multibuttonentry.c
@@ -1713,7 +1713,7 @@ EAPI Evas_Object *
elm_multibuttonentry_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
static void
diff --git a/src/lib/elementary/efl_ui_panes.c b/src/lib/elementary/efl_ui_panes.c
index dea1363cd5..9c46cab040 100644
--- a/src/lib/elementary/efl_ui_panes.c
+++ b/src/lib/elementary/efl_ui_panes.c
@@ -578,7 +578,7 @@ EAPI Evas_Object *
elm_panes_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EAPI void
diff --git a/src/lib/elementary/efl_ui_progressbar.c b/src/lib/elementary/efl_ui_progressbar.c
index 461869c7d5..67b98b12e6 100644
--- a/src/lib/elementary/efl_ui_progressbar.c
+++ b/src/lib/elementary/efl_ui_progressbar.c
@@ -575,7 +575,7 @@ EAPI Evas_Object *
elm_progressbar_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- Eo *obj = efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ Eo *obj = elm_legacy_add(MY_CLASS, parent);
elm_progressbar_unit_format_set(obj, "%.0f %%");
return obj;
diff --git a/src/lib/elementary/efl_ui_radio.c b/src/lib/elementary/efl_ui_radio.c
index 89d0578066..3281fecaa9 100644
--- a/src/lib/elementary/efl_ui_radio.c
+++ b/src/lib/elementary/efl_ui_radio.c
@@ -384,7 +384,7 @@ EAPI Evas_Object *
elm_radio_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EAPI void
diff --git a/src/lib/elementary/efl_ui_slider.c b/src/lib/elementary/efl_ui_slider.c
index 2fc9689248..919e0b7315 100644
--- a/src/lib/elementary/efl_ui_slider.c
+++ b/src/lib/elementary/efl_ui_slider.c
@@ -1483,7 +1483,7 @@ EAPI Evas_Object *
elm_slider_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EAPI void
diff --git a/src/lib/elementary/efl_ui_video.c b/src/lib/elementary/efl_ui_video.c
index 486b13da08..3895b1c520 100644
--- a/src/lib/elementary/efl_ui_video.c
+++ b/src/lib/elementary/efl_ui_video.c
@@ -256,7 +256,7 @@ EAPI Evas_Object *
elm_video_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 87e7e9624d..1b7ad802e0 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -5342,13 +5342,6 @@ _efl_ui_win_efl_object_finalize(Eo *obj, Efl_Ui_Win_Data *sd)
return obj;
}
-EOLIAN static void
-_efl_ui_win_efl_canvas_object_legacy_ctor(Eo *obj, Efl_Ui_Win_Data *sd)
-{
- sd->legacy.ctor = EINA_TRUE;
- efl_canvas_object_legacy_ctor(efl_super(obj, MY_CLASS));
-}
-
EOLIAN static Efl_Ui_Focus_Manager*
_efl_ui_win_elm_widget_focus_manager_create(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd EINA_UNUSED, Efl_Ui_Focus_Object *root)
{
@@ -8089,20 +8082,18 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
default: break;
}
- return efl_add(klass, parent,
- efl_canvas_object_legacy_ctor(efl_added),
- efl_ui_win_name_set(efl_added, name),
- efl_ui_win_type_set(efl_added, type));
+ return elm_legacy_add(klass, parent,
+ efl_ui_win_name_set(efl_added, name),
+ efl_ui_win_type_set(efl_added, type));
}
EAPI Evas_Object *
elm_win_fake_add(Ecore_Evas *ee)
{
- return efl_add(MY_CLASS, NULL,
- efl_canvas_object_legacy_ctor(efl_added),
- _fake_canvas_set(efl_added, ee),
- efl_ui_win_name_set(efl_added, NULL),
- efl_ui_win_type_set(efl_added, ELM_WIN_FAKE));
+ return elm_legacy_add(MY_CLASS, NULL,
+ _fake_canvas_set(efl_added, ee),
+ efl_ui_win_name_set(efl_added, NULL),
+ efl_ui_win_type_set(efl_added, ELM_WIN_FAKE));
}
EAPI Evas_Object *
@@ -8110,11 +8101,10 @@ elm_win_util_standard_add(const char *name, const char *title)
{
Evas_Object *win;
- win = efl_add(EFL_UI_WIN_CLASS, NULL,
- efl_canvas_object_legacy_ctor(efl_added),
- efl_text_set(efl_added, title),
- efl_ui_win_name_set(efl_added, name),
- efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC));
+ win = elm_legacy_add(EFL_UI_WIN_CLASS, NULL,
+ efl_text_set(efl_added, title),
+ efl_ui_win_name_set(efl_added, name),
+ efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC));
if (!win) return NULL;
_elm_win_standard_init(win);
@@ -8126,11 +8116,10 @@ elm_win_util_dialog_add(Evas_Object *parent, const char *name, const char *title
{
Evas_Object *win;
- win = efl_add(EFL_UI_WIN_CLASS, parent,
- efl_canvas_object_legacy_ctor(efl_added),
- efl_text_set(efl_added, title),
- efl_ui_win_name_set(efl_added, name),
- efl_ui_win_type_set(efl_added, EFL_UI_WIN_DIALOG_BASIC));
+ win = elm_legacy_add(EFL_UI_WIN_CLASS, parent,
+ efl_text_set(efl_added, title),
+ efl_ui_win_name_set(efl_added, name),
+ efl_ui_win_type_set(efl_added, EFL_UI_WIN_DIALOG_BASIC));
if (!win) return NULL;
_elm_win_standard_init(win);
@@ -8427,7 +8416,6 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_win, Efl_Ui_Win_Data)
#define EFL_UI_WIN_EXTRA_OPS \
EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_win), \
- ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_win), \
- EFL_OBJECT_OP_FUNC(efl_canvas_object_legacy_ctor, _efl_ui_win_efl_canvas_object_legacy_ctor)
+ ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_win)
#include "efl_ui_win.eo.c"
diff --git a/src/lib/elementary/elc_combobox.c b/src/lib/elementary/elc_combobox.c
index a7b9e5a375..11b4156833 100644
--- a/src/lib/elementary/elc_combobox.c
+++ b/src/lib/elementary/elc_combobox.c
@@ -337,16 +337,7 @@ EAPI Evas_Object *
elm_combobox_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
-}
-
-static inline void
-_hover_ctor(Eo *parent, Eo *hover)
-{
- ELM_WIDGET_DATA_GET_OR_RETURN(parent, wd);
- if (wd->legacy)
- efl_canvas_object_legacy_ctor(hover);
- efl_gfx_visible_set(hover, EINA_FALSE);
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
@@ -370,9 +361,19 @@ _elm_combobox_efl_object_constructor(Eo *obj, Elm_Combobox_Data *sd)
snprintf(buf, sizeof(buf), "combobox_vertical/%s", elm_widget_style_get(obj));
//hover
- sd->hover = efl_add(ELM_HOVER_CLASS, sd->hover_parent,
- _hover_ctor(obj, efl_added),
- efl_ui_widget_style_set(efl_added, buf));
+ if (elm_widget_is_legacy(obj))
+ {
+ sd->hover = elm_legacy_add(ELM_HOVER_CLASS, sd->hover_parent,
+ efl_gfx_visible_set(efl_added, EINA_FALSE),
+ efl_ui_widget_style_set(efl_added, buf));
+ }
+ else
+ {
+ sd->hover = efl_add(ELM_HOVER_CLASS, sd->hover_parent,
+ efl_gfx_visible_set(efl_added, EINA_FALSE),
+ efl_ui_widget_style_set(efl_added, buf));
+ }
+
evas_object_layer_set(sd->hover, EVAS_LAYER_MAX);
efl_ui_mirrored_automatic_set(sd->hover, EINA_FALSE);
elm_hover_target_set(sd->hover, obj);
diff --git a/src/lib/elementary/elc_ctxpopup.c b/src/lib/elementary/elc_ctxpopup.c
index c392d8fcc7..bbe9132871 100644
--- a/src/lib/elementary/elc_ctxpopup.c
+++ b/src/lib/elementary/elc_ctxpopup.c
@@ -1110,7 +1110,7 @@ EAPI Evas_Object *
elm_ctxpopup_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- Evas_Object *obj = efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ Evas_Object *obj = elm_legacy_add(MY_CLASS, parent);
/* access: parent could be any object such as elm_list which does
not know elc_ctxpopup as its child object in the focus_next(); */
diff --git a/src/lib/elementary/elc_fileselector.c b/src/lib/elementary/elc_fileselector.c
index a9b8d41879..3df9845f1c 100644
--- a/src/lib/elementary/elc_fileselector.c
+++ b/src/lib/elementary/elc_fileselector.c
@@ -2043,7 +2043,7 @@ EAPI Evas_Object *
elm_fileselector_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elc_fileselector_button.c b/src/lib/elementary/elc_fileselector_button.c
index ef4cd0012a..52b7789e16 100644
--- a/src/lib/elementary/elc_fileselector_button.c
+++ b/src/lib/elementary/elc_fileselector_button.c
@@ -262,7 +262,7 @@ EAPI Evas_Object *
elm_fileselector_button_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elc_fileselector_entry.c b/src/lib/elementary/elc_fileselector_entry.c
index d752e49ea1..048be2923c 100644
--- a/src/lib/elementary/elc_fileselector_entry.c
+++ b/src/lib/elementary/elc_fileselector_entry.c
@@ -331,7 +331,7 @@ EAPI Evas_Object *
elm_fileselector_entry_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elc_hoversel.c b/src/lib/elementary/elc_hoversel.c
index a81212ccbe..e5cf4fffbc 100644
--- a/src/lib/elementary/elc_hoversel.c
+++ b/src/lib/elementary/elc_hoversel.c
@@ -685,7 +685,7 @@ EAPI Evas_Object *
elm_hoversel_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elc_naviframe.c b/src/lib/elementary/elc_naviframe.c
index a56c0cfed4..97d963e674 100644
--- a/src/lib/elementary/elc_naviframe.c
+++ b/src/lib/elementary/elc_naviframe.c
@@ -1581,7 +1581,7 @@ EAPI Evas_Object *
elm_naviframe_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elc_player.c b/src/lib/elementary/elc_player.c
index 27645a95b6..7249bb6ae4 100644
--- a/src/lib/elementary/elc_player.c
+++ b/src/lib/elementary/elc_player.c
@@ -658,7 +658,7 @@ EAPI Evas_Object *
elm_player_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elc_popup.c b/src/lib/elementary/elc_popup.c
index fc4f6a4a08..3a2f2213c1 100644
--- a/src/lib/elementary/elc_popup.c
+++ b/src/lib/elementary/elc_popup.c
@@ -1515,7 +1515,7 @@ EAPI Evas_Object *
elm_popup_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- Evas_Object *obj = efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ Evas_Object *obj = elm_legacy_add(MY_CLASS, parent);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
wd->highlight_root = EINA_TRUE;
diff --git a/src/lib/elementary/elm_access.c b/src/lib/elementary/elm_access.c
index fd953d15d2..47c45a753d 100644
--- a/src/lib/elementary/elm_access.c
+++ b/src/lib/elementary/elm_access.c
@@ -1260,7 +1260,7 @@ static Evas_Object *
_elm_access_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_actionslider.c b/src/lib/elementary/elm_actionslider.c
index f7ea01126a..1fdbf2992d 100644
--- a/src/lib/elementary/elm_actionslider.c
+++ b/src/lib/elementary/elm_actionslider.c
@@ -539,7 +539,7 @@ EAPI Evas_Object *
elm_actionslider_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_box.c b/src/lib/elementary/elm_box.c
index b59705d861..6b4a8868d7 100644
--- a/src/lib/elementary/elm_box.c
+++ b/src/lib/elementary/elm_box.c
@@ -366,7 +366,7 @@ EAPI Evas_Object *
elm_box_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_bubble.c b/src/lib/elementary/elm_bubble.c
index 915bf433a2..b46018a47b 100644
--- a/src/lib/elementary/elm_bubble.c
+++ b/src/lib/elementary/elm_bubble.c
@@ -187,7 +187,7 @@ EAPI Evas_Object *
elm_bubble_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_calendar.c b/src/lib/elementary/elm_calendar.c
index 5155389c6d..e236bdc56a 100644
--- a/src/lib/elementary/elm_calendar.c
+++ b/src/lib/elementary/elm_calendar.c
@@ -1602,7 +1602,7 @@ EAPI Evas_Object *
elm_calendar_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_clock.c b/src/lib/elementary/elm_clock.c
index 4a2f5288bd..757363d5fa 100644
--- a/src/lib/elementary/elm_clock.c
+++ b/src/lib/elementary/elm_clock.c
@@ -775,7 +775,7 @@ EAPI Evas_Object *
elm_clock_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_code_widget.c b/src/lib/elementary/elm_code_widget.c
index 175bc86ce4..1ce0ffa99c 100644
--- a/src/lib/elementary/elm_code_widget.c
+++ b/src/lib/elementary/elm_code_widget.c
@@ -61,8 +61,7 @@ EAPI Evas_Object *
elm_code_widget_add(Evas_Object *parent, Elm_Code *code)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, elm_obj_code_widget_code_set(efl_added, code),
- efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent, elm_obj_code_widget_code_set(efl_added, code));
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_colorselector.c b/src/lib/elementary/elm_colorselector.c
index 710c3378f4..e96ea0ac4b 100644
--- a/src/lib/elementary/elm_colorselector.c
+++ b/src/lib/elementary/elm_colorselector.c
@@ -1882,9 +1882,8 @@ _palette_colors_load(Evas_Object *obj)
}
static inline void
-_palette_box_prepare(Eo *o, Eina_Bool legacy)
+_palette_box_prepare(Eo *o)
{
- if (legacy) efl_canvas_object_legacy_ctor(o);
efl_ui_direction_set(o, EFL_UI_DIR_HORIZONTAL);
efl_gfx_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
efl_gfx_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
@@ -1903,8 +1902,16 @@ _create_colorpalette(Evas_Object *obj)
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
if (sd->palette_box) return;
- sd->palette_box = efl_add(EFL_UI_BOX_FLOW_CLASS, obj,
- _palette_box_prepare(efl_added, wd->legacy));
+ if (elm_widget_is_legacy(obj))
+ {
+ sd->palette_box = elm_legacy_add(EFL_UI_BOX_FLOW_CLASS, obj,
+ _palette_box_prepare(efl_added));
+ }
+ else
+ {
+ sd->palette_box = efl_add(EFL_UI_BOX_FLOW_CLASS, obj,
+ _palette_box_prepare(efl_added));
+ }
hpadstr = edje_object_data_get(wd->resize_obj, "horizontal_pad");
if (hpadstr) h_pad = atoi(hpadstr);
@@ -2259,7 +2266,7 @@ EAPI Evas_Object *
elm_colorselector_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_conform.c b/src/lib/elementary/elm_conform.c
index 4e88196bd4..55f04de82a 100644
--- a/src/lib/elementary/elm_conform.c
+++ b/src/lib/elementary/elm_conform.c
@@ -992,7 +992,7 @@ EAPI Evas_Object *
elm_conformant_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_datetime.c b/src/lib/elementary/elm_datetime.c
index 6c9f34d652..fc68f87525 100644
--- a/src/lib/elementary/elm_datetime.c
+++ b/src/lib/elementary/elm_datetime.c
@@ -21,7 +21,7 @@ EAPI Evas_Object *
elm_datetime_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(EFL_UI_CLOCK_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(EFL_UI_CLOCK_CLASS, parent);
}
EAPI void
diff --git a/src/lib/elementary/elm_dayselector.c b/src/lib/elementary/elm_dayselector.c
index ebd038fcf4..68b8dd8066 100644
--- a/src/lib/elementary/elm_dayselector.c
+++ b/src/lib/elementary/elm_dayselector.c
@@ -447,7 +447,7 @@ EAPI Evas_Object *
elm_dayselector_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_diskselector.c b/src/lib/elementary/elm_diskselector.c
index ee877334e0..fe27ed72d9 100644
--- a/src/lib/elementary/elm_diskselector.c
+++ b/src/lib/elementary/elm_diskselector.c
@@ -1407,7 +1407,7 @@ EAPI Evas_Object *
elm_diskselector_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_entry.c b/src/lib/elementary/elm_entry.c
index da8782a3ed..c6018fca3c 100644
--- a/src/lib/elementary/elm_entry.c
+++ b/src/lib/elementary/elm_entry.c
@@ -4005,7 +4005,7 @@ EAPI Evas_Object *
elm_entry_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
static void
diff --git a/src/lib/elementary/elm_flipselector.c b/src/lib/elementary/elm_flipselector.c
index bce73f9b00..cb078c6214 100644
--- a/src/lib/elementary/elm_flipselector.c
+++ b/src/lib/elementary/elm_flipselector.c
@@ -654,7 +654,7 @@ EAPI Evas_Object *
elm_flipselector_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EAPI void
diff --git a/src/lib/elementary/elm_gengrid.c b/src/lib/elementary/elm_gengrid.c
index 42ab62b5fb..6923a0b5ec 100644
--- a/src/lib/elementary/elm_gengrid.c
+++ b/src/lib/elementary/elm_gengrid.c
@@ -4231,7 +4231,7 @@ EAPI Evas_Object *
elm_gengrid_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
static void
diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c
index 8edbe023a8..6c77edff13 100644
--- a/src/lib/elementary/elm_genlist.c
+++ b/src/lib/elementary/elm_genlist.c
@@ -5783,7 +5783,7 @@ EAPI Evas_Object *
elm_genlist_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_gesture_layer.c b/src/lib/elementary/elm_gesture_layer.c
index ef286049b8..d64ff5827a 100644
--- a/src/lib/elementary/elm_gesture_layer.c
+++ b/src/lib/elementary/elm_gesture_layer.c
@@ -3834,7 +3834,7 @@ EAPI Evas_Object *
elm_gesture_layer_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_glview.c b/src/lib/elementary/elm_glview.c
index 5424eb4437..d1a96f5269 100644
--- a/src/lib/elementary/elm_glview.c
+++ b/src/lib/elementary/elm_glview.c
@@ -339,18 +339,16 @@ EAPI Evas_Object *
elm_glview_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent,
- elm_obj_glview_version_constructor(efl_added, EVAS_GL_GLES_2_X),
- efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent,
+ elm_obj_glview_version_constructor(efl_added, EVAS_GL_GLES_2_X));
}
EAPI Evas_Object *
elm_glview_version_add(Evas_Object *parent, Evas_GL_Context_Version version)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent,
- elm_obj_glview_version_constructor(efl_added, version),
- efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent,
+ elm_obj_glview_version_constructor(efl_added, version));
}
EOLIAN static void
diff --git a/src/lib/elementary/elm_grid.c b/src/lib/elementary/elm_grid.c
index bdfb4a56d7..f189a7ddcf 100644
--- a/src/lib/elementary/elm_grid.c
+++ b/src/lib/elementary/elm_grid.c
@@ -90,7 +90,7 @@ EAPI Evas_Object *
elm_grid_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_hover.c b/src/lib/elementary/elm_hover.c
index 696a080bd6..d87df91638 100644
--- a/src/lib/elementary/elm_hover.c
+++ b/src/lib/elementary/elm_hover.c
@@ -695,7 +695,7 @@ EAPI Evas_Object *
elm_hover_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_icon.c b/src/lib/elementary/elm_icon.c
index 3515c424c2..5fdc294776 100644
--- a/src/lib/elementary/elm_icon.c
+++ b/src/lib/elementary/elm_icon.c
@@ -604,7 +604,7 @@ EAPI Evas_Object *
elm_icon_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_index.c b/src/lib/elementary/elm_index.c
index 72b8793838..91fb2e37d5 100644
--- a/src/lib/elementary/elm_index.c
+++ b/src/lib/elementary/elm_index.c
@@ -1189,7 +1189,7 @@ EAPI Evas_Object *
elm_index_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EAPI void elm_index_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
diff --git a/src/lib/elementary/elm_interface_scrollable.c b/src/lib/elementary/elm_interface_scrollable.c
index 522deba236..8f1371f027 100644
--- a/src/lib/elementary/elm_interface_scrollable.c
+++ b/src/lib/elementary/elm_interface_scrollable.c
@@ -192,7 +192,7 @@ _elm_pan_content_size_get(Eo *obj EINA_UNUSED, Elm_Pan_Smart_Data *psd, Evas_Coo
static Evas_Object *
_elm_pan_add(Evas *evas)
{
- return efl_add(MY_PAN_CLASS, evas, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_PAN_CLASS, evas);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_inwin.c b/src/lib/elementary/elm_inwin.c
index 76becb4b75..7e7cb8abb4 100644
--- a/src/lib/elementary/elm_inwin.c
+++ b/src/lib/elementary/elm_inwin.c
@@ -74,7 +74,7 @@ EAPI Evas_Object *
elm_win_inwin_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_label.c b/src/lib/elementary/elm_label.c
index b9b98875c8..8d493348ce 100644
--- a/src/lib/elementary/elm_label.c
+++ b/src/lib/elementary/elm_label.c
@@ -417,7 +417,7 @@ EAPI Evas_Object *
elm_label_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_list.c b/src/lib/elementary/elm_list.c
index e343c06844..47f63dfe88 100644
--- a/src/lib/elementary/elm_list.c
+++ b/src/lib/elementary/elm_list.c
@@ -2505,7 +2505,7 @@ EAPI Evas_Object *
elm_list_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_map.c b/src/lib/elementary/elm_map.c
index 5093e9db0e..5c2e68d957 100644
--- a/src/lib/elementary/elm_map.c
+++ b/src/lib/elementary/elm_map.c
@@ -4284,7 +4284,7 @@ EAPI Evas_Object *
elm_map_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_mapbuf.c b/src/lib/elementary/elm_mapbuf.c
index 98fa8389cf..f6886a60a7 100644
--- a/src/lib/elementary/elm_mapbuf.c
+++ b/src/lib/elementary/elm_mapbuf.c
@@ -309,7 +309,7 @@ EAPI Evas_Object *
elm_mapbuf_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_menu.c b/src/lib/elementary/elm_menu.c
index 7cffe95344..cb34abbb65 100644
--- a/src/lib/elementary/elm_menu.c
+++ b/src/lib/elementary/elm_menu.c
@@ -800,7 +800,7 @@ EAPI Evas_Object *
elm_menu_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Efl_Ui_Focus_Manager*
diff --git a/src/lib/elementary/elm_notify.c b/src/lib/elementary/elm_notify.c
index 7a80d83663..afffc90231 100644
--- a/src/lib/elementary/elm_notify.c
+++ b/src/lib/elementary/elm_notify.c
@@ -471,7 +471,7 @@ EAPI Evas_Object *
elm_notify_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_panel.c b/src/lib/elementary/elm_panel.c
index d6d59ee327..b7d4bcd79a 100644
--- a/src/lib/elementary/elm_panel.c
+++ b/src/lib/elementary/elm_panel.c
@@ -955,7 +955,7 @@ EAPI Evas_Object *
elm_panel_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- Evas_Object *obj = efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ Evas_Object *obj = elm_legacy_add(MY_CLASS, parent);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
wd->highlight_root = EINA_TRUE;
diff --git a/src/lib/elementary/elm_photo.c b/src/lib/elementary/elm_photo.c
index 47b7756b5e..151dc26eca 100644
--- a/src/lib/elementary/elm_photo.c
+++ b/src/lib/elementary/elm_photo.c
@@ -297,7 +297,7 @@ EAPI Evas_Object *
elm_photo_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_plug.c b/src/lib/elementary/elm_plug.c
index de55ef3f5b..9fe640654e 100644
--- a/src/lib/elementary/elm_plug.c
+++ b/src/lib/elementary/elm_plug.c
@@ -136,7 +136,7 @@ EAPI Evas_Object *
elm_plug_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_prefs.c b/src/lib/elementary/elm_prefs.c
index f5bb2898cd..0077789ef3 100644
--- a/src/lib/elementary/elm_prefs.c
+++ b/src/lib/elementary/elm_prefs.c
@@ -483,7 +483,7 @@ elm_prefs_add(Evas_Object *parent)
return NULL;
}
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_route.c b/src/lib/elementary/elm_route.c
index 4a0377591c..ba4f64e15f 100644
--- a/src/lib/elementary/elm_route.c
+++ b/src/lib/elementary/elm_route.c
@@ -178,7 +178,7 @@ EAPI Evas_Object *
elm_route_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_scroller.c b/src/lib/elementary/elm_scroller.c
index 9fe6f14565..7198593110 100644
--- a/src/lib/elementary/elm_scroller.c
+++ b/src/lib/elementary/elm_scroller.c
@@ -849,7 +849,7 @@ EAPI Evas_Object *
elm_scroller_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
static void
diff --git a/src/lib/elementary/elm_segment_control.c b/src/lib/elementary/elm_segment_control.c
index de995b4169..600219f74f 100644
--- a/src/lib/elementary/elm_segment_control.c
+++ b/src/lib/elementary/elm_segment_control.c
@@ -672,7 +672,7 @@ EAPI Evas_Object *
elm_segment_control_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_separator.c b/src/lib/elementary/elm_separator.c
index 3301445cd9..e720f4e410 100644
--- a/src/lib/elementary/elm_separator.c
+++ b/src/lib/elementary/elm_separator.c
@@ -63,7 +63,7 @@ EAPI Evas_Object *
elm_separator_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_slideshow.c b/src/lib/elementary/elm_slideshow.c
index af57fa505c..b37cba64d8 100644
--- a/src/lib/elementary/elm_slideshow.c
+++ b/src/lib/elementary/elm_slideshow.c
@@ -367,7 +367,7 @@ EAPI Evas_Object *
elm_slideshow_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_spinner.c b/src/lib/elementary/elm_spinner.c
index ac41e98a6f..cad50767d7 100644
--- a/src/lib/elementary/elm_spinner.c
+++ b/src/lib/elementary/elm_spinner.c
@@ -1353,7 +1353,7 @@ EAPI Evas_Object *
elm_spinner_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EAPI void
diff --git a/src/lib/elementary/elm_table.c b/src/lib/elementary/elm_table.c
index cd6c193c68..ca3de608a5 100644
--- a/src/lib/elementary/elm_table.c
+++ b/src/lib/elementary/elm_table.c
@@ -129,7 +129,7 @@ EAPI Evas_Object *
elm_table_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_thumb.c b/src/lib/elementary/elm_thumb.c
index 68202c64cf..4dfb1dfe27 100644
--- a/src/lib/elementary/elm_thumb.c
+++ b/src/lib/elementary/elm_thumb.c
@@ -579,7 +579,7 @@ EAPI Evas_Object *
elm_thumb_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_toolbar.c b/src/lib/elementary/elm_toolbar.c
index 64a37065f3..6df060fc41 100644
--- a/src/lib/elementary/elm_toolbar.c
+++ b/src/lib/elementary/elm_toolbar.c
@@ -2948,7 +2948,7 @@ EAPI Evas_Object *
elm_toolbar_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(MY_CLASS, parent);
}
EOLIAN static Eina_Bool
diff --git a/src/lib/elementary/elm_web2.c b/src/lib/elementary/elm_web2.c
index e1174976fa..170ae425c7 100644
--- a/src/lib/elementary/elm_web2.c
+++ b/src/lib/elementary/elm_web2.c
@@ -80,7 +80,7 @@ elm_web_add(Evas_Object *parent)
{
if (!parent || !ewm.class_get) return NULL;
- return efl_add(ewm.class_get(), parent, efl_canvas_object_legacy_ctor(efl_added));
+ return elm_legacy_add(ewm.class_get(), parent);
}
EAPI const Efl_Class *
diff --git a/src/lib/elementary/elm_widget.c b/src/lib/elementary/elm_widget.c
index 26ec1563eb..022f1f3aba 100644
--- a/src/lib/elementary/elm_widget.c
+++ b/src/lib/elementary/elm_widget.c
@@ -53,6 +53,8 @@ typedef struct _Elm_Event_Cb_Data Elm_Event_Cb_Data;
typedef struct _Elm_Label_Data Elm_Label_Data;
typedef struct _Elm_Translate_String_Data Elm_Translate_String_Data;
+Eina_Bool _elm_legacy_add = EINA_FALSE;
+
struct _Elm_Event_Cb_Data
{
Elm_Event_Cb func;
@@ -2968,7 +2970,7 @@ elm_widget_theme_get(const Evas_Object *obj)
EOLIAN static Efl_Ui_Theme_Apply
_elm_widget_style_set(Eo *obj, Elm_Widget_Smart_Data *sd, const char *style)
{
- if (!sd->legacy && efl_finalized_get(obj))
+ if (!elm_widget_is_legacy(obj) && efl_finalized_get(obj))
{
ERR("Efl.Ui.Widget.style can only be set before finalize!");
return EFL_UI_THEME_APPLY_FAILED;
@@ -5117,6 +5119,8 @@ _elm_widget_efl_object_constructor(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSE
Eo *parent = NULL;
sd->on_create = EINA_TRUE;
+ sd->legacy = _elm_legacy_add;
+ _elm_legacy_add = EINA_FALSE;
efl_canvas_group_clipped_set(obj, EINA_FALSE);
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
@@ -5170,6 +5174,7 @@ _elm_widget_legacy_ctor(Eo *obj, Elm_Widget_Smart_Data *sd)
{
efl_canvas_object_legacy_ctor(efl_super(obj, MY_CLASS));
sd->legacy = EINA_TRUE;
+ _elm_legacy_add = EINA_FALSE;
}
EOLIAN static void
diff --git a/src/lib/elementary/elm_widget.h b/src/lib/elementary/elm_widget.h
index 82e17bc76d..aa5d11d123 100644
--- a/src/lib/elementary/elm_widget.h
+++ b/src/lib/elementary/elm_widget.h
@@ -809,11 +809,19 @@ _elm_widget_sub_object_redirect_to_top(Evas_Object *obj, Evas_Object *sobj)
return ret;
}
+/* Internal hack to mark legacy objects as such before construction.
+ * No need for TLS: Only UI objects created in the main loop matter. */
+extern Eina_Bool _elm_legacy_add;
+#define elm_legacy_add(k, p, ...) ({ _elm_legacy_add = 1; \
+ efl_add(k, p, efl_canvas_object_legacy_ctor(efl_added), ##__VA_ARGS__); })
+
static inline Eina_Bool
elm_widget_is_legacy(const Eo *obj)
{
- Elm_Widget_Smart_Data *sd = (Elm_Widget_Smart_Data *)
- efl_data_scope_safe_get(obj, ELM_WIDGET_CLASS);
+ Elm_Widget_Smart_Data *sd;
+
+ if (_elm_legacy_add) return EINA_TRUE;
+ sd = (Elm_Widget_Smart_Data *) efl_data_scope_safe_get(obj, ELM_WIDGET_CLASS);
return sd ? sd->legacy : EINA_FALSE;
}