40#ifdef USE_DEBUG_WINDOW
91 for (; win; win = win->
parent)
256 getyx(stdscr, row, col);
333 rc = vw_printw(stdscr, fmt, ap);
358#ifdef USE_DEBUG_WINDOW
374 return (width > -wrap) ? (width + wrap) : width;
376 return (wrap < width) ? wrap : width;
405 return addnstr(str, num);
434 int rc = vw_printw(stdscr, fmt, ap);
447 if (!parent || !child)
516 for (; win; win = win->
parent)
559 for (; win; win = win->
parent)
660 return (win_focus == win);
671 while (win && win->
focus)
699 if (win == old_focus)
706#ifdef USE_DEBUG_WINDOW
769 clearok(stdscr,
true);
770 keypad(stdscr,
true);
785 const bool c_status_on_top =
cs_subset_bool(sub,
"status_on_top");
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Convenience wrapper for the config headers.
void mutt_refresh(void)
Force a refresh of the screen.
GUI miscellaneous curses (window drawing) routines.
Convenience wrapper for the debug headers.
void debug_win_dump(void)
bool OptNoCurses
(pseudo) when sending in batch mode
#define mutt_debug(LEVEL,...)
@ LL_NOTIFY
Log of notifications.
const char * mutt_map_get_name(int val, const struct Mapping *map)
Lookup a string for a constant.
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Convenience wrapper for the library headers.
struct Notify * notify_new(void)
Create a new notifications handler.
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
void notify_set_parent(struct Notify *notify, struct Notify *parent)
Set the parent notification handler.
void notify_free(struct Notify **ptr)
Free a notification handler.
enum MuttCursorState mutt_curses_set_cursor(enum MuttCursorState state)
Set the cursor state.
Define wrapper functions around Curses.
@ MUTT_CURSOR_INVISIBLE
Hide the cursor.
static bool is_visible(struct Email *e)
Is the message visible?
void mutt_window_clear(struct MuttWindow *win)
Clear a Window.
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_reflow(struct MuttWindow *win)
Resize a Window and its children.
static void window_recursor(void)
Recursor the focussed Window.
struct MuttWindow * window_find_parent(struct MuttWindow *win, enum WindowType type)
Find a (grand-)parent of a Window by type.
void window_notify_all(struct MuttWindow *win)
Notify observers of changes to a Window and its children.
bool window_status_on_top(struct MuttWindow *panel, struct ConfigSubset *sub)
Organise windows according to config variable.
static void window_notify(struct MuttWindow *win)
Notify observers of changes to a Window.
bool window_is_focused(const struct MuttWindow *win)
Does the given Window have the focus?
static const struct Mapping WindowNames[]
Lookups for Window Names.
void mutt_window_free(struct MuttWindow **ptr)
Free a Window and its children.
void mutt_window_add_child(struct MuttWindow *parent, struct MuttWindow *child)
Add a child to Window.
const char * mutt_window_win_name(const struct MuttWindow *win)
Get the name of a Window.
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.
struct MuttWindow * window_get_focus(void)
Get the currently focused Window.
static void window_invalidate(struct MuttWindow *win)
Mark a window as in need of repaint.
int mutt_window_move(struct MuttWindow *win, int col, int row)
Move the cursor in a Window.
static void window_recalc(struct MuttWindow *win)
Recalculate a tree of Windows.
struct MuttWindow * window_set_focus(struct MuttWindow *win)
Set the Window focus.
struct MuttWindow * mutt_window_remove_child(struct MuttWindow *parent, struct MuttWindow *child)
Remove a child from a Window.
void window_set_visible(struct MuttWindow *win, bool visible)
Set a Window visible or hidden.
static bool window_was_visible(struct MuttWindow *win)
Was the Window visible?
void mutt_window_get_coords(struct MuttWindow *win, int *col, int *row)
Get the cursor position in the Window.
int mutt_window_wrap_cols(int width, short wrap)
Calculate the wrap column for a given screen width.
void mutt_winlist_free(struct MuttWindowList *head)
Free a tree of Windows.
struct MuttWindow * window_find_child(struct MuttWindow *win, enum WindowType type)
Recursively find a child Window of a given type.
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.
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.
int mutt_window_addnstr(struct MuttWindow *win, const char *str, int num)
Write a partial string to a Window.
void mutt_window_clrtoeol(struct MuttWindow *win)
Clear to the end of the line.
static void window_repaint(struct MuttWindow *win)
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 window_invalidate_all(void)
Mark all windows as in need of repaint.
int mutt_window_addch(struct MuttWindow *win, int ch)
Write one character to a Window.
#define WA_RECALC
Recalculate the contents of the Window.
#define WN_MOVED
Window moved.
uint8_t WindowNotifyFlags
Flags for Changes to a MuttWindow, e.g. WN_TALLER.
#define WN_WIDER
Window became wider.
WindowType
Type of Window.
@ WT_CUSTOM
Window with a custom drawing function.
@ WT_ROOT
Parent of All Windows.
@ WT_DLG_ALIAS
Alias Dialog, dlg_alias()
@ WT_ALL_DIALOGS
Container for All Dialogs (nested Windows)
@ WT_DLG_BROWSER
Browser Dialog, dlg_browser()
@ WT_MESSAGE
Window for messages/errors.
@ WT_DLG_SMIME
Smime Dialog, dlg_smime()
@ WT_DLG_QUERY
Query Dialog, dlg_query()
@ WT_DLG_HISTORY
History Dialog, dlg_history()
@ WT_DLG_PGP
Pgp Dialog, dlg_pgp()
@ WT_CONTAINER
Invisible shaping container Window.
@ WT_DLG_CERTIFICATE
Certificate Dialog, dlg_certificate()
@ WT_DLG_COMPOSE
Compose Dialog, dlg_compose()
@ WT_DLG_INDEX
Index Dialog, dlg_index()
@ WT_PAGER
A panel containing the Pager Window.
@ WT_DLG_GPGME
GPGME Dialog, dlg_gpgme()
@ WT_STATUS_BAR
Status Bar containing extra info about the Index/Pager/etc.
@ WT_HELP_BAR
Help Bar containing list of useful key bindings.
@ WT_DLG_POSTPONED
Postponed Dialog, dlg_postponed()
@ WT_INDEX
A panel containing the Index Window.
@ WT_DLG_ATTACHMENT
Attachment Dialog, dlg_attachment()
@ WT_SIDEBAR
Side panel containing Accounts or groups of data.
@ WT_DLG_PAGER
Pager Dialog, dlg_pager()
@ WT_DLG_AUTOCRYPT
Autocrypt Dialog, dlg_autocrypt()
@ WT_MENU
An Window containing a Menu.
@ WT_DLG_PATTERN
Pattern Dialog, dlg_pattern()
MuttWindowOrientation
Which way does the Window expand?
@ NT_WINDOW_STATE
Window state has changed, e.g. WN_VISIBLE.
@ NT_WINDOW_DELETE
Window is about to be deleted.
@ NT_WINDOW_FOCUS
Window focus has changed.
@ NT_WINDOW_ADD
New Window has been added.
#define WN_VISIBLE
Window became visible.
#define WN_HIDDEN
Window became hidden.
#define WN_NO_FLAGS
No flags are set.
#define WA_REPAINT
Redraw the contents of the Window.
#define WN_TALLER
Window became taller.
MuttWindowSize
Control the allocation of Window space.
#define WN_NARROWER
Window became narrower.
#define WN_SHORTER
Window became shorter.
@ NT_WINDOW
MuttWindow has changed, NotifyWindow, EventWindow.
#define TAILQ_FOREACH(var, head, field)
#define TAILQ_FOREACH_SAFE(var, head, field, tvar)
#define TAILQ_INSERT_TAIL(head, elm, field)
#define TAILQ_FIRST(head)
#define TAILQ_REMOVE(head, elm, field)
#define TAILQ_LAST(head, headname)
#define TAILQ_INSERT_HEAD(head, elm, field)
void window_reflow(struct MuttWindow *win)
Reflow Windows.
struct MuttWindow * RootWindow
Parent of all Windows.
A set of inherited config items.
An Event that happened to a Window.
struct MuttWindow * win
Window that changed.
WindowNotifyFlags flags
Attributes of Window that changed.
Mapping between user-readable string and a constant.
struct WindowState old
Previous state of the Window.
int(* repaint)(struct MuttWindow *win)
short req_cols
Number of columns required.
struct WindowState state
Current state of the Window.
struct MuttWindow * focus
Focused Window.
void * wdata
Private data.
enum MuttWindowOrientation orient
Which direction the Window will expand.
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
short req_rows
Number of rows required.
int(* recalc)(struct MuttWindow *win)
void(* wdata_free)(struct MuttWindow *win, void **ptr)
struct MuttWindowList children
Children Windows.
struct MuttWindow * parent
Parent Window.
WindowActionFlags actions
Actions to be performed, e.g. WA_RECALC.
enum MuttWindowSize size
Type of Window, e.g. MUTT_WIN_SIZE_FIXED.
bool(* recursor)(struct MuttWindow *win)
enum WindowType type
Window type, e.g. WT_SIDEBAR.
The current, or old, state of a Window.
bool visible
Window is visible.
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
short row_offset
Absolute on-screen row.
short col_offset
Absolute on-screen column.
short rows
Number of rows, can be MUTT_WIN_SIZE_UNLIMITED.