]>
Commit | Line | Data |
---|---|---|
2c40a813 | 1 | /*++\r |
2 | \r | |
f57387d5 HT |
3 | Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r |
4 | This program and the accompanying materials \r | |
2c40a813 | 5 | are licensed and made available under the terms and conditions of the BSD License \r |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | HiiImage.h\r | |
15 | \r | |
16 | Abstract:\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 | |
22 | Revision 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 | |
40 | EFI_FORWARD_DECLARATION (EFI_HII_IMAGE_PROTOCOL);\r | |
41 | \r | |
42 | typedef UINT32 EFI_HII_DRAW_FLAGS;\r | |
43 | \r | |
44 | typedef struct _EFI_IMAGE_INPUT {\r | |
45 | UINT32 Flags; \r | |
46 | UINT16 Width;\r | |
47 | UINT16 Height;\r | |
48 | EFI_GRAPHICS_OUTPUT_BLT_PIXEL Bitmap[1];\r | |
49 | } EFI_IMAGE_INPUT;\r | |
50 | \r | |
51 | #define EFI_IMAGE_TRANSPARENT 0x00000001\r | |
52 | \r | |
53 | typedef 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 | |
69 | typedef\r | |
70 | EFI_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 | |
98 | typedef\r | |
99 | EFI_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 | |
104 | OUT EFI_IMAGE_INPUT *Image,\r | |
105 | OUT UINTN *ImageSize\r | |
106 | )\r | |
107 | /*++\r | |
108 | \r | |
109 | Routine Description:\r | |
110 | This function retrieves the image specified by ImageId which is associated with\r | |
111 | the specified PackageList and copies it into the buffer specified by Image.\r | |
112 | \r | |
113 | Arguments: \r | |
114 | This - A pointer to the EFI_HII_IMAGE_PROTOCOL instance.\r | |
115 | PackageList - Handle of the package list where this image will be searched. \r | |
fd0d281b | 116 | ImageId - The image's id,, which is unique within PackageList.\r |
2c40a813 | 117 | Image - Points to the image.\r |
118 | ImageSize - On entry, points to the size of the buffer pointed to by Image, in bytes. On return,\r | |
119 | points to the length of the image, in bytes. \r | |
120 | \r | |
121 | Returns:\r | |
122 | EFI_SUCCESS - The new image was returned successfully.\r | |
123 | EFI_NOT_FOUND - The image specified by ImageId is not available.\r | |
124 | EFI_BUFFER_TOO_SMALL - The buffer specified by ImageSize is too small to hold the image. \r | |
125 | EFI_INVALID_PARAMETER - The Image or ImageSize was NULL.\r | |
126 | \r | |
127 | --*/ \r | |
128 | ;\r | |
129 | \r | |
130 | typedef\r | |
131 | EFI_STATUS\r | |
132 | (EFIAPI *EFI_HII_SET_IMAGE) (\r | |
133 | IN CONST EFI_HII_IMAGE_PROTOCOL *This,\r | |
134 | IN EFI_HII_HANDLE PackageList,\r | |
135 | IN EFI_IMAGE_ID ImageId,\r | |
136 | IN CONST EFI_IMAGE_INPUT *Image\r | |
137 | )\r | |
138 | /*++\r | |
139 | \r | |
140 | Routine Description:\r | |
141 | This function updates the image specified by ImageId in the specified PackageListHandle to\r | |
142 | the image specified by Image. \r | |
143 | \r | |
144 | Arguments: \r | |
145 | This - A pointer to the EFI_HII_IMAGE_PROTOCOL instance.\r | |
146 | PackageList - The package list containing the images.\r | |
fd0d281b | 147 | ImageId - The image's id,, which is unique within PackageList.\r |
2c40a813 | 148 | Image - Points to the image.\r |
149 | \r | |
150 | Returns:\r | |
151 | EFI_SUCCESS - The new image was updated successfully.\r | |
152 | EFI_NOT_FOUND - The image specified by ImageId is not in the database. \r | |
153 | EFI_INVALID_PARAMETER - The Image was NULL.\r | |
154 | \r | |
155 | --*/ \r | |
156 | ;\r | |
157 | \r | |
158 | typedef\r | |
159 | EFI_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 | |
198 | typedef\r | |
199 | EFI_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 | |
236 | EFI_INVALID_PARAMETER - The Image was NULL.\r | |
237 | \r | |
238 | --*/\r | |
239 | ;\r | |
240 | \r | |
241 | //\r | |
242 | // Interface structure for the EFI_HII_IMAGE_PROTOCOL\r | |
243 | //\r | |
e5bce275 | 244 | struct _EFI_HII_IMAGE_PROTOCOL {\r |
2c40a813 | 245 | EFI_HII_NEW_IMAGE NewImage;\r |
246 | EFI_HII_GET_IMAGE GetImage;\r | |
247 | EFI_HII_SET_IMAGE SetImage;\r | |
248 | EFI_HII_DRAW_IMAGE DrawImage;\r | |
249 | EFI_HII_DRAW_IMAGE_ID DrawImageId;\r | |
e5bce275 | 250 | };\r |
2c40a813 | 251 | \r |
252 | extern EFI_GUID gEfiHiiImageProtocolGuid;\r | |
253 | \r | |
254 | #endif\r |