NeoMutt  2022-04-29-323-g5fcc6c
Teaching an old dog new tricks
DOXYGEN
observer.c
Go to the documentation of this file.
1
29#include "config.h"
30#include <stddef.h>
31#include <stdbool.h>
32#include "private.h"
33#include "mutt/lib.h"
34#include "config/lib.h"
35#include "core/lib.h"
36#include "gui/lib.h"
37#include "color/lib.h"
38#include "index/lib.h"
39
40void sb_win_remove_observers(struct MuttWindow *win);
41
50{
52 const char *const c_sidebar_divider_char = cs_subset_string(NeoMutt->sub, "sidebar_divider_char");
53
54 // Calculate the width of the delimiter in screen cells
55 int width = mutt_strwidth(c_sidebar_divider_char);
56
57 const bool c_ascii_chars = cs_subset_bool(NeoMutt->sub, "ascii_chars");
58 if (c_ascii_chars)
59 {
60 if (width < 1) // empty or bad
61 {
63 width = 1;
64 }
65 else
66 {
67 for (size_t i = 0; i < width; i++)
68 {
69 if (c_sidebar_divider_char[i] & ~0x7F) // high-bit is set
70 {
72 width = 1;
73 break;
74 }
75 }
76 }
77 }
78 else
79 {
80 if (width < 1) // empty or bad
81 {
83 width = 1;
84 }
85 }
86
87 const bool changed = (width != wdata->divider_width);
88
89 wdata->divider_type = type;
90 wdata->divider_width = width;
91
92 return changed;
93}
94
100static struct MuttWindow *sb_win_init(struct MuttWindow *dlg)
101{
103
104 struct MuttWindow *index_panel = TAILQ_FIRST(&dlg->children);
105 mutt_window_remove_child(dlg, index_panel);
106
107 struct MuttWindow *pager_panel = TAILQ_FIRST(&dlg->children);
108 mutt_window_remove_child(dlg, pager_panel);
109
113 dlg->focus = cont_right;
114
115 mutt_window_add_child(cont_right, index_panel);
116 mutt_window_add_child(cont_right, pager_panel);
117 cont_right->focus = index_panel;
118
119 const short c_sidebar_width = cs_subset_number(NeoMutt->sub, "sidebar_width");
121 MUTT_WIN_SIZE_FIXED, c_sidebar_width,
123 const bool c_sidebar_visible = cs_subset_bool(NeoMutt->sub, "sidebar_visible");
124 win_sidebar->state.visible = c_sidebar_visible && (c_sidebar_width > 0);
125
126 struct IndexSharedData *shared = dlg->wdata;
127 win_sidebar->wdata = sb_wdata_new(win_sidebar, shared);
128 win_sidebar->wdata_free = sb_wdata_free;
129
130 calc_divider(win_sidebar->wdata);
131
132 win_sidebar->recalc = sb_recalc;
133 win_sidebar->repaint = sb_repaint;
134
135 const bool c_sidebar_on_right = cs_subset_bool(NeoMutt->sub, "sidebar_on_right");
136 if (c_sidebar_on_right)
137 {
138 mutt_window_add_child(dlg, cont_right);
139 mutt_window_add_child(dlg, win_sidebar);
140 }
141 else
142 {
143 mutt_window_add_child(dlg, win_sidebar);
144 mutt_window_add_child(dlg, cont_right);
145 }
146
147 sb_win_add_observers(win_sidebar);
148
149 return win_sidebar;
150}
151
156static void sb_init_data(struct MuttWindow *win)
157{
159 if (!wdata)
160 return;
161
162 if (!ARRAY_EMPTY(&wdata->entries))
163 return;
164
165 struct MailboxList ml = STAILQ_HEAD_INITIALIZER(ml);
167 struct MailboxNode *np = NULL;
168 STAILQ_FOREACH(np, &ml, entries)
169 {
170 if (np->mailbox->visible)
171 sb_add_mailbox(wdata, np->mailbox);
172 }
174}
175
180{
181 if (nc->event_type != NT_ACCOUNT)
182 return 0;
183 if (!nc->global_data || !nc->event_data)
184 return -1;
186 return 0;
187
188 struct MuttWindow *win = nc->global_data;
190 struct EventAccount *ev_a = nc->event_data;
191
192 struct MailboxNode *np = NULL;
193 STAILQ_FOREACH(np, &ev_a->account->mailboxes, entries)
194 {
195 sb_add_mailbox(wdata, np->mailbox);
196 }
197
198 win->actions |= WA_RECALC;
199 mutt_debug(LL_DEBUG5, "account done, request WA_RECALC\n");
200 return 0;
201}
202
206static int sb_color_observer(struct NotifyCallback *nc)
207{
208 if (nc->event_type != NT_COLOR)
209 return 0;
210 if (!nc->global_data || !nc->event_data)
211 return -1;
212
213 struct EventColor *ev_c = nc->event_data;
214 struct MuttWindow *win = nc->global_data;
215
216 enum ColorId cid = ev_c->cid;
217
218 switch (cid)
219 {
221 case MT_COLOR_NORMAL:
230 case MT_COLOR_MAX: // Sent on `uncolor *`
231 win->actions |= WA_REPAINT;
232 mutt_debug(LL_DEBUG5, "color done, request WA_REPAINT\n");
233 break;
234
235 default:
236 break;
237 }
238 return 0;
239}
240
245{
246 if (nc->event_type != NT_COMMAND)
247 return 0;
248 if (!nc->global_data || !nc->event_data)
249 return -1;
250
251 struct Command *cmd = nc->event_data;
252
253 if ((cmd->parse != sb_parse_whitelist) && (cmd->parse != sb_parse_unwhitelist))
254 return 0;
255
256 struct MuttWindow *win = nc->global_data;
257 win->actions |= WA_RECALC;
258 mutt_debug(LL_DEBUG5, "command done, request WA_RECALC\n");
259 return 0;
260}
261
265static int sb_config_observer(struct NotifyCallback *nc)
266{
267 if (nc->event_type != NT_CONFIG)
268 return 0;
269 if (!nc->global_data || !nc->event_data)
270 return -1;
271
272 struct EventConfig *ev_c = nc->event_data;
273
274 if (!mutt_strn_equal(ev_c->name, "sidebar_", 8) &&
275 !mutt_str_equal(ev_c->name, "ascii_chars") &&
276 !mutt_str_equal(ev_c->name, "folder") && !mutt_str_equal(ev_c->name, "spool_file"))
277 {
278 return 0;
279 }
280
281 if (mutt_str_equal(ev_c->name, "sidebar_next_new_wrap"))
282 return 0; // Affects the behaviour, but not the display
283
284 mutt_debug(LL_DEBUG5, "config: %s\n", ev_c->name);
285
286 struct MuttWindow *win = nc->global_data;
287
288 if (mutt_str_equal(ev_c->name, "sidebar_visible"))
289 {
290 const bool c_sidebar_visible = cs_subset_bool(NeoMutt->sub, "sidebar_visible");
291 window_set_visible(win, c_sidebar_visible);
292 window_reflow(win->parent);
293 mutt_debug(LL_DEBUG5, "config done, request WA_REFLOW\n");
294 return 0;
295 }
296
297 if (mutt_str_equal(ev_c->name, "sidebar_width"))
298 {
299 const short c_sidebar_width = cs_subset_number(NeoMutt->sub, "sidebar_width");
300 win->req_cols = c_sidebar_width;
301 window_reflow(win->parent);
302 mutt_debug(LL_DEBUG5, "config done, request WA_REFLOW\n");
303 return 0;
304 }
305
306 if (mutt_str_equal(ev_c->name, "spool_file"))
307 {
308 win->actions |= WA_REPAINT;
309 mutt_debug(LL_DEBUG5, "config done, request WA_REPAINT\n");
310 return 0;
311 }
312
313 if (mutt_str_equal(ev_c->name, "sidebar_on_right"))
314 {
315 struct MuttWindow *parent = win->parent;
316 struct MuttWindow *first = TAILQ_FIRST(&parent->children);
317 const bool c_sidebar_on_right = cs_subset_bool(NeoMutt->sub, "sidebar_on_right");
318
319 if ((c_sidebar_on_right && (first == win)) || (!c_sidebar_on_right && (first != win)))
320 {
321 // Swap the Sidebar and the Container of the Index/Pager
322 TAILQ_REMOVE(&parent->children, first, entries);
323 TAILQ_INSERT_TAIL(&parent->children, first, entries);
324 }
325
326 window_reflow(win->parent);
327 mutt_debug(LL_DEBUG5, "config done, request WA_REFLOW\n");
328 return 0;
329 }
330
331 if (mutt_str_equal(ev_c->name, "ascii_chars") ||
332 mutt_str_equal(ev_c->name, "sidebar_divider_char"))
333 {
337 mutt_debug(LL_DEBUG5, "config done, request WA_REPAINT\n");
338 return 0;
339 }
340
341 // All the remaining config changes...
343 mutt_debug(LL_DEBUG5, "config done, request WA_RECALC\n");
344 return 0;
345}
346
350static int sb_index_observer(struct NotifyCallback *nc)
351{
352 if (nc->event_type != NT_INDEX)
353 return 0;
354 if (!nc->global_data || !nc->event_data)
355 return 0;
356 if (!(nc->event_subtype & NT_INDEX_MAILBOX))
357 return 0;
358
359 struct MuttWindow *win_sidebar = nc->global_data;
360 struct IndexSharedData *shared = nc->event_data;
361
362 struct SidebarWindowData *wdata = sb_wdata_get(win_sidebar);
364
365 win_sidebar->actions |= WA_RECALC;
366 mutt_debug(LL_DEBUG5, "index done, request WA_RECALC\n");
367
368 return 0;
369}
370
375{
376 if (nc->event_type != NT_MAILBOX)
377 return 0;
378 if (!nc->global_data || !nc->event_data)
379 return -1;
380
381 struct MuttWindow *win = nc->global_data;
382
384 struct EventMailbox *ev_m = nc->event_data;
385
386 if (nc->event_subtype == NT_MAILBOX_ADD)
387 {
388 sb_add_mailbox(wdata, ev_m->mailbox);
389 }
390 else if (nc->event_subtype == NT_MAILBOX_DELETE)
391 {
392 sb_remove_mailbox(wdata, ev_m->mailbox);
393 }
394
395 win->actions |= WA_RECALC;
396 mutt_debug(LL_DEBUG5, "mailbox done, request WA_RECALC\n");
397 return 0;
398}
399
403static int sb_window_observer(struct NotifyCallback *nc)
404{
405 if (nc->event_type != NT_WINDOW)
406 return 0;
407 if (!nc->global_data || !nc->event_data)
408 return -1;
409
410 struct MuttWindow *win = nc->global_data;
411 struct EventWindow *ev_w = nc->event_data;
412 if (ev_w->win != win)
413 return 0;
414
416 {
418 mutt_debug(LL_DEBUG5, "window state done, request WA_RECALC\n");
419 }
420 else if (nc->event_subtype == NT_WINDOW_DELETE)
421 {
422 mutt_debug(LL_DEBUG5, "window delete done\n");
424 }
425 return 0;
426}
427
433{
434 if (!win || !NeoMutt)
435 return;
436
437 struct MuttWindow *dlg = window_find_parent(win, WT_DLG_INDEX);
438
446}
447
453{
454 if (!win || !NeoMutt)
455 return;
456
457 struct MuttWindow *dlg = window_find_parent(win, WT_DLG_INDEX);
458
466}
467
472{
473 if (nc->event_type != NT_WINDOW)
474 return 0;
475 if (!nc->event_data)
476 return -1;
478 return 0;
479
480 struct EventWindow *ev_w = nc->event_data;
481 if (ev_w->win->type != WT_DLG_INDEX)
482 return 0;
483
484 if (ev_w->flags & WN_VISIBLE)
485 {
486 mutt_debug(LL_DEBUG5, "insertion: visible\n");
487 struct MuttWindow *win_sidebar = sb_win_init(ev_w->win);
488 sb_init_data(win_sidebar);
489 }
490 else if (ev_w->flags & WN_HIDDEN)
491 {
492 mutt_debug(LL_DEBUG5, "insertion: hidden\n");
494 }
495
496 return 0;
497}
@ NT_ACCOUNT_DELETE
Account is about to be deleted.
Definition: account.h:70
#define ARRAY_EMPTY(head)
Check if an array is empty.
Definition: array.h:73
Color and attribute parsing.
ColorId
List of all colored objects.
Definition: color.h:38
@ MT_COLOR_SIDEBAR_DIVIDER
Line dividing sidebar from the index/pager.
Definition: color.h:64
@ MT_COLOR_MAX
Definition: color.h:91
@ MT_COLOR_SIDEBAR_NEW
Mailbox with new mail.
Definition: color.h:68
@ MT_COLOR_SIDEBAR_UNREAD
Mailbox with unread mail.
Definition: color.h:71
@ MT_COLOR_INDICATOR
Selected item in list.
Definition: color.h:52
@ MT_COLOR_SIDEBAR_SPOOLFILE
$spool_file (Spool mailbox)
Definition: color.h:70
@ MT_COLOR_SIDEBAR_ORDINARY
Mailbox with no new or flagged messages.
Definition: color.h:69
@ MT_COLOR_NORMAL
Plain text.
Definition: color.h:57
@ MT_COLOR_SIDEBAR_INDICATOR
Current open mailbox.
Definition: color.h:67
@ MT_COLOR_SIDEBAR_HIGHLIGHT
Select cursor.
Definition: color.h:66
@ MT_COLOR_SIDEBAR_FLAGGED
Mailbox with flagged messages.
Definition: color.h:65
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition: helpers.c:317
short cs_subset_number(const struct ConfigSubset *sub, const char *name)
Get a number config item by name.
Definition: helpers.c:169
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition: helpers.c:73
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
size_t mutt_strwidth(const char *s)
Measure a string's width in screen cells.
Definition: curs_lib.c:907
enum CommandResult sb_parse_whitelist(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'sidebar_whitelist' command - Implements Command::parse() -.
Definition: commands.c:41
enum CommandResult sb_parse_unwhitelist(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'unsidebar_whitelist' command - Implements Command::parse() -.
Definition: commands.c:60
#define mutt_debug(LEVEL,...)
Definition: logging.h:84
static int sb_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
Definition: observer.c:403
static int sb_mailbox_observer(struct NotifyCallback *nc)
Notification that a Mailbox has changed - Implements observer_t -.
Definition: observer.c:374
static int sb_account_observer(struct NotifyCallback *nc)
Notification that an Account has changed - Implements observer_t -.
Definition: observer.c:179
int sb_insertion_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
Definition: observer.c:471
static int sb_command_observer(struct NotifyCallback *nc)
Notification that a Command has occurred - Implements observer_t -.
Definition: observer.c:244
static int sb_color_observer(struct NotifyCallback *nc)
Notification that a Color has changed - Implements observer_t -.
Definition: observer.c:206
static int sb_index_observer(struct NotifyCallback *nc)
Notification that the Index has changed - Implements observer_t -.
Definition: observer.c:350
static int sb_config_observer(struct NotifyCallback *nc)
Notification that a Config Variable has changed - Implements observer_t -.
Definition: observer.c:265
int sb_recalc(struct MuttWindow *win)
Recalculate the Sidebar display - Implements MuttWindow::recalc() -.
Definition: window.c:711
int sb_repaint(struct MuttWindow *win)
Repaint the Sidebar display - Implements MuttWindow::repaint() -.
Definition: window.c:897
void sb_wdata_free(struct MuttWindow *win, void **ptr)
Free Sidebar Window data - Implements MuttWindow::wdata_free() -.
Definition: wdata.c:55
Convenience wrapper for the gui headers.
GUI manage the main index (list of emails)
#define NT_INDEX_MAILBOX
Mailbox has changed.
Definition: lib.h:65
@ LL_DEBUG5
Log at debug level 5.
Definition: logging.h:44
@ NT_MAILBOX_DELETE
Mailbox is about to be deleted.
Definition: mailbox.h:170
@ NT_MAILBOX_ADD
Mailbox has been added.
Definition: mailbox.h:169
@ MUTT_MAILBOX_ANY
Match any Mailbox type.
Definition: mailbox.h:42
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:228
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:189
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition: string.c:807
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:496
struct MuttWindow * window_find_parent(struct MuttWindow *win, enum WindowType type)
Find a (grand-)parent of a Window by type.
Definition: mutt_window.c:547
void mutt_window_add_child(struct MuttWindow *parent, struct MuttWindow *child)
Add a child to Window.
Definition: mutt_window.c:439
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:181
struct MuttWindow * mutt_window_remove_child(struct MuttWindow *parent, struct MuttWindow *child)
Remove a child from a Window.
Definition: mutt_window.c:460
void window_set_visible(struct MuttWindow *win, bool visible)
Set a Window visible or hidden.
Definition: mutt_window.c:164
#define WA_RECALC
Recalculate the contents of the Window.
Definition: mutt_window.h:110
@ WT_CONTAINER
Invisible shaping container Window.
Definition: mutt_window.h:73
@ WT_DLG_INDEX
Index Dialog, index_pager_init()
Definition: mutt_window.h:86
@ WT_SIDEBAR
Side panel containing Accounts or groups of data.
Definition: mutt_window.h:101
@ 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.
Definition: mutt_window.h:208
@ NT_WINDOW_STATE
Window state has changed, e.g. WN_VISIBLE.
Definition: mutt_window.h:207
@ NT_WINDOW_DELETE
Window is about to be deleted.
Definition: mutt_window.h:206
#define WN_VISIBLE
Window became visible.
Definition: mutt_window.h:192
#define WN_HIDDEN
Window became hidden.
Definition: mutt_window.h:193
#define WA_REPAINT
Redraw the contents of the Window.
Definition: mutt_window.h:111
#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
void neomutt_mailboxlist_clear(struct MailboxList *ml)
Free a Mailbox List.
Definition: neomutt.c:141
size_t neomutt_mailboxlist_get_all(struct MailboxList *head, struct NeoMutt *n, enum MailboxType type)
Get a List of all Mailboxes.
Definition: neomutt.c:164
@ NT_WINDOW
MuttWindow has changed, NotifyWindow, EventWindow.
Definition: notify_type.h:55
@ 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
@ NT_ALL
Register for all notifications.
Definition: notify_type.h:35
#define STAILQ_HEAD_INITIALIZER(head)
Definition: queue.h:324
#define TAILQ_INSERT_TAIL(head, elm, field)
Definition: queue.h:809
#define STAILQ_FOREACH(var, head, field)
Definition: queue.h:352
#define TAILQ_FIRST(head)
Definition: queue.h:723
#define TAILQ_REMOVE(head, elm, field)
Definition: queue.h:841
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:432
static struct MuttWindow * sb_win_init(struct MuttWindow *dlg)
Initialise and insert the Sidebar Window.
Definition: observer.c:100
static bool calc_divider(struct SidebarWindowData *wdata)
Decide what actions are required for the divider.
Definition: observer.c:49
static void sb_init_data(struct MuttWindow *win)
Initialise the Sidebar data.
Definition: observer.c:156
void sb_win_remove_observers(struct MuttWindow *win)
Remove Observers from the Sidebar Window.
Definition: observer.c:452
GUI display the mailboxes in a side panel.
DivType
Source of the sidebar divider character.
Definition: private.h:55
@ SB_DIV_ASCII
An ASCII vertical bar (pipe)
Definition: private.h:57
@ SB_DIV_USER
User configured using $sidebar_divider_char.
Definition: private.h:56
@ SB_DIV_UTF8
A unicode line-drawing character.
Definition: private.h:58
void sb_remove_mailbox(struct SidebarWindowData *wdata, const struct Mailbox *m)
Remove a Mailbox from the Sidebar.
Definition: sidebar.c:120
struct SidebarWindowData * sb_wdata_new(struct MuttWindow *win, struct IndexSharedData *shared)
Create new Window data for the Sidebar.
Definition: wdata.c:43
void sb_set_current_mailbox(struct SidebarWindowData *wdata, struct Mailbox *m)
Set the current Mailbox.
Definition: sidebar.c:173
void sb_add_mailbox(struct SidebarWindowData *wdata, struct Mailbox *m)
Add a Mailbox to the Sidebar.
Definition: sidebar.c:83
struct SidebarWindowData * sb_wdata_get(struct MuttWindow *win)
Get the Sidebar data for this window.
Definition: wdata.c:73
struct MailboxList mailboxes
List of Mailboxes.
Definition: account.h:41
enum CommandResult(* parse)(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Definition: command.h:63
An Event that happened to an Account.
Definition: account.h:79
struct Account * account
The Account this Event relates to.
Definition: account.h:80
An Event that happened to a Colour.
Definition: notify2.h:53
enum ColorId cid
Colour ID that has changed.
Definition: notify2.h:54
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:186
struct Mailbox * mailbox
The Mailbox this Event relates to.
Definition: mailbox.h:187
An Event that happened to a Window.
Definition: mutt_window.h:216
struct MuttWindow * win
Window that changed.
Definition: mutt_window.h:217
WindowNotifyFlags flags
Attributes of Window that changed.
Definition: mutt_window.h:218
Data shared between Index, Pager and Sidebar.
Definition: shared_data.h:37
struct Mailbox * mailbox
Current Mailbox.
Definition: shared_data.h:41
List of Mailboxes.
Definition: mailbox.h:153
struct Mailbox * mailbox
Mailbox in the list.
Definition: mailbox.h:154
bool visible
True if a result of "mailboxes".
Definition: mailbox.h:130
int(* repaint)(struct MuttWindow *win)
Definition: mutt_window.h:182
short req_cols
Number of columns required.
Definition: mutt_window.h:124
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:127
struct MuttWindow * focus
Focused Window.
Definition: mutt_window.h:140
void * wdata
Private data.
Definition: mutt_window.h:145
enum MuttWindowOrientation orient
Which direction the Window will expand.
Definition: mutt_window.h:130
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
Definition: mutt_window.h:138
int(* recalc)(struct MuttWindow *win)
Definition: mutt_window.h:171
void(* wdata_free)(struct MuttWindow *win, void **ptr)
Definition: mutt_window.h:160
struct MuttWindowList children
Children Windows.
Definition: mutt_window.h:136
struct MuttWindow * parent
Parent Window.
Definition: mutt_window.h:135
WindowActionFlags actions
Actions to be performed, e.g. WA_RECALC.
Definition: mutt_window.h:132
enum WindowType type
Window type, e.g. WT_SIDEBAR.
Definition: mutt_window.h:144
Container for Accounts, Notifications.
Definition: neomutt.h:37
struct Notify * notify
Notifications handler.
Definition: neomutt.h:38
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:39
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:65
short divider_width
Width of the divider in screen columns.
Definition: private.h:77
enum DivType divider_type
Type of divider to use, e.g. SB_DIV_ASCII.
Definition: private.h:76
struct IndexSharedData * shared
Shared Index Data.
Definition: private.h:67
struct MuttWindow * win
Sidebar Window.
Definition: private.h:66
bool visible
Window is visible.
Definition: mutt_window.h:59