]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiFont/HiiFont.h
Update the copyright notice format
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Efi / Protocol / HiiFont / HiiFont.h
CommitLineData
2c40a813 1/*++\r
2\r
f57387d5
HT
3Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
4This program and the accompanying materials \r
2c40a813 5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 HiiFont.h\r
15 \r
16Abstract:\r
17\r
18 EFI_HII_FONT_PROTOCOL from UEFI 2.1 specification.\r
19 \r
20 This protocol provides interfaces to retrieve font information.\r
21\r
22Revision History\r
23\r
24--*/\r
25\r
26#ifndef __EFI_HII_FONT_PROTOCOL_H__\r
27#define __EFI_HII_FONT_PROTOCOL_H__\r
28\r
29#include EFI_PROTOCOL_DEFINITION (GraphicsOutput)\r
30#include EFI_PROTOCOL_DEFINITION (HiiImage)\r
31\r
32//\r
33// Global ID for the Hii Font Protocol.\r
34//\r
35\r
36#define EFI_HII_FONT_PROTOCOL_GUID \\r
37 { \\r
7ccf38a3 38 0xe9ca4775, 0x8657, 0x47fc, {0x97, 0xe7, 0x7e, 0xd6, 0x5a, 0x8, 0x43, 0x24} \\r
2c40a813 39 }\r
40\r
41EFI_FORWARD_DECLARATION (EFI_HII_FONT_PROTOCOL);\r
42\r
43typedef UINT32 EFI_HII_OUT_FLAGS;\r
44typedef UINT32 EFI_FONT_INFO_MASK;\r
45typedef VOID* EFI_FONT_HANDLE;\r
46\r
47typedef struct _EFI_HII_ROW_INFO {\r
48 UINTN StartIndex;\r
49 UINTN EndIndex;\r
50 UINTN LineHeight;\r
51 UINTN LineWidth;\r
52 UINTN BaselineOffset;\r
53} EFI_HII_ROW_INFO;\r
54\r
55typedef struct {\r
56 UINT32 FontStyle;\r
57 UINT16 FontSize; // character cell size in pixels\r
58 CHAR16 FontName[1];\r
59} EFI_FONT_INFO;\r
60\r
61typedef struct _EFI_FONT_DISPLAY_INFO {\r
62 EFI_GRAPHICS_OUTPUT_BLT_PIXEL ForegroundColor;\r
63 EFI_GRAPHICS_OUTPUT_BLT_PIXEL BackgroundColor;\r
64 EFI_FONT_INFO_MASK FontInfoMask;\r
65 EFI_FONT_INFO FontInfo; \r
66} EFI_FONT_DISPLAY_INFO;\r
67\r
68#define EFI_HII_OUT_FLAG_CLIP 0x00000001\r
69#define EFI_HII_OUT_FLAG_WRAP 0x00000002\r
70#define EFI_HII_OUT_FLAG_CLEAN_Y 0x00000004\r
71#define EFI_HII_OUT_FLAG_CLEAN_X 0x00000008\r
72#define EFI_HII_OUT_FLAG_TRANSPARENT 0x00000010\r
73#define EFI_HII_IGNORE_IF_NO_GLYPH 0x00000020\r
74#define EFI_HII_IGNORE_LINE_BREAK 0x00000040\r
75#define EFI_HII_DIRECT_TO_SCREEN 0x00000080\r
76\r
77#define EFI_FONT_INFO_SYS_FONT 0x00000001\r
78#define EFI_FONT_INFO_SYS_SIZE 0x00000002\r
79#define EFI_FONT_INFO_SYS_STYLE 0x00000004\r
80#define EFI_FONT_INFO_SYS_FORE_COLOR 0x00000010\r
81#define EFI_FONT_INFO_SYS_BACK_COLOR 0x00000020\r
82#define EFI_FONT_INFO_RESIZE 0x00001000\r
83#define EFI_FONT_INFO_RESTYLE 0x00002000\r
84#define EFI_FONT_INFO_ANY_FONT 0x00010000\r
85#define EFI_FONT_INFO_ANY_SIZE 0x00020000\r
86#define EFI_FONT_INFO_ANY_STYLE 0x00040000\r
87\r
88typedef\r
89EFI_STATUS\r
90(EFIAPI *EFI_HII_STRING_TO_IMAGE) (\r
91 IN CONST EFI_HII_FONT_PROTOCOL *This,\r
92 IN EFI_HII_OUT_FLAGS Flags,\r
93 IN CONST EFI_STRING String,\r
94 IN CONST EFI_FONT_DISPLAY_INFO *StringInfo OPTIONAL,\r
95 IN OUT EFI_IMAGE_OUTPUT **Blt,\r
96 IN UINTN BltX,\r
97 IN UINTN BltY,\r
98 OUT EFI_HII_ROW_INFO **RowInfoArray OPTIONAL,\r
99 OUT UINTN *RowInfoArraySize OPTIONAL,\r
100 OUT UINTN *ColumnInfoArray OPTIONAL\r
101 )\r
102/*++\r
103\r
104 Routine Description:\r
105 Renders a string to a bitmap or to the display.\r
106\r
107 Arguments: \r
108 This - A pointer to the EFI_HII_FONT_PROTOCOL instance.\r
109 Flags - Describes how the string is to be drawn. \r
110 String - Points to the null-terminated string to be displayed.\r
111 StringInfo - Points to the string output information, including the color and font. \r
112 If NULL, then the string will be output in the default system font and color. \r
113 Blt - If this points to a non-NULL on entry, this points to the image, which is Width pixels \r
114 wide and Height pixels high. The string will be drawn onto this image and \r
115 EFI_HII_OUT_FLAG_CLIP is implied. If this points to a NULL on entry, then a \r
116 buffer will be allocated to hold the generated image and the pointer updated on exit. It\r
fd0d281b 117 is the caller's responsibility to free this buffer. \r
2c40a813 118 BltX,BLTY - Specifies the offset from the left and top edge of the image of the first character cell in\r
119 the image. \r
120 RowInfoArray - If this is non-NULL on entry, then on exit, this will point to an allocated buffer \r
121 containing row information and RowInfoArraySize will be updated to contain the \r
122 number of elements. This array describes the characters which were at least partially\r
fd0d281b 123 drawn and the heights of the rows. It is the caller's responsibility to free this buffer. \r
2c40a813 124 RowInfoArraySize - If this is non-NULL on entry, then on exit it contains the number of elements in\r
125 RowInfoArray. \r
126 ColumnInfoArray - If this is non-NULL, then on return it will be filled with the horizontal offset for each \r
127 character in the string on the row where it is displayed. Non-printing characters will \r
128 have the offset ~0. The caller is responsible to allocate a buffer large enough so that \r
129 there is one entry for each character in the string, not including the null-terminator. It\r
130 is possible when character display is normalized that some character cells overlap. \r
131 \r
132 Returns:\r
133 EFI_SUCCESS - The string was successfully rendered. \r
134 EFI_OUT_OF_RESOURCES - Unable to allocate an output buffer for RowInfoArray or Blt.\r
135 EFI_INVALID_PARAMETER - The String was NULL. \r
136 \r
137--*/\r
138;\r
139\r
140typedef\r
141EFI_STATUS\r
142(EFIAPI *EFI_HII_STRING_ID_TO_IMAGE) (\r
143 IN CONST EFI_HII_FONT_PROTOCOL *This,\r
144 IN EFI_HII_OUT_FLAGS Flags, \r
145 IN EFI_HII_HANDLE PackageList,\r
146 IN EFI_STRING_ID StringId,\r
147 IN CONST CHAR8* Language,\r
148 IN CONST EFI_FONT_DISPLAY_INFO *StringInfo OPTIONAL,\r
149 IN OUT EFI_IMAGE_OUTPUT **Blt,\r
150 IN UINTN BltX,\r
151 IN UINTN BltY,\r
152 OUT EFI_HII_ROW_INFO **RowInfoArray OPTIONAL,\r
153 OUT UINTN *RowInfoArraySize OPTIONAL,\r
154 OUT UINTN *ColumnInfoArray OPTIONAL\r
155 )\r
156/*++\r
157\r
158 Routine Description:\r
159 Render a string to a bitmap or the screen containing the contents of the specified string.\r
160\r
161 Arguments: \r
162 This - A pointer to the EFI_HII_FONT_PROTOCOL instance.\r
163 Flags - Describes how the string is to be drawn. \r
164 PackageList - The package list in the HII database to search for the specified string. \r
fd0d281b 165 StringId - The string's id, which is unique within PackageList. \r
2c40a813 166 Language - Points to the language for the retrieved string. If NULL, then the current system\r
167 language is used. \r
168 StringInfo - Points to the string output information, including the color and font. \r
169 If NULL, then the string will be output in the default system font and color. \r
170 Blt - If this points to a non-NULL on entry, this points to the image, which is Width pixels \r
171 wide and Height pixels high. The string will be drawn onto this image and \r
172 EFI_HII_OUT_FLAG_CLIP is implied. If this points to a NULL on entry, then a \r
173 buffer will be allocated to hold the generated image and the pointer updated on exit. It\r
fd0d281b 174 is the caller's responsibility to free this buffer. \r
2c40a813 175 BltX,BLTY - Specifies the offset from the left and top edge of the image of the first character cell in\r
176 the image. \r
177 RowInfoArray - If this is non-NULL on entry, then on exit, this will point to an allocated buffer \r
178 containing row information and RowInfoArraySize will be updated to contain the \r
179 number of elements. This array describes the characters which were at least partially\r
fd0d281b 180 drawn and the heights of the rows. It is the caller's responsibility to free this buffer. \r
2c40a813 181 RowInfoArraySize - If this is non-NULL on entry, then on exit it contains the number of elements in\r
182 RowInfoArray. \r
183 ColumnInfoArray - If this is non-NULL, then on return it will be filled with the horizontal offset for each \r
184 character in the string on the row where it is displayed. Non-printing characters will \r
185 have the offset ~0. The caller is responsible to allocate a buffer large enough so that \r
186 there is one entry for each character in the string, not including the null-terminator. It\r
187 is possible when character display is normalized that some character cells overlap. \r
188 \r
189 Returns:\r
190 EFI_SUCCESS - The string was successfully rendered. \r
191 EFI_OUT_OF_RESOURCES - Unable to allocate an output buffer for RowInfoArray or Blt.\r
192 EFI_INVALID_PARAMETER - The String was NULL. \r
193 \r
194--*/\r
195;\r
196\r
197typedef\r
198EFI_STATUS\r
199(EFIAPI *EFI_HII_GET_GLYPH) (\r
200 IN CONST EFI_HII_FONT_PROTOCOL *This,\r
201 IN CHAR16 Char,\r
202 IN CONST EFI_FONT_DISPLAY_INFO *StringInfo,\r
203 OUT EFI_IMAGE_OUTPUT **Blt,\r
204 OUT UINTN *Baseline OPTIONAL\r
205 )\r
206/*++\r
207\r
208 Routine Description:\r
209 Convert the glyph for a single character into a bitmap.\r
210\r
211 Arguments: \r
212 This - A pointer to the EFI_HII_FONT_PROTOCOL instance.\r
213 Char - Character to retrieve.\r
214 StringInfo - Points to the string font and color information or NULL if the string should use the\r
215 default system font and color. \r
216 Blt - Thus must point to a NULL on entry. A buffer will be allocated to hold the output and\r
fd0d281b 217 the pointer updated on exit. It is the caller's responsibility to free this buffer. \r
2c40a813 218 Baseline - Number of pixels from the bottom of the bitmap to the baseline.\r
219\r
220 Returns:\r
221 EFI_SUCCESS - Glyph bitmap created.\r
222 EFI_OUT_OF_RESOURCES - Unable to allocate the output buffer Blt. \r
223 EFI_WARN_UNKNOWN_GLYPH - The glyph was unknown and was \r
224 replaced with the glyph for Unicode\r
225 character 0xFFFD. \r
226 EFI_INVALID_PARAMETER - Blt is NULL or *Blt is not NULL.\r
227 \r
228--*/ \r
229;\r
230\r
231typedef\r
232EFI_STATUS\r
233(EFIAPI *EFI_HII_GET_FONT_INFO) (\r
234 IN CONST EFI_HII_FONT_PROTOCOL *This,\r
235 IN OUT EFI_FONT_HANDLE *FontHandle,\r
236 IN CONST EFI_FONT_DISPLAY_INFO *StringInfoIn,\r
237 OUT EFI_FONT_DISPLAY_INFO **StringInfoOut,\r
238 IN CONST EFI_STRING String OPTIONAL\r
239 )\r
240/*++\r
241\r
242 Routine Description:\r
243 This function iterates through fonts which match the specified font, using \r
244 the specified criteria. If String is non-NULL, then all of the characters in \r
245 the string must exist in order for a candidate font to be returned.\r
246 \r
247 Arguments: \r
248 This - A pointer to the EFI_HII_FONT_PROTOCOL instance.\r
249 FontHandle - On entry, points to the font handle returned by a \r
250 previous call to GetFontInfo() or NULL to start with the \r
251 first font. On return, points to the returned font handle or\r
252 points to NULL if there are no more matching fonts. \r
253 StringInfoIn - Upon entry, points to the font to return information about. \r
fd0d281b 254 StringInfoOut - Upon return, contains the matching font's information. \r
2c40a813 255 If NULL, then no information is returned.\r
256 It's caller's responsibility to free this buffer.\r
257 String - Points to the string which will be tested to determine \r
258 if all characters are available. If NULL, then any font \r
259 is acceptable.\r
260\r
261 Returns:\r
262 EFI_SUCCESS - Matching font returned successfully.\r
263 EFI_NOT_FOUND - No matching font was found.\r
264 EFI_INVALID_PARAMETER - StringInfoIn is NULL.\r
265 EFI_OUT_OF_RESOURCES - There were insufficient resources to complete the request.\r
266 \r
267--*/ \r
268;\r
269\r
270\r
271//\r
272// Interface structure for the EFI_HII_FONT_PROTOCOL\r
273//\r
e5bce275 274struct _EFI_HII_FONT_PROTOCOL {\r
2c40a813 275 EFI_HII_STRING_TO_IMAGE StringToImage;\r
276 EFI_HII_STRING_ID_TO_IMAGE StringIdToImage;\r
277 EFI_HII_GET_GLYPH GetGlyph;\r
278 EFI_HII_GET_FONT_INFO GetFontInfo;\r
e5bce275 279};\r
2c40a813 280\r
281extern EFI_GUID gEfiHiiFontProtocolGuid;\r
282\r
283#endif\r