GUI miscellaneous curses (window drawing) routines. More...
Go to the source code of this file.
Data Structures | |
struct | FileCompletionData |
Input for the file completion function. More... | |
Functions | |
int | mutt_addwch (struct MuttWindow *win, wchar_t wc) |
Addwch would be provided by an up-to-date curses library. | |
int | mutt_any_key_to_continue (const char *s) |
Prompt the user to 'press any key' and wait. | |
void | mutt_beep (bool force) |
Irritate the user. | |
int | mw_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 -. | |
void | mutt_edit_file (const char *editor, const char *file) |
Let the user edit a file. | |
void | mutt_endwin (void) |
Shutdown curses. | |
void | mutt_flushinp (void) |
Empty all the keyboard buffers. | |
struct KeyEvent | mutt_getch (GetChFlags flags) |
Read a character from the input buffer. | |
void | mutt_need_hard_redraw (void) |
Force a hard refresh. | |
void | mutt_paddstr (struct MuttWindow *win, int n, const char *s) |
Display a string on screen, padded if necessary. | |
void | mutt_push_macro_event (int ch, int op) |
Add the character/operation to the macro buffer. | |
void | mutt_query_exit (void) |
Ask the user if they want to leave NeoMutt. | |
void | mutt_refresh (void) |
Force a refresh of the screen. | |
size_t | mutt_strwidth (const char *s) |
Measure a string's width in screen cells. | |
size_t | mutt_strnwidth (const char *s, size_t len) |
Measure a string's width in screen cells. | |
void | mutt_unget_ch (int ch) |
Return a keystroke to the input buffer. | |
void | mutt_unget_op (int op) |
Return an operation to the input buffer. | |
void | mutt_unget_string (const char *s) |
Return a string to the input buffer. | |
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. | |
GUI miscellaneous curses (window drawing) routines.
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 curs_lib.h.
int mutt_addwch | ( | struct MuttWindow * | win, |
wchar_t | wc | ||
) |
Addwch would be provided by an up-to-date curses library.
win | Window |
wc | Wide char to display |
0 | Success |
-1 | Error |
Definition at line 318 of file curs_lib.c.
int mutt_any_key_to_continue | ( | const char * | s | ) |
Prompt the user to 'press any key' and wait.
s | Message prompt |
num | Key pressed |
EOF | Error, or prompt aborted |
Definition at line 173 of file curs_lib.c.
void mutt_beep | ( | bool | force | ) |
Irritate the user.
force | If true, ignore the "$beep" config variable |
Definition at line 68 of file curs_lib.c.
void mutt_edit_file | ( | const char * | editor, |
const char * | file | ||
) |
Let the user edit a file.
editor | User's editor config |
file | File to edit |
Definition at line 116 of file curs_lib.c.
void mutt_endwin | ( | void | ) |
Shutdown curses.
Definition at line 151 of file curs_lib.c.
void mutt_flushinp | ( | void | ) |
Empty all the keyboard buffers.
Definition at line 58 of file get.c.
struct KeyEvent mutt_getch | ( | GetChFlags | flags | ) |
Read a character from the input buffer.
flags | Flags, e.g. GETCH_IGNORE_MACRO |
obj | KeyEvent to process |
The priority for reading events is:
This function can return:
{ 0, OP_ABORT }
{ 0, OP_REPAINT }
{ 0, OP_TIMEOUT }
Definition at line 210 of file get.c.
void mutt_need_hard_redraw | ( | void | ) |
Force a hard refresh.
Make sure that the next refresh does a full refresh. This could be optimized by not doing it at all if DISPLAY is set as this might indicate that a GUI based pinentry was used. Having an option to customize this is of course the NeoMutt way.
Definition at line 100 of file curs_lib.c.
void mutt_paddstr | ( | struct MuttWindow * | win, |
int | n, | ||
const char * | s | ||
) |
Display a string on screen, padded if necessary.
win | Window |
n | Final width of field |
s | String to display |
Definition at line 341 of file curs_lib.c.
void mutt_push_macro_event | ( | int | ch, |
int | op | ||
) |
Add the character/operation to the macro buffer.
ch | Character to add |
op | Operation to add |
Adds the ch/op to the macro buffer. This should be used for macros, push, and exec commands only.
Definition at line 155 of file get.c.
void mutt_query_exit | ( | void | ) |
Ask the user if they want to leave NeoMutt.
This function is called when the user presses the abort key.
Definition at line 137 of file curs_lib.c.
void mutt_refresh | ( | void | ) |
Force a refresh of the screen.
Definition at line 78 of file curs_lib.c.
size_t mutt_strwidth | ( | const char * | s | ) |
Measure a string's width in screen cells.
s | String to be measured |
num | Screen cells string would use |
Definition at line 443 of file curs_lib.c.
size_t mutt_strnwidth | ( | const char * | s, |
size_t | n | ||
) |
Measure a string's width in screen cells.
s | String to be measured |
n | Length of string to be measured |
num | Screen cells string would use |
Definition at line 456 of file curs_lib.c.
void mutt_unget_ch | ( | int | ch | ) |
void mutt_unget_op | ( | int | op | ) |
void mutt_unget_string | ( | const char * | s | ) |
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.
[in] | src | String to measure |
[in] | maxlen | Maximum length of string in bytes |
[in] | maxwid | Maximum width in screen columns |
[out] | width | Save the truncated screen column width |
num | Bytes to use |
See how many bytes to copy from string so it's at most maxlen bytes long and maxwid columns wide
Definition at line 383 of file curs_lib.c.