|
|
|
@ -38,66 +38,48 @@ struct _E_Binding_Edge_Data |
|
|
|
|
EAPI int |
|
|
|
|
e_bindings_init(void) |
|
|
|
|
{ |
|
|
|
|
E_Config_Binding_Signal *ebs; |
|
|
|
|
E_Config_Binding_Mouse *ebm; |
|
|
|
|
E_Config_Binding_Wheel *ebw; |
|
|
|
|
E_Config_Binding_Edge *ebe; |
|
|
|
|
E_Config_Binding_Key *ebk; |
|
|
|
|
Eina_List *l; |
|
|
|
|
|
|
|
|
|
for (l = e_config->mouse_bindings; l; l = l->next) |
|
|
|
|
{ |
|
|
|
|
E_Config_Binding_Mouse *eb; |
|
|
|
|
EINA_LIST_FOREACH(e_config->mouse_bindings, l, ebm) |
|
|
|
|
e_bindings_mouse_add(ebm->context, ebm->button, ebm->modifiers, |
|
|
|
|
ebm->any_mod, ebm->action, ebm->params); |
|
|
|
|
|
|
|
|
|
eb = l->data; |
|
|
|
|
e_bindings_mouse_add(eb->context, eb->button, eb->modifiers, |
|
|
|
|
eb->any_mod, eb->action, eb->params); |
|
|
|
|
} |
|
|
|
|
EINA_LIST_FOREACH(e_config->key_bindings, l, ebk) |
|
|
|
|
e_bindings_key_add(ebk->context, ebk->key, ebk->modifiers, |
|
|
|
|
ebk->any_mod, ebk->action, ebk->params); |
|
|
|
|
|
|
|
|
|
for (l = e_config->key_bindings; l; l = l->next) |
|
|
|
|
{ |
|
|
|
|
E_Config_Binding_Key *eb; |
|
|
|
|
EINA_LIST_FOREACH(e_config->edge_bindings, l, ebe) |
|
|
|
|
e_bindings_edge_add(ebe->context, ebe->edge, ebe->modifiers, |
|
|
|
|
ebe->any_mod, ebe->action, ebe->params, ebe->delay); |
|
|
|
|
|
|
|
|
|
eb = l->data; |
|
|
|
|
e_bindings_key_add(eb->context, eb->key, eb->modifiers, |
|
|
|
|
eb->any_mod, eb->action, eb->params); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (l = e_config->edge_bindings; l; l = l->next) |
|
|
|
|
EINA_LIST_FOREACH(e_config->signal_bindings, l, ebs) |
|
|
|
|
{ |
|
|
|
|
E_Config_Binding_Edge *eb; |
|
|
|
|
|
|
|
|
|
eb = l->data; |
|
|
|
|
e_bindings_edge_add(eb->context, eb->edge, eb->modifiers, |
|
|
|
|
eb->any_mod, eb->action, eb->params, eb->delay); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (l = e_config->signal_bindings; l; l = l->next) |
|
|
|
|
{ |
|
|
|
|
E_Config_Binding_Signal *eb; |
|
|
|
|
|
|
|
|
|
eb = l->data; |
|
|
|
|
e_bindings_signal_add(eb->context, eb->signal, eb->source, eb->modifiers, |
|
|
|
|
eb->any_mod, eb->action, eb->params); |
|
|
|
|
e_bindings_signal_add(ebs->context, ebs->signal, ebs->source, ebs->modifiers, |
|
|
|
|
ebs->any_mod, ebs->action, ebs->params); |
|
|
|
|
/* FIXME: Can this be solved in a generic way? */ |
|
|
|
|
/* FIXME: Only change cursor if action is allowed! */ |
|
|
|
|
if ((eb->action) && (eb->signal) && (eb->source) && |
|
|
|
|
(!strcmp(eb->action, "window_resize")) && |
|
|
|
|
(!strncmp(eb->signal, "mouse,down,", 11)) && |
|
|
|
|
(!strncmp(eb->source, "e.event.resize.", 15))) |
|
|
|
|
if ((ebs->action) && (ebs->signal) && (ebs->source) && |
|
|
|
|
(!strcmp(ebs->action, "window_resize")) && |
|
|
|
|
(!strncmp(ebs->signal, "mouse,down,", 11)) && |
|
|
|
|
(!strncmp(ebs->source, "e.event.resize.", 15))) |
|
|
|
|
{ |
|
|
|
|
char params[32]; |
|
|
|
|
snprintf(params, sizeof(params), "resize_%s", eb->params); |
|
|
|
|
e_bindings_signal_add(eb->context, "mouse,in", eb->source, eb->modifiers, |
|
|
|
|
eb->any_mod, "pointer_resize_push", params); |
|
|
|
|
e_bindings_signal_add(eb->context, "mouse,out", eb->source, eb->modifiers, |
|
|
|
|
eb->any_mod, "pointer_resize_pop", params); |
|
|
|
|
snprintf(params, sizeof(params), "resize_%s", ebs->params); |
|
|
|
|
e_bindings_signal_add(ebs->context, "mouse,in", ebs->source, ebs->modifiers, |
|
|
|
|
ebs->any_mod, "pointer_resize_push", params); |
|
|
|
|
e_bindings_signal_add(ebs->context, "mouse,out", ebs->source, ebs->modifiers, |
|
|
|
|
ebs->any_mod, "pointer_resize_pop", params); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (l = e_config->wheel_bindings; l; l = l->next) |
|
|
|
|
{ |
|
|
|
|
E_Config_Binding_Wheel *eb; |
|
|
|
|
|
|
|
|
|
eb = l->data; |
|
|
|
|
e_bindings_wheel_add(eb->context, eb->direction, eb->z, eb->modifiers, |
|
|
|
|
eb->any_mod, eb->action, eb->params); |
|
|
|
|
} |
|
|
|
|
EINA_LIST_FOREACH(e_config->wheel_bindings, l, ebw) |
|
|
|
|
e_bindings_wheel_add(ebw->context, ebw->direction, ebw->z, ebw->modifiers, |
|
|
|
|
ebw->any_mod, ebw->action, ebw->params); |
|
|
|
|
|
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
@ -105,46 +87,27 @@ e_bindings_init(void) |
|
|
|
|
EAPI int |
|
|
|
|
e_bindings_shutdown(void) |
|
|
|
|
{ |
|
|
|
|
while (mouse_bindings) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Mouse *bind; |
|
|
|
|
|
|
|
|
|
bind = mouse_bindings->data; |
|
|
|
|
mouse_bindings = eina_list_remove_list(mouse_bindings, mouse_bindings); |
|
|
|
|
_e_bindings_mouse_free(bind); |
|
|
|
|
} |
|
|
|
|
while (key_bindings) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Key *bind; |
|
|
|
|
|
|
|
|
|
bind = key_bindings->data; |
|
|
|
|
key_bindings = eina_list_remove_list(key_bindings, key_bindings); |
|
|
|
|
_e_bindings_key_free(bind); |
|
|
|
|
} |
|
|
|
|
while (edge_bindings) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Edge *bind; |
|
|
|
|
|
|
|
|
|
bind = edge_bindings->data; |
|
|
|
|
edge_bindings = eina_list_remove_list(edge_bindings, edge_bindings); |
|
|
|
|
_e_bindings_edge_free(bind); |
|
|
|
|
} |
|
|
|
|
while (signal_bindings) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Signal *bind; |
|
|
|
|
|
|
|
|
|
bind = signal_bindings->data; |
|
|
|
|
signal_bindings = eina_list_remove_list(signal_bindings, signal_bindings); |
|
|
|
|
_e_bindings_signal_free(bind); |
|
|
|
|
} |
|
|
|
|
while (wheel_bindings) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Wheel *bind; |
|
|
|
|
|
|
|
|
|
bind = wheel_bindings->data; |
|
|
|
|
wheel_bindings = eina_list_remove_list(wheel_bindings, wheel_bindings); |
|
|
|
|
_e_bindings_wheel_free(bind); |
|
|
|
|
} |
|
|
|
|
E_Binding_Signal *binds; |
|
|
|
|
E_Binding_Mouse *bindm; |
|
|
|
|
E_Binding_Wheel *bindw; |
|
|
|
|
E_Binding_Edge *binde; |
|
|
|
|
E_Binding_Key *bindk; |
|
|
|
|
|
|
|
|
|
EINA_LIST_FREE(mouse_bindings, bindm) |
|
|
|
|
_e_bindings_mouse_free(bindm); |
|
|
|
|
|
|
|
|
|
EINA_LIST_FREE(key_bindings, bindk) |
|
|
|
|
_e_bindings_key_free(bindk); |
|
|
|
|
|
|
|
|
|
EINA_LIST_FREE(edge_bindings, binde) |
|
|
|
|
_e_bindings_edge_free(binde); |
|
|
|
|
|
|
|
|
|
EINA_LIST_FREE(signal_bindings, binds) |
|
|
|
|
_e_bindings_signal_free(binds); |
|
|
|
|
|
|
|
|
|
EINA_LIST_FREE(wheel_bindings, bindw) |
|
|
|
|
_e_bindings_wheel_free(bindw); |
|
|
|
|
|
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -152,7 +115,7 @@ EAPI void |
|
|
|
|
e_bindings_mouse_add(E_Binding_Context ctxt, int button, E_Binding_Modifier mod, int any_mod, const char *action, const char *params) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Mouse *bind; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bind = calloc(1, sizeof(E_Binding_Mouse)); |
|
|
|
|
bind->ctxt = ctxt; |
|
|
|
|
bind->button = button; |
|
|
|
@ -166,13 +129,11 @@ e_bindings_mouse_add(E_Binding_Context ctxt, int button, E_Binding_Modifier mod, |
|
|
|
|
EAPI void |
|
|
|
|
e_bindings_mouse_del(E_Binding_Context ctxt, int button, E_Binding_Modifier mod, int any_mod, const char *action, const char *params) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Mouse *bind; |
|
|
|
|
Eina_List *l; |
|
|
|
|
|
|
|
|
|
for (l = mouse_bindings; l; l = l->next) |
|
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(mouse_bindings, l, bind) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Mouse *bind; |
|
|
|
|
|
|
|
|
|
bind = l->data; |
|
|
|
|
if ((bind->ctxt == ctxt) && |
|
|
|
|
(bind->button == button) && |
|
|
|
|
(bind->mod == mod) && |
|
|
|
@ -192,13 +153,11 @@ e_bindings_mouse_del(E_Binding_Context ctxt, int button, E_Binding_Modifier mod, |
|
|
|
|
EAPI void |
|
|
|
|
e_bindings_mouse_grab(E_Binding_Context ctxt, Ecore_X_Window win) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Mouse *bind; |
|
|
|
|
Eina_List *l; |
|
|
|
|
|
|
|
|
|
for (l = mouse_bindings; l; l = l->next) |
|
|
|
|
EINA_LIST_FOREACH(mouse_bindings, l, bind) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Mouse *bind; |
|
|
|
|
|
|
|
|
|
bind = l->data; |
|
|
|
|
if (_e_bindings_context_match(bind->ctxt, ctxt)) |
|
|
|
|
{ |
|
|
|
|
ecore_x_window_button_grab(win, bind->button, |
|
|
|
@ -214,13 +173,11 @@ e_bindings_mouse_grab(E_Binding_Context ctxt, Ecore_X_Window win) |
|
|
|
|
EAPI void |
|
|
|
|
e_bindings_mouse_ungrab(E_Binding_Context ctxt, Ecore_X_Window win) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Mouse *bind; |
|
|
|
|
Eina_List *l; |
|
|
|
|
|
|
|
|
|
for (l = mouse_bindings; l; l = l->next) |
|
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(mouse_bindings, l, bind) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Mouse *bind; |
|
|
|
|
|
|
|
|
|
bind = l->data; |
|
|
|
|
if (_e_bindings_context_match(bind->ctxt, ctxt)) |
|
|
|
|
{ |
|
|
|
|
ecore_x_window_button_ungrab(win, bind->button, |
|
|
|
@ -233,21 +190,19 @@ EAPI E_Action * |
|
|
|
|
e_bindings_mouse_down_find(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Mouse_Button *ev, E_Binding_Mouse **bind_ret) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Modifier mod = 0; |
|
|
|
|
E_Binding_Mouse *bind; |
|
|
|
|
Eina_List *l; |
|
|
|
|
|
|
|
|
|
mod = _e_bindings_modifiers(ev->modifiers); |
|
|
|
|
for (l = mouse_bindings; l; l = l->next) |
|
|
|
|
EINA_LIST_FOREACH(mouse_bindings, l, bind) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Mouse *bind; |
|
|
|
|
|
|
|
|
|
bind = l->data; |
|
|
|
|
if ((bind->button == ev->buttons) && |
|
|
|
|
((bind->any_mod) || (bind->mod == mod))) |
|
|
|
|
{ |
|
|
|
|
if (_e_bindings_context_match(bind->ctxt, ctxt)) |
|
|
|
|
{ |
|
|
|
|
E_Action *act; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
act = e_action_find(bind->action); |
|
|
|
|
if (bind_ret) *bind_ret = bind; |
|
|
|
|
return act; |
|
|
|
@ -279,14 +234,12 @@ EAPI E_Action * |
|
|
|
|
e_bindings_mouse_up_find(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Mouse_Button *ev, E_Binding_Mouse **bind_ret) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Modifier mod = 0; |
|
|
|
|
E_Binding_Mouse *bind; |
|
|
|
|
Eina_List *l; |
|
|
|
|
|
|
|
|
|
mod = _e_bindings_modifiers(ev->modifiers); |
|
|
|
|
for (l = mouse_bindings; l; l = l->next) |
|
|
|
|
EINA_LIST_FOREACH(mouse_bindings, l, bind) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Mouse *bind; |
|
|
|
|
|
|
|
|
|
bind = l->data; |
|
|
|
|
if ((bind->button == ev->buttons) && |
|
|
|
|
((bind->any_mod) || (bind->mod == mod))) |
|
|
|
|
{ |
|
|
|
@ -339,13 +292,11 @@ e_bindings_key_add(E_Binding_Context ctxt, const char *key, E_Binding_Modifier m |
|
|
|
|
EAPI E_Binding_Key * |
|
|
|
|
e_bindings_key_get(const char *action) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Key *bind; |
|
|
|
|
Eina_List *l; |
|
|
|
|
|
|
|
|
|
for (l = key_bindings; l; l = l->next) |
|
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(key_bindings, l, bind) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Key *bind; |
|
|
|
|
|
|
|
|
|
bind = l->data; |
|
|
|
|
if (bind->action && action && !strcmp(action, bind->action)) |
|
|
|
|
return bind; |
|
|
|
|
} |
|
|
|
@ -355,13 +306,11 @@ e_bindings_key_get(const char *action) |
|
|
|
|
EAPI void |
|
|
|
|
e_bindings_key_del(E_Binding_Context ctxt, const char *key, E_Binding_Modifier mod, int any_mod, const char *action, const char *params) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Key *bind; |
|
|
|
|
Eina_List *l; |
|
|
|
|
|
|
|
|
|
for (l = key_bindings; l; l = l->next) |
|
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(key_bindings, l, bind) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Key *bind; |
|
|
|
|
|
|
|
|
|
bind = l->data; |
|
|
|
|
if ((bind->ctxt == ctxt) && |
|
|
|
|
(key) && (bind->key) && (!strcmp(bind->key, key)) && |
|
|
|
|
(bind->mod == mod) && |
|
|
|
@ -381,13 +330,11 @@ e_bindings_key_del(E_Binding_Context ctxt, const char *key, E_Binding_Modifier m |
|
|
|
|
EAPI void |
|
|
|
|
e_bindings_key_grab(E_Binding_Context ctxt, Ecore_X_Window win) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Key *bind; |
|
|
|
|
Eina_List *l; |
|
|
|
|
|
|
|
|
|
for (l = key_bindings; l; l = l->next) |
|
|
|
|
EINA_LIST_FOREACH(key_bindings, l, bind) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Key *bind; |
|
|
|
|
|
|
|
|
|
bind = l->data; |
|
|
|
|
if (_e_bindings_context_match(bind->ctxt, ctxt)) |
|
|
|
|
{ |
|
|
|
|
ecore_x_window_key_grab(win, bind->key, |
|
|
|
@ -399,13 +346,11 @@ e_bindings_key_grab(E_Binding_Context ctxt, Ecore_X_Window win) |
|
|
|
|
EAPI void |
|
|
|
|
e_bindings_key_ungrab(E_Binding_Context ctxt, Ecore_X_Window win) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Key *bind; |
|
|
|
|
Eina_List *l; |
|
|
|
|
|
|
|
|
|
for (l = key_bindings; l; l = l->next) |
|
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(key_bindings, l, bind) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Key *bind; |
|
|
|
|
|
|
|
|
|
bind = l->data; |
|
|
|
|
if (_e_bindings_context_match(bind->ctxt, ctxt)) |
|
|
|
|
{ |
|
|
|
|
ecore_x_window_key_ungrab(win, bind->key, |
|
|
|
@ -418,14 +363,12 @@ EAPI E_Action * |
|
|
|
|
e_bindings_key_down_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Key *ev) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Modifier mod = 0; |
|
|
|
|
E_Binding_Key *bind; |
|
|
|
|
Eina_List *l; |
|
|
|
|
|
|
|
|
|
mod = _e_bindings_modifiers(ev->modifiers); |
|
|
|
|
for (l = key_bindings; l; l = l->next) |
|
|
|
|
EINA_LIST_FOREACH(key_bindings, l, bind) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Key *bind; |
|
|
|
|
|
|
|
|
|
bind = l->data; |
|
|
|
|
if ((bind->key) && (!strcmp(bind->key, ev->keyname)) && |
|
|
|
|
((bind->any_mod) || (bind->mod == mod))) |
|
|
|
|
{ |
|
|
|
@ -453,14 +396,12 @@ EAPI E_Action * |
|
|
|
|
e_bindings_key_up_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Key *ev) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Modifier mod = 0; |
|
|
|
|
E_Binding_Key *bind; |
|
|
|
|
Eina_List *l; |
|
|
|
|
|
|
|
|
|
mod = _e_bindings_modifiers(ev->modifiers); |
|
|
|
|
for (l = key_bindings; l; l = l->next) |
|
|
|
|
EINA_LIST_FOREACH(key_bindings, l, bind) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Key *bind; |
|
|
|
|
|
|
|
|
|
bind = l->data; |
|
|
|
|
if ((bind->key) && (!strcmp(bind->key, ev->keyname)) && |
|
|
|
|
((bind->any_mod) || (bind->mod == mod))) |
|
|
|
|
{ |
|
|
|
@ -503,13 +444,11 @@ e_bindings_edge_add(E_Binding_Context ctxt, E_Zone_Edge edge, E_Binding_Modifier |
|
|
|
|
EAPI E_Binding_Edge * |
|
|
|
|
e_bindings_edge_get(const char *action, E_Zone_Edge edge) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Edge *bind; |
|
|
|
|
Eina_List *l; |
|
|
|
|
|
|
|
|
|
for (l = edge_bindings; l; l = l->next) |
|
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(edge_bindings, l, bind) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Edge *bind; |
|
|
|
|
|
|
|
|
|
bind = l->data; |
|
|
|
|
if ((bind->edge == edge) && bind->action && |
|
|
|
|
action && !strcmp(action, bind->action)) |
|
|
|
|
return bind; |
|
|
|
@ -520,13 +459,11 @@ e_bindings_edge_get(const char *action, E_Zone_Edge edge) |
|
|
|
|
EAPI void |
|
|
|
|
e_bindings_edge_del(E_Binding_Context ctxt, E_Zone_Edge edge, E_Binding_Modifier mod, int any_mod, const char *action, const char *params, float delay) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Edge *bind; |
|
|
|
|
Eina_List *l; |
|
|
|
|
|
|
|
|
|
for (l = edge_bindings; l; l = l->next) |
|
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(edge_bindings, l, bind) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Edge *bind; |
|
|
|
|
|
|
|
|
|
bind = l->data; |
|
|
|
|
if ((bind->ctxt == ctxt) && |
|
|
|
|
(bind->edge == edge) && |
|
|
|
|
(bind->mod == mod) && |
|
|
|
@ -548,6 +485,7 @@ EAPI E_Action * |
|
|
|
|
e_bindings_edge_in_event_handle(E_Binding_Context ctxt, E_Object *obj, E_Event_Zone_Edge *ev) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Modifier mod = 0; |
|
|
|
|
E_Binding_Edge *bind; |
|
|
|
|
E_Desk *current = NULL; |
|
|
|
|
E_Action *act = NULL; |
|
|
|
|
Eina_List *l; |
|
|
|
@ -559,11 +497,8 @@ e_bindings_edge_in_event_handle(E_Binding_Context ctxt, E_Object *obj, E_Event_Z |
|
|
|
|
if (ev->modifiers & ECORE_X_MODIFIER_CTRL) mod |= E_BINDING_MODIFIER_CTRL; |
|
|
|
|
if (ev->modifiers & ECORE_X_MODIFIER_ALT) mod |= E_BINDING_MODIFIER_ALT; |
|
|
|
|
if (ev->modifiers & ECORE_X_MODIFIER_WIN) mod |= E_BINDING_MODIFIER_WIN; |
|
|
|
|
for (l = edge_bindings; l; l = l->next) |
|
|
|
|
EINA_LIST_FOREACH(edge_bindings, l, bind) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Edge *bind; |
|
|
|
|
|
|
|
|
|
bind = l->data; |
|
|
|
|
if (((bind->edge == ev->edge)) && |
|
|
|
|
((bind->any_mod) || (bind->mod == mod))) |
|
|
|
|
{ |
|
|
|
@ -598,18 +533,16 @@ EAPI E_Action * |
|
|
|
|
e_bindings_edge_out_event_handle(E_Binding_Context ctxt, E_Object *obj, E_Event_Zone_Edge *ev) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Modifier mod = 0; |
|
|
|
|
E_Binding_Edge *bind; |
|
|
|
|
E_Action *act = NULL; |
|
|
|
|
Eina_List *l; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ev->modifiers & ECORE_X_MODIFIER_SHIFT) mod |= E_BINDING_MODIFIER_SHIFT; |
|
|
|
|
if (ev->modifiers & ECORE_X_MODIFIER_CTRL) mod |= E_BINDING_MODIFIER_CTRL; |
|
|
|
|
if (ev->modifiers & ECORE_X_MODIFIER_ALT) mod |= E_BINDING_MODIFIER_ALT; |
|
|
|
|
if (ev->modifiers & ECORE_X_MODIFIER_WIN) mod |= E_BINDING_MODIFIER_WIN; |
|
|
|
|
for (l = edge_bindings; l; l = l->next) |
|
|
|
|
EINA_LIST_FOREACH(edge_bindings, l, bind) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Edge *bind; |
|
|
|
|
|
|
|
|
|
bind = l->data; |
|
|
|
|
if ((bind->edge == ev->edge) && |
|
|
|
|
((bind->any_mod) || (bind->mod == mod))) |
|
|
|
|
{ |
|
|
|
@ -647,13 +580,11 @@ e_bindings_signal_add(E_Binding_Context ctxt, const char *sig, const char *src, |
|
|
|
|
EAPI void |
|
|
|
|
e_bindings_signal_del(E_Binding_Context ctxt, const char *sig, const char *src, E_Binding_Modifier mod, int any_mod, const char *action, const char *params) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Signal *bind; |
|
|
|
|
Eina_List *l; |
|
|
|
|
|
|
|
|
|
for (l = signal_bindings; l; l = l->next) |
|
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(signal_bindings, l, bind) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Signal *bind; |
|
|
|
|
|
|
|
|
|
bind = l->data; |
|
|
|
|
if ((bind->ctxt == ctxt) && |
|
|
|
|
(((bind->sig) && (sig) && (!strcmp(bind->sig, sig))) || |
|
|
|
|
((!bind->sig) && (!sig))) && |
|
|
|
@ -677,17 +608,15 @@ EAPI E_Action * |
|
|
|
|
e_bindings_signal_find(E_Binding_Context ctxt, E_Object *obj, const char *sig, const char *src, E_Binding_Signal **bind_ret) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Modifier mod = 0; |
|
|
|
|
E_Binding_Signal *bind; |
|
|
|
|
Eina_List *l; |
|
|
|
|
|
|
|
|
|
if (strstr(sig, "MOD:Shift")) mod |= E_BINDING_MODIFIER_SHIFT; |
|
|
|
|
if (strstr(sig, "MOD:Control")) mod |= E_BINDING_MODIFIER_CTRL; |
|
|
|
|
if (strstr(sig, "MOD:Alt")) mod |= E_BINDING_MODIFIER_ALT; |
|
|
|
|
if (strstr(sig, "MOD:Super")) mod |= E_BINDING_MODIFIER_WIN; |
|
|
|
|
for (l = signal_bindings; l; l = l->next) |
|
|
|
|
EINA_LIST_FOREACH(signal_bindings, l, bind) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Signal *bind; |
|
|
|
|
|
|
|
|
|
bind = l->data; |
|
|
|
|
if ((e_util_glob_match(sig, bind->sig)) && |
|
|
|
|
(e_util_glob_match(src, bind->src)) && |
|
|
|
|
((bind->any_mod) || (bind->mod == mod))) |
|
|
|
@ -744,13 +673,11 @@ e_bindings_wheel_add(E_Binding_Context ctxt, int direction, int z, E_Binding_Mod |
|
|
|
|
EAPI void |
|
|
|
|
e_bindings_wheel_del(E_Binding_Context ctxt, int direction, int z, E_Binding_Modifier mod, int any_mod, const char *action, const char *params) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Wheel *bind; |
|
|
|
|
Eina_List *l; |
|
|
|
|
|
|
|
|
|
for (l = wheel_bindings; l; l = l->next) |
|
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(wheel_bindings, l, bind) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Wheel *bind; |
|
|
|
|
|
|
|
|
|
bind = l->data; |
|
|
|
|
if ((bind->ctxt == ctxt) && |
|
|
|
|
(bind->direction == direction) && |
|
|
|
|
(bind->z == z) && |
|
|
|
@ -771,13 +698,11 @@ e_bindings_wheel_del(E_Binding_Context ctxt, int direction, int z, E_Binding_Mod |
|
|
|
|
EAPI void |
|
|
|
|
e_bindings_wheel_grab(E_Binding_Context ctxt, Ecore_X_Window win) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Wheel *bind; |
|
|
|
|
Eina_List *l; |
|
|
|
|
|
|
|
|
|
for (l = wheel_bindings; l; l = l->next) |
|
|
|
|
EINA_LIST_FOREACH(wheel_bindings, l, bind) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Wheel *bind; |
|
|
|
|
|
|
|
|
|
bind = l->data; |
|
|
|
|
if (_e_bindings_context_match(bind->ctxt, ctxt)) |
|
|
|
|
{ |
|
|
|
|
int button = 0; |
|
|
|
@ -803,13 +728,11 @@ e_bindings_wheel_grab(E_Binding_Context ctxt, Ecore_X_Window win) |
|
|
|
|
EAPI void |
|
|
|
|
e_bindings_wheel_ungrab(E_Binding_Context ctxt, Ecore_X_Window win) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Wheel *bind; |
|
|
|
|
Eina_List *l; |
|
|
|
|
|
|
|
|
|
for (l = wheel_bindings; l; l = l->next) |
|
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(wheel_bindings, l, bind) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Wheel *bind; |
|
|
|
|
|
|
|
|
|
bind = l->data; |
|
|
|
|
if (_e_bindings_context_match(bind->ctxt, ctxt)) |
|
|
|
|
{ |
|
|
|
|
int button = 0; |
|
|
|
@ -835,14 +758,12 @@ EAPI E_Action * |
|
|
|
|
e_bindings_wheel_find(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Mouse_Wheel *ev, E_Binding_Wheel **bind_ret) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Modifier mod = 0; |
|
|
|
|
E_Binding_Wheel *bind; |
|
|
|
|
Eina_List *l; |
|
|
|
|
|
|
|
|
|
mod = _e_bindings_modifiers(ev->modifiers); |
|
|
|
|
for (l = wheel_bindings; l; l = l->next) |
|
|
|
|
EINA_LIST_FOREACH(wheel_bindings, l, bind) |
|
|
|
|
{ |
|
|
|
|
E_Binding_Wheel *bind; |
|
|
|
|
|
|
|
|
|
bind = l->data; |
|
|
|
|
if ((bind->direction == ev->direction) && |
|
|
|
|
(((bind->z < 0) && (ev->z < 0)) || ((bind->z > 0) && (ev->z > 0))) && |
|
|
|
|
((bind->any_mod) || (bind->mod == mod))) |
|
|
|
|