File src/menus/menus.c changed (mode: 100644) (index 3e61356ff..c1d30bf18) |
... |
... |
static void draw_menu_frame(const menu_state_t *ms); |
78 |
78 |
static void output_handler(const char line[], void *arg); |
static void output_handler(const char line[], void *arg); |
79 |
79 |
static void append_to_string(char **str, const char suffix[]); |
static void append_to_string(char **str, const char suffix[]); |
80 |
80 |
static char * expand_tabulation_a(const char line[], size_t tab_stops); |
static char * expand_tabulation_a(const char line[], size_t tab_stops); |
81 |
|
static void init_menu_state(menu_state_t *ms, menu_data_t *m, view_t *view); |
|
|
81 |
|
static void init_menu_state(menu_state_t *ms, menu_data_t *m); |
82 |
82 |
static void replace_menu_data(menu_data_t *m); |
static void replace_menu_data(menu_data_t *m); |
83 |
83 |
static int can_stash_menu(const menu_data_t *m); |
static int can_stash_menu(const menu_data_t *m); |
84 |
84 |
static void stash_menu(menu_data_t *m); |
static void stash_menu(menu_data_t *m); |
|
... |
... |
menus_enter(menu_data_t *m, view_t *view) |
687 |
687 |
return 1; |
return 1; |
688 |
688 |
} |
} |
689 |
689 |
|
|
|
690 |
|
/* The view should be set regardless whether we're already in the menu |
|
691 |
|
* mode. */ |
|
692 |
|
menu_state.view = view; |
|
693 |
|
|
690 |
694 |
if(vle_mode_is(MENU_MODE)) |
if(vle_mode_is(MENU_MODE)) |
691 |
695 |
{ |
{ |
692 |
696 |
menus_switch_to(m); |
menus_switch_to(m); |
|
... |
... |
menus_enter(menu_data_t *m, view_t *view) |
694 |
698 |
} |
} |
695 |
699 |
|
|
696 |
700 |
/* This moves data out of `m`, so don't use it below. */ |
/* This moves data out of `m`, so don't use it below. */ |
697 |
|
init_menu_state(&menu_state, m, view); |
|
|
701 |
|
init_menu_state(&menu_state, m); |
698 |
702 |
|
|
699 |
703 |
ui_setup_for_menu_like(); |
ui_setup_for_menu_like(); |
700 |
704 |
term_title_update(menu_state.d->title); |
term_title_update(menu_state.d->title); |
|
... |
... |
menus_enter(menu_data_t *m, view_t *view) |
706 |
710 |
|
|
707 |
711 |
/* Initializes menu state structure with default/initial values. */ |
/* Initializes menu state structure with default/initial values. */ |
708 |
712 |
static void |
static void |
709 |
|
init_menu_state(menu_state_t *ms, menu_data_t *m, view_t *view) |
|
|
713 |
|
init_menu_state(menu_state_t *ms, menu_data_t *m) |
710 |
714 |
{ |
{ |
711 |
715 |
free(ms->regexp); |
free(ms->regexp); |
712 |
716 |
free(ms->matches); |
free(ms->matches); |
|
... |
... |
init_menu_state(menu_state_t *ms, menu_data_t *m, view_t *view) |
724 |
728 |
ms->matches = NULL; |
ms->matches = NULL; |
725 |
729 |
ms->regexp = NULL; |
ms->regexp = NULL; |
726 |
730 |
ms->search_repeat = 0; |
ms->search_repeat = 0; |
727 |
|
ms->view = view; |
|
728 |
731 |
} |
} |
729 |
732 |
|
|
730 |
733 |
void |
void |
|
... |
... |
replace_menu_data(menu_data_t *m) |
765 |
768 |
move_menu_data(&menu_state.data_storage, m); |
move_menu_data(&menu_state.data_storage, m); |
766 |
769 |
menu_state.d = &menu_state.data_storage; |
menu_state.d = &menu_state.data_storage; |
767 |
770 |
|
|
|
771 |
|
modmenu_reenter(menu_state.view); |
|
772 |
|
|
768 |
773 |
menus_partial_redraw(m->state); |
menus_partial_redraw(m->state); |
769 |
774 |
menus_set_pos(m->state, m->pos); |
menus_set_pos(m->state, m->pos); |
770 |
775 |
ui_refresh_win(menu_win); |
ui_refresh_win(menu_win); |
File src/modes/menu.c changed (mode: 100644) (index 4bed2d586..fcc075f7b) |
... |
... |
key_handler(wchar_t key) |
338 |
338 |
} |
} |
339 |
339 |
|
|
340 |
340 |
void |
void |
341 |
|
modmenu_enter(menu_data_t *m, view_t *active_view) |
|
|
341 |
|
modmenu_enter(menu_data_t *m, view_t *target_view) |
342 |
342 |
{ |
{ |
343 |
343 |
if(curr_stats.load_stage >= 0 && curr_stats.load_stage < 2) |
if(curr_stats.load_stage >= 0 && curr_stats.load_stage < 2) |
344 |
344 |
{ |
{ |
|
... |
... |
modmenu_enter(menu_data_t *m, view_t *active_view) |
350 |
350 |
ui_hide_graphics(); |
ui_hide_graphics(); |
351 |
351 |
werase(status_bar); |
werase(status_bar); |
352 |
352 |
|
|
353 |
|
view = active_view; |
|
|
353 |
|
view = target_view; |
354 |
354 |
menu = m; |
menu = m; |
355 |
355 |
vle_mode_set(MENU_MODE, VMT_PRIMARY); |
vle_mode_set(MENU_MODE, VMT_PRIMARY); |
356 |
356 |
stats_refresh_later(); |
stats_refresh_later(); |
|
... |
... |
modmenu_enter(menu_data_t *m, view_t *active_view) |
359 |
359 |
vle_cmds_init(0, &cmds_conf); |
vle_cmds_init(0, &cmds_conf); |
360 |
360 |
} |
} |
361 |
361 |
|
|
|
362 |
|
void |
|
363 |
|
modmenu_reenter(view_t *target_view) |
|
364 |
|
{ |
|
365 |
|
assert(vle_mode_is(MENU_MODE) && "Menu mode must be active!"); |
|
366 |
|
view = target_view; |
|
367 |
|
} |
|
368 |
|
|
362 |
369 |
void |
void |
363 |
370 |
modmenu_abort(void) |
modmenu_abort(void) |
364 |
371 |
{ |
{ |