NeoMutt  2024-12-12-14-g7b49f7
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
color.c
Go to the documentation of this file.
1
31#include "config.h"
32#include <stdbool.h>
33#include <stdio.h>
34#include "mutt/lib.h"
35#include "core/lib.h"
36#include "gui/lib.h"
37#include "color.h"
38#include "curses2.h"
39#include "debug.h"
40#include "merged.h"
41#include "notify2.h"
42#include "quoted.h"
43#include "regex4.h"
44#include "simple2.h"
45
49void colors_init(void)
50{
51 color_debug(LL_DEBUG5, "init\n");
53
59
60 start_color();
61 use_default_colors();
62 color_debug(LL_DEBUG5, "COLORS = %d, COLOR_PAIRS = %d\n", COLORS, COLOR_PAIRS);
63}
64
68void colors_reset(void)
69{
70 color_debug(LL_DEBUG5, "reset\n");
71 mutt_debug(LL_NOTIFY, "NT_COLOR_RESET: [ALL]\n");
72
76
77 struct EventColor ev_c = { MT_COLOR_MAX, NULL };
79}
80
85{
91}
92
99{
100 return (cid == MT_COLOR_ATTACH_HEADERS) || (cid == MT_COLOR_BODY) ||
101 (cid == MT_COLOR_HEADER) || (cid == MT_COLOR_INDEX) ||
107 (cid == MT_COLOR_STATUS);
108}
struct Notify * ColorsNotify
Notifications: ColorId, EventColor.
Definition: notify.c:36
void color_notify_init(struct Notify *parent)
Initialise the Colour notification.
Definition: notify.c:42
void color_notify_cleanup(void)
Free the Colour notification.
Definition: notify.c:51
void regex_colors_init(void)
Initialise the Regex colours.
Definition: regex.c:68
void regex_colors_reset(void)
Reset the Regex colours.
Definition: regex.c:91
void regex_colors_cleanup(void)
Cleanup the Regex colours.
Definition: regex.c:114
void simple_colors_init(void)
Initialise the simple colour definitions.
Definition: simple.c:47
void simple_colors_cleanup(void)
Cleanup the simple colour definitions.
Definition: simple.c:83
void simple_colors_reset(void)
Reset the simple colour definitions.
Definition: simple.c:70
void colors_cleanup(void)
Cleanup all the colours.
Definition: color.c:84
void colors_init(void)
Initialize colours.
Definition: color.c:49
bool mutt_color_has_pattern(enum ColorId cid)
Check if a color object supports a regex pattern.
Definition: color.c:98
void colors_reset(void)
Reset all the simple, quoted and regex colours.
Definition: color.c:68
Color and attribute parsing.
ColorId
List of all coloured objects.
Definition: color.h:36
@ MT_COLOR_INDEX_AUTHOR
Index: author field.
Definition: color.h:80
@ MT_COLOR_MAX
Definition: color.h:90
@ MT_COLOR_HEADER
Message headers (takes a pattern)
Definition: color.h:49
@ MT_COLOR_STATUS
Status bar (takes a pattern)
Definition: color.h:71
@ MT_COLOR_INDEX_SIZE
Index: size field.
Definition: color.h:86
@ MT_COLOR_INDEX_TAGS
Index: tags field (g, J)
Definition: color.h:89
@ MT_COLOR_INDEX_SUBJECT
Index: subject field.
Definition: color.h:87
@ MT_COLOR_BODY
Pager: highlight body of message (takes a pattern)
Definition: color.h:40
@ MT_COLOR_INDEX_DATE
Index: date field.
Definition: color.h:82
@ MT_COLOR_INDEX_TAG
Index: tag field (G)
Definition: color.h:88
@ MT_COLOR_ATTACH_HEADERS
MIME attachment test (takes a pattern)
Definition: color.h:39
@ MT_COLOR_INDEX_LABEL
Index: label field.
Definition: color.h:84
@ MT_COLOR_INDEX
Index: default colour.
Definition: color.h:79
@ MT_COLOR_INDEX_NUMBER
Index: index number.
Definition: color.h:85
@ MT_COLOR_INDEX_FLAGS
Index: flags field.
Definition: color.h:83
@ MT_COLOR_INDEX_COLLAPSED
Index: number of messages in collapsed thread.
Definition: color.h:81
Convenience wrapper for the core headers.
Curses Colour.
void curses_colors_init(void)
Initialise the Curses colours.
Definition: curses.c:44
Colour Debugging.
static int color_debug(enum LogLevel level, const char *format,...)
Definition: debug.h:52
#define mutt_debug(LEVEL,...)
Definition: logging2.h:89
Convenience wrapper for the gui headers.
@ LL_DEBUG5
Log at debug level 5.
Definition: logging2.h:47
@ LL_NOTIFY
Log of notifications.
Definition: logging2.h:48
void merged_colors_cleanup(void)
Free the list of Merged colours.
Definition: merged.c:52
void merged_colors_init(void)
Initialise the Merged colours.
Definition: merged.c:44
Merged colours.
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.
Definition: notify.c:173
Colour notifications.
@ NT_COLOR_RESET
Color has been reset/removed.
Definition: notify2.h:44
@ NT_COLOR
Colour has changed, NotifyColor, EventColor.
Definition: notify_type.h:41
void quoted_colors_init(void)
Initialise the Quoted colours.
Definition: quoted.c:49
void quoted_colors_reset(void)
Reset the quoted-email colours.
Definition: quoted.c:63
void quoted_colors_cleanup(void)
Cleanup the quoted-email colours.
Definition: quoted.c:76
Quoted-Email colours.
Regex Colour.
Simple colour.
An Event that happened to a Colour.
Definition: notify2.h:55
enum ColorId cid
Colour ID that has changed.
Definition: notify2.h:56
Container for Accounts, Notifications.
Definition: neomutt.h:42
struct Notify * notify
Notifications handler.
Definition: neomutt.h:43