summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_ui_win.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-08-17 15:08:00 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-08-23 11:16:45 +0900
commit20a5968c12024cfecc65d38c32e3230f5ee801a7 (patch)
tree595539adb65ef650221a9031fb24d987f778e543 /src/lib/elementary/efl_ui_win.c
parent069747b9def73436fc253729f1203038754e7fbd (diff)
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.
Diffstat (limited to '')
-rw-r--r--src/lib/elementary/efl_ui_win.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 7b5c4d1cd7..f11af9c0a3 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -1766,21 +1766,6 @@ _key_action_move(Evas_Object *obj, const char *params)
1766 return EINA_TRUE; 1766 return EINA_TRUE;
1767} 1767}
1768 1768
1769EOLIAN static Eina_Bool
1770_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)
1771{
1772 Evas_Event_Key_Down *ev = event_info;
1773
1774 if (elm_widget_disabled_get(obj)) return EINA_FALSE;
1775 if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
1776
1777 if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME_LEGACY, ev, key_actions))
1778 return EINA_FALSE;
1779
1780 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
1781 return EINA_TRUE;
1782}
1783
1784/* forward events sent to evas to the window */ 1769/* forward events sent to evas to the window */
1785static void 1770static void
1786_evas_event_key_cb(void *data, const Efl_Event *ev) 1771_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
8210 8195
8211/* Internal EO APIs and hidden overrides */ 8196/* Internal EO APIs and hidden overrides */
8212 8197
8198ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_win, Efl_Ui_Win_Data)
8199
8200/* Internal EO APIs and hidden overrides */
8201
8213#define EFL_UI_WIN_EXTRA_OPS \ 8202#define EFL_UI_WIN_EXTRA_OPS \
8214 EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_win), \ 8203 EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_win), \
8215 ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_win), \ 8204 ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_win), \