NeoMutt  2020-06-26-89-g172cd3
Teaching an old dog new tricks
DOXYGEN
mutt_window.h File Reference

Window management. More...

#include "config.h"
#include <stdbool.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_PGP, WT_DLG_POSTPONE, WT_DLG_QUERY,
  WT_DLG_REMAILER, WT_DLG_SMIME, WT_CUSTOM, WT_HELP_BAR,
  WT_INDEX, WT_INDEX_BAR, 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 }
 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_copy_size (const struct MuttWindow *win_src, struct MuttWindow *win_dst)
 Copy the size of one Window to another. 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_clrtobot (void)
 Clear to the bottom of the 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...
 
struct MuttWindowmutt_window_dialog (struct MuttWindow *win)
 Find the parent Dialog of a Window. 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 (and its children) visible or hidden. More...
 
void dialog_pop (void)
 Hide a Window from the user. More...
 
void dialog_push (struct MuttWindow *dlg)
 Display a Window to the user. More...
 
void window_redraw (struct MuttWindow *win)
 Reflow, recalc and repaint a tree of Windows. More...
 

Variables

struct MuttWindowMuttDialogWindow
 Parent of all Dialogs. More...
 
struct MuttWindowMuttHelpWindow
 Help Window. More...
 
struct MuttWindowMuttMessageWindow
 Message Window. 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 49 of file mutt_window.h.

◆ WA_NO_FLAGS

#define WA_NO_FLAGS   0

No flags are set.

Definition at line 104 of file mutt_window.h.

◆ WA_REFLOW

#define WA_REFLOW   (1 << 0)

Reflow the Window and its children.

Definition at line 105 of file mutt_window.h.

◆ WA_RECALC

#define WA_RECALC   (1 << 1)

Recalculate the contents of the Window.

Definition at line 106 of file mutt_window.h.

◆ WA_REPAINT

#define WA_REPAINT   (1 << 2)

Redraw the contents of the Window.

Definition at line 107 of file mutt_window.h.

◆ WN_NO_FLAGS

#define WN_NO_FLAGS   0

No flags are set.

Definition at line 152 of file mutt_window.h.

◆ WN_TALLER

#define WN_TALLER   (1 << 0)

Window became taller.

Definition at line 153 of file mutt_window.h.

◆ WN_SHORTER

#define WN_SHORTER   (1 << 1)

Window became shorter.

Definition at line 154 of file mutt_window.h.

◆ WN_WIDER

#define WN_WIDER   (1 << 2)

Window became wider.

Definition at line 155 of file mutt_window.h.

◆ WN_NARROWER

#define WN_NARROWER   (1 << 3)

Window became narrower.

Definition at line 156 of file mutt_window.h.

◆ WN_MOVED

#define WN_MOVED   (1 << 4)

Window moved.

Definition at line 157 of file mutt_window.h.

◆ WN_VISIBLE

#define WN_VISIBLE   (1 << 5)

Window became visible.

Definition at line 158 of file mutt_window.h.

◆ WN_HIDDEN

#define WN_HIDDEN   (1 << 6)

Window became hidden.

Definition at line 159 of file mutt_window.h.

Typedef Documentation

◆ WindowActionFlags

typedef uint8_t WindowActionFlags

Actions waiting to be performed on a MuttWindow.

Definition at line 103 of file mutt_window.h.

◆ WindowNotifyFlags

typedef uint8_t WindowNotifyFlags

Changes to a MuttWindow.

Definition at line 151 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 33 of file mutt_window.h.

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

◆ 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 42 of file mutt_window.h.

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

◆ 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, alias_menu()

WT_DLG_ATTACH 

Attach Dialog, mutt_view_attachments()

WT_DLG_AUTOCRYPT 

Autocrypt Dialog, mutt_autocrypt_account_menu()

WT_DLG_BROWSER 

Browser Dialog, mutt_buffer_select_file()

WT_DLG_CERTIFICATE 

Certificate Dialog, dlg_verify_cert()

WT_DLG_COMPOSE 

Compose Dialog, mutt_compose_menu()

WT_DLG_CRYPT_GPGME 

Crypt-GPGME Dialog, crypt_select_key()

WT_DLG_DO_PAGER 

Pager Dialog, mutt_do_pager()

WT_DLG_HISTORY 

History Dialog, history_menu()

WT_DLG_INDEX 

Index Dialog, index_pager_init()

WT_DLG_PGP 

Pgp Dialog, pgp_select_key()

WT_DLG_POSTPONE 

Postpone Dialog, select_msg()

WT_DLG_QUERY 

Query Dialog, query_menu()

WT_DLG_REMAILER 

Remailer Dialog, mix_make_chain()

WT_DLG_SMIME 

Smime Dialog, smime_select_key()

WT_CUSTOM 

Window with a custom drawing function.

WT_HELP_BAR 

Help Bar containing list of useful key bindings.

WT_INDEX 

An Index Window containing a selection list.

WT_INDEX_BAR 

Index Bar containing status info about the Index.

WT_MESSAGE 

Window for messages/errors and command entry.

WT_PAGER 

Window containing paged free-form text.

WT_PAGER_BAR 

Pager Bar containing status info about the Pager.

WT_SIDEBAR 

Side panel containing Accounts or groups of data.

Definition at line 66 of file mutt_window.h.

67 {
68  // Structural Windows
69  WT_ROOT,
70  WT_CONTAINER,
72 
73  // Dialogs (nested Windows) displayed to the user
74  WT_DLG_ALIAS,
83  WT_DLG_INDEX,
84  WT_DLG_PGP,
86  WT_DLG_QUERY,
88  WT_DLG_SMIME,
89 
90  // Common Windows
91  WT_CUSTOM,
92  WT_HELP_BAR,
93  WT_INDEX,
94  WT_INDEX_BAR,
95  WT_MESSAGE,
96  WT_PAGER,
97  WT_PAGER_BAR,
98  WT_SIDEBAR,
99 };
History Dialog, history_menu()
Definition: mutt_window.h:82
Pager Bar containing status info about the Pager.
Definition: mutt_window.h:97
Crypt-GPGME Dialog, crypt_select_key()
Definition: mutt_window.h:80
Window for messages/errors and command entry.
Definition: mutt_window.h:95
Attach Dialog, mutt_view_attachments()
Definition: mutt_window.h:75
Pgp Dialog, pgp_select_key()
Definition: mutt_window.h:84
Query Dialog, query_menu()
Definition: mutt_window.h:86
Invisible shaping container Window.
Definition: mutt_window.h:70
Parent of All Windows.
Definition: mutt_window.h:69
An Index Window containing a selection list.
Definition: mutt_window.h:93
Window with a custom drawing function.
Definition: mutt_window.h:91
Browser Dialog, mutt_buffer_select_file()
Definition: mutt_window.h:77
Autocrypt Dialog, mutt_autocrypt_account_menu()
Definition: mutt_window.h:76
Side panel containing Accounts or groups of data.
Definition: mutt_window.h:98
Help Bar containing list of useful key bindings.
Definition: mutt_window.h:92
Pager Dialog, mutt_do_pager()
Definition: mutt_window.h:81
Container for All Dialogs (nested Windows)
Definition: mutt_window.h:71
Window containing paged free-form text.
Definition: mutt_window.h:96
Smime Dialog, smime_select_key()
Definition: mutt_window.h:88
Compose Dialog, mutt_compose_menu()
Definition: mutt_window.h:79
Postpone Dialog, select_msg()
Definition: mutt_window.h:85
Index Dialog, index_pager_init()
Definition: mutt_window.h:83
Certificate Dialog, dlg_verify_cert()
Definition: mutt_window.h:78
Index Bar containing status info about the Index.
Definition: mutt_window.h:94
Alias Dialog, alias_menu()
Definition: mutt_window.h:74
Remailer Dialog, mix_make_chain()
Definition: mutt_window.h:87

◆ 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.

Definition at line 166 of file mutt_window.h.

167 {
168  NT_WINDOW_NEW = 1,
172 };
A new Dialog Window has been created, e.g. WT_DLG_INDEX.
Definition: mutt_window.h:171
Window is about to be deleted.
Definition: mutt_window.h:169
New Window has been added.
Definition: mutt_window.h:168
Window state has changed, e.g. WN_VISIBLE.
Definition: mutt_window.h:170

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 561 of file mutt_window.c.

