NeoMutt  2020-06-26-89-g172cd3
Teaching an old dog new tricks
DOXYGEN
mutt_window.c
Go to the documentation of this file.
1 
29 #include "config.h"
30 #include <stdarg.h>
31 #include <string.h>
32 #include "mutt/lib.h"
33 #include "config/lib.h"
34 #include "core/lib.h"
35 #include "debug/lib.h"
36 #include "mutt_window.h"
37 #include "mutt_curses.h"
38 #include "mutt_globals.h"
39 #include "mutt_menu.h"
40 #include "options.h"
41 #include "reflow.h"
42 
43 struct MuttWindow *RootWindow = NULL;
44 struct MuttWindow *MuttDialogWindow = NULL;
45 struct MuttWindow *MuttHelpWindow = NULL;
46 struct MuttWindow *MuttMessageWindow = NULL;
47 
52 static void window_notify(struct MuttWindow *win)
53 {
54  if (!win->notify)
55  return;
56 
57  const struct WindowState *old = &win->old;
58  const struct WindowState *new = &win->state;
60 
61  if (new->visible != old->visible)
62  flags |= new->visible ? WN_VISIBLE : WN_HIDDEN;
63 
64  if ((new->row_offset != old->row_offset) || (new->col_offset != old->col_offset))
65  flags |= WN_MOVED;
66 
67  if (new->rows > old->rows)
68  flags |= WN_TALLER;
69  else if (new->rows < old->rows)
70  flags |= WN_SHORTER;
71 
72  if (new->cols > old->cols)
73  flags |= WN_WIDER;
74  else if (new->cols < old->cols)
75  flags |= WN_NARROWER;
76 
77  if (flags == WN_NO_FLAGS)
78  return;
79 
80  struct EventWindow ev_w = { win, flags };
82  win->old = win->state;
83 }
84 
90 {
91  if (!win)
92  win = RootWindow;
93 
94  window_notify(win);
95 
96  struct MuttWindow *np = NULL;
97  TAILQ_FOREACH(np, &win->children, entries)
98  {
100  }
101 }
102 
108 void window_set_visible(struct MuttWindow *win, bool visible)
109 {
110  if (!win)
111  win = RootWindow;
112 
113  win->state.visible = visible;
114 
115  struct MuttWindow *np = NULL;
116  TAILQ_FOREACH(np, &win->children, entries)
117  {
118  window_set_visible(np, visible);
119  }
120 }
121 
132  enum MuttWindowSize size, int cols, int rows)
133 {
134  struct MuttWindow *win = mutt_mem_calloc(1, sizeof(struct MuttWindow));
135 
136  win->type = type;
137  win->orient = orient;
138  win->size = size;
139  win->req_rows = rows;
140  win->req_cols = cols;
141  win->state.visible = true;
142  win->notify = notify_new();
143  TAILQ_INIT(&win->children);
144  return win;
145 }
146 
151 void mutt_window_free(struct MuttWindow **ptr)
152 {
153  if (!ptr || !*ptr)
154  return;
155 
156  struct MuttWindow *win = *ptr;
157 
158  struct EventWindow ev_w = { win, WN_NO_FLAGS };
160 
162 
163  if (win->wdata && win->wdata_free)
164  win->wdata_free(win, &win->wdata); // Custom function to free private data
165 
166  notify_free(&win->notify);
167 
168  FREE(ptr);
169 }
170 
171 #ifdef USE_SLANG_CURSES
172 
179 static int vw_printw(SLcurses_Window_Type *win, const char *fmt, va_list ap)
180 {
181  char buf[1024];
182 
183  (void) SLvsnprintf(buf, sizeof(buf), (char *) fmt, ap);
184  SLcurses_waddnstr(win, buf, -1);
185  return 0;
186 }
187 #endif
188 
194 void mutt_window_clearline(struct MuttWindow *win, int row)
195 {
196  mutt_window_move(win, 0, row);
198 }
199 
206 {
207  clrtobot();
208 }
209 
217 {
218  if (!win || !stdscr)
219  return;
220 
221  if (win->state.col_offset + win->state.cols == COLS)
222  clrtoeol();
223  else
224  {
225  int row = 0;
226  int col = 0;
227  getyx(stdscr, row, col);
228  int curcol = col;
229  while (curcol < (win->state.col_offset + win->state.cols))
230  {
231  addch(' ');
232  curcol++;
233  }
234  move(row, col);
235  }
236 }
237 
242 {
243  if (!nc->event_data || !nc->global_data)
244  return -1;
245  if (nc->event_type != NT_CONFIG)
246  return 0;
247 
248  struct EventConfig *ec = nc->event_data;
249  struct MuttWindow *root_win = nc->global_data;
250 
251  if (mutt_str_equal(ec->name, "help"))
252  {
253  MuttHelpWindow->state.visible = C_Help;
254  goto reflow;
255  }
256 
257  if (mutt_str_equal(ec->name, "status_on_top"))
258  {
259  struct MuttWindow *first = TAILQ_FIRST(&root_win->children);
260  if (!first)
261  return -1;
262 
263  if ((C_StatusOnTop && (first->type == WT_HELP_BAR)) ||
264  (!C_StatusOnTop && (first->type != WT_HELP_BAR)))
265  {
266  // Swap the HelpLine and the Dialogs Container
267  struct MuttWindow *next = TAILQ_NEXT(first, entries);
268  if (!next)
269  return -1;
270  TAILQ_REMOVE(&root_win->children, next, entries);
271  TAILQ_INSERT_HEAD(&root_win->children, next, entries);
272  }
273  }
274 
275 reflow:
276  mutt_window_reflow(root_win);
277  return 0;
278 }
279 
284 {
285  if (NeoMutt)
287  MuttDialogWindow = NULL;
288  MuttHelpWindow = NULL;
289  MuttMessageWindow = NULL;
290  mutt_window_free(&RootWindow);
291 }
292 
302 void mutt_window_get_coords(struct MuttWindow *win, int *col, int *row)
303 {
304  int x = 0;
305  int y = 0;
306 
307  getyx(stdscr, y, x);
308  if (col)
309  *col = x - win->state.col_offset;
310  if (row)
311  *row = y - win->state.row_offset;
312 }
313 
320 {
321  if (RootWindow)
322  return;
323 
324  RootWindow =
326  notify_set_parent(RootWindow->notify, NeoMutt->notify);
327 
330  MuttHelpWindow->state.visible = C_Help;
331 
335 
338 
339  if (C_StatusOnTop)
340  {
341  mutt_window_add_child(RootWindow, MuttDialogWindow);
342  mutt_window_add_child(RootWindow, MuttHelpWindow);
343  }
344  else
345  {
346  mutt_window_add_child(RootWindow, MuttHelpWindow);
347  mutt_window_add_child(RootWindow, MuttDialogWindow);
348  }
349 
350  mutt_window_add_child(RootWindow, MuttMessageWindow);
352 }
353 
362 int mutt_window_move(struct MuttWindow *win, int col, int row)
363 {
364  return move(win->state.row_offset + row, win->state.col_offset + col);
365 }
366 
376 int mutt_window_mvaddstr(struct MuttWindow *win, int col, int row, const char *str)
377 {
378 #ifdef USE_SLANG_CURSES
379  return mvaddstr(win->state.row_offset + row, win->state.col_offset + col, (char *) str);
380 #else
381  return mvaddstr(win->state.row_offset + row, win->state.col_offset + col, str);
382 #endif
383 }
384 
395 int mutt_window_mvprintw(struct MuttWindow *win, int col, int row, const char *fmt, ...)
396 {
397  int rc = mutt_window_move(win, col, row);
398  if (rc == ERR)
399  return rc;
400 
401  va_list ap;
402  va_start(ap, fmt);
403  rc = vw_printw(stdscr, fmt, ap);
404  va_end(ap);
405 
406  return rc;
407 }
408 
414 void mutt_window_copy_size(const struct MuttWindow *win_src, struct MuttWindow *win_dst)
415 {
416  if (!win_src || !win_dst)
417  return;
418 
419  win_dst->state.rows = win_src->state.rows;
420  win_dst->state.cols = win_src->state.cols;
421  win_dst->state.row_offset = win_src->state.row_offset;
422  win_dst->state.col_offset = win_src->state.col_offset;
423 }
424 
430 {
431  if (OptNoCurses)
432  return;
433 
434  if (!win)
435  win = RootWindow;
436 
437  mutt_debug(LL_DEBUG2, "entering\n");
438  window_reflow(win);
439  window_notify_all(win);
440 
442  /* the pager menu needs this flag set to recalc line_info */
444 #ifdef USE_DEBUG_WINDOW
445  debug_win_dump();
446 #endif
447 }
448 
456 {
457  MuttMessageWindow->req_rows = mw_rows;
458  mutt_window_reflow(MuttMessageWindow->parent);
459 
460  /* We don't also set REDRAW_FLOW because this function only
461  * changes rows and is a temporary adjustment. */
463 }
464 
473 int mutt_window_wrap_cols(int width, short wrap)
474 {
475  if (wrap < 0)
476  return (width > -wrap) ? (width + wrap) : width;
477  if (wrap)
478  return (wrap < width) ? wrap : width;
479  return width;
480 }
481 
488 int mutt_window_addch(int ch)
489 {
490  return addch(ch);
491 }
492 
500 int mutt_window_addnstr(const char *str, int num)
501 {
502  if (!str)
503  return -1;
504 
505 #ifdef USE_SLANG_CURSES
506  return addnstr((char *) str, num);
507 #else
508  return addnstr(str, num);
509 #endif
510 }
511 
518 int mutt_window_addstr(const char *str)
519 {
520  if (!str)
521  return -1;
522 
523 #ifdef USE_SLANG_CURSES
524  return addstr((char *) str);
525 #else
526  return addstr(str);
527 #endif
528 }
529 
535 void mutt_window_move_abs(int col, int row)
536 {
537  move(row, col);
538 }
539 
546 int mutt_window_printf(const char *fmt, ...)
547 {
548  va_list ap;
549  va_start(ap, fmt);
550  int rc = vw_printw(stdscr, fmt, ap);
551  va_end(ap);
552 
553  return rc;
554 }
555 
561 void mutt_window_add_child(struct MuttWindow *parent, struct MuttWindow *child)
562 {
563  if (!parent || !child)
564  return;
565 
566  TAILQ_INSERT_TAIL(&parent->children, child, entries);
567  child->parent = parent;
568 
569  notify_set_parent(child->notify, parent->notify);
570 
571  struct EventWindow ev_w = { child, WN_NO_FLAGS };
572  notify_send(child->notify, NT_WINDOW, NT_WINDOW_NEW, &ev_w);
573 }
574 
581 {
582  if (!parent || !child)
583  return NULL;
584 
585  struct EventWindow ev_w = { child, WN_NO_FLAGS };
586  notify_send(child->notify, NT_WINDOW, NT_WINDOW_DELETE, &ev_w);
587 
588  TAILQ_REMOVE(&parent->children, child, entries);
589  child->parent = NULL;
590 
591  notify_set_parent(child->notify, NULL);
592 
593  return child;
594 }
595 
600 void mutt_winlist_free(struct MuttWindowList *head)
601 {
602  if (!head)
603  return;
604 
605  struct MuttWindow *np = NULL;
606  struct MuttWindow *tmp = NULL;
607  TAILQ_FOREACH_SAFE(np, head, entries, tmp)
608  {
609  TAILQ_REMOVE(head, np, entries);
611  mutt_window_free(&np);
612  }
613 }
614 
620 void mutt_window_set_root(int cols, int rows)
621 {
622  if (!RootWindow)
623  return;
624 
625  bool changed = false;
626 
627  if (RootWindow->state.rows != rows)
628  {
629  RootWindow->state.rows = rows;
630  changed = true;
631  }
632 
633  if (RootWindow->state.cols != cols)
634  {
635  RootWindow->state.cols = cols;
636  changed = true;
637  }
638 
639  if (changed)
640  {
641  mutt_window_reflow(RootWindow);
642  }
643 }
644 
654 {
655  if (!win)
656  return false;
657 
658  for (; win; win = win->parent)
659  {
660  if (!win->state.visible)
661  return false;
662  }
663 
664  return true;
665 }
666 
675 {
676  for (; win && win->parent; win = win->parent)
677  {
678  if (win->parent->type == WT_ALL_DIALOGS)
679  return win;
680  }
681 
682  return NULL;
683 }
684 
693 {
694  if (!root)
695  return NULL;
696  if (root->type == type)
697  return root;
698 
699  struct MuttWindow *np = NULL;
700  struct MuttWindow *match = NULL;
701  TAILQ_FOREACH(np, &root->children, entries)
702  {
703  match = mutt_window_find(np, type);
704  if (match)
705  return match;
706  }
707 
708  return NULL;
709 }
710 
720 void dialog_push(struct MuttWindow *dlg)
721 {
722  if (!dlg || !MuttDialogWindow)
723  return;
724 
725  struct MuttWindow *last = TAILQ_LAST(&MuttDialogWindow->children, MuttWindowList);
726  if (last)
727  last->state.visible = false;
728 
729  TAILQ_INSERT_TAIL(&MuttDialogWindow->children, dlg, entries);
730  notify_set_parent(dlg->notify, MuttDialogWindow->notify);
731 
732  // Notify the world, allowing plugins to integrate
733  struct EventWindow ev_w = { dlg, WN_VISIBLE };
735 
736  dlg->state.visible = true;
737  dlg->parent = MuttDialogWindow;
738  mutt_window_reflow(MuttDialogWindow);
739 #ifdef USE_DEBUG_WINDOW
740  debug_win_dump();
741 #endif
742 }
743 
750 void dialog_pop(void)
751 {
752  if (!MuttDialogWindow)
753  return;
754 
755  struct MuttWindow *last = TAILQ_LAST(&MuttDialogWindow->children, MuttWindowList);
756  if (!last)
757  return;
758 
759  // Notify the world, allowing plugins to clean up
760  struct EventWindow ev_w = { last, WN_HIDDEN };
762 
763  last->state.visible = false;
764  last->parent = NULL;
765  TAILQ_REMOVE(&MuttDialogWindow->children, last, entries);
766 
767  last = TAILQ_LAST(&MuttDialogWindow->children, MuttWindowList);
768  if (last)
769  {
770  last->state.visible = true;
771  mutt_window_reflow(MuttDialogWindow);
772  }
774 #ifdef USE_DEBUG_WINDOW
775  debug_win_dump();
776 #endif
777 }
778 
784 {
785  if (!win)
786  return;
787 
788  if (win->recalc)
789  win->recalc(win, false);
790 
791  struct MuttWindow *np = NULL;
792  TAILQ_FOREACH(np, &win->children, entries)
793  {
794  if (np->recalc)
795  np->recalc(np, false);
796  }
797 }
798 
803 void window_repaint(struct MuttWindow *win)
804 {
805  if (!win)
806  return;
807 
808  if (win->repaint)
809  win->repaint(win, false);
810 
811  struct MuttWindow *np = NULL;
812  TAILQ_FOREACH(np, &win->children, entries)
813  {
814  if (np->repaint)
815  np->repaint(np, false);
816  }
817 }
818 
823 void window_redraw(struct MuttWindow *win)
824 {
825  if (!win)
826  return;
827 
828  window_reflow(win);
829  window_notify_all(win);
830 
831  window_recalc(win);
832  window_repaint(win);
833 }
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition: string.c:876
static int mutt_dlg_rootwin_observer(struct NotifyCallback *nc)
Listen for config changes affecting the Root Window - Implements observer_t.
Definition: mutt_window.c:241
#define WN_NARROWER
Window became narrower.
Definition: mutt_window.h:156
#define REDRAW_FULL
Redraw everything.
Definition: mutt_menu.h:45
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Definition: memory.c:50
Define wrapper functions around Curses/Slang.
A new Dialog Window has been created, e.g. WT_DLG_INDEX.
Definition: mutt_window.h:171
struct MuttWindow * mutt_window_remove_child(struct MuttWindow *parent, struct MuttWindow *child)
Remove a child from a Window.
Definition: mutt_window.c:580
enum MuttWindowOrientation orient
Which direction the Window will expand.
Definition: mutt_window.h:122
#define TAILQ_FIRST(head)
Definition: queue.h:716
void(* wdata_free)(struct MuttWindow *win, void **ptr)
Callback function to free private data.
Definition: mutt_window.h:134
Data passed to a notification function.
Definition: observer.h:39
struct MuttWindow * win
Window that changed.
Definition: mutt_window.h:179
void mutt_window_init(void)
Create the default Windows.
Definition: mutt_window.c:319
#define TAILQ_FOREACH(var, head, field)
Definition: queue.h:718
Window management.
void window_recalc(struct MuttWindow *win)
Recalculate a tree of Windows.
Definition: mutt_window.c:783
An Event that happened to a Window.
Definition: mutt_window.h:177
#define TAILQ_LAST(head, headname)
Definition: queue.h:812
Window for messages/errors and command entry.
Definition: mutt_window.h:95
Window uses all available vertical space.
Definition: mutt_window.h:35
void notify_free(struct Notify **ptr)
Free a notification handler.
Definition: notify.c:62
void dialog_pop(void)
Hide a Window from the user.
Definition: mutt_window.c:750
#define REDRAW_FLOW
Used by pager to reflow text.
Definition: mutt_menu.h:47
void mutt_window_free_all(void)
Free all the default Windows.
Definition: mutt_window.c:283
static int const char * fmt
Definition: acutest.h:488
struct MuttWindow * mutt_window_find(struct MuttWindow *root, enum WindowType type)
Find a Window of a given type.
Definition: mutt_window.c:692
void mutt_window_clrtoeol(struct MuttWindow *win)
Clear to the end of the line.
Definition: mutt_window.c:216
void dialog_push(struct MuttWindow *dlg)
Display a Window to the user.
Definition: mutt_window.c:720
#define WN_NO_FLAGS
No flags are set.
Definition: mutt_window.h:152
WindowType
Type of Window.
Definition: mutt_window.h:66
MuttWindowOrientation
Which way does the Window expand?
Definition: mutt_window.h:33
A config-change event.
Definition: subset.h:70
#define TAILQ_FOREACH_SAFE(var, head, field, tvar)
Definition: queue.h:728
Parent of All Windows.
Definition: mutt_window.h:69
#define WN_WIDER
Window became wider.
Definition: mutt_window.h:155
Window is about to be deleted.
Definition: mutt_window.h:169
void window_redraw(struct MuttWindow *win)
Reflow, recalc and repaint a tree of Windows.
Definition: mutt_window.c:823
WHERE bool OptNoCurses
(pseudo) when sending in batch mode
Definition: options.h:48
#define WN_HIDDEN
Window became hidden.
Definition: mutt_window.h:159
A division of the screen.
Definition: mutt_window.h:114
void mutt_window_move_abs(int col, int row)
Move the cursor to an absolute screen position.
Definition: mutt_window.c:535
short col_offset
Absolute on-screen column.
Definition: mutt_window.h:59
void window_reflow(struct MuttWindow *win)
Reflow Windows.
Definition: reflow.c:222
int mutt_window_mvaddstr(struct MuttWindow *win, int col, int row, const char *str)
Move the cursor and write a fixed string to a Window.
Definition: mutt_window.c:376
Container for Accounts, Notifications.
Definition: neomutt.h:36
MuttWindow has changed, NotifyWindow, EventWindow.
Definition: notify_type.h:41
Convenience wrapper for the config headers.
int mutt_window_move(struct MuttWindow *win, int col, int row)
Move the cursor in a Window.
Definition: mutt_window.c:362
void mutt_window_free(struct MuttWindow **ptr)
Free a Window and its children.
Definition: mutt_window.c:151
enum NotifyType event_type
Send: Event type, e.g. NT_ACCOUNT.
Definition: observer.h:41
int mutt_window_addnstr(const char *str, int num)
Write a partial string to a Window.
Definition: mutt_window.c:500
struct Notify * notify
Notifications system.
Definition: mutt_window.h:130
Log at debug level 2.
Definition: logging.h:41
void mutt_window_copy_size(const struct MuttWindow *win_src, struct MuttWindow *win_dst)
Copy the size of one Window to another.
Definition: mutt_window.c:414
void mutt_window_clearline(struct MuttWindow *win, int row)
Clear a row of a Window.
Definition: mutt_window.c:194
Convenience wrapper for the core headers.
New Window has been added.
Definition: mutt_window.h:168
va_start(args, fmt)
void mutt_winlist_free(struct MuttWindowList *head)
Free a tree of Windows.
Definition: mutt_window.c:600
#define TAILQ_INIT(head)
Definition: queue.h:758
void mutt_window_clrtobot(void)
Clear to the bottom of the Window.
Definition: mutt_window.c:205
void * global_data
Data from notify_observer_add()
Definition: observer.h:44
Window has a fixed size.
Definition: mutt_window.h:44
#define TAILQ_REMOVE(head, elm, field)
Definition: queue.h:834
void mutt_window_reflow_message_rows(int mw_rows)
Resize the Message Window.
Definition: mutt_window.c:455
Window state has changed, e.g. WN_VISIBLE.
Definition: mutt_window.h:170
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:57
struct Notify * notify_new(void)
Create a new notifications handler.
Definition: notify.c:49
void mutt_window_get_coords(struct MuttWindow *win, int *col, int *row)
Get the cursor position in the Window.
Definition: mutt_window.c:302
void mutt_window_set_root(int cols, int rows)
Set the dimensions of the Root Window.
Definition: mutt_window.c:620
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:119
#define WN_TALLER
Window became taller.
Definition: mutt_window.h:153
struct MuttWindow * RootWindow
Parent of all Windows.
Definition: mutt_window.c:43
bool visible
Window is visible.
Definition: mutt_window.h:56
bool mutt_window_is_visible(struct MuttWindow *win)
Is the Window visible?
Definition: mutt_window.c:653
short row_offset
Absolute on-screen row.
Definition: mutt_window.h:60
#define MUTT_WIN_SIZE_UNLIMITED
Use as much space as possible.
Definition: mutt_window.h:49
short rows
Number of rows, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:58
uint8_t WindowNotifyFlags
Changes to a MuttWindow.
Definition: mutt_window.h:151
static void window_notify(struct MuttWindow *win)
Notify observers of changes to a Window.
Definition: mutt_window.c:52
Help Bar containing list of useful key bindings.
Definition: mutt_window.h:92
#define WN_SHORTER
Window became shorter.
Definition: mutt_window.h:154
GUI present the user with a selectable list.
struct WindowState old
Previous state of the Window.
Definition: mutt_window.h:120
int mutt_window_wrap_cols(int width, short wrap)
Calculate the wrap column for a given screen width.
Definition: mutt_window.c:473
#define TAILQ_INSERT_TAIL(head, elm, field)
Definition: queue.h:802
enum MuttWindowSize size
Type of Window, e.g. MUTT_WIN_SIZE_FIXED.
Definition: mutt_window.h:123
struct Notify * notify
Notifications handler.
Definition: neomutt.h:38
Container for All Dialogs (nested Windows)
Definition: mutt_window.h:71
bool notify_observer_add(struct Notify *notify, observer_t callback, void *global_data)
Add an observer to an object.
Definition: notify.c:153
void * event_data
Data from notify_send()
Definition: observer.h:43
void mutt_window_add_child(struct MuttWindow *parent, struct MuttWindow *child)
Add a child to Window.
Definition: mutt_window.c:561
Window management.
struct MuttWindow * mutt_window_dialog(struct MuttWindow *win)
Find the parent Dialog of a Window.
Definition: mutt_window.c:674
The current, or old, state of a Window.
Definition: mutt_window.h:54
void window_notify_all(struct MuttWindow *win)
Notify observers of changes to a Window and its children.
Definition: mutt_window.c:89
Config has changed, NotifyConfig, EventConfig.
Definition: notify_type.h:36
#define TAILQ_INSERT_HEAD(head, elm, field)
Definition: queue.h:789
void window_repaint(struct MuttWindow *win)
Repaint a tree of Windows.
Definition: mutt_window.c:803
int mutt_window_printf(const char *fmt,...)
Write a formatted string to a Window.
Definition: mutt_window.c:546
int mutt_window_addch(int ch)
Write one character to a Window.
Definition: mutt_window.c:488
Convenience wrapper for the debug headers.
void window_set_visible(struct MuttWindow *win, bool visible)
Set a Window (and its children) visible or hidden.
Definition: mutt_window.c:108
void mutt_window_reflow(struct MuttWindow *win)
Resize a Window and its children.
Definition: mutt_window.c:429
WHERE bool C_StatusOnTop
Config: Display the status bar at the top.
Definition: mutt_globals.h:166
struct MuttWindow * parent
Parent Window.
Definition: mutt_window.h:127
#define WN_VISIBLE
Window became visible.
Definition: mutt_window.h:158
#define FREE(x)
Definition: memory.h:40
MuttWindowSize
Control the allocation of Window space.
Definition: mutt_window.h:42
struct MuttWindowList children
Children Windows.
Definition: mutt_window.h:128
short req_rows
Number of rows required.
Definition: mutt_window.h:117
bool notify_observer_remove(struct Notify *notify, observer_t callback, void *global_data)
Remove an observer from an object.
Definition: notify.c:185
int mutt_window_mvprintw(struct MuttWindow *win, int col, int row, const char *fmt,...)
Move the cursor and write a formatted string to a Window.
Definition: mutt_window.c:395
void notify_set_parent(struct Notify *notify, struct Notify *parent)
Set the parent notification handler.
Definition: notify.c:82
int mutt_window_addstr(const char *str)
Write a string to a Window.
Definition: mutt_window.c:518
#define TAILQ_NEXT(elm, field)
Definition: queue.h:825
void debug_win_dump(void)
Definition: window.c:87
Hundreds of global variables to back the user variables.
Handling of global boolean variables.
#define mutt_debug(LEVEL,...)
Definition: logging.h:81
int(* repaint)(struct MuttWindow *win, bool all)
Repaint the Window.
Definition: mutt_window.h:148
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:131
Convenience wrapper for the library headers.
struct MuttWindow * MuttDialogWindow
Parent of all Dialogs.
Definition: mutt_window.c:44
Window wants as much space as possible.
Definition: mutt_window.h:45
void * wdata
Private data.
Definition: mutt_window.h:133
WHERE bool C_Help
Config: Display a help line with common key bindings.
Definition: mutt_globals.h:153
enum WindowType type
Window type, e.g. WT_SIDEBAR.
Definition: mutt_window.h:132
const char * name
Name of config item that changed.
Definition: subset.h:73
int(* recalc)(struct MuttWindow *win, bool all)
Recalculate the Window data.
Definition: mutt_window.h:141
#define WN_MOVED
Window moved.
Definition: mutt_window.h:157
short req_cols
Number of columns required.
Definition: mutt_window.h:116
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
Definition: notify.c:137
va_end(args)