NeoMutt  2022-04-29-215-gc12b98
Teaching an old dog new tricks
DOXYGEN
curs_lib.h
Go to the documentation of this file.
1
23#ifndef MUTT_GUI_CURS_LIB_H
24#define MUTT_GUI_CURS_LIB_H
25
26#include <stdbool.h>
27#include <wchar.h> // IWYU pragma: keep
28#include "browser/lib.h"
29#include "keymap.h"
30
31struct Buffer;
32struct Mailbox;
33struct MuttWindow;
34
35extern int MuttGetchTimeout;
36
41{
45};
46
47int mutt_addwch(struct MuttWindow *win, wchar_t wc);
48int mutt_any_key_to_continue(const char *s);
49void mutt_beep(bool force);
50int mutt_buffer_enter_fname(const char *prompt, struct Buffer *fname, bool mailbox, struct Mailbox *m, bool multiple, char ***files, int *numfiles, SelectFileFlags flags);
51void mutt_edit_file(const char *editor, const char *file);
52void mutt_endwin(void);
53void mutt_flushinp(void);
56void mutt_format_s(char *buf, size_t buflen, const char *prec, const char *s);
57void mutt_format_s_tree(char *buf, size_t buflen, const char *prec, const char *s);
58void mutt_format_s_x(char *buf, size_t buflen, const char *prec, const char *s, bool arboreal);
59struct KeyEvent mutt_getch_timeout(int delay);
60struct KeyEvent mutt_getch(void);
61void mutt_need_hard_redraw(void);
62void mutt_paddstr(struct MuttWindow *win, int n, const char *s);
63void mutt_perror_debug(const char *s);
64void mutt_push_macro_event(int ch, int op);
65void mutt_query_exit(void);
66void mutt_refresh(void);
67void 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);
68size_t mutt_strwidth(const char *s);
69size_t mutt_strnwidth(const char *s, size_t len);
70void mutt_unget_ch(int ch);
71void mutt_unget_op(int op);
72void mutt_unget_string(const char *s);
73size_t mutt_wstr_trunc(const char *src, size_t maxlen, size_t maxwid, size_t *width);
74
75#endif /* MUTT_GUI_CURS_LIB_H */
Select a Mailbox from a list.
uint8_t SelectFileFlags
Flags for mutt_select_file(), e.g. MUTT_SEL_MAILBOX.
Definition: lib.h:54
void mutt_edit_file(const char *editor, const char *file)
Let the user edit a file.
Definition: curs_lib.c:312
struct KeyEvent mutt_getch_timeout(int delay)
Get an event with a timeout.
Definition: curs_lib.c:197
void mutt_flushinp(void)
Empty all the keyboard buffers.
Definition: curs_lib.c:592
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:858
size_t mutt_strnwidth(const char *s, size_t len)
Measure a string's width in screen cells.
Definition: curs_lib.c:920
struct KeyEvent mutt_getch(void)
Read a character from the input buffer.
Definition: curs_lib.c:242
void mutt_unget_string(const char *s)
Return a string to the input buffer.
Definition: curs_lib.c:543
void mutt_push_macro_event(int ch, int op)
Add the character/operation to the macro buffer.
Definition: curs_lib.c:561
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:445
void mutt_paddstr(struct MuttWindow *win, int n, const char *s)
Display a string on screen, padded if necessary.
Definition: curs_lib.c:816
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:756
void mutt_unget_op(int op)
Return an operation to the input buffer.
Definition: curs_lib.c:532
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:805
void mutt_refresh(void)
Force a refresh of the screen.
Definition: curs_lib.c:140
void mutt_flush_unget_to_endcond(void)
Clear entries from UngetKeyEvents.
Definition: curs_lib.c:584
int mutt_addwch(struct MuttWindow *win, wchar_t wc)
Addwch would be provided by an up-to-date curses library.
Definition: curs_lib.c:606
void mutt_flush_macro_to_endcond(void)
Drop a macro from the input buffer.
Definition: curs_lib.c:572
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:639
int mutt_any_key_to_continue(const char *s)
Prompt the user to 'press any key' and wait.
Definition: curs_lib.c:387
void mutt_need_hard_redraw(void)
Force a hard refresh.
Definition: curs_lib.c:162
void mutt_query_exit(void)
Ask the user if they want to leave NeoMutt.
Definition: curs_lib.c:335
FormatJustify
Alignment for mutt_simple_format()
Definition: curs_lib.h:41
@ JUSTIFY_RIGHT
Right justify the text.
Definition: curs_lib.h:44
@ JUSTIFY_LEFT
Left justify the text.
Definition: curs_lib.h:42
@ JUSTIFY_CENTER
Centre the text.
Definition: curs_lib.h:43
void mutt_endwin(void)
Shutdown curses.
Definition: curs_lib.c:354
void mutt_beep(bool force)
Irritate the user.
Definition: curs_lib.c:130
size_t mutt_strwidth(const char *s)
Measure a string's width in screen cells.
Definition: curs_lib.c:907
void mutt_unget_ch(int ch)
Return a keystroke to the input buffer.
Definition: curs_lib.c:521
void mutt_perror_debug(const char *s)
Show the user an 'errno' message.
Definition: curs_lib.c:373
void mutt_format_s(char *buf, size_t buflen, const char *prec, const char *s)
Format a simple string.
Definition: curs_lib.c:793
int MuttGetchTimeout
Timeout in ms for mutt_getch()
Definition: curs_lib.c:124
Manage keymappings.
String manipulation buffer.
Definition: buffer.h:34
An event such as a keypress.
Definition: keymap.h:65
int op
Function opcode, e.g. OP_HELP.
Definition: keymap.h:67
int ch
Raw key pressed.
Definition: keymap.h:66
A mailbox.
Definition: mailbox.h:79