GUI miscellaneous curses (window drawing) routines. More...
#include "config.h"
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <termios.h>
#include <unistd.h>
#include <wchar.h>
#include "mutt/lib.h"
#include "config/lib.h"
#include "core/lib.h"
#include "mutt.h"
#include "curs_lib.h"
#include "browser/lib.h"
#include "color/lib.h"
#include "editor/lib.h"
#include "history/lib.h"
#include "key/lib.h"
#include "question/lib.h"
#include "globals.h"
#include "msgcont.h"
#include "msgwin.h"
#include "mutt_curses.h"
#include "mutt_logging.h"
#include "mutt_thread.h"
#include "mutt_window.h"
#include "opcodes.h"
#include "protos.h"
Go to the source code of this file.
Functions | |
void | mutt_beep (bool force) |
Irritate the user. | |
void | mutt_refresh (void) |
Force a refresh of the screen. | |
void | mutt_need_hard_redraw (void) |
Force a hard refresh. | |
void | mutt_edit_file (const char *editor, const char *file) |
Let the user edit a file. | |
void | mutt_query_exit (void) |
Ask the user if they want to leave NeoMutt. | |
void | mutt_endwin (void) |
Shutdown curses. | |
int | mutt_any_key_to_continue (const char *s) |
Prompt the user to 'press any key' and wait. | |
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 -. | |
int | mutt_addwch (struct MuttWindow *win, wchar_t wc) |
Addwch would be provided by an up-to-date curses library. | |
void | mutt_paddstr (struct MuttWindow *win, int n, const char *s) |
Display a string on screen, padded if necessary. | |
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. | |
size_t | mutt_strwidth (const char *s) |
Measure a string's width in screen cells. | |
size_t | mutt_strnwidth (const char *s, size_t n) |
Measure a string's width in screen cells. | |
void | mw_what_key (void) |
Display the value of a key -. | |
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.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_refresh | ( | void | ) |
Force a refresh of the screen.
Definition at line 78 of file curs_lib.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_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_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_endwin | ( | void | ) |
Shutdown curses.
Definition at line 151 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.
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.
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.
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.
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.