選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

ansicol.h 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #ifndef _IPXE_ANSICOL_H
  2. #define _IPXE_ANSICOL_H
  3. /** @file
  4. *
  5. * ANSI colours
  6. *
  7. */
  8. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  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. /** Magic colour
  15. *
  16. * The magic basic colour is automatically remapped to the colour
  17. * stored in @c ansicol_magic. This is used to allow the UI
  18. * background to automatically become transparent when a background
  19. * picture is used.
  20. */
  21. #define ANSICOL_MAGIC 15
  22. /** RGB value for "not defined" */
  23. #define ANSICOL_NO_RGB 0x01000000
  24. /**
  25. * @defgroup ansicolpairs ANSI colour pairs
  26. * @{
  27. */
  28. /** Default colour pair */
  29. #define CPAIR_DEFAULT 0
  30. /** Normal text */
  31. #define CPAIR_NORMAL 1
  32. /** Highlighted text */
  33. #define CPAIR_SELECT 2
  34. /** Unselectable text (e.g. continuation ellipses, menu separators) */
  35. #define CPAIR_SEPARATOR 3
  36. /** Editable text */
  37. #define CPAIR_EDIT 4
  38. /** Error text */
  39. #define CPAIR_ALERT 5
  40. /** URL text */
  41. #define CPAIR_URL 6
  42. /** PXE selected menu entry */
  43. #define CPAIR_PXE 7
  44. /** @} */
  45. /** An ANSI colour pair definition */
  46. struct ansicol_pair {
  47. /** Foreground colour index */
  48. uint8_t foreground;
  49. /** Background colour index */
  50. uint8_t background;
  51. } __attribute__ (( packed ));
  52. /* ansicol.c */
  53. extern void ansicol_set_pair ( unsigned int cpair );
  54. extern int ansicol_define_pair ( unsigned int cpair, unsigned int foreground,
  55. unsigned int background );
  56. /* ansicoldef.c */
  57. extern int ansicol_define ( unsigned int colour, unsigned int ansi,
  58. uint32_t rgb );
  59. extern void ansicol_reset_magic ( void );
  60. extern void ansicol_set_magic_transparent ( void );
  61. /* Function provided by ansicol.c but overridden by ansicoldef.c, if present */
  62. extern void ansicol_set ( unsigned int colour, unsigned int which );
  63. #endif /* _IPXE_ANSICOL_H */