Some optimization and cleanup of color-related code in TTY layer.
[midnight-commander.git] / lib / tty / color-internal.h
blob609d850c5b0ddddd69df5b90893c42c812d7d62a
2 /** \file color-internal.h
3 * \brief Header: Internal stuff of color setup
4 */
6 #ifndef MC_COLOR_INTERNAL_H
7 #define MC_COLOR_INTERNAL_H
9 #include <sys/types.h> /* size_t */
11 #include "lib/global.h"
13 #ifdef HAVE_SLANG
14 # include "tty-slang.h"
15 #else
16 # include "tty-ncurses.h"
17 #endif /* HAVE_SLANG */
19 extern gboolean use_colors;
20 extern gboolean mc_tty_color_disable;
22 typedef struct mc_color_pair_struct
24 const char *cfg;
25 const char *cbg;
26 int ifg;
27 int ibg;
28 int pair_index;
29 gboolean is_temp;
30 } tty_color_pair_t;
32 /* *INDENT-OFF* */
33 typedef enum {
34 SPEC_A_REVERSE = -100,
35 SPEC_A_BOLD = -101,
36 SPEC_A_BOLD_REVERSE = -102,
37 SPEC_A_UNDERLINE = -103
38 } tty_special_color_t;
39 /* *INDENT-ON* */
41 const char *tty_color_get_valid_name (const char *);
42 int tty_color_get_index_by_name (const char *);
44 void tty_color_init_lib (gboolean, gboolean);
45 void tty_color_deinit_lib (void);
47 void tty_color_try_alloc_pair_lib (tty_color_pair_t *);
49 #endif /* MC_COLOR_INTERNAL_H */