Debian Codegraph @

.cargo/vendor/r-efi/src/protocols/simple_text_output.rs

raw
1 //! Simple Text Output Protocol
2 //!
3 //! The simple-text-output protocol provides a simple way to print text on screen. It is modeled
4 //! around the old VGA-consoles, but does not carry all the old cruft. It expects a rectangular
5 //! text array and allows you to move the cursor around to write Unicode symbols to screen.
6
7 pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
8 0x387477c2,
9 0x69c7,
10 0x11d2,
11 0x8e,
12 0x39,
13 &[0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b],
14 );
15
16 #[repr(C)]
17 #[derive(Clone, Copy, Debug)]
18 pub struct Mode {
19 pub max_mode: i32,
20 pub mode: i32,
21 pub attribute: i32,
22 pub cursor_column: i32,
23 pub cursor_row: i32,
24 pub cursor_visible: crate::base::Boolean,
25 }
26
27 pub type ProtocolReset = eficall! {fn(
28 *mut Protocol,
29 crate::base::Boolean,
30 ) -> crate::base::Status};
31
32 pub type ProtocolOutputString = eficall! {fn(
33 *mut Protocol,
34 *mut crate::base::Char16,
35 ) -> crate::base::Status};
36
37 pub type ProtocolTestString = eficall! {fn(
38 *mut Protocol,
39 *mut crate::base::Char16,
40 ) -> crate::base::Status};
41
42 pub type ProtocolQueryMode = eficall! {fn(
43 *mut Protocol,
44 usize,
45 *mut usize,
46 *mut usize,
47 ) -> crate::base::Status};
48
49 pub type ProtocolSetMode = eficall! {fn(
50 *mut Protocol,
51 usize,
52 ) -> crate::base::Status};
53
54 pub type ProtocolSetAttribute = eficall! {fn(
55 *mut Protocol,
56 usize,
57 ) -> crate::base::Status};
58
59 pub type ProtocolClearScreen = eficall! {fn(
60 *mut Protocol,
61 ) -> crate::base::Status};
62
63 pub type ProtocolSetCursorPosition = eficall! {fn(
64 *mut Protocol,
65 usize,
66 usize,
67 ) -> crate::base::Status};
68
69 pub type ProtocolEnableCursor = eficall! {fn(
70 *mut Protocol,
71 crate::base::Boolean,
72 ) -> crate::base::Status};
73
74 #[repr(C)]
75 pub struct Protocol {
76 pub reset: ProtocolReset,
77 pub output_string: ProtocolOutputString,
78 pub test_string: ProtocolTestString,
79 pub query_mode: ProtocolQueryMode,
80 pub set_mode: ProtocolSetMode,
81 pub set_attribute: ProtocolSetAttribute,
82 pub clear_screen: ProtocolClearScreen,
83 pub set_cursor_position: ProtocolSetCursorPosition,
84 pub enable_cursor: ProtocolEnableCursor,
85 pub mode: *mut Mode,
86 }