NeoMutt  2021-10-29-220-g2b1eec
Teaching an old dog new tricks
DOXYGEN
display.h
Go to the documentation of this file.
1 
23 #ifndef MUTT_PAGER_DISPLAY_H
24 #define MUTT_PAGER_DISPLAY_H
25 
26 #include "config.h"
27 #include <stdbool.h>
28 #include <stdint.h>
29 #include <stdio.h>
30 #include "mutt/lib.h"
31 #include "lib.h"
32 
33 struct MuttWindow;
34 
35 // clang-format off
36 typedef uint8_t AnsiFlags;
37 #define ANSI_NO_FLAGS 0
38 #define ANSI_OFF (1 << 0)
39 #define ANSI_BLINK (1 << 1)
40 #define ANSI_BOLD (1 << 2)
41 #define ANSI_UNDERLINE (1 << 3)
42 #define ANSI_REVERSE (1 << 4)
43 #define ANSI_COLOR (1 << 5)
44 // clang-format on
45 
49 struct TextSyntax
50 {
51  int color;
52  int first;
53  int last;
54 };
55 
59 struct AnsiAttr
60 {
62  int fg;
63  int bg;
64  int pair;
65 };
66 
70 struct Line
71 {
72  LOFF_T offset;
73  short cid;
74  bool cont_line : 1;
75  bool cont_header : 1;
76 
78  struct TextSyntax *syntax;
79 
81  struct TextSyntax *search;
82 
83  struct QuoteStyle *quote;
84 };
85 
86 int display_line(FILE *fp, LOFF_T *last_pos, struct Line **lines, int n, int *last,
87  int *max, PagerFlags flags, struct QuoteStyle **quote_list, int *q_level,
88  bool *force_redraw, regex_t *search_re, struct MuttWindow *win_pager);
89 
90 #endif /* MUTT_PAGER_DISPLAY_H */
uint8_t AnsiFlags
Flags, e.g. ANSI_OFF.
Definition: display.h:33
int display_line(FILE *fp, LOFF_T *last_pos, struct Line **lines, int n, int *last, int *max, PagerFlags flags, struct QuoteStyle **quote_list, int *q_level, bool *force_redraw, regex_t *search_re, struct MuttWindow *win_pager)
Print a line on screen.
Definition: display.c:1039
Convenience wrapper for the library headers.
uint16_t PagerFlags
Flags for mutt_pager(), e.g. MUTT_SHOWFLAT.
Definition: lib.h:56
Key value store.
An ANSI escape sequence.
Definition: display.h:60
AnsiFlags attr
Attributes, e.g. ANSI_BOLD.
Definition: display.h:61
int pair
Curses colour pair.
Definition: display.h:64
int fg
ANSI Foreground colour, e.g. 1 red, 2 green, etc.
Definition: display.h:62
int bg
ANSI Background colour, e.g. 1 red, 2 green, etc.
Definition: display.h:63
A line of text in the pager.
Definition: display.h:71
short search_arr_size
Number of items in search array.
Definition: display.h:80
struct TextSyntax * search
Array of search text in the line.
Definition: display.h:81
bool cont_line
Continuation of a previous line (wrapped by NeoMutt)
Definition: display.h:74
short cid
Default line colour, e.g. MT_COLOR_QUOTED.
Definition: display.h:73
struct QuoteStyle * quote
Quoting style for this line (pointer into PagerPrivateData->quote_list)
Definition: display.h:83
LOFF_T offset
Offset into Email file (PagerPrivateData->fp)
Definition: display.h:72
bool cont_header
Continuation of a header line (wrapped by MTA)
Definition: display.h:75
short syntax_arr_size
Number of items in syntax array.
Definition: display.h:77
struct TextSyntax * syntax
Array of coloured text in the line.
Definition: display.h:78
Style of quoted text.
Definition: quoted.h:66
Highlighting for a piece of text.
Definition: display.h:50
int last
Last character in line to be coloured.
Definition: display.h:53
int color
Curses colour of text.
Definition: display.h:51
int first
First character in line to be coloured.
Definition: display.h:52