Rename widget_* functions and variables into input_* functions and variables.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
Slava Zanko 2009-09-24 15:22:13 +03:00 committed by Ilia Maslakov
parent 3f95f87f5e
commit 5bdd17a6ec
6 changed files with 27 additions and 27 deletions

View File

@ -41,7 +41,7 @@ extern const global_key_map_t default_editor_x_keymap[];
extern const global_key_map_t default_panel_keymap[];
/* widget.c */
extern const global_key_map_t default_widget_keymap[];
extern const global_key_map_t default_input_keymap[];
/* main.c */
extern const global_key_map_t default_main_map[];

View File

@ -310,7 +310,7 @@ GArray *viewer_hex_keymap = NULL;
GArray *main_keymap = NULL;
GArray *main_x_keymap = NULL;
GArray *panel_keymap = NULL;
GArray *widget_keymap = NULL;
GArray *input_keymap = NULL;
const global_key_map_t *main_map;
const global_key_map_t *main_x_map;
@ -1203,7 +1203,7 @@ nothing (void)
}
void
execute_cmd(int command)
midnight_execute_cmd(int command)
{
switch (command) {
case CK_MenuLastSelectedCmd:
@ -1512,7 +1512,7 @@ midnight_callback (struct Dlg_head *h, dlg_msg_t msg, int parm)
ctl_x_map_enabled = 0;
for (i = 0; main_x_map[i].key; i++)
if (parm == main_x_map[i].key) {
execute_cmd (main_x_map[i].command);
midnight_execute_cmd (main_x_map[i].command);
return MSG_HANDLED;
}
}
@ -1614,13 +1614,13 @@ midnight_callback (struct Dlg_head *h, dlg_msg_t msg, int parm)
ctl_x_map_enabled = 0;
for (i = 0; main_x_map[i].key; i++)
if (parm == main_x_map[i].key) {
execute_cmd (main_x_map[i].command);
midnight_execute_cmd (main_x_map[i].command);
return MSG_HANDLED;
}
} else {
for (i = 0; main_map[i].key; i++) {
if (parm == main_map[i].key) {
execute_cmd (main_map[i].command);
midnight_execute_cmd (main_map[i].command);
return MSG_HANDLED;
}
}
@ -1815,10 +1815,10 @@ do_nc (void)
panel_map = (global_key_map_t *) panel_keymap->data;
}
widget_map = default_widget_keymap;
input_map = default_input_keymap;
if (widget_keymap && widget_keymap->len > 0)
widget_map = (global_key_map_t *) widget_keymap->data;
if (input_keymap && input_keymap->len > 0)
input_map = (global_key_map_t *) input_keymap->data;
/* Check if we were invoked as an editor or file viewer */
if (!mc_maybe_editor_or_viewer ()) {

View File

@ -80,10 +80,10 @@ extern GArray *viewer_hex_keymap;
extern GArray *main_keymap;
extern GArray *main_x_keymap;
extern GArray *panel_keymap;
extern GArray *widget_keymap;
extern GArray *input_keymap;
extern const global_key_map_t *panel_map;
extern const global_key_map_t *widget_map;
extern const global_key_map_t *input_map;
void do_update_prompt (void);

View File

@ -2289,7 +2289,7 @@ static void cmd_unselect(WPanel *wp) { (void) wp;unselect_cmd(); }
static void cmd_reverse_selection(WPanel *wp) { (void) wp;reverse_selection_cmd(); }
void
screen_execute_cmd (WPanel *panel, int command, int key)
panel_execute_cmd (WPanel *panel, int command, int key)
{
switch (command) {
case CK_PanelChdirOtherPanel:
@ -2400,7 +2400,7 @@ panel_key (WPanel *panel, int key)
if (panel_map[i].command != CK_PanelStartSearch)
panel->searching = 0;
screen_execute_cmd (panel, panel_map[i].command, key);
panel_execute_cmd (panel, panel_map[i].command, key);
if (panel->searching != old_searching)
display_mini_info (panel);

View File

@ -1007,8 +1007,8 @@ load_keymap_defs (void)
panel_keymap = g_array_new(TRUE, FALSE, sizeof(global_key_map_t));
load_keymap_from_section ("panel", panel_keymap, mc_global_keymap);
widget_keymap = g_array_new(TRUE, FALSE, sizeof(global_key_map_t));
load_keymap_from_section ("input", widget_keymap, mc_global_keymap);
input_keymap = g_array_new(TRUE, FALSE, sizeof(global_key_map_t));
load_keymap_from_section ("input", input_keymap, mc_global_keymap);
mc_config_deinit(mc_global_keymap);
}

View File

@ -59,9 +59,9 @@
#define HISTORY_FILE_NAME ".mc/history"
const global_key_map_t *widget_map;
const global_key_map_t *input_map;
const global_key_map_t default_widget_keymap[] = {
const global_key_map_t default_input_keymap[] = {
/* Motion */
{ XCTRL('a'), CK_InputBol },
{ KEY_HOME, CK_InputBol },
@ -1727,7 +1727,7 @@ port_region_marked_for_delete (WInput *in)
}
static void
widget_execute_cmd (WInput *in, int command, int key)
input_execute_cmd (WInput *in, int command, int key)
{
switch (command) {
case CK_InputBol:
@ -1810,10 +1810,10 @@ is_in_input_map (WInput *in, int key)
{
int i;
for (i = 0; widget_map[i].key; i++) {
if (key == widget_map[i].key) {
widget_execute_cmd (in, widget_map[i].command, key);
if (widget_map[i].command == CK_InputComplete)
for (i = 0; input_map[i].key; i++) {
if (key == input_map[i].key) {
input_execute_cmd (in, input_map[i].command, key);
if (input_map[i].command == CK_InputComplete)
return 2;
else
return 1;
@ -1838,18 +1838,18 @@ handle_char (WInput *in, int key)
return v;
}
for (i = 0; widget_map[i].key; i++) {
if (key == widget_map[i].key) {
if (widget_map[i].command != CK_InputComplete) {
for (i = 0; input_map[i].key; i++) {
if (key == input_map[i].key) {
if (input_map[i].command != CK_InputComplete) {
free_completions (in);
widget_execute_cmd (in, widget_map[i].command, key);
input_execute_cmd (in, input_map[i].command, key);
update_input (in, 1);
v = MSG_HANDLED;
break;
}
}
}
if (widget_map[i].command == 0) {
if (input_map[i].command == 0) {
if (key > 255)
return MSG_NOT_HANDLED;
if (in->first)