NetSurf
Functions
system_colour.h File Reference

Interface to system colour values. More...

#include <libcss/libcss.h>
#include "utils/errors.h"
#include "netsurf/types.h"
Include dependency graph for system_colour.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

css_error ns_system_colour (void *pw, lwc_string *name, css_color *color)
 css callback to obtain named system colour. More...
 
nserror ns_system_colour_char (const char *name, colour *color)
 Obtain a system colour from a name. More...
 
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...
 

Detailed Description

Interface to system colour values.

Netsurf has a list of user configurable colours with frontend specific defaults. These colours are used for the css system colours and to colour and style internally rendered widgets (e.g. cookies treeview or local file directory views.

Definition in file system_colour.h.

Function Documentation

◆ ns_system_colour()

css_error ns_system_colour ( void *  pw,
lwc_string *  name,
css_color *  color 
)

css callback to obtain named system colour.

Parameters
[in]pwcontext unused in implementation
[in]nameThe name of the colour being looked up
[out]colorThe system colour associated with the name.
Returns
CSS_OK and color updated on success else CSS_INVALID if the name is unrecognised

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().

Here is the caller graph for this function:

◆ ns_system_colour_char()

nserror ns_system_colour_char ( const char *  name,
colour color 
)

Obtain a system colour from a name.

Parameters
[in]nameThe name of the colour being looked up
[out]colorThe system colour associated with the name in the netsurf colour representation.
Returns
NSERROR_OK and color updated on success else appropriate error code.

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().

Here is the caller graph for this function:

◆ ns_system_colour_finalize()

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().

Here is the caller graph for this function:

◆ ns_system_colour_init()

nserror ns_system_colour_init ( void  )

Initialise the system colours.

Returns
NSERROR_OK on success else appropriate error code.

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().

Here is the caller graph for this function: