@@ -12,19 +12,20 @@ pub struct Output {
12
12
rows : & mut usize )
13
13
-> Status ,
14
14
set_mode : extern "C" fn ( this : & mut Output , mode : i32 ) -> Status ,
15
- _pad : [ usize ; 4 ] ,
15
+ set_attribute : usize ,
16
+ clear_screen : usize ,
17
+ set_cursor_position : usize ,
18
+ enable_cursor : extern "C" fn ( this : & mut Output , visible : bool ) -> Status ,
16
19
data : & ' static OutputData ,
17
20
}
18
21
19
22
impl Output {
20
23
/// Resets the text output device hardware.
21
- #[ inline]
22
24
pub fn reset ( & mut self , extended : bool ) -> Result < ( ) > {
23
25
( self . reset ) ( self , extended) . into ( )
24
26
}
25
27
26
28
/// Writes a string to the output device.
27
- #[ inline]
28
29
pub fn output_string ( & mut self , string : * const u16 ) -> Result < ( ) > {
29
30
( self . output_string ) ( self , string) . into ( )
30
31
}
@@ -34,7 +35,6 @@ impl Output {
34
35
///
35
36
/// UEFI applications are encouraged to try to print a string even if it contains
36
37
/// some unsupported characters.
37
- #[ inline]
38
38
pub fn test_string ( & mut self , string : * const u16 ) -> bool {
39
39
match ( self . test_string ) ( self , string) {
40
40
Status :: Success => true ,
@@ -44,7 +44,6 @@ impl Output {
44
44
45
45
/// Returns an iterator of all supported text modes.
46
46
// TODO: fix the ugly lifetime parameter.
47
- #[ inline]
48
47
pub fn modes < ' a > ( & ' a mut self ) -> impl Iterator < Item = OutputMode > + ' a {
49
48
let max = self . data . max_mode ;
50
49
OutputModeIter {
@@ -62,18 +61,21 @@ impl Output {
62
61
}
63
62
64
63
/// Sets a mode as current.
65
- #[ inline]
66
64
pub fn set_mode ( & mut self , mode : OutputMode ) -> Result < ( ) > {
67
65
( self . set_mode ) ( self , mode. index ) . into ( )
68
66
}
69
67
70
68
/// Returns the the current text mode.
71
- #[ inline]
72
69
pub fn current_mode ( & self ) -> Result < OutputMode > {
73
70
let index = self . data . mode ;
74
71
let dims = self . query_mode ( index) ?;
75
72
Ok ( OutputMode { index, dims } )
76
73
}
74
+
75
+ /// Enables or disables the cursor.
76
+ pub fn enable_cursor ( & mut self , visible : bool ) -> Result < ( ) > {
77
+ ( self . enable_cursor ) ( self , visible) . into ( )
78
+ }
77
79
}
78
80
79
81
/// The text mode (resolution) of the output device.
0 commit comments