NetSurf
system_colour.h
Go to the documentation of this file.
1/*
2 * Copyright 2014 vincent Sanders <vince@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/**
20 * \file
21 * Interface to system colour values.
22 *
23 * Netsurf has a list of user configurable colours with frontend
24 * specific defaults. These colours are used for the css system
25 * colours and to colour and style internally rendered widgets
26 * (e.g. cookies treeview or local file directory views.
27 */
28
29#ifndef NETSURF_DESKTOP_SYSTEM_COLOUR_H
30#define NETSURF_DESKTOP_SYSTEM_COLOUR_H
31
32#include <libcss/libcss.h>
33
34#include "utils/errors.h"
35#include "netsurf/types.h"
36
37/**
38 * css callback to obtain named system colour.
39 *
40 * \param[in] pw context unused in implementation
41 * \param[in] name The name of the colour being looked up
42 * \param[out] color The system colour associated with the name.
43 * \return CSS_OK and \a color updated on success else CSS_INVALID if
44 * the \a name is unrecognised
45 */
46css_error ns_system_colour(void *pw, lwc_string *name, css_color *color);
47
48
49/**
50 * Obtain a system colour from a name.
51 *
52 * \param[in] name The name of the colour being looked up
53 * \param[out] color The system colour associated with the name in the
54 * netsurf colour representation.
55 * \return NSERROR_OK and \a color updated on success else appropriate
56 * error code.
57 */
58nserror ns_system_colour_char(const char *name, colour *color);
59
60
61/**
62 * Initialise the system colours
63 *
64 * \return NSERROR_OK on success else appropriate error code.
65 */
67
68
69/**
70 * release any resources associated with the system colours.
71 */
73
74#endif
Error codes.
nserror
Enumeration of error codes.
Definition: errors.h:29
css_error ns_system_colour(void *pw, lwc_string *name, css_color *color)
css callback to obtain named system colour.
Definition: system_colour.c:95
nserror ns_system_colour_char(const char *name, colour *color)
Obtain a system colour from a name.
Definition: system_colour.c:78
nserror ns_system_colour_init(void)
Initialise the system colours.
Definition: system_colour.c:42
void ns_system_colour_finalize(void)
release any resources associated with the system colours.
Definition: system_colour.c:67
NetSurf types.
uint32_t colour
Colour type: XBGR.
Definition: types.h:35