GUI display a file/email/help in a viewport with paging. More...
#include "config.h"
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include "mutt/lib.h"
Go to the source code of this file.
Data Structures | |
struct | PagerData |
Data to be displayed by PagerView. More... | |
struct | PagerView |
Paged view into some data. More... | |
Macros | |
#define | MUTT_PAGER_NO_FLAGS 0 |
No flags are set. | |
#define | MUTT_SHOWFLAT (1 << 0) |
Show characters (used for displaying help) | |
#define | MUTT_SHOWCOLOR (1 << 1) |
Show characters in color otherwise don't show characters. | |
#define | MUTT_HIDE (1 << 2) |
Don't show quoted text. | |
#define | MUTT_SEARCH (1 << 3) |
Resolve search patterns. | |
#define | MUTT_TYPES (1 << 4) |
Compute line's type. | |
#define | MUTT_SHOW (MUTT_SHOWCOLOR | MUTT_SHOWFLAT) |
#define | MUTT_PAGER_NSKIP (1 << 5) |
Preserve whitespace with smartwrap. | |
#define | MUTT_PAGER_MARKER (1 << 6) |
Use markers if option is set. | |
#define | MUTT_PAGER_RETWINCH (1 << 7) |
Need reformatting on SIGWINCH. | |
#define | MUTT_PAGER_ATTACHMENT (1 << 8) |
Attachments may exist. | |
#define | MUTT_PAGER_NOWRAP (1 << 9) |
Format for term width, ignore $wrap. | |
#define | MUTT_PAGER_LOGS (1 << 10) |
Logview mode. | |
#define | MUTT_PAGER_BOTTOM (1 << 11) |
Start at the bottom. | |
#define | MUTT_PAGER_STRIPES (1 << 12) |
Striped highlighting. | |
#define | MUTT_PAGER_MESSAGE (MUTT_SHOWCOLOR | MUTT_PAGER_MARKER) |
#define | MUTT_DISPLAYFLAGS (MUTT_SHOW | MUTT_PAGER_NSKIP | MUTT_PAGER_MARKER | MUTT_PAGER_LOGS) |
#define | NT_PAGER_NO_FLAGS 0 |
No flags are set. | |
#define | NT_PAGER_DELETE (1 << 0) |
Pager Private Data is about to be freed. | |
#define | NT_PAGER_VIEW (1 << 1) |
Pager View has changed. | |
#define | PAGER_REDRAW_NO_FLAGS 0 |
No flags are set. | |
#define | PAGER_REDRAW_PAGER (1 << 1) |
Redraw the pager. | |
#define | PAGER_REDRAW_FLOW (1 << 2) |
Reflow the pager. | |
Typedefs | |
typedef uint16_t | PagerFlags |
Flags for dlg_pager(), e.g. MUTT_SHOWFLAT. | |
typedef uint8_t | NotifyPager |
Flags, e.g. NT_PAGER_DELETE. | |
typedef uint8_t | PagerRedrawFlags |
Flags, e.g. PAGER_REDRAW_PAGER. | |
Enumerations | |
enum | PagerMode { PAGER_MODE_UNKNOWN = 0 , PAGER_MODE_EMAIL , PAGER_MODE_ATTACH , PAGER_MODE_ATTACH_E , PAGER_MODE_HELP , PAGER_MODE_OTHER , PAGER_MODE_MAX } |
Determine the behaviour of the Pager. More... | |
enum | PagerLoopMode { PAGER_LOOP_CONTINUE = -7 , PAGER_LOOP_QUIT = -6 , PAGER_LOOP_RELOAD = -5 } |
What the Pager Event Loop should do next. More... | |
Functions | |
int | dlg_pager (struct PagerView *pview) |
Display an email, attachment, or help, in a window -. | |
int | mutt_do_pager (struct PagerView *pview, struct Email *e) |
Display some page-able text to the user (help or attachment) | |
void | buf_strip_formatting (struct Buffer *dest, const char *src, bool strip_markers) |
Removes ANSI and backspace formatting. | |
struct MuttWindow * | ppanel_new (bool status_on_top, struct IndexSharedData *shared) |
Create the Windows for the Pager panel. | |
struct MuttWindow * | pager_window_new (struct IndexSharedData *shared, struct PagerPrivateData *priv) |
Create a new Pager Window (list of Emails) | |
int | mutt_display_message (struct MuttWindow *win_index, struct IndexSharedData *shared) |
Display a message in the pager. | |
int | external_pager (struct MailboxView *mv, struct Email *e, const char *command) |
Display a message in an external program. | |
void | pager_queue_redraw (struct PagerPrivateData *priv, PagerRedrawFlags redraw) |
Queue a request for a redraw. | |
bool | mutt_is_quote_line (char *buf, regmatch_t *pmatch) |
Is a line of message text a quote? | |
const char * | pager_get_pager (struct ConfigSubset *sub) |
Get the value of $pager. | |
void | mutt_clear_pager_position (void) |
void | dump_text_syntax (struct TextSyntax *ts, int num) |
void | dump_line (int i, struct Line *line) |
static void | dump_pager (struct PagerPrivateData *priv) |
Variables | |
int | BrailleRow |
Braille display: row to leave the cursor. | |
int | BrailleCol |
Braille display: column to leave the cursor. | |
GUI display a file/email/help in a viewport with paging.
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 lib.h.
#define MUTT_SHOWFLAT (1 << 0) |
#define MUTT_SHOWCOLOR (1 << 1) |
#define MUTT_SHOW (MUTT_SHOWCOLOR | MUTT_SHOWFLAT) |
#define MUTT_PAGER_NSKIP (1 << 5) |
#define MUTT_PAGER_MARKER (1 << 6) |
#define MUTT_PAGER_RETWINCH (1 << 7) |
#define MUTT_PAGER_NOWRAP (1 << 9) |
#define MUTT_PAGER_MESSAGE (MUTT_SHOWCOLOR | MUTT_PAGER_MARKER) |
#define MUTT_DISPLAYFLAGS (MUTT_SHOW | MUTT_PAGER_NSKIP | MUTT_PAGER_MARKER | MUTT_PAGER_LOGS) |
#define NT_PAGER_DELETE (1 << 0) |
typedef uint16_t PagerFlags |
Flags for dlg_pager(), e.g. MUTT_SHOWFLAT.
typedef uint8_t NotifyPager |
Flags, e.g. NT_PAGER_DELETE.
typedef uint8_t PagerRedrawFlags |
Flags, e.g. PAGER_REDRAW_PAGER.
enum PagerMode |
Determine the behaviour of the Pager.
Definition at line 134 of file lib.h.
enum PagerLoopMode |
What the Pager Event Loop should do next.
Enumerator | |
---|---|
PAGER_LOOP_CONTINUE | Stay in the Pager Event Loop. |
PAGER_LOOP_QUIT | Quit the Pager. |
PAGER_LOOP_RELOAD | Reload the Pager from scratch. |
Display some page-able text to the user (help or attachment)
0 | Success |
-1 | Error |
Definition at line 122 of file do_pager.c.
void buf_strip_formatting | ( | struct Buffer * | dest, |
const char * | src, | ||
bool | strip_markers | ||
) |
Removes ANSI and backspace formatting.
dest | Buffer for the result |
src | String to strip |
strip_markers | Remove |
Removes ANSI and backspace formatting, and optionally markers. This is separated out so that it can be used both by the pager and the autoview handler.
This logic is pulled from the pager fill_buffer() function, for use in stripping reply-quoted autoview output of ansi sequences.
Definition at line 721 of file display.c.
struct MuttWindow * ppanel_new | ( | bool | status_on_top, |
struct IndexSharedData * | shared | ||
) |
Create the Windows for the Pager panel.
status_on_top | true, if the Pager bar should be on top |
shared | Shared Index data |
ptr | New Pager Panel |
Definition at line 133 of file ppanel.c.
struct MuttWindow * pager_window_new | ( | struct IndexSharedData * | shared, |
struct PagerPrivateData * | priv | ||
) |
Create a new Pager Window (list of Emails)
shared | Shared Index Data |
priv | Private Pager Data |
ptr | New Window |
Definition at line 418 of file pager.c.
int mutt_display_message | ( | struct MuttWindow * | win_index, |
struct IndexSharedData * | shared | ||
) |
Display a message in the pager.
win_index | Index Window |
shared | Shared Index data |
0 | Success |
-1 | Error |
Definition at line 447 of file message.c.
int external_pager | ( | struct MailboxView * | mv, |
struct Email * | e, | ||
const char * | command | ||
) |
Display a message in an external program.
0 | Success |
-1 | Error |
Definition at line 300 of file message.c.
void pager_queue_redraw | ( | struct PagerPrivateData * | priv, |
PagerRedrawFlags | redraw | ||
) |
Queue a request for a redraw.
priv | Private Pager data |
redraw | Item to redraw, e.g. PAGER_REDRAW_PAGER |
Definition at line 127 of file dlg_pager.c.
bool mutt_is_quote_line | ( | char * | line, |
regmatch_t * | pmatch | ||
) |
Is a line of message text a quote?
true | Line is quoted |
Checks if line matches the $quote_regex
and doesn't match $smileys
. This is used by the pager for calling qstyle_classify.
Definition at line 323 of file display.c.
const char * pager_get_pager | ( | struct ConfigSubset * | sub | ) |
Get the value of $pager.
sub | Config Subset |
str | External command to use |
NULL | The internal pager will be used |
Definition at line 111 of file config.c.
void mutt_clear_pager_position | ( | void | ) |
void dump_text_syntax | ( | struct TextSyntax * | ts, |
int | num | ||
) |
Definition at line 37 of file pager.c.
void dump_line | ( | int | i, |
struct Line * | line | ||
) |
Definition at line 58 of file pager.c.
|
inlinestatic |
|
extern |
Braille display: row to leave the cursor.
Definition at line 67 of file dlg_pager.c.
|
extern |
Braille display: column to leave the cursor.
Definition at line 69 of file dlg_pager.c.