forked from neomutt/neomutt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotify2.h
64 lines (56 loc) · 1.83 KB
/
notify2.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/**
* @file
* Colour notifications
*
* @authors
* Copyright (C) 2021 Richard Russon <[email protected]>
*
* @copyright
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 2 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MUTT_COLOR_NOTIFY2_H
#define MUTT_COLOR_NOTIFY2_H
#include "config.h"
#include "mutt/lib.h"
#include "color.h"
extern struct Notify *ColorsNotify;
/**
* enum NotifyColor - Types of Color Event
*
* Observers of #NT_COLOR will be passed an #EventColor.
*
* @note Notifications are sent **after** the event.
*/
enum NotifyColor
{
NT_COLOR_SET = 1, ///< Color has been set
NT_COLOR_RESET, ///< Color has been reset/removed
};
/**
* struct EventColor - An Event that happened to a Colour
*
* Observers will be passed a type of #NT_COLOR and a subtype of
* #NT_COLOR_SET or #NT_COLOR_RESET with a struct which
* describes the colour, e.g. #MT_COLOR_SIDEBAR_HIGHLIGHT.
*/
struct EventColor
{
enum ColorId cid; ///< Colour ID that has changed
struct AttrColor *attr_color; ///< Colour object that has changed
};
void color_notify_init(void);
void color_notify_cleanup(void);
void mutt_color_observer_add (observer_t callback, void *global_data);
void mutt_color_observer_remove(observer_t callback, void *global_data);
#endif /* MUTT_COLOR_NOTIFY2_H */