TianoCore EDK2 master
Loading...
Searching...
No Matches
SimpleTextOut.h
Go to the documentation of this file.
1
14#ifndef __SIMPLE_TEXT_OUT_H__
15#define __SIMPLE_TEXT_OUT_H__
16
17#define EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID \
18 { \
19 0x387477c2, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
20 }
21
25#define SIMPLE_TEXT_OUTPUT_PROTOCOL EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID
26
28
33
34//
35// Defines for required EFI Unicode Box Draw characters
36//
37#define BOXDRAW_HORIZONTAL 0x2500
38#define BOXDRAW_VERTICAL 0x2502
39#define BOXDRAW_DOWN_RIGHT 0x250c
40#define BOXDRAW_DOWN_LEFT 0x2510
41#define BOXDRAW_UP_RIGHT 0x2514
42#define BOXDRAW_UP_LEFT 0x2518
43#define BOXDRAW_VERTICAL_RIGHT 0x251c
44#define BOXDRAW_VERTICAL_LEFT 0x2524
45#define BOXDRAW_DOWN_HORIZONTAL 0x252c
46#define BOXDRAW_UP_HORIZONTAL 0x2534
47#define BOXDRAW_VERTICAL_HORIZONTAL 0x253c
48#define BOXDRAW_DOUBLE_HORIZONTAL 0x2550
49#define BOXDRAW_DOUBLE_VERTICAL 0x2551
50#define BOXDRAW_DOWN_RIGHT_DOUBLE 0x2552
51#define BOXDRAW_DOWN_DOUBLE_RIGHT 0x2553
52#define BOXDRAW_DOUBLE_DOWN_RIGHT 0x2554
53#define BOXDRAW_DOWN_LEFT_DOUBLE 0x2555
54#define BOXDRAW_DOWN_DOUBLE_LEFT 0x2556
55#define BOXDRAW_DOUBLE_DOWN_LEFT 0x2557
56#define BOXDRAW_UP_RIGHT_DOUBLE 0x2558
57#define BOXDRAW_UP_DOUBLE_RIGHT 0x2559
58#define BOXDRAW_DOUBLE_UP_RIGHT 0x255a
59#define BOXDRAW_UP_LEFT_DOUBLE 0x255b
60#define BOXDRAW_UP_DOUBLE_LEFT 0x255c
61#define BOXDRAW_DOUBLE_UP_LEFT 0x255d
62#define BOXDRAW_VERTICAL_RIGHT_DOUBLE 0x255e
63#define BOXDRAW_VERTICAL_DOUBLE_RIGHT 0x255f
64#define BOXDRAW_DOUBLE_VERTICAL_RIGHT 0x2560
65#define BOXDRAW_VERTICAL_LEFT_DOUBLE 0x2561
66#define BOXDRAW_VERTICAL_DOUBLE_LEFT 0x2562
67#define BOXDRAW_DOUBLE_VERTICAL_LEFT 0x2563
68#define BOXDRAW_DOWN_HORIZONTAL_DOUBLE 0x2564
69#define BOXDRAW_DOWN_DOUBLE_HORIZONTAL 0x2565
70#define BOXDRAW_DOUBLE_DOWN_HORIZONTAL 0x2566
71#define BOXDRAW_UP_HORIZONTAL_DOUBLE 0x2567
72#define BOXDRAW_UP_DOUBLE_HORIZONTAL 0x2568
73#define BOXDRAW_DOUBLE_UP_HORIZONTAL 0x2569
74#define BOXDRAW_VERTICAL_HORIZONTAL_DOUBLE 0x256a
75#define BOXDRAW_VERTICAL_DOUBLE_HORIZONTAL 0x256b
76#define BOXDRAW_DOUBLE_VERTICAL_HORIZONTAL 0x256c
77
78//
79// EFI Required Block Elements Code Chart
80//
81#define BLOCKELEMENT_FULL_BLOCK 0x2588
82#define BLOCKELEMENT_LIGHT_SHADE 0x2591
83
84//
85// EFI Required Geometric Shapes Code Chart
86//
87#define GEOMETRICSHAPE_UP_TRIANGLE 0x25b2
88#define GEOMETRICSHAPE_RIGHT_TRIANGLE 0x25ba
89#define GEOMETRICSHAPE_DOWN_TRIANGLE 0x25bc
90#define GEOMETRICSHAPE_LEFT_TRIANGLE 0x25c4
91
92//
93// EFI Required Arrow shapes
94//
95#define ARROW_LEFT 0x2190
96#define ARROW_UP 0x2191
97#define ARROW_RIGHT 0x2192
98#define ARROW_DOWN 0x2193
99
100//
101// EFI Console Colours
102//
103#define EFI_BLACK 0x00
104#define EFI_BLUE 0x01
105#define EFI_GREEN 0x02
106#define EFI_CYAN (EFI_BLUE | EFI_GREEN)
107#define EFI_RED 0x04
108#define EFI_MAGENTA (EFI_BLUE | EFI_RED)
109#define EFI_BROWN (EFI_GREEN | EFI_RED)
110#define EFI_LIGHTGRAY (EFI_BLUE | EFI_GREEN | EFI_RED)
111#define EFI_BRIGHT 0x08
112#define EFI_DARKGRAY (EFI_BLACK | EFI_BRIGHT)
113#define EFI_LIGHTBLUE (EFI_BLUE | EFI_BRIGHT)
114#define EFI_LIGHTGREEN (EFI_GREEN | EFI_BRIGHT)
115#define EFI_LIGHTCYAN (EFI_CYAN | EFI_BRIGHT)
116#define EFI_LIGHTRED (EFI_RED | EFI_BRIGHT)
117#define EFI_LIGHTMAGENTA (EFI_MAGENTA | EFI_BRIGHT)
118#define EFI_YELLOW (EFI_BROWN | EFI_BRIGHT)
119#define EFI_WHITE (EFI_BLUE | EFI_GREEN | EFI_RED | EFI_BRIGHT)
120
121//
122// Macro to accept color values in their raw form to create
123// a value that represents both a foreground and background
124// color in a single byte.
125// For Foreground, and EFI_* value is valid from EFI_BLACK(0x00) to
126// EFI_WHITE (0x0F).
127// For Background, only EFI_BLACK, EFI_BLUE, EFI_GREEN, EFI_CYAN,
128// EFI_RED, EFI_MAGENTA, EFI_BROWN, and EFI_LIGHTGRAY are acceptable
129//
130// Do not use EFI_BACKGROUND_xxx values with this macro.
131//
132#define EFI_TEXT_ATTR(Foreground, Background) ((Foreground) | ((Background) << 4))
133
134#define EFI_BACKGROUND_BLACK 0x00
135#define EFI_BACKGROUND_BLUE 0x10
136#define EFI_BACKGROUND_GREEN 0x20
137#define EFI_BACKGROUND_CYAN (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_GREEN)
138#define EFI_BACKGROUND_RED 0x40
139#define EFI_BACKGROUND_MAGENTA (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_RED)
140#define EFI_BACKGROUND_BROWN (EFI_BACKGROUND_GREEN | EFI_BACKGROUND_RED)
141#define EFI_BACKGROUND_LIGHTGRAY (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_GREEN | EFI_BACKGROUND_RED)
142
143//
144// We currently define attributes from 0 - 7F for color manipulations
145// To internally handle the local display characteristics for a particular character,
146// Bit 7 signifies the local glyph representation for a character. If turned on, glyphs will be
147// pulled from the wide glyph database and will display locally as a wide character (16 X 19 versus 8 X 19)
148// If bit 7 is off, the narrow glyph database will be used. This does NOT affect information that is sent to
149// non-local displays, such as serial or LAN consoles.
150//
151#define EFI_WIDE_ATTRIBUTE 0x80
152
165typedef
167(EFIAPI *EFI_TEXT_RESET)(
169 IN BOOLEAN ExtendedVerification
170 );
171
190typedef
192(EFIAPI *EFI_TEXT_STRING)(
194 IN CHAR16 *String
195 );
196
211typedef
213(EFIAPI *EFI_TEXT_TEST_STRING)(
215 IN CHAR16 *String
216 );
217
234typedef
236(EFIAPI *EFI_TEXT_QUERY_MODE)(
238 IN UINTN ModeNumber,
239 OUT UINTN *Columns,
240 OUT UINTN *Rows
241 );
242
254typedef
256(EFIAPI *EFI_TEXT_SET_MODE)(
258 IN UINTN ModeNumber
259 );
260
275typedef
277(EFIAPI *EFI_TEXT_SET_ATTRIBUTE)(
279 IN UINTN Attribute
280 );
281
293typedef
295(EFIAPI *EFI_TEXT_CLEAR_SCREEN)(
297 );
298
316typedef
320 IN UINTN Column,
321 IN UINTN Row
322 );
323
338typedef
340(EFIAPI *EFI_TEXT_ENABLE_CURSOR)(
342 IN BOOLEAN Visible
343 );
344
349typedef struct {
353 INT32 MaxMode;
354
355 //
356 // current settings
357 //
358
362 INT32 Mode;
380
388 EFI_TEXT_RESET Reset;
389
390 EFI_TEXT_STRING OutputString;
391 EFI_TEXT_TEST_STRING TestString;
392
393 EFI_TEXT_QUERY_MODE QueryMode;
394 EFI_TEXT_SET_MODE SetMode;
395 EFI_TEXT_SET_ATTRIBUTE SetAttribute;
396
397 EFI_TEXT_CLEAR_SCREEN ClearScreen;
398 EFI_TEXT_SET_CURSOR_POSITION SetCursorPosition;
399 EFI_TEXT_ENABLE_CURSOR EnableCursor;
400
405};
406
407extern EFI_GUID gEfiSimpleTextOutProtocolGuid;
408
409#endif
UINT64 UINTN
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_STATUS(EFIAPI * EFI_TEXT_SET_ATTRIBUTE)(IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN UINTN Attribute)
EFI_STATUS(EFIAPI * EFI_TEXT_ENABLE_CURSOR)(IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN BOOLEAN Visible)
EFI_STATUS(EFIAPI * EFI_TEXT_SET_CURSOR_POSITION)(IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN UINTN Column, IN UINTN Row)
EFI_STATUS(EFIAPI * EFI_TEXT_SET_MODE)(IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN UINTN ModeNumber)
EFI_STATUS(EFIAPI * EFI_TEXT_TEST_STRING)(IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN CHAR16 *String)
EFI_STATUS(EFIAPI * EFI_TEXT_CLEAR_SCREEN)(IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This)
EFI_STATUS(EFIAPI * EFI_TEXT_QUERY_MODE)(IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN UINTN ModeNumber, OUT UINTN *Columns, OUT UINTN *Rows)
EFI_STATUS(EFIAPI * EFI_TEXT_RESET)(IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SIMPLE_TEXT_OUTPUT_INTERFACE
Definition: SimpleTextOut.h:32
EFI_STATUS(EFIAPI * EFI_TEXT_STRING)(IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN CHAR16 *String)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
EFI_SIMPLE_TEXT_OUTPUT_MODE * Mode
Definition: Base.h:213