File src/ui/color_scheme.c changed (mode: 100644) (index 436bc51f4..f1eaa7d35) |
... |
... |
static file_hi_t * clone_color_scheme_highlights(const col_scheme_t *from); |
372 |
372 |
static void reset_color_scheme_colors(col_scheme_t *cs); |
static void reset_color_scheme_colors(col_scheme_t *cs); |
373 |
373 |
static int source_cs(const char name[]); |
static int source_cs(const char name[]); |
374 |
374 |
static void get_cs_path(const char name[], char buf[], size_t buf_size); |
static void get_cs_path(const char name[], char buf[], size_t buf_size); |
|
375 |
|
static void check_color_scheme(col_scheme_t *cs); |
375 |
376 |
static void load_color_pairs(col_scheme_t *cs); |
static void load_color_pairs(col_scheme_t *cs); |
376 |
377 |
static void ensure_dir_map_exists(void); |
static void ensure_dir_map_exists(void); |
377 |
378 |
|
|
378 |
379 |
/* Mapping of color schemes associations onto file system tree. */ |
/* Mapping of color schemes associations onto file system tree. */ |
379 |
380 |
static fsddata_t *dir_map; |
static fsddata_t *dir_map; |
380 |
381 |
|
|
381 |
|
void |
|
382 |
|
check_color_scheme(col_scheme_t *cs) |
|
383 |
|
{ |
|
384 |
|
if(cs->state == CSS_BROKEN) |
|
385 |
|
{ |
|
386 |
|
reset_color_scheme_colors(cs); |
|
387 |
|
cs->state = CSS_DEFAULTED; |
|
388 |
|
} |
|
389 |
|
} |
|
390 |
|
|
|
391 |
382 |
int |
int |
392 |
383 |
cs_have_no_extensions(void) |
cs_have_no_extensions(void) |
393 |
384 |
{ |
{ |
|
... |
... |
get_cs_path(const char name[], char buf[], size_t buf_size) |
848 |
839 |
(void)cut_suffix(buf, ".vifm"); |
(void)cut_suffix(buf, ".vifm"); |
849 |
840 |
} |
} |
850 |
841 |
|
|
|
842 |
|
/* Checks whether colorscheme is in unusable state and resets it to normal |
|
843 |
|
* state. */ |
|
844 |
|
static void |
|
845 |
|
check_color_scheme(col_scheme_t *cs) |
|
846 |
|
{ |
|
847 |
|
if(cs->state == CSS_BROKEN) |
|
848 |
|
{ |
|
849 |
|
reset_color_scheme_colors(cs); |
|
850 |
|
cs->state = CSS_DEFAULTED; |
|
851 |
|
} |
|
852 |
|
} |
|
853 |
|
|
851 |
854 |
/* Loads color scheme settings into color pairs. */ |
/* Loads color scheme settings into color pairs. */ |
852 |
855 |
static void |
static void |
853 |
856 |
load_color_pairs(col_scheme_t *cs) |
load_color_pairs(col_scheme_t *cs) |
854 |
857 |
{ |
{ |
855 |
858 |
int i; |
int i; |
856 |
|
for(i = 0; i < MAXNUM_COLOR; i++) |
|
|
859 |
|
for(i = 0; i < MAXNUM_COLOR; ++i) |
857 |
860 |
{ |
{ |
858 |
861 |
cs->pair[i] = colmgr_get_pair(cs->color[i].fg, cs->color[i].bg); |
cs->pair[i] = colmgr_get_pair(cs->color[i].fg, cs->color[i].bg); |
859 |
862 |
} |
} |
File src/ui/color_scheme.h changed (mode: 100644) (index 7c77d3454..eac113d38) |
... |
... |
void complete_colorschemes(const char name[]); |
106 |
106 |
|
|
107 |
107 |
const char * attrs_to_str(int attrs); |
const char * attrs_to_str(int attrs); |
108 |
108 |
|
|
109 |
|
void check_color_scheme(col_scheme_t *cs); |
|
110 |
|
|
|
111 |
109 |
/* Associates colorscheme specified by its name with the given path. */ |
/* Associates colorscheme specified by its name with the given path. */ |
112 |
110 |
void assoc_dir(const char name[], const char dir[]); |
void assoc_dir(const char name[], const char dir[]); |
113 |
111 |
|
|