118 int q_level,
int *rc,
struct Buffer *err)
221 if ((*quote_list)->down)
246 struct QuoteStyle *new_class,
int index,
int *q_level)
260 q_list = q_list->
down;
262 else if (q_list->
next)
264 q_list = q_list->
next;
268 while (!q_list->
next)
275 q_list = q_list->
next;
294 size_t length,
bool *force_redraw,
int *q_level)
297 struct QuoteStyle *qc = NULL, *tmp = NULL, *ptr = NULL, *save = NULL;
298 const char *tail_qptr = NULL;
299 size_t offset, tail_lng;
348 tmp->prefix_len = length;
353 tmp->next = q_list->
next;
371 if (q_list == *quote_list)
386 *force_redraw =
true;
392 q_list = q_list->
next;
408 q_list = q_list->
down;
409 tail_lng = length - offset;
410 tail_qptr = qptr + offset;
428 tmp->prefix_len = length;
433 tmp->next = q_list->
next;
444 tmp->
up = q_list->
up;
446 if (tmp->up->down == q_list)
490 *force_redraw =
true;
495 q_list = q_list->
next;
509 q_list = q_list->
down;
510 tail_lng = length - offset;
511 tail_qptr = qptr + offset;
518 q_list = q_list->
next;
529 tmp->prefix_len = length;
533 tmp->next = ptr->down;
534 ptr->down->prev = tmp;
539 tmp->quote_n = (*q_level)++;
555 q_list = q_list->
next;
572 if ((*quote_list)->next)
577 (*quote_list)->
next = qc;
578 qc->
prev = *quote_list;
606 *cur_qlevel = (*cur_qlevel + 1) % num_qlevel;
void attr_color_overwrite(struct AttrColor *ac_old, struct AttrColor *ac_new)
Update an AttrColor in-place.
void attr_color_clear(struct AttrColor *ac)
Free the contents of an AttrColor.
bool attr_color_is_set(const struct AttrColor *ac)
Is the object coloured?
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
void get_colorid_name(unsigned int cid, struct Buffer *buf)
Get the name of a color id.
struct Notify * ColorsNotify
Notifications: ColorId, EventColor.
struct AttrColor * simple_color_get(enum ColorId cid)
Get the colour of an object by its ID.
Color and attribute parsing.
ColorId
List of all colored objects.
@ MT_COLOR_QUOTED
Pager: quoted text.
CommandResult
Error codes for command_t parse functions.
@ MUTT_CMD_SUCCESS
Success: Command worked.
Convenience wrapper for the core headers.
void curses_color_free(struct CursesColor **ptr)
Free a CursesColor.
void curses_color_dump(struct CursesColor *cc, const char *prefix)
Log one Curses colour.
void curses_colors_dump(struct Buffer *buf)
Dump all the Curses colours.
static int color_debug(enum LogLevel level, const char *format,...)
@ LL_DEBUG5
Log at debug level 5.
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Convenience wrapper for the library headers.
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
char * mutt_strn_dup(const char *begin, size_t len)
Duplicate a sub-string.
bool mutt_strn_equal(const char *a, const char *b, size_t num)
Check for equality of two strings (to a maximum), safely.
@ NT_COLOR_RESET
Color has been reset/removed.
@ NT_COLOR_SET
Color has been set.
@ NT_COLOR
Colour has changed, NotifyColor, EventColor.
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
enum CommandResult quoted_colors_parse_uncolor(enum ColorId cid, int q_level, struct Buffer *err)
Parse the 'uncolor quoted' command.
struct QuoteStyle * qstyle_classify(struct QuoteStyle **quote_list, const char *qptr, size_t length, bool *force_redraw, int *q_level)
Find a style for a string.
struct AttrColor * quoted_colors_get(int q)
Return the color of a quote, cycling through the used quotes.
void qstyle_recolor(struct QuoteStyle *quote_list)
Recolour quotes after colour changes.
bool quoted_colors_parse_color(enum ColorId cid, struct AttrColor *ac_val, int q_level, int *rc, struct Buffer *err)
Parse the 'color quoted' command.
int quoted_colors_num_used(void)
Return the number of used quotes.
int NumQuotedColors
Number of colours for quoted email text.
struct AttrColor QuotedColors[COLOR_QUOTES_MAX]
Array of colours for quoted email text.
static void qstyle_recurse(struct QuoteStyle *quote_list, int num_qlevel, int *cur_qlevel)
Update the quoting styles after colour changes.
void qstyle_free_tree(struct QuoteStyle **quote_list)
Free an entire tree of QuoteStyle.
void quoted_colors_init(void)
Initialise the Quoted colours.
static void qstyle_insert(struct QuoteStyle *quote_list, struct QuoteStyle *new_class, int index, int *q_level)
Insert a new quote colour class into a list.
static struct QuoteStyle * qstyle_new(void)
Create a new QuoteStyle.
void quoted_colors_cleanup(void)
Reset the quoted-email colours.
static void qstyle_free(struct QuoteStyle **ptr)
Free a single QuoteStyle object.
static int find_highest_used(void)
Find the highest-numbered quotedN in use.
#define COLOR_QUOTES_MAX
Ten colours, quoted0..quoted9 (quoted and quoted0 are equivalent)
A curses colour and its attributes.
struct ColorElement bg
Background colour.
struct ColorElement fg
Foreground colour.
short ref_count
Number of users.
struct CursesColor * curses_color
Underlying Curses colour.
String manipulation buffer.
char * data
Pointer to data.
Colour in the ncurses palette.
short ref_count
Number of users.
An Event that happened to a Colour.
enum ColorId cid
Colour ID that has changed.
struct AttrColor * attr_color
Colour and attribute of the text.
struct QuoteStyle * next
Different quoting styles at the same level.
size_t prefix_len
Length of the prefix string.
char * prefix
Prefix string, e.g. "> ".
struct QuoteStyle * down
Parent (less quoted) and child (more quoted) levels.
int quote_n
The quoteN colour index for this level.