NeoMutt  2025-12-11-980-ge38c27
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
draw.c File Reference

Paint the Menu. More...

#include "config.h"
#include <stdbool.h>
#include <string.h>
#include <wchar.h>
#include "mutt/lib.h"
#include "config/lib.h"
#include "email/lib.h"
#include "core/lib.h"
#include "gui/lib.h"
#include "lib.h"
#include "color/lib.h"
#include "index/lib.h"
#include "pattern/lib.h"
+ Include dependency graph for draw.c:

Go to the source code of this file.

Functions

static const struct AttrColorget_color (int index, unsigned char *s)
 Choose a colour for a line of the index.
 
static void print_enriched_string (struct MuttWindow *win, int index, const struct AttrColor *ac_def, struct AttrColor *ac_ind, struct Buffer *buf, struct ConfigSubset *sub)
 Display a string with embedded colours and graphics.
 
static void menu_pad_string (struct Menu *menu, struct Buffer *buf)
 Pad a string with spaces for display in the Menu.
 
void menu_redraw_full (struct Menu *menu)
 Force the redraw of the Menu.
 
void menu_redraw_index (struct Menu *menu)
 Force the redraw of the index.
 
void menu_redraw_motion (struct Menu *menu)
 Force the redraw of the list part of the menu.
 
void menu_redraw_current (struct Menu *menu)
 Redraw the current menu.
 
int menu_redraw (struct Menu *menu)
 Redraw the parts of the screen that have been flagged to be redrawn.
 

Detailed Description

Paint the Menu.

Authors
  • Richard Russon
  • Pietro Cerutti

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file draw.c.

Function Documentation

◆ get_color()

static const struct AttrColor * get_color ( int index,
unsigned char * s )
static

Choose a colour for a line of the index.

Parameters
indexIndex number
sString of embedded colour codes
Return values
numColour pair in an integer

Text is coloured by inserting special characters into the string, e.g. MT_COLOR_INDEX_AUTHOR

Definition at line 53 of file draw.c.

54{
55 const int type = *s;
56 struct RegexColorList *rcl = regex_colors_get_list(type);
57 struct Mailbox *m_cur = get_current_mailbox();
58 struct Email *e = mutt_get_virt_email(m_cur, index);
59 if (!rcl || !e)
60 {
61 return simple_color_get(type);
62 }
63
64 struct RegexColor *np = NULL;
65 const struct AttrColor *ac_merge = NULL;
66
68 ASSERT(mod_data);
69
70 struct Buffer *buf = buf_pool_get();
71 buf_strcpy(buf, (const char *) (s + 1));
72 char *marker = (char *) buf_find_char(buf, MUTT_SPECIAL_INDEX);
73 if (marker)
74 *marker = '\0';
75
76 // %Gx %{tags-transformed} - Transformed message tags
77 if (type == MT_COLOR_INDEX_TAG)
78 {
79 STAILQ_FOREACH(np, rcl, entries)
80 {
81 const char *transform = mutt_hash_find(mod_data->tag_transforms, np->pattern);
82 if (transform && strstr(buf_string(buf), transform))
83
84 {
85 ac_merge = merged_color_overlay(ac_merge, &np->attr_color);
86 }
87 }
88 goto done;
89 }
90
91 STAILQ_FOREACH(np, rcl, entries)
92 {
94 MUTT_MATCH_FULL_ADDRESS, m_cur, e, NULL))
95 {
96 ac_merge = merged_color_overlay(ac_merge, &np->attr_color);
97 }
98 }
99
100done:
101 buf_pool_release(&buf);
102 return ac_merge;
103}
const char * buf_find_char(const struct Buffer *buf, const char c)
Return a pointer to a char found in the buffer.
Definition buffer.c:659
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition buffer.c:401
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition buffer.h:96
struct RegexColorList * regex_colors_get_list(enum ColorId cid)
Return the RegexColorList for a Colour ID.
Definition regex.c:192
struct AttrColor * simple_color_get(enum ColorId cid)
Get the colour of an object by its ID.
Definition simple.c:98
@ MT_COLOR_INDEX_TAG
Index: tag field (G)
Definition color.h:95
@ MUTT_SPECIAL_INDEX
Colour indicator.
Definition thread.h:72
void * mutt_hash_find(const struct HashTable *table, const char *strkey)
Find the HashElem data in a Hash Table element using a key.
Definition hash.c:365
struct Mailbox * get_current_mailbox(void)
Get the current Mailbox.
Definition index.c:725
const struct AttrColor * merged_color_overlay(const struct AttrColor *base, const struct AttrColor *over)
Combine two colours.
Definition merged.c:110
@ MODULE_ID_EMAIL
ModuleEmail, Email code
Definition module_api.h:64
struct Email * mutt_get_virt_email(struct Mailbox *m, int vnum)
Get a virtual Email.
Definition mview.c:378
void * neomutt_get_module_data(struct NeoMutt *n, enum ModuleId id)
Get the private data for a Module.
Definition neomutt.c:666
bool mutt_pattern_exec(struct Pattern *pat, PatternExecFlags flags, struct Mailbox *m, struct Email *e, struct PatternCache *cache)
Match a pattern against an email header.
Definition exec.c:1151
@ MUTT_MATCH_FULL_ADDRESS
Match the full address.
Definition lib.h:117
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
Definition pool.c:91
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
Definition pool.c:111
#define STAILQ_FOREACH(var, head, field)
Definition queue.h:390
#define SLIST_FIRST(head)
Definition queue.h:227
#define ASSERT(COND)
Definition signal2.h:59
A curses colour and its attributes.
Definition attr.h:65
String manipulation buffer.
Definition buffer.h:36
Email private Module data.
Definition module_data.h:32
struct HashTable * tag_transforms
Hash Table: "inbox" -> "i" - Alternative tag names.
Definition module_data.h:42
The envelope/body of an email.
Definition email.h:39
int index
The absolute (unsorted) message number.
Definition email.h:110
A mailbox.
Definition mailbox.h:81
Container for Accounts, Notifications.
Definition neomutt.h:41
A regular expression and a color to highlight a line.
Definition regex4.h:37
struct PatternList * color_pattern
Compiled pattern to speed up index color calculation.
Definition regex4.h:42
struct AttrColor attr_color
Colour and attributes to apply.
Definition regex4.h:38
char * pattern
Pattern to match.
Definition regex4.h:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ print_enriched_string()

