]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiImage/HiiImage.h
Maintainers.txt: Remove EdkCompatibilityPkg information
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Efi / Protocol / HiiImage / HiiImage.h
CommitLineData
2c40a813 1/*++\r
2\r
3e99020d 3Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
f57387d5 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 HiiImage.h\r
15 \r
16Abstract:\r
17\r
18 EFI_HII_IMAGE_PROTOCOL from UEFI 2.1 specification.\r
19 \r
20 This protocol provides access to images in the images database.\r
21\r
22Revision History\r
23\r
24--*/\r
25\r
26#ifndef __EFI_HII_IMAGE_PROTOCOL_H__\r
27#define __EFI_HII_IMAGE_PROTOCOL_H__\r
28\r
29#include "EfiHii.h"\r
30#include EFI_PROTOCOL_DEFINITION (GraphicsOutput) \r
31\r
32//\r
33// Global ID for the Hii Image Protocol.\r
34//\r
35#define EFI_HII_IMAGE_PROTOCOL_GUID \\r
36 { \\r
7ccf38a3 37 0x31a6406a, 0x6bdf, 0x4e46, {0xb2, 0xa2, 0xeb, 0xaa, 0x89, 0xc4, 0x9, 0x20} \\r
2c40a813 38 }\r
39\r
40EFI_FORWARD_DECLARATION (EFI_HII_IMAGE_PROTOCOL);\r
41\r
42typedef UINT32 EFI_HII_DRAW_FLAGS;\r
43\r
44typedef struct _EFI_IMAGE_INPUT {\r
45 UINT32 Flags; \r
46 UINT16 Width;\r
47 UINT16 Height;\r
3e99020d 48 EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Bitmap;\r
2c40a813 49} EFI_IMAGE_INPUT;\r
50\r
51#define EFI_IMAGE_TRANSPARENT 0x00000001\r
52\r
53typedef struct _EFI_IMAGE_OUTPUT {\r
54 UINT16 Width;\r
55 UINT16 Height;\r
56 union {\r
57 EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Bitmap;\r
58 EFI_GRAPHICS_OUTPUT_PROTOCOL *Screen;\r
59 } Image;\r
60} EFI_IMAGE_OUTPUT;\r
61\r
62#define EFI_HII_DRAW_FLAG_CLIP 0x00000001\r
63#define EFI_HII_DRAW_FLAG_TRANSPARENT 0x00000030\r
64#define EFI_HII_DRAW_FLAG_DEFAULT 0x00000000\r
65#define EFI_HII_DRAW_FLAG_FORCE_TRANS 0x00000010\r
66#define EFI_HII_DRAW_FLAG_FORCE_OPAQUE 0x00000020\r
67#define EFI_HII_DIRECT_TO_SCREEN 0x00000080\r
68\r
69typedef\r
70EFI_STATUS\r
71(EFIAPI *EFI_HII_NEW_IMAGE) (\r
72 IN CONST EFI_HII_IMAGE_PROTOCOL *This,\r
73 IN EFI_HII_HANDLE PackageList,\r
74 OUT EFI_IMAGE_ID *ImageId,\r
75 IN CONST EFI_IMAGE_INPUT *Image\r
76 )\r
77/*++\r
78\r
79 Routine Description:\r
80 This function adds the image Image to the group of images owned by PackageList, and returns\r
81 a new image identifier (ImageId). \r
82 \r
83 Arguments: \r
84 This - A pointer to the EFI_HII_IMAGE_PROTOCOL instance.\r
85 PackageList - Handle of the package list where this image will be added. \r
86 ImageId - On return, contains the new image id, which is unique within PackageList.\r
87 Image - Points to the image.\r
88 \r
89 Returns:\r
90 EFI_SUCCESS - The new image was added successfully.\r
91 EFI_NOT_FOUND - The specified PackageList could not be found in database.\r
92 EFI_OUT_OF_RESOURCES - Could not add the image due to lack of resources.\r
93 EFI_INVALID_PARAMETER - Image is NULL or ImageId is NULL. \r
94 \r
95--*/ \r
96;\r
97\r
98typedef\r
99EFI_STATUS\r
100(EFIAPI *EFI_HII_GET_IMAGE) (\r
101 IN CONST EFI_HII_IMAGE_PROTOCOL *This,\r
102 IN EFI_HII_HANDLE PackageList,\r
103 IN EFI_IMAGE_ID ImageId,\r
3e99020d 104 OUT EFI_IMAGE_INPUT *Image\r
2c40a813 105 )\r
106/*++\r
107\r
108 Routine Description:\r
109 This function retrieves the image specified by ImageId which is associated with\r
110 the specified PackageList and copies it into the buffer specified by Image.\r
111 \r
112 Arguments: \r
113 This - A pointer to the EFI_HII_IMAGE_PROTOCOL instance.\r
114 PackageList - Handle of the package list where this image will be searched. \r
fd0d281b 115 ImageId - The image's id,, which is unique within PackageList.\r
2c40a813 116 Image - Points to the image.\r
2c40a813 117 \r
118 Returns:\r
119 EFI_SUCCESS - The new image was returned successfully.\r
120 EFI_NOT_FOUND - The image specified by ImageId is not available.\r
3e99020d 121 The specified PackageList is not in the database.\r
2c40a813 122 EFI_INVALID_PARAMETER - The Image or ImageSize was NULL.\r
3e99020d
LG
123 EFI_OUT_OF_RESOURCES - The bitmap could not be retrieved because there was not\r
124 enough memory.\r
2c40a813 125 \r
126--*/ \r
127;\r
128\r
129typedef\r
130EFI_STATUS\r
131(EFIAPI *EFI_HII_SET_IMAGE) (\r
132 IN CONST EFI_HII_IMAGE_PROTOCOL *This,\r
133 IN EFI_HII_HANDLE PackageList,\r
134 IN EFI_IMAGE_ID ImageId,\r
135 IN CONST EFI_IMAGE_INPUT *Image\r
136 )\r
137/*++\r
138\r
139 Routine Description:\r
140 This function updates the image specified by ImageId in the specified PackageListHandle to\r
141 the image specified by Image. \r
142 \r
143 Arguments: \r
144 This - A pointer to the EFI_HII_IMAGE_PROTOCOL instance.\r
145 PackageList - The package list containing the images.\r
fd0d281b 146 ImageId - The image's id,, which is unique within PackageList.\r
2c40a813 147 Image - Points to the image.\r
148 \r
149 Returns:\r
150 EFI_SUCCESS - The new image was updated successfully.\r
3e99020d
LG
151 EFI_NOT_FOUND - The image specified by ImageId is not in the database.\r
152 The specified PackageList is not in the database. \r
2c40a813 153 EFI_INVALID_PARAMETER - The Image was NULL.\r
154 \r
155--*/ \r
156;\r
157\r
158typedef\r
159EFI_STATUS\r
160(EFIAPI *EFI_HII_DRAW_IMAGE) (\r
161 IN CONST EFI_HII_IMAGE_PROTOCOL *This,\r
162 IN EFI_HII_DRAW_FLAGS Flags,\r
163 IN CONST EFI_IMAGE_INPUT *Image,\r
164 IN OUT EFI_IMAGE_OUTPUT **Blt,\r
165 IN UINTN BltX,\r
166 IN UINTN BltY\r
167 )\r
168/*++\r
169\r
170 Routine Description:\r
171 This function renders an image to a bitmap or the screen using the specified\r
172 color and options. It draws the image on an existing bitmap, allocates a new\r
173 bitmap or uses the screen. The images can be clipped. \r
174 \r
175 Arguments: \r
176 This - A pointer to the EFI_HII_IMAGE_PROTOCOL instance.\r
177 Flags - Describes how the image is to be drawn. \r
178 Image - Points to the image to be displayed.\r
179 Blt - If this points to a non-NULL on entry, this points to the\r
180 image, which is Width pixels wide and Height pixels high. \r
181 The image will be drawn onto this image and \r
182 EFI_HII_DRAW_FLAG_CLIP is implied. If this points to a \r
183 NULL on entry, then a buffer will be allocated to hold \r
184 the generated image and the pointer updated on exit. It\r
fd0d281b 185 is the caller's responsibility to free this buffer.\r
2c40a813 186 BltX, BltY - Specifies the offset from the left and top edge of the \r
187 output image of the first pixel in the image.\r
188 \r
189 Returns:\r
190 EFI_SUCCESS - The image was successfully drawn.\r
191 EFI_OUT_OF_RESOURCES - Unable to allocate an output buffer for Blt.\r
192 EFI_INVALID_PARAMETER - The Image or Blt was NULL.\r
193 EFI_INVALID_PARAMETER - Any combination of Flags is invalid.\r
194 \r
195--*/\r
196;\r
197\r
198typedef\r
199EFI_STATUS\r
200(EFIAPI *EFI_HII_DRAW_IMAGE_ID) (\r
201 IN CONST EFI_HII_IMAGE_PROTOCOL *This,\r
202 IN EFI_HII_DRAW_FLAGS Flags,\r
203 IN EFI_HII_HANDLE PackageList,\r
204 IN EFI_IMAGE_ID ImageId,\r
205 IN OUT EFI_IMAGE_OUTPUT **Blt,\r
206 IN UINTN BltX,\r
207 IN UINTN BltY\r
208 )\r
209\r
210/*++\r
211\r
212 Routine Description:\r
213 This function renders an image to a bitmap or the screen using the specified\r
214 color and options. It draws the image on an existing bitmap, allocates a new\r
215 bitmap or uses the screen. The images can be clipped. \r
216 \r
217 Arguments: \r
218 This - A pointer to the EFI_HII_IMAGE_PROTOCOL instance.\r
219 Flags - Describes how the image is to be drawn.\r
220 PackageList - The package list in the HII database to search for the \r
221 specified image.\r
222 ImageId - The image's id, which is unique within PackageList.\r
223 Blt - If this points to a non-NULL on entry, this points to the\r
224 image, which is Width pixels wide and Height pixels high.\r
225 The image will be drawn onto this image and \r
226 EFI_HII_DRAW_FLAG_CLIP is implied. If this points to a \r
227 NULL on entry, then a buffer will be allocated to hold \r
228 the generated image and the pointer updated on exit. It\r
fd0d281b 229 is the caller's responsibility to free this buffer.\r
2c40a813 230 BltX, BltY - Specifies the offset from the left and top edge of the \r
231 output image of the first pixel in the image.\r
232 \r
233 Returns:\r
234 EFI_SUCCESS - The image was successfully drawn.\r
235 EFI_OUT_OF_RESOURCES - Unable to allocate an output buffer for Blt.\r
3e99020d
LG
236 EFI_NOT_FOUND - The image specified by ImageId is not in the database. \r
237 The specified PackageList is not in the database. \r
238 EFI_INVALID_PARAMETER - The Blt was NULL. \r
2c40a813 239\r
240--*/\r
241;\r
242\r
243//\r
244// Interface structure for the EFI_HII_IMAGE_PROTOCOL\r
245//\r
e5bce275 246struct _EFI_HII_IMAGE_PROTOCOL {\r
2c40a813 247 EFI_HII_NEW_IMAGE NewImage;\r
248 EFI_HII_GET_IMAGE GetImage;\r
249 EFI_HII_SET_IMAGE SetImage;\r
250 EFI_HII_DRAW_IMAGE DrawImage;\r
251 EFI_HII_DRAW_IMAGE_ID DrawImageId;\r
e5bce275 252};\r
2c40a813 253\r
254extern EFI_GUID gEfiHiiImageProtocolGuid;\r
255\r
256#endif\r