NeoMutt  2024-12-12-14-g7b49f7
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
Preview Function API

Prototype for a Preview Function. More...

+ Collaboration diagram for Preview Function API:

Functions

static int preview_page_up (struct PreviewWindowData *wdata, int op)
 Show the previous page of the message - Implements preview_function_t -.
 
static int preview_page_down (struct PreviewWindowData *wdata, int op)
 Show the previous page of the message - Implements preview_function_t -.
 

Detailed Description

Prototype for a Preview Function.

Parameters
wdataPreview Window data
opOperation to perform, e.g. OP_NEXT_PAGE
Return values
enumFunctionRetval

Function Documentation

◆ preview_page_up()

static int preview_page_up ( struct PreviewWindowData wdata,
int  op 
)
static

Show the previous page of the message - Implements preview_function_t -.

Definition at line 366 of file preview.c.

367{
368 if (wdata->scroll_offset <= 0)
369 return FR_NO_ACTION;
370
371 wdata->scroll_offset -= MAX(wdata->win->state.rows - 1, 1);
372 draw_preview(wdata->win, wdata);
373
374 return FR_SUCCESS;
375}
@ FR_SUCCESS
Valid function - successfully performed.
Definition: dispatcher.h:39
@ FR_NO_ACTION
Valid function - no action performed.
Definition: dispatcher.h:37
#define MAX(a, b)
Definition: memory.h:31
static void draw_preview(struct MuttWindow *win, struct PreviewWindowData *wdata)
Write the message preview to the compose window.
Definition: preview.c:134
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:127
struct MuttWindow * win
Window holding the message preview.
Definition: preview.c:81
int scroll_offset
Scroll offset.
Definition: preview.c:80
short rows
Number of rows, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:62
+ Here is the call graph for this function:

◆ preview_page_down()

static int preview_page_down ( struct PreviewWindowData wdata,
int  op 
)
static

Show the previous page of the message - Implements preview_function_t -.

Definition at line 380 of file preview.c.

381{
382 if (!wdata->more_content)
383 return FR_NO_ACTION;
384
385 wdata->scroll_offset += MAX(wdata->win->state.rows - 1, 1);
386 draw_preview(wdata->win, wdata);
387
388 return FR_SUCCESS;
389}
bool more_content
Is there more content to scroll down to?
Definition: preview.c:83
+ Here is the call graph for this function: