eb->any_mod, eb->action, eb->params);
/* FIXME: Can this be solved in a generic way? */
/* FIXME: Only change cursor if action is allowed! */
- if ((!strcmp(eb->action, "window_resize")) &&
+ if ((eb->action) && (eb->signal) && (eb->source) &&
+ (!strcmp(eb->action, "window_resize")) &&
(!strncmp(eb->signal, "mouse,down,", 11)) &&
(!strncmp(eb->source, "resize_", 7)))
{
bind->button = button;
bind->mod = mod;
bind->any_mod = any_mod;
- bind->action = strdup(action);
- bind->params = strdup(params);
+ if (action) bind->action = strdup(action);
+ if (params) bind->params = strdup(params);
mouse_bindings = evas_list_append(mouse_bindings, bind);
}
(bind->button == button) &&
(bind->mod == mod) &&
(bind->any_mod == any_mod) &&
- (!strcmp(bind->action, action)) &&
- (!strcmp(bind->params, params)))
+ (((bind->action) && (action) && (!strcmp(bind->action, action))) ||
+ ((!bind->action) && (!action))) &&
+ (((bind->params) && (params) && (!strcmp(bind->params, params))) ||
+ ((!bind->params) && (!params))))
{
_e_bindings_mouse_free(bind);
mouse_bindings = evas_list_remove_list(mouse_bindings, l);
bind->key = strdup(key);
bind->mod = mod;
bind->any_mod = any_mod;
- bind->action = strdup(action);
- bind->params = strdup(params);
+ if (action) bind->action = strdup(action);
+ if (params) bind->params = strdup(params);
key_bindings = evas_list_append(key_bindings, bind);
}
bind = l->data;
if ((bind->ctxt == ctxt) &&
- (!strcmp(bind->key, key)) &&
+ (key) && (bind->key) && (!strcmp(bind->key, key)) &&
(bind->mod == mod) &&
(bind->any_mod == any_mod) &&
- (!strcmp(bind->action, action)) &&
- (!strcmp(bind->params, params)))
+ (((bind->action) && (action) && (!strcmp(bind->action, action))) ||
+ ((!bind->action) && (!action))) &&
+ (((bind->params) && (params) && (!strcmp(bind->params, params))) ||
+ ((!bind->params) && (!params))))
{
_e_bindings_key_free(bind);
key_bindings = evas_list_remove_list(key_bindings, l);
E_Binding_Key *bind;
bind = l->data;
- if ((!strcmp(bind->key, ev->keyname)) &&
+ if ((bind->key) && (!strcmp(bind->key, ev->keyname)) &&
((bind->any_mod) || (bind->mod == mod)))
{
if (_e_bindings_context_match(bind->ctxt, ctxt))
E_Binding_Key *bind;
bind = l->data;
- if ((!strcmp(bind->key, ev->keyname)) &&
+ if ((bind->key) && (!strcmp(bind->key, ev->keyname)) &&
((bind->any_mod) || (bind->mod == mod)))
{
if (_e_bindings_context_match(bind->ctxt, ctxt))
bind = calloc(1, sizeof(E_Binding_Signal));
bind->ctxt = ctxt;
- bind->sig = strdup(sig);
- bind->src = strdup(src);
+ if (sig) bind->sig = strdup(sig);
+ if (src) bind->src = strdup(src);
bind->mod = mod;
bind->any_mod = any_mod;
- bind->action = strdup(action);
- bind->params = strdup(params);
+ if (action) bind->action = strdup(action);
+ if (params) bind->params = strdup(params);
signal_bindings = evas_list_append(signal_bindings, bind);
}
bind = l->data;
if ((bind->ctxt == ctxt) &&
- (!strcmp(bind->sig, sig)) &&
- (!strcmp(bind->src, src)) &&
+ (((bind->sig) && (sig) && (!strcmp(bind->sig, sig))) ||
+ ((!bind->sig) && (!sig))) &&
+ (((bind->src) && (src) && (!strcmp(bind->src, src))) ||
+ ((!bind->src) && (!src))) &&
(bind->mod == mod) &&
(bind->any_mod == any_mod) &&
- (!strcmp(bind->action, action)) &&
- (!strcmp(bind->params, params)))
+ (((bind->action) && (action) && (!strcmp(bind->action, action))) ||
+ ((!bind->action) && (!action))) &&
+ (((bind->params) && (params) && (!strcmp(bind->params, params))) ||
+ ((!bind->params) && (!params))))
{
_e_bindings_signal_free(bind);
signal_bindings = evas_list_remove_list(signal_bindings, l);
{
E_Action *act;
E_Binding_Signal *bind;
-
+
+ if (sig[0] == 0) sig = NULL;
+ if (src[0] == 0) src = NULL;
act = e_bindings_signal_find(ctxt, obj, sig, src, &bind);
if (act)
{
bind->z = z;
bind->mod = mod;
bind->any_mod = any_mod;
- bind->action = strdup(action);
- bind->params = strdup(params);
+ if (action) bind->action = strdup(action);
+ if (params) bind->params = strdup(params);
wheel_bindings = evas_list_append(wheel_bindings, bind);
}
(bind->z == z) &&
(bind->mod == mod) &&
(bind->any_mod == any_mod) &&
- (!strcmp(bind->action, action)) &&
- (!strcmp(bind->params, params)))
+ (((bind->action) && (action) && (!strcmp(bind->action, action))) ||
+ ((!bind->action) && (!action))) &&
+ (((bind->params) && (params) && (!strcmp(bind->params, params))) ||
+ ((!bind->params) && (!params))))
{
_e_bindings_wheel_free(bind);
wheel_bindings = evas_list_remove_list(wheel_bindings, l);
e_config = E_NEW(E_Config, 1);
e_config->config_version = E_CONFIG_FILE_VERSION;
e_config->show_splash = 1;
- e_config->desktop_default_background = strdup("");
+ e_config->desktop_default_background = NULL;
e_config->desktop_default_name = strdup("Desktop %i, %i");
e_config->menus_scroll_speed = 1000.0;
e_config->menus_fast_mouse_move_threshhold = 300.0;
e_config->evas_engine_drag = E_EVAS_ENGINE_DEFAULT;
e_config->evas_engine_win = E_EVAS_ENGINE_DEFAULT;
e_config->evas_engine_zone = E_EVAS_ENGINE_DEFAULT;
- e_config->language = strdup("");
+ e_config->language = NULL;
e_config->window_placement_policy = E_WINDOW_PLACEMENT_SMART;
e_config->focus_policy = E_FOCUS_SLOPPY;
e_config->focus_setting = E_FOCUS_NEW_DIALOG_IF_OWNER_FOCUSED;
e_config->kill_timer_wait = 10.0;
e_config->ping_clients = 1;
e_config->ping_clients_wait = 10.0;
- e_config->transition_start = strdup("");
+ e_config->transition_start = NULL;
e_config->transition_desk = strdup("vswipe");
e_config->transition_change = strdup("crossfade");
e_config->move_info_follows = 1;
eb->modifiers = E_BINDING_MODIFIER_ALT;
eb->any_mod = 0;
eb->action = strdup("window_move");
- eb->params = strdup("");
+ eb->params = NULL;
e_config->mouse_bindings = evas_list_append(e_config->mouse_bindings, eb);
eb = E_NEW(E_Config_Binding_Mouse, 1);
eb->modifiers = E_BINDING_MODIFIER_ALT;
eb->any_mod = 0;
eb->action = strdup("window_resize");
- eb->params = strdup("");
+ eb->params = NULL;
e_config->mouse_bindings = evas_list_append(e_config->mouse_bindings, eb);
eb = E_NEW(E_Config_Binding_Mouse, 1);
eb->modifiers = E_BINDING_MODIFIER_ALT;
eb->any_mod = 0;
eb->action = strdup("window_menu");
- eb->params = strdup("");
+ eb->params = NULL;
e_config->mouse_bindings = evas_list_append(e_config->mouse_bindings, eb);
eb = E_NEW(E_Config_Binding_Mouse, 1);
eb->modifiers = E_BINDING_MODIFIER_ALT;
eb->any_mod = 0;
eb->action = strdup("edit_mode");
- eb->params = strdup("");
+ eb->params = NULL;
e_config->mouse_bindings = evas_list_append(e_config->mouse_bindings, eb);
}
{
eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT;
eb->any_mod = 0;
eb->action = strdup("window_raise");
- eb->params = strdup("");
+ eb->params = NULL;
e_config->key_bindings = evas_list_append(e_config->key_bindings, eb);
eb = E_NEW(E_Config_Binding_Key, 1);
eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT;
eb->any_mod = 0;
eb->action = strdup("window_lower");
- eb->params = strdup("");
+ eb->params = NULL;
e_config->key_bindings = evas_list_append(e_config->key_bindings, eb);
eb = E_NEW(E_Config_Binding_Key, 1);
eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT;
eb->any_mod = 0;
eb->action = strdup("window_close");
- eb->params = strdup("");
+ eb->params = NULL;
e_config->key_bindings = evas_list_append(e_config->key_bindings, eb);
eb = E_NEW(E_Config_Binding_Key, 1);
eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT;
eb->any_mod = 0;
eb->action = strdup("window_kill");
- eb->params = strdup("");
+ eb->params = NULL;
e_config->key_bindings = evas_list_append(e_config->key_bindings, eb);
eb = E_NEW(E_Config_Binding_Key, 1);
eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT;
eb->any_mod = 0;
eb->action = strdup("window_menu");
- eb->params = strdup("");
+ eb->params = NULL;
e_config->key_bindings = evas_list_append(e_config->key_bindings, eb);
eb = E_NEW(E_Config_Binding_Key, 1);
eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT;
eb->any_mod = 0;
eb->action = strdup("window_sticky_toggle");
- eb->params = strdup("");
+ eb->params = NULL;
e_config->key_bindings = evas_list_append(e_config->key_bindings, eb);
eb = E_NEW(E_Config_Binding_Key, 1);
eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT;
eb->any_mod = 0;
eb->action = strdup("window_iconic_toggle");
- eb->params = strdup("");
+ eb->params = NULL;
e_config->key_bindings = evas_list_append(e_config->key_bindings, eb);
eb = E_NEW(E_Config_Binding_Key, 1);
eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT;
eb->any_mod = 0;
eb->action = strdup("window_maximized_toggle");
- eb->params = strdup("");
+ eb->params = NULL;
e_config->key_bindings = evas_list_append(e_config->key_bindings, eb);
eb = E_NEW(E_Config_Binding_Key, 1);
eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT;
eb->any_mod = 0;
eb->action = strdup("window_shaded_toggle");
- eb->params = strdup("");
+ eb->params = NULL;
e_config->key_bindings = evas_list_append(e_config->key_bindings, eb);
eb = E_NEW(E_Config_Binding_Key, 1);
eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT;
eb->any_mod = 0;
eb->action = strdup("edit_mode_toggle");
- eb->params = strdup("");
+ eb->params = NULL;
e_config->key_bindings = evas_list_append(e_config->key_bindings, eb);
eb = E_NEW(E_Config_Binding_Key, 1);
eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT;
eb->any_mod = 0;
eb->action = strdup("restart");
- eb->params = strdup("");
+ eb->params = NULL;
e_config->key_bindings = evas_list_append(e_config->key_bindings, eb);
eb = E_NEW(E_Config_Binding_Key, 1);
eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT;
eb->any_mod = 0;
eb->action = strdup("exit");
- eb->params = strdup("");
+ eb->params = NULL;
e_config->key_bindings = evas_list_append(e_config->key_bindings, eb);
/* need to support fullscreen anyway for this - ie netwm and the border
eb->modifiers = E_BINDING_MODIFIER_NONE;
eb->any_mod = 1;
eb->action = strdup("window_menu");
- eb->params = strdup("");
+ eb->params = NULL;
e_config->signal_bindings = evas_list_append(e_config->signal_bindings, eb);
eb = E_NEW(E_Config_Binding_Signal, 1);
eb->modifiers = E_BINDING_MODIFIER_NONE;
eb->any_mod = 1;
eb->action = strdup("window_menu");
- eb->params = strdup("");
+ eb->params = NULL;
e_config->signal_bindings = evas_list_append(e_config->signal_bindings, eb);
eb = E_NEW(E_Config_Binding_Signal, 1);
eb->modifiers = E_BINDING_MODIFIER_NONE;
eb->any_mod = 1;
eb->action = strdup("window_close");
- eb->params = strdup("");
+ eb->params = NULL;
e_config->signal_bindings = evas_list_append(e_config->signal_bindings, eb);
eb = E_NEW(E_Config_Binding_Signal, 1);
eb->modifiers = E_BINDING_MODIFIER_NONE;
eb->any_mod = 1;
eb->action = strdup("window_kill");
- eb->params = strdup("");
+ eb->params = NULL;
e_config->signal_bindings = evas_list_append(e_config->signal_bindings, eb);
eb = E_NEW(E_Config_Binding_Signal, 1);
eb->modifiers = E_BINDING_MODIFIER_NONE;
eb->any_mod = 1;
eb->action = strdup("window_maximized_toggle");
- eb->params = strdup("");
+ eb->params = NULL;
e_config->signal_bindings = evas_list_append(e_config->signal_bindings, eb);
eb = E_NEW(E_Config_Binding_Signal, 1);
eb->modifiers = E_BINDING_MODIFIER_NONE;
eb->any_mod = 1;
eb->action = strdup("window_iconic_toggle");
- eb->params = strdup("");
+ eb->params = NULL;
e_config->signal_bindings = evas_list_append(e_config->signal_bindings, eb);
eb = E_NEW(E_Config_Binding_Signal, 1);
eb->modifiers = E_BINDING_MODIFIER_NONE;
eb->any_mod = 1;
eb->action = strdup("window_drag_icon");
- eb->params = strdup("");
+ eb->params = NULL;
e_config->signal_bindings = evas_list_append(e_config->signal_bindings, eb);
eb = E_NEW(E_Config_Binding_Signal, 1);
eb->modifiers = E_BINDING_MODIFIER_NONE;
eb->any_mod = 1;
eb->action = strdup("window_move");
- eb->params = strdup("");
+ eb->params = NULL;
e_config->signal_bindings = evas_list_append(e_config->signal_bindings, eb);
eb = E_NEW(E_Config_Binding_Signal, 1);
eb->modifiers = E_BINDING_MODIFIER_NONE;
eb->any_mod = 1;
eb->action = strdup("window_move");
- eb->params = strdup("");
+ eb->params = NULL;
e_config->signal_bindings = evas_list_append(e_config->signal_bindings, eb);
eb = E_NEW(E_Config_Binding_Signal, 1);