NeoMutt  2021-02-05-666-ge300cd
Teaching an old dog new tricks
DOXYGEN
repaint()

Repaint the Window. More...

+ Collaboration diagram for repaint():

Functions

int attach_repaint (struct MuttWindow *win)
 Repaint the Window - Implements MuttWindow::repaint() -. More...
 
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() -The Help Bar is drawn from the data cached in the HelpbarWindowData. More...
 
static int ibar_repaint (struct MuttWindow *win)
 Repaint the Window - Implements MuttWindow::repaint() -. More...
 
static int menu_repaint (struct MuttWindow *win)
 Repaint the Window - Implements MuttWindow::repaint() -. More...
 
static int pbar_repaint (struct MuttWindow *win)
 Repaint the Window - 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

◆ attach_repaint()

int attach_repaint ( struct MuttWindow win)

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

Definition at line 157 of file attach.c.

158 {
159  if (!mutt_window_is_visible(win))
160  return 0;
161 #if 0
162  struct ComposeBarData *attach_data = win->wdata;
163 
164  mutt_window_move(win, 0, 0);
167 
168  mutt_window_move(win, 0, 0);
169  mutt_draw_statusline(win->state.cols, attach_data->compose_format,
170  mutt_str_len(attach_data->compose_format));
172 #endif
173  mutt_debug(LL_DEBUG5, "repaint done\n");
174  return 0;
175 }
void mutt_curses_set_color(enum ColorId color)
Set the current colour for text.
Definition: mutt_curses.c:56
void mutt_window_clrtoeol(struct MuttWindow *win)
Clear to the end of the line.
Definition: mutt_window.c:259
int mutt_window_move(struct MuttWindow *win, int col, int row)
Move the cursor in a Window.
Definition: mutt_window.c:310
Plain text.
Definition: color.h:58
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:60
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:127
bool mutt_window_is_visible(struct MuttWindow *win)
Is the Window visible?
Definition: mutt_window.c:529
Status bar (takes a pattern)
Definition: color.h:75
void mutt_draw_statusline(struct MuttWindow *win, int cols, const char *buf, size_t buflen)
Draw a highlighted status bar.
Definition: dlg_index.c:875
Data to fill the Compose Bar Window.
Definition: cbar_data.h:33
#define mutt_debug(LEVEL,...)
Definition: logging.h:85
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
Definition: string.c:664
char * compose_format
Cached status string.
Definition: cbar_data.h:35
Log at debug level 5.
Definition: logging.h:44
void * wdata
Private data.
Definition: mutt_window.h:145
+ Here is the call graph for this function:

◆ cbar_repaint()

static int cbar_repaint ( struct MuttWindow win)
static

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

Definition at line 182 of file cbar.c.

183 {
184  if (!mutt_window_is_visible(win))
185  return 0;
186 
187  struct ComposeBarData *cbar_data = win->wdata;
188 
189  mutt_window_move(win, 0, 0);
192 
193  mutt_window_move(win, 0, 0);
194  mutt_draw_statusline(win, win->state.cols, cbar_data->compose_format,
195  mutt_str_len(cbar_data->compose_format));
197  mutt_debug(LL_DEBUG5, "repaint done\n");
198 
199  return 0;
200 }
void mutt_curses_set_color(enum ColorId color)
Set the current colour for text.
Definition: mutt_curses.c:56
void mutt_window_clrtoeol(struct MuttWindow *win)
Clear to the end of the line.
Definition: mutt_window.c:259
int mutt_window_move(struct MuttWindow *win, int col, int row)
Move the cursor in a Window.
Definition: mutt_window.c:310
Plain text.
Definition: color.h:58
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:60
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:127
bool mutt_window_is_visible(struct MuttWindow *win)
Is the Window visible?
Definition: mutt_window.c:529
Status bar (takes a pattern)
Definition: color.h:75
void mutt_draw_statusline(struct MuttWindow *win, int cols, const char *buf, size_t buflen)
Draw a highlighted status bar.
Definition: dlg_index.c:875
Data to fill the Compose Bar Window.
Definition: cbar_data.h:33
#define mutt_debug(LEVEL,...)
Definition: logging.h:85
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
Definition: string.c:664
char * compose_format
Cached status string.
Definition: cbar_data.h:35
Log at debug level 5.
Definition: logging.h:44
void * wdata
Private data.
Definition: mutt_window.h:145
+ 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 687 of file envelope.c.

688 {
689  if (!mutt_window_is_visible(win))
690  return 0;
691 
692  struct ComposeSharedData *shared = win->parent->wdata;
693  struct ComposeEnvelopeData *edata = win->wdata;
694 
695  draw_envelope(win, shared, edata);
696  mutt_debug(LL_DEBUG5, "repaint done\n");
697  return 0;
698 }
Shared Compose Data.
Definition: shared_data.h:29
Data to fill the Compose Envelope Window.
Definition: env_data.h:37
static void draw_envelope(struct MuttWindow *win, struct ComposeSharedData *shared, struct ComposeEnvelopeData *edata)
Write the email headers to the compose window.
Definition: envelope.c:605
bool mutt_window_is_visible(struct MuttWindow *win)
Is the Window visible?
Definition: mutt_window.c:529
#define mutt_debug(LEVEL,...)
Definition: logging.h:85
struct MuttWindow * parent
Parent Window.
Definition: mutt_window.h:135
Log at debug level 5.
Definition: logging.h:44
void * wdata
Private data.
Definition: mutt_window.h:145
+ 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 117 of file msgwin.c.

118 {
119  if (!mutt_window_is_visible(win) || window_is_focused(win)) // or someone else is using it
120  return 0;
121 
122  struct MsgWinPrivateData *priv = win->wdata;
123 
124  mutt_window_move(win, 0, 0);
125 
127  mutt_window_move(win, 0, 0);
128  mutt_paddstr(win, win->state.cols, priv->text);
130 
131  mutt_debug(LL_DEBUG5, "repaint done\n");
132  return 0;
133 }
enum ColorId color
Colour for the text, e.g. MT_COLOR_MESSAGE.
Definition: msgwin.c:97
void mutt_curses_set_color(enum ColorId color)
Set the current colour for text.
Definition: mutt_curses.c:56
int mutt_window_move(struct MuttWindow *win, int col, int row)
Move the cursor in a Window.
Definition: mutt_window.c:310
Private data for the Message Window.
Definition: msgwin.c:95
Plain text.
Definition: color.h:58
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:60
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:127
bool mutt_window_is_visible(struct MuttWindow *win)
Is the Window visible?
Definition: mutt_window.c:529
#define mutt_debug(LEVEL,...)
Definition: logging.h:85
bool window_is_focused(struct MuttWindow *win)
Does the given Window have the focus?
Definition: mutt_window.c:650
char * text
Cached display string.
Definition: msgwin.c:98
Log at debug level 5.
Definition: logging.h:44
void * wdata
Private data.
Definition: mutt_window.h:145
void mutt_paddstr(struct MuttWindow *win, int n, const char *s)
Display a string on screen, padded if necessary.
Definition: curs_lib.c:890
+ 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 94 of file sbar.c.

95 {
96  if (!mutt_window_is_visible(win))
97  return 0;
98 
99  struct SBarPrivateData *priv = win->wdata;
100 
101  mutt_window_move(win, 0, 0);
102 
104  mutt_window_move(win, 0, 0);
105  mutt_paddstr(win, win->state.cols, priv->display);
107 
108  mutt_debug(LL_DEBUG5, "repaint done\n");
109  return 0;
110 }
void mutt_curses_set_color(enum ColorId color)
Set the current colour for text.
Definition: mutt_curses.c:56
char * display
Cached display string.
Definition: sbar.c:75
int mutt_window_move(struct MuttWindow *win, int col, int row)
Move the cursor in a Window.
Definition: mutt_window.c:310
Plain text.
Definition: color.h:58
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:60
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:127
bool mutt_window_is_visible(struct MuttWindow *win)
Is the Window visible?
Definition: mutt_window.c:529
Status bar (takes a pattern)
Definition: color.h:75
Private data for the Simple Bar.
Definition: sbar.c:73
#define mutt_debug(LEVEL,...)
Definition: logging.h:85
Log at debug level 5.
Definition: logging.h:44
void * wdata
Private data.
Definition: mutt_window.h:145
void mutt_paddstr(struct MuttWindow *win, int n, const char *s)
Display a string on screen, padded if necessary.
Definition: curs_lib.c:890
+ 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 180 of file helpbar.c.

