Thanks to visit codestin.com
Credit goes to code.neomutt.org
NeoMutt
2025-12-11-219-g274730
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
menu.h
Go to the documentation of this file.
1
22
23
#ifndef MUTT_KEY_MENU_H
24
#define MUTT_KEY_MENU_H
25
26
#include <stdbool.h>
27
#include "
mutt/lib.h
"
28
#include "
menu/lib.h
"
29
#include "
get.h
"
30
#include "
keymap.h
"
31
33
#define MAX_SEQ 8
34
38
struct
MenuFuncOp
39
{
40
const
char
*
name
;
41
int
op
;
42
MenuFuncFlags
flags
;
43
};
44
48
struct
MenuOpSeq
49
{
50
int
op
;
51
const
char
*
seq
;
52
};
53
57
struct
MenuFunctionOp
58
{
59
int
menu
;
60
const
char
*
function
;
61
int
op
;
62
};
63
ARRAY_HEAD
(MenuFunctionOpArray,
struct
MenuFunctionOp
);
64
68
struct
SubMenu
69
{
70
struct
MenuDefinition
*
parent
;
71
const
struct
MenuFuncOp
*
functions
;
72
struct
KeymapList
keymaps
;
73
};
74
ARRAY_HEAD
(SubMenuArray,
struct
SubMenu
);
75
ARRAY_HEAD
(SubMenuPArray,
struct
SubMenu
*);
76
80
struct
MenuDefinition
81
{
82
int
id
;
83
const
char
*
name
;
84
struct
SubMenuPArray
submenus
;
85
};
86
ARRAY_HEAD
(MenuDefinitionArray,
struct
MenuDefinition
);
87
96
typedef
void (*
init_keys_t
)(
struct
SubMenu
*sm_generic);
97
98
bool
is_bound
(
const
struct
MenuDefinition
*md,
int
op);
99
struct
Keymap
*
km_find_func
(
enum
MenuType
menu,
int
func);
100
int
km_get_menu_id
(
const
char
*name);
101
const
char
*
km_get_menu_name
(
int
mtype);
102
int
km_get_op
(
const
char
*func);
103
int
km_get_op_menu
(
int
mtype,
const
char
*func);
104
struct
MenuDefinition
*
menu_find
(
int
menu);
105
106
#endif
/* MUTT_KEY_MENU_H */
ARRAY_HEAD
#define ARRAY_HEAD(name, T)
Define a named struct for arrays of elements of a certain type.
Definition
array.h:47
get.h
Get a key from the user.
MenuFuncFlags
uint8_t MenuFuncFlags
Flags, e.g. MFF_DEPRECATED.
Definition
get.h:42
keymap.h
Keymap handling.
lib.h
GUI present the user with a selectable list.
init_keys_t
void(* init_keys_t)(struct SubMenu *sm_generic)
Definition
menu.h:96
km_get_op_menu
int km_get_op_menu(int mtype, const char *func)
Get the OpCode for a Function from a Menu.
Definition
menu.c:257
menu_find
struct MenuDefinition * menu_find(int menu)
Find a Menu Definition by Menu type.
Definition
menu.c:287
km_find_func
struct Keymap * km_find_func(enum MenuType menu, int func)
Find a function's mapping in a Menu.
Definition
menu.c:164
is_bound
bool is_bound(const struct MenuDefinition *md, int op)
Does a function have a keybinding?
Definition
menu.c:305
km_get_menu_name
const char * km_get_menu_name(int mtype)
Get the name of a Menu.
Definition
menu.c:195
km_get_op
int km_get_op(const char *func)
Get the OpCode for a Function.
Definition
menu.c:229
km_get_menu_id
int km_get_menu_id(const char *name)
Get the ID of a Menu.
Definition
menu.c:212
lib.h
Convenience wrapper for the library headers.
Keymap
A keyboard mapping.
Definition
keymap.h:43
MenuDefinition
Functions for a Dialog or Window.
Definition
menu.h:81
MenuDefinition::name
const char * name
Menu name, e.g. "alias".
Definition
menu.h:83
MenuDefinition::id
int id
Menu ID, e.g. MENU_ALIAS.
Definition
menu.h:82
MenuDefinition::submenus
struct SubMenuPArray submenus
Parts making up the Menu.
Definition
menu.h:84
MenuFuncOp
Mapping between a function and an operation.
Definition
menu.h:39
MenuFuncOp::name
const char * name
Name of the function.
Definition
menu.h:40
MenuFuncOp::flags
MenuFuncFlags flags
Flags, e.g. MFF_DEPRECATED.
Definition
menu.h:42
MenuFuncOp::op
int op
Operation, e.g. OP_DELETE.
Definition
menu.h:41
MenuFunctionOp
Mapping between a function and an operation.
Definition
menu.h:58
MenuFunctionOp::function
const char * function
Name of the function.
Definition
menu.h:60
MenuFunctionOp::menu
int menu
Menu, e.g. MENU_ALIAS.
Definition
menu.h:59
MenuFunctionOp::op
int op
Operation, e.g. OP_DELETE.
Definition
menu.h:61
MenuOpSeq
Mapping between an operation and a key sequence.
Definition
menu.h:49
MenuOpSeq::op
int op
Operation, e.g. OP_DELETE.
Definition
menu.h:50
MenuOpSeq::seq
const char * seq
Default key binding.
Definition
menu.h:51
SubMenu
Collection of related functions.
Definition
menu.h:69
SubMenu::functions
const struct MenuFuncOp * functions
All available functions.
Definition
menu.h:71
SubMenu::keymaps
struct KeymapList keymaps
All keybindings.
Definition
menu.h:72
SubMenu::parent
struct MenuDefinition * parent
Primary parent.
Definition
menu.h:70
MenuType
MenuType
Types of GUI selections.
Definition
type.h:33