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 <stdlib.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"
Include dependency graph for curs_lib.c: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 -. | |
| char * | mutt_str_expand_tabs (char *str, size_t *len, int tabwidth) |
| Convert tabs to spaces in a 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.c.
| void mutt_beep | ( | bool | force | ) |
Irritate the user.
| force | If true, ignore the "$beep" config variable |
Definition at line 69 of file curs_lib.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void mutt_refresh | ( | void | ) |
Force a refresh of the screen.
Definition at line 79 of file curs_lib.c.
Here is the caller graph for this function:| 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 101 of file curs_lib.c.
Here is the call graph for this function:
Here is the caller graph for this function:| 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 117 of file curs_lib.c.
Here is the call graph for this function:
Here is the caller graph for this function:| 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 138 of file curs_lib.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void mutt_endwin | ( | void | ) |
Shutdown curses.
Definition at line 152 of file curs_lib.c.
Here is the call graph for this function:
Here is the caller graph for this function:| 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 174 of file curs_lib.c.
Here is the call graph for this function:
Here is the caller graph for this function:| 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 320 of file curs_lib.c.
Here is the call graph for this function:
Here is the caller graph for this function:| 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 343 of file curs_lib.c.
Here is the call graph for this function:
Here is the caller graph for this function:| 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 385 of file curs_lib.c.
Here is the call graph for this function:
Here is the caller graph for this function:| 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 445 of file curs_lib.c.
Here is the call graph for this function:
Here is the caller graph for this function:| 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 458 of file curs_lib.c.
Here is the caller graph for this function:| char * mutt_str_expand_tabs | ( | char * | str, |
| size_t * | len, | ||
| int | tabwidth | ||
| ) |
Convert tabs to spaces in a string.
| str | Input string |
| len | Length of the string |
| tabwidth | The number of spaces per indentation-level |
Replace tab characters (\t) with spaces in the string. The string will be resized to fit the expanded version if necessary.
Definition at line 592 of file curs_lib.c.
Here is the call graph for this function:
Here is the caller graph for this function: