NeoMutt  2025-12-11-694-ga89709
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
observer.c
Go to the documentation of this file.
1
25
31
32#include "config.h"
33#include <stdbool.h>
34#include <stddef.h>
35#include "private.h"
36#include "mutt/lib.h"
37#include "config/lib.h"
38#include "core/lib.h"
39#include "gui/lib.h"
40#include "color/lib.h"
41#include "index/lib.h"
42
43void sb_win_remove_observers(struct MuttWindow *win);
44
53{
55 bool changed = false;
56 const char *const c_sidebar_divider_char = cs_subset_string(NeoMutt->sub, "sidebar_divider_char");
57
58 // Calculate the width of the delimiter in screen cells
59 int width = mutt_strwidth(c_sidebar_divider_char);
60 if (width < 1)
61 {
63 goto done;
64 }
65
66 const bool c_ascii_chars = cs_subset_bool(NeoMutt->sub, "ascii_chars");
67 if (c_ascii_chars || !CharsetIsUtf8)
68 {
69 const size_t len = mutt_str_len(c_sidebar_divider_char);
70 for (size_t i = 0; i < len; i++)
71 {
72 if (c_sidebar_divider_char[i] & ~0x7F) // high-bit is set
73 {
75 width = 1;
76 break;
77 }
78 }
79 }
80
81done:
82 changed = (width != wdata->divider_width);
83
84 wdata->divider_type = type;
85 wdata->divider_width = width;
86
87 return changed;
88}
89
95static struct MuttWindow *sb_win_init(struct MuttWindow *dlg)
96{
98
99 struct MuttWindow **pw_index_panel = ARRAY_FIRST(&dlg->children);
100 struct MuttWindow *index_panel = pw_index_panel ? *pw_index_panel : NULL;
101 mutt_window_remove_child(dlg, index_panel);
102
103 struct MuttWindow **wp_pager_panel = ARRAY_FIRST(&dlg->children);
104 struct MuttWindow *pager_panel = wp_pager_panel ? *wp_pager_panel : NULL;
105 mutt_window_remove_child(dlg, pager_panel);
106
110 dlg->focus = cont_right;
111
112 mutt_window_add_child(cont_right, index_panel);
113 mutt_window_add_child(cont_right, pager_panel);
114 cont_right->focus = index_panel;
115
116 const short c_sidebar_width = cs_subset_number(NeoMutt->sub, "sidebar_width");
118 MUTT_WIN_SIZE_FIXED, c_sidebar_width,
120 const bool c_sidebar_visible = cs_subset_bool(NeoMutt->sub, "sidebar_visible");
121 win_sidebar->state.visible = c_sidebar_visible && (c_sidebar_width > 0);
122
123 struct IndexSharedData *shared = dlg->wdata;
124 win_sidebar->wdata = sb_wdata_new(win_sidebar, shared);
125 win_sidebar->wdata_free = sb_wdata_free;
126
127 calc_divider(win_sidebar->wdata);
128
129 win_sidebar->recalc = sb_recalc;
130 win_sidebar->repaint = sb_repaint;
131
132 const bool c_sidebar_on_right = cs_subset_bool(NeoMutt->sub, "sidebar_on_right");
133 if (c_sidebar_on_right)
134 {
135 mutt_window_add_child(dlg, cont_right);
136 mutt_window_add_child(dlg, win_sidebar);
137 }
138 else
139 {
140 mutt_window_add_child(dlg, win_sidebar);
141 mutt_window_add_child(dlg, cont_right);
142 }
143
144 sb_win_add_observers(win_sidebar);
145
146 return win_sidebar;
147}
148
153static void sb_init_data(struct MuttWindow *win)
154{
156 if (!wdata)
157 return;
158
159 if (!ARRAY_EMPTY(&wdata->entries))
160 return;
161
162 struct MailboxArray ma = neomutt_mailboxes_get(NeoMutt, MUTT_MAILBOX_ANY);
163 struct Mailbox **mp = NULL;
164 ARRAY_FOREACH(mp, &ma)
165 {
166 struct Mailbox *m = *mp;
167
168 if (m->visible)
169 sb_add_mailbox(wdata, m);
170 }
171 ARRAY_FREE(&ma); // Clean up the ARRAY, but not the Mailboxes
172}
173
178{
179 if (nc->event_type != NT_ACCOUNT)
180 return 0;
181 if (!nc->global_data || !nc->event_data)
182 return -1;
184 return 0;
185
186 struct MuttWindow *win = nc->global_data;
188 struct EventAccount *ev_a = nc->event_data;
189
190 struct Mailbox **mp = NULL;
191 ARRAY_FOREACH(mp, &ev_a->account->mailboxes)
192 {
193 sb_add_mailbox(wdata, *mp);
194 }
195
196 win->actions |= WA_RECALC;
197 mutt_debug(LL_DEBUG5, "account done, request WA_RECALC\n");
198 return 0;
199}
200
204static int sb_color_observer(struct NotifyCallback *nc)
205{
206 if (nc->event_type != NT_COLOR)
207 return 0;
208 if (!nc->global_data || !nc->event_data)
209 return -1;
210
211 struct EventColor *ev_c = nc->event_data;
212 struct MuttWindow *win = nc->global_data;
213
214 enum ColorId cid = ev_c->cid;
215
216 if (cid == MT_COLOR_MAX) // Sent on `uncolor *`
217 {
218 // Set a default style
220 ac->attrs = A_UNDERLINE;
221 }
222
223 switch (cid)
224 {
226 case MT_COLOR_NORMAL:
236 case MT_COLOR_MAX: // Sent on `uncolor *`
237 win->actions |= WA_REPAINT;
238 mutt_debug(LL_DEBUG5, "color done, request WA_REPAINT\n");
239 break;
240
241 default:
242 break;
243 }
244 return 0;
245}
246
251{
252 if (nc->event_type != NT_COMMAND)
253 return 0;
254 if (!nc->global_data || !nc->event_data)
255 return -1;
256
257 struct Command *cmd = nc->event_data;
258
259 if ((cmd->parse != parse_sidebar_pin) && (cmd->parse != parse_sidebar_unpin))
260 return 0;
261
262 struct MuttWindow *win = nc->global_data;
263 win->actions |= WA_RECALC;
264 mutt_debug(LL_DEBUG5, "command done, request WA_RECALC\n");
265 return 0;
266}
267
271static int sb_config_observer(struct NotifyCallback *nc)
272{
273 if (nc->event_type != NT_CONFIG)
274 return 0;
275 if (!nc->global_data || !nc->event_data)
276 return -1;
277
278 struct EventConfig *ev_c = nc->event_data;
279
280 if (!mutt_strn_equal(ev_c->name, "sidebar_", 8) &&
281 !mutt_str_equal(ev_c->name, "ascii_chars") &&
282 !mutt_str_equal(ev_c->name, "folder") && !mutt_str_equal(ev_c->name, "spool_file"))
283 {
284 return 0;
285 }
286
287 if (mutt_str_equal(ev_c->name, "sidebar_next_new_wrap"))
288 return 0; // Affects the behaviour, but not the display
289
290 mutt_debug(LL_DEBUG5, "config: %s\n", ev_c->name);
291
292 struct MuttWindow *win = nc->global_data;
293
294 if (mutt_str_equal(ev_c->name, "sidebar_visible"))
295 {
296 const bool c_sidebar_visible = cs_subset_bool(NeoMutt->sub, "sidebar_visible");
297 window_set_visible(win, c_sidebar_visible);
298 window_reflow(win->parent);
299 mutt_debug(LL_DEBUG5, "config done, request WA_REFLOW\n");
300 return 0;
301 }
302
303 if (mutt_str_equal(ev_c->name, "sidebar_width"))
304 {
305 const short c_sidebar_width = cs_subset_number(NeoMutt->sub, "sidebar_width");
306 win->req_cols = c_sidebar_width;
307 window_reflow(win->parent);
308 mutt_debug(LL_DEBUG5, "config done, request WA_REFLOW\n");
309 return 0;
310 }
311
312 if (mutt_str_equal(ev_c->name, "spool_file"))
313 {
314 win->actions |= WA_REPAINT;
315 mutt_debug(LL_DEBUG5, "config done, request WA_REPAINT\n");
316 return 0;
317 }
318
319 if (mutt_str_equal(ev_c->name, "sidebar_on_right"))
320 {
321 struct MuttWindow *parent = win->parent;
322 struct MuttWindow **wp_first = ARRAY_FIRST(&parent->children);
323 if (!wp_first)
324 return 0;
325
326 struct MuttWindow *first = *wp_first;
327 const bool c_sidebar_on_right = cs_subset_bool(NeoMutt->sub, "sidebar_on_right");
328
329 if ((c_sidebar_on_right && (first == win)) || (!c_sidebar_on_right && (first != win)))
330 {
331 // Swap the Sidebar and the Container of the Index/Pager - move first to end
332 ARRAY_REMOVE(&parent->children, wp_first);
333 ARRAY_ADD(&parent->children, first);
334 }
335
336 window_reflow(win->parent);
337 mutt_debug(LL_DEBUG5, "config done, request WA_REFLOW\n");
338 return 0;
339 }
340
341 if (mutt_str_equal(ev_c->name, "ascii_chars") ||
342 mutt_str_equal(ev_c->name, "sidebar_divider_char"))
343 {
347 mutt_debug(LL_DEBUG5, "config done, request WA_RECALC\n");
348 return 0;
349 }
350
351 // All the remaining config changes...
353 mutt_debug(LL_DEBUG5, "config done, request WA_RECALC\n");
354 return 0;
355}
356
360static int sb_index_observer(struct NotifyCallback *nc)
361{
362 if (nc->event_type != NT_INDEX)
363 return 0;
364 if (!nc->global_data || !nc->event_data)
365 return 0;
366 if (!(nc->event_subtype & NT_INDEX_MAILBOX))
367 return 0;
368
369 struct MuttWindow *win_sidebar = nc->global_data;
370 struct IndexSharedData *shared = nc->event_data;
371
372 struct SidebarWindowData *wdata = sb_wdata_get(win_sidebar);
374
375 win_sidebar->actions |= WA_RECALC;
376 mutt_debug(LL_DEBUG5, "index done, request WA_RECALC\n");
377
378 return 0;
379}
380
385{
386 if (nc->event_type != NT_MAILBOX)
387 return 0;
388 if (!nc->global_data || !nc->event_data)
389 return -1;
390
391 struct MuttWindow *win = nc->global_data;
392
394 struct EventMailbox *ev_m = nc->event_data;
395
396 if (nc->event_subtype == NT_MAILBOX_ADD)
397 {
398 sb_add_mailbox(wdata, ev_m->mailbox);
399 }
400 else if (nc->event_subtype == NT_MAILBOX_DELETE)
401 {
402 sb_remove_mailbox(wdata, ev_m->mailbox);
403 }
404
405 win->actions |= WA_RECALC;
406 mutt_debug(LL_DEBUG5, "mailbox done, request WA_RECALC\n");
407 return 0;
408}
409
413static int sb_window_observer(struct NotifyCallback *nc)
414{
415 if (nc->event_type != NT_WINDOW)
416 return 0;
417 if (!nc->global_data || !nc->event_data)
418 return -1;
419
420 struct MuttWindow *win = nc->global_data;
421 struct EventWindow *ev_w = nc->event_data;
422 if (ev_w->win != win)
423 return 0;
424
426 {
428 mutt_debug(LL_DEBUG5, "window state done, request WA_RECALC\n");
429 }
430 else if (nc->event_subtype == NT_WINDOW_DELETE)
431 {
432 mutt_debug(LL_DEBUG5, "window delete done\n");
434 }
435 return 0;
436}
437
459
481
486{
487 if (nc->event_type != NT_WINDOW)
488 return 0;
489 if (!nc->event_data)
490 return -1;
492 return 0;
493
494 struct EventWindow *ev_w = nc->event_data;
495 if (ev_w->win->type != WT_DLG_INDEX)
496 return 0;
497
498 if (ev_w->flags & WN_VISIBLE)
499 {
500 mutt_debug(LL_DEBUG5, "insertion: visible\n");
501 struct MuttWindow *win_sidebar = sb_win_init(ev_w->win);
502 sb_init_data(win_sidebar);
503 }
504 else if (ev_w->flags & WN_HIDDEN)
505 {
506 mutt_debug(LL_DEBUG5, "insertion: hidden\n");
508 }
509
510 return 0;
511}
#define ARRAY_FIRST(head)
Convenience method to get the first element.
Definition array.h:136
#define ARRAY_ADD(head, elem)
Add an element at the end of the array.
Definition array.h:157
#define ARRAY_REMOVE(head, elem)
Remove an entry from the array, shifting down the subsequent entries.
Definition array.h:355
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
Definition array.h:223
#define ARRAY_EMPTY(head)
Check if an array is empty.
Definition array.h:74
#define ARRAY_FREE(head)
Release all memory.
Definition array.h:209
Color and attribute parsing.
void mutt_color_observer_remove(observer_t callback, void *global_data)
Remove an observer.
Definition notify.c:71
void mutt_color_observer_add(observer_t callback, void *global_data)
Add an observer.
Definition notify.c:61
struct AttrColor * simple_color_get(enum ColorId cid)
Get the colour of an object by its ID.
Definition simple.c:95
ColorId
List of all coloured objects.
Definition color.h:35
@ MT_COLOR_SIDEBAR_SPOOL_FILE
$spool_file (Spool mailbox)
Definition color.h:75
@ MT_COLOR_SIDEBAR_DIVIDER
Line dividing sidebar from the index/pager.
Definition color.h:69
@ MT_COLOR_MAX
Definition color.h:97
@ MT_COLOR_SIDEBAR_NEW
Mailbox with new mail.
Definition color.h:73
@ MT_COLOR_SIDEBAR_UNREAD
Mailbox with unread mail.
Definition color.h:76
@ MT_COLOR_INDICATOR
Selected item in list.
Definition color.h:49
@ MT_COLOR_SIDEBAR_ORDINARY
Mailbox with no new or flagged messages.
Definition color.h:74
@ MT_COLOR_SIDEBAR_BACKGROUND
Background colour for the Sidebar.
Definition color.h:68
@ MT_COLOR_NORMAL
Plain text.
Definition color.h:53
@ MT_COLOR_SIDEBAR_INDICATOR
Current open mailbox.
Definition color.h:72
@ MT_COLOR_SIDEBAR_HIGHLIGHT
Select cursor.
Definition color.h:71
@ MT_COLOR_SIDEBAR_FLAGGED
Mailbox with flagged messages.
Definition color.h:70
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition helpers.c:291
short cs_subset_number(const struct ConfigSubset *sub, const char *name)
Get a number config item by name.
Definition helpers.c:143
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition helpers.c:47
Convenience wrapper for the config headers.
@ NT_ACCOUNT_DELETE
Account is about to be deleted.
Definition account.h:68
Convenience wrapper for the core headers.
@ NT_MAILBOX_DELETE
Mailbox is about to be deleted.
Definition mailbox.h:173
@ NT_MAILBOX_ADD
Mailbox has been added.
Definition mailbox.h:172
@ MUTT_MAILBOX_ANY
Match any Mailbox type.
Definition mailbox.h:41
size_t mutt_strwidth(const char *s)
Measure a string's width in screen cells.
Definition curs_lib.c:444
enum CommandResult parse_sidebar_pin(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'sidebar-pin' command - Implements Command::parse() -.
Definition commands.c:44
enum CommandResult parse_sidebar_unpin(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'sidebar-unpin' command - Implements Command::parse() -.
Definition commands.c:74
#define mutt_debug(LEVEL,...)
Definition logging2.h:91
static int sb_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
Definition observer.c:413
static int sb_mailbox_observer(struct NotifyCallback *nc)
Notification that a Mailbox has changed - Implements observer_t -.
Definition observer.c:384
static int sb_account_observer(struct NotifyCallback *nc)
Notification that an Account has changed - Implements observer_t -.
Definition observer.c:177
int sb_insertion_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
Definition observer.c:485
static int sb_command_observer(struct NotifyCallback *nc)
Notification that a Command has occurred - Implements observer_t -.
Definition observer.c:250
static int sb_color_observer(struct NotifyCallback *nc)
Notification that a Color has changed - Implements observer_t -.
Definition observer.c:204
static int sb_index_observer(struct NotifyCallback *nc)
Notification that the Index has changed - Implements observer_t -.
Definition observer.c:360
static int sb_config_observer(struct NotifyCallback *nc)
Notification that a Config Variable has changed - Implements observer_t -.
Definition observer.c:271
int sb_recalc(struct MuttWindow *win)
Recalculate the Sidebar display - Implements MuttWindow::recalc() -.
Definition window.c:555
int sb_repaint(struct MuttWindow *win)
Repaint the Sidebar display - Implements MuttWindow::repaint() -.
Definition window.c:710
void sb_wdata_free(struct MuttWindow *win, void **ptr)
Free Sidebar Window data - Implements MuttWindow::wdata_free() -.
Definition wdata.c:56
Convenience wrapper for the gui headers.
GUI manage the main index (list of emails)
#define NT_INDEX_MAILBOX
Mailbox has changed.
Definition lib.h:75
@ LL_DEBUG5
Log at debug level 5.
Definition logging2.h:49
bool CharsetIsUtf8
Is the user's current character set utf-8?
Definition charset.c:66
Convenience wrapper for the library headers.
bool notify_observer_remove(struct Notify *notify, const observer_t callback, const void *global_data)
Remove an observer from an object.
Definition notify.c:230
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:191
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition string.c:665
bool mutt_strn_equal(const char *a, const char *b, size_t num)
Check for equality of two strings (to a maximum), safely.
Definition string.c:429
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
Definition string.c:503
struct MuttWindow * window_find_parent(struct MuttWindow *win, enum WindowType type)
Find a (grand-)parent of a Window by type.
void mutt_window_add_child(struct MuttWindow *parent, struct MuttWindow *child)
Add a child to Window.
struct MuttWindow * mutt_window_new(enum WindowType type, enum MuttWindowOrientation orient, enum MuttWindowSize size, int cols, int rows)
Create a new Window.
struct MuttWindow * mutt_window_remove_child(struct MuttWindow *parent, struct MuttWindow *child)
Remove a child from a Window.
void window_set_visible(struct MuttWindow *win, bool visible)
Set a Window visible or hidden.
#define WA_RECALC
Recalculate the contents of the Window.
@ WT_CONTAINER
Invisible shaping container Window.
Definition mutt_window.h:73
@ WT_DLG_INDEX
Index Dialog, dlg_index()
Definition mutt_window.h:86
@ WT_SIDEBAR
Side panel containing Accounts or groups of data.
@ MUTT_WIN_ORIENT_VERTICAL
Window uses all available vertical space.
Definition mutt_window.h:38
@ MUTT_WIN_ORIENT_HORIZONTAL
Window uses all available horizontal space.
Definition mutt_window.h:39
@ NT_WINDOW_DIALOG
A new Dialog Window has been created, e.g. WT_DLG_INDEX.
@ NT_WINDOW_STATE
Window state has changed, e.g. WN_VISIBLE.
@ NT_WINDOW_DELETE
Window is about to be deleted.
#define WN_VISIBLE
Window became visible.
#define WN_HIDDEN
Window became hidden.
#define WA_REPAINT
Redraw the contents of the Window.
#define MUTT_WIN_SIZE_UNLIMITED
Use as much space as possible.
Definition mutt_window.h:52
@ MUTT_WIN_SIZE_FIXED
Window has a fixed size.
Definition mutt_window.h:47
@ MUTT_WIN_SIZE_MAXIMISE
Window wants as much space as possible.
Definition mutt_window.h:48
struct MailboxArray neomutt_mailboxes_get(struct NeoMutt *n, enum MailboxType type)
Get an Array of matching Mailboxes.
Definition neomutt.c:526
@ NT_WINDOW
MuttWindow has changed, NotifyWindow, EventWindow.
Definition notify_type.h:57
@ NT_CONFIG
Config has changed, NotifyConfig, EventConfig.
Definition notify_type.h:43
@ NT_COLOR
Colour has changed, NotifyColor, EventColor.
Definition notify_type.h:41
@ NT_MAILBOX
Mailbox has changed, NotifyMailbox, EventMailbox.
Definition notify_type.h:49
@ NT_COMMAND
A Command has been executed, Command.
Definition notify_type.h:42
@ NT_ACCOUNT
Account has changed, NotifyAccount, EventAccount.
Definition notify_type.h:36
@ NT_INDEX
Index data has changed, NotifyIndex, IndexSharedData.
Definition notify_type.h:48
void window_reflow(struct MuttWindow *win)
Reflow Windows.
Definition reflow.c:220
void sb_win_add_observers(struct MuttWindow *win)
Add Observers to the Sidebar Window.
Definition observer.c:442
static struct MuttWindow * sb_win_init(struct MuttWindow *dlg)
Initialise and insert the Sidebar Window.
Definition observer.c:95
static bool calc_divider(struct SidebarWindowData *wdata)
Decide what actions are required for the divider.
Definition observer.c:52
static void sb_init_data(struct MuttWindow *win)
Initialise the Sidebar data.
Definition observer.c:153
void sb_win_remove_observers(struct MuttWindow *win)
Remove Observers from the Sidebar Window.
Definition observer.c:464
GUI display the mailboxes in a side panel.
DivType
Source of the sidebar divider character.
Definition private.h:82
@ SB_DIV_ASCII
An ASCII vertical bar (pipe)
Definition private.h:84
@ SB_DIV_USER
User configured using $sidebar_divider_char.
Definition private.h:83
void sb_remove_mailbox(struct SidebarWindowData *wdata, const struct Mailbox *m)
Remove a Mailbox from the Sidebar.
Definition sidebar.c:138
struct SidebarWindowData * sb_wdata_new(struct MuttWindow *win, struct IndexSharedData *shared)
Create new Window data for the Sidebar.
Definition wdata.c:44
void sb_set_current_mailbox(struct SidebarWindowData *wdata, struct Mailbox *m)
Set the current Mailbox.
Definition sidebar.c:191
void sb_add_mailbox(struct SidebarWindowData *wdata, struct Mailbox *m)
Add a Mailbox to the Sidebar.
Definition sidebar.c:100
struct SidebarWindowData * sb_wdata_get(struct MuttWindow *win)
Get the Sidebar data for this window.
Definition wdata.c:77
struct MailboxArray mailboxes
All Mailboxes.
Definition account.h:40
A curses colour and its attributes.
Definition attr.h:65
int attrs
Text attributes, e.g. A_BOLD.
Definition attr.h:68
enum CommandResult(* parse)(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Definition command.h:178
struct Notify * notify
Notifications: NotifyConfig, EventConfig.
Definition subset.h:51
An Event that happened to an Account.
Definition account.h:77
struct Account * account
The Account this Event relates to.
Definition account.h:78
An Event that happened to a Colour.
Definition notify2.h:54
enum ColorId cid
Colour ID that has changed.
Definition notify2.h:55
A config-change event.
Definition subset.h:70
const char * name
Name of config item that changed.
Definition subset.h:72
An Event that happened to a Mailbox.
Definition mailbox.h:189
struct Mailbox * mailbox
The Mailbox this Event relates to.
Definition mailbox.h:190
An Event that happened to a Window.
struct MuttWindow * win
Window that changed.
WindowNotifyFlags flags
Attributes of Window that changed.
Data shared between Index, Pager and Sidebar.
Definition shared_data.h:37
struct Mailbox * mailbox
Current Mailbox.
Definition shared_data.h:41
A mailbox.
Definition mailbox.h:78
bool visible
True if a result of "mailboxes".
Definition mailbox.h:129
struct MuttWindowArray children
Children Windows.
int(* repaint)(struct MuttWindow *win)
short req_cols
Number of columns required.
struct WindowState state
Current state of the Window.
struct MuttWindow * focus
Focused Window.
void * wdata
Private data.
enum MuttWindowOrientation orient
Which direction the Window will expand.
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
int(* recalc)(struct MuttWindow *win)
void(* wdata_free)(struct MuttWindow *win, void **ptr)
struct MuttWindow * parent
Parent Window.
WindowActionFlags actions
Actions to be performed, e.g. WA_RECALC.
enum WindowType type
Window type, e.g. WT_SIDEBAR.
Container for Accounts, Notifications.
Definition neomutt.h:41
struct Notify * notify
Notifications handler.
Definition neomutt.h:45
struct ConfigSubset * sub
Inherited config items.
Definition neomutt.h:49
Data passed to a notification function.
Definition observer.h:34
void * event_data
Data from notify_send()
Definition observer.h:38
enum NotifyType event_type
Send: Event type, e.g. NT_ACCOUNT.
Definition observer.h:36
int event_subtype
Send: Event subtype, e.g. NT_ACCOUNT_ADD.
Definition observer.h:37
void * global_data
Data from notify_observer_add()
Definition observer.h:39
Sidebar private Window data -.
Definition private.h:91
short divider_width
Width of the divider in screen columns.
Definition private.h:105
enum DivType divider_type
Type of divider to use, e.g. SB_DIV_ASCII.
Definition private.h:104
struct IndexSharedData * shared
Shared Index Data.
Definition private.h:93
struct MuttWindow * win
Sidebar Window.
Definition private.h:92
bool visible
Window is visible.
Definition mutt_window.h:59