1
2
3
4
5
6 #ifndef MC__COLOR_INTERNAL_H
7 #define MC__COLOR_INTERNAL_H
8
9 #include <sys/types.h>
10
11 #include "lib/global.h"
12
13 #ifdef HAVE_SLANG
14 #include "tty-slang.h"
15 #else
16 #include "tty-ncurses.h"
17 #endif
18
19
20
21 #define FLAG_TRUECOLOR (1 << 24)
22 #define COLORS_TRUECOLOR (1 << 24)
23
24
25
26 typedef enum
27 {
28 SPEC_A_REVERSE = -100,
29 SPEC_A_BOLD = -101,
30 SPEC_A_BOLD_REVERSE = -102,
31 SPEC_A_UNDERLINE = -103
32 } tty_special_color_t;
33
34
35
36
37 typedef struct
38 {
39 int fg;
40 int bg;
41 int attr;
42 size_t pair_index;
43 gboolean is_temp;
44 } tty_color_lib_pair_t;
45
46
47
48 extern gboolean use_colors;
49 extern gboolean mc_tty_color_disable;
50 extern gboolean need_convert_256color;
51
52
53
54 const char *tty_color_get_name_by_index (int idx);
55 int tty_color_get_index_by_name (const char *color_name);
56 int tty_attr_get_bits (const char *attrs);
57 int convert_256color_to_truecolor (int color);
58
59 void tty_color_init_lib (gboolean disable, gboolean force);
60 void tty_color_deinit_lib (void);
61
62 void tty_color_try_alloc_lib_pair (tty_color_lib_pair_t *mc_color_pair);
63
64
65
66 #endif