ELinks 0.18.0
style.c File Reference

BFU style/color cache. More...

#include "elinks.h"
#include "bfu/style.h"
#include "config/options.h"
#include "terminal/color.h"
#include "terminal/draw.h"
#include "terminal/terminal.h"
#include "util/color.h"
#include "util/hash.h"
Include dependency graph for style.c:

Data Structures

struct  bfu_color_entry

Functions

struct color_pairget_bfu_color (struct terminal *term, const char *stylename)
 Get suitable BFU color for the specific terminal.
void done_bfu_colors (void)
 Cleanup after the BFU style cache.

Variables

static struct hashbfu_colors = NULL

Detailed Description

BFU style/color cache.

Function Documentation

◆ done_bfu_colors()

void done_bfu_colors ( void )

Cleanup after the BFU style cache.

Free all resources used by the BFU style cache.

◆ get_bfu_color()

struct color_pair * get_bfu_color ( struct terminal * term,
const char * stylename )

Get suitable BFU color for the specific terminal.

Get a color pair (foreground- and background color) for a specific BFU widget "style". Depending on the terminal settings a color suitable for either mono terminals or color terminals is returned. The returned color is derived by looking up the specified stylename under the option tree of "ui.colors.color" or the "ui.colors.mono", and using the values of the "text" and "background" color options as the values of the color pair.

Parameters
termTerminal for which the color will be used.
stylenameThe name of the BFU color.
Returns
A color pair matching the stylename or NULL.

Variable Documentation

◆ bfu_colors

struct hash* bfu_colors = NULL
static