TianoCore EDK2 master
Loading...
Searching...
No Matches
Console.c File Reference
#include "UefiLibInternal.h"

Go to the source code of this file.

Data Structures

struct  UNICODE_WIDTH_ENTRY
 

Macros

#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 OPTIONAL,...)
 

Variables

GLOBAL_REMOVE_IF_UNREFERENCED CONST UNICODE_WIDTH_ENTRY mUnicodeWidthTable []
 

Detailed Description

This module provide help function for displaying unicode string.

Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Console.c.

Macro Definition Documentation

◆ NARROW_CHAR

#define NARROW_CHAR   0xFFF0

Definition at line 16 of file Console.c.

◆ WIDE_CHAR

#define WIDE_CHAR   0xFFF1

Definition at line 17 of file Console.c.

Function Documentation

◆ CreatePopUp()

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

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]AttributeSpecifies the foreground and background color of the popup.
[out]KeyA 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.

Definition at line 393 of file Console.c.

◆ GetGlyphWidth()

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
UnicodeCharA Unicode character.
Return values
0The width if UnicodeChar could not be determined.
1UnicodeChar is a narrow glyph.
2UnicodeChar is a wide glyph.

Definition at line 205 of file Console.c.

◆ UefiLibGetStringWidth()

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
StringThe input string to be counted.
LimitLenWhether need to limit the string length.
MaxWidthThe max length this function supported.
OffsetThe max index of the string can be show out.
Returns
Storage space for the input string.

Definition at line 308 of file Console.c.

◆ UnicodeStringDisplayLength()

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
StringA pointer to a Null-terminated Unicode string.
Returns
The display length of the Null-terminated Unicode string specified by String.

Definition at line 265 of file Console.c.

Variable Documentation

◆ mUnicodeWidthTable

Definition at line 19 of file Console.c.