From 40a3e3206942a1eb55bb5be65e472a93e2f0bcd0 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 5 Mar 2019 17:00:37 -0500 Subject: [PATCH] elm_grid: 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/D8174 Change-Id: Ieb9ac786fd28ab76f5c9b19eef11191deaa10582 --- src/Makefile_Elementary.am | 5 +- src/lib/elementary/elm_grid.c | 4 +- src/lib/elementary/elm_grid.eo | 69 ------------------------ src/lib/elementary/elm_grid_eo.c | 75 ++++++++++++++++++++++++++ src/lib/elementary/elm_grid_eo.h | 96 +++++++++++++++++++++++++++++++++ src/lib/elementary/elm_grid_eo.legacy.c | 36 +++++++++++++ src/lib/elementary/elm_grid_eo.legacy.h | 89 ++++++++++++++++++++++++++++++ src/lib/elementary/elm_grid_legacy.h | 2 +- src/lib/elementary/meson.build | 3 +- 9 files changed, 305 insertions(+), 74 deletions(-) delete mode 100644 src/lib/elementary/elm_grid.eo create mode 100644 src/lib/elementary/elm_grid_eo.c create mode 100644 src/lib/elementary/elm_grid_eo.h create mode 100644 src/lib/elementary/elm_grid_eo.legacy.c create mode 100644 src/lib/elementary/elm_grid_eo.legacy.h diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am index 43daf99..b3b8a52 100644 --- a/src/Makefile_Elementary.am +++ b/src/Makefile_Elementary.am @@ -239,7 +239,6 @@ elm_legacy_eolian_files = \ lib/elementary/elm_actionslider_part.eo \ lib/elementary/elm_bubble_part.eo \ lib/elementary/elm_fileselector_part.eo \ - lib/elementary/elm_grid.eo \ lib/elementary/elm_icon.eo \ lib/elementary/elm_inwin.eo \ lib/elementary/elm_mapbuf.eo \ @@ -367,6 +366,8 @@ lib/elementary/elm_gesture_layer_eo.legacy.c \ lib/elementary/elm_gesture_layer_eo.c \ lib/elementary/elm_glview_eo.legacy.c \ lib/elementary/elm_glview_eo.c \ +lib/elementary/elm_grid_eo.legacy.c \ +lib/elementary/elm_grid_eo.c \ lib/elementary/elm_hoversel_eo.c \ lib/elementary/elm_hoversel_item_eo.c \ lib/elementary/elm_hoversel_item_eo.legacy.c @@ -480,6 +481,8 @@ lib/elementary/elm_gesture_layer_eo.h \ lib/elementary/elm_gesture_layer_eo.legacy.h \ lib/elementary/elm_glview_eo.h \ lib/elementary/elm_glview_eo.legacy.h \ +lib/elementary/elm_grid_eo.h \ +lib/elementary/elm_grid_eo.legacy.h \ lib/elementary/elm_hoversel_eo.h \ lib/elementary/elm_hoversel_eo.legacy.h \ lib/elementary/elm_hoversel_item_eo.h \ diff --git a/src/lib/elementary/elm_grid.c b/src/lib/elementary/elm_grid.c index 78fb6b1..0e3fa9c 100644 --- a/src/lib/elementary/elm_grid.c +++ b/src/lib/elementary/elm_grid.c @@ -6,7 +6,7 @@ #define EFL_UI_FOCUS_COMPOSITION_PROTECTED #include -#include +#include #include "elm_priv.h" #include "elm_widget_grid.h" @@ -300,4 +300,4 @@ _elm_grid_class_constructor(Efl_Class *klass) #define ELM_GRID_EXTRA_OPS \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_grid) -#include "elm_grid.eo.c" +#include "elm_grid_eo.c" diff --git a/src/lib/elementary/elm_grid.eo b/src/lib/elementary/elm_grid.eo deleted file mode 100644 index 2b2c091..0000000 --- a/src/lib/elementary/elm_grid.eo +++ /dev/null @@ -1,69 +0,0 @@ -class Elm.Grid extends Efl.Ui.Widget implements Efl.Ui.Focus.Composition, Efl.Ui.Legacy -{ - [[Elementary grid class]] - legacy_prefix: elm_grid; - eo_prefix: elm_obj_grid; - data: null; - methods { - @property grid_size { - set { - [[Set the virtual size of the grid]] - legacy: elm_grid_size_set; - } - get { - [[Get the virtual size of the grid]] - legacy: elm_grid_size_get; - } - values { - w: int; [[The virtual width of the grid]] - h: int; [[The virtual height of the grid]] - } - } - @property children { - get { - [[Get the list of the children for the grid. - - Note: This is a duplicate of the list kept by the grid internally. - It's up to the user to destroy it when it no longer needs it. - It's possible to remove objects from the grid when walking this - list, but these removals won't be reflected on it. - ]] - return: list @owned @warn_unused; [[List of children]] - } - } - clear { - [[Faster way to remove all child objects from a grid object.]] - params { - @in clear: bool; [[If $true, it will delete just removed children]] - } - } - unpack { - [[Unpack a child from a grid object]] - params { - @in subobj: Efl.Canvas.Object; [[The child to unpack]] - } - } - pack { - [[Pack child at given position and size]] - params { - @in subobj: Efl.Canvas.Object; [[The child to pack.]] - @in x: int; [[The virtual x coord at which to pack it.]] - @in y: int; [[The virtual y coord at which to pack it.]] - @in w: int; [[The virtual width at which to pack it.]] - @in h: int; [[The virtual height at which to pack it.]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Ui.Widget.theme_apply; - Efl.Ui.Focus.Composition.prepare; - //TIZEN_ONLY(20180607): Restore legacy focus - Efl.Ui.Widget.focus_direction; - Efl.Ui.Widget.focus_next_manager_is; - Efl.Ui.Widget.focus_next; - Efl.Ui.Widget.focus_direction_manager_is; - // - } -} diff --git a/src/lib/elementary/elm_grid_eo.c b/src/lib/elementary/elm_grid_eo.c new file mode 100644 index 0000000..9502a45 --- /dev/null +++ b/src/lib/elementary/elm_grid_eo.c @@ -0,0 +1,75 @@ + +void _elm_grid_grid_size_set(Eo *obj, void *pd, int w, int h); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_grid_size_set, EFL_FUNC_CALL(w, h), int w, int h); + +void _elm_grid_grid_size_get(const Eo *obj, void *pd, int *w, int *h); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_grid_size_get, EFL_FUNC_CALL(w, h), int *w, int *h); + +Eina_List *_elm_grid_children_get(const Eo *obj, void *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_grid_children_get, Eina_List *, NULL); + +void _elm_grid_clear(Eo *obj, void *pd, Eina_Bool clear); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_grid_clear, EFL_FUNC_CALL(clear), Eina_Bool clear); + +void _elm_grid_unpack(Eo *obj, void *pd, Efl_Canvas_Object *subobj); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_grid_unpack, EFL_FUNC_CALL(subobj), Efl_Canvas_Object *subobj); + +void _elm_grid_pack(Eo *obj, void *pd, Efl_Canvas_Object *subobj, int x, int y, int w, int h); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_grid_pack, EFL_FUNC_CALL(subobj, x, y, w, h), Efl_Canvas_Object *subobj, int x, int y, int w, int h); + +Efl_Object *_elm_grid_efl_object_constructor(Eo *obj, void *pd); + + +Eina_Error _elm_grid_efl_ui_widget_theme_apply(Eo *obj, void *pd); + + +void _elm_grid_efl_ui_focus_composition_prepare(Eo *obj, void *pd); + + +static Eina_Bool +_elm_grid_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_GRID_EXTRA_OPS +#define ELM_GRID_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_grid_size_set, _elm_grid_grid_size_set), + EFL_OBJECT_OP_FUNC(elm_obj_grid_size_get, _elm_grid_grid_size_get), + EFL_OBJECT_OP_FUNC(elm_obj_grid_children_get, _elm_grid_children_get), + EFL_OBJECT_OP_FUNC(elm_obj_grid_clear, _elm_grid_clear), + EFL_OBJECT_OP_FUNC(elm_obj_grid_unpack, _elm_grid_unpack), + EFL_OBJECT_OP_FUNC(elm_obj_grid_pack, _elm_grid_pack), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_grid_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_grid_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_focus_composition_prepare, _elm_grid_efl_ui_focus_composition_prepare), + ELM_GRID_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_grid_class_desc = { + EO_VERSION, + "Elm.Grid", + EFL_CLASS_TYPE_REGULAR, + 0, + _elm_grid_class_initializer, + _elm_grid_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_grid_class_get, &_elm_grid_class_desc, EFL_UI_WIDGET_CLASS, EFL_UI_FOCUS_COMPOSITION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_grid_eo.legacy.c" diff --git a/src/lib/elementary/elm_grid_eo.h b/src/lib/elementary/elm_grid_eo.h new file mode 100644 index 0000000..d9ae0a8 --- /dev/null +++ b/src/lib/elementary/elm_grid_eo.h @@ -0,0 +1,96 @@ +#ifndef _ELM_GRID_EO_H_ +#define _ELM_GRID_EO_H_ + +#ifndef _ELM_GRID_EO_CLASS_TYPE +#define _ELM_GRID_EO_CLASS_TYPE + +typedef Eo Elm_Grid; + +#endif + +#ifndef _ELM_GRID_EO_TYPES +#define _ELM_GRID_EO_TYPES + + +#endif +/** Elementary grid class + * + * @ingroup Elm_Grid + */ +#define ELM_GRID_CLASS elm_grid_class_get() + +EWAPI const Efl_Class *elm_grid_class_get(void); + +/** + * @brief Set the virtual size of the grid + * + * @param[in] obj The object. + * @param[in] w The virtual width of the grid + * @param[in] h The virtual height of the grid + * + * @ingroup Elm_Grid + */ +EOAPI void elm_obj_grid_size_set(Eo *obj, int w, int h); + +/** + * @brief Get the virtual size of the grid + * + * @param[in] obj The object. + * @param[out] w The virtual width of the grid + * @param[out] h The virtual height of the grid + * + * @ingroup Elm_Grid + */ +EOAPI void elm_obj_grid_size_get(const Eo *obj, int *w, int *h); + +/** + * @brief Get the list of the children for the grid. + * + * @note This is a duplicate of the list kept by the grid internally. It's up + * to the user to destroy it when it no longer needs it. It's possible to + * remove objects from the grid when walking this list, but these removals + * won't be reflected on it. + * + * @param[in] obj The object. + * + * @return List of children + * + * @ingroup Elm_Grid + */ +EOAPI Eina_List *elm_obj_grid_children_get(const Eo *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Faster way to remove all child objects from a grid object. + * + * @param[in] obj The object. + * @param[in] clear If @c true, it will delete just removed children + * + * @ingroup Elm_Grid + */ +EOAPI void elm_obj_grid_clear(Eo *obj, Eina_Bool clear); + +/** + * @brief Unpack a child from a grid object + * + * @param[in] obj The object. + * @param[in] subobj The child to unpack + * + * @ingroup Elm_Grid + */ +EOAPI void elm_obj_grid_unpack(Eo *obj, Efl_Canvas_Object *subobj); + +/** + * @brief Pack child at given position and size + * + * @param[in] obj The object. + * @param[in] subobj The child to pack. + * @param[in] x The virtual x coord at which to pack it. + * @param[in] y The virtual y coord at which to pack it. + * @param[in] w The virtual width at which to pack it. + * @param[in] h The virtual height at which to pack it. + * + * @ingroup Elm_Grid + */ +EOAPI void elm_obj_grid_pack(Eo *obj, Efl_Canvas_Object *subobj, int x, int y, int w, int h); + +#endif diff --git a/src/lib/elementary/elm_grid_eo.legacy.c b/src/lib/elementary/elm_grid_eo.legacy.c new file mode 100644 index 0000000..074d488 --- /dev/null +++ b/src/lib/elementary/elm_grid_eo.legacy.c @@ -0,0 +1,36 @@ + +EAPI void +elm_grid_size_set(Elm_Grid *obj, int w, int h) +{ + elm_obj_grid_size_set(obj, w, h); +} + +EAPI void +elm_grid_size_get(const Elm_Grid *obj, int *w, int *h) +{ + elm_obj_grid_size_get(obj, w, h); +} + +EAPI Eina_List * +elm_grid_children_get(const Elm_Grid *obj) +{ + return elm_obj_grid_children_get(obj); +} + +EAPI void +elm_grid_clear(Elm_Grid *obj, Eina_Bool clear) +{ + elm_obj_grid_clear(obj, clear); +} + +EAPI void +elm_grid_unpack(Elm_Grid *obj, Efl_Canvas_Object *subobj) +{ + elm_obj_grid_unpack(obj, subobj); +} + +EAPI void +elm_grid_pack(Elm_Grid *obj, Efl_Canvas_Object *subobj, int x, int y, int w, int h) +{ + elm_obj_grid_pack(obj, subobj, x, y, w, h); +} diff --git a/src/lib/elementary/elm_grid_eo.legacy.h b/src/lib/elementary/elm_grid_eo.legacy.h new file mode 100644 index 0000000..7dae7b5 --- /dev/null +++ b/src/lib/elementary/elm_grid_eo.legacy.h @@ -0,0 +1,89 @@ +#ifndef _ELM_GRID_EO_LEGACY_H_ +#define _ELM_GRID_EO_LEGACY_H_ + +#ifndef _ELM_GRID_EO_CLASS_TYPE +#define _ELM_GRID_EO_CLASS_TYPE + +typedef Eo Elm_Grid; + +#endif + +#ifndef _ELM_GRID_EO_TYPES +#define _ELM_GRID_EO_TYPES + + +#endif + +/** + * @brief Set the virtual size of the grid + * + * @param[in] obj The object. + * @param[in] w The virtual width of the grid + * @param[in] h The virtual height of the grid + * + * @ingroup Elm_Grid_Group + */ +EAPI void elm_grid_size_set(Elm_Grid *obj, int w, int h); + +/** + * @brief Get the virtual size of the grid + * + * @param[in] obj The object. + * @param[out] w The virtual width of the grid + * @param[out] h The virtual height of the grid + * + * @ingroup Elm_Grid_Group + */ +EAPI void elm_grid_size_get(const Elm_Grid *obj, int *w, int *h); + +/** + * @brief Get the list of the children for the grid. + * + * @note This is a duplicate of the list kept by the grid internally. It's up + * to the user to destroy it when it no longer needs it. It's possible to + * remove objects from the grid when walking this list, but these removals + * won't be reflected on it. + * + * @param[in] obj The object. + * + * @return List of children + * + * @ingroup Elm_Grid_Group + */ +EAPI Eina_List *elm_grid_children_get(const Elm_Grid *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Faster way to remove all child objects from a grid object. + * + * @param[in] obj The object. + * @param[in] clear If @c true, it will delete just removed children + * + * @ingroup Elm_Grid_Group + */ +EAPI void elm_grid_clear(Elm_Grid *obj, Eina_Bool clear); + +/** + * @brief Unpack a child from a grid object + * + * @param[in] obj The object. + * @param[in] subobj The child to unpack + * + * @ingroup Elm_Grid_Group + */ +EAPI void elm_grid_unpack(Elm_Grid *obj, Efl_Canvas_Object *subobj); + +/** + * @brief Pack child at given position and size + * + * @param[in] obj The object. + * @param[in] subobj The child to pack. + * @param[in] x The virtual x coord at which to pack it. + * @param[in] y The virtual y coord at which to pack it. + * @param[in] w The virtual width at which to pack it. + * @param[in] h The virtual height at which to pack it. + * + * @ingroup Elm_Grid_Group + */ +EAPI void elm_grid_pack(Elm_Grid *obj, Efl_Canvas_Object *subobj, int x, int y, int w, int h); + +#endif diff --git a/src/lib/elementary/elm_grid_legacy.h b/src/lib/elementary/elm_grid_legacy.h index d67c921..6884fb1 100644 --- a/src/lib/elementary/elm_grid_legacy.h +++ b/src/lib/elementary/elm_grid_legacy.h @@ -34,4 +34,4 @@ EAPI void elm_grid_pack_set(Evas_Object *subobj, Evas_Coord x, Evas_Coor */ EAPI void elm_grid_pack_get(Evas_Object *subobj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h); -#include "elm_grid.eo.legacy.h" \ No newline at end of file +#include "elm_grid_eo.legacy.h" \ No newline at end of file diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build index 2d11656..61b5de3 100644 --- a/src/lib/elementary/meson.build +++ b/src/lib/elementary/meson.build @@ -41,7 +41,6 @@ pub_legacy_eo_files = [ 'elm_actionslider_part.eo', 'elm_bubble_part.eo', 'elm_fileselector_part.eo', - 'elm_grid.eo', 'elm_icon.eo', 'elm_inwin.eo', 'elm_mapbuf.eo', @@ -874,6 +873,8 @@ elementary_pub_headers = [ 'elm_gesture_layer_eo.legacy.h', 'elm_glview_eo.h', 'elm_glview_eo.legacy.h', + 'elm_grid_eo.h', + 'elm_grid_eo.legacy.h', 'elm_hoversel_eo.h', 'elm_hoversel_eo.legacy.h', 'elm_hoversel_item_eo.h', -- 2.7.4