NeoMutt  2025-12-11-435-g4ac674
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
functions.h File Reference

Browser functions. More...

#include "key/lib.h"
+ Include dependency graph for functions.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  BrowserFunction
 A NeoMutt function. More...
 

Typedefs

typedef int(* browser_function_t) (struct BrowserPrivateData *priv, const struct KeyEvent *event)
 

Functions

int browser_function_dispatcher (struct MuttWindow *win, const struct KeyEvent *event)
 Perform a Browser function.
 

Variables

struct MenuDefinitionMdBrowser
 Browser Menu Definition.
 

Detailed Description

Browser functions.

Authors
  • Richard Russon

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.h.

Typedef Documentation

◆ browser_function_t

typedef int(* browser_function_t) (struct BrowserPrivateData *priv, const struct KeyEvent *event)

Definition at line 45 of file functions.h.

Function Documentation

◆ browser_function_dispatcher()

int browser_function_dispatcher ( struct MuttWindow * win,
const struct KeyEvent * event )

Perform a Browser function.

Parameters
winWindow for the Browser
eventEvent to process
Return values
numFunctionRetval, e.g. FR_SUCCESS

Definition at line 1152 of file functions.c.

1153{
1154 // The Dispatcher may be called on any Window in the Dialog
1155 struct MuttWindow *dlg = dialog_find(win);
1156 if (!dlg || !dlg->wdata)
1157 return FR_ERROR;
1158
1159 struct Menu *menu = dlg->wdata;
1160 struct BrowserPrivateData *priv = menu->mdata;
1161 if (!priv)
1162 return FR_ERROR;
1163
1164 int rc = FR_UNKNOWN;
1165 for (size_t i = 0; BrowserFunctions[i].op != OP_NULL; i++)
1166 {
1167 const struct BrowserFunction *fn = &BrowserFunctions[i];
1168 if (fn->op == event->op)
1169 {
1170 rc = fn->function(priv, event);
1171 break;
1172 }
1173 }
1174
1175 return rc;
1176}
static const struct BrowserFunction BrowserFunctions[]
All the NeoMutt functions that the Browser supports.
Definition functions.c:1114
struct MuttWindow * dialog_find(struct MuttWindow *win)
Find the parent Dialog of a Window.
Definition dialog.c:89
@ FR_UNKNOWN
Unknown function.
Definition dispatcher.h:34
@ FR_ERROR
Valid function - error occurred.
Definition dispatcher.h:39
A NeoMutt function.
Definition functions.h:51
int op
Op code, e.g. OP_MAIN_LIMIT.
Definition functions.h:52
browser_function_t function
Function to call.
Definition functions.h:53
Private state data for the Browser.
struct Menu * menu
Menu.
int op
Function opcode, e.g. OP_HELP.
Definition get.h:52
Definition lib.h:80
void * mdata
Private data.
Definition lib.h:149
void * wdata
Private data.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ MdBrowser

struct MenuDefinition* MdBrowser
extern

Browser Menu Definition.

Definition at line 64 of file functions.c.