NeoMutt  2022-04-29-247-gc6aae8
Teaching an old dog new tricks
DOXYGEN
repaint()

Repaint the Window. More...

+ Collaboration diagram for repaint():

Functions

static int cbar_repaint (struct MuttWindow *win)
 Repaint the Window - Implements MuttWindow::repaint() -. More...
 
static int env_repaint (struct MuttWindow *win)
 Repaint the Window - Implements MuttWindow::repaint() -. More...
 
static int msgwin_repaint (struct MuttWindow *win)
 Redraw the Message Window - Implements MuttWindow::repaint() -. More...
 
static int sbar_repaint (struct MuttWindow *win)
 Repaint the Window - Implements MuttWindow::repaint() -. More...
 
static int helpbar_repaint (struct MuttWindow *win)
 Redraw the Help Bar - Implements MuttWindow::repaint() -. More...
 
static int ibar_repaint (struct MuttWindow *win)
 Repaint the Window - Implements MuttWindow::repaint() -. More...
 
static int index_repaint (struct MuttWindow *win)
 Repaint the Index display - Implements MuttWindow::repaint() -. More...
 
static int menu_repaint (struct MuttWindow *win)
 Repaint the Window - Implements MuttWindow::repaint() -. More...
 
static int win_chain_repaint (struct MuttWindow *win)
 Repaint the Chain list - Implements MuttWindow::repaint() -. More...
 
static int pager_repaint (struct MuttWindow *win)
 Repaint the Pager display - Implements MuttWindow::repaint() -. More...
 
static int pbar_repaint (struct MuttWindow *win)
 Repaint the Window - Implements MuttWindow::repaint() -. More...
 
static int progress_window_repaint (struct MuttWindow *win)
 Repaint the Progress Bar - Implements MuttWindow::repaint() -. More...
 
int sb_repaint (struct MuttWindow *win)
 Repaint the Sidebar display - Implements MuttWindow::repaint() -. More...
 

Detailed Description

Repaint the Window.

Parameters
winWindow
Return values
0Success
-1Error

Function Documentation

◆ cbar_repaint()

static int cbar_repaint ( struct MuttWindow win)
static

Repaint the Window - Implements MuttWindow::repaint() -.

Definition at line 183 of file cbar.c.

184{
185 struct ComposeBarData *cbar_data = win->wdata;
186
187 mutt_window_move(win, 0, 0);
190
191 mutt_window_move(win, 0, 0);
192 mutt_draw_statusline(win, win->state.cols, cbar_data->compose_format,
193 mutt_str_len(cbar_data->compose_format));
195 mutt_debug(LL_DEBUG5, "repaint done\n");
196
197 return 0;
198}
@ MT_COLOR_STATUS
Status bar (takes a pattern)
Definition: color.h:71
@ MT_COLOR_NORMAL
Plain text.
Definition: color.h:54
void mutt_draw_statusline(struct MuttWindow *win, int cols, const char *buf, size_t buflen)
Draw a highlighted status bar.
Definition: dlg_index.c:922
#define mutt_debug(LEVEL,...)
Definition: logging.h:84
@ LL_DEBUG5
Log at debug level 5.
Definition: logging.h:44
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
Definition: string.c:567
struct AttrColor * mutt_curses_set_normal_backed_color_by_id(enum ColorId cid)
Set the colour and attributes by the colour id.
Definition: mutt_curses.c:65
struct AttrColor * mutt_curses_set_color_by_id(enum ColorId cid)
Set the colour and attributes by the colour id.
Definition: mutt_curses.c:81
int mutt_window_move(struct MuttWindow *win, int col, int row)
Move the cursor in a Window.
Definition: mutt_window.c:293
void mutt_window_clrtoeol(struct MuttWindow *win)
Clear to the end of the line.
Definition: mutt_window.c:242
Data to fill the Compose Bar Window.
Definition: cbar_data.h:34
char * compose_format
Cached status string.
Definition: cbar_data.h:35
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:127
void * wdata
Private data.
Definition: mutt_window.h:145
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:

◆ env_repaint()

static int env_repaint ( struct MuttWindow win)
static

Repaint the Window - Implements MuttWindow::repaint() -.

Definition at line 772 of file window.c.

773{
774 struct EnvelopeWindowData *wdata = win->wdata;
775
776 draw_envelope(win, wdata);
777 mutt_debug(LL_DEBUG5, "repaint done\n");
778 return 0;
779}
static void draw_envelope(struct MuttWindow *win, struct EnvelopeWindowData *wdata)
Write the email headers to the compose window.
Definition: window.c:694
Data to fill the Envelope Window.
Definition: wdata.h:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ msgwin_repaint()

static int msgwin_repaint ( struct MuttWindow win)
static

Redraw the Message Window - Implements MuttWindow::repaint() -.

Definition at line 115 of file msgwin.c.

116{
117 if (window_is_focused(win)) // someone else is using it
118 return 0;
119
120 struct MsgWinPrivateData *priv = win->wdata;
121
122 mutt_window_move(win, 0, 0);
123
125 mutt_window_move(win, 0, 0);
126 mutt_window_addstr(win, priv->text);
129
130 mutt_debug(LL_DEBUG5, "repaint done\n");
131 return 0;
132}
bool window_is_focused(const struct MuttWindow *win)
Does the given Window have the focus?
Definition: mutt_window.c:629
int mutt_window_addstr(struct MuttWindow *win, const char *str)
Write a string to a Window.
Definition: mutt_window.c:409
Private data for the Message Window.
Definition: msgwin.c:94
char * text
Cached display string.
Definition: msgwin.c:96
enum ColorId cid
Colour for the text, e.g. MT_COLOR_MESSAGE.
Definition: msgwin.c:95
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sbar_repaint()

static int sbar_repaint ( struct MuttWindow win)
static

Repaint the Window - Implements MuttWindow::repaint() -.

Definition at line 93 of file sbar.c.

94{
95 struct SBarPrivateData *priv = win->wdata;
96
97 mutt_window_move(win, 0, 0);
98
100 mutt_window_move(win, 0, 0);
101 mutt_paddstr(win, win->state.cols, priv->display);
103
104 mutt_debug(LL_DEBUG5, "repaint done\n");
105 return 0;
106}
void mutt_paddstr(struct MuttWindow *win, int n, const char *s)
Display a string on screen, padded if necessary.
Definition: curs_lib.c:816
Private data for the Simple Bar.
Definition: sbar.c:73
char * display
Cached display string.
Definition: sbar.c:74
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ helpbar_repaint()

static int helpbar_repaint ( struct MuttWindow win)
static

Redraw the Help Bar - Implements MuttWindow::repaint() -.

The Help Bar is drawn from the data cached in the HelpbarWindowData. No calculation is performed.

Definition at line 179 of file helpbar.c.

180{
182 if (!wdata)
183 return 0;
184
186 mutt_window_move(win, 0, 0);
187 mutt_paddstr(win, win->state.cols, wdata->help_str);
189
190 mutt_debug(LL_DEBUG5, "repaint done\n");
191 return 0;
192}
struct HelpbarWindowData * helpbar_wdata_get(struct MuttWindow *win)
Get the Helpbar data for this window.
Definition: wdata.c:61
Help Bar Window data -.
Definition: private.h:34
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ibar_repaint()

static int ibar_repaint ( struct MuttWindow win)
static

Repaint the Window - Implements MuttWindow::repaint() -.

Definition at line 138 of file ibar.c.

139{
140 struct IBarPrivateData *ibar_data = win->wdata;
141 struct IndexSharedData *shared = ibar_data->shared;
142
143 mutt_window_move(win, 0, 0);
146
147 mutt_window_move(win, 0, 0);
148 mutt_draw_statusline(win, win->state.cols, ibar_data->status_format,
149 mutt_str_len(ibar_data->status_format));
151
152 const bool c_ts_enabled = cs_subset_bool(shared->sub, "ts_enabled");
153 if (c_ts_enabled && TsSupported)
154 {
156 mutt_ts_icon(ibar_data->ts_icon_format);
157 }
158
159 mutt_debug(LL_DEBUG5, "repaint done\n");
160 return 0;
161}
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition: helpers.c:73
Data to draw the Index Bar.
Definition: ibar.c:78
char * ts_icon_format
Cached terminal icon string.
Definition: ibar.c:83
struct IndexSharedData * shared
Shared Index data.
Definition: ibar.c:79
char * ts_status_format
Cached terminal status string.
Definition: ibar.c:82
char * status_format
Cached screen status string.
Definition: ibar.c:81
Data shared between Index, Pager and Sidebar.
Definition: shared_data.h:37
struct ConfigSubset * sub
Config set to use.
Definition: shared_data.h:38
bool TsSupported
Terminal Setting is supported.
Definition: terminal.c:41
void mutt_ts_icon(char *str)
Set the icon in the terminal title bar.
Definition: terminal.c:115
void mutt_ts_status(char *str)
Set the text of the terminal title bar.
Definition: terminal.c:101
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ index_repaint()

static int index_repaint ( struct MuttWindow win)
static

Repaint the Index display - Implements MuttWindow::repaint() -.

Definition at line 537 of file index.c.

538{
539 struct Menu *menu = win->wdata;
540
541 if (menu->redraw & MENU_REDRAW_FULL)
542 menu_redraw_full(menu);
543
544 // If we don't have the focus, then this is a mini-Index ($pager_index_lines)
545 if (!window_is_focused(menu->win))
546 {
547 int indicator = menu->page_len / 3;
548
549 /* some fudge to work out whereabouts the indicator should go */
550 const int index = menu_get_index(menu);
551 if ((index - indicator) < 0)
552 menu->top = 0;
553 else if ((menu->max - index) < (menu->page_len - indicator))
554 menu->top = menu->max - menu->page_len;
555 else
556 menu->top = index - indicator;
557 }
558 menu_adjust(menu);
560
561 struct IndexPrivateData *priv = menu->mdata;
562 struct IndexSharedData *shared = priv->shared;
563 struct Mailbox *m = shared->mailbox;
564 const int index = menu_get_index(menu);
565 if (m && m->emails && (index < m->vcount))
566 {
567 if (menu->redraw & MENU_REDRAW_INDEX)
568 {
569 menu_redraw_index(menu);
570 }
571 else if (menu->redraw & MENU_REDRAW_MOTION)
572 menu_redraw_motion(menu);
573 else if (menu->redraw & MENU_REDRAW_CURRENT)
575 }
576
578 mutt_debug(LL_DEBUG5, "repaint done\n");
579 return 0;
580}
void menu_redraw_current(struct Menu *menu)
Redraw the current menu.
Definition: draw.c:436
void menu_redraw_index(struct Menu *menu)
Force the redraw of the index.
Definition: draw.c:320
void menu_redraw_full(struct Menu *menu)
Force the redraw of the Menu.
Definition: draw.c:306
void menu_redraw_motion(struct Menu *menu)
Force the redraw of the list part of the menu.
Definition: draw.c:377
#define MENU_REDRAW_FULL
Redraw everything.
Definition: lib.h:59
void menu_adjust(struct Menu *menu)
Reapply the config to the Menu.
Definition: move.c:319
#define MENU_REDRAW_INDEX
Redraw the index.
Definition: lib.h:56
int menu_get_index(struct Menu *menu)
Get the current selection in the Menu.
Definition: menu.c:154
#define MENU_REDRAW_NO_FLAGS
No flags are set.
Definition: lib.h:55
#define MENU_REDRAW_CURRENT
Redraw the current line of the menu.
Definition: lib.h:58
#define MENU_REDRAW_MOTION
Redraw after moving the menu list.
Definition: lib.h:57
Private state data for the Index.
Definition: private_data.h:35
struct IndexSharedData * shared
Shared Index data.
Definition: private_data.h:42
struct Menu * menu
Menu controlling the index.
Definition: private_data.h:43
struct Mailbox * mailbox
Current Mailbox.
Definition: shared_data.h:41
A mailbox.
Definition: mailbox.h:79
int vcount
The number of virtual messages.
Definition: mailbox.h:99
struct Email ** emails
Array of Emails.
Definition: mailbox.h:96
Definition: lib.h:69
struct MuttWindow * win
Window holding the Menu.
Definition: lib.h:76
MenuRedrawFlags redraw
When to redraw the screen.
Definition: lib.h:72
int top
Entry that is the top of the current page.
Definition: lib.h:80
void * mdata
Private data.
Definition: lib.h:137
int max
Number of entries in the menu.
Definition: lib.h:71
int page_len
Number of entries per screen.
Definition: lib.h:74
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ menu_repaint()

static int menu_repaint ( struct MuttWindow win)
static

Repaint the Window - Implements MuttWindow::repaint() -.

Definition at line 95 of file window.c.

96{
97 if (win->type != WT_MENU)
98 return 0;
99
100 struct Menu *menu = win->wdata;
101 menu->redraw |= MENU_REDRAW_FULL;
102 menu_redraw(menu);
104
105 const bool c_arrow_cursor = cs_subset_bool(menu->sub, "arrow_cursor");
106 const bool c_braille_friendly = cs_subset_bool(menu->sub, "braille_friendly");
107
108 /* move the cursor out of the way */
109 if (c_arrow_cursor)
110 mutt_window_move(menu->win, 2, menu->current - menu->top);
111 else if (c_braille_friendly)
112 mutt_window_move(menu->win, 0, menu->current - menu->top);
113 else
114 {
115 mutt_window_move(menu->win, menu->win->state.cols - 1, menu->current - menu->top);
116 }
117
118 mutt_debug(LL_DEBUG5, "repaint done\n");
119 return 0;
120}
int menu_redraw(struct Menu *menu)
Redraw the parts of the screen that have been flagged to be redrawn.
Definition: draw.c:472
@ WT_MENU
An Window containing a Menu.
Definition: mutt_window.h:98
int current
Current entry.
Definition: lib.h:70
struct ConfigSubset * sub
Inherited config items.
Definition: lib.h:77
enum WindowType type
Window type, e.g. WT_SIDEBAR.
Definition: mutt_window.h:144
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ win_chain_repaint()

static int win_chain_repaint ( struct MuttWindow win)
static

Repaint the Chain list - Implements MuttWindow::repaint() -.

Definition at line 145 of file win_chain.c.

146{
147 for (int i = 0; i < win->state.rows; i++)
148 {
149 mutt_window_move(win, 0, i);
151 }
152
153 struct ChainData *cd = win->wdata;
154
155 if (cd->chain_len == 0)
156 return 0;
157
158 for (int i = 0; i < cd->chain_len; i++)
159 {
160 if (cd->coords[i].row < win->state.rows)
161 {
162 if (i == cd->sel)
164 else
166
167 int index = cd->chain[i];
168 struct Remailer **rp = ARRAY_GET(cd->ra, index);
169 mutt_window_mvaddstr(win, cd->coords[i].col, cd->coords[i].row, (*rp)->shortname);
171
172 if ((i + 1) < cd->chain_len)
173 mutt_window_addstr(win, ", ");
174 }
175 }
176 return 0;
177}
#define ARRAY_GET(head, idx)
Return the element at index.
Definition: array.h:108
@ MT_COLOR_INDICATOR
Selected item in list.
Definition: color.h:49
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:307
An ordered set of Remailer hosts.
Definition: chain_data.h:46
int chain_len
Length of chain.
Definition: chain_data.h:48
struct RemailerArray * ra
Array of all Remailer hosts.
Definition: chain_data.h:51
int chain[MAX_MIXES]
Indexes of chain hosts.
Definition: chain_data.h:49
int sel
Current selection.
Definition: chain_data.h:47
struct Coord coords[MAX_MIXES]
Screen coordinates of each entry.
Definition: chain_data.h:50
short col
Column.
Definition: chain_data.h:37
short row
Row.
Definition: chain_data.h:36
A Mixmaster remailer.
Definition: remailer.h:40
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:

◆ pager_repaint()

static int pager_repaint ( struct MuttWindow win)
static

Repaint the Pager display - Implements MuttWindow::repaint() -.

Definition at line 133 of file pager.c.

134{
135 struct PagerPrivateData *priv = win->wdata;
136 if (!priv || !priv->pview || !priv->pview->pdata)
137 return 0;
138
139#ifdef USE_DEBUG_COLOR
140 dump_pager(priv);
141#endif
142
143 // We need to populate more lines, but not change position
144 const bool repopulate = (priv->cur_line > priv->lines_used);
145 if ((priv->redraw & PAGER_REDRAW_FLOW) || repopulate)
146 {
147 if (!(priv->pview->flags & MUTT_PAGER_RETWINCH))
148 {
149 priv->win_height = -1;
150 for (int i = 0; i <= priv->top_line; i++)
151 if (!priv->lines[i].cont_line)
152 priv->win_height++;
153 for (int i = 0; i < priv->lines_max; i++)
154 {
155 priv->lines[i].offset = 0;
156 priv->lines[i].cid = -1;
157 priv->lines[i].cont_line = 0;
158 priv->lines[i].syntax_arr_size = 0;
159 priv->lines[i].search_arr_size = -1;
160 priv->lines[i].quote = NULL;
161
162 mutt_mem_realloc(&(priv->lines[i].syntax), sizeof(struct TextSyntax));
163 if (priv->search_compiled && priv->lines[i].search)
164 FREE(&(priv->lines[i].search));
165 }
166
167 if (!repopulate)
168 {
169 priv->lines_used = 0;
170 priv->top_line = 0;
171 }
172 }
173 int i = -1;
174 int j = -1;
175 while (display_line(priv->fp, &priv->bytes_read, &priv->lines, ++i,
176 &priv->lines_used, &priv->lines_max,
177 priv->has_types | priv->search_flag | (priv->pview->flags & MUTT_PAGER_NOWRAP),
178 &priv->quote_list, &priv->q_level, &priv->force_redraw,
179 &priv->search_re, priv->pview->win_pager, &priv->ansi_list) == 0)
180 {
181 if (!priv->lines[i].cont_line && (++j == priv->win_height))
182 {
183 if (!repopulate)
184 priv->top_line = i;
185 if (!priv->search_flag)
186 break;
187 }
188 }
189 }
190
191 if ((priv->redraw & PAGER_REDRAW_PAGER) || (priv->top_line != priv->old_top_line))
192 {
193 do
194 {
195 mutt_window_move(priv->pview->win_pager, 0, 0);
196 priv->cur_line = priv->top_line;
197 priv->old_top_line = priv->top_line;
198 priv->win_height = 0;
199 priv->force_redraw = false;
200
201 while ((priv->win_height < priv->pview->win_pager->state.rows) &&
202 (priv->lines[priv->cur_line].offset <= priv->st.st_size - 1))
203 {
204 if (display_line(priv->fp, &priv->bytes_read, &priv->lines,
205 priv->cur_line, &priv->lines_used, &priv->lines_max,
206 (priv->pview->flags & MUTT_DISPLAYFLAGS) | priv->hide_quoted |
207 priv->search_flag | (priv->pview->flags & MUTT_PAGER_NOWRAP),
208 &priv->quote_list, &priv->q_level, &priv->force_redraw,
209 &priv->search_re, priv->pview->win_pager, &priv->ansi_list) > 0)
210 {
211 priv->win_height++;
212 }
213 priv->cur_line++;
214 mutt_window_move(priv->pview->win_pager, 0, priv->win_height);
215 }
216 } while (priv->force_redraw);
217 // curses_colors_dump();
218 // attr_color_list_dump(&priv->ansi_list, "All AnsiColors");
219
220 const bool c_tilde = cs_subset_bool(NeoMutt->sub, "tilde");
222 while (priv->win_height < priv->pview->win_pager->state.rows)
223 {
225 if (c_tilde)
226 mutt_window_addch(priv->pview->win_pager, '~');
227 priv->win_height++;
228 mutt_window_move(priv->pview->win_pager, 0, priv->win_height);
229 }
231 }
232
234 mutt_debug(LL_DEBUG5, "repaint done\n");
235 return 0;
236}
@ MT_COLOR_TILDE
Pager: empty lines after message.
Definition: color.h:72
void dump_pager(struct PagerPrivateData *priv)
Definition: pager.c:102
int display_line(FILE *fp, LOFF_T *bytes_read, struct Line **lines, int line_num, int *lines_used, int *lines_max, PagerFlags flags, struct QuoteStyle **quote_list, int *q_level, bool *force_redraw, regex_t *search_re, struct MuttWindow *win_pager, struct AttrColorList *ansi_list)
Print a line on screen.
Definition: display.c:980
void mutt_mem_realloc(void *ptr, size_t size)
Resize a block of memory on the heap.
Definition: memory.c:114
#define FREE(x)
Definition: memory.h:43
int mutt_window_addch(struct MuttWindow *win, int ch)
Write one character to a Window.
Definition: mutt_window.c:381
#define MUTT_PAGER_RETWINCH
Need reformatting on SIGWINCH.
Definition: lib.h:69
#define MUTT_PAGER_NOWRAP
Format for term width, ignore $wrap.
Definition: lib.h:71
#define MUTT_DISPLAYFLAGS
Definition: lib.h:76
#define PAGER_REDRAW_FLOW
Reflow the pager.
Definition: lib.h:189
#define PAGER_REDRAW_PAGER
Redraw the pager.
Definition: lib.h:188
#define PAGER_REDRAW_NO_FLAGS
No flags are set.
Definition: lib.h:187
short search_arr_size
Number of items in search array.
Definition: display.h:60
struct TextSyntax * search
Array of search text in the line.
Definition: display.h:61
bool cont_line
Continuation of a previous line (wrapped by NeoMutt)
Definition: display.h:54
short cid
Default line colour, e.g. MT_COLOR_QUOTED.
Definition: display.h:53
struct QuoteStyle * quote
Quoting style for this line (pointer into PagerPrivateData->quote_list)
Definition: display.h:63
LOFF_T offset
Offset into Email file (PagerPrivateData->fp)
Definition: display.h:52
short syntax_arr_size
Number of items in syntax array.
Definition: display.h:57
struct TextSyntax * syntax
Array of coloured text in the line.
Definition: display.h:58
Container for Accounts, Notifications.
Definition: neomutt.h:37
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:39
Private state data for the Pager.
Definition: private_data.h:41
PagerFlags hide_quoted
Set to MUTT_HIDE when quoted email is hidden <toggle-quoted>
Definition: private_data.h:60
int q_level
Number of unique quoting levels.
Definition: private_data.h:59
int cur_line
Current line (last line visible on screen)
Definition: private_data.h:51
int lines_used
Size of lines array (used entries)
Definition: private_data.h:49
int lines_max
Capacity of lines array (total entries)
Definition: private_data.h:50
bool force_redraw
Repaint is needed.
Definition: private_data.h:68
struct Line * lines
Array of text lines in pager.
Definition: private_data.h:48
PagerRedrawFlags redraw
When to redraw the screen.
Definition: private_data.h:69
int has_types
Set to MUTT_TYPES for PAGER_MODE_EMAIL or MUTT_SHOWCOLOR.
Definition: private_data.h:56
LOFF_T bytes_read
Number of bytes read from file.
Definition: private_data.h:46
int top_line
First visible line on screen.
Definition: private_data.h:55
struct stat st
Stats about Email file.
Definition: private_data.h:45
struct QuoteStyle * quote_list
Tree of quoting levels.
Definition: private_data.h:58
struct PagerView * pview
Object to view in the pager.
Definition: private_data.h:42
struct AttrColorList ansi_list
List of ANSI colours used in the Pager.
Definition: private_data.h:70
regex_t search_re
Compiled search string.
Definition: private_data.h:65
int win_height
Number of lines in the Window.
Definition: private_data.h:54
int old_top_line
Old top line, used for repainting.
Definition: private_data.h:53
FILE * fp
File containing decrypted/decoded/weeded Email.
Definition: private_data.h:44
PagerFlags search_flag
Set to MUTT_SEARCH when search results are visible <search-toggle>
Definition: private_data.h:62
bool search_compiled
Search regex is in use.
Definition: private_data.h:64
struct PagerData * pdata
Data that pager displays. NOTNULL.
Definition: lib.h:170
PagerFlags flags
Additional settings to tweak pager's function.
Definition: lib.h:172
struct MuttWindow * win_pager
Pager Window.
Definition: lib.h:177
Highlighting for a piece of text.
Definition: display.h:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pbar_repaint()

