NeoMutt  2021-02-05-329-g9e03b7
Teaching an old dog new tricks
DOXYGEN
mutt_window.h File Reference

Window management. More...

#include "config.h"
#include <stdbool.h>
#include <stdint.h>
#include "mutt/lib.h"
+ Include dependency graph for mutt_window.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  WindowState
 The current, or old, state of a Window. More...
 
struct  MuttWindow
 A division of the screen. More...
 
struct  EventWindow
 An Event that happened to a Window. More...
 

Macros

#define MUTT_WIN_SIZE_UNLIMITED   -1
 Use as much space as possible. More...
 
#define WA_NO_FLAGS   0
 No flags are set. More...
 
#define WA_REFLOW   (1 << 0)
 Reflow the Window and its children. More...
 
#define WA_RECALC   (1 << 1)
 Recalculate the contents of the Window. More...
 
#define WA_REPAINT   (1 << 2)
 Redraw the contents of the Window. More...
 
#define WN_NO_FLAGS   0
 No flags are set. More...
 
#define WN_TALLER   (1 << 0)
 Window became taller. More...
 
#define WN_SHORTER   (1 << 1)
 Window became shorter. More...
 
#define WN_WIDER   (1 << 2)
 Window became wider. More...
 
#define WN_NARROWER   (1 << 3)
 Window became narrower. More...
 
#define WN_MOVED   (1 << 4)
 Window moved. More...
 
#define WN_VISIBLE   (1 << 5)
 Window became visible. More...
 
#define WN_HIDDEN   (1 << 6)
 Window became hidden. More...
 

Typedefs

typedef uint8_t WindowActionFlags
 Actions waiting to be performed on a MuttWindow. More...
 
typedef uint8_t WindowNotifyFlags
 Changes to a MuttWindow. More...
 

Enumerations

enum  MuttWindowOrientation { MUTT_WIN_ORIENT_VERTICAL = 1, MUTT_WIN_ORIENT_HORIZONTAL }
 Which way does the Window expand? More...
 
enum  MuttWindowSize { MUTT_WIN_SIZE_FIXED = 1, MUTT_WIN_SIZE_MAXIMISE, MUTT_WIN_SIZE_MINIMISE }
 Control the allocation of Window space. More...
 
enum  WindowType {
  WT_ROOT, WT_CONTAINER, WT_ALL_DIALOGS, WT_DLG_ALIAS,
  WT_DLG_ATTACH, WT_DLG_AUTOCRYPT, WT_DLG_BROWSER, WT_DLG_CERTIFICATE,
  WT_DLG_COMPOSE, WT_DLG_CRYPT_GPGME, WT_DLG_DO_PAGER, WT_DLG_HISTORY,
  WT_DLG_INDEX, WT_DLG_PATTERN, WT_DLG_PGP, WT_DLG_POSTPONE,
  WT_DLG_QUERY, WT_DLG_REMAILER, WT_DLG_SMIME, WT_CUSTOM,
  WT_HELP_BAR, WT_INDEX, WT_INDEX_BAR, WT_MENU,
  WT_MESSAGE, WT_PAGER, WT_PAGER_BAR, WT_SIDEBAR
}
 Type of Window. More...
 
enum  NotifyWindow {
  NT_WINDOW_NEW = 1, NT_WINDOW_DELETE, NT_WINDOW_STATE, NT_WINDOW_DIALOG,
  NT_WINDOW_FOCUS
}
 Window notification types. More...
 

Functions

 TAILQ_HEAD (MuttWindowList, MuttWindow)
 
void mutt_window_add_child (struct MuttWindow *parent, struct MuttWindow *child)
 Add a child to Window. More...
 
void mutt_window_free (struct MuttWindow **ptr)
 Free a Window and its children. More...
 
void mutt_window_free_all (void)
 Free all the default Windows. More...
 
void mutt_window_get_coords (struct MuttWindow *win, int *col, int *row)
 Get the cursor position in the Window. More...
 
void mutt_window_init (void)
 Create the default Windows. More...
 
struct MuttWindowmutt_window_new (enum WindowType type, enum MuttWindowOrientation orient, enum MuttWindowSize size, int cols, int rows)
 Create a new Window. More...
 
void mutt_window_reflow (struct MuttWindow *win)
 Resize a Window and its children. More...
 
void mutt_window_reflow_message_rows (int mw_rows)
 Resize the Message Window. More...
 
struct MuttWindowmutt_window_remove_child (struct MuttWindow *parent, struct MuttWindow *child)
 Remove a child from a Window. More...
 
void mutt_window_set_root (int cols, int rows)
 Set the dimensions of the Root Window. More...
 
int mutt_window_wrap_cols (int width, short wrap)
 Calculate the wrap column for a given screen width. More...
 
int mutt_window_addch (int ch)
 Write one character to a Window. More...
 
int mutt_window_addnstr (const char *str, int num)
 Write a partial string to a Window. More...
 
int mutt_window_addstr (const char *str)
 Write a string to a Window. More...
 
void mutt_window_clearline (struct MuttWindow *win, int row)
 Clear a row of a Window. More...
 
void mutt_window_clear (struct MuttWindow *win)
 Clear a Window. More...
 
void mutt_window_clrtoeol (struct MuttWindow *win)
 Clear to the end of the line. More...
 
int mutt_window_move (struct MuttWindow *win, int col, int row)
 Move the cursor in a Window. More...
 
void mutt_window_move_abs (int col, int row)
 Move the cursor to an absolute screen position. More...
 
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. More...
 
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. More...
 
int mutt_window_printf (const char *format,...)
 Write a formatted string to a Window. More...
 
bool mutt_window_is_visible (struct MuttWindow *win)
 Is the Window visible? More...
 
void mutt_winlist_free (struct MuttWindowList *head)
 Free a tree of Windows. More...
 
struct MuttWindowmutt_window_find (struct MuttWindow *root, enum WindowType type)
 Find a Window of a given type. More...
 
