xref: /haiku/src/system/boot/platform/generic/text_console.cpp (revision 4c8e85b316c35a9161f5a1c50ad70bc91c83a76f)
1 /*
2  * Copyright 2021, Haiku, Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 
7 #include <boot/platform/generic/text_console.h>
8 #include <boot/vfs.h>
9 
10 
11 // This is set by the boot platform during console_init().
12 ConsoleNode* gConsoleNode;
13 
14 
15 void
16 console_clear_screen()
17 {
18 	gConsoleNode->ClearScreen();
19 }
20 
21 
22 int32
23 console_width()
24 {
25 	return gConsoleNode->Width();
26 }
27 
28 
29 int32
30 console_height()
31 {
32 	return gConsoleNode->Height();
33 }
34 
35 
36 void
37 console_set_cursor(int32 x, int32 y)
38 {
39 	gConsoleNode->SetCursor(x, y);
40 }
41 
42 
43 void
44 console_show_cursor()
45 {
46 	gConsoleNode->SetCursorVisible(true);
47 }
48 
49 
50 void
51 console_hide_cursor(void)
52 {
53 	gConsoleNode->SetCursorVisible(false);
54 }
55 
56 
57 void
58 console_set_color(int32 foreground, int32 background)
59 {
60 	gConsoleNode->SetColors(foreground, background);
61 }
62