static int pbar_repaint ( struct MuttWindow win)
static

Repaint the Window - Implements MuttWindow::repaint() -.

Definition at line 152 of file pbar.c.

153{
154 struct PBarPrivateData *pbar_data = win->wdata;
155 // struct IndexSharedData *shared = pbar_data->shared;
156
157 mutt_window_move(win, 0, 0);
160
161 mutt_window_move(win, 0, 0);
162 mutt_draw_statusline(win, win->state.cols, pbar_data->pager_format,
163 mutt_str_len(pbar_data->pager_format));
165
166 mutt_debug(LL_DEBUG5, "repaint done\n");
167 return 0;
168}
Data to draw the Pager Bar.
Definition: pbar.c:84
char * pager_format
Cached status string.
Definition: pbar.c:87
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ progress_window_repaint()

static int progress_window_repaint ( struct MuttWindow win)
static

Repaint the Progress Bar - Implements MuttWindow::repaint() -.

Definition at line 156 of file window.c.

157{
158 if (!win || !win->wdata)
159 return -1;
160
161 struct ProgressWindowData *wdata = win->wdata;
162
163 if (wdata->size == 0)
164 {
165 message_bar(wdata->win, wdata->display_percent, "%s %zu (%d%%)", wdata->msg,
166 wdata->display_pos, wdata->display_percent);
167 }
168 else
169 {
170 if (wdata->is_bytes)
171 {
172 message_bar(wdata->win, wdata->display_percent, "%s %s/%s (%d%%)", wdata->msg,
173 wdata->pretty_pos, wdata->pretty_size, wdata->display_percent);
174 }
175 else
176 {
177 message_bar(wdata->win, wdata->display_percent, "%s %zu/%zu (%d%%)", wdata->msg,
178 wdata->display_pos, wdata->size, wdata->display_percent);
179 }
180 }
181
182 return 0;
183}
static void message_bar(struct MuttWindow *win, int percent, const char *fmt,...)
Draw a colourful progress bar.
Definition: window.c:73
Progress Bar Window Data.
Definition: wdata.h:36
char msg[1024]
Message to display.
Definition: wdata.h:40
size_t size
Total expected size.
Definition: wdata.h:42
char pretty_pos[24]
Pretty string for the position.
Definition: wdata.h:51
int display_percent
Displayed percentage complete.
Definition: wdata.h:49
size_t display_pos
Displayed position.
Definition: wdata.h:48
bool is_bytes
true if measuring bytes
Definition: wdata.h:45
struct MuttWindow * win
Window to draw on.
Definition: wdata.h:37
char pretty_size[24]
Pretty string for size.
Definition: wdata.h:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sb_repaint()

