NeoMutt  2024-10-02-37-gfa9146
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
attr.h
Go to the documentation of this file.
1
23#ifndef MUTT_COLOR_ATTR_H
24#define MUTT_COLOR_ATTR_H
25
26#include "config.h"
27#include <stdbool.h>
28#include "mutt/lib.h"
29#include "curses2.h"
30
35{
39};
40
45{
50};
51
56{
60};
61
66{
69 int attrs;
71 short ref_count;
73};
74TAILQ_HEAD(AttrColorList, AttrColor);
75
76void attr_color_clear (struct AttrColor *ac);
77struct AttrColor attr_color_copy (const struct AttrColor *ac);
78void attr_color_free (struct AttrColor **ptr);
79bool attr_color_is_set(const struct AttrColor *ac);
80bool attr_color_match (struct AttrColor *ac1, struct AttrColor *ac2);
81struct AttrColor *attr_color_new (void);
82
83void attr_color_list_clear(struct AttrColorList *acl);
84struct AttrColor *attr_color_list_find (struct AttrColorList *acl, color_t fg, color_t bg, int attrs);
85
86void attr_color_overwrite(struct AttrColor *ac_old, struct AttrColor *ac_new);
87
88#endif /* MUTT_COLOR_ATTR_H */
struct AttrColor * attr_color_list_find(struct AttrColorList *acl, color_t fg, color_t bg, int attrs)
Find an AttrColor in a list.
Definition: attr.c:139
void attr_color_overwrite(struct AttrColor *ac_old, struct AttrColor *ac_new)
Update an AttrColor in-place.
Definition: attr.c:395
void attr_color_clear(struct AttrColor *ac)
Free the contents of an AttrColor.
Definition: attr.c:48
ColorPrefix
Constants for colour prefixes of named colours.
Definition: attr.h:45
@ COLOR_PREFIX_NONE
no prefix
Definition: attr.h:46
@ COLOR_PREFIX_ALERT
"alert" colour prefix
Definition: attr.h:47
@ COLOR_PREFIX_LIGHT
"light" colour prefix
Definition: attr.h:49
@ COLOR_PREFIX_BRIGHT
"bright" colour prefix
Definition: attr.h:48
ColorType
Type of Colour.
Definition: attr.h:35
@ CT_SIMPLE
Simple colour, e.g. "Red".
Definition: attr.h:36
@ CT_PALETTE
Palette colour, e.g. "color207".
Definition: attr.h:37
@ CT_RGB
True colour, e.g. "#11AAFF".
Definition: attr.h:38
bool attr_color_match(struct AttrColor *ac1, struct AttrColor *ac2)
Do the colours match?
Definition: attr.c:193
struct AttrColor attr_color_copy(const struct AttrColor *ac)
Copy a colour.
Definition: attr.c:166
struct AttrColor * attr_color_new(void)
Create a new AttrColor.
Definition: attr.c:90
void attr_color_free(struct AttrColor **ptr)
Free an AttrColor.
Definition: attr.c:69
void attr_color_list_clear(struct AttrColorList *acl)
Free the contents of an AttrColorList.
Definition: attr.c:117
bool attr_color_is_set(const struct AttrColor *ac)
Is the object coloured?
Definition: attr.c:179
Curses Colour.
int32_t color_t
Type for 24-bit colour value.
Definition: curses2.h:31
Convenience wrapper for the library headers.
#define TAILQ_HEAD(name, type)
Definition: queue.h:623
A curses colour and its attributes.
Definition: attr.h:66
struct ColorElement bg
Background colour.
Definition: attr.h:68
struct ColorElement fg
Foreground colour.
Definition: attr.h:67
TAILQ_ENTRY(AttrColor) entries
Linked list.
short ref_count
Number of users.
Definition: attr.h:71
int attrs
Text attributes, e.g. A_BOLD.
Definition: attr.h:69
struct CursesColor * curses_color
Underlying Curses colour.
Definition: attr.h:70
One element of a Colour.
Definition: attr.h:56
enum ColorType type
Type of Colour.
Definition: attr.h:58
color_t color
Colour.
Definition: attr.h:57
enum ColorPrefix prefix
Optional Colour Modifier.
Definition: attr.h:59
Colour in the ncurses palette.
Definition: curses2.h:41