]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.h
apply for doxgen format.
[mirror_edk2.git] / MdeModulePkg / Universal / Console / GraphicsConsoleDxe / GraphicsConsole.h
1 /** @file
2 Header file for GraphicsConsole driver.
3
4 Copyright (c) 2006, Intel Corporation. <BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef _GRAPHICS_CONSOLE_H
16 #define _GRAPHICS_CONSOLE_H
17
18 #include <PiDxe.h>
19 #include <Protocol/SimpleTextOut.h>
20 #include <Protocol/GraphicsOutput.h>
21 #include <Protocol/UgaDraw.h>
22 #include <Protocol/DevicePath.h>
23 #include <Library/DebugLib.h>
24 #include <Library/UefiDriverEntryPoint.h>
25 #include <Library/UefiLib.h>
26 #include <Library/BaseMemoryLib.h>
27 #include <Library/MemoryAllocationLib.h>
28 #include <Library/UefiBootServicesTableLib.h>
29 #include <Library/HiiLib.h>
30 #include <Library/BaseLib.h>
31 #include <Library/PcdLib.h>
32
33 #include <MdeModuleHii.h>
34
35 #include <Protocol/HiiFont.h>
36 #include <Protocol/HiiDatabase.h>
37
38
39 extern EFI_COMPONENT_NAME_PROTOCOL gGraphicsConsoleComponentName;
40 extern EFI_COMPONENT_NAME2_PROTOCOL gGraphicsConsoleComponentName2;
41
42 //
43 // EFI Component Name Functions
44 //
45 /**
46 Retrieves a Unicode string that is the user readable name of the driver.
47
48 This function retrieves the user readable name of a driver in the form of a
49 Unicode string. If the driver specified by This has a user readable name in
50 the language specified by Language, then a pointer to the driver name is
51 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
52 by This does not support the language specified by Language,
53 then EFI_UNSUPPORTED is returned.
54
55 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
56 EFI_COMPONENT_NAME_PROTOCOL instance.
57
58 @param Language[in] A pointer to a Null-terminated ASCII string
59 array indicating the language. This is the
60 language of the driver name that the caller is
61 requesting, and it must match one of the
62 languages specified in SupportedLanguages. The
63 number of languages supported by a driver is up
64 to the driver writer. Language is specified
65 in RFC 3066 or ISO 639-2 language code format.
66
67 @param DriverName[out] A pointer to the Unicode string to return.
68 This Unicode string is the name of the
69 driver specified by This in the language
70 specified by Language.
71
72 @retval EFI_SUCCESS The Unicode string for the Driver specified by
73 This and the language specified by Language was
74 returned in DriverName.
75
76 @retval EFI_INVALID_PARAMETER Language is NULL.
77
78 @retval EFI_INVALID_PARAMETER DriverName is NULL.
79
80 @retval EFI_UNSUPPORTED The driver specified by This does not support
81 the language specified by Language.
82
83 **/
84 EFI_STATUS
85 EFIAPI
86 GraphicsConsoleComponentNameGetDriverName (
87 IN EFI_COMPONENT_NAME_PROTOCOL *This,
88 IN CHAR8 *Language,
89 OUT CHAR16 **DriverName
90 );
91
92
93 /**
94 Retrieves a Unicode string that is the user readable name of the controller
95 that is being managed by a driver.
96
97 This function retrieves the user readable name of the controller specified by
98 ControllerHandle and ChildHandle in the form of a Unicode string. If the
99 driver specified by This has a user readable name in the language specified by
100 Language, then a pointer to the controller name is returned in ControllerName,
101 and EFI_SUCCESS is returned. If the driver specified by This is not currently
102 managing the controller specified by ControllerHandle and ChildHandle,
103 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
104 support the language specified by Language, then EFI_UNSUPPORTED is returned.
105
106 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
107 EFI_COMPONENT_NAME_PROTOCOL instance.
108
109 @param ControllerHandle[in] The handle of a controller that the driver
110 specified by This is managing. This handle
111 specifies the controller whose name is to be
112 returned.
113
114 @param ChildHandle[in] The handle of the child controller to retrieve
115 the name of. This is an optional parameter that
116 may be NULL. It will be NULL for device
117 drivers. It will also be NULL for a bus drivers
118 that wish to retrieve the name of the bus
119 controller. It will not be NULL for a bus
120 driver that wishes to retrieve the name of a
121 child controller.
122
123 @param Language[in] A pointer to a Null-terminated ASCII string
124 array indicating the language. This is the
125 language of the driver name that the caller is
126 requesting, and it must match one of the
127 languages specified in SupportedLanguages. The
128 number of languages supported by a driver is up
129 to the driver writer. Language is specified in
130 RFC 3066 or ISO 639-2 language code format.
131
132 @param ControllerName[out] A pointer to the Unicode string to return.
133 This Unicode string is the name of the
134 controller specified by ControllerHandle and
135 ChildHandle in the language specified by
136 Language from the point of view of the driver
137 specified by This.
138
139 @retval EFI_SUCCESS The Unicode string for the user readable name in
140 the language specified by Language for the
141 driver specified by This was returned in
142 DriverName.
143
144 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
145
146 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
147 EFI_HANDLE.
148
149 @retval EFI_INVALID_PARAMETER Language is NULL.
150
151 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
152
153 @retval EFI_UNSUPPORTED The driver specified by This is not currently
154 managing the controller specified by
155 ControllerHandle and ChildHandle.
156
157 @retval EFI_UNSUPPORTED The driver specified by This does not support
158 the language specified by Language.
159
160 **/
161 EFI_STATUS
162 EFIAPI
163 GraphicsConsoleComponentNameGetControllerName (
164 IN EFI_COMPONENT_NAME_PROTOCOL *This,
165 IN EFI_HANDLE ControllerHandle,
166 IN EFI_HANDLE ChildHandle OPTIONAL,
167 IN CHAR8 *Language,
168 OUT CHAR16 **ControllerName
169 );
170
171
172 //
173 // Glyph database
174 //
175 //#define GLYPH_WIDTH 8
176 //#define GLYPH_HEIGHT 19
177
178 //
179 // User can define valid graphic resolution here
180 // e.g. 640x480, 800x600, 1024x768...
181 //
182 #define CURRENT_HORIZONTAL_RESOLUTION 800
183 #define CURRENT_VERTICAL_RESOLUTION 600
184
185 typedef union {
186 EFI_NARROW_GLYPH NarrowGlyph;
187 EFI_WIDE_GLYPH WideGlyph;
188 } GLYPH_UNION;
189
190 extern EFI_NARROW_GLYPH UsStdNarrowGlyphData[];
191 extern EFI_WIDE_GLYPH UsStdWideGlyphData[];
192
193 //
194 // Device Structure
195 //
196 #define GRAPHICS_CONSOLE_DEV_SIGNATURE EFI_SIGNATURE_32 ('g', 's', 't', 'o')
197
198 typedef struct {
199 UINTN Columns;
200 UINTN Rows;
201 INTN DeltaX;
202 INTN DeltaY;
203 UINT32 GopWidth;
204 UINT32 GopHeight;
205 UINT32 GopModeNumber;
206 } GRAPHICS_CONSOLE_MODE_DATA;
207
208 #define GRAPHICS_MAX_MODE 4
209
210 typedef struct {
211 UINTN Signature;
212 EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
213 EFI_UGA_DRAW_PROTOCOL *UgaDraw;
214 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SimpleTextOutput;
215 EFI_SIMPLE_TEXT_OUTPUT_MODE SimpleTextOutputMode;
216 GRAPHICS_CONSOLE_MODE_DATA ModeData[GRAPHICS_MAX_MODE];
217 EFI_GRAPHICS_OUTPUT_BLT_PIXEL *LineBuffer;
218 EFI_HII_HANDLE HiiHandle;
219 } GRAPHICS_CONSOLE_DEV;
220
221 #define GRAPHICS_CONSOLE_CON_OUT_DEV_FROM_THIS(a) \
222 CR (a, GRAPHICS_CONSOLE_DEV, SimpleTextOutput, GRAPHICS_CONSOLE_DEV_SIGNATURE)
223
224 //
225 // Global Variables
226 //
227 extern EFI_DRIVER_BINDING_PROTOCOL gGraphicsConsoleDriverBinding;
228
229 //
230 // Prototypes
231 //
232 UINTN
233 ReturnNarrowFontSize (
234 VOID
235 );
236
237 UINTN
238 ReturnWideFontSize (
239 VOID
240 );
241
242 EFI_STATUS
243 EFIAPI
244 GraphicsConsoleConOutReset (
245 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
246 IN BOOLEAN ExtendedVerification
247 );
248
249 EFI_STATUS
250 EFIAPI
251 GraphicsConsoleConOutOutputString (
252 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
253 IN CHAR16 *WString
254 );
255
256 EFI_STATUS
257 EFIAPI
258 GraphicsConsoleConOutTestString (
259 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
260 IN CHAR16 *WString
261 );
262
263 EFI_STATUS
264 EFIAPI
265 GraphicsConsoleConOutQueryMode (
266 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
267 IN UINTN ModeNumber,
268 OUT UINTN *Columns,
269 OUT UINTN *Rows
270 );
271
272 EFI_STATUS
273 EFIAPI
274 GraphicsConsoleConOutSetMode (
275 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
276 IN UINTN ModeNumber
277 );
278
279 EFI_STATUS
280 EFIAPI
281 GraphicsConsoleConOutSetAttribute (
282 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
283 IN UINTN Attribute
284 );
285
286 EFI_STATUS
287 EFIAPI
288 GraphicsConsoleConOutClearScreen (
289 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This
290 );
291
292 EFI_STATUS
293 EFIAPI
294 GraphicsConsoleConOutSetCursorPosition (
295 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
296 IN UINTN Column,
297 IN UINTN Row
298 );
299
300 EFI_STATUS
301 EFIAPI
302 GraphicsConsoleConOutEnableCursor (
303 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
304 IN BOOLEAN Visible
305 );
306
307 EFI_STATUS
308 EFIAPI
309 GraphicsConsoleControllerDriverSupported (
310 IN EFI_DRIVER_BINDING_PROTOCOL *This,
311 IN EFI_HANDLE Controller,
312 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
313 );
314
315 EFI_STATUS
316 EFIAPI
317 GraphicsConsoleControllerDriverStart (
318 IN EFI_DRIVER_BINDING_PROTOCOL *This,
319 IN EFI_HANDLE Controller,
320 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
321 );
322
323 EFI_STATUS
324 EFIAPI
325 GraphicsConsoleControllerDriverStop (
326 IN EFI_DRIVER_BINDING_PROTOCOL *This,
327 IN EFI_HANDLE Controller,
328 IN UINTN NumberOfChildren,
329 IN EFI_HANDLE *ChildHandleBuffer
330 );
331
332 EFI_STATUS
333 EfiLocateHiiProtocol (
334 VOID
335 )
336 ;
337
338
339 #endif