]>
Commit | Line | Data |
---|---|---|
a48d0a3d CS |
1 | /** @file\r |
2 | Protocol which allows access to the images in the images database.\r | |
3 | \r | |
4 | (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r | |
5 | \r | |
6 | This program and the accompanying materials are licensed and made available under\r | |
7 | the terms and conditions of the BSD License that accompanies this distribution.\r | |
8 | The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php.\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | #ifndef __EFI_HII_IMAGE_EX_H__\r | |
17 | #define __EFI_HII_IMAGE_EX_H__\r | |
18 | \r | |
19 | #include <Protocol/HiiImage.h>\r | |
20 | \r | |
21 | //\r | |
22 | // Global ID for the Hii Image Ex Protocol.\r | |
23 | //\r | |
24 | #define EFI_HII_IMAGE_EX_PROTOCOL_GUID \\r | |
25 | {0x1a1241e6, 0x8f19, 0x41a9, { 0xbc, 0xe, 0xe8, 0xef, 0x39, 0xe0, 0x65, 0x46 }}\r | |
26 | \r | |
27 | typedef struct _EFI_HII_IMAGE_EX_PROTOCOL EFI_HII_IMAGE_EX_PROTOCOL;\r | |
28 | \r | |
29 | /**\r | |
30 | The prototype of this extension function is the same with EFI_HII_IMAGE_PROTOCOL.NewImage().\r | |
b16dd6c8 | 31 | This protocol invokes EFI_HII_IMAGE_PROTOCOL.NewImage() implicitly.\r |
a48d0a3d CS |
32 | \r |
33 | @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.\r | |
34 | @param PackageList Handle of the package list where this image will\r | |
35 | be added.\r | |
36 | @param ImageId On return, contains the new image id, which is\r | |
37 | unique within PackageList.\r | |
38 | @param Image Points to the image.\r | |
39 | \r | |
40 | @retval EFI_SUCCESS The new image was added successfully.\r | |
41 | @retval EFI_NOT_FOUND The specified PackageList could not be found in\r | |
42 | database.\r | |
43 | @retval EFI_OUT_OF_RESOURCES Could not add the image due to lack of resources.\r | |
44 | @retval EFI_INVALID_PARAMETER Image is NULL or ImageId is NULL.\r | |
45 | \r | |
46 | **/\r | |
47 | typedef\r | |
48 | EFI_STATUS\r | |
49 | (EFIAPI *EFI_HII_NEW_IMAGE_EX)(\r | |
50 | IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This,\r | |
51 | IN EFI_HII_HANDLE PackageList,\r | |
52 | OUT EFI_IMAGE_ID *ImageId,\r | |
53 | IN CONST EFI_IMAGE_INPUT *Image\r | |
54 | );\r | |
55 | \r | |
56 | /**\r | |
57 | Return the information about the image, associated with the package list.\r | |
58 | The prototype of this extension function is the same with EFI_HII_IMAGE_PROTOCOL.GetImage().\r | |
b16dd6c8 DB |
59 | \r |
60 | This function is similar to EFI_HII_IMAGE_PROTOCOL.GetImage().The difference is that\r | |
61 | this function will locate all EFI_HII_IMAGE_DECODER_PROTOCOL instances installed in the\r | |
62 | system if the decoder of the certain image type is not supported by the\r | |
63 | EFI_HII_IMAGE_EX_PROTOCOL. The function will attempt to decode the image to the\r | |
64 | EFI_IMAGE_INPUT using the first EFI_HII_IMAGE_DECODER_PROTOCOL instance that\r | |
65 | supports the requested image type.\r | |
a48d0a3d CS |
66 | \r |
67 | @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.\r | |
b16dd6c8 DB |
68 | @param PackageList The package list in the HII database to search for the\r |
69 | specified image.\r | |
70 | @param ImageId The image's id, which is unique within PackageList.\r | |
a48d0a3d CS |
71 | @param Image Points to the image.\r |
72 | \r | |
73 | @retval EFI_SUCCESS The new image was returned successfully.\r | |
b16dd6c8 DB |
74 | @retval EFI_NOT_FOUND The image specified by ImageId is not available. The specified\r |
75 | PackageList is not in the Database.\r | |
76 | @retval EFI_INVALID_PARAMETER Image was NULL or ImageId was 0.\r | |
a48d0a3d CS |
77 | @retval EFI_OUT_OF_RESOURCES The bitmap could not be retrieved because there\r |
78 | was not enough memory.\r | |
79 | \r | |
80 | **/\r | |
81 | typedef\r | |
82 | EFI_STATUS\r | |
83 | (EFIAPI *EFI_HII_GET_IMAGE_EX)(\r | |
84 | IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This,\r | |
85 | IN EFI_HII_HANDLE PackageList,\r | |
86 | IN EFI_IMAGE_ID ImageId,\r | |
87 | OUT EFI_IMAGE_INPUT *Image\r | |
88 | );\r | |
89 | \r | |
90 | /**\r | |
b16dd6c8 DB |
91 | Change the information about the image.\r |
92 | \r | |
93 | Same with EFI_HII_IMAGE_PROTOCOL.SetImage(),this protocol invokes\r | |
94 | EFI_HII_IMAGE_PROTOCOL.SetImage()implicitly.\r | |
a48d0a3d CS |
95 | \r |
96 | @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.\r | |
97 | @param PackageList The package list containing the images.\r | |
b16dd6c8 | 98 | @param ImageId The image's id, which is unique within PackageList.\r |
a48d0a3d CS |
99 | @param Image Points to the image.\r |
100 | \r | |
b16dd6c8 | 101 | @retval EFI_SUCCESS The new image was successfully updated.\r |
a48d0a3d CS |
102 | @retval EFI_NOT_FOUND The image specified by ImageId is not in the\r |
103 | database. The specified PackageList is not in\r | |
104 | the database.\r | |
b16dd6c8 DB |
105 | @retval EFI_INVALID_PARAMETER The Image was NULL, the ImageId was 0 or\r |
106 | the Image->Bitmap was NULL.\r | |
a48d0a3d CS |
107 | \r |
108 | **/\r | |
109 | typedef\r | |
110 | EFI_STATUS\r | |
111 | (EFIAPI *EFI_HII_SET_IMAGE_EX)(\r | |
112 | IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This,\r | |
113 | IN EFI_HII_HANDLE PackageList,\r | |
114 | IN EFI_IMAGE_ID ImageId,\r | |
115 | IN CONST EFI_IMAGE_INPUT *Image\r | |
116 | );\r | |
117 | \r | |
118 | /**\r | |
b16dd6c8 DB |
119 | Renders an image to a bitmap or to the display.\r |
120 | \r | |
121 | The prototype of this extension function is the same with\r | |
122 | EFI_HII_IMAGE_PROTOCOL.DrawImage(). This protocol invokes\r | |
123 | EFI_HII_IMAGE_PROTOCOL.DrawImage() implicitly.\r | |
a48d0a3d CS |
124 | \r |
125 | @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.\r | |
126 | @param Flags Describes how the image is to be drawn.\r | |
127 | @param Image Points to the image to be displayed.\r | |
128 | @param Blt If this points to a non-NULL on entry, this points\r | |
129 | to the image, which is Width pixels wide and\r | |
130 | Height pixels high. The image will be drawn onto\r | |
131 | this image and EFI_HII_DRAW_FLAG_CLIP is implied.\r | |
b16dd6c8 DB |
132 | If this points to a NULL on entry, then a buffer\r |
133 | will be allocated to hold the generated image and\r | |
a48d0a3d CS |
134 | the pointer updated on exit. It is the caller's\r |
135 | responsibility to free this buffer.\r | |
136 | @param BltX Specifies the offset from the left and top edge of\r | |
b16dd6c8 | 137 | the output image of the first pixel in the image.\r |
a48d0a3d | 138 | @param BltY Specifies the offset from the left and top edge of\r |
b16dd6c8 | 139 | the output image of the first pixel in the image.\r |
a48d0a3d CS |
140 | \r |
141 | @retval EFI_SUCCESS The image was successfully drawn.\r | |
142 | @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for Blt.\r | |
143 | @retval EFI_INVALID_PARAMETER The Image or Blt was NULL.\r | |
a48d0a3d CS |
144 | \r |
145 | **/\r | |
146 | typedef\r | |
147 | EFI_STATUS\r | |
148 | (EFIAPI *EFI_HII_DRAW_IMAGE_EX)(\r | |
149 | IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This,\r | |
150 | IN EFI_HII_DRAW_FLAGS Flags,\r | |
151 | IN CONST EFI_IMAGE_INPUT *Image,\r | |
152 | IN OUT EFI_IMAGE_OUTPUT **Blt,\r | |
153 | IN UINTN BltX,\r | |
154 | IN UINTN BltY\r | |
155 | );\r | |
156 | \r | |
157 | /**\r | |
158 | Renders an image to a bitmap or the screen containing the contents of the specified\r | |
b16dd6c8 DB |
159 | image.\r |
160 | \r | |
161 | This function is similar to EFI_HII_IMAGE_PROTOCOL.DrawImageId(). The difference is that\r | |
162 | this function will locate all EFI_HII_IMAGE_DECODER_PROTOCOL instances installed in the\r | |
163 | system if the decoder of the certain image type is not supported by the\r | |
164 | EFI_HII_IMAGE_EX_PROTOCOL. The function will attempt to decode the image to the\r | |
165 | EFI_IMAGE_INPUT using the first EFI_HII_IMAGE_DECODER_PROTOCOL instance that\r | |
166 | supports the requested image type.\r | |
a48d0a3d CS |
167 | \r |
168 | @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.\r | |
169 | @param Flags Describes how the image is to be drawn.\r | |
170 | @param PackageList The package list in the HII database to search for\r | |
171 | the specified image.\r | |
b16dd6c8 | 172 | @param ImageId The image's id, which is unique within PackageList.\r |
a48d0a3d CS |
173 | @param Blt If this points to a non-NULL on entry, this points\r |
174 | to the image, which is Width pixels wide and\r | |
175 | Height pixels high. The image will be drawn onto\r | |
176 | this image and EFI_HII_DRAW_FLAG_CLIP is implied.\r | |
177 | If this points to a NULL on entry, then a buffer\r | |
178 | will be allocated to hold the generated image\r | |
179 | and the pointer updated on exit. It is the caller's\r | |
180 | responsibility to free this buffer.\r | |
181 | @param BltX Specifies the offset from the left and top edge of\r | |
182 | the output image of the first pixel in the image.\r | |
183 | @param BltY Specifies the offset from the left and top edge of\r | |
184 | the output image of the first pixel in the image.\r | |
185 | \r | |
186 | @retval EFI_SUCCESS The image was successfully drawn.\r | |
187 | @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for Blt.\r | |
b16dd6c8 | 188 | @retval EFI_INVALID_PARAMETER The Blt was NULL or ImageId was 0.\r |
a48d0a3d CS |
189 | @retval EFI_NOT_FOUND The image specified by ImageId is not in the database.\r |
190 | The specified PackageList is not in the database.\r | |
191 | \r | |
192 | **/\r | |
193 | typedef\r | |
194 | EFI_STATUS\r | |
195 | (EFIAPI *EFI_HII_DRAW_IMAGE_ID_EX)(\r | |
196 | IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This,\r | |
197 | IN EFI_HII_DRAW_FLAGS Flags,\r | |
198 | IN EFI_HII_HANDLE PackageList,\r | |
199 | IN EFI_IMAGE_ID ImageId,\r | |
200 | IN OUT EFI_IMAGE_OUTPUT **Blt,\r | |
201 | IN UINTN BltX,\r | |
202 | IN UINTN BltY\r | |
203 | );\r | |
204 | \r | |
205 | /**\r | |
206 | This function returns the image information to EFI_IMAGE_OUTPUT. Only the width\r | |
207 | and height are returned to the EFI_IMAGE_OUTPUT instead of decoding the image\r | |
208 | to the buffer. This function is used to get the geometry of the image. This function\r | |
209 | will try to locate all of the EFI_HII_IMAGE_DECODER_PROTOCOL installed on the\r | |
210 | system if the decoder of image type is not supported by the EFI_HII_IMAGE_EX_PROTOCOL.\r | |
211 | \r | |
212 | @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.\r | |
213 | @param PackageList Handle of the package list where this image will\r | |
214 | be searched.\r | |
b16dd6c8 | 215 | @param ImageId The image's id, which is unique within PackageList.\r |
a48d0a3d CS |
216 | @param Image Points to the image.\r |
217 | \r | |
218 | @retval EFI_SUCCESS The new image was returned successfully.\r | |
219 | @retval EFI_NOT_FOUND The image specified by ImageId is not in the\r | |
220 | database. The specified PackageList is not in the database.\r | |
221 | @retval EFI_BUFFER_TOO_SMALL The buffer specified by ImageSize is too small to\r | |
222 | hold the image.\r | |
b16dd6c8 | 223 | @retval EFI_INVALID_PARAMETER The Image was NULL or the ImageId was 0.\r |
a48d0a3d CS |
224 | @retval EFI_OUT_OF_RESOURCES The bitmap could not be retrieved because there\r |
225 | was not enough memory.\r | |
226 | \r | |
227 | **/\r | |
228 | typedef\r | |
229 | EFI_STATUS\r | |
230 | (EFIAPI *EFI_HII_GET_IMAGE_INFO)(\r | |
231 | IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This,\r | |
232 | IN EFI_HII_HANDLE PackageList,\r | |
233 | IN EFI_IMAGE_ID ImageId,\r | |
6e227fb5 | 234 | OUT EFI_IMAGE_OUTPUT *Image\r |
a48d0a3d CS |
235 | );\r |
236 | \r | |
237 | ///\r | |
238 | /// Protocol which allows access to the images in the images database.\r | |
239 | ///\r | |
240 | struct _EFI_HII_IMAGE_EX_PROTOCOL {\r | |
241 | EFI_HII_NEW_IMAGE_EX NewImageEx;\r | |
242 | EFI_HII_GET_IMAGE_EX GetImageEx;\r | |
243 | EFI_HII_SET_IMAGE_EX SetImageEx;\r | |
244 | EFI_HII_DRAW_IMAGE_EX DrawImageEx;\r | |
245 | EFI_HII_DRAW_IMAGE_ID_EX DrawImageIdEx;\r | |
246 | EFI_HII_GET_IMAGE_INFO GetImageInfo;\r | |
247 | };\r | |
248 | \r | |
249 | extern EFI_GUID gEfiHiiImageExProtocolGuid;\r | |
250 | \r | |
251 | #endif\r |