NeoMutt  2025-12-11-694-ga89709
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
functions.c File Reference

Definitions of user functions. More...

#include "config.h"
#include <stddef.h>
#include "key/lib.h"
#include "menu/lib.h"
#include "opcodes.h"
+ Include dependency graph for functions.c:

Go to the source code of this file.

Functions

struct SubMenugeneric_init_keys (void)
 Initialise the Generic Keybindings.
 

Variables

struct MenuDefinitionMdGeneric = NULL
 Generic Menu Definition.
 
struct MenuDefinitionMdDialog = NULL
 Dialog Menu Definition.
 
struct SubMenuSmGeneric = NULL
 Generic functions.
 
struct SubMenuSmDialog = NULL
 Dialog functions.
 
static const struct MenuFuncOp OpDialog []
 Functions for Simple Dialogs.
 
static const struct MenuFuncOp OpGeneric []
 Functions for the Generic Menu.
 
static const struct MenuOpSeq DialogDefaultBindings []
 Key bindings for Simple Dialogs.
 
static const struct MenuOpSeq GenericDefaultBindings []
 Key bindings for the Generic Menu.
 

Detailed Description

Definitions of user functions.

Authors
  • Richard Russon
  • Pietro Cerutti

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 functions.c.

Function Documentation

◆ generic_init_keys()

struct SubMenu * generic_init_keys ( void )

Initialise the Generic Keybindings.

Definition at line 195 of file functions.c.

196{
197 struct MenuDefinition *md = NULL;
198 struct SubMenu *sm = NULL;
199 struct SubMenu *sm_generic = NULL;
200
201 sm_generic = km_register_submenu(OpGeneric);
202 md = km_register_menu(MENU_GENERIC, "generic");
203 km_menu_add_submenu(md, sm_generic);
205
206 MdGeneric = md;
207 SmGeneric = sm;
208
210 md = km_register_menu(MENU_DIALOG, "dialog");
211 km_menu_add_submenu(md, sm);
212 km_menu_add_submenu(md, sm_generic);
214
215 MdDialog = md;
216 SmDialog = sm;
217
218 return sm_generic;
219}
struct MenuDefinition * MdDialog
Dialog Menu Definition.
Definition functions.c:53
struct SubMenu * SmGeneric
Generic functions.
Definition functions.c:56
static const struct MenuFuncOp OpGeneric[]
Functions for the Generic Menu.
Definition functions.c:74
struct MenuDefinition * MdGeneric
Generic Menu Definition.
Definition functions.c:50
static const struct MenuOpSeq GenericDefaultBindings[]
Key bindings for the Generic Menu.
Definition functions.c:144
static const struct MenuOpSeq DialogDefaultBindings[]
Key bindings for Simple Dialogs.
Definition functions.c:136
struct SubMenu * SmDialog
Dialog functions.
Definition functions.c:59
static const struct MenuFuncOp OpDialog[]
Functions for Simple Dialogs.
Definition functions.c:65
void km_menu_add_submenu(struct MenuDefinition *md, struct SubMenu *sm)
Add a SubMenu to a Menu Definition.
Definition init.c:123
struct SubMenu * km_register_submenu(const struct MenuFuncOp functions[])
Register a submenu.
Definition init.c:91
struct MenuDefinition * km_register_menu(int menu, const char *name)
Register a menu.
Definition init.c:107
void km_menu_add_bindings(struct MenuDefinition *md, const struct MenuOpSeq bindings[])
Add Keybindings to a Menu.
Definition init.c:136
Functions for a Dialog or Window.
Definition menu.h:80
Collection of related functions.
Definition menu.h:68
@ MENU_DIALOG
Simple Dialog.
Definition type.h:41
@ MENU_GENERIC
Generic selection list.
Definition type.h:43
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ MdGeneric

struct MenuDefinition* MdGeneric = NULL

Generic Menu Definition.

Definition at line 50 of file functions.c.

◆ MdDialog

struct MenuDefinition* MdDialog = NULL

Dialog Menu Definition.

Definition at line 53 of file functions.c.

◆ SmGeneric

struct SubMenu* SmGeneric = NULL

Generic functions.

Definition at line 56 of file functions.c.

◆ SmDialog

struct SubMenu* SmDialog = NULL

Dialog functions.

Definition at line 59 of file functions.c.

◆ OpDialog

const struct MenuFuncOp OpDialog[]
static
Initial value:
= {
{ "quit", OP_QUIT },
{ "exit", OP_EXIT },
{ NULL, 0 },
}

Functions for Simple Dialogs.

Definition at line 65 of file functions.c.

65 {
66 { "quit", OP_QUIT },
67 { "exit", OP_EXIT },
68 { NULL, 0 },
69};

◆ OpGeneric

const struct MenuFuncOp OpGeneric[]
static

Functions for the Generic Menu.

Definition at line 74 of file functions.c.

74 { /* map: generic */
75 /*
76 ** <para>
77 ** The <emphasis>generic</emphasis> menu is not a real menu, but specifies common functions
78 ** (such as movement) available in all menus except for <emphasis>pager</emphasis> and
79 ** <emphasis>editor</emphasis>. Changing settings for this menu will affect the default
80 ** bindings for all menus (except as noted).
81 ** </para>
82 */
83 { "bottom-page", OP_BOTTOM_PAGE },
84 { "check-stats", OP_CHECK_STATS },
85 { "current-bottom", OP_CURRENT_BOTTOM },
86 { "current-middle", OP_CURRENT_MIDDLE },
87 { "current-top", OP_CURRENT_TOP },
88 { "end-cond", OP_END_COND },
89 { "enter-command", OP_ENTER_COMMAND },
90 { "exit", OP_EXIT },
91 { "first-entry", OP_FIRST_ENTRY },
92 { "half-down", OP_HALF_DOWN },
93 { "half-up", OP_HALF_UP },
94 { "help", OP_HELP },
95 { "jump", OP_JUMP },
96 { "jump", OP_JUMP_1 },
97 { "jump", OP_JUMP_2 },
98 { "jump", OP_JUMP_3 },
99 { "jump", OP_JUMP_4 },
100 { "jump", OP_JUMP_5 },
101 { "jump", OP_JUMP_6 },
102 { "jump", OP_JUMP_7 },
103 { "jump", OP_JUMP_8 },
104 { "jump", OP_JUMP_9 },
105 { "last-entry", OP_LAST_ENTRY },
106 { "middle-page", OP_MIDDLE_PAGE },
107 { "next-entry", OP_NEXT_ENTRY },
108 { "next-line", OP_NEXT_LINE },
109 { "next-page", OP_NEXT_PAGE },
110 { "previous-entry", OP_PREV_ENTRY },
111 { "previous-line", OP_PREV_LINE },
112 { "previous-page", OP_PREV_PAGE },
113 { "redraw-screen", OP_REDRAW },
114 { "search", OP_SEARCH },
115 { "search-next", OP_SEARCH_NEXT },
116 { "search-opposite", OP_SEARCH_OPPOSITE },
117 { "search-reverse", OP_SEARCH_REVERSE },
118 { "select-entry", OP_GENERIC_SELECT_ENTRY },
119 { "shell-escape", OP_SHELL_ESCAPE },
120 { "show-log-messages", OP_SHOW_LOG_MESSAGES },
121 { "show-version", OP_VERSION },
122 { "tag-entry", OP_TAG },
123 { "tag-prefix", OP_TAG_PREFIX },
124 { "tag-prefix-cond", OP_TAG_PREFIX_COND },
125 { "top-page", OP_TOP_PAGE },
126 { "what-key", OP_WHAT_KEY },
127 // Deprecated
128 { "error-history", OP_SHOW_LOG_MESSAGES, MFF_DEPRECATED },
129 { "refresh", OP_REDRAW, MFF_DEPRECATED },
130 { NULL, 0 },
131};
#define MFF_DEPRECATED
Redraw the pager.
Definition get.h:44

◆ DialogDefaultBindings

const struct MenuOpSeq DialogDefaultBindings[]
static
Initial value:
= {
{ OP_QUIT, "q" },
{ 0, NULL },
}

Key bindings for Simple Dialogs.

Definition at line 136 of file functions.c.

136 {
137 { OP_QUIT, "q" },
138 { 0, NULL },
139};

◆ GenericDefaultBindings

const struct MenuOpSeq GenericDefaultBindings[]
static

Key bindings for the Generic Menu.

Definition at line 144 of file functions.c.

144 { /* map: generic */
145 { OP_BOTTOM_PAGE, "L" },
146 { OP_ENTER_COMMAND, ":" },
147 { OP_FIRST_ENTRY, "<home>" },
148 { OP_FIRST_ENTRY, "=" },
149 { OP_GENERIC_SELECT_ENTRY, "<keypadenter>" },
150 { OP_GENERIC_SELECT_ENTRY, "\n" }, // <Enter>
151 { OP_GENERIC_SELECT_ENTRY, "\r" }, // <Return>
152 { OP_HALF_DOWN, "]" },
153 { OP_HALF_UP, "[" },
154 { OP_HELP, "?" },
155 { OP_JUMP_1, "1" },
156 { OP_JUMP_2, "2" },
157 { OP_JUMP_3, "3" },
158 { OP_JUMP_4, "4" },
159 { OP_JUMP_5, "5" },
160 { OP_JUMP_6, "6" },
161 { OP_JUMP_7, "7" },
162 { OP_JUMP_8, "8" },
163 { OP_JUMP_9, "9" },
164 { OP_LAST_ENTRY, "*" },
165 { OP_LAST_ENTRY, "<end>" },
166 { OP_MIDDLE_PAGE, "M" },
167 { OP_NEXT_ENTRY, "<down>" },
168 { OP_NEXT_ENTRY, "j" },
169 { OP_NEXT_LINE, ">" },
170 { OP_NEXT_PAGE, "<pagedown>" },
171 { OP_NEXT_PAGE, "<right>" },
172 { OP_NEXT_PAGE, "z" },
173 { OP_PREV_ENTRY, "<up>" },
174 { OP_PREV_ENTRY, "k" },
175 { OP_PREV_LINE, "<" },
176 { OP_PREV_PAGE, "<left>" },
177 { OP_PREV_PAGE, "<pageup>" },
178 { OP_PREV_PAGE, "Z" },
179 { OP_REDRAW, "\014" }, // <Ctrl-L>
180 { OP_SEARCH, "/" },
181 { OP_SEARCH_NEXT, "n" },
182 { OP_SEARCH_REVERSE, "\033/" }, // <Alt-/>
183 { OP_SHELL_ESCAPE, "!" },
184 { OP_TAG, "t" },
185 { OP_TAG_PREFIX, ";" },
186 { OP_TOP_PAGE, "H" },
187 { OP_VERSION, "V" },
188 { 0, NULL },
189};