]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Include/Protocol/HiiImage.h
Correct HiiGetBrowserData API usage.
[mirror_edk2.git] / MdePkg / Include / Protocol / HiiImage.h
... / ...
CommitLineData
1/** @file\r
2 The file provides services to access to images in the images database.\r
3 \r
4 Copyright (c) 2006 - 2008, Intel Corporation\r
5 All rights reserved. This program and the accompanying materials \r
6 are licensed and made available under the terms and conditions of the BSD License \r
7 which accompanies this distribution. The full text of the license may be found at \r
8 http://opensource.org/licenses/bsd-license.php \r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
12\r
13**/\r
14\r
15#ifndef __HII_IMAGE_H__\r
16#define __HII_IMAGE_H__\r
17\r
18#define EFI_HII_IMAGE_PROTOCOL_GUID \\r
19 { 0x31a6406a, 0x6bdf, 0x4e46, { 0xb2, 0xa2, 0xeb, 0xaa, 0x89, 0xc4, 0x9, 0x20 } }\r
20\r
21typedef struct _EFI_HII_IMAGE_PROTOCOL EFI_HII_IMAGE_PROTOCOL;\r
22\r
23\r
24///\r
25/// Flags in EFI_IMAGE_INPUT\r
26/// \r
27#define EFI_IMAGE_TRANSPARENT 0x00000001\r
28\r
29/**\r
30 \r
31 Definition of EFI_IMAGE_INPUT.\r
32 \r
33 @param Flags Describe image characteristics. If\r
34 EFI_IMAGE_TRANSPARENT is set, then the image was\r
35 designed for transparent display.\r
36\r
37 @param Width Image width, in pixels. \r
38\r
39 @param Height Image height, in pixels.\r
40\r
41 @param Bitmap The actual bitmap, organized left-to-right,\r
42 top-to-bottom. The size of the bitmap is\r
43 Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL).\r
44\r
45 \r
46**/\r
47typedef struct _EFI_IMAGE_INPUT {\r
48 UINT32 Flags;\r
49 UINT16 Width;\r
50 UINT16 Height;\r
51 EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Bitmap;\r
52} EFI_IMAGE_INPUT;\r
53\r
54\r
55/**\r
56\r
57 This function adds the image Image to the group of images\r
58 owned by PackageList, and returns a new image identifier\r
59 (ImageId).\r
60\r
61 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance. \r
62 \r
63 @param PackageList Handle of the package list where this image will be added.\r
64\r
65 @param ImageId On return, contains the new image id, which is\r
66 unique within PackageList.\r
67\r
68 @param Image Points to the image.\r
69\r
70 @retval EFI_SUCCESS The new image was added\r
71 successfully\r
72 \r
73 @retval EFI_OUT_OF_RESOURCES Could not add the image.\r
74 \r
75 @retval EFI_INVALID_PARAMETER Image is NULL or ImageId is\r
76 NULL.\r
77\r
78\r
79**/\r
80typedef\r
81EFI_STATUS\r
82(EFIAPI *EFI_HII_NEW_IMAGE)(\r
83 IN CONST EFI_HII_IMAGE_PROTOCOL *This,\r
84 IN EFI_HII_HANDLE PackageList,\r
85 OUT EFI_IMAGE_ID *ImageId,\r
86 IN CONST EFI_IMAGE_INPUT *Image\r
87);\r
88\r
89/**\r
90\r
91 This function retrieves the image specified by ImageId which\r
92 is associated with the specified PackageList and copies it\r
93 into the buffer specified by Image. If the image specified by\r
94 ImageId is not present in the specified PackageList, then\r
95 EFI_NOT_FOUND is returned. If the buffer specified by\r
96 ImageSize is too small to hold the image, then\r
97 EFI_BUFFER_TOO_SMALL will be returned. ImageSize will be\r
98 updated to the size of buffer actually required to hold the\r
99 image.\r
100\r
101 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance. \r
102 \r
103 @param PackageList The package list in the HII database to\r
104 search for the specified image.\r
105 \r
106 @param ImageId The image's id, which is unique within\r
107 PackageList.\r
108 \r
109 @param Image Points to the new image.\r
110 \r
111 @retval EFI_SUCCESS The image was returned successfully.\r
112\r
113 @retval EFI_NOT_FOUND The image specified by ImageId is not\r
114 available. Or The specified PackageList is not in the database.\r
115 \r
116 @retval EFI_INVALID_PARAMETER The Image or Langugae was NULL.\r
117 @retval EFI_OUT_OF_RESOURCES The bitmap could not be retrieved because there was not\r
118 enough memory.\r
119\r
120\r
121**/\r
122typedef\r
123EFI_STATUS\r
124(EFIAPI *EFI_HII_GET_IMAGE)(\r
125 IN CONST EFI_HII_IMAGE_PROTOCOL *This,\r
126 IN EFI_HII_HANDLE PackageList,\r
127 IN EFI_IMAGE_ID ImageId,\r
128 OUT EFI_IMAGE_INPUT *Image\r
129);\r
130\r
131/**\r
132 \r
133 This function updates the image specified by ImageId in the\r
134 specified PackageListHandle to the image specified by Image.\r
135\r
136\r
137 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance. \r
138\r
139 @param PackageList The package list containing the images.\r
140\r
141 @param ImageId The image id, which is unique within PackageList.\r
142\r
143 @param Image Points to the image.\r
144\r
145 @retval EFI_SUCCESS The image was successfully updated.\r
146 \r
147 @retval EFI_NOT_FOUND The image specified by ImageId is not in the database.\r
148 The specified PackageList is not in the database. \r
149 \r
150 @retval EFI_INVALID_PARAMETER The Image or Language was NULL.\r
151\r
152**/\r
153typedef\r
154EFI_STATUS\r
155(EFIAPI *EFI_HII_SET_IMAGE)(\r
156 IN CONST EFI_HII_IMAGE_PROTOCOL *This,\r
157 IN EFI_HII_HANDLE PackageList,\r
158 IN EFI_IMAGE_ID ImageId,\r
159 IN CONST EFI_IMAGE_INPUT *Image\r
160);\r
161\r
162\r
163///\r
164/// EFI_HII_DRAW_FLAGS describes how the image is to be drawn.\r
165/// These flags are defined as EFI_HII_DRAW_FLAG_***\r
166///\r
167typedef UINT32 EFI_HII_DRAW_FLAGS;\r
168\r
169#define EFI_HII_DRAW_FLAG_CLIP 0x00000001\r
170#define EFI_HII_DRAW_FLAG_TRANSPARENT 0x00000030\r
171#define EFI_HII_DRAW_FLAG_DEFAULT 0x00000000\r
172#define EFI_HII_DRAW_FLAG_FORCE_TRANS 0x00000010\r
173#define EFI_HII_DRAW_FLAG_FORCE_OPAQUE 0x00000020\r
174#define EFI_HII_DIRECT_TO_SCREEN 0x00000080\r
175\r
176/**\r
177 \r
178 Definition of EFI_IMAGE_OUTPUT.\r
179 \r
180 @param Width Width of the output image.\r
181\r
182 @param Height Height of the output image.\r
183\r
184 @param Bitmap Points to the output bitmap.\r
185\r
186 @param Screen Points to the EFI_GRAPHICS_OUTPUT_PROTOCOL which\r
187 describes the screen on which to draw the\r
188 specified image.\r
189\r
190**/\r
191typedef struct _EFI_IMAGE_OUTPUT {\r
192 UINT16 Width;\r
193 UINT16 Height;\r
194 union {\r
195 EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Bitmap;\r
196 EFI_GRAPHICS_OUTPUT_PROTOCOL *Screen;\r
197 } Image;\r
198} EFI_IMAGE_OUTPUT;\r
199\r
200\r
201/**\r
202 \r
203 This function renders an image to a bitmap or the screen using\r
204 the specified color and options. It draws the image on an\r
205 existing bitmap, allocates a new bitmap or uses the screen. The\r
206 images can be clipped. If EFI_HII_DRAW_FLAG_CLIP is set, then\r
207 all pixels drawn outside the bounding box specified by Width and\r
208 Height are ignored. If EFI_HII_DRAW_FLAG_TRANSPARENT is set,\r
209 then all 'off' pixels in the images drawn will use the\r
210 pixel value from Blt. This flag cannot be used if Blt is NULL\r
211 upon entry. If EFI_HII_DIRECT_TO_SCREEN is set, then the image\r
212 will be written directly to the output device specified by\r
213 Screen. Otherwise the image will be rendered to the bitmap\r
214 specified by Bitmap.\r
215\r
216\r
217 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance. \r
218 \r
219 @param Flags Describes how the image is to be drawn.\r
220 EFI_HII_DRAW_FLAGS is defined in Related\r
221 Definitions, below.\r
222 \r
223 @param Image Points to the image to be displayed. \r
224 \r
225 @param Blt If this points to a non-NULL on entry, this points\r
226 to the image, which is Width pixels wide and\r
227 Height pixels high. The image will be drawn onto\r
228 this image and EFI_HII_DRAW_FLAG_CLIP is implied.\r
229 If this points to a NULL on entry, then a buffer\r
230 will be allocated to hold the generated image and\r
231 the pointer updated on exit. It is the caller's\r
232 responsibility to free this buffer.\r
233\r
234 @param BltX, BltY Specifies the offset from the left and top\r
235 edge of the image of the first pixel in\r
236 the image.\r
237\r
238 @retval EFI_SUCCESS The image was successfully updated.\r
239\r
240 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output\r
241 buffer for RowInfoArray or Blt.\r
242\r
243 @retval EFI_INVALID_PARAMETER The Image or Blt or Height or\r
244 Width was NULL.\r
245\r
246\r
247**/\r
248typedef\r
249EFI_STATUS\r
250(EFIAPI *EFI_HII_DRAW_IMAGE)(\r
251 IN CONST EFI_HII_IMAGE_PROTOCOL *This,\r
252 IN EFI_HII_DRAW_FLAGS Flags,\r
253 IN CONST EFI_IMAGE_INPUT *Image,\r
254 IN OUT EFI_IMAGE_OUTPUT **Blt,\r
255 IN UINTN BltX,\r
256 IN UINTN BltY\r
257);\r
258\r
259/**\r
260 \r
261 This function renders an image as a bitmap or to the screen and\r
262 can clip the image. The bitmap is either supplied by the caller\r
263 or else is allocated by the function. The images can be drawn\r
264 transparently or opaquely. If EFI_HII_DRAW_FLAG_CLIP is set,\r
265 then all pixels drawn outside the bounding box specified by\r
266 Width and Height are ignored. If EFI_HII_DRAW_FLAG_TRANSPARENT\r
267 is set, then all "off" pixels in the character's glyph will\r
268 use the pixel value from Blt. This flag cannot be used if Blt\r
269 is NULL upon entry. If EFI_HII_DIRECT_TO_SCREEN is set, then\r
270 the image will be written directly to the output device\r
271 specified by Screen. Otherwise the image will be rendered to\r
272 the bitmap specified by Bitmap.\r
273 This function renders an image to a bitmap or the screen using\r
274 the specified color and options. It draws the image on an\r
275 existing bitmap, allocates a new bitmap or uses the screen. The\r
276 images can be clipped. If EFI_HII_DRAW_FLAG_CLIP is set, then\r
277 all pixels drawn outside the bounding box specified by Width and\r
278 Height are ignored. The EFI_HII_DRAW_FLAG_TRANSPARENT flag\r
279 determines whether the image will be drawn transparent or\r
280 opaque. If EFI_HII_DRAW_FLAG_FORCE_TRANS is set, then the image\r
281 will be drawn so that all 'off' pixels in the image will\r
282 be drawn using the pixel value from Blt and all other pixels\r
283 will be copied. If EFI_HII_DRAW_FLAG_FORCE_OPAQUE is set, then\r
284 the image's pixels will be copied directly to the\r
285 destination. If EFI_HII_DRAW_FLAG_DEFAULT is set, then the image\r
286 will be drawn transparently or opaque, depending on the\r
287 image's transparency setting (see EFI_IMAGE_TRANSPARENT).\r
288 Images cannot be drawn transparently if Blt is NULL. If\r
289 EFI_HII_DIRECT_TO_SCREEN is set, then the image will be written\r
290 directly to the output device specified by Screen. Otherwise the\r
291 image will be rendered to the bitmap specified by Bitmap.\r
292\r
293 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance. \r
294\r
295 @param Flags Describes how the image is to be drawn.\r
296\r
297 @param PackageList The package list in the HII database to\r
298 search for the specified image.\r
299\r
300 @param ImageId The image's id, which is unique within PackageList.\r
301\r
302 @param Blt If this points to a non-NULL on entry, this points\r
303 to the image, which is Width pixels wide and\r
304 Height pixels high. The image will be drawn onto\r
305 this image and EFI_HII_DRAW_FLAG_CLIP is implied.\r
306 If this points to a NULL on entry, then a buffer\r
307 will be allocated to hold the generated image and\r
308 the pointer updated on exit. It is the caller's\r
309 responsibility to free this buffer.\r
310\r
311 @param BltX, BltY Specifies the offset from the left and top\r
312 edge of the output image of the first\r
313 pixel in the image.\r
314\r
315 @retval EFI_SUCCESS The image was successfully updated.\r
316 \r
317 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output\r
318 buffer for RowInfoArray or Blt.\r
319 \r
320 @retval EFI_NOT_FOUND The image specified by ImageId is not in the database. \r
321 Or The specified PackageList is not in the database. \r
322 \r
323 @retval EFI_INVALID_PARAMETER The Blt was NULL. \r
324\r
325**/\r
326typedef\r
327EFI_STATUS\r
328(EFIAPI *EFI_HII_DRAW_IMAGE_ID)(\r
329IN CONST EFI_HII_IMAGE_PROTOCOL *This,\r
330IN EFI_HII_DRAW_FLAGS Flags,\r
331IN EFI_HII_HANDLE PackageList,\r
332IN EFI_IMAGE_ID ImageId,\r
333IN OUT EFI_IMAGE_OUTPUT **Blt,\r
334IN UINTN BltX,\r
335IN UINTN BltY\r
336);\r
337\r
338\r
339///\r
340/// Services to access to images in the images database.\r
341///\r
342struct _EFI_HII_IMAGE_PROTOCOL {\r
343 EFI_HII_NEW_IMAGE NewImage;\r
344 EFI_HII_GET_IMAGE GetImage;\r
345 EFI_HII_SET_IMAGE SetImage;\r
346 EFI_HII_DRAW_IMAGE DrawImage;\r
347 EFI_HII_DRAW_IMAGE_ID DrawImageId;\r
348};\r
349\r
350extern EFI_GUID gEfiHiiImageProtocolGuid;\r
351\r
352#endif\r
353\r
354\r