static void print_enriched_string ( struct MuttWindow * win,
int index,
const struct AttrColor * ac_def,
struct AttrColor * ac_ind,
struct Buffer * buf,
struct ConfigSubset * sub )
static

Display a string with embedded colours and graphics.

Parameters
winWindow
indexIndex number
ac_defDefault colour for the line
ac_indIndicator colour for the line
bufString of embedded colour codes
subConfig items

Definition at line 114 of file draw.c.

117{
118 wchar_t wc = 0;
119 size_t k;
120 size_t n = mutt_str_len(buf_string(buf));
121 unsigned char *s = (unsigned char *) buf->data;
122 mbstate_t mbstate = { 0 };
123
124 const bool c_ascii_chars = cs_subset_bool(sub, "ascii_chars");
125 while (*s)
126 {
127 if (*s < MUTT_TREE_MAX)
128 {
129 /* Combining tree fg color and another bg color requires having
130 * use_default_colors, because the other bg color may be undefined. */
131 mutt_curses_set_color(ac_ind);
132
133 while (*s && (*s < MUTT_TREE_MAX))
134 {
135 switch (*s)
136 {
138 if (c_ascii_chars)
139 mutt_window_addch(win, '`');
140#ifdef WACS_LLCORNER
141 else
142 add_wch(WACS_LLCORNER);
143#else
144 else if (CharsetIsUtf8)
145 mutt_window_addstr(win, "\342\224\224"); /* WACS_LLCORNER */
146 else
147 mutt_window_addch(win, ACS_LLCORNER);
148#endif
149 break;
151 if (c_ascii_chars)
152 mutt_window_addch(win, ',');
153#ifdef WACS_ULCORNER
154 else
155 add_wch(WACS_ULCORNER);
156#else
157 else if (CharsetIsUtf8)
158 mutt_window_addstr(win, "\342\224\214"); /* WACS_ULCORNER */
159 else
160 mutt_window_addch(win, ACS_ULCORNER);
161#endif
162 break;
163 case MUTT_TREE_LTEE:
164 if (c_ascii_chars)
165 mutt_window_addch(win, '|');
166#ifdef WACS_LTEE
167 else
168 add_wch(WACS_LTEE);
169#else
170 else if (CharsetIsUtf8)
171 mutt_window_addstr(win, "\342\224\234"); /* WACS_LTEE */
172 else
173 mutt_window_addch(win, ACS_LTEE);
174#endif
175 break;
176 case MUTT_TREE_HLINE:
177 if (c_ascii_chars)
178 mutt_window_addch(win, '-');
179#ifdef WACS_HLINE
180 else
181 add_wch(WACS_HLINE);
182#else
183 else if (CharsetIsUtf8)
184 mutt_window_addstr(win, "\342\224\200"); /* WACS_HLINE */
185 else
186 mutt_window_addch(win, ACS_HLINE);
187#endif
188 break;
189 case MUTT_TREE_VLINE:
190 if (c_ascii_chars)
191 mutt_window_addch(win, '|');
192#ifdef WACS_VLINE
193 else
194 add_wch(WACS_VLINE);
195#else
196 else if (CharsetIsUtf8)
197 mutt_window_addstr(win, "\342\224\202"); /* WACS_VLINE */
198 else
199 mutt_window_addch(win, ACS_VLINE);
200#endif
201 break;
202 case MUTT_TREE_TTEE:
203 if (c_ascii_chars)
204 mutt_window_addch(win, '-');
205#ifdef WACS_TTEE
206 else
207 add_wch(WACS_TTEE);
208#else
209 else if (CharsetIsUtf8)
210 mutt_window_addstr(win, "\342\224\254"); /* WACS_TTEE */
211 else
212 mutt_window_addch(win, ACS_TTEE);
213#endif
214 break;
215 case MUTT_TREE_BTEE:
216 if (c_ascii_chars)
217 mutt_window_addch(win, '-');
218#ifdef WACS_BTEE
219 else
220 add_wch(WACS_BTEE);
221#else
222 else if (CharsetIsUtf8)
223 mutt_window_addstr(win, "\342\224\264"); /* WACS_BTEE */
224 else
225 mutt_window_addch(win, ACS_BTEE);
226#endif
227 break;
228 case MUTT_TREE_SPACE:
229 mutt_window_addch(win, ' ');
230 break;
231 case MUTT_TREE_RARROW:
232 mutt_window_addch(win, '>');
233 break;
234 case MUTT_TREE_STAR:
235 mutt_window_addch(win, '*'); /* fake thread indicator */
236 break;
237 case MUTT_TREE_HIDDEN:
238 mutt_window_addch(win, '&');
239 break;
240 case MUTT_TREE_EQUALS:
241 mutt_window_addch(win, '=');
242 break;
244 mutt_window_addch(win, '?');
245 break;
246 }
247 s++;
248 n--;
249 }
250 const struct AttrColor *ac_merge = merged_color_overlay(ac_def, ac_ind);
251 mutt_curses_set_color(ac_merge);
252 }
253 else if ((*s == MUTT_SPECIAL_INDEX) && (n >= 2))
254 {
255 s++;
256 if (*s == MT_COLOR_INDEX)
257 {
258 const struct AttrColor *ac_merge = merged_color_overlay(ac_def, ac_ind);
259 mutt_curses_set_color(ac_merge);
260 }
261 else
262 {
263 const struct AttrColor *color = get_color(index, s);
264 const struct AttrColor *ac_merge = merged_color_overlay(ac_def, color);
265 ac_merge = merged_color_overlay(ac_merge, ac_ind);
266
267 mutt_curses_set_color(ac_merge);
268 }
269 s++;
270 n -= 2;
271 }
272 else if ((k = mbrtowc(&wc, (char *) s, n, &mbstate)) > 0)
273 {
274 mutt_window_addnstr(win, (char *) s, k);
275 s += k;
276 n -= k;
277 }
278 else
279 {
280 break;
281 }
282 }
283}
@ MT_COLOR_INDEX
Index: default colour.
Definition color.h:86
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition helpers.c:47
static const struct AttrColor * get_color(int index, unsigned char *s)
Choose a colour for a line of the index.
Definition draw.c:53
@ MUTT_TREE_MAX
Definition thread.h:70
@ MUTT_TREE_LLCORNER
Lower left corner.
Definition thread.h:57
@ MUTT_TREE_RARROW
Right arrow.
Definition thread.h:63
@ MUTT_TREE_ULCORNER
Upper left corner.
Definition thread.h:58
@ MUTT_TREE_EQUALS
Equals (for threads)
Definition thread.h:66
@ MUTT_TREE_HIDDEN
Ampersand character (for threads)
Definition thread.h:65
@ MUTT_TREE_STAR
Star character (for threads)
Definition thread.h:64
@ MUTT_TREE_LTEE
Left T-piece.
Definition thread.h:59
@ MUTT_TREE_VLINE
Vertical line.
Definition thread.h:61
@ MUTT_TREE_MISSING
Question mark.
Definition thread.h:69
@ MUTT_TREE_TTEE
Top T-piece.
Definition thread.h:67
@ MUTT_TREE_HLINE
Horizontal line.
Definition thread.h:60
@ MUTT_TREE_SPACE
Blank space.
Definition thread.h:62
@ MUTT_TREE_BTEE
Bottom T-piece.
Definition thread.h:68
bool CharsetIsUtf8
Is the user's current character set utf-8?
Definition charset.c:67
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
Definition string.c:503
void mutt_curses_set_color(const struct AttrColor *ac)
Set the colour and attributes for text.
Definition mutt_curses.c:38
int mutt_window_addstr(struct MuttWindow *win, const char *str)
Write a string to a Window.
int mutt_window_addnstr(struct MuttWindow *win, const char *str, int num)
Write a partial string to a Window.
int mutt_window_addch(struct MuttWindow *win, int ch)
Write one character to a Window.
char * data
Pointer to data.
Definition buffer.h:37
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ menu_pad_string()

