43 if (colorsConfig ==
NULL)
45 printf(
"theme: failed to open colors config, using defaults\n");
55 if (varsConfig ==
NULL)
57 printf(
"theme: failed to open vars config, using defaults\n");
76 if (ansiConfig ==
NULL)
78 printf(
"theme: failed to open ansi config, using defaults\n");
85 snprintf(keyNormal,
sizeof(keyNormal),
"color%lu_normal", i);
86 snprintf(keyBright,
sizeof(keyBright),
"color%lu_bright", i);
87 snprintf(keyDim,
sizeof(keyDim),
"color%lu_dim", i);
#define MAX_PATH
Maximum length of filepaths.
config_t * config_open(const char *prefix, const char *name)
Open a configuration file.
int64_t config_get_int(config_t *config, const char *section, const char *key, int64_t fallback)
Get an integer value from a configuration file.
const char * config_get_string(config_t *config, const char *section, const char *key, const char *fallback)
Get a string value from a configuration file.
void config_close(config_t *config)
Close a configuration file.
#define THEME_COLOR_INVALID
Invalid color constant.
#define THEME_ANSI_COLOR_COUNT
Number of ANSI colors.
theme_t * theme_global_get(void)
Get the global theme.
#define NULL
Pointer error value.
_PUBLIC int printf(const char *_RESTRICT format,...)
_PUBLIC int snprintf(char *_RESTRICT s, size_t n, const char *_RESTRICT format,...)
_PUBLIC char * strncpy(char *_RESTRICT s1, const char *_RESTRICT s2, size_t n)
Opaque configuration structure.
pixel_t dim[THEME_ANSI_COLOR_COUNT]
pixel_t bright[THEME_ANSI_COLOR_COUNT]
pixel_t normal[THEME_ANSI_COLOR_COUNT]
pixel_t foregroundInactive
pixel_t backgroundSelectedEnd
pixel_t backgroundUnselectedEnd
pixel_t backgroundUnselectedStart
pixel_t foregroundSelected
pixel_t backgroundSelectedStart
theme_color_set_t element
char iconMinimize[MAX_PATH]
char defaultFont[MAX_PATH]
char cursorArrow[MAX_PATH]
static void theme_colors_load(config_t *config, const char *section, theme_color_set_t *dest)
static void theme_lazy_load(void)