From 64923b8db15fdaa25583824123e56f3c1083ac45 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Tue, 14 May 2019 15:50:15 -0400 Subject: [PATCH] efl_ui: move clickable from efl to efl_ui Summary: efl_ui_clickable is now a mixin. The mixin now brings two APIs the press and unpress API can be used to tell the implementation the state of the presses. Within the implementation the calls to press / unpress are then converted to longpress / clicked events. Reviewers: zmike, segfaultxavi, cedric Reviewed By: zmike Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8820 --- src/Makefile_Efl.am | 1 - src/Makefile_Elementary.am | 4 + src/lib/efl/Efl.h | 1 - src/lib/efl/interfaces/efl_interfaces_main.c | 1 - src/lib/efl/interfaces/efl_ui_clickable.eo | 18 --- src/lib/efl/interfaces/meson.build | 1 - src/lib/elementary/Efl_Ui.h | 2 + src/lib/elementary/Elementary.h | 1 + src/lib/elementary/efl_ui_clickable.c | 120 ++++++++++++++++++ src/lib/elementary/efl_ui_clickable.eo | 47 +++++++ src/lib/elementary/efl_ui_clickable_util.c | 99 +++++++++++++++ src/lib/elementary/efl_ui_clickable_util.eo | 24 ++++ src/lib/elementary/efl_ui_image_zoomable.c | 7 +- src/lib/elementary/elm_bubble_eo.c | 2 +- src/lib/elementary/elm_colorselector_eo.c | 2 +- src/lib/elementary/elm_diskselector_eo.c | 2 +- src/lib/elementary/elm_entry_eo.c | 2 +- .../elementary/elm_fileselector_entry_eo.c | 2 +- src/lib/elementary/elm_fileselector_eo.c | 2 +- src/lib/elementary/elm_gengrid_eo.c | 2 +- src/lib/elementary/elm_genlist_eo.c | 2 +- src/lib/elementary/elm_hover_eo.c | 2 +- src/lib/elementary/elm_hoversel_eo.c | 2 +- src/lib/elementary/elm_index_eo.c | 2 +- src/lib/elementary/elm_list_eo.c | 2 +- src/lib/elementary/elm_map_eo.c | 2 +- src/lib/elementary/elm_menu_eo.c | 2 +- src/lib/elementary/elm_multibuttonentry_eo.c | 2 +- src/lib/elementary/elm_photo_eo.c | 2 +- src/lib/elementary/elm_plug_eo.c | 2 +- src/lib/elementary/elm_thumb_eo.c | 2 +- src/lib/elementary/elm_toolbar_eo.c | 2 +- src/lib/elementary/meson.build | 6 +- 33 files changed, 327 insertions(+), 43 deletions(-) delete mode 100644 src/lib/efl/interfaces/efl_ui_clickable.eo create mode 100644 src/lib/elementary/efl_ui_clickable.c create mode 100644 src/lib/elementary/efl_ui_clickable.eo create mode 100644 src/lib/elementary/efl_ui_clickable_util.c create mode 100644 src/lib/elementary/efl_ui_clickable_util.eo diff --git a/src/Makefile_Efl.am b/src/Makefile_Efl.am index e9323a3195..f62bced764 100644 --- a/src/Makefile_Efl.am +++ b/src/Makefile_Efl.am @@ -7,7 +7,6 @@ efl_eolian_legacy_files = \ lib/efl/interfaces/efl_gfx_frame_controller.eo \ lib/efl/interfaces/efl_input_device.eo \ lib/efl/interfaces/efl_ui_draggable.eo \ - lib/efl/interfaces/efl_ui_clickable.eo \ lib/efl/interfaces/efl_ui_scrollable.eo \ lib/efl/interfaces/efl_ui_scrollable_interactive.eo \ lib/efl/interfaces/efl_ui_scrollbar.eo \ diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am index 9baaecc0ef..a67a8d9e7e 100644 --- a/src/Makefile_Elementary.am +++ b/src/Makefile_Elementary.am @@ -132,6 +132,8 @@ elm_public_eolian_files = \ lib/elementary/efl_ui_caching_factory.eo \ lib/elementary/efl_ui_widget_factory.eo \ lib/elementary/efl_ui_relative_layout.eo \ + lib/elementary/efl_ui_clickable.eo \ + lib/elementary/efl_ui_clickable_util.eo \ $(NULL) # More public files -- FIXME @@ -1211,6 +1213,8 @@ lib_elementary_libelementary_la_SOURCES = \ lib/elementary/efl_ui_exact_model.c \ lib/elementary/efl_ui_average_model.c \ lib/elementary/efl_ui_relative_layout.c \ + lib/elementary/efl_ui_clickable.c \ + lib/elementary/efl_ui_clickable_util.c \ $(NULL) diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h index 9a21ee8bc3..c0651a861a 100644 --- a/src/lib/efl/Efl.h +++ b/src/lib/efl/Efl.h @@ -104,7 +104,6 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command; #include "interfaces/efl_ui_range_interactive.eo.h" #include "interfaces/efl_ui_autorepeat.eo.h" #include "interfaces/efl_ui_draggable.eo.h" -#include "interfaces/efl_ui_clickable.eo.h" #include "interfaces/efl_ui_scrollable.eo.h" #include "interfaces/efl_ui_scrollbar.eo.h" #include "interfaces/efl_ui_scrollable_interactive.eo.h" diff --git a/src/lib/efl/interfaces/efl_interfaces_main.c b/src/lib/efl/interfaces/efl_interfaces_main.c index b3bbf4fa9b..4d7927f6f8 100644 --- a/src/lib/efl/interfaces/efl_interfaces_main.c +++ b/src/lib/efl/interfaces/efl_interfaces_main.c @@ -72,7 +72,6 @@ #include "interfaces/efl_ui_factory_bind.eo.c" #include "interfaces/efl_ui_draggable.eo.c" -#include "interfaces/efl_ui_clickable.eo.c" #include "interfaces/efl_ui_scrollable.eo.c" #include "interfaces/efl_ui_scrollable_interactive.eo.c" #include "interfaces/efl_ui_scrollbar.eo.c" diff --git a/src/lib/efl/interfaces/efl_ui_clickable.eo b/src/lib/efl/interfaces/efl_ui_clickable.eo deleted file mode 100644 index 97806e7501..0000000000 --- a/src/lib/efl/interfaces/efl_ui_clickable.eo +++ /dev/null @@ -1,18 +0,0 @@ -interface @beta Efl.Ui.Clickable -{ - [[Efl UI clickable interface]] - event_prefix: efl_ui; - events { - /* FIXME: Explain what are the objects passed through the event_infos */ - clicked: void; [[Called when object is clicked]] - clicked,double: void; [[Called when object receives a double click]] - clicked,triple: void; [[Called when object receives a triple click]] - clicked,right: Efl.Object; [[Called when object receives a right click]] - /* FIXME: Might be NULL */ - pressed: Efl.Object; [[Called when the object is pressed]] - /* FIXME: Might be NULL */ - unpressed: Efl.Object; [[Called when the object is no longer pressed]] - /* FIXME: Might be NULL */ - longpressed: Efl.Object; [[Called when the object receives a long press]] - } -} diff --git a/src/lib/efl/interfaces/meson.build b/src/lib/efl/interfaces/meson.build index 3efefbf4f9..d29af1cd6d 100644 --- a/src/lib/efl/interfaces/meson.build +++ b/src/lib/efl/interfaces/meson.build @@ -8,7 +8,6 @@ pub_legacy_eo_files = [ 'efl_gfx_frame_controller.eo', 'efl_input_device.eo', 'efl_ui_draggable.eo', - 'efl_ui_clickable.eo', 'efl_ui_scrollable.eo', 'efl_ui_scrollable_interactive.eo', 'efl_ui_scrollbar.eo', diff --git a/src/lib/elementary/Efl_Ui.h b/src/lib/elementary/Efl_Ui.h index 246ebf8456..34f0549f4d 100644 --- a/src/lib/elementary/Efl_Ui.h +++ b/src/lib/elementary/Efl_Ui.h @@ -235,6 +235,8 @@ EAPI void efl_ui_focus_relation_free(Efl_Ui_Focus_Relations *rel); # include # include # include +# include +# include /** * Initialize Elementary diff --git a/src/lib/elementary/Elementary.h b/src/lib/elementary/Elementary.h index b7e0bd678e..4fa8c3e468 100644 --- a/src/lib/elementary/Elementary.h +++ b/src/lib/elementary/Elementary.h @@ -171,6 +171,7 @@ typedef Eo Efl_Ui_Focus_Manager; #ifdef EFL_BETA_API_SUPPORT # include # include +#include #endif #include diff --git a/src/lib/elementary/efl_ui_clickable.c b/src/lib/elementary/efl_ui_clickable.c new file mode 100644 index 0000000000..ced9609e35 --- /dev/null +++ b/src/lib/elementary/efl_ui_clickable.c @@ -0,0 +1,120 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#define EFL_UI_CLICKABLE_PROTECTED 1 + +#include +#include "elm_priv.h" + +typedef struct { + Eina_Bool pressed; + int pressed_before; + Efl_Loop_Timer *timer; + double clicked_last_time; +} Button_State; + +typedef struct { + Button_State state[3]; +} Efl_Ui_Clickable_Data; + +#define MY_CLASS EFL_UI_CLICKABLE_MIXIN + +#define DOUBLE_CLICK_TIME ((double)0.1) //in seconds +#define LONGPRESS_TIMEOUT ((double)1.0) //in seconds + +static void +_timer_longpress(void *data, const Efl_Event *ev) +{ + Button_State *state; + Efl_Ui_Clickable_Data *pd = efl_data_scope_get(data, MY_CLASS); + + for (int i = 0; i < 3; ++i) + { + state = &pd->state[i]; + if (state->timer == ev->object) + { + efl_del(state->timer); + state->timer = NULL; + efl_event_callback_call(data, EFL_UI_EVENT_LONGPRESSED, &i); + } + } +} + +EOLIAN static void +_efl_ui_clickable_press(Eo *obj EINA_UNUSED, Efl_Ui_Clickable_Data *pd, unsigned int button) +{ + Button_State *state; + EINA_SAFETY_ON_FALSE_RETURN(button < 3); + + INF("Widget %s,%p is pressed(%d)", efl_class_name_get(obj), obj, button); + + state = &pd->state[button]; + EINA_SAFETY_ON_NULL_RETURN(state); + + state->pressed = EINA_TRUE; + if (state->timer) efl_del(state->timer); + state->timer = efl_add(EFL_LOOP_TIMER_CLASS, obj, + efl_loop_timer_interval_set(efl_added, LONGPRESS_TIMEOUT), + efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TIMER_TICK, _timer_longpress, obj)); + + efl_event_callback_call(obj, EFL_UI_EVENT_PRESSED, &button); +} + +EOLIAN static void +_efl_ui_clickable_unpress(Eo *obj EINA_UNUSED, Efl_Ui_Clickable_Data *pd, unsigned int button) +{ + Efl_Ui_Clickable_Clicked clicked; + Button_State *state; + Eina_Bool pressed; + EINA_SAFETY_ON_FALSE_RETURN(button < 3); + + state = &pd->state[button]; + EINA_SAFETY_ON_NULL_RETURN(state); + + INF("Widget %s,%p is unpressed(%d):%d", efl_class_name_get(obj), obj, button, state->pressed); + + //eval if this is a repeated click + if (state->clicked_last_time > 0.0 && ecore_time_unix_get() - state->clicked_last_time < DOUBLE_CLICK_TIME) + state->pressed_before++; + else + state->pressed_before = 0; + //reset state + state->clicked_last_time = ecore_time_unix_get(); + pressed = state->pressed; + state->pressed = EINA_FALSE; + if (state->timer) + efl_del(state->timer); + state->timer = NULL; + + //populate state + efl_event_callback_call(obj, EFL_UI_EVENT_UNPRESSED, &button); + if (pressed) + { + INF("Widget %s,%p is clicked(%d)", efl_class_name_get(obj), obj, button); + clicked.repeated = state->pressed_before; + clicked.button = button; + if (button == 1) + efl_event_callback_call(obj, EFL_UI_EVENT_CLICKED, &clicked); + efl_event_callback_call(obj, EFL_UI_EVENT_CLICKED_ANY, &clicked); + } +} + +EOLIAN static void +_efl_ui_clickable_button_state_reset(Eo *obj EINA_UNUSED, Efl_Ui_Clickable_Data *pd, unsigned int button) +{ + Button_State *state; + EINA_SAFETY_ON_FALSE_RETURN(button < 3); + + state = &pd->state[button]; + EINA_SAFETY_ON_NULL_RETURN(state); + + INF("Widget %s,%p is press is aborted(%d):%d", efl_class_name_get(obj), obj, button, state->pressed); + + if (state->timer) + efl_del(state->timer); + state->timer = NULL; + state->pressed = EINA_FALSE; +} + +#include "efl_ui_clickable.eo.c" diff --git a/src/lib/elementary/efl_ui_clickable.eo b/src/lib/elementary/efl_ui_clickable.eo new file mode 100644 index 0000000000..de3a3e4fb1 --- /dev/null +++ b/src/lib/elementary/efl_ui_clickable.eo @@ -0,0 +1,47 @@ +struct Efl.Ui.Clickable_Clicked { + [[A struct that expresses a click in elementary.]] + repeated : int; [[The amount of how often the clicked event was repeated in a certain amount of time]] + button : int; [[The Button that is pressed]] +} + +mixin @beta Efl.Ui.Clickable +{ + [[Efl UI clickable interface]] + event_prefix: efl_ui; + methods { + press @protected { + [[Change internal states that a button got pressed. + + When the button is already pressed, this is silently ignored. + ]] + params { + button : uint; [[The number of the button. FIXME ensure to have the right interval of possible input]] + } + } + unpress @protected { + [[Change internal states that a button got unpressed. + + When the button is not pressed, this is silently ignored. + ]] + params { + button : uint; [[The number of the button. FIXME ensure to have the right interval of possible input]] + } + } + button_state_reset @protected { + [[This aborts the internal state after a press call. + + This will stop the timer for longpress. And set the state of the clickable mixin back into the unpressed state. + ]] + params { + button : uint; + } + } + } + events { + clicked: Efl.Ui.Clickable_Clicked; [[Called when object is in sequence pressed and unpressed, by the primary button]] + clicked,any : Efl.Ui.Clickable_Clicked; [[Called when object is in sequence pressed and unpressed by any button. The button that triggered the event can be found in the event information.]] + pressed: int; [[Called when the object is pressed, event_info is the button that got pressed]] + unpressed: int; [[Called when the object is no longer pressed, event_info is the button that got pressed]] + longpressed: int; [[Called when the object receives a long press, event_info is the button that got pressed]] + } +} diff --git a/src/lib/elementary/efl_ui_clickable_util.c b/src/lib/elementary/efl_ui_clickable_util.c new file mode 100644 index 0000000000..b11e0c50e2 --- /dev/null +++ b/src/lib/elementary/efl_ui_clickable_util.c @@ -0,0 +1,99 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#define EFL_UI_CLICKABLE_PROTECTED 1 + +#include +#include "elm_priv.h" + +typedef struct { + +} Efl_Ui_Clickable_Util_Data; + +static void +_on_press_cb(void *data, + Evas_Object *obj EINA_UNUSED, + const char *emission EINA_UNUSED, + const char *source EINA_UNUSED) +{ + efl_ui_clickable_press(data, 1); +} + +static void +_on_unpress_cb(void *data, + Evas_Object *obj EINA_UNUSED, + const char *emission EINA_UNUSED, + const char *source EINA_UNUSED) +{ + efl_ui_clickable_unpress(data, 1); +} + +static void +_on_mouse_out(void *data, + Evas_Object *obj EINA_UNUSED, + const char *emission EINA_UNUSED, + const char *source EINA_UNUSED) +{ + efl_ui_clickable_button_state_reset(data, 1); +} + +EOLIAN static void +_efl_ui_clickable_util_bind_to_theme(Efl_Canvas_Layout *object, Efl_Ui_Clickable *clickable) +{ + efl_layout_signal_callback_add(object, "efl,action,press", "*", clickable, _on_press_cb, NULL); + efl_layout_signal_callback_add(object, "efl,action,unpress", "*", clickable, _on_unpress_cb, NULL); + efl_layout_signal_callback_add(object, "efl,action,mouse_out", "*", clickable, _on_mouse_out, NULL); +} + +static void +_press_cb(void *data, const Efl_Event *ev) +{ + Efl_Input_Pointer *pointer = ev->info; + if (!efl_input_processed_get(pointer)) + { + efl_ui_clickable_press(data, 1); + efl_input_processed_set(pointer, EINA_TRUE); + } +} + +static void +_unpress_cb(void *data, const Efl_Event *ev EINA_UNUSED) +{ + Efl_Input_Pointer *pointer = ev->info; + Eina_Position2D mouse_pos = efl_input_pointer_position_get(pointer); + Eina_Rect geom = efl_gfx_entity_geometry_get(data); + if (efl_input_processed_get(pointer)) + { + efl_ui_clickable_button_state_reset(data, 1); + } + else if (!eina_rectangle_coords_inside(&geom.rect, mouse_pos.x, mouse_pos.y)) + { + //we are emulating edje behavior here, do press unpress on the event, but not click + efl_ui_clickable_button_state_reset(data, 1); + if (efl_canvas_object_pointer_mode_get(data) == EFL_INPUT_OBJECT_POINTER_MODE_AUTO_GRAB) + { + efl_ui_clickable_unpress(data, 1); + efl_input_processed_set(pointer, EINA_TRUE); + } + } + else + { + efl_ui_clickable_unpress(data, 1); + efl_input_processed_set(pointer, EINA_TRUE); + } +} + +EFL_CALLBACKS_ARRAY_DEFINE(bind_to_theme_callbacks, + {EFL_EVENT_POINTER_DOWN, _press_cb}, + {EFL_EVENT_POINTER_UP, _unpress_cb}, +) + +EOLIAN static void +_efl_ui_clickable_util_bind_to_object(Efl_Input_Interface *object, Efl_Ui_Clickable *clickable) +{ + efl_event_callback_array_add(object, bind_to_theme_callbacks(), clickable); +} + + +#include "efl_ui_clickable_util.eo.c" diff --git a/src/lib/elementary/efl_ui_clickable_util.eo b/src/lib/elementary/efl_ui_clickable_util.eo new file mode 100644 index 0000000000..5f009e2925 --- /dev/null +++ b/src/lib/elementary/efl_ui_clickable_util.eo @@ -0,0 +1,24 @@ +class @beta Efl.Ui.Clickable_Util { + methods { + bind_to_theme @class { + [[This will listen to the standard events of a theme, and emit the events on clickable + + This means, widgets themselfs do not neccessarily need to listen to the theme signals. This function does this, and calls the correct clickable functions. + ]] + params { + object : Efl.Canvas.Layout; [[The object to listen on]] + clickable : Efl.Ui.Clickable; [[The object to call the clickable events on]] + } + } + bind_to_object @class { + [[This will listen to the standard events on a object, and call the correct methods on clickable + + This means, widgets themselfs do not neccessarily need to listen to the events on the object. This function does this, and calls the correct clickable functions. + ]] + params { + object : Efl.Input.Interface; [[The object to listen on]] + clickable : Efl.Ui.Clickable; [[The object to call the clickable events on]] + } + } + } +} diff --git a/src/lib/elementary/efl_ui_image_zoomable.c b/src/lib/elementary/efl_ui_image_zoomable.c index 6818cf09ad..5f8147d777 100644 --- a/src/lib/elementary/efl_ui_image_zoomable.c +++ b/src/lib/elementary/efl_ui_image_zoomable.c @@ -861,7 +861,12 @@ _mouse_down_cb(void *data, if (elm_widget_is_legacy(data)) evas_object_smart_callback_call(data, "clicked,double", NULL); else - efl_event_callback_call(data, EFL_UI_EVENT_CLICKED_DOUBLE, NULL); + { + Efl_Ui_Clickable_Clicked clicked; + clicked.repeated = 1; + clicked.button = 1; + efl_event_callback_call(data, EFL_UI_EVENT_CLICKED, &clicked); + } } else efl_event_callback_legacy_call(data, EFL_UI_IMAGE_ZOOMABLE_EVENT_PRESS, NULL); diff --git a/src/lib/elementary/elm_bubble_eo.c b/src/lib/elementary/elm_bubble_eo.c index 8b6ef3e104..4f6ee165a3 100644 --- a/src/lib/elementary/elm_bubble_eo.c +++ b/src/lib/elementary/elm_bubble_eo.c @@ -50,6 +50,6 @@ static const Efl_Class_Description _elm_bubble_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_bubble_class_get, &_elm_bubble_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_CLICKABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_bubble_class_get, &_elm_bubble_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_CLICKABLE_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); #include "elm_bubble_eo.legacy.c" diff --git a/src/lib/elementary/elm_colorselector_eo.c b/src/lib/elementary/elm_colorselector_eo.c index aba3685bd4..b6b288a8cf 100644 --- a/src/lib/elementary/elm_colorselector_eo.c +++ b/src/lib/elementary/elm_colorselector_eo.c @@ -146,6 +146,6 @@ static const Efl_Class_Description _elm_colorselector_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_colorselector_class_get, &_elm_colorselector_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_FOCUS_COMPOSITION_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_CLICKABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_colorselector_class_get, &_elm_colorselector_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_FOCUS_COMPOSITION_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_CLICKABLE_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); #include "elm_colorselector_eo.legacy.c" diff --git a/src/lib/elementary/elm_diskselector_eo.c b/src/lib/elementary/elm_diskselector_eo.c index b44f2a0f9f..d533a106eb 100644 --- a/src/lib/elementary/elm_diskselector_eo.c +++ b/src/lib/elementary/elm_diskselector_eo.c @@ -222,6 +222,6 @@ static const Efl_Class_Description _elm_diskselector_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_diskselector_class_get, &_elm_diskselector_class_desc, EFL_UI_WIDGET_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_CLICKABLE_INTERFACE, EFL_UI_SCROLLABLE_INTERFACE, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_diskselector_class_get, &_elm_diskselector_class_desc, EFL_UI_WIDGET_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_CLICKABLE_MIXIN, EFL_UI_SCROLLABLE_INTERFACE, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); #include "elm_diskselector_eo.legacy.c" diff --git a/src/lib/elementary/elm_entry_eo.c b/src/lib/elementary/elm_entry_eo.c index 09ff5794c8..110de558bc 100644 --- a/src/lib/elementary/elm_entry_eo.c +++ b/src/lib/elementary/elm_entry_eo.c @@ -1188,6 +1188,6 @@ static const Efl_Class_Description _elm_entry_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_entry_class_get, &_elm_entry_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_UI_CLICKABLE_INTERFACE, EFL_ACCESS_TEXT_INTERFACE, EFL_ACCESS_EDITABLE_TEXT_INTERFACE, EFL_FILE_MIXIN, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_SCROLLABLE_INTERFACE, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_entry_class_get, &_elm_entry_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_UI_CLICKABLE_MIXIN, EFL_ACCESS_TEXT_INTERFACE, EFL_ACCESS_EDITABLE_TEXT_INTERFACE, EFL_FILE_MIXIN, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_SCROLLABLE_INTERFACE, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); #include "elm_entry_eo.legacy.c" diff --git a/src/lib/elementary/elm_fileselector_entry_eo.c b/src/lib/elementary/elm_fileselector_entry_eo.c index 58c0092614..04af297c98 100644 --- a/src/lib/elementary/elm_fileselector_entry_eo.c +++ b/src/lib/elementary/elm_fileselector_entry_eo.c @@ -88,4 +88,4 @@ static const Efl_Class_Description _elm_fileselector_entry_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_fileselector_entry_class_get, &_elm_fileselector_entry_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_FILESELECTOR_INTERFACE, EFL_UI_CLICKABLE_INTERFACE, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_fileselector_entry_class_get, &_elm_fileselector_entry_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_FILESELECTOR_INTERFACE, EFL_UI_CLICKABLE_MIXIN, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/elm_fileselector_eo.c b/src/lib/elementary/elm_fileselector_eo.c index fa3e9d6408..3ae6cd3539 100644 --- a/src/lib/elementary/elm_fileselector_eo.c +++ b/src/lib/elementary/elm_fileselector_eo.c @@ -202,6 +202,6 @@ static const Efl_Class_Description _elm_fileselector_class_desc = { _elm_fileselector_class_destructor }; -EFL_DEFINE_CLASS(elm_fileselector_class_get, &_elm_fileselector_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_FILESELECTOR_INTERFACE, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_FOCUS_COMPOSITION_MIXIN, EFL_UI_CLICKABLE_INTERFACE, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_fileselector_class_get, &_elm_fileselector_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_FILESELECTOR_INTERFACE, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_FOCUS_COMPOSITION_MIXIN, EFL_UI_CLICKABLE_MIXIN, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); #include "elm_fileselector_eo.legacy.c" diff --git a/src/lib/elementary/elm_gengrid_eo.c b/src/lib/elementary/elm_gengrid_eo.c index 89263f9c1f..b3012a57b8 100644 --- a/src/lib/elementary/elm_gengrid_eo.c +++ b/src/lib/elementary/elm_gengrid_eo.c @@ -512,6 +512,6 @@ static const Efl_Class_Description _elm_gengrid_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_gengrid_class_get, &_elm_gengrid_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_UI_CLICKABLE_INTERFACE, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_ACCESS_SELECTION_INTERFACE, EFL_UI_LEGACY_INTERFACE, ELM_WIDGET_ITEM_CONTAINER_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_gengrid_class_get, &_elm_gengrid_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_UI_CLICKABLE_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_ACCESS_SELECTION_INTERFACE, EFL_UI_LEGACY_INTERFACE, ELM_WIDGET_ITEM_CONTAINER_INTERFACE, NULL); #include "elm_gengrid_eo.legacy.c" diff --git a/src/lib/elementary/elm_genlist_eo.c b/src/lib/elementary/elm_genlist_eo.c index ca2fd5669e..fd0d5216ab 100644 --- a/src/lib/elementary/elm_genlist_eo.c +++ b/src/lib/elementary/elm_genlist_eo.c @@ -681,6 +681,6 @@ static const Efl_Class_Description _elm_genlist_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_genlist_class_get, &_elm_genlist_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_UI_CLICKABLE_INTERFACE, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_ACCESS_SELECTION_INTERFACE, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, ELM_WIDGET_ITEM_CONTAINER_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_genlist_class_get, &_elm_genlist_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_UI_CLICKABLE_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_ACCESS_SELECTION_INTERFACE, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, ELM_WIDGET_ITEM_CONTAINER_INTERFACE, NULL); #include "elm_genlist_eo.legacy.c" diff --git a/src/lib/elementary/elm_hover_eo.c b/src/lib/elementary/elm_hover_eo.c index 5ca798a132..b5a1b20208 100644 --- a/src/lib/elementary/elm_hover_eo.c +++ b/src/lib/elementary/elm_hover_eo.c @@ -92,6 +92,6 @@ static const Efl_Class_Description _elm_hover_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_hover_class_get, &_elm_hover_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_FOCUS_LAYER_MIXIN, EFL_UI_CLICKABLE_INTERFACE, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_hover_class_get, &_elm_hover_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_FOCUS_LAYER_MIXIN, EFL_UI_CLICKABLE_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); #include "elm_hover_eo.legacy.c" diff --git a/src/lib/elementary/elm_hoversel_eo.c b/src/lib/elementary/elm_hoversel_eo.c index fb108263a1..de2f5371c5 100644 --- a/src/lib/elementary/elm_hoversel_eo.c +++ b/src/lib/elementary/elm_hoversel_eo.c @@ -189,6 +189,6 @@ static const Efl_Class_Description _elm_hoversel_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_hoversel_class_get, &_elm_hoversel_class_desc, EFL_UI_BUTTON_LEGACY_CLASS, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_CLICKABLE_INTERFACE, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_hoversel_class_get, &_elm_hoversel_class_desc, EFL_UI_BUTTON_LEGACY_CLASS, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_CLICKABLE_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); #include "elm_hoversel_eo.legacy.c" diff --git a/src/lib/elementary/elm_index_eo.c b/src/lib/elementary/elm_index_eo.c index 9c935c7f92..68bd184e59 100644 --- a/src/lib/elementary/elm_index_eo.c +++ b/src/lib/elementary/elm_index_eo.c @@ -322,6 +322,6 @@ static const Efl_Class_Description _elm_index_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_index_class_get, &_elm_index_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_DIRECTION_INTERFACE, EFL_UI_CLICKABLE_INTERFACE, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_index_class_get, &_elm_index_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_DIRECTION_INTERFACE, EFL_UI_CLICKABLE_MIXIN, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); #include "elm_index_eo.legacy.c" diff --git a/src/lib/elementary/elm_list_eo.c b/src/lib/elementary/elm_list_eo.c index 9668aa5e07..3da0cba750 100644 --- a/src/lib/elementary/elm_list_eo.c +++ b/src/lib/elementary/elm_list_eo.c @@ -363,6 +363,6 @@ static const Efl_Class_Description _elm_list_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_list_class_get, &_elm_list_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_ACCESS_SELECTION_INTERFACE, EFL_ACCESS_OBJECT_MIXIN, EFL_UI_CLICKABLE_INTERFACE, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, ELM_WIDGET_ITEM_CONTAINER_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_list_class_get, &_elm_list_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_ACCESS_SELECTION_INTERFACE, EFL_ACCESS_OBJECT_MIXIN, EFL_UI_CLICKABLE_MIXIN, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, ELM_WIDGET_ITEM_CONTAINER_INTERFACE, NULL); #include "elm_list_eo.legacy.c" diff --git a/src/lib/elementary/elm_map_eo.c b/src/lib/elementary/elm_map_eo.c index 62ed9c2861..0e522f4635 100644 --- a/src/lib/elementary/elm_map_eo.c +++ b/src/lib/elementary/elm_map_eo.c @@ -360,6 +360,6 @@ static const Efl_Class_Description _elm_map_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_map_class_get, &_elm_map_class_desc, EFL_UI_WIDGET_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_CLICKABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, EFL_UI_ZOOM_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_map_class_get, &_elm_map_class_desc, EFL_UI_WIDGET_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_CLICKABLE_MIXIN, EFL_UI_LEGACY_INTERFACE, EFL_UI_ZOOM_INTERFACE, NULL); #include "elm_map_eo.legacy.c" diff --git a/src/lib/elementary/elm_menu_eo.c b/src/lib/elementary/elm_menu_eo.c index 1bc7f988da..4aaa856be8 100644 --- a/src/lib/elementary/elm_menu_eo.c +++ b/src/lib/elementary/elm_menu_eo.c @@ -119,6 +119,6 @@ static const Efl_Class_Description _elm_menu_class_desc = { 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); +EFL_DEFINE_CLASS(elm_menu_class_get, &_elm_menu_class_desc, EFL_UI_WIDGET_CLASS, EFL_UI_CLICKABLE_MIXIN, 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_multibuttonentry_eo.c b/src/lib/elementary/elm_multibuttonentry_eo.c index 24dfb7fc45..dcfb62778d 100644 --- a/src/lib/elementary/elm_multibuttonentry_eo.c +++ b/src/lib/elementary/elm_multibuttonentry_eo.c @@ -219,6 +219,6 @@ static const Efl_Class_Description _elm_multibuttonentry_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_multibuttonentry_class_get, &_elm_multibuttonentry_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_CLICKABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_multibuttonentry_class_get, &_elm_multibuttonentry_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_CLICKABLE_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); #include "elm_multibuttonentry_eo.legacy.c" diff --git a/src/lib/elementary/elm_photo_eo.c b/src/lib/elementary/elm_photo_eo.c index 02b8a28fcf..6c49b03515 100644 --- a/src/lib/elementary/elm_photo_eo.c +++ b/src/lib/elementary/elm_photo_eo.c @@ -76,4 +76,4 @@ static const Efl_Class_Description _elm_photo_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_photo_class_get, &_elm_photo_class_desc, EFL_UI_WIDGET_CLASS, EFL_FILE_MIXIN, EFL_UI_CLICKABLE_INTERFACE, EFL_UI_DRAGGABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_photo_class_get, &_elm_photo_class_desc, EFL_UI_WIDGET_CLASS, EFL_FILE_MIXIN, EFL_UI_CLICKABLE_MIXIN, EFL_UI_DRAGGABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/elm_plug_eo.c b/src/lib/elementary/elm_plug_eo.c index 7dc8c4daad..c40f883d22 100644 --- a/src/lib/elementary/elm_plug_eo.c +++ b/src/lib/elementary/elm_plug_eo.c @@ -54,6 +54,6 @@ static const Efl_Class_Description _elm_plug_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_plug_class_get, &_elm_plug_class_desc, EFL_UI_WIDGET_CLASS, EFL_UI_CLICKABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_plug_class_get, &_elm_plug_class_desc, EFL_UI_WIDGET_CLASS, EFL_UI_CLICKABLE_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); #include "elm_plug_eo.legacy.c" diff --git a/src/lib/elementary/elm_thumb_eo.c b/src/lib/elementary/elm_thumb_eo.c index d65f2ee700..0e57845112 100644 --- a/src/lib/elementary/elm_thumb_eo.c +++ b/src/lib/elementary/elm_thumb_eo.c @@ -82,4 +82,4 @@ static const Efl_Class_Description _elm_thumb_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_thumb_class_get, &_elm_thumb_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_FILE_MIXIN, EFL_UI_CLICKABLE_INTERFACE, EFL_UI_DRAGGABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_thumb_class_get, &_elm_thumb_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_FILE_MIXIN, EFL_UI_CLICKABLE_MIXIN, EFL_UI_DRAGGABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/elm_toolbar_eo.c b/src/lib/elementary/elm_toolbar_eo.c index 0589b9aa71..4356aff25a 100644 --- a/src/lib/elementary/elm_toolbar_eo.c +++ b/src/lib/elementary/elm_toolbar_eo.c @@ -372,6 +372,6 @@ static const Efl_Class_Description _elm_toolbar_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_toolbar_class_get, &_elm_toolbar_class_desc, EFL_UI_WIDGET_CLASS, EFL_UI_FOCUS_COMPOSITION_MIXIN, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_UI_DIRECTION_INTERFACE, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_ACCESS_SELECTION_INTERFACE, EFL_ACCESS_OBJECT_MIXIN, EFL_UI_CLICKABLE_INTERFACE, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, ELM_WIDGET_ITEM_CONTAINER_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_toolbar_class_get, &_elm_toolbar_class_desc, EFL_UI_WIDGET_CLASS, EFL_UI_FOCUS_COMPOSITION_MIXIN, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_UI_DIRECTION_INTERFACE, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_ACCESS_SELECTION_INTERFACE, EFL_ACCESS_OBJECT_MIXIN, EFL_UI_CLICKABLE_MIXIN, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, ELM_WIDGET_ITEM_CONTAINER_INTERFACE, NULL); #include "elm_toolbar_eo.legacy.c" diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build index 6d40ca1cde..87e1b21c43 100644 --- a/src/lib/elementary/meson.build +++ b/src/lib/elementary/meson.build @@ -175,6 +175,8 @@ pub_eo_files = [ 'efl_ui_caching_factory.eo', 'efl_ui_widget_factory.eo', 'efl_ui_relative_layout.eo', + 'efl_ui_clickable.eo', + 'efl_ui_clickable_util.eo', ] foreach eo_file : pub_eo_files @@ -931,7 +933,9 @@ elementary_src = [ 'efl_ui_homogeneous_model.c', 'efl_ui_exact_model.c', 'efl_ui_average_model.c', - 'efl_ui_relative_layout.c' + 'efl_ui_relative_layout.c', + 'efl_ui_clickable.c', + 'efl_ui_clickable_util.c', ] elementary_deps = [emile, eo, efl, edje, ethumb, ethumb_client, emotion, ecore_imf, ecore_con, eldbus, efreet, efreet_mime, efreet_trash, eio, atspi, dl, intl]