r_efi/protocols/
hii_font.rs

1//! HII Font Protocol
2
3pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
4    0xe9ca4775,
5    0x8657,
6    0x47fc,
7    0x97,
8    0xe7,
9    &[0x7e, 0xd6, 0x5a, 0x08, 0x43, 0x24],
10);
11
12pub type ProtocolStringToImage = eficall! {fn(
13    *const Protocol,
14    OutFlags,
15    String,
16    *const super::hii_font_ex::DisplayInfo,
17    *mut *mut super::hii_font_ex::ImageOutput,
18    usize,
19    usize,
20    *mut *mut RowInfo,
21    *mut usize,
22    *mut usize,
23) -> crate::base::Status};
24
25pub type ProtocolStringIdToImage = eficall! {fn(
26    *const Protocol,
27    OutFlags,
28    crate::hii::Handle,
29    crate::hii::StringId,
30    *const crate::base::Char8,
31    *const super::hii_font_ex::DisplayInfo,
32    *mut *mut super::hii_font_ex::ImageOutput,
33    usize,
34    usize,
35    *mut *mut RowInfo,
36    *mut usize,
37    *mut usize,
38) -> crate::base::Status};
39
40pub type ProtocolGetGlyph = eficall! {fn(
41    *const Protocol,
42    crate::base::Char16,
43    *const super::hii_font_ex::DisplayInfo,
44    *mut *mut super::hii_font_ex::ImageOutput,
45    *mut usize,
46) -> crate::base::Status};
47
48pub type ProtocolGetFontInfo = eficall! {fn(
49    *const Protocol,
50    *mut Handle,
51    *const super::hii_font_ex::DisplayInfo,
52    *mut *mut super::hii_font_ex::DisplayInfo,
53    String,
54) -> crate::base::Status};
55
56#[repr(C)]
57pub struct Protocol {
58    pub string_to_image: ProtocolStringToImage,
59    pub string_id_to_image: ProtocolStringIdToImage,
60    pub get_glyph: ProtocolGetGlyph,
61    pub get_font_info: ProtocolGetFontInfo,
62}
63
64pub type OutFlags = u32;
65
66pub const OUT_FLAG_CLIP: OutFlags = 0x00000001;
67pub const OUT_FLAG_WRAP: OutFlags = 0x00000002;
68pub const OUT_FLAG_CLIP_CLEAN_Y: OutFlags = 0x00000004;
69pub const OUT_FLAG_CLIP_CLEAN_X: OutFlags = 0x00000008;
70pub const OUT_FLAG_TRANSPARENT: OutFlags = 0x00000010;
71pub const IGNORE_IF_NO_GLYPH: OutFlags = 0x00000020;
72pub const IGNORE_LINE_BREAK: OutFlags = 0x00000040;
73pub const DIRECT_TO_SCREEN: OutFlags = 0x00000080;
74
75pub type String = *mut crate::base::Char16;
76
77#[repr(C)]
78#[derive(Clone, Copy, Debug)]
79pub struct RowInfo {
80    pub start_index: usize,
81    pub end_index: usize,
82    pub line_height: usize,
83    pub line_width: usize,
84    pub baseline_offset: usize,
85}
86
87pub type Handle = *mut core::ffi::c_void;