static void menu_pad_string ( struct Menu * menu,
struct Buffer * buf )
static

Pad a string with spaces for display in the Menu.

Parameters
menuCurrent Menu
bufBuffer containing the string
Note
The string is padded in-place.

Definition at line 292 of file draw.c.

293{
294 int max_cols = menu->win->state.cols;
295 const bool c_arrow_cursor = cs_subset_bool(menu->sub, "arrow_cursor");
296 if (c_arrow_cursor)
297 {
298 const char *const c_arrow_string = cs_subset_string(menu->sub, "arrow_string");
299 if (max_cols > 0)
300 max_cols -= (mutt_strwidth(c_arrow_string) + 1);
301 }
302
303 int buf_cols = mutt_strwidth(buf_string(buf));
304 for (; buf_cols < max_cols; buf_cols++)
305 {
306 buf_addch(buf, ' ');
307 }
308}
size_t buf_addch(struct Buffer *buf, char c)
Add a single character to a Buffer.
Definition buffer.c:248
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition helpers.c:291
size_t mutt_strwidth(const char *s)
Measure a string's width in screen cells.
Definition curs_lib.c:449
struct MuttWindow * win
Window holding the Menu.
Definition lib.h:94
struct ConfigSubset * sub
Inherited config items.
Definition lib.h:95
struct WindowState state
Current state of the Window.
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition mutt_window.h:60
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ menu_redraw_full()

void menu_redraw_full ( struct Menu * menu)

Force the redraw of the Menu.

Parameters
menuCurrent Menu

Definition at line 314 of file draw.c.

315{
317 mutt_window_clear(menu->win);
318
319 menu->page_len = menu->win->state.rows;
320
322}
@ MT_COLOR_NORMAL
Plain text.
Definition color.h:53
@ MENU_REDRAW_INDEX
Redraw the index.
Definition lib.h:61
const struct AttrColor * mutt_curses_set_color_by_id(enum ColorId cid)
Set the colour and attributes by the Colour ID.
Definition mutt_curses.c:79
void mutt_window_clear(struct MuttWindow *win)
Clear a Window.
MenuRedrawFlags redraw
When to redraw the screen.
Definition lib.h:89
int page_len
Number of entries per screen.
Definition lib.h:91
short rows
Number of rows, can be MUTT_WIN_SIZE_UNLIMITED.
Definition mutt_window.h:61
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ menu_redraw_index()

void menu_redraw_index ( struct Menu * menu)

Force the redraw of the index.

Parameters
menuCurrent Menu

Definition at line 328 of file draw.c.

329{
330 struct Buffer *buf = buf_pool_get();
331 const struct AttrColor *ac = NULL;
332
333 const bool c_arrow_cursor = cs_subset_bool(menu->sub, "arrow_cursor");
334 const char *const c_arrow_string = cs_subset_string(menu->sub, "arrow_string");
335 const int arrow_width = mutt_strwidth(c_arrow_string);
336 struct AttrColor *ac_ind = menu->show_indicator ? simple_color_get(MT_COLOR_INDICATOR) : NULL;
337 for (int i = menu->top; i < (menu->top + menu->page_len); i++)
338 {
339 if (i < menu->max)
340 {
341 ac = menu->color(menu, i);
342
343 buf_reset(buf);
344 menu->make_entry(menu, i, menu->win->state.cols, buf);
345 menu_pad_string(menu, buf);
346
348 mutt_window_move(menu->win, i - menu->top, 0);
349
350 if (i == menu->current)
351 mutt_curses_set_color(ac_ind);
352
353 if (c_arrow_cursor)
354 {
355 if (i == menu->current)
356 {
357 mutt_window_addstr(menu->win, c_arrow_string);
359 mutt_window_addch(menu->win, ' ');
360 }
361 else
362 {
363 /* Print space chars to match the screen width of `$arrow_string` */
364 mutt_window_printf(menu->win, "%*s", arrow_width + 1, "");
365 }
366 }
367
368 if ((i == menu->current) && !c_arrow_cursor)
369 {
370 print_enriched_string(menu->win, i, ac, ac_ind, buf, menu->sub);
371 }
372 else
373 {
374 print_enriched_string(menu->win, i, ac, NULL, buf, menu->sub);
375 }
376 }
377 else
378 {
380 mutt_window_clearline(menu->win, i - menu->top);
381 }
382 }
384 menu->redraw = MENU_REDRAW_NONE;
385 buf_pool_release(&buf);
386}
void buf_reset(struct Buffer *buf)
Reset an existing Buffer.
Definition buffer.c:89
@ MT_COLOR_INDICATOR
Selected item in list.
Definition color.h:49
static void menu_pad_string(struct Menu *menu, struct Buffer *buf)
Pad a string with spaces for display in the Menu.
Definition draw.c:292
static void print_enriched_string(struct MuttWindow *win, int index, const struct AttrColor *ac_def, struct AttrColor *ac_ind, struct Buffer *buf, struct ConfigSubset *sub)
Display a string with embedded colours and graphics.
Definition draw.c:114
@ MENU_REDRAW_NONE
No flags are set.
Definition lib.h:60
int mutt_window_printf(struct MuttWindow *win, const char *fmt,...)
Write a formatted string to a Window.
int mutt_window_move(struct MuttWindow *win, int row, int col)
Move the cursor in a Window.
void mutt_window_clearline(struct MuttWindow *win, int row)
Clear a row of a Window.
int current
Current entry.
Definition lib.h:87
const struct AttrColor *(* color)(struct Menu *menu, int line)
Definition lib.h:151
bool show_indicator
Show the Indicator colour.
Definition lib.h:93
int top
Entry that is the top of the current page.
Definition lib.h:98
int(* make_entry)(struct Menu *menu, int line, int max_cols, struct Buffer *buf)
Definition lib.h:114
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ menu_redraw_motion()

void menu_redraw_motion ( struct Menu * menu)

Force the redraw of the list part of the menu.

Parameters
menuCurrent Menu

Definition at line 392 of file draw.c.

393{
394 struct Buffer *buf = buf_pool_get();
395
396 /* Note: menu->color() for the index can end up retrieving a message
397 * over imap (if matching against ~h for instance). This can
398 * generate status messages. So we want to call it *before* we
399 * position the cursor for drawing. */
400 const struct AttrColor *old_color = menu->color(menu, menu->old_current);
401 mutt_window_move(menu->win, menu->old_current - menu->top, 0);
402 mutt_curses_set_color(old_color);
403
404 const bool c_arrow_cursor = cs_subset_bool(menu->sub, "arrow_cursor");
405 struct AttrColor *ac_ind = menu->show_indicator ? simple_color_get(MT_COLOR_INDICATOR) : NULL;
406 if (c_arrow_cursor)
407 {
408 const char *const c_arrow_string = cs_subset_string(menu->sub, "arrow_string");
409 const int arrow_width = mutt_strwidth(c_arrow_string);
410 /* clear the arrow */
411 /* Print space chars to match the screen width of `$arrow_string` */
412 mutt_window_printf(menu->win, "%*s", arrow_width + 1, "");
414
415 menu->make_entry(menu, menu->old_current, menu->win->state.cols, buf);
416 menu_pad_string(menu, buf);
417 mutt_window_move(menu->win, menu->old_current - menu->top, arrow_width + 1);
418 print_enriched_string(menu->win, menu->old_current, old_color, NULL, buf, menu->sub);
419
420 /* now draw it in the new location */
421 mutt_curses_set_color(ac_ind);
422 mutt_window_move(menu->win, menu->current - menu->top, 0);
423 mutt_window_addstr(menu->win, c_arrow_string);
424 }
425 else
426 {
428 /* erase the current indicator */
429 menu->make_entry(menu, menu->old_current, menu->win->state.cols, buf);
430 menu_pad_string(menu, buf);
431 print_enriched_string(menu->win, menu->old_current, old_color, NULL, buf, menu->sub);
432
433 /* now draw the new one to reflect the change */
434 const struct AttrColor *cur_color = menu->color(menu, menu->current);
435 cur_color = merged_color_overlay(cur_color, ac_ind);
436 buf_reset(buf);
437 menu->make_entry(menu, menu->current, menu->win->state.cols, buf);
438 menu_pad_string(menu, buf);
439 mutt_window_move(menu->win, menu->current - menu->top, 0);
440 mutt_curses_set_color(cur_color);
441 print_enriched_string(menu->win, menu->current, cur_color, ac_ind, buf, menu->sub);
442 }
444 buf_pool_release(&buf);
445}
int old_current
For driver use only.
Definition lib.h:99
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ menu_redraw_current()

void menu_redraw_current ( struct Menu * menu)

Redraw the current menu.

Parameters
menuCurrent Menu

Definition at line 451 of file draw.c.

452{
453 struct Buffer *buf = buf_pool_get();
454 const struct AttrColor *ac = menu->color(menu, menu->current);
455
456 mutt_window_move(menu->win, menu->current - menu->top, 0);
457 menu->make_entry(menu, menu->current, menu->win->state.cols, buf);
458 menu_pad_string(menu, buf);
459
460 struct AttrColor *ac_ind = menu->show_indicator ? simple_color_get(MT_COLOR_INDICATOR) : NULL;
461 const bool c_arrow_cursor = cs_subset_bool(menu->sub, "arrow_cursor");
462 if (c_arrow_cursor)
463 {
464 mutt_curses_set_color(ac_ind);
465 const char *const c_arrow_string = cs_subset_string(menu->sub, "arrow_string");
466 mutt_window_addstr(menu->win, c_arrow_string);
468 mutt_window_addch(menu->win, ' ');
469 menu_pad_string(menu, buf);
470 print_enriched_string(menu->win, menu->current, ac, NULL, buf, menu->sub);
471 }
472 else
473 {
474 print_enriched_string(menu->win, menu->current, ac, ac_ind, buf, menu->sub);
475 }
477 buf_pool_release(&buf);
478}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ menu_redraw()

int menu_redraw ( struct Menu * menu)

Redraw the parts of the screen that have been flagged to be redrawn.

Parameters
menuMenu to redraw
Return values
OP_NULLMenu was redrawn
OP_REDRAWFull redraw required

Definition at line 486 of file draw.c.

487{
488 /* See if all or part of the screen needs to be updated. */
489 if (menu->redraw & MENU_REDRAW_FULL)
490 menu_redraw_full(menu);
491
492 if (menu->redraw & MENU_REDRAW_INDEX)
493 menu_redraw_index(menu);
494 else if (menu->redraw & MENU_REDRAW_MOTION)
495 menu_redraw_motion(menu);
496 else if (menu->redraw == MENU_REDRAW_CURRENT)
498
499 return OP_NULL;
500}
void menu_redraw_current(struct Menu *menu)
Redraw the current menu.
Definition draw.c:451
void menu_redraw_index(struct Menu *menu)
Force the redraw of the index.
Definition draw.c:328
void menu_redraw_full(struct Menu *menu)
Force the redraw of the Menu.
Definition draw.c:314
void menu_redraw_motion(struct Menu *menu)
Force the redraw of the list part of the menu.
Definition draw.c:392
@ MENU_REDRAW_FULL
Redraw everything.
Definition lib.h:64
@ MENU_REDRAW_CURRENT
Redraw the current line of the menu.
Definition lib.h:63
@ MENU_REDRAW_MOTION
Redraw after moving the menu list.
Definition lib.h:62
+ Here is the call graph for this function:
+ Here is the caller graph for this function: