color-internal.h 1017 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /** \file color-internal.h
  2. * \brief Header: Internal stuff of color setup
  3. */
  4. #ifndef MC_COLOR_INTERNAL_H
  5. #define MC_COLOR_INTERNAL_H
  6. #include <sys/types.h> /* size_t */
  7. #include "lib/global.h"
  8. #ifdef HAVE_SLANG
  9. # include "tty-slang.h"
  10. #else
  11. # include "tty-ncurses.h"
  12. #endif /* HAVE_SLANG */
  13. extern gboolean use_colors;
  14. extern gboolean mc_tty_color_disable;
  15. typedef struct mc_color_pair_struct
  16. {
  17. const char *cfg;
  18. const char *cbg;
  19. int ifg;
  20. int ibg;
  21. size_t pair_index;
  22. gboolean is_temp;
  23. } tty_color_pair_t;
  24. /* *INDENT-OFF* */
  25. typedef enum {
  26. SPEC_A_REVERSE = -100,
  27. SPEC_A_BOLD = -101,
  28. SPEC_A_BOLD_REVERSE = -102,
  29. SPEC_A_UNDERLINE = -103
  30. } tty_special_color_t;
  31. /* *INDENT-ON* */
  32. const char *tty_color_get_valid_name (const char *);
  33. int tty_color_get_index_by_name (const char *);
  34. void tty_color_init_lib (gboolean, gboolean);
  35. void tty_color_deinit_lib (void);
  36. void tty_color_try_alloc_pair_lib (tty_color_pair_t *);
  37. #endif /* MC_COLOR_INTERNAL_H */