diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am index 8e91c28f4e..d44bd3c4e7 100644 --- a/src/Makefile_Elementary.am +++ b/src/Makefile_Elementary.am @@ -205,7 +205,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_separator.eo \ lib/elementary/elm_slideshow.eo \ lib/elementary/elm_slideshow_item.eo \ lib/elementary/elm_table.eo \ @@ -384,6 +383,8 @@ lib/elementary/elm_segment_control_eo.c \ lib/elementary/elm_segment_control_eo.legacy.c \ lib/elementary/elm_segment_control_item_eo.c \ lib/elementary/elm_segment_control_item_eo.legacy.c \ +lib/elementary/elm_separator_eo.c \ +lib/elementary/elm_separator_eo.legacy.c \ $(NULL) elm_legacy_eo_headers = \ @@ -563,6 +564,8 @@ lib/elementary/elm_segment_control_eo.h \ lib/elementary/elm_segment_control_eo.legacy.h \ lib/elementary/elm_segment_control_item_eo.h \ lib/elementary/elm_segment_control_item_eo.legacy.h \ +lib/elementary/elm_separator_eo.h \ +lib/elementary/elm_separator_eo.legacy.h \ $(NULL) diff --git a/src/lib/elementary/elm_separator.c b/src/lib/elementary/elm_separator.c index 8d94d05ed6..2c73da13b0 100644 --- a/src/lib/elementary/elm_separator.c +++ b/src/lib/elementary/elm_separator.c @@ -7,7 +7,7 @@ #include #include "elm_priv.h" -#include "elm_separator.eo.h" +#include "elm_separator_eo.h" #include "elm_widget_separator.h" #include "elm_widget_layout.h" @@ -104,4 +104,4 @@ _elm_separator_class_constructor(Efl_Class *klass) ELM_LAYOUT_SIZING_EVAL_OPS(elm_separator), \ EFL_CANVAS_GROUP_ADD_OPS(elm_separator) -#include "elm_separator.eo.c" +#include "elm_separator_eo.c" diff --git a/src/lib/elementary/elm_separator.eo b/src/lib/elementary/elm_separator.eo deleted file mode 100644 index 8356248c90..0000000000 --- a/src/lib/elementary/elm_separator.eo +++ /dev/null @@ -1,24 +0,0 @@ -class Elm.Separator extends Efl.Ui.Layout_Base implements Efl.Ui.Legacy -{ - [[Elementary separator class]] - legacy_prefix: elm_separator; - eo_prefix: elm_obj_separator; - methods { - @property horizontal { - set { - [[Set the horizontal mode of a separator object]] - } - get { - [[Get the horizontal mode of a separator object]] - } - values { - horizontal: bool; [[If true, the separator is horizontal]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Ui.Widget.theme_apply; - } -} diff --git a/src/lib/elementary/elm_separator_eo.c b/src/lib/elementary/elm_separator_eo.c new file mode 100644 index 0000000000..1f8206fe6b --- /dev/null +++ b/src/lib/elementary/elm_separator_eo.c @@ -0,0 +1,83 @@ + +void _elm_separator_horizontal_set(Eo *obj, Elm_Separator_Data *pd, Eina_Bool horizontal); + + +static Eina_Error +__eolian_elm_separator_horizontal_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_separator_horizontal_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_separator_horizontal_set, EFL_FUNC_CALL(horizontal), Eina_Bool horizontal); + +Eina_Bool _elm_separator_horizontal_get(const Eo *obj, Elm_Separator_Data *pd); + + +static Eina_Value +__eolian_elm_separator_horizontal_get_reflect(Eo *obj) +{ + Eina_Bool val = elm_obj_separator_horizontal_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_separator_horizontal_get, Eina_Bool, 0); + +Efl_Object *_elm_separator_efl_object_constructor(Eo *obj, Elm_Separator_Data *pd); + + +Eina_Error _elm_separator_efl_ui_widget_theme_apply(Eo *obj, Elm_Separator_Data *pd); + + +static Eina_Bool +_elm_separator_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_SEPARATOR_EXTRA_OPS +#define ELM_SEPARATOR_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_separator_horizontal_set, _elm_separator_horizontal_set), + EFL_OBJECT_OP_FUNC(elm_obj_separator_horizontal_get, _elm_separator_horizontal_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_separator_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_separator_efl_ui_widget_theme_apply), + ELM_SEPARATOR_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"horizontal", __eolian_elm_separator_horizontal_set_reflect, __eolian_elm_separator_horizontal_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_separator_class_desc = { + EO_VERSION, + "Elm.Separator", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Separator_Data), + _elm_separator_class_initializer, + _elm_separator_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_separator_class_get, &_elm_separator_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_separator_eo.legacy.c" diff --git a/src/lib/elementary/elm_separator_eo.h b/src/lib/elementary/elm_separator_eo.h new file mode 100644 index 0000000000..ce4d5e0539 --- /dev/null +++ b/src/lib/elementary/elm_separator_eo.h @@ -0,0 +1,45 @@ +#ifndef _ELM_SEPARATOR_EO_H_ +#define _ELM_SEPARATOR_EO_H_ + +#ifndef _ELM_SEPARATOR_EO_CLASS_TYPE +#define _ELM_SEPARATOR_EO_CLASS_TYPE + +typedef Eo Elm_Separator; + +#endif + +#ifndef _ELM_SEPARATOR_EO_TYPES +#define _ELM_SEPARATOR_EO_TYPES + + +#endif +/** Elementary separator class + * + * @ingroup Elm_Separator + */ +#define ELM_SEPARATOR_CLASS elm_separator_class_get() + +EWAPI const Efl_Class *elm_separator_class_get(void); + +/** + * @brief Set the horizontal mode of a separator object + * + * @param[in] obj The object. + * @param[in] horizontal If true, the separator is horizontal + * + * @ingroup Elm_Separator + */ +EOAPI void elm_obj_separator_horizontal_set(Eo *obj, Eina_Bool horizontal); + +/** + * @brief Get the horizontal mode of a separator object + * + * @param[in] obj The object. + * + * @return If true, the separator is horizontal + * + * @ingroup Elm_Separator + */ +EOAPI Eina_Bool elm_obj_separator_horizontal_get(const Eo *obj); + +#endif diff --git a/src/lib/elementary/elm_separator_eo.legacy.c b/src/lib/elementary/elm_separator_eo.legacy.c new file mode 100644 index 0000000000..13de3002c2 --- /dev/null +++ b/src/lib/elementary/elm_separator_eo.legacy.c @@ -0,0 +1,12 @@ + +EAPI void +elm_separator_horizontal_set(Elm_Separator *obj, Eina_Bool horizontal) +{ + elm_obj_separator_horizontal_set(obj, horizontal); +} + +EAPI Eina_Bool +elm_separator_horizontal_get(const Elm_Separator *obj) +{ + return elm_obj_separator_horizontal_get(obj); +} diff --git a/src/lib/elementary/elm_separator_eo.legacy.h b/src/lib/elementary/elm_separator_eo.legacy.h new file mode 100644 index 0000000000..907250b2f1 --- /dev/null +++ b/src/lib/elementary/elm_separator_eo.legacy.h @@ -0,0 +1,38 @@ +#ifndef _ELM_SEPARATOR_EO_LEGACY_H_ +#define _ELM_SEPARATOR_EO_LEGACY_H_ + +#ifndef _ELM_SEPARATOR_EO_CLASS_TYPE +#define _ELM_SEPARATOR_EO_CLASS_TYPE + +typedef Eo Elm_Separator; + +#endif + +#ifndef _ELM_SEPARATOR_EO_TYPES +#define _ELM_SEPARATOR_EO_TYPES + + +#endif + +/** + * @brief Set the horizontal mode of a separator object + * + * @param[in] obj The object. + * @param[in] horizontal If true, the separator is horizontal + * + * @ingroup Elm_Separator_Group + */ +EAPI void elm_separator_horizontal_set(Elm_Separator *obj, Eina_Bool horizontal); + +/** + * @brief Get the horizontal mode of a separator object + * + * @param[in] obj The object. + * + * @return If true, the separator is horizontal + * + * @ingroup Elm_Separator_Group + */ +EAPI Eina_Bool elm_separator_horizontal_get(const Elm_Separator *obj); + +#endif diff --git a/src/lib/elementary/elm_separator_legacy.h b/src/lib/elementary/elm_separator_legacy.h index 82cf44ee0b..bd5ac73f31 100644 --- a/src/lib/elementary/elm_separator_legacy.h +++ b/src/lib/elementary/elm_separator_legacy.h @@ -9,4 +9,4 @@ */ EAPI Evas_Object *elm_separator_add(Evas_Object *parent); -#include "elm_separator.eo.legacy.h" \ No newline at end of file +#include "elm_separator_eo.legacy.h" \ No newline at end of file diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build index 47df877302..c06e47a9fa 100644 --- a/src/lib/elementary/meson.build +++ b/src/lib/elementary/meson.build @@ -22,7 +22,6 @@ pub_legacy_eo_files = [ 'elm_actionslider_part.eo', 'elm_bubble_part.eo', 'elm_fileselector_part.eo', - 'elm_separator.eo', 'elm_slideshow.eo', 'elm_slideshow_item.eo', 'elm_table.eo', @@ -790,6 +789,8 @@ elementary_pub_headers = [ 'elm_segment_control_eo.legacy.h', 'elm_segment_control_item_eo.h', 'elm_segment_control_item_eo.legacy.h', + 'elm_separator_eo.h', + 'elm_separator_eo.legacy.h', ] elementary_header_src = [