Go to the documentation of this file.
23 #ifndef MUTT_MUTT_WINDOW_H
24 #define MUTT_MUTT_WINDOW_H
49 #define MUTT_WIN_SIZE_UNLIMITED -1
105 #define WA_NO_FLAGS 0
106 #define WA_REFLOW (1 << 0)
107 #define WA_RECALC (1 << 1)
108 #define WA_REPAINT (1 << 2)
165 #define WN_NO_FLAGS 0
166 #define WN_TALLER (1 << 0)
167 #define WN_SHORTER (1 << 1)
168 #define WN_WIDER (1 << 2)
169 #define WN_NARROWER (1 << 3)
170 #define WN_MOVED (1 << 4)
171 #define WN_VISIBLE (1 << 5)
172 #define WN_HIDDEN (1 << 6)
@ WT_DLG_POSTPONE
Postpone Dialog, dlg_select_postponed_email()
@ WT_CUSTOM
Window with a custom drawing function.
@ WT_PAGER
Window containing paged free-form text.
@ NT_WINDOW_STATE
Window state has changed, e.g. WN_VISIBLE.
@ WT_DLG_ATTACH
Attach Dialog, dlg_select_attachment()
@ WT_PAGER_BAR
Pager Bar containing status info about the Pager.
@ WT_ROOT
Parent of All Windows.
MuttWindowSize
Control the allocation of Window space.
WindowNotifyFlags flags
Attributes of Window that changed.
@ MUTT_WIN_ORIENT_HORIZONTAL
Window uses all available horizontal space.
@ WT_DLG_CERTIFICATE
Certificate Dialog, dlg_verify_certificate()
struct MuttWindow * mutt_window_remove_child(struct MuttWindow *parent, struct MuttWindow *child)
Remove a child from a Window.
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.
WindowType
Type of Window.
short req_cols
Number of columns required.
@ WT_DLG_AUTOCRYPT
Autocrypt Dialog, dlg_select_autocrypt_account()
struct MuttWindow * AllDialogsWindow
Parent of all Dialogs.
void window_set_visible(struct MuttWindow *win, bool visible)
Set a Window visible or hidden.
struct MuttWindow * win
Window that changed.
A division of the screen.
void(* wdata_free)(struct MuttWindow *win, void **ptr)
Free the private data attached to the MuttWindow.
short row_offset
Absolute on-screen row.
bool visible
Window is visible.
@ WT_DLG_CRYPT_GPGME
Crypt-GPGME Dialog, dlg_select_gpgme_key()
@ NT_WINDOW_DIALOG
A new Dialog Window has been created, e.g. WT_DLG_INDEX.
int help_menu
Menu for key bindings, e.g. MENU_PAGER.
uint8_t WindowActionFlags
Actions waiting to be performed on a MuttWindow.
void mutt_winlist_free(struct MuttWindowList *head)
Free a tree of Windows.
MuttWindowOrientation
Which way does the Window expand?
@ MUTT_WIN_SIZE_MAXIMISE
Window wants as much space as possible.
@ WT_DLG_COMPOSE
Compose Dialog, mutt_compose_menu()
@ WT_DLG_PGP
Pgp Dialog, dlg_select_pgp_key()
@ WT_SIDEBAR
Side panel containing Accounts or groups of data.
void mutt_window_add_child(struct MuttWindow *parent, struct MuttWindow *child)
Add a child to Window.
Mapping between user-readable string and a constant.
TAILQ_HEAD(MuttWindowList, MuttWindow)
@ NT_WINDOW_DELETE
Window is about to be deleted.
struct MuttWindow * window_get_focus(void)
Get the currently focussed Window.
struct MuttWindow * mutt_window_new(enum WindowType type, enum MuttWindowOrientation orient, enum MuttWindowSize size, int cols, int rows)
Create a new Window.
void mutt_window_move_abs(int col, int row)
Move the cursor to an absolute screen position.
short col_offset
Absolute on-screen column.
@ WT_MESSAGE
Window for messages/errors and command entry.
struct MuttWindow * focus
Focussed Window.
struct Notify * notify
Notifications system.
void window_redraw(struct MuttWindow *win, bool force)
Reflow, recalc and repaint a tree of Windows.
int mutt_window_printf(const char *format,...)
Write a formatted string to a Window.
void mutt_window_get_coords(struct MuttWindow *win, int *col, int *row)
Get the cursor position in the Window.
@ MUTT_WIN_ORIENT_VERTICAL
Window uses all available vertical space.
int mutt_window_addnstr(const char *str, int num)
Write a partial string to a Window.
struct WindowState old
Previous state of the Window.
@ WT_DLG_QUERY
Query Dialog, dlg_select_query()
int mutt_window_wrap_cols(int width, short wrap)
Calculate the wrap column for a given screen width.
WindowActionFlags actions
Actions to be performed, e.g. WA_RECALC.
The current, or old, state of a Window.
@ WT_DLG_INDEX
Index Dialog, index_pager_init()
@ NT_WINDOW_NEW
New Window has been added.
int mutt_window_addstr(const char *str)
Write a string to a Window.
struct MuttWindow * mutt_window_find(struct MuttWindow *root, enum WindowType type)
Find a Window of a given type.
int mutt_window_move(struct MuttWindow *win, int col, int row)
Move the cursor in a Window.
struct MuttWindow * MessageWindow
Message Window, ":set", etc.
@ WT_DLG_DO_PAGER
Pager Dialog, mutt_do_pager()
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.
short rows
Number of rows, can be MUTT_WIN_SIZE_UNLIMITED.
struct MuttWindow * parent
Parent Window.
@ WT_DLG_BROWSER
Browser Dialog, mutt_buffer_select_file()
void mutt_window_set_root(int cols, int rows)
Set the dimensions of the Root Window.
const struct Mapping * help_data
Data for the Help Bar.
int(* repaint)(struct MuttWindow *win)
Repaint the Window.
@ NT_WINDOW_FOCUS
Window focus has changed.
@ WT_DLG_PATTERN
Pattern Dialog, create_pattern_menu()
struct WindowState state
Current state of the Window.
@ WT_INDEX
An Index Window containing a selection list.
@ WT_DLG_ALIAS
Alias Dialog, dlg_select_alias()
short req_rows
Number of rows required.
@ WT_DLG_SMIME
Smime Dialog, dlg_select_smime_key()
void mutt_window_clearline(struct MuttWindow *win, int row)
Clear a row of a Window.
@ WT_ALL_DIALOGS
Container for All Dialogs (nested Windows)
@ WT_CONTAINER
Invisible shaping container Window.
int mutt_window_addch(int ch)
Write one character to a Window.
enum MuttWindowSize size
Type of Window, e.g. MUTT_WIN_SIZE_FIXED.
uint8_t WindowNotifyFlags
Changes to a MuttWindow.
@ MUTT_WIN_SIZE_MINIMISE
Window size depends on its children.
@ WT_INDEX_BAR
Index Bar containing status info about the Index.
void window_notify_all(struct MuttWindow *win)
Notify observers of changes to a Window and its children.
@ WT_HELP_BAR
Help Bar containing list of useful key bindings.
struct MuttWindow * RootWindow
Parent of all Windows.
TAILQ_ENTRY(MuttWindow) entries
Linked list.
enum WindowType type
Window type, e.g. WT_SIDEBAR.
void mutt_window_init(void)
Create the default Windows.
@ MUTT_WIN_SIZE_FIXED
Window has a fixed size.
void window_set_focus(struct MuttWindow *win)
Set the Window focus.
NotifyWindow
Window notification types.
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
void mutt_window_free(struct MuttWindow **ptr)
Free a Window and its children.
void mutt_window_reflow(struct MuttWindow *win)
Resize a Window and its children.
@ WT_DLG_HISTORY
History Dialog, dlg_select_history()
struct MuttWindowList children
Children Windows.
void mutt_window_free_all(void)
Free all the default Windows.
int(* recalc)(struct MuttWindow *win)
Recalculate the Window data.
@ WT_DLG_REMAILER
Remailer Dialog, dlg_select_mixmaster_chain()
enum MuttWindowOrientation orient
Which direction the Window will expand.
An Event that happened to a Window.
void mutt_window_reflow_message_rows(int mw_rows)
Resize the Message Window.
bool mutt_window_is_visible(struct MuttWindow *win)
Is the Window visible?
void mutt_window_clear(struct MuttWindow *win)
Clear a Window.
void * wdata
Private data.
void mutt_window_clrtoeol(struct MuttWindow *win)
Clear to the end of the line.