color-internal.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 idx);
  37. int tty_color_get_index_by_name (const char *color_name);
  38. int tty_attr_get_bits (const char *attrs);
  39. void tty_color_init_lib (gboolean disable, gboolean force);
  40. void tty_color_deinit_lib (void);
  41. void tty_color_try_alloc_pair_lib (tty_color_pair_t * mc_color_pair);
  42. /*** inline functions ****************************************************************************/
  43. #endif /* MC__COLOR_INTERNAL_H */