You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ansicol.h 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #ifndef _IPXE_ANSICOL_H
  2. #define _IPXE_ANSICOL_H
  3. /** @file
  4. *
  5. * ANSI colours
  6. *
  7. */
  8. FILE_LICENCE ( GPL2_OR_LATER );
  9. #include <stdint.h>
  10. #include <curses.h> /* For COLOR_RED etc. */
  11. /** Default colour (usually white foreground, black background) */
  12. #define COLOUR_DEFAULT 9
  13. #define COLOR_DEFAULT COLOUR_DEFAULT
  14. /** RGB value for "not defined" */
  15. #define ANSICOL_NO_RGB 0x01000000
  16. /**
  17. * @defgroup ansicolpairs ANSI colour pairs
  18. * @{
  19. */
  20. /** Default colour pair */
  21. #define CPAIR_DEFAULT 0
  22. /** Normal text */
  23. #define CPAIR_NORMAL 1
  24. /** Highlighted text */
  25. #define CPAIR_SELECT 2
  26. /** Unselectable text (e.g. continuation ellipses, menu separators) */
  27. #define CPAIR_SEPARATOR 3
  28. /** Editable text */
  29. #define CPAIR_EDIT 4
  30. /** Error text */
  31. #define CPAIR_ALERT 5
  32. /** URL text */
  33. #define CPAIR_URL 6
  34. /** PXE selected menu entry */
  35. #define CPAIR_PXE 7
  36. /** @} */
  37. /** An ANSI colour pair definition */
  38. struct ansicol_pair {
  39. /** Foreground colour index */
  40. uint8_t foreground;
  41. /** Background colour index */
  42. uint8_t background;
  43. } __attribute__ (( packed ));
  44. /* ansicol.c */
  45. extern void ansicol_set_pair ( unsigned int cpair );
  46. extern int ansicol_define_pair ( unsigned int cpair, unsigned int foreground,
  47. unsigned int background );
  48. /* ansicoldef.c */
  49. extern int ansicol_define ( unsigned int colour, unsigned int ansi,
  50. uint32_t rgb );
  51. /* Function provided by ansicol.c but overridden by ansicoldef.c, if present */
  52. extern void ansicol_set ( unsigned int colour, unsigned int which );
  53. #endif /* _IPXE_ANSICOL_H */