Enlightenment CVS committal Author : raster Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_bindings.c e_config.c e_config.h e_theme.c Log Message: key and mouse bindings are saved and loaded to/from config now. next phase: export via ipc. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_bindings.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- e_bindings.c 30 Apr 2005 07:03:34 -0000 1.9 +++ e_bindings.c 3 May 2005 15:25:01 -0000 1.10 @@ -52,138 +52,25 @@ int e_bindings_init(void) { - e_bindings_mouse_add(E_BINDING_CONTEXT_BORDER, - 1, E_BINDING_MODIFIER_ALT, 0, - "window_move", ""); - e_bindings_mouse_add(E_BINDING_CONTEXT_BORDER, - 2, E_BINDING_MODIFIER_ALT, 0, - "window_resize", ""); - e_bindings_mouse_add(E_BINDING_CONTEXT_BORDER, - 3, E_BINDING_MODIFIER_ALT, 0, - "window_menu", ""); - - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "Left", E_BINDING_MODIFIER_SHIFT | E_BINDING_MODIFIER_ALT, 0, - "desk_flip_by", "-1 0"); - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "Right", E_BINDING_MODIFIER_SHIFT | E_BINDING_MODIFIER_ALT, 0, - "desk_flip_by", "1 0"); - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "Up", E_BINDING_MODIFIER_SHIFT | E_BINDING_MODIFIER_ALT, 0, - "desk_flip_by", "0 -1"); - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "Down", E_BINDING_MODIFIER_SHIFT | E_BINDING_MODIFIER_ALT, 0, - "desk_flip_by", "0 1"); - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "Up", E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0, - "window_raise", ""); - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "Down", E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0, - "window_lower", ""); - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "x", E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0, - "window_close", ""); - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "k", E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0, - "window_kill", ""); - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "w", E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0, - "window_menu", ""); - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "s", E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0, - "window_sticky_toggle", ""); - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "i", E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0, - "window_iconic_toggle", ""); - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "f", E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0, - "window_maximized_toggle", ""); - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "r", E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0, - "window_shaded_toggle", ""); - - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "Left", E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0, - "desk_linear_flip_by", "-1"); - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "Right", E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0, - "desk_linear_flip_by", "1"); - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "F1", E_BINDING_MODIFIER_ALT, 0, - "desk_linear_flip_to", "0"); - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "F2", E_BINDING_MODIFIER_ALT, 0, - "desk_linear_flip_to", "1"); - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "F3", E_BINDING_MODIFIER_ALT, 0, - "desk_linear_flip_to", "2"); - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "F4", E_BINDING_MODIFIER_ALT, 0, - "desk_linear_flip_to", "3"); - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "F5", E_BINDING_MODIFIER_ALT, 0, - "desk_linear_flip_to", "4"); - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "F6", E_BINDING_MODIFIER_ALT, 0, - "desk_linear_flip_to", "5"); - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "F7", E_BINDING_MODIFIER_ALT, 0, - "desk_linear_flip_to", "6"); - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "F8", E_BINDING_MODIFIER_ALT, 0, - "desk_linear_flip_to", "7"); - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "F9", E_BINDING_MODIFIER_ALT, 0, - "desk_linear_flip_to", "8"); - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "F10", E_BINDING_MODIFIER_ALT, 0, - "desk_linear_flip_to", "9"); - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "F11", E_BINDING_MODIFIER_ALT, 0, - "desk_linear_flip_to", "10"); - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "F12", E_BINDING_MODIFIER_ALT, 0, - "desk_linear_flip_to", "11"); - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "m", E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0, - "menu_show", "main"); - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "a", E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0, - "menu_show", "favorites"); - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "Menu", 0, 0, - "menu_show", "main"); - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "Menu", E_BINDING_MODIFIER_CTRL, 0, - "menu_show", "clients"); - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "Menu", E_BINDING_MODIFIER_ALT, 0, - "menu_show", "favorites"); - - e_bindings_key_add(E_BINDING_CONTEXT_ANY, - "Insert", E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0, - "exec", "Eterm"); - - /* shoudl do these - can't yet due to other things missing... */ - - /* need a yes/no dialog for these - to stop accidental logouts. for this - * i'd make a special case that can ask u to log out, restart or shut down - * or even reboot (if you have permissions to do so) - */ - /* CTRL+ALT Delete - logout */ - /* CTRL+ALT End - restart */ - - /* need a way to display all focused windows nicely - subsystem for - * this that also grabs the modifier on activate (if there are any) so - * on release of modifier(s) OR on any new action this list aborts display - */ - /* ALT Tab - next window focus */ - /* ALT_SHIFT Tab - prev window focus */ - - /* need to support fullscreen anyway for this - ie netwm and the border - * system need to handle this as well as possibly using xrandr/xvidmode - */ - /* ALT Return - fullscreen window */ + Evas_List *l; + + for (l = e_config->mouse_bindings; l; l = l->next) + { + E_Config_Binding_Mouse *eb; + + eb = l->data; + e_bindings_mouse_add(eb->context, eb->button, eb->modifiers, + eb->any_mod, eb->action, eb->params); + } + + for (l = e_config->key_bindings; l; l = l->next) + { + E_Config_Binding_Key *eb; + + eb = l->data; + e_bindings_key_add(eb->context, eb->key, eb->modifiers, + eb->any_mod, eb->action, eb->params); + } return 1; } =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -3 -r1.35 -r1.36 --- e_config.c 3 May 2005 08:06:48 -0000 1.35 +++ e_config.c 3 May 2005 15:25:01 -0000 1.36 @@ -27,6 +27,8 @@ static E_Config_DD *_e_config_font_fallback_edd = NULL; static E_Config_DD *_e_config_font_default_edd = NULL; static E_Config_DD *_e_config_theme_edd = NULL; +static E_Config_DD *_e_config_bindings_mouse_edd = NULL; +static E_Config_DD *_e_config_bindings_key_edd = NULL; /* externally accessible functions */ int @@ -66,6 +68,30 @@ #define D _e_config_font_fallback_edd E_CONFIG_VAL(D, T, name, STR); + _e_config_bindings_mouse_edd = E_CONFIG_DD_NEW("E_Config_Binding_Mouse", E_Config_Binding_Mouse); +#undef T +#undef D +#define T E_Config_Binding_Mouse +#define D _e_config_bindings_mouse_edd + E_CONFIG_VAL(D, T, context, INT); + E_CONFIG_VAL(D, T, modifiers, INT); + E_CONFIG_VAL(D, T, action, STR); + E_CONFIG_VAL(D, T, params, STR); + E_CONFIG_VAL(D, T, button, UCHAR); + E_CONFIG_VAL(D, T, any_mod, UCHAR); + + _e_config_bindings_key_edd = E_CONFIG_DD_NEW("E_Config_Binding_Key", E_Config_Binding_Key); +#undef T +#undef D +#define T E_Config_Binding_Key +#define D _e_config_bindings_key_edd + E_CONFIG_VAL(D, T, context, INT); + E_CONFIG_VAL(D, T, modifiers, INT); + E_CONFIG_VAL(D, T, key, STR); + E_CONFIG_VAL(D, T, action, STR); + E_CONFIG_VAL(D, T, params, STR); + E_CONFIG_VAL(D, T, any_mod, UCHAR); + _e_config_edd = E_CONFIG_DD_NEW("E_Config", E_Config); #undef T #undef D @@ -88,6 +114,8 @@ E_CONFIG_LIST(D, T, font_fallbacks, _e_config_font_fallback_edd); E_CONFIG_LIST(D, T, font_defaults, _e_config_font_default_edd); E_CONFIG_LIST(D, T, themes, _e_config_theme_edd); + E_CONFIG_LIST(D, T, mouse_bindings, _e_config_bindings_mouse_edd); + E_CONFIG_LIST(D, T, key_bindings, _e_config_bindings_key_edd); e_config = e_config_domain_load("e", _e_config_edd); if (!e_config) @@ -183,6 +211,357 @@ et->file = strdup("default.edj"); e_config->themes = evas_list_append(e_config->themes, et); } + { + E_Config_Binding_Mouse *eb; + + eb = E_NEW(E_Config_Binding_Mouse, 1); + eb->context = E_BINDING_CONTEXT_BORDER; + eb->button = 1; + eb->modifiers = E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("window_move"); + eb->params = strdup(""); + e_config->mouse_bindings = evas_list_append(e_config->mouse_bindings, eb); + + eb = E_NEW(E_Config_Binding_Mouse, 1); + eb->context = E_BINDING_CONTEXT_BORDER; + eb->button = 2; + eb->modifiers = E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("window_resize"); + eb->params = strdup(""); + e_config->mouse_bindings = evas_list_append(e_config->mouse_bindings, eb); + + eb = E_NEW(E_Config_Binding_Mouse, 1); + eb->context = E_BINDING_CONTEXT_BORDER; + eb->button = 3; + eb->modifiers = E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("window_menu"); + eb->params = strdup(""); + e_config->mouse_bindings = evas_list_append(e_config->mouse_bindings, eb); + } + { + E_Config_Binding_Key *eb; + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("Left"); + eb->modifiers = E_BINDING_MODIFIER_SHIFT | E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("desk_flip_by"); + eb->params = strdup("-1 0"); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("Right"); + eb->modifiers = E_BINDING_MODIFIER_SHIFT | E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("desk_flip_by"); + eb->params = strdup("1 0"); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("Up"); + eb->modifiers = E_BINDING_MODIFIER_SHIFT | E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("desk_flip_by"); + eb->params = strdup("0 -1"); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("Down"); + eb->modifiers = E_BINDING_MODIFIER_SHIFT | E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("desk_flip_by"); + eb->params = strdup("0 1"); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("Up"); + eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("window_raise"); + eb->params = strdup(""); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("Down"); + eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("window_lower"); + eb->params = strdup(""); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("x"); + eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("window_close"); + eb->params = strdup(""); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("k"); + eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("window_kill"); + eb->params = strdup(""); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("w"); + eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("window_menu"); + eb->params = strdup(""); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("s"); + eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("window_sticky_toggle"); + eb->params = strdup(""); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("i"); + eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("window_iconic_toggle"); + eb->params = strdup(""); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("f"); + eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("window_maximized_toggle"); + eb->params = strdup(""); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("r"); + eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("window_shaded_toggle"); + eb->params = strdup(""); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("Left"); + eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("desk_linear_flip_by"); + eb->params = strdup("-1"); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("Right"); + eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("desk_linear_flip_by"); + eb->params = strdup("1"); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("F1"); + eb->modifiers = E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("desk_linear_flip_to"); + eb->params = strdup("0"); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("F2"); + eb->modifiers = E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("desk_linear_flip_to"); + eb->params = strdup("1"); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("F3"); + eb->modifiers = E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("desk_linear_flip_to"); + eb->params = strdup("2"); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("F4"); + eb->modifiers = E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("desk_linear_flip_to"); + eb->params = strdup("3"); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("F5"); + eb->modifiers = E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("desk_linear_flip_to"); + eb->params = strdup("4"); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("F6"); + eb->modifiers = E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("desk_linear_flip_to"); + eb->params = strdup("5"); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("F7"); + eb->modifiers = E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("desk_linear_flip_to"); + eb->params = strdup("6"); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("F8"); + eb->modifiers = E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("desk_linear_flip_to"); + eb->params = strdup("7"); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("F9"); + eb->modifiers = E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("desk_linear_flip_to"); + eb->params = strdup("8"); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("F10"); + eb->modifiers = E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("desk_linear_flip_to"); + eb->params = strdup("9"); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("F11"); + eb->modifiers = E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("desk_linear_flip_to"); + eb->params = strdup("10"); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("F12"); + eb->modifiers = E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("desk_linear_flip_to"); + eb->params = strdup("11"); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("m"); + eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("menu_show"); + eb->params = strdup("main"); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("a"); + eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("menu_show"); + eb->params = strdup("favorites"); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("Menu"); + eb->modifiers = 0; + eb->any_mod = 0; + eb->action = strdup("menu_show"); + eb->params = strdup("main"); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("Menu"); + eb->modifiers = E_BINDING_MODIFIER_CTRL; + eb->any_mod = 0; + eb->action = strdup("menu_show"); + eb->params = strdup("clients"); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("Menu"); + eb->modifiers = E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("menu_show"); + eb->params = strdup("favorites"); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("Insert"); + eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("exec"); + eb->params = strdup("Eterm"); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + /* should do these - can't yet due to other things missing... */ + + /* need a yes/no dialog for these - to stop accidental logouts. for this + * i'd make a special case that can ask u to log out, restart or shut down + * or even reboot (if you have permissions to do so) + */ + /* CTRL+ALT Delete - logout */ + /* CTRL+ALT End - restart */ + + /* need a way to display all focused windows nicely - subsystem for + * this that also grabs the modifier on activate (if there are any) so + * on release of modifier(s) OR on any new action this list aborts display + */ + /* ALT Tab - next window focus */ + /* ALT_SHIFT Tab - prev window focus */ + + /* need to support fullscreen anyway for this - ie netwm and the border + * system need to handle this as well as possibly using xrandr/xvidmode + */ + /* ALT Return - fullscreen window */ + } e_config_save_queue(); } @@ -196,7 +575,7 @@ E_CONFIG_LIMIT(e_config->image_cache, 0, 256 * 1024); E_CONFIG_LIMIT(e_config->font_cache, 0, 32 * 1024); - /* apply config */ + /* apply lang config - exception and config is loaded after intl setup */ if ((e_config->language) && (strlen(e_config->language) > 0)) { @@ -204,22 +583,6 @@ e_intl_language_set(e_config->language); } - { - Evas_List *l; - - for (l = e_config->themes; l; l = l->next) - { - E_Config_Theme *et; - char buf[256]; - - et = l->data; - snprintf(buf, sizeof(buf), "base/%s", et->category); - printf("THEME: %s %s\n", buf, et->file); - e_theme_file_set(buf, et->file); - } - } - /* FIXME: run through themes and set */ - return 1; } @@ -266,7 +629,28 @@ E_FREE(et->file); E_FREE(et); } - + while (e_config->mouse_bindings) + { + E_Config_Binding_Mouse *eb; + + eb = e_config->mouse_bindings->data; + e_config->mouse_bindings = evas_list_remove_list(e_config->mouse_bindings, e_config->mouse_bindings); + E_FREE(eb->action); + E_FREE(eb->params); + E_FREE(eb); + } + while (e_config->key_bindings) + { + E_Config_Binding_Key *eb; + + eb = e_config->key_bindings->data; + e_config->key_bindings = evas_list_remove_list(e_config->key_bindings, e_config->key_bindings); + E_FREE(eb->key); + E_FREE(eb->action); + E_FREE(eb->params); + E_FREE(eb); + } + E_FREE(e_config->desktop_default_background); E_FREE(e_config->language); E_FREE(e_config); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -3 -r1.15 -r1.16 --- e_config.h 2 May 2005 10:16:31 -0000 1.15 +++ e_config.h 3 May 2005 15:25:02 -0000 1.16 @@ -31,10 +31,12 @@ #define E_CONFIG_LIMIT(v, min, max) {if (v > max) v = max; else if (v < min) v = min;} -typedef struct _E_Config E_Config; -typedef struct _E_Config_Module E_Config_Module; -typedef struct _E_Config_Theme E_Config_Theme; -typedef Eet_Data_Descriptor E_Config_DD; +typedef struct _E_Config E_Config; +typedef struct _E_Config_Module E_Config_Module; +typedef struct _E_Config_Theme E_Config_Theme; +typedef struct _E_Config_Binding_Mouse E_Config_Binding_Mouse; +typedef struct _E_Config_Binding_Key E_Config_Binding_Key; +typedef Eet_Data_Descriptor E_Config_DD; #else #ifndef E_CONFIG_H @@ -60,6 +62,8 @@ Evas_List *font_fallbacks; Evas_List *font_defaults; Evas_List *themes; + Evas_List *mouse_bindings; + Evas_List *key_bindings; }; struct _E_Config_Module @@ -74,6 +78,26 @@ char *file; }; +struct _E_Config_Binding_Mouse +{ + int context; + int modifiers; + char *action; + char *params; + unsigned char button; + unsigned char any_mod; +}; + +struct _E_Config_Binding_Key +{ + int context; + int modifiers; + char *key; + char *action; + char *params; + unsigned char any_mod; +}; + EAPI int e_config_init(void); EAPI int e_config_shutdown(void); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_theme.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- e_theme.c 1 May 2005 16:21:57 -0000 1.6 +++ e_theme.c 3 May 2005 15:25:02 -0000 1.7 @@ -23,10 +23,22 @@ int e_theme_init(void) { + Evas_List *l; + /* this is a fallback that is ALWAYS there - if all fails things will */ /* always fall back to the default theme. the rest after this are config */ /* values users can set */ e_theme_file_set("base", "default.edj"); + + for (l = e_config->themes; l; l = l->next) + { + E_Config_Theme *et; + char buf[256]; + + et = l->data; + snprintf(buf, sizeof(buf), "base/%s", et->category); + e_theme_file_set(buf, et->file); + } /* * other possible categories... * e_theme_file_set("base/theme/borders", "default.edj"); ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs