color-internal.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. /*** typedefs(not structures) and defined constants **********************************************/
  14. /*** enums ***************************************************************************************/
  15. /* *INDENT-OFF* */
  16. typedef enum {
  17. SPEC_A_REVERSE = -100,
  18. SPEC_A_BOLD = -101,
  19. SPEC_A_BOLD_REVERSE = -102,
  20. SPEC_A_UNDERLINE = -103
  21. } tty_special_color_t;
  22. /* *INDENT-ON* */
  23. /*** structures declarations (and typedefs of structures)*****************************************/
  24. typedef struct mc_color_pair_struct
  25. {
  26. int ifg;
  27. int ibg;
  28. int attr;
  29. size_t pair_index;
  30. gboolean is_temp;
  31. } tty_color_pair_t;
  32. /*** global variables defined in .c file *********************************************************/
  33. extern gboolean use_colors;
  34. extern gboolean mc_tty_color_disable;
  35. /*** declarations of public functions ************************************************************/
  36. const char *tty_color_get_name_by_index (int);
  37. int tty_color_get_index_by_name (const char *);
  38. int tty_attr_get_bits (const char *);
  39. void tty_color_init_lib (gboolean, gboolean);
  40. void tty_color_deinit_lib (void);
  41. void tty_color_try_alloc_pair_lib (tty_color_pair_t *);
  42. /*** inline functions ****************************************************************************/
  43. #endif /* MC_COLOR_INTERNAL_H */