NeoMutt  2021-02-05-89-gabe350
Teaching an old dog new tricks
DOXYGEN
curs_lib.h
Go to the documentation of this file.
1 
23 #ifndef MUTT_CURS_LIB_H
24 #define MUTT_CURS_LIB_H
25 
26 #include <stddef.h>
27 #include <stdbool.h>
28 #include <wchar.h>
29 #include "config/lib.h"
30 #include "mutt.h"
31 #include "browser.h"
32 #include "keymap.h"
33 #include "pager/lib.h"
34 
35 struct Buffer;
36 struct Mailbox;
37 
38 /* These Config Variables are only used in curs_lib.c */
39 extern bool C_MetaKey;
40 
41 extern int MuttGetchTimeout;
42 
47 {
48  JUSTIFY_LEFT = -1,
51 };
52 
53 int mutt_addwch(wchar_t wc);
54 int mutt_any_key_to_continue(const char *s);
55 void mutt_beep(bool force);
56 int mutt_buffer_enter_fname(const char *prompt, struct Buffer *fname, bool mailbox, struct Mailbox *m, bool multiple, char ***files, int *numfiles, SelectFileFlags flags);
57 int mutt_buffer_get_field(const char *field, struct Buffer *buf, CompletionFlags complete, bool multiple, struct Mailbox *m, char ***files, int *numfiles);
58 int mutt_do_pager(const char *banner, const char *tempfile, PagerFlags do_color, struct Pager *info);
59 void mutt_edit_file(const char *editor, const char *file);
60 void mutt_endwin(void);
61 void mutt_flushinp(void);
64 void mutt_format_s(char *buf, size_t buflen, const char *prec, const char *s);
65 void mutt_format_s_tree(char *buf, size_t buflen, const char *prec, const char *s);
66 void mutt_format_s_x(char *buf, size_t buflen, const char *prec, const char *s, bool arboreal);
67 void mutt_getch_timeout(int delay);
68 struct KeyEvent mutt_getch(void);
69 int mutt_get_field(const char *field, char *buf, size_t buflen, CompletionFlags complete, bool multiple, char ***files, int *numfiles);
70 int mutt_get_field_unbuffered(const char *msg, char *buf, size_t buflen, CompletionFlags flags);
71 int mutt_multi_choice(const char *prompt, const char *letters);
72 void mutt_need_hard_redraw(void);
73 void mutt_paddstr(int n, const char *s);
74 void mutt_perror_debug(const char *s);
75 void mutt_push_macro_event(int ch, int op);
76 void mutt_query_exit(void);
77 void mutt_refresh(void);
78 void mutt_show_error(void);
79 void mutt_simple_format(char *buf, size_t buflen, int min_width, int max_width, enum FormatJustify justify, char pad_char, const char *s, size_t n, bool arboreal);
80 int mutt_strwidth(const char *s);
81 int mutt_strnwidth(const char *s, size_t len);
82 void mutt_unget_event(int ch, int op);
83 void mutt_unget_string(const char *s);
84 size_t mutt_wstr_trunc(const char *src, size_t maxlen, size_t maxwid, size_t *width);
85 enum QuadOption mutt_yesorno(const char *msg, enum QuadOption def);
86 enum QuadOption query_quadoption(enum QuadOption opt, const char *prompt);
87 
88 #endif /* MUTT_CURS_LIB_H */
mutt_strwidth
int mutt_strwidth(const char *s)
Measure a string's width in screen cells.
Definition: curs_lib.c:1363
MuttGetchTimeout
int MuttGetchTimeout
Timeout in ms for mutt_getch()
Definition: curs_lib.c:93
lib.h
mutt_simple_format
void mutt_simple_format(char *buf, size_t buflen, int min_width, int max_width, enum FormatJustify justify, char pad_char, const char *s, size_t n, bool arboreal)
Format a string, like snprintf()
Definition: curs_lib.c:1097
QuadOption
QuadOption
Possible values for a quad-option.
Definition: quad.h:36
mutt_format_s_tree
void mutt_format_s_tree(char *buf, size_t buflen, const char *prec, const char *s)
Format a simple string with tree characters.
Definition: curs_lib.c:1260
Mailbox
A mailbox.
Definition: mailbox.h:81
mutt_perror_debug
void mutt_perror_debug(const char *s)
Show the user an 'errno' message.
Definition: curs_lib.c:591
mutt_wstr_trunc
size_t mutt_wstr_trunc(const char *src, size_t maxlen, size_t maxwid, size_t *width)
Work out how to truncate a widechar string.
Definition: curs_lib.c:1313
Buffer
String manipulation buffer.
Definition: buffer.h:33
mutt_query_exit
void mutt_query_exit(void)
Ask the user if they want to leave NeoMutt.
Definition: curs_lib.c:540
mutt_need_hard_redraw
void mutt_need_hard_redraw(void)
Force a hard refresh.
Definition: curs_lib.c:130
mutt_buffer_get_field
int mutt_buffer_get_field(const char *field, struct Buffer *buf, CompletionFlags complete, bool multiple, struct Mailbox *m, char ***files, int *numfiles)
Ask the user for a string.
Definition: curs_lib.c:260
FormatJustify
FormatJustify
Alignment for mutt_simple_format()
Definition: curs_lib.h:46
mutt_paddstr
void mutt_paddstr(int n, const char *s)
Display a string on screen, padded if necessary.
Definition: curs_lib.c:1270
mutt_format_s
void mutt_format_s(char *buf, size_t buflen, const char *prec, const char *s)
Format a simple string.
Definition: curs_lib.c:1248
Mailbox::flags
uint8_t flags
e.g. MB_NORMAL
Definition: mailbox.h:134
mutt_get_field
int mutt_get_field(const char *field, char *buf, size_t buflen, CompletionFlags complete, bool multiple, char ***files, int *numfiles)
Ask the user for a string.
Definition: curs_lib.c:311
mutt_flush_unget_to_endcond
void mutt_flush_unget_to_endcond(void)
Clear entries from UngetKeyEvents.
Definition: curs_lib.c:911
mutt_beep
void mutt_beep(bool force)
Irritate the user.
Definition: curs_lib.c:99
mutt_flush_macro_to_endcond
void mutt_flush_macro_to_endcond(void)
Drop a macro from the input buffer.
Definition: curs_lib.c:894
mutt_yesorno
enum QuadOption mutt_yesorno(const char *msg, enum QuadOption def)
Ask the user a Yes/No question.
Definition: curs_lib.c:380
mutt_getch_timeout
void mutt_getch_timeout(int delay)
Set the getch() timeout.
Definition: curs_lib.c:146
lib.h
C_MetaKey
bool C_MetaKey
interpret ALT-x as ESC-x
Definition: curs_lib.c:72
JUSTIFY_LEFT
@ JUSTIFY_LEFT
Left justify the text.
Definition: curs_lib.h:48
JUSTIFY_RIGHT
@ JUSTIFY_RIGHT
Right justify the text.
Definition: curs_lib.h:50
keymap.h
mutt_format_s_x
void mutt_format_s_x(char *buf, size_t buflen, const char *prec, const char *s, bool arboreal)
Format a string like snprintf()
Definition: curs_lib.c:1211
mutt_unget_event
void mutt_unget_event(int ch, int op)
Return a keystroke to the input buffer.
Definition: curs_lib.c:838
mutt_addwch
int mutt_addwch(wchar_t wc)
addwch would be provided by an up-to-date curses library
Definition: curs_lib.c:1063
KeyEvent::op
int op
function op
Definition: keymap.h:66
KeyEvent
An event such as a keypress.
Definition: keymap.h:63
mutt_refresh
void mutt_refresh(void)
Force a refresh of the screen.
Definition: curs_lib.c:108
mutt_multi_choice
int mutt_multi_choice(const char *prompt, const char *letters)
Offer the user a multiple choice question.
Definition: curs_lib.c:937
mutt_endwin
void mutt_endwin(void)
Shutdown curses/slang.
Definition: curs_lib.c:572
mutt_buffer_enter_fname
int mutt_buffer_enter_fname(const char *prompt, struct Buffer *fname, bool mailbox, struct Mailbox *m, bool multiple, char ***files, int *numfiles, SelectFileFlags flags)
Ask the user to select a file.
Definition: curs_lib.c:772
mutt_any_key_to_continue
int mutt_any_key_to_continue(const char *s)
Prompt the user to 'press any key' and wait.
Definition: curs_lib.c:605
query_quadoption
enum QuadOption query_quadoption(enum QuadOption opt, const char *prompt)
Ask the user a quad-question.
Definition: curs_lib.c:518
JUSTIFY_CENTER
@ JUSTIFY_CENTER
Centre the text.
Definition: curs_lib.h:49
mutt_show_error
void mutt_show_error(void)
Show the user an error message.
Definition: curs_lib.c:558
mutt.h
mutt_strnwidth
int mutt_strnwidth(const char *s, size_t len)
Measure a string's width in screen cells.
Definition: curs_lib.c:1376
mutt_get_field_unbuffered
int mutt_get_field_unbuffered(const char *msg, char *buf, size_t buflen, CompletionFlags flags)
Ask the user for a string (ignoring macro buffer)
Definition: curs_lib.c:335
browser.h
mutt_edit_file
void mutt_edit_file(const char *editor, const char *file)
Let the user edit a file.
Definition: curs_lib.c:356
SelectFileFlags
uint8_t SelectFileFlags
Flags for mutt_select_file(), e.g. MUTT_SEL_MAILBOX.
Definition: browser.h:40
mutt_push_macro_event
void mutt_push_macro_event(int ch, int op)
Add the character/operation to the macro buffer.
Definition: curs_lib.c:875
mutt_do_pager
int mutt_do_pager(const char *banner, const char *tempfile, PagerFlags do_color, struct Pager *info)
Display some page-able text to the user.
Definition: curs_lib.c:691
Pager
An email being displayed.
Definition: lib.h:64
mutt_flushinp
void mutt_flushinp(void)
Empty all the keyboard buffers.
Definition: curs_lib.c:923
mutt_unget_string
void mutt_unget_string(const char *s)
Return a string to the input buffer.
Definition: curs_lib.c:857
KeyEvent::ch
int ch
raw key pressed
Definition: keymap.h:65
CompletionFlags
uint16_t CompletionFlags
Flags for mutt_enter_string_full(), e.g. MUTT_ALIAS.
Definition: mutt.h:55
mutt_getch
struct KeyEvent mutt_getch(void)
Read a character from the input buffer.
Definition: curs_lib.c:189
PagerFlags
uint16_t PagerFlags
Flags for mutt_pager(), e.g. MUTT_SHOWFLAT.
Definition: lib.h:41