51 {
N_(
"Help"), OP_HELP },
52 {
N_(
"Complete"), OP_EDITOR_COMPLETE },
53 {
N_(
"Hist Up"), OP_EDITOR_HISTORY_UP },
54 {
N_(
"Hist Down"), OP_EDITOR_HISTORY_DOWN },
55 {
N_(
"Hist Search"), OP_EDITOR_HISTORY_SEARCH },
56 {
N_(
"Begin Line"), OP_EDITOR_BOL },
57 {
N_(
"End Line"), OP_EDITOR_EOL },
58 {
N_(
"Kill Line"), OP_EDITOR_KILL_LINE },
59 {
N_(
"Kill Word"), OP_EDITOR_KILL_WORD },
104 size_t k = mbrtowc(&wc, &c, 1, wdata->
mbstate);
109 else if ((k != 0) && (k != 1))
118 wdata->
first =
false;
126 if ((wc ==
'\r') || (wc ==
'\n'))
138 char **tfiles = NULL;
143 *cdata->
files = tfiles;
148 else if (wc && ((wc <
' ') ||
IsWPrint(wc)))
198 int prompt_length = 0;
201 int width = win->
state.
cols - prompt_length - 1;
294 mbstate_t mbstate = { 0 };
296 struct EnterWindowData wdata = { buf, complete, es,
hclass,
comp_api,
cdata,
prompt,
ENTER_REDRAW_NONE, (complete &
MUTT_COMP_PASS),
true, NULL, 0, &
mbstate, 0,
false, NULL, 0, 0 };
308 if (es->
wbuf[0] == L
'\0')
344 if (event.
op == OP_NULL)
366 if ((event.
op != OP_EDITOR_COMPLETE) && (event.
op != OP_EDITOR_COMPLETE_QUERY))
394 }
while (!wdata.
done);
void buf_reset(struct Buffer *buf)
Reset an existing Buffer.
void buf_fix_dptr(struct Buffer *buf)
Move the dptr to end of the Buffer.
char * buf_strdup(const struct Buffer *buf)
Copy a Buffer's string.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Color and attribute parsing.
@ MT_COLOR_NORMAL
Plain text.
@ MT_COLOR_PROMPT
Question/user input.
Convenience wrapper for the core headers.
int mutt_addwch(struct MuttWindow *win, wchar_t wc)
Addwch would be provided by an up-to-date curses library.
void mutt_beep(bool force)
Irritate the user.
void mutt_flushinp(void)
Empty all the keyboard buffers.
void completion_data_free(struct CompletionData **ptr)
Free the Completion Data.
@ FR_SUCCESS
Valid function - successfully performed.
@ FR_UNKNOWN
Unknown function.
@ FR_ERROR
Valid function - error occurred.
@ FR_CONTINUE
Remain in the Dialog.
@ FR_NO_ACTION
Valid function - no action performed.
struct EnterState * enter_state_new(void)
Create a new EnterState.
void enter_state_free(struct EnterState **ptr)
Free an EnterState.
@ ENTER_REDRAW_NONE
Nothing to redraw.
@ ENTER_REDRAW_LINE
Redraw entire line.
@ ENTER_REDRAW_INIT
Go to end of line and redraw.
static const struct Mapping EditorHelp[]
Help Bar for the Command Line Editor.
static int my_addwch(struct MuttWindow *win, wchar_t wc)
Display one wide character on screen.
bool self_insert(struct EnterWindowData *wdata, int ch)
Insert a normal character.
struct KeyEvent km_dokey_event(enum MenuType mtype, GetChFlags flags)
Determine what a keypress should do.
int enter_function_dispatcher(struct MuttWindow *win, int op)
Perform an Enter function - Implements function_dispatcher_t -.
int mw_get_field(const char *prompt, struct Buffer *buf, CompletionFlags complete, enum HistoryClass hclass, const struct CompleteOps *comp_api, void *cdata)
Ask the user for a string -.
#define mutt_debug(LEVEL,...)
static int enter_recalc(struct MuttWindow *win)
Recalculate the Window data - Implements MuttWindow::recalc() -.
static bool enter_recursor(struct MuttWindow *win)
Recursor the Window - Implements MuttWindow::recursor() -.
static int enter_repaint(struct MuttWindow *win)
Repaint the Window - Implements MuttWindow::repaint() -.
Convenience wrapper for the gui headers.
Read/write command history from/to a file.
HistoryClass
Type to differentiate different histories.
void mutt_hist_add(enum HistoryClass hclass, const char *str, bool save)
Add a string to a history.
void mutt_hist_reset_state(enum HistoryClass hclass)
Move the 'current' position to the end of the History.
uint8_t GetChFlags
Flags for mutt_getch(), e.g. GETCH_NO_FLAGS.
#define GETCH_IGNORE_MACRO
Don't use MacroEvents.
#define GETCH_NO_FLAGS
No flags are set.
@ LL_DEBUG5
Log at debug level 5.
@ LL_DEBUG1
Log at debug level 1.
size_t mutt_mb_width_ceiling(const wchar_t *s, size_t n, int w1)
Keep the end of the string on-screen.
size_t mutt_mb_mbstowcs(wchar_t **pwbuf, size_t *pwbuflen, size_t i, const char *buf)
Convert a string from multibyte to wide characters.
int mutt_mb_wcswidth(const wchar_t *s, size_t n)
Measure the screen width of a string.
void buf_mb_wcstombs(struct Buffer *dest, const wchar_t *wstr, size_t wlen)
Convert a string from wide to multibyte characters.
int mutt_mb_wcwidth(wchar_t wc)
Measure the screen width of a character.
#define MUTT_MEM_CALLOC(n, type)
#define MUTT_MEM_REALLOC(pptr, n, type)
void msgcont_push_window(struct MuttWindow *win)
Add a window to the Container Stack.
struct MuttWindow * msgcont_pop_window(void)
Remove the last Window from the Container Stack.
#define ICONV_BUF_TOO_SMALL
Error value for iconv() - Buffer too small.
Convenience wrapper for the library headers.
Keep track when processing files.
Many unsorted constants and some structs.
uint8_t CompletionFlags
Flags for mw_get_field(), e.g. MUTT_COMP_NO_FLAGS.
#define MUTT_COMP_PASS
Password mode (no echo)
#define MUTT_COMP_UNBUFFERED
Ignore macro buffer.
#define MUTT_COMP_CLEAR
Clear input if printable character is pressed.
const struct AttrColor * mutt_curses_set_normal_backed_color_by_id(enum ColorId cid)
Set the colour and attributes by the colour id.
enum MuttCursorState mutt_curses_set_cursor(enum MuttCursorState state)
Set the cursor state.
const struct AttrColor * mutt_curses_set_color_by_id(enum ColorId cid)
Set the colour and attributes by the colour id.
@ MUTT_CURSOR_VISIBLE
Display a normal cursor.
bool mutt_window_is_visible(struct MuttWindow *win)
Is the Window visible?
void window_redraw(struct MuttWindow *win)
Reflow, recalc and repaint a tree of Windows.
void mutt_window_free(struct MuttWindow **ptr)
Free a Window and its children.
int mutt_window_printf(struct MuttWindow *win, const char *fmt,...)
Write a formatted string to a Window.
struct MuttWindow * mutt_window_new(enum WindowType type, enum MuttWindowOrientation orient, enum MuttWindowSize size, int cols, int rows)
Create a new Window.
int mutt_window_move(struct MuttWindow *win, int col, int row)
Move the cursor in a Window.
struct MuttWindow * window_set_focus(struct MuttWindow *win)
Set the Window focus.
void mutt_window_get_coords(struct MuttWindow *win, int *col, int *row)
Get the cursor position in the Window.
void mutt_window_clearline(struct MuttWindow *win, int row)
Clear a row of a Window.
int mutt_window_addstr(struct MuttWindow *win, const char *str)
Write a string to a Window.
void mutt_window_clrtoeol(struct MuttWindow *win)
Clear to the end of the line.
#define WA_RECALC
Recalculate the contents of the Window.
@ WT_CUSTOM
Window with a custom drawing function.
@ MUTT_WIN_ORIENT_VERTICAL
Window uses all available vertical space.
#define WA_REPAINT
Redraw the contents of the Window.
#define MUTT_WIN_SIZE_UNLIMITED
Use as much space as possible.
@ MUTT_WIN_SIZE_FIXED
Window has a fixed size.
void buf_expand_path_regex(struct Buffer *buf, bool regex)
Create the canonical path (with regex char escaping)
Some miscellaneous functions.
const char * opcodes_get_name(int op)
Get the name of an opcode.
#define OP_TIMEOUT
1 second with no events
#define OP_REPAINT
Repaint is needed.
#define OP_ABORT
$abort_key pressed (Ctrl-G)
Progress Bar Window Data.
String manipulation buffer.
Keep our place when entering a string.
size_t curpos
Position of the cursor.
size_t wbuflen
Length of buffer.
size_t begin
Position of the start.
wchar_t * wbuf
Buffer for the string being entered.
size_t lastchar
Position of the last character.
Data to fill the Enter Window.
bool pass
Password mode, conceal characters.
int tabs
Number of times the user has hit tab.
void * cdata
Auto-Completion private data.
CompletionFlags flags
Flags, see CompletionFlags.
struct CompletionData * cd
Auto-completion state data.
struct Buffer * buffer
struct Buffer for the result
bool done
Is text-entry done?
bool first
First time through, no input yet.
wchar_t * tempbuf
Buffer used by completion.
const struct CompleteOps * comp_api
Auto-Completion API.
const char * prompt
Prompt.
struct EnterState * state
Current state of text entry.
enum EnterRedrawFlags redraw
What needs redrawing? See EnterRedrawFlags.
mbstate_t * mbstate
Multi-byte state.
enum HistoryClass hclass
History to use, e.g. HC_NEO_COMMAND.
Input for the file completion function.
char *** files
List of files selected.
bool multiple
Allow multiple selections.
int * numfiles
Number of files selected.
An event such as a keypress.
int op
Function opcode, e.g. OP_HELP.
Mapping between user-readable string and a constant.
const struct Mapping * help_data
Data for the Help Bar.
int(* repaint)(struct MuttWindow *win)
struct WindowState state
Current state of the Window.
void * wdata
Private data.
int(* recalc)(struct MuttWindow *win)
void(* wdata_free)(struct MuttWindow *win, void **ptr)
int help_menu
Menu for key bindings, e.g. MENU_PAGER.
WindowActionFlags actions
Actions to be performed, e.g. WA_RECALC.
bool(* recursor)(struct MuttWindow *win)
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
@ MENU_EDITOR
Text entry area.