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

Pager functions. More...

#include <stdbool.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  PagerFunctionData
 Data passed to Pager worker functions. More...
 
struct  PagerFunction
 A NeoMutt function. More...
 

Macros

#define MdPager   (pager_get_menu_definition())
 

Typedefs

typedef int(* pager_function_t) (struct PagerFunctionData *fdata, const struct KeyEvent *event)
 

Functions

int pager_function_dispatcher (struct MuttWindow *win, const struct KeyEvent *event)
 Perform a Pager function - Implements function_dispatcher_t -.
 
bool jump_to_bottom (struct PagerPrivateData *priv, struct PagerView *pview)
 Make sure the bottom line is displayed.
 
struct MenuDefinitionpager_get_menu_definition (void)
 Get the Pager Menu Definition.
 

Detailed Description

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

Macro Definition Documentation

◆ MdPager

#define MdPager   (pager_get_menu_definition())

Definition at line 73 of file functions.h.

Typedef Documentation

◆ pager_function_t

typedef int(* pager_function_t) (struct PagerFunctionData *fdata, const struct KeyEvent *event)

Definition at line 57 of file functions.h.

Function Documentation

◆ jump_to_bottom()

bool jump_to_bottom ( struct PagerPrivateData * priv,
struct PagerView * pview )

Make sure the bottom line is displayed.

Parameters
privPrivate Pager data
pviewPagerView
Return values
trueSomething changed
falseBottom was already displayed

Definition at line 379 of file functions.c.

380{
381 if (!(priv->lines[priv->cur_line].offset < (priv->st.st_size - 1)))
382 {
383 return false;
384 }
385
386 int line_num = priv->cur_line;
387 /* make sure the types are defined to the end of file */
388 while (display_line(priv->fp, &priv->bytes_read, &priv->lines, line_num,
389 &priv->lines_used, &priv->lines_max,
390 priv->has_types | (pview->flags & MUTT_PAGER_NOWRAP),
391 &priv->quote_list, &priv->q_level, &priv->force_redraw,
392 &priv->search_re, priv->pview->win_pager, &priv->ansi_list) == 0)
393 {
394 line_num++;
395 }
396 priv->top_line = up_n_lines(priv->pview->win_pager->state.rows, priv->lines,
397 priv->lines_used, priv->hide_quoted);
399 return true;
400}
int display_line(FILE *fp, LOFF_T *bytes_read, struct Line **lines, int line_num, int *lines_used, int *lines_max, PagerFlags flags, struct QuoteStyle **quote_list, int *q_level, bool *force_redraw, regex_t *search_re, struct MuttWindow *win_pager, struct AttrColorList *ansi_list)
Print a line on screen.
Definition display.c:1058
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
Definition notify.c:173
@ NT_PAGER
Pager data has changed, NotifyPager, PagerPrivateData.
Definition notify_type.h:53
static int up_n_lines(int nlines, struct Line *info, int cur, bool hiding)
Reposition the pager's view up by n lines.
Definition functions.c:360
#define NT_PAGER_VIEW
Pager View has changed.
Definition lib.h:188
#define MUTT_PAGER_NOWRAP
Format for term width, ignore $wrap.
Definition lib.h:74
LOFF_T offset
Offset into Email file (PagerPrivateData->fp)
Definition display.h:51
struct WindowState state
Current state of the Window.
PagerFlags hide_quoted
Set to MUTT_HIDE when quoted email is hidden <toggle-quoted>
int q_level
Number of unique quoting levels.
int cur_line
Current line (last line visible on screen)
int lines_used
Size of lines array (used entries)
int lines_max
Capacity of lines array (total entries)
bool force_redraw
Repaint is needed.
struct Line * lines
Array of text lines in pager.
int has_types
Set to MUTT_TYPES for PAGER_MODE_EMAIL or MUTT_SHOWCOLOR.
struct Notify * notify
Notifications: NotifyPager, PagerPrivateData.
LOFF_T bytes_read
Number of bytes read from file.
int top_line
First visible line on screen.
struct stat st
Stats about Email file.
struct QuoteStyle * quote_list
Tree of quoting levels.
struct PagerView * pview
Object to view in the pager.
struct AttrColorList ansi_list
List of ANSI colours used in the Pager.
regex_t search_re
Compiled search string.
FILE * fp
File containing decrypted/decoded/weeded Email.
PagerFlags flags
Additional settings to tweak pager's function.
Definition lib.h:176
struct MuttWindow * win_pager
Pager Window.
Definition lib.h:181
short rows
Number of rows, can be MUTT_WIN_SIZE_UNLIMITED.
Definition mutt_window.h:61
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pager_get_menu_definition()

struct MenuDefinition * pager_get_menu_definition ( void )

Get the Pager Menu Definition.

Return values
ptrPager Menu Definition

Definition at line 1195 of file functions.c.

1196{
1198 ASSERT(mod_data);
1199
1200 return mod_data->menu_pager;
1201}
@ MODULE_ID_PAGER
ModulePager, Pager
Definition module_api.h:83
void * neomutt_get_module_data(struct NeoMutt *n, enum ModuleId id)
Get the private data for a Module.
Definition neomutt.c:665
#define ASSERT(COND)
Definition signal2.h:59
Container for Accounts, Notifications.
Definition neomutt.h:41
Pager private Module data.
Definition module_data.h:30
struct MenuDefinition * menu_pager
Pager menu definition.
Definition module_data.h:32
+ Here is the call graph for this function: