MdePkg/Library/UefiLib/Console.c File Reference


Defines

#define NARROW_CHAR   0xFFF0
#define WIDE_CHAR   0xFFF1

Functions

UINTN EFIAPI GetGlyphWidth (IN CHAR16 UnicodeChar)
UINTN EFIAPI UnicodeStringDisplayLength (IN CONST CHAR16 *String)
UINTN UefiLibGetStringWidth (IN CHAR16 *String, IN BOOLEAN LimitLen, IN UINTN MaxWidth, OUT UINTN *Offset)
VOID EFIAPI CreatePopUp (IN UINTN Attribute, OUT EFI_INPUT_KEY *Key,...)

Variables

GLOBAL_REMOVE_IF_UNREFERENCED
CONST UNICODE_WIDTH_ENTRY 
mUnicodeWidthTable []

Detailed Description

This module provide help function for displaying unicode string.

Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php.

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.


Define Documentation

#define NARROW_CHAR   0xFFF0

Referenced by UefiLibGetStringWidth().

#define WIDE_CHAR   0xFFF1

Referenced by UefiLibGetStringWidth().


Function Documentation

VOID EFIAPI CreatePopUp ( IN UINTN  Attribute,
OUT EFI_INPUT_KEY Key,
  ... 
)

Draws a dialog box to the console output device specified by ConOut defined in the EFI_SYSTEM_TABLE and waits for a keystroke from the console input device specified by ConIn defined in the EFI_SYSTEM_TABLE.

If there are no strings in the variable argument list, then ASSERT(). If all the strings in the variable argument list are empty, then ASSERT().

Parameters:
[in] Attribute Specifies the foreground and background color of the popup.
[out] Key A pointer to the EFI_KEY value of the key that was pressed. This is an optional parameter that may be NULL. If it is NULL then no wait for a keypress will be performed.
[in] ... The variable argument list that contains pointers to Null- terminated Unicode strings to display in the dialog box. The variable argument list is terminated by a NULL.

References AllocateZeroPool(), ASSERT, EFI_SIMPLE_TEXT_OUTPUT_MODE::Attribute, BOXDRAW_DOWN_LEFT, BOXDRAW_DOWN_RIGHT, BOXDRAW_HORIZONTAL, BOXDRAW_UP_LEFT, BOXDRAW_UP_RIGHT, BOXDRAW_VERTICAL, EFI_SYSTEM_TABLE::ConIn, EFI_SYSTEM_TABLE::ConOut, CopyMem(), EFI_SIMPLE_TEXT_OUTPUT_MODE::CursorColumn, EFI_SIMPLE_TEXT_OUTPUT_MODE::CursorRow, EFI_SIMPLE_TEXT_OUTPUT_MODE::CursorVisible, EFI_ERROR, EFI_NOT_READY, _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL::EnableCursor, FALSE, FreePool(), gBS, gST, MAX, MIN, EFI_SIMPLE_TEXT_OUTPUT_MODE::Mode, _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL::Mode, NULL, _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL::OutputString, _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL::QueryMode, _EFI_SIMPLE_TEXT_INPUT_PROTOCOL::ReadKeyStroke, _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL::SetAttribute, _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL::SetCursorPosition, SetMem16(), StrCatS(), StrnCpyS(), TRUE, UefiLibGetStringWidth(), VA_ARG, VA_END, VA_START, EFI_BOOT_SERVICES::WaitForEvent, and _EFI_SIMPLE_TEXT_INPUT_PROTOCOL::WaitForKey.

UINTN EFIAPI GetGlyphWidth ( IN CHAR16  UnicodeChar  ) 

Retrieves the width of a Unicode character.

This function computes and returns the width of the Unicode character specified by UnicodeChar.

Parameters:
UnicodeChar A Unicode character.
Return values:
0 The width if UnicodeChar could not be determined.
1 UnicodeChar is a narrow glyph.
2 UnicodeChar is a wide glyph.

References CONST, mUnicodeWidthTable, and NULL.

Referenced by UnicodeStringDisplayLength().

UINTN UefiLibGetStringWidth ( IN CHAR16 String,
IN BOOLEAN  LimitLen,
IN UINTN  MaxWidth,
OUT UINTN *  Offset 
)

Count the storage space of a Unicode string.

This function handles the Unicode string with NARROW_CHAR and WIDE_CHAR control characters. NARROW_HCAR and WIDE_CHAR does not count in the resultant output. If a WIDE_CHAR is hit, then 2 Unicode character will consume an output storage space with size of CHAR16 till a NARROW_CHAR is hit.

Parameters:
String The input string to be counted.
LimitLen Whether need to limit the string length.
MaxWidth The max length this function supported.
Offset The max index of the string can be show out.
Returns:
Storage space for the input string.

References NARROW_CHAR, NULL, and WIDE_CHAR.

Referenced by CreatePopUp().

UINTN EFIAPI UnicodeStringDisplayLength ( IN CONST CHAR16 String  ) 

Computes the display length of a Null-terminated Unicode String.

This function computes and returns the display length of the Null-terminated Unicode string specified by String. If String is NULL then 0 is returned. If any of the widths of the Unicode characters in String can not be determined, then 0 is returned. The display width of String can be computed by summing the display widths of each Unicode character in String. Unicode characters that are narrow glyphs have a width of 1, and Unicode characters that are width glyphs have a width of 2. If String is not aligned on a 16-bit boundary, then ASSERT().

Parameters:
String A pointer to a Null-terminated Unicode string.
Returns:
The display length of the Null-terminated Unicode string specified by String.

References GetGlyphWidth(), and NULL.


Variable Documentation

GLOBAL_REMOVE_IF_UNREFERENCED CONST UNICODE_WIDTH_ENTRY mUnicodeWidthTable[]

Referenced by GetGlyphWidth().


Generated on Thu Sep 24 23:14:24 2015 for MdePkg[ALL] by  doxygen 1.5.7.1