From 57a69262a1d40f3a5adf4585f088395f0af9278d Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 5 Mar 2019 17:00:37 -0500 Subject: [PATCH] elm_view*: remove all legacy usage from eo files this takes the current generated output from eolian for legacy code in efl and adds it to the tree, then removes legacy references from the corresponding eo files. in the case where the entire eo file was for a legacy object, that eo file has been removed from the tree ref T7724 Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D8207 --- src/Makefile_Efl_Mono.am | 2 +- src/Makefile_Elementary.am | 8 +- src/lib/elementary/elm_view_form.c | 2 +- src/lib/elementary/elm_view_form.eo | 31 ------- src/lib/elementary/elm_view_form.h | 2 +- src/lib/elementary/elm_view_form_eo.c | 45 +++++++++ src/lib/elementary/elm_view_form_eo.h | 49 ++++++++++ src/lib/elementary/elm_view_form_eo.legacy.h | 19 ++++ src/lib/elementary/elm_view_list.c | 2 +- src/lib/elementary/elm_view_list.eo | 65 ------------- src/lib/elementary/elm_view_list.h | 2 +- src/lib/elementary/elm_view_list_eo.c | 62 +++++++++++++ src/lib/elementary/elm_view_list_eo.h | 97 ++++++++++++++++++++ src/lib/elementary/elm_view_list_eo.legacy.h | 22 +++++ src/lib/elementary/meson.build | 6 +- 15 files changed, 309 insertions(+), 105 deletions(-) delete mode 100644 src/lib/elementary/elm_view_form.eo create mode 100644 src/lib/elementary/elm_view_form_eo.c create mode 100644 src/lib/elementary/elm_view_form_eo.h create mode 100644 src/lib/elementary/elm_view_form_eo.legacy.h delete mode 100644 src/lib/elementary/elm_view_list.eo create mode 100644 src/lib/elementary/elm_view_list_eo.c create mode 100644 src/lib/elementary/elm_view_list_eo.h create mode 100644 src/lib/elementary/elm_view_list_eo.legacy.h diff --git a/src/Makefile_Efl_Mono.am b/src/Makefile_Efl_Mono.am index cf8884837b..1f09ba1ccd 100644 --- a/src/Makefile_Efl_Mono.am +++ b/src/Makefile_Efl_Mono.am @@ -174,7 +174,7 @@ lib/elementary/elm_map_eo.cs \ lib/elementary/elm_combobox.eo.cs \ lib/elementary/elm_list_eo.cs \ lib/elementary/elm_genlist_eo.cs \ -lib/elementary/elm_view_list.eo.cs \ +lib/elementary/elm_view_list_eo.cs \ lib/elementary/elm_genlist_item_eo.cs \ lib/elementary/elm_gengrid_eo.cs \ lib/elementary/elm_glview_eo.cs diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am index f8b2319bf6..13566cb093 100644 --- a/src/Makefile_Elementary.am +++ b/src/Makefile_Elementary.am @@ -146,8 +146,6 @@ elm_public_eolian_files += \ lib/elementary/elm_atspi_bridge.eo \ lib/elementary/elm_atspi_app_object.eo \ lib/elementary/efl_ui_image_zoomable_pan.eo \ - lib/elementary/elm_view_list.eo \ - lib/elementary/elm_view_form.eo \ lib/elementary/elm_web.eo \ lib/elementary/elm_widget_item.eo \ lib/elementary/elm_widget_item_container.eo \ @@ -394,6 +392,8 @@ lib/elementary/elm_toolbar_eo.c \ lib/elementary/elm_toolbar_eo.legacy.c \ lib/elementary/elm_toolbar_item_eo.c \ lib/elementary/elm_toolbar_item_eo.legacy.c \ +lib/elementary/elm_view_form_eo.c \ +lib/elementary/elm_view_list_eo.c \ $(NULL) elm_legacy_eo_headers = \ @@ -601,6 +601,10 @@ lib/elementary/elm_toolbar_eo.h \ lib/elementary/elm_toolbar_eo.legacy.h \ lib/elementary/elm_toolbar_item_eo.h \ lib/elementary/elm_toolbar_item_eo.legacy.h \ +lib/elementary/elm_view_form_eo.h \ +lib/elementary/elm_view_form_eo.legacy.h \ +lib/elementary/elm_view_list_eo.h \ +lib/elementary/elm_view_list_eo.legacy.h \ $(NULL) diff --git a/src/lib/elementary/elm_view_form.c b/src/lib/elementary/elm_view_form.c index 5bb910be58..48440682a1 100644 --- a/src/lib/elementary/elm_view_form.c +++ b/src/lib/elementary/elm_view_form.c @@ -96,4 +96,4 @@ _elm_view_form_widget_add(Eo *obj EINA_UNUSED, Elm_View_Form_Data *priv, const c _elm_view_widget_add(priv, propname, evas); } -#include "elm_view_form.eo.c" +#include "elm_view_form_eo.c" diff --git a/src/lib/elementary/elm_view_form.eo b/src/lib/elementary/elm_view_form.eo deleted file mode 100644 index ce32cecce8..0000000000 --- a/src/lib/elementary/elm_view_form.eo +++ /dev/null @@ -1,31 +0,0 @@ -class Elm.View.Form extends Efl.Object -{ - [[Elementary view form class]] - methods { - model_set { - [[Set model - - @since 1.11 - ]] - params { - @in model: Efl.Model; [[Emodel object]] - } - } - widget_add { - [[Add new widget - - @since 1.11 - ]] - params { - @in propname: string; [[Property name]] - @in evas: Efl.Canvas.Object; [[Evas widget]] - } - } - } - implements { - Efl.Object.destructor; - } - constructors { - .model_set @optional; - } -} diff --git a/src/lib/elementary/elm_view_form.h b/src/lib/elementary/elm_view_form.h index 3572c7c725..e97ca6c6e7 100644 --- a/src/lib/elementary/elm_view_form.h +++ b/src/lib/elementary/elm_view_form.h @@ -4,7 +4,7 @@ #define ELM_VIEW_FORM_H #include -#include +#include #endif #endif diff --git a/src/lib/elementary/elm_view_form_eo.c b/src/lib/elementary/elm_view_form_eo.c new file mode 100644 index 0000000000..5a0b58d3e7 --- /dev/null +++ b/src/lib/elementary/elm_view_form_eo.c @@ -0,0 +1,45 @@ + +void _elm_view_form_model_set(Eo *obj, Elm_View_Form_Data *pd, Efl_Model *model); + +EOAPI EFL_VOID_FUNC_BODYV(elm_view_form_model_set, EFL_FUNC_CALL(model), Efl_Model *model); + +void _elm_view_form_widget_add(Eo *obj, Elm_View_Form_Data *pd, const char *propname, Efl_Canvas_Object *evas); + +EOAPI EFL_VOID_FUNC_BODYV(elm_view_form_widget_add, EFL_FUNC_CALL(propname, evas), const char *propname, Efl_Canvas_Object *evas); + +void _elm_view_form_efl_object_destructor(Eo *obj, Elm_View_Form_Data *pd); + + +static Eina_Bool +_elm_view_form_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_VIEW_FORM_EXTRA_OPS +#define ELM_VIEW_FORM_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_view_form_model_set, _elm_view_form_model_set), + EFL_OBJECT_OP_FUNC(elm_view_form_widget_add, _elm_view_form_widget_add), + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_view_form_efl_object_destructor), + ELM_VIEW_FORM_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_view_form_class_desc = { + EO_VERSION, + "Elm.View.Form", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_View_Form_Data), + _elm_view_form_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_view_form_class_get, &_elm_view_form_class_desc, EFL_OBJECT_CLASS, NULL); diff --git a/src/lib/elementary/elm_view_form_eo.h b/src/lib/elementary/elm_view_form_eo.h new file mode 100644 index 0000000000..83dbe7e6c2 --- /dev/null +++ b/src/lib/elementary/elm_view_form_eo.h @@ -0,0 +1,49 @@ +#ifndef _ELM_VIEW_FORM_EO_H_ +#define _ELM_VIEW_FORM_EO_H_ + +#ifndef _ELM_VIEW_FORM_EO_CLASS_TYPE +#define _ELM_VIEW_FORM_EO_CLASS_TYPE + +typedef Eo Elm_View_Form; + +#endif + +#ifndef _ELM_VIEW_FORM_EO_TYPES +#define _ELM_VIEW_FORM_EO_TYPES + + +#endif +/** Elementary view form class + * + * @ingroup Elm_View_Form + */ +#define ELM_VIEW_FORM_CLASS elm_view_form_class_get() + +EWAPI const Efl_Class *elm_view_form_class_get(void); + +/** + * @brief Set model + * + * @param[in] obj The object. + * @param[in] model Emodel object + * + * @since 1.11 + * + * @ingroup Elm_View_Form + */ +EOAPI void elm_view_form_model_set(Eo *obj, Efl_Model *model); + +/** + * @brief Add new widget + * + * @param[in] obj The object. + * @param[in] propname Property name + * @param[in] evas Evas widget + * + * @since 1.11 + * + * @ingroup Elm_View_Form + */ +EOAPI void elm_view_form_widget_add(Eo *obj, const char *propname, Efl_Canvas_Object *evas); + +#endif diff --git a/src/lib/elementary/elm_view_form_eo.legacy.h b/src/lib/elementary/elm_view_form_eo.legacy.h new file mode 100644 index 0000000000..dc641a3abd --- /dev/null +++ b/src/lib/elementary/elm_view_form_eo.legacy.h @@ -0,0 +1,19 @@ +#ifndef _ELM_VIEW_FORM_EO_LEGACY_H_ +#define _ELM_VIEW_FORM_EO_LEGACY_H_ + +#ifndef _ELM_VIEW_FORM_EO_CLASS_TYPE +#define _ELM_VIEW_FORM_EO_CLASS_TYPE + +typedef Eo Elm_View_Form; + +#endif + +#ifndef _ELM_VIEW_FORM_EO_TYPES +#define _ELM_VIEW_FORM_EO_TYPES + + +#endif + + + +#endif diff --git a/src/lib/elementary/elm_view_list.c b/src/lib/elementary/elm_view_list.c index f22de4d0eb..9c52b18589 100644 --- a/src/lib/elementary/elm_view_list.c +++ b/src/lib/elementary/elm_view_list.c @@ -433,4 +433,4 @@ _elm_view_list_model_get(const Eo *obj EINA_UNUSED, Elm_View_List_Data *priv) { return priv->connect.model; } -#include "elm_view_list.eo.c" +#include "elm_view_list_eo.c" diff --git a/src/lib/elementary/elm_view_list.eo b/src/lib/elementary/elm_view_list.eo deleted file mode 100644 index 932b5863f6..0000000000 --- a/src/lib/elementary/elm_view_list.eo +++ /dev/null @@ -1,65 +0,0 @@ -import elm_general; - -class Elm.View.List extends Efl.Object -{ - [[Elementary view list class]] - methods { - genlist_set { - [[Constructor wrapper - - @since 1.11 - ]] - params { - @in genlist: Efl.Canvas.Object; [[Genlist object]] - @in item_type: Elm.Genlist.Item.Type; [[Item type]] - @in item_style: string; [[The current item style name. $null would be default.]] - } - } - evas_object_get { - [[Return evas object - - @since 1.11 - ]] - params { - @out widget: Efl.Canvas.Object; [[Returned widget]] - } - } - property_connect { - [[Connect property - - @since 1.11 - ]] - params { - @in property: string; [[Property name]] - @in part: string; [[Edje's theme part]] - } - } - @property model { - set { - [[Set model - - @since 1.11 - ]] - } - get { - [[Get model - - @since 1.11 - ]] - } - values { - model: Efl.Model; [[Efl.Model to set]] - } - } - } - /* For some reason the following comment after the event doesn't work: Event dispatch when a model is selected */ - events { - model,selected: Efl.Object; [[Called when model was selected]] - } - implements { - Efl.Object.destructor; - } - constructors { - .genlist_set @optional; - } -} diff --git a/src/lib/elementary/elm_view_list.h b/src/lib/elementary/elm_view_list.h index 7d9823e810..4ad048e106 100644 --- a/src/lib/elementary/elm_view_list.h +++ b/src/lib/elementary/elm_view_list.h @@ -4,7 +4,7 @@ #define ELM_VIEW_LIST_H #include -#include +#include #endif #endif // ELM_VIEW_LIST_H diff --git a/src/lib/elementary/elm_view_list_eo.c b/src/lib/elementary/elm_view_list_eo.c new file mode 100644 index 0000000000..3c9a8c208b --- /dev/null +++ b/src/lib/elementary/elm_view_list_eo.c @@ -0,0 +1,62 @@ +EWAPI const Efl_Event_Description _ELM_VIEW_LIST_EVENT_MODEL_SELECTED = + EFL_EVENT_DESCRIPTION("model,selected"); + +void _elm_view_list_genlist_set(Eo *obj, Elm_View_List_Data *pd, Efl_Canvas_Object *genlist, Elm_Genlist_Item_Type item_type, const char *item_style); + +EOAPI EFL_VOID_FUNC_BODYV(elm_view_list_genlist_set, EFL_FUNC_CALL(genlist, item_type, item_style), Efl_Canvas_Object *genlist, Elm_Genlist_Item_Type item_type, const char *item_style); + +void _elm_view_list_evas_object_get(Eo *obj, Elm_View_List_Data *pd, Efl_Canvas_Object **widget); + +EOAPI EFL_VOID_FUNC_BODYV(elm_view_list_evas_object_get, EFL_FUNC_CALL(widget), Efl_Canvas_Object **widget); + +void _elm_view_list_property_connect(Eo *obj, Elm_View_List_Data *pd, const char *property, const char *part); + +EOAPI EFL_VOID_FUNC_BODYV(elm_view_list_property_connect, EFL_FUNC_CALL(property, part), const char *property, const char *part); + +void _elm_view_list_model_set(Eo *obj, Elm_View_List_Data *pd, Efl_Model *model); + +EOAPI EFL_VOID_FUNC_BODYV(elm_view_list_model_set, EFL_FUNC_CALL(model), Efl_Model *model); + +Efl_Model *_elm_view_list_model_get(const Eo *obj, Elm_View_List_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_view_list_model_get, Efl_Model *, NULL); + +void _elm_view_list_efl_object_destructor(Eo *obj, Elm_View_List_Data *pd); + + +static Eina_Bool +_elm_view_list_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_VIEW_LIST_EXTRA_OPS +#define ELM_VIEW_LIST_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_view_list_genlist_set, _elm_view_list_genlist_set), + EFL_OBJECT_OP_FUNC(elm_view_list_evas_object_get, _elm_view_list_evas_object_get), + EFL_OBJECT_OP_FUNC(elm_view_list_property_connect, _elm_view_list_property_connect), + EFL_OBJECT_OP_FUNC(elm_view_list_model_set, _elm_view_list_model_set), + EFL_OBJECT_OP_FUNC(elm_view_list_model_get, _elm_view_list_model_get), + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_view_list_efl_object_destructor), + ELM_VIEW_LIST_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_view_list_class_desc = { + EO_VERSION, + "Elm.View.List", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_View_List_Data), + _elm_view_list_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_view_list_class_get, &_elm_view_list_class_desc, EFL_OBJECT_CLASS, NULL); diff --git a/src/lib/elementary/elm_view_list_eo.h b/src/lib/elementary/elm_view_list_eo.h new file mode 100644 index 0000000000..f35c275c3b --- /dev/null +++ b/src/lib/elementary/elm_view_list_eo.h @@ -0,0 +1,97 @@ +#ifndef _ELM_VIEW_LIST_EO_H_ +#define _ELM_VIEW_LIST_EO_H_ + +#ifndef _ELM_VIEW_LIST_EO_CLASS_TYPE +#define _ELM_VIEW_LIST_EO_CLASS_TYPE + +typedef Eo Elm_View_List; + +#endif + +#ifndef _ELM_VIEW_LIST_EO_TYPES +#define _ELM_VIEW_LIST_EO_TYPES + + +#endif +/** Elementary view list class + * + * @ingroup Elm_View_List + */ +#define ELM_VIEW_LIST_CLASS elm_view_list_class_get() + +EWAPI const Efl_Class *elm_view_list_class_get(void); + +/** + * @brief Constructor wrapper + * + * @param[in] obj The object. + * @param[in] genlist Genlist object + * @param[in] item_type Item type + * @param[in] item_style The current item style name. @c null would be default. + * + * @since 1.11 + * + * @ingroup Elm_View_List + */ +EOAPI void elm_view_list_genlist_set(Eo *obj, Efl_Canvas_Object *genlist, Elm_Genlist_Item_Type item_type, const char *item_style); + +/** + * @brief Return evas object + * + * @param[in] obj The object. + * @param[out] widget Returned widget + * + * @since 1.11 + * + * @ingroup Elm_View_List + */ +EOAPI void elm_view_list_evas_object_get(Eo *obj, Efl_Canvas_Object **widget); + +/** + * @brief Connect property + * + * @param[in] obj The object. + * @param[in] property Property name + * @param[in] part Edje's theme part + * + * @since 1.11 + * + * @ingroup Elm_View_List + */ +EOAPI void elm_view_list_property_connect(Eo *obj, const char *property, const char *part); + +/** + * @brief Set model + * + * @param[in] obj The object. + * @param[in] model Efl.Model to set + * + * @since 1.11 + * + * @ingroup Elm_View_List + */ +EOAPI void elm_view_list_model_set(Eo *obj, Efl_Model *model); + +/** + * @brief Get model + * + * @param[in] obj The object. + * + * @return Efl.Model to set + * + * @since 1.11 + * + * @ingroup Elm_View_List + */ +EOAPI Efl_Model *elm_view_list_model_get(const Eo *obj); + +EWAPI extern const Efl_Event_Description _ELM_VIEW_LIST_EVENT_MODEL_SELECTED; + +/** Called when model was selected + * @return Efl_Object * + * + * @ingroup Elm_View_List + */ +#define ELM_VIEW_LIST_EVENT_MODEL_SELECTED (&(_ELM_VIEW_LIST_EVENT_MODEL_SELECTED)) + +#endif diff --git a/src/lib/elementary/elm_view_list_eo.legacy.h b/src/lib/elementary/elm_view_list_eo.legacy.h new file mode 100644 index 0000000000..d218aa2e3a --- /dev/null +++ b/src/lib/elementary/elm_view_list_eo.legacy.h @@ -0,0 +1,22 @@ +#ifndef _ELM_VIEW_LIST_EO_LEGACY_H_ +#define _ELM_VIEW_LIST_EO_LEGACY_H_ + +#ifndef _ELM_VIEW_LIST_EO_CLASS_TYPE +#define _ELM_VIEW_LIST_EO_CLASS_TYPE + +typedef Eo Elm_View_List; + +#endif + +#ifndef _ELM_VIEW_LIST_EO_TYPES +#define _ELM_VIEW_LIST_EO_TYPES + + +#endif + + + + + + +#endif diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build index 04f682ef1a..ebd8a6cd71 100644 --- a/src/lib/elementary/meson.build +++ b/src/lib/elementary/meson.build @@ -176,8 +176,6 @@ pub_eo_files = [ 'elm_atspi_bridge.eo', 'elm_atspi_app_object.eo', 'efl_ui_image_zoomable_pan.eo', - 'elm_view_list.eo', - 'elm_view_form.eo', 'elm_web.eo', 'elm_widget_item.eo', 'efl_ui_text_part.eo', @@ -804,6 +802,10 @@ elementary_pub_headers = [ 'elm_toolbar_eo.legacy.h', 'elm_toolbar_item_eo.h', 'elm_toolbar_item_eo.legacy.h', + 'elm_view_form_eo.h', + 'elm_view_form_eo.legacy.h', + 'elm_view_list_eo.h', + 'elm_view_list_eo.legacy.h', ] elementary_header_src = [