1 /*
2  * Copyright 2020 Michael Drake <tlsa@netsurf-browser.org>
3  *
4  * This file is part of NetSurf, http://www.netsurf-browser.org/
5  *
6  * NetSurf is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; version 2 of the License.
9  *
10  * NetSurf is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 /** \file
20  * NetSurf UI colours (interface).
21  *
22  * Interface to acquire common colours used throughout NetSurf's interface.
23  */
24 
25 #ifndef _NETSURF_UTILS_NSCOLOUR_H_
26 #define _NETSURF_UTILS_NSCOLOUR_H_
27 
28 #include "netsurf/types.h"
29 
30 /**
31  * NetSurf UI colour key.
32  */
33 enum nscolour {
34 	NSCOLOUR_WIN_ODD_BG,
35 	NSCOLOUR_WIN_ODD_BG_HOVER,
36 	NSCOLOUR_WIN_ODD_FG,
37 	NSCOLOUR_WIN_ODD_FG_SUBTLE,
38 	NSCOLOUR_WIN_ODD_FG_FADED,
39 	NSCOLOUR_WIN_ODD_FG_GOOD,
40 	NSCOLOUR_WIN_ODD_FG_BAD,
41 	NSCOLOUR_WIN_ODD_BORDER,
42 	NSCOLOUR_WIN_EVEN_BG,
43 	NSCOLOUR_WIN_EVEN_BG_HOVER,
44 	NSCOLOUR_WIN_EVEN_FG,
45 	NSCOLOUR_WIN_EVEN_FG_SUBTLE,
46 	NSCOLOUR_WIN_EVEN_FG_FADED,
47 	NSCOLOUR_WIN_EVEN_FG_GOOD,
48 	NSCOLOUR_WIN_EVEN_FG_BAD,
49 	NSCOLOUR_WIN_EVEN_BORDER,
50 	NSCOLOUR_TEXT_INPUT_BG,
51 	NSCOLOUR_TEXT_INPUT_FG,
52 	NSCOLOUR_TEXT_INPUT_FG_SUBTLE,
53 	NSCOLOUR_SEL_BG,
54 	NSCOLOUR_SEL_FG,
55 	NSCOLOUR_SEL_FG_SUBTLE,
56 	NSCOLOUR_SCROLL_WELL,
57 	NSCOLOUR_BUTTON_BG,
58 	NSCOLOUR_BUTTON_FG,
59 	NSCOLOUR__COUNT,
60 };
61 
62 /**
63  * NetSurf UI colour table.
64  */
65 extern colour nscolours[];
66 
67 /**
68  * Update the nscolour table from the current nsoptions.
69  *
70  * \return NSERROR_OK on success, or appropriate error otherwise.
71  */
72 nserror nscolour_update(void);
73 
74 /**
75  * Get a pointer to a stylesheet for nscolours.
76  *
77  * \return NSERROR_OK on success, or appropriate error otherwise.
78  */
79 nserror nscolour_get_stylesheet(const char **stylesheet_out);
80 
81 #endif
82