From 864bb0faaa71364b67e6f56f26e6d761061c6c9b Mon Sep 17 00:00:00 2001 From: Sungtaek Hong Date: Wed, 24 Jan 2018 15:50:58 +0900 Subject: [PATCH] efl_ui_legacy: add new interface to indicate legacy widget Summary: For now, how to check whether a widget is legacy or not is to check flags in private data or static flag, which is set during elm_legacy_add. If Efl.Ui.Legacy interface is added, it can be easilly checked by efl_isa(obj, EFL_UI_LEGACY_INTERFACE) Reviewers: woohyun, jpeg, cedric, Jaehyun_Cho Subscribers: conr2d, cedric, jpeg Differential Revision: https://phab.enlightenment.org/D5748 --- src/Makefile_Elementary.am | 19 + src/lib/elementary/efl_ui_bg_widget.c | 82 +- src/lib/elementary/efl_ui_bg_widget.eo | 1 - src/lib/elementary/efl_ui_bg_widget_legacy.eo | 14 + src/lib/elementary/efl_ui_button.c | 42 +- src/lib/elementary/efl_ui_button.eo | 1 - src/lib/elementary/efl_ui_button_legacy.eo | 13 + src/lib/elementary/efl_ui_check.c | 42 +- src/lib/elementary/efl_ui_check.eo | 1 - src/lib/elementary/efl_ui_check_legacy.eo | 15 + src/lib/elementary/efl_ui_clock.c | 8 - src/lib/elementary/efl_ui_clock.eo | 1 - src/lib/elementary/efl_ui_clock_legacy.eo | 9 + src/lib/elementary/efl_ui_flip.c | 42 +- src/lib/elementary/efl_ui_flip.eo | 1 - src/lib/elementary/efl_ui_flip_legacy.eo | 9 + src/lib/elementary/efl_ui_frame.c | 42 +- src/lib/elementary/efl_ui_frame.eo | 1 - src/lib/elementary/efl_ui_frame_legacy.eo | 14 + src/lib/elementary/efl_ui_image.c | 52 +- src/lib/elementary/efl_ui_image.eo | 1 - src/lib/elementary/efl_ui_image_legacy.eo | 9 + src/lib/elementary/efl_ui_image_zoomable.c | 47 +- src/lib/elementary/efl_ui_image_zoomable_legacy.eo | 9 + src/lib/elementary/efl_ui_layout.c | 855 +++++++++++---------- src/lib/elementary/efl_ui_layout.eo | 1 - src/lib/elementary/efl_ui_layout_legacy.eo | 9 + src/lib/elementary/efl_ui_legacy.c | 8 + src/lib/elementary/efl_ui_legacy.eo | 9 + src/lib/elementary/efl_ui_multibuttonentry.c | 39 +- .../elementary/efl_ui_multibuttonentry_legacy.eo | 9 + src/lib/elementary/efl_ui_panes.c | 33 +- src/lib/elementary/efl_ui_panes.eo | 1 - src/lib/elementary/efl_ui_panes_legacy.eo | 9 + src/lib/elementary/efl_ui_progressbar.c | 30 +- src/lib/elementary/efl_ui_progressbar.eo | 1 - src/lib/elementary/efl_ui_progressbar_legacy.eo | 9 + src/lib/elementary/efl_ui_radio.c | 29 +- src/lib/elementary/efl_ui_radio.eo | 1 - src/lib/elementary/efl_ui_radio_legacy.eo | 9 + src/lib/elementary/efl_ui_slider.c | 54 +- src/lib/elementary/efl_ui_slider.eo | 1 - src/lib/elementary/efl_ui_slider_legacy.eo | 9 + src/lib/elementary/efl_ui_video.c | 63 +- src/lib/elementary/efl_ui_video.eo | 1 - src/lib/elementary/efl_ui_video_legacy.eo | 9 + src/lib/elementary/efl_ui_widget.c | 16 - src/lib/elementary/efl_ui_win.c | 239 +++--- src/lib/elementary/efl_ui_win_legacy.eo | 9 + src/lib/elementary/elm_actionslider.eo | 2 +- src/lib/elementary/elm_box.eo | 2 +- src/lib/elementary/elm_bubble.eo | 2 +- src/lib/elementary/elm_calendar.eo | 3 +- src/lib/elementary/elm_clock.eo | 2 +- src/lib/elementary/elm_code.h | 1 + src/lib/elementary/elm_code_diff_widget.c | 4 +- src/lib/elementary/elm_code_widget.c | 9 +- src/lib/elementary/elm_code_widget_legacy.eo | 5 + src/lib/elementary/elm_colorselector.eo | 2 +- src/lib/elementary/elm_combobox.eo | 2 +- src/lib/elementary/elm_conformant.eo | 2 +- src/lib/elementary/elm_ctxpopup.eo | 2 +- src/lib/elementary/elm_ctxpopup_item.eo | 3 +- src/lib/elementary/elm_datetime.c | 22 +- src/lib/elementary/elm_dayselector.eo | 2 +- src/lib/elementary/elm_diskselector.eo | 2 +- src/lib/elementary/elm_diskselector_item.eo | 2 +- src/lib/elementary/elm_entry.eo | 3 +- src/lib/elementary/elm_fileselector.eo | 2 +- src/lib/elementary/elm_fileselector_button.eo | 3 +- src/lib/elementary/elm_fileselector_entry.eo | 2 +- src/lib/elementary/elm_flipselector.eo | 2 +- src/lib/elementary/elm_gengrid.eo | 2 +- src/lib/elementary/elm_gengrid_item.eo | 2 +- src/lib/elementary/elm_genlist.eo | 2 +- src/lib/elementary/elm_genlist_item.eo | 2 +- src/lib/elementary/elm_gesture_layer.eo | 2 +- src/lib/elementary/elm_glview.eo | 2 +- src/lib/elementary/elm_grid.eo | 2 +- src/lib/elementary/elm_hover.eo | 3 +- src/lib/elementary/elm_hoversel.eo | 3 +- src/lib/elementary/elm_hoversel_item.eo | 2 +- src/lib/elementary/elm_icon.eo | 2 +- src/lib/elementary/elm_index.eo | 2 +- src/lib/elementary/elm_index_item.eo | 2 +- src/lib/elementary/elm_interface_scrollable.c | 2 +- src/lib/elementary/elm_interfaces.h | 2 + src/lib/elementary/elm_inwin.eo | 2 +- src/lib/elementary/elm_label.eo | 2 +- src/lib/elementary/elm_list.eo | 2 +- src/lib/elementary/elm_list_item.eo | 2 +- src/lib/elementary/elm_map.eo | 2 +- src/lib/elementary/elm_mapbuf.eo | 2 +- src/lib/elementary/elm_menu.eo | 2 +- src/lib/elementary/elm_menu_item.eo | 2 +- src/lib/elementary/elm_multibuttonentry_item.eo | 3 +- src/lib/elementary/elm_naviframe.eo | 2 +- src/lib/elementary/elm_naviframe_item.eo | 2 +- src/lib/elementary/elm_notify.eo | 2 +- src/lib/elementary/elm_panel.eo | 2 +- src/lib/elementary/elm_photo.eo | 3 +- src/lib/elementary/elm_player.eo | 2 +- src/lib/elementary/elm_plug.eo | 2 +- src/lib/elementary/elm_popup.eo | 2 +- src/lib/elementary/elm_popup_item.eo | 2 +- src/lib/elementary/elm_prefs.eo | 2 +- src/lib/elementary/elm_route.eo | 2 +- src/lib/elementary/elm_scroller.eo | 2 +- src/lib/elementary/elm_segment_control.eo | 2 +- src/lib/elementary/elm_segment_control_item.eo | 2 +- src/lib/elementary/elm_separator.eo | 2 +- src/lib/elementary/elm_slideshow.eo | 2 +- src/lib/elementary/elm_spinner.eo | 2 +- src/lib/elementary/elm_table.eo | 2 +- src/lib/elementary/elm_theme.c | 1 + src/lib/elementary/elm_thumb.eo | 2 +- src/lib/elementary/elm_toolbar.eo | 2 +- src/lib/elementary/elm_toolbar_item.eo | 2 +- src/lib/elementary/elm_web.eo | 2 +- src/lib/elementary/elm_widget.h | 12 +- 120 files changed, 1246 insertions(+), 872 deletions(-) create mode 100644 src/lib/elementary/efl_ui_bg_widget_legacy.eo create mode 100644 src/lib/elementary/efl_ui_button_legacy.eo create mode 100644 src/lib/elementary/efl_ui_check_legacy.eo create mode 100644 src/lib/elementary/efl_ui_clock_legacy.eo create mode 100644 src/lib/elementary/efl_ui_flip_legacy.eo create mode 100644 src/lib/elementary/efl_ui_frame_legacy.eo create mode 100644 src/lib/elementary/efl_ui_image_legacy.eo create mode 100644 src/lib/elementary/efl_ui_image_zoomable_legacy.eo create mode 100644 src/lib/elementary/efl_ui_layout_legacy.eo create mode 100644 src/lib/elementary/efl_ui_legacy.c create mode 100644 src/lib/elementary/efl_ui_legacy.eo create mode 100644 src/lib/elementary/efl_ui_multibuttonentry_legacy.eo create mode 100644 src/lib/elementary/efl_ui_panes_legacy.eo create mode 100644 src/lib/elementary/efl_ui_progressbar_legacy.eo create mode 100644 src/lib/elementary/efl_ui_radio_legacy.eo create mode 100644 src/lib/elementary/efl_ui_slider_legacy.eo create mode 100644 src/lib/elementary/efl_ui_video_legacy.eo create mode 100644 src/lib/elementary/efl_ui_win_legacy.eo create mode 100644 src/lib/elementary/elm_code_widget_legacy.eo diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am index b0e8a72..f850ee5 100644 --- a/src/Makefile_Elementary.am +++ b/src/Makefile_Elementary.am @@ -106,6 +106,7 @@ elm_public_eolian_files = \ # More public files -- FIXME elm_public_eolian_files += \ + lib/elementary/efl_ui_legacy.eo \ lib/elementary/elm_spinner.eo \ lib/elementary/elm_multibuttonentry_item.eo \ lib/elementary/elm_interface_scrollable.eo \ @@ -139,6 +140,23 @@ elm_private_eolian_files = \ # Legacy classes - not part of public EO API elm_legacy_eolian_files = \ + lib/elementary/efl_ui_button_legacy.eo \ + lib/elementary/efl_ui_check_legacy.eo \ + lib/elementary/efl_ui_radio_legacy.eo \ + lib/elementary/efl_ui_bg_widget_legacy.eo \ + lib/elementary/efl_ui_video_legacy.eo \ + lib/elementary/efl_ui_frame_legacy.eo \ + lib/elementary/efl_ui_slider_legacy.eo \ + lib/elementary/efl_ui_panes_legacy.eo \ + lib/elementary/efl_ui_image_zoomable_legacy.eo \ + lib/elementary/efl_ui_multibuttonentry_legacy.eo \ + lib/elementary/efl_ui_flip_legacy.eo \ + lib/elementary/efl_ui_win_legacy.eo \ + lib/elementary/efl_ui_image_legacy.eo \ + lib/elementary/efl_ui_progressbar_legacy.eo \ + lib/elementary/efl_ui_clock_legacy.eo \ + lib/elementary/efl_ui_layout_legacy.eo \ + lib/elementary/elm_code_widget_legacy.eo \ lib/elementary/elm_interface_fileselector.eo \ lib/elementary/elm_calendar.eo \ lib/elementary/elm_calendar_item.eo \ @@ -621,6 +639,7 @@ lib_elementary_libelementary_la_SOURCES = \ lib/elementary/elm_atspi_bridge.c \ lib/elementary/elm_atspi_ewk_wrapper.c \ lib/elementary/elm_atspi_proxy.c \ + lib/elementary/efl_ui_legacy.c \ lib/elementary/efl_ui_bg.c \ lib/elementary/efl_ui_bg_widget.c \ lib/elementary/elm_box.c \ diff --git a/src/lib/elementary/efl_ui_bg_widget.c b/src/lib/elementary/efl_ui_bg_widget.c index d350d24..7c517f1 100644 --- a/src/lib/elementary/efl_ui_bg_widget.c +++ b/src/lib/elementary/efl_ui_bg_widget.c @@ -13,7 +13,6 @@ #define MY_CLASS_PFX efl_ui_bg_widget #define MY_CLASS_NAME "Efl.Ui.Bg_Widget" -#define MY_CLASS_NAME_LEGACY "elm_bg" static const Elm_Layout_Part_Alias_Description _content_aliases[] = { @@ -25,32 +24,6 @@ static const Elm_Layout_Part_Alias_Description _content_aliases[] = static Evas_Object *_precreated_bg_obj = NULL; // -EAPI Evas_Object * -elm_bg_add(Evas_Object *parent) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); -// TIZEN_ONLY(20160218): Improve launching performance. - if (_precreated_bg_obj) - { - Evas_Object *par_obj = elm_widget_parent_get(_precreated_bg_obj); - - if (par_obj == parent) - { - Evas_Object *above_obj = evas_object_above_get(_precreated_bg_obj); - if (above_obj) - evas_object_raise(_precreated_bg_obj); - - Evas_Object *tmp = _precreated_bg_obj; - _precreated_bg_obj = NULL; - INF("Return precreated obj(%p).", tmp); - return tmp; - } - } -// - - return elm_legacy_add(MY_CLASS, parent); -} - EOLIAN static Eo * _efl_ui_bg_widget_efl_object_constructor(Eo *obj, Efl_Ui_Bg_Widget_Data *pd) { @@ -77,7 +50,6 @@ _efl_ui_bg_widget_efl_object_constructor(Eo *obj, Efl_Ui_Bg_Widget_Data *pd) efl_image_scale_type_set(efl_added, EFL_IMAGE_SCALE_TYPE_FIT_OUTSIDE), efl_content_set(efl_part(obj, "elm.swallow.background"), efl_added)); - efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); efl_access_type_set(obj, EFL_ACCESS_TYPE_DISABLED); efl_ui_widget_focus_allow_set(obj, EINA_FALSE); @@ -214,12 +186,6 @@ _efl_ui_bg_widget_efl_image_load_load_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Bg_Wi return efl_image_load_size_get(sd->img); } -static void -_efl_ui_bg_widget_class_constructor(Efl_Class *klass) -{ - evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); -} - EAPI Eina_Bool elm_bg_file_set(Eo *obj, const char *file, const char *group) { @@ -281,3 +247,51 @@ ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(MY_CLASS_PFX) ELM_LAYOUT_CONTENT_ALIASES_OPS(MY_CLASS_PFX) #include "efl_ui_bg_widget.eo.c" + + +#include "efl_ui_bg_widget_legacy.eo.h" + +#define MY_CLASS_NAME_LEGACY "elm_bg" + +static void +_efl_ui_bg_widget_legacy_class_constructor(Efl_Class *klass) +{ + evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); +} + +EOLIAN static Eo * +_efl_ui_bg_widget_legacy_efl_object_constructor(Eo *obj, void *_pd EINA_UNUSED) +{ + obj = efl_constructor(efl_super(obj, EFL_UI_BG_WIDGET_LEGACY_CLASS)); + efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); + + return obj; +} + +EAPI Evas_Object * +elm_bg_add(Evas_Object *parent) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); +// TIZEN_ONLY(20160218): Improve launching performance. + if (_precreated_bg_obj) + { + Evas_Object *par_obj = elm_widget_parent_get(_precreated_bg_obj); + + if (par_obj == parent) + { + Evas_Object *above_obj = evas_object_above_get(_precreated_bg_obj); + if (above_obj) + evas_object_raise(_precreated_bg_obj); + + Evas_Object *tmp = _precreated_bg_obj; + _precreated_bg_obj = NULL; + INF("Return precreated obj(%p).", tmp); + return tmp; + } + } +// + + return elm_legacy_add(EFL_UI_BG_WIDGET_LEGACY_CLASS, parent); +} + +#include "efl_ui_bg_widget_legacy.eo.c" diff --git a/src/lib/elementary/efl_ui_bg_widget.eo b/src/lib/elementary/efl_ui_bg_widget.eo index 96a9424..ef8882d 100644 --- a/src/lib/elementary/efl_ui_bg_widget.eo +++ b/src/lib/elementary/efl_ui_bg_widget.eo @@ -8,7 +8,6 @@ class Efl.Ui.Bg_Widget (Efl.Ui.Layout, Efl.Ui.Bg, Efl.Image.Load) ]] legacy_prefix: elm_bg; implements { - class.constructor; Efl.Object.constructor; Efl.File.file { get; set; } Efl.File.mmap { get; set; } diff --git a/src/lib/elementary/efl_ui_bg_widget_legacy.eo b/src/lib/elementary/efl_ui_bg_widget_legacy.eo new file mode 100644 index 0000000..66d38b2 --- /dev/null +++ b/src/lib/elementary/efl_ui_bg_widget_legacy.eo @@ -0,0 +1,14 @@ +class Efl.Ui.Bg_Widget_Legacy (Efl.Ui.Bg_Widget, Efl.Ui.Legacy) +{ + [[The bg (background) widget is used for setting (solid) background decorations + + for a window (unless it has transparency enabled) or for any container object. It + works just like an image, but has some properties useful for backgrounds, such as + setting it to tiled, centered, scaled or stretched. + ]] + data: null; + implements { + class.constructor; + Efl.Object.constructor; + } +} diff --git a/src/lib/elementary/efl_ui_button.c b/src/lib/elementary/efl_ui_button.c index 8cdfa7d..c14d4be 100644 --- a/src/lib/elementary/efl_ui_button.c +++ b/src/lib/elementary/efl_ui_button.c @@ -17,7 +17,6 @@ #define MY_CLASS_PFX efl_ui_button #define MY_CLASS_NAME "Efl.Ui.Button" -#define MY_CLASS_NAME_LEGACY "elm_button" static const char SIG_CLICKED[] = "clicked"; static const char SIG_REPEATED[] = "repeated"; @@ -303,18 +302,10 @@ _efl_ui_button_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Button_Data *_pd EINA_ CRI("Failed to set layout!"); } -EAPI Evas_Object * -elm_button_add(Evas_Object *parent) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - return elm_legacy_add(MY_CLASS, parent); -} - EOLIAN static Eo * _efl_ui_button_efl_object_constructor(Eo *obj, Efl_Ui_Button_Data *_pd EINA_UNUSED) { obj = efl_constructor(efl_super(obj, MY_CLASS)); - efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); efl_access_role_set(obj, EFL_ACCESS_ROLE_PUSH_BUTTON); @@ -406,12 +397,6 @@ _efl_ui_button_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Efl return &atspi_actions[0]; } -static void -_efl_ui_button_class_constructor(Efl_Class *klass) -{ - evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); -} - /* Standard widget overrides */ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_button, Efl_Ui_Button_Data) @@ -481,3 +466,30 @@ ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(MY_CLASS_PFX) EFL_CANVAS_GROUP_ADD_OPS(efl_ui_button) #include "efl_ui_button.eo.c" + +#include "efl_ui_button_legacy.eo.h" + +#define MY_CLASS_NAME_LEGACY "elm_button" + +static void +_efl_ui_button_legacy_class_constructor(Efl_Class *klass) +{ + evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); +} + +EOLIAN static Eo * +_efl_ui_button_legacy_efl_object_constructor(Eo *obj, void *_pd EINA_UNUSED) +{ + obj = efl_constructor(efl_super(obj, EFL_UI_BUTTON_LEGACY_CLASS)); + efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); + return obj; +} + +EAPI Evas_Object * +elm_button_add(Evas_Object *parent) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); + return elm_legacy_add(EFL_UI_BUTTON_LEGACY_CLASS, parent); +} + +#include "efl_ui_button_legacy.eo.c" diff --git a/src/lib/elementary/efl_ui_button.eo b/src/lib/elementary/efl_ui_button.eo index cb165ed..883bd34 100644 --- a/src/lib/elementary/efl_ui_button.eo +++ b/src/lib/elementary/efl_ui_button.eo @@ -9,7 +9,6 @@ class Efl.Ui.Button (Efl.Ui.Layout, Efl.Ui.Clickable, Efl.Ui.Autorepeat, ]] legacy_prefix: elm_button; implements { - class.constructor; Efl.Object.constructor; Efl.Ui.Autorepeat.autorepeat_initial_timeout { set; get; } Efl.Ui.Autorepeat.autorepeat_gap_timeout { set; get; } diff --git a/src/lib/elementary/efl_ui_button_legacy.eo b/src/lib/elementary/efl_ui_button_legacy.eo new file mode 100644 index 0000000..91f104b --- /dev/null +++ b/src/lib/elementary/efl_ui_button_legacy.eo @@ -0,0 +1,13 @@ +class Efl.Ui.Button_Legacy (Efl.Ui.Button, Efl.Ui.Legacy) +{ + [[Push-button widget + + Press it and run some function. It can contain a simple label and icon + object and it also has an autorepeat feature. + ]] + data: null; + implements { + class.constructor; + Efl.Object.constructor; + } +} diff --git a/src/lib/elementary/efl_ui_check.c b/src/lib/elementary/efl_ui_check.c index 61d3cbb..a4cce48 100644 --- a/src/lib/elementary/efl_ui_check.c +++ b/src/lib/elementary/efl_ui_check.c @@ -17,7 +17,6 @@ #define MY_CLASS_PFX efl_ui_check #define MY_CLASS_NAME "Efl.Ui.Check" -#define MY_CLASS_NAME_LEGACY "elm_check" static const Elm_Layout_Part_Alias_Description _text_aliases[] = { @@ -311,20 +310,12 @@ _efl_ui_check_efl_ui_nstate_value_set(Eo *obj, Efl_Ui_Check_Data *pd EINA_UNUSED efl_ui_nstate_value_set(efl_super(obj, MY_CLASS), _state); } -EAPI Evas_Object * -elm_check_add(Evas_Object *parent) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - return elm_legacy_add(MY_CLASS, parent); -} - EOLIAN static Eo * _efl_ui_check_efl_object_constructor(Eo *obj, Efl_Ui_Check_Data *pd EINA_UNUSED) { if (!elm_widget_theme_klass_get(obj)) elm_widget_theme_klass_set(obj, "check"); obj = efl_constructor(efl_super(obj, MY_CLASS)); - efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); @@ -408,12 +399,6 @@ _efl_ui_check_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Efl_ return &atspi_action[0]; } -static void -_efl_ui_check_class_constructor(Efl_Class *klass) -{ - evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); -} - /* Standard widget overrides */ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_check, Efl_Ui_Check_Data) @@ -426,3 +411,30 @@ ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(MY_CLASS_PFX) ELM_LAYOUT_TEXT_ALIASES_OPS(MY_CLASS_PFX) #include "efl_ui_check.eo.c" + +#include "efl_ui_check_legacy.eo.h" + +#define MY_CLASS_NAME_LEGACY "elm_check" + +static void +_efl_ui_check_legacy_class_constructor(Efl_Class *klass) +{ + evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); +} + +EOLIAN static Eo * +_efl_ui_check_legacy_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED) +{ + obj = efl_constructor(efl_super(obj, EFL_UI_CHECK_LEGACY_CLASS)); + efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); + return obj; +} + +EAPI Evas_Object * +elm_check_add(Evas_Object *parent) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); + return elm_legacy_add(EFL_UI_CHECK_LEGACY_CLASS, parent); +} + +#include "efl_ui_check_legacy.eo.c" diff --git a/src/lib/elementary/efl_ui_check.eo b/src/lib/elementary/efl_ui_check.eo index 6544f39..508d3fa 100644 --- a/src/lib/elementary/efl_ui_check.eo +++ b/src/lib/elementary/efl_ui_check.eo @@ -21,7 +21,6 @@ class Efl.Ui.Check (Efl.Ui.Nstate, Efl.Access.Widget.Action) } } implements { - class.constructor; Efl.Object.constructor; Efl.Ui.Widget.on_access_activate; Efl.Ui.Widget.theme_apply; diff --git a/src/lib/elementary/efl_ui_check_legacy.eo b/src/lib/elementary/efl_ui_check_legacy.eo new file mode 100644 index 0000000..b140077 --- /dev/null +++ b/src/lib/elementary/efl_ui_check_legacy.eo @@ -0,0 +1,15 @@ +class Efl.Ui.Check_Legacy (Efl.Ui.Check, Efl.Ui.Legacy) +{ + [[Check widget + + The check widget allows for toggling a value between true and false. + Check objects are a lot like radio objects in layout and functionality, + except they do not work as a group, but independently, and only toggle + the value of a boolean between false and true. + ]] + data: null; + implements { + class.constructor; + Efl.Object.constructor; + } +} diff --git a/src/lib/elementary/efl_ui_clock.c b/src/lib/elementary/efl_ui_clock.c index 390266e..2e6c371 100644 --- a/src/lib/elementary/efl_ui_clock.c +++ b/src/lib/elementary/efl_ui_clock.c @@ -13,7 +13,6 @@ #define MY_CLASS EFL_UI_CLOCK_CLASS #define MY_CLASS_NAME "Efl.Ui.Clock" -#define MY_CLASS_NAME_LEGACY "efl_ui_clock" #ifdef HAVE_LOCALE_H # include @@ -1092,7 +1091,6 @@ EOLIAN static Eo * _efl_ui_clock_efl_object_constructor(Eo *obj, Efl_Ui_Clock_Data *_pd EINA_UNUSED) { obj = efl_constructor(efl_super(obj, MY_CLASS)); - efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); efl_access_role_set(obj, EFL_ACCESS_ROLE_DATE_EDITOR); @@ -1299,12 +1297,6 @@ _efl_ui_clock_time_max_set(Eo *obj, Efl_Ui_Clock_Data *sd, Efl_Time maxtime) efl_event_callback_legacy_call(obj, EFL_UI_CLOCK_EVENT_CHANGED, NULL); } -EOLIAN static void -_efl_ui_clock_class_constructor(Efl_Class *klass) -{ - evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); -} - /* Internal EO APIs and hidden overrides */ #define EFL_UI_CLOCK_EXTRA_OPS \ diff --git a/src/lib/elementary/efl_ui_clock.eo b/src/lib/elementary/efl_ui_clock.eo index 9b27fc3..7852c98 100644 --- a/src/lib/elementary/efl_ui_clock.eo +++ b/src/lib/elementary/efl_ui_clock.eo @@ -222,7 +222,6 @@ class Efl.Ui.Clock (Efl.Ui.Layout) } } implements { - class.constructor; Efl.Object.constructor; Efl.Ui.Widget.theme_apply; Efl.Ui.Widget.on_disabled_update; diff --git a/src/lib/elementary/efl_ui_clock_legacy.eo b/src/lib/elementary/efl_ui_clock_legacy.eo new file mode 100644 index 0000000..b152257 --- /dev/null +++ b/src/lib/elementary/efl_ui_clock_legacy.eo @@ -0,0 +1,9 @@ +class Efl.Ui.Clock_Legacy (Efl.Ui.Clock, Efl.Ui.Legacy) +{ + [[Efl UI clock class]] + data: null; + implements { + class.constructor; + Efl.Object.constructor; + } +} diff --git a/src/lib/elementary/efl_ui_flip.c b/src/lib/elementary/efl_ui_flip.c index 3967a3a..e9c5412 100644 --- a/src/lib/elementary/efl_ui_flip.c +++ b/src/lib/elementary/efl_ui_flip.c @@ -14,7 +14,6 @@ #define MY_CLASS EFL_UI_FLIP_CLASS #define MY_CLASS_NAME "Efl.Ui.Flip" -#define MY_CLASS_NAME_LEGACY "elm_flip" static const char SIG_ANIMATE_BEGIN[] = "animate,begin"; static const char SIG_ANIMATE_DONE[] = "animate,done"; @@ -1862,20 +1861,12 @@ _efl_ui_flip_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Flip_Data *sd) efl_canvas_group_del(efl_super(obj, MY_CLASS)); } -EAPI Evas_Object * -elm_flip_add(Evas_Object *parent) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - return elm_legacy_add(MY_CLASS, parent); -} - EOLIAN static Eo * _efl_ui_flip_efl_object_constructor(Eo *obj, Efl_Ui_Flip_Data *sd) { obj = efl_constructor(efl_super(obj, MY_CLASS)); sd->obj = obj; - efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); efl_access_role_set(obj, EFL_ACCESS_ROLE_PAGE_TAB_LIST); @@ -2313,12 +2304,6 @@ _efl_ui_flip_efl_pack_linear_pack_index_get(Eo *obj EINA_UNUSED, Efl_Ui_Flip_Dat return eina_list_data_idx(pd->content_list, (void *)subobj); } -static void -_efl_ui_flip_class_constructor(Efl_Class *klass) -{ - evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); -} - EAPI void elm_flip_interaction_direction_hitsize_set(Efl_Ui_Flip *obj, Elm_Flip_Direction dir, double hitsize) { @@ -2371,3 +2356,30 @@ ELM_PART_CONTENT_DEFAULT_GET(efl_ui_flip, "front") EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_flip) #include "efl_ui_flip.eo.c" + +#include "efl_ui_flip_legacy.eo.h" + +#define MY_CLASS_NAME_LEGACY "elm_flip" + +static void +_efl_ui_flip_legacy_class_constructor(Efl_Class *klass) +{ + evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); +} + +EOLIAN static Eo * +_efl_ui_flip_legacy_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED) +{ + obj = efl_constructor(efl_super(obj, EFL_UI_FLIP_LEGACY_CLASS)); + efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); + return obj; +} + +EAPI Evas_Object * +elm_flip_add(Evas_Object *parent) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); + return elm_legacy_add(EFL_UI_FLIP_LEGACY_CLASS, parent); +} + +#include "efl_ui_flip_legacy.eo.c" diff --git a/src/lib/elementary/efl_ui_flip.eo b/src/lib/elementary/efl_ui_flip.eo index 892ebf9..9e55aa1 100644 --- a/src/lib/elementary/efl_ui_flip.eo +++ b/src/lib/elementary/efl_ui_flip.eo @@ -227,7 +227,6 @@ class Efl.Ui.Flip (Efl.Ui.Widget, Efl.Pack.Linear, Efl.Part) } } implements { - class.constructor; Efl.Object.constructor; Efl.Ui.Widget.widget_sub_object_add; Efl.Ui.Widget.theme_apply; diff --git a/src/lib/elementary/efl_ui_flip_legacy.eo b/src/lib/elementary/efl_ui_flip_legacy.eo new file mode 100644 index 0000000..697c2d1 --- /dev/null +++ b/src/lib/elementary/efl_ui_flip_legacy.eo @@ -0,0 +1,9 @@ +class Efl.Ui.Flip_Legacy (Efl.Ui.Flip, Efl.Ui.Legacy) +{ + [[Efl UI flip class]] + data: null; + implements { + class.constructor; + Efl.Object.constructor; + } +} diff --git a/src/lib/elementary/efl_ui_frame.c b/src/lib/elementary/efl_ui_frame.c index 234812d..d4f60eb 100644 --- a/src/lib/elementary/efl_ui_frame.c +++ b/src/lib/elementary/efl_ui_frame.c @@ -14,7 +14,6 @@ #define MY_CLASS EFL_UI_FRAME_CLASS #define MY_CLASS_PFX efl_ui_frame #define MY_CLASS_NAME "Efl.Ui.Frame" -#define MY_CLASS_NAME_LEGACY "elm_frame" static const char SIG_CLICKED[] = "clicked"; @@ -140,18 +139,10 @@ _efl_ui_frame_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Frame_Data *_pd EINA_UN elm_layout_sizing_eval(obj); } -EAPI Evas_Object * -elm_frame_add(Evas_Object *parent) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - return elm_legacy_add(MY_CLASS, parent); -} - EOLIAN static Eo * _efl_ui_frame_efl_object_constructor(Eo *obj, Efl_Ui_Frame_Data *_pd EINA_UNUSED) { obj = efl_constructor(efl_super(obj, MY_CLASS)); - efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); efl_access_role_set(obj, EFL_ACCESS_ROLE_FRAME); @@ -210,12 +201,6 @@ _efl_ui_frame_collapse_get(Eo *obj EINA_UNUSED, Efl_Ui_Frame_Data *sd) return sd->collapsed; } -EOLIAN static void -_efl_ui_frame_class_constructor(Efl_Class *klass) -{ - evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); -} - /* Default text (title) and content */ ELM_PART_TEXT_DEFAULT_IMPLEMENT(efl_ui_frame, Efl_Ui_Frame_Data) @@ -235,3 +220,30 @@ ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(efl_ui_frame) ELM_LAYOUT_TEXT_ALIASES_OPS(efl_ui_frame) #include "efl_ui_frame.eo.c" + +#include "efl_ui_frame_legacy.eo.h" + +#define MY_CLASS_NAME_LEGACY "elm_frame" + +static void +_efl_ui_frame_legacy_class_constructor(Efl_Class *klass) +{ + evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); +} + +EOLIAN static Eo * +_efl_ui_frame_legacy_efl_object_constructor(Eo *obj, void *_pd EINA_UNUSED) +{ + obj = efl_constructor(efl_super(obj, EFL_UI_FRAME_LEGACY_CLASS)); + efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); + return obj; +} + +EAPI Evas_Object * +elm_frame_add(Evas_Object *parent) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); + return elm_legacy_add(EFL_UI_FRAME_LEGACY_CLASS, parent); +} + +#include "efl_ui_frame_legacy.eo.c" diff --git a/src/lib/elementary/efl_ui_frame.eo b/src/lib/elementary/efl_ui_frame.eo index 557e475..f05017f 100644 --- a/src/lib/elementary/efl_ui_frame.eo +++ b/src/lib/elementary/efl_ui_frame.eo @@ -55,7 +55,6 @@ class Efl.Ui.Frame (Efl.Ui.Layout, Efl.Ui.Clickable, Efl.Text, Efl.Text.Markup, } implements { Efl.Object.constructor; - class.constructor; Efl.Canvas.Group.group_calculate; Efl.Text.text { get; set; } Efl.Text.Markup.markup { get; set; } diff --git a/src/lib/elementary/efl_ui_frame_legacy.eo b/src/lib/elementary/efl_ui_frame_legacy.eo new file mode 100644 index 0000000..02393c5 --- /dev/null +++ b/src/lib/elementary/efl_ui_frame_legacy.eo @@ -0,0 +1,14 @@ +class Efl.Ui.Frame_Legacy (Efl.Ui.Frame, Efl.Ui.Legacy) +{ + [[Frame widget + + The Frame widget allows for collapsing and expanding the content widget + by clicking on the frame label. + the label and content can be set using text_set and content_set api. + ]] + data: null; + implements { + Efl.Object.constructor; + class.constructor; + } +} diff --git a/src/lib/elementary/efl_ui_image.c b/src/lib/elementary/efl_ui_image.c index 60594ae..e8e6df9 100644 --- a/src/lib/elementary/efl_ui_image.c +++ b/src/lib/elementary/efl_ui_image.c @@ -16,7 +16,6 @@ #define MY_CLASS EFL_UI_IMAGE_CLASS #define MY_CLASS_NAME "Efl.Ui.Image" -#define MY_CLASS_NAME_LEGACY "elm_image" #define NON_EXISTING (void *)-1 static const char *icon_theme = NULL; @@ -853,23 +852,10 @@ _on_size_hints_changed(void *data, const Efl_Event *ev) _efl_ui_image_internal_sizing_eval(ev->object, data); } -EAPI Evas_Object * -elm_image_add(Evas_Object *parent) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - 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); - - return obj; -} - EOLIAN static Eo * _efl_ui_image_efl_object_constructor(Eo *obj, Efl_Ui_Image_Data *pd) { obj = efl_constructor(efl_super(obj, MY_CLASS)); - efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); efl_access_role_set(obj, EFL_ACCESS_ROLE_IMAGE); @@ -1521,12 +1507,6 @@ _efl_ui_image_efl_player_play_get(Eo *obj, Efl_Ui_Image_Data *sd) return _efl_ui_image_animated_play_get_internal(obj, sd); } -static void -_efl_ui_image_class_constructor(Efl_Class *klass) -{ - evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); -} - EOLIAN static void _efl_ui_image_efl_image_scale_type_set(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd EINA_UNUSED, Efl_Image_Scale_Type scale_type) { @@ -2282,3 +2262,35 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_image, Efl_Ui_Image_Data) EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_image) #include "efl_ui_image.eo.c" + +#include "efl_ui_image_legacy.eo.h" + +#define MY_CLASS_NAME_LEGACY "elm_image" + +static void +_efl_ui_image_legacy_class_constructor(Efl_Class *klass) +{ + evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); +} + +EOLIAN static Eo * +_efl_ui_image_legacy_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED) +{ + obj = efl_constructor(efl_super(obj, EFL_UI_IMAGE_LEGACY_CLASS)); + efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); + return obj; +} + +EAPI Evas_Object * +elm_image_add(Evas_Object *parent) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); + Evas_Object *obj = elm_legacy_add(EFL_UI_IMAGE_LEGACY_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); + + return obj; +} + +#include "efl_ui_image_legacy.eo.c" diff --git a/src/lib/elementary/efl_ui_image.eo b/src/lib/elementary/efl_ui_image.eo index db48d04..11a8f2a 100644 --- a/src/lib/elementary/efl_ui_image.eo +++ b/src/lib/elementary/efl_ui_image.eo @@ -88,7 +88,6 @@ class Efl.Ui.Image (Efl.Ui.Widget, Efl.Ui.Clickable, Efl.Ui.Draggable, } } implements { - class.constructor; Efl.Object.constructor; Efl.File.file { get; set; } Efl.File.mmap { set; } diff --git a/src/lib/elementary/efl_ui_image_legacy.eo b/src/lib/elementary/efl_ui_image_legacy.eo new file mode 100644 index 0000000..0ee7309 --- /dev/null +++ b/src/lib/elementary/efl_ui_image_legacy.eo @@ -0,0 +1,9 @@ +class Efl.Ui.Image_Legacy (Efl.Ui.Image, Efl.Ui.Legacy) +{ + [[ Efl UI image class]] + data: null; + implements { + class.constructor; + Efl.Object.constructor; + } +} diff --git a/src/lib/elementary/efl_ui_image_zoomable.c b/src/lib/elementary/efl_ui_image_zoomable.c index 7fe888b..c3885b2 100644 --- a/src/lib/elementary/efl_ui_image_zoomable.c +++ b/src/lib/elementary/efl_ui_image_zoomable.c @@ -21,7 +21,6 @@ #define MY_CLASS EFL_UI_IMAGE_ZOOMABLE_CLASS #define MY_CLASS_NAME "Efl.Ui.Image_Zoomable" -#define MY_CLASS_NAME_LEGACY "elm_photocam" /* * TODO (maybe - optional future stuff): @@ -1802,7 +1801,6 @@ EOLIAN static Eo * _efl_ui_image_zoomable_efl_object_constructor(Eo *obj, Efl_Ui_Image_Zoomable_Data *_pd EINA_UNUSED) { obj = efl_constructor(efl_super(obj, MY_CLASS)); - efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); efl_access_role_set(obj, EFL_ACCESS_ROLE_IMAGE); @@ -2967,10 +2965,8 @@ _efl_ui_image_zoomable_efl_player_play_get(Eo *obj, Efl_Ui_Image_Zoomable_Data * } EOLIAN static void -_efl_ui_image_zoomable_class_constructor(Efl_Class *klass) +_efl_ui_image_zoomable_class_constructor(Efl_Class *klass EINA_UNUSED) { - evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); - PHOTO_FILE_LOAD_ERROR_GENERIC = eina_error_msg_static_register("Generic load error"); PHOTO_FILE_LOAD_ERROR_DOES_NOT_EXIST = eina_error_msg_static_register("File does not exist"); PHOTO_FILE_LOAD_ERROR_PERMISSION_DENIED = eina_error_msg_static_register("Permission denied to an existing file"); @@ -2996,13 +2992,39 @@ _efl_ui_image_zoomable_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNU return &atspi_actions[0]; } -/* Legacy APIs */ +/* Standard widget overrides */ + +ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_image_zoomable, Efl_Ui_Image_Zoomable_Data) + +/* Internal EO APIs and hidden overrides */ + +#define EFL_UI_IMAGE_ZOOMABLE_EXTRA_OPS \ + EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_image_zoomable) + +#include "efl_ui_image_zoomable.eo.c" + +#include "efl_ui_image_zoomable_legacy.eo.h" +#define MY_CLASS_NAME_LEGACY "elm_photocam" + +static void +_efl_ui_image_zoomable_legacy_class_constructor(Efl_Class *klass) +{ + evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); +} + +EOLIAN static Eo * +_efl_ui_image_zoomable_legacy_efl_object_constructor(Eo *obj, void *_pd EINA_UNUSED) +{ + obj = efl_constructor(efl_super(obj, EFL_UI_IMAGE_ZOOMABLE_LEGACY_CLASS)); + efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); + return obj; +} EAPI Evas_Object * elm_photocam_add(Evas_Object *parent) { EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - return elm_legacy_add(MY_CLASS, parent); + return elm_legacy_add(EFL_UI_IMAGE_ZOOMABLE_LEGACY_CLASS, parent); } static inline void @@ -3237,13 +3259,4 @@ elm_photocam_image_region_get(const Efl_Ui_Image_Zoomable *obj, int *x, int *y, if (h) *h = r.h; } -/* Standard widget overrides */ - -ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_image_zoomable, Efl_Ui_Image_Zoomable_Data) - -/* Internal EO APIs and hidden overrides */ - -#define EFL_UI_IMAGE_ZOOMABLE_EXTRA_OPS \ - EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_image_zoomable) - -#include "efl_ui_image_zoomable.eo.c" +#include "efl_ui_image_zoomable_legacy.eo.c" diff --git a/src/lib/elementary/efl_ui_image_zoomable_legacy.eo b/src/lib/elementary/efl_ui_image_zoomable_legacy.eo new file mode 100644 index 0000000..3816422 --- /dev/null +++ b/src/lib/elementary/efl_ui_image_zoomable_legacy.eo @@ -0,0 +1,9 @@ +class Efl.Ui.Image_Zoomable_Legacy (Efl.Ui.Image_Zoomable, Efl.Ui.Legacy) +{ + [[Elementary Image Zoomable class]] + data: null; + implements { + class.constructor; + Efl.Object.constructor; + } +} diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c index 13df6ce..6278ab9 100644 --- a/src/lib/elementary/efl_ui_layout.c +++ b/src/lib/elementary/efl_ui_layout.c @@ -17,7 +17,6 @@ #define MY_CLASS_PFX efl_ui_layout #define MY_CLASS_NAME "Efl.Ui.Layout" -#define MY_CLASS_NAME_LEGACY "elm_layout" Eo *_efl_ui_layout_pack_proxy_get(Efl_Ui_Layout *obj, Edje_Part_Type type, const char *part); static void _efl_model_properties_changed_cb(void *, const Efl_Event *); @@ -811,9 +810,8 @@ EOLIAN static Efl_Ui_Theme_Apply _efl_ui_layout_theme_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *klass, const char *group, const char *style) { Eina_Bool changed = EINA_FALSE; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); - if (!wd->legacy && efl_finalized_get(obj)) + if (!elm_widget_is_legacy(obj) && efl_finalized_get(obj)) { ERR("Efl.Ui.Layout.theme can only be set before finalize!"); return EFL_UI_THEME_APPLY_FAILED; @@ -1162,7 +1160,7 @@ _efl_ui_layout_text_generic_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *par if (!text) return EINA_TRUE; - if (wd->legacy) + if (elm_widget_is_legacy(obj)) { if (!edje_object_part_text_escaped_set (wd->resize_obj, part, text)) @@ -2101,12 +2099,6 @@ _efl_ui_layout_efl_ui_model_factory_connect_connect(Eo *obj EINA_UNUSED, Efl_Ui_ elm_layout_content_set(obj, name, new_ev); } -EAPI Evas_Object * -elm_layout_add(Evas_Object *parent) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - return elm_legacy_add(MY_CLASS, parent); -} //TIZEN_ONLY(20170621) handle atspi proxy connection at runtime static void @@ -2121,7 +2113,6 @@ _efl_ui_layout_efl_object_constructor(Eo *obj, Efl_Ui_Layout_Data *sd) { sd->obj = obj; obj = efl_constructor(efl_super(obj, MY_CLASS)); - efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); efl_access_role_set(obj, EFL_ACCESS_ROLE_FILLER); @@ -2134,11 +2125,6 @@ _efl_ui_layout_efl_object_constructor(Eo *obj, Efl_Ui_Layout_Data *sd) return obj; } -EOLIAN static void _efl_ui_layout_class_constructor(Efl_Class *klass) -{ - evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); -} - EOLIAN static Efl_Object* _efl_ui_layout_efl_object_finalize(Eo *obj, Efl_Ui_Layout_Data *pd EINA_UNUSED) { @@ -2164,598 +2150,619 @@ _efl_ui_layout_efl_layout_signal_signal_process(Eo *obj, Efl_Ui_Layout_Data *pd efl_layout_signal_process(wd->resize_obj, recurse); } +/* Efl.Part implementation */ -/* Legacy APIs */ - -EAPI Eina_Bool -elm_layout_file_set(Eo *obj, const char *file, const char *group) +EOLIAN static Eo * +_efl_ui_layout_efl_part_part(const Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED, const char *part) { - return efl_file_set((Eo *) obj, file, group); -} + Efl_Canvas_Layout_Part_Type type = EFL_CANVAS_LAYOUT_PART_TYPE_NONE; -EAPI void -elm_layout_file_get(Eo *obj, const char **file, const char **group) -{ - efl_file_get((Eo *) obj, file, group); -} + EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL); + ELM_WIDGET_DATA_GET_OR_RETURN((Eo *) obj, wd, NULL); -EAPI Eina_Bool -elm_layout_mmap_set(Eo *obj, const Eina_File *file, const char *group) -{ - return efl_file_mmap_set((Eo *) obj, file, group); -} + // Check part type without using edje_object_part_object_get(), as this + // can cause recalc, which has side effects... and could be slow. -EAPI void -elm_layout_mmap_get(Eo *obj, const Eina_File **file, const char **group) -{ - efl_file_mmap_get((Eo *) obj, file, group); + if (eina_streq(part, "background")) + { + if (efl_layout_group_part_exist_get(wd->resize_obj, part)) + type = efl_canvas_layout_part_type_get(efl_part(wd->resize_obj, part)); + if (type != EFL_CANVAS_LAYOUT_PART_TYPE_SWALLOW) + { + if (type < EFL_CANVAS_LAYOUT_PART_TYPE_LAST && + type > EFL_CANVAS_LAYOUT_PART_TYPE_NONE) + { + const char *file = NULL, *key = NULL; + efl_file_get(wd->resize_obj, &file, &key); + WRN("Layout has a background but it's not a swallow: '%s'", + elm_widget_theme_element_get(obj)); + } + return efl_part(efl_super(obj, MY_CLASS), part); + } + + return ELM_PART_IMPLEMENT(EFL_UI_LAYOUT_PART_BG_CLASS, obj, part); + } + else if (eina_streq(part, "shadow")) + return efl_part(efl_super(obj, MY_CLASS), part); + + if (!efl_layout_group_part_exist_get(wd->resize_obj, part)) + { + // edje part will handle the error message + return efl_part(wd->resize_obj, part); + } + + type = efl_canvas_layout_part_type_get(efl_part(wd->resize_obj, part)); + if (type >= EFL_CANVAS_LAYOUT_PART_TYPE_LAST) + { + ERR("Invalid type found for part '%s' in group '%s'", + part, elm_widget_theme_element_get(obj)); + return NULL; + } + + switch (type) + { + case EFL_CANVAS_LAYOUT_PART_TYPE_BOX: + case EFL_CANVAS_LAYOUT_PART_TYPE_TABLE: + return _efl_ui_layout_pack_proxy_get((Eo *) obj, type, part); + case EFL_CANVAS_LAYOUT_PART_TYPE_TEXT: + case EFL_CANVAS_LAYOUT_PART_TYPE_TEXTBLOCK: + return ELM_PART_IMPLEMENT(EFL_UI_LAYOUT_PART_TEXT_CLASS, obj, part); + case EFL_CANVAS_LAYOUT_PART_TYPE_SWALLOW: + return ELM_PART_IMPLEMENT(EFL_UI_LAYOUT_PART_CONTENT_CLASS, obj, part); + default: + return ELM_PART_IMPLEMENT(EFL_UI_LAYOUT_PART_CLASS, obj, part); + } } -EAPI Eina_Bool -elm_layout_box_append(Eo *obj, const char *part, Evas_Object *child) +static const char * +_efl_ui_layout_default_content_part_get(const Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED) { - return efl_pack(efl_part(obj, part), child); + const char *part = NULL; + if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_FALSE)) + return NULL; + return part; } -EAPI Eina_Bool -elm_layout_box_prepend(Eo *obj, const char *part, Evas_Object *child) +static const char * +_efl_ui_layout_default_text_part_get(const Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED) { - return efl_pack_begin(efl_part(obj, part), child); + const char *part = NULL; + if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_TRUE)) + return NULL; + return part; } -EAPI Eina_Bool -elm_layout_box_insert_before(Eo *obj, const char *part, Evas_Object *child, const Evas_Object *reference) +/* Efl.Ui.Layout.Part (common) */ + +EOLIAN static Eina_Bool +_efl_ui_layout_part_efl_ui_cursor_cursor_set(Eo *obj, void *_pd EINA_UNUSED, const char *cursor) { - return efl_pack_before(efl_part(obj, part), child, reference); + Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); + Efl_Ui_Layout_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS); + return _efl_ui_layout_part_cursor_set(sd, pd->part, cursor); } -EAPI Eina_Bool -elm_layout_box_insert_at(Eo *obj, const char *part, Evas_Object *child, unsigned int pos) +EOLIAN static const char * +_efl_ui_layout_part_efl_ui_cursor_cursor_get(Eo *obj, void *_pd EINA_UNUSED) { - return efl_pack_at(efl_part(obj, part), child, pos); + Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); + Efl_Ui_Layout_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS); + return _efl_ui_layout_part_cursor_get(sd, pd->part); } -EAPI Evas_Object * -elm_layout_box_remove(Eo *obj, const char *part, Evas_Object *child) +EOLIAN static Eina_Bool +_efl_ui_layout_part_efl_ui_cursor_cursor_style_set(Eo *obj, void *_pd EINA_UNUSED, const char *style) { - if (!efl_pack_unpack(efl_part(obj, part), child)) - return NULL; - return child; + Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); + Efl_Ui_Layout_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS); + return _efl_ui_layout_part_cursor_style_set(sd, pd->part, style); } -EAPI Eina_Bool -elm_layout_box_remove_all(Eo *obj, const char *part, Eina_Bool clear) +EOLIAN static const char * +_efl_ui_layout_part_efl_ui_cursor_cursor_style_get(Eo *obj, void *_pd EINA_UNUSED) { - if (clear) - return efl_pack_clear(efl_part(obj, part)); - else - return efl_pack_unpack_all(efl_part(obj, part)); + Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); + Efl_Ui_Layout_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS); + return _efl_ui_layout_part_cursor_style_get(sd, pd->part); } -EAPI Eina_Bool -elm_layout_table_pack(Eo *obj, const char *part, Evas_Object *child, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan) +EOLIAN static Eina_Bool +_efl_ui_layout_part_efl_ui_cursor_cursor_theme_search_enabled_set(Eo *obj, void *_pd EINA_UNUSED, Eina_Bool allow) { - return efl_pack_table(efl_part(obj, part), child, col, row, colspan, rowspan); + Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); + Efl_Ui_Layout_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS); + return _efl_ui_layout_part_cursor_engine_only_set(sd, pd->part, !allow); } -EAPI Evas_Object * -elm_layout_table_unpack(Eo *obj, const char *part, Evas_Object *child) +EOLIAN static Eina_Bool +_efl_ui_layout_part_efl_ui_cursor_cursor_theme_search_enabled_get(Eo *obj, void *_pd EINA_UNUSED) { - if (!efl_pack_unpack(efl_part(obj, part), child)) - return NULL; - return child; + Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); + Efl_Ui_Layout_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS); + return !_efl_ui_layout_part_cursor_engine_only_get(sd, pd->part); } -EAPI Eina_Bool -elm_layout_table_clear(Eo *obj, const char *part, Eina_Bool clear) +//TIZEN_ONLY(20161213): apply screen_reader_changed callback +EOLIAN static void +_efl_ui_layout_efl_ui_widget_screen_reader(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED, Eina_Bool is_screen_reader) { - if (clear) - return efl_pack_clear(efl_part(obj, part)); - else - return efl_pack_unpack_all(efl_part(obj, part)); + EINA_SAFETY_ON_NULL_RETURN(obj); + evas_object_smart_callback_call(obj, SIG_ATSPI_SCREEN_READER_CHANGED, &is_screen_reader); } +// -EAPI Eina_Bool -elm_layout_text_set(Eo *obj, const char *part, const char *text) +/************************************************************************* + * TIZEN_ONLY_FEATURE: add internal APIs for handling a part's alignment * + *************************************************************************/ +EOLIAN static void +_efl_ui_layout_text_valign_set(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED, const char *part, double valign) { - if (!part) - { - part = efl_ui_widget_default_text_part_get(obj); - if (!part) return EINA_FALSE; - } - else if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_TRUE)) - return EINA_FALSE; + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - efl_text_set(efl_part(obj, part), text); - return EINA_TRUE; + edje_object_part_text_valign_set(wd->resize_obj, part, valign); } -EAPI const char * -elm_layout_text_get(const Eo *obj, const char *part) +EOLIAN static double +_efl_ui_layout_text_valign_get(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED, const char *part) { - if (!part) - { - part = efl_ui_widget_default_text_part_get(obj); - if (!part) return NULL; - } - else if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_TRUE)) - return NULL; + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, -1.0); - return efl_text_get(efl_part(obj, part)); + return edje_object_part_text_valign_get(wd->resize_obj, part); } -EAPI Eina_Bool -elm_layout_part_cursor_engine_only_set(Eo *obj, const char *part, Eina_Bool engine_only) +EOLIAN static void +_efl_ui_layout_valign_set(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED, const char *part, double valign) { - return efl_ui_cursor_theme_search_enabled_set(efl_part(obj, part), !engine_only); -} + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); -EAPI Eina_Bool -elm_layout_part_cursor_engine_only_get(const Eo *obj, const char *part) -{ - return !efl_ui_cursor_theme_search_enabled_get(efl_part(obj, part)); + edje_object_part_valign_set(wd->resize_obj, part, valign); } -EAPI Eina_Bool -elm_layout_part_cursor_set(Eo *obj, const char *part, const char *cursor) +EOLIAN static double +_efl_ui_layout_valign_get(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED, const char *part) { - return efl_ui_cursor_set(efl_part(obj, part), cursor); -} + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, -1.0); -EAPI const char * -elm_layout_part_cursor_get(const Eo *obj, const char *part) -{ - return efl_ui_cursor_get(efl_part(obj, part)); + return edje_object_part_valign_get(wd->resize_obj, part); } -EAPI Eina_Bool -elm_layout_part_cursor_style_set(Eo *obj, const char *part, const char *style) +EAPI void +elm_layout_text_valign_set(Evas_Object *obj, const char *part, double valign) { - return efl_ui_cursor_style_set(efl_part(obj, part), style); + efl_ui_layout_text_valign_set(obj, part, valign); } -EAPI const char * -elm_layout_part_cursor_style_get(const Eo *obj, const char *part) +EAPI double +elm_layout_text_valign_get(Evas_Object *obj, const char *part) { - return efl_ui_cursor_style_get(efl_part(obj, part)); + return efl_ui_layout_text_valign_get(obj, part); } -EAPI Eina_Bool -elm_layout_part_cursor_unset(Eo *obj, const char *part) +EAPI void +elm_layout_valign_set(Evas_Object *obj, const char *part, double valign) { - return efl_ui_cursor_set(efl_part(obj, part), NULL); + efl_ui_layout_valign_set(obj, part, valign); } -EAPI int -elm_layout_freeze(Evas_Object *obj) +EAPI double +elm_layout_valign_get(Evas_Object *obj, const char *part) { - return efl_layout_calc_freeze(obj); + return efl_ui_layout_valign_get(obj, part); } +/******* + * END * + *******/ -EAPI int -elm_layout_thaw(Evas_Object *obj) +/* Efl.Ui.Layout.Part_Content */ +ELM_PART_OVERRIDE_CONTENT_GET_FULL(efl_ui_layout_part_content, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) +ELM_PART_OVERRIDE_CONTENT_SET_FULL(efl_ui_layout_part_content, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) +ELM_PART_OVERRIDE_CONTENT_UNSET_FULL(efl_ui_layout_part_content, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) + +/* Efl.Ui.Layout.Part_Text */ +ELM_PART_OVERRIDE_TEXT_GET_FULL(efl_ui_layout_part_text, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) +ELM_PART_OVERRIDE_TEXT_SET_FULL(efl_ui_layout_part_text, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) +ELM_PART_OVERRIDE_TEXT_MARKUP_GET_FULL(efl_ui_layout_part_text, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) +ELM_PART_OVERRIDE_TEXT_MARKUP_SET_FULL(efl_ui_layout_part_text, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) + +EOLIAN static const char * +_efl_ui_layout_part_text_efl_ui_translatable_translatable_text_get(Eo *obj, void *_pd EINA_UNUSED, const char **domain) { - return efl_layout_calc_thaw(obj); + Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); + return elm_widget_part_translatable_text_get(pd->obj, pd->part, domain); } -void -_elm_layout_signal_callback_add_legacy(Eo *obj, Eo *edje, Eina_List **p_edje_signals, - const char *emission, const char *source, - Edje_Signal_Cb func, void *data) +EOLIAN static void +_efl_ui_layout_part_text_efl_ui_translatable_translatable_text_set(Eo *obj, void *_pd EINA_UNUSED, const char *label, const char *domain) { - Edje_Signal_Data *esd; + Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); + elm_widget_part_translatable_text_set(pd->obj, pd->part, label, domain); +} - esd = ELM_NEW(Edje_Signal_Data); - if (!esd) return; +/* Efl.Ui.Layout.Part_Legacy */ +ELM_PART_OVERRIDE_CONTENT_GET_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) +ELM_PART_OVERRIDE_CONTENT_SET_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) +ELM_PART_OVERRIDE_CONTENT_UNSET_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) +ELM_PART_OVERRIDE_TEXT_GET_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) +ELM_PART_OVERRIDE_TEXT_SET_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) +ELM_PART_OVERRIDE_TEXT_MARKUP_GET_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) +ELM_PART_OVERRIDE_TEXT_MARKUP_SET_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) - esd->obj = obj; - esd->func = func; - esd->emission = eina_stringshare_add(emission); - esd->source = eina_stringshare_add(source); - esd->data = data; - *p_edje_signals = eina_list_append(*p_edje_signals, esd); +EOLIAN static const char * +_efl_ui_layout_part_legacy_efl_ui_translatable_translatable_text_get(Eo *obj, void *_pd EINA_UNUSED, const char **domain) +{ + Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); + return elm_widget_part_translatable_text_get(pd->obj, pd->part, domain); +} - efl_layout_signal_callback_add(edje, emission, source, - _edje_signal_callback, esd); +EOLIAN static void +_efl_ui_layout_part_legacy_efl_ui_translatable_translatable_text_set(Eo *obj, void *_pd EINA_UNUSED, const char *label, const char *domain) +{ + Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); + elm_widget_part_translatable_text_set(pd->obj, pd->part, label, domain); } -EAPI void -elm_layout_signal_callback_add(Eo *obj, const char *emission, const char *source, Edje_Signal_Cb func, void *data) +/* Efl.Ui.Layout.Part_Bg (common) */ + +EOLIAN static Efl_Object * +_efl_ui_layout_part_bg_efl_object_finalize(Eo *obj, void *_pd EINA_UNUSED) { Efl_Ui_Layout_Data *sd; + Elm_Part_Data *pd; + Eo *bg; - if (!emission || !source) return; + obj = efl_finalize(efl_super(obj, EFL_UI_LAYOUT_PART_BG_CLASS)); + if (!obj) return NULL; - if (efl_isa(obj, ELM_ENTRY_CLASS)) + pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); + sd = efl_data_scope_get(pd->obj, MY_CLASS); + bg = _efl_ui_widget_bg_get(pd->obj); + if (!_efl_ui_layout_content_set(pd->obj, sd, "background", bg)) { - _elm_entry_signal_callback_add_legacy(obj, emission, source, func, data); - return; + ERR("Failed to swallow new background object!"); + // Shouldn't happen. What now? del bg? call super? return null? } - sd = efl_data_scope_safe_get(obj, MY_CLASS); - if (!sd) return; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - - _elm_layout_signal_callback_add_legacy(obj, wd->resize_obj, &sd->edje_signals, - emission, source, func, data); + return obj; } -void * -_elm_layout_signal_callback_del_legacy(Eo *obj EINA_UNUSED, Eo *edje, Eina_List **p_edje_signals, - const char *emission, const char *source, - Edje_Signal_Cb func) -{ - Edje_Signal_Data *esd = NULL; - void *data = NULL; - Eina_List *l; - - if (!emission || !source) return NULL; +/* Efl.Ui.Layout.Part_Xxx includes */ +#include "efl_ui_layout_part.eo.c" +#include "efl_ui_layout_part_content.eo.c" +#include "efl_ui_layout_part_bg.eo.c" +#include "efl_ui_layout_part_text.eo.c" +#include "efl_ui_layout_part_legacy.eo.c" - EINA_LIST_FOREACH(*p_edje_signals, l, esd) - { - if ((esd->func == func) && (!strcmp(esd->emission, emission)) && - (!strcmp(esd->source, source))) - { - *p_edje_signals = eina_list_remove_list(*p_edje_signals, l); +/* Efl.Part end */ - efl_layout_signal_callback_del(edje, emission, source, - _edje_signal_callback, esd); - eina_stringshare_del(esd->emission); - eina_stringshare_del(esd->source); - data = esd->data; - free(esd); +/* Internal EO APIs and hidden overrides */ - return data; /* stop at 1st match */ - } - } +EAPI EFL_VOID_FUNC_BODY(elm_layout_sizing_eval) +EFL_FUNC_BODY_CONST(elm_layout_text_aliases_get, const Elm_Layout_Part_Alias_Description *, NULL) +EFL_FUNC_BODY_CONST(elm_layout_content_aliases_get, const Elm_Layout_Part_Alias_Description *, NULL) - return NULL; -} +ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(MY_CLASS_PFX) +ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(MY_CLASS_PFX) -EAPI void * -elm_layout_signal_callback_del(Eo *obj, const char *emission, const char *source, Edje_Signal_Cb func) -{ - Efl_Ui_Layout_Data *sd; +#define EFL_UI_LAYOUT_EXTRA_OPS \ + EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_layout), \ + ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_layout), \ + ELM_PART_TEXT_DEFAULT_OPS(efl_ui_layout), \ + ELM_LAYOUT_CONTENT_ALIASES_OPS(MY_CLASS_PFX), \ + ELM_LAYOUT_TEXT_ALIASES_OPS(MY_CLASS_PFX), \ + EFL_OBJECT_OP_FUNC(elm_layout_sizing_eval, _elm_layout_sizing_eval), \ + EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _efl_ui_layout_efl_object_dbg_info_get) - if (!emission || !source) return NULL; +#include "efl_ui_layout.eo.c" - if (efl_isa(obj, ELM_ENTRY_CLASS)) - return _elm_entry_signal_callback_del_legacy(obj, emission, source, func); +#include "efl_ui_layout_legacy.eo.h" - sd = efl_data_scope_safe_get(obj, MY_CLASS); - if (!sd) return NULL; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); +#define MY_CLASS_NAME_LEGACY "elm_layout" - return _elm_layout_signal_callback_del_legacy(obj, wd->resize_obj, &sd->edje_signals, - emission, source, func); +static void +_efl_ui_layout_legacy_class_constructor(Efl_Class *klass) +{ + evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); } -EAPI void -elm_layout_signal_emit(Eo *obj, const char *emission, const char *source) +EOLIAN static Eo * +_efl_ui_layout_legacy_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED) { - efl_layout_signal_emit(obj, emission, source); + obj = efl_constructor(efl_super(obj, EFL_UI_LAYOUT_LEGACY_CLASS)); + efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); + return obj; } -EAPI const char * -elm_layout_data_get(const Evas_Object *obj, const char *key) +EAPI Evas_Object * +elm_layout_add(Evas_Object *parent) { - return efl_layout_group_data_get(obj, key); + EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); + return elm_legacy_add(EFL_UI_LAYOUT_LEGACY_CLASS, parent); } EAPI Eina_Bool -elm_layout_theme_set(Evas_Object *obj, const char *klass, const char *group, const char *style) +elm_layout_file_set(Eo *obj, const char *file, const char *group) { - Efl_Ui_Theme_Apply ta; - - ta = efl_ui_layout_theme_set(obj, klass, group, style); - return (ta != EFL_UI_THEME_APPLY_FAILED); + return efl_file_set((Eo *) obj, file, group); } -/* End of legacy only */ - - -/* Efl.Part implementation */ - -EOLIAN static Eo * -_efl_ui_layout_efl_part_part(const Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED, const char *part) +EAPI void +elm_layout_file_get(Eo *obj, const char **file, const char **group) { - Efl_Canvas_Layout_Part_Type type = EFL_CANVAS_LAYOUT_PART_TYPE_NONE; - - EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL); - ELM_WIDGET_DATA_GET_OR_RETURN((Eo *) obj, wd, NULL); - - // Check part type without using edje_object_part_object_get(), as this - // can cause recalc, which has side effects... and could be slow. + efl_file_get((Eo *) obj, file, group); +} - if (eina_streq(part, "background")) - { - if (efl_layout_group_part_exist_get(wd->resize_obj, part)) - type = efl_canvas_layout_part_type_get(efl_part(wd->resize_obj, part)); - if (type != EFL_CANVAS_LAYOUT_PART_TYPE_SWALLOW) - { - if (type < EFL_CANVAS_LAYOUT_PART_TYPE_LAST && - type > EFL_CANVAS_LAYOUT_PART_TYPE_NONE) - { - const char *file = NULL, *key = NULL; - efl_file_get(wd->resize_obj, &file, &key); - WRN("Layout has a background but it's not a swallow: '%s'", - elm_widget_theme_element_get(obj)); - } - return efl_part(efl_super(obj, MY_CLASS), part); - } +EAPI Eina_Bool +elm_layout_mmap_set(Eo *obj, const Eina_File *file, const char *group) +{ + return efl_file_mmap_set((Eo *) obj, file, group); +} - return ELM_PART_IMPLEMENT(EFL_UI_LAYOUT_PART_BG_CLASS, obj, part); - } - else if (eina_streq(part, "shadow")) - return efl_part(efl_super(obj, MY_CLASS), part); +EAPI void +elm_layout_mmap_get(Eo *obj, const Eina_File **file, const char **group) +{ + efl_file_mmap_get((Eo *) obj, file, group); +} - if (!efl_layout_group_part_exist_get(wd->resize_obj, part)) - { - // edje part will handle the error message - return efl_part(wd->resize_obj, part); - } +EAPI Eina_Bool +elm_layout_box_append(Eo *obj, const char *part, Evas_Object *child) +{ + return efl_pack(efl_part(obj, part), child); +} - type = efl_canvas_layout_part_type_get(efl_part(wd->resize_obj, part)); - if (type >= EFL_CANVAS_LAYOUT_PART_TYPE_LAST) - { - ERR("Invalid type found for part '%s' in group '%s'", - part, elm_widget_theme_element_get(obj)); - return NULL; - } +EAPI Eina_Bool +elm_layout_box_prepend(Eo *obj, const char *part, Evas_Object *child) +{ + return efl_pack_begin(efl_part(obj, part), child); +} - switch (type) - { - case EFL_CANVAS_LAYOUT_PART_TYPE_BOX: - case EFL_CANVAS_LAYOUT_PART_TYPE_TABLE: - return _efl_ui_layout_pack_proxy_get((Eo *) obj, type, part); - case EFL_CANVAS_LAYOUT_PART_TYPE_TEXT: - case EFL_CANVAS_LAYOUT_PART_TYPE_TEXTBLOCK: - return ELM_PART_IMPLEMENT(EFL_UI_LAYOUT_PART_TEXT_CLASS, obj, part); - case EFL_CANVAS_LAYOUT_PART_TYPE_SWALLOW: - return ELM_PART_IMPLEMENT(EFL_UI_LAYOUT_PART_CONTENT_CLASS, obj, part); - default: - return ELM_PART_IMPLEMENT(EFL_UI_LAYOUT_PART_CLASS, obj, part); - } +EAPI Eina_Bool +elm_layout_box_insert_before(Eo *obj, const char *part, Evas_Object *child, const Evas_Object *reference) +{ + return efl_pack_before(efl_part(obj, part), child, reference); } -static const char * -_efl_ui_layout_default_content_part_get(const Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED) +EAPI Eina_Bool +elm_layout_box_insert_at(Eo *obj, const char *part, Evas_Object *child, unsigned int pos) { - const char *part = NULL; - if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_FALSE)) - return NULL; - return part; + return efl_pack_at(efl_part(obj, part), child, pos); } -static const char * -_efl_ui_layout_default_text_part_get(const Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED) +EAPI Evas_Object * +elm_layout_box_remove(Eo *obj, const char *part, Evas_Object *child) { - const char *part = NULL; - if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_TRUE)) + if (!efl_pack_unpack(efl_part(obj, part), child)) return NULL; - return part; + return child; } -/* Efl.Ui.Layout.Part (common) */ +EAPI Eina_Bool +elm_layout_box_remove_all(Eo *obj, const char *part, Eina_Bool clear) +{ + if (clear) + return efl_pack_clear(efl_part(obj, part)); + else + return efl_pack_unpack_all(efl_part(obj, part)); +} -EOLIAN static Eina_Bool -_efl_ui_layout_part_efl_ui_cursor_cursor_set(Eo *obj, void *_pd EINA_UNUSED, const char *cursor) +EAPI Eina_Bool +elm_layout_table_pack(Eo *obj, const char *part, Evas_Object *child, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan) { - Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); - Efl_Ui_Layout_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS); - return _efl_ui_layout_part_cursor_set(sd, pd->part, cursor); + return efl_pack_table(efl_part(obj, part), child, col, row, colspan, rowspan); } -EOLIAN static const char * -_efl_ui_layout_part_efl_ui_cursor_cursor_get(Eo *obj, void *_pd EINA_UNUSED) +EAPI Evas_Object * +elm_layout_table_unpack(Eo *obj, const char *part, Evas_Object *child) { - Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); - Efl_Ui_Layout_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS); - return _efl_ui_layout_part_cursor_get(sd, pd->part); + if (!efl_pack_unpack(efl_part(obj, part), child)) + return NULL; + return child; } -EOLIAN static Eina_Bool -_efl_ui_layout_part_efl_ui_cursor_cursor_style_set(Eo *obj, void *_pd EINA_UNUSED, const char *style) +EAPI Eina_Bool +elm_layout_table_clear(Eo *obj, const char *part, Eina_Bool clear) { - Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); - Efl_Ui_Layout_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS); - return _efl_ui_layout_part_cursor_style_set(sd, pd->part, style); + if (clear) + return efl_pack_clear(efl_part(obj, part)); + else + return efl_pack_unpack_all(efl_part(obj, part)); } -EOLIAN static const char * -_efl_ui_layout_part_efl_ui_cursor_cursor_style_get(Eo *obj, void *_pd EINA_UNUSED) +EAPI Eina_Bool +elm_layout_text_set(Eo *obj, const char *part, const char *text) { - Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); - Efl_Ui_Layout_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS); - return _efl_ui_layout_part_cursor_style_get(sd, pd->part); + if (!part) + { + part = efl_ui_widget_default_text_part_get(obj); + if (!part) return EINA_FALSE; + } + else if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_TRUE)) + return EINA_FALSE; + + efl_text_set(efl_part(obj, part), text); + return EINA_TRUE; } -EOLIAN static Eina_Bool -_efl_ui_layout_part_efl_ui_cursor_cursor_theme_search_enabled_set(Eo *obj, void *_pd EINA_UNUSED, Eina_Bool allow) +EAPI const char * +elm_layout_text_get(const Eo *obj, const char *part) { - Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); - Efl_Ui_Layout_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS); - return _efl_ui_layout_part_cursor_engine_only_set(sd, pd->part, !allow); + if (!part) + { + part = efl_ui_widget_default_text_part_get(obj); + if (!part) return NULL; + } + else if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_TRUE)) + return NULL; + + return efl_text_get(efl_part(obj, part)); } -EOLIAN static Eina_Bool -_efl_ui_layout_part_efl_ui_cursor_cursor_theme_search_enabled_get(Eo *obj, void *_pd EINA_UNUSED) +EAPI Eina_Bool +elm_layout_part_cursor_engine_only_set(Eo *obj, const char *part, Eina_Bool engine_only) { - Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); - Efl_Ui_Layout_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS); - return !_efl_ui_layout_part_cursor_engine_only_get(sd, pd->part); + return efl_ui_cursor_theme_search_enabled_set(efl_part(obj, part), !engine_only); } -//TIZEN_ONLY(20161213): apply screen_reader_changed callback -EOLIAN static void -_efl_ui_layout_efl_ui_widget_screen_reader(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED, Eina_Bool is_screen_reader) +EAPI Eina_Bool +elm_layout_part_cursor_engine_only_get(const Eo *obj, const char *part) { - EINA_SAFETY_ON_NULL_RETURN(obj); - evas_object_smart_callback_call(obj, SIG_ATSPI_SCREEN_READER_CHANGED, &is_screen_reader); + return !efl_ui_cursor_theme_search_enabled_get(efl_part(obj, part)); } -// -/************************************************************************* - * TIZEN_ONLY_FEATURE: add internal APIs for handling a part's alignment * - *************************************************************************/ -EOLIAN static void -_efl_ui_layout_text_valign_set(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED, const char *part, double valign) +EAPI Eina_Bool +elm_layout_part_cursor_set(Eo *obj, const char *part, const char *cursor) { - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - - edje_object_part_text_valign_set(wd->resize_obj, part, valign); + return efl_ui_cursor_set(efl_part(obj, part), cursor); } -EOLIAN static double -_efl_ui_layout_text_valign_get(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED, const char *part) +EAPI const char * +elm_layout_part_cursor_get(const Eo *obj, const char *part) { - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, -1.0); - - return edje_object_part_text_valign_get(wd->resize_obj, part); + return efl_ui_cursor_get(efl_part(obj, part)); } -EOLIAN static void -_efl_ui_layout_valign_set(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED, const char *part, double valign) +EAPI Eina_Bool +elm_layout_part_cursor_style_set(Eo *obj, const char *part, const char *style) { - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - - edje_object_part_valign_set(wd->resize_obj, part, valign); + return efl_ui_cursor_style_set(efl_part(obj, part), style); } -EOLIAN static double -_efl_ui_layout_valign_get(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED, const char *part) +EAPI const char * +elm_layout_part_cursor_style_get(const Eo *obj, const char *part) { - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, -1.0); - - return edje_object_part_valign_get(wd->resize_obj, part); + return efl_ui_cursor_style_get(efl_part(obj, part)); } -EAPI void -elm_layout_text_valign_set(Evas_Object *obj, const char *part, double valign) +EAPI Eina_Bool +elm_layout_part_cursor_unset(Eo *obj, const char *part) { - efl_ui_layout_text_valign_set(obj, part, valign); + return efl_ui_cursor_set(efl_part(obj, part), NULL); } -EAPI double -elm_layout_text_valign_get(Evas_Object *obj, const char *part) +EAPI int +elm_layout_freeze(Evas_Object *obj) { - return efl_ui_layout_text_valign_get(obj, part); + return efl_layout_calc_freeze(obj); } -EAPI void -elm_layout_valign_set(Evas_Object *obj, const char *part, double valign) +EAPI int +elm_layout_thaw(Evas_Object *obj) { - efl_ui_layout_valign_set(obj, part, valign); + return efl_layout_calc_thaw(obj); } -EAPI double -elm_layout_valign_get(Evas_Object *obj, const char *part) +void +_elm_layout_signal_callback_add_legacy(Eo *obj, Eo *edje, Eina_List **p_edje_signals, + const char *emission, const char *source, + Edje_Signal_Cb func, void *data) { - return efl_ui_layout_valign_get(obj, part); -} -/******* - * END * - *******/ + Edje_Signal_Data *esd; -/* Efl.Ui.Layout.Part_Content */ -ELM_PART_OVERRIDE_CONTENT_GET_FULL(efl_ui_layout_part_content, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) -ELM_PART_OVERRIDE_CONTENT_SET_FULL(efl_ui_layout_part_content, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) -ELM_PART_OVERRIDE_CONTENT_UNSET_FULL(efl_ui_layout_part_content, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) + esd = ELM_NEW(Edje_Signal_Data); + if (!esd) return; -/* Efl.Ui.Layout.Part_Text */ -ELM_PART_OVERRIDE_TEXT_GET_FULL(efl_ui_layout_part_text, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) -ELM_PART_OVERRIDE_TEXT_SET_FULL(efl_ui_layout_part_text, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) -ELM_PART_OVERRIDE_TEXT_MARKUP_GET_FULL(efl_ui_layout_part_text, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) -ELM_PART_OVERRIDE_TEXT_MARKUP_SET_FULL(efl_ui_layout_part_text, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) + esd->obj = obj; + esd->func = func; + esd->emission = eina_stringshare_add(emission); + esd->source = eina_stringshare_add(source); + esd->data = data; + *p_edje_signals = eina_list_append(*p_edje_signals, esd); -EOLIAN static const char * -_efl_ui_layout_part_text_efl_ui_translatable_translatable_text_get(Eo *obj, void *_pd EINA_UNUSED, const char **domain) -{ - Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); - return elm_widget_part_translatable_text_get(pd->obj, pd->part, domain); + efl_layout_signal_callback_add(edje, emission, source, + _edje_signal_callback, esd); } -EOLIAN static void -_efl_ui_layout_part_text_efl_ui_translatable_translatable_text_set(Eo *obj, void *_pd EINA_UNUSED, const char *label, const char *domain) +EAPI void +elm_layout_signal_callback_add(Eo *obj, const char *emission, const char *source, Edje_Signal_Cb func, void *data) { - Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); - elm_widget_part_translatable_text_set(pd->obj, pd->part, label, domain); -} + Efl_Ui_Layout_Data *sd; -/* Efl.Ui.Layout.Part_Legacy */ -ELM_PART_OVERRIDE_CONTENT_GET_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) -ELM_PART_OVERRIDE_CONTENT_SET_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) -ELM_PART_OVERRIDE_CONTENT_UNSET_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) -ELM_PART_OVERRIDE_TEXT_GET_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) -ELM_PART_OVERRIDE_TEXT_SET_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) -ELM_PART_OVERRIDE_TEXT_MARKUP_GET_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) -ELM_PART_OVERRIDE_TEXT_MARKUP_SET_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data) + if (!emission || !source) return; -EOLIAN static const char * -_efl_ui_layout_part_legacy_efl_ui_translatable_translatable_text_get(Eo *obj, void *_pd EINA_UNUSED, const char **domain) -{ - Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); - return elm_widget_part_translatable_text_get(pd->obj, pd->part, domain); -} + if (efl_isa(obj, ELM_ENTRY_CLASS)) + { + _elm_entry_signal_callback_add_legacy(obj, emission, source, func, data); + return; + } -EOLIAN static void -_efl_ui_layout_part_legacy_efl_ui_translatable_translatable_text_set(Eo *obj, void *_pd EINA_UNUSED, const char *label, const char *domain) -{ - Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); - elm_widget_part_translatable_text_set(pd->obj, pd->part, label, domain); -} + sd = efl_data_scope_safe_get(obj, MY_CLASS); + if (!sd) return; + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); -/* Efl.Ui.Layout.Part_Bg (common) */ + _elm_layout_signal_callback_add_legacy(obj, wd->resize_obj, &sd->edje_signals, + emission, source, func, data); +} -EOLIAN static Efl_Object * -_efl_ui_layout_part_bg_efl_object_finalize(Eo *obj, void *_pd EINA_UNUSED) +void * +_elm_layout_signal_callback_del_legacy(Eo *obj EINA_UNUSED, Eo *edje, Eina_List **p_edje_signals, + const char *emission, const char *source, + Edje_Signal_Cb func) { - Efl_Ui_Layout_Data *sd; - Elm_Part_Data *pd; - Eo *bg; + Edje_Signal_Data *esd = NULL; + void *data = NULL; + Eina_List *l; - obj = efl_finalize(efl_super(obj, EFL_UI_LAYOUT_PART_BG_CLASS)); - if (!obj) return NULL; + if (!emission || !source) return NULL; - pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); - sd = efl_data_scope_get(pd->obj, MY_CLASS); - bg = _efl_ui_widget_bg_get(pd->obj); - if (!_efl_ui_layout_content_set(pd->obj, sd, "background", bg)) + EINA_LIST_FOREACH(*p_edje_signals, l, esd) { - ERR("Failed to swallow new background object!"); - // Shouldn't happen. What now? del bg? call super? return null? + if ((esd->func == func) && (!strcmp(esd->emission, emission)) && + (!strcmp(esd->source, source))) + { + *p_edje_signals = eina_list_remove_list(*p_edje_signals, l); + + efl_layout_signal_callback_del(edje, emission, source, + _edje_signal_callback, esd); + + eina_stringshare_del(esd->emission); + eina_stringshare_del(esd->source); + data = esd->data; + free(esd); + + return data; /* stop at 1st match */ + } } - return obj; + return NULL; } -/* Efl.Ui.Layout.Part_Xxx includes */ -#include "efl_ui_layout_part.eo.c" -#include "efl_ui_layout_part_content.eo.c" -#include "efl_ui_layout_part_bg.eo.c" -#include "efl_ui_layout_part_text.eo.c" -#include "efl_ui_layout_part_legacy.eo.c" +EAPI void * +elm_layout_signal_callback_del(Eo *obj, const char *emission, const char *source, Edje_Signal_Cb func) +{ + Efl_Ui_Layout_Data *sd; -/* Efl.Part end */ + if (!emission || !source) return NULL; + if (efl_isa(obj, ELM_ENTRY_CLASS)) + return _elm_entry_signal_callback_del_legacy(obj, emission, source, func); -/* Internal EO APIs and hidden overrides */ + sd = efl_data_scope_safe_get(obj, MY_CLASS); + if (!sd) return NULL; + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); -EAPI EFL_VOID_FUNC_BODY(elm_layout_sizing_eval) -EFL_FUNC_BODY_CONST(elm_layout_text_aliases_get, const Elm_Layout_Part_Alias_Description *, NULL) -EFL_FUNC_BODY_CONST(elm_layout_content_aliases_get, const Elm_Layout_Part_Alias_Description *, NULL) + return _elm_layout_signal_callback_del_legacy(obj, wd->resize_obj, &sd->edje_signals, + emission, source, func); +} -ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(MY_CLASS_PFX) -ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(MY_CLASS_PFX) +EAPI void +elm_layout_signal_emit(Eo *obj, const char *emission, const char *source) +{ + efl_layout_signal_emit(obj, emission, source); +} -#define EFL_UI_LAYOUT_EXTRA_OPS \ - EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_layout), \ - ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_layout), \ - ELM_PART_TEXT_DEFAULT_OPS(efl_ui_layout), \ - ELM_LAYOUT_CONTENT_ALIASES_OPS(MY_CLASS_PFX), \ - ELM_LAYOUT_TEXT_ALIASES_OPS(MY_CLASS_PFX), \ - EFL_OBJECT_OP_FUNC(elm_layout_sizing_eval, _elm_layout_sizing_eval), \ - EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _efl_ui_layout_efl_object_dbg_info_get) +EAPI const char * +elm_layout_data_get(const Evas_Object *obj, const char *key) +{ + return efl_layout_group_data_get(obj, key); +} -#include "efl_ui_layout.eo.c" +EAPI Eina_Bool +elm_layout_theme_set(Evas_Object *obj, const char *klass, const char *group, const char *style) +{ + Efl_Ui_Theme_Apply ta; + + ta = efl_ui_layout_theme_set(obj, klass, group, style); + return (ta != EFL_UI_THEME_APPLY_FAILED); +} + +#include "efl_ui_layout_legacy.eo.c" diff --git a/src/lib/elementary/efl_ui_layout.eo b/src/lib/elementary/efl_ui_layout.eo index e501b84..84f502e 100644 --- a/src/lib/elementary/efl_ui_layout.eo +++ b/src/lib/elementary/efl_ui_layout.eo @@ -87,7 +87,6 @@ class Efl.Ui.Layout (Efl.Ui.Widget, Efl.Part, Efl.Container, Efl.File, *******/ } implements { - class.constructor; Efl.Object.constructor; Efl.Object.finalize; Efl.File.file { get; set; } diff --git a/src/lib/elementary/efl_ui_layout_legacy.eo b/src/lib/elementary/efl_ui_layout_legacy.eo new file mode 100644 index 0000000..453d78e --- /dev/null +++ b/src/lib/elementary/efl_ui_layout_legacy.eo @@ -0,0 +1,9 @@ +class Efl.Ui.Layout_Legacy (Efl.Ui.Layout, Efl.Ui.Legacy) +{ + [[Elementary layout class]] + data: null; + implements { + class.constructor; + Efl.Object.constructor; + } +} diff --git a/src/lib/elementary/efl_ui_legacy.c b/src/lib/elementary/efl_ui_legacy.c new file mode 100644 index 0000000..85a0c23 --- /dev/null +++ b/src/lib/elementary/efl_ui_legacy.c @@ -0,0 +1,8 @@ +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif + +#include +#include "elm_priv.h" + +#include "efl_ui_legacy.eo.c" diff --git a/src/lib/elementary/efl_ui_legacy.eo b/src/lib/elementary/efl_ui_legacy.eo new file mode 100644 index 0000000..e077691 --- /dev/null +++ b/src/lib/elementary/efl_ui_legacy.eo @@ -0,0 +1,9 @@ +interface EFl.Ui.Legacy (Efl.Interface) +{ + [[The bg (background) widget is used for setting (solid) background decorations + + in a window (unless it has transparency enabled) or on any container object. It + works just like an image but has some properties useful for backgrounds, such as + setting it to tiled, centered, scaled or stretched. + ]] +} diff --git a/src/lib/elementary/efl_ui_multibuttonentry.c b/src/lib/elementary/efl_ui_multibuttonentry.c index c186463..6367d98 100644 --- a/src/lib/elementary/efl_ui_multibuttonentry.c +++ b/src/lib/elementary/efl_ui_multibuttonentry.c @@ -18,7 +18,6 @@ #define MY_CLASS_PFX efl_ui_multibuttonentry #define MY_CLASS_NAME "Efl.Ui.Multibuttonentry" -#define MY_CLASS_NAME_LEGACY "elm_multibuttonentry" #define MAX_STR 256 #define MIN_W_ENTRY 10 @@ -1830,13 +1829,6 @@ _efl_ui_multibuttonentry_efl_ui_widget_screen_reader(Eo *obj, Efl_Ui_Multibutton // // -EAPI Evas_Object * -elm_multibuttonentry_add(Evas_Object *parent) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - return elm_legacy_add(MY_CLASS, parent); -} - static void _legacy_focused(void *data, const Efl_Event *ev) { @@ -1878,7 +1870,6 @@ EOLIAN static Eo * _efl_ui_multibuttonentry_efl_object_constructor(Eo *obj, Efl_Ui_Multibuttonentry_Data *sd EINA_UNUSED) { obj = efl_constructor(efl_super(obj, MY_CLASS)); - efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); efl_access_role_set(obj, EFL_ACCESS_ROLE_FILLER); @@ -2171,10 +2162,8 @@ _efl_ui_multibuttonentry_efl_ui_format_format_cb_set(Eo *obj EINA_UNUSED, Efl_Ui } static void -_efl_ui_multibuttonentry_class_constructor(Efl_Class *klass) +_efl_ui_multibuttonentry_class_constructor(Efl_Class *klass EINA_UNUSED) { - evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); - if (_elm_config->access_mode != ELM_ACCESS_MODE_OFF) _efl_ui_multibuttonentry_smart_focus_next_enable = EINA_TRUE; } @@ -2284,6 +2273,30 @@ ELM_PART_OVERRIDE_TEXT_GET(efl_ui_multibuttonentry, EFL_UI_MULTIBUTTONENTRY, Efl #include "elm_multibuttonentry_item.eo.c" #include "efl_ui_multibuttonentry.eo.c" +#include "efl_ui_multibuttonentry_legacy.eo.h" +#define MY_CLASS_NAME_LEGACY "elm_multibuttonentry" + +static void +_efl_ui_multibuttonentry_legacy_class_constructor(Efl_Class *klass) +{ + evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); +} + +EOLIAN static Eo * +_efl_ui_multibuttonentry_legacy_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED) +{ + obj = efl_constructor(efl_super(obj, EFL_UI_MULTIBUTTONENTRY_LEGACY_CLASS)); + efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); + return obj; +} + +EAPI Evas_Object * +elm_multibuttonentry_add(Evas_Object *parent) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); + return elm_legacy_add(EFL_UI_MULTIBUTTONENTRY_LEGACY_CLASS, parent); +} + /* Legacy APIs */ typedef struct @@ -2336,3 +2349,5 @@ elm_multibuttonentry_format_function_set(Eo *obj, Elm_Multibuttonentry_Format_Cb efl_ui_format_cb_set(obj, mfwd, _format_legacy_to_format_eo_cb, _format_legacy_to_format_eo_free_cb); } + +#include "efl_ui_multibuttonentry_legacy.eo.c" diff --git a/src/lib/elementary/efl_ui_multibuttonentry_legacy.eo b/src/lib/elementary/efl_ui_multibuttonentry_legacy.eo new file mode 100644 index 0000000..e649ed6 --- /dev/null +++ b/src/lib/elementary/efl_ui_multibuttonentry_legacy.eo @@ -0,0 +1,9 @@ +class Efl.Ui.Multibuttonentry_Legacy (Efl.Ui.Multibuttonentry, Efl.Ui.Legacy) +{ + [[Elementary multibuttonentry class]] + data: null; + implements { + class.constructor; + Efl.Object.constructor; + } +} diff --git a/src/lib/elementary/efl_ui_panes.c b/src/lib/elementary/efl_ui_panes.c index 6e334dd..4548c90 100644 --- a/src/lib/elementary/efl_ui_panes.c +++ b/src/lib/elementary/efl_ui_panes.c @@ -19,7 +19,6 @@ #define MY_CLASS_PFX efl_ui_panes #define MY_CLASS_NAME "Efl.Ui.Panes" -#define MY_CLASS_NAME_LEGACY "elm_panes" /** * TODO * Update the minimun height of the bar in the theme. @@ -465,7 +464,6 @@ EOLIAN static Eo * _efl_ui_panes_efl_object_constructor(Eo *obj, Efl_Ui_Panes_Data *_pd EINA_UNUSED) { obj = efl_constructor(efl_super(obj, MY_CLASS)); - efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); efl_access_role_set(obj, EFL_ACCESS_ROLE_SPLIT_PANE); @@ -550,12 +548,6 @@ _efl_ui_panes_fixed_get(Eo *obj EINA_UNUSED, Efl_Ui_Panes_Data *sd) return sd->fixed; } -static void -_efl_ui_panes_class_constructor(Efl_Class *klass) -{ - evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); -} - /* Efl.Part begin */ static Eina_Bool @@ -660,13 +652,30 @@ ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(efl_ui_panes) ELM_LAYOUT_CONTENT_ALIASES_OPS(efl_ui_panes), \ ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_panes) -/* Legacy APIs */ +#include "efl_ui_panes.eo.c" + +#include "efl_ui_panes_legacy.eo.h" +#define MY_CLASS_NAME_LEGACY "elm_panes" + +static void +_efl_ui_panes_legacy_class_constructor(Efl_Class *klass) +{ + evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); +} + +EOLIAN static Eo * +_efl_ui_panes_legacy_efl_object_constructor(Eo *obj, void *_pd EINA_UNUSED) +{ + obj = efl_constructor(efl_super(obj, EFL_UI_PANES_LEGACY_CLASS)); + efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); + return obj; +} EAPI Evas_Object * elm_panes_add(Evas_Object *parent) { EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - return elm_legacy_add(MY_CLASS, parent); + return elm_legacy_add(EFL_UI_PANES_LEGACY_CLASS, parent); } EAPI void @@ -832,6 +841,4 @@ elm_panes_content_right_unset(Evas_Object *obj) return elm_layout_content_unset(obj, "right"); } -/* Legacy APIs end */ - -#include "efl_ui_panes.eo.c" +#include "efl_ui_panes_legacy.eo.c" diff --git a/src/lib/elementary/efl_ui_panes.eo b/src/lib/elementary/efl_ui_panes.eo index bfd8381..41e8021 100644 --- a/src/lib/elementary/efl_ui_panes.eo +++ b/src/lib/elementary/efl_ui_panes.eo @@ -49,7 +49,6 @@ class Efl.Ui.Panes (Efl.Ui.Layout, Efl.Ui.Direction, second: Efl.Ui.Panes.Part; [[The second half of the panes widget (right or bottom)]] } implements { - class.constructor; Efl.Object.constructor; Efl.Ui.Widget.theme_apply; Efl.Ui.Direction.direction { get; set; [[Only supports $vertical and $horizontal. Default is $vertical.]] } diff --git a/src/lib/elementary/efl_ui_panes_legacy.eo b/src/lib/elementary/efl_ui_panes_legacy.eo new file mode 100644 index 0000000..704f709 --- /dev/null +++ b/src/lib/elementary/efl_ui_panes_legacy.eo @@ -0,0 +1,9 @@ +class Efl.Ui.Panes_Legacy(Efl.Ui.Panes, Efl.Ui.Legacy) +{ + [[Elementary panes class]] + data: null; + implements { + class.constructor; + Efl.Object.constructor; + } +} diff --git a/src/lib/elementary/efl_ui_progressbar.c b/src/lib/elementary/efl_ui_progressbar.c index 0fd7171..da43f5d 100644 --- a/src/lib/elementary/efl_ui_progressbar.c +++ b/src/lib/elementary/efl_ui_progressbar.c @@ -19,7 +19,6 @@ #define MY_CLASS_PFX efl_ui_progressbar #define MY_CLASS_NAME "Efl.Ui.Progressbar" -#define MY_CLASS_NAME_LEGACY "elm_progressbar" static const char SIG_CHANGED[] = "changed"; @@ -430,7 +429,6 @@ EOLIAN static Eo * _efl_ui_progressbar_efl_object_constructor(Eo *obj, Efl_Ui_Progressbar_Data *_pd EINA_UNUSED) { obj = efl_constructor(efl_super(obj, MY_CLASS)); - efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); efl_access_role_set(obj, EFL_ACCESS_ROLE_PROGRESS_BAR); @@ -594,12 +592,6 @@ _efl_ui_progressbar_pulse_get(Eo *obj EINA_UNUSED, Efl_Ui_Progressbar_Data *sd) return (sd->pulse_state && sd->pulse); } -EOLIAN static void -_efl_ui_progressbar_class_constructor(Efl_Class *klass) -{ - evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); -} - /* Efl.Part begin */ EOLIAN static Eo * @@ -685,13 +677,29 @@ ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(efl_ui_progressbar) #include "efl_ui_progressbar.eo.c" -/* Legacy APIs */ +#include "efl_ui_progressbar_legacy.eo.h" + +#define MY_CLASS_NAME_LEGACY "elm_progressbar" + +static void +_efl_ui_progressbar_legacy_class_constructor(Efl_Class *klass) +{ + evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); +} + +EOLIAN static Eo * +_efl_ui_progressbar_legacy_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED) +{ + obj = efl_constructor(efl_super(obj, EFL_UI_PROGRESSBAR_LEGACY_CLASS)); + efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); + return obj; +} EAPI Evas_Object * elm_progressbar_add(Evas_Object *parent) { EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - Eo *obj = elm_legacy_add(MY_CLASS, parent); + Eo *obj = elm_legacy_add(EFL_UI_PROGRESSBAR_LEGACY_CLASS, parent); //TIZEN_ONLY(20180212): default of unit format is NULL in Tizen UX. //elm_progressbar_unit_format_set(obj, "%.0f %%"); @@ -860,3 +868,5 @@ elm_progressbar_value_get(const Evas_Object *obj) { return efl_ui_range_value_get(obj); } + +#include "efl_ui_progressbar_legacy.eo.c" diff --git a/src/lib/elementary/efl_ui_progressbar.eo b/src/lib/elementary/efl_ui_progressbar.eo index 514bcb8..694972b 100644 --- a/src/lib/elementary/efl_ui_progressbar.eo +++ b/src/lib/elementary/efl_ui_progressbar.eo @@ -49,7 +49,6 @@ class Efl.Ui.Progressbar (Efl.Ui.Layout, Efl.Ui.Range, Efl.Ui.Format, } } implements { - class.constructor; Efl.Object.constructor; Efl.Ui.Widget.theme_apply; Efl.Ui.Widget.widget_sub_object_add; diff --git a/src/lib/elementary/efl_ui_progressbar_legacy.eo b/src/lib/elementary/efl_ui_progressbar_legacy.eo new file mode 100644 index 0000000..b6bf882 --- /dev/null +++ b/src/lib/elementary/efl_ui_progressbar_legacy.eo @@ -0,0 +1,9 @@ +class Efl.Ui.Progressbar_Legacy (Efl.Ui.Progressbar, Efl.Ui.Legacy) +{ + [[Elementary progressbar class]] + data: null; + implements { + class.constructor; + Efl.Object.constructor; + } +} diff --git a/src/lib/elementary/efl_ui_radio.c b/src/lib/elementary/efl_ui_radio.c index 2dff219..ae36ae7 100644 --- a/src/lib/elementary/efl_ui_radio.c +++ b/src/lib/elementary/efl_ui_radio.c @@ -17,7 +17,6 @@ #define MY_CLASS_PFX efl_ui_radio #define MY_CLASS_NAME "Efl.Ui.Radio" -#define MY_CLASS_NAME_LEGACY "elm_radio" static const Elm_Layout_Part_Alias_Description _text_aliases[] = { @@ -209,7 +208,6 @@ _efl_ui_radio_efl_object_constructor(Eo *obj, Efl_Ui_Radio_Data *pd) if (!elm_widget_theme_klass_get(obj)) elm_widget_theme_klass_set(obj, "radio"); obj = efl_constructor(efl_super(obj, MY_CLASS)); - efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); @@ -337,12 +335,6 @@ _efl_ui_radio_efl_ui_widget_on_access_activate(Eo *obj, Efl_Ui_Radio_Data *_pd E return EINA_TRUE; } -EOLIAN static void -_efl_ui_radio_class_constructor(Efl_Class *klass) -{ - evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); -} - EOLIAN const Efl_Access_Action_Data * _efl_ui_radio_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Efl_Ui_Radio_Data *pd EINA_UNUSED) { @@ -380,13 +372,30 @@ ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(MY_CLASS_PFX) #include "efl_ui_radio.eo.c" +#include "efl_ui_radio_legacy.eo.h" + +#define MY_CLASS_NAME_LEGACY "elm_radio" /* Legacy APIs */ +static void +_efl_ui_radio_legacy_class_constructor(Efl_Class *klass) +{ + evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); +} + +EOLIAN static Eo * +_efl_ui_radio_legacy_efl_object_constructor(Eo *obj, void *_pd EINA_UNUSED) +{ + obj = efl_constructor(efl_super(obj, EFL_UI_RADIO_LEGACY_CLASS)); + efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); + return obj; +} + EAPI Evas_Object * elm_radio_add(Evas_Object *parent) { EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - return elm_legacy_add(MY_CLASS, parent); + return elm_legacy_add(EFL_UI_RADIO_LEGACY_CLASS, parent); } EAPI void @@ -400,3 +409,5 @@ elm_radio_value_get(const Evas_Object *obj) { return efl_ui_nstate_value_get(obj); } + +#include "efl_ui_radio_legacy.eo.c" \ No newline at end of file diff --git a/src/lib/elementary/efl_ui_radio.eo b/src/lib/elementary/efl_ui_radio.eo index 35602e8..f3ec5d6 100644 --- a/src/lib/elementary/efl_ui_radio.eo +++ b/src/lib/elementary/efl_ui_radio.eo @@ -59,7 +59,6 @@ class Efl.Ui.Radio (Efl.Ui.Check, Efl.Access.Widget.Action, Efl.Content) } } implements { - class.constructor; Efl.Object.constructor; Efl.Object.destructor; Efl.Ui.Widget.theme_apply; diff --git a/src/lib/elementary/efl_ui_radio_legacy.eo b/src/lib/elementary/efl_ui_radio_legacy.eo new file mode 100644 index 0000000..da18c8a --- /dev/null +++ b/src/lib/elementary/efl_ui_radio_legacy.eo @@ -0,0 +1,9 @@ +class Efl.Ui.Radio_Legacy (Efl.Ui.Radio, Efl.Ui.Legacy) +{ + [[Elementary radio class]] + data: null; + implements { + class.constructor; + Efl.Object.constructor; + } +} diff --git a/src/lib/elementary/efl_ui_slider.c b/src/lib/elementary/efl_ui_slider.c index 95529c8..2066ef3 100644 --- a/src/lib/elementary/efl_ui_slider.c +++ b/src/lib/elementary/efl_ui_slider.c @@ -18,7 +18,6 @@ #define MY_CLASS_PFX efl_ui_slider #define MY_CLASS_NAME "Efl.Ui.Slider" -#define MY_CLASS_NAME_LEGACY "elm_slider" #define SLIDER_DELAY_CHANGED_INTERVAL 0.2 #define SLIDER_STEP 0.05 @@ -1246,7 +1245,6 @@ EOLIAN static Eo * _efl_ui_slider_efl_object_constructor(Eo *obj, Efl_Ui_Slider_Data *_pd EINA_UNUSED) { obj = efl_constructor(efl_super(obj, MY_CLASS)); - efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); efl_access_role_set(obj, EFL_ACCESS_ROLE_SLIDER); @@ -1364,12 +1362,6 @@ _efl_ui_slider_efl_ui_widget_on_disabled_update(Eo *obj, Efl_Ui_Slider_Data *sd, } // -EOLIAN static void -_efl_ui_slider_class_constructor(Efl_Class *klass) -{ - evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); -} - // A11Y Accessibility EOLIAN static void @@ -1601,13 +1593,42 @@ _efl_ui_slider_part_indicator_visible_mode_get(Eo *obj, void *_pd EINA_UNUSED) /* Efl.Part end */ -/* Legacy APIs */ +/* Internal EO APIs and hidden overrides */ + +ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(efl_ui_slider) +ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(efl_ui_slider) + +#define EFL_UI_SLIDER_EXTRA_OPS \ + ELM_LAYOUT_CONTENT_ALIASES_OPS(efl_ui_slider), \ + ELM_LAYOUT_TEXT_ALIASES_OPS(efl_ui_slider), \ + ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_slider), \ + EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_slider) + +#include "efl_ui_slider.eo.c" + +#include "efl_ui_slider_legacy.eo.h" + +#define MY_CLASS_NAME_LEGACY "elm_slider" + +static void +_efl_ui_slider_legacy_class_constructor(Efl_Class *klass) +{ + evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); +} + +EOLIAN static Eo * +_efl_ui_slider_legacy_efl_object_constructor(Eo *obj, void *_pd EINA_UNUSED) +{ + obj = efl_constructor(efl_super(obj, EFL_UI_SLIDER_LEGACY_CLASS)); + efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); + return obj; +} EAPI Evas_Object * elm_slider_add(Evas_Object *parent) { EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - return elm_legacy_add(MY_CLASS, parent); + return elm_legacy_add(EFL_UI_SLIDER_LEGACY_CLASS, parent); } EAPI void @@ -1879,15 +1900,4 @@ elm_slider_indicator_visible_mode_get(const Evas_Object *obj) return efl_ui_slider_part_indicator_visible_mode_get(efl_part(obj, "indicator")); } -/* Internal EO APIs and hidden overrides */ - -ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(efl_ui_slider) -ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(efl_ui_slider) - -#define EFL_UI_SLIDER_EXTRA_OPS \ - ELM_LAYOUT_CONTENT_ALIASES_OPS(efl_ui_slider), \ - ELM_LAYOUT_TEXT_ALIASES_OPS(efl_ui_slider), \ - ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_slider), \ - EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_slider) - -#include "efl_ui_slider.eo.c" +#include "efl_ui_slider_legacy.eo.c" diff --git a/src/lib/elementary/efl_ui_slider.eo b/src/lib/elementary/efl_ui_slider.eo index 173c534..212252d 100644 --- a/src/lib/elementary/efl_ui_slider.eo +++ b/src/lib/elementary/efl_ui_slider.eo @@ -34,7 +34,6 @@ class Efl.Ui.Slider (Efl.Ui.Layout, Efl.Ui.Range, Efl.Ui.Direction, [[A floating indicator above the slider.]] } implements { - class.constructor; Efl.Object.constructor; Efl.Canvas.Group.group_calculate; Efl.Ui.Widget.theme_apply; diff --git a/src/lib/elementary/efl_ui_slider_legacy.eo b/src/lib/elementary/efl_ui_slider_legacy.eo new file mode 100644 index 0000000..c6653c0 --- /dev/null +++ b/src/lib/elementary/efl_ui_slider_legacy.eo @@ -0,0 +1,9 @@ +class Efl.Ui.Slider_Legacy (Efl.Ui.Slider, Efl.Ui.Legacy) +{ + [[Elementary slider class]] + data: null; + implements { + class.constructor; + Efl.Object.constructor; + } +} diff --git a/src/lib/elementary/efl_ui_video.c b/src/lib/elementary/efl_ui_video.c index 9d19b8a..96a68d7 100644 --- a/src/lib/elementary/efl_ui_video.c +++ b/src/lib/elementary/efl_ui_video.c @@ -18,7 +18,6 @@ #define MY_CLASS EFL_UI_VIDEO_CLASS #define MY_CLASS_NAME "Efl.Ui.Video" -#define MY_CLASS_NAME_LEGACY "elm_video" static const Evas_Smart_Cb_Description _smart_callbacks[] = { {SIG_LAYOUT_FOCUSED, ""}, /**< handled by elm_layout */ @@ -258,18 +257,10 @@ _efl_ui_video_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Video_Data *sd) efl_canvas_group_del(efl_super(obj, MY_CLASS)); } -EAPI Evas_Object * -elm_video_add(Evas_Object *parent) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - return elm_legacy_add(MY_CLASS, parent); -} - EOLIAN static Eo * _efl_ui_video_efl_object_constructor(Eo *obj, Efl_Ui_Video_Data *_pd EINA_UNUSED) { obj = efl_constructor(efl_super(obj, MY_CLASS)); - efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); efl_access_role_set(obj, EFL_ACCESS_ROLE_ANIMATION); @@ -373,12 +364,6 @@ _efl_ui_video_remember_position_get(Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *sd) return sd->remember; } -EOLIAN static void -_efl_ui_video_class_constructor(Efl_Class *klass) -{ - evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); -} - EOLIAN const Efl_Access_Action_Data * _efl_ui_video_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *pd EINA_UNUSED) { @@ -390,6 +375,42 @@ _efl_ui_video_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Efl_ }; return &atspi_actions[0]; } +/* Internal EO APIs and hidden overrides */ + +ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_video, Efl_Ui_Video_Data) + +/* Internal EO APIs and hidden overrides */ + +#define EFL_UI_VIDEO_EXTRA_OPS \ + ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_video), \ + EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_video) + +#include "efl_ui_video.eo.c" + +#include "efl_ui_video_legacy.eo.h" + +#define MY_CLASS_NAME_LEGACY "elm_video" + +static void +_efl_ui_video_legacy_class_constructor(Efl_Class *klass) +{ + evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); +} + +EOLIAN static Eo * +_efl_ui_video_legacy_efl_object_constructor(Eo *obj, void *_pd EINA_UNUSED) +{ + obj = efl_constructor(efl_super(obj, EFL_UI_VIDEO_LEGACY_CLASS)); + efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); + return obj; +} + +EAPI Evas_Object * +elm_video_add(Evas_Object *parent) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); + return elm_legacy_add(EFL_UI_VIDEO_LEGACY_CLASS, parent); +} EAPI Eina_Bool elm_video_file_set(Eo *obj, const char *filename) @@ -475,14 +496,4 @@ elm_video_pause(Evas_Object *obj) efl_player_play_set(obj, EINA_FALSE); } -/* Internal EO APIs and hidden overrides */ - -ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_video, Efl_Ui_Video_Data) - -/* Internal EO APIs and hidden overrides */ - -#define EFL_UI_VIDEO_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_video), \ - EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_video) - -#include "efl_ui_video.eo.c" +#include "efl_ui_video_legacy.eo.c" diff --git a/src/lib/elementary/efl_ui_video.eo b/src/lib/elementary/efl_ui_video.eo index 5971f26..32aa8ef 100644 --- a/src/lib/elementary/efl_ui_video.eo +++ b/src/lib/elementary/efl_ui_video.eo @@ -42,7 +42,6 @@ class Efl.Ui.Video (Efl.Ui.Layout, Efl.File, } } implements { - class.constructor; Efl.Object.constructor; Efl.File.file { get; set; } Efl.Ui.Widget.widget_event; diff --git a/src/lib/elementary/efl_ui_video_legacy.eo b/src/lib/elementary/efl_ui_video_legacy.eo new file mode 100644 index 0000000..9edfc48 --- /dev/null +++ b/src/lib/elementary/efl_ui_video_legacy.eo @@ -0,0 +1,9 @@ +class Efl.Ui.Video_Legacy (Efl.Ui.Video, Efl.Ui.Legacy) +{ + [[Efl UI video class]] + data: null; + implements { + class.constructor; + Efl.Object.constructor; + } +} diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c index c784fc9..68f11c1 100644 --- a/src/lib/elementary/efl_ui_widget.c +++ b/src/lib/elementary/efl_ui_widget.c @@ -61,9 +61,6 @@ 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; -/* FIXME: EAPI because of elm_code_widget test case */ -EAPI Eina_Bool _elm_legacy_add = EINA_FALSE; - struct _Elm_Event_Cb_Data { Elm_Event_Cb func; @@ -5504,11 +5501,6 @@ _efl_ui_widget_efl_object_constructor(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UN Eo *parent = NULL; sd->on_create = EINA_TRUE; - if (_elm_legacy_add) - { - 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); @@ -5604,13 +5596,6 @@ _efl_ui_widget_efl_object_destructor(Eo *obj, Elm_Widget_Smart_Data *sd) } /* internal eo */ -static void -_efl_ui_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 _efl_ui_widget_efl_object_debug_name_override(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED, Eina_Strbuf *sb) @@ -6968,7 +6953,6 @@ static void _elm_widget_class_color_clear(Eo *obj EINA_UNUSED, Elm_Widget_Smart_ EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_widget), \ ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_widget), \ ELM_PART_TEXT_DEFAULT_OPS(efl_ui_widget), \ - EFL_OBJECT_OP_FUNC(efl_canvas_object_legacy_ctor, _efl_ui_widget_legacy_ctor), \ EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _efl_ui_widget_efl_object_dbg_info_get), \ /*********************************************************************************** \ * TIZEN_ONLY_FEATURE: apply Tizen's color_class features. * \ diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index 83b27e4..78a508a 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -5874,7 +5874,6 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U /* FIXME: Major hack: calling the constructor in the middle of finalize. */ efl_constructor(efl_super(obj, MY_CLASS)); - efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); evas_object_focus_set(obj, EINA_TRUE); @@ -7814,9 +7813,8 @@ _elm_win_focus_auto_hide(Evas_Object *obj) } EOLIAN static void -_efl_ui_win_class_constructor(Efl_Class *klass) +_efl_ui_win_class_constructor(Efl_Class *klass EINA_UNUSED) { - evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); } EOLIAN static void @@ -9363,114 +9361,6 @@ _fake_canvas_set(Evas_Object *obj, Ecore_Evas *oee) _elm_win_need_frame_adjust(sd, ecore_evas_engine_name_get(oee)); } -EAPI Evas_Object * -elm_win_add(Evas_Object *parent, const char *name, Efl_Ui_Win_Type type) -{ -//TIZEN_ONLY(20160628): Add Performance log for cold booting -#ifdef ENABLE_TTRACE - traceBegin(TTRACE_TAG_EFL, "elm_win_add"); -#endif -// - const Efl_Class *klass = MY_CLASS; - -//TIZEN_ONLY(20161202): Temporary code - Apply mirroring in elm_win_add() - if (_elm_config && _elm_config->language_auto_mirrored) - { - if (!strcmp(E_("default:LTR"), "default:RTL")) - elm_config_mirrored_set(EINA_TRUE); - else - elm_config_mirrored_set(EINA_FALSE); - } -// - - switch ((int) type) - { - case ELM_WIN_INLINED_IMAGE: klass = EFL_UI_WIN_INLINED_CLASS; break; - case ELM_WIN_SOCKET_IMAGE: klass = EFL_UI_WIN_SOCKET_CLASS; break; - default: break; - } -// TIZEN_ONLY(20160218): Improve launching performance. - if (_precreated_win_obj) - { - ELM_WIN_DATA_GET(_precreated_win_obj, sd); - - if (sd) - { - if (sd->parent == parent) - { - Evas_Object *tmp = _precreated_win_obj; - TRAP(sd, name_class_set, name, _elm_appname); - //TIZEN_ONLY(20180131):Added code to set the window title - TRAP(sd, title_set, sd->title ? sd->title : name); - _precreated_win_obj = NULL; - if (sd->type != type) - efl_ui_win_type_set(tmp, type); - INF("Return precreated obj(%p).", tmp); - - /* TIZEN_ONLY(20180117): Apply paragraph direction according to locale */ - if (!strcmp(E_("default:LTR"), "default:RTL")) - efl_canvas_object_paragraph_direction_set(tmp, EVAS_BIDI_DIRECTION_ANY_RTL); - else - efl_canvas_object_paragraph_direction_set(tmp, EVAS_BIDI_DIRECTION_LTR); - /* END */ - - return tmp; - } - } - } -// - - Evas_Object *obj = elm_legacy_add(klass, parent, - efl_ui_win_name_set(efl_added, name), - efl_ui_win_type_set(efl_added, type)); - -//TIZEN_ONLY(20160628): Add Performance log for cold booting -#ifdef ENABLE_TTRACE - traceEnd(TTRACE_TAG_EFL); -#endif -// - return obj; -} - -EAPI Evas_Object * -elm_win_fake_add(Ecore_Evas *ee) -{ - 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 * -elm_win_util_standard_add(const char *name, const char *title) -{ - Evas_Object *win; - - 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); - return win; -} - -EAPI Evas_Object * -elm_win_util_dialog_add(Evas_Object *parent, const char *name, const char *title) -{ - Evas_Object *win; - - 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); - return win; -} - /** * @internal * @@ -10068,3 +9958,130 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_win, Efl_Ui_Win_Data) EFL_OBJECT_OP_FUNC(efl_canvas_object_legacy_ctor, _efl_ui_win_efl_canvas_object_legacy_ctor) #include "efl_ui_win.eo.c" + +#include "efl_ui_win_legacy.eo.h" + +static void +_efl_ui_win_legacy_class_constructor(Efl_Class *klass) +{ + evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); +} + +EOLIAN static Eo * +_efl_ui_win_legacy_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED) +{ + obj = efl_constructor(efl_super(obj, EFL_UI_WIN_LEGACY_CLASS)); + efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); + return obj; +} + +EAPI Evas_Object * +elm_win_add(Evas_Object *parent, const char *name, Efl_Ui_Win_Type type) +{ +//TIZEN_ONLY(20160628): Add Performance log for cold booting +#ifdef ENABLE_TTRACE + traceBegin(TTRACE_TAG_EFL, "elm_win_add"); +#endif +// + const Efl_Class *klass = EFL_UI_WIN_LEGACY_CLASS; + +//TIZEN_ONLY(20161202): Temporary code - Apply mirroring in elm_win_add() + if (_elm_config && _elm_config->language_auto_mirrored) + { + if (!strcmp(E_("default:LTR"), "default:RTL")) + elm_config_mirrored_set(EINA_TRUE); + else + elm_config_mirrored_set(EINA_FALSE); + } +// + + switch ((int) type) + { + case ELM_WIN_INLINED_IMAGE: klass = EFL_UI_WIN_INLINED_CLASS; break; + case ELM_WIN_SOCKET_IMAGE: klass = EFL_UI_WIN_SOCKET_CLASS; break; + default: break; + } +// TIZEN_ONLY(20160218): Improve launching performance. + if (_precreated_win_obj) + { + ELM_WIN_DATA_GET(_precreated_win_obj, sd); + + if (sd) + { + if (sd->parent == parent) + { + Evas_Object *tmp = _precreated_win_obj; + TRAP(sd, name_class_set, name, _elm_appname); + //TIZEN_ONLY(20180131):Added code to set the window title + TRAP(sd, title_set, sd->title ? sd->title : name); + _precreated_win_obj = NULL; + if (sd->type != type) + efl_ui_win_type_set(tmp, type); + INF("Return precreated obj(%p).", tmp); + + /* TIZEN_ONLY(20180117): Apply paragraph direction according to locale */ + if (!strcmp(E_("default:LTR"), "default:RTL")) + efl_canvas_object_paragraph_direction_set(tmp, EVAS_BIDI_DIRECTION_ANY_RTL); + else + efl_canvas_object_paragraph_direction_set(tmp, EVAS_BIDI_DIRECTION_LTR); + /* END */ + + return tmp; + } + } + } +// + + Evas_Object *obj = elm_legacy_add(klass, parent, + efl_ui_win_name_set(efl_added, name), + efl_ui_win_type_set(efl_added, type)); + +//TIZEN_ONLY(20160628): Add Performance log for cold booting +#ifdef ENABLE_TTRACE + traceEnd(TTRACE_TAG_EFL); +#endif +// + return obj; +} + + +EAPI Evas_Object * +elm_win_fake_add(Ecore_Evas *ee) +{ + return elm_legacy_add(EFL_UI_WIN_LEGACY_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 * +elm_win_util_standard_add(const char *name, const char *title) +{ + Evas_Object *win; + + win = elm_legacy_add(EFL_UI_WIN_LEGACY_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); + return win; +} + +EAPI Evas_Object * +elm_win_util_dialog_add(Evas_Object *parent, const char *name, const char *title) +{ + Evas_Object *win; + + win = elm_legacy_add(EFL_UI_WIN_LEGACY_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); + return win; +} + +#include "efl_ui_win_legacy.eo.c" diff --git a/src/lib/elementary/efl_ui_win_legacy.eo b/src/lib/elementary/efl_ui_win_legacy.eo new file mode 100644 index 0000000..fe13a04 --- /dev/null +++ b/src/lib/elementary/efl_ui_win_legacy.eo @@ -0,0 +1,9 @@ +class Efl.Ui.Win_Legacy (Efl.Ui.Win, Efl.Ui.Legacy) +{ + [[Efl UI window class]] + data: null; + implements { + class.constructor; + Efl.Object.constructor; + } +} diff --git a/src/lib/elementary/elm_actionslider.eo b/src/lib/elementary/elm_actionslider.eo index 30f78db..351cb28 100644 --- a/src/lib/elementary/elm_actionslider.eo +++ b/src/lib/elementary/elm_actionslider.eo @@ -10,7 +10,7 @@ enum Elm.Actionslider.Pos all = (1 << 3) - 1 [[All positions for left/center/right.]] } -class Elm.Actionslider (Efl.Ui.Layout, Efl.Ui.Selectable) +class Elm.Actionslider (Efl.Ui.Layout, Efl.Ui.Selectable, Efl.Ui.Legacy) { [[An actionslider is a switcher for 2 or 3 labels diff --git a/src/lib/elementary/elm_box.eo b/src/lib/elementary/elm_box.eo index 9249599..c728048 100644 --- a/src/lib/elementary/elm_box.eo +++ b/src/lib/elementary/elm_box.eo @@ -1,6 +1,6 @@ import evas_box; -class Elm.Box (Efl.Ui.Widget, Efl.Ui.Focus.Composition) +class Elm.Box (Efl.Ui.Widget, Efl.Ui.Focus.Composition, Efl.Ui.Legacy) { [[Elementary box class]] legacy_prefix: elm_box; diff --git a/src/lib/elementary/elm_bubble.eo b/src/lib/elementary/elm_bubble.eo index f696846..2b326ab 100644 --- a/src/lib/elementary/elm_bubble.eo +++ b/src/lib/elementary/elm_bubble.eo @@ -12,7 +12,7 @@ enum Elm.Bubble.Pos bottom_right [[The arrow of the bubble points to the bottom right corner.]] } -class Elm.Bubble (Efl.Ui.Layout, Efl.Ui.Clickable) +class Elm.Bubble (Efl.Ui.Layout, Efl.Ui.Clickable, Efl.Ui.Legacy) { [[Speech bubble widget used in messaging applications]] diff --git a/src/lib/elementary/elm_calendar.eo b/src/lib/elementary/elm_calendar.eo index aba5782..e72e6f2 100644 --- a/src/lib/elementary/elm_calendar.eo +++ b/src/lib/elementary/elm_calendar.eo @@ -72,7 +72,8 @@ struct Elm.Calendar.Mark; [[Item handle for a calendar mark. with @Elm.Calendar.mark_del. ]] -class Elm.Calendar (Efl.Ui.Layout, Efl.Ui.Focus.Composition, Efl.Access.Widget.Action) +class Elm.Calendar (Efl.Ui.Layout, Efl.Ui.Focus.Composition, Efl.Access.Widget.Action, + Efl.Ui.Legacy) { [[Calendar widget diff --git a/src/lib/elementary/elm_clock.eo b/src/lib/elementary/elm_clock.eo index 16e4868..3bd3f0f 100644 --- a/src/lib/elementary/elm_clock.eo +++ b/src/lib/elementary/elm_clock.eo @@ -18,7 +18,7 @@ enum Elm.Clock.Edit_Mode all = (1 << 6) - 1 [[All digits should be editable.]] } -class Elm.Clock (Efl.Ui.Layout, Efl.Ui.Focus.Composition) +class Elm.Clock (Efl.Ui.Layout, Efl.Ui.Focus.Composition, Efl.Ui.Legacy) { [[Digital clock widget diff --git a/src/lib/elementary/elm_code.h b/src/lib/elementary/elm_code.h index 9ffd0e9..3a0887b 100644 --- a/src/lib/elementary/elm_code.h +++ b/src/lib/elementary/elm_code.h @@ -11,6 +11,7 @@ #include "elm_code_parse.h" #include "elm_code_syntax.h" #include "elm_code_widget.eo.h" +#include "elm_code_widget_legacy.eo.h" #include "elm_code_widget_legacy.h" #include "elm_code_widget_selection.h" #include "elm_code_diff_widget.h" diff --git a/src/lib/elementary/elm_code_diff_widget.c b/src/lib/elementary/elm_code_diff_widget.c index eec32ee..d8ec149 100644 --- a/src/lib/elementary/elm_code_diff_widget.c +++ b/src/lib/elementary/elm_code_diff_widget.c @@ -95,7 +95,7 @@ elm_code_diff_widget_add(Evas_Object *parent, Elm_Code *code) // left side of diff wcode1 = elm_code_create(); elm_code_parser_standard_add(wcode1, ELM_CODE_PARSER_STANDARD_DIFF); - widget_left = efl_add(ELM_CODE_WIDGET_CLASS, parent, elm_obj_code_widget_code_set(efl_added, wcode1)); + widget_left = elm_legacy_add(ELM_CODE_WIDGET_LEGACY_CLASS, parent, elm_obj_code_widget_code_set(efl_added, wcode1)); evas_object_size_hint_weight_set(widget_left, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(widget_left, EVAS_HINT_FILL, EVAS_HINT_FILL); @@ -106,7 +106,7 @@ elm_code_diff_widget_add(Evas_Object *parent, Elm_Code *code) // right side of diff wcode2 = elm_code_create(); elm_code_parser_standard_add(wcode2, ELM_CODE_PARSER_STANDARD_DIFF); - widget_right = efl_add(ELM_CODE_WIDGET_CLASS, parent, elm_obj_code_widget_code_set(efl_added, wcode2)); + widget_right = elm_legacy_add(ELM_CODE_WIDGET_LEGACY_CLASS, parent, elm_obj_code_widget_code_set(efl_added, wcode2)); evas_object_size_hint_weight_set(widget_right, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(widget_right, EVAS_HINT_FILL, EVAS_HINT_FILL); diff --git a/src/lib/elementary/elm_code_widget.c b/src/lib/elementary/elm_code_widget.c index 5d1fc78..21abee7 100644 --- a/src/lib/elementary/elm_code_widget.c +++ b/src/lib/elementary/elm_code_widget.c @@ -59,12 +59,19 @@ static Eina_Unicode status_icons[] = { static void _elm_code_widget_resize(Elm_Code_Widget *widget, Elm_Code_Line *newline); #ifndef ELM_CODE_TEST + +#include "elm_code_widget_legacy.eo.h" + EAPI Evas_Object * elm_code_widget_add(Evas_Object *parent, Elm_Code *code) { EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - return elm_legacy_add(MY_CLASS, parent, elm_obj_code_widget_code_set(efl_added, code)); + return elm_legacy_add(ELM_CODE_WIDGET_LEGACY_CLASS, parent, + elm_obj_code_widget_code_set(efl_added, code)); } + +#include "elm_code_widget_legacy.eo.c" + #endif // ELM_CODE_TEST EOLIAN static Eo * diff --git a/src/lib/elementary/elm_code_widget_legacy.eo b/src/lib/elementary/elm_code_widget_legacy.eo new file mode 100644 index 0000000..1c228b3 --- /dev/null +++ b/src/lib/elementary/elm_code_widget_legacy.eo @@ -0,0 +1,5 @@ +class Elm.Code_Widget_Legacy (Elm.Code_Widget, Efl.Ui.Legacy) +{ + [[Elementary code widget]] + data: null; +} diff --git a/src/lib/elementary/elm_colorselector.eo b/src/lib/elementary/elm_colorselector.eo index 2449b8b..6a18f28 100644 --- a/src/lib/elementary/elm_colorselector.eo +++ b/src/lib/elementary/elm_colorselector.eo @@ -13,7 +13,7 @@ enum Elm.Colorselector.Mode } class Elm.Colorselector (Efl.Ui.Layout, Efl.Ui.Focus.Composition, - Efl.Access.Widget.Action, Efl.Ui.Clickable) + Efl.Access.Widget.Action, Efl.Ui.Clickable, Efl.Ui.Legacy) { [[Elementary colorselector class]] legacy_prefix: elm_colorselector; diff --git a/src/lib/elementary/elm_combobox.eo b/src/lib/elementary/elm_combobox.eo index d0c914b..d8fa736 100644 --- a/src/lib/elementary/elm_combobox.eo +++ b/src/lib/elementary/elm_combobox.eo @@ -1,6 +1,6 @@ class Elm.Combobox (Efl.Ui.Button, Efl.Ui.Selectable, Efl.Access.Widget.Action, - Elm.Entry, Elm.Genlist, Elm.Hover) + Elm.Entry, Elm.Genlist, Elm.Hover, Efl.Ui.Legacy) { [[Elementary combobox class]] legacy_prefix: elm_combobox; diff --git a/src/lib/elementary/elm_conformant.eo b/src/lib/elementary/elm_conformant.eo index 5b14742..6fbbe7d 100644 --- a/src/lib/elementary/elm_conformant.eo +++ b/src/lib/elementary/elm_conformant.eo @@ -1,4 +1,4 @@ -class Elm.Conformant (Efl.Ui.Layout) +class Elm.Conformant (Efl.Ui.Layout, Efl.Ui.Legacy) { [[Elementary conformant class]] legacy_prefix: elm_conformant; diff --git a/src/lib/elementary/elm_ctxpopup.eo b/src/lib/elementary/elm_ctxpopup.eo index e0ba25d..141947b 100644 --- a/src/lib/elementary/elm_ctxpopup.eo +++ b/src/lib/elementary/elm_ctxpopup.eo @@ -9,7 +9,7 @@ enum Elm.Ctxpopup.Direction } class Elm.Ctxpopup (Efl.Ui.Layout, Efl.Ui.Focus.Layer, Efl.Access.Widget.Action, - Efl.Ui.Menu) + Efl.Ui.Menu, Efl.Ui.Legacy) { [[Elementary context popup class]] legacy_prefix: elm_ctxpopup; diff --git a/src/lib/elementary/elm_ctxpopup_item.eo b/src/lib/elementary/elm_ctxpopup_item.eo index 190e021..481c98b 100644 --- a/src/lib/elementary/elm_ctxpopup_item.eo +++ b/src/lib/elementary/elm_ctxpopup_item.eo @@ -1,4 +1,5 @@ -class Elm.Ctxpopup.Item(Elm.Widget.Item, Efl.Ui.Item, Efl.Access.Widget.Action) +class Elm.Ctxpopup.Item(Elm.Widget.Item, Efl.Ui.Item, Efl.Access.Widget.Action, + Efl.Ui.Legacy) { [[Elementary context popup item class]] legacy_prefix: elm_ctxpopup_item; diff --git a/src/lib/elementary/elm_datetime.c b/src/lib/elementary/elm_datetime.c index f64f1ec..4069722 100644 --- a/src/lib/elementary/elm_datetime.c +++ b/src/lib/elementary/elm_datetime.c @@ -17,11 +17,29 @@ #include "elm_datetime.h" +#include "efl_ui_clock_legacy.eo.h" + +#define MY_CLASS_NAME_LEGACY "elm_datetime" + +static void +_efl_ui_clock_legacy_class_constructor(Efl_Class *klass) +{ + evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); +} + +EOLIAN static Eo * +_efl_ui_clock_legacy_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED) +{ + obj = efl_constructor(efl_super(obj, EFL_UI_CLOCK_LEGACY_CLASS)); + efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); + return obj; +} + EAPI Evas_Object * elm_datetime_add(Evas_Object *parent) { EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - return elm_legacy_add(EFL_UI_CLOCK_CLASS, parent); + return elm_legacy_add(EFL_UI_CLOCK_LEGACY_CLASS, parent); } EAPI void @@ -203,3 +221,5 @@ elm_datetime_value_max_get(const Evas_Object *obj, Efl_Time *maxtime) return EINA_TRUE; } + +#include "efl_ui_clock_legacy.eo.c" diff --git a/src/lib/elementary/elm_dayselector.eo b/src/lib/elementary/elm_dayselector.eo index 39427aa..d95ca9f 100644 --- a/src/lib/elementary/elm_dayselector.eo +++ b/src/lib/elementary/elm_dayselector.eo @@ -17,7 +17,7 @@ enum Elm.Dayselector.Day max [[Sentinel value to indicate last enum field during iteration]] } -class Elm.Dayselector (Efl.Ui.Layout) +class Elm.Dayselector (Efl.Ui.Layout, Efl.Ui.Legacy) { [[Elementary dayselector class]] legacy_prefix: elm_dayselector; diff --git a/src/lib/elementary/elm_diskselector.eo b/src/lib/elementary/elm_diskselector.eo index 29c5787..77282aa 100644 --- a/src/lib/elementary/elm_diskselector.eo +++ b/src/lib/elementary/elm_diskselector.eo @@ -1,7 +1,7 @@ class Elm.Diskselector (Efl.Ui.Widget, Elm.Interface_Scrollable, Efl.Access.Widget.Action, Efl.Ui.Clickable, Efl.Ui.Scrollable, - Efl.Ui.Selectable) + Efl.Ui.Selectable, Efl.Ui.Legacy) { [[Elementary diskselector class]] legacy_prefix: elm_diskselector; diff --git a/src/lib/elementary/elm_diskselector_item.eo b/src/lib/elementary/elm_diskselector_item.eo index 9a281cc..740364f 100644 --- a/src/lib/elementary/elm_diskselector_item.eo +++ b/src/lib/elementary/elm_diskselector_item.eo @@ -1,4 +1,4 @@ -class Elm.Diskselector.Item(Elm.Widget.Item) +class Elm.Diskselector.Item(Elm.Widget.Item, Efl.Ui.Legacy) { [[Elementary diskselector item class]] legacy_prefix: elm_diskselector_item; diff --git a/src/lib/elementary/elm_entry.eo b/src/lib/elementary/elm_entry.eo index 541ca6e..ca1a4d7 100644 --- a/src/lib/elementary/elm_entry.eo +++ b/src/lib/elementary/elm_entry.eo @@ -5,7 +5,8 @@ type Elm_Entry_Filter_Cb: __undefined_type; [[Elementary entry filter callback t class Elm.Entry (Efl.Ui.Layout, Elm.Interface_Scrollable, Efl.Ui.Clickable, Efl.Access.Text, Efl.Access.Editable.Text, Efl.File, - Efl.Ui.Selectable, Efl.Ui.Scrollable, Efl.Access.Widget.Action) + Efl.Ui.Selectable, Efl.Ui.Scrollable, Efl.Access.Widget.Action, + Efl.Ui.Legacy) { [[Elementary entry class]] legacy_prefix: elm_entry; diff --git a/src/lib/elementary/elm_fileselector.eo b/src/lib/elementary/elm_fileselector.eo index c1a4e43..e7ff91f 100644 --- a/src/lib/elementary/elm_fileselector.eo +++ b/src/lib/elementary/elm_fileselector.eo @@ -1,6 +1,6 @@ class Elm.Fileselector (Efl.Ui.Layout, Elm.Interface.Fileselector, Efl.Access.Widget.Action, - Efl.Ui.Clickable, Efl.Ui.Selectable) + Efl.Ui.Clickable, Efl.Ui.Selectable, Efl.Ui.Legacy) { [[Elementary fileselector class]] legacy_prefix: elm_fileselector; diff --git a/src/lib/elementary/elm_fileselector_button.eo b/src/lib/elementary/elm_fileselector_button.eo index 728a086..9ed6c55 100644 --- a/src/lib/elementary/elm_fileselector_button.eo +++ b/src/lib/elementary/elm_fileselector_button.eo @@ -1,4 +1,5 @@ -class Elm.Fileselector_Button (Efl.Ui.Button, Elm.Interface.Fileselector) +class Elm.Fileselector_Button (Efl.Ui.Button, Elm.Interface.Fileselector, + Efl.Ui.Legacy) { [[Elementary fileselector button class]] event_prefix: elm_fileselector_button; diff --git a/src/lib/elementary/elm_fileselector_entry.eo b/src/lib/elementary/elm_fileselector_entry.eo index 1b267b8..2959619 100644 --- a/src/lib/elementary/elm_fileselector_entry.eo +++ b/src/lib/elementary/elm_fileselector_entry.eo @@ -1,5 +1,5 @@ class Elm.Fileselector_Entry (Efl.Ui.Layout, Elm.Interface.Fileselector, - Efl.Ui.Clickable, Efl.Ui.Selectable) + Efl.Ui.Clickable, Efl.Ui.Selectable, Efl.Ui.Legacy) { [[Elementary fileselector entry class]] event_prefix: elm_fileselector_entry; diff --git a/src/lib/elementary/elm_flipselector.eo b/src/lib/elementary/elm_flipselector.eo index a7ee1eb..a1e7538 100644 --- a/src/lib/elementary/elm_flipselector.eo +++ b/src/lib/elementary/elm_flipselector.eo @@ -1,6 +1,6 @@ class Elm.Flipselector (Efl.Ui.Layout, Efl.Ui.Range, Efl.Access.Widget.Action, - Efl.Ui.Selectable) + Efl.Ui.Selectable, Efl.Ui.Legacy) { [[Elementary flipselector class]] legacy_prefix: elm_flipselector; diff --git a/src/lib/elementary/elm_gengrid.eo b/src/lib/elementary/elm_gengrid.eo index 5e2ca8c..cf8c8ff 100644 --- a/src/lib/elementary/elm_gengrid.eo +++ b/src/lib/elementary/elm_gengrid.eo @@ -12,7 +12,7 @@ enum Elm.Gengrid.Reorder_Type class Elm.Gengrid (Efl.Ui.Layout, Efl.Ui.Focus.Composition, Elm.Interface_Scrollable, Efl.Ui.Clickable, Efl.Access.Widget.Action, - Efl.Access.Selection) + Efl.Access.Selection, Efl.Ui.Legacy) { [[Elementary gengrid class]] legacy_prefix: elm_gengrid; diff --git a/src/lib/elementary/elm_gengrid_item.eo b/src/lib/elementary/elm_gengrid_item.eo index 3ecc7e4..1575ad4 100644 --- a/src/lib/elementary/elm_gengrid_item.eo +++ b/src/lib/elementary/elm_gengrid_item.eo @@ -25,7 +25,7 @@ enum Elm.Gengrid.Item.Field_Type } -class Elm.Gengrid.Item(Elm.Widget.Item.Static_Focus, Efl.Ui.Focus.Object) +class Elm.Gengrid.Item(Elm.Widget.Item.Static_Focus, Efl.Ui.Focus.Object, Efl.Ui.Legacy) { [[Elementary gengrid item class]] legacy_prefix: elm_gengrid_item; diff --git a/src/lib/elementary/elm_genlist.eo b/src/lib/elementary/elm_genlist.eo index 29c8d4e..97bfb3d 100644 --- a/src/lib/elementary/elm_genlist.eo +++ b/src/lib/elementary/elm_genlist.eo @@ -4,7 +4,7 @@ import elm_genlist_item; class Elm.Genlist (Efl.Ui.Layout, Efl.Ui.Focus.Composition, Elm.Interface_Scrollable, Efl.Ui.Clickable, Efl.Access.Widget_Action, Efl.Access.Selection, - Efl.Ui.Selectable) + Efl.Ui.Selectable, Efl.Ui.Legacy) { [[Elementary genlist class]] legacy_prefix: elm_genlist; diff --git a/src/lib/elementary/elm_genlist_item.eo b/src/lib/elementary/elm_genlist_item.eo index fbfcd8e..8e9d58f 100644 --- a/src/lib/elementary/elm_genlist_item.eo +++ b/src/lib/elementary/elm_genlist_item.eo @@ -38,7 +38,7 @@ enum Elm.Genlist.Item.Scrollto_Type bottom = (1 << 3) [[To the bottom of viewport.]] } -class Elm.Genlist.Item(Elm.Widget.Item.Static_Focus) +class Elm.Genlist.Item(Elm.Widget.Item.Static_Focus, Efl.Ui.Legacy) { [[Elementary genlist item class]] legacy_prefix: elm_genlist_item; diff --git a/src/lib/elementary/elm_gesture_layer.eo b/src/lib/elementary/elm_gesture_layer.eo index 5ef2f25..114e060 100644 --- a/src/lib/elementary/elm_gesture_layer.eo +++ b/src/lib/elementary/elm_gesture_layer.eo @@ -31,7 +31,7 @@ enum Elm.Gesture.State abort [[Ongoing gesture was aborted]] } -class Elm.Gesture_Layer (Efl.Ui.Widget) +class Elm.Gesture_Layer (Efl.Ui.Widget, Efl.Ui.Legacy) { [[Elementary gesture layer class]] legacy_prefix: elm_gesture_layer; diff --git a/src/lib/elementary/elm_glview.eo b/src/lib/elementary/elm_glview.eo index aafb81b..e6ec64c 100644 --- a/src/lib/elementary/elm_glview.eo +++ b/src/lib/elementary/elm_glview.eo @@ -80,7 +80,7 @@ enum Elm.GLView.Render.Policy always = 2 [[Render always even when it is not visible]] } -class Elm.Glview (Efl.Ui.Widget, Efl.Gfx.View) +class Elm.Glview (Efl.Ui.Widget, Efl.Gfx.View, Efl.Ui.Legacy) { [[Elementary GL view class]] legacy_prefix: elm_glview; diff --git a/src/lib/elementary/elm_grid.eo b/src/lib/elementary/elm_grid.eo index b8e685f..61996cd 100644 --- a/src/lib/elementary/elm_grid.eo +++ b/src/lib/elementary/elm_grid.eo @@ -1,4 +1,4 @@ -class Elm.Grid (Efl.Ui.Widget, Efl.Ui.Focus.Composition) +class Elm.Grid (Efl.Ui.Widget, Efl.Ui.Focus.Composition, Efl.Ui.Legacy) { [[Elementary grid class]] legacy_prefix: elm_grid; diff --git a/src/lib/elementary/elm_hover.eo b/src/lib/elementary/elm_hover.eo index 6ea3836..5866ced 100644 --- a/src/lib/elementary/elm_hover.eo +++ b/src/lib/elementary/elm_hover.eo @@ -7,7 +7,8 @@ enum Elm.Hover.Axis both [[ELM_HOVER_AXIS_BOTH -- both.]] } -class Elm.Hover (Efl.Ui.Layout, Efl.Ui.Focus.Layer, Efl.Ui.Clickable, Efl.Access.Widget.Action) +class Elm.Hover (Efl.Ui.Layout, Efl.Ui.Focus.Layer, Efl.Ui.Clickable, + Efl.Access.Widget.Action, Efl.Ui.Legacy) { [[Elementary hover class]] legacy_prefix: elm_hover; diff --git a/src/lib/elementary/elm_hoversel.eo b/src/lib/elementary/elm_hoversel.eo index 8e7a580..a3454b2 100644 --- a/src/lib/elementary/elm_hoversel.eo +++ b/src/lib/elementary/elm_hoversel.eo @@ -2,7 +2,8 @@ import elm_general; class Elm.Hoversel (Efl.Ui.Button, Efl.Ui.Selectable, Efl.Ui.Clickable, - Efl.Access.Widget.Action) + Efl.Access.Widget.Action, + Efl.Ui.Legacy) { [[Elementary hoversel class]] legacy_prefix: elm_hoversel; diff --git a/src/lib/elementary/elm_hoversel_item.eo b/src/lib/elementary/elm_hoversel_item.eo index 1f9a77b..6f5c7f7 100644 --- a/src/lib/elementary/elm_hoversel_item.eo +++ b/src/lib/elementary/elm_hoversel_item.eo @@ -1,6 +1,6 @@ import elm_general; -class Elm.Hoversel.Item(Elm.Widget.Item) +class Elm.Hoversel.Item(Elm.Widget.Item, Efl.Ui.Legacy) { [[Elementary hoversel item class]] legacy_prefix: elm_hoversel_item; diff --git a/src/lib/elementary/elm_icon.eo b/src/lib/elementary/elm_icon.eo index a491436..774b609 100644 --- a/src/lib/elementary/elm_icon.eo +++ b/src/lib/elementary/elm_icon.eo @@ -1,4 +1,4 @@ -class Elm.Icon (Efl.Ui.Image) +class Elm.Icon (Efl.Ui.Image, Efl.Ui.Legacy) { [[Elementary Icon Class]] legacy_prefix: elm_icon; diff --git a/src/lib/elementary/elm_index.eo b/src/lib/elementary/elm_index.eo index 68df6ae..afd4d1c 100644 --- a/src/lib/elementary/elm_index.eo +++ b/src/lib/elementary/elm_index.eo @@ -1,5 +1,5 @@ class Elm.Index (Efl.Ui.Layout, Efl.Ui.Direction, - Efl.Ui.Clickable, Efl.Ui.Selectable) + Efl.Ui.Clickable, Efl.Ui.Selectable, Efl.Ui.Legacy) { [[elementary index class]] legacy_prefix: elm_index; diff --git a/src/lib/elementary/elm_index_item.eo b/src/lib/elementary/elm_index_item.eo index d31e2c1..0ad179e 100644 --- a/src/lib/elementary/elm_index_item.eo +++ b/src/lib/elementary/elm_index_item.eo @@ -1,4 +1,4 @@ -class Elm.Index.Item(Elm.Widget.Item, Efl.Access.Widget.Action) +class Elm.Index.Item(Elm.Widget.Item, Efl.Access.Widget.Action, Efl.Ui.Legacy) { [[Elementary index item class]] legacy_prefix: elm_index_item; diff --git a/src/lib/elementary/elm_interface_scrollable.c b/src/lib/elementary/elm_interface_scrollable.c index aa7943c..c169cc6 100644 --- a/src/lib/elementary/elm_interface_scrollable.c +++ b/src/lib/elementary/elm_interface_scrollable.c @@ -211,7 +211,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_interfaces.h b/src/lib/elementary/elm_interfaces.h index 12e2ff7..809a278 100644 --- a/src/lib/elementary/elm_interfaces.h +++ b/src/lib/elementary/elm_interfaces.h @@ -18,6 +18,7 @@ #include "efl_access_image.eo.h" #include "efl_access_selection.eo.h" #include "efl_access_value.eo.h" +#include "efl_ui_legacy.eo.h" #endif // TIZEN_ONLY(20171114): Add accessibility highlight for toolbar items I7892c9433d675d9ba6618991ae46488060752c3c //#endif @@ -40,6 +41,7 @@ #include "efl_access_image.eo.legacy.h" #include "efl_access_selection.eo.legacy.h" #include "efl_access_value.eo.legacy.h" +#include "efl_ui_legacy.eo.legacy.h" #endif // TIZEN_ONLY(20171114): Add accessibility highlight for toolbar items I7892c9433d675d9ba6618991ae46488060752c3c //#endif diff --git a/src/lib/elementary/elm_inwin.eo b/src/lib/elementary/elm_inwin.eo index 9edf1d6..0b6acf9 100644 --- a/src/lib/elementary/elm_inwin.eo +++ b/src/lib/elementary/elm_inwin.eo @@ -1,4 +1,4 @@ -class Elm.Inwin (Efl.Ui.Layout, Efl.Ui.Focus.Layer, Efl.Content) +class Elm.Inwin (Efl.Ui.Layout, Efl.Ui.Focus.Layer, Efl.Content, Efl.Ui.Legacy) { [[Elementary inwin class]] legacy_prefix: elm_inwin; diff --git a/src/lib/elementary/elm_label.eo b/src/lib/elementary/elm_label.eo index fe74064..a3fab6f 100644 --- a/src/lib/elementary/elm_label.eo +++ b/src/lib/elementary/elm_label.eo @@ -8,7 +8,7 @@ enum Elm.Label.Slide_Mode always [[Slide always.]] } -class Elm.Label (Efl.Ui.Layout) +class Elm.Label (Efl.Ui.Layout, Efl.Ui.Legacy) { [[Elementary label class]] legacy_prefix: elm_label; diff --git a/src/lib/elementary/elm_list.eo b/src/lib/elementary/elm_list.eo index 2aa4879..14a83f3 100644 --- a/src/lib/elementary/elm_list.eo +++ b/src/lib/elementary/elm_list.eo @@ -38,7 +38,7 @@ enum Elm.List.Mode class Elm.List (Efl.Ui.Layout, Elm.Interface_Scrollable, Efl.Access.Widget.Action, Efl.Access.Selection, - Efl.Ui.Clickable, Efl.Ui.Selectable) + Efl.Ui.Clickable, Efl.Ui.Selectable, Efl.Ui.Legacy) { [[Elementary list class]] legacy_prefix: elm_list; diff --git a/src/lib/elementary/elm_list_item.eo b/src/lib/elementary/elm_list_item.eo index ae6c260..d508f34 100644 --- a/src/lib/elementary/elm_list_item.eo +++ b/src/lib/elementary/elm_list_item.eo @@ -1,4 +1,4 @@ -class Elm.List.Item(Elm.Widget.Item) +class Elm.List.Item(Elm.Widget.Item, Efl.Ui.Legacy) { [[Elementary list item class]] legacy_prefix: elm_list_item; diff --git a/src/lib/elementary/elm_map.eo b/src/lib/elementary/elm_map.eo index a20ccff..9c4d68d 100644 --- a/src/lib/elementary/elm_map.eo +++ b/src/lib/elementary/elm_map.eo @@ -71,7 +71,7 @@ enum Elm.Map.Route_Method class Elm.Map (Efl.Ui.Widget, Elm.Interface_Scrollable, Efl.Access.Widget.Action, - Efl.Ui.Clickable) + Efl.Ui.Clickable, Efl.Ui.Legacy) { [[Elementary map class]] legacy_prefix: elm_map; diff --git a/src/lib/elementary/elm_mapbuf.eo b/src/lib/elementary/elm_mapbuf.eo index a8f1ead..b116ed7 100644 --- a/src/lib/elementary/elm_mapbuf.eo +++ b/src/lib/elementary/elm_mapbuf.eo @@ -1,4 +1,4 @@ -class Elm.Mapbuf (Efl.Ui.Widget, Efl.Content, Efl.Part) +class Elm.Mapbuf (Efl.Ui.Widget, Efl.Content, Efl.Part, Efl.Ui.Legacy) { [[Elementary mapbuf class]] legacy_prefix: elm_mapbuf; diff --git a/src/lib/elementary/elm_menu.eo b/src/lib/elementary/elm_menu.eo index ccbaa21..a808f29 100644 --- a/src/lib/elementary/elm_menu.eo +++ b/src/lib/elementary/elm_menu.eo @@ -1,5 +1,5 @@ class Elm.Menu (Efl.Ui.Widget, Efl.Ui.Clickable, Efl.Ui.Menu, - Efl.Access.Selection, Efl.Ui.Focus.Manager) + Efl.Access.Selection, Efl.Ui.Focus.Manager, Efl.Ui.Legacy) { [[Elementary menu class]] legacy_prefix: elm_menu; diff --git a/src/lib/elementary/elm_menu_item.eo b/src/lib/elementary/elm_menu_item.eo index 249b0f0..464f831 100644 --- a/src/lib/elementary/elm_menu_item.eo +++ b/src/lib/elementary/elm_menu_item.eo @@ -1,5 +1,5 @@ class Elm.Menu.Item(Elm.Widget.Item, Efl.Access.Selection, - Efl.Ui.Item) + Efl.Ui.Item, Efl.Ui.Legacy) { [[Elementary menu item class]] legacy_prefix: elm_menu_item; diff --git a/src/lib/elementary/elm_multibuttonentry_item.eo b/src/lib/elementary/elm_multibuttonentry_item.eo index 1c7292d..32a6185 100644 --- a/src/lib/elementary/elm_multibuttonentry_item.eo +++ b/src/lib/elementary/elm_multibuttonentry_item.eo @@ -1,5 +1,6 @@ class Elm.Multibuttonentry.Item(Elm.Widget.Item, - Efl.Access.Widget.Action) + Efl.Access.Widget.Action, + Efl.Ui.Legacy) { [[Elementary multibuttonentry class]] legacy_prefix: elm_multibuttonentry_item; diff --git a/src/lib/elementary/elm_naviframe.eo b/src/lib/elementary/elm_naviframe.eo index e71a35a..1aebc48 100644 --- a/src/lib/elementary/elm_naviframe.eo +++ b/src/lib/elementary/elm_naviframe.eo @@ -1,4 +1,4 @@ -class Elm.Naviframe (Efl.Ui.Layout, Efl.Access.Widget.Action) +class Elm.Naviframe (Efl.Ui.Layout, Efl.Access.Widget.Action, Efl.Ui.Legacy) { [[Elementary naviframe class]] legacy_prefix: elm_naviframe; diff --git a/src/lib/elementary/elm_naviframe_item.eo b/src/lib/elementary/elm_naviframe_item.eo index 21a9d6e..86174cc 100644 --- a/src/lib/elementary/elm_naviframe_item.eo +++ b/src/lib/elementary/elm_naviframe_item.eo @@ -1,6 +1,6 @@ type Elm_Naviframe_Item_Pop_Cb: __undefined_type; [[Elementary naviframe item pop callback type]] -class Elm.Naviframe.Item(Elm.Widget.Item) +class Elm.Naviframe.Item(Elm.Widget.Item, Efl.Ui.Legacy) { [[Elementary naviframe item class]] legacy_prefix: elm_naviframe_item; diff --git a/src/lib/elementary/elm_notify.eo b/src/lib/elementary/elm_notify.eo index 26859b9..a12ffa2 100644 --- a/src/lib/elementary/elm_notify.eo +++ b/src/lib/elementary/elm_notify.eo @@ -1,4 +1,4 @@ -class Elm.Notify (Efl.Ui.Widget, Efl.Ui.Focus.Layer, Efl.Content, Efl.Part) +class Elm.Notify (Efl.Ui.Widget, Efl.Ui.Focus.Layer, Efl.Content, Efl.Part, Efl.Ui.Legacy) { [[Elementary notification class]] legacy_prefix: elm_notify; diff --git a/src/lib/elementary/elm_panel.eo b/src/lib/elementary/elm_panel.eo index 284ec7a..2ec6848 100644 --- a/src/lib/elementary/elm_panel.eo +++ b/src/lib/elementary/elm_panel.eo @@ -12,7 +12,7 @@ class Elm.Panel (Efl.Ui.Layout, Efl.Ui.Focus.Layer, Elm.Interface_Scrollable, // TIZEN_ONLY(20170105): scrollable panel content size ratio refactoring (for 2.4 UX) Efl.Orientation, // - Efl.Access.Widget.Action) + Efl.Access.Widget.Action, Efl.Ui.Legacy) { [[Elementary panel class]] legacy_prefix: elm_panel; diff --git a/src/lib/elementary/elm_photo.eo b/src/lib/elementary/elm_photo.eo index a7811ab..bd9e986 100644 --- a/src/lib/elementary/elm_photo.eo +++ b/src/lib/elementary/elm_photo.eo @@ -1,4 +1,5 @@ -class Elm.Photo (Efl.Ui.Widget, Efl.File, Efl.Ui.Clickable, Efl.Ui.Draggable) +class Elm.Photo (Efl.Ui.Widget, Efl.File, Efl.Ui.Clickable, Efl.Ui.Draggable, + Efl.Ui.Legacy) { [[Elementary photo class]] legacy_prefix: elm_photo; diff --git a/src/lib/elementary/elm_player.eo b/src/lib/elementary/elm_player.eo index 3771e08..49263c1 100644 --- a/src/lib/elementary/elm_player.eo +++ b/src/lib/elementary/elm_player.eo @@ -1,4 +1,4 @@ -class Elm.Player (Efl.Ui.Layout, Efl.Access.Widget.Action) +class Elm.Player (Efl.Ui.Layout, Efl.Access.Widget.Action, Efl.Ui.Legacy) { [[Elementary player class]] legacy_prefix: elm_player; diff --git a/src/lib/elementary/elm_plug.eo b/src/lib/elementary/elm_plug.eo index f07d7f5..5eebf7d 100644 --- a/src/lib/elementary/elm_plug.eo +++ b/src/lib/elementary/elm_plug.eo @@ -1,4 +1,4 @@ -class Elm.Plug (Efl.Ui.Widget, Efl.Ui.Clickable) +class Elm.Plug (Efl.Ui.Widget, Efl.Ui.Clickable, Efl.Ui.Legacy) { [[Elementary plug class]] legacy_prefix: elm_plug; diff --git a/src/lib/elementary/elm_popup.eo b/src/lib/elementary/elm_popup.eo index e0e61b5..34ca794 100644 --- a/src/lib/elementary/elm_popup.eo +++ b/src/lib/elementary/elm_popup.eo @@ -23,7 +23,7 @@ enum Elm.Popup.Orient } -class Elm.Popup (Efl.Ui.Layout, Efl.Access.Widget.Action) +class Elm.Popup (Efl.Ui.Layout, Efl.Access.Widget.Action, Efl.Ui.Legacy) { [[Elementary popup class]] legacy_prefix: elm_popup; diff --git a/src/lib/elementary/elm_popup_item.eo b/src/lib/elementary/elm_popup_item.eo index dcf9577..7668b17 100644 --- a/src/lib/elementary/elm_popup_item.eo +++ b/src/lib/elementary/elm_popup_item.eo @@ -1,4 +1,4 @@ -class Elm.Popup.Item(Elm.Widget.Item) +class Elm.Popup.Item(Elm.Widget.Item, Efl.Ui.Legacy) { [[Elementary popup item class]] legacy_prefix: elm_popup_item; diff --git a/src/lib/elementary/elm_prefs.eo b/src/lib/elementary/elm_prefs.eo index 2b7eb66..0f91b45 100644 --- a/src/lib/elementary/elm_prefs.eo +++ b/src/lib/elementary/elm_prefs.eo @@ -3,7 +3,7 @@ import eina_types; type Elm_Prefs_Data: __undefined_type; [[Elementary preferences data type]] type Elm_Prefs_Reset_Mode: __undefined_type; [[Elementary preferences reset mode type]] -class Elm.Prefs (Efl.Ui.Widget, Efl.File) +class Elm.Prefs (Efl.Ui.Widget, Efl.File, Efl.Ui.Legacy) { [[Elementary preferences class]] legacy_prefix: elm_prefs; diff --git a/src/lib/elementary/elm_route.eo b/src/lib/elementary/elm_route.eo index fa95398..fe41b6a 100644 --- a/src/lib/elementary/elm_route.eo +++ b/src/lib/elementary/elm_route.eo @@ -1,4 +1,4 @@ -class Elm.Route (Efl.Ui.Widget) +class Elm.Route (Efl.Ui.Widget, Efl.Ui.Legacy) { [[Elementary route class]] legacy_prefix: elm_route; diff --git a/src/lib/elementary/elm_scroller.eo b/src/lib/elementary/elm_scroller.eo index cb0e3fe..0abe125 100644 --- a/src/lib/elementary/elm_scroller.eo +++ b/src/lib/elementary/elm_scroller.eo @@ -1,6 +1,6 @@ class Elm.Scroller (Efl.Ui.Layout, Elm.Interface_Scrollable, Efl.Access.Widget.Action, - Efl.Ui.Scrollable, Efl.Content) + Efl.Ui.Scrollable, Efl.Content, Efl.Ui.Legacy) { [[Elementary scroller class]] legacy_prefix: elm_scroller; diff --git a/src/lib/elementary/elm_segment_control.eo b/src/lib/elementary/elm_segment_control.eo index 7c2cbea..bd42439 100644 --- a/src/lib/elementary/elm_segment_control.eo +++ b/src/lib/elementary/elm_segment_control.eo @@ -1,4 +1,4 @@ -class Elm.Segment_Control (Efl.Ui.Layout, Efl.Ui.Focus.Composition) +class Elm.Segment_Control (Efl.Ui.Layout, Efl.Ui.Focus.Composition, Efl.Ui.Legacy) { [[Elementary segment control class]] legacy_prefix: elm_segment_control; diff --git a/src/lib/elementary/elm_segment_control_item.eo b/src/lib/elementary/elm_segment_control_item.eo index 743b058..dab3f9c 100644 --- a/src/lib/elementary/elm_segment_control_item.eo +++ b/src/lib/elementary/elm_segment_control_item.eo @@ -1,4 +1,4 @@ -class Elm.Segment_Control.Item(Elm.Widget.Item, Efl.Ui.Focus.Object) +class Elm.Segment_Control.Item(Elm.Widget.Item, Efl.Ui.Focus.Object, Efl.Ui.Legacy) { [[Elementary segment control item class]] legacy_prefix: elm_segment_control_item; diff --git a/src/lib/elementary/elm_separator.eo b/src/lib/elementary/elm_separator.eo index 3c7b23d..c29585d 100644 --- a/src/lib/elementary/elm_separator.eo +++ b/src/lib/elementary/elm_separator.eo @@ -1,4 +1,4 @@ -class Elm.Separator (Efl.Ui.Layout) +class Elm.Separator (Efl.Ui.Layout, Efl.Ui.Legacy) { [[Elementary separator class]] legacy_prefix: elm_separator; diff --git a/src/lib/elementary/elm_slideshow.eo b/src/lib/elementary/elm_slideshow.eo index 9f0b533..acb6b24 100644 --- a/src/lib/elementary/elm_slideshow.eo +++ b/src/lib/elementary/elm_slideshow.eo @@ -1,6 +1,6 @@ type Elm_Slideshow_Item_Class: __undefined_type; [[Elementary slideshow item class type]] -class Elm.Slideshow (Efl.Ui.Layout, Efl.Access.Widget.Action) +class Elm.Slideshow (Efl.Ui.Layout, Efl.Access.Widget.Action, Efl.Ui.Legacy) { [[Elementary slideshow class]] eo_prefix: elm_obj_slideshow; diff --git a/src/lib/elementary/elm_spinner.eo b/src/lib/elementary/elm_spinner.eo index b0bec9c..63efe17 100644 --- a/src/lib/elementary/elm_spinner.eo +++ b/src/lib/elementary/elm_spinner.eo @@ -1,5 +1,5 @@ class Elm.Spinner (Efl.Ui.Layout, Efl.Ui.Range, Efl.Ui.Focus.Composition, - Efl.Access.Value, Efl.Access.Widget.Action) + Efl.Access.Value, Efl.Access.Widget.Action, Efl.Ui.Legacy) { [[Elementary spinner class]] legacy_prefix: elm_spinner; diff --git a/src/lib/elementary/elm_table.eo b/src/lib/elementary/elm_table.eo index 8271373..7eaae08 100644 --- a/src/lib/elementary/elm_table.eo +++ b/src/lib/elementary/elm_table.eo @@ -1,4 +1,4 @@ -class Elm.Table (Efl.Ui.Widget, Efl.Ui.Focus.Composition) +class Elm.Table (Efl.Ui.Widget, Efl.Ui.Focus.Composition, Efl.Ui.Legacy) { [[Elementary table class]] legacy_prefix: elm_table; diff --git a/src/lib/elementary/elm_theme.c b/src/lib/elementary/elm_theme.c index 0b24f40..c1b4a5d 100644 --- a/src/lib/elementary/elm_theme.c +++ b/src/lib/elementary/elm_theme.c @@ -281,6 +281,7 @@ _elm_theme_object_set(Evas_Object *parent, Evas_Object *o, const char *clas, con Elm_Theme *th = NULL; if (parent) th = elm_widget_theme_get(parent); + return _elm_theme_set(th, o, clas, group, style, elm_widget_is_legacy(parent)); } diff --git a/src/lib/elementary/elm_thumb.eo b/src/lib/elementary/elm_thumb.eo index a6f9820..fa8a94a 100644 --- a/src/lib/elementary/elm_thumb.eo +++ b/src/lib/elementary/elm_thumb.eo @@ -1,5 +1,5 @@ class Elm.Thumb (Efl.Ui.Layout, Efl.File, Efl.Ui.Clickable, - Efl.Ui.Draggable) + Efl.Ui.Draggable, Efl.Ui.Legacy) { [[Elementary thumbnail class]] legacy_prefix: elm_thumb; diff --git a/src/lib/elementary/elm_toolbar.eo b/src/lib/elementary/elm_toolbar.eo index 9b34214..724726f 100644 --- a/src/lib/elementary/elm_toolbar.eo +++ b/src/lib/elementary/elm_toolbar.eo @@ -25,7 +25,7 @@ enum Elm.Toolbar.Shrink_Mode class Elm.Toolbar (Efl.Ui.Widget, Efl.Ui.Focus.Composition, Elm.Interface_Scrollable, Efl.Ui.Direction, Efl.Access.Widget.Action, Efl.Access.Selection, - Efl.Ui.Clickable, Efl.Ui.Selectable, Efl.Ui.Menu, Efl.Orientation) + Efl.Ui.Clickable, Efl.Ui.Selectable, Efl.Ui.Menu, Efl.Orientation, Efl.Ui.Legacy) { [[Elementary toolbar class]] legacy_prefix: elm_toolbar; diff --git a/src/lib/elementary/elm_toolbar_item.eo b/src/lib/elementary/elm_toolbar_item.eo index 500d1e3..275b1aa 100644 --- a/src/lib/elementary/elm_toolbar_item.eo +++ b/src/lib/elementary/elm_toolbar_item.eo @@ -23,7 +23,7 @@ struct Elm.Toolbar.Item.State data: const(void_ptr); [[Item data]] } -class Elm.Toolbar.Item(Elm.Widget.Item, Efl.Ui.Item, Efl.Ui.Focus.Object) +class Elm.Toolbar.Item(Elm.Widget.Item, Efl.Ui.Item, Efl.Ui.Focus.Object, Efl.Ui.Legacy) { [[Elementary toolbar item class]] legacy_prefix: elm_toolbar_item; diff --git a/src/lib/elementary/elm_web.eo b/src/lib/elementary/elm_web.eo index 1ff13fe..ee2e939 100644 --- a/src/lib/elementary/elm_web.eo +++ b/src/lib/elementary/elm_web.eo @@ -14,7 +14,7 @@ enum Elm.Web.Zoom_Mode last [[Sentinel value to indicate last enum field during iteration]] } -class Elm.Web (Efl.Ui.Widget) +class Elm.Web (Efl.Ui.Widget, Efl.Ui.Legacy) { [[Elementary web view class]] legacy_prefix: elm_web; diff --git a/src/lib/elementary/elm_widget.h b/src/lib/elementary/elm_widget.h index d88fdb8..0227d04 100644 --- a/src/lib/elementary/elm_widget.h +++ b/src/lib/elementary/elm_widget.h @@ -491,7 +491,6 @@ typedef struct _Elm_Widget_Smart_Data Eina_Bool on_create : 1; /**< This is true when the widget is on creation(general widget constructor). */ Eina_Bool on_destroy: 1; /**< This is true when the widget is on destruction(general widget destructor). */ Eina_Bool provider_lookup : 1; /**< This is true when efl_provider_find is currently walking the tree */ - Eina_Bool legacy : 1; /**< Widget was created with a legacy API, not efl_add() */ Eina_Bool has_shadow : 1; ///TIZEN_ONLY(20170717) : expose highlight information on atspi Eina_Bool can_highlight : 1; /**< true if widget have at-spi HIGHLIGHTABLE state */ @@ -951,10 +950,7 @@ Eina_Bool _elm_widget_item_color_class_update(Elm_Widget_Item_Data *sd); * END * *******/ -/* Internal hack to mark legacy objects as such before construction. - * No need for TLS: Only UI objects created in the main loop matter. */ -EAPI extern Eina_Bool _elm_legacy_add; -#define elm_legacy_add(k, p, ...) ({ _elm_legacy_add = 1; \ +#define elm_legacy_add(k, p, ...) ({ \ efl_add(k, p, efl_canvas_object_legacy_ctor(efl_added), ##__VA_ARGS__); }) static inline Eo * @@ -967,11 +963,7 @@ elm_widget_resize_object_get(const Eo *obj) static inline Eina_Bool elm_widget_is_legacy(const Eo *obj) { - Elm_Widget_Smart_Data *sd; - - if (_elm_legacy_add) return EINA_TRUE; - sd = (Elm_Widget_Smart_Data *) efl_data_scope_safe_get(obj, EFL_UI_WIDGET_CLASS); - return sd ? sd->legacy : EINA_FALSE; + return efl_isa(obj, EFL_UI_LEGACY_INTERFACE); } /** Takes in any canvas object and returns the first smart parent that is a widget */ -- 2.7.4