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