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
10FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11FILE_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 */
65 /** Foreground colour index */
67 /** Background colour index */
69} __attribute__ (( packed ));
70
71/* ansicol.c */
72extern void ansicol_set_pair ( unsigned int cpair );
73extern int ansicol_define_pair ( unsigned int cpair, unsigned int foreground,
74 unsigned int background );
75
76/* ansicoldef.c */
77extern int ansicol_define ( unsigned int colour, unsigned int ansi,
78 uint32_t rgb );
79extern void ansicol_reset_magic ( void );
80extern void ansicol_set_magic_transparent ( void );
81
82/* Function provided by ansicol.c but overridden by ansicoldef.c, if present */
83extern void ansicol_set ( unsigned int colour, unsigned int which );
84
85#endif /* _IPXE_ANSICOL_H */
#define colour
Colour for debug messages.
Definition acpi.c:42
void ansicol_set_magic_transparent(void)
Set magic colour to transparent.
Definition ansicoldef.c:190
void ansicol_set_pair(unsigned int cpair)
Set ANSI foreground and background colour.
Definition ansicol.c:90
void ansicol_reset_magic(void)
Reset magic colour.
Definition ansicoldef.c:180
void ansicol_set(unsigned int colour, unsigned int which)
Set ANSI colour (when no colour definition support is present)
Definition ansicol.c:58
int ansicol_define(unsigned int colour, unsigned int ansi, uint32_t rgb)
Define ANSI colour.
Definition ansicoldef.c:126
int ansicol_define_pair(unsigned int cpair, unsigned int foreground, unsigned int background)
Define ANSI colour pair.
Definition ansicol.c:111
unsigned int uint32_t
Definition stdint.h:12
unsigned char uint8_t
Definition stdint.h:10
MuCurses header file.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
#define __attribute__(x)
Definition compiler.h:10
An ANSI colour pair definition.
Definition ansicol.h:64
uint8_t foreground
Foreground colour index.
Definition ansicol.h:66
uint8_t background
Background colour index.
Definition ansicol.h:68