50 static const struct Mapping EditorHelp[] = {
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 },
78 for (; win; win = win->
parent)
102 if (was_visible != is_visible)
209 #ifdef USE_SLANG_CURSES 217 static int vw_printw(SLcurses_Window_Type *
win,
const char *fmt, va_list ap)
221 (void) SLvsnprintf(buf,
sizeof(buf), (
char *) fmt, ap);
222 SLcurses_waddnstr(
win, buf, -1);
255 getyx(stdscr, row, col);
308 AllDialogsWindow = NULL;
309 MessageWindow = NULL;
398 #ifdef USE_SLANG_CURSES 423 rc = vw_printw(stdscr, fmt, ap);
448 #ifdef USE_DEBUG_WINDOW 480 return (width > -wrap) ? (width + wrap) : width;
482 return (wrap < width) ? wrap : width;
509 #ifdef USE_SLANG_CURSES 510 return addnstr((
char *) str, num);
512 return addnstr(str, num);
527 #ifdef USE_SLANG_CURSES 528 return addstr((
char *) str);
554 int rc = vw_printw(stdscr, fmt, ap);
567 if (!parent || !child)
586 if (!parent || !child)
629 bool changed =
false;
662 for (; win; win = win->
parent)
682 if (root->
type == type)
773 parent->
focus = child;
776 while (win && win->
focus)
781 #ifdef USE_DEBUG_WINDOW 794 while (win && win->
focus)
811 for (
int i = 0; i < win->
state.
rows; i++)
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
static int mutt_dlg_rootwin_observer(struct NotifyCallback *nc)
Listen for config changes affecting the Root Window - Implements observer_t.
#define WN_NARROWER
Window became narrower.
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Define wrapper functions around Curses/Slang.
struct MuttWindow * mutt_window_remove_child(struct MuttWindow *parent, struct MuttWindow *child)
Remove a child from a Window.
enum MuttWindowOrientation orient
Which direction the Window will expand.
#define TAILQ_FIRST(head)
void(* wdata_free)(struct MuttWindow *win, void **ptr)
Free the private data attached to the MuttWindow.
#define WA_REPAINT
Redraw the contents of the Window.
Data passed to a notification function.
struct MuttWindow * win
Window that changed.
void mutt_window_init(void)
Create the default Windows.
#define TAILQ_FOREACH(var, head, field)
void window_set_focus(struct MuttWindow *win)
Set the Window focus.
An Event that happened to a Window.
Window for messages/errors and command entry.
int help_menu
Menu for key bindings, e.g. MENU_PAGER.
Window uses all available vertical space.
void notify_free(struct Notify **ptr)
Free a notification handler.
static bool is_visible(struct Email *e)
Is the message visible?
void mutt_window_free_all(void)
Free all the default Windows.
struct MuttWindow * mutt_window_find(struct MuttWindow *root, enum WindowType type)
Find a Window of a given type.
void mutt_window_clrtoeol(struct MuttWindow *win)
Clear to the end of the line.
static bool window_was_visible(struct MuttWindow *win)
Was the Window visible?
#define WN_NO_FLAGS
No flags are set.
WindowType
Type of Window.
MuttWindowOrientation
Which way does the Window expand?
#define TAILQ_FOREACH_SAFE(var, head, field, tvar)
#define WN_WIDER
Window became wider.
static const struct Mapping EditorHelp[]
Help Bar for the Command Line Editor.
Window is about to be deleted.
WHERE bool OptNoCurses
(pseudo) when sending in batch mode
#define WN_HIDDEN
Window became hidden.
Window focus has changed.
A division of the screen.
void mutt_window_move_abs(int col, int row)
Move the cursor to an absolute screen position.
short col_offset
Absolute on-screen column.
int mutt_window_mvaddstr(struct MuttWindow *win, int col, int row, const char *str)
Move the cursor and write a fixed string to a Window.
All user-callable functions.
Container for Accounts, Notifications.
MuttWindow has changed, NotifyWindow, EventWindow.
Convenience wrapper for the config headers.
int mutt_window_move(struct MuttWindow *win, int col, int row)
Move the cursor in a Window.
void mutt_window_free(struct MuttWindow **ptr)
Free a Window and its children.
enum NotifyType event_type
Send: Event type, e.g. NT_ACCOUNT.
struct MuttWindow * focus
Focussed Window.
WindowActionFlags actions
Actions to be performed, e.g. WA_RECALC.
int mutt_window_addnstr(const char *str, int num)
Write a partial string to a Window.
void mutt_window_clear(struct MuttWindow *win)
Clear a Window.
struct Notify * notify
Notifications system.
static void window_repaint(struct MuttWindow *win, bool force)
Repaint a tree of Windows.
void mutt_window_clearline(struct MuttWindow *win, int row)
Clear a row of a Window.
struct MuttWindow * window_get_focus(void)
Get the currently focussed Window.
Convenience wrapper for the core headers.
New Window has been added.
void mutt_winlist_free(struct MuttWindowList *head)
Free a tree of Windows.
struct MuttWindow * helpbar_create(void)
Create the Help Bar Window.
Help Bar Convenience wrapper for the Help Bar headers.
bool notify_observer_add(struct Notify *notify, enum NotifyType type, observer_t callback, void *global_data)
Add an observer to an object.
void * global_data
Data from notify_observer_add()
#define TAILQ_REMOVE(head, elm, field)
void mutt_window_reflow_message_rows(int mw_rows)
Resize the Message Window.
Window state has changed, e.g. WN_VISIBLE.
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
struct Notify * notify_new(void)
Create a new notifications handler.
void window_reflow(struct MuttWindow *win)
Reflow Windows.
void mutt_window_get_coords(struct MuttWindow *win, int *col, int *row)
Get the cursor position in the Window.
void mutt_window_set_root(int cols, int rows)
Set the dimensions of the Root Window.
struct WindowState state
Current state of the Window.
#define WN_TALLER
Window became taller.
struct MuttWindow * RootWindow
Parent of all Windows.
bool visible
Window is visible.
bool mutt_window_is_visible(struct MuttWindow *win)
Is the Window visible?
short row_offset
Absolute on-screen row.
static void window_recalc(struct MuttWindow *win)
Recalculate a tree of Windows.
#define MUTT_WIN_SIZE_UNLIMITED
Use as much space as possible.
short rows
Number of rows, can be MUTT_WIN_SIZE_UNLIMITED.
uint8_t WindowNotifyFlags
Changes to a MuttWindow.
static void window_notify(struct MuttWindow *win)
Notify observers of changes to a Window.
const struct Mapping * help_data
Data for the Help Bar.
Help Bar containing list of useful key bindings.
#define WN_SHORTER
Window became shorter.
struct WindowState old
Previous state of the Window.
int mutt_window_wrap_cols(int width, short wrap)
Calculate the wrap column for a given screen width.
#define TAILQ_INSERT_TAIL(head, elm, field)
enum MuttWindowSize size
Type of Window, e.g. MUTT_WIN_SIZE_FIXED.
struct Notify * notify
Notifications handler.
Container for All Dialogs (nested Windows)
void * event_data
Data from notify_send()
void mutt_window_add_child(struct MuttWindow *parent, struct MuttWindow *child)
Add a child to Window.
The current, or old, state of a Window.
void window_notify_all(struct MuttWindow *win)
Notify observers of changes to a Window and its children.
Config has changed, NotifyConfig, EventConfig.
#define TAILQ_INSERT_HEAD(head, elm, field)
int mutt_window_printf(const char *fmt,...)
Write a formatted string to a Window.
int mutt_window_addch(int ch)
Write one character to a Window.
Convenience wrapper for the debug headers.
void window_set_visible(struct MuttWindow *win, bool visible)
Set a Window visible or hidden.
void mutt_window_reflow(struct MuttWindow *win)
Resize a Window and its children.
WHERE bool C_StatusOnTop
Config: Display the status bar at the top.
struct MuttWindow * parent
Parent Window.
#define WN_VISIBLE
Window became visible.
int(* repaint)(struct MuttWindow *win)
Repaint the Window.
Mapping between user-readable string and a constant.
MuttWindowSize
Control the allocation of Window space.
struct MuttWindowList children
Children Windows.
short req_rows
Number of rows required.
bool notify_observer_remove(struct Notify *notify, observer_t callback, void *global_data)
Remove an observer from an object.
void window_redraw(struct MuttWindow *win, bool force)
Reflow, recalc and repaint a tree of Windows.
int mutt_window_mvprintw(struct MuttWindow *win, int col, int row, const char *fmt,...)
Move the cursor and write a formatted string to a Window.
void notify_set_parent(struct Notify *notify, struct Notify *parent)
Set the parent notification handler.
int mutt_window_addstr(const char *str)
Write a string to a Window.
#define TAILQ_NEXT(elm, field)
int(* recalc)(struct MuttWindow *win)
Recalculate the Window data.
void debug_win_dump(void)
Hundreds of global variables to back the user variables.
Handling of global boolean variables.
#define mutt_debug(LEVEL,...)
struct MuttWindow * mutt_window_new(enum WindowType type, enum MuttWindowOrientation orient, enum MuttWindowSize size, int cols, int rows)
Create a new Window.
Convenience wrapper for the library headers.
Window wants as much space as possible.
void * wdata
Private data.
enum WindowType type
Window type, e.g. WT_SIDEBAR.
const char * name
Name of config item that changed.
#define WN_MOVED
Window moved.
short req_cols
Number of columns required.
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
#define WA_RECALC
Recalculate the contents of the Window.