aboutsummaryrefslogtreecommitdiffstats
path: root/Library/UefiShellUfmCommandLib/tbi/screen.h
blob: fb0cd154e8a27020f6df3dd4a4b9eec5d25f93d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef UFM_TBI_SCREEN_H
#define UFM_TBI_SCREEN_H

/*
	EDK2 NOTE: All devices that support the Simple Text Output Protocol must
	minimally support an 80x25 character mode. Additional modes are optional
*/

#include <Uefi.h>

struct screen
{
	EFI_SIMPLE_TEXT_INPUT_PROTOCOL *stdin;
	EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *stdout;
	EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *stderr;
	UINTN columns, lines; // current screen size
	INT32 attr; // main screen attributes
};

/*
 * Prepares a structure with information about screen
 *
 * return: A pointer to the allocated structure or NULL if allocation fails
*/
struct screen *prepare_screen(VOID);

/*
 * Frees the structure of the screen
 *
 * scr: the screen on which to operate
 *
 * return: VOID
*/
VOID forget_screen(struct screen *scr);

/*
 * Clears the screen
 *
 * scr: the screen on which to operate
 *
 * return: VOID
*/
VOID screen_clear(struct screen *scr);

#endif /* UFM_TBI_SCREEN_H */