void window_notify_all (struct MuttWindow *win)
 Notify observers of changes to a Window and its children. More...
 
void window_set_visible (struct MuttWindow *win, bool visible)
 Set a Window visible or hidden. More...
 
void window_set_focus (struct MuttWindow *win)
 Set the Window focus. More...
 
struct MuttWindowwindow_get_focus (void)
 Get the currently focussed Window. More...
 
struct MuttWindowwindow_get_dialog (void)
 Get the currently active Dialog. More...
 
void window_redraw (struct MuttWindow *win, bool force)
 Reflow, recalc and repaint a tree of Windows. More...
 

Variables

struct MuttWindowRootWindow
 Parent of all Windows. More...
 
struct MuttWindowAllDialogsWindow
 Parent of all Dialogs. More...
 
struct MuttWindowMessageWindow
 Message Window, ":set", etc. More...
 

Detailed Description

Window management.

Authors
  • Richard Russon

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 mutt_window.h.

Macro Definition Documentation

◆ MUTT_WIN_SIZE_UNLIMITED

#define MUTT_WIN_SIZE_UNLIMITED   -1

Use as much space as possible.

Definition at line 50 of file mutt_window.h.

◆ WA_NO_FLAGS

#define WA_NO_FLAGS   0

No flags are set.

Definition at line 107 of file mutt_window.h.

◆ WA_REFLOW

#define WA_REFLOW   (1 << 0)

Reflow the Window and its children.

Definition at line 108 of file mutt_window.h.

◆ WA_RECALC

#define WA_RECALC   (1 << 1)

Recalculate the contents of the Window.

Definition at line 109 of file mutt_window.h.

◆ WA_REPAINT

#define WA_REPAINT   (1 << 2)

Redraw the contents of the Window.

Definition at line 110 of file mutt_window.h.

◆ WN_NO_FLAGS

#define WN_NO_FLAGS   0

No flags are set.

Definition at line 167 of file mutt_window.h.

◆ WN_TALLER

#define WN_TALLER   (1 << 0)

Window became taller.

Definition at line 168 of file mutt_window.h.

◆ WN_SHORTER

#define WN_SHORTER   (1 << 1)

Window became shorter.

Definition at line 169 of file mutt_window.h.

◆ WN_WIDER

#define WN_WIDER   (1 << 2)

Window became wider.

Definition at line 170 of file mutt_window.h.

◆ WN_NARROWER

#define WN_NARROWER   (1 << 3)

Window became narrower.

Definition at line 171 of file mutt_window.h.

◆ WN_MOVED

#define WN_MOVED   (1 << 4)

Window moved.

Definition at line 172 of file mutt_window.h.

◆ WN_VISIBLE

#define WN_VISIBLE   (1 << 5)

Window became visible.

Definition at line 173 of file mutt_window.h.

◆ WN_HIDDEN

#define WN_HIDDEN   (1 << 6)

Window became hidden.

Definition at line 174 of file mutt_window.h.

Typedef Documentation

◆ WindowActionFlags

typedef uint8_t WindowActionFlags

Actions waiting to be performed on a MuttWindow.

Definition at line 106 of file mutt_window.h.

◆ WindowNotifyFlags

typedef uint8_t WindowNotifyFlags

Changes to a MuttWindow.

Definition at line 166 of file mutt_window.h.

Enumeration Type Documentation

◆ MuttWindowOrientation

Which way does the Window expand?

Enumerator
MUTT_WIN_ORIENT_VERTICAL 

Window uses all available vertical space.

MUTT_WIN_ORIENT_HORIZONTAL 

Window uses all available horizontal space.

Definition at line 34 of file mutt_window.h.

35 {
38 };
Window uses all available vertical space.
Definition: mutt_window.h:36
Window uses all available horizontal space.
Definition: mutt_window.h:37

◆ MuttWindowSize

Control the allocation of Window space.

Enumerator
MUTT_WIN_SIZE_FIXED 

Window has a fixed size.

MUTT_WIN_SIZE_MAXIMISE 

Window wants as much space as possible.

MUTT_WIN_SIZE_MINIMISE 

Window size depends on its children.

Definition at line 43 of file mutt_window.h.

44 {
48 };
Window has a fixed size.
Definition: mutt_window.h:45
Window size depends on its children.
Definition: mutt_window.h:47
Window wants as much space as possible.
Definition: mutt_window.h:46

◆ WindowType

enum WindowType

Type of Window.

Enumerator
WT_ROOT 

Parent of All Windows.

WT_CONTAINER 

Invisible shaping container Window.

WT_ALL_DIALOGS 

Container for All Dialogs (nested Windows)

WT_DLG_ALIAS 

Alias Dialog, dlg_select_alias()

WT_DLG_ATTACH 

Attach Dialog, dlg_select_attachment()

WT_DLG_AUTOCRYPT 

Autocrypt Dialog, dlg_select_autocrypt_account()

WT_DLG_BROWSER 

Browser Dialog, mutt_buffer_select_file()

WT_DLG_CERTIFICATE 

Certificate Dialog, dlg_verify_certificate()

WT_DLG_COMPOSE 

Compose Dialog, mutt_compose_menu()

WT_DLG_CRYPT_GPGME 

Crypt-GPGME Dialog, dlg_select_gpgme_key()

WT_DLG_DO_PAGER 

Pager Dialog, mutt_do_pager()

WT_DLG_HISTORY 

History Dialog, dlg_select_history()

WT_DLG_INDEX 

Index Dialog, index_pager_init()

WT_DLG_PATTERN 

Pattern Dialog, create_pattern_menu()

WT_DLG_PGP 

Pgp Dialog, dlg_select_pgp_key()

WT_DLG_POSTPONE 

Postpone Dialog, dlg_select_postponed_email()

WT_DLG_QUERY 

Query Dialog, dlg_select_query()

WT_DLG_REMAILER 

Remailer Dialog, dlg_select_mixmaster_chain()

WT_DLG_SMIME 

Smime Dialog, dlg_select_smime_key()

