NetSurf
|
System colour handling implementation. More...
#include <string.h>
#include "utils/config.h"
#include "utils/utils.h"
#include "utils/log.h"
#include "utils/nsoption.h"
#include "netsurf/css.h"
#include "desktop/system_colour.h"
Go to the source code of this file.
Macros | |
#define | colour_list_len ((NSOPTION_SYS_COLOUR_END - NSOPTION_SYS_COLOUR_START) + 1) |
Functions | |
nserror | ns_system_colour_init (void) |
Initialise the system colours. More... | |
void | ns_system_colour_finalize (void) |
release any resources associated with the system colours. More... | |
nserror | ns_system_colour_char (const char *name, colour *colour_out) |
Obtain a system colour from a name. More... | |
css_error | ns_system_colour (void *pw, lwc_string *name, css_color *colour) |
css callback to obtain named system colour. More... | |
Variables | |
static lwc_string * | colour_list [colour_list_len] |
static lwc_string ** | ns_system_colour_pw = NULL |
System colour handling implementation.
Definition in file system_colour.c.
#define colour_list_len ((NSOPTION_SYS_COLOUR_END - NSOPTION_SYS_COLOUR_START) + 1) |
Definition at line 34 of file system_colour.c.
css_error ns_system_colour | ( | void * | pw, |
lwc_string * | name, | ||
css_color * | color | ||
) |
css callback to obtain named system colour.
[in] | pw | context unused in implementation |
[in] | name | The name of the colour being looked up |
[out] | color | The system colour associated with the name. |
Definition at line 95 of file system_colour.c.
References colour_list, colour_list_len, ns_color_to_nscss, NSOPTION_SYS_COLOUR_START, nsoptions, and nsoption_s::value.
Referenced by nscss_create_css_data(), nscss_create_inline_style(), and nscss_register_import().
Obtain a system colour from a name.
[in] | name | The name of the colour being looked up |
[out] | color | The system colour associated with the name in the netsurf colour representation. |
Definition at line 78 of file system_colour.c.
References nsoption_s::c, colour_list_len, nsoption_s::key, NSERROR_INVALID, NSERROR_OK, NSOPTION_SYS_COLOUR_START, nsoptions, SLEN, and nsoption_s::value.
Referenced by nscolour__get(), and nscolour_update().
void ns_system_colour_finalize | ( | void | ) |
release any resources associated with the system colours.
Definition at line 67 of file system_colour.c.
References colour_list, and colour_list_len.
Referenced by netsurf_exit().
nserror ns_system_colour_init | ( | void | ) |
Initialise the system colours.
Definition at line 42 of file system_colour.c.
References colour_list, colour_list_len, nsoption_s::key, nsoption_s::key_len, ns_system_colour_pw, NSERROR_INIT_FAILED, NSERROR_NOMEM, NSERROR_OK, NSOPTION_SYS_COLOUR_START, nsoptions, and SLEN.
Referenced by netsurf_init().
|
static |
Definition at line 36 of file system_colour.c.
Referenced by ns_system_colour(), ns_system_colour_finalize(), and ns_system_colour_init().
|
static |
Definition at line 38 of file system_colour.c.
Referenced by ns_system_colour_init().