diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am index ad60028976..f3d6ff0308 100644 --- a/src/Makefile_Elementary.am +++ b/src/Makefile_Elementary.am @@ -186,7 +186,6 @@ elm_private_eolian_files = \ # Legacy classes - not part of public EO API elm_legacy_eolian_files = \ lib/elementary/efl_ui_clock_legacy.eo \ - lib/elementary/elm_menu.eo \ lib/elementary/elm_notify.eo \ lib/elementary/elm_panel.eo \ lib/elementary/elm_player.eo \ @@ -198,7 +197,6 @@ elm_legacy_eolian_files = \ lib/elementary/elm_sys_notify.eo \ lib/elementary/elm_sys_notify_dbus.eo \ lib/elementary/elm_systray.eo \ - lib/elementary/elm_menu_item.eo \ lib/elementary/elm_widget_item_static_focus.eo \ lib/elementary/elm_popup_item.eo \ lib/elementary/elm_ctxpopup_part.eo \ @@ -368,6 +366,10 @@ lib/elementary/elm_mapbuf_eo.legacy.c \ lib/elementary/elm_map_eo.c \ lib/elementary/elm_map_eo.legacy.c \ lib/elementary/elm_map_pan_eo.c \ +lib/elementary/elm_menu_eo.c \ +lib/elementary/elm_menu_eo.legacy.c \ +lib/elementary/elm_menu_item_eo.c \ +lib/elementary/elm_menu_item_eo.legacy.c \ $(NULL) elm_legacy_eo_headers = \ @@ -509,6 +511,10 @@ lib/elementary/elm_map_eo.h \ lib/elementary/elm_map_eo.legacy.h \ lib/elementary/elm_map_pan_eo.h \ lib/elementary/elm_map_pan_eo.legacy.h \ +lib/elementary/elm_menu_eo.h \ +lib/elementary/elm_menu_eo.legacy.h \ +lib/elementary/elm_menu_item_eo.h \ +lib/elementary/elm_menu_item_eo.legacy.h \ $(NULL) diff --git a/src/lib/elementary/elm_menu.c b/src/lib/elementary/elm_menu.c index 8c56dc995b..aebcd7dd37 100644 --- a/src/lib/elementary/elm_menu.c +++ b/src/lib/elementary/elm_menu.c @@ -1461,5 +1461,5 @@ _elm_menu_efl_object_provider_find(const Eo *obj, Elm_Menu_Data *pd, const Efl_O #define ELM_MENU_EXTRA_OPS \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_menu) -#include "elm_menu_item.eo.c" -#include "elm_menu.eo.c" +#include "elm_menu_item_eo.c" +#include "elm_menu_eo.c" diff --git a/src/lib/elementary/elm_menu.eo b/src/lib/elementary/elm_menu.eo deleted file mode 100644 index ef0ccacc1f..0000000000 --- a/src/lib/elementary/elm_menu.eo +++ /dev/null @@ -1,106 +0,0 @@ -class Elm.Menu extends Efl.Ui.Widget implements Efl.Ui.Clickable, - Efl.Access.Selection, Efl.Ui.Widget_Focus_Manager, Efl.Ui.Legacy -{ - [[Elementary menu class]] - legacy_prefix: elm_menu; - eo_prefix: elm_obj_menu; - event_prefix: elm_menu; - methods { - @property selected_item { - get { - [[Get the selected item in the widget.]] - } - values { - item: Elm.Widget.Item; [[The selected item or $null.]] - } - } - @property first_item { - get { - [[Get the first item in the widget.]] - } - values { - item: Elm.Widget.Item; [[The first item or $null.]] - } - } - @property last_item { - get { - [[Get the last item in the widget.]] - } - values { - item: Elm.Widget.Item; [[The last item or $null.]] - } - } - @property items { - get { - [[Returns a list of the widget item.]] - return: const(list); [[const list to widget items]] - } - } - relative_move { - [[Move the menu to a new position - - Sets the top-left position of the menu to ($x, $y). - - Note: $x and $y coordinates are relative to parent. - ]] - legacy: elm_menu_move; - params { - @in x: int; [[The new X coordinate]] - @in y: int; [[The new Y coordinate]] - } - } - item_add { - [[Add an item at the end of the given menu widget. - - Note: This function does not accept relative icon path. - ]] - return: Elm.Widget.Item; [[The new menu item.]] - params { - @in parent: Elm.Widget.Item @optional; [[The parent menu item (optional).]] - @in icon: string @optional; [[An icon display on the item. The icon will be destroyed by the menu.]] - @in label: string; [[The label of the item.]] - @in func: Evas_Smart_Cb @optional; [[Function called when the user select the item.]] - @in data: const(void_ptr) @optional; [[Data sent by the callback.]] - } - } - open { - [[Open a closed menu - - Show the menu with no child sub-menus expanded.. - ]] - } - close { - [[Close a opened menu - - Hides the menu and all it's sub-menus. - ]] - } - item_separator_add { - [[Add a separator item to menu $obj under $parent.]] - return: Elm.Widget.Item; [[The created item or $null.]] - params { - @in parent: Elm.Widget.Item; [[The item to add the separator under.]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Object.destructor; - Efl.Gfx.Entity.visible { set; } - Efl.Ui.Widget.widget_parent { get; set; } - Efl.Ui.Widget.theme_apply; - Efl.Ui.L10n.translation_update; - Efl.Ui.Widget_Focus_Manager.focus_manager_create; - Efl.Access.Object.access_children { get; } - Efl.Access.Selection.selected_children_count { get; } - Efl.Access.Selection.selected_child { get; } - Efl.Object.provider_find; - } - events { - dismissed: void; [[Called when menu widget was dismissed]] - /* FIXME: Nobody is emitting this, but they are already in use */ - elm,action,block_menu: void; [[Called when menu blocking have been enabled]] - elm,action,unblock_menu: void; [[Called when menu blocking has been disabled]] - } -} diff --git a/src/lib/elementary/elm_menu_eo.c b/src/lib/elementary/elm_menu_eo.c new file mode 100644 index 0000000000..e0440405b8 --- /dev/null +++ b/src/lib/elementary/elm_menu_eo.c @@ -0,0 +1,132 @@ +EWAPI const Efl_Event_Description _ELM_MENU_EVENT_DISMISSED = + EFL_EVENT_DESCRIPTION("dismissed"); +EWAPI const Efl_Event_Description _ELM_MENU_EVENT_ELM_ACTION_BLOCK_MENU = + EFL_EVENT_DESCRIPTION("elm,action,block_menu"); +EWAPI const Efl_Event_Description _ELM_MENU_EVENT_ELM_ACTION_UNBLOCK_MENU = + EFL_EVENT_DESCRIPTION("elm,action,unblock_menu"); + +Elm_Widget_Item *_elm_menu_selected_item_get(const Eo *obj, Elm_Menu_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_menu_selected_item_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_menu_first_item_get(const Eo *obj, Elm_Menu_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_menu_first_item_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_menu_last_item_get(const Eo *obj, Elm_Menu_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_menu_last_item_get, Elm_Widget_Item *, NULL); + +const Eina_List *_elm_menu_items_get(const Eo *obj, Elm_Menu_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_menu_items_get, const Eina_List *, NULL); + +void _elm_menu_relative_move(Eo *obj, Elm_Menu_Data *pd, int x, int y); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_menu_relative_move, EFL_FUNC_CALL(x, y), int x, int y); + +Elm_Widget_Item *_elm_menu_item_add(Eo *obj, Elm_Menu_Data *pd, Elm_Widget_Item *parent, const char *icon, const char *label, Evas_Smart_Cb func, const void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_menu_item_add, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(parent, icon, label, func, data), Elm_Widget_Item *parent, const char *icon, const char *label, Evas_Smart_Cb func, const void *data); + +void _elm_menu_open(Eo *obj, Elm_Menu_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_menu_open); + +void _elm_menu_close(Eo *obj, Elm_Menu_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_menu_close); + +Elm_Widget_Item *_elm_menu_item_separator_add(Eo *obj, Elm_Menu_Data *pd, Elm_Widget_Item *parent); + +EOAPI EFL_FUNC_BODYV(elm_obj_menu_item_separator_add, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(parent), Elm_Widget_Item *parent); + +Efl_Object *_elm_menu_efl_object_constructor(Eo *obj, Elm_Menu_Data *pd); + + +void _elm_menu_efl_object_destructor(Eo *obj, Elm_Menu_Data *pd); + + +void _elm_menu_efl_gfx_entity_visible_set(Eo *obj, Elm_Menu_Data *pd, Eina_Bool v); + + +void _elm_menu_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Menu_Data *pd, Efl_Ui_Widget *parent); + + +Efl_Ui_Widget *_elm_menu_efl_ui_widget_widget_parent_get(const Eo *obj, Elm_Menu_Data *pd); + + +Eina_Error _elm_menu_efl_ui_widget_theme_apply(Eo *obj, Elm_Menu_Data *pd); + + +void _elm_menu_efl_ui_l10n_translation_update(Eo *obj, Elm_Menu_Data *pd); + + +Efl_Ui_Focus_Manager *_elm_menu_efl_ui_widget_focus_manager_focus_manager_create(Eo *obj, Elm_Menu_Data *pd, Efl_Ui_Focus_Object *root); + + +Eina_List *_elm_menu_efl_access_object_access_children_get(const Eo *obj, Elm_Menu_Data *pd); + + +int _elm_menu_efl_access_selection_selected_children_count_get(const Eo *obj, Elm_Menu_Data *pd); + + +Efl_Object *_elm_menu_efl_access_selection_selected_child_get(const Eo *obj, Elm_Menu_Data *pd, int selected_child_index); + + +Efl_Object *_elm_menu_efl_object_provider_find(const Eo *obj, Elm_Menu_Data *pd, const Efl_Class *klass); + + +static Eina_Bool +_elm_menu_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_MENU_EXTRA_OPS +#define ELM_MENU_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_menu_selected_item_get, _elm_menu_selected_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_menu_first_item_get, _elm_menu_first_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_menu_last_item_get, _elm_menu_last_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_menu_items_get, _elm_menu_items_get), + EFL_OBJECT_OP_FUNC(elm_obj_menu_relative_move, _elm_menu_relative_move), + EFL_OBJECT_OP_FUNC(elm_obj_menu_item_add, _elm_menu_item_add), + EFL_OBJECT_OP_FUNC(elm_obj_menu_open, _elm_menu_open), + EFL_OBJECT_OP_FUNC(elm_obj_menu_close, _elm_menu_close), + EFL_OBJECT_OP_FUNC(elm_obj_menu_item_separator_add, _elm_menu_item_separator_add), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_menu_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_menu_efl_object_destructor), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_visible_set, _elm_menu_efl_gfx_entity_visible_set), + EFL_OBJECT_OP_FUNC(efl_ui_widget_parent_set, _elm_menu_efl_ui_widget_widget_parent_set), + EFL_OBJECT_OP_FUNC(efl_ui_widget_parent_get, _elm_menu_efl_ui_widget_widget_parent_get), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_menu_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_l10n_translation_update, _elm_menu_efl_ui_l10n_translation_update), + EFL_OBJECT_OP_FUNC(efl_ui_widget_focus_manager_create, _elm_menu_efl_ui_widget_focus_manager_focus_manager_create), + EFL_OBJECT_OP_FUNC(efl_access_object_access_children_get, _elm_menu_efl_access_object_access_children_get), + EFL_OBJECT_OP_FUNC(efl_access_selection_selected_children_count_get, _elm_menu_efl_access_selection_selected_children_count_get), + EFL_OBJECT_OP_FUNC(efl_access_selection_selected_child_get, _elm_menu_efl_access_selection_selected_child_get), + EFL_OBJECT_OP_FUNC(efl_provider_find, _elm_menu_efl_object_provider_find), + ELM_MENU_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_menu_class_desc = { + EO_VERSION, + "Elm.Menu", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Menu_Data), + _elm_menu_class_initializer, + _elm_menu_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_menu_class_get, &_elm_menu_class_desc, EFL_UI_WIDGET_CLASS, EFL_UI_CLICKABLE_INTERFACE, EFL_ACCESS_SELECTION_INTERFACE, EFL_UI_WIDGET_FOCUS_MANAGER_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_menu_eo.legacy.c" diff --git a/src/lib/elementary/elm_menu_eo.h b/src/lib/elementary/elm_menu_eo.h new file mode 100644 index 0000000000..1c4a8111eb --- /dev/null +++ b/src/lib/elementary/elm_menu_eo.h @@ -0,0 +1,158 @@ +#ifndef _ELM_MENU_EO_H_ +#define _ELM_MENU_EO_H_ + +#ifndef _ELM_MENU_EO_CLASS_TYPE +#define _ELM_MENU_EO_CLASS_TYPE + +typedef Eo Elm_Menu; + +#endif + +#ifndef _ELM_MENU_EO_TYPES +#define _ELM_MENU_EO_TYPES + + +#endif +/** Elementary menu class + * + * @ingroup Elm_Menu + */ +#define ELM_MENU_CLASS elm_menu_class_get() + +EWAPI const Efl_Class *elm_menu_class_get(void); + +/** + * @brief Get the selected item in the widget. + * + * @param[in] obj The object. + * + * @return The selected item or @c null. + * + * @ingroup Elm_Menu + */ +EOAPI Elm_Widget_Item *elm_obj_menu_selected_item_get(const Eo *obj); + +/** + * @brief Get the first item in the widget. + * + * @param[in] obj The object. + * + * @return The first item or @c null. + * + * @ingroup Elm_Menu + */ +EOAPI Elm_Widget_Item *elm_obj_menu_first_item_get(const Eo *obj); + +/** + * @brief Get the last item in the widget. + * + * @param[in] obj The object. + * + * @return The last item or @c null. + * + * @ingroup Elm_Menu + */ +EOAPI Elm_Widget_Item *elm_obj_menu_last_item_get(const Eo *obj); + +/** + * @brief Returns a list of the widget item. + * + * @param[in] obj The object. + * + * @return const list to widget items + * + * @ingroup Elm_Menu + */ +EOAPI const Eina_List *elm_obj_menu_items_get(const Eo *obj); + +/** + * @brief Move the menu to a new position + * + * Sets the top-left position of the menu to ($x, @c y). + * + * @note @c x and @c y coordinates are relative to parent. + * + * @param[in] obj The object. + * @param[in] x The new X coordinate + * @param[in] y The new Y coordinate + * + * @ingroup Elm_Menu + */ +EOAPI void elm_obj_menu_relative_move(Eo *obj, int x, int y); + +/** + * @brief Add an item at the end of the given menu widget. + * + * @note This function does not accept relative icon path. + * + * @param[in] obj The object. + * @param[in] parent The parent menu item (optional). + * @param[in] icon An icon display on the item. The icon will be destroyed by + * the menu. + * @param[in] label The label of the item. + * @param[in] func Function called when the user select the item. + * @param[in] data Data sent by the callback. + * + * @return The new menu item. + * + * @ingroup Elm_Menu + */ +EOAPI Elm_Widget_Item *elm_obj_menu_item_add(Eo *obj, Elm_Widget_Item *parent, const char *icon, const char *label, Evas_Smart_Cb func, const void *data); + +/** + * @brief Open a closed menu + * + * Show the menu with no child sub-menus expanded.. + * @param[in] obj The object. + * + * @ingroup Elm_Menu + */ +EOAPI void elm_obj_menu_open(Eo *obj); + +/** + * @brief Close a opened menu + * + * Hides the menu and all it's sub-menus. + * @param[in] obj The object. + * + * @ingroup Elm_Menu + */ +EOAPI void elm_obj_menu_close(Eo *obj); + +/** + * @brief Add a separator item to menu @c obj under @c parent. + * + * @param[in] obj The object. + * @param[in] parent The item to add the separator under. + * + * @return The created item or @c null. + * + * @ingroup Elm_Menu + */ +EOAPI Elm_Widget_Item *elm_obj_menu_item_separator_add(Eo *obj, Elm_Widget_Item *parent); + +EWAPI extern const Efl_Event_Description _ELM_MENU_EVENT_DISMISSED; + +/** Called when menu widget was dismissed + * + * @ingroup Elm_Menu + */ +#define ELM_MENU_EVENT_DISMISSED (&(_ELM_MENU_EVENT_DISMISSED)) + +EWAPI extern const Efl_Event_Description _ELM_MENU_EVENT_ELM_ACTION_BLOCK_MENU; + +/** Called when menu blocking have been enabled + * + * @ingroup Elm_Menu + */ +#define ELM_MENU_EVENT_ELM_ACTION_BLOCK_MENU (&(_ELM_MENU_EVENT_ELM_ACTION_BLOCK_MENU)) + +EWAPI extern const Efl_Event_Description _ELM_MENU_EVENT_ELM_ACTION_UNBLOCK_MENU; + +/** Called when menu blocking has been disabled + * + * @ingroup Elm_Menu + */ +#define ELM_MENU_EVENT_ELM_ACTION_UNBLOCK_MENU (&(_ELM_MENU_EVENT_ELM_ACTION_UNBLOCK_MENU)) + +#endif diff --git a/src/lib/elementary/elm_menu_eo.legacy.c b/src/lib/elementary/elm_menu_eo.legacy.c new file mode 100644 index 0000000000..864be2de63 --- /dev/null +++ b/src/lib/elementary/elm_menu_eo.legacy.c @@ -0,0 +1,54 @@ + +EAPI Elm_Widget_Item * +elm_menu_selected_item_get(const Elm_Menu *obj) +{ + return elm_obj_menu_selected_item_get(obj); +} + +EAPI Elm_Widget_Item * +elm_menu_first_item_get(const Elm_Menu *obj) +{ + return elm_obj_menu_first_item_get(obj); +} + +EAPI Elm_Widget_Item * +elm_menu_last_item_get(const Elm_Menu *obj) +{ + return elm_obj_menu_last_item_get(obj); +} + +EAPI const Eina_List * +elm_menu_items_get(const Elm_Menu *obj) +{ + return elm_obj_menu_items_get(obj); +} + +EAPI void +elm_menu_move(Elm_Menu *obj, int x, int y) +{ + elm_obj_menu_relative_move(obj, x, y); +} + +EAPI Elm_Widget_Item * +elm_menu_item_add(Elm_Menu *obj, Elm_Widget_Item *parent, const char *icon, const char *label, Evas_Smart_Cb func, const void *data) +{ + return elm_obj_menu_item_add(obj, parent, icon, label, func, data); +} + +EAPI void +elm_menu_open(Elm_Menu *obj) +{ + elm_obj_menu_open(obj); +} + +EAPI void +elm_menu_close(Elm_Menu *obj) +{ + elm_obj_menu_close(obj); +} + +EAPI Elm_Widget_Item * +elm_menu_item_separator_add(Elm_Menu *obj, Elm_Widget_Item *parent) +{ + return elm_obj_menu_item_separator_add(obj, parent); +} diff --git a/src/lib/elementary/elm_menu_eo.legacy.h b/src/lib/elementary/elm_menu_eo.legacy.h new file mode 100644 index 0000000000..d54b4405c0 --- /dev/null +++ b/src/lib/elementary/elm_menu_eo.legacy.h @@ -0,0 +1,127 @@ +#ifndef _ELM_MENU_EO_LEGACY_H_ +#define _ELM_MENU_EO_LEGACY_H_ + +#ifndef _ELM_MENU_EO_CLASS_TYPE +#define _ELM_MENU_EO_CLASS_TYPE + +typedef Eo Elm_Menu; + +#endif + +#ifndef _ELM_MENU_EO_TYPES +#define _ELM_MENU_EO_TYPES + + +#endif + +/** + * @brief Get the selected item in the widget. + * + * @param[in] obj The object. + * + * @return The selected item or @c null. + * + * @ingroup Elm_Menu_Group + */ +EAPI Elm_Widget_Item *elm_menu_selected_item_get(const Elm_Menu *obj); + +/** + * @brief Get the first item in the widget. + * + * @param[in] obj The object. + * + * @return The first item or @c null. + * + * @ingroup Elm_Menu_Group + */ +EAPI Elm_Widget_Item *elm_menu_first_item_get(const Elm_Menu *obj); + +/** + * @brief Get the last item in the widget. + * + * @param[in] obj The object. + * + * @return The last item or @c null. + * + * @ingroup Elm_Menu_Group + */ +EAPI Elm_Widget_Item *elm_menu_last_item_get(const Elm_Menu *obj); + +/** + * @brief Returns a list of the widget item. + * + * @param[in] obj The object. + * + * @return const list to widget items + * + * @ingroup Elm_Menu_Group + */ +EAPI const Eina_List *elm_menu_items_get(const Elm_Menu *obj); + +/** + * @brief Move the menu to a new position + * + * Sets the top-left position of the menu to ($x, @c y). + * + * @note @c x and @c y coordinates are relative to parent. + * + * @param[in] obj The object. + * @param[in] x The new X coordinate + * @param[in] y The new Y coordinate + * + * @ingroup Elm_Menu_Group + */ +EAPI void elm_menu_move(Elm_Menu *obj, int x, int y); + +/** + * @brief Add an item at the end of the given menu widget. + * + * @note This function does not accept relative icon path. + * + * @param[in] obj The object. + * @param[in] parent The parent menu item (optional). + * @param[in] icon An icon display on the item. The icon will be destroyed by + * the menu. + * @param[in] label The label of the item. + * @param[in] func Function called when the user select the item. + * @param[in] data Data sent by the callback. + * + * @return The new menu item. + * + * @ingroup Elm_Menu_Group + */ +EAPI Elm_Widget_Item *elm_menu_item_add(Elm_Menu *obj, Elm_Widget_Item *parent, const char *icon, const char *label, Evas_Smart_Cb func, const void *data); + +/** + * @brief Open a closed menu + * + * Show the menu with no child sub-menus expanded.. + * @param[in] obj The object. + * + * @ingroup Elm_Menu_Group + */ +EAPI void elm_menu_open(Elm_Menu *obj); + +/** + * @brief Close a opened menu + * + * Hides the menu and all it's sub-menus. + * @param[in] obj The object. + * + * @ingroup Elm_Menu_Group + */ +EAPI void elm_menu_close(Elm_Menu *obj); + +/** + * @brief Add a separator item to menu @c obj under @c parent. + * + * @param[in] obj The object. + * @param[in] parent The item to add the separator under. + * + * @return The created item or @c null. + * + * @ingroup Elm_Menu_Group + */ +EAPI Elm_Widget_Item *elm_menu_item_separator_add(Elm_Menu *obj, Elm_Widget_Item *parent); + +#endif diff --git a/src/lib/elementary/elm_menu_item.eo b/src/lib/elementary/elm_menu_item.eo deleted file mode 100644 index 8bc14ed649..0000000000 --- a/src/lib/elementary/elm_menu_item.eo +++ /dev/null @@ -1,121 +0,0 @@ -class Elm.Menu.Item extends Elm.Widget.Item implements Efl.Access.Selection, Efl.Ui.Legacy -{ - [[Elementary menu item class]] - legacy_prefix: elm_menu_item; - eo_prefix: elm_obj_menu_item; - methods { - @property icon_name { - get { - [[Get the string representation from the icon of a menu item - - Once this icon is set, any previously set icon will be deleted. - To hide icon set it to "". - ]] - } - set { - [[Set the icon of a menu item to the standard icon with the - given name. - - Once this icon is set, any previously set icon will be deleted. - To hide icon set it to "". - ]] - } - values { - icon: string; [[The name of icon object.]] - } - } - @property prev { - get { - [[Get the item before this one in the widget's list of items. - - See also @.next. - ]] - } - values { - item: Elm.Widget.Item; [[The item before the object in its parent's - list. If there is no previous item or in case - of error, $null is returned.]] - } - } - @property next { - get { - [[Get the item after this one in the widget's list of items. - - See also @.prev. - ]] - } - values { - item: Elm.Widget.Item; [[The item after the object in its parent's - list. If there is no next item or in case - of error, $null is returned.]] - } - } - @property selected { - [[Indicates whether this item is currently selected.]] - get { - [[Get the selected state of this item.]] - } - set { - [[Set the selected state of $item. - - This sets the selected state of the given item $it. - $true for selected, $false for not selected. - - If a new item is selected the previously selected will - be unselected. Previously selected item can be retrieved - with @Elm.Menu.selected_item.get. - - Selected items will be highlighted. - ]] - } - values { - selected: bool; [[The selection state.]] - } - } - index_get @const { - [[Get the item index]] - return: uint; [[Item index]] - } - subitems_clear { - [[Remove all sub-items (children) of the given item - - This removes all items that are children (and their descendants) - of the given item $it. - - @since 1.8 - ]] - } - subitems_get @const { - [[Returns a list of $item's subitems.]] - return: const(list); [[A list of $item's subitems]] - } - is_separator @const { - [[Returns whether $item is a separator.]] - return: bool; [[$true if the item is a separator.]] - } - object_get @const { - [[Get the real Evas(Edje) object created to implement the view of - a given menu item. - - Warning: Don't manipulate this object! - ]] - return: Efl.Canvas.Object; [[The base Edje object containing the - swallowed content associated with the item.]] - } - } - implements { - Efl.Object.constructor; - Efl.Object.destructor; - Efl.Object.parent { get; } - Elm.Widget.Item.disable; - Elm.Widget.Item.signal_emit; - Elm.Widget.Item.part_text { get; set; } - Elm.Widget.Item.part_content { get; set; } - Efl.Access.Object.access_children { get; } - Efl.Access.Object.role { get; } - Efl.Access.Object.i18n_name { get; } - Efl.Access.Object.state_set { get; } - Efl.Access.Selection.selected_children_count { get; } - Efl.Access.Selection.selected_child { get; } - } -} diff --git a/src/lib/elementary/elm_menu_item_eo.c b/src/lib/elementary/elm_menu_item_eo.c new file mode 100644 index 0000000000..40d2fd8aed --- /dev/null +++ b/src/lib/elementary/elm_menu_item_eo.c @@ -0,0 +1,205 @@ + +void _elm_menu_item_icon_name_set(Eo *obj, Elm_Menu_Item_Data *pd, const char *icon); + + +static Eina_Error +__eolian_elm_menu_item_icon_name_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; const char *cval; + if (!eina_value_string_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_menu_item_icon_name_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_menu_item_icon_name_set, EFL_FUNC_CALL(icon), const char *icon); + +const char *_elm_menu_item_icon_name_get(const Eo *obj, Elm_Menu_Item_Data *pd); + + +static Eina_Value +__eolian_elm_menu_item_icon_name_get_reflect(Eo *obj) +{ + const char *val = elm_obj_menu_item_icon_name_get(obj); + return eina_value_string_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_menu_item_icon_name_get, const char *, NULL); + +Elm_Widget_Item *_elm_menu_item_prev_get(const Eo *obj, Elm_Menu_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_menu_item_prev_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_menu_item_next_get(const Eo *obj, Elm_Menu_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_menu_item_next_get, Elm_Widget_Item *, NULL); + +void _elm_menu_item_selected_set(Eo *obj, Elm_Menu_Item_Data *pd, Eina_Bool selected); + + +static Eina_Error +__eolian_elm_menu_item_selected_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_menu_item_selected_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_menu_item_selected_set, EFL_FUNC_CALL(selected), Eina_Bool selected); + +Eina_Bool _elm_menu_item_selected_get(const Eo *obj, Elm_Menu_Item_Data *pd); + + +static Eina_Value +__eolian_elm_menu_item_selected_get_reflect(Eo *obj) +{ + Eina_Bool val = elm_obj_menu_item_selected_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_menu_item_selected_get, Eina_Bool, 0); + +unsigned int _elm_menu_item_index_get(const Eo *obj, Elm_Menu_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_menu_item_index_get, unsigned int, 0); + +void _elm_menu_item_subitems_clear(Eo *obj, Elm_Menu_Item_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_menu_item_subitems_clear); + +const Eina_List *_elm_menu_item_subitems_get(const Eo *obj, Elm_Menu_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_menu_item_subitems_get, const Eina_List *, NULL); + +Eina_Bool _elm_menu_item_is_separator(const Eo *obj, Elm_Menu_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_menu_item_is_separator, Eina_Bool, 0); + +Efl_Canvas_Object *_elm_menu_item_object_get(const Eo *obj, Elm_Menu_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_menu_item_object_get, Efl_Canvas_Object *, NULL); + +Efl_Object *_elm_menu_item_efl_object_constructor(Eo *obj, Elm_Menu_Item_Data *pd); + + +void _elm_menu_item_efl_object_destructor(Eo *obj, Elm_Menu_Item_Data *pd); + + +Efl_Object *_elm_menu_item_efl_object_parent_get(const Eo *obj, Elm_Menu_Item_Data *pd); + + +void _elm_menu_item_elm_widget_item_disable(Eo *obj, Elm_Menu_Item_Data *pd); + + +void _elm_menu_item_elm_widget_item_signal_emit(Eo *obj, Elm_Menu_Item_Data *pd, const char *emission, const char *source); + + +void _elm_menu_item_elm_widget_item_part_text_set(Eo *obj, Elm_Menu_Item_Data *pd, const char *part, const char *label); + + +const char *_elm_menu_item_elm_widget_item_part_text_get(const Eo *obj, Elm_Menu_Item_Data *pd, const char *part); + + +void _elm_menu_item_elm_widget_item_part_content_set(Eo *obj, Elm_Menu_Item_Data *pd, const char *part, Efl_Canvas_Object *content); + + +Efl_Canvas_Object *_elm_menu_item_elm_widget_item_part_content_get(const Eo *obj, Elm_Menu_Item_Data *pd, const char *part); + + +Eina_List *_elm_menu_item_efl_access_object_access_children_get(const Eo *obj, Elm_Menu_Item_Data *pd); + + +Efl_Access_Role _elm_menu_item_efl_access_object_role_get(const Eo *obj, Elm_Menu_Item_Data *pd); + + +const char *_elm_menu_item_efl_access_object_i18n_name_get(const Eo *obj, Elm_Menu_Item_Data *pd); + + +Efl_Access_State_Set _elm_menu_item_efl_access_object_state_set_get(const Eo *obj, Elm_Menu_Item_Data *pd); + + +int _elm_menu_item_efl_access_selection_selected_children_count_get(const Eo *obj, Elm_Menu_Item_Data *pd); + + +Efl_Object *_elm_menu_item_efl_access_selection_selected_child_get(const Eo *obj, Elm_Menu_Item_Data *pd, int selected_child_index); + + +static Eina_Bool +_elm_menu_item_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_MENU_ITEM_EXTRA_OPS +#define ELM_MENU_ITEM_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_menu_item_icon_name_set, _elm_menu_item_icon_name_set), + EFL_OBJECT_OP_FUNC(elm_obj_menu_item_icon_name_get, _elm_menu_item_icon_name_get), + EFL_OBJECT_OP_FUNC(elm_obj_menu_item_prev_get, _elm_menu_item_prev_get), + EFL_OBJECT_OP_FUNC(elm_obj_menu_item_next_get, _elm_menu_item_next_get), + EFL_OBJECT_OP_FUNC(elm_obj_menu_item_selected_set, _elm_menu_item_selected_set), + EFL_OBJECT_OP_FUNC(elm_obj_menu_item_selected_get, _elm_menu_item_selected_get), + EFL_OBJECT_OP_FUNC(elm_obj_menu_item_index_get, _elm_menu_item_index_get), + EFL_OBJECT_OP_FUNC(elm_obj_menu_item_subitems_clear, _elm_menu_item_subitems_clear), + EFL_OBJECT_OP_FUNC(elm_obj_menu_item_subitems_get, _elm_menu_item_subitems_get), + EFL_OBJECT_OP_FUNC(elm_obj_menu_item_is_separator, _elm_menu_item_is_separator), + EFL_OBJECT_OP_FUNC(elm_obj_menu_item_object_get, _elm_menu_item_object_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_menu_item_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_menu_item_efl_object_destructor), + EFL_OBJECT_OP_FUNC(efl_parent_get, _elm_menu_item_efl_object_parent_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_disable, _elm_menu_item_elm_widget_item_disable), + EFL_OBJECT_OP_FUNC(elm_wdg_item_signal_emit, _elm_menu_item_elm_widget_item_signal_emit), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_set, _elm_menu_item_elm_widget_item_part_text_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_get, _elm_menu_item_elm_widget_item_part_text_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_content_set, _elm_menu_item_elm_widget_item_part_content_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_content_get, _elm_menu_item_elm_widget_item_part_content_get), + EFL_OBJECT_OP_FUNC(efl_access_object_access_children_get, _elm_menu_item_efl_access_object_access_children_get), + EFL_OBJECT_OP_FUNC(efl_access_object_role_get, _elm_menu_item_efl_access_object_role_get), + EFL_OBJECT_OP_FUNC(efl_access_object_i18n_name_get, _elm_menu_item_efl_access_object_i18n_name_get), + EFL_OBJECT_OP_FUNC(efl_access_object_state_set_get, _elm_menu_item_efl_access_object_state_set_get), + EFL_OBJECT_OP_FUNC(efl_access_selection_selected_children_count_get, _elm_menu_item_efl_access_selection_selected_children_count_get), + EFL_OBJECT_OP_FUNC(efl_access_selection_selected_child_get, _elm_menu_item_efl_access_selection_selected_child_get), + ELM_MENU_ITEM_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"icon_name", __eolian_elm_menu_item_icon_name_set_reflect, __eolian_elm_menu_item_icon_name_get_reflect}, + {"selected", __eolian_elm_menu_item_selected_set_reflect, __eolian_elm_menu_item_selected_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_menu_item_class_desc = { + EO_VERSION, + "Elm.Menu.Item", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Menu_Item_Data), + _elm_menu_item_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_menu_item_class_get, &_elm_menu_item_class_desc, ELM_WIDGET_ITEM_CLASS, EFL_ACCESS_SELECTION_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_menu_item_eo.legacy.c" diff --git a/src/lib/elementary/elm_menu_item_eo.h b/src/lib/elementary/elm_menu_item_eo.h new file mode 100644 index 0000000000..708e77ed6d --- /dev/null +++ b/src/lib/elementary/elm_menu_item_eo.h @@ -0,0 +1,175 @@ +#ifndef _ELM_MENU_ITEM_EO_H_ +#define _ELM_MENU_ITEM_EO_H_ + +#ifndef _ELM_MENU_ITEM_EO_CLASS_TYPE +#define _ELM_MENU_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Menu_Item; + +#endif + +#ifndef _ELM_MENU_ITEM_EO_TYPES +#define _ELM_MENU_ITEM_EO_TYPES + + +#endif +/** Elementary menu item class + * + * @ingroup Elm_Menu_Item + */ +#define ELM_MENU_ITEM_CLASS elm_menu_item_class_get() + +EWAPI const Efl_Class *elm_menu_item_class_get(void); + +/** + * @brief Set the icon of a menu item to the standard icon with the given name. + * + * Once this icon is set, any previously set icon will be deleted. To hide icon + * set it to "". + * + * @param[in] obj The object. + * @param[in] icon The name of icon object. + * + * @ingroup Elm_Menu_Item + */ +EOAPI void elm_obj_menu_item_icon_name_set(Eo *obj, const char *icon); + +/** + * @brief Get the string representation from the icon of a menu item + * + * Once this icon is set, any previously set icon will be deleted. To hide icon + * set it to "". + * + * @param[in] obj The object. + * + * @return The name of icon object. + * + * @ingroup Elm_Menu_Item + */ +EOAPI const char *elm_obj_menu_item_icon_name_get(const Eo *obj); + +/** + * @brief Get the item before this one in the widget's list of items. + * + * See also @ref elm_obj_menu_item_next_get. + * + * @param[in] obj The object. + * + * @return The item before the object in its parent's list. If there is no + * previous item or in case of error, @c null is returned. + * + * @ingroup Elm_Menu_Item + */ +EOAPI Elm_Widget_Item *elm_obj_menu_item_prev_get(const Eo *obj); + +/** + * @brief Get the item after this one in the widget's list of items. + * + * See also @ref elm_obj_menu_item_prev_get. + * + * @param[in] obj The object. + * + * @return The item after the object in its parent's list. If there is no next + * item or in case of error, @c null is returned. + * + * @ingroup Elm_Menu_Item + */ +EOAPI Elm_Widget_Item *elm_obj_menu_item_next_get(const Eo *obj); + +/** + * @brief Indicates whether this item is currently selected. + * + * Set the selected state of @c item. + * + * This sets the selected state of the given item @c it. @c true for selected, + * @c false for not selected. + * + * If a new item is selected the previously selected will be unselected. + * Previously selected item can be retrieved with + * @ref elm_obj_menu_selected_item_get. + * + * Selected items will be highlighted. + * + * @param[in] obj The object. + * @param[in] selected The selection state. + * + * @ingroup Elm_Menu_Item + */ +EOAPI void elm_obj_menu_item_selected_set(Eo *obj, Eina_Bool selected); + +/** + * @brief Indicates whether this item is currently selected. + * + * Get the selected state of this item. + * + * @param[in] obj The object. + * + * @return The selection state. + * + * @ingroup Elm_Menu_Item + */ +EOAPI Eina_Bool elm_obj_menu_item_selected_get(const Eo *obj); + +/** + * @brief Get the item index + * + * @param[in] obj The object. + * + * @return Item index + * + * @ingroup Elm_Menu_Item + */ +EOAPI unsigned int elm_obj_menu_item_index_get(const Eo *obj); + +/** + * @brief Remove all sub-items (children) of the given item + * + * This removes all items that are children (and their descendants) of the + * given item @c it. + * + * @param[in] obj The object. + * + * @since 1.8 + * + * @ingroup Elm_Menu_Item + */ +EOAPI void elm_obj_menu_item_subitems_clear(Eo *obj); + +/** + * @brief Returns a list of @c item's subitems. + * + * @param[in] obj The object. + * + * @return A list of @c item's subitems + * + * @ingroup Elm_Menu_Item + */ +EOAPI const Eina_List *elm_obj_menu_item_subitems_get(const Eo *obj); + +/** + * @brief Returns whether @c item is a separator. + * + * @param[in] obj The object. + * + * @return @c true if the item is a separator. + * + * @ingroup Elm_Menu_Item + */ +EOAPI Eina_Bool elm_obj_menu_item_is_separator(const Eo *obj); + +/** + * @brief Get the real Evas(Edje) object created to implement the view of a + * given menu item. + * + * @warning Don't manipulate this object! + * + * @param[in] obj The object. + * + * @return The base Edje object containing the swallowed content associated + * with the item. + * + * @ingroup Elm_Menu_Item + */ +EOAPI Efl_Canvas_Object *elm_obj_menu_item_object_get(const Eo *obj); + +#endif diff --git a/src/lib/elementary/elm_menu_item_eo.legacy.c b/src/lib/elementary/elm_menu_item_eo.legacy.c new file mode 100644 index 0000000000..fa2c452613 --- /dev/null +++ b/src/lib/elementary/elm_menu_item_eo.legacy.c @@ -0,0 +1,66 @@ + +EAPI void +elm_menu_item_icon_name_set(Elm_Menu_Item *obj, const char *icon) +{ + elm_obj_menu_item_icon_name_set(obj, icon); +} + +EAPI const char * +elm_menu_item_icon_name_get(const Elm_Menu_Item *obj) +{ + return elm_obj_menu_item_icon_name_get(obj); +} + +EAPI Elm_Widget_Item * +elm_menu_item_prev_get(const Elm_Menu_Item *obj) +{ + return elm_obj_menu_item_prev_get(obj); +} + +EAPI Elm_Widget_Item * +elm_menu_item_next_get(const Elm_Menu_Item *obj) +{ + return elm_obj_menu_item_next_get(obj); +} + +EAPI void +elm_menu_item_selected_set(Elm_Menu_Item *obj, Eina_Bool selected) +{ + elm_obj_menu_item_selected_set(obj, selected); +} + +EAPI Eina_Bool +elm_menu_item_selected_get(const Elm_Menu_Item *obj) +{ + return elm_obj_menu_item_selected_get(obj); +} + +EAPI unsigned int +elm_menu_item_index_get(const Elm_Menu_Item *obj) +{ + return elm_obj_menu_item_index_get(obj); +} + +EAPI void +elm_menu_item_subitems_clear(Elm_Menu_Item *obj) +{ + elm_obj_menu_item_subitems_clear(obj); +} + +EAPI const Eina_List * +elm_menu_item_subitems_get(const Elm_Menu_Item *obj) +{ + return elm_obj_menu_item_subitems_get(obj); +} + +EAPI Eina_Bool +elm_menu_item_is_separator(const Elm_Menu_Item *obj) +{ + return elm_obj_menu_item_is_separator(obj); +} + +EAPI Efl_Canvas_Object * +elm_menu_item_object_get(const Elm_Menu_Item *obj) +{ + return elm_obj_menu_item_object_get(obj); +} diff --git a/src/lib/elementary/elm_menu_item_eo.legacy.h b/src/lib/elementary/elm_menu_item_eo.legacy.h new file mode 100644 index 0000000000..d03284c2bf --- /dev/null +++ b/src/lib/elementary/elm_menu_item_eo.legacy.h @@ -0,0 +1,168 @@ +#ifndef _ELM_MENU_ITEM_EO_LEGACY_H_ +#define _ELM_MENU_ITEM_EO_LEGACY_H_ + +#ifndef _ELM_MENU_ITEM_EO_CLASS_TYPE +#define _ELM_MENU_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Menu_Item; + +#endif + +#ifndef _ELM_MENU_ITEM_EO_TYPES +#define _ELM_MENU_ITEM_EO_TYPES + + +#endif + +/** + * @brief Set the icon of a menu item to the standard icon with the given name. + * + * Once this icon is set, any previously set icon will be deleted. To hide icon + * set it to "". + * + * @param[in] obj The object. + * @param[in] icon The name of icon object. + * + * @ingroup Elm_Menu_Item_Group + */ +EAPI void elm_menu_item_icon_name_set(Elm_Menu_Item *obj, const char *icon); + +/** + * @brief Get the string representation from the icon of a menu item + * + * Once this icon is set, any previously set icon will be deleted. To hide icon + * set it to "". + * + * @param[in] obj The object. + * + * @return The name of icon object. + * + * @ingroup Elm_Menu_Item_Group + */ +EAPI const char *elm_menu_item_icon_name_get(const Elm_Menu_Item *obj); + +/** + * @brief Get the item before this one in the widget's list of items. + * + * See also @ref elm_menu_item_next_get. + * + * @param[in] obj The object. + * + * @return The item before the object in its parent's list. If there is no + * previous item or in case of error, @c null is returned. + * + * @ingroup Elm_Menu_Item_Group + */ +EAPI Elm_Widget_Item *elm_menu_item_prev_get(const Elm_Menu_Item *obj); + +/** + * @brief Get the item after this one in the widget's list of items. + * + * See also @ref elm_menu_item_prev_get. + * + * @param[in] obj The object. + * + * @return The item after the object in its parent's list. If there is no next + * item or in case of error, @c null is returned. + * + * @ingroup Elm_Menu_Item_Group + */ +EAPI Elm_Widget_Item *elm_menu_item_next_get(const Elm_Menu_Item *obj); + +/** + * @brief Indicates whether this item is currently selected. + * + * Set the selected state of @c item. + * + * This sets the selected state of the given item @c it. @c true for selected, + * @c false for not selected. + * + * If a new item is selected the previously selected will be unselected. + * Previously selected item can be retrieved with + * @ref elm_menu_selected_item_get. + * + * Selected items will be highlighted. + * + * @param[in] obj The object. + * @param[in] selected The selection state. + * + * @ingroup Elm_Menu_Item_Group + */ +EAPI void elm_menu_item_selected_set(Elm_Menu_Item *obj, Eina_Bool selected); + +/** + * @brief Indicates whether this item is currently selected. + * + * Get the selected state of this item. + * + * @param[in] obj The object. + * + * @return The selection state. + * + * @ingroup Elm_Menu_Item_Group + */ +EAPI Eina_Bool elm_menu_item_selected_get(const Elm_Menu_Item *obj); + +/** + * @brief Get the item index + * + * @param[in] obj The object. + * + * @return Item index + * + * @ingroup Elm_Menu_Item_Group + */ +EAPI unsigned int elm_menu_item_index_get(const Elm_Menu_Item *obj); + +/** + * @brief Remove all sub-items (children) of the given item + * + * This removes all items that are children (and their descendants) of the + * given item @c it. + * + * @param[in] obj The object. + * + * @since 1.8 + * + * @ingroup Elm_Menu_Item_Group + */ +EAPI void elm_menu_item_subitems_clear(Elm_Menu_Item *obj); + +/** + * @brief Returns a list of @c item's subitems. + * + * @param[in] obj The object. + * + * @return A list of @c item's subitems + * + * @ingroup Elm_Menu_Item_Group + */ +EAPI const Eina_List *elm_menu_item_subitems_get(const Elm_Menu_Item *obj); + +/** + * @brief Returns whether @c item is a separator. + * + * @param[in] obj The object. + * + * @return @c true if the item is a separator. + * + * @ingroup Elm_Menu_Item_Group + */ +EAPI Eina_Bool elm_menu_item_is_separator(const Elm_Menu_Item *obj); + +/** + * @brief Get the real Evas(Edje) object created to implement the view of a + * given menu item. + * + * @warning Don't manipulate this object! + * + * @param[in] obj The object. + * + * @return The base Edje object containing the swallowed content associated + * with the item. + * + * @ingroup Elm_Menu_Item_Group + */ +EAPI Efl_Canvas_Object *elm_menu_item_object_get(const Elm_Menu_Item *obj); + +#endif diff --git a/src/lib/elementary/elm_menu_legacy.h b/src/lib/elementary/elm_menu_legacy.h index 9c86efc722..6e6b8ef370 100644 --- a/src/lib/elementary/elm_menu_legacy.h +++ b/src/lib/elementary/elm_menu_legacy.h @@ -30,5 +30,5 @@ EAPI void elm_menu_parent_set(Evas_Object *obj, Evas_Obj */ EAPI Evas_Object *elm_menu_parent_get(const Evas_Object *obj); -#include "elm_menu_item.eo.legacy.h" -#include "elm_menu.eo.legacy.h" +#include "elm_menu_item_eo.legacy.h" +#include "elm_menu_eo.legacy.h" diff --git a/src/lib/elementary/elm_widget_menu.h b/src/lib/elementary/elm_widget_menu.h index 7a1f3ea9b4..dfcc538e90 100644 --- a/src/lib/elementary/elm_widget_menu.h +++ b/src/lib/elementary/elm_widget_menu.h @@ -3,8 +3,8 @@ #include "Elementary.h" -#include "elm_menu.eo.h" -#include "elm_menu_item.eo.h" +#include "elm_menu_eo.h" +#include "elm_menu_item_eo.h" #include "elm_hover_eo.h" /* DO NOT USE THIS HEADER UNLESS YOU ARE PREPARED FOR BREAKING OF YOUR diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build index e2d72b7830..0514bdc3c3 100644 --- a/src/lib/elementary/meson.build +++ b/src/lib/elementary/meson.build @@ -1,6 +1,5 @@ pub_legacy_eo_files = [ 'efl_ui_clock_legacy.eo', - 'elm_menu.eo', 'elm_notify.eo', 'elm_panel.eo', 'elm_player.eo', @@ -12,7 +11,6 @@ pub_legacy_eo_files = [ 'elm_sys_notify.eo', 'elm_sys_notify_dbus.eo', 'elm_systray.eo', - 'elm_menu_item.eo', 'elm_widget_item_static_focus.eo', 'elm_popup_item.eo', 'elm_ctxpopup_part.eo', @@ -771,6 +769,10 @@ elementary_pub_headers = [ 'elm_map_eo.legacy.h', 'elm_map_pan_eo.h', 'elm_map_pan_eo.legacy.h', + 'elm_menu_eo.h', + 'elm_menu_eo.legacy.h', + 'elm_menu_item_eo.h', + 'elm_menu_item_eo.legacy.h', ] elementary_header_src = [