3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. 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
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.
23 #ifndef _GRAPHICS_CONSOLE_H
24 #define _GRAPHICS_CONSOLE_H
27 #include <Protocol/HiiFramework.h>
28 #include <Protocol/SimpleTextOut.h>
29 #include <Protocol/GraphicsOutput.h>
30 #include <Protocol/UgaDraw.h>
31 #include <Protocol/DevicePath.h>
32 #include <Library/DebugLib.h>
33 #include <Library/UefiDriverEntryPoint.h>
34 #include <Library/UefiLib.h>
35 #include <Library/HiiLibFramework.h>
36 #include <Library/BaseMemoryLib.h>
37 #include <Library/MemoryAllocationLib.h>
38 #include <Library/UefiBootServicesTableLib.h>
41 extern EFI_COMPONENT_NAME_PROTOCOL gGraphicsConsoleComponentName
;
42 extern EFI_COMPONENT_NAME2_PROTOCOL gGraphicsConsoleComponentName2
;
45 // EFI Component Name Functions
48 Retrieves a Unicode string that is the user readable name of the driver.
50 This function retrieves the user readable name of a driver in the form of a
51 Unicode string. If the driver specified by This has a user readable name in
52 the language specified by Language, then a pointer to the driver name is
53 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
54 by This does not support the language specified by Language,
55 then EFI_UNSUPPORTED is returned.
57 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
58 EFI_COMPONENT_NAME_PROTOCOL instance.
60 @param Language[in] A pointer to a Null-terminated ASCII string
61 array indicating the language. This is the
62 language of the driver name that the caller is
63 requesting, and it must match one of the
64 languages specified in SupportedLanguages. The
65 number of languages supported by a driver is up
66 to the driver writer. Language is specified
67 in RFC 3066 or ISO 639-2 language code format.
69 @param DriverName[out] A pointer to the Unicode string to return.
70 This Unicode string is the name of the
71 driver specified by This in the language
72 specified by Language.
74 @retval EFI_SUCCESS The Unicode string for the Driver specified by
75 This and the language specified by Language was
76 returned in DriverName.
78 @retval EFI_INVALID_PARAMETER Language is NULL.
80 @retval EFI_INVALID_PARAMETER DriverName is NULL.
82 @retval EFI_UNSUPPORTED The driver specified by This does not support
83 the language specified by Language.
88 GraphicsConsoleComponentNameGetDriverName (
89 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
91 OUT CHAR16
**DriverName
96 Retrieves a Unicode string that is the user readable name of the controller
97 that is being managed by a driver.
99 This function retrieves the user readable name of the controller specified by
100 ControllerHandle and ChildHandle in the form of a Unicode string. If the
101 driver specified by This has a user readable name in the language specified by
102 Language, then a pointer to the controller name is returned in ControllerName,
103 and EFI_SUCCESS is returned. If the driver specified by This is not currently
104 managing the controller specified by ControllerHandle and ChildHandle,
105 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
106 support the language specified by Language, then EFI_UNSUPPORTED is returned.
108 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
109 EFI_COMPONENT_NAME_PROTOCOL instance.
111 @param ControllerHandle[in] The handle of a controller that the driver
112 specified by This is managing. This handle
113 specifies the controller whose name is to be
116 @param ChildHandle[in] The handle of the child controller to retrieve
117 the name of. This is an optional parameter that
118 may be NULL. It will be NULL for device
119 drivers. It will also be NULL for a bus drivers
120 that wish to retrieve the name of the bus
121 controller. It will not be NULL for a bus
122 driver that wishes to retrieve the name of a
125 @param Language[in] A pointer to a Null-terminated ASCII string
126 array indicating the language. This is the
127 language of the driver name that the caller is
128 requesting, and it must match one of the
129 languages specified in SupportedLanguages. The
130 number of languages supported by a driver is up
131 to the driver writer. Language is specified in
132 RFC 3066 or ISO 639-2 language code format.
134 @param ControllerName[out] A pointer to the Unicode string to return.
135 This Unicode string is the name of the
136 controller specified by ControllerHandle and
137 ChildHandle in the language specified by
138 Language from the point of view of the driver
141 @retval EFI_SUCCESS The Unicode string for the user readable name in
142 the language specified by Language for the
143 driver specified by This was returned in
146 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
148 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
151 @retval EFI_INVALID_PARAMETER Language is NULL.
153 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
155 @retval EFI_UNSUPPORTED The driver specified by This is not currently
156 managing the controller specified by
157 ControllerHandle and ChildHandle.
159 @retval EFI_UNSUPPORTED The driver specified by This does not support
160 the language specified by Language.
165 GraphicsConsoleComponentNameGetControllerName (
166 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
167 IN EFI_HANDLE ControllerHandle
,
168 IN EFI_HANDLE ChildHandle OPTIONAL
,
170 OUT CHAR16
**ControllerName
177 #define GLYPH_WIDTH 8
178 #define GLYPH_HEIGHT 19
181 EFI_NARROW_GLYPH NarrowGlyph
;
182 EFI_WIDE_GLYPH WideGlyph
;
185 extern EFI_NARROW_GLYPH UsStdNarrowGlyphData
[];
186 extern EFI_WIDE_GLYPH UsStdWideGlyphData
[];
191 #define GRAPHICS_CONSOLE_DEV_SIGNATURE EFI_SIGNATURE_32 ('g', 's', 't', 'o')
200 UINT32 GopModeNumber
;
201 } GRAPHICS_CONSOLE_MODE_DATA
;
203 #define GRAPHICS_MAX_MODE 3
207 EFI_GRAPHICS_OUTPUT_PROTOCOL
*GraphicsOutput
;
208 EFI_UGA_DRAW_PROTOCOL
*UgaDraw
;
209 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SimpleTextOutput
;
210 EFI_SIMPLE_TEXT_OUTPUT_MODE SimpleTextOutputMode
;
211 GRAPHICS_CONSOLE_MODE_DATA ModeData
[GRAPHICS_MAX_MODE
];
212 EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*LineBuffer
;
213 EFI_HII_HANDLE HiiHandle
;
214 } GRAPHICS_CONSOLE_DEV
;
216 #define GRAPHICS_CONSOLE_CON_OUT_DEV_FROM_THIS(a) \
217 CR (a, GRAPHICS_CONSOLE_DEV, SimpleTextOutput, GRAPHICS_CONSOLE_DEV_SIGNATURE)
222 extern EFI_DRIVER_BINDING_PROTOCOL gGraphicsConsoleDriverBinding
;
228 ReturnNarrowFontSize (
239 GraphicsConsoleConOutReset (
240 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
241 IN BOOLEAN ExtendedVerification
246 GraphicsConsoleConOutOutputString (
247 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
253 GraphicsConsoleConOutTestString (
254 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
260 GraphicsConsoleConOutQueryMode (
261 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
269 GraphicsConsoleConOutSetMode (
270 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
276 GraphicsConsoleConOutSetAttribute (
277 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
283 GraphicsConsoleConOutClearScreen (
284 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
289 GraphicsConsoleConOutSetCursorPosition (
290 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
297 GraphicsConsoleConOutEnableCursor (
298 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
303 EfiLocateHiiProtocol (
309 GraphicsConsoleControllerDriverSupported (
310 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
311 IN EFI_HANDLE Controller
,
312 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
317 GraphicsConsoleControllerDriverStart (
318 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
319 IN EFI_HANDLE Controller
,
320 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
325 GraphicsConsoleControllerDriverStop (
326 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
327 IN EFI_HANDLE Controller
,
328 IN UINTN NumberOfChildren
,
329 IN EFI_HANDLE
*ChildHandleBuffer