WT_CUSTOM 

Window with a custom drawing function.

WT_HELP_BAR 

Help Bar containing list of useful key bindings.

WT_INDEX 

A panel containing the Index Window.

WT_INDEX_BAR 

Index Bar containing status info about the Index.

WT_MENU 

An Window containing a Menu.

WT_MESSAGE 

Window for messages/errors and command entry.

WT_PAGER 

A panel containing the Pager Window.

WT_PAGER_BAR 

Pager Bar containing status info about the Pager.

WT_SIDEBAR 

Side panel containing Accounts or groups of data.

Definition at line 67 of file mutt_window.h.

68 {
69  // Structural Windows
70  WT_ROOT,
71  WT_CONTAINER,
73 
74  // Dialogs (nested Windows) displayed to the user
75  WT_DLG_ALIAS,
84  WT_DLG_INDEX,
86  WT_DLG_PGP,
88  WT_DLG_QUERY,
90  WT_DLG_SMIME,
91 
92  // Common Windows
93  WT_CUSTOM,
94  WT_HELP_BAR,
95  WT_INDEX,
96  WT_INDEX_BAR,
97  WT_MENU,
98  WT_MESSAGE,
99  WT_PAGER,
100  WT_PAGER_BAR,
101  WT_SIDEBAR,
102 };
History Dialog, dlg_select_history()
Definition: mutt_window.h:83
Pager Bar containing status info about the Pager.
Definition: mutt_window.h:100
Crypt-GPGME Dialog, dlg_select_gpgme_key()
Definition: mutt_window.h:81
Window for messages/errors and command entry.
Definition: mutt_window.h:98
Attach Dialog, dlg_select_attachment()
Definition: mutt_window.h:76
Pgp Dialog, dlg_select_pgp_key()
Definition: mutt_window.h:86
Query Dialog, dlg_select_query()
Definition: mutt_window.h:88
Invisible shaping container Window.
Definition: mutt_window.h:71
Parent of All Windows.
Definition: mutt_window.h:70
A panel containing the Index Window.
Definition: mutt_window.h:95
Window with a custom drawing function.
Definition: mutt_window.h:93
Browser Dialog, mutt_buffer_select_file()
Definition: mutt_window.h:78
Autocrypt Dialog, dlg_select_autocrypt_account()
Definition: mutt_window.h:77
Side panel containing Accounts or groups of data.
Definition: mutt_window.h:101
Help Bar containing list of useful key bindings.
Definition: mutt_window.h:94
Pager Dialog, mutt_do_pager()
Definition: mutt_window.h:82
Container for All Dialogs (nested Windows)
Definition: mutt_window.h:72
A panel containing the Pager Window.
Definition: mutt_window.h:99
Smime Dialog, dlg_select_smime_key()
Definition: mutt_window.h:90
Compose Dialog, mutt_compose_menu()
Definition: mutt_window.h:80
Pattern Dialog, create_pattern_menu()
Definition: mutt_window.h:85
Postpone Dialog, dlg_select_postponed_email()
Definition: mutt_window.h:87
Index Dialog, index_pager_init()
Definition: mutt_window.h:84
Certificate Dialog, dlg_verify_certificate()
Definition: mutt_window.h:79
Index Bar containing status info about the Index.
Definition: mutt_window.h:96
An Window containing a Menu.
Definition: mutt_window.h:97
Alias Dialog, dlg_select_alias()
Definition: mutt_window.h:75
Remailer Dialog, dlg_select_mixmaster_chain()
Definition: mutt_window.h:89

◆ NotifyWindow

Window notification types.

Observers of NT_WINDOW will be passed an EventWindow.

Enumerator
NT_WINDOW_NEW 

New Window has been added.

NT_WINDOW_DELETE 

Window is about to be deleted.

NT_WINDOW_STATE 

Window state has changed, e.g. WN_VISIBLE.

NT_WINDOW_DIALOG 

A new Dialog Window has been created, e.g. WT_DLG_INDEX.

NT_WINDOW_FOCUS 

Window focus has changed.

Definition at line 181 of file mutt_window.h.

182 {
183  NT_WINDOW_NEW = 1,
188 };
A new Dialog Window has been created, e.g. WT_DLG_INDEX.
Definition: mutt_window.h:186
Window is about to be deleted.
Definition: mutt_window.h:184
Window focus has changed.
Definition: mutt_window.h:187
New Window has been added.
Definition: mutt_window.h:183
Window state has changed, e.g. WN_VISIBLE.
Definition: mutt_window.h:185

Function Documentation

◆ TAILQ_HEAD()

TAILQ_HEAD ( MuttWindowList  ,
MuttWindow   
)

◆ mutt_window_add_child()

void mutt_window_add_child ( struct MuttWindow parent,
struct MuttWindow child 
)

Add a child to Window.

Parameters
parentWindow to add to
childWindow to add

Definition at line 562 of file mutt_window.c.

563 {
564  if (!parent || !child)
565  return;
566 
567  TAILQ_INSERT_TAIL(&parent->children, child, entries);
568  child->parent = parent;
569 
570  notify_set_parent(child->notify, parent->notify);
571 
572  struct EventWindow ev_w = { child, WN_NO_FLAGS };
573  notify_send(child->notify, NT_WINDOW, NT_WINDOW_NEW, &ev_w);
574 }
An Event that happened to a Window.
Definition: mutt_window.h:193
#define WN_NO_FLAGS
No flags are set.
Definition: mutt_window.h:167
MuttWindow has changed, NotifyWindow, EventWindow.
Definition: notify_type.h:51
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
Definition: mutt_window.h:133
New Window has been added.
Definition: mutt_window.h:183
#define TAILQ_INSERT_TAIL(head, elm, field)
Definition: queue.h:802
struct MuttWindow * parent
Parent Window.
Definition: mutt_window.h:130
struct MuttWindowList children
Children Windows.
Definition: mutt_window.h:131
void notify_set_parent(struct Notify *notify, struct Notify *parent)
Set the parent notification handler.
Definition: notify.c:82
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
Definition: notify.c:156
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_window_free()

