64 char buf[1024] = { 0 };
65 snprintf(buf,
sizeof(buf),
_(
"-- Remailer chain [Length: %d]"), cd->
chain_len);
108 const int wrap_indent = 2;
110 if (!win || !win->
wdata)
120 short col = 0, row = 0;
124 int index = cd->
chain[i];
126 col += strlen((*rp)->shortname) + 2;
130 old_col = wrap_indent;
147 for (
int i = 0; i < win->
state.
rows; i++)
167 int index = cd->
chain[i];
209 if (!win || !win->
wdata)
235 if (!win || !win->
wdata)
245 const int j = cd->
chain[i];
249 t = (*rp)->shortname;
269 if (!win || !win->
wdata)
284 if (!win || !win->
wdata)
295 mutt_error(
_(
"You already have the last chain element selected"));
310 if (!win || !win->
wdata)
321 mutt_error(
_(
"You already have the first chain element selected"));
337 if (!win || !win->
wdata || !r)
356 if (!win || !win->
wdata || !r)
387 if (!win || !win->
wdata)
404 mutt_error(
_(
"The remailer chain is already empty"));
419 if (!win || !win->
wdata)
432 mutt_error(
_(
"Error: %s can't be used as the final remailer of a chain"),
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
#define ARRAY_GET(head, idx)
Return the element at index.
struct ChainData * chain_data_new(void)
Create new Chain data.
#define MAX_MIXES
Mixmaster's maximum chain length. Don't change this.
Color and attribute parsing.
@ MT_COLOR_INDICATOR
Selected item in list.
@ MT_COLOR_NORMAL
Plain text.
static int win_chain_recalc(struct MuttWindow *win)
Recalculate the Chain list - Implements MuttWindow::recalc() -.
static int win_chain_repaint(struct MuttWindow *win)
Repaint the Chain list - Implements MuttWindow::repaint() -.
void chain_data_free(struct MuttWindow *win, void **ptr)
Free the Chain data attached to the Window - Implements MuttWindow::wdata_free() -.
Convenience wrapper for the gui headers.
struct ListNode * mutt_list_insert_tail(struct ListHead *h, char *s)
Append a string to the end of a List.
Convenience wrapper for the library headers.
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
char * mutt_str_dup(const char *str)
Copy a string, safely.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
struct AttrColor * mutt_curses_set_color_by_id(enum ColorId cid)
Set the colour and attributes by the colour id.
struct MuttWindow * mutt_window_new(enum WindowType type, enum MuttWindowOrientation orient, enum MuttWindowSize size, int cols, int rows)
Create a new Window.
int mutt_window_move(struct MuttWindow *win, int col, int row)
Move the cursor in a Window.
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.
int mutt_window_addstr(struct MuttWindow *win, const char *str)
Write a string to a Window.
void mutt_window_clrtoeol(struct MuttWindow *win)
Clear to the end of the line.
#define WA_RECALC
Recalculate the contents of the Window.
@ WT_CUSTOM
Window with a custom drawing function.
@ MUTT_WIN_ORIENT_VERTICAL
Window uses all available vertical space.
#define WA_REPAINT
Redraw the contents of the Window.
#define MUTT_WIN_SIZE_UNLIMITED
Use as much space as possible.
@ MUTT_WIN_SIZE_FIXED
Window has a fixed size.
#define STAILQ_FOREACH(var, head, field)
#define MIX_CAP_MIDDLEMAN
Must be a middle-man (not at the end of a chain)
void sbar_set_title(struct MuttWindow *win, const char *title)
Set the title for the Simple Bar.
An ordered set of Remailer hosts.
int chain_len
Length of chain.
struct RemailerArray * ra
Array of all Remailer hosts.
struct MuttWindow * win_cbar
Chain Bar (status window)
int chain[MAX_MIXES]
Indexes of chain hosts.
int sel
Current selection.
struct Coord coords[MAX_MIXES]
Screen coordinates of each entry.
int(* repaint)(struct MuttWindow *win)
struct WindowState state
Current state of the Window.
void * wdata
Private data.
int(* recalc)(struct MuttWindow *win)
void(* wdata_free)(struct MuttWindow *win, void **ptr)
WindowActionFlags actions
Actions to be performed, e.g. WA_RECALC.
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
short rows
Number of rows, can be MUTT_WIN_SIZE_UNLIMITED.
bool win_chain_prev(struct MuttWindow *win)
Select the previous entry in the Chain list.
static void cbar_update(struct ChainData *cd)
Update the Chain bar (status bar)
int win_chain_extract(struct MuttWindow *win, struct ListHead *chain)
Extract the Chain list data.
struct MuttWindow * win_chain_new(struct MuttWindow *win_cbar)
Create a new Chain list Window.
bool win_chain_insert(struct MuttWindow *win, struct Remailer *r)
Add an item to the Chain, before the current item.
bool win_chain_delete(struct MuttWindow *win)
Delete the current item from the Chain.
bool win_chain_next(struct MuttWindow *win)
Select the next entry in the Chain list.
void win_chain_init(struct MuttWindow *win, struct ListHead *chain, struct RemailerArray *ra)
Initialise the Chain list Window.
bool win_chain_validate(struct MuttWindow *win)
Validate the Chain.
static int chain_add(struct ChainData *cd, const char *s, struct RemailerArray *ra)
Add a host to the chain.
bool win_chain_append(struct MuttWindow *win, struct Remailer *r)
Add an item to the Chain, after the current item.
int win_chain_get_length(struct MuttWindow *win)
Get the number of Remailers in the Chain.