NeoMutt  2021-02-05-666-ge300cd
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 <stdbool.h>
27 #include <wchar.h> // IWYU pragma: keep
28 #include "mutt.h"
29 #include "browser.h"
30 #include "keymap.h"
31 
32 struct Buffer;
33 struct Mailbox;
34 struct MuttWindow;
35 
36 extern int MuttGetchTimeout;
37 
42 {
43  JUSTIFY_LEFT = -1,
46 };
47 
48 int mutt_addwch(struct MuttWindow *win, wchar_t wc);
49 int mutt_any_key_to_continue(const char *s);
50 void mutt_beep(bool force);
51 int mutt_buffer_enter_fname(const char *prompt, struct Buffer *fname, bool mailbox, struct Mailbox *m, bool multiple, char ***files, int *numfiles, SelectFileFlags flags);
52 int mutt_buffer_get_field(const char *field, struct Buffer *buf, CompletionFlags complete, bool multiple, struct Mailbox *m, char ***files, int *numfiles);
53 void mutt_edit_file(const char *editor, const char *file);
54 void mutt_endwin(void);
55 void mutt_flushinp(void);
58 void mutt_format_s(char *buf, size_t buflen, const char *prec, const char *s);
59 void mutt_format_s_tree(char *buf, size_t buflen, const char *prec, const char *s);
60 void mutt_format_s_x(char *buf, size_t buflen, const char *prec, const char *s, bool arboreal);
61 void mutt_getch_timeout(int delay);
62 struct KeyEvent mutt_getch(void);
63 int mutt_get_field(const char *field, char *buf, size_t buflen, CompletionFlags complete, bool multiple, char ***files, int *numfiles);
64 int mutt_get_field_unbuffered(const char *msg, char *buf, size_t buflen, CompletionFlags flags);
65 void mutt_need_hard_redraw(void);
66 void mutt_paddstr(struct MuttWindow *win, int n, const char *s);
67 void mutt_perror_debug(const char *s);
68 void mutt_push_macro_event(int ch, int op);
69 void mutt_query_exit(void);
70 void mutt_refresh(void);
71 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);
72 int mutt_strwidth(const char *s);
73 int mutt_strnwidth(const char *s, size_t len);
74 void mutt_unget_event(int ch, int op);
75 void mutt_unget_string(const char *s);
76 size_t mutt_wstr_trunc(const char *src, size_t maxlen, size_t maxwid, size_t *width);
77 
78 #endif /* MUTT_CURS_LIB_H */
void mutt_paddstr(struct MuttWindow *win, int n, const char *s)
Display a string on screen, padded if necessary.
Definition: curs_lib.c:890
Manage keymappings.
void mutt_unget_string(const char *s)
Return a string to the input buffer.
Definition: curs_lib.c:602
Left justify the text.
Definition: curs_lib.h:43
struct KeyEvent mutt_getch(void)
Read a character from the input buffer.
Definition: curs_lib.c:196
FormatJustify
Alignment for mutt_simple_format()
Definition: curs_lib.h:41
int MuttGetchTimeout
Timeout in ms for mutt_getch()
Definition: curs_lib.c:84
uint16_t CompletionFlags
Flags for mutt_enter_string_full(), e.g. MUTT_ALIAS.
Definition: mutt.h:51
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:716
int mutt_strnwidth(const char *s, size_t len)
Measure a string&#39;s width in screen cells.
Definition: curs_lib.c:996
void mutt_query_exit(void)
Ask the user if they want to leave NeoMutt.
Definition: curs_lib.c:403
void mutt_format_s(char *buf, size_t buflen, const char *prec, const char *s)
Format a simple string.
Definition: curs_lib.c:867
Right justify the text.
Definition: curs_lib.h:45
String manipulation buffer.
Definition: buffer.h:33
int op
function op
Definition: keymap.h:67
int ch
raw key pressed
Definition: keymap.h:66
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:268
void mutt_perror_debug(const char *s)
Show the user an &#39;errno&#39; message.
Definition: curs_lib.c:441
GUI component for displaying/selecting items from a list.
Many unsorted constants and some structs.
Centre the text.
Definition: curs_lib.h:44
void mutt_beep(bool force)
Irritate the user.
Definition: curs_lib.c:105
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:933
A mailbox.
Definition: mailbox.h:81
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:830
void mutt_unget_event(int ch, int op)
Return a keystroke to the input buffer.
Definition: curs_lib.c:583
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:359
An event such as a keypress.
Definition: keymap.h:64
void mutt_endwin(void)
Shutdown curses/slang.
Definition: curs_lib.c:422
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:335
void mutt_refresh(void)
Force a refresh of the screen.
Definition: curs_lib.c:115
void mutt_flush_unget_to_endcond(void)
Clear entries from UngetKeyEvents.
Definition: curs_lib.c:656
int mutt_any_key_to_continue(const char *s)
Prompt the user to &#39;press any key&#39; and wait.
Definition: curs_lib.c:455
int mutt_strwidth(const char *s)
Measure a string&#39;s width in screen cells.
Definition: curs_lib.c:983
int mutt_addwch(struct MuttWindow *win, wchar_t wc)
addwch would be provided by an up-to-date curses library
Definition: curs_lib.c:682
void mutt_edit_file(const char *editor, const char *file)
Let the user edit a file.
Definition: curs_lib.c:380
void mutt_flush_macro_to_endcond(void)
Drop a macro from the input buffer.
Definition: curs_lib.c:639
void mutt_getch_timeout(int delay)
Set the getch() timeout.
Definition: curs_lib.c:153
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:879
void mutt_need_hard_redraw(void)
Force a hard refresh.
Definition: curs_lib.c:137
void mutt_push_macro_event(int ch, int op)
Add the character/operation to the macro buffer.
Definition: curs_lib.c:620
void mutt_flushinp(void)
Empty all the keyboard buffers.
Definition: curs_lib.c:668
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:513
uint8_t SelectFileFlags
Flags for mutt_select_file(), e.g. MUTT_SEL_MAILBOX.
Definition: browser.h:33