void mutt_window_free ( struct MuttWindow **  ptr)

Free a Window and its children.

Parameters
ptrWindow to free

Definition at line 184 of file mutt_window.c.

185 {
186  if (!ptr || !*ptr)
187  return;
188 
189  struct MuttWindow *win = *ptr;
190 
191  if (win->parent && (win->parent->focus == win))
192  win->parent->focus = NULL;
193 
194  struct EventWindow ev_w = { win, WN_NO_FLAGS };
196 
198 
199  if (win->wdata && win->wdata_free)
200  win->wdata_free(win, &win->wdata); // Custom function to free private data
201 
202  notify_free(&win->notify);
203 
204  FREE(ptr);
205 }
void(* wdata_free)(struct MuttWindow *win, void **ptr)
Free the private data attached to the MuttWindow.
Definition: mutt_window.h:147
struct MuttWindow * win
Window that changed.
Definition: mutt_window.h:195
An Event that happened to a Window.
Definition: mutt_window.h:193
void notify_free(struct Notify **ptr)
Free a notification handler.
Definition: notify.c:62
#define WN_NO_FLAGS
No flags are set.
Definition: mutt_window.h:167
Window is about to be deleted.
Definition: mutt_window.h:184
A division of the screen.
Definition: mutt_window.h:117
MuttWindow has changed, NotifyWindow, EventWindow.
Definition: notify_type.h:51
struct MuttWindow * focus
Focussed Window.
Definition: mutt_window.h:135
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
Definition: mutt_window.h:133
void mutt_winlist_free(struct MuttWindowList *head)
Free a tree of Windows.
Definition: mutt_window.c:601
struct MuttWindow * parent
Parent Window.
Definition: mutt_window.h:130
#define FREE(x)
Definition: memory.h:40
struct MuttWindowList children
Children Windows.
Definition: mutt_window.h:131
void * wdata
Private data.
Definition: mutt_window.h:140
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
Definition: notify.c:156
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_window_free_all()

void mutt_window_free_all ( void  )

Free all the default Windows.

Definition at line 303 of file mutt_window.c.

304 {
305  if (NeoMutt)
307  AllDialogsWindow = NULL;
308  MessageWindow = NULL;
310 }
static int mutt_dlg_rootwin_observer(struct NotifyCallback *nc)
Listen for config changes affecting the Root Window - Implements observer_t.
Definition: mutt_window.c:267
Container for Accounts, Notifications.
Definition: neomutt.h:36
void mutt_window_free(struct MuttWindow **ptr)
Free a Window and its children.
Definition: mutt_window.c:184
struct MuttWindow * MessageWindow
Message Window, ":set", etc.
Definition: mutt_window.c:45
struct MuttWindow * RootWindow
Parent of all Windows.
Definition: mutt_window.c:43
struct Notify * notify
Notifications handler.
Definition: neomutt.h:38
struct MuttWindow * AllDialogsWindow
Parent of all Dialogs.
Definition: mutt_window.c:44
bool notify_observer_remove(struct Notify *notify, observer_t callback, void *global_data)
Remove an observer from an object.
Definition: notify.c:212
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_window_get_coords()

void mutt_window_get_coords ( struct MuttWindow win,
int *  col,
int *  row 
)

Get the cursor position in the Window.

Parameters
[in]winWindow
[out]colColumn in Window
[out]rowRow in Window

Assumes the current position is inside the window. Otherwise it will happily return negative or values outside the window boundaries

Definition at line 321 of file mutt_window.c.

322 {
323  int x = 0;
324  int y = 0;
325 
326  getyx(stdscr, y, x);
327  if (col)
328  *col = x - win->state.col_offset;
329  if (row)
330  *row = y - win->state.row_offset;
331 }
short col_offset
Absolute on-screen column.
Definition: mutt_window.h:60
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:122
short row_offset
Absolute on-screen row.
Definition: mutt_window.h:61
+ Here is the caller graph for this function:

◆ mutt_window_init()

void mutt_window_init ( void  )

Create the default Windows.

Create the Help, Index, Status, Message and Sidebar Windows.

Definition at line 338 of file mutt_window.c.

339 {
340  if (RootWindow)
341  return;
342 
343  RootWindow =
346 
347  struct MuttWindow *win_helpbar = helpbar_create();
348 
352 
357 
358  const bool c_status_on_top = cs_subset_bool(NeoMutt->sub, "status_on_top");
359  if (c_status_on_top)
360  {
362  mutt_window_add_child(RootWindow, win_helpbar);
363  }
364  else
365  {
366  mutt_window_add_child(RootWindow, win_helpbar);
368  }
369 
372 }
static int mutt_dlg_rootwin_observer(struct NotifyCallback *nc)
Listen for config changes affecting the Root Window - Implements observer_t.
Definition: mutt_window.c:267
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition: helpers.c:71
Window for messages/errors and command entry.
Definition: mutt_window.h:98
int help_menu
Menu for key bindings, e.g. MENU_PAGER.
Definition: mutt_window.h:136
Window uses all available vertical space.
Definition: mutt_window.h:36
Parent of All Windows.
Definition: mutt_window.h:70
static const struct Mapping EditorHelp[]
Help Bar for the Command Line Editor.
Definition: mutt_window.c:48
A division of the screen.
Definition: mutt_window.h:117
Container for Accounts, Notifications.
Definition: neomutt.h:36
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
Definition: mutt_window.h:133
struct MuttWindow * helpbar_create(void)
Create the Help Bar Window.
Definition: helpbar.c:263
bool notify_observer_add(struct Notify *notify, enum NotifyType type, observer_t callback, void *global_data)
Add an observer to an object.
Definition: notify.c:173
Window has a fixed size.
Definition: mutt_window.h:45
struct MuttWindow * MessageWindow
Message Window, ":set", etc.
Definition: mutt_window.c:45
struct MuttWindow * RootWindow
Parent of all Windows.
Definition: mutt_window.c:43
#define MUTT_WIN_SIZE_UNLIMITED
Use as much space as possible.
Definition: mutt_window.h:50
const struct Mapping * help_data
Data for the Help Bar.
Definition: mutt_window.h:137
struct Notify * notify
Notifications handler.
Definition: neomutt.h:38
Container for All Dialogs (nested Windows)
Definition: mutt_window.h:72
struct MuttWindow * AllDialogsWindow
Parent of all Dialogs.
Definition: mutt_window.c:44
void mutt_window_add_child(struct MuttWindow *parent, struct MuttWindow *child)
Add a child to Window.
Definition: mutt_window.c:562
Config has changed, NotifyConfig, EventConfig.
Definition: notify_type.h:41
Text entry area.
Definition: keymap.h:77
void notify_set_parent(struct Notify *notify, struct Notify *parent)
Set the parent notification handler.
Definition: notify.c:82
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:39
struct MuttWindow * mutt_window_new(enum WindowType type, enum MuttWindowOrientation orient, enum MuttWindowSize size, int cols, int rows)
Create a new Window.
Definition: mutt_window.c:164
Window wants as much space as possible.
Definition: mutt_window.h:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_window_new()

