diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am index e90b278a6b..1827d80f13 100644 --- a/src/Makefile_Elementary.am +++ b/src/Makefile_Elementary.am @@ -187,7 +187,6 @@ elm_private_eolian_files = \ elm_legacy_eolian_files = \ lib/elementary/efl_ui_clock_legacy.eo \ lib/elementary/elm_interface_fileselector.eo \ - lib/elementary/elm_ctxpopup.eo \ lib/elementary/elm_dayselector.eo \ lib/elementary/elm_entry.eo \ lib/elementary/elm_fileselector.eo \ @@ -218,7 +217,6 @@ elm_legacy_eolian_files = \ lib/elementary/elm_dayselector_item.eo \ lib/elementary/elm_flipselector_item.eo \ lib/elementary/elm_menu_item.eo \ - lib/elementary/elm_ctxpopup_item.eo \ lib/elementary/elm_index_item.eo \ lib/elementary/elm_widget_item_static_focus.eo \ lib/elementary/elm_genlist_item.eo \ @@ -340,6 +338,10 @@ lib/elementary/elm_color_item_eo.c \ lib/elementary/elm_colorselector_eo.legacy.c \ lib/elementary/elm_colorselector_eo.c \ lib/elementary/elm_conformant_eo.c \ +lib/elementary/elm_ctxpopup_eo.legacy.c \ +lib/elementary/elm_ctxpopup_eo.c \ +lib/elementary/elm_ctxpopup_item_eo.legacy.c \ +lib/elementary/elm_ctxpopup_item_eo.c \ lib/elementary/elm_hoversel_eo.c \ lib/elementary/elm_hoversel_item_eo.c \ lib/elementary/elm_hoversel_item_eo.legacy.c @@ -411,6 +413,10 @@ lib/elementary/elm_colorselector_eo.h \ lib/elementary/elm_colorselector_eo.legacy.h \ lib/elementary/elm_conformant_eo.h \ lib/elementary/elm_conformant_eo.legacy.h \ +lib/elementary/elm_ctxpopup_eo.h \ +lib/elementary/elm_ctxpopup_eo.legacy.h \ +lib/elementary/elm_ctxpopup_item_eo.h \ +lib/elementary/elm_ctxpopup_item_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/elc_ctxpopup.c b/src/lib/elementary/elc_ctxpopup.c index 3222c652c4..926c80e563 100644 --- a/src/lib/elementary/elc_ctxpopup.c +++ b/src/lib/elementary/elc_ctxpopup.c @@ -13,8 +13,8 @@ #include "elm_priv.h" #include "elm_widget_ctxpopup.h" -#include "elm_ctxpopup_item.eo.h" -#include "elm_ctxpopup.eo.h" +#include "elm_ctxpopup_item_eo.h" +#include "elm_ctxpopup_eo.h" #include "elm_ctxpopup_part.eo.h" #include "elm_part_helper.h" @@ -1560,5 +1560,5 @@ ELM_PART_OVERRIDE_CONTENT_UNSET(elm_ctxpopup, ELM_CTXPOPUP, Elm_Ctxpopup_Data) ELM_LAYOUT_SIZING_EVAL_OPS(elm_ctxpopup), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_ctxpopup) -#include "elm_ctxpopup_item.eo.c" -#include "elm_ctxpopup.eo.c" +#include "elm_ctxpopup_item_eo.c" +#include "elm_ctxpopup_eo.c" diff --git a/src/lib/elementary/elc_ctxpopup_legacy.h b/src/lib/elementary/elc_ctxpopup_legacy.h index cf3ad28371..d3181ed2cf 100644 --- a/src/lib/elementary/elc_ctxpopup_legacy.h +++ b/src/lib/elementary/elc_ctxpopup_legacy.h @@ -8,5 +8,5 @@ */ EAPI Evas_Object *elm_ctxpopup_add(Evas_Object *parent); -#include "elm_ctxpopup_item.eo.legacy.h" -#include "elm_ctxpopup.eo.legacy.h" +#include "elm_ctxpopup_item_eo.legacy.h" +#include "elm_ctxpopup_eo.legacy.h" diff --git a/src/lib/elementary/elm_ctxpopup.eo b/src/lib/elementary/elm_ctxpopup.eo deleted file mode 100644 index 8f5857494d..0000000000 --- a/src/lib/elementary/elm_ctxpopup.eo +++ /dev/null @@ -1,248 +0,0 @@ -enum Elm.Ctxpopup.Direction -{ - [[Direction in which to show the popup.]] - down, [[Ctxpopup show appear below clicked area.]] - right, [[Ctxpopup show appear to the right of the clicked area.]] - left, [[Ctxpopup show appear to the left of the clicked area.]] - up, [[Ctxpopup show appear above the clicked area.]] - unknown [[Ctxpopup does not determine it's direction yet.]] -} - -class Elm.Ctxpopup extends Efl.Ui.Layout_Base implements Efl.Ui.Focus.Layer, Efl.Access.Widget.Action, Efl.Ui.Legacy, Elm.Widget_Item_Container -{ - [[Elementary context popup class]] - legacy_prefix: elm_ctxpopup; - eo_prefix: elm_obj_ctxpopup; - event_prefix: elm_ctxpopup; - 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]] - } - } - - @property horizontal { - set { - [[Change the ctxpopup's orientation to horizontal or vertical.]] - } - get { - [[Get the value of current ctxpopup object's orientation. - - See also @.horizontal.set. - ]] - } - values { - horizontal: bool; [[$true for horizontal mode, $false for vertical.]] - } - } - @property auto_hide_disabled { - set { - [[Set ctxpopup auto hide mode triggered by ctxpopup policy. - - Use this function when user wants ctxpopup not to hide automatically. - By default, ctxpopup is dismissed whenever mouse clicked its background area, language is changed, - and its parent geometry is updated(changed). - Not to hide ctxpopup automatically, disable auto hide function by calling this API, - then ctxpopup won't be dismissed in those scenarios. - - Default value of disabled is $false. - - See also @.auto_hide_disabled.get. - - @since 1.9 - ]] - } - get { - [[Get ctxpopup auto hide mode triggered by ctxpopup policy. - - See also @.auto_hide_disabled.set for more information. - - @since 1.9 - ]] - } - values { - disabled: bool; [[Auto hide enable/disable.]] - } - } - @property hover_parent { - set { - [[Set the Ctxpopup's parent - - Set the parent object. - - Note: \@ref elm_ctxpopup_add will automatically call this function - with its $parent argument. - - See also \@ref elm_ctxpopup_add, - \@ref elm_hover_parent_set. - ]] - } - get { - [[Get the Ctxpopup's parent - - See also @.hover_parent.set for more information - ]] - } - values { - parent: Efl.Canvas.Object; [[The parent to use.]] - } - } - @property direction_priority { - set { - [[Set the direction priority of a ctxpopup. - - This functions gives a chance to user to set the priority of ctxpopup - showing direction. This doesn't guarantee the ctxpopup will appear in the - requested direction. - - See also @.Direction. - ]] - } - get { - [[Get the direction priority of a ctxpopup. - - See also @.direction_priority.set for more information. - ]] - } - values { - first: Elm.Ctxpopup.Direction; [[1st priority of direction]] - second: Elm.Ctxpopup.Direction; [[2nd priority of direction]] - third: Elm.Ctxpopup.Direction; [[3th priority of direction]] - fourth: Elm.Ctxpopup.Direction; [[4th priority of direction]] - } - } - @property direction { - get { - [[Get the current direction of a ctxpopup. - - Warning: Once the ctxpopup showed up, the direction would be determined - - ]] - return: Elm.Ctxpopup.Direction(Elm.Ctxpopup.Direction.unknown); [[Direction]] - } - } - dismiss { - [[Dismiss a ctxpopup object - - Use this function to simulate clicking outside of the ctxpopup to dismiss it. - In this way, the ctxpopup will be hidden and the "clicked" signal will be - emitted.]] - - } - clear { - [[Clear all items in the given ctxpopup object.]] - } - item_insert_before { - [[Insert a new item to a ctxpopup object before item $before. - - See also elm_object_content_set. - - @since 1.21 - ]] - return: Elm.Widget.Item; [[A handle to the item added or $null, on errors.]] - - params { - @in before: Elm.Widget.Item; [[The ctxpopup item to insert before.]] - @in label: string; [[The Label of the new item]] - @in icon: Efl.Canvas.Object @optional; [[Icon to be set on new item]] - @in func: Evas_Smart_Cb @optional; [[Convenience function called when item selected]] - @in data: const(void_ptr) @optional; [[Data passed to $func]] - } - } - item_insert_after { - [[Insert a new item to a ctxpopup object after item $after. - - See also elm_object_content_set. - - @since 1.21 - ]] - return: Elm.Widget.Item; [[A handle to the item added or $null, on errors.]] - - params { - @in after: Elm.Widget.Item; [[The ctxpopup item to insert after.]] - @in label: string; [[The Label of the new item]] - @in icon: Efl.Canvas.Object @optional; [[Icon to be set on new item]] - @in func: Evas_Smart_Cb @optional; [[Convenience function called when item selected]] - @in data: const(void_ptr) @optional; [[Data passed to $func]] - } - } - item_append { - [[Add a new item to a ctxpopup object. - - Warning:Ctxpopup can't hold both an item list and a content at the same - time. When an item is added, any previous content will be removed. - - See also \@ref elm_object_content_set. - ]] - return: Elm.Widget.Item; [[A handle to the item added or $null, on errors.]] - - params { - @in label: string; [[The Label of the new item]] - @in icon: Efl.Canvas.Object @optional; [[Icon to be set on new item]] - @in func: Evas_Smart_Cb @optional; [[Convenience function called when item selected]] - @in data: const(void_ptr) @optional; [[Data passed to $func]] - } - } - item_prepend { - [[Prepend a new item to a ctxpopup object. - - Warning: Ctxpopup can't hold both an item list and a content at the same - time. When an item is added, any previous content will be removed. - - See also \@ref elm_object_content_set. - - @since 1.11 - ]] - return: Elm.Widget.Item; [[A handle to the item added or $null, on errors.]] - - params { - @in label: string; [[The Label of the new item]] - @in icon: Efl.Canvas.Object @optional; [[Icon to be set on new item]] - @in func: Evas_Smart_Cb @optional; [[Convenience function called when item selected]] - @in data: const(void_ptr) @optional; [[Data passed to $func]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Ui.Widget.widget_parent { set; } - Efl.Ui.Widget.widget_sub_object_add; - Efl.Ui.L10n.translation_update; - Efl.Ui.Widget.theme_apply; - Efl.Ui.Widget.widget_input_event_handler; - Elm.Widget_Item_Container.focused_item { get; } - Efl.Access.Widget.Action.elm_actions { get; } - Efl.Access.Object.state_set { get; } - Efl.Part.part_get; - } - events { - dismissed: void; [[Called when context popup was dismissed]] - geometry,update: const(ptr(Eina.Rect)); [[Called when context popup geometry was updated]] - } -} diff --git a/src/lib/elementary/elm_ctxpopup_eo.c b/src/lib/elementary/elm_ctxpopup_eo.c new file mode 100644 index 0000000000..a3cd0e7105 --- /dev/null +++ b/src/lib/elementary/elm_ctxpopup_eo.c @@ -0,0 +1,229 @@ +EWAPI const Efl_Event_Description _ELM_CTXPOPUP_EVENT_DISMISSED = + EFL_EVENT_DESCRIPTION("dismissed"); +EWAPI const Efl_Event_Description _ELM_CTXPOPUP_EVENT_GEOMETRY_UPDATE = + EFL_EVENT_DESCRIPTION("geometry,update"); + +Elm_Widget_Item *_elm_ctxpopup_selected_item_get(const Eo *obj, Elm_Ctxpopup_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_ctxpopup_selected_item_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_ctxpopup_first_item_get(const Eo *obj, Elm_Ctxpopup_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_ctxpopup_first_item_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_ctxpopup_last_item_get(const Eo *obj, Elm_Ctxpopup_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_ctxpopup_last_item_get, Elm_Widget_Item *, NULL); + +const Eina_List *_elm_ctxpopup_items_get(const Eo *obj, Elm_Ctxpopup_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_ctxpopup_items_get, const Eina_List *, NULL); + +void _elm_ctxpopup_horizontal_set(Eo *obj, Elm_Ctxpopup_Data *pd, Eina_Bool horizontal); + + +static Eina_Error +__eolian_elm_ctxpopup_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_ctxpopup_horizontal_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_ctxpopup_horizontal_set, EFL_FUNC_CALL(horizontal), Eina_Bool horizontal); + +Eina_Bool _elm_ctxpopup_horizontal_get(const Eo *obj, Elm_Ctxpopup_Data *pd); + + +static Eina_Value +__eolian_elm_ctxpopup_horizontal_get_reflect(Eo *obj) +{ + Eina_Bool val = elm_obj_ctxpopup_horizontal_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_ctxpopup_horizontal_get, Eina_Bool, 0); + +void _elm_ctxpopup_auto_hide_disabled_set(Eo *obj, Elm_Ctxpopup_Data *pd, Eina_Bool disabled); + + +static Eina_Error +__eolian_elm_ctxpopup_auto_hide_disabled_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_ctxpopup_auto_hide_disabled_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_ctxpopup_auto_hide_disabled_set, EFL_FUNC_CALL(disabled), Eina_Bool disabled); + +Eina_Bool _elm_ctxpopup_auto_hide_disabled_get(const Eo *obj, Elm_Ctxpopup_Data *pd); + + +static Eina_Value +__eolian_elm_ctxpopup_auto_hide_disabled_get_reflect(Eo *obj) +{ + Eina_Bool val = elm_obj_ctxpopup_auto_hide_disabled_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_ctxpopup_auto_hide_disabled_get, Eina_Bool, 0); + +void _elm_ctxpopup_hover_parent_set(Eo *obj, Elm_Ctxpopup_Data *pd, Efl_Canvas_Object *parent); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_ctxpopup_hover_parent_set, EFL_FUNC_CALL(parent), Efl_Canvas_Object *parent); + +Efl_Canvas_Object *_elm_ctxpopup_hover_parent_get(const Eo *obj, Elm_Ctxpopup_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_ctxpopup_hover_parent_get, Efl_Canvas_Object *, NULL); + +void _elm_ctxpopup_direction_priority_set(Eo *obj, Elm_Ctxpopup_Data *pd, Elm_Ctxpopup_Direction first, Elm_Ctxpopup_Direction second, Elm_Ctxpopup_Direction third, Elm_Ctxpopup_Direction fourth); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_ctxpopup_direction_priority_set, EFL_FUNC_CALL(first, second, third, fourth), Elm_Ctxpopup_Direction first, Elm_Ctxpopup_Direction second, Elm_Ctxpopup_Direction third, Elm_Ctxpopup_Direction fourth); + +void _elm_ctxpopup_direction_priority_get(const Eo *obj, Elm_Ctxpopup_Data *pd, Elm_Ctxpopup_Direction *first, Elm_Ctxpopup_Direction *second, Elm_Ctxpopup_Direction *third, Elm_Ctxpopup_Direction *fourth); + +EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_ctxpopup_direction_priority_get, EFL_FUNC_CALL(first, second, third, fourth), Elm_Ctxpopup_Direction *first, Elm_Ctxpopup_Direction *second, Elm_Ctxpopup_Direction *third, Elm_Ctxpopup_Direction *fourth); + +Elm_Ctxpopup_Direction _elm_ctxpopup_direction_get(const Eo *obj, Elm_Ctxpopup_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_ctxpopup_direction_get, Elm_Ctxpopup_Direction, 4 /* Elm.Ctxpopup.Direction.unknown */); + +void _elm_ctxpopup_dismiss(Eo *obj, Elm_Ctxpopup_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_ctxpopup_dismiss); + +void _elm_ctxpopup_clear(Eo *obj, Elm_Ctxpopup_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_ctxpopup_clear); + +Elm_Widget_Item *_elm_ctxpopup_item_insert_before(Eo *obj, Elm_Ctxpopup_Data *pd, Elm_Widget_Item *before, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_ctxpopup_item_insert_before, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(before, label, icon, func, data), Elm_Widget_Item *before, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +Elm_Widget_Item *_elm_ctxpopup_item_insert_after(Eo *obj, Elm_Ctxpopup_Data *pd, Elm_Widget_Item *after, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_ctxpopup_item_insert_after, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(after, label, icon, func, data), Elm_Widget_Item *after, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +Elm_Widget_Item *_elm_ctxpopup_item_append(Eo *obj, Elm_Ctxpopup_Data *pd, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_ctxpopup_item_append, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(label, icon, func, data), const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +Elm_Widget_Item *_elm_ctxpopup_item_prepend(Eo *obj, Elm_Ctxpopup_Data *pd, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_ctxpopup_item_prepend, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(label, icon, func, data), const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +Efl_Object *_elm_ctxpopup_efl_object_constructor(Eo *obj, Elm_Ctxpopup_Data *pd); + + +void _elm_ctxpopup_efl_ui_widget_widget_parent_set(Eo *obj, Elm_Ctxpopup_Data *pd, Efl_Ui_Widget *parent); + + +Eina_Bool _elm_ctxpopup_efl_ui_widget_widget_sub_object_add(Eo *obj, Elm_Ctxpopup_Data *pd, Efl_Canvas_Object *sub_obj); + + +void _elm_ctxpopup_efl_ui_l10n_translation_update(Eo *obj, Elm_Ctxpopup_Data *pd); + + +Eina_Error _elm_ctxpopup_efl_ui_widget_theme_apply(Eo *obj, Elm_Ctxpopup_Data *pd); + + +Eina_Bool _elm_ctxpopup_efl_ui_widget_widget_input_event_handler(Eo *obj, Elm_Ctxpopup_Data *pd, const Efl_Event *eo_event, Efl_Canvas_Object *source); + + +Elm_Widget_Item *_elm_ctxpopup_elm_widget_item_container_focused_item_get(const Eo *obj, Elm_Ctxpopup_Data *pd); + + +const Efl_Access_Action_Data *_elm_ctxpopup_efl_access_widget_action_elm_actions_get(const Eo *obj, Elm_Ctxpopup_Data *pd); + + +Efl_Access_State_Set _elm_ctxpopup_efl_access_object_state_set_get(const Eo *obj, Elm_Ctxpopup_Data *pd); + + +Efl_Object *_elm_ctxpopup_efl_part_part_get(const Eo *obj, Elm_Ctxpopup_Data *pd, const char *name); + + +static Eina_Bool +_elm_ctxpopup_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_CTXPOPUP_EXTRA_OPS +#define ELM_CTXPOPUP_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_selected_item_get, _elm_ctxpopup_selected_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_first_item_get, _elm_ctxpopup_first_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_last_item_get, _elm_ctxpopup_last_item_get), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_items_get, _elm_ctxpopup_items_get), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_horizontal_set, _elm_ctxpopup_horizontal_set), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_horizontal_get, _elm_ctxpopup_horizontal_get), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_auto_hide_disabled_set, _elm_ctxpopup_auto_hide_disabled_set), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_auto_hide_disabled_get, _elm_ctxpopup_auto_hide_disabled_get), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_hover_parent_set, _elm_ctxpopup_hover_parent_set), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_hover_parent_get, _elm_ctxpopup_hover_parent_get), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_direction_priority_set, _elm_ctxpopup_direction_priority_set), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_direction_priority_get, _elm_ctxpopup_direction_priority_get), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_direction_get, _elm_ctxpopup_direction_get), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_dismiss, _elm_ctxpopup_dismiss), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_clear, _elm_ctxpopup_clear), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_item_insert_before, _elm_ctxpopup_item_insert_before), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_item_insert_after, _elm_ctxpopup_item_insert_after), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_item_append, _elm_ctxpopup_item_append), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_item_prepend, _elm_ctxpopup_item_prepend), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_ctxpopup_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_parent_set, _elm_ctxpopup_efl_ui_widget_widget_parent_set), + EFL_OBJECT_OP_FUNC(efl_ui_widget_sub_object_add, _elm_ctxpopup_efl_ui_widget_widget_sub_object_add), + EFL_OBJECT_OP_FUNC(efl_ui_l10n_translation_update, _elm_ctxpopup_efl_ui_l10n_translation_update), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_ctxpopup_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_widget_input_event_handler, _elm_ctxpopup_efl_ui_widget_widget_input_event_handler), + EFL_OBJECT_OP_FUNC(elm_widget_item_container_focused_item_get, _elm_ctxpopup_elm_widget_item_container_focused_item_get), + EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_ctxpopup_efl_access_widget_action_elm_actions_get), + EFL_OBJECT_OP_FUNC(efl_access_object_state_set_get, _elm_ctxpopup_efl_access_object_state_set_get), + EFL_OBJECT_OP_FUNC(efl_part_get, _elm_ctxpopup_efl_part_part_get), + ELM_CTXPOPUP_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"horizontal", __eolian_elm_ctxpopup_horizontal_set_reflect, __eolian_elm_ctxpopup_horizontal_get_reflect}, + {"auto_hide_disabled", __eolian_elm_ctxpopup_auto_hide_disabled_set_reflect, __eolian_elm_ctxpopup_auto_hide_disabled_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_ctxpopup_class_desc = { + EO_VERSION, + "Elm.Ctxpopup", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Ctxpopup_Data), + _elm_ctxpopup_class_initializer, + _elm_ctxpopup_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_ctxpopup_class_get, &_elm_ctxpopup_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_FOCUS_LAYER_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_LEGACY_INTERFACE, ELM_WIDGET_ITEM_CONTAINER_INTERFACE, NULL); + +#include "elm_ctxpopup_eo.legacy.c" diff --git a/src/lib/elementary/elm_ctxpopup_eo.h b/src/lib/elementary/elm_ctxpopup_eo.h new file mode 100644 index 0000000000..78e8ad0a11 --- /dev/null +++ b/src/lib/elementary/elm_ctxpopup_eo.h @@ -0,0 +1,340 @@ +#ifndef _ELM_CTXPOPUP_EO_H_ +#define _ELM_CTXPOPUP_EO_H_ + +#ifndef _ELM_CTXPOPUP_EO_CLASS_TYPE +#define _ELM_CTXPOPUP_EO_CLASS_TYPE + +typedef Eo Elm_Ctxpopup; + +#endif + +#ifndef _ELM_CTXPOPUP_EO_TYPES +#define _ELM_CTXPOPUP_EO_TYPES + +/** Direction in which to show the popup. + * + * @ingroup Elm_Ctxpopup + */ +typedef enum +{ + ELM_CTXPOPUP_DIRECTION_DOWN = 0, /**< Ctxpopup show appear below clicked area. + */ + ELM_CTXPOPUP_DIRECTION_RIGHT, /**< Ctxpopup show appear to the right of the + * clicked area. */ + ELM_CTXPOPUP_DIRECTION_LEFT, /**< Ctxpopup show appear to the left of the + * clicked area. */ + ELM_CTXPOPUP_DIRECTION_UP, /**< Ctxpopup show appear above the clicked area. + */ + ELM_CTXPOPUP_DIRECTION_UNKNOWN /**< Ctxpopup does not determine it's direction + * yet. */ +} Elm_Ctxpopup_Direction; + + +#endif +/** Elementary context popup class + * + * @ingroup Elm_Ctxpopup + */ +#define ELM_CTXPOPUP_CLASS elm_ctxpopup_class_get() + +EWAPI const Efl_Class *elm_ctxpopup_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_Ctxpopup + */ +EOAPI Elm_Widget_Item *elm_obj_ctxpopup_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_Ctxpopup + */ +EOAPI Elm_Widget_Item *elm_obj_ctxpopup_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_Ctxpopup + */ +EOAPI Elm_Widget_Item *elm_obj_ctxpopup_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_Ctxpopup + */ +EOAPI const Eina_List *elm_obj_ctxpopup_items_get(const Eo *obj); + +/** + * @brief Change the ctxpopup's orientation to horizontal or vertical. + * + * @param[in] obj The object. + * @param[in] horizontal @c true for horizontal mode, @c false for vertical. + * + * @ingroup Elm_Ctxpopup + */ +EOAPI void elm_obj_ctxpopup_horizontal_set(Eo *obj, Eina_Bool horizontal); + +/** + * @brief Get the value of current ctxpopup object's orientation. + * + * See also @ref elm_obj_ctxpopup_horizontal_set. + * + * @param[in] obj The object. + * + * @return @c true for horizontal mode, @c false for vertical. + * + * @ingroup Elm_Ctxpopup + */ +EOAPI Eina_Bool elm_obj_ctxpopup_horizontal_get(const Eo *obj); + +/** + * @brief Set ctxpopup auto hide mode triggered by ctxpopup policy. + * + * Use this function when user wants ctxpopup not to hide automatically. By + * default, ctxpopup is dismissed whenever mouse clicked its background area, + * language is changed, and its parent geometry is updated(changed). Not to + * hide ctxpopup automatically, disable auto hide function by calling this API, + * then ctxpopup won't be dismissed in those scenarios. + * + * Default value of disabled is @c false. + * + * See also @ref elm_obj_ctxpopup_auto_hide_disabled_get. + * + * @param[in] obj The object. + * @param[in] disabled Auto hide enable/disable. + * + * @since 1.9 + * + * @ingroup Elm_Ctxpopup + */ +EOAPI void elm_obj_ctxpopup_auto_hide_disabled_set(Eo *obj, Eina_Bool disabled); + +/** + * @brief Get ctxpopup auto hide mode triggered by ctxpopup policy. + * + * See also @ref elm_obj_ctxpopup_auto_hide_disabled_set for more information. + * + * @param[in] obj The object. + * + * @return Auto hide enable/disable. + * + * @since 1.9 + * + * @ingroup Elm_Ctxpopup + */ +EOAPI Eina_Bool elm_obj_ctxpopup_auto_hide_disabled_get(const Eo *obj); + +/** + * @brief Set the Ctxpopup's parent + * + * Set the parent object. + * + * @note @ref elm_ctxpopup_add will automatically call this function with its + * @c parent argument. + * + * See also @ref elm_ctxpopup_add, @ref elm_hover_parent_set. + * + * @param[in] obj The object. + * @param[in] parent The parent to use. + * + * @ingroup Elm_Ctxpopup + */ +EOAPI void elm_obj_ctxpopup_hover_parent_set(Eo *obj, Efl_Canvas_Object *parent); + +/** + * @brief Get the Ctxpopup's parent + * + * See also @ref elm_obj_ctxpopup_hover_parent_set for more information + * + * @param[in] obj The object. + * + * @return The parent to use. + * + * @ingroup Elm_Ctxpopup + */ +EOAPI Efl_Canvas_Object *elm_obj_ctxpopup_hover_parent_get(const Eo *obj); + +/** + * @brief Set the direction priority of a ctxpopup. + * + * This functions gives a chance to user to set the priority of ctxpopup + * showing direction. This doesn't guarantee the ctxpopup will appear in the + * requested direction. + * + * See also @ref Elm_Ctxpopup_Direction. + * + * @param[in] obj The object. + * @param[in] first 1st priority of direction + * @param[in] second 2nd priority of direction + * @param[in] third 3th priority of direction + * @param[in] fourth 4th priority of direction + * + * @ingroup Elm_Ctxpopup + */ +EOAPI void elm_obj_ctxpopup_direction_priority_set(Eo *obj, Elm_Ctxpopup_Direction first, Elm_Ctxpopup_Direction second, Elm_Ctxpopup_Direction third, Elm_Ctxpopup_Direction fourth); + +/** + * @brief Get the direction priority of a ctxpopup. + * + * See also @ref elm_obj_ctxpopup_direction_priority_set for more information. + * + * @param[in] obj The object. + * @param[out] first 1st priority of direction + * @param[out] second 2nd priority of direction + * @param[out] third 3th priority of direction + * @param[out] fourth 4th priority of direction + * + * @ingroup Elm_Ctxpopup + */ +EOAPI void elm_obj_ctxpopup_direction_priority_get(const Eo *obj, Elm_Ctxpopup_Direction *first, Elm_Ctxpopup_Direction *second, Elm_Ctxpopup_Direction *third, Elm_Ctxpopup_Direction *fourth); + +/** + * @brief Get the current direction of a ctxpopup. + * + * @warning Once the ctxpopup showed up, the direction would be determined + * + * @param[in] obj The object. + * + * @return Direction + * + * @ingroup Elm_Ctxpopup + */ +EOAPI Elm_Ctxpopup_Direction elm_obj_ctxpopup_direction_get(const Eo *obj); + +/** + * @brief Dismiss a ctxpopup object + * + * Use this function to simulate clicking outside of the ctxpopup to dismiss + * it. In this way, the ctxpopup will be hidden and the "clicked" signal will + * be emitted. + * @param[in] obj The object. + * + * @ingroup Elm_Ctxpopup + */ +EOAPI void elm_obj_ctxpopup_dismiss(Eo *obj); + +/** Clear all items in the given ctxpopup object. + * + * @ingroup Elm_Ctxpopup + */ +EOAPI void elm_obj_ctxpopup_clear(Eo *obj); + +/** + * @brief Insert a new item to a ctxpopup object before item @c before. + * + * See also elm_object_content_set. + * + * @param[in] obj The object. + * @param[in] before The ctxpopup item to insert before. + * @param[in] label The Label of the new item + * @param[in] icon Icon to be set on new item + * @param[in] func Convenience function called when item selected + * @param[in] data Data passed to @c func + * + * @return A handle to the item added or @c null, on errors. + * + * @since 1.21 + * + * @ingroup Elm_Ctxpopup + */ +EOAPI Elm_Widget_Item *elm_obj_ctxpopup_item_insert_before(Eo *obj, Elm_Widget_Item *before, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +/** + * @brief Insert a new item to a ctxpopup object after item @c after. + * + * See also elm_object_content_set. + * + * @param[in] obj The object. + * @param[in] after The ctxpopup item to insert after. + * @param[in] label The Label of the new item + * @param[in] icon Icon to be set on new item + * @param[in] func Convenience function called when item selected + * @param[in] data Data passed to @c func + * + * @return A handle to the item added or @c null, on errors. + * + * @since 1.21 + * + * @ingroup Elm_Ctxpopup + */ +EOAPI Elm_Widget_Item *elm_obj_ctxpopup_item_insert_after(Eo *obj, Elm_Widget_Item *after, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +/** + * @brief Add a new item to a ctxpopup object. + * + * Warning:Ctxpopup can't hold both an item list and a content at the same + * time. When an item is added, any previous content will be removed. + * + * See also @ref elm_object_content_set. + * + * @param[in] obj The object. + * @param[in] label The Label of the new item + * @param[in] icon Icon to be set on new item + * @param[in] func Convenience function called when item selected + * @param[in] data Data passed to @c func + * + * @return A handle to the item added or @c null, on errors. + * + * @ingroup Elm_Ctxpopup + */ +EOAPI Elm_Widget_Item *elm_obj_ctxpopup_item_append(Eo *obj, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +/** + * @brief Prepend a new item to a ctxpopup object. + * + * @warning Ctxpopup can't hold both an item list and a content at the same + * time. When an item is added, any previous content will be removed. + * + * See also @ref elm_object_content_set. + * + * @param[in] obj The object. + * @param[in] label The Label of the new item + * @param[in] icon Icon to be set on new item + * @param[in] func Convenience function called when item selected + * @param[in] data Data passed to @c func + * + * @return A handle to the item added or @c null, on errors. + * + * @since 1.11 + * + * @ingroup Elm_Ctxpopup + */ +EOAPI Elm_Widget_Item *elm_obj_ctxpopup_item_prepend(Eo *obj, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +EWAPI extern const Efl_Event_Description _ELM_CTXPOPUP_EVENT_DISMISSED; + +/** Called when context popup was dismissed + * + * @ingroup Elm_Ctxpopup + */ +#define ELM_CTXPOPUP_EVENT_DISMISSED (&(_ELM_CTXPOPUP_EVENT_DISMISSED)) + +EWAPI extern const Efl_Event_Description _ELM_CTXPOPUP_EVENT_GEOMETRY_UPDATE; + +/** Called when context popup geometry was updated + * @return const Eina_Rect * + * + * @ingroup Elm_Ctxpopup + */ +#define ELM_CTXPOPUP_EVENT_GEOMETRY_UPDATE (&(_ELM_CTXPOPUP_EVENT_GEOMETRY_UPDATE)) + +#endif diff --git a/src/lib/elementary/elm_ctxpopup_eo.legacy.c b/src/lib/elementary/elm_ctxpopup_eo.legacy.c new file mode 100644 index 0000000000..09d07738e2 --- /dev/null +++ b/src/lib/elementary/elm_ctxpopup_eo.legacy.c @@ -0,0 +1,114 @@ + +EAPI Elm_Widget_Item * +elm_ctxpopup_selected_item_get(const Elm_Ctxpopup *obj) +{ + return elm_obj_ctxpopup_selected_item_get(obj); +} + +EAPI Elm_Widget_Item * +elm_ctxpopup_first_item_get(const Elm_Ctxpopup *obj) +{ + return elm_obj_ctxpopup_first_item_get(obj); +} + +EAPI Elm_Widget_Item * +elm_ctxpopup_last_item_get(const Elm_Ctxpopup *obj) +{ + return elm_obj_ctxpopup_last_item_get(obj); +} + +EAPI const Eina_List * +elm_ctxpopup_items_get(const Elm_Ctxpopup *obj) +{ + return elm_obj_ctxpopup_items_get(obj); +} + +EAPI void +elm_ctxpopup_horizontal_set(Elm_Ctxpopup *obj, Eina_Bool horizontal) +{ + elm_obj_ctxpopup_horizontal_set(obj, horizontal); +} + +EAPI Eina_Bool +elm_ctxpopup_horizontal_get(const Elm_Ctxpopup *obj) +{ + return elm_obj_ctxpopup_horizontal_get(obj); +} + +EAPI void +elm_ctxpopup_auto_hide_disabled_set(Elm_Ctxpopup *obj, Eina_Bool disabled) +{ + elm_obj_ctxpopup_auto_hide_disabled_set(obj, disabled); +} + +EAPI Eina_Bool +elm_ctxpopup_auto_hide_disabled_get(const Elm_Ctxpopup *obj) +{ + return elm_obj_ctxpopup_auto_hide_disabled_get(obj); +} + +EAPI void +elm_ctxpopup_hover_parent_set(Elm_Ctxpopup *obj, Efl_Canvas_Object *parent) +{ + elm_obj_ctxpopup_hover_parent_set(obj, parent); +} + +EAPI Efl_Canvas_Object * +elm_ctxpopup_hover_parent_get(const Elm_Ctxpopup *obj) +{ + return elm_obj_ctxpopup_hover_parent_get(obj); +} + +EAPI void +elm_ctxpopup_direction_priority_set(Elm_Ctxpopup *obj, Elm_Ctxpopup_Direction first, Elm_Ctxpopup_Direction second, Elm_Ctxpopup_Direction third, Elm_Ctxpopup_Direction fourth) +{ + elm_obj_ctxpopup_direction_priority_set(obj, first, second, third, fourth); +} + +EAPI void +elm_ctxpopup_direction_priority_get(const Elm_Ctxpopup *obj, Elm_Ctxpopup_Direction *first, Elm_Ctxpopup_Direction *second, Elm_Ctxpopup_Direction *third, Elm_Ctxpopup_Direction *fourth) +{ + elm_obj_ctxpopup_direction_priority_get(obj, first, second, third, fourth); +} + +EAPI Elm_Ctxpopup_Direction +elm_ctxpopup_direction_get(const Elm_Ctxpopup *obj) +{ + return elm_obj_ctxpopup_direction_get(obj); +} + +EAPI void +elm_ctxpopup_dismiss(Elm_Ctxpopup *obj) +{ + elm_obj_ctxpopup_dismiss(obj); +} + +EAPI void +elm_ctxpopup_clear(Elm_Ctxpopup *obj) +{ + elm_obj_ctxpopup_clear(obj); +} + +EAPI Elm_Widget_Item * +elm_ctxpopup_item_insert_before(Elm_Ctxpopup *obj, Elm_Widget_Item *before, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data) +{ + return elm_obj_ctxpopup_item_insert_before(obj, before, label, icon, func, data); +} + +EAPI Elm_Widget_Item * +elm_ctxpopup_item_insert_after(Elm_Ctxpopup *obj, Elm_Widget_Item *after, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data) +{ + return elm_obj_ctxpopup_item_insert_after(obj, after, label, icon, func, data); +} + +EAPI Elm_Widget_Item * +elm_ctxpopup_item_append(Elm_Ctxpopup *obj, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data) +{ + return elm_obj_ctxpopup_item_append(obj, label, icon, func, data); +} + +EAPI Elm_Widget_Item * +elm_ctxpopup_item_prepend(Elm_Ctxpopup *obj, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data) +{ + return elm_obj_ctxpopup_item_prepend(obj, label, icon, func, data); +} diff --git a/src/lib/elementary/elm_ctxpopup_eo.legacy.h b/src/lib/elementary/elm_ctxpopup_eo.legacy.h new file mode 100644 index 0000000000..74422ac22e --- /dev/null +++ b/src/lib/elementary/elm_ctxpopup_eo.legacy.h @@ -0,0 +1,316 @@ +#ifndef _ELM_CTXPOPUP_EO_LEGACY_H_ +#define _ELM_CTXPOPUP_EO_LEGACY_H_ + +#ifndef _ELM_CTXPOPUP_EO_CLASS_TYPE +#define _ELM_CTXPOPUP_EO_CLASS_TYPE + +typedef Eo Elm_Ctxpopup; + +#endif + +#ifndef _ELM_CTXPOPUP_EO_TYPES +#define _ELM_CTXPOPUP_EO_TYPES + +/** Direction in which to show the popup. + * + * @ingroup Elm_Ctxpopup + */ +typedef enum +{ + ELM_CTXPOPUP_DIRECTION_DOWN = 0, /**< Ctxpopup show appear below clicked area. + */ + ELM_CTXPOPUP_DIRECTION_RIGHT, /**< Ctxpopup show appear to the right of the + * clicked area. */ + ELM_CTXPOPUP_DIRECTION_LEFT, /**< Ctxpopup show appear to the left of the + * clicked area. */ + ELM_CTXPOPUP_DIRECTION_UP, /**< Ctxpopup show appear above the clicked area. + */ + ELM_CTXPOPUP_DIRECTION_UNKNOWN /**< Ctxpopup does not determine it's direction + * yet. */ +} Elm_Ctxpopup_Direction; + + +#endif + +/** + * @brief Get the selected item in the widget. + * + * @param[in] obj The object. + * + * @return The selected item or @c null. + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI Elm_Widget_Item *elm_ctxpopup_selected_item_get(const Elm_Ctxpopup *obj); + +/** + * @brief Get the first item in the widget. + * + * @param[in] obj The object. + * + * @return The first item or @c null. + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI Elm_Widget_Item *elm_ctxpopup_first_item_get(const Elm_Ctxpopup *obj); + +/** + * @brief Get the last item in the widget. + * + * @param[in] obj The object. + * + * @return The last item or @c null. + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI Elm_Widget_Item *elm_ctxpopup_last_item_get(const Elm_Ctxpopup *obj); + +/** + * @brief Returns a list of the widget item. + * + * @param[in] obj The object. + * + * @return const list to widget items + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI const Eina_List *elm_ctxpopup_items_get(const Elm_Ctxpopup *obj); + +/** + * @brief Change the ctxpopup's orientation to horizontal or vertical. + * + * @param[in] obj The object. + * @param[in] horizontal @c true for horizontal mode, @c false for vertical. + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI void elm_ctxpopup_horizontal_set(Elm_Ctxpopup *obj, Eina_Bool horizontal); + +/** + * @brief Get the value of current ctxpopup object's orientation. + * + * See also @ref elm_ctxpopup_horizontal_set. + * + * @param[in] obj The object. + * + * @return @c true for horizontal mode, @c false for vertical. + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI Eina_Bool elm_ctxpopup_horizontal_get(const Elm_Ctxpopup *obj); + +/** + * @brief Set ctxpopup auto hide mode triggered by ctxpopup policy. + * + * Use this function when user wants ctxpopup not to hide automatically. By + * default, ctxpopup is dismissed whenever mouse clicked its background area, + * language is changed, and its parent geometry is updated(changed). Not to + * hide ctxpopup automatically, disable auto hide function by calling this API, + * then ctxpopup won't be dismissed in those scenarios. + * + * Default value of disabled is @c false. + * + * See also @ref elm_ctxpopup_auto_hide_disabled_get. + * + * @param[in] obj The object. + * @param[in] disabled Auto hide enable/disable. + * + * @since 1.9 + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI void elm_ctxpopup_auto_hide_disabled_set(Elm_Ctxpopup *obj, Eina_Bool disabled); + +/** + * @brief Get ctxpopup auto hide mode triggered by ctxpopup policy. + * + * See also @ref elm_ctxpopup_auto_hide_disabled_set for more information. + * + * @param[in] obj The object. + * + * @return Auto hide enable/disable. + * + * @since 1.9 + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI Eina_Bool elm_ctxpopup_auto_hide_disabled_get(const Elm_Ctxpopup *obj); + +/** + * @brief Set the Ctxpopup's parent + * + * Set the parent object. + * + * @note @ref elm_ctxpopup_add will automatically call this function with its + * @c parent argument. + * + * See also @ref elm_ctxpopup_add, @ref elm_hover_parent_set. + * + * @param[in] obj The object. + * @param[in] parent The parent to use. + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI void elm_ctxpopup_hover_parent_set(Elm_Ctxpopup *obj, Efl_Canvas_Object *parent); + +/** + * @brief Get the Ctxpopup's parent + * + * See also @ref elm_ctxpopup_hover_parent_set for more information + * + * @param[in] obj The object. + * + * @return The parent to use. + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI Efl_Canvas_Object *elm_ctxpopup_hover_parent_get(const Elm_Ctxpopup *obj); + +/** + * @brief Set the direction priority of a ctxpopup. + * + * This functions gives a chance to user to set the priority of ctxpopup + * showing direction. This doesn't guarantee the ctxpopup will appear in the + * requested direction. + * + * See also @ref Elm_Ctxpopup_Direction. + * + * @param[in] obj The object. + * @param[in] first 1st priority of direction + * @param[in] second 2nd priority of direction + * @param[in] third 3th priority of direction + * @param[in] fourth 4th priority of direction + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI void elm_ctxpopup_direction_priority_set(Elm_Ctxpopup *obj, Elm_Ctxpopup_Direction first, Elm_Ctxpopup_Direction second, Elm_Ctxpopup_Direction third, Elm_Ctxpopup_Direction fourth); + +/** + * @brief Get the direction priority of a ctxpopup. + * + * See also @ref elm_ctxpopup_direction_priority_set for more information. + * + * @param[in] obj The object. + * @param[out] first 1st priority of direction + * @param[out] second 2nd priority of direction + * @param[out] third 3th priority of direction + * @param[out] fourth 4th priority of direction + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI void elm_ctxpopup_direction_priority_get(const Elm_Ctxpopup *obj, Elm_Ctxpopup_Direction *first, Elm_Ctxpopup_Direction *second, Elm_Ctxpopup_Direction *third, Elm_Ctxpopup_Direction *fourth); + +/** + * @brief Get the current direction of a ctxpopup. + * + * @warning Once the ctxpopup showed up, the direction would be determined + * + * @param[in] obj The object. + * + * @return Direction + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI Elm_Ctxpopup_Direction elm_ctxpopup_direction_get(const Elm_Ctxpopup *obj); + +/** + * @brief Dismiss a ctxpopup object + * + * Use this function to simulate clicking outside of the ctxpopup to dismiss + * it. In this way, the ctxpopup will be hidden and the "clicked" signal will + * be emitted. + * @param[in] obj The object. + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI void elm_ctxpopup_dismiss(Elm_Ctxpopup *obj); + +/** Clear all items in the given ctxpopup object. + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI void elm_ctxpopup_clear(Elm_Ctxpopup *obj); + +/** + * @brief Insert a new item to a ctxpopup object before item @c before. + * + * See also elm_object_content_set. + * + * @param[in] obj The object. + * @param[in] before The ctxpopup item to insert before. + * @param[in] label The Label of the new item + * @param[in] icon Icon to be set on new item + * @param[in] func Convenience function called when item selected + * @param[in] data Data passed to @c func + * + * @return A handle to the item added or @c null, on errors. + * + * @since 1.21 + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI Elm_Widget_Item *elm_ctxpopup_item_insert_before(Elm_Ctxpopup *obj, Elm_Widget_Item *before, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +/** + * @brief Insert a new item to a ctxpopup object after item @c after. + * + * See also elm_object_content_set. + * + * @param[in] obj The object. + * @param[in] after The ctxpopup item to insert after. + * @param[in] label The Label of the new item + * @param[in] icon Icon to be set on new item + * @param[in] func Convenience function called when item selected + * @param[in] data Data passed to @c func + * + * @return A handle to the item added or @c null, on errors. + * + * @since 1.21 + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI Elm_Widget_Item *elm_ctxpopup_item_insert_after(Elm_Ctxpopup *obj, Elm_Widget_Item *after, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +/** + * @brief Add a new item to a ctxpopup object. + * + * Warning:Ctxpopup can't hold both an item list and a content at the same + * time. When an item is added, any previous content will be removed. + * + * See also @ref elm_object_content_set. + * + * @param[in] obj The object. + * @param[in] label The Label of the new item + * @param[in] icon Icon to be set on new item + * @param[in] func Convenience function called when item selected + * @param[in] data Data passed to @c func + * + * @return A handle to the item added or @c null, on errors. + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI Elm_Widget_Item *elm_ctxpopup_item_append(Elm_Ctxpopup *obj, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +/** + * @brief Prepend a new item to a ctxpopup object. + * + * @warning Ctxpopup can't hold both an item list and a content at the same + * time. When an item is added, any previous content will be removed. + * + * See also @ref elm_object_content_set. + * + * @param[in] obj The object. + * @param[in] label The Label of the new item + * @param[in] icon Icon to be set on new item + * @param[in] func Convenience function called when item selected + * @param[in] data Data passed to @c func + * + * @return A handle to the item added or @c null, on errors. + * + * @since 1.11 + * + * @ingroup Elm_Ctxpopup_Group + */ +EAPI Elm_Widget_Item *elm_ctxpopup_item_prepend(Elm_Ctxpopup *obj, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); + +#endif diff --git a/src/lib/elementary/elm_ctxpopup_item.eo b/src/lib/elementary/elm_ctxpopup_item.eo deleted file mode 100644 index c0be337d23..0000000000 --- a/src/lib/elementary/elm_ctxpopup_item.eo +++ /dev/null @@ -1,76 +0,0 @@ -class Elm.Ctxpopup.Item extends Elm.Widget.Item implements Efl.Access.Widget.Action, - Efl.Ui.Legacy -{ - [[Elementary context popup item class]] - legacy_prefix: elm_ctxpopup_item; - eo_prefix: elm_obj_ctxpopup_item; - methods { - @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.Ctxpopup.selected_item.get. - - Selected items will be highlighted. - ]] - } - values { - selected: bool; [[The selection state.]] - } - } - init { - [[Init context popup item]] - params { - func: Evas_Smart_Cb @nullable; [[Smart callback function]] - data: const(void_ptr) @optional; [[Data pointer]] - } - } - } - implements { - Efl.Object.constructor; - Efl.Object.destructor; - Elm.Widget.Item.disable; - Elm.Widget.Item.signal_emit; - Elm.Widget.Item.del_pre; - Elm.Widget.Item.part_text { get; set; } - Elm.Widget.Item.part_content { get; set; } - Elm.Widget.Item.part_content_unset; - Elm.Widget.Item.item_focus { get; set; } - Efl.Access.Widget.Action.elm_actions { get; } - } -} diff --git a/src/lib/elementary/elm_ctxpopup_item_eo.c b/src/lib/elementary/elm_ctxpopup_item_eo.c new file mode 100644 index 0000000000..02b8c16bbd --- /dev/null +++ b/src/lib/elementary/elm_ctxpopup_item_eo.c @@ -0,0 +1,142 @@ + +Elm_Widget_Item *_elm_ctxpopup_item_prev_get(const Eo *obj, Elm_Ctxpopup_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_ctxpopup_item_prev_get, Elm_Widget_Item *, NULL); + +Elm_Widget_Item *_elm_ctxpopup_item_next_get(const Eo *obj, Elm_Ctxpopup_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_ctxpopup_item_next_get, Elm_Widget_Item *, NULL); + +void _elm_ctxpopup_item_selected_set(Eo *obj, Elm_Ctxpopup_Item_Data *pd, Eina_Bool selected); + + +static Eina_Error +__eolian_elm_ctxpopup_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_ctxpopup_item_selected_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_ctxpopup_item_selected_set, EFL_FUNC_CALL(selected), Eina_Bool selected); + +Eina_Bool _elm_ctxpopup_item_selected_get(const Eo *obj, Elm_Ctxpopup_Item_Data *pd); + + +static Eina_Value +__eolian_elm_ctxpopup_item_selected_get_reflect(Eo *obj) +{ + Eina_Bool val = elm_obj_ctxpopup_item_selected_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_ctxpopup_item_selected_get, Eina_Bool, 0); + +void _elm_ctxpopup_item_init(Eo *obj, Elm_Ctxpopup_Item_Data *pd, Evas_Smart_Cb func, const void *data); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_ctxpopup_item_init, EFL_FUNC_CALL(func, data), Evas_Smart_Cb func, const void *data); + +Efl_Object *_elm_ctxpopup_item_efl_object_constructor(Eo *obj, Elm_Ctxpopup_Item_Data *pd); + + +void _elm_ctxpopup_item_efl_object_destructor(Eo *obj, Elm_Ctxpopup_Item_Data *pd); + + +void _elm_ctxpopup_item_elm_widget_item_disable(Eo *obj, Elm_Ctxpopup_Item_Data *pd); + + +void _elm_ctxpopup_item_elm_widget_item_signal_emit(Eo *obj, Elm_Ctxpopup_Item_Data *pd, const char *emission, const char *source); + + +void _elm_ctxpopup_item_elm_widget_item_del_pre(Eo *obj, Elm_Ctxpopup_Item_Data *pd); + + +void _elm_ctxpopup_item_elm_widget_item_part_text_set(Eo *obj, Elm_Ctxpopup_Item_Data *pd, const char *part, const char *label); + + +const char *_elm_ctxpopup_item_elm_widget_item_part_text_get(const Eo *obj, Elm_Ctxpopup_Item_Data *pd, const char *part); + + +void _elm_ctxpopup_item_elm_widget_item_part_content_set(Eo *obj, Elm_Ctxpopup_Item_Data *pd, const char *part, Efl_Canvas_Object *content); + + +Efl_Canvas_Object *_elm_ctxpopup_item_elm_widget_item_part_content_get(const Eo *obj, Elm_Ctxpopup_Item_Data *pd, const char *part); + + +Efl_Canvas_Object *_elm_ctxpopup_item_elm_widget_item_part_content_unset(Eo *obj, Elm_Ctxpopup_Item_Data *pd, const char *part); + + +void _elm_ctxpopup_item_elm_widget_item_item_focus_set(Eo *obj, Elm_Ctxpopup_Item_Data *pd, Eina_Bool focused); + + +Eina_Bool _elm_ctxpopup_item_elm_widget_item_item_focus_get(const Eo *obj, Elm_Ctxpopup_Item_Data *pd); + + +const Efl_Access_Action_Data *_elm_ctxpopup_item_efl_access_widget_action_elm_actions_get(const Eo *obj, Elm_Ctxpopup_Item_Data *pd); + + +static Eina_Bool +_elm_ctxpopup_item_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_CTXPOPUP_ITEM_EXTRA_OPS +#define ELM_CTXPOPUP_ITEM_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_item_prev_get, _elm_ctxpopup_item_prev_get), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_item_next_get, _elm_ctxpopup_item_next_get), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_item_selected_set, _elm_ctxpopup_item_selected_set), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_item_selected_get, _elm_ctxpopup_item_selected_get), + EFL_OBJECT_OP_FUNC(elm_obj_ctxpopup_item_init, _elm_ctxpopup_item_init), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_ctxpopup_item_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_ctxpopup_item_efl_object_destructor), + EFL_OBJECT_OP_FUNC(elm_wdg_item_disable, _elm_ctxpopup_item_elm_widget_item_disable), + EFL_OBJECT_OP_FUNC(elm_wdg_item_signal_emit, _elm_ctxpopup_item_elm_widget_item_signal_emit), + EFL_OBJECT_OP_FUNC(elm_wdg_item_del_pre, _elm_ctxpopup_item_elm_widget_item_del_pre), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_set, _elm_ctxpopup_item_elm_widget_item_part_text_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_text_get, _elm_ctxpopup_item_elm_widget_item_part_text_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_content_set, _elm_ctxpopup_item_elm_widget_item_part_content_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_content_get, _elm_ctxpopup_item_elm_widget_item_part_content_get), + EFL_OBJECT_OP_FUNC(elm_wdg_item_part_content_unset, _elm_ctxpopup_item_elm_widget_item_part_content_unset), + EFL_OBJECT_OP_FUNC(elm_wdg_item_focus_set, _elm_ctxpopup_item_elm_widget_item_item_focus_set), + EFL_OBJECT_OP_FUNC(elm_wdg_item_focus_get, _elm_ctxpopup_item_elm_widget_item_item_focus_get), + EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_ctxpopup_item_efl_access_widget_action_elm_actions_get), + ELM_CTXPOPUP_ITEM_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"selected", __eolian_elm_ctxpopup_item_selected_set_reflect, __eolian_elm_ctxpopup_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_ctxpopup_item_class_desc = { + EO_VERSION, + "Elm.Ctxpopup.Item", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Ctxpopup_Item_Data), + _elm_ctxpopup_item_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_ctxpopup_item_class_get, &_elm_ctxpopup_item_class_desc, ELM_WIDGET_ITEM_CLASS, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_ctxpopup_item_eo.legacy.c" diff --git a/src/lib/elementary/elm_ctxpopup_item_eo.h b/src/lib/elementary/elm_ctxpopup_item_eo.h new file mode 100644 index 0000000000..1e8d30d650 --- /dev/null +++ b/src/lib/elementary/elm_ctxpopup_item_eo.h @@ -0,0 +1,97 @@ +#ifndef _ELM_CTXPOPUP_ITEM_EO_H_ +#define _ELM_CTXPOPUP_ITEM_EO_H_ + +#ifndef _ELM_CTXPOPUP_ITEM_EO_CLASS_TYPE +#define _ELM_CTXPOPUP_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Ctxpopup_Item; + +#endif + +#ifndef _ELM_CTXPOPUP_ITEM_EO_TYPES +#define _ELM_CTXPOPUP_ITEM_EO_TYPES + + +#endif +/** Elementary context popup item class + * + * @ingroup Elm_Ctxpopup_Item + */ +#define ELM_CTXPOPUP_ITEM_CLASS elm_ctxpopup_item_class_get() + +EWAPI const Efl_Class *elm_ctxpopup_item_class_get(void); + +/** + * @brief Get the item before this one in the widget's list of items. + * + * See also @ref elm_obj_ctxpopup_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_Ctxpopup_Item + */ +EOAPI Elm_Widget_Item *elm_obj_ctxpopup_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_ctxpopup_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_Ctxpopup_Item + */ +EOAPI Elm_Widget_Item *elm_obj_ctxpopup_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_ctxpopup_selected_item_get. + * + * Selected items will be highlighted. + * + * @param[in] obj The object. + * @param[in] selected The selection state. + * + * @ingroup Elm_Ctxpopup_Item + */ +EOAPI void elm_obj_ctxpopup_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_Ctxpopup_Item + */ +EOAPI Eina_Bool elm_obj_ctxpopup_item_selected_get(const Eo *obj); + +/** + * @brief Init context popup item + * + * @param[in] obj The object. + * @param[in] func Smart callback function + * @param[in] data Data pointer + * + * @ingroup Elm_Ctxpopup_Item + */ +EOAPI void elm_obj_ctxpopup_item_init(Eo *obj, Evas_Smart_Cb func, const void *data); + +#endif diff --git a/src/lib/elementary/elm_ctxpopup_item_eo.legacy.c b/src/lib/elementary/elm_ctxpopup_item_eo.legacy.c new file mode 100644 index 0000000000..a4b13aa3b7 --- /dev/null +++ b/src/lib/elementary/elm_ctxpopup_item_eo.legacy.c @@ -0,0 +1,30 @@ + +EAPI Elm_Widget_Item * +elm_ctxpopup_item_prev_get(const Elm_Ctxpopup_Item *obj) +{ + return elm_obj_ctxpopup_item_prev_get(obj); +} + +EAPI Elm_Widget_Item * +elm_ctxpopup_item_next_get(const Elm_Ctxpopup_Item *obj) +{ + return elm_obj_ctxpopup_item_next_get(obj); +} + +EAPI void +elm_ctxpopup_item_selected_set(Elm_Ctxpopup_Item *obj, Eina_Bool selected) +{ + elm_obj_ctxpopup_item_selected_set(obj, selected); +} + +EAPI Eina_Bool +elm_ctxpopup_item_selected_get(const Elm_Ctxpopup_Item *obj) +{ + return elm_obj_ctxpopup_item_selected_get(obj); +} + +EAPI void +elm_ctxpopup_item_init(Elm_Ctxpopup_Item *obj, Evas_Smart_Cb func, const void *data) +{ + elm_obj_ctxpopup_item_init(obj, func, data); +} diff --git a/src/lib/elementary/elm_ctxpopup_item_eo.legacy.h b/src/lib/elementary/elm_ctxpopup_item_eo.legacy.h new file mode 100644 index 0000000000..76bf43c702 --- /dev/null +++ b/src/lib/elementary/elm_ctxpopup_item_eo.legacy.h @@ -0,0 +1,90 @@ +#ifndef _ELM_CTXPOPUP_ITEM_EO_LEGACY_H_ +#define _ELM_CTXPOPUP_ITEM_EO_LEGACY_H_ + +#ifndef _ELM_CTXPOPUP_ITEM_EO_CLASS_TYPE +#define _ELM_CTXPOPUP_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Ctxpopup_Item; + +#endif + +#ifndef _ELM_CTXPOPUP_ITEM_EO_TYPES +#define _ELM_CTXPOPUP_ITEM_EO_TYPES + + +#endif + +/** + * @brief Get the item before this one in the widget's list of items. + * + * See also @ref elm_ctxpopup_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_Ctxpopup_Item_Group + */ +EAPI Elm_Widget_Item *elm_ctxpopup_item_prev_get(const Elm_Ctxpopup_Item *obj); + +/** + * @brief Get the item after this one in the widget's list of items. + * + * See also @ref elm_ctxpopup_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_Ctxpopup_Item_Group + */ +EAPI Elm_Widget_Item *elm_ctxpopup_item_next_get(const Elm_Ctxpopup_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_ctxpopup_selected_item_get. + * + * Selected items will be highlighted. + * + * @param[in] obj The object. + * @param[in] selected The selection state. + * + * @ingroup Elm_Ctxpopup_Item_Group + */ +EAPI void elm_ctxpopup_item_selected_set(Elm_Ctxpopup_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_Ctxpopup_Item_Group + */ +EAPI Eina_Bool elm_ctxpopup_item_selected_get(const Elm_Ctxpopup_Item *obj); + +/** + * @brief Init context popup item + * + * @param[in] obj The object. + * @param[in] func Smart callback function + * @param[in] data Data pointer + * + * @ingroup Elm_Ctxpopup_Item_Group + */ +EAPI void elm_ctxpopup_item_init(Elm_Ctxpopup_Item *obj, Evas_Smart_Cb func, const void *data); + +#endif diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build index 3003901e4a..6aadb2cf94 100644 --- a/src/lib/elementary/meson.build +++ b/src/lib/elementary/meson.build @@ -1,7 +1,6 @@ pub_legacy_eo_files = [ 'efl_ui_clock_legacy.eo', 'elm_interface_fileselector.eo', - 'elm_ctxpopup.eo', 'elm_dayselector.eo', 'elm_entry.eo', 'elm_fileselector.eo', @@ -32,7 +31,6 @@ pub_legacy_eo_files = [ 'elm_dayselector_item.eo', 'elm_flipselector_item.eo', 'elm_menu_item.eo', - 'elm_ctxpopup_item.eo', 'elm_index_item.eo', 'elm_widget_item_static_focus.eo', 'elm_genlist_item.eo', @@ -734,6 +732,10 @@ elementary_pub_headers = [ 'elm_colorselector_eo.legacy.h', 'elm_conformant_eo.h', 'elm_conformant_eo.legacy.h', + 'elm_ctxpopup_eo.h', + 'elm_ctxpopup_eo.legacy.h', + 'elm_ctxpopup_item_eo.h', + 'elm_ctxpopup_item_eo.legacy.h', 'elm_hoversel_eo.h', 'elm_hoversel_eo.legacy.h', 'elm_hoversel_item_eo.h', diff --git a/src/modules/elementary/clock_input_ctxpopup/clock_input_ctxpopup.c b/src/modules/elementary/clock_input_ctxpopup/clock_input_ctxpopup.c index 73b73e87e2..5daabebe0a 100644 --- a/src/modules/elementary/clock_input_ctxpopup/clock_input_ctxpopup.c +++ b/src/modules/elementary/clock_input_ctxpopup/clock_input_ctxpopup.c @@ -6,8 +6,8 @@ #include "elm_module_helper.h" #include "elm_widget.h" #include "efl_ui_clock_private.h" -#include "elm_ctxpopup_item.eo.h" -#include "elm_ctxpopup.eo.h" +#include "elm_ctxpopup_item_eo.h" +#include "elm_ctxpopup_eo.h" #define ELEMENTARY_BUILD #undef ELM_MODULE_HELPER_H