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