struct MuttWindow* mutt_window_new ( enum WindowType  type,
enum MuttWindowOrientation  orient,
enum MuttWindowSize  size,
int  cols,
int  rows 
)

Create a new Window.

Parameters
typeWindow type, e.g. WT_ROOT
orientWindow orientation, e.g. MUTT_WIN_ORIENT_VERTICAL
sizeWindow size, e.g. MUTT_WIN_SIZE_MAXIMISE
colsInitial number of columns to allocate, can be MUTT_WIN_SIZE_UNLIMITED
rowsInitial number of rows to allocate, can be MUTT_WIN_SIZE_UNLIMITED
Return values
ptrNew Window

Definition at line 164 of file mutt_window.c.

166 {
167  struct MuttWindow *win = mutt_mem_calloc(1, sizeof(struct MuttWindow));
168 
169  win->type = type;
170  win->orient = orient;
171  win->size = size;
172  win->req_rows = rows;
173  win->req_cols = cols;
174  win->state.visible = true;
175  win->notify = notify_new();
176  TAILQ_INIT(&win->children);
177  return win;
178 }
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Definition: memory.c:50
enum MuttWindowOrientation orient
Which direction the Window will expand.
Definition: mutt_window.h:125
A division of the screen.
Definition: mutt_window.h:117
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
Definition: mutt_window.h:133
#define TAILQ_INIT(head)
Definition: queue.h:758
struct Notify * notify_new(void)
Create a new notifications handler.
Definition: notify.c:49
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:122
bool visible
Window is visible.
Definition: mutt_window.h:57
enum MuttWindowSize size
Type of Window, e.g. MUTT_WIN_SIZE_FIXED.
Definition: mutt_window.h:126
struct MuttWindowList children
Children Windows.
Definition: mutt_window.h:131
short req_rows
Number of rows required.
Definition: mutt_window.h:120
enum WindowType type
Window type, e.g. WT_SIDEBAR.
Definition: mutt_window.h:139
short req_cols
Number of columns required.
Definition: mutt_window.h:119
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_window_reflow()

void mutt_window_reflow ( struct MuttWindow win)

Resize a Window and its children.

Parameters
winWindow to resize

Definition at line 433 of file mutt_window.c.

434 {
435  if (OptNoCurses)
436  return;
437 
438  if (!win)
439  win = RootWindow;
440 
441  mutt_debug(LL_DEBUG2, "entering\n");
442  window_reflow(win);
443  window_notify_all(win);
444 
445 #ifdef USE_DEBUG_WINDOW
446  debug_win_dump();
447 #endif
448 }
WHERE bool OptNoCurses
(pseudo) when sending in batch mode
Definition: options.h:48
Log at debug level 2.
Definition: logging.h:41
void window_reflow(struct MuttWindow *win)
Reflow Windows.
Definition: reflow.c:222
struct MuttWindow * RootWindow
Parent of all Windows.
Definition: mutt_window.c:43
void window_notify_all(struct MuttWindow *win)
Notify observers of changes to a Window and its children.
Definition: mutt_window.c:127
void debug_win_dump(void)
Definition: window.c:90
#define mutt_debug(LEVEL,...)
Definition: logging.h:81
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_window_reflow_message_rows()

void mutt_window_reflow_message_rows ( int  mw_rows)

Resize the Message Window.

Parameters
mw_rowsNumber of rows required

Resize the other Windows to allow a multi-line message to be displayed.

Definition at line 456 of file mutt_window.c.

457 {
458  MessageWindow->req_rows = mw_rows;
460 
461  /* We don't also set REDRAW_FLOW because this function only
462  * changes rows and is a temporary adjustment. */
463  window_redraw(RootWindow, true);
464 }
struct MuttWindow * MessageWindow
Message Window, ":set", etc.
Definition: mutt_window.c:45
struct MuttWindow * RootWindow
Parent of all Windows.
Definition: mutt_window.c:43
void mutt_window_reflow(struct MuttWindow *win)
Resize a Window and its children.
Definition: mutt_window.c:433
struct MuttWindow * parent
Parent Window.
Definition: mutt_window.h:130
short req_rows
Number of rows required.
Definition: mutt_window.h:120
void window_redraw(struct MuttWindow *win, bool force)
Reflow, recalc and repaint a tree of Windows.
Definition: mutt_window.c:744
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_window_remove_child()

struct MuttWindow* mutt_window_remove_child ( struct MuttWindow parent,
struct MuttWindow child 
)

Remove a child from a Window.

Parameters
parentWindow to remove from
childWindow to remove

Definition at line 581 of file mutt_window.c.

