color-internal.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. /* Screen library specific color pair */
  25. typedef struct
  26. {
  27. int fg;
  28. int bg;
  29. int attr;
  30. size_t pair_index;
  31. gboolean is_temp;
  32. } tty_color_lib_pair_t;
  33. /*** global variables defined in .c file *********************************************************/
  34. extern gboolean use_colors;
  35. extern gboolean mc_tty_color_disable;
  36. /*** declarations of public functions ************************************************************/
  37. const char *tty_color_get_name_by_index (int idx);
  38. int tty_color_get_index_by_name (const char *color_name);
  39. int tty_attr_get_bits (const char *attrs);
  40. void tty_color_init_lib (gboolean disable, gboolean force);
  41. void tty_color_deinit_lib (void);
  42. void tty_color_try_alloc_lib_pair (tty_color_lib_pair_t * mc_color_pair);
  43. /*** inline functions ****************************************************************************/
  44. #endif /* MC__COLOR_INTERNAL_H */