181 {
182  if (!mutt_window_is_visible(win))
183  return 0;
184 
186  if (!wdata)
187  return 0;
188 
190  mutt_window_move(win, 0, 0);
191  mutt_paddstr(win, win->state.cols, wdata->help_str);
193 
194  mutt_debug(LL_DEBUG5, "repaint done\n");
195  return 0;
196 }
void mutt_curses_set_color(enum ColorId color)
Set the current colour for text.
Definition: mutt_curses.c:56
char * help_str
Formatted Help Bar string.
Definition: private.h:37
int mutt_window_move(struct MuttWindow *win, int col, int row)
Move the cursor in a Window.
Definition: mutt_window.c:310
struct HelpbarWindowData * helpbar_wdata_get(struct MuttWindow *win)
Get the Helpbar data for this window.
Definition: wdata.c:61
Plain text.
Definition: color.h:58
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:60
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:127
bool mutt_window_is_visible(struct MuttWindow *win)
Is the Window visible?
Definition: mutt_window.c:529
Status bar (takes a pattern)
Definition: color.h:75
Help Bar Window data -.
Definition: private.h:33
#define mutt_debug(LEVEL,...)
Definition: logging.h:85
Log at debug level 5.
Definition: logging.h:44
void * wdata
Private data.
Definition: mutt_window.h:145
void mutt_paddstr(struct MuttWindow *win, int n, const char *s)
Display a string on screen, padded if necessary.
Definition: curs_lib.c:890
+ 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 141 of file ibar.c.

142 {
143  if (!mutt_window_is_visible(win))
144  return 0;
145 
146  struct IBarPrivateData *ibar_data = win->wdata;
147  struct IndexSharedData *shared = ibar_data->shared;
148 
149  mutt_window_move(win, 0, 0);
152 
153  mutt_window_move(win, 0, 0);
154  mutt_draw_statusline(win, win->state.cols, ibar_data->status_format,
155  mutt_str_len(ibar_data->status_format));
157 
158  const bool c_ts_enabled = cs_subset_bool(shared->sub, "ts_enabled");
159  if (c_ts_enabled && TsSupported)
160  {
161  mutt_ts_status(ibar_data->ts_status_format);
162  mutt_ts_icon(ibar_data->ts_icon_format);
163  }
164 
165  mutt_debug(LL_DEBUG5, "repaint done\n");
166  return 0;
167 }
char * ts_icon_format
Cached terminal icon string.
Definition: ibar.c:84
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition: helpers.c:73
struct IndexSharedData * shared
Shared Index data.
Definition: ibar.c:80
void mutt_curses_set_color(enum ColorId color)
Set the current colour for text.
Definition: mutt_curses.c:56
struct ConfigSubset * sub
Config set to use.
Definition: shared_data.h:38
void mutt_window_clrtoeol(struct MuttWindow *win)
Clear to the end of the line.
Definition: mutt_window.c:259
char * status_format
Cached screen status string.
Definition: ibar.c:82
Data shared between Index, Pager and Sidebar.
Definition: shared_data.h:36
char * ts_status_format
Cached terminal status string.
Definition: ibar.c:83
int mutt_window_move(struct MuttWindow *win, int col, int row)
Move the cursor in a Window.
Definition: mutt_window.c:310
Plain text.
Definition: color.h:58
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:60
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:127
bool mutt_window_is_visible(struct MuttWindow *win)
Is the Window visible?
Definition: mutt_window.c:529
Status bar (takes a pattern)
Definition: color.h:75
void mutt_draw_statusline(struct MuttWindow *win, int cols, const char *buf, size_t buflen)
Draw a highlighted status bar.
Definition: dlg_index.c:875
bool TsSupported
Terminal Setting is supported.
Definition: terminal.c:43
#define mutt_debug(LEVEL,...)
Definition: logging.h:85
Data to draw the Index Bar.
Definition: ibar.c:78
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
Definition: string.c:664
void mutt_ts_icon(char *str)
Set the icon in the terminal title bar.
Definition: terminal.c:118
void mutt_ts_status(char *str)
Set the text of the terminal title bar.
Definition: terminal.c:104
Log at debug level 5.
Definition: logging.h:44
void * wdata
Private data.
Definition: mutt_window.h:145
+ 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 97 of file window.c.

98 {
99  if (win->type != WT_MENU)
100  return 0;
101 
102  // struct Menu *menu = win->wdata;
103  // menu_redraw(menu);
104  // menu->redraw = MENU_REDRAW_NO_FLAGS;
105 
106  mutt_debug(LL_DEBUG5, "repaint done\n");
107  return 0;
108 }
#define mutt_debug(LEVEL,...)
Definition: logging.h:85
Log at debug level 5.
Definition: logging.h:44
enum WindowType type
Window type, e.g. WT_SIDEBAR.
Definition: mutt_window.h:144
An Window containing a Menu.
Definition: mutt_window.h:98
+ 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 146 of file pbar.c.