582 {
583  if (!parent || !child)
584  return NULL;
585 
586  struct EventWindow ev_w = { child, WN_NO_FLAGS };
587  notify_send(child->notify, NT_WINDOW, NT_WINDOW_DELETE, &ev_w);
588 
589  TAILQ_REMOVE(&parent->children, child, entries);
590  child->parent = NULL;
591 
592  notify_set_parent(child->notify, NULL);
593 
594  return child;
595 }
An Event that happened to a Window.
Definition: mutt_window.h:193
#define WN_NO_FLAGS
No flags are set.
Definition: mutt_window.h:167
Window is about to be deleted.
Definition: mutt_window.h:184
MuttWindow has changed, NotifyWindow, EventWindow.
Definition: notify_type.h:51
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
Definition: mutt_window.h:133
#define TAILQ_REMOVE(head, elm, field)
Definition: queue.h:834
struct MuttWindow * parent
Parent Window.
Definition: mutt_window.h:130
struct MuttWindowList children
Children Windows.
Definition: mutt_window.h:131
void notify_set_parent(struct Notify *notify, struct Notify *parent)
Set the parent notification handler.
Definition: notify.c:82
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
Definition: notify.c:156
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_window_set_root()

void mutt_window_set_root ( int  cols,
int  rows 
)

Set the dimensions of the Root Window.

Parameters
rows
cols

Definition at line 621 of file mutt_window.c.

622 {
623  if (!RootWindow)
624  return;
625 
626  bool changed = false;
627 
628  if (RootWindow->state.rows != rows)
629  {
630  RootWindow->state.rows = rows;
631  changed = true;
632  }
633 
634  if (RootWindow->state.cols != cols)
635  {
636  RootWindow->state.cols = cols;
637  changed = true;
638  }
639 
640  if (changed)
641  {
643  }
644 }
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:58
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:122
struct MuttWindow * RootWindow
Parent of all Windows.
Definition: mutt_window.c:43
short rows
Number of rows, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:59
void mutt_window_reflow(struct MuttWindow *win)
Resize a Window and its children.
Definition: mutt_window.c:433
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_window_wrap_cols()

int mutt_window_wrap_cols ( int  width,
short  wrap 
)

Calculate the wrap column for a given screen width.

Parameters
widthScreen width
wrapWrap config
Return values
numColumn that text should be wrapped at

The wrap variable can be negative, meaning there should be a right margin.

Definition at line 474 of file mutt_window.c.

475 {
476  if (wrap < 0)
477  return (width > -wrap) ? (width + wrap) : width;
478  if (wrap)
479  return (wrap < width) ? wrap : width;
480  return width;
481 }
+ Here is the caller graph for this function:

◆ mutt_window_addch()

int mutt_window_addch ( int  ch)

Write one character to a Window.

Parameters
chCharacter to write
Return values
0Success
-1Error

Definition at line 489 of file mutt_window.c.

490 {
491  return addch(ch);
492 }
+ Here is the caller graph for this function:

◆ mutt_window_addnstr()

int mutt_window_addnstr ( const char *  str,
int  num 
)

Write a partial string to a Window.

Parameters
strString
numMaximum number of characters to write
Return values
0Success
-1Error

Definition at line 501 of file mutt_window.c.

502 {
503  if (!str)
504  return -1;
505 
506 #ifdef USE_SLANG_CURSES
507  return addnstr((char *) str, num);
508 #else
509  return addnstr(str, num);
510 #endif
511 }
+ Here is the caller graph for this function:

◆ mutt_window_addstr()

int mutt_window_addstr ( const char *  str)

Write a string to a Window.

Parameters
strString
Return values
0Success
-1Error

Definition at line 519 of file mutt_window.c.

520 {
521  if (!str)
522  return -1;
523 
524 #ifdef USE_SLANG_CURSES
525  return addstr((char *) str);
526 #else
527  return addstr(str);
528 #endif
529 }
+ Here is the caller graph for this function:

◆ mutt_window_clearline()

void mutt_window_clearline ( struct MuttWindow win,
int  row 
)

Clear a row of a Window.

Parameters
winWindow
rowRow to clear

Definition at line 230 of file mutt_window.c.

231 {
232  mutt_window_move(win, 0, row);
234 }
void mutt_window_clrtoeol(struct MuttWindow *win)
Clear to the end of the line.
Definition: mutt_window.c:242
int mutt_window_move(struct MuttWindow *win, int col, int row)
Move the cursor in a Window.
Definition: mutt_window.c:382
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_window_clear()

void mutt_window_clear ( struct MuttWindow win)

Clear a Window.

Parameters
winWindow

If the Window isn't visible, it won't be cleared.

Definition at line 822 of file mutt_window.c.

823 {
824  if (!mutt_window_is_visible(win))
825  return;
826 
827  for (int i = 0; i < win->state.rows; i++)
828  mutt_window_clearline(win, i);
829 }
void mutt_window_clearline(struct MuttWindow *win, int row)
Clear a row of a Window.
Definition: mutt_window.c:230
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:122
bool mutt_window_is_visible(struct MuttWindow *win)
Is the Window visible?
Definition: mutt_window.c:654
short rows
Number of rows, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:59
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_window_clrtoeol()

void mutt_window_clrtoeol ( struct MuttWindow win)

Clear to the end of the line.

Parameters
winWindow
Note
Assumes the cursor has already been positioned within the window.

Definition at line 242 of file mutt_window.c.

243 {
244  if (!win || !stdscr)
245  return;
246 
247  if (win->state.col_offset + win->state.cols == COLS)
248  clrtoeol();
249  else
250  {
251  int row = 0;
252  int col = 0;
253  getyx(stdscr, row, col);
254  int curcol = col;
255  while (curcol < (win->state.col_offset + win->state.cols))
256  {
257  addch(' ');
258  curcol++;
259  }
260  move(row, col);
261  }
262 }
short col_offset
Absolute on-screen column.
Definition: mutt_window.h:60
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:58
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:122
+ Here is the caller graph for this function:

◆ mutt_window_move()

int mutt_window_move ( struct MuttWindow win,
int  col,
int  row 
)

Move the cursor in a Window.

Parameters
winWindow
colColumn to move to
rowRow to move to
Return values
OKSuccess
ERRError

Definition at line 382 of file mutt_window.c.

383 {
384  return move(win->state.row_offset + row, win->state.col_offset + col);
385 }
short col_offset
Absolute on-screen column.
Definition: mutt_window.h:60
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:122
short row_offset
Absolute on-screen row.
Definition: mutt_window.h:61
+ Here is the caller graph for this function:

◆ mutt_window_move_abs()

void mutt_window_move_abs ( int  col,
int  row 
)

Move the cursor to an absolute screen position.

Parameters
colScreen column (0-based)
rowScreen row (0-based)

Definition at line 536 of file mutt_window.c.

537 {
538  move(row, col);
539 }
+ Here is the caller graph for this function:

◆ mutt_window_mvaddstr()

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.

Parameters
winWindow to write to
colColumn to move to
rowRow to move to
strString to write
Return values
OKSuccess
ERRError

Definition at line 396 of file mutt_window.c.

397 {
398 #ifdef USE_SLANG_CURSES
399  return mvaddstr(win->state.row_offset + row, win->state.col_offset + col, (char *) str);
400 #else
401  return mvaddstr(win->state.row_offset + row, win->state.col_offset + col, str);
402 #endif
403 }
short col_offset
Absolute on-screen column.
Definition: mutt_window.h:60
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:122
short row_offset
Absolute on-screen row.
Definition: mutt_window.h:61
+ Here is the caller graph for this function:

◆ mutt_window_mvprintw()

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.

Parameters
winWindow to write to
colColumn to move to
rowRow to move to
fmtprintf format string
...printf arguments
Return values
numSuccess, characters written
ERRError, move failed

Definition at line 415 of file mutt_window.c.

416 {
417  int rc = mutt_window_move(win, col, row);
418  if (rc == ERR)
419  return rc;
420 
421  va_list ap;
422  va_start(ap, fmt);
423  rc = vw_printw(stdscr, fmt, ap);
424  va_end(ap);
425 
426  return rc;
427 }
int mutt_window_move(struct MuttWindow *win, int col, int row)
Move the cursor in a Window.
Definition: mutt_window.c:382
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_window_printf()

int mutt_window_printf ( const char *  fmt,
  ... 
)

Write a formatted string to a Window.

Parameters
fmtFormat string
...Arguments
Return values
numNumber of characters written

Definition at line 547 of file mutt_window.c.

548 {
549  va_list ap;
550  va_start(ap, fmt);
551  int rc = vw_printw(stdscr, fmt, ap);
552  va_end(ap);
553 
554  return rc;
555 }
+ Here is the caller graph for this function:

◆ mutt_window_is_visible()

bool mutt_window_is_visible ( struct MuttWindow win)

Is the Window visible?

Parameters
winWindow
Return values
trueThe Window is visible

For a Window to be visible, it must be visible and it's parent and grandparent, etc.

Definition at line 654 of file mutt_window.c.

655 {
656  if (!win)
657  return false;
658 
659  for (; win; win = win->parent)
660  {
661  if (!win->state.visible)
662  return false;
663  }
664 
665  return true;
666 }
struct MuttWindow * win
Window that changed.
Definition: mutt_window.h:195
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:122
bool visible
Window is visible.
Definition: mutt_window.h:57
struct MuttWindow * parent
Parent Window.
Definition: mutt_window.h:130
+ Here is the caller graph for this function:

◆ mutt_winlist_free()

void mutt_winlist_free ( struct MuttWindowList *  head)

Free a tree of Windows.

Parameters
headWindowList to free

Definition at line 601 of file mutt_window.c.

602 {
603  if (!head)
604  return;
605 
606  struct MuttWindow *np = NULL;
607  struct MuttWindow *tmp = NULL;
608  TAILQ_FOREACH_SAFE(np, head, entries, tmp)
609  {
610  TAILQ_REMOVE(head, np, entries);
612  mutt_window_free(&np);
613  }
614 }
#define TAILQ_FOREACH_SAFE(var, head, field, tvar)
Definition: queue.h:728
A division of the screen.
Definition: mutt_window.h:117
void mutt_window_free(struct MuttWindow **ptr)
Free a Window and its children.
Definition: mutt_window.c:184
void mutt_winlist_free(struct MuttWindowList *head)
Free a tree of Windows.
Definition: mutt_window.c:601
#define TAILQ_REMOVE(head, elm, field)
Definition: queue.h:834
struct MuttWindowList children
Children Windows.
Definition: mutt_window.h:131
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_window_find()

struct MuttWindow* mutt_window_find ( struct MuttWindow root,
enum WindowType  type 
)

Find a Window of a given type.

Parameters
rootWindow to start searching
typeWindow type to find, e.g. WT_INDEX_BAR
Return values
ptrMatching Window
NULLNo match

Definition at line 675 of file mutt_window.c.

676 {
677  if (!root)
678  return NULL;
679  if (root->type == type)
680  return root;
681 
682  struct MuttWindow *np = NULL;
683  struct MuttWindow *match = NULL;
684  TAILQ_FOREACH(np, &root->children, entries)
685  {
686  match = mutt_window_find(np, type);
687  if (match)
688  return match;
689  }
690 
691  return NULL;
692 }
#define TAILQ_FOREACH(var, head, field)
Definition: queue.h:718
struct MuttWindow * mutt_window_find(struct MuttWindow *root, enum WindowType type)
Find a Window of a given type.
Definition: mutt_window.c:675
A division of the screen.
Definition: mutt_window.h:117
struct MuttWindowList children
Children Windows.
Definition: mutt_window.h:131
enum WindowType type
Window type, e.g. WT_SIDEBAR.
Definition: mutt_window.h:139
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ window_notify_all()

void window_notify_all ( struct MuttWindow win)

Notify observers of changes to a Window and its children.

Parameters
winWindow