562 {
563  if (!parent || !child)
564  return;
565 
566  TAILQ_INSERT_TAIL(&parent->children, child, entries);
567  child->parent = parent;
568 
569  notify_set_parent(child->notify, parent->notify);
570 
571  struct EventWindow ev_w = { child, WN_NO_FLAGS };
572  notify_send(child->notify, NT_WINDOW, NT_WINDOW_NEW, &ev_w);
573 }
An Event that happened to a Window.
Definition: mutt_window.h:177
#define WN_NO_FLAGS
No flags are set.
Definition: mutt_window.h:152
MuttWindow has changed, NotifyWindow, EventWindow.
Definition: notify_type.h:41
struct Notify * notify
Notifications system.
Definition: mutt_window.h:130
New Window has been added.
Definition: mutt_window.h:168
#define TAILQ_INSERT_TAIL(head, elm, field)
Definition: queue.h:802
struct MuttWindow * parent
Parent Window.
Definition: mutt_window.h:127
struct MuttWindowList children
Children Windows.
Definition: mutt_window.h:128
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:137
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_window_copy_size()

void mutt_window_copy_size ( const struct MuttWindow win_src,
struct MuttWindow win_dst 
)

Copy the size of one Window to another.

Parameters
win_srcWindow to copy
win_dstWindow to resize

Definition at line 414 of file mutt_window.c.

415 {
416  if (!win_src || !win_dst)
417  return;
418 
419  win_dst->state.rows = win_src->state.rows;
420  win_dst->state.cols = win_src->state.cols;
421  win_dst->state.row_offset = win_src->state.row_offset;
422  win_dst->state.col_offset = win_src->state.col_offset;
423 }
short col_offset
Absolute on-screen column.
Definition: mutt_window.h:59
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:57
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:119
short row_offset
Absolute on-screen row.
Definition: mutt_window.h:60
short rows
Number of rows, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:58

◆ mutt_window_free()

void mutt_window_free ( struct MuttWindow **  ptr)

Free a Window and its children.

Parameters
ptrWindow to free

Definition at line 151 of file mutt_window.c.

152 {
153  if (!ptr || !*ptr)
154  return;
155 
156  struct MuttWindow *win = *ptr;
157 
158  struct EventWindow ev_w = { win, WN_NO_FLAGS };
160 
162 
163  if (win->wdata && win->wdata_free)
164  win->wdata_free(win, &win->wdata); // Custom function to free private data
165 
166  notify_free(&win->notify);
167 
168  FREE(ptr);
169 }
void(* wdata_free)(struct MuttWindow *win, void **ptr)
Callback function to free private data.
Definition: mutt_window.h:134
struct MuttWindow * win
Window that changed.
Definition: mutt_window.h:179
An Event that happened to a Window.
Definition: mutt_window.h:177
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:152
Window is about to be deleted.
Definition: mutt_window.h:169
A division of the screen.
Definition: mutt_window.h:114
MuttWindow has changed, NotifyWindow, EventWindow.
Definition: notify_type.h:41
struct Notify * notify
Notifications system.
Definition: mutt_window.h:130
void mutt_winlist_free(struct MuttWindowList *head)
Free a tree of Windows.
Definition: mutt_window.c:600
#define FREE(x)
Definition: memory.h:40
struct MuttWindowList children
Children Windows.
Definition: mutt_window.h:128
void * wdata
Private data.
Definition: mutt_window.h:133
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
Definition: notify.c:137
+ 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 283 of file mutt_window.c.

284 {
285  if (NeoMutt)
287  MuttDialogWindow = NULL;
288  MuttHelpWindow = NULL;
289  MuttMessageWindow = NULL;
291 }
static int mutt_dlg_rootwin_observer(struct NotifyCallback *nc)
Listen for config changes affecting the Root Window - Implements observer_t.
Definition: mutt_window.c:241
struct MuttWindow * MuttHelpWindow
Help Window.
Definition: mutt_window.c:45
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:151
struct MuttWindow * RootWindow
Parent of all Windows.
Definition: mutt_window.c:43
struct Notify * notify
Notifications handler.
Definition: neomutt.h:38
bool notify_observer_remove(struct Notify *notify, observer_t callback, void *global_data)
Remove an observer from an object.
Definition: notify.c:185
struct MuttWindow * MuttMessageWindow
Message Window.
Definition: mutt_window.c:46
struct MuttWindow * MuttDialogWindow
Parent of all Dialogs.
Definition: mutt_window.c:44
+ 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 302 of file mutt_window.c.

