Display an email, attachment, or help, in a window.
This pager is actually not so simple as it once was. But it will be again. Currently it operates in 3 modes:
226{
227
228
229
230 assert(pview);
232 assert(pview->
pdata);
235
239
241 {
243
244
245
248 assert(shared->
email);
250 break;
251
253
254
255
256
259 {
260
261
263 }
264 break;
265
269 assert(!shared->
email);
271 break;
272
275 default:
276
277
278
279 assert(false);
280 break;
281 }
282
283
284
285
286
287
288 int op = 0;
297
298
301 memset(priv, 0, sizeof(*priv));
305
306
309
311 {
315 if (c_pager_read_delay == 0)
316 {
318 }
319 else
320 {
322 }
323 }
324
327
328
335 0;
336
337 for (
size_t i = 0; i < priv->
lines_max; i++)
338 {
344 }
345
346
348 {
350 return -1;
351 }
352
354 {
357 return -1;
358 }
361
362
366
368
369
371 {
373 }
374
375
376
377
378
379
380
383
385 do
386 {
390
392 if (c_braille_friendly)
393 {
395 {
398 }
399 }
400 else
401 {
403 }
404
405
407
408
409
410
411
412
413 bool do_new_mail = false;
415 {
417
420 {
422 {
423
425 break;
426 }
427 }
430 {
431
433 {
435 {
437
439 {
441 do_new_mail = true;
442 break;
443 }
444 }
445 }
446
448 {
451 }
452 }
453
455 {
457 if (c_beep_new)
460 if (c_new_mail_command)
461 {
462 char cmd[1024] = { 0 };
464 NONULL(c_new_mail_command));
467 }
468 }
469 }
470
471
473 {
476 clearok(stdscr, true);
478
481 {
482
484 for (
size_t i = 0; i <= priv->
top_line; i++)
487
489
493
495 priv->
rc = OP_REFORMAT_WINCH;
496 break;
497 }
498 else
499 {
500
501
502 op = OP_NULL;
503 }
504 continue;
505 }
506
507#ifdef USE_DEBUG_COLOR
509#endif
510
511
512
513
514
515
516
517
518
519
520
522
523
524
525
526
528 {
530 }
531
534
535 if (op >= OP_NULL)
537
539
540 if (op < OP_NULL)
541 {
542 op = OP_NULL;
544 continue;
545 }
546
547 if (op == OP_NULL)
548 {
550 continue;
551 }
552
554
556 {
559#ifdef USE_SIDEBAR
562#endif
563 }
566
569 {
570
572 break;
573 }
574
577
579
580
581
582
583
586 {
589 }
590
592
593 for (
size_t i = 0; i < priv->
lines_max; i++)
594 {
598 }
600 {
603 }
606 {
608 int count = 0;
610 {
611 count++;
612 }
614 }
615
617
620
621 return (priv->
rc != -1) ? priv->
rc : 0;
622}
void attr_color_list_clear(struct AttrColorList *acl)
Free the contents of an AttrColorList.
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
short cs_subset_number(const struct ConfigSubset *sub, const char *name)
Get a number config item by name.
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
void mutt_flushinp(void)
Empty all the keyboard buffers.
void mutt_refresh(void)
Force a refresh of the screen.
void mutt_beep(bool force)
Irritate the user.
void dump_pager(struct PagerPrivateData *priv)
int color_debug(enum LogLevel level, const char *format,...)
Write to the log file.
struct MuttWindow * dialog_find(struct MuttWindow *win)
Find the parent Dialog of a Window.
@ FR_UNKNOWN
Unknown function.
int mutt_file_fclose(FILE **fp)
Close a FILE handle (and NULL the pointer)
void mutt_set_flag(struct Mailbox *m, struct Email *e, enum MessageType flag, bool bf, bool upd_mbox)
Set a flag on an email.
bool OptAttachMsg
(pseudo) used by attach-message
bool OptSearchInvalid
(pseudo) used to invalidate the search pattern
SIG_ATOMIC_VOLATILE_T SigWinch
true after SIGWINCH is received
int pager_function_dispatcher(struct MuttWindow *win, int op)
Perform a Pager function - Implements function_dispatcher_t -.
int sb_function_dispatcher(struct MuttWindow *win, int op)
Perform a Sidebar function - Implements function_dispatcher_t -.
int global_function_dispatcher(struct MuttWindow *win, int op)
Perform a Global function - Implements function_dispatcher_t -.
int index_function_dispatcher(struct MuttWindow *win, int op)
Perform an Index function - Implements function_dispatcher_t -.
#define mutt_message(...)
#define mutt_debug(LEVEL,...)
void mutt_timeout_hook(void)
Execute any timeout hooks.
int km_dokey(enum MenuType mtype)
Determine what a keypress should do.
void km_error_key(enum MenuType mtype)
Handle an unbound key sequence.
@ LL_DEBUG5
Log at debug level 5.
@ LL_DEBUG1
Log at debug level 1.
MailboxType
Supported mailbox formats.
@ MUTT_UNKNOWN
Mailbox wasn't recognised.
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
void * mutt_mem_malloc(size_t size)
Allocate memory on the heap.
void msgwin_clear_text(void)
Clear the text in the Message Window.
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
@ MUTT_READ
Messages that have been read.
void mutt_resize_screen(void)
Update NeoMutt's opinion about the window size (CURSES)
void mutt_clear_error(void)
Clear the message line (bottom line of screen)
bool mutt_mailbox_notify(struct Mailbox *m_cur)
Notify the user if there's new mail.
void window_redraw(struct MuttWindow *win)
Reflow, recalc and repaint a tree of Windows.
void mutt_window_reflow(struct MuttWindow *win)
Resize a Window and its children.
int mutt_window_move(struct MuttWindow *win, int col, int row)
Move the cursor in a Window.
struct MuttWindow * window_set_focus(struct MuttWindow *win)
Set the Window focus.
void window_set_visible(struct MuttWindow *win, bool visible)
Set a Window visible or hidden.
struct MuttWindow * window_find_child(struct MuttWindow *win, enum WindowType type)
Recursively find a child Window of a given type.
void window_invalidate_all(void)
Mark all windows as in need of repaint.
@ WT_SIDEBAR
Side panel containing Accounts or groups of data.
@ MUTT_WIN_SIZE_MAXIMISE
Window wants as much space as possible.
enum MxStatus mx_mbox_check(struct Mailbox *m)
Check for new mail - Wrapper for MxOps::mbox_check()
MxStatus
Return values from mbox_check(), mbox_check_stats(), mbox_snc(), and mbox_close()
@ MX_STATUS_ERROR
An error occurred.
@ MX_STATUS_FLAGS
Nondestructive flags change (IMAP)
@ MX_STATUS_REOPENED
Mailbox was reopened.
@ MX_STATUS_NEW_MAIL
New mail received in Mailbox.
@ NT_PAGER
Pager data has changed, NotifyPager, PagerPrivateData.
const char * opcodes_get_name(int op)
Get the name of an opcode.
int mutt_system(const char *cmd)
Run an external command.
#define TAILQ_FOREACH(var, head, field)
void qstyle_free_tree(struct QuoteStyle **quote_list)
Free an entire tree of QuoteStyle.
void menu_status_line(char *buf, size_t buflen, struct IndexSharedData *shared, struct Menu *menu, int cols, const char *fmt)
Create the status line.
A curses colour and its attributes.
struct Email * email
header information for message/rfc822
The envelope/body of an email.
int msgno
Number displayed to the user.
Data shared between Index, Pager and Sidebar.
struct Email * email
Currently selected Email.
struct Mailbox * mailbox
Current Mailbox.
struct MailboxView * mailbox_view
Current Mailbox view.
A line of text in the pager.
short search_arr_size
Number of items in search array.
struct TextSyntax * search
Array of search text in the line.
bool cont_line
Continuation of a previous line (wrapped by NeoMutt)
short cid
Default line colour, e.g. MT_COLOR_QUOTED.
struct TextSyntax * syntax
Array of coloured text in the line.
int msg_in_pager
Message currently shown in the pager.
int msg_count
Total number of messages.
enum MailboxType type
Mailbox type.
struct Email ** emails
Array of Emails.
struct Buffer pathbuf
Path of the Mailbox.
const struct Mapping * help_data
Data for the Help Bar.
struct WindowState state
Current state of the Window.
void * wdata
Private data.
int help_menu
Menu for key bindings, e.g. MENU_PAGER.
struct MuttWindow * parent
Parent Window.
enum MuttWindowSize size
Type of Window, e.g. MUTT_WIN_SIZE_FIXED.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.
Keep track of screen resizing.
Highlighting for a piece of text.
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
@ MENU_PAGER
Pager pager (email viewer)