iPXE
ansicol.h
Go to the documentation of this file.
1 #ifndef _IPXE_ANSICOL_H
2 #define _IPXE_ANSICOL_H
3 
4 /** @file
5  *
6  * ANSI colours
7  *
8  */
9 
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11 FILE_SECBOOT ( PERMITTED );
12 
13 #include <stdint.h>
14 #include <curses.h> /* For COLOR_RED etc. */
15 
16 /** Default colour (usually white foreground, black background) */
17 #define COLOUR_DEFAULT 9
18 #define COLOR_DEFAULT COLOUR_DEFAULT
19 
20 /** Magic colour
21  *
22  * The magic basic colour is automatically remapped to the colour
23  * stored in @c ansicol_magic. This is used to allow the UI
24  * background to automatically become transparent when a background
25  * picture is used.
26  */
27 #define ANSICOL_MAGIC 15
28 
29 /** RGB value for "not defined" */
30 #define ANSICOL_NO_RGB 0x01000000
31 
32 /**
33  * @defgroup ansicolpairs ANSI colour pairs
34  * @{
35  */
36 
37 /** Default colour pair */
38 #define CPAIR_DEFAULT 0
39 
40 /** Normal text */
41 #define CPAIR_NORMAL 1
42 
43 /** Highlighted text */
44 #define CPAIR_SELECT 2
45 
46 /** Unselectable text (e.g. continuation ellipses, menu separators) */
47 #define CPAIR_SEPARATOR 3
48 
49 /** Editable text */
50 #define CPAIR_EDIT 4
51 
52 /** Error text */
53 #define CPAIR_ALERT 5
54 
55 /** URL text */
56 #define CPAIR_URL 6
57 
58 /** PXE selected menu entry */
59 #define CPAIR_PXE 7
60 
61 /** @} */
62 
63 /** An ANSI colour pair definition */
64 struct ansicol_pair {
65  /** Foreground colour index */
67  /** Background colour index */
69 } __attribute__ (( packed ));
70 
71 /* ansicol.c */
72 extern void ansicol_set_pair ( unsigned int cpair );
73 extern int ansicol_define_pair ( unsigned int cpair, unsigned int foreground,
74  unsigned int background );
75 
76 /* ansicoldef.c */
77 extern int ansicol_define ( unsigned int colour, unsigned int ansi,
78  uint32_t rgb );
79 extern void ansicol_reset_magic ( void );
80 extern void ansicol_set_magic_transparent ( void );
81 
82 /* Function provided by ansicol.c but overridden by ansicoldef.c, if present */
83 extern void ansicol_set ( unsigned int colour, unsigned int which );
84 
85 #endif /* _IPXE_ANSICOL_H */
MuCurses header file.
#define __attribute__(x)
Definition: compiler.h:10
void ansicol_reset_magic(void)
Reset magic colour.
Definition: ansicoldef.c:180
uint8_t foreground
Foreground colour index.
Definition: ansicol.h:66
int ansicol_define(unsigned int colour, unsigned int ansi, uint32_t rgb)
Define ANSI colour.
Definition: ansicoldef.c:126
void ansicol_set(unsigned int colour, unsigned int which)
Set ANSI colour (when no colour definition support is present)
Definition: ansicol.c:58
An ANSI colour pair definition.
Definition: ansicol.h:64
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
#define colour
Colour for debug messages.
Definition: acpi.c:42
void ansicol_set_pair(unsigned int cpair)
Set ANSI foreground and background colour.
Definition: ansicol.c:90
FILE_SECBOOT(PERMITTED)
int ansicol_define_pair(unsigned int cpair, unsigned int foreground, unsigned int background)
Define ANSI colour pair.
Definition: ansicol.c:111
unsigned char uint8_t
Definition: stdint.h:10
unsigned int uint32_t
Definition: stdint.h:12
void ansicol_set_magic_transparent(void)
Set magic colour to transparent.
Definition: ansicoldef.c:190
uint8_t background
Background colour index.
Definition: ansicol.h:68