From b260b726e2b7b8c84aa9775379a41ec94cf87325 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 5 Mar 2019 17:00:37 -0500 Subject: [PATCH] elm_actionslider: 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/D8153 --- src/Makefile_Elementary.am | 5 +- src/lib/elementary/elm_actionslider.c | 4 +- src/lib/elementary/elm_actionslider.eo | 80 ----------- src/lib/elementary/elm_actionslider_eo.c | 82 +++++++++++ src/lib/elementary/elm_actionslider_eo.h | 134 ++++++++++++++++++ .../elementary/elm_actionslider_eo.legacy.c | 42 ++++++ .../elementary/elm_actionslider_eo.legacy.h | 113 +++++++++++++++ src/lib/elementary/elm_actionslider_legacy.h | 2 +- src/lib/elementary/meson.build | 3 +- 9 files changed, 380 insertions(+), 85 deletions(-) delete mode 100644 src/lib/elementary/elm_actionslider.eo create mode 100644 src/lib/elementary/elm_actionslider_eo.c create mode 100644 src/lib/elementary/elm_actionslider_eo.h create mode 100644 src/lib/elementary/elm_actionslider_eo.legacy.c create mode 100644 src/lib/elementary/elm_actionslider_eo.legacy.h diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am index e20e4ffaad..93caa5b34c 100644 --- a/src/Makefile_Elementary.am +++ b/src/Makefile_Elementary.am @@ -249,7 +249,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_actionslider.eo \ lib/elementary/elm_box.eo \ lib/elementary/elm_bubble.eo \ lib/elementary/elm_diskselector.eo \ @@ -332,6 +331,8 @@ lib/elementary/efl_ui_win_legacy_eo.c \ lib/elementary/efl_ui_win_socket_legacy_eo.c \ lib/elementary/elm_access_eo.c \ lib/elementary/elm_access_eo.legacy.c \ +lib/elementary/elm_actionslider_eo.c \ +lib/elementary/elm_actionslider_eo.legacy.c \ lib/elementary/elm_hoversel_eo.c \ lib/elementary/elm_hoversel_item_eo.c \ lib/elementary/elm_hoversel_item_eo.legacy.c @@ -382,6 +383,8 @@ lib/elementary/efl_ui_win_socket_legacy_eo.h \ lib/elementary/efl_ui_win_socket_legacy_eo.legacy.h \ lib/elementary/elm_access_eo.h \ lib/elementary/elm_access_eo.legacy.h \ +lib/elementary/elm_actionslider_eo.h \ +lib/elementary/elm_actionslider_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_actionslider.c b/src/lib/elementary/elm_actionslider.c index b7b98f178a..f83bdca156 100644 --- a/src/lib/elementary/elm_actionslider.c +++ b/src/lib/elementary/elm_actionslider.c @@ -12,7 +12,7 @@ #include "elm_widget_actionslider.h" #include "elm_widget_layout.h" -#include "elm_actionslider.eo.h" +#include "elm_actionslider_eo.h" #include "elm_actionslider_part.eo.h" #include "elm_part_helper.h" @@ -664,4 +664,4 @@ ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(MY_CLASS_PFX) ELM_LAYOUT_SIZING_EVAL_OPS(elm_actionslider), \ EFL_CANVAS_GROUP_ADD_OPS(elm_actionslider) -#include "elm_actionslider.eo.c" +#include "elm_actionslider_eo.c" diff --git a/src/lib/elementary/elm_actionslider.eo b/src/lib/elementary/elm_actionslider.eo deleted file mode 100644 index a4f78157a2..0000000000 --- a/src/lib/elementary/elm_actionslider.eo +++ /dev/null @@ -1,80 +0,0 @@ -enum Elm.Actionslider.Pos -{ - [[A position for indicators, magnets, and enabled items.]] - legacy: elm_actionslider; - - none = 0, [[No position is set.]] - left = 1 << 0, [[Left position.]] - center = 1 << 1, [[Center position.]] - right = 1 << 2, [[Right position.]] - all = (1 << 3) - 1 [[All positions for left/center/right.]] -} - -class Elm.Actionslider extends Efl.Ui.Layout_Base implements Efl.Ui.Selectable, Efl.Ui.Legacy -{ - [[An actionslider is a switcher for 2 or 3 labels - - with customizable magnet properties. The user drags and releases - the indicator, to choose a label. When the indicator is released, - it will move to its nearest "enabled and magnetized" position. - ]] - - legacy_prefix: elm_actionslider; - eo_prefix: elm_obj_actionslider; - event_prefix: elm_actionslider; - methods { - @property indicator_pos { - [[Actionslider position indicator]] - set { - } - get { - } - values { - pos: Elm.Actionslider.Pos; [[The position of the indicator.]] - } - } - @property magnet_pos { - [[Actionslider magnet position.]] - set { - [[To make multiple positions magnets OR them together (e.g. - ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT) - ]] - } - get { - } - values { - pos: Elm.Actionslider.Pos; [[Bit mask indicating the magnet positions.]] - } - } - @property enabled_pos { - [[Actionslider enabled position.]] - set { - [[To set multiple positions as enabled OR them together(e.g. - ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT). - - Note: All the positions are enabled by default. - ]] - } - get { - } - values { - pos: Elm.Actionslider.Pos; [[Bit mask indicating the enabled positions.]] - } - } - @property selected_label { - get { - [[Get actionslider selected label.]] - return: string; [[Selected label]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Ui.Widget.theme_apply; - Efl.Part.part_get; - } - events { - pos_changed: string; [[The position of the actionslider has changed]] - } -} diff --git a/src/lib/elementary/elm_actionslider_eo.c b/src/lib/elementary/elm_actionslider_eo.c new file mode 100644 index 0000000000..5e47bd42f6 --- /dev/null +++ b/src/lib/elementary/elm_actionslider_eo.c @@ -0,0 +1,82 @@ +EWAPI const Efl_Event_Description _ELM_ACTIONSLIDER_EVENT_POS_CHANGED = + EFL_EVENT_DESCRIPTION("pos_changed"); + +void _elm_actionslider_indicator_pos_set(Eo *obj, Elm_Actionslider_Data *pd, Elm_Actionslider_Pos pos); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_actionslider_indicator_pos_set, EFL_FUNC_CALL(pos), Elm_Actionslider_Pos pos); + +Elm_Actionslider_Pos _elm_actionslider_indicator_pos_get(const Eo *obj, Elm_Actionslider_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_actionslider_indicator_pos_get, Elm_Actionslider_Pos, 0); + +void _elm_actionslider_magnet_pos_set(Eo *obj, Elm_Actionslider_Data *pd, Elm_Actionslider_Pos pos); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_actionslider_magnet_pos_set, EFL_FUNC_CALL(pos), Elm_Actionslider_Pos pos); + +Elm_Actionslider_Pos _elm_actionslider_magnet_pos_get(const Eo *obj, Elm_Actionslider_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_actionslider_magnet_pos_get, Elm_Actionslider_Pos, 0); + +void _elm_actionslider_enabled_pos_set(Eo *obj, Elm_Actionslider_Data *pd, Elm_Actionslider_Pos pos); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_actionslider_enabled_pos_set, EFL_FUNC_CALL(pos), Elm_Actionslider_Pos pos); + +Elm_Actionslider_Pos _elm_actionslider_enabled_pos_get(const Eo *obj, Elm_Actionslider_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_actionslider_enabled_pos_get, Elm_Actionslider_Pos, 0); + +const char *_elm_actionslider_selected_label_get(const Eo *obj, Elm_Actionslider_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_actionslider_selected_label_get, const char *, NULL); + +Efl_Object *_elm_actionslider_efl_object_constructor(Eo *obj, Elm_Actionslider_Data *pd); + + +Eina_Error _elm_actionslider_efl_ui_widget_theme_apply(Eo *obj, Elm_Actionslider_Data *pd); + + +Efl_Object *_elm_actionslider_efl_part_part_get(const Eo *obj, Elm_Actionslider_Data *pd, const char *name); + + +static Eina_Bool +_elm_actionslider_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_ACTIONSLIDER_EXTRA_OPS +#define ELM_ACTIONSLIDER_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_actionslider_indicator_pos_set, _elm_actionslider_indicator_pos_set), + EFL_OBJECT_OP_FUNC(elm_obj_actionslider_indicator_pos_get, _elm_actionslider_indicator_pos_get), + EFL_OBJECT_OP_FUNC(elm_obj_actionslider_magnet_pos_set, _elm_actionslider_magnet_pos_set), + EFL_OBJECT_OP_FUNC(elm_obj_actionslider_magnet_pos_get, _elm_actionslider_magnet_pos_get), + EFL_OBJECT_OP_FUNC(elm_obj_actionslider_enabled_pos_set, _elm_actionslider_enabled_pos_set), + EFL_OBJECT_OP_FUNC(elm_obj_actionslider_enabled_pos_get, _elm_actionslider_enabled_pos_get), + EFL_OBJECT_OP_FUNC(elm_obj_actionslider_selected_label_get, _elm_actionslider_selected_label_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_actionslider_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_actionslider_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_part_get, _elm_actionslider_efl_part_part_get), + ELM_ACTIONSLIDER_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_actionslider_class_desc = { + EO_VERSION, + "Elm.Actionslider", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Actionslider_Data), + _elm_actionslider_class_initializer, + _elm_actionslider_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_actionslider_class_get, &_elm_actionslider_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_actionslider_eo.legacy.c" diff --git a/src/lib/elementary/elm_actionslider_eo.h b/src/lib/elementary/elm_actionslider_eo.h new file mode 100644 index 0000000000..9a6b55d484 --- /dev/null +++ b/src/lib/elementary/elm_actionslider_eo.h @@ -0,0 +1,134 @@ +#ifndef _ELM_ACTIONSLIDER_EO_H_ +#define _ELM_ACTIONSLIDER_EO_H_ + +#ifndef _ELM_ACTIONSLIDER_EO_CLASS_TYPE +#define _ELM_ACTIONSLIDER_EO_CLASS_TYPE + +typedef Eo Elm_Actionslider; + +#endif + +#ifndef _ELM_ACTIONSLIDER_EO_TYPES +#define _ELM_ACTIONSLIDER_EO_TYPES + +/** A position for indicators, magnets, and enabled items. + * + * @ingroup Elm_Actionslider + */ +typedef enum +{ + ELM_ACTIONSLIDER_NONE = 0, /**< No position is set. */ + ELM_ACTIONSLIDER_LEFT = 1 /* 1 >> 0 */, /**< Left position. */ + ELM_ACTIONSLIDER_CENTER = 2 /* 1 >> 1 */, /**< Center position. */ + ELM_ACTIONSLIDER_RIGHT = 4 /* 1 >> 2 */, /**< Right position. */ + ELM_ACTIONSLIDER_ALL = 7 /* (1 >> 3) * 1 */ /**< All positions for + * left/center/right. */ +} Elm_Actionslider_Pos; + + +#endif +/** + * @brief An actionslider is a switcher for 2 or 3 labels + * + * with customizable magnet properties. The user drags and releases the + * indicator, to choose a label. When the indicator is released, it will move + * to its nearest "enabled and magnetized" position. + * + * @ingroup Elm_Actionslider + */ +#define ELM_ACTIONSLIDER_CLASS elm_actionslider_class_get() + +EWAPI const Efl_Class *elm_actionslider_class_get(void); + +/** + * @brief Actionslider position indicator + * + * @param[in] obj The object. + * @param[in] pos The position of the indicator. + * + * @ingroup Elm_Actionslider + */ +EOAPI void elm_obj_actionslider_indicator_pos_set(Eo *obj, Elm_Actionslider_Pos pos); + +/** + * @brief Actionslider position indicator + * + * @param[in] obj The object. + * + * @return The position of the indicator. + * + * @ingroup Elm_Actionslider + */ +EOAPI Elm_Actionslider_Pos elm_obj_actionslider_indicator_pos_get(const Eo *obj); + +/** + * @brief Actionslider magnet position. + * + * To make multiple positions magnets OR them together (e.g. + * ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT) + * + * @param[in] obj The object. + * @param[in] pos Bit mask indicating the magnet positions. + * + * @ingroup Elm_Actionslider + */ +EOAPI void elm_obj_actionslider_magnet_pos_set(Eo *obj, Elm_Actionslider_Pos pos); + +/** + * @brief Actionslider magnet position. + * + * @param[in] obj The object. + * + * @return Bit mask indicating the magnet positions. + * + * @ingroup Elm_Actionslider + */ +EOAPI Elm_Actionslider_Pos elm_obj_actionslider_magnet_pos_get(const Eo *obj); + +/** + * @brief Actionslider enabled position. + * + * To set multiple positions as enabled OR them together(e.g. + * ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT). + * + * @note All the positions are enabled by default. + * + * @param[in] obj The object. + * @param[in] pos Bit mask indicating the enabled positions. + * + * @ingroup Elm_Actionslider + */ +EOAPI void elm_obj_actionslider_enabled_pos_set(Eo *obj, Elm_Actionslider_Pos pos); + +/** + * @brief Actionslider enabled position. + * + * @param[in] obj The object. + * + * @return Bit mask indicating the enabled positions. + * + * @ingroup Elm_Actionslider + */ +EOAPI Elm_Actionslider_Pos elm_obj_actionslider_enabled_pos_get(const Eo *obj); + +/** + * @brief Get actionslider selected label. + * + * @param[in] obj The object. + * + * @return Selected label + * + * @ingroup Elm_Actionslider + */ +EOAPI const char *elm_obj_actionslider_selected_label_get(const Eo *obj); + +EWAPI extern const Efl_Event_Description _ELM_ACTIONSLIDER_EVENT_POS_CHANGED; + +/** The position of the actionslider has changed + * @return const char * + * + * @ingroup Elm_Actionslider + */ +#define ELM_ACTIONSLIDER_EVENT_POS_CHANGED (&(_ELM_ACTIONSLIDER_EVENT_POS_CHANGED)) + +#endif diff --git a/src/lib/elementary/elm_actionslider_eo.legacy.c b/src/lib/elementary/elm_actionslider_eo.legacy.c new file mode 100644 index 0000000000..b1c02500d9 --- /dev/null +++ b/src/lib/elementary/elm_actionslider_eo.legacy.c @@ -0,0 +1,42 @@ + +EAPI void +elm_actionslider_indicator_pos_set(Elm_Actionslider *obj, Elm_Actionslider_Pos pos) +{ + elm_obj_actionslider_indicator_pos_set(obj, pos); +} + +EAPI Elm_Actionslider_Pos +elm_actionslider_indicator_pos_get(const Elm_Actionslider *obj) +{ + return elm_obj_actionslider_indicator_pos_get(obj); +} + +EAPI void +elm_actionslider_magnet_pos_set(Elm_Actionslider *obj, Elm_Actionslider_Pos pos) +{ + elm_obj_actionslider_magnet_pos_set(obj, pos); +} + +EAPI Elm_Actionslider_Pos +elm_actionslider_magnet_pos_get(const Elm_Actionslider *obj) +{ + return elm_obj_actionslider_magnet_pos_get(obj); +} + +EAPI void +elm_actionslider_enabled_pos_set(Elm_Actionslider *obj, Elm_Actionslider_Pos pos) +{ + elm_obj_actionslider_enabled_pos_set(obj, pos); +} + +EAPI Elm_Actionslider_Pos +elm_actionslider_enabled_pos_get(const Elm_Actionslider *obj) +{ + return elm_obj_actionslider_enabled_pos_get(obj); +} + +EAPI const char * +elm_actionslider_selected_label_get(const Elm_Actionslider *obj) +{ + return elm_obj_actionslider_selected_label_get(obj); +} diff --git a/src/lib/elementary/elm_actionslider_eo.legacy.h b/src/lib/elementary/elm_actionslider_eo.legacy.h new file mode 100644 index 0000000000..6a8b63bd0c --- /dev/null +++ b/src/lib/elementary/elm_actionslider_eo.legacy.h @@ -0,0 +1,113 @@ +#ifndef _ELM_ACTIONSLIDER_EO_LEGACY_H_ +#define _ELM_ACTIONSLIDER_EO_LEGACY_H_ + +#ifndef _ELM_ACTIONSLIDER_EO_CLASS_TYPE +#define _ELM_ACTIONSLIDER_EO_CLASS_TYPE + +typedef Eo Elm_Actionslider; + +#endif + +#ifndef _ELM_ACTIONSLIDER_EO_TYPES +#define _ELM_ACTIONSLIDER_EO_TYPES + +/** A position for indicators, magnets, and enabled items. + * + * @ingroup Elm_Actionslider + */ +typedef enum +{ + ELM_ACTIONSLIDER_NONE = 0, /**< No position is set. */ + ELM_ACTIONSLIDER_LEFT = 1 /* 1 >> 0 */, /**< Left position. */ + ELM_ACTIONSLIDER_CENTER = 2 /* 1 >> 1 */, /**< Center position. */ + ELM_ACTIONSLIDER_RIGHT = 4 /* 1 >> 2 */, /**< Right position. */ + ELM_ACTIONSLIDER_ALL = 7 /* (1 >> 3) * 1 */ /**< All positions for + * left/center/right. */ +} Elm_Actionslider_Pos; + + +#endif + +/** + * @brief Actionslider position indicator + * + * @param[in] obj The object. + * @param[in] pos The position of the indicator. + * + * @ingroup Elm_Actionslider_Group + */ +EAPI void elm_actionslider_indicator_pos_set(Elm_Actionslider *obj, Elm_Actionslider_Pos pos); + +/** + * @brief Actionslider position indicator + * + * @param[in] obj The object. + * + * @return The position of the indicator. + * + * @ingroup Elm_Actionslider_Group + */ +EAPI Elm_Actionslider_Pos elm_actionslider_indicator_pos_get(const Elm_Actionslider *obj); + +/** + * @brief Actionslider magnet position. + * + * To make multiple positions magnets OR them together (e.g. + * ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT) + * + * @param[in] obj The object. + * @param[in] pos Bit mask indicating the magnet positions. + * + * @ingroup Elm_Actionslider_Group + */ +EAPI void elm_actionslider_magnet_pos_set(Elm_Actionslider *obj, Elm_Actionslider_Pos pos); + +/** + * @brief Actionslider magnet position. + * + * @param[in] obj The object. + * + * @return Bit mask indicating the magnet positions. + * + * @ingroup Elm_Actionslider_Group + */ +EAPI Elm_Actionslider_Pos elm_actionslider_magnet_pos_get(const Elm_Actionslider *obj); + +/** + * @brief Actionslider enabled position. + * + * To set multiple positions as enabled OR them together(e.g. + * ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT). + * + * @note All the positions are enabled by default. + * + * @param[in] obj The object. + * @param[in] pos Bit mask indicating the enabled positions. + * + * @ingroup Elm_Actionslider_Group + */ +EAPI void elm_actionslider_enabled_pos_set(Elm_Actionslider *obj, Elm_Actionslider_Pos pos); + +/** + * @brief Actionslider enabled position. + * + * @param[in] obj The object. + * + * @return Bit mask indicating the enabled positions. + * + * @ingroup Elm_Actionslider_Group + */ +EAPI Elm_Actionslider_Pos elm_actionslider_enabled_pos_get(const Elm_Actionslider *obj); + +/** + * @brief Get actionslider selected label. + * + * @param[in] obj The object. + * + * @return Selected label + * + * @ingroup Elm_Actionslider_Group + */ +EAPI const char *elm_actionslider_selected_label_get(const Elm_Actionslider *obj); + +#endif diff --git a/src/lib/elementary/elm_actionslider_legacy.h b/src/lib/elementary/elm_actionslider_legacy.h index 60512fd004..57aa0e2770 100644 --- a/src/lib/elementary/elm_actionslider_legacy.h +++ b/src/lib/elementary/elm_actionslider_legacy.h @@ -8,4 +8,4 @@ */ EAPI Evas_Object *elm_actionslider_add(Evas_Object *parent); -#include "elm_actionslider.eo.legacy.h" +#include "elm_actionslider_eo.legacy.h" diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build index 8e003ae24b..db9b97f4b7 100644 --- a/src/lib/elementary/meson.build +++ b/src/lib/elementary/meson.build @@ -63,7 +63,6 @@ pub_legacy_eo_files = [ 'elm_actionslider_part.eo', 'elm_bubble_part.eo', 'elm_fileselector_part.eo', - 'elm_actionslider.eo', 'elm_box.eo', 'elm_bubble.eo', 'elm_diskselector.eo', @@ -723,6 +722,8 @@ elementary_pub_headers = [ 'efl_ui_win_socket_legacy_eo.legacy.h', 'elm_access_eo.h', 'elm_access_eo.legacy.h', + 'elm_actionslider_eo.h', + 'elm_actionslider_eo.legacy.h', 'elm_hoversel_eo.h', 'elm_hoversel_eo.legacy.h', 'elm_hoversel_item_eo.h',