Definition at line 127 of file mutt_window.c.

128 {
129  if (!win)
130  win = RootWindow;
131 
132  window_notify(win);
133 
134  struct MuttWindow *np = NULL;
135  TAILQ_FOREACH(np, &win->children, entries)
136  {
137  window_notify_all(np);
138  }
139  win->old = win->state;
140 }
#define TAILQ_FOREACH(var, head, field)
Definition: queue.h:718
A division of the screen.
Definition: mutt_window.h:117
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:122
struct MuttWindow * RootWindow
Parent of all Windows.
Definition: mutt_window.c:43
static void window_notify(struct MuttWindow *win)
Notify observers of changes to a Window.
Definition: mutt_window.c:89
struct WindowState old
Previous state of the Window.
Definition: mutt_window.h:123
void window_notify_all(struct MuttWindow *win)
Notify observers of changes to a Window and its children.
Definition: mutt_window.c:127
struct MuttWindowList children
Children Windows.
Definition: mutt_window.h:131
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ window_set_visible()

void window_set_visible ( struct MuttWindow win,
bool  visible 
)

Set a Window visible or hidden.

Parameters
winWindow
visibleIf true, make Window visible, otherwise hidden

Definition at line 147 of file mutt_window.c.

148 {
149  if (!win)
150  win = RootWindow;
151 
152  win->state.visible = visible;
153 }
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:122
struct MuttWindow * RootWindow
Parent of all Windows.
Definition: mutt_window.c:43
bool visible
Window is visible.
Definition: mutt_window.h:57
+ Here is the caller graph for this function:

◆ window_set_focus()

void window_set_focus ( struct MuttWindow win)

Set the Window focus.

Parameters
winWindow to focus

Definition at line 760 of file mutt_window.c.

761 {
762  if (!win)
763  return;
764 
765  struct MuttWindow *parent = win->parent;
766  struct MuttWindow *child = win;
767 
768  // Set the chain of focus, all the way to the root
769  for (; parent; child = parent, parent = parent->parent)
770  parent->focus = child;
771 
772  // Find the most focussed Window
773  while (win && win->focus)
774  win = win->focus;
775 
776  struct EventWindow ev_w = { win, WN_NO_FLAGS };
778 #ifdef USE_DEBUG_WINDOW
779  debug_win_dump();
780 #endif
781 }
struct MuttWindow * win
Window that changed.
Definition: mutt_window.h:195
An Event that happened to a Window.
Definition: mutt_window.h:193
#define WN_NO_FLAGS
No flags are set.
Definition: mutt_window.h:167
Window focus has changed.
Definition: mutt_window.h:187
A division of the screen.
Definition: mutt_window.h:117
MuttWindow has changed, NotifyWindow, EventWindow.
Definition: notify_type.h:51
struct MuttWindow * focus
Focussed Window.
Definition: mutt_window.h:135
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
Definition: mutt_window.h:133
struct MuttWindow * parent
Parent Window.
Definition: mutt_window.h:130
void debug_win_dump(void)
Definition: window.c:90
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
Definition: notify.c:156
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ window_get_focus()

struct MuttWindow* window_get_focus ( void  )

Get the currently focussed Window.

Return values
ptrWindow with focus

Definition at line 787 of file mutt_window.c.

788 {
789  struct MuttWindow *win = RootWindow;
790 
791  while (win && win->focus)
792  win = win->focus;
793 
794  return win;
795 }
A division of the screen.
Definition: mutt_window.h:117
struct MuttWindow * focus
Focussed Window.
Definition: mutt_window.h:135
struct MuttWindow * RootWindow
Parent of all Windows.
Definition: mutt_window.c:43
+ Here is the caller graph for this function:

◆ window_get_dialog()

struct MuttWindow* window_get_dialog ( void  )

Get the currently active Dialog.

Return values
ptrActive Dialog

Definition at line 801 of file mutt_window.c.

802 {
803  if (!AllDialogsWindow)
804  return NULL;
805 
806  struct MuttWindow *np = NULL;
807  TAILQ_FOREACH(np, &AllDialogsWindow->children, entries)
808  {
809  if (mutt_window_is_visible(np))
810  return np;
811  }
812 
813  return NULL;
814 }
#define TAILQ_FOREACH(var, head, field)
Definition: queue.h:718
A division of the screen.
Definition: mutt_window.h:117
bool mutt_window_is_visible(struct MuttWindow *win)
Is the Window visible?
Definition: mutt_window.c:654
struct MuttWindow * AllDialogsWindow
Parent of all Dialogs.
Definition: mutt_window.c:44
struct MuttWindowList children
Children Windows.
Definition: mutt_window.h:131
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ window_redraw()

void window_redraw ( struct MuttWindow win,
bool  force 
)

Reflow, recalc and repaint a tree of Windows.

Parameters
winWindow to start at
forceRepaint everything

Definition at line 744 of file mutt_window.c.

745 {
746  if (!win)
747  return;
748 
749  window_reflow(win);
750  window_notify_all(win);
751 
752  window_recalc(win);
753  window_repaint(win, force);
754 }
static void window_repaint(struct MuttWindow *win, bool force)
Repaint a tree of Windows.
Definition: mutt_window.c:721
void window_reflow(struct MuttWindow *win)
Reflow Windows.
Definition: reflow.c:222
static void window_recalc(struct MuttWindow *win)
Recalculate a tree of Windows.
Definition: mutt_window.c:698
void window_notify_all(struct MuttWindow *win)
Notify observers of changes to a Window and its children.
Definition: mutt_window.c:127
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ RootWindow

struct MuttWindow* RootWindow

Parent of all Windows.

Definition at line 43 of file mutt_window.c.

◆ AllDialogsWindow

struct MuttWindow* AllDialogsWindow

Parent of all Dialogs.

Definition at line 44 of file mutt_window.c.

◆ MessageWindow

struct MuttWindow* MessageWindow

Message Window, ":set", etc.

Definition at line 45 of file mutt_window.c.