NeoMutt  2025-01-09-81-g753ae0
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 if (cid == MT_COLOR_MAX) // Sent on `uncolor *`
213 {
214 // Set a default style
216 ac->attrs = A_UNDERLINE;
217 }
218
219 switch (cid)
220 {
222 case MT_COLOR_NORMAL:
232 case MT_COLOR_MAX: // Sent on `uncolor *`
233 win->actions |= WA_REPAINT;
234 mutt_debug(LL_DEBUG5, "color done, request WA_REPAINT\n");
235 break;
236
237 default:
238 break;
239 }
240 return 0;
241}
242
247{
248 if (nc->event_type != NT_COMMAND)
249 return 0;
250 if (!nc->global_data || !nc->event_data)
251 return -1;
252
253 struct Command *cmd = nc->event_data;
254
255 if ((cmd->parse != sb_parse_sidebar_pin) && (cmd->parse != sb_parse_sidebar_unpin))
256 return 0;
257
258 struct MuttWindow *win = nc->global_data;
259 win->actions |= WA_RECALC;
260 mutt_debug(LL_DEBUG5, "command done, request WA_RECALC\n");
261 return 0;
262}
263
267static int sb_config_observer(struct NotifyCallback *nc)
268{
269 if (nc->event_type != NT_CONFIG)
270 return 0;
271 if (!nc->global_data || !nc->event_data)
272 return -1;
273
274 struct EventConfig *ev_c = nc->event_data;
275
276 if (!mutt_strn_equal(ev_c->name, "sidebar_", 8) &&
277 !mutt_str_equal(ev_c->name, "ascii_chars") &&
278 !mutt_str_equal(ev_c->name, "folder") && !mutt_str_equal(ev_c->name, "spool_file"))
279 {
280 return 0;
281 }
282
283 if (mutt_str_equal(ev_c->name, "sidebar_next_new_wrap"))
284 return 0; // Affects the behaviour, but not the display
285
286 mutt_debug(LL_DEBUG5, "config: %s\n", ev_c->name);
287
288 struct MuttWindow *win = nc->global_data;
289
290 if (mutt_str_equal(ev_c->name, "sidebar_visible"))
291 {
292 const bool c_sidebar_visible = cs_subset_bool(NeoMutt->sub, "sidebar_visible");
293 window_set_visible(win, c_sidebar_visible);
294 window_reflow(win->parent);
295 mutt_debug(LL_DEBUG5, "config done, request WA_REFLOW\n");
296 return 0;
297 }
298
299 if (mutt_str_equal(ev_c->name, "sidebar_width"))
300 {
301 const short c_sidebar_width = cs_subset_number(NeoMutt->sub, "sidebar_width");
302 win->req_cols = c_sidebar_width;
303 window_reflow(win->parent);
304 mutt_debug(LL_DEBUG5, "config done, request WA_REFLOW\n");
305 return 0;
306 }
307
308 if (mutt_str_equal(ev_c->name, "spool_file"))
309 {
310 win->actions |= WA_REPAINT;
311 mutt_debug(LL_DEBUG5, "config done, request WA_REPAINT\n");
312 return 0;
313 }
314
315 if (mutt_str_equal(ev_c->name, "sidebar_on_right"))
316 {
317 struct MuttWindow *parent = win->parent;
318 struct MuttWindow *first = TAILQ_FIRST(&parent->children);
319 const bool c_sidebar_on_right = cs_subset_bool(NeoMutt->sub, "sidebar_on_right");
320
321 if ((c_sidebar_on_right && (first == win)) || (!c_sidebar_on_right && (first != win)))
322 {
323 // Swap the Sidebar and the Container of the Index/Pager
324 TAILQ_REMOVE(&parent->children, first, entries);
325 TAILQ_INSERT_TAIL(&parent->children, first, entries);
326 }
327
328 window_reflow(win->parent);
329 mutt_debug(LL_DEBUG5, "config done, request WA_REFLOW\n");
330 return 0;
331 }
332
333 if (mutt_str_equal(ev_c->name, "ascii_chars") ||
334 mutt_str_equal(ev_c->name, "sidebar_divider_char"))
335 {
339 mutt_debug(LL_DEBUG5, "config done, request WA_RECALC\n");
340 return 0;
341 }
342
343 // All the remaining config changes...
345 mutt_debug(LL_DEBUG5, "config done, request WA_RECALC\n");
346 return 0;
347}
348
352static int sb_index_observer(struct NotifyCallback *nc)
353{
354 if (nc->event_type != NT_INDEX)
355 return 0;
356 if (!nc->global_data || !nc->event_data)
357 return 0;
358 if (!(nc->event_subtype & NT_INDEX_MAILBOX))
359 return 0;
360
361 struct MuttWindow *win_sidebar = nc->global_data;
362 struct IndexSharedData *shared = nc->event_data;
363
364 struct SidebarWindowData *wdata = sb_wdata_get(win_sidebar);
366
367 win_sidebar->actions |= WA_RECALC;
368 mutt_debug(LL_DEBUG5, "index done, request WA_RECALC\n");
369
370 return 0;
371}
372
377{
378 if (nc->event_type != NT_MAILBOX)
379 return 0;
380 if (!nc->global_data || !nc->event_data)
381 return -1;
382
383 struct MuttWindow *win = nc->global_data;
384
386 struct EventMailbox *ev_m = nc->event_data;
387
388 if (nc->event_subtype == NT_MAILBOX_ADD)
389 {
390 sb_add_mailbox(wdata, ev_m->mailbox);
391 }
392 else if (nc->event_subtype == NT_MAILBOX_DELETE)
393 {
394 sb_remove_mailbox(wdata, ev_m->mailbox);
395 }
396
397 win->actions |= WA_RECALC;
398 mutt_debug(LL_DEBUG5, "mailbox done, request WA_RECALC\n");
399 return 0;
400}
401
405static int sb_window_observer(struct NotifyCallback *nc)
406{
407 if (nc->event_type != NT_WINDOW)
408 return 0;
409 if (!nc->global_data || !nc->event_data)
410 return -1;
411
412 struct MuttWindow *win = nc->global_data;
413 struct EventWindow *ev_w = nc->event_data;
414 if (ev_w->win != win)
415 return 0;
416
418 {
420 mutt_debug(LL_DEBUG5, "window state done, request WA_RECALC\n");
421 }
422 else if (nc->event_subtype == NT_WINDOW_DELETE)
423 {
424 mutt_debug(LL_DEBUG5, "window delete done\n");
426 }
427 return 0;
428}
429
435{
436 if (!win || !NeoMutt)
437 return;
438
439 struct MuttWindow *dlg = window_find_parent(win, WT_DLG_INDEX);
440
448}
449
455{
456 if (!win || !NeoMutt)
457 return;
458
459 struct MuttWindow *dlg = window_find_parent(win, WT_DLG_INDEX);
460
468}
469
474{
475 if (nc->event_type != NT_WINDOW)
476 return 0;
477 if (!nc->event_data)
478 return -1;
480 return 0;
481
482 struct EventWindow *ev_w = nc->event_data;
483 if (ev_w->win->type != WT_DLG_INDEX)
484 return 0;
485
486 if (ev_w->flags & WN_VISIBLE)
487 {
488 mutt_debug(LL_DEBUG5, "insertion: visible\n");
489 struct MuttWindow *win_sidebar = sb_win_init(ev_w->win);
490 sb_init_data(win_sidebar);
491 }
492 else if (ev_w->flags & WN_HIDDEN)
493 {
494 mutt_debug(LL_DEBUG5, "insertion: hidden\n");
496 }
497
498 return 0;
499}
#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: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:36
@ MT_COLOR_SIDEBAR_DIVIDER
Line dividing sidebar from the index/pager.
Definition: color.h:71
@ MT_COLOR_MAX
Definition: color.h:99
@ MT_COLOR_SIDEBAR_NEW
Mailbox with new mail.
Definition: color.h:75
@ MT_COLOR_SIDEBAR_UNREAD
Mailbox with unread mail.
Definition: color.h:78
@ MT_COLOR_INDICATOR
Selected item in list.
Definition: color.h:50
@ MT_COLOR_SIDEBAR_SPOOLFILE
$spool_file (Spool mailbox)
Definition: color.h:77
@ MT_COLOR_SIDEBAR_ORDINARY
Mailbox with no new or flagged messages.
Definition: color.h:76
@ MT_COLOR_SIDEBAR_BACKGROUND
Background colour for the Sidebar.
Definition: color.h:70
@ MT_COLOR_NORMAL
Plain text.
Definition: color.h:55
@ MT_COLOR_SIDEBAR_INDICATOR
Current open mailbox.
Definition: color.h:74
@ MT_COLOR_SIDEBAR_HIGHLIGHT
Select cursor.
Definition: color.h:73
@ MT_COLOR_SIDEBAR_FLAGGED
Mailbox with flagged messages.
Definition: color.h:72
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:445
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:405
static int sb_mailbox_observer(struct NotifyCallback *nc)
Notification that a Mailbox has changed - Implements observer_t -.
Definition: observer.c:376
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:473
static int sb_command_observer(struct NotifyCallback *nc)
Notification that a Command has occurred - Implements observer_t -.
Definition: observer.c:246
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:352
static int sb_config_observer(struct NotifyCallback *nc)
Notification that a Config Variable has changed - Implements observer_t -.
Definition: observer.c:267
int sb_recalc(struct MuttWindow *win)
Recalculate the Sidebar display - Implements MuttWindow::recalc() -.
Definition: window.c:506
int sb_repaint(struct MuttWindow *win)
Repaint the Sidebar display - Implements MuttWindow::repaint() -.
Definition: window.c:695
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:70
@ 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:661
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:426
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
Definition: string.c:497
struct MuttWindow * window_find_parent(struct MuttWindow *win, enum WindowType type)
Find a (grand-)parent of a Window by type.
Definition: mutt_window.c:523
void mutt_window_add_child(struct MuttWindow *parent, struct MuttWindow *child)
Add a child to Window.
Definition: mutt_window.c:411
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:182
struct MuttWindow * mutt_window_remove_child(struct MuttWindow *parent, struct MuttWindow *child)
Remove a child from a Window.
Definition: mutt_window.c:433
void window_set_visible(struct MuttWindow *win, bool visible)
Set a Window visible or hidden.
Definition: mutt_window.c:165
#define WA_RECALC
Recalculate the contents of the Window.
Definition: mutt_window.h:110
@ WT_CONTAINER
Invisible shaping container Window.
Definition: mutt_window.h:74
@ WT_DLG_INDEX
Index Dialog, dlg_index()
Definition: mutt_window.h:87
@ 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:39
@ MUTT_WIN_ORIENT_HORIZONTAL
Window uses all available horizontal space.
Definition: mutt_window.h:40
@ NT_WINDOW_DIALOG
A new Dialog Window has been created, e.g. WT_DLG_INDEX.
Definition: mutt_window.h:231
@ NT_WINDOW_STATE
Window state has changed, e.g. WN_VISIBLE.
Definition: mutt_window.h:230
@ NT_WINDOW_DELETE
Window is about to be deleted.
Definition: mutt_window.h:229
#define WN_VISIBLE
Window became visible.
Definition: mutt_window.h:215
#define WN_HIDDEN
Window became hidden.
Definition: mutt_window.h:216
#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:53
@ MUTT_WIN_SIZE_FIXED
Window has a fixed size.
Definition: mutt_window.h:48
@ MUTT_WIN_SIZE_MAXIMISE
Window wants as much space as possible.
Definition: mutt_window.h:49
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:866
#define STAILQ_FOREACH(var, head, field)
Definition: queue.h:390
#define TAILQ_FIRST(head)
Definition: queue.h:780
#define TAILQ_REMOVE(head, elm, field)
Definition: queue.h:901
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:434
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:454
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:126
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:179
void sb_add_mailbox(struct SidebarWindowData *wdata, struct Mailbox *m)
Add a Mailbox to the Sidebar.
Definition: sidebar.c:89
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
A curses colour and its attributes.
Definition: attr.h:66
int attrs
Text attributes, e.g. A_BOLD.
Definition: attr.h:69
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:51
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:55
enum ColorId cid
Colour ID that has changed.
Definition: notify2.h:56
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: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:239
struct MuttWindow * win
Window that changed.
Definition: mutt_window.h:240
WindowNotifyFlags flags
Attributes of Window that changed.
Definition: mutt_window.h:241
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:187
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:173
void(* wdata_free)(struct MuttWindow *win, void **ptr)
Definition: mutt_window.h:159
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: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:60