GUI present the user with a selectable list. More...
#include "config.h"
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <wchar.h>
#include "mutt/lib.h"
#include "config/lib.h"
#include "email/lib.h"
#include "core/lib.h"
#include "gui/lib.h"
#include "mutt.h"
#include "pattern/lib.h"
#include "commands.h"
#include "context.h"
#include "keymap.h"
#include "mutt_globals.h"
#include "mutt_logging.h"
#include "mutt_mailbox.h"
#include "mutt_menu.h"
#include "mutt_thread.h"
#include "muttlib.h"
#include "opcodes.h"
#include "options.h"
#include "protos.h"
Go to the source code of this file.
Macros | |
#define | DIRECTION ((neg * 2) + 1) |
#define | MUTT_SEARCH_UP 1 |
#define | MUTT_SEARCH_DOWN 2 |
Functions | |
ARRAY_HEAD (struct Menu *) | |
static void | print_enriched_string (int index, int attr, unsigned char *s, bool do_color) |
Display a string with embedded colours and graphics. More... | |
static void | make_entry (char *buf, size_t buflen, struct Menu *menu, int i) |
Create string to display in a Menu (the index) More... | |
static void | menu_pad_string (struct Menu *menu, char *buf, size_t buflen) |
Pad a string with spaces for display in the Menu. More... | |
void | menu_redraw_full (struct Menu *menu) |
Force the redraw of the Menu. More... | |
void | menu_redraw_status (struct Menu *menu) |
Force the redraw of the status bar. More... | |
void | menu_redraw_index (struct Menu *menu) |
Force the redraw of the index. More... | |
void | menu_redraw_motion (struct Menu *menu) |
Force the redraw of the list part of the menu. More... | |
void | menu_redraw_current (struct Menu *menu) |
Redraw the current menu. More... | |
static void | menu_redraw_prompt (struct Menu *menu) |
Force the redraw of the message window. More... | |
void | menu_check_recenter (struct Menu *menu) |
Recentre the menu on screen. More... | |
static void | menu_jump (struct Menu *menu) |
Jump to another item in the menu. More... | |
void | menu_next_line (struct Menu *menu) |
Move the view down one line, keeping the selection the same. More... | |
void | menu_prev_line (struct Menu *menu) |
Move the view up one line, keeping the selection the same. More... | |
static void | menu_length_jump (struct Menu *menu, int jumplen) |
Calculate the destination of a jump. More... | |
void | menu_next_page (struct Menu *menu) |
Move the focus to the next page in the menu. More... | |
void | menu_prev_page (struct Menu *menu) |
Move the focus to the previous page in the menu. More... | |
void | menu_half_down (struct Menu *menu) |
Move the focus down half a page in the menu. More... | |
void | menu_half_up (struct Menu *menu) |
Move the focus up half a page in the menu. More... | |
void | menu_top_page (struct Menu *menu) |
Move the focus to the top of the page. More... | |
void | menu_bottom_page (struct Menu *menu) |
Move the focus to the bottom of the page. More... | |
void | menu_middle_page (struct Menu *menu) |
Move the focus to the centre of the page. More... | |
void | menu_first_entry (struct Menu *menu) |
Move the focus to the first entry in the menu. More... | |
void | menu_last_entry (struct Menu *menu) |
Move the focus to the last entry in the menu. More... | |
void | menu_current_top (struct Menu *menu) |
Move the current selection to the top of the window. More... | |
void | menu_current_middle (struct Menu *menu) |
Move the current selection to the centre of the window. More... | |
void | menu_current_bottom (struct Menu *menu) |
Move the current selection to the bottom of the window. More... | |
static void | menu_next_entry (struct Menu *menu) |
Move the focus to the next item in the menu. More... | |
static void | menu_prev_entry (struct Menu *menu) |
Move the focus to the previous item in the menu. More... | |
static int | default_color (int line) |
Get the default colour for a line of the menu - Implements Menu::color() More... | |
static int | generic_search (struct Menu *menu, regex_t *rx, int line) |
Search a menu for a item matching a regex - Implements Menu::search() More... | |
void | mutt_menu_init (void) |
Initialise all the Menus. More... | |
struct Menu * | mutt_menu_new (enum MenuType type) |
Create a new Menu. More... | |
void | mutt_menu_free (struct Menu **ptr) |
Destroy a menu. More... | |
void | mutt_menu_add_dialog_row (struct Menu *menu, const char *row) |
Add a row to a Menu. More... | |
static struct Menu * | get_current_menu (void) |
Get the current Menu. More... | |
void | mutt_menu_push_current (struct Menu *menu) |
Add a new Menu to the stack. More... | |
void | mutt_menu_pop_current (struct Menu *menu) |
Remove a Menu from the stack. More... | |
void | mutt_menu_set_current_redraw (MuttRedrawFlags redraw) |
Set redraw flags on the current menu. More... | |
void | mutt_menu_set_current_redraw_full (void) |
Flag the current menu to be fully redrawn. More... | |
void | mutt_menu_set_redraw (enum MenuType menu, MuttRedrawFlags redraw) |
Set redraw flags on a menu. More... | |
void | mutt_menu_set_redraw_full (enum MenuType menu) |
Flag a menu to be fully redrawn. More... | |
void | mutt_menu_current_redraw (void) |
Redraw the current menu. More... | |
static int | search (struct Menu *menu, int op) |
Search a menu. More... | |
static int | menu_dialog_translate_op (int i) |
Convert menubar movement to scrolling. More... | |
static int | menu_dialog_dokey (struct Menu *menu, int *ip) |
Check if there are any menu key events to process. More... | |
int | menu_redraw (struct Menu *menu) |
Redraw the parts of the screen that have been flagged to be redrawn. More... | |
int | mutt_menu_loop (struct Menu *menu) |
Menu event loop. More... | |
int | mutt_menu_color_observer (struct NotifyCallback *nc) |
Listen for colour changes affecting the menu - Implements observer_t. More... | |
int | mutt_menu_config_observer (struct NotifyCallback *nc) |
Listen for config changes affecting the menu - Implements observer_t. More... | |
Variables | |
short | C_MenuContext |
Config: Number of lines of overlap when changing pages in the index. More... | |
bool | C_MenuMoveOff |
Config: Allow the last menu item to move off the bottom of the screen. More... | |
bool | C_MenuScroll |
Config: Scroll the menu/index by one line, rather than a page. More... | |
char * | SearchBuffers [MENU_MAX] |
GUI present the user with a selectable list.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file menu.c.
#define DIRECTION ((neg * 2) + 1) |
#define MUTT_SEARCH_UP 1 |
#define MUTT_SEARCH_DOWN 2 |
ARRAY_HEAD | ( | struct Menu * | ) |
Definition at line 63 of file menu.c.
|
static |
Display a string with embedded colours and graphics.
index | Index number |
attr | Default colour for the line |
s | String of embedded colour codes |
do_color | If true, apply colour |
Definition at line 130 of file menu.c.
|
static |
Create string to display in a Menu (the index)
Definition at line 313 of file menu.c.
|
static |
Pad a string with spaces for display in the Menu.
Definition at line 332 of file menu.c.
void menu_redraw_full | ( | struct Menu * | menu | ) |
Force the redraw of the Menu.
menu | Current Menu |
Definition at line 348 of file menu.c.
void menu_redraw_status | ( | struct Menu * | menu | ) |
Force the redraw of the status bar.
menu | Current Menu |
Definition at line 365 of file menu.c.
void menu_redraw_index | ( | struct Menu * | menu | ) |
Force the redraw of the index.
menu | Current Menu |
Definition at line 381 of file menu.c.
void menu_redraw_motion | ( | struct Menu * | menu | ) |
Force the redraw of the list part of the menu.
menu | Current Menu |
Definition at line 434 of file menu.c.
void menu_redraw_current | ( | struct Menu * | menu | ) |
Redraw the current menu.
menu | Current Menu |
Definition at line 494 of file menu.c.
|
static |
Force the redraw of the message window.
menu | Current Menu |
Definition at line 522 of file menu.c.
void menu_check_recenter | ( | struct Menu * | menu | ) |
|
static |
Jump to another item in the menu.
menu | Current Menu |
Ask the user for a message number to jump to.
Definition at line 596 of file menu.c.
void menu_next_line | ( | struct Menu * | menu | ) |
void menu_prev_line | ( | struct Menu * | menu | ) |
|
static |
void menu_next_page | ( | struct Menu * | menu | ) |
void menu_prev_page | ( | struct Menu * | menu | ) |
void menu_half_down | ( | struct Menu * | menu | ) |
void menu_half_up | ( | 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_first_entry | ( | struct Menu * | menu | ) |
void menu_last_entry | ( | struct Menu * | menu | ) |
void menu_current_top | ( | struct Menu * | menu | ) |
void menu_current_middle | ( | struct Menu * | menu | ) |
void menu_current_bottom | ( | struct Menu * | menu | ) |
|
static |
|
static |
|
static |
Get the default colour for a line of the menu - Implements Menu::color()
Definition at line 925 of file menu.c.
|
static |
Search a menu for a item matching a regex - Implements Menu::search()
Definition at line 933 of file menu.c.
void mutt_menu_init | ( | void | ) |
Initialise all the Menus.
Definition at line 944 of file menu.c.
Create a new Menu.
type | Menu type, e.g. MENU_PAGER |
ptr | New Menu |
Definition at line 955 of file menu.c.
void mutt_menu_free | ( | struct Menu ** | ptr | ) |
Destroy a menu.
[out] | ptr | Menu to destroy |
Definition at line 971 of file menu.c.
void mutt_menu_add_dialog_row | ( | struct Menu * | menu, |
const char * | row | ||
) |
|
static |
Get the current Menu.
ptr | Current Menu |
Definition at line 1002 of file menu.c.
void mutt_menu_push_current | ( | struct Menu * | menu | ) |
Add a new Menu to the stack.
menu | Menu to add |
The menus are stored in a LIFO. The top-most is shown to the user.
Definition at line 1014 of file menu.c.
void mutt_menu_pop_current | ( | struct Menu * | menu | ) |
Remove a Menu from the stack.
menu | Current Menu |
The menus are stored in a LIFO. The top-most is shown to the user.
Definition at line 1026 of file menu.c.
void mutt_menu_set_current_redraw | ( | MuttRedrawFlags | redraw | ) |
Set redraw flags on the current menu.
redraw | Flags to set, see MuttRedrawFlags |
Definition at line 1061 of file menu.c.
void mutt_menu_set_current_redraw_full | ( | void | ) |
void mutt_menu_set_redraw | ( | enum MenuType | menu, |
MuttRedrawFlags | redraw | ||
) |
Set redraw flags on a menu.
menu | Menu type, e.g. MENU_ALIAS |
redraw | Flags, e.g. REDRAW_INDEX |
This is ignored if it's not the current menu.
Definition at line 1085 of file menu.c.
void mutt_menu_set_redraw_full | ( | enum MenuType | menu | ) |
Flag a menu to be fully redrawn.
menu | Menu type, e.g. MENU_ALIAS |
This is ignored if it's not the current menu.
Definition at line 1097 of file menu.c.
void mutt_menu_current_redraw | ( | void | ) |
|
static |
Search a menu.
menu | Menu to search |
op | Search operation, e.g. OP_SEARCH_NEXT |
>=0 | Index of matching item |
-1 | Search failed, or was cancelled |
Definition at line 1128 of file menu.c.
|
static |
|
static |
Check if there are any menu key events to process.
0 | An event occurred for the menu, or a timeout |
-1 | There was an event, but not for menu |
Definition at line 1232 of file menu.c.
int menu_redraw | ( | struct Menu * | menu | ) |
Redraw the parts of the screen that have been flagged to be redrawn.
menu | Menu to redraw |
OP_NULL | Menu was redrawn |
OP_REDRAW | Full redraw required |
Definition at line 1269 of file menu.c.
int mutt_menu_loop | ( | struct Menu * | menu | ) |
Menu event loop.
menu | Current Menu |
num | An event id that the menu can't process |
Definition at line 1308 of file menu.c.
int mutt_menu_color_observer | ( | struct NotifyCallback * | nc | ) |
Listen for colour changes affecting the menu - Implements observer_t.
Definition at line 1569 of file menu.c.
int mutt_menu_config_observer | ( | struct NotifyCallback * | nc | ) |
Listen for config changes affecting the menu - Implements observer_t.
Definition at line 1613 of file menu.c.
short C_MenuContext |
bool C_MenuMoveOff |
bool C_MenuScroll |