303 {
304  int x = 0;
305  int y = 0;
306 
307  getyx(stdscr, y, x);
308  if (col)
309  *col = x - win->state.col_offset;
310  if (row)
311  *row = y - win->state.row_offset;
312 }
short col_offset
Absolute on-screen column.
Definition: mutt_window.h:59
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:119
short row_offset
Absolute on-screen row.
Definition: mutt_window.h:60
+ 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 319 of file mutt_window.c.

320 {
321  if (RootWindow)
322  return;
323 
324  RootWindow =
327 
331 
335 
338 
339  if (C_StatusOnTop)
340  {
343  }
344  else
345  {
348  }
349 
352 }
static int mutt_dlg_rootwin_observer(struct NotifyCallback *nc)
Listen for config changes affecting the Root Window - Implements observer_t.
Definition: mutt_window.c:241
Window for messages/errors and command entry.
Definition: mutt_window.h:95
Window uses all available vertical space.
Definition: mutt_window.h:35
Parent of All Windows.
Definition: mutt_window.h:69
struct MuttWindow * MuttHelpWindow
Help Window.
Definition: mutt_window.c:45
Container for Accounts, Notifications.
Definition: neomutt.h:36
struct Notify * notify
Notifications system.
Definition: mutt_window.h:130
Window has a fixed size.
Definition: mutt_window.h:44
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:119
struct MuttWindow * RootWindow
Parent of all Windows.
Definition: mutt_window.c:43
bool visible
Window is visible.
Definition: mutt_window.h:56
#define MUTT_WIN_SIZE_UNLIMITED
Use as much space as possible.
Definition: mutt_window.h:49
Help Bar containing list of useful key bindings.
Definition: mutt_window.h:92
struct Notify * notify
Notifications handler.
Definition: neomutt.h:38
Container for All Dialogs (nested Windows)
Definition: mutt_window.h:71
bool notify_observer_add(struct Notify *notify, observer_t callback, void *global_data)
Add an observer to an object.
Definition: notify.c:153
void mutt_window_add_child(struct MuttWindow *parent, struct MuttWindow *child)
Add a child to Window.
Definition: mutt_window.c:561
WHERE bool C_StatusOnTop
Config: Display the status bar at the top.
Definition: mutt_globals.h:166
void notify_set_parent(struct Notify *notify, struct Notify *parent)
Set the parent notification handler.
Definition: notify.c:82
struct MuttWindow * MuttMessageWindow
Message Window.
Definition: mutt_window.c:46
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:131
Window wants as much space as possible.
Definition: mutt_window.h:45
struct MuttWindow * MuttDialogWindow
Parent of all Dialogs.
Definition: mutt_window.c:44
WHERE bool C_Help
Config: Display a help line with common key bindings.
Definition: mutt_globals.h:153
+ 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 131 of file mutt_window.c.

133 {
134  struct MuttWindow *win = mutt_mem_calloc(1, sizeof(struct MuttWindow));
135 
136  win->type = type;
137  win->orient = orient;
138  win->size = size;
139  win->req_rows = rows;
140  win->req_cols = cols;
141  win->state.visible = true;
142  win->notify = notify_new();
143  TAILQ_INIT(&win->children);
144  return win;
145 }
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:122
A division of the screen.
Definition: mutt_window.h:114
struct Notify * notify
Notifications system.
Definition: mutt_window.h:130
#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:119
bool visible
Window is visible.
Definition: mutt_window.h:56
enum MuttWindowSize size
Type of Window, e.g. MUTT_WIN_SIZE_FIXED.
Definition: mutt_window.h:123
struct MuttWindowList children
Children Windows.
Definition: mutt_window.h:128
short req_rows
Number of rows required.
Definition: mutt_window.h:117
enum WindowType type
Window type, e.g. WT_SIDEBAR.
Definition: mutt_window.h:132
short req_cols
Number of columns required.
Definition: mutt_window.h:116
+ 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 429 of file mutt_window.c.

430 {
431  if (OptNoCurses)
432  return;
433 
434  if (!win)
435  win = RootWindow;
436 
437  mutt_debug(LL_DEBUG2, "entering\n");
438  window_reflow(win);
439  window_notify_all(win);
440 
442  /* the pager menu needs this flag set to recalc line_info */
444 #ifdef USE_DEBUG_WINDOW
445  debug_win_dump();
446 #endif
447 }
#define REDRAW_FLOW
Used by pager to reflow text.
Definition: mutt_menu.h:47
WHERE bool OptNoCurses
(pseudo) when sending in batch mode
Definition: options.h:48
void window_reflow(struct MuttWindow *win)
Reflow Windows.
Definition: reflow.c:222
Log at debug level 2.
Definition: logging.h:41
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:89
void debug_win_dump(void)
Definition: window.c:87
#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 455 of file mutt_window.c.

456 {
457  MuttMessageWindow->req_rows = mw_rows;
459 
460  /* We don't also set REDRAW_FLOW because this function only
461  * changes rows and is a temporary adjustment. */
463 }
void mutt_window_reflow(struct MuttWindow *win)
Resize a Window and its children.
Definition: mutt_window.c:429
struct MuttWindow * parent
Parent Window.
Definition: mutt_window.h:127
short req_rows
Number of rows required.
Definition: mutt_window.h:117
struct MuttWindow * MuttMessageWindow
Message Window.
Definition: mutt_window.c:46
+ 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 580 of file mutt_window.c.

581 {
582  if (!parent || !child)
583  return NULL;
584 
585  struct EventWindow ev_w = { child, WN_NO_FLAGS };
586  notify_send(child->notify, NT_WINDOW, NT_WINDOW_DELETE, &ev_w);
587 
588  TAILQ_REMOVE(&parent->children, child, entries);
589  child->parent = NULL;
590 
591  notify_set_parent(child->notify, NULL);
592 
593  return child;
594 }
An Event that happened to a Window.
Definition: mutt_window.h:177
#define WN_NO_FLAGS
No flags are set.
Definition: mutt_window.h:152
Window is about to be deleted.
Definition: mutt_window.h:169
MuttWindow has changed, NotifyWindow, EventWindow.
Definition: notify_type.h:41
struct Notify * notify
Notifications system.
Definition: mutt_window.h:130
#define TAILQ_REMOVE(head, elm, field)
Definition: queue.h:834
struct MuttWindow * parent
Parent Window.
Definition: mutt_window.h:127
struct MuttWindowList children
Children Windows.
Definition: mutt_window.h:128
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:137
+ 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 620 of file mutt_window.c.

621 {
622  if (!RootWindow)
623  return;
624 
625  bool changed = false;
626 
627  if (RootWindow->state.rows != rows)
628  {
629  RootWindow->state.rows = rows;
630  changed = true;
631  }
632 
633  if (RootWindow->state.cols != cols)
634  {
635  RootWindow->state.cols = cols;
636  changed = true;
637  }
638 
639  if (changed)
640  {
642  }
643 }
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:57
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:119
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:58
void mutt_window_reflow(struct MuttWindow *win)
Resize a Window and its children.
Definition: mutt_window.c:429
+ 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 473 of file mutt_window.c.

474 {
475  if (wrap < 0)
476  return (width > -wrap) ? (width + wrap) : width;
477  if (wrap)
478  return (wrap < width) ? wrap : width;
479  return width;
480 }
+ 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 488 of file mutt_window.c.

489 {
490  return addch(ch);
491 }
+ 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 500 of file mutt_window.c.

501 {
502  if (!str)
503  return -1;
504 
505 #ifdef USE_SLANG_CURSES
506  return addnstr((char *) str, num);
507 #else
508  return addnstr(str, num);
509 #endif
510 }
+ 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 518 of file mutt_window.c.

519 {
520  if (!str)
521  return -1;
522 
523 #ifdef USE_SLANG_CURSES
524  return addstr((char *) str);
525 #else
526  return addstr(str);
527 #endif
528 }
+ 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 194 of file mutt_window.c.

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

◆ mutt_window_clrtobot()

void mutt_window_clrtobot ( void  )

Clear to the bottom of the Window.

Note
Assumes the cursor has already been positioned within the Window.

Definition at line 205 of file mutt_window.c.

206 {
207  clrtobot();
208 }
+ 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 216 of file mutt_window.c.

217 {
218  if (!win || !stdscr)
219  return;
220 
221  if (win->state.col_offset + win->state.cols == COLS)
222  clrtoeol();
223  else
224  {
225  int row = 0;
226  int col = 0;
227  getyx(stdscr, row, col);
228  int curcol = col;
229  while (curcol < (win->state.col_offset + win->state.cols))
230  {
231  addch(' ');
232  curcol++;
233  }
234  move(row, col);
235  }
236 }
short col_offset
Absolute on-screen column.
Definition: mutt_window.h:59
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:57
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:119
+ 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 362 of file mutt_window.c.

363 {
364  return move(win->state.row_offset + row, win->state.col_offset + col);
365 }
short col_offset
Absolute on-screen column.
Definition: mutt_window.h:59
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:119
short row_offset
Absolute on-screen row.
Definition: mutt_window.h:60
+ 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 535 of file mutt_window.c.

536 {
537  move(row, col);
538 }
+ 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 376 of file mutt_window.c.

377 {
378 #ifdef USE_SLANG_CURSES
379  return mvaddstr(win->state.row_offset + row, win->state.col_offset + col, (char *) str);
380 #else
381  return mvaddstr(win->state.row_offset + row, win->state.col_offset + col, str);
382 #endif
383 }
short col_offset
Absolute on-screen column.
Definition: mutt_window.h:59
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:119
short row_offset
Absolute on-screen row.
Definition: mutt_window.h:60
+ 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 395 of file mutt_window.c.

396 {
397  int rc = mutt_window_move(win, col, row);
398  if (rc == ERR)
399  return rc;
400 
401  va_list ap;
402  va_start(ap, fmt);
403  rc = vw_printw(stdscr, fmt, ap);
404  va_end(ap);
405 
406  return rc;
407 }
static int const char * fmt
Definition: acutest.h:488
int mutt_window_move(struct MuttWindow *win, int col, int row)
Move the cursor in a Window.
Definition: mutt_window.c:362
va_start(args, fmt)
va_end(args)
+ 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 546 of file mutt_window.c.

547 {
548  va_list ap;
549  va_start(ap, fmt);
550  int rc = vw_printw(stdscr, fmt, ap);
551  va_end(ap);
552 
553  return rc;
554 }
static int const char * fmt
Definition: acutest.h:488
va_start(args, fmt)
va_end(args)
+ Here is the call graph for this function:
+ 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
trueIf the Window is visible

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

Definition at line 653 of file mutt_window.c.

654 {
655  if (!win)
656  return false;
657 
658  for (; win; win = win->parent)
659  {
660  if (!win->state.visible)
661  return false;
662  }
663 
664  return true;
665 }
struct MuttWindow * win
Window that changed.
Definition: mutt_window.h:179
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:119
bool visible
Window is visible.
Definition: mutt_window.h:56
struct MuttWindow * parent
Parent Window.
Definition: mutt_window.h:127
+ 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 600 of file mutt_window.c.

601 {
602  if (!head)
603  return;
604 
605  struct MuttWindow *np = NULL;
606  struct MuttWindow *tmp = NULL;
607  TAILQ_FOREACH_SAFE(np, head, entries, tmp)
608  {
609  TAILQ_REMOVE(head, np, entries);
611  mutt_window_free(&np);
612  }
613 }
#define TAILQ_FOREACH_SAFE(var, head, field, tvar)
Definition: queue.h:728
A division of the screen.
Definition: mutt_window.h:114
void mutt_window_free(struct MuttWindow **ptr)
Free a Window and its children.
Definition: mutt_window.c:151
void mutt_winlist_free(struct MuttWindowList *head)
Free a tree of Windows.
Definition: mutt_window.c:600
#define TAILQ_REMOVE(head, elm, field)
Definition: queue.h:834
struct MuttWindowList children
Children Windows.
Definition: mutt_window.h:128
+ 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 692 of file mutt_window.c.

693 {
694  if (!root)
695  return NULL;
696  if (root->type == type)
697  return root;
698 
699  struct MuttWindow *np = NULL;
700  struct MuttWindow *match = NULL;
701  TAILQ_FOREACH(np, &root->children, entries)
702  {
703  match = mutt_window_find(np, type);
704  if (match)
705  return match;
706  }
707 
708  return NULL;
709 }
#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:692
A division of the screen.
Definition: mutt_window.h:114
struct MuttWindowList children
Children Windows.
Definition: mutt_window.h:128
enum WindowType type
Window type, e.g. WT_SIDEBAR.
Definition: mutt_window.h:132
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_window_dialog()

struct MuttWindow* mutt_window_dialog ( struct MuttWindow win)

Find the parent Dialog of a Window.

Parameters
winWindow
Return values
ptrDialog

Dialog Windows will be owned by a MuttWindow of type WT_ALL_DIALOGS.

Definition at line 674 of file mutt_window.c.

675 {
676  for (; win && win->parent; win = win->parent)
677  {
678  if (win->parent->type == WT_ALL_DIALOGS)
679  return win;
680  }
681 
682  return NULL;
683 }
Container for All Dialogs (nested Windows)
Definition: mutt_window.h:71
struct MuttWindow * parent
Parent Window.
Definition: mutt_window.h:127
enum WindowType type
Window type, e.g. WT_SIDEBAR.
Definition: mutt_window.h:132
+ 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 89 of file mutt_window.c.

90 {
91  if (!win)
92  win = RootWindow;
93 
94  window_notify(win);
95 
96  struct MuttWindow *np = NULL;
97  TAILQ_FOREACH(np, &win->children, entries)
98  {
100  }
101 }
#define TAILQ_FOREACH(var, head, field)
Definition: queue.h:718
A division of the screen.
Definition: mutt_window.h:114
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:52
void window_notify_all(struct MuttWindow *win)
Notify observers of changes to a Window and its children.
Definition: mutt_window.c:89
struct MuttWindowList children
Children Windows.
Definition: mutt_window.h:128
+ 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 (and its children) visible or hidden.

Parameters
winWindow
visibleIf true, make Window visible, otherwise hidden

Definition at line 108 of file mutt_window.c.

109 {
110  if (!win)
111  win = RootWindow;
112 
113  win->state.visible = visible;
114 
115  struct MuttWindow *np = NULL;
116  TAILQ_FOREACH(np, &win->children, entries)
117  {
118  window_set_visible(np, visible);
119  }
120 }
#define TAILQ_FOREACH(var, head, field)
Definition: queue.h:718
A division of the screen.
Definition: mutt_window.h:114
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:119
struct MuttWindow * RootWindow
Parent of all Windows.
Definition: mutt_window.c:43
bool visible
Window is visible.
Definition: mutt_window.h:56
void window_set_visible(struct MuttWindow *win, bool visible)
Set a Window (and its children) visible or hidden.
Definition: mutt_window.c:108
struct MuttWindowList children
Children Windows.
Definition: mutt_window.h:128
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dialog_pop()

void dialog_pop ( void  )

Hide a Window from the user.

The topmost (visible) Window is removed from the stack and the next Window is marked as visible.

Definition at line 750 of file mutt_window.c.

751 {
752  if (!MuttDialogWindow)
753  return;
754 
755  struct MuttWindow *last = TAILQ_LAST(&MuttDialogWindow->children, MuttWindowList);
756  if (!last)
757  return;
758 
759  // Notify the world, allowing plugins to clean up
760  struct EventWindow ev_w = { last, WN_HIDDEN };
762 
763  last->state.visible = false;
764  last->parent = NULL;
765  TAILQ_REMOVE(&MuttDialogWindow->children, last, entries);
766 
767  last = TAILQ_LAST(&MuttDialogWindow->children, MuttWindowList);
768  if (last)
769  {
770  last->state.visible = true;
772  }
774 #ifdef USE_DEBUG_WINDOW
775  debug_win_dump();
776 #endif
777 }
#define REDRAW_FULL
Redraw everything.
Definition: mutt_menu.h:45
A new Dialog Window has been created, e.g. WT_DLG_INDEX.
Definition: mutt_window.h:171
An Event that happened to a Window.
Definition: mutt_window.h:177
#define TAILQ_LAST(head, headname)
Definition: queue.h:812
#define WN_HIDDEN
Window became hidden.
Definition: mutt_window.h:159
A division of the screen.
Definition: mutt_window.h:114
MuttWindow has changed, NotifyWindow, EventWindow.
Definition: notify_type.h:41
struct Notify * notify
Notifications system.
Definition: mutt_window.h:130
#define TAILQ_REMOVE(head, elm, field)
Definition: queue.h:834
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:119
bool visible
Window is visible.
Definition: mutt_window.h:56
void mutt_window_reflow(struct MuttWindow *win)
Resize a Window and its children.
Definition: mutt_window.c:429
struct MuttWindow * parent
Parent Window.
Definition: mutt_window.h:127
struct MuttWindowList children
Children Windows.
Definition: mutt_window.h:128
void debug_win_dump(void)
Definition: window.c:87
struct MuttWindow * MuttDialogWindow
Parent of all Dialogs.
Definition: mutt_window.c:44
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
Definition: notify.c:137
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dialog_push()

void dialog_push ( struct MuttWindow dlg)

Display a Window to the user.

Parameters
dlgWindow to display

The Dialog Windows are kept in a stack. The topmost is visible to the user, whilst the others are hidden.

When a Window is pushed, the old Window is marked as not visible.

Definition at line 720 of file mutt_window.c.

721 {
722  if (!dlg || !MuttDialogWindow)
723  return;
724 
725  struct MuttWindow *last = TAILQ_LAST(&MuttDialogWindow->children, MuttWindowList);
726  if (last)
727  last->state.visible = false;
728 
731 
732  // Notify the world, allowing plugins to integrate
733  struct EventWindow ev_w = { dlg, WN_VISIBLE };
735 
736  dlg->state.visible = true;
737  dlg->parent = MuttDialogWindow;
739 #ifdef USE_DEBUG_WINDOW
740  debug_win_dump();
741 #endif
742 }
A new Dialog Window has been created, e.g. WT_DLG_INDEX.
Definition: mutt_window.h:171
An Event that happened to a Window.
Definition: mutt_window.h:177
#define TAILQ_LAST(head, headname)
Definition: queue.h:812
A division of the screen.
Definition: mutt_window.h:114
MuttWindow has changed, NotifyWindow, EventWindow.
Definition: notify_type.h:41
struct Notify * notify
Notifications system.
Definition: mutt_window.h:130
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:119
bool visible
Window is visible.
Definition: mutt_window.h:56
#define TAILQ_INSERT_TAIL(head, elm, field)
Definition: queue.h:802
void mutt_window_reflow(struct MuttWindow *win)
Resize a Window and its children.
Definition: mutt_window.c:429
struct MuttWindow * parent
Parent Window.
Definition: mutt_window.h:127
#define WN_VISIBLE
Window became visible.
Definition: mutt_window.h:158
struct MuttWindowList children
Children Windows.
Definition: mutt_window.h:128
void notify_set_parent(struct Notify *notify, struct Notify *parent)
Set the parent notification handler.
Definition: notify.c:82
void debug_win_dump(void)
Definition: window.c:87
struct MuttWindow * MuttDialogWindow
Parent of all Dialogs.
Definition: mutt_window.c:44
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
Definition: notify.c:137
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ window_redraw()

void window_redraw ( struct MuttWindow win)

Reflow, recalc and repaint a tree of Windows.

Parameters
winWindow to start at

Definition at line 823 of file mutt_window.c.

824 {
825  if (!win)
826  return;
827 
828  window_reflow(win);
829  window_notify_all(win);
830 
831  window_recalc(win);
832  window_repaint(win);
833 }
void window_recalc(struct MuttWindow *win)
Recalculate a tree of Windows.
Definition: mutt_window.c:783
void window_reflow(struct MuttWindow *win)
Reflow Windows.
Definition: reflow.c:222
void window_notify_all(struct MuttWindow *win)
Notify observers of changes to a Window and its children.
Definition: mutt_window.c:89
void window_repaint(struct MuttWindow *win)
Repaint a tree of Windows.
Definition: mutt_window.c:803
+ Here is the call graph for this function:

Variable Documentation

◆ MuttDialogWindow

struct MuttWindow* MuttDialogWindow

Parent of all Dialogs.

Definition at line 44 of file mutt_window.c.

◆ MuttHelpWindow

struct MuttWindow* MuttHelpWindow

Help Window.

Definition at line 45 of file mutt_window.c.

◆ MuttMessageWindow

struct MuttWindow* MuttMessageWindow

Message Window.

Definition at line 46 of file mutt_window.c.