147 {
148  if (!mutt_window_is_visible(win))
149  return 0;
150 
151  struct PBarPrivateData *pbar_data = win->wdata;
152  // struct IndexSharedData *shared = pbar_data->shared;
153 
154  mutt_window_move(win, 0, 0);
157 
158  mutt_window_move(win, 0, 0);
159  mutt_draw_statusline(win, win->state.cols, pbar_data->pager_format,
160  mutt_str_len(pbar_data->pager_format));
162 
163  mutt_debug(LL_DEBUG5, "repaint done\n");
164  return 0;
165 }
void mutt_curses_set_color(enum ColorId color)
Set the current colour for text.
Definition: mutt_curses.c:56
void mutt_window_clrtoeol(struct MuttWindow *win)
Clear to the end of the line.
Definition: mutt_window.c:259
int mutt_window_move(struct MuttWindow *win, int col, int row)
Move the cursor in a Window.
Definition: mutt_window.c:310
char * pager_format
Cached status string.
Definition: pbar.c:87
Plain text.
Definition: color.h:58
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:60
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:127
bool mutt_window_is_visible(struct MuttWindow *win)
Is the Window visible?
Definition: mutt_window.c:529
Status bar (takes a pattern)
Definition: color.h:75
void mutt_draw_statusline(struct MuttWindow *win, int cols, const char *buf, size_t buflen)
Draw a highlighted status bar.
Definition: dlg_index.c:875
Data to draw the Pager Bar.
Definition: pbar.c:83
#define mutt_debug(LEVEL,...)
Definition: logging.h:85
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
Definition: string.c:664
Log at debug level 5.
Definition: logging.h:44
void * wdata
Private data.
Definition: mutt_window.h:145
+ 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 891 of file window.c.

892 {
893  if (!mutt_window_is_visible(win))
894  return 0;
895 
896  struct SidebarWindowData *wdata = sb_wdata_get(win);
897  const bool c_sidebar_on_right =
898  cs_subset_bool(NeoMutt->sub, "sidebar_on_right");
899 
900  int row = 0;
901  int num_rows = win->state.rows;
902  int num_cols = win->state.cols;
903 
904  if (wdata->top_index >= 0)
905  {
906  int col = 0;
907  if (c_sidebar_on_right)
908  col = wdata->divider_width;
909 
910  struct SbEntry **sbep = NULL;
911  ARRAY_FOREACH_FROM(sbep, &wdata->entries, wdata->top_index)
912  {
913  if (row >= num_rows)
914  break;
915 
916  if ((*sbep)->is_hidden)
917  continue;
918 
919  struct SbEntry *entry = (*sbep);
920  mutt_window_move(win, col, row);
922  mutt_window_printf(win, "%s", entry->display);
923  mutt_refresh();
924  row++;
925  }
926  }
927 
928  fill_empty_space(win, row, num_rows - row, wdata->divider_width,
929  num_cols - wdata->divider_width);
930  draw_divider(wdata, win, num_rows, num_cols);
931 
932  mutt_debug(LL_DEBUG5, "repaint done\n");
933  return 0;
934 }
char display[256]
Formatted string to display.
Definition: private.h:42
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition: helpers.c:73
int top_index
First mailbox visible in sidebar.
Definition: private.h:67
void mutt_curses_set_color(enum ColorId color)
Set the current colour for text.
Definition: mutt_curses.c:56
Sidebar private Window data -.
Definition: private.h:62
enum ColorId color
Colour to use.
Definition: private.h:46
Info about folders in the sidebar.
Definition: private.h:39
Container for Accounts, Notifications.
Definition: neomutt.h:36
int mutt_window_move(struct MuttWindow *win, int col, int row)
Move the cursor in a Window.
Definition: mutt_window.c:310
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:60
void mutt_refresh(void)
Force a refresh of the screen.
Definition: curs_lib.c:115
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:127
bool mutt_window_is_visible(struct MuttWindow *win)
Is the Window visible?
Definition: mutt_window.c:529
short rows
Number of rows, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:61
int mutt_window_printf(struct MuttWindow *win, const char *fmt,...)
Write a formatted string to a Window.
Definition: mutt_window.c:453
#define mutt_debug(LEVEL,...)
Definition: logging.h:85
#define ARRAY_FOREACH_FROM(elem, head, from)
Iterate from an index to the end.
Definition: array.h:217
short divider_width
Width of the divider in screen columns.
Definition: private.h:74
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:39
Log at debug level 5.
Definition: logging.h:44
void * wdata
Private data.
Definition: mutt_window.h:145
+ Here is the call graph for this function:
+ Here is the caller graph for this function: