From: Richard Russon Date: Sun, 1 Apr 2018 03:30:33 +0000 (+0100) Subject: rename menu functions X-Git-Tag: neomutt-20180512~69^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c9c5a8fbc134d87c77e97379baa2f413a2309c3e;p=neomutt rename menu functions --- diff --git a/addrbook.c b/addrbook.c index ce70601f8..643aaff3e 100644 --- a/addrbook.c +++ b/addrbook.c @@ -184,12 +184,12 @@ void mutt_alias_menu(char *buf, size_t buflen, struct Alias *aliases) return; } - menu = mutt_new_menu(MENU_ALIAS); + menu = mutt_menu_new(MENU_ALIAS); menu->make_entry = alias_entry; menu->tag = alias_tag; menu->title = _("Aliases"); menu->help = mutt_compile_help(helpstr, sizeof(helpstr), MENU_ALIAS, AliasHelp); - mutt_push_current_menu(menu); + mutt_menu_push_current(menu); new_aliases: @@ -278,7 +278,7 @@ new_aliases: mutt_addr_write(buf, buflen, AliasTable[t]->addr, true); } - mutt_pop_current_menu(menu); + mutt_menu_pop_current(menu); mutt_menu_destroy(&menu); FREE(&AliasTable); } diff --git a/browser.c b/browser.c index fddb0c7a2..7d64c501d 100644 --- a/browser.c +++ b/browser.c @@ -1367,7 +1367,7 @@ void mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numfi if (examine_directory(NULL, &state, LastDir, prefix) == -1) goto bail; } - menu = mutt_new_menu(MENU_FOLDER); + menu = mutt_menu_new(MENU_FOLDER); menu->make_entry = folder_entry; menu->search = select_file_search; menu->title = title; @@ -1390,7 +1390,7 @@ void mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numfi OPT_NEWS ? FolderNewsHelp : #endif FolderHelp); - mutt_push_current_menu(menu); + mutt_menu_push_current(menu); init_menu(&state, menu, title, sizeof(title), buffy); @@ -2202,7 +2202,7 @@ bail: if (menu) { - mutt_pop_current_menu(menu); + mutt_menu_pop_current(menu); mutt_menu_destroy(&menu); } diff --git a/buffy.c b/buffy.c index 04fb34f9e..030aede89 100644 --- a/buffy.c +++ b/buffy.c @@ -444,7 +444,7 @@ static void buffy_check(struct Buffy *tmp, struct stat *contex_sb, bool check_st if ((orig_new != tmp->new) || (orig_count != tmp->msg_count) || (orig_unread != tmp->msg_unread) || (orig_flagged != tmp->msg_flagged)) { - mutt_set_current_menu_redraw(REDRAW_SIDEBAR); + mutt_menu_set_current_redraw(REDRAW_SIDEBAR); } #endif diff --git a/color.c b/color.c index e665cd798..106f45ef2 100644 --- a/color.c +++ b/color.c @@ -515,7 +515,7 @@ static int parse_uncolor(struct Buffer *buf, struct Buffer *s, unsigned long dat if (object > MT_COLOR_INDEX_SUBJECT) { /* uncolor index column */ ColorDefs[object] = 0; - mutt_set_menu_redraw_full(MENU_MAIN); + mutt_menu_set_redraw_full(MENU_MAIN); return 0; } @@ -580,7 +580,7 @@ static int parse_uncolor(struct Buffer *buf, struct Buffer *s, unsigned long dat if (is_index && do_cache && !OPT_NO_CURSES) { - mutt_set_menu_redraw_full(MENU_MAIN); + mutt_menu_set_redraw_full(MENU_MAIN); /* force re-caching of index colors */ for (int i = 0; Context && i < Context->msgcount; i++) Context->hdrs[i]->pair = 0; @@ -937,27 +937,27 @@ static int parse_color(struct Buffer *buf, struct Buffer *s, struct Buffer *err, else if (object == MT_COLOR_INDEX) { r = add_pattern(&ColorIndexList, buf->data, 1, fg, bg, attr, err, 1, match); - mutt_set_menu_redraw_full(MENU_MAIN); + mutt_menu_set_redraw_full(MENU_MAIN); } else if (object == MT_COLOR_INDEX_AUTHOR) { r = add_pattern(&ColorIndexAuthorList, buf->data, 1, fg, bg, attr, err, 1, match); - mutt_set_menu_redraw_full(MENU_MAIN); + mutt_menu_set_redraw_full(MENU_MAIN); } else if (object == MT_COLOR_INDEX_FLAGS) { r = add_pattern(&ColorIndexFlagsList, buf->data, 1, fg, bg, attr, err, 1, match); - mutt_set_menu_redraw_full(MENU_MAIN); + mutt_menu_set_redraw_full(MENU_MAIN); } else if (object == MT_COLOR_INDEX_SUBJECT) { r = add_pattern(&ColorIndexSubjectList, buf->data, 1, fg, bg, attr, err, 1, match); - mutt_set_menu_redraw_full(MENU_MAIN); + mutt_menu_set_redraw_full(MENU_MAIN); } else if (object == MT_COLOR_INDEX_TAG) { r = add_pattern(&ColorIndexTagList, buf->data, 1, fg, bg, attr, err, 1, match); - mutt_set_menu_redraw_full(MENU_MAIN); + mutt_menu_set_redraw_full(MENU_MAIN); } else if (object == MT_COLOR_QUOTED) { @@ -987,7 +987,7 @@ static int parse_color(struct Buffer *buf, struct Buffer *s, struct Buffer *err, { ColorDefs[object] = fgbgattr_to_color(fg, bg, attr); if (object > MT_COLOR_INDEX_AUTHOR) - mutt_set_menu_redraw_full(MENU_MAIN); + mutt_menu_set_redraw_full(MENU_MAIN); } return r; diff --git a/compose.c b/compose.c index ef7d5a8ba..689f4ff2b 100644 --- a/compose.c +++ b/compose.c @@ -799,7 +799,7 @@ int mutt_compose_menu(struct Header *msg, char *fcc, size_t fcclen, rd.msg = msg; rd.fcc = fcc; - menu = mutt_new_menu(MENU_COMPOSE); + menu = mutt_menu_new(MENU_COMPOSE); menu->offset = HDR_ATTACH; menu->make_entry = snd_entry; menu->tag = mutt_tag_attach; @@ -811,7 +811,7 @@ int mutt_compose_menu(struct Header *msg, char *fcc, size_t fcclen, menu->help = mutt_compile_help(helpstr, sizeof(helpstr), MENU_COMPOSE, ComposeHelp); menu->custom_menu_redraw = compose_menu_redraw; menu->redraw_data = &rd; - mutt_push_current_menu(menu); + mutt_menu_push_current(menu); actx = mutt_mem_calloc(sizeof(struct AttachCtx), 1); actx->hdr = msg; @@ -1670,7 +1670,7 @@ int mutt_compose_menu(struct Header *msg, char *fcc, size_t fcclen, } } - mutt_pop_current_menu(menu); + mutt_menu_pop_current(menu); mutt_menu_destroy(&menu); if (actx->idxlen) diff --git a/conn/ssl.c b/conn/ssl.c index 5b44e6d07..931808148 100644 --- a/conn/ssl.c +++ b/conn/ssl.c @@ -952,12 +952,12 @@ static int interactive_check_cert(X509 *cert, int idx, size_t len, SSL *ssl, int char helpstr[LONG_STRING]; char buf[STRING]; char title[STRING]; - struct Menu *menu = mutt_new_menu(MENU_GENERIC); + struct Menu *menu = mutt_menu_new(MENU_GENERIC); int done, row; FILE *fp = NULL; int ALLOW_SKIP = 0; /**< All caps tells Coverity that this is effectively a preproc condition */ - mutt_push_current_menu(menu); + mutt_menu_push_current(menu); menu->max = mutt_array_size(part) * 2 + 10; menu->dialog = mutt_mem_calloc(1, menu->max * sizeof(char *)); @@ -1088,7 +1088,7 @@ static int interactive_check_cert(X509 *cert, int idx, size_t len, SSL *ssl, int } } OPT_IGNORE_MACRO_EVENTS = false; - mutt_pop_current_menu(menu); + mutt_menu_pop_current(menu); mutt_menu_destroy(&menu); mutt_debug(2, "done=%d\n", done); return (done == 2); diff --git a/conn/ssl_gnutls.c b/conn/ssl_gnutls.c index 2a02e0f33..8521d1c55 100644 --- a/conn/ssl_gnutls.c +++ b/conn/ssl_gnutls.c @@ -600,12 +600,12 @@ static int tls_check_one_certificate(const gnutls_datum_t *certdata, return 0; } - menu = mutt_new_menu(MENU_GENERIC); + menu = mutt_menu_new(MENU_GENERIC); menu->max = 25; menu->dialog = mutt_mem_calloc(1, menu->max * sizeof(char *)); for (int i = 0; i < menu->max; i++) menu->dialog[i] = mutt_mem_calloc(1, SHORT_STRING * sizeof(char)); - mutt_push_current_menu(menu); + mutt_menu_push_current(menu); row = 0; mutt_str_strfcpy(menu->dialog[row], _("This certificate belongs to:"), SHORT_STRING); @@ -848,7 +848,7 @@ static int tls_check_one_certificate(const gnutls_datum_t *certdata, } } OPT_IGNORE_MACRO_EVENTS = false; - mutt_pop_current_menu(menu); + mutt_menu_pop_current(menu); mutt_menu_destroy(&menu); gnutls_x509_crt_deinit(cert); diff --git a/curs_lib.c b/curs_lib.c index 50244f29c..5773acf66 100644 --- a/curs_lib.c +++ b/curs_lib.c @@ -112,7 +112,7 @@ void mutt_need_hard_redraw(void) { keypad(stdscr, true); clearok(stdscr, true); - mutt_set_current_menu_redraw_full(); + mutt_menu_set_current_redraw_full(); } struct Event mutt_getch(void) @@ -184,7 +184,7 @@ int mutt_get_field_full(const char *field, char *buf, size_t buflen, SigWinch = 0; mutt_resize_screen(); clearok(stdscr, TRUE); - mutt_current_menu_redraw(); + mutt_menu_current_redraw(); } mutt_window_clearline(MuttMessageWindow, 0); SETCOLOR(MT_COLOR_PROMPT); @@ -273,7 +273,7 @@ int mutt_yesorno(const char *msg, int def) SigWinch = 0; mutt_resize_screen(); clearok(stdscr, TRUE); - mutt_current_menu_redraw(); + mutt_menu_current_redraw(); } if (MuttMessageWindow->cols) { @@ -284,7 +284,7 @@ int mutt_yesorno(const char *msg, int def) if (prompt_lines != MuttMessageWindow->rows) { reflow_message_window_rows(prompt_lines); - mutt_current_menu_redraw(); + mutt_menu_current_redraw(); } /* maxlen here is sort of arbitrary, so pick a reasonable upper bound */ @@ -342,7 +342,7 @@ int mutt_yesorno(const char *msg, int def) if (MuttMessageWindow->rows != 1) { reflow_message_window_rows(1); - mutt_current_menu_redraw(); + mutt_menu_current_redraw(); } else mutt_window_clearline(MuttMessageWindow, 0); @@ -618,9 +618,9 @@ void mutt_reflow_windows(void) } #endif - mutt_set_current_menu_redraw_full(); + mutt_menu_set_current_redraw_full(); /* the pager menu needs this flag set to recalc line_info */ - mutt_set_current_menu_redraw(REDRAW_FLOW); + mutt_menu_set_current_redraw(REDRAW_FLOW); } static void reflow_message_window_rows(int mw_rows) @@ -643,7 +643,7 @@ static void reflow_message_window_rows(int mw_rows) /* We don't also set REDRAW_FLOW because this function only * changes rows and is a temporary adjustment. */ - mutt_set_current_menu_redraw_full(); + mutt_menu_set_current_redraw_full(); } int mutt_window_move(struct MuttWindow *win, int row, int col) @@ -996,7 +996,7 @@ int mutt_multi_choice(char *prompt, char *letters) SigWinch = 0; mutt_resize_screen(); clearok(stdscr, TRUE); - mutt_current_menu_redraw(); + mutt_menu_current_redraw(); } if (MuttMessageWindow->cols) { @@ -1007,7 +1007,7 @@ int mutt_multi_choice(char *prompt, char *letters) if (prompt_lines != MuttMessageWindow->rows) { reflow_message_window_rows(prompt_lines); - mutt_current_menu_redraw(); + mutt_menu_current_redraw(); } SETCOLOR(MT_COLOR_PROMPT); @@ -1049,7 +1049,7 @@ int mutt_multi_choice(char *prompt, char *letters) if (MuttMessageWindow->rows != 1) { reflow_message_window_rows(1); - mutt_current_menu_redraw(); + mutt_menu_current_redraw(); } else mutt_window_clearline(MuttMessageWindow, 0); diff --git a/curs_main.c b/curs_main.c index f924dfc87..56a64238a 100644 --- a/curs_main.c +++ b/curs_main.c @@ -919,7 +919,7 @@ int mutt_index_menu(void) int close = 0; /* did we OP_QUIT or OP_EXIT out of this menu? */ int attach_msg = OPT_ATTACH_MSG; - menu = mutt_new_menu(MENU_MAIN); + menu = mutt_menu_new(MENU_MAIN); menu->make_entry = index_make_entry; menu->color = index_color; menu->current = ci_first_message(); @@ -930,7 +930,7 @@ int mutt_index_menu(void) #endif IndexHelp); menu->custom_menu_redraw = index_menu_redraw; - mutt_push_current_menu(menu); + mutt_menu_push_current(menu); if (!attach_msg) mutt_buffy_check(true); /* force the buffy check after we enter the folder */ @@ -2206,7 +2206,7 @@ int mutt_index_menu(void) int hint = Context->hdrs[Context->v2r[menu->current]]->index; /* If we are returning to the pager via an index menu redirection, we - * need to reset the menu->menu. Otherwise mutt_pop_current_menu() will + * need to reset the menu->menu. Otherwise mutt_menu_pop_current() will * set CurrentMenu incorrectly when we return back to the index menu. */ menu->menu = MENU_MAIN; @@ -3385,7 +3385,7 @@ int mutt_index_menu(void) break; } - mutt_pop_current_menu(menu); + mutt_menu_pop_current(menu); mutt_menu_destroy(&menu); return close; } diff --git a/flags.c b/flags.c index f0333a14a..549c5aae6 100644 --- a/flags.c +++ b/flags.c @@ -316,7 +316,7 @@ void mutt_set_flag_update(struct Context *ctx, struct Header *h, int flag, int b { mutt_set_header_color(ctx, h); #ifdef USE_SIDEBAR - mutt_set_current_menu_redraw(REDRAW_SIDEBAR); + mutt_menu_set_current_redraw(REDRAW_SIDEBAR); #endif } diff --git a/history.c b/history.c index 4d88d55be..088f53184 100644 --- a/history.c +++ b/history.c @@ -661,11 +661,11 @@ static void history_menu(char *buf, size_t buflen, char **matches, int match_cou snprintf(title, sizeof(title), _("History '%s'"), buf); - menu = mutt_new_menu(MENU_GENERIC); + menu = mutt_menu_new(MENU_GENERIC); menu->make_entry = history_entry; menu->title = title; menu->help = mutt_compile_help(helpstr, sizeof(helpstr), MENU_GENERIC, HistoryHelp); - mutt_push_current_menu(menu); + mutt_menu_push_current(menu); menu->max = match_count; menu->data = matches; @@ -684,7 +684,7 @@ static void history_menu(char *buf, size_t buflen, char **matches, int match_cou } } - mutt_pop_current_menu(menu); + mutt_menu_pop_current(menu); mutt_menu_destroy(&menu); } diff --git a/imap/command.c b/imap/command.c index 0cd15fede..970d63185 100644 --- a/imap/command.c +++ b/imap/command.c @@ -754,7 +754,7 @@ static void cmd_parse_status(struct ImapData *idata, char *s) if ((inc->new != new) || (inc->msg_count != status->messages) || (inc->msg_unread != status->unseen)) { - mutt_set_current_menu_redraw(REDRAW_SIDEBAR); + mutt_menu_set_current_redraw(REDRAW_SIDEBAR); } #endif inc->new = new; diff --git a/init.c b/init.c index 94947b620..1db6f7796 100644 --- a/init.c +++ b/init.c @@ -1657,7 +1657,7 @@ static int parse_unalias(struct Buffer *buf, struct Buffer *s, { for (tmp = Aliases; tmp; tmp = tmp->next) tmp->del = true; - mutt_set_current_menu_redraw_full(); + mutt_menu_set_current_redraw_full(); } else mutt_alias_free(&Aliases); @@ -1672,7 +1672,7 @@ static int parse_unalias(struct Buffer *buf, struct Buffer *s, if (CurrentMenu == MENU_ALIAS) { tmp->del = true; - mutt_set_current_menu_redraw_full(); + mutt_menu_set_current_redraw_full(); break; } @@ -1733,7 +1733,7 @@ static int parse_alias(struct Buffer *buf, struct Buffer *s, unsigned long data, /* override the previous value */ mutt_addr_free(&tmp->addr); if (CurrentMenu == MENU_ALIAS) - mutt_set_current_menu_redraw_full(); + mutt_menu_set_current_redraw_full(); } mutt_extract_token(buf, s, MUTT_TOKEN_QUOTE | MUTT_TOKEN_SPACE | MUTT_TOKEN_SEMICOLON); @@ -1950,13 +1950,13 @@ static void restore_default(struct Option *p) } if (p->flags & R_INDEX) - mutt_set_menu_redraw_full(MENU_MAIN); + mutt_menu_set_redraw_full(MENU_MAIN); if (p->flags & R_PAGER) - mutt_set_menu_redraw_full(MENU_PAGER); + mutt_menu_set_redraw_full(MENU_PAGER); if (p->flags & R_PAGER_FLOW) { - mutt_set_menu_redraw_full(MENU_PAGER); - mutt_set_menu_redraw(MENU_PAGER, REDRAW_FLOW); + mutt_menu_set_redraw_full(MENU_PAGER); + mutt_menu_set_redraw(MENU_PAGER, REDRAW_FLOW); } if (p->flags & R_RESORT_SUB) OPT_SORT_SUBTHREADS = true; @@ -1970,10 +1970,10 @@ static void restore_default(struct Option *p) mutt_reflow_windows(); #ifdef USE_SIDEBAR if (p->flags & R_SIDEBAR) - mutt_set_current_menu_redraw(REDRAW_SIDEBAR); + mutt_menu_set_current_redraw(REDRAW_SIDEBAR); #endif if (p->flags & R_MENU) - mutt_set_current_menu_redraw_full(); + mutt_menu_set_current_redraw_full(); } static void esc_char(char c, char *p, char *dst, size_t len) @@ -2221,7 +2221,7 @@ static int parse_set(struct Buffer *tmp, struct Buffer *s, unsigned long data, } for (idx = 0; MuttVars[idx].name; idx++) restore_default(&MuttVars[idx]); - mutt_set_current_menu_redraw_full(); + mutt_menu_set_current_redraw_full(); OPT_SORT_SUBTHREADS = true; OPT_NEED_RESORT = true; OPT_RESORT_INIT = true; @@ -2698,13 +2698,13 @@ static int parse_set(struct Buffer *tmp, struct Buffer *s, unsigned long data, if (!myvar) { if (MuttVars[idx].flags & R_INDEX) - mutt_set_menu_redraw_full(MENU_MAIN); + mutt_menu_set_redraw_full(MENU_MAIN); if (MuttVars[idx].flags & R_PAGER) - mutt_set_menu_redraw_full(MENU_PAGER); + mutt_menu_set_redraw_full(MENU_PAGER); if (MuttVars[idx].flags & R_PAGER_FLOW) { - mutt_set_menu_redraw_full(MENU_PAGER); - mutt_set_menu_redraw(MENU_PAGER, REDRAW_FLOW); + mutt_menu_set_redraw_full(MENU_PAGER); + mutt_menu_set_redraw(MENU_PAGER, REDRAW_FLOW); } if (MuttVars[idx].flags & R_RESORT_SUB) OPT_SORT_SUBTHREADS = true; @@ -2718,10 +2718,10 @@ static int parse_set(struct Buffer *tmp, struct Buffer *s, unsigned long data, mutt_reflow_windows(); #ifdef USE_SIDEBAR if (MuttVars[idx].flags & R_SIDEBAR) - mutt_set_current_menu_redraw(REDRAW_SIDEBAR); + mutt_menu_set_current_redraw(REDRAW_SIDEBAR); #endif if (MuttVars[idx].flags & R_MENU) - mutt_set_current_menu_redraw_full(); + mutt_menu_set_current_redraw_full(); } } return r; diff --git a/menu.c b/menu.c index 7918e674f..e7194ceee 100644 --- a/menu.c +++ b/menu.c @@ -800,7 +800,7 @@ void mutt_menu_init(void) SearchBuffers[i] = NULL; } -struct Menu *mutt_new_menu(int menu) +struct Menu *mutt_menu_new(int menu) { struct Menu *p = mutt_mem_calloc(1, sizeof(struct Menu)); @@ -841,7 +841,7 @@ static struct Menu *get_current_menu(void) return MenuStackCount ? MenuStack[MenuStackCount - 1] : NULL; } -void mutt_push_current_menu(struct Menu *menu) +void mutt_menu_push_current(struct Menu *menu) { if (MenuStackCount >= MenuStackLen) { @@ -853,7 +853,7 @@ void mutt_push_current_menu(struct Menu *menu) CurrentMenu = menu->menu; } -void mutt_pop_current_menu(struct Menu *menu) +void mutt_menu_pop_current(struct Menu *menu) { struct Menu *prev_menu = NULL; @@ -876,7 +876,7 @@ void mutt_pop_current_menu(struct Menu *menu) } } -void mutt_set_current_menu_redraw(int redraw) +void mutt_menu_set_current_redraw(int redraw) { struct Menu *current_menu = NULL; @@ -885,7 +885,7 @@ void mutt_set_current_menu_redraw(int redraw) current_menu->redraw |= redraw; } -void mutt_set_current_menu_redraw_full(void) +void mutt_menu_set_current_redraw_full(void) { struct Menu *current_menu = NULL; @@ -894,19 +894,19 @@ void mutt_set_current_menu_redraw_full(void) current_menu->redraw = REDRAW_FULL; } -void mutt_set_menu_redraw(int menu_type, int redraw) +void mutt_menu_set_redraw(int menu_type, int redraw) { if (CurrentMenu == menu_type) - mutt_set_current_menu_redraw(redraw); + mutt_menu_set_current_redraw(redraw); } -void mutt_set_menu_redraw_full(int menu_type) +void mutt_menu_set_redraw_full(int menu_type) { if (CurrentMenu == menu_type) - mutt_set_current_menu_redraw_full(); + mutt_menu_set_current_redraw_full(); } -void mutt_current_menu_redraw() +void mutt_menu_current_redraw() { struct Menu *current_menu = NULL; diff --git a/mutt_menu.h b/mutt_menu.h index 95d7b6085..a83a1bd83 100644 --- a/mutt_menu.h +++ b/mutt_menu.h @@ -95,46 +95,46 @@ struct Menu int tagged; /**< number of tagged entries */ }; -void mutt_menu_init(void); -void menu_redraw_full(struct Menu *menu); -#ifdef USE_SIDEBAR -void menu_redraw_sidebar(struct Menu *menu); -#endif -void menu_redraw_index(struct Menu *menu); -void menu_redraw_status(struct Menu *menu); -void menu_redraw_motion(struct Menu *menu); -void menu_redraw_current(struct Menu *menu); -int menu_redraw(struct Menu *menu); +int menu_redraw(struct Menu *menu); +void menu_bottom_page(struct Menu *menu); +void menu_check_recenter(struct Menu *menu); +void menu_current_bottom(struct Menu *menu); +void menu_current_middle(struct Menu *menu); +void menu_current_top(struct Menu *menu); void menu_first_entry(struct Menu *menu); +void menu_half_down(struct Menu *menu); +void menu_half_up(struct Menu *menu); void menu_last_entry(struct Menu *menu); -void menu_top_page(struct Menu *menu); -void menu_bottom_page(struct Menu *menu); void menu_middle_page(struct Menu *menu); -void menu_next_page(struct Menu *menu); -void menu_prev_page(struct Menu *menu); void menu_next_line(struct Menu *menu); +void menu_next_page(struct Menu *menu); void menu_prev_line(struct Menu *menu); -void menu_half_up(struct Menu *menu); -void menu_half_down(struct Menu *menu); -void menu_current_top(struct Menu *menu); -void menu_current_middle(struct Menu *menu); -void menu_current_bottom(struct Menu *menu); -void menu_check_recenter(struct Menu *menu); +void menu_prev_page(struct Menu *menu); +void menu_redraw_current(struct Menu *menu); +void menu_redraw_full(struct Menu *menu); +void menu_redraw_index(struct Menu *menu); +void menu_redraw_motion(struct Menu *menu); +#ifdef USE_SIDEBAR +void menu_redraw_sidebar(struct Menu *menu); +#endif +void menu_redraw_status(struct Menu *menu); void menu_status_line(char *buf, size_t buflen, struct Menu *menu, const char *p); bool mutt_ts_capability(void); void mutt_ts_status(char *str); void mutt_ts_icon(char *str); +void menu_top_page(struct Menu *menu); -struct Menu *mutt_new_menu(int menu); -void mutt_menu_destroy(struct Menu **p); -void mutt_push_current_menu(struct Menu *menu); -void mutt_pop_current_menu(struct Menu *menu); -void mutt_set_current_menu_redraw(int redraw); -void mutt_set_current_menu_redraw_full(void); -void mutt_set_menu_redraw(int menu_type, int redraw); -void mutt_set_menu_redraw_full(int menu_type); -void mutt_current_menu_redraw(void); -int mutt_menu_loop(struct Menu *menu); +void mutt_menu_current_redraw(void); +void mutt_menu_destroy(struct Menu **p); +void mutt_menu_init(void); +int mutt_menu_loop(struct Menu *menu); +struct Menu *mutt_menu_new(int menu); +void mutt_menu_pop_current(struct Menu *menu); +void mutt_menu_push_current(struct Menu *menu); +void mutt_menu_set_current_redraw_full(void); +void mutt_menu_set_current_redraw(int redraw); +void mutt_menu_set_redraw_full(int menu_type); +void mutt_menu_set_redraw(int menu_type, int redraw); /* used in both the index and pager index to make an entry. */ void index_make_entry(char *s, size_t l, struct Menu *menu, int num); diff --git a/ncrypt/crypt_gpgme.c b/ncrypt/crypt_gpgme.c index a81b3b72b..0c550d067 100644 --- a/ncrypt/crypt_gpgme.c +++ b/ncrypt/crypt_gpgme.c @@ -4233,12 +4233,12 @@ static struct CryptKeyInfo *crypt_select_key(struct CryptKeyInfo *keys, mutt_make_help(buf, sizeof(buf), _("Help"), menu_to_use, OP_HELP); strcat(helpstr, buf); - menu = mutt_new_menu(menu_to_use); + menu = mutt_menu_new(menu_to_use); menu->max = i; menu->make_entry = crypt_entry; menu->help = helpstr; menu->data = key_table; - mutt_push_current_menu(menu); + mutt_menu_push_current(menu); { const char *ts = NULL; @@ -4345,7 +4345,7 @@ static struct CryptKeyInfo *crypt_select_key(struct CryptKeyInfo *keys, } } - mutt_pop_current_menu(menu); + mutt_menu_pop_current(menu); mutt_menu_destroy(&menu); FREE(&key_table); diff --git a/ncrypt/pgpkey.c b/ncrypt/pgpkey.c index 8a03f80ee..dd05eed15 100644 --- a/ncrypt/pgpkey.c +++ b/ncrypt/pgpkey.c @@ -544,12 +544,12 @@ static struct PgpKeyInfo *pgp_select_key(struct PgpKeyInfo *keys, mutt_make_help(buf, sizeof(buf), _("Help"), MENU_PGP, OP_HELP); strcat(helpstr, buf); - menu = mutt_new_menu(MENU_PGP); + menu = mutt_menu_new(MENU_PGP); menu->max = i; menu->make_entry = pgp_entry; menu->help = helpstr; menu->data = KeyTable; - mutt_push_current_menu(menu); + mutt_menu_push_current(menu); if (p) snprintf(buf, sizeof(buf), _("PGP keys matching <%s>."), p->mailbox); @@ -670,7 +670,7 @@ static struct PgpKeyInfo *pgp_select_key(struct PgpKeyInfo *keys, } } - mutt_pop_current_menu(menu); + mutt_menu_pop_current(menu); mutt_menu_destroy(&menu); FREE(&KeyTable); diff --git a/ncrypt/smime.c b/ncrypt/smime.c index d55570351..9761a56c0 100644 --- a/ncrypt/smime.c +++ b/ncrypt/smime.c @@ -422,13 +422,13 @@ static struct SmimeKey *smime_select_key(struct SmimeKey *keys, char *query) strcat(helpstr, buf); /* Create the menu */ - menu = mutt_new_menu(MENU_SMIME); + menu = mutt_menu_new(MENU_SMIME); menu->max = table_index; menu->make_entry = smime_entry; menu->help = helpstr; menu->data = table; menu->title = title; - mutt_push_current_menu(menu); + mutt_menu_push_current(menu); /* sorting keys might be done later - TODO */ mutt_clear_error(); @@ -474,7 +474,7 @@ static struct SmimeKey *smime_select_key(struct SmimeKey *keys, char *query) } } - mutt_pop_current_menu(menu); + mutt_menu_pop_current(menu); mutt_menu_destroy(&menu); FREE(&table); diff --git a/pager.c b/pager.c index 261e621e0..531fae58a 100644 --- a/pager.c +++ b/pager.c @@ -1860,7 +1860,7 @@ static void pager_menu_redraw(struct Menu *pager_menu) { /* only allocate the space if/when we need the index. Initialise the menu as per the main index */ - rd->index = mutt_new_menu(MENU_MAIN); + rd->index = mutt_menu_new(MENU_MAIN); rd->index->make_entry = index_make_entry; rd->index->color = index_color; rd->index->max = Context ? Context->vcount : 0; @@ -2147,10 +2147,10 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e rd.pager_status_window = mutt_mem_calloc(1, sizeof(struct MuttWindow)); rd.pager_window = mutt_mem_calloc(1, sizeof(struct MuttWindow)); - pager_menu = mutt_new_menu(MENU_PAGER); + pager_menu = mutt_menu_new(MENU_PAGER); pager_menu->custom_menu_redraw = pager_menu_redraw; pager_menu->redraw_data = &rd; - mutt_push_current_menu(pager_menu); + mutt_menu_push_current(pager_menu); while (ch != -1) { @@ -3278,7 +3278,7 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e rd.search_compiled = 0; } FREE(&rd.line_info); - mutt_pop_current_menu(pager_menu); + mutt_menu_pop_current(pager_menu); mutt_menu_destroy(&pager_menu); if (rd.index) mutt_menu_destroy(&rd.index); diff --git a/postpone.c b/postpone.c index 72b12799b..ca34158f0 100644 --- a/postpone.c +++ b/postpone.c @@ -192,13 +192,13 @@ static struct Header *select_msg(void) bool done = false; char helpstr[LONG_STRING]; - struct Menu *menu = mutt_new_menu(MENU_POST); + struct Menu *menu = mutt_menu_new(MENU_POST); menu->make_entry = post_entry; menu->max = PostContext->msgcount; menu->title = _("Postponed Messages"); menu->data = PostContext; menu->help = mutt_compile_help(helpstr, sizeof(helpstr), MENU_POST, PostponeHelp); - mutt_push_current_menu(menu); + mutt_menu_push_current(menu); /* The postponed mailbox is setup to have sorting disabled, but the global * Sort variable may indicate something different. Sorting has to be @@ -245,7 +245,7 @@ static struct Header *select_msg(void) } Sort = orig_sort; - mutt_pop_current_menu(menu); + mutt_menu_pop_current(menu); mutt_menu_destroy(&menu); return (r > -1 ? PostContext->hdrs[r] : NULL); } diff --git a/query.c b/query.c index 83a10477d..faa6f64b5 100644 --- a/query.c +++ b/query.c @@ -326,14 +326,14 @@ static void query_menu(char *buf, size_t buflen, struct Query *results, int retb { snprintf(title, sizeof(title), _("Query '%s'"), buf); - menu = mutt_new_menu(MENU_QUERY); + menu = mutt_menu_new(MENU_QUERY); menu->make_entry = query_entry; menu->search = query_search; menu->tag = query_tag; menu->title = title; char helpstr[LONG_STRING]; menu->help = mutt_compile_help(helpstr, sizeof(helpstr), MENU_QUERY, QueryHelp); - mutt_push_current_menu(menu); + mutt_menu_push_current(menu); /* count the number of results */ for (queryp = results; queryp; queryp = queryp->next) @@ -380,15 +380,15 @@ static void query_menu(char *buf, size_t buflen, struct Query *results, int retb } menu->current = 0; - mutt_pop_current_menu(menu); + mutt_menu_pop_current(menu); mutt_menu_destroy(&menu); - menu = mutt_new_menu(MENU_QUERY); + menu = mutt_menu_new(MENU_QUERY); menu->make_entry = query_entry; menu->search = query_search; menu->tag = query_tag; menu->title = title; menu->help = mutt_compile_help(helpstr, sizeof(helpstr), MENU_QUERY, QueryHelp); - mutt_push_current_menu(menu); + mutt_menu_push_current(menu); /* count the number of results */ for (queryp = results; queryp; queryp = queryp->next) @@ -533,7 +533,7 @@ static void query_menu(char *buf, size_t buflen, struct Query *results, int retb free_query(&results); FREE(&QueryTable); - mutt_pop_current_menu(menu); + mutt_menu_pop_current(menu); mutt_menu_destroy(&menu); } } diff --git a/recvattach.c b/recvattach.c index 77f95638c..3b89e483a 100644 --- a/recvattach.c +++ b/recvattach.c @@ -1168,12 +1168,12 @@ void mutt_view_attachments(struct Header *hdr) if (!msg) return; - menu = mutt_new_menu(MENU_ATTACH); + menu = mutt_menu_new(MENU_ATTACH); menu->title = _("Attachments"); menu->make_entry = attach_entry; menu->tag = mutt_tag_attach; menu->help = mutt_compile_help(helpstr, sizeof(helpstr), MENU_ATTACH, AttachHelp); - mutt_push_current_menu(menu); + mutt_menu_push_current(menu); actx = mutt_mem_calloc(sizeof(struct AttachCtx), 1); actx->hdr = hdr; @@ -1430,7 +1430,7 @@ void mutt_view_attachments(struct Header *hdr) mutt_free_attach_context(&actx); - mutt_pop_current_menu(menu); + mutt_menu_pop_current(menu); mutt_menu_destroy(&menu); return; } diff --git a/remailer.c b/remailer.c index 252e44632..3ec59e837 100644 --- a/remailer.c +++ b/remailer.c @@ -518,7 +518,7 @@ void mix_make_chain(struct ListHead *chainhead) mix_screen_coordinates(type2_list, &coords, chain, 0); - menu = mutt_new_menu(MENU_MIX); + menu = mutt_menu_new(MENU_MIX); menu->max = ttll; menu->make_entry = mix_entry; menu->tag = NULL; @@ -526,7 +526,7 @@ void mix_make_chain(struct ListHead *chainhead) menu->data = type2_list; menu->help = mutt_compile_help(helpstr, sizeof(helpstr), MENU_MIX, RemailerHelp); menu->pagelen = MIX_VOFFSET - 1; - mutt_push_current_menu(menu); + mutt_menu_push_current(menu); while (loop) { @@ -663,7 +663,7 @@ void mix_make_chain(struct ListHead *chainhead) } } - mutt_pop_current_menu(menu); + mutt_menu_pop_current(menu); mutt_menu_destroy(&menu); /* construct the remailer list */ diff --git a/score.c b/score.c index 9db9be6d0..de30dc586 100644 --- a/score.c +++ b/score.c @@ -62,8 +62,8 @@ void mutt_check_rescore(struct Context *ctx) } /* must redraw the index since the user might have %N in it */ - mutt_set_menu_redraw_full(MENU_MAIN); - mutt_set_menu_redraw_full(MENU_PAGER); + mutt_menu_set_redraw_full(MENU_MAIN); + mutt_menu_set_redraw_full(MENU_PAGER); for (int i = 0; ctx && i < ctx->msgcount; i++) { diff --git a/sidebar.c b/sidebar.c index 39af41502..5ef642a55 100644 --- a/sidebar.c +++ b/sidebar.c @@ -1040,7 +1040,7 @@ void mutt_sb_change_mailbox(int op) default: return; } - mutt_set_current_menu_redraw(REDRAW_SIDEBAR); + mutt_menu_set_current_redraw(REDRAW_SIDEBAR); } /** @@ -1173,7 +1173,7 @@ void mutt_sb_notify_mailbox(struct Buffy *b, int created) Entries[del_index] = Entries[del_index + 1]; } - mutt_set_current_menu_redraw(REDRAW_SIDEBAR); + mutt_menu_set_current_redraw(REDRAW_SIDEBAR); } /** @@ -1207,5 +1207,5 @@ void mutt_sb_toggle_virtual(void) } } - mutt_set_current_menu_redraw(REDRAW_SIDEBAR); + mutt_menu_set_current_redraw(REDRAW_SIDEBAR); }