forked from enlightenment/enlightenment
add edge binding event find function
similar to key/mouse/wheel functions
This commit is contained in:
parent
6e3b9763b0
commit
93b106f17e
|
@ -868,6 +868,31 @@ e_bindings_edge_del(E_Binding_Context ctxt, E_Zone_Edge edge, Eina_Bool drag_onl
|
|||
e_zone_edge_free(edge);
|
||||
}
|
||||
|
||||
E_API E_Action *
|
||||
e_bindings_edge_event_find(E_Binding_Context ctxt, E_Event_Zone_Edge *ev, Eina_Bool click, E_Binding_Edge **bind_ret)
|
||||
{
|
||||
E_Binding_Edge *binding;
|
||||
E_Binding_Modifier mod = 0;
|
||||
E_Action *act = NULL;
|
||||
Eina_List *l;
|
||||
|
||||
mod = _e_bindings_modifiers(ev->modifiers);
|
||||
EINA_LIST_FOREACH(edge_bindings, l, binding)
|
||||
/* A value of <= -1.0 for the delay indicates it as a mouse-click binding on that edge */
|
||||
if (((binding->edge == ev->edge)) &&
|
||||
((click && (binding->delay == -1.0 * click)) || (!click && (binding->delay >= 0.0))) &&
|
||||
((binding->drag_only == ev->drag) || ev->drag) &&
|
||||
((binding->any_mod) || (binding->mod == mod)))
|
||||
{
|
||||
if (!_e_bindings_context_match(binding->ctxt, ctxt)) continue;
|
||||
act = e_action_find(binding->action);
|
||||
if (!act) continue;
|
||||
if (bind_ret) *bind_ret = binding;
|
||||
break;
|
||||
}
|
||||
return act;
|
||||
}
|
||||
|
||||
E_API E_Action *
|
||||
e_bindings_edge_in_event_handle(E_Binding_Context ctxt, E_Object *obj, E_Event_Zone_Edge *ev)
|
||||
{
|
||||
|
|
|
@ -168,6 +168,7 @@ E_API Eina_Bool e_bindings_key_allowed(const char *key);
|
|||
E_API void e_bindings_edge_add(E_Binding_Context ctxt, E_Zone_Edge edge, Eina_Bool drag_only, E_Binding_Modifier mod, int any_mod, const char *action, const char *params, float delay);
|
||||
E_API Eina_Bool e_bindings_edge_flippable_get(E_Zone_Edge edge);
|
||||
E_API Eina_Bool e_bindings_edge_non_flippable_get(E_Zone_Edge edge);
|
||||
E_API E_Action *e_bindings_edge_event_find(E_Binding_Context ctxt, E_Event_Zone_Edge *ev, Eina_Bool click, E_Binding_Edge **bind_ret);
|
||||
E_API E_Binding_Edge *e_bindings_edge_get(const char *action, E_Zone_Edge edge, int click);
|
||||
E_API void e_bindings_edge_del(E_Binding_Context ctxt, E_Zone_Edge edge, Eina_Bool drag_only, E_Binding_Modifier mod, int any_mod, const char *action, const char *params, float delay);
|
||||
E_API E_Action *e_bindings_edge_in_event_handle(E_Binding_Context ctxt, E_Object *obj, E_Event_Zone_Edge *ev);
|
||||
|
|
Loading…
Reference in New Issue