OpenCore
1.0.4
OpenCore Bootloader
|
#include "OcConsoleLibInternal.h"
#include <Uefi.h>
#include <Guid/AppleVariable.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/OcConsoleLib.h>
#include <Library/OcMiscLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Protocol/ConsoleControl.h>
#include <Protocol/GraphicsOutput.h>
Go to the source code of this file.
Macros | |
#define | TGT_CHAR_WIDTH ((UINTN)(ISO_CHAR_WIDTH) * mFontScale) |
#define | TGT_CHAR_HEIGHT ((UINTN)(ISO_CHAR_HEIGHT) * mFontScale) |
#define | TGT_CHAR_AREA ((TGT_CHAR_WIDTH) * (TGT_CHAR_HEIGHT)) |
#define | TGT_PADD_WIDTH (mConsolePaddingX) |
#define | TGT_PADD_HEIGHT (mConsolePaddingY) |
#define | TGT_CURSOR_X mFontScale |
#define | TGT_CURSOR_Y ((TGT_CHAR_HEIGHT) - mFontScale) |
#define | TGT_CURSOR_WIDTH ((TGT_CHAR_WIDTH) - mFontScale * 2) |
#define | TGT_CURSOR_HEIGHT (mFontScale) |
#define | MIN_SUPPORTED_CONSOLE_WIDTH (80) |
#define | MIN_SUPPORTED_CONSOLE_HEIGHT (25) |
Functions | |
STATIC EFI_STATUS | GetConsoleFontCharInfo (IN OC_CONSOLE_FONT *ConsoleFont, IN CHAR16 Char, OUT OC_CONSOLE_FONT_PAGE **Page, OUT UINT8 *GlyphIndex, IN BOOLEAN UseFallback) |
BOOLEAN | OcConsoleFontContainsChar (IN OC_CONSOLE_FONT *ConsoleFont, IN CHAR16 Char) |
STATIC VOID | RenderChar (IN CHAR16 Char, IN UINTN PosX, IN UINTN PosY) |
STATIC VOID | FlushCursor (IN BOOLEAN Enabled, IN UINTN PosX, IN UINTN PosY) |
STATIC VOID | RenderScroll (VOID) |
STATIC EFI_STATUS | RenderResync (IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This) |
STATIC EFI_STATUS EFIAPI | AsciiTextResetEx (IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN BOOLEAN ExtendedVerification, IN BOOLEAN Debug) |
STATIC EFI_STATUS EFIAPI | AsciiTextReset (IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN BOOLEAN ExtendedVerification) |
STATIC EFI_STATUS EFIAPI | AsciiTextOutputString (IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN CHAR16 *String) |
STATIC EFI_STATUS EFIAPI | AsciiTextTestString (IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN CHAR16 *String) |
STATIC EFI_STATUS EFIAPI | AsciiTextQueryMode (IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN UINTN ModeNumber, OUT UINTN *Columns, OUT UINTN *Rows) |
STATIC EFI_STATUS EFIAPI | AsciiTextSetMode (IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN UINTN ModeNumber) |
STATIC EFI_STATUS EFIAPI | AsciiTextSetAttribute (IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN UINTN Attribute) |
STATIC EFI_STATUS EFIAPI | AsciiTextClearScreen (IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This) |
STATIC EFI_STATUS EFIAPI | AsciiTextSetCursorPosition (IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN UINTN Column, IN UINTN Row) |
STATIC EFI_STATUS EFIAPI | AsciiTextEnableCursor (IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN BOOLEAN Visible) |
STATIC EFI_STATUS EFIAPI | ConsoleControlGetMode (IN EFI_CONSOLE_CONTROL_PROTOCOL *This, OUT EFI_CONSOLE_CONTROL_SCREEN_MODE *Mode, OUT BOOLEAN *GopUgaExists OPTIONAL, OUT BOOLEAN *StdInLocked OPTIONAL) |
STATIC EFI_STATUS EFIAPI | ConsoleControlSetMode (IN EFI_CONSOLE_CONTROL_PROTOCOL *This, IN EFI_CONSOLE_CONTROL_SCREEN_MODE Mode) |
STATIC EFI_STATUS EFIAPI | ConsoleControlLockStdIn (IN EFI_CONSOLE_CONTROL_PROTOCOL *This, IN CHAR16 *Password) |
EFI_STATUS | OcUseBuiltinTextOutput (IN EFI_CONSOLE_CONTROL_SCREEN_MODE InitialMode, IN OC_STORAGE_CONTEXT *Storage OPTIONAL, IN CONST CHAR8 *Font OPTIONAL, IN EFI_CONSOLE_CONTROL_SCREEN_MODE Mode, IN UINT32 Width, IN UINT32 Height) |
Variables | |
STATIC BOOLEAN | mIsDefaultFont |
STATIC OC_CONSOLE_FONT * | mConsoleFont |
STATIC UINT32 | mGraphicsEfiColors [16] |
STATIC EFI_GRAPHICS_OUTPUT_PROTOCOL * | mGraphicsOutput |
STATIC UINTN | mConsolePaddingX |
STATIC UINTN | mConsolePaddingY |
STATIC UINTN | mUserWidth |
STATIC UINTN | mUserHeight |
STATIC UINTN | mConsoleWidth |
STATIC UINTN | mConsoleHeight |
STATIC UINTN | mConsoleMaxPosX |
STATIC UINTN | mConsoleMaxPosY |
STATIC BOOLEAN | mConsoleUncontrolled |
STATIC UINTN | mPrivateColumn |
At least UEFI Shell trashes Mode values. | |
STATIC UINTN | mPrivateRow |
At least UEFI Shell trashes Mode values. | |
STATIC UINT32 | mConsoleGopMode |
STATIC UINT8 | mUIScale |
STATIC UINT8 | mFontScale |
STATIC EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION | mBackgroundColor |
STATIC EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION | mForegroundColor |
STATIC EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION * | mCharacterBuffer |
STATIC EFI_CONSOLE_CONTROL_SCREEN_MODE | mConsoleMode = EfiConsoleControlScreenText |
STATIC EFI_SIMPLE_TEXT_OUTPUT_MODE | mAsciiTextOutputMode |
STATIC EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL | mAsciiTextOutputProtocol |
STATIC EFI_CONSOLE_CONTROL_PROTOCOL | mConsoleControlProtocol |
Copyright (C) 2020, vit9696. All rights reserved.
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.
Definition in file TextOutputBuiltin.c.
#define MIN_SUPPORTED_CONSOLE_HEIGHT (25) |
Definition at line 83 of file TextOutputBuiltin.c.
#define MIN_SUPPORTED_CONSOLE_WIDTH (80) |
Definition at line 82 of file TextOutputBuiltin.c.
#define TGT_CHAR_AREA ((TGT_CHAR_WIDTH) * (TGT_CHAR_HEIGHT)) |
Definition at line 74 of file TextOutputBuiltin.c.
#define TGT_CHAR_HEIGHT ((UINTN)(ISO_CHAR_HEIGHT) * mFontScale) |
Definition at line 73 of file TextOutputBuiltin.c.
#define TGT_CHAR_WIDTH ((UINTN)(ISO_CHAR_WIDTH) * mFontScale) |
Definition at line 72 of file TextOutputBuiltin.c.
#define TGT_CURSOR_HEIGHT (mFontScale) |
Definition at line 80 of file TextOutputBuiltin.c.
#define TGT_CURSOR_WIDTH ((TGT_CHAR_WIDTH) - mFontScale * 2) |
Definition at line 79 of file TextOutputBuiltin.c.
#define TGT_CURSOR_X mFontScale |
Definition at line 77 of file TextOutputBuiltin.c.
#define TGT_CURSOR_Y ((TGT_CHAR_HEIGHT) - mFontScale) |
Definition at line 78 of file TextOutputBuiltin.c.
#define TGT_PADD_HEIGHT (mConsolePaddingY) |
Definition at line 76 of file TextOutputBuiltin.c.
#define TGT_PADD_WIDTH (mConsolePaddingX) |
Definition at line 75 of file TextOutputBuiltin.c.
STATIC EFI_STATUS EFIAPI AsciiTextClearScreen | ( | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * | This | ) |
Definition at line 795 of file TextOutputBuiltin.c.
STATIC EFI_STATUS EFIAPI AsciiTextEnableCursor | ( | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * | This, |
IN BOOLEAN | Visible ) |
Definition at line 946 of file TextOutputBuiltin.c.
STATIC EFI_STATUS EFIAPI AsciiTextOutputString | ( | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * | This, |
IN CHAR16 * | String ) |
Definition at line 547 of file TextOutputBuiltin.c.
STATIC EFI_STATUS EFIAPI AsciiTextQueryMode | ( | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * | This, |
IN UINTN | ModeNumber, | ||
OUT UINTN * | Columns, | ||
OUT UINTN * | Rows ) |
Definition at line 676 of file TextOutputBuiltin.c.
STATIC EFI_STATUS EFIAPI AsciiTextReset | ( | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * | This, |
IN BOOLEAN | ExtendedVerification ) |
Definition at line 533 of file TextOutputBuiltin.c.
STATIC EFI_STATUS EFIAPI AsciiTextResetEx | ( | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * | This, |
IN BOOLEAN | ExtendedVerification, | ||
IN BOOLEAN | Debug ) |
Definition at line 484 of file TextOutputBuiltin.c.
STATIC EFI_STATUS EFIAPI AsciiTextSetAttribute | ( | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * | This, |
IN UINTN | Attribute ) |
Definition at line 739 of file TextOutputBuiltin.c.
STATIC EFI_STATUS EFIAPI AsciiTextSetCursorPosition | ( | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * | This, |
IN UINTN | Column, | ||
IN UINTN | Row ) |
Definition at line 892 of file TextOutputBuiltin.c.
STATIC EFI_STATUS EFIAPI AsciiTextSetMode | ( | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * | This, |
IN UINTN | ModeNumber ) |
Definition at line 712 of file TextOutputBuiltin.c.
STATIC EFI_STATUS EFIAPI AsciiTextTestString | ( | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * | This, |
IN CHAR16 * | String ) |
Definition at line 661 of file TextOutputBuiltin.c.
STATIC EFI_STATUS EFIAPI ConsoleControlGetMode | ( | IN EFI_CONSOLE_CONTROL_PROTOCOL * | This, |
OUT EFI_CONSOLE_CONTROL_SCREEN_MODE * | Mode, | ||
OUT BOOLEAN *GopUgaExists | OPTIONAL, | ||
OUT BOOLEAN *StdInLocked | OPTIONAL ) |
Definition at line 993 of file TextOutputBuiltin.c.
STATIC EFI_STATUS EFIAPI ConsoleControlLockStdIn | ( | IN EFI_CONSOLE_CONTROL_PROTOCOL * | This, |
IN CHAR16 * | Password ) |
Definition at line 1040 of file TextOutputBuiltin.c.
STATIC EFI_STATUS EFIAPI ConsoleControlSetMode | ( | IN EFI_CONSOLE_CONTROL_PROTOCOL * | This, |
IN EFI_CONSOLE_CONTROL_SCREEN_MODE | Mode ) |
Definition at line 1016 of file TextOutputBuiltin.c.
STATIC VOID FlushCursor | ( | IN BOOLEAN | Enabled, |
IN UINTN | PosX, | ||
IN UINTN | PosY ) |
Swap cursor visibility onscreen.
[in] | Enabled | Whether cursor is visible. |
[in] | PosX | Character X position. |
[in] | PosY | Character Y position. |
Definition at line 289 of file TextOutputBuiltin.c.
STATIC EFI_STATUS GetConsoleFontCharInfo | ( | IN OC_CONSOLE_FONT * | ConsoleFont, |
IN CHAR16 | Char, | ||
OUT OC_CONSOLE_FONT_PAGE ** | Page, | ||
OUT UINT8 * | GlyphIndex, | ||
IN BOOLEAN | UseFallback ) |
[in] | ConsoleFont | Font to use. |
[in] | Char | Char for which to find information. |
[out] | Page | Font page in which char (or fallback char) is found. |
[out] | GlyphIndex | Index to glyph for char (or fallback char). |
[in] | UseFallback | Whether to use fallback char if char is not found. |
EFI_SUCCESS | Successfully returned font data for character. |
EFI_WARN_UNKNOWN_GLYPH | Returned font data for fallback character because requested character was not in font. |
EFI_LOAD_ERROR | No valid font data returned. Will only occur in abnormal circumstances (namely, broken font data), or when UseFallback is FALSE. |
< NB EFI_WARN_... are not errors
Definition at line 100 of file TextOutputBuiltin.c.
BOOLEAN OcConsoleFontContainsChar | ( | IN OC_CONSOLE_FONT * | ConsoleFont, |
IN CHAR16 | Char ) |
Definition at line 172 of file TextOutputBuiltin.c.
EFI_STATUS OcUseBuiltinTextOutput | ( | IN EFI_CONSOLE_CONTROL_SCREEN_MODE | InitialMode, |
IN OC_STORAGE_CONTEXT *Storage | OPTIONAL, | ||
IN CONST CHAR8 *Font | OPTIONAL, | ||
IN EFI_CONSOLE_CONTROL_SCREEN_MODE | Mode, | ||
IN UINT32 | Width, | ||
IN UINT32 | Height ) |
< Produces o/p using old, uncontrolled text protocol
< Prepare new text protocol (sets new font size, clears screen)
< Install new text protocol
Definition at line 1057 of file TextOutputBuiltin.c.
STATIC VOID RenderChar | ( | IN CHAR16 | Char, |
IN UINTN | PosX, | ||
IN UINTN | PosY ) |
Render character onscreen.
[in] | Char | Character code. |
[in] | PosX | Character X position. |
[in] | PosY | Character Y position. |
Definition at line 195 of file TextOutputBuiltin.c.
STATIC EFI_STATUS RenderResync | ( | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * | This | ) |
Definition at line 390 of file TextOutputBuiltin.c.
STATIC VOID RenderScroll | ( | VOID | ) |
Definition at line 345 of file TextOutputBuiltin.c.
STATIC EFI_SIMPLE_TEXT_OUTPUT_MODE mAsciiTextOutputMode |
Definition at line 973 of file TextOutputBuiltin.c.
STATIC EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL mAsciiTextOutputProtocol |
Definition at line 977 of file TextOutputBuiltin.c.
STATIC EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION mBackgroundColor |
Definition at line 67 of file TextOutputBuiltin.c.
STATIC EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION* mCharacterBuffer |
Definition at line 69 of file TextOutputBuiltin.c.
STATIC EFI_CONSOLE_CONTROL_PROTOCOL mConsoleControlProtocol |
Definition at line 1050 of file TextOutputBuiltin.c.
STATIC OC_CONSOLE_FONT* mConsoleFont |
Definition at line 31 of file TextOutputBuiltin.c.
STATIC UINT32 mConsoleGopMode |
Definition at line 64 of file TextOutputBuiltin.c.
STATIC UINTN mConsoleHeight |
Definition at line 58 of file TextOutputBuiltin.c.
STATIC UINTN mConsoleMaxPosX |
Definition at line 59 of file TextOutputBuiltin.c.
STATIC UINTN mConsoleMaxPosY |
Definition at line 60 of file TextOutputBuiltin.c.
STATIC EFI_CONSOLE_CONTROL_SCREEN_MODE mConsoleMode = EfiConsoleControlScreenText |
Definition at line 70 of file TextOutputBuiltin.c.
STATIC UINTN mConsolePaddingX |
Definition at line 53 of file TextOutputBuiltin.c.
STATIC UINTN mConsolePaddingY |
Definition at line 54 of file TextOutputBuiltin.c.
STATIC BOOLEAN mConsoleUncontrolled |
Definition at line 61 of file TextOutputBuiltin.c.
STATIC UINTN mConsoleWidth |
Definition at line 57 of file TextOutputBuiltin.c.
STATIC UINT8 mFontScale |
Definition at line 66 of file TextOutputBuiltin.c.
STATIC EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION mForegroundColor |
Definition at line 68 of file TextOutputBuiltin.c.
STATIC UINT32 mGraphicsEfiColors[16] |
Definition at line 33 of file TextOutputBuiltin.c.
STATIC EFI_GRAPHICS_OUTPUT_PROTOCOL* mGraphicsOutput |
Definition at line 52 of file TextOutputBuiltin.c.
STATIC BOOLEAN mIsDefaultFont |
Definition at line 30 of file TextOutputBuiltin.c.
STATIC UINTN mPrivateColumn |
At least UEFI Shell trashes Mode values.
Definition at line 62 of file TextOutputBuiltin.c.
STATIC UINTN mPrivateRow |
At least UEFI Shell trashes Mode values.
Definition at line 63 of file TextOutputBuiltin.c.
STATIC UINT8 mUIScale |
Definition at line 65 of file TextOutputBuiltin.c.
STATIC UINTN mUserHeight |
Definition at line 56 of file TextOutputBuiltin.c.
STATIC UINTN mUserWidth |
Definition at line 55 of file TextOutputBuiltin.c.