int sb_repaint ( struct MuttWindow win)

Repaint the Sidebar display - Implements MuttWindow::repaint() -.

Definition at line 897 of file window.c.

898{
900 const bool c_sidebar_on_right = cs_subset_bool(NeoMutt->sub, "sidebar_on_right");
901
902 int row = 0;
903 int num_rows = win->state.rows;
904 int num_cols = win->state.cols;
905
906 if (wdata->top_index >= 0)
907 {
908 int col = 0;
909 if (c_sidebar_on_right)
910 col = wdata->divider_width;
911
912 struct SbEntry **sbep = NULL;
913 ARRAY_FOREACH_FROM(sbep, &wdata->entries, wdata->top_index)
914 {
915 if (row >= num_rows)
916 break;
917
918 if ((*sbep)->is_hidden)
919 continue;
920
921 struct SbEntry *entry = (*sbep);
922 mutt_window_move(win, col, row);
924 mutt_window_printf(win, "%s", entry->display);
925 mutt_refresh();
926 row++;
927 }
928 }
929
930 fill_empty_space(win, row, num_rows - row, wdata->divider_width,
931 num_cols - wdata->divider_width);
932 draw_divider(wdata, win, num_rows, num_cols);
933
934 mutt_debug(LL_DEBUG5, "repaint done\n");
935 return 0;
936}
#define ARRAY_FOREACH_FROM(elem, head, from)
Iterate from an index to the end.
Definition: array.h:222
void mutt_refresh(void)
Force a refresh of the screen.
Definition: curs_lib.c:140
void mutt_curses_set_color(struct AttrColor *ac)
Set the colour and attributes for text.
Definition: mutt_curses.c:40
int mutt_window_printf(struct MuttWindow *win, const char *fmt,...)
Write a formatted string to a Window.
Definition: mutt_window.c:424
struct SidebarWindowData * sb_wdata_get(struct MuttWindow *win)
Get the Sidebar data for this window.
Definition: wdata.c:73
static void fill_empty_space(struct MuttWindow *win, int first_row, int num_rows, int div_width, int num_cols)
Wipe the remaining Sidebar space.
Definition: window.c:876
static int draw_divider(struct SidebarWindowData *wdata, struct MuttWindow *win, int num_rows, int num_cols)
Draw a line between the sidebar and the rest of neomutt.
Definition: window.c:830
Info about folders in the sidebar.
Definition: private.h:41
char display[256]
Formatted string to display.
Definition: private.h:43
struct AttrColor * color
Colour to use.
Definition: private.h:47
Sidebar private Window data -.
Definition: private.h:65
int top_index
First mailbox visible in sidebar.
Definition: private.h:70
short divider_width
Width of the divider in screen columns.
Definition: private.h:77
struct MuttWindow * win
Sidebar Window.
Definition: private.h:66
struct SbEntryArray entries
Items to display in the sidebar.
Definition: private.h:68
+ Here is the call graph for this function:
+ Here is the caller graph for this function: