|
From: Enlightenment C. <no...@cv...> - 2006-05-06 09:36:14
|
Enlightenment CVS committal
Author : sndev
Project : e17
Module : apps/e
Dir : e17/apps/e/src/bin
Modified Files:
e_actions.c e_actions.h e_int_config_keybindings.c
e_int_config_keybindings.h e_widget_button.c e_widget_button.h
e_widget_radio.c e_widget_radio.h
Log Message:
* Some code cleenup
* repeated code cleanup
* moving the list of keybinding into action.c
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_actions.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -3 -r1.52 -r1.53
--- e_actions.c 2 Mar 2006 12:03:47 -0000 1.52
+++ e_actions.c 6 May 2006 09:35:05 -0000 1.53
@@ -1378,84 +1378,268 @@
ACT_END(window_move);
ACT_END_MOUSE(window_move);
+ /* window_resize */
ACT_GO(window_resize);
ACT_GO_MOUSE(window_resize);
ACT_GO_SIGNAL(window_resize);
ACT_END(window_resize);
ACT_END_MOUSE(window_resize);
+ /* window_menu */
ACT_GO(window_menu);
+ e_register_action_predef_name(_("Menu"), _("Window Menu"), "window_menu", NULL,
+ EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
ACT_GO_MOUSE(window_menu);
ACT_GO_KEY(window_menu);
+ /* window_raise */
ACT_GO(window_raise);
+ e_register_action_predef_name(_("Window : Actions"), _("Raise"), "window_raise",
+ NULL, EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ /* window_lower */
ACT_GO(window_lower);
+ e_register_action_predef_name(_("Window : Actions"), _("Lower"), "window_lower",
+ NULL, EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ /* window_close */
ACT_GO(window_close);
+ e_register_action_predef_name(_("Window : Actions"), _("Close"), "window_close",
+ NULL, EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ /* window_kill */
ACT_GO(window_kill);
+ e_register_action_predef_name(_("Window : Actions"), _("Kill"), "window_kill",
+ NULL, EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ /* window_sticky_toggle */
ACT_GO(window_sticky_toggle);
+ e_register_action_predef_name(_("Window : State"), _("Sticky Mode Toggle"),
+ "window_sticky_toggle", NULL,
+ EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
ACT_GO(window_sticky);
+ /* window_iconic_toggle */
ACT_GO(window_iconic_toggle);
+ e_register_action_predef_name(_("Window : State"), _("Iconic Mode Toggle"),
+ "window_iconic_toggle", NULL,
+ EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
ACT_GO(window_iconic);
+ /* window_maximized_toggle */
ACT_GO(window_maximized_toggle);
+ e_register_action_predef_name(_("Window : State"), _("Maximize"), "window_maximized_toggle",
+ NULL, EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Window : State"), _("Maximize Vertically"),
+ "window_maximized_toggle", "vertical",
+ EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Window : State"), _("Maximize Horizontally"),
+ "window_maximized_toggle", "horizontal",
+ EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Window : State"), _("Maximize Fullscreen"),
+ "window_maximized_toggle", "fullscreen",
+ EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Window : State"), _("Maximize Mode \"Smart\""),
+ "window_maximized_toggle", "smart",
+ EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Window : State"), _("Maximize Mode \"Expand\""),
+ "window_maximized_toggle", "expand",
+ EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Window : State"), _("Maximize Mode \"Fill\""),
+ "window_maximized_toggle", "fill",
+ EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
ACT_GO(window_maximized);
+ /* window_shaded_toggle */
ACT_GO(window_shaded_toggle);
+ e_register_action_predef_name(_("Window : State"), _("Shade Up Mode Toggle"),
+ "window_shaded_toggle", "up",
+ EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Window : State"), _("Shade Down Mode Toggle"),
+ "window_shaded_toggle", "down",
+ EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Window : State"), _("Shade Left Mode Toggle"),
+ "window_shaded_toggle", "Left",
+ EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Window : State"), _("Shade Right Mode Toggle"),
+ "window_shaded_toggle", "Left",
+ EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
ACT_GO(window_shaded);
+ /* desk_flip_by */
ACT_GO(desk_flip_by);
+ e_register_action_predef_name(_("Desktop"), _("Flip Desktop Left"), "desk_flip_by", "-1 0",
+ EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Desktop"), _("Flip Desktop Right"), "desk_flip_by", "1 0",
+ EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Desktop"), _("Flip Desktop Up"), "desk_flip_by", "0 -1",
+ EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Desktop"), _("Flip Desktop Down"), "desk_flip_by", "0 1",
+ EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Desktop"), _("Flip Desktop Byâ¦"),
+ "desk_flip_by", NULL, EDIT_RESTRICT_ACTION, 0);
+ /* desk_linear_flip_to */
ACT_GO(desk_flip_to);
+ e_register_action_predef_name(_("Desktop"), _("Flip Desktop Toâ¦"),
+ "desk_flip_to", NULL, EDIT_RESTRICT_ACTION, 0);
+ /* desk_linear_flip_by */
ACT_GO(desk_linear_flip_by);
+ e_register_action_predef_name(_("Desktop"), _("Flip Desktop Linearlyâ¦"),
+ "desk_linear_flip_by", NULL, EDIT_RESTRICT_ACTION, 0);
+ /* desk_linear_flip_to */
ACT_GO(desk_linear_flip_to);
+ e_register_action_predef_name(_("Desktop"), _("Switch To Desktop 0"), "desk_linear_flip_to",
+ "0", EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Desktop"), _("Switch To Desktop 1"), "desk_linear_flip_to",
+ "1", EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Desktop"), _("Switch To Desktop 2"), "desk_linear_flip_to",
+ "2", EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Desktop"), _("Switch To Desktop 3"), "desk_linear_flip_to",
+ "3", EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Desktop"), _("Switch To Desktop 4"), "desk_linear_flip_to",
+ "4", EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Desktop"), _("Switch To Desktop 5"), "desk_linear_flip_to",
+ "5", EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Desktop"), _("Switch To Desktop 6"), "desk_linear_flip_to",
+ "6", EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Desktop"), _("Switch To Desktop 7"), "desk_linear_flip_to",
+ "7", EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Desktop"), _("Switch To Desktop 8"), "desk_linear_flip_to",
+ "8", EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Desktop"), _("Switch To Desktop 9"), "desk_linear_flip_to",
+ "9", EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Desktop"), _("Switch To Desktop 10"), "desk_linear_flip_to",
+ "10", EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Desktop"), _("Switch To Desktop 11"), "desk_linear_flip_to",
+ "11", EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Desktop"), _("Switch To Desktopâ¦"),
+ "desk_linear_flip_to", NULL, EDIT_RESTRICT_ACTION, 0);
+ /* window_move_to */
ACT_GO(window_move_to);
-
+ e_register_action_predef_name(_("Window : Actions"), "Move Toâ¦", "window_move_to", NULL,
+ EDIT_RESTRICT_ACTION, 0);
+ /* window_move_by */
ACT_GO(window_move_by);
+ e_register_action_predef_name(_("Window : Actions"), "Move Byâ¦", "window_move_by", NULL,
+ EDIT_RESTRICT_ACTION, 0);
+ /* window_resize_by */
ACT_GO(window_resize_by);
+ e_register_action_predef_name(_("Window : Actions"), "Resize Byâ¦", "window_resize_by", NULL,
+ EDIT_RESTRICT_ACTION, 0);
+ /* window_drag_icon */
ACT_GO(window_drag_icon);
+ e_register_action_predef_name(_("Window : Actions"), "Drag Iconâ¦", "window_drag_icon", NULL,
+ EDIT_RESTRICT_ACTION, 0);
+ /* window_desk_move_by */
ACT_GO(window_desk_move_by);
+ e_register_action_predef_name(_("Window : Moving"), _("To Next Desktop"), "window_desk_move_by",
+ "1 0", EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Window : Moving"), _("To Previous Desktop"),
+ "window_desk_move_by", "-1 0",
+ EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Window : Moving"), _("By Desktop #â¦"), "window_desk_move_by",
+ NULL, EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ /* window_desk_move_to */
ACT_GO(window_desk_move_to);
+ e_register_action_predef_name(_("Window : Moving"), _("To Desktop 0"), "window_desk_move_to",
+ "0", EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Window : Moving"), _("To Desktop 1"), "window_desk_move_to",
+ "1", EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Window : Moving"), _("To Desktop 2"), "window_desk_move_to",
+ "2", EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Window : Moving"), _("To Desktop 3"), "window_desk_move_to",
+ "3", EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Window : Moving"), _("To Desktop 4"), "window_desk_move_to",
+ "4", EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Window : Moving"), _("To Desktop 5"), "window_desk_move_to",
+ "5", EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Window : Moving"), _("To Desktop 6"), "window_desk_move_to",
+ "6", EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Window : Moving"), _("To Desktop 7"), "window_desk_move_to",
+ "7", EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Window : Moving"), _("To Desktop 8"), "window_desk_move_to",
+ "8", EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Window : Moving"), _("To Desktop 9"), "window_desk_move_to",
+ "9", EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Window : Moving"), _("To Desktop 10"), "window_desk_move_to",
+ "10", EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Window : Moving"), _("To Desktop 11"), "window_desk_move_to",
+ "11", EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Window : Moving"), _("To Desktopâ¦"), "window_desk_move_to",
+ NULL, EDIT_RESTRICT_ACTION, 0);
+ /* menu_show */
ACT_GO(menu_show);
+ e_register_action_predef_name(_("Menu"), _("Show Main Menu"), "menu_show", "main",
+ EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Menu"), _("Show Favorites Menu"), "menu_show", "favorites",
+ EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Menu"), _("Show Clients Menu"), "menu_show", "clients",
+ EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Menu"), _("Show Menuâ¦"), "menu_show", "clients",
+ EDIT_RESTRICT_ACTION, 0);
ACT_GO_MOUSE(menu_show);
ACT_GO_KEY(menu_show);
+ /* exec */
ACT_GO(exec);
+ e_register_action_predef_name(_("Enlightenment"), _("User Defined Actions"), "exec", NULL,
+ EDIT_RESTRICT_ACTION, 0);
+ /* app */
ACT_GO(app);
+ e_register_action_predef_name(_("Enlightenment"), _("Application"), "app", NULL,
+ EDIT_RESTRICT_ACTION, 0);
+ /* winlist */
ACT_GO(winlist);
+ e_register_action_predef_name(_("Window : List"), _("Next Window"), "winlist", "next",
+ EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ e_register_action_predef_name(_("Window : List"), _("Previous Window"), "winlist", "prev",
+ EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
ACT_GO_MOUSE(winlist);
ACT_GO_KEY(winlist);
ACT_GO(edit_mode);
ACT_END(edit_mode);
+ /* edit_mode */
ACT_GO(edit_mode_toggle);
+ e_register_action_predef_name(_("Gadgets"), _("Toggle Edit Mode"), "edit_mode_toggle", NULL,
+ EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ /* restart */
ACT_GO(restart);
+ e_register_action_predef_name(_("Enlightenment"), _("Restart"), "restart", NULL,
+ EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+
+ /* exit */
ACT_GO(exit);
+ e_register_action_predef_name(_("Enlightenment"), _("Exit"), "exit", NULL,
+ EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
ACT_GO(pointer_resize_push);
ACT_GO(pointer_resize_pop);
+ /* exebuf */
ACT_GO(exebuf);
+ e_register_action_predef_name(_("Enlightenment"), _("Run Command"), "exebuf", NULL,
+ EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
+ /* desk_lock */
ACT_GO(desk_lock);
+ e_register_action_predef_name(_("Desktop"), _("Desktop Lock"), "desk_lock", NULL,
+ EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS, 0);
return 1;
}
@@ -1463,6 +1647,7 @@
EAPI int
e_actions_shutdown(void)
{
+ e_unregister_all_action_predef_names();
action_names = evas_list_free(action_names);
while (actions)
{
@@ -1492,6 +1677,16 @@
action_names = evas_list_append(action_names, name);
}
return act;
+}
+
+EAPI void
+e_action_del(const char *name)
+{
+ E_Action *act;
+
+ act = evas_hash_find(actions, name);
+ if (act)
+ _e_action_free(act);
}
EAPI E_Action *
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_actions.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- e_actions.h 2 Mar 2006 12:03:48 -0000 1.10
+++ e_actions.h 6 May 2006 09:35:05 -0000 1.11
@@ -33,6 +33,8 @@
EAPI Evas_List *e_action_name_list(void);
EAPI E_Action *e_action_add(const char *name);
+/* e_action_del allows, for example, modules to define their own actions dynamically. */
+EAPI void e_action_del(const char *name);
EAPI E_Action *e_action_find(const char *name);
#endif
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_int_config_keybindings.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- e_int_config_keybindings.c 30 Apr 2006 04:31:42 -0000 1.19
+++ e_int_config_keybindings.c 6 May 2006 09:35:05 -0000 1.20
@@ -1,11 +1,5 @@
#include "e.h"
-/* FIXME: this dialog needs to keep up with the actions in actions.c - this
- * isnt' easily "automatic - should probably add this info to actions.c so
- * this can list an existing set of actions and extra ones are added from
- * a list automatically retrieved from actions.c
- */
-
#define ACTION_LIST_ICON_W 24
#define ACTION_LIST_ICON_H 24
@@ -22,12 +16,8 @@
#define ILIST_ICON_WITH_KEYBIND "enlightenment/e"
#define ILIST_ICON_WITHOUT_KEYBIND ""
-#define _DEFAULT_ACTION 0
-#define _NONDEFAULT_ACTION 1
-
-#define EDIT_RESTRICT_NONE (0 << 0)
-#define EDIT_RESTRICT_ACTION (1 << 0)
-#define EDIT_RESTRICT_PARAMS (1 << 1)
+#define AG_UNSORTED _("Unsorted")
+#define AG_AN_UNKNOWN _("Unknown")
#define E_BINDING_CONTEXT_NUMBER 10
@@ -44,7 +34,7 @@
static void _e_keybinding_default_keybinding_settings(E_Config_Dialog_Data *cfdata);
static void _e_keybinding_keybind_cb_del_keybinding(void *data, void *data2);
-static int _e_keybinding_keybind_delete_keybinding(E_Config_Dialog_Data *cfdata);
+static void _e_keybinding_keybind_delete_keybinding(E_Config_Dialog_Data *cfdata);
static void _e_keybinding_keybind_cb_add_keybinding(void *data, void *data2);
@@ -67,242 +57,40 @@
static int _e_keybinding_cb_mouse_handler_dumb(void *data, int type, void *event);
static int _e_keybinding_keybind_cb_auto_apply(E_Config_Dialog_Data *cfdata);
-/*******************************************************************************************/
-typedef struct _E_Config_KeyBind E_Config_KeyBind;
-typedef struct _E_Widget_IList_Data E_Widget_IList_Data;
-typedef struct _E_Widget_Radio_Data E_Widget_Radio_Data;
-typedef struct _E_Widget_Button_Data E_Widget_Button_Data;
-typedef struct _E_Widget_Entry_Data E_Widget_Entry_Data;
-
-typedef struct _E_Smart_Item E_Smart_Item;
-typedef struct _E_Smart_Data E_Smart_Data;
-
-typedef struct
-{
- char *action_name;
- char *action_cmd;
- char *action_params;
- int def_action;
- int restrictions;
-} ACTION;
-const ACTION actions_predefined_names[ ] = {
- {"Flip Desktop Left", "desk_flip_by", "-1 0", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Flip Desktop Right", "desk_flip_by", "1 0", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Flip Desktop Up", "desk_flip_by", "0 -1", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Flip Desktop Down", "desk_flip_by", "0 1", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Flip Desktop By", "desk_flip_by", NULL, _NONDEFAULT_ACTION, EDIT_RESTRICT_ACTION },
- {"Flip Desktop To", "desk_flip_to", NULL, _NONDEFAULT_ACTION, EDIT_RESTRICT_ACTION },
-/* These fuck with a lot of bindings like firefox, irssi, bitchx etcâ¦
- {"Switch To Left Desktop", "desk_linear_flip_by", "-1", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Switch To Right Desktop", "desk_linear_flip_by", "1", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
-*/
- {"Flip Desktop Linearlyâ¦", "desk_linear_flip_by", NULL, _NONDEFAULT_ACTION,
- EDIT_RESTRICT_ACTION },
- {"Switch To Desktop 0", "desk_linear_flip_to", "0", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Switch To Desktop 1", "desk_linear_flip_to", "1", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Switch To Desktop 2", "desk_linear_flip_to", "2", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Switch To Desktop 3", "desk_linear_flip_to", "3", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Switch To Desktop 4", "desk_linear_flip_to", "4", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Switch To Desktop 5", "desk_linear_flip_to", "5", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Switch To Desktop 6", "desk_linear_flip_to", "6", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Switch To Desktop 7", "desk_linear_flip_to", "7", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Switch To Desktop 8", "desk_linear_flip_to", "8", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Switch To Desktop 9", "desk_linear_flip_to", "9", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Switch To Desktop 10", "desk_linear_flip_to", "10", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Switch To Desktop 11", "desk_linear_flip_to", "11", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Switch To Desktopâ¦", "desk_linear_flip_to", NULL, _NONDEFAULT_ACTION, EDIT_RESTRICT_ACTION },
-
- {"Run Command", "exebuf", NULL, _DEFAULT_ACTION, EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Exit Enlightenment", "exit", NULL,
- _DEFAULT_ACTION, EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Restart Enlightenment", "restart", NULL,
- _DEFAULT_ACTION, EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
-
- {"Show Main Menu", "menu_show", "main", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Show Favorites Menu", "menu_show", "favorites", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Show Clients Menu", "menu_show", "clients", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Show Menuâ¦", "menu_show", NULL, _NONDEFAULT_ACTION, EDIT_RESTRICT_ACTION },
-
- {"Desktop Lock", "desk_lock", NULL, _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
-
- {"Toggle Edit Mode", "edit_mode_toggle", NULL, _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
-
- {"Window List - Next Window", "winlist", "next", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Window List - Previous Window", "winlist", "prev", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
-
- {"Window Move To Next Desktop", "window_desk_move_by", "1 0", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Window Move To Previous Desktop", "window_desk_move_by", "-1 0", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Window Move By Desktopâ¦", "window_desk_move_by", NULL, _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION },
- {"Window Move To Desktop 0", "window_desk_move_to", "0", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Window Move To Desktop 1", "window_desk_move_to", "1", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Window Move To Desktop 2", "window_desk_move_to", "2", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Window Move To Desktop 3", "window_desk_move_to", "3", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Window Move To Desktop 4", "window_desk_move_to", "4", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Window Move To Desktop 5", "window_desk_move_to", "5", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Window Move To Desktop 6", "window_desk_move_to", "6", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Window Move To Desktop 7", "window_desk_move_to", "7", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Window Move To Desktop 8", "window_desk_move_to", "8", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Window Move To Desktop 9", "window_desk_move_to", "9", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Window Move To Desktop 10", "window_desk_move_to", "10", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Window Move To Desktop 11", "window_desk_move_to", "11", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Window Move To Desktopâ¦", "window_desk_move_to", NULL, _NONDEFAULT_ACTION,
- EDIT_RESTRICT_ACTION },
- {"Window Maximize", "window_maximized_toggle", NULL, _DEFAULT_ACTION, EDIT_RESTRICT_ACTION },
- {"Window Maximize Vertically", "window_maximized_toggle", "vertical", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Window Maximize Horizontally", "window_maximized_toggle", "horizontal", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Window Iconic Mode Toggle", "window_iconic_toggle", NULL, _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Window Shaded Up Mode Toggle", "window_shaded_toggle", "up", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Window Shaded Down Mode Toggle", "window_shaded_toggle", "down", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Window Shaded Left Mode Toggle", "window_shaded_toggle", "left", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Window Shaded Right Mode Toggle", "window_shaded_toggle", "right", _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Window Sticky Mode Toggle", "window_sticky_toggle", NULL, _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
-
- {"Window Lower", "window_lower", NULL, _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Window Raise", "window_raise", NULL, _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Window Close", "window_close", NULL, _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Window Kill", "window_kill", NULL, _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
- {"Window Menu", "window_menu", NULL, _DEFAULT_ACTION,
- EDIT_RESTRICT_ACTION | EDIT_RESTRICT_PARAMS },
-
- {"Window Moveâ¦", "window_move", NULL, _NONDEFAULT_ACTION, EDIT_RESTRICT_ACTION },
- {"Window Move Toâ¦", "window_move_to", NULL, _NONDEFAULT_ACTION, EDIT_RESTRICT_ACTION },
- {"Window Move Byâ¦", "window_move_by", NULL, _NONDEFAULT_ACTION, EDIT_RESTRICT_ACTION },
- {"Window Resize Toâ¦", "window_resize", NULL, _NONDEFAULT_ACTION, EDIT_RESTRICT_ACTION },
- {"Window Resize Byâ¦", "window_resize_by", NULL, _NONDEFAULT_ACTION, EDIT_RESTRICT_ACTION },
- {"Window Drag Icon", "window_drag_icon", NULL, _NONDEFAULT_ACTION, EDIT_RESTRICT_ACTION },
-
- {"Application", "app", NULL, _NONDEFAULT_ACTION, EDIT_RESTRICT_ACTION },
- {"User Defined Actionsâ¦", "exec", NULL, _NONDEFAULT_ACTION, EDIT_RESTRICT_ACTION },
-// {"Unknown Action", NULL, NULL, _NONDEFAULT_ACTION, EDIT_RESTRICT_NONE },
- {NULL, NULL, NULL, _NONDEFAULT_ACTION, EDIT_RESTRICT_NONE }
-};
-
-struct _E_Smart_Data
-{
- Evas_Coord x, y, w, h;
-
- Evas_Object *smart_obj;
- Evas_Object *box_obj;
- Evas_List *items;
- int selected;
- Evas_Coord icon_w, icon_h;
- unsigned char selector : 1;
-};
-
-struct _E_Smart_Item
-{
- E_Smart_Data *sd;
- Evas_Object *base_obj;
- Evas_Object *icon_obj;
- void (*func) (void *data, void *data2);
- void (*func_hilight) (void *data, void *data2);
- void *data;
- void *data2;
-};
-
-struct _E_Widget_IList_Data
-{
- Evas_Object *o_widget, *o_scrollframe, *o_ilist;
- Evas_List *callbacks;
- char **value;
-};
-
-struct _E_Widget_Radio_Data
-{
- E_Radio_Group *group;
- Evas_Object *o_radio;
- int valnum;
-};
-
-struct _E_Widget_Button_Data
-{
- Evas_Object *o_button;
- Evas_Object *o_icon;
- void (*func) (void *data, void *data2);
- void *data;
- void *data2;
-};
+static void _fill_data(E_Config_Dialog_Data *cfdata);
+static int _action_group_list_sort_cb(void *e1, void *e2);
+static int _action_group_actions_list_sort_cb(void *e1, void *e2);
+/*******************************************************************************************/
-struct _E_Widget_Entry_Data
+typedef struct _action2
{
- Evas_Object *o_entry;
- Evas_Object *obj;
- char **valptr;
- void (*on_change_func) (void *data, Evas_Object *obj);
- void *on_change_data;
-};
+ const char *action_name;
+ const char *action_cmd;
+ const char *action_params;
+ int def_action;
+ int restrictions;
+ Evas_List *key_bindings;
+} ACTION2;
-struct _E_Config_KeyBind
+typedef struct _action_group
{
- int acn;
- Evas_List *bk_list;
-};
+ const char *action_group;
+ Evas_List *actions; // Here ACTION2 structure is used.
+} ACTION_GROUP;
struct _E_Config_Dialog_Data
{
E_Config_Dialog *cfd;
- Evas_List *key_bindings;
- int cur_eckb_kb_sel;
- E_Config_KeyBind *cur_eckb;
+ ACTION_GROUP *current_actg;
+ ACTION2 *current_act;
+ int current_act_selector;
+
Evas *evas;
int binding_context;
- char *key_bind;
char *key_action;
char *key_params;
@@ -329,6 +117,172 @@
int changed;
};
+/*******************************************************************************/
+
+
+Evas_List *action_group_list=NULL;
+
+int e_int_config_keybindings_register_action_predef_name(const char *action_group,
+ const char *action_name,
+ const char *action_cmd,
+ const char *action_params,
+ act_restrict_t restrictions,
+ int flag)
+{
+ ACTION_GROUP *actg = NULL;
+ ACTION2 *act = NULL;
+ Evas_List *ll;
+
+ if (!action_group || !action_name)
+ return 0;
+
+ for (ll = action_group_list; ll; ll = ll->next)
+ {
+ actg = ll->data;
+
+ if (!strcmp(actg->action_group, action_group))
+ break;
+ actg = NULL;
+ }
+
+ if (actg == NULL)
+ {
+ actg = E_NEW(ACTION_GROUP, 1);
+ if (!actg)
+ return 0;
+
+ actg->action_group = evas_stringshare_add(action_group);
+ actg->actions = NULL;
+
+ action_group_list = evas_list_append(action_group_list, actg);
+
+ action_group_list = evas_list_sort(action_group_list, evas_list_count(action_group_list),
+ _action_group_list_sort_cb);
+ }
+
+ for (ll = actg->actions; ll; ll = ll->next)
+ {
+ act = ll->data;
+ if (!strcmp(act->action_name, action_name))
+ break;
+ act = NULL;
+ }
+
+ if (act)
+ return 1;
+
+
+ act = E_NEW(ACTION2, 1);
+ if (!act)
+ return 0;
+ act->action_name = action_name == NULL ? NULL : evas_stringshare_add(action_name);
+ act->action_cmd = action_cmd == NULL ? NULL : evas_stringshare_add(action_cmd);
+ act->action_params = action_params == NULL ? NULL : evas_stringshare_add(action_params);
+ act->restrictions = restrictions;
+ act->def_action = flag;
+ act->key_bindings = NULL;
+
+ actg->actions = evas_list_append(actg->actions, act);
+#if 0
+ actg->actions = evas_list_sort(actg->actions, evas_list_count(actg->actions),
+ _action_group_actions_list_sort_cb);
+#endif
+
+ return 1;
+}
+
+int e_int_config_keybindings_unregister_action_predef_name(const char *action_group,
+ const char *action_name)
+{
+ ACTION_GROUP *actg;
+ ACTION2 *act;
+ Evas_List *l, *l2, *l3;
+
+ for (l = action_group_list; l; l = l->next)
+ {
+ actg = l->data;
+ if (!strcmp(actg->action_group, action_group))
+ {
+ for (l2 = actg->actions; l2; l2 = l2->next)
+ {
+ act = l2->data;
+ if (!strcmp(act->action_name, action_name))
+ {
+ actg->actions = evas_list_remove(actg->actions, l2);
+
+ if (act->action_name) evas_stringshare_del(act->action_name);
+ if (act->action_cmd) evas_stringshare_del(act->action_cmd);
+ if (act->action_params) evas_stringshare_del(act->action_params);
+
+ for (l3 = act->key_bindings; l3; l3 = l3->next)
+ {
+ E_Config_Binding_Key *eb = l3->data;
+ if (eb->key) evas_stringshare_del(eb->key);
+ if (eb->action) evas_stringshare_del(eb->action);
+ if (eb->params) evas_stringshare_del(eb->params);
+ E_FREE(eb);
+ }
+
+ E_FREE(act);
+ break;
+ }
+ }
+
+ if (evas_list_count(actg->actions) == 0)
+ {
+ action_group_list = evas_list_remove(action_group_list, l);
+ if (actg->action_group) evas_stringshare_del(actg->action_group);
+ E_FREE(actg);
+ }
+ break;
+ }
+ }
+
+ return 1;
+}
+
+void e_int_config_keybindings_unregister_all_action_predef_names()
+{
+ ACTION_GROUP *actg;
+ ACTION2 *act;
+ Evas_List *l, *l2, *l3;
+
+ while (action_group_list)
+ {
+ actg = action_group_list->data;
+
+ while (actg->actions)
+ {
+ act = actg->actions->data;
+
+ if (act->action_name) evas_stringshare_del(act->action_name);
+ if (act->action_cmd) evas_stringshare_del(act->action_cmd);
+ if (act->action_params) evas_stringshare_del(act->action_params);
+
+ for (l3 = act->key_bindings; l3; l3 = l3->next)
+ {
+ E_Config_Binding_Key *eb = l3->data;
+ if (eb->key) evas_stringshare_del(eb->key);
+ if (eb->action) evas_stringshare_del(eb->action);
+ if (eb->params) evas_stringshare_del(eb->params);
+ E_FREE(eb);
+ }
+
+ E_FREE(act);
+
+ actg->actions = evas_list_remove_list(actg->actions, actg->actions);
+ }
+
+ if (actg->action_group) evas_stringshare_del(actg->action_group);
+ E_FREE(actg);
+
+ action_group_list = evas_list_remove_list(action_group_list, action_group_list);
+ }
+
+ action_group_list = NULL;
+}
+/*******************************************************************************/
+
EAPI E_Config_Dialog *
e_int_config_keybindings(E_Container *con)
@@ -349,116 +303,121 @@
}
static void
-_fill_keybindings_data(E_Config_Dialog_Data *cfdata)
+_fill_data(E_Config_Dialog_Data *cfdata)
{
- int i, j;
- E_Config_KeyBind *eckb;
- E_Config_Binding_Key *bk, *t;
+ E_Config_Binding_Key *eb, *t;
+ Evas_List *l, *l2, *l3;
+ ACTION_GROUP *actg;
+ ACTION2 *act;
+ int done;
+
+ e_int_config_keybindings_register_action_predef_name(AG_UNSORTED, AG_AN_UNKNOWN,
+ NULL, NULL,
+ EDIT_RESTRICT_NONE, 1);
+
+ for (l = e_config->key_bindings; l; l = l->next)
+ {
+ int found;
+ t = l->data;
- for( i = 0; actions_predefined_names[i].action_name; i++ )
- {
- eckb = E_NEW(E_Config_KeyBind, 1);
- if(!eckb)
- continue;
-
- eckb->acn = i;
-
- eckb->bk_list = NULL;
- cfdata->key_bindings = evas_list_append(cfdata->key_bindings, eckb);
- eckb = NULL;
- }
+ found = 0;
+ for (l2 = action_group_list; l2 && !found; l2 = l2->next)
+ {
+ actg = l2->data;
- for (i = 0; i < evas_list_count(e_config->key_bindings); i++)
- {
- t = evas_list_nth(e_config->key_bindings, i);
+ /* here we are looking for actions with params */
+ for (l3 = actg->actions; l3 && !found; l3 = l3->next)
+ {
+ act = l3->data;
- bk = NULL;
- for (j = 0; j < evas_list_count(cfdata->key_bindings); j++)
- {
- eckb = evas_list_nth(cfdata->key_bindings, j);
+ if ((!act->action_cmd || !act->action_cmd[0]) && (t->action && t->action[0]) ||
+ (!t->action || !t->action[0]) && (act->action_cmd && act->action_cmd[0]))
+ continue;
- if (t->params == NULL)
- {
- // should I check if actions_pre... has a non-NULL params ?
- if (strcasecmp(actions_predefined_names[eckb->acn].action_cmd == NULL ? "" :
- actions_predefined_names[eckb->acn].action_cmd, t->action) == 0)
- {
- // here we found a first occurience of such action;
- bk = E_NEW(E_Config_Binding_Key, 1);
- if (!bk)
- continue;
+ if (t->params && t->params[0]) // here we have that action has params
+ {
+ if (!act->action_params || !act->action_params[0])
+ continue;
- bk->context = t->context;
- bk->key = evas_stringshare_add(t->key);
- bk->modifiers = t->modifiers;
- bk->any_mod = t->any_mod;
- bk->action = t->action == NULL ?
- NULL : evas_stringshare_add(t->action);
- bk->params = t->params == NULL ?
- NULL : evas_stringshare_add(t->params);
-
- eckb->bk_list = evas_list_append(eckb->bk_list, bk);
- break;
- }
- }
- else if (t->action != NULL && t->params != NULL)
- {
- if (strcasecmp(actions_predefined_names[eckb->acn].action_cmd == NULL ?
- "" : actions_predefined_names[eckb->acn].action_cmd,
- t->action) == 0 &&
- strcasecmp(actions_predefined_names[eckb->acn].action_params == NULL ?
- "" : actions_predefined_names[eckb->acn].action_params,
- t->params) == 0)
- {
- bk = E_NEW(E_Config_Binding_Key, 1);
- if (!bk)
- continue;
+ if (strcmp(!act->action_cmd ? "" : act->action_cmd,
+ !t->action ? "" : t->action) == 0 &&
+ strcmp(act->action_params, t->params) == 0)
+ {
+ eb = E_NEW(E_Config_Binding_Key, 1);
+ if (!eb) continue;
+
+ eb->context = t->context;
+ eb->modifiers = t->modifiers;
+ eb->key = (!t->key) ? evas_stringshare_add("") :
+ evas_stringshare_add(t->key);
+ eb->action = (!t->action) ? NULL : evas_stringshare_add(t->action);
+ eb->params = (!t->params) ? NULL : evas_stringshare_add(t->params);
+ eb->any_mod = t->any_mod;
+
+ act->key_bindings = evas_list_append(act->key_bindings, eb);
+
+ found = 1;
+ }
+ }
+ }
+
+ /* here we are looking for actions without parmas and for unsorted actions */
+ for (l3 = actg->actions; l3 && !found; l3 = l3->next)
+ {
+ act = l3->data;
- bk->context = t->context;
- bk->key = evas_stringshare_add(t->key);
- bk->modifiers = t->modifiers;
- bk->any_mod = t->any_mod;
- bk->action = t->action == NULL ?
- NULL : evas_stringshare_add(t->action);
- bk->params = t->params == NULL ?
- NULL : evas_stringshare_add(t->params);
-
- eckb->bk_list = evas_list_append(eckb->bk_list, bk);
- break;
- }
- }
-
- if (!bk && actions_predefined_names[eckb->acn].def_action == _NONDEFAULT_ACTION)
- {
- if (strcasecmp(actions_predefined_names[eckb->acn].action_cmd == NULL ?
- "" : actions_predefined_names[eckb->acn].action_cmd,
- t->action) == 0 )
- {
- bk = E_NEW(E_Config_Binding_Key, 1);
- if (!bk)
+ if (act->action_params && act->action_params[0])
continue;
- bk->context = t->context;
- bk->key = evas_stringshare_add(t->key);
- bk->modifiers = t->modifiers;
- bk->any_mod = t->any_mod;
- bk->action = t->action == NULL ?
- NULL : evas_stringshare_add(t->action);
- bk->params = t->params == NULL ?
- NULL : evas_stringshare_add(t->params);
-
- eckb->bk_list = evas_list_append(eckb->bk_list, bk);
- break;
- }
- }// if (!bk ...)
- }
- }
+ if (!strcmp(actg->action_group, AG_UNSORTED) &&
+ !strcmp(act->action_name, AG_AN_UNKNOWN))
+ {
+ eb = E_NEW(E_Config_Binding_Key, 1);
+ if (!eb) continue;
+
+ eb->context = t->context;
+ eb->modifiers = t->modifiers;
+ eb->key = t->key == NULL ? evas_stringshare_add("") :
+ evas_stringshare_add(t->key);
+ eb->action = t->action == NULL ? NULL : evas_stringshare_add(t->action);
+ eb->params = t->params == NULL ? NULL : evas_stringshare_add(t->params);
+ eb->any_mod = t->any_mod;
+
+ act->key_bindings = evas_list_append(act->key_bindings, eb);
+ found = 1;
+ break;
+ }
+
+ if ((!act->action_cmd || !act->action_cmd[0]) && (t->action && t->action[0]) ||
+ (!t->action || !t->action[0]) && (act->action_cmd && act->action_cmd[0]))
+ continue;
+
+ if (strcmp(!act->action_cmd ? "" : act->action_cmd,
+ !t->action ? "" : t->action) == 0)
+ {
+ eb = E_NEW(E_Config_Binding_Key, 1);
+ if (!eb) continue;
+
+ eb->context = t->context;
+ eb->modifiers = t->modifiers;
+ eb->key = (!t->key) ? evas_stringshare_add("") :
+ evas_stringshare_add(t->key);
+ eb->action = (!t->action) ? NULL : evas_stringshare_add(t->action);
+ eb->params = (!t->params) ? NULL : evas_stringshare_add(t->params);
+ eb->any_mod = t->any_mod;
+
+ act->key_bindings = evas_list_append(act->key_bindings, eb);
+
+ found = 1;
+ }
+ }
+ }
+ }
cfdata->locals.keybind_win = 0;
cfdata->locals.handlers = NULL;
cfdata->locals.dia = NULL;
cfdata->changed = 0;
}
-
static void *
_create_data(E_Config_Dialog *cfd)
{
@@ -467,11 +426,10 @@
cfdata = E_NEW(E_Config_Dialog_Data, 1);
cfdata->binding_context = -1;//E_BINDING_CONTEXT_ANY;
- cfdata->key_bind = strdup("");
cfdata->key_action = strdup("");
cfdata->key_params = strdup("");
- _fill_keybindings_data(cfdata);
+ _fill_data(cfdata);
cfdata->cfd = cfd;
return cfdata;
@@ -480,119 +438,98 @@
static void
_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
- unsigned int i, j;
- unsigned int size, size2;
- E_Config_KeyBind *eckb;
- E_Config_Binding_Key *bk;
-
-
- E_FREE(cfdata->key_bind);
- E_FREE(cfdata->key_action);
- E_FREE(cfdata->key_params);
+ Evas_List *l, *l2;
+ E_FREE(cfdata->key_action);
+ E_FREE(cfdata->key_params);
+ for (l = action_group_list; l; l = l->next)
+ {
+ ACTION_GROUP *actg = l->data;
+ for (l2 = actg->actions; l2; l2 = l2->next)
+ {
+ ACTION2 *act = l2->data;
+ while (act->key_bindings)
+ {
+ E_Config_Binding_Key *eb = act->key_bindings->data;
- size = evas_list_count(cfdata->key_bindings);
- for (i = 0; i < size; i++)
- {
- eckb = evas_list_nth(cfdata->key_bindings, i);
- if (eckb)
- {
- size2 = evas_list_count(eckb->bk_list);
- for (j = 0; j < size2; j++)
- {
- bk = evas_list_nth(eckb->bk_list, j);
- if (bk)
- {
- if (bk->key) evas_stringshare_del(bk->key);
- if (bk->action) evas_stringshare_del(bk->action);
- if (bk->params) evas_stringshare_del(bk->params);
- E_FREE(bk);
- }
- }
- evas_list_free(eckb->bk_list);
- E_FREE(eckb);
- }
- }
- evas_list_free(cfdata->key_bindings);
- free(cfdata);
+ if (eb)
+ {
+ if (eb->key) evas_stringshare_del(eb->key);
+ if (eb->action) evas_stringshare_del(eb->action);
+ if (eb->params) evas_stringshare_del(eb->params);
+ E_FREE(eb);
+ }
+ act->key_bindings = evas_list_remove_list(act->key_bindings, act->key_bindings);
+ }
+ }
+ }
+ free(cfdata);
}
static int
_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
- E_Config_KeyBind *eckb;
- E_Config_Binding_Key *bk, *bk2;
- size_t size, size2;
- unsigned int i, j;
-
- //we should call for autoapply here, since this prevents a bug, when only one
- //NEW keybinding is made and apply/ok button is pressed. Thus, this keybinding does
- //not lost.
- if (cfdata->cur_eckb)
- if (_e_keybinding_keybind_cb_auto_apply(cfdata) != 0)
- {
- //TODO: message box which should ask if we really should proceed.
- //If yes, then the current 'empty' binding will be deleted
- //_keybind_delete_keybinding(cfdata);
- }
+ Evas_List *l, *l2, *l3;
+ if (!cfdata) return 0;
- // here the removing of the old keybindings goes
- e_managers_keys_ungrab();
- while (e_config->key_bindings)
- {
- E_Config_Binding_Key *eb;
-
- eb = e_config->key_bindings->data;
+ if (cfdata->current_actg && cfdata->current_act)
+ if (_e_keybinding_keybind_cb_auto_apply(cfdata) != 1)
+ {
+ //TODO: message box which should ask if we really should proceed.
+ //If yes, then the current 'empty' binding will be deleted
+ //_keybind_delete_keybinding(cfdata);
+ }
- e_bindings_key_del(eb->context, eb->key, eb->modifiers, eb->any_mod,
- eb->action, eb->params);
+ e_managers_keys_ungrab();
+ while(e_config->key_bindings)
+ {
+ E_Config_Binding_Key *eb;
- e_config->key_bindings = evas_list_remove_list(e_config->key_bindings,
+ eb = e_config->key_bindings->data;
+ e_bindings_key_del(eb->context, eb->key, eb->modifiers, eb->any_mod,
+ eb->action, eb->params);
+ e_config->key_bindings = evas_list_remove_list(e_config->key_bindings,
e_config->key_bindings);
- if (eb->key) evas_stringshare_del(eb->key);
- if (eb->action) evas_stringshare_del(eb->action);
- if (eb->params) evas_stringshare_del(eb->params);
- E_FREE(eb);
- }
+ if (eb->key) evas_stringshare_del(eb->key);
+ if (eb->action) evas_stringshare_del(eb->action);
+ if (eb->params) evas_stringshare_del(eb->params);
+ E_FREE(eb);
+ }
- // here the adding of new keybinds are going.
- size = evas_list_count(cfdata->key_bindings);
- for (i = 0; i < size; i++)
- {
- eckb = evas_list_nth(cfdata->key_bindings, i);
- if (eckb)
- {
- size2 = evas_list_count(eckb->bk_list);
- for (j = 0; j < size2; j++)
- {
- bk = evas_list_nth(eckb->bk_list, j);
- if (bk && bk->key && strlen(bk->key) > 0)
- {
- bk2 = E_NEW(E_Config_Binding_Key, 1);
- if (bk2)
- {
- bk2->context = bk->context;
- bk2->key = evas_stringshare_add(bk->key);
- bk2->modifiers = bk->modifiers;
- bk2->any_mod = bk->any_mod;
- bk2->action = bk->action == NULL ? NULL :
- (char *)evas_stringshare_add(bk->action);
- bk2->params = bk->params == NULL ? NULL :
- (char *)evas_stringshare_add(bk->params);
- e_config->key_bindings = evas_list_append(e_config->key_bindings, bk2);
- e_bindings_key_add(bk->context, bk->key, bk->modifiers, bk->any_mod,
- bk->action, bk->params);
- }
- }
- }
- }
- }
- e_managers_keys_grab();
- e_config_save_queue();
- cfdata->changed = 0;
- return 1;
+ for (l = action_group_list; l; l = l->next)
+ {
+ ACTION_GROUP *actg = l->data;
+ for (l2 = actg->actions; l2; l2 = l2->next)
+ {
+ ACTION2 *act = l2->data;
+ for (l3 = act->key_bindings; l3; l3 = l3->next)
+ {
+ E_Config_Binding_Key *eb, *eb2;
+ eb = l3->data;
+ if (!eb || !eb->key || !eb->key[0]) continue;
+
+ eb2 = E_NEW(E_Config_Binding_Key, 1);
+ if (!eb2) continue;
+
+ eb2->context = eb->context;
+ eb2->key = evas_stringshare_add(eb->key);
+ eb2->modifiers = eb->modifiers;
+ eb2->any_mod = eb->any_mod;
+ eb2->action = !eb->action || !eb->action[0] ? NULL :
+ evas_stringshare_add(eb->action);
+ eb2->params = !eb->params || !eb->params[0] ? NULL :
+ evas_stringshare_add(eb->params);
+ e_config->key_bindings = evas_list_append(e_config->key_bindings, eb2);
+ e_bindings_key_add(eb->context, eb->key, eb->modifiers, eb->any_mod,
+ eb->action, eb->params);
+ }
+ }
+ }
+ e_managers_keys_grab();
+ e_config_save_queue();
+ cfdata->changed = 0;
+ return 1;
}
-
static Evas_Object *
_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
{
@@ -603,7 +540,6 @@
int mw, mh;
cfdata->evas = evas;
- //_fill_keybindings_data(cfdata);
ot = e_widget_table_add(evas, 0);
{
@@ -612,11 +548,35 @@
cfdata->gui.action_ilist = e_widget_ilist_add(evas, ACTION_LIST_ICON_W,
ACTION_LIST_ICON_H, NULL);
{
- Evas_List *l;
+ Evas_List *l, *l2;
+ ACTION_GROUP *actg = NULL;
+ ACTION2 *act = NULL;
+
e_widget_on_change_hook_set(cfdata->gui.action_ilist, _e_keybinding_action_ilist_cb_change,
cfdata);
- for (l = cfdata->key_bindings; l; l = l->next)
+ for (l = action_group_list; l; l = l->next)
+ {
+ //TODO:possible: do not show Unsorted:Unknow group if there are no unsorted actions.
+ actg = l->data;
+ e_widget_ilist_header_append(cfdata->gui.action_ilist, NULL, actg->action_group);
+
+ for (l2 = actg->actions; l2; l2 = l2->next)
+ {
+ Evas_Object *ic = NULL;
+ act = l2->data;
+
+ ic = edje_object_add(evas);
+ if (evas_list_count(act->key_bindings))
+ e_util_edje_icon_set(ic, ILIST_ICON_WITH_KEYBIND);
+ else
+ e_util_edje_icon_set(ic, ILIST_ICON_WITHOUT_KEYBIND);
+
+ e_widget_ilist_append(cfdata->gui.action_ilist, ic,
+ act->action_name, NULL, NULL, NULL);
+ }
+ }
+ /*for (l = cfdata->key_bindings; l; l = l->next)
{
Evas_Object *ic;
E_Config_KeyBind *eckb;
@@ -631,7 +591,7 @@
e_widget_ilist_append(cfdata->gui.action_ilist, ic,
_(actions_predefined_names[eckb->acn].action_name),
NULL, NULL, NULL);
- }
+ }*/
e_widget_min_size_set(cfdata->gui.action_ilist, 250, 330);
e_widget_ilist_go(cfdata->gui.action_ilist);
}
@@ -792,95 +752,100 @@
static void
_e_keybinding_binding_ilist_cb_change(void *data, Evas_Object *obj)
{
- int indx;
- E_Config_Dialog_Data *cfdata;
- E_Config_Binding_Key *bk;
+ E_Config_Dialog_Data *cfdata;
+ int indx;
- cfdata = data;
- if (!cfdata) return;
+ if (!(cfdata = data)) return;
- if (cfdata->cur_eckb)
- if (_e_keybinding_keybind_cb_auto_apply(cfdata) != 0)
- {
- //TODO: message box which should ask if we really should proceed.
- //If yes, then the current 'empty' binding will be deleted
- //_keybind_delete_keybinding(cfdata);
- }
+ if (cfdata->current_actg && cfdata->current_act)
+ if (_e_keybinding_keybind_cb_auto_apply(cfdata) != 1)
+ {
+ //TODO: message box which should ask if we really should proceed.
+ //If yes, then the current 'empty' binding will be deleted
+ //_keybind_delete_keybinding(cfdata);
+ }
+
+ if (!cfdata->current_actg && !cfdata->current_act)
+ return;
+
+ indx = e_widget_ilist_selected_get(cfdata->gui.binding_ilist);
+ if (indx < 0 || indx >= e_widget_ilist_count(cfdata->gui.binding_ilist))
+ return;
+
+ cfdata->current_act_selector = indx;
+
+ _e_keybinding_update_context_radios(cfdata);
+ _e_keybinding_update_action_param_entries(cfdata);
+ _e_keybinding_update_keybinding_button(cfdata);
+ _e_keybinding_update_add_delete_buttons(cfdata);
- indx = e_widget_ilist_selected_get(cfdata->gui.binding_ilist);
- if (indx < 0 || indx >= e_widget_ilist_count(cfdata->gui.binding_ilist))
- {
- return;
- }
-
- cfdata->cur_eckb_kb_sel = indx;
-
- if (cfdata->cur_eckb)
- {
- _e_keybinding_update_context_radios(cfdata);
- _e_keybinding_update_action_param_entries(cfdata);
- _e_keybinding_update_keybinding_button(cfdata);
- _e_keybinding_update_add_delete_buttons(cfdata);
- }
}
static void
_e_keybinding_action_ilist_cb_change(void *data, Evas_Object *obj)
{
- int acn;
- E_Config_Dialog_Data *cfdata;
- E_Config_KeyBind *eckb;
- Evas_List *l;
- char *label;
+ E_Config_Dialog_Data *cfdata;
+ Evas_List *l, *l2;
+ ACTION_GROUP *actg = NULL;
+ ACTION2 *act = NULL;
+ char *label;
+ int done;
+
+ cfdata = data;
+
+ if (!cfdata) return;
+
+ if (cfdata->current_actg)
+ if (_e_keybinding_keybind_cb_auto_apply(cfdata) != 1)
+ {
+ //TODO: message box which should ask if we really should proceed.
+ //If yes, then the current 'empty' binding will be deleted
+ //_keybind_delete_keybinding(cfdata);
+ }
+ _e_keybinding_default_keybinding_settings(cfdata);
- cfdata = data;
+ label = strdup(e_widget_ilist_selected_label_get(obj));
- if (!cfdata) return;
-
-
- if (cfdata->cur_eckb)
- if (_e_keybinding_keybind_cb_auto_apply(cfdata) != 0)
- {
- //TODO: message box which should ask if we really should proceed.
- //If yes, then the current 'empty' binding will be deleted
- //_keybind_delete_keybinding(cfdata);
- }
- _e_keybinding_default_keybinding_settings(cfdata);
+ done = 0;
+ for (l = action_group_list; l && !done; l = l->next)
+ {
+ actg = l->data;
- label = strdup(e_widget_ilist_selected_label_get(obj));
- for (acn = 0; strcasecmp(label, _(actions_predefined_names[acn].action_name) == NULL ? "" :
- _(actions_predefined_names[acn].action_name)) != 0; acn++ );
+ for (l2 = actg->actions; l2 && !done; l2 = l2->next)
+ {
+ act = l2->data;
- for (l = cfdata->key_bindings; l; l = l->next)
- {
- eckb = l->data;
- if (eckb->acn == acn)
- break;
- eckb = NULL;
- }
+ if (!strcmp(act->action_name, label))
+ {
+ cfdata->current_actg = actg;
+ cfdata->current_act = act;
+ done = 1;
+ }
+ }
+ }
- cfdata->cur_eckb = eckb;
- if (evas_list_count(cfdata->cur_eckb->bk_list))
- cfdata->cur_eckb_kb_sel = 0;
+ _e_keybinding_update_binding_list(cfdata);
+ //FIXME:is this is really needed ?
+ _e_keybinding_update_add_delete_buttons(cfdata);
- _e_keybinding_update_binding_list(cfdata);
- _e_keybinding_update_add_delete_buttons(cfdata);
+ _e_keybinding_update_action_ilist_cur_selection_icon(cfdata);
- /*if (cfdata->changed == 0)
- {*/
- //e_dialog_button_disable_num_set(cfdata->cfd->dia, 0, 1);
- //e_dialog_button_disable_num_set(cfdata->cfd->dia, 1, 1);
- //}
+#if 0
+ if (cfdata->changed == 0)
+ {
+ e_dialog_button_disable_num_set(cfdata->cfd->dia, 0, 1);
+ e_dialog_button_disable_num_set(cfdata->cfd->dia, 1, 1);
+ }
+#endif
}
-
static void
_e_keybinding_default_keybinding_settings(E_Config_Dialog_Data *cfdata)
{
if (!cfdata) return;
- cfdata->cur_eckb = NULL;
- cfdata->cur_eckb_kb_sel = -1;
- E_FREE(cfdata->key_bind);
- cfdata->key_bind = strdup("");
+ cfdata->current_actg = NULL;
+ cfdata->current_act = NULL;
+ cfdata->current_act_selector = -1;
+
E_FREE(cfdata->key_action);
cfdata->key_action = strdup("");
E_FREE(cfdata->key_params);
@@ -900,90 +865,58 @@
e_widget_disabled_set(cfdata->gui.btn_add, 1);
e_widget_disabled_set(cfdata->gui.btn_del, 1);
- if (!cfdata->cur_eckb) return;
+ if (!cfdata->current_actg && !cfdata->current_act) return;
e_widget_disabled_set(cfdata->gui.btn_add, 0);
- if (cfdata->cur_eckb_kb_sel >= 0)
+ if (cfdata->current_act_selector >= 0)
e_widget_disabled_set(cfdata->gui.btn_del, 0);
}
static void
_e_keybinding_update_keybinding_button(E_Config_Dialog_Data *cfdata)
{
- char *b;
- E_Config_Binding_Key *bk;
- E_Widget_Button_Data *wd;
-
- if (cfdata == NULL) return;
+ E_Config_Binding_Key *eb;
- wd = e_widget_data_get(cfdata->gui.btn_keybind);
-
- if (cfdata->cur_eckb == NULL || cfdata->cur_eckb_kb_sel < 0)
- {
- e_widget_disabled_set(cfdata->gui.btn_keybind, 1);
- edje_object_part_text_set(wd->o_button, "label", BTN_ASSIGN_KEYBINDING_TEXT);
+ if (!cfdata) return;
- E_FREE(cfdata->key_bind);
- cfdata->key_bind = strdup("");
- }
- else
- {
- bk = evas_list_nth(cfdata->cur_eckb->bk_list, cfdata->cur_eckb_kb_sel);
-
- E_FREE(cfdata->key_bind);
- cfdata->key_bind = strdup(bk->key);
+ if ((!cfdata->current_actg && !cfdata->current_act) || cfdata->current_act_selector < 0)
+ {
+ e_widget_disabled_set(cfdata->gui.btn_keybind, 1);
+ e_widget_button_label_set(cfdata->gui.btn_keybind, BTN_ASSIGN_KEYBINDING_TEXT);
+ }
+ else
+ {
+ eb = evas_list_nth(cfdata->current_act->key_bindings, cfdata->current_act_selector);
- e_widget_disabled_set(cfdata->gui.btn_keybind, 0);
- if (bk && bk->key && bk->key[0])
- {
- b = _e_keybinding_get_keybinding_text(bk);
- edje_object_part_text_set(wd->o_button, "label", b);
- free(b);
- }
- else
- edje_object_part_text_set(wd->o_button, "label", BTN_ASSIGN_KEYBINDING_TEXT);
- }
+ e_widget_disabled_set(cfdata->gui.btn_keybind, 0);
+ if (eb && eb->key && eb->key[0])
+ {
+ char *b = _e_keybinding_get_keybinding_text(eb);
+ e_widget_button_label_set(cfdata->gui.btn_keybind, b);
+ free(b);
+ }
+ else
+ e_widget_button_label_set(cfdata->gui.btn_keybind, BTN_ASSIGN_KEYBINDING_TEXT);
+ }
}
-
-
static void
_e_keybinding_update_context_radios(E_Config_Dialog_Data *cfdata)
{
- E_Widget_Radio_Data *wd;
- E_Config_Binding_Key *bk;
-
- if (cfdata == NULL) return;
-
- wd = e_widget_data_get(cfdata->gui.bind_context[E_BINDING_CONTEXT_NONE]);
- edje_object_signal_emit(wd->o_radio, "toggle_off", "");
-
- wd = e_widget_data_get(cfdata->gui.bind_context[E_BINDING_CONTEXT_UNKNOWN]);
- edje_object_signal_emit(wd->o_radio, "toggle_off", "");
-
- wd = e_widget_data_get(cfdata->gui.bind_context[E_BINDING_CONTEXT_BORDER]);
- edje_object_signal_emit(wd->o_radio, "toggle_off", "");
-
- wd = e_widget_data_get(cfdata->gui.bind_context[E_BINDING_CONTEXT_ZONE]);
- edje_object_signal_emit(wd->o_radio, "toggle_off", "");
-
- wd = e_widget_data_get(cfdata->gui.bind_context[E_BINDING_CONTEXT_CONTAINER]);
- edje_object_signal_emit(wd->o_radio, "toggle_off", "");
-
- wd = e_widget_data_get(cfdata->gui.bind_context[E_BINDING_CONTEXT_MANAGER]);
- edje_object_signal_emit(wd->o_radio, "toggle_off", "");
-
- wd = e_widget_data_get(cfdata->gui.bind_context[E_BINDING_CONTEXT_MENU]);
- edje_object_signal_emit(wd->o_radio, "toggle_off", "");
+ E_Config_Binding_Key *eb;
- wd = e_widget_data_get(cfdata->gui.bind_context[E_BINDING_CONTEXT_WINLIST]);
- edje_object_signal_emit(wd->o_radio, "toggle_off", "");
-
- wd = e_widget_data_get(cfdata->gui.bind_context[E_BINDING_CONTEXT_POPUP]);
- edje_object_signal_emit(wd->o_radio, "toggle_off", "");
+ if (!cfdata) return;
- wd = e_widget_data_get(cfdata->gui.bind_context[E_BINDING_CONTEXT_ANY]);
- edje_object_signal_emit(wd->o_radio, "toggle_off", "");
+ e_widget_radio_toggle_set(cfdata->gui.bind_context[E_BINDING_CONTEXT_NONE], 0);
+ e_widget_radio_toggle_set(cfdata->gui.bind_context[E_BINDING_CONTEXT_UNKNOWN], 0);
+ e_widget_radio_toggle_set(cfdata->gui.bind_context[E_BINDING_CONTEXT_BORDER], 0);
+ e_widget_radio_toggle_set(cfdata->gui.bind_context[E_BINDING_CONTEXT_ZONE], 0);
+ e_widget_radio_toggle_set(cfdata->gui.bind_context[E_BINDING_CONTEXT_CONTAINER], 0);
+ e_widget_radio_toggle_set(cfdata->gui.bind_context[E_BINDING_CONTEXT_MANAGER], 0);
+ e_widget_radio_toggle_set(cfdata->gui.bind_context[E_BINDING_CONTEXT_MENU], 0);
+ e_widget_radio_toggle_set(cfdata->gui.bind_context[E_BINDING_CONTEXT_WINLIST], 0);
+ e_widget_radio_toggle_set(cfdata->gui.bind_context[E_BINDING_CONTEXT_POPUP], 0);
+ e_widget_radio_toggle_set(cfdata->gui.bind_context[E_BINDING_CONTEXT_ANY], 0);
e_widget_disabled_set(cfdata->gui.bind_context[E_BINDING_CONTEXT_NONE], 1);
e_widget_disabled_set(cfdata->gui.bind_context[E_BINDING_CONTEXT_UNKNOWN], 1);
@@ -996,7 +929,7 @@
e_widget_disabled_set(cfdata->gui.bind_context[E_BINDING_CONTEXT_POPUP], 1);
e_widget_disabled_set(cfdata->gui.bind_context[E_BINDING_CONTEXT_ANY], 1);
- if (cfdata->cur_eckb_kb_sel < 0) return;
+ if (cfdata->current_act_selector < 0) return;
e_widget_disabled_set(cfdata->gui.bind_context[E_BINDING_CONTEXT_NONE], 0);
e_widget_disabled_set(cfdata->gui.bind_context[E_BINDING_CONTEXT_UNKNOWN], 0);
@@ -1009,258 +942,193 @@
e_widget_disabled_set(cfdata->gui.bind_context[E_BINDING_CONTEXT_POPUP], 0);
e_widget_disabled_set(cfdata->gui.bind_context[E_BINDING_CONTEXT_ANY], 0);
- if ((bk = evas_list_nth(cfdata->cur_eckb->bk_list, cfdata->cur_eckb_kb_sel)) == NULL )
+ if ((eb = evas_list_nth(cfdata->current_act->key_bindings, cfdata->current_act_selector)) == NULL)
return;
- if (bk->context == E_BINDING_CONTEXT_NONE)
+ if (eb->context == E_BINDING_CONTEXT_NONE)
{
cfdata->binding_context = E_BINDING_CONTEXT_NONE;
- wd = e_widget_data_get(cfdata->gui.bind_context[E_BINDING_CONTEXT_NONE]);
- edje_object_signal_emit(wd->o_radio, "toggle_on", "");
+ e_widget_radio_toggle_set(cfdata->gui.bind_context[E_BINDING_CONTEXT_NONE], 1);
}
- if (bk->context == E_BINDING_CONTEXT_UNKNOWN)
+ if (eb->context == E_BINDING_CONTEXT_UNKNOWN)
{
cfdata->binding_context = E_BINDING_CONTEXT_UNKNOWN;
- wd = e_widget_data_get(cfdata->gui.bind_context[E_BINDING_CONTEXT_UNKNOWN]);
- edje_object_signal_emit(wd->o_radio, "toggle_on", "");
+ e_widget_radio_toggle_set(cfdata->gui.bind_context[E_BINDING_CONTEXT_UNKNOWN], 1);
}
- if (bk->context == E_BINDING_CONTEXT_BORDER)
+ if (eb->context == E_BINDING_CONTEXT_BORDER)
{
cfdata->binding_context = E_BINDING_CONTEXT_BORDER;
- wd = e_widget_data_get(cfdata->gui.bind_context[E_BINDING_CONTEXT_BORDER]);
- edje_object_signal_emit(wd->o_radio, "toggle_on", "");
+ e_widget_radio_toggle_set(cfdata->gui.bind_context[E_BINDING_CONTEXT_BORDER], 1);
}
- if (bk->context == E_BINDING_CONTEXT_ZONE)
+ if (eb->context == E_BINDING_CONTEXT_ZONE)
{
cfdata->binding_context = E_BINDING_CONTEXT_ZONE;
- wd = e_widget_data_get(cfdata->gui.bind_context[E_BINDING_CONTEXT_ZONE]);
- edje_object_signal_emit(wd->o_radio, "toggle_on", "");
+ e_widget_radio_toggle_set(cfdata->gui.bind_context[E_BINDING_CONTEXT_ZONE], 1);
}
- if (bk->context == E_BINDING_CONTEXT_CONTAINER)
+ if (eb->context == E_BINDING_CONTEXT_CONTAINER)
{
cfdata->binding_context = E_BINDING_CONTEXT_CONTAINER;
- wd = e_widget_data_get(cfdata->gui.bind_context[E_BINDING_CONTEXT_CONTAINER]);
- edje_object_signal_emit(wd->o_radio, "toggle_on", "");
+ e_widget_radio_toggle_set(cfdata->gui.bind_context[E_BINDING_CONTEXT_CONTAINER], 1);
}
- if (bk->context == E_BINDING_CONTEXT_MANAGER)
+ if (eb->context == E_BINDING_CONTEXT_MANAGER)
{
cfdata...
[truncated message content] |