NeoMutt  2024-10-02-34-g9dd811
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
observer.c
Go to the documentation of this file.
1
31#include "config.h"
32#include <stdbool.h>
33#include <stddef.h>
34#include "private.h"
35#include "mutt/lib.h"
36#include "config/lib.h"
37#include "core/lib.h"
38#include "gui/lib.h"
39#include "color/lib.h"
40#include "index/lib.h"
41
42void sb_win_remove_observers(struct MuttWindow *win);
43
52{
54 bool changed = false;
55 const char *const c_sidebar_divider_char = cs_subset_string(NeoMutt->sub, "sidebar_divider_char");
56
57 // Calculate the width of the delimiter in screen cells
58 int width = mutt_strwidth(c_sidebar_divider_char);
59 if (width < 1)
60 {
62 goto done;
63 }
64
65 const bool c_ascii_chars = cs_subset_bool(NeoMutt->sub, "ascii_chars");
66 if (c_ascii_chars || !CharsetIsUtf8)
67 {
68 const size_t len = mutt_str_len(c_sidebar_divider_char);
69 for (size_t i = 0; i < len; i++)
70 {
71 if (c_sidebar_divider_char[i] & ~0x7F) // high-bit is set
72 {
74 width = 1;
75 break;
76 }
77 }
78 }
79
80done:
81 changed = (width != wdata->divider_width);
82
83 wdata->divider_type = type;
84 wdata->divider_width = width;
85
86 return changed;
87}
88
94static struct MuttWindow *sb_win_init(struct MuttWindow *dlg)
95{
97
98 struct MuttWindow *index_panel = TAILQ_FIRST(&dlg->children);
99 mutt_window_remove_child(dlg, index_panel);
100
101 struct MuttWindow *pager_panel = TAILQ_FIRST(&dlg->children);
102 mutt_window_remove_child(dlg, pager_panel);
103
107 dlg->focus = cont_right;
108
109 mutt_window_add_child(cont_right, index_panel);
110 mutt_window_add_child(cont_right, pager_panel);
111 cont_right->focus = index_panel;
112
113 const short c_sidebar_width = cs_subset_number(NeoMutt->sub, "sidebar_width");
115 MUTT_WIN_SIZE_FIXED, c_sidebar_width,
117 const bool c_sidebar_visible = cs_subset_bool(NeoMutt->sub, "sidebar_visible");
118 win_sidebar->state.visible = c_sidebar_visible && (c_sidebar_width > 0);
119
120 struct IndexSharedData *shared = dlg->wdata;
121 win_sidebar->wdata = sb_wdata_new(win_sidebar, shared);
122 win_sidebar->wdata_free = sb_wdata_free;
123
124 calc_divider(win_sidebar->wdata);
125
126 win_sidebar->recalc = sb_recalc;
127 win_sidebar->repaint = sb_repaint;
128
129 const bool c_sidebar_on_right = cs_subset_bool(NeoMutt->sub, "sidebar_on_right");
130 if (c_sidebar_on_right)
131 {
132 mutt_window_add_child(dlg, cont_right);
133 mutt_window_add_child(dlg, win_sidebar);
134 }
135 else
136 {
137 mutt_window_add_child(dlg, win_sidebar);
138 mutt_window_add_child(dlg, cont_right);
139 }
140
141 sb_win_add_observers(win_sidebar);
142
143 return win_sidebar;
144}
145
150static void sb_init_data(struct MuttWindow *win)
151{
153 if (!wdata)
154 return;
155
156 if (!ARRAY_EMPTY(&wdata->entries))
157 return;
158
159 struct MailboxList ml = STAILQ_HEAD_INITIALIZER(ml);
161 struct MailboxNode *np = NULL;
162 STAILQ_FOREACH(np, &ml, entries)
163 {
164 if (np->mailbox->visible)
165 sb_add_mailbox(wdata, np->mailbox);
166 }
168}
169
174{
175 if (nc->event_type != NT_ACCOUNT)
176 return 0;
177 if (!nc->global_data || !nc->event_data)
178 return -1;
180 return 0;
181
182 struct MuttWindow *win = nc->global_data;
184 struct EventAccount *ev_a = nc->event_data;
185
186 struct MailboxNode *np = NULL;
187 STAILQ_FOREACH(np, &ev_a->account->mailboxes, entries)
188 {
189 sb_add_mailbox(wdata, np->mailbox);
190 }
191
192 win->actions |= WA_RECALC;
193 mutt_debug(LL_DEBUG5, "account done, request WA_RECALC\n");
194 return 0;
195}
196
200static int sb_color_observer(struct NotifyCallback *nc)
201{
202 if (nc->event_type != NT_COLOR)
203 return 0;
204 if (!nc->global_data || !nc->event_data)
205 return -1;
206
207 struct EventColor *ev_c = nc->event_data;
208 struct MuttWindow *win = nc->global_data;
209
210 enum ColorId cid = ev_c->cid;
211
212 switch (cid)
213 {
215 case MT_COLOR_NORMAL:
225 case MT_COLOR_MAX: // Sent on `uncolor *`
226 win->actions |= WA_REPAINT;
227 mutt_debug(LL_DEBUG5, "color done, request WA_REPAINT\n");
228 break;
229
230 default:
231 break;
232 }
233 return 0;
234}
235
240{
241 if (nc->event_type != NT_COMMAND)
242 return 0;
243 if (!nc->global_data || !nc->event_data)
244 return -1;
245
246 struct Command *cmd = nc->event_data;
247
248 if ((cmd->parse != sb_parse_sidebar_pin) && (cmd->parse != sb_parse_sidebar_unpin))
249 return 0;
250
251 struct MuttWindow *win = nc->global_data;
252 win->actions |= WA_RECALC;
253 mutt_debug(LL_DEBUG5, "command done, request WA_RECALC\n");
254 return 0;
255}
256
260static int sb_config_observer(struct NotifyCallback *nc)
261{
262 if (nc->event_type != NT_CONFIG)
263 return 0;
264 if (!nc->global_data || !nc->event_data)
265 return -1;
266
267 struct EventConfig *ev_c = nc->event_data;
268
269 if (!mutt_strn_equal(ev_c->name, "sidebar_", 8) &&
270 !mutt_str_equal(ev_c->name, "ascii_chars") &&
271 !mutt_str_equal(ev_c->name, "folder") && !mutt_str_equal(ev_c->name, "spool_file"))
272 {
273 return 0;
274 }
275
276 if (mutt_str_equal(ev_c->name, "sidebar_next_new_wrap"))
277 return 0; // Affects the behaviour, but not the display
278
279 mutt_debug(LL_DEBUG5, "config: %s\n", ev_c->name);
280
281 struct MuttWindow *win = nc->global_data;
282
283 if (mutt_str_equal(ev_c->name, "sidebar_visible"))
284 {
285 const bool c_sidebar_visible = cs_subset_bool(NeoMutt->sub, "sidebar_visible");
286 window_set_visible(win, c_sidebar_visible);
287 window_reflow(win->parent);
288 mutt_debug(LL_DEBUG5, "config done, request WA_REFLOW\n");
289 return 0;
290 }
291
292 if (mutt_str_equal(ev_c->name, "sidebar_width"))
293 {
294 const short c_sidebar_width = cs_subset_number(NeoMutt->sub, "sidebar_width");
295 win->req_cols = c_sidebar_width;
296 window_reflow(win->parent);
297 mutt_debug(LL_DEBUG5, "config done, request WA_REFLOW\n");
298 return 0;
299 }
300
301 if (mutt_str_equal(ev_c->name, "spool_file"))
302 {
303 win->actions |= WA_REPAINT;
304 mutt_debug(LL_DEBUG5, "config done, request WA_REPAINT\n");
305 return 0;
306 }
307
308 if (mutt_str_equal(ev_c->name, "sidebar_on_right"))
309 {
310 struct MuttWindow *parent = win->parent;
311 struct MuttWindow *first = TAILQ_FIRST(&parent->children);
312 const bool c_sidebar_on_right = cs_subset_bool(NeoMutt->sub, "sidebar_on_right");
313
314 if ((c_sidebar_on_right && (first == win)) || (!c_sidebar_on_right && (first != win)))
315 {
316 // Swap the Sidebar and the Container of the Index/Pager
317 TAILQ_REMOVE(&parent->children, first, entries);
318 TAILQ_INSERT_TAIL(&parent->children, first, entries);
319 }
320
321 window_reflow(win->parent);
322 mutt_debug(LL_DEBUG5, "config done, request WA_REFLOW\n");
323 return 0;
324 }
325
326 if (mutt_str_equal(ev_c->name, "ascii_chars") ||
327 mutt_str_equal(ev_c->name, "sidebar_divider_char"))
328 {
332 mutt_debug(LL_DEBUG5, "config done, request WA_RECALC\n");
333 return 0;
334 }
335
336 // All the remaining config changes...
338 mutt_debug(LL_DEBUG5, "config done, request WA_RECALC\n");
339 return 0;
340}
341
345static int sb_index_observer(struct NotifyCallback *nc)
346{
347 if (nc->event_type != NT_INDEX)
348 return 0;
349 if (!nc->global_data || !nc->event_data)
350 return 0;
351 if (!(nc->event_subtype & NT_INDEX_MAILBOX))
352 return 0;
353
354 struct MuttWindow *win_sidebar = nc->global_data;
355 struct IndexSharedData *shared = nc->event_data;
356
357 struct SidebarWindowData *wdata = sb_wdata_get(win_sidebar);
359
360 win_sidebar->actions |= WA_RECALC;
361 mutt_debug(LL_DEBUG5, "index done, request WA_RECALC\n");
362
363 return 0;
364}
365
370{
371 if (nc->event_type != NT_MAILBOX)
372 return 0;
373 if (!nc->global_data || !nc->event_data)
374 return -1;
375
376 struct MuttWindow *win = nc->global_data;
377
379 struct EventMailbox *ev_m = nc->event_data;
380
381 if (nc->event_subtype == NT_MAILBOX_ADD)
382 {
383 sb_add_mailbox(wdata, ev_m->mailbox);
384 }
385 else if (nc->event_subtype == NT_MAILBOX_DELETE)
386 {
387 sb_remove_mailbox(wdata, ev_m->mailbox);
388 }
389
390 win->actions |= WA_RECALC;
391 mutt_debug(LL_DEBUG5, "mailbox done, request WA_RECALC\n");
392 return 0;
393}
394
398static int sb_window_observer(struct NotifyCallback *nc)
399{
400 if (nc->event_type != NT_WINDOW)
401 return 0;
402 if (!nc->global_data || !nc->event_data)
403 return -1;
404
405 struct MuttWindow *win = nc->global_data;
406 struct EventWindow *ev_w = nc->event_data;
407 if (ev_w->win != win)
408 return 0;
409
411 {
413 mutt_debug(LL_DEBUG5, "window state done, request WA_RECALC\n");
414 }
415 else if (nc->event_subtype == NT_WINDOW_DELETE)
416 {
417 mutt_debug(LL_DEBUG5, "window delete done\n");
419 }
420 return 0;
421}
422
428{
429 if (!win || !NeoMutt)
430 return;
431
432 struct MuttWindow *dlg = window_find_parent(win, WT_DLG_INDEX);
433
441}
442
448{
449 if (!win || !NeoMutt)
450 return;
451
452 struct MuttWindow *dlg = window_find_parent(win, WT_DLG_INDEX);
453
461}
462
467{
468 if (nc->event_type != NT_WINDOW)
469 return 0;
470 if (!nc->event_data)
471 return -1;
473 return 0;
474
475 struct EventWindow *ev_w = nc->event_data;
476 if (ev_w->win->type != WT_DLG_INDEX)
477 return 0;
478
479 if (ev_w->flags & WN_VISIBLE)
480 {
481 mutt_debug(LL_DEBUG5, "insertion: visible\n");
482 struct MuttWindow *win_sidebar = sb_win_init(ev_w->win);
483 sb_init_data(win_sidebar);
484 }
485 else if (ev_w->flags & WN_HIDDEN)
486 {
487 mutt_debug(LL_DEBUG5, "insertion: hidden\n");
489 }
490
491 return 0;
492}
#define ARRAY_EMPTY(head)
Check if an array is empty.
Definition: array.h:74
Color and attribute parsing.
void mutt_color_observer_remove(observer_t callback, void *global_data)
Remove an observer.
Definition: notify.c:69
void mutt_color_observer_add(observer_t callback, void *global_data)
Add an observer.
Definition: notify.c:59
ColorId
List of all colored objects.
Definition: color.h:40
@ MT_COLOR_SIDEBAR_DIVIDER
Line dividing sidebar from the index/pager.
Definition: color.h:66
@ MT_COLOR_MAX
Definition: color.h:94
@ MT_COLOR_SIDEBAR_NEW
Mailbox with new mail.
Definition: color.h:70
@ MT_COLOR_SIDEBAR_UNREAD
Mailbox with unread mail.
Definition: color.h:73
@ MT_COLOR_INDICATOR
Selected item in list.
Definition: color.h:54
@ MT_COLOR_SIDEBAR_SPOOLFILE
$spool_file (Spool mailbox)
Definition: color.h:72
@ MT_COLOR_SIDEBAR_ORDINARY
Mailbox with no new or flagged messages.
Definition: color.h:71
@ MT_COLOR_SIDEBAR_BACKGROUND
Background colour for the Sidebar.
Definition: color.h:65
@ MT_COLOR_NORMAL
Plain text.
Definition: color.h:59
@ MT_COLOR_SIDEBAR_INDICATOR
Current open mailbox.
Definition: color.h:69
@ MT_COLOR_SIDEBAR_HIGHLIGHT
Select cursor.
Definition: color.h:68
@ MT_COLOR_SIDEBAR_FLAGGED
Mailbox with flagged messages.
Definition: color.h:67
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:70
Convenience wrapper for the core headers.
@ NT_MAILBOX_DELETE
Mailbox is about to be deleted.
Definition: mailbox.h:183
@ NT_MAILBOX_ADD
Mailbox has been added.
Definition: mailbox.h:182
@ MUTT_MAILBOX_ANY
Match any Mailbox type.
Definition: mailbox.h:42
size_t mutt_strwidth(const char *s)
Measure a string's width in screen cells.
Definition: curs_lib.c:443
enum CommandResult sb_parse_sidebar_pin(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'sidebar_pin' command - Implements Command::parse() -.
Definition: commands.c:41
enum CommandResult sb_parse_sidebar_unpin(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'sidebar_unpin' command - Implements Command::parse() -.
Definition: commands.c:60
#define mutt_debug(LEVEL,...)
Definition: logging2.h:89
static int sb_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
Definition: observer.c:398
static int sb_mailbox_observer(struct NotifyCallback *nc)
Notification that a Mailbox has changed - Implements observer_t -.
Definition: observer.c:369
static int sb_account_observer(struct NotifyCallback *nc)
Notification that an Account has changed - Implements observer_t -.
Definition: observer.c:173
int sb_insertion_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
Definition: observer.c:466
static int sb_command_observer(struct NotifyCallback *nc)
Notification that a Command has occurred - Implements observer_t -.
Definition: observer.c:239
static int sb_color_observer(struct NotifyCallback *nc)
Notification that a Color has changed - Implements observer_t -.
Definition: observer.c:200
static int sb_index_observer(struct NotifyCallback *nc)
Notification that the Index has changed - Implements observer_t -.
Definition: observer.c:345
static int sb_config_observer(struct NotifyCallback *nc)
Notification that a Config Variable has changed - Implements observer_t -.
Definition: observer.c:260
int sb_recalc(struct MuttWindow *win)
Recalculate the Sidebar display - Implements MuttWindow::recalc() -.
Definition: window.c:777
int sb_repaint(struct MuttWindow *win)
Repaint the Sidebar display - Implements MuttWindow::repaint() -.
Definition: window.c:966
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:64
@ LL_DEBUG5
Log at debug level 5.
Definition: logging2.h:47
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:660
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:425
size_t mutt_str_len(const char *a)
Calculate the length of a string, 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:557
void mutt_window_add_child(struct MuttWindow *parent, struct MuttWindow *child)
Add a child to Window.
Definition: mutt_window.c:445
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:467
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:109
@ 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.
Definition: mutt_window.h:100
@ 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:230
@ NT_WINDOW_STATE
Window state has changed, e.g. WN_VISIBLE.
Definition: mutt_window.h:229
@ NT_WINDOW_DELETE
Window is about to be deleted.
Definition: mutt_window.h:228
#define WN_VISIBLE
Window became visible.
Definition: mutt_window.h:214
#define WN_HIDDEN
Window became hidden.
Definition: mutt_window.h:215
#define WA_REPAINT
Redraw the contents of the Window.
Definition: mutt_window.h:110
#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:168
size_t neomutt_mailboxlist_get_all(struct MailboxList *head, struct NeoMutt *n, enum MailboxType type)
Get a List of all Mailboxes.
Definition: neomutt.c:191
@ 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
@ 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:427
static struct MuttWindow * sb_win_init(struct MuttWindow *dlg)
Initialise and insert the Sidebar Window.
Definition: observer.c:94
static bool calc_divider(struct SidebarWindowData *wdata)
Decide what actions are required for the divider.
Definition: observer.c:51
static void sb_init_data(struct MuttWindow *win)
Initialise the Sidebar data.
Definition: observer.c:150
void sb_win_remove_observers(struct MuttWindow *win)
Remove Observers from the Sidebar Window.
Definition: observer.c:447
GUI display the mailboxes in a side panel.
DivType
Source of the sidebar divider character.
Definition: private.h:79
@ SB_DIV_ASCII
An ASCII vertical bar (pipe)
Definition: private.h:81
@ SB_DIV_USER
User configured using $sidebar_divider_char.
Definition: private.h:80
void sb_remove_mailbox(struct SidebarWindowData *wdata, const struct Mailbox *m)
Remove a Mailbox from the Sidebar.
Definition: sidebar.c:125
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:178
void sb_add_mailbox(struct SidebarWindowData *wdata, struct Mailbox *m)
Add a Mailbox to the Sidebar.
Definition: sidebar.c:88
struct SidebarWindowData * sb_wdata_get(struct MuttWindow *win)
Get the Sidebar data for this window.
Definition: wdata.c:77
struct MailboxList mailboxes
List of Mailboxes.
Definition: account.h:40
enum CommandResult(* parse)(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Definition: command.h:65
struct Notify * notify
Notifications: NotifyConfig, EventConfig.
Definition: subset.h:52
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:71
const char * name
Name of config item that changed.
Definition: subset.h:73
An Event that happened to a Mailbox.
Definition: mailbox.h:199
struct Mailbox * mailbox
The Mailbox this Event relates to.
Definition: mailbox.h:200
An Event that happened to a Window.
Definition: mutt_window.h:238
struct MuttWindow * win
Window that changed.
Definition: mutt_window.h:239
WindowNotifyFlags flags
Attributes of Window that changed.
Definition: mutt_window.h:240
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:166
struct Mailbox * mailbox
Mailbox in the list.
Definition: mailbox.h:167
bool visible
True if a result of "mailboxes".
Definition: mailbox.h:130
int(* repaint)(struct MuttWindow *win)
Definition: mutt_window.h:186
short req_cols
Number of columns required.
Definition: mutt_window.h:123
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:126
struct MuttWindow * focus
Focused Window.
Definition: mutt_window.h:139
void * wdata
Private data.
Definition: mutt_window.h:144
enum MuttWindowOrientation orient
Which direction the Window will expand.
Definition: mutt_window.h:129
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
Definition: mutt_window.h:137
int(* recalc)(struct MuttWindow *win)
Definition: mutt_window.h:172
void(* wdata_free)(struct MuttWindow *win, void **ptr)
Definition: mutt_window.h:158
struct MuttWindowList children
Children Windows.
Definition: mutt_window.h:135
struct MuttWindow * parent
Parent Window.
Definition: mutt_window.h:134
WindowActionFlags actions
Actions to be performed, e.g. WA_RECALC.
Definition: mutt_window.h:131
enum WindowType type
Window type, e.g. WT_SIDEBAR.
Definition: mutt_window.h:143
Container for Accounts, Notifications.
Definition: neomutt.h:42
struct Notify * notify
Notifications handler.
Definition: neomutt.h:43
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:46
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:88
short divider_width
Width of the divider in screen columns.
Definition: private.h:100
enum DivType divider_type
Type of divider to use, e.g. SB_DIV_ASCII.
Definition: private.h:99
struct IndexSharedData * shared
Shared Index Data.
Definition: private.h:90
struct MuttWindow * win
Sidebar Window.
Definition: private.h:89
bool visible
Window is visible.
Definition: mutt_window.h:59