elm: Use a macro to handle key bindings
This factorizes the code and makes most widgets handle key down events in the same way: - check that the object is not disabled, event is not on hold - figure out the key binding based on the class name - mark event as on hold The class name is usually MY_CLASS_NAME but in some cases it was MY_CLASS_NAME_LEGACY which may be different from the EO class name (eg. elm_win vs. Efl.Ui.Win). In that case the key bindings are broken. This breaks key bindings for the following widgets: - Win (focus) - Image ("clicked") - Video (move, play) This fixes key bindings for the following widgets: - Nstate Some widgets remain broken: - Photocam / Efl.Ui.Image.Zoomable A patch will be applied to restore the key bindings for the above breaks.
This commit is contained in:
parent
069747b9de
commit
20a5968c12
|
@ -172,22 +172,6 @@ _key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_efl_ui_button_elm_widget_widget_event(Eo *obj, Efl_Ui_Button_Data *_pd EINA_UNUSED, const Efl_Event *eo_event EINA_UNUSED, Evas_Object *src EINA_UNUSED, Evas_Callback_Type type, void *event_info)
|
||||
{
|
||||
(void) src;
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
|
||||
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
|
||||
|
||||
if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME, ev, key_actions))
|
||||
return EINA_FALSE;
|
||||
|
||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
_on_clicked_signal(void *data,
|
||||
Evas_Object *obj EINA_UNUSED,
|
||||
|
@ -433,6 +417,9 @@ _efl_ui_button_class_constructor(Efl_Class *klass)
|
|||
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
|
||||
}
|
||||
|
||||
/* Standard widget overrides */
|
||||
|
||||
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_button, Efl_Ui_Button_Data)
|
||||
EFL_TEXT_PART_DEFAULT_IMPLEMENT(efl_ui_button, Efl_Ui_Button_Data)
|
||||
|
||||
/* Efl.Part begin */
|
||||
|
|
|
@ -149,22 +149,6 @@ _key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_efl_ui_check_elm_widget_widget_event(Eo *obj, Efl_Ui_Check_Data *_pd EINA_UNUSED, const Efl_Event *eo_event EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
|
||||
{
|
||||
(void) src;
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
|
||||
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
|
||||
|
||||
if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME, ev, key_actions))
|
||||
return EINA_FALSE;
|
||||
|
||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static Efl_Ui_Theme_Apply
|
||||
_efl_ui_check_elm_widget_theme_apply(Eo *obj, Efl_Ui_Check_Data *sd EINA_UNUSED)
|
||||
{
|
||||
|
@ -426,6 +410,10 @@ _efl_ui_check_class_constructor(Efl_Class *klass)
|
|||
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
|
||||
}
|
||||
|
||||
/* Standard widget overrides */
|
||||
|
||||
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_check, Efl_Ui_Check_Data)
|
||||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(MY_CLASS_PFX)
|
||||
|
|
|
@ -728,22 +728,6 @@ _key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_efl_ui_image_elm_widget_widget_event(Eo *obj, Efl_Ui_Image_Data *_pd EINA_UNUSED, const Efl_Event *eo_event EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
|
||||
{
|
||||
(void) src;
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
|
||||
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
|
||||
|
||||
if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME_LEGACY, ev, key_actions))
|
||||
return EINA_FALSE;
|
||||
|
||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
// TODO: remove this function after using the widget's scale value instead of image's scale value,
|
||||
|
||||
static void
|
||||
|
@ -2269,6 +2253,10 @@ elm_image_aspect_fixed_get(const Evas_Object *obj)
|
|||
return sd->aspect_fixed;
|
||||
}
|
||||
|
||||
/* Standard widget overrides */
|
||||
|
||||
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_image, Efl_Ui_Image_Data)
|
||||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
#define EFL_UI_IMAGE_EXTRA_OPS \
|
||||
|
|
|
@ -1033,22 +1033,6 @@ _key_action_zoom(Evas_Object *obj, const char *params)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_efl_ui_image_zoomable_elm_widget_widget_event(Eo *obj, Efl_Ui_Image_Zoomable_Data *_pd EINA_UNUSED, const Efl_Event *eo_event EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
|
||||
{
|
||||
(void) src;
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
|
||||
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
|
||||
|
||||
if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME, ev, key_actions))
|
||||
return EINA_FALSE;
|
||||
|
||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
_bounce_eval(void *data, const Efl_Event *event EINA_UNUSED)
|
||||
{
|
||||
|
@ -2972,6 +2956,10 @@ elm_photocam_bounce_get(const Evas_Object *obj,
|
|||
elm_interface_scrollable_bounce_allow_get((Eo *)obj, h_bounce, v_bounce);
|
||||
}
|
||||
|
||||
/* Standard widget overrides */
|
||||
|
||||
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_image_zoomable, Efl_Ui_Image_Zoomable_Data)
|
||||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
#define EFL_UI_IMAGE_ZOOMABLE_EXTRA_OPS \
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
#define MY_CLASS EFL_UI_NSTATE_CLASS
|
||||
#define MY_CLASS_NAME "Efl.Ui.Nstate"
|
||||
#define MY_CLASS_NAME_LEGACY "efl_ui_nstate"
|
||||
|
||||
|
||||
typedef struct
|
||||
|
@ -158,21 +157,6 @@ _key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_efl_ui_nstate_elm_widget_widget_event(Eo *obj, Efl_Ui_Nstate_Data *_pd EINA_UNUSED, const Efl_Event *eo_event EINA_UNUSED, Evas_Object *src EINA_UNUSED, Evas_Callback_Type type, void *event_info)
|
||||
{
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
|
||||
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
|
||||
|
||||
if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME_LEGACY, ev, key_actions))
|
||||
return EINA_FALSE;
|
||||
|
||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_nstate_activate(Eo *obj, Efl_Ui_Nstate_Data *_pd)
|
||||
{
|
||||
|
@ -186,6 +170,10 @@ _efl_ui_nstate_class_constructor(Efl_Class *klass)
|
|||
evas_smart_legacy_type_register(MY_CLASS_NAME, klass);
|
||||
}
|
||||
|
||||
/* Standard widget overrides */
|
||||
|
||||
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_nstate, Efl_Ui_Nstate_Data)
|
||||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
#define EFL_UI_NSTATE_EXTRA_OPS \
|
||||
|
|
|
@ -130,22 +130,6 @@ _key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_efl_ui_radio_elm_widget_widget_event(Eo *obj, Efl_Ui_Radio_Data *_pd EINA_UNUSED, const Efl_Event *eo_event EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
|
||||
{
|
||||
(void) src;
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
|
||||
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
|
||||
|
||||
if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME, ev, key_actions))
|
||||
return EINA_FALSE;
|
||||
|
||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
/* FIXME: replicated from elm_layout just because radio's icon spot
|
||||
* is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
|
||||
* can changed the theme API */
|
||||
|
@ -401,6 +385,10 @@ _efl_ui_radio_elm_interface_atspi_accessible_state_set_get(Eo *obj, Efl_Ui_Radio
|
|||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_radio, Efl_Ui_Radio_Data)
|
||||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(MY_CLASS_PFX)
|
||||
|
||||
#define EFL_UI_RADIO_EXTRA_OPS \
|
||||
|
|
|
@ -107,25 +107,6 @@ _key_action_play(Evas_Object *obj, const char *params EINA_UNUSED)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_efl_ui_video_elm_widget_widget_event(Eo *obj, Efl_Ui_Video_Data *_pd EINA_UNUSED, const Efl_Event *eo_event EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
|
||||
{
|
||||
(void) src;
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
|
||||
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
|
||||
|
||||
if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME_LEGACY, ev, key_actions))
|
||||
{
|
||||
INF("keyname: '%s' not handled", ev->key);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_video_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Video_Data *sd)
|
||||
{
|
||||
|
@ -472,6 +453,10 @@ elm_video_play_position_get(const Evas_Object *obj)
|
|||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_video, Efl_Ui_Video_Data)
|
||||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
#define EFL_UI_VIDEO_EXTRA_OPS \
|
||||
ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_video), \
|
||||
EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_video)
|
||||
|
|
|
@ -1766,21 +1766,6 @@ _key_action_move(Evas_Object *obj, const char *params)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_efl_ui_win_elm_widget_widget_event(Eo *obj, Efl_Ui_Win_Data *_pd EINA_UNUSED, const Efl_Event *eo_event EINA_UNUSED, Evas_Object *src EINA_UNUSED, Evas_Callback_Type type, void *event_info)
|
||||
{
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
|
||||
if (elm_widget_disabled_get(obj)) return EINA_FALSE;
|
||||
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
||||
|
||||
if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME_LEGACY, ev, key_actions))
|
||||
return EINA_FALSE;
|
||||
|
||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
/* forward events sent to evas to the window */
|
||||
static void
|
||||
_evas_event_key_cb(void *data, const Efl_Event *ev)
|
||||
|
@ -8210,6 +8195,10 @@ elm_win_teamwork_uri_open(Efl_Ui_Win *obj EINA_UNUSED, const char *uri EINA_UNUS
|
|||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_win, Efl_Ui_Win_Data)
|
||||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
#define EFL_UI_WIN_EXTRA_OPS \
|
||||
EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_win), \
|
||||
ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_win), \
|
||||
|
|
|
@ -482,6 +482,7 @@ static Eina_Bool
|
|||
_key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED)
|
||||
{
|
||||
ELM_COMBOBOX_DATA_GET(obj, sd);
|
||||
if (!sd->hover) return EINA_FALSE;
|
||||
if (!sd->expanded)
|
||||
elm_combobox_hover_begin(obj);
|
||||
else
|
||||
|
@ -492,23 +493,6 @@ _key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_combobox_elm_widget_widget_event(Eo *obj, Elm_Combobox_Data *sd,
|
||||
const Efl_Event *eo_event EINA_UNUSED,
|
||||
Evas_Object *src EINA_UNUSED,
|
||||
Evas_Callback_Type type, void *event_info)
|
||||
{
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
if (!sd || !sd->hover) return EINA_FALSE;
|
||||
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
|
||||
if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME, ev, key_actions))
|
||||
return EINA_FALSE;
|
||||
|
||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_combobox_class_constructor(Efl_Class *klass)
|
||||
{
|
||||
|
@ -563,6 +547,10 @@ _elm_combobox_efl_gfx_size_set(Eo *obj, Elm_Combobox_Data *pd, Evas_Coord w, Eva
|
|||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_combobox, Elm_Combobox_Data)
|
||||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
#define ELM_COMBOBOX_EXTRA_OPS \
|
||||
EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_combobox)
|
||||
|
||||
|
|
|
@ -145,22 +145,6 @@ _key_action_escape(Evas_Object *obj, const char *params EINA_UNUSED)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_ctxpopup_elm_widget_widget_event(Eo *obj, Elm_Ctxpopup_Data *sd EINA_UNUSED, const Efl_Event *eo_event EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
|
||||
{
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
(void)src;
|
||||
|
||||
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
|
||||
|
||||
if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME, ev, key_actions))
|
||||
return EINA_FALSE;
|
||||
|
||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
_x_pos_adjust(Evas_Coord_Point *pos,
|
||||
Evas_Coord_Point *base_size,
|
||||
|
@ -1649,6 +1633,10 @@ _elm_ctxpopup_elm_interface_atspi_accessible_state_set_get(Eo *obj, Elm_Ctxpopup
|
|||
return ret;
|
||||
}
|
||||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_ctxpopup, Elm_Ctxpopup_Data)
|
||||
|
||||
/* Efl.Part begin */
|
||||
|
||||
ELM_PART_OVERRIDE(elm_ctxpopup, ELM_CTXPOPUP, EFL_UI_LAYOUT, Elm_Ctxpopup_Data, Elm_Part_Data)
|
||||
|
|
|
@ -306,22 +306,6 @@ _key_action_backspace(Evas_Object *obj, const char *params EINA_UNUSED)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_fileselector_elm_widget_widget_event(Eo *obj, Elm_Fileselector_Data *sd EINA_UNUSED, const Efl_Event *eo_event EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
|
||||
{
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
(void) src;
|
||||
|
||||
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
|
||||
|
||||
if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME, ev, key_actions))
|
||||
return EINA_FALSE;
|
||||
|
||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
/*** GENLIST/GENGRID "MODEL" ***/
|
||||
static char *
|
||||
_itc_text_get(void *data,
|
||||
|
@ -3231,6 +3215,9 @@ _elm_fileselector_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA
|
|||
return &atspi_actions[0];
|
||||
}
|
||||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_fileselector, Elm_Fileselector_Data)
|
||||
|
||||
/* Efl.Part begin */
|
||||
|
||||
|
@ -3239,6 +3226,7 @@ ELM_PART_OVERRIDE_TEXT_SET(elm_fileselector, ELM_FILESELECTOR, EFL_UI_LAYOUT, El
|
|||
#include "elm_fileselector_internal_part.eo.c"
|
||||
|
||||
/* Efl.Part end */
|
||||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
#define ELM_FILESELECTOR_EXTRA_OPS \
|
||||
|
|
|
@ -934,6 +934,7 @@ _key_action_move(Evas_Object *obj, const char *params)
|
|||
ELM_HOVERSEL_DATA_GET(obj, sd);
|
||||
const char *dir = params;
|
||||
|
||||
if (!sd->hover) return EINA_FALSE;
|
||||
_elm_widget_focus_auto_show(obj);
|
||||
if (!strcmp(dir, "down") || !strcmp(dir, "right"))
|
||||
{
|
||||
|
@ -983,6 +984,8 @@ _key_action_move(Evas_Object *obj, const char *params)
|
|||
static Eina_Bool
|
||||
_key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED)
|
||||
{
|
||||
ELM_HOVERSEL_DATA_GET(obj, sd);
|
||||
if (!sd->hover) return EINA_FALSE;
|
||||
_activate(obj);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
@ -990,29 +993,22 @@ _key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED)
|
|||
static Eina_Bool
|
||||
_key_action_escape(Evas_Object *obj, const char *params EINA_UNUSED)
|
||||
{
|
||||
ELM_HOVERSEL_DATA_GET(obj, sd);
|
||||
if (!sd->hover) return EINA_FALSE;
|
||||
elm_hoversel_hover_end(obj);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
// _hoversel_elm_widget_widget_event()
|
||||
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(hoversel, Elm_Hoversel_Data)
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_hoversel_elm_widget_widget_event(Eo *obj, Elm_Hoversel_Data *sd, const Efl_Event *eo_event, Evas_Object *src, Evas_Callback_Type type, void *event_info)
|
||||
{
|
||||
(void) src;
|
||||
Eina_Bool int_ret = EINA_FALSE;
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
if (elm_obj_widget_event(efl_super(obj, MY_CLASS), eo_event, src, type, event_info))
|
||||
return EINA_TRUE; // note: this was FALSE but likely wrong
|
||||
|
||||
int_ret = elm_obj_widget_event(efl_super(obj, MY_CLASS), eo_event, src, type, event_info);
|
||||
if (int_ret) return EINA_FALSE;
|
||||
|
||||
if (!sd || !sd->hover) return EINA_FALSE;
|
||||
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
|
||||
|
||||
if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME, ev, key_actions))
|
||||
return EINA_FALSE;
|
||||
|
||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||
return EINA_TRUE;
|
||||
return _hoversel_elm_widget_widget_event(obj, sd, eo_event, src, type, event_info);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -1569,20 +1569,6 @@ _key_action_item_pop(Evas_Object *obj, const char *params EINA_UNUSED)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_naviframe_elm_widget_widget_event(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, const Efl_Event *eo_event EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
|
||||
{
|
||||
(void)src;
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
|
||||
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
|
||||
if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME, ev, key_actions)) return EINA_FALSE;
|
||||
|
||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_naviframe_elm_widget_access(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd, Eina_Bool is_access)
|
||||
{
|
||||
|
@ -2094,6 +2080,10 @@ _elm_naviframe_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UN
|
|||
return &atspi_actions[0];
|
||||
}
|
||||
|
||||
/* Standard widget overrides */
|
||||
|
||||
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_naviframe, Elm_Naviframe_Data)
|
||||
|
||||
/* Efl.Part begin */
|
||||
|
||||
ELM_PART_OVERRIDE(elm_naviframe, ELM_NAVIFRAME, EFL_UI_LAYOUT, Elm_Naviframe_Data, Elm_Part_Data)
|
||||
|
|
|
@ -98,6 +98,7 @@ _key_action_move(Evas_Object *obj, const char *params)
|
|||
ELM_PLAYER_DATA_GET(obj, sd);
|
||||
const char *dir = params;
|
||||
|
||||
if (!sd->video) return EINA_FALSE;
|
||||
_elm_widget_focus_auto_show(obj);
|
||||
if (!strcmp(dir, "left"))
|
||||
{
|
||||
|
@ -136,6 +137,7 @@ _key_action_play(Evas_Object *obj, const char *params EINA_UNUSED)
|
|||
{
|
||||
ELM_PLAYER_DATA_GET(obj, sd);
|
||||
|
||||
if (!sd->video) return EINA_FALSE;
|
||||
if (elm_video_is_playing_get(sd->video))
|
||||
elm_video_pause(sd->video);
|
||||
else
|
||||
|
@ -144,23 +146,6 @@ _key_action_play(Evas_Object *obj, const char *params EINA_UNUSED)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_player_elm_widget_widget_event(Eo *obj, Elm_Player_Data *sd, const Efl_Event *eo_event EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
|
||||
{
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
(void) src;
|
||||
|
||||
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
|
||||
if (!sd->video) return EINA_FALSE;
|
||||
|
||||
if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME, ev, key_actions))
|
||||
return EINA_FALSE;
|
||||
|
||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
_update_theme_button(Evas_Object *obj, Evas_Object *bt, const char *name)
|
||||
{
|
||||
|
@ -705,6 +690,10 @@ _elm_player_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UNUSE
|
|||
return &atspi_actions[0];
|
||||
}
|
||||
|
||||
/* Standard widget overrides */
|
||||
|
||||
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_player, Elm_Player_Data)
|
||||
|
||||
/* Efl.Part implementation */
|
||||
|
||||
ELM_PART_OVERRIDE(elm_player, ELM_PLAYER, EFL_UI_LAYOUT, Elm_Player_Data, Elm_Part_Data)
|
||||
|
|
|
@ -1504,22 +1504,6 @@ _key_action_escape(Evas_Object *obj, const char *params EINA_UNUSED)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_popup_elm_widget_widget_event(Eo *obj, Elm_Popup_Data *_pd EINA_UNUSED, const Efl_Event *eo_event EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
|
||||
{
|
||||
(void)src;
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
|
||||
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
|
||||
|
||||
if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME, ev, key_actions))
|
||||
return EINA_FALSE;
|
||||
|
||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_popup_efl_canvas_group_group_add(Eo *obj, Elm_Popup_Data *priv)
|
||||
{
|
||||
|
@ -1929,6 +1913,10 @@ _elm_popup_elm_interface_atspi_accessible_state_set_get(Eo *obj, Elm_Popup_Data
|
|||
return ret;
|
||||
}
|
||||
|
||||
/* Standard widget overrides */
|
||||
|
||||
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_popup, Elm_Popup_Data)
|
||||
|
||||
/* Efl.Part begin */
|
||||
|
||||
ELM_PART_OVERRIDE(elm_popup, ELM_POPUP, EFL_UI_LAYOUT, Elm_Popup_Data, Elm_Part_Data)
|
||||
|
|
|
@ -1655,22 +1655,6 @@ _elm_calendar_elm_widget_on_focus(Eo *obj, Elm_Calendar_Data *sd, Elm_Object_Ite
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_calendar_elm_widget_widget_event(Eo *obj, Elm_Calendar_Data *sd EINA_UNUSED, const Efl_Event *eo_event EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
|
||||
{
|
||||
(void) src;
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
|
||||
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
||||
|
||||
if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME, ev, key_actions))
|
||||
return EINA_FALSE;
|
||||
|
||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||
return EINA_TRUE;
|
||||
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_calendar_efl_canvas_group_group_calculate(Eo *obj, Elm_Calendar_Data *_pd EINA_UNUSED)
|
||||
{
|
||||
|
@ -2338,6 +2322,10 @@ _elm_calendar_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UNU
|
|||
return &atspi_actions[0];
|
||||
}
|
||||
|
||||
/* Standard widget overrides */
|
||||
|
||||
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_calendar, Elm_Calendar_Data)
|
||||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
#define ELM_CALENDAR_EXTRA_OPS \
|
||||
|
|
|
@ -2050,6 +2050,8 @@ _key_action_move(Evas_Object *obj, const char *params)
|
|||
char colorbar_s[128];
|
||||
const char *dir = params;
|
||||
|
||||
if (!sd->selected) sd->selected = sd->items;
|
||||
if (!sd->focus_items) sd->focus_items = sd->items;
|
||||
_elm_widget_focus_auto_show(obj);
|
||||
if (!strcmp(dir, "left"))
|
||||
{
|
||||
|
@ -2151,6 +2153,8 @@ _key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED)
|
|||
{
|
||||
ELM_COLORSELECTOR_DATA_GET(obj, sd);
|
||||
|
||||
if (!sd->selected) sd->selected = sd->items;
|
||||
if (!sd->focus_items) sd->focus_items = sd->items;
|
||||
if (sd->focused == ELM_COLORSELECTOR_PALETTE)
|
||||
{
|
||||
Elm_Object_Item *eo_item = NULL;
|
||||
|
@ -2163,25 +2167,6 @@ _key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED)
|
|||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_colorselector_elm_widget_widget_event(Eo *obj, Elm_Colorselector_Data *sd, const Efl_Event *eo_event EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
|
||||
{
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
(void) src;
|
||||
|
||||
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
|
||||
if (!sd) return EINA_FALSE;
|
||||
if (!sd->selected) sd->selected = sd->items;
|
||||
if (!sd->focus_items) sd->focus_items = sd->items;
|
||||
|
||||
if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME, ev, key_actions))
|
||||
return EINA_FALSE;
|
||||
|
||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static Eina_Bool _elm_colorselector_smart_focus_next_enable = EINA_FALSE;
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
|
@ -2734,6 +2719,10 @@ _elm_color_item_elm_interface_atspi_accessible_name_get(Eo *eo_it, Elm_Color_Ite
|
|||
return it->base->accessible_name;
|
||||
}
|
||||
|
||||
/* Standard widget overrides */
|
||||
|
||||
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_colorselector, Elm_Colorselector_Data)
|
||||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
#define ELM_COLORSELECTOR_EXTRA_OPS \
|
||||
|
|
|
@ -964,6 +964,7 @@ _key_action_move(Evas_Object *obj, const char *params)
|
|||
Eina_List *l = NULL;
|
||||
const char *dir = params;
|
||||
|
||||
if (!sd->selected_item) return EINA_TRUE;
|
||||
_elm_widget_focus_auto_show(obj);
|
||||
if (!strcmp(dir, "prev"))
|
||||
{
|
||||
|
@ -996,29 +997,6 @@ _key_action_move(Evas_Object *obj, const char *params)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_diskselector_elm_widget_widget_event(Eo *obj, Elm_Diskselector_Data *sd, const Efl_Event *eo_event EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
|
||||
{
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
|
||||
(void) src;
|
||||
|
||||
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
|
||||
|
||||
if (!sd->selected_item)
|
||||
{
|
||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME, ev, key_actions))
|
||||
return EINA_FALSE;
|
||||
|
||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
_scroll_cb(Evas_Object *obj,
|
||||
void *data EINA_UNUSED)
|
||||
|
@ -1835,6 +1813,10 @@ _elm_diskselector_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA
|
|||
return &atspi_actions[0];
|
||||
}
|
||||
|
||||
/* Standard widget overrides */
|
||||
|
||||
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_diskselector, Elm_Diskselector_Data)
|
||||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
#define ELM_DISKSELECTOR_EXTRA_OPS \
|
||||
|
|
|
@ -529,22 +529,6 @@ _elm_flipselector_efl_ui_spin_value_set(Eo *obj EINA_UNUSED, Elm_Flipselector_Da
|
|||
elm_flipselector_item_selected_set(it, EINA_TRUE);
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_flipselector_elm_widget_widget_event(Eo *obj EINA_UNUSED, Elm_Flipselector_Data *sd EINA_UNUSED, const Efl_Event *eo_event EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
|
||||
{
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
(void) src;
|
||||
|
||||
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
|
||||
|
||||
if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME, ev, key_actions))
|
||||
return EINA_FALSE;
|
||||
|
||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_signal_val_up(void *data)
|
||||
{
|
||||
|
@ -926,6 +910,10 @@ _elm_flipselector_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA
|
|||
return &atspi_actions[0];
|
||||
}
|
||||
|
||||
/* Standard widget overrides */
|
||||
|
||||
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_flipselector, Elm_Flipselector_Data)
|
||||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
#define ELM_FLIPSELECTOR_EXTRA_OPS \
|
||||
|
|
|
@ -3246,6 +3246,7 @@ _key_action_move(Evas_Object *obj, const char *params)
|
|||
Eina_Bool mirrored = efl_ui_mirrored_get(obj);
|
||||
Elm_Focus_Direction direction;
|
||||
|
||||
if (!sd->items) return EINA_FALSE;
|
||||
elm_interface_scrollable_content_pos_get(obj, &x, &y);
|
||||
elm_interface_scrollable_step_size_get(obj, &step_x, &step_y);
|
||||
elm_interface_scrollable_page_size_get(obj, &page_x, &page_y);
|
||||
|
@ -3358,6 +3359,8 @@ static Eina_Bool
|
|||
_key_action_select(Evas_Object *obj, const char *params)
|
||||
{
|
||||
ELM_GENGRID_DATA_GET(obj, sd);
|
||||
if (!sd->items) return EINA_FALSE;
|
||||
|
||||
Elm_Object_Item *eo_it = elm_object_focused_item_get(obj);
|
||||
if (!eo_it) return EINA_TRUE;
|
||||
ELM_GENGRID_ITEM_DATA_GET(eo_it, it);
|
||||
|
@ -3410,24 +3413,8 @@ _key_action_escape(Evas_Object *obj, const char *params EINA_UNUSED)
|
|||
{
|
||||
ELM_GENGRID_DATA_GET(obj, sd);
|
||||
|
||||
if (!_all_items_deselect(sd)) return EINA_FALSE;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_gengrid_elm_widget_widget_event(Eo *obj, Elm_Gengrid_Data *sd, const Efl_Event *eo_event EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
|
||||
{
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
(void) src;
|
||||
|
||||
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
|
||||
if (!sd->items) return EINA_FALSE;
|
||||
|
||||
if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME, ev, key_actions))
|
||||
return EINA_FALSE;
|
||||
|
||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||
if (!_all_items_deselect(sd)) return EINA_FALSE;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
|
@ -5730,6 +5717,10 @@ _elm_gengrid_elm_interface_atspi_selection_child_deselect(Eo *obj EINA_UNUSED, E
|
|||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
/* Standard widget overrides */
|
||||
|
||||
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_gengrid, Elm_Gengrid_Data)
|
||||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
#define ELM_GENGRID_EXTRA_OPS \
|
||||
|
|
|
@ -3012,6 +3012,7 @@ _key_action_move(Evas_Object *obj, const char *params)
|
|||
Elm_Object_Item *it = NULL;
|
||||
Evas_Coord pan_max_x = 0, pan_max_y = 0;
|
||||
|
||||
if (!sd->items) return EINA_FALSE;
|
||||
elm_interface_scrollable_content_pos_get(obj, &x, &y);
|
||||
elm_interface_scrollable_step_size_get(obj, &step_x, &step_y);
|
||||
elm_interface_scrollable_page_size_get(obj, &page_x, &page_y);
|
||||
|
@ -3131,11 +3132,13 @@ _key_action_select(Evas_Object *obj, const char *params)
|
|||
{
|
||||
Elm_Object_Item *eo_it = NULL;
|
||||
|
||||
ELM_GENLIST_DATA_GET(obj, sd);
|
||||
if (!sd->items) return EINA_FALSE;
|
||||
|
||||
eo_it = elm_object_focused_item_get(obj);
|
||||
if (!eo_it) return EINA_TRUE;
|
||||
elm_genlist_item_expanded_set(eo_it, !elm_genlist_item_expanded_get(eo_it));
|
||||
ELM_GENLIST_ITEM_DATA_GET(eo_it, it);
|
||||
ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
|
||||
|
||||
if (sd->multi &&
|
||||
((sd->multi_select_mode != ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL) ||
|
||||
|
@ -3193,23 +3196,6 @@ _key_action_escape(Evas_Object *obj, const char *params EINA_UNUSED)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_genlist_elm_widget_widget_event(Eo *obj, Elm_Genlist_Data *sd, const Efl_Event *eo_event EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
|
||||
{
|
||||
(void) src;
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
|
||||
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
|
||||
if (!sd->items) return EINA_FALSE;
|
||||
|
||||
if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME, ev, key_actions))
|
||||
return EINA_FALSE;
|
||||
|
||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_genlist_elm_widget_sub_object_add(Eo *obj, Elm_Genlist_Data *_pd EINA_UNUSED, Evas_Object *sobj)
|
||||
{
|
||||
|
@ -8708,6 +8694,10 @@ _elm_genlist_elm_interface_atspi_selection_child_deselect(Eo *obj EINA_UNUSED, E
|
|||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
/* Standard widget overrides */
|
||||
|
||||
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_genlist, Elm_Genlist_Data)
|
||||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
#define ELM_GENLIST_EXTRA_OPS \
|
||||
|
|
|
@ -473,6 +473,7 @@ static Eina_Bool _key_action_move(Evas_Object *obj, const char *params)
|
|||
Evas_Coord page_y = 0;
|
||||
Elm_Object_Item *it = NULL;
|
||||
|
||||
if (!sd->items) return EINA_FALSE;
|
||||
elm_interface_scrollable_content_pos_get(obj, &x, &y);
|
||||
elm_interface_scrollable_step_size_get(obj, &step_x, &step_y);
|
||||
elm_interface_scrollable_page_size_get(obj, &page_x, &page_y);
|
||||
|
@ -604,6 +605,7 @@ static Eina_Bool _key_action_select(Evas_Object *obj, const char *params EINA_UN
|
|||
ELM_LIST_DATA_GET(obj, sd);
|
||||
Elm_Object_Item *eo_it = NULL;
|
||||
|
||||
if (!sd->items) return EINA_FALSE;
|
||||
if (!_elm_config->item_select_on_focus_disable &&
|
||||
(!sd->multi) && (sd->selected))
|
||||
eo_it = elm_list_selected_item_get(obj);
|
||||
|
@ -624,24 +626,8 @@ static Eina_Bool _key_action_escape(Evas_Object *obj, const char *params EINA_UN
|
|||
{
|
||||
ELM_LIST_DATA_GET(obj, sd);
|
||||
|
||||
if (!_all_items_unselect(sd)) return EINA_FALSE;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_list_elm_widget_widget_event(Eo *obj, Elm_List_Data *sd, const Efl_Event *eo_event EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
|
||||
{
|
||||
(void) src;
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
|
||||
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
|
||||
if (!sd->items) return EINA_FALSE;
|
||||
|
||||
if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME, ev, key_actions))
|
||||
return EINA_FALSE;
|
||||
|
||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||
if (!_all_items_unselect(sd)) return EINA_FALSE;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
|
@ -3295,6 +3281,10 @@ _elm_list_elm_interface_atspi_selection_child_deselect(Eo *obj EINA_UNUSED, Elm_
|
|||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
/* Standard widget overrides */
|
||||
|
||||
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_list, Elm_List_Data)
|
||||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
#define ELM_LIST_EXTRA_OPS \
|
||||
|
|
|
@ -4068,22 +4068,6 @@ _key_action_zoom(Evas_Object *obj, const char *params)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_map_elm_widget_widget_event(Eo *obj, Elm_Map_Data *sd EINA_UNUSED, const Efl_Event *eo_event EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
|
||||
{
|
||||
(void) src;
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
|
||||
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
|
||||
|
||||
if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME, ev, key_actions))
|
||||
return EINA_FALSE;
|
||||
|
||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_map_efl_canvas_group_group_add(Eo *obj, Elm_Map_Data *priv)
|
||||
{
|
||||
|
@ -5632,6 +5616,10 @@ _elm_map_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UNUSED,
|
|||
return &atspi_actions[0];
|
||||
}
|
||||
|
||||
/* Standard widget overrides */
|
||||
|
||||
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_map, Elm_Map_Data)
|
||||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
#define ELM_MAP_EXTRA_OPS \
|
||||
|
|
|
@ -757,18 +757,14 @@ _key_action_toggle(Evas_Object *obj, const char *params EINA_UNUSED)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
// _panel_elm_widget_widget_event
|
||||
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(panel, Elm_Panel_Data)
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_panel_elm_widget_widget_event(Eo *obj, Elm_Panel_Data *_pd EINA_UNUSED, const Efl_Event *eo_event EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
|
||||
_elm_panel_elm_widget_widget_event(Eo *obj, Elm_Panel_Data *pd, const Efl_Event *eo_event, Evas_Object *src, Evas_Callback_Type type, void *event_info)
|
||||
{
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
|
||||
if (src != obj) return EINA_FALSE;
|
||||
|
||||
if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME, ev, key_actions)) return EINA_FALSE;
|
||||
|
||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||
return EINA_TRUE;
|
||||
return _panel_elm_widget_widget_event(obj, pd, eo_event, src, type, event_info);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
|
|
|
@ -641,6 +641,20 @@ const Elm_Layout_Part_Alias_Description *elm_layout_text_aliases_get(const Eo *o
|
|||
#define ELM_LAYOUT_SIZING_EVAL_OPS(_pfx) \
|
||||
EFL_OBJECT_OP_FUNC(elm_layout_sizing_eval, _##_pfx##_elm_layout_sizing_eval)
|
||||
|
||||
#define ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(_pfx, _typ) \
|
||||
EOLIAN static Eina_Bool \
|
||||
_##_pfx##_elm_widget_widget_event(Eo *obj, _typ *_pd EINA_UNUSED, const Efl_Event *eo_event, Evas_Object *src EINA_UNUSED, Evas_Callback_Type type EINA_UNUSED, void *event_info EINA_UNUSED) \
|
||||
{ \
|
||||
Evas_Event_Key_Down *ev; \
|
||||
if (eo_event->desc != EFL_EVENT_KEY_DOWN) return EINA_FALSE; \
|
||||
if (efl_input_processed_get(eo_event->info)) return EINA_FALSE; \
|
||||
if (elm_widget_disabled_get(obj)) return EINA_FALSE; \
|
||||
ev = efl_input_legacy_info_get(eo_event->info); \
|
||||
if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME, ev, key_actions)) return EINA_FALSE; \
|
||||
efl_input_processed_set(eo_event->info, EINA_TRUE); \
|
||||
return EINA_TRUE; \
|
||||
}
|
||||
|
||||
static inline Eina_Bool
|
||||
efl_ui_dir_is_horizontal(Efl_Ui_Dir dir, Eina_Bool def_val)
|
||||
{
|
||||
|
|
|
@ -261,22 +261,6 @@ _key_action_move(Evas_Object *obj, const char *params)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_scroller_elm_widget_widget_event(Eo *obj, Elm_Scroller_Data *sd EINA_UNUSED, const Efl_Event *eo_event EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
|
||||
{
|
||||
(void) src;
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
|
||||
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
|
||||
|
||||
if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME, ev, key_actions))
|
||||
return EINA_FALSE;
|
||||
|
||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_scroller_elm_widget_activate(Eo *obj, Elm_Scroller_Data *_pd EINA_UNUSED, Elm_Activate act)
|
||||
{
|
||||
|
@ -1477,6 +1461,10 @@ _elm_scroller_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UNU
|
|||
return &atspi_actions[0];
|
||||
}
|
||||
|
||||
/* Standard widget overrides */
|
||||
|
||||
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_scroller, Elm_Scroller_Data)
|
||||
|
||||
/* Efl.Part begin */
|
||||
|
||||
ELM_PART_OVERRIDE(elm_scroller, ELM_SCROLLER, EFL_UI_LAYOUT, Elm_Scroller_Data, Elm_Part_Data)
|
||||
|
|
|
@ -74,22 +74,6 @@ _key_action_pause(Evas_Object *obj, const char *params EINA_UNUSED)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_slideshow_elm_widget_widget_event(Eo *obj, Elm_Slideshow_Data *sd EINA_UNUSED, const Efl_Event *eo_event EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
|
||||
{
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
(void) src;
|
||||
|
||||
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
|
||||
|
||||
if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME, ev, key_actions))
|
||||
return EINA_FALSE;
|
||||
|
||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_slideshow_elm_layout_sizing_eval(Eo *obj, Elm_Slideshow_Data *_pd EINA_UNUSED)
|
||||
{
|
||||
|
@ -734,6 +718,10 @@ _elm_slideshow_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UN
|
|||
return &atspi_actions[0];
|
||||
}
|
||||
|
||||
/* Standard widget overrides */
|
||||
|
||||
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_slideshow, Elm_Slideshow_Data)
|
||||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
#define ELM_SLIDESHOW_EXTRA_OPS \
|
||||
|
|
|
@ -895,6 +895,7 @@ _key_action_select(Evas_Object *obj, const char *params EINA_UNUSED)
|
|||
{
|
||||
ELM_TOOLBAR_DATA_GET(obj, sd);
|
||||
|
||||
if (!sd->items) return EINA_FALSE;
|
||||
if (sd->focused_item)
|
||||
{
|
||||
ELM_TOOLBAR_ITEM_DATA_GET(sd->focused_item, focus_it);
|
||||
|
@ -904,24 +905,6 @@ _key_action_select(Evas_Object *obj, const char *params EINA_UNUSED)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_toolbar_elm_widget_widget_event(Eo *obj, Elm_Toolbar_Data *sd, const Efl_Event *eo_event EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
|
||||
{
|
||||
(void) src;
|
||||
(void) type;
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
|
||||
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
|
||||
if (!sd->items) return EINA_FALSE;
|
||||
|
||||
if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME, ev, key_actions))
|
||||
return EINA_FALSE;
|
||||
|
||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
_resizing_eval(Evas_Object *obj)
|
||||
{
|
||||
|
@ -4186,6 +4169,10 @@ elm_toolbar_icon_order_lookup_get(const Evas_Object *obj EINA_UNUSED)
|
|||
return ELM_ICON_LOOKUP_FDO_THEME;
|
||||
}
|
||||
|
||||
/* Standard widget overrides */
|
||||
|
||||
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_toolbar, Elm_Toolbar_Data)
|
||||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
#define ELM_TOOLBAR_EXTRA_OPS \
|
||||
|
|
Loading…
Reference in New Issue