NeoMutt  2021-10-22-8-g9cb437
Teaching an old dog new tricks
DOXYGEN
dlgalias.c
Go to the documentation of this file.
1 
74 #include "config.h"
75 #include <stdbool.h>
76 #include <stdint.h>
77 #include <stdio.h>
78 #include <string.h>
79 #include "mutt/lib.h"
80 #include "address/lib.h"
81 #include "config/lib.h"
82 #include "core/lib.h"
83 #include "gui/lib.h"
84 #include "lib.h"
85 #include "menu/lib.h"
86 #include "pattern/lib.h"
87 #include "question/lib.h"
88 #include "alias.h"
89 #include "format_flags.h"
90 #include "gui.h"
91 #include "muttlib.h"
92 #include "opcodes.h"
93 
95 static const struct Mapping AliasHelp[] = {
96  // clang-format off
97  { N_("Exit"), OP_EXIT },
98  { N_("Del"), OP_DELETE },
99  { N_("Undel"), OP_UNDELETE },
100  { N_("Sort"), OP_SORT },
101  { N_("Rev-Sort"), OP_SORT_REVERSE },
102  { N_("Select"), OP_GENERIC_SELECT_ENTRY },
103  { N_("Help"), OP_HELP },
104  { NULL, 0 },
105  // clang-format on
106 };
107 
120 static const char *alias_format_str(char *buf, size_t buflen, size_t col, int cols,
121  char op, const char *src, const char *prec,
122  const char *if_str, const char *else_str,
123  intptr_t data, MuttFormatFlags flags)
124 {
125  char fmt[128], addr[1024];
126  struct AliasView *av = (struct AliasView *) data;
127  struct Alias *alias = av->alias;
128 
129  switch (op)
130  {
131  case 'a':
132  mutt_format_s(buf, buflen, prec, alias->name);
133  break;
134  case 'c':
135  mutt_format_s(buf, buflen, prec, alias->comment);
136  break;
137  case 'f':
138  snprintf(fmt, sizeof(fmt), "%%%ss", prec);
139  snprintf(buf, buflen, fmt, av->is_deleted ? "D" : " ");
140  break;
141  case 'n':
142  snprintf(fmt, sizeof(fmt), "%%%sd", prec);
143  snprintf(buf, buflen, fmt, av->num + 1);
144  break;
145  case 'r':
146  addr[0] = '\0';
147  mutt_addrlist_write(&alias->addr, addr, sizeof(addr), true);
148  mutt_format_s(buf, buflen, prec, addr);
149  break;
150  case 't':
151  buf[0] = av->is_tagged ? '*' : ' ';
152  buf[1] = '\0';
153  break;
154  }
155 
156  return src;
157 }
158 
162 static void alias_make_entry(struct Menu *menu, char *buf, size_t buflen, int line)
163 {
164  const struct AliasMenuData *mdata = menu->mdata;
165  const struct AliasViewArray *ava = &mdata->ava;
166  const struct AliasView *av = ARRAY_GET(ava, line);
167 
168  const char *const alias_format = cs_subset_string(mdata->sub, "alias_format");
169 
170  mutt_expando_format(buf, buflen, 0, menu->win->state.cols, NONULL(alias_format),
171  alias_format_str, (intptr_t) av, MUTT_FORMAT_ARROWCURSOR);
172 }
173 
177 static int alias_tag(struct Menu *menu, int sel, int act)
178 {
179  const struct AliasMenuData *mdata = menu->mdata;
180  const struct AliasViewArray *ava = &mdata->ava;
181  struct AliasView *av = ARRAY_GET(ava, sel);
182 
183  bool ot = av->is_tagged;
184 
185  av->is_tagged = ((act >= 0) ? act : !av->is_tagged);
186 
187  return av->is_tagged - ot;
188 }
189 
193 static int alias_alias_observer(struct NotifyCallback *nc)
194 {
195  if ((nc->event_type != NT_ALIAS) || !nc->global_data || !nc->event_data)
196  return -1;
197 
198  struct EventAlias *ev_a = nc->event_data;
199  struct Menu *menu = nc->global_data;
200  struct AliasMenuData *mdata = menu->mdata;
201  struct Alias *alias = ev_a->alias;
202 
203  if (nc->event_subtype == NT_ALIAS_ADD)
204  {
205  alias_array_alias_add(&mdata->ava, alias);
206 
207  if (alias_array_count_visible(&mdata->ava) != ARRAY_SIZE(&mdata->ava))
208  {
209  mutt_pattern_alias_func(NULL, mdata, menu);
210  }
211  }
212  else if (nc->event_subtype == NT_ALIAS_DELETE)
213  {
214  alias_array_alias_delete(&mdata->ava, alias);
215 
216  int vcount = alias_array_count_visible(&mdata->ava);
217  int index = menu_get_index(menu);
218  if ((index > (vcount - 1)) && (index > 0))
219  menu_set_index(menu, index - 1);
220  }
221 
222  alias_array_sort(&mdata->ava, mdata->sub);
223 
224  menu->max = alias_array_count_visible(&mdata->ava);
226  mutt_debug(LL_DEBUG5, "alias done, request WA_RECALC, MENU_REDRAW_FULL\n");
227 
228  return 0;
229 }
230 
239 {
240  if ((nc->event_type != NT_WINDOW) || !nc->global_data || !nc->event_data)
241  return -1;
242 
243  if (nc->event_subtype != NT_WINDOW_DELETE)
244  return 0;
245 
246  struct MuttWindow *win_menu = nc->global_data;
247  struct EventWindow *ev_w = nc->event_data;
248  if (ev_w->win != win_menu)
249  return 0;
250 
251  struct Menu *menu = win_menu->wdata;
252 
256 
257  mutt_debug(LL_DEBUG5, "window delete done\n");
258  return 0;
259 }
260 
267 {
269 
270  struct Menu *menu = dlg->wdata;
272  menu->custom_search = true;
273  menu->tag = alias_tag;
274  menu->max = alias_array_count_visible(&mdata->ava);
275  menu->mdata = mdata;
276 
277  struct MuttWindow *win_menu = menu->win;
278 
279  // Override the Simple Dialog's recalc()
280  win_menu->recalc = alias_recalc;
281 
282  struct MuttWindow *sbar = window_find_child(dlg, WT_STATUS_BAR);
283 
284  alias_set_title(sbar, _("Aliases"), mdata->str);
285 
286  // NT_COLOR is handled by the SimpleDialog
290 
291  return dlg;
292 }
293 
300 static void dlg_select_alias(char *buf, size_t buflen, struct AliasMenuData *mdata)
301 {
302  if (ARRAY_EMPTY(&mdata->ava))
303  {
304  mutt_warning(_("You have no aliases"));
305  return;
306  }
307 
308  struct MuttWindow *dlg = alias_dialog_new(mdata);
309  struct Menu *menu = dlg->wdata;
310  struct MuttWindow *sbar = window_find_child(dlg, WT_STATUS_BAR);
311 
312  int t = -1;
313  bool done = false;
314 
315  alias_array_sort(&mdata->ava, mdata->sub);
316 
317  struct AliasView *avp = NULL;
318  ARRAY_FOREACH(avp, &mdata->ava)
319  {
320  avp->num = ARRAY_FOREACH_IDX;
321  }
322 
323  while (!done)
324  {
325  int op = menu_loop(menu);
326  switch (op)
327  {
328  case OP_DELETE:
329  case OP_UNDELETE:
330  if (menu->tagprefix)
331  {
332  ARRAY_FOREACH(avp, &mdata->ava)
333  {
334  if (avp->is_tagged)
335  avp->is_deleted = (op == OP_DELETE);
336  }
338  }
339  else
340  {
341  int index = menu_get_index(menu);
342  ARRAY_GET(&mdata->ava, index)->is_deleted = (op == OP_DELETE);
344  const bool c_resolve = cs_subset_bool(NeoMutt->sub, "resolve");
345  if (c_resolve && (index < (menu->max - 1)))
346  {
347  menu_set_index(menu, index + 1);
349  }
350  }
351  break;
352  case OP_SORT:
353  case OP_SORT_REVERSE:
354  {
355  int sort = cs_subset_sort(mdata->sub, "sort_alias");
356  bool resort = true;
357  bool reverse = (op == OP_SORT_REVERSE);
358 
359  switch (mutt_multi_choice(
360  reverse ?
361  /* L10N: The highlighted letters must match the "Sort" options */
362  _("Rev-Sort (a)lias, a(d)dress or (u)nsorted?") :
363  /* L10N: The highlighted letters must match the "Rev-Sort" options */
364  _("Sort (a)lias, a(d)dress or (u)nsorted?"),
365  /* L10N: These must match the highlighted letters from "Sort" and "Rev-Sort" */
366  _("adu")))
367  {
368  case -1: /* abort */
369  resort = false;
370  break;
371 
372  case 1: /* (a)lias */
373  sort = SORT_ALIAS;
374  break;
375 
376  case 2: /* a(d)dress */
377  sort = SORT_ADDRESS;
378  break;
379 
380  case 3: /* (u)nsorted */
381  sort = SORT_ORDER;
382  break;
383  }
384 
385  if (resort)
386  {
387  sort |= reverse ? SORT_REVERSE : 0;
388 
389  // This will trigger a WA_RECALC
390  cs_subset_str_native_set(mdata->sub, "sort_alias", sort, NULL);
391  }
392 
393  break;
394  }
395  case OP_SEARCH_REVERSE:
396  case OP_SEARCH_NEXT:
397  case OP_SEARCH_OPPOSITE:
398  case OP_SEARCH:
399  {
400  int index = mutt_search_alias_command(menu, menu_get_index(menu), op);
401  if (index == -1)
402  break;
403 
404  menu_set_index(menu, index);
405  break;
406  }
407 
408  case OP_MAIN_LIMIT:
409  {
410  int rc = mutt_pattern_alias_func(_("Limit to addresses matching: "), mdata, menu);
411  if (rc == 0)
412  {
413  alias_set_title(sbar, _("Aliases"), mdata->str);
415  window_redraw(NULL);
416  }
417 
418  break;
419  }
420 
421  case OP_GENERIC_SELECT_ENTRY:
422  t = menu_get_index(menu);
423  if (t >= ARRAY_SIZE(&mdata->ava))
424  t = -1;
425  done = true;
426  break;
427 
428  case OP_EXIT:
429  done = true;
430  break;
431  }
432  }
433 
434  ARRAY_FOREACH(avp, &mdata->ava)
435  {
436  if (avp->is_tagged)
437  {
438  mutt_addrlist_write(&avp->alias->addr, buf, buflen, true);
439  t = -1;
440  }
441  }
442 
443  if (t != -1)
444  {
445  mutt_addrlist_write(&ARRAY_GET(&mdata->ava, t)->alias->addr, buf, buflen, true);
446  }
447 
448  simple_dialog_free(&dlg);
449 }
450 
463 int alias_complete(char *buf, size_t buflen, struct ConfigSubset *sub)
464 {
465  struct Alias *np = NULL;
466  char bestname[8192] = { 0 };
467 
468  struct AliasMenuData mdata = { NULL, ARRAY_HEAD_INITIALIZER, sub };
469  mdata.str = mutt_str_dup(buf);
470 
471  if (buf[0] != '\0')
472  {
473  TAILQ_FOREACH(np, &Aliases, entries)
474  {
475  if (np->name && mutt_strn_equal(np->name, buf, strlen(buf)))
476  {
477  if (bestname[0] == '\0') /* init */
478  {
479  mutt_str_copy(bestname, np->name,
480  MIN(mutt_str_len(np->name) + 1, sizeof(bestname)));
481  }
482  else
483  {
484  int i;
485  for (i = 0; np->name[i] && (np->name[i] == bestname[i]); i++)
486  ; // do nothing
487 
488  bestname[i] = '\0';
489  }
490  }
491  }
492 
493  if (bestname[0] != '\0')
494  {
495  /* fake the pattern for menu title */
496  char *mtitle = NULL;
497  mutt_str_asprintf(&mtitle, "~f ^%s", buf);
498  FREE(&mdata.str);
499  mdata.str = mtitle;
500 
501  if (!mutt_str_equal(bestname, buf))
502  {
503  /* we are adding something to the completion */
504  mutt_str_copy(buf, bestname, mutt_str_len(bestname) + 1);
505  FREE(&mdata.str);
506  return 1;
507  }
508 
509  /* build alias list and show it */
510  TAILQ_FOREACH(np, &Aliases, entries)
511  {
512  int aasize = alias_array_alias_add(&mdata.ava, np);
513 
514  struct AliasView *av = ARRAY_GET(&mdata.ava, aasize - 1);
515 
516  if (np->name && !mutt_strn_equal(np->name, buf, strlen(buf)))
517  {
518  av->is_visible = false;
519  }
520  }
521  }
522  }
523 
524  if (ARRAY_EMPTY(&mdata.ava))
525  {
526  TAILQ_FOREACH(np, &Aliases, entries)
527  {
528  alias_array_alias_add(&mdata.ava, np);
529  }
530 
531  mutt_pattern_alias_func(NULL, &mdata, NULL);
532  }
533 
534  alias_array_sort(&mdata.ava, mdata.sub);
535 
536  bestname[0] = '\0';
537  dlg_select_alias(bestname, sizeof(bestname), &mdata);
538  if (bestname[0] != '\0')
539  mutt_str_copy(buf, bestname, buflen);
540 
541  struct AliasView *avp = NULL;
542  ARRAY_FOREACH(avp, &mdata.ava)
543  {
544  if (!avp->is_deleted)
545  continue;
546 
547  TAILQ_REMOVE(&Aliases, avp->alias, entries);
548  alias_free(&avp->alias);
549  }
550 
551  ARRAY_FREE(&mdata.ava);
552  FREE(&mdata.str);
553 
554  return 0;
555 }
size_t mutt_addrlist_write(const struct AddressList *al, char *buf, size_t buflen, bool display)
Write an Address to a buffer.
Definition: address.c:1150
Email Address Handling.
void alias_array_sort(struct AliasViewArray *ava, const struct ConfigSubset *sub)
Sort and reindex an AliasViewArray.
Definition: sort.c:157
void alias_free(struct Alias **ptr)
Free an Alias.
Definition: alias.c:629
struct AliasList Aliases
List of all the user's email aliases.
Definition: alias.c:57
Representation of a single alias to an email address.
@ NT_ALIAS_ADD
Alias has been added.
Definition: alias.h:54
@ NT_ALIAS_DELETE
Alias is about to be deleted.
Definition: alias.h:55
int alias_array_count_visible(struct AliasViewArray *ava)
Count number of visible Aliases.
Definition: array.c:91
int alias_array_alias_delete(struct AliasViewArray *ava, struct Alias *alias)
Delete an Alias from the AliasViewArray.
Definition: array.c:69
int alias_array_alias_add(struct AliasViewArray *ava, struct Alias *alias)
Add an Alias to the AliasViewArray.
Definition: array.c:45
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
Definition: array.h:208
#define ARRAY_EMPTY(head)
Check if an array is empty.
Definition: array.h:70
#define ARRAY_SIZE(head)
The number of elements stored.
Definition: array.h:83
#define ARRAY_FREE(head)
Release all memory.
Definition: array.h:200
#define ARRAY_GET(head, idx)
Return the element at index.
Definition: array.h:105
#define ARRAY_HEAD_INITIALIZER
Static initializer for arrays.
Definition: array.h:54
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
void mutt_format_s(char *buf, size_t buflen, const char *prec, const char *s)
Format a simple string.
Definition: curs_lib.c:872
static void dlg_select_alias(char *buf, size_t buflen, struct AliasMenuData *mdata)
Display a menu of Aliases.
Definition: dlgalias.c:300
static const struct Mapping AliasHelp[]
Help Bar for the Alias dialog (address book)
Definition: dlgalias.c:95
struct MuttWindow * alias_dialog_new(struct AliasMenuData *mdata)
Create an Alias Selection Dialog.
Definition: dlgalias.c:266
int alias_complete(char *buf, size_t buflen, struct ConfigSubset *sub)
Alias completion routine.
Definition: dlgalias.c:463
Flags to control mutt_expando_format()
#define MUTT_FORMAT_ARROWCURSOR
Reserve space for arrow_cursor.
Definition: format_flags.h:35
uint8_t MuttFormatFlags
Flags for mutt_expando_format(), e.g. MUTT_FORMAT_FORCESUBJ.
Definition: format_flags.h:29
static const char * alias_format_str(char *buf, size_t buflen, size_t col, int cols, char op, const char *src, const char *prec, const char *if_str, const char *else_str, intptr_t data, MuttFormatFlags flags)
Format a string for the alias list - Implements format_t -.
Definition: dlgalias.c:120
void mutt_expando_format(char *buf, size_t buflen, size_t col, int cols, const char *src, format_t callback, intptr_t data, MuttFormatFlags flags)
Expand expandos (x) in a string -.
Definition: muttlib.c:780
#define mutt_warning(...)
Definition: logging.h:85
#define mutt_debug(LEVEL,...)
Definition: logging.h:84
static void alias_make_entry(struct Menu *menu, char *buf, size_t buflen, int line)
Format a menu item for the alias list - Implements Menu::make_entry() -.
Definition: dlgalias.c:162
static int alias_tag(struct Menu *menu, int sel, int act)
Tag some aliases - Implements Menu::tag() -.
Definition: dlgalias.c:177
static int alias_alias_observer(struct NotifyCallback *nc)
Notification that an Alias has changed - Implements observer_t -.
Definition: dlgalias.c:193
int alias_config_observer(struct NotifyCallback *nc)
Notification that a Config Variable has changed - Implements observer_t -.
Definition: gui.c:43
int alias_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
Definition: dlgalias.c:238
int alias_recalc(struct MuttWindow *win)
Recalculate the display of the Alias Window - Implements MuttWindow::recalc() -.
Definition: gui.c:87
Convenience wrapper for the gui headers.
struct MuttWindow * simple_dialog_new(enum MenuType mtype, enum WindowType wtype, const struct Mapping *help_data)
Create a simple index Dialog.
Definition: simple.c:126
void simple_dialog_free(struct MuttWindow **ptr)
Destroy a simple index Dialog.
Definition: simple.c:163
void alias_set_title(struct MuttWindow *sbar, char *menu_name, char *limit)
Create a title string for the Menu.
Definition: gui.c:67
Shared code for the Alias and Query Dialogs.
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition: helpers.c:317
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition: helpers.c:73
short cs_subset_sort(const struct ConfigSubset *sub, const char *name)
Get a sort config item by name.
Definition: helpers.c:292
@ LL_DEBUG5
Log at debug level 5.
Definition: logging.h:44
#define FREE(x)
Definition: memory.h:40
#define MIN(a, b)
Definition: memory.h:31
GUI present the user with a selectable list.
#define MENU_REDRAW_FULL
Redraw everything.
Definition: lib.h:55
#define MENU_REDRAW_INDEX
Redraw the index.
Definition: lib.h:52
void menu_queue_redraw(struct Menu *menu, MenuRedrawFlags redraw)
Queue a request for a redraw.
Definition: menu.c:632
int menu_get_index(struct Menu *menu)
Get the current selection in the Menu.
Definition: menu.c:608
int menu_loop(struct Menu *menu)
Menu event loop.
Definition: menu.c:283
#define MENU_REDRAW_CURRENT
Redraw the current line of the menu.
Definition: lib.h:54
MenuRedrawFlags menu_set_index(struct Menu *menu, int index)
Set the current selection in the Menu.
Definition: menu.c:622
Convenience wrapper for the library headers.
#define N_(a)
Definition: message.h:32
#define _(a)
Definition: message.h:28
bool notify_observer_remove(struct Notify *notify, observer_t callback, 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
int mutt_str_asprintf(char **strp, const char *fmt,...)
Definition: string.c:1128
char * mutt_str_dup(const char *str)
Copy a string, safely.
Definition: string.c:370
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition: string.c:904
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:593
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
Definition: string.c:664
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
Definition: string.c:749
void window_redraw(struct MuttWindow *win)
Reflow, recalc and repaint a tree of Windows.
Definition: mutt_window.c:602
struct MuttWindow * window_find_child(struct MuttWindow *win, enum WindowType type)
Recursively find a child Window of a given type.
Definition: mutt_window.c:520
@ WT_DLG_ALIAS
Alias Dialog, dlg_select_alias()
Definition: mutt_window.h:77
@ WT_STATUS_BAR
Status Bar containing extra info about the Index/Pager/etc.
Definition: mutt_window.h:102
@ NT_WINDOW_DELETE
Window is about to be deleted.
Definition: mutt_window.h:206
Some miscellaneous functions.
@ NT_WINDOW
MuttWindow has changed, NotifyWindow, EventWindow.
Definition: notify_type.h:53
@ NT_CONFIG
Config has changed, NotifyConfig, EventConfig.
Definition: notify_type.h:42
@ NT_ALIAS
Alias has changed, NotifyAlias, EventAlias.
Definition: notify_type.h:35
All user-callable functions.
Match patterns to emails.
int mutt_search_alias_command(struct Menu *menu, int cur, int op)
Perform a search.
Definition: pattern.c:653
int mutt_pattern_alias_func(char *prompt, struct AliasMenuData *mdata, struct Menu *menu)
Perform some Pattern matching for Alias.
Definition: pattern.c:243
Ask the user a question.
int mutt_multi_choice(const char *prompt, const char *letters)
Offer the user a multiple choice question.
Definition: question.c:50
#define TAILQ_FOREACH(var, head, field)
Definition: queue.h:725
#define TAILQ_REMOVE(head, elm, field)
Definition: queue.h:841
@ SORT_ORDER
Sort by the order the messages appear in the mailbox.
Definition: sort2.h:48
@ SORT_ALIAS
Sort by email alias.
Definition: sort2.h:53
@ SORT_ADDRESS
Sort by email address.
Definition: sort2.h:54
#define SORT_REVERSE
Reverse the order of the sort.
Definition: sort2.h:79
Key value store.
#define NONULL(x)
Definition: string2.h:37
AliasView array wrapper with Pattern information -.
Definition: gui.h:52
struct AliasViewArray ava
Array of AliasView.
Definition: gui.h:54
char * str
String representing the limit being used.
Definition: gui.h:53
struct ConfigSubset * sub
Config items.
Definition: gui.h:55
GUI data wrapping an Alias.
Definition: gui.h:36
bool is_visible
Is visible?
Definition: gui.h:43
struct Alias * alias
Alias.
Definition: gui.h:44
bool is_deleted
Is it deleted?
Definition: gui.h:42
bool is_tagged
Is it tagged?
Definition: gui.h:41
int num
Index number in list.
Definition: gui.h:37
A shortcut for an email address or addresses.
Definition: alias.h:34
char * comment
Free-form comment string.
Definition: alias.h:37
char * name
Short name.
Definition: alias.h:35
struct AddressList addr
List of Addresses the Alias expands to.
Definition: alias.h:36
A set of inherited config items.
Definition: subset.h:47
An alias-change event.
Definition: alias.h:64
struct Alias * alias
Alias that changed.
Definition: alias.h:65
An Event that happened to a Window.
Definition: mutt_window.h:216
struct MuttWindow * win
Window that changed.
Definition: mutt_window.h:217
Mapping between user-readable string and a constant.
Definition: mapping.h:32
Definition: lib.h:67
struct MuttWindow * win
Window holding the Menu.
Definition: lib.h:74
void(* make_entry)(struct Menu *menu, char *buf, size_t buflen, int line)
Definition: lib.h:103
int(* tag)(struct Menu *menu, int sel, int act)
Definition: lib.h:128
bool tagprefix
User has pressed <tag-prefix>
Definition: lib.h:73
void * mdata
Private data.
Definition: lib.h:153
int max
Number of entries in the menu.
Definition: lib.h:69
bool custom_search
The menu implements its own non-Menusearch()-compatible search, trickle OP_SEARCH*.
Definition: lib.h:91
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:127
void * wdata
Private data.
Definition: mutt_window.h:145
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
Definition: mutt_window.h:138
int(* recalc)(struct MuttWindow *win)
Definition: mutt_window.h:171
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
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:60
int cs_subset_str_native_set(const struct ConfigSubset *sub, const char *name, intptr_t value, struct Buffer *err)
Natively set the value of a string config item.
Definition: subset.c:305
@ MENU_ALIAS
Select an email address by its alias.
Definition: type.h:37