summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elc_ctxpopup.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/elc_ctxpopup.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 'src/lib/elementary/elc_ctxpopup.c')
-rw-r--r--src/lib/elementary/elc_ctxpopup.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/lib/elementary/elc_ctxpopup.c b/src/lib/elementary/elc_ctxpopup.c
index 1de6d08..1c85606 100644
--- a/src/lib/elementary/elc_ctxpopup.c
+++ b/src/lib/elementary/elc_ctxpopup.c
@@ -145,22 +145,6 @@ _key_action_escape(Evas_Object *obj, const char *params EINA_UNUSED)
145 return EINA_TRUE; 145 return EINA_TRUE;
146} 146}
147 147
148EOLIAN static Eina_Bool
149_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)
150{
151 Evas_Event_Key_Down *ev = event_info;
152 (void)src;
153
154 if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
155 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
156
157 if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME, ev, key_actions))
158 return EINA_FALSE;
159
160 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
161 return EINA_TRUE;
162}
163
164static void 148static void
165_x_pos_adjust(Evas_Coord_Point *pos, 149_x_pos_adjust(Evas_Coord_Point *pos,
166 Evas_Coord_Point *base_size, 150 Evas_Coord_Point *base_size,
@@ -1649,6 +1633,10 @@ _elm_ctxpopup_elm_interface_atspi_accessible_state_set_get(Eo *obj, Elm_Ctxpopup
1649 return ret; 1633 return ret;
1650} 1634}
1651 1635
1636/* Internal EO APIs and hidden overrides */
1637
1638ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_ctxpopup, Elm_Ctxpopup_Data)
1639
1652/* Efl.Part begin */ 1640/* Efl.Part begin */
1653 1641
1654ELM_PART_OVERRIDE(elm_ctxpopup, ELM_CTXPOPUP, EFL_UI_LAYOUT, Elm_Ctxpopup_Data, Elm_Part_Data) 1642ELM_PART_OVERRIDE(elm_ctxpopup, ELM_CTXPOPUP, EFL_UI_LAYOUT, Elm_Ctxpopup_Data, Elm_Part_Data)