Rollback patch 14537 & 14538, because patch 14537 is not tested by Laszlo Ersek, but i wrote it.
Signed-off-by: Eric Dong <eric.dong@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14539 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -1,66 +0,0 @@
|
||||
## @file
|
||||
# The DXE driver produces FORM BROWSER protocols defined in UEFI HII 2.1 specificatin.
|
||||
#
|
||||
# Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
#
|
||||
##
|
||||
|
||||
[Defines]
|
||||
INF_VERSION = 0x00010005
|
||||
BASE_NAME = DisplayEngine
|
||||
FILE_GUID = E660EA85-058E-4b55-A54B-F02F83A24707
|
||||
MODULE_TYPE = DXE_DRIVER
|
||||
VERSION_STRING = 1.0
|
||||
ENTRY_POINT = InitializeDisplayEngine
|
||||
UNLOAD_IMAGE = UnloadDisplayEngine
|
||||
#
|
||||
# The following information is for reference only and not required by the build tools.
|
||||
#
|
||||
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
|
||||
#
|
||||
|
||||
[Sources]
|
||||
FormDisplayStr.uni
|
||||
FormDisplay.c
|
||||
FormDisplay.h
|
||||
ProcessOptions.c
|
||||
InputHandler.c
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
UefiDriverEntryPoint
|
||||
UefiBootServicesTableLib
|
||||
DebugLib
|
||||
BaseMemoryLib
|
||||
BaseLib
|
||||
PrintLib
|
||||
HiiLib
|
||||
MemoryAllocationLib
|
||||
CustomizedDisplayLib
|
||||
|
||||
[Protocols]
|
||||
gEdkiiFormDisplayEngineProtocolGuid
|
||||
gEdkiiFormBrowserEx2ProtocolGuid
|
||||
|
||||
[Guids]
|
||||
gEfiIfrTianoGuid ## CONSUMES ## GUID
|
||||
|
||||
[Depex]
|
||||
gEfiHiiDatabaseProtocolGuid AND gEfiHiiConfigRoutingProtocolGuid AND gEdkiiFormBrowserEx2ProtocolGuid
|
||||
|
||||
[FeaturePcd]
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserGrayOutTextStatement ## CONSUMES
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowerGrayOutReadOnlyMenu ## CONSUMES
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,589 +0,0 @@
|
||||
/** @file
|
||||
FormDiplay protocol to show Form
|
||||
|
||||
Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials are licensed and made available under
|
||||
the terms and conditions of the BSD License that 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.
|
||||
|
||||
**/
|
||||
|
||||
#ifndef __FORM_DISPLAY_H__
|
||||
#define __FORM_DISPLAY_H__
|
||||
|
||||
|
||||
#include <Library/UefiBootServicesTableLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/HiiLib.h>
|
||||
#include <Library/MemoryAllocationLib.h>
|
||||
#include <Library/PrintLib.h>
|
||||
#include <Library/CustomizedDisplayLib.h>
|
||||
|
||||
#include <Protocol/FormBrowserEx2.h>
|
||||
#include <Protocol/SimpleTextIn.h>
|
||||
#include <Protocol/DisplayProtocol.h>
|
||||
|
||||
#include <Guid/MdeModuleHii.h>
|
||||
|
||||
//
|
||||
// This is the generated header file which includes whatever needs to be exported (strings + IFR)
|
||||
//
|
||||
extern UINT8 DisplayEngineStrings[];
|
||||
extern EFI_SCREEN_DESCRIPTOR gStatementDimensions;
|
||||
extern USER_INPUT *gUserInput;
|
||||
extern FORM_DISPLAY_ENGINE_FORM *gFormData;
|
||||
extern EFI_HII_HANDLE gHiiHandle;
|
||||
extern UINT16 gDirection;
|
||||
extern LIST_ENTRY gMenuOption;
|
||||
|
||||
//
|
||||
// Browser Global Strings
|
||||
//
|
||||
extern CHAR16 *gSaveFailed;
|
||||
extern CHAR16 *gPromptForData;
|
||||
extern CHAR16 *gPromptForPassword;
|
||||
extern CHAR16 *gPromptForNewPassword;
|
||||
extern CHAR16 *gConfirmPassword;
|
||||
extern CHAR16 *gConfirmError;
|
||||
extern CHAR16 *gPassowordInvalid;
|
||||
extern CHAR16 *gPressEnter;
|
||||
extern CHAR16 *gEmptyString;
|
||||
extern CHAR16 *gMiniString;
|
||||
extern CHAR16 *gOptionMismatch;
|
||||
extern CHAR16 *gFormSuppress;
|
||||
extern CHAR16 *gProtocolNotFound;
|
||||
|
||||
extern CHAR16 gPromptBlockWidth;
|
||||
extern CHAR16 gOptionBlockWidth;
|
||||
extern CHAR16 gHelpBlockWidth;
|
||||
extern CHAR16 *mUnknownString;
|
||||
|
||||
//
|
||||
// Screen definitions
|
||||
//
|
||||
|
||||
#define LEFT_SKIPPED_COLUMNS 3
|
||||
#define SCROLL_ARROW_HEIGHT 1
|
||||
#define POPUP_PAD_SPACE_COUNT 5
|
||||
#define POPUP_FRAME_WIDTH 2
|
||||
|
||||
//
|
||||
// Display definitions
|
||||
//
|
||||
#define LEFT_ONEOF_DELIMITER L'<'
|
||||
#define RIGHT_ONEOF_DELIMITER L'>'
|
||||
|
||||
#define LEFT_NUMERIC_DELIMITER L'['
|
||||
#define RIGHT_NUMERIC_DELIMITER L']'
|
||||
|
||||
#define LEFT_CHECKBOX_DELIMITER L'['
|
||||
#define RIGHT_CHECKBOX_DELIMITER L']'
|
||||
|
||||
#define CHECK_ON L'X'
|
||||
#define CHECK_OFF L' '
|
||||
|
||||
#define TIME_SEPARATOR L':'
|
||||
#define DATE_SEPARATOR L'/'
|
||||
|
||||
#define SUBTITLE_INDENT 2
|
||||
|
||||
//
|
||||
// This is the Input Error Message
|
||||
//
|
||||
#define INPUT_ERROR 1
|
||||
|
||||
//
|
||||
// This is the NV RAM update required Message
|
||||
//
|
||||
#define NV_UPDATE_REQUIRED 2
|
||||
//
|
||||
// Time definitions
|
||||
//
|
||||
#define ONE_SECOND 10000000
|
||||
|
||||
//
|
||||
// It take 23 characters including the NULL to print a 64 bits number with "[" and "]".
|
||||
// pow(2, 64) = [18446744073709551616]
|
||||
//
|
||||
#define MAX_NUMERIC_INPUT_WIDTH 23
|
||||
|
||||
#define EFI_HII_EXPRESSION_INCONSISTENT_IF 0
|
||||
#define EFI_HII_EXPRESSION_NO_SUBMIT_IF 1
|
||||
#define EFI_HII_EXPRESSION_GRAY_OUT_IF 2
|
||||
#define EFI_HII_EXPRESSION_SUPPRESS_IF 3
|
||||
#define EFI_HII_EXPRESSION_DISABLE_IF 4
|
||||
|
||||
//
|
||||
// Character definitions
|
||||
//
|
||||
#define CHAR_SPACE 0x0020
|
||||
|
||||
#define FORM_DISPLAY_DRIVER_SIGNATURE SIGNATURE_32 ('F', 'D', 'D', 'V')
|
||||
typedef struct {
|
||||
UINT32 Signature;
|
||||
|
||||
EFI_HANDLE Handle;
|
||||
|
||||
//
|
||||
// Produced protocol
|
||||
//
|
||||
EDKII_FORM_DISPLAY_ENGINE_PROTOCOL FromDisplayProt;
|
||||
} FORM_DISPLAY_DRIVER_PRIVATE_DATA;
|
||||
|
||||
|
||||
typedef enum {
|
||||
UiNoOperation,
|
||||
UiSelect,
|
||||
UiUp,
|
||||
UiDown,
|
||||
UiLeft,
|
||||
UiRight,
|
||||
UiReset,
|
||||
UiPrevious,
|
||||
UiPageUp,
|
||||
UiPageDown,
|
||||
UiHotKey,
|
||||
UiMaxOperation
|
||||
} UI_SCREEN_OPERATION;
|
||||
|
||||
typedef enum {
|
||||
CfInitialization,
|
||||
CfCheckSelection,
|
||||
CfRepaint,
|
||||
CfRefreshHighLight,
|
||||
CfUpdateHelpString,
|
||||
CfPrepareToReadKey,
|
||||
CfReadKey,
|
||||
CfScreenOperation,
|
||||
CfUiSelect,
|
||||
CfUiReset,
|
||||
CfUiLeft,
|
||||
CfUiRight,
|
||||
CfUiUp,
|
||||
CfUiPageUp,
|
||||
CfUiPageDown,
|
||||
CfUiDown,
|
||||
CfUiDefault,
|
||||
CfUiNoOperation,
|
||||
CfExit,
|
||||
CfUiHotKey,
|
||||
CfMaxControlFlag
|
||||
} UI_CONTROL_FLAG;
|
||||
|
||||
typedef enum {
|
||||
UIEventNone,
|
||||
UIEventKey,
|
||||
UIEventTimeOut,
|
||||
UIEventDriver
|
||||
} UI_EVENT_TYPE;
|
||||
|
||||
typedef struct {
|
||||
UINT16 ScanCode;
|
||||
UI_SCREEN_OPERATION ScreenOperation;
|
||||
} SCAN_CODE_TO_SCREEN_OPERATION;
|
||||
|
||||
typedef struct {
|
||||
UI_SCREEN_OPERATION ScreenOperation;
|
||||
UI_CONTROL_FLAG ControlFlag;
|
||||
} SCREEN_OPERATION_T0_CONTROL_FLAG;
|
||||
|
||||
typedef struct {
|
||||
EFI_QUESTION_ID QuestionId;
|
||||
UINT16 DisplayRow;
|
||||
} DISPLAY_HIGHLIGHT_MENU_INFO;
|
||||
|
||||
#define UI_MENU_OPTION_SIGNATURE SIGNATURE_32 ('u', 'i', 'm', 'm')
|
||||
|
||||
typedef struct {
|
||||
UINTN Signature;
|
||||
LIST_ENTRY Link;
|
||||
|
||||
EFI_HII_HANDLE Handle;
|
||||
FORM_DISPLAY_ENGINE_STATEMENT *ThisTag;
|
||||
UINT16 EntryNumber;
|
||||
|
||||
UINTN Row;
|
||||
UINTN Col;
|
||||
UINTN OptCol;
|
||||
CHAR16 *Description;
|
||||
UINTN Skip; // Number of lines
|
||||
|
||||
//
|
||||
// Display item sequence for date/time
|
||||
// Date: Month/Day/Year
|
||||
// Sequence: 0 1 2
|
||||
//
|
||||
// Time: Hour : Minute : Second
|
||||
// Sequence: 0 1 2
|
||||
//
|
||||
//
|
||||
UINTN Sequence;
|
||||
|
||||
BOOLEAN GrayOut;
|
||||
BOOLEAN ReadOnly;
|
||||
|
||||
//
|
||||
// Whether user could change value of this item
|
||||
//
|
||||
BOOLEAN IsQuestion;
|
||||
BOOLEAN NestInStatement;
|
||||
} UI_MENU_OPTION;
|
||||
|
||||
#define MENU_OPTION_FROM_LINK(a) CR (a, UI_MENU_OPTION, Link, UI_MENU_OPTION_SIGNATURE)
|
||||
|
||||
/**
|
||||
Print Question Value according to it's storage width and display attributes.
|
||||
|
||||
@param Question The Question to be printed.
|
||||
@param FormattedNumber Buffer for output string.
|
||||
@param BufferSize The FormattedNumber buffer size in bytes.
|
||||
|
||||
@retval EFI_SUCCESS Print success.
|
||||
@retval EFI_BUFFER_TOO_SMALL Buffer size is not enough for formatted number.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
PrintFormattedNumber (
|
||||
IN FORM_DISPLAY_ENGINE_STATEMENT *Question,
|
||||
IN OUT CHAR16 *FormattedNumber,
|
||||
IN UINTN BufferSize
|
||||
);
|
||||
|
||||
/**
|
||||
Set value of a data element in an Array by its Index.
|
||||
|
||||
@param Array The data array.
|
||||
@param Type Type of the data in this array.
|
||||
@param Index Zero based index for data in this array.
|
||||
@param Value The value to be set.
|
||||
|
||||
**/
|
||||
VOID
|
||||
SetArrayData (
|
||||
IN VOID *Array,
|
||||
IN UINT8 Type,
|
||||
IN UINTN Index,
|
||||
IN UINT64 Value
|
||||
);
|
||||
|
||||
/**
|
||||
Return data element in an Array by its Index.
|
||||
|
||||
@param Array The data array.
|
||||
@param Type Type of the data in this array.
|
||||
@param Index Zero based index for data in this array.
|
||||
|
||||
@retval Value The data to be returned
|
||||
|
||||
**/
|
||||
UINT64
|
||||
GetArrayData (
|
||||
IN VOID *Array,
|
||||
IN UINT8 Type,
|
||||
IN UINTN Index
|
||||
);
|
||||
|
||||
/**
|
||||
Search an Option of a Question by its value.
|
||||
|
||||
@param Question The Question
|
||||
@param OptionValue Value for Option to be searched.
|
||||
|
||||
@retval Pointer Pointer to the found Option.
|
||||
@retval NULL Option not found.
|
||||
|
||||
**/
|
||||
DISPLAY_QUESTION_OPTION *
|
||||
ValueToOption (
|
||||
IN FORM_DISPLAY_ENGINE_STATEMENT *Question,
|
||||
IN EFI_HII_VALUE *OptionValue
|
||||
);
|
||||
|
||||
/**
|
||||
Compare two Hii value.
|
||||
|
||||
@param Value1 Expression value to compare on left-hand.
|
||||
@param Value2 Expression value to compare on right-hand.
|
||||
@param Result Return value after compare.
|
||||
retval 0 Two operators equal.
|
||||
return Positive value if Value1 is greater than Value2.
|
||||
retval Negative value if Value1 is less than Value2.
|
||||
@param HiiHandle Only required for string compare.
|
||||
|
||||
@retval other Could not perform compare on two values.
|
||||
@retval EFI_SUCCESS Compare the value success.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
CompareHiiValue (
|
||||
IN EFI_HII_VALUE *Value1,
|
||||
IN EFI_HII_VALUE *Value2,
|
||||
OUT INTN *Result,
|
||||
IN EFI_HII_HANDLE HiiHandle OPTIONAL
|
||||
);
|
||||
|
||||
/**
|
||||
Draw a pop up windows based on the dimension, number of lines and
|
||||
strings specified.
|
||||
|
||||
@param RequestedWidth The width of the pop-up.
|
||||
@param NumberOfLines The number of lines.
|
||||
@param ... A series of text strings that displayed in the pop-up.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
CreateMultiStringPopUp (
|
||||
IN UINTN RequestedWidth,
|
||||
IN UINTN NumberOfLines,
|
||||
...
|
||||
);
|
||||
|
||||
/**
|
||||
Will copy LineWidth amount of a string in the OutputString buffer and return the
|
||||
number of CHAR16 characters that were copied into the OutputString buffer.
|
||||
The output string format is:
|
||||
Glyph Info + String info + '\0'.
|
||||
|
||||
In the code, it deals \r,\n,\r\n same as \n\r, also it not process the \r or \g.
|
||||
|
||||
@param InputString String description for this option.
|
||||
@param LineWidth Width of the desired string to extract in CHAR16
|
||||
characters
|
||||
@param GlyphWidth The glyph width of the begin of the char in the string.
|
||||
@param Index Where in InputString to start the copy process
|
||||
@param OutputString Buffer to copy the string into
|
||||
|
||||
@return Returns the number of CHAR16 characters that were copied into the OutputString
|
||||
buffer, include extra glyph info and '\0' info.
|
||||
|
||||
**/
|
||||
UINT16
|
||||
GetLineByWidth (
|
||||
IN CHAR16 *InputString,
|
||||
IN UINT16 LineWidth,
|
||||
IN OUT UINT16 *GlyphWidth,
|
||||
IN OUT UINTN *Index,
|
||||
OUT CHAR16 **OutputString
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Get the string based on the StringId and HII Package List Handle.
|
||||
|
||||
@param Token The String's ID.
|
||||
@param HiiHandle The Hii handle for this string package.
|
||||
|
||||
@return The output string.
|
||||
|
||||
**/
|
||||
CHAR16 *
|
||||
GetToken (
|
||||
IN EFI_STRING_ID Token,
|
||||
IN EFI_HII_HANDLE HiiHandle
|
||||
);
|
||||
|
||||
/**
|
||||
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.
|
||||
|
||||
If String is NULL, then ASSERT ().
|
||||
|
||||
@param String The input string to be counted.
|
||||
|
||||
@return Storage space for the input string.
|
||||
|
||||
**/
|
||||
UINTN
|
||||
GetStringWidth (
|
||||
IN CHAR16 *String
|
||||
);
|
||||
|
||||
/**
|
||||
This routine reads a numeric value from the user input.
|
||||
|
||||
@param MenuOption Pointer to the current input menu.
|
||||
|
||||
@retval EFI_SUCCESS If numerical input is read successfully
|
||||
@retval EFI_DEVICE_ERROR If operation fails
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
GetNumericInput (
|
||||
IN UI_MENU_OPTION *MenuOption
|
||||
);
|
||||
|
||||
/**
|
||||
Get string or password input from user.
|
||||
|
||||
@param MenuOption Pointer to the current input menu.
|
||||
@param Prompt The prompt string shown on popup window.
|
||||
@param StringPtr Old user input and destination for use input string.
|
||||
|
||||
@retval EFI_SUCCESS If string input is read successfully
|
||||
@retval EFI_DEVICE_ERROR If operation fails
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
ReadString (
|
||||
IN UI_MENU_OPTION *MenuOption,
|
||||
IN CHAR16 *Prompt,
|
||||
IN OUT CHAR16 *StringPtr
|
||||
);
|
||||
|
||||
/**
|
||||
Draw a pop up windows based on the dimension, number of lines and
|
||||
strings specified.
|
||||
|
||||
@param RequestedWidth The width of the pop-up.
|
||||
@param NumberOfLines The number of lines.
|
||||
@param Marker The variable argument list for the list of string to be printed.
|
||||
|
||||
**/
|
||||
VOID
|
||||
CreateSharedPopUp (
|
||||
IN UINTN RequestedWidth,
|
||||
IN UINTN NumberOfLines,
|
||||
IN VA_LIST Marker
|
||||
);
|
||||
|
||||
/**
|
||||
Wait for a key to be pressed by user.
|
||||
|
||||
@param Key The key which is pressed by user.
|
||||
|
||||
@retval EFI_SUCCESS The function always completed successfully.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
WaitForKeyStroke (
|
||||
OUT EFI_INPUT_KEY *Key
|
||||
);
|
||||
|
||||
/**
|
||||
Get selection for OneOf and OrderedList (Left/Right will be ignored).
|
||||
|
||||
@param MenuOption Pointer to the current input menu.
|
||||
|
||||
@retval EFI_SUCCESS If Option input is processed successfully
|
||||
@retval EFI_DEVICE_ERROR If operation fails
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
GetSelectionInputPopUp (
|
||||
IN UI_MENU_OPTION *MenuOption
|
||||
);
|
||||
|
||||
/**
|
||||
Process the help string: Split StringPtr to several lines of strings stored in
|
||||
FormattedString and the glyph width of each line cannot exceed gHelpBlockWidth.
|
||||
|
||||
@param StringPtr The entire help string.
|
||||
@param FormattedString The oupput formatted string.
|
||||
@param EachLineWidth The max string length of each line in the formatted string.
|
||||
@param RowCount TRUE: if Question is selected.
|
||||
|
||||
**/
|
||||
UINTN
|
||||
ProcessHelpString (
|
||||
IN CHAR16 *StringPtr,
|
||||
OUT CHAR16 **FormattedString,
|
||||
OUT UINT16 *EachLineWidth,
|
||||
IN UINTN RowCount
|
||||
);
|
||||
|
||||
/**
|
||||
Process a Question's Option (whether selected or un-selected).
|
||||
|
||||
@param MenuOption The MenuOption for this Question.
|
||||
@param Selected TRUE: if Question is selected.
|
||||
@param OptionString Pointer of the Option String to be displayed.
|
||||
@param SkipErrorValue Whether need to return when value without option for it.
|
||||
|
||||
@retval EFI_SUCCESS Question Option process success.
|
||||
@retval Other Question Option process fail.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
ProcessOptions (
|
||||
IN UI_MENU_OPTION *MenuOption,
|
||||
IN BOOLEAN Selected,
|
||||
OUT CHAR16 **OptionString,
|
||||
IN BOOLEAN SkipErrorValue
|
||||
);
|
||||
|
||||
/**
|
||||
Set Buffer to Value for Size bytes.
|
||||
|
||||
@param Buffer Memory to set.
|
||||
@param Size Number of bytes to set
|
||||
@param Value Value of the set operation.
|
||||
|
||||
**/
|
||||
VOID
|
||||
SetUnicodeMem (
|
||||
IN VOID *Buffer,
|
||||
IN UINTN Size,
|
||||
IN CHAR16 Value
|
||||
);
|
||||
|
||||
/**
|
||||
Display one form, and return user input.
|
||||
|
||||
@param FormData Form Data to be shown.
|
||||
@param UserInputData User input data.
|
||||
|
||||
@retval EFI_SUCCESS Form Data is shown, and user input is got.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
FormDisplay (
|
||||
IN FORM_DISPLAY_ENGINE_FORM *FormData,
|
||||
OUT USER_INPUT *UserInputData
|
||||
);
|
||||
|
||||
/**
|
||||
Clear Screen to the initial state.
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
DriverClearDisplayPage (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
Exit Display and Clear Screen to the original state.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
ExitDisplay (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
Process validate for one question.
|
||||
|
||||
@param Question The question which need to validate.
|
||||
|
||||
@retval EFI_SUCCESS Question Option process success.
|
||||
@retval Other Question Option process fail.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
ValidateQuestion (
|
||||
IN FORM_DISPLAY_ENGINE_STATEMENT *Question
|
||||
);
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
44
MdeModulePkg/Universal/SetupBrowserDxe/Colors.h
Normal file
44
MdeModulePkg/Universal/SetupBrowserDxe/Colors.h
Normal file
@@ -0,0 +1,44 @@
|
||||
/** @file
|
||||
MACRO definitions for color used in Setup Browser.
|
||||
|
||||
Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
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.
|
||||
|
||||
**/
|
||||
//
|
||||
// Unicode collation protocol in
|
||||
|
||||
#ifndef _COLORS_H_
|
||||
#define _COLORS_H_
|
||||
|
||||
//
|
||||
// Screen Color Settings
|
||||
//
|
||||
#define PICKLIST_HIGHLIGHT_TEXT EFI_WHITE
|
||||
#define PICKLIST_HIGHLIGHT_BACKGROUND EFI_BACKGROUND_CYAN
|
||||
#define TITLE_TEXT EFI_WHITE
|
||||
#define TITLE_BACKGROUND EFI_BACKGROUND_BLUE
|
||||
#define KEYHELP_TEXT EFI_LIGHTGRAY
|
||||
#define KEYHELP_BACKGROUND EFI_BACKGROUND_BLACK
|
||||
#define SUBTITLE_BACKGROUND EFI_BACKGROUND_LIGHTGRAY
|
||||
#define BANNER_TEXT EFI_BLUE
|
||||
#define BANNER_BACKGROUND EFI_BACKGROUND_LIGHTGRAY
|
||||
#define FIELD_TEXT_GRAYED EFI_DARKGRAY
|
||||
#define FIELD_BACKGROUND EFI_BACKGROUND_LIGHTGRAY
|
||||
#define POPUP_TEXT EFI_LIGHTGRAY
|
||||
#define POPUP_BACKGROUND EFI_BACKGROUND_BLUE
|
||||
#define POPUP_INVERSE_TEXT EFI_LIGHTGRAY
|
||||
#define POPUP_INVERSE_BACKGROUND EFI_BACKGROUND_BLACK
|
||||
#define HELP_TEXT EFI_BLUE
|
||||
#define ERROR_TEXT EFI_RED | EFI_BRIGHT
|
||||
#define INFO_TEXT EFI_YELLOW | EFI_BRIGHT
|
||||
#define ARROW_TEXT EFI_RED | EFI_BRIGHT
|
||||
#define ARROW_BACKGROUND EFI_BACKGROUND_LIGHTGRAY
|
||||
|
||||
#endif
|
@@ -787,7 +787,7 @@ FORM_BROWSER_FORM *
|
||||
IdToForm (
|
||||
IN FORM_BROWSER_FORMSET *FormSet,
|
||||
IN UINT16 FormId
|
||||
)
|
||||
)
|
||||
{
|
||||
LIST_ENTRY *Link;
|
||||
FORM_BROWSER_FORM *Form;
|
||||
@@ -2105,7 +2105,7 @@ GetQuestionValueFromForm (
|
||||
//
|
||||
FormSet = AllocateZeroPool (sizeof (FORM_BROWSER_FORMSET));
|
||||
ASSERT (FormSet != NULL);
|
||||
Status = InitializeFormSet(HiiHandle, FormSetGuid, FormSet);
|
||||
Status = InitializeFormSet(HiiHandle, FormSetGuid, FormSet, FALSE);
|
||||
if (EFI_ERROR (Status)) {
|
||||
GetTheVal = FALSE;
|
||||
goto Done;
|
||||
@@ -2800,7 +2800,7 @@ EvaluateExpression (
|
||||
for (Index = 0; Index < OpCode->ValueWidth; Index ++, TempBuffer --) {
|
||||
StrPtr += UnicodeValueToString (StrPtr, PREFIX_ZERO | RADIX_HEX, *TempBuffer, 2);
|
||||
}
|
||||
Status = SetValueByName (OpCode->VarStorage, OpCode->ValueName, NameValue, GetSetValueWithEditBuffer, NULL);
|
||||
Status = SetValueByName (OpCode->VarStorage, OpCode->ValueName, NameValue, GetSetValueWithEditBuffer);
|
||||
FreePool (NameValue);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
Data1.Value.b = TRUE;
|
||||
|
@@ -1,265 +0,0 @@
|
||||
/** @file
|
||||
Private structure, MACRO and function definitions for User Interface related functionalities.
|
||||
|
||||
Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
|
||||
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.
|
||||
|
||||
**/
|
||||
|
||||
#ifndef _EXPRESSION_H_
|
||||
#define _EXPRESSION_H_
|
||||
|
||||
/**
|
||||
Get the expression list count.
|
||||
|
||||
@param Level Which type this expression belong to. Form,
|
||||
statement or option?
|
||||
|
||||
@retval >=0 The expression count
|
||||
@retval -1 Input parameter error.
|
||||
|
||||
**/
|
||||
INTN
|
||||
GetConditionalExpressionCount (
|
||||
IN EXPRESS_LEVEL Level
|
||||
);
|
||||
|
||||
/**
|
||||
Reset stack pointer to begin of the stack.
|
||||
|
||||
**/
|
||||
VOID
|
||||
ResetCurrentExpressionStack (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
Reset stack pointer to begin of the stack.
|
||||
|
||||
**/
|
||||
VOID
|
||||
ResetMapExpressionListStack (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
Reset stack pointer to begin of the stack.
|
||||
|
||||
**/
|
||||
VOID
|
||||
ResetScopeStack (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
Push an Operand onto the Stack
|
||||
|
||||
@param Operand Operand to push.
|
||||
|
||||
@retval EFI_SUCCESS The value was pushed onto the stack.
|
||||
@retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the
|
||||
stack.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
PushScope (
|
||||
IN UINT8 Operand
|
||||
);
|
||||
|
||||
/**
|
||||
Get the expression Buffer pointer.
|
||||
|
||||
@param Level Which type this expression belong to. Form,
|
||||
statement or option?
|
||||
|
||||
@retval The start pointer of the expression buffer or NULL.
|
||||
|
||||
**/
|
||||
FORM_EXPRESSION **
|
||||
GetConditionalExpressionList (
|
||||
IN EXPRESS_LEVEL Level
|
||||
);
|
||||
|
||||
/**
|
||||
Pop an Operand from the Stack
|
||||
|
||||
@param Operand Operand to pop.
|
||||
|
||||
@retval EFI_SUCCESS The value was pushed onto the stack.
|
||||
@retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the
|
||||
stack.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
PopScope (
|
||||
OUT UINT8 *Operand
|
||||
);
|
||||
|
||||
/**
|
||||
Push the list of map expression onto the Stack
|
||||
|
||||
@param Pointer Pointer to the list of map expression to be pushed.
|
||||
|
||||
@retval EFI_SUCCESS The value was pushed onto the stack.
|
||||
@retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the stack.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
PushMapExpressionList (
|
||||
IN VOID *Pointer
|
||||
);
|
||||
|
||||
/**
|
||||
Push current expression onto the Stack
|
||||
|
||||
@param Pointer Pointer to current expression.
|
||||
|
||||
@retval EFI_SUCCESS The value was pushed onto the stack.
|
||||
@retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the stack.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
PushCurrentExpression (
|
||||
IN VOID *Pointer
|
||||
);
|
||||
|
||||
/**
|
||||
Zero extend integer/boolean/date/time to UINT64 for comparing.
|
||||
|
||||
@param Value HII Value to be converted.
|
||||
|
||||
**/
|
||||
VOID
|
||||
ExtendValueToU64 (
|
||||
IN EFI_HII_VALUE *Value
|
||||
);
|
||||
|
||||
/**
|
||||
Push the expression options onto the Stack.
|
||||
|
||||
@param Pointer Pointer to the current expression.
|
||||
@param Level Which type this expression belong to. Form,
|
||||
statement or option?
|
||||
|
||||
@retval EFI_SUCCESS The value was pushed onto the stack.
|
||||
@retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the stack.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
PushConditionalExpression (
|
||||
IN FORM_EXPRESSION *Pointer,
|
||||
IN EXPRESS_LEVEL Level
|
||||
);
|
||||
|
||||
/**
|
||||
Pop the expression options from the Stack
|
||||
|
||||
@param Level Which type this expression belong to. Form,
|
||||
statement or option?
|
||||
|
||||
@retval EFI_SUCCESS The value was pushed onto the stack.
|
||||
@retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the stack.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
PopConditionalExpression (
|
||||
IN EXPRESS_LEVEL Level
|
||||
);
|
||||
|
||||
/**
|
||||
Pop the list of map expression from the Stack
|
||||
|
||||
@param Pointer Pointer to the list of map expression to be pop.
|
||||
|
||||
@retval EFI_SUCCESS The value was pushed onto the stack.
|
||||
@retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the stack.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
PopMapExpressionList (
|
||||
OUT VOID **Pointer
|
||||
);
|
||||
|
||||
/**
|
||||
Pop current expression from the Stack
|
||||
|
||||
@param Pointer Pointer to current expression to be pop.
|
||||
|
||||
@retval EFI_SUCCESS The value was pushed onto the stack.
|
||||
@retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the stack.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
PopCurrentExpression (
|
||||
OUT VOID **Pointer
|
||||
);
|
||||
|
||||
/**
|
||||
Evaluate the result of a HII expression.
|
||||
|
||||
If Expression is NULL, then ASSERT.
|
||||
|
||||
@param FormSet FormSet associated with this expression.
|
||||
@param Form Form associated with this expression.
|
||||
@param Expression Expression to be evaluated.
|
||||
|
||||
@retval EFI_SUCCESS The expression evaluated successfuly
|
||||
@retval EFI_NOT_FOUND The Question which referenced by a QuestionId
|
||||
could not be found.
|
||||
@retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the
|
||||
stack.
|
||||
@retval EFI_ACCESS_DENIED The pop operation underflowed the stack
|
||||
@retval EFI_INVALID_PARAMETER Syntax error with the Expression
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EvaluateExpression (
|
||||
IN FORM_BROWSER_FORMSET *FormSet,
|
||||
IN FORM_BROWSER_FORM *Form,
|
||||
IN OUT FORM_EXPRESSION *Expression
|
||||
);
|
||||
/**
|
||||
Return the result of the expression list. Check the expression list and
|
||||
return the highest priority express result.
|
||||
Priority: DisableIf > SuppressIf > GrayOutIf > FALSE
|
||||
|
||||
@param ExpList The input expression list.
|
||||
@param Evaluate Whether need to evaluate the expression first.
|
||||
@param FormSet FormSet associated with this expression.
|
||||
@param Form Form associated with this expression.
|
||||
|
||||
@retval EXPRESS_RESULT Return the higher priority express result.
|
||||
DisableIf > SuppressIf > GrayOutIf > FALSE
|
||||
|
||||
**/
|
||||
EXPRESS_RESULT
|
||||
EvaluateExpressionList (
|
||||
IN FORM_EXPRESSION_LIST *ExpList,
|
||||
IN BOOLEAN Evaluate,
|
||||
IN FORM_BROWSER_FORMSET *FormSet, OPTIONAL
|
||||
IN FORM_BROWSER_FORM *Form OPTIONAL
|
||||
);
|
||||
|
||||
/**
|
||||
Get Form given its FormId.
|
||||
|
||||
@param FormSet The formset which contains this form.
|
||||
@param FormId Id of this form.
|
||||
|
||||
@retval Pointer The form.
|
||||
@retval NULL Specified Form is not found in the formset.
|
||||
|
||||
**/
|
||||
FORM_BROWSER_FORM *
|
||||
IdToForm (
|
||||
IN FORM_BROWSER_FORMSET *FormSet,
|
||||
IN UINT16 FormId
|
||||
);
|
||||
|
||||
#endif // _EXPRESSION_H
|
@@ -16,7 +16,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
UINT16 mStatementIndex;
|
||||
UINT16 mExpressionOpCodeIndex;
|
||||
EFI_QUESTION_ID mUsedQuestionId;
|
||||
|
||||
BOOLEAN mInScopeSubtitle;
|
||||
extern LIST_ENTRY gBrowserStorageList;
|
||||
/**
|
||||
@@ -42,9 +42,9 @@ CreateStatement (
|
||||
|
||||
if (Form == NULL) {
|
||||
//
|
||||
// Only guid op may out side the form level.
|
||||
// We are currently not in a Form Scope, so just skip this Statement
|
||||
//
|
||||
ASSERT (((EFI_IFR_OP_HEADER *) OpCodeData)->OpCode == EFI_IFR_GUID_OP);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Statement = &FormSet->StatementBuffer[mStatementIndex];
|
||||
@@ -58,7 +58,6 @@ CreateStatement (
|
||||
Statement->Signature = FORM_BROWSER_STATEMENT_SIGNATURE;
|
||||
|
||||
Statement->Operand = ((EFI_IFR_OP_HEADER *) OpCodeData)->OpCode;
|
||||
Statement->OpCode = (EFI_IFR_OP_HEADER *) OpCodeData;
|
||||
|
||||
StatementHdr = (EFI_IFR_STATEMENT_HEADER *) (OpCodeData + sizeof (EFI_IFR_OP_HEADER));
|
||||
CopyMem (&Statement->Prompt, &StatementHdr->Prompt, sizeof (EFI_STRING_ID));
|
||||
@@ -83,11 +82,8 @@ CreateStatement (
|
||||
//
|
||||
// Insert this Statement into current Form
|
||||
//
|
||||
if (Form == NULL) {
|
||||
InsertTailList (&FormSet->StatementListOSF, &Statement->Link);
|
||||
} else {
|
||||
InsertTailList (&Form->StatementListHead, &Statement->Link);
|
||||
}
|
||||
InsertTailList (&Form->StatementListHead, &Statement->Link);
|
||||
|
||||
return Statement;
|
||||
}
|
||||
|
||||
@@ -1137,7 +1133,6 @@ ParseOpCodes (
|
||||
CountOpCodes (FormSet, &NumberOfStatement, &NumberOfExpression);
|
||||
|
||||
mStatementIndex = 0;
|
||||
mUsedQuestionId = 1;
|
||||
FormSet->StatementBuffer = AllocateZeroPool (NumberOfStatement * sizeof (FORM_BROWSER_STATEMENT));
|
||||
if (FormSet->StatementBuffer == NULL) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
@@ -1149,7 +1144,6 @@ ParseOpCodes (
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
InitializeListHead (&FormSet->StatementListOSF);
|
||||
InitializeListHead (&FormSet->StorageListHead);
|
||||
InitializeListHead (&FormSet->DefaultStoreListHead);
|
||||
InitializeListHead (&FormSet->FormListHead);
|
||||
@@ -1508,6 +1502,7 @@ ParseOpCodes (
|
||||
InitializeListHead (&CurrentForm->ConfigRequestHead);
|
||||
|
||||
CurrentForm->FormType = STANDARD_MAP_FORM_TYPE;
|
||||
CurrentForm->NvUpdateRequired = FALSE;
|
||||
CopyMem (&CurrentForm->FormId, &((EFI_IFR_FORM *) OpCodeData)->FormId, sizeof (UINT16));
|
||||
CopyMem (&CurrentForm->FormTitle, &((EFI_IFR_FORM *) OpCodeData)->FormTitle, sizeof (EFI_STRING_ID));
|
||||
|
||||
@@ -1544,6 +1539,7 @@ ParseOpCodes (
|
||||
CurrentForm = AllocateZeroPool (sizeof (FORM_BROWSER_FORM));
|
||||
ASSERT (CurrentForm != NULL);
|
||||
CurrentForm->Signature = FORM_BROWSER_FORM_SIGNATURE;
|
||||
CurrentForm->NvUpdateRequired = FALSE;
|
||||
InitializeListHead (&CurrentForm->ExpressionListHead);
|
||||
InitializeListHead (&CurrentForm->StatementListHead);
|
||||
InitializeListHead (&CurrentForm->ConfigRequestHead);
|
||||
@@ -1657,7 +1653,7 @@ ParseOpCodes (
|
||||
ASSERT (CurrentStatement != NULL);
|
||||
|
||||
CurrentStatement->Flags = ((EFI_IFR_SUBTITLE *) OpCodeData)->Flags;
|
||||
CurrentStatement->FakeQuestionId = mUsedQuestionId++;
|
||||
|
||||
if (Scope != 0) {
|
||||
mInScopeSubtitle = TRUE;
|
||||
}
|
||||
@@ -1666,14 +1662,13 @@ ParseOpCodes (
|
||||
case EFI_IFR_TEXT_OP:
|
||||
CurrentStatement = CreateStatement (OpCodeData, FormSet, CurrentForm);
|
||||
ASSERT (CurrentStatement != NULL);
|
||||
CurrentStatement->FakeQuestionId = mUsedQuestionId++;
|
||||
|
||||
CopyMem (&CurrentStatement->TextTwo, &((EFI_IFR_TEXT *) OpCodeData)->TextTwo, sizeof (EFI_STRING_ID));
|
||||
break;
|
||||
|
||||
case EFI_IFR_RESET_BUTTON_OP:
|
||||
CurrentStatement = CreateStatement (OpCodeData, FormSet, CurrentForm);
|
||||
ASSERT (CurrentStatement != NULL);
|
||||
CurrentStatement->FakeQuestionId = mUsedQuestionId++;
|
||||
CopyMem (&CurrentStatement->DefaultId, &((EFI_IFR_RESET_BUTTON *) OpCodeData)->DefaultId, sizeof (EFI_DEFAULT_ID));
|
||||
break;
|
||||
|
||||
@@ -1918,7 +1913,6 @@ ParseOpCodes (
|
||||
CurrentOption = AllocateZeroPool (sizeof (QUESTION_OPTION));
|
||||
ASSERT (CurrentOption != NULL);
|
||||
CurrentOption->Signature = QUESTION_OPTION_SIGNATURE;
|
||||
CurrentOption->OpCode = (EFI_IFR_ONE_OF_OPTION *) OpCodeData;
|
||||
|
||||
CurrentOption->Flags = ((EFI_IFR_ONE_OF_OPTION *) OpCodeData)->Flags;
|
||||
CurrentOption->Value.Type = ((EFI_IFR_ONE_OF_OPTION *) OpCodeData)->Type;
|
||||
@@ -2276,8 +2270,45 @@ ParseOpCodes (
|
||||
//
|
||||
// Vendor specific
|
||||
//
|
||||
case EFI_IFR_GUID_OP:
|
||||
CurrentStatement = CreateStatement (OpCodeData, FormSet, CurrentForm);
|
||||
case EFI_IFR_GUID_OP:
|
||||
if (CompareGuid (&gEfiIfrTianoGuid, (EFI_GUID *)(OpCodeData + sizeof (EFI_IFR_OP_HEADER)))) {
|
||||
//
|
||||
// Tiano specific GUIDed opcodes
|
||||
//
|
||||
switch (((EFI_IFR_GUID_LABEL *) OpCodeData)->ExtendOpCode) {
|
||||
case EFI_IFR_EXTEND_OP_LABEL:
|
||||
//
|
||||
// just ignore label
|
||||
//
|
||||
break;
|
||||
|
||||
case EFI_IFR_EXTEND_OP_BANNER:
|
||||
//
|
||||
// By SubClass to get Banner Data from Front Page
|
||||
//
|
||||
if (FormSet->SubClass == EFI_FRONT_PAGE_SUBCLASS) {
|
||||
CopyMem (
|
||||
&gBannerData->Banner[((EFI_IFR_GUID_BANNER *) OpCodeData)->LineNumber][
|
||||
((EFI_IFR_GUID_BANNER *) OpCodeData)->Alignment],
|
||||
&((EFI_IFR_GUID_BANNER *) OpCodeData)->Title,
|
||||
sizeof (EFI_STRING_ID)
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
||||
case EFI_IFR_EXTEND_OP_CLASS:
|
||||
CopyMem (&FormSet->Class, &((EFI_IFR_GUID_CLASS *) OpCodeData)->Class, sizeof (UINT16));
|
||||
break;
|
||||
|
||||
case EFI_IFR_EXTEND_OP_SUBCLASS:
|
||||
CopyMem (&FormSet->SubClass, &((EFI_IFR_GUID_SUBCLASS *) OpCodeData)->SubClass, sizeof (UINT16));
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
//
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
272
MdeModulePkg/Universal/SetupBrowserDxe/Print.c
Normal file
272
MdeModulePkg/Universal/SetupBrowserDxe/Print.c
Normal file
@@ -0,0 +1,272 @@
|
||||
/** @file
|
||||
Basic Ascii AvSPrintf() function named VSPrint(). VSPrint() enables very
|
||||
simple implemenation of SPrint() and Print() to support debug.
|
||||
|
||||
You can not Print more than EFI_DRIVER_LIB_MAX_PRINT_BUFFER characters at a
|
||||
time. This makes the implementation very simple.
|
||||
|
||||
VSPrint, Print, SPrint format specification has the follwoing form
|
||||
|
||||
%type
|
||||
|
||||
type:
|
||||
'S','s' - argument is an Unicode string
|
||||
'c' - argument is an ascii character
|
||||
'%' - Print a %
|
||||
|
||||
|
||||
Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
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.
|
||||
|
||||
**/
|
||||
|
||||
#include "Setup.h"
|
||||
|
||||
/**
|
||||
The internal function prints to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
|
||||
protocol instance.
|
||||
|
||||
@param Column The position of the output string.
|
||||
@param Row The position of the output string.
|
||||
@param Out The EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL instance.
|
||||
@param Fmt The format string.
|
||||
@param Args The additional argument for the variables in the format string.
|
||||
|
||||
@return Number of Unicode character printed.
|
||||
|
||||
**/
|
||||
UINTN
|
||||
PrintInternal (
|
||||
IN UINTN Column,
|
||||
IN UINTN Row,
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *Out,
|
||||
IN CHAR16 *Fmt,
|
||||
IN VA_LIST Args
|
||||
)
|
||||
{
|
||||
CHAR16 *Buffer;
|
||||
CHAR16 *BackupBuffer;
|
||||
UINTN Index;
|
||||
UINTN PreviousIndex;
|
||||
UINTN Count;
|
||||
|
||||
//
|
||||
// For now, allocate an arbitrarily long buffer
|
||||
//
|
||||
Buffer = AllocateZeroPool (0x10000);
|
||||
BackupBuffer = AllocateZeroPool (0x10000);
|
||||
ASSERT (Buffer);
|
||||
ASSERT (BackupBuffer);
|
||||
|
||||
if (Column != (UINTN) -1) {
|
||||
Out->SetCursorPosition (Out, Column, Row);
|
||||
}
|
||||
|
||||
UnicodeVSPrint (Buffer, 0x10000, Fmt, Args);
|
||||
|
||||
Out->Mode->Attribute = Out->Mode->Attribute & 0x7f;
|
||||
|
||||
Out->SetAttribute (Out, Out->Mode->Attribute);
|
||||
|
||||
Index = 0;
|
||||
PreviousIndex = 0;
|
||||
Count = 0;
|
||||
|
||||
do {
|
||||
for (; (Buffer[Index] != NARROW_CHAR) && (Buffer[Index] != WIDE_CHAR) && (Buffer[Index] != 0); Index++) {
|
||||
BackupBuffer[Index] = Buffer[Index];
|
||||
}
|
||||
|
||||
if (Buffer[Index] == 0) {
|
||||
break;
|
||||
}
|
||||
//
|
||||
// Null-terminate the temporary string
|
||||
//
|
||||
BackupBuffer[Index] = 0;
|
||||
|
||||
//
|
||||
// Print this out, we are about to switch widths
|
||||
//
|
||||
Out->OutputString (Out, &BackupBuffer[PreviousIndex]);
|
||||
Count += StrLen (&BackupBuffer[PreviousIndex]);
|
||||
|
||||
//
|
||||
// Preserve the current index + 1, since this is where we will start printing from next
|
||||
//
|
||||
PreviousIndex = Index + 1;
|
||||
|
||||
//
|
||||
// We are at a narrow or wide character directive. Set attributes and strip it and print it
|
||||
//
|
||||
if (Buffer[Index] == NARROW_CHAR) {
|
||||
//
|
||||
// Preserve bits 0 - 6 and zero out the rest
|
||||
//
|
||||
Out->Mode->Attribute = Out->Mode->Attribute & 0x7f;
|
||||
Out->SetAttribute (Out, Out->Mode->Attribute);
|
||||
} else {
|
||||
//
|
||||
// Must be wide, set bit 7 ON
|
||||
//
|
||||
Out->Mode->Attribute = Out->Mode->Attribute | EFI_WIDE_ATTRIBUTE;
|
||||
Out->SetAttribute (Out, Out->Mode->Attribute);
|
||||
}
|
||||
|
||||
Index++;
|
||||
|
||||
} while (Buffer[Index] != 0);
|
||||
|
||||
//
|
||||
// We hit the end of the string - print it
|
||||
//
|
||||
Out->OutputString (Out, &BackupBuffer[PreviousIndex]);
|
||||
Count += StrLen (&BackupBuffer[PreviousIndex]);
|
||||
|
||||
FreePool (Buffer);
|
||||
FreePool (BackupBuffer);
|
||||
return Count;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Prints a formatted unicode string to the default console.
|
||||
|
||||
@param Fmt Format string
|
||||
@param ... Variable argument list for format string.
|
||||
|
||||
@return Length of string printed to the console.
|
||||
|
||||
**/
|
||||
UINTN
|
||||
EFIAPI
|
||||
ConsolePrint (
|
||||
IN CHAR16 *Fmt,
|
||||
...
|
||||
)
|
||||
{
|
||||
VA_LIST Args;
|
||||
UINTN LengthOfPrinted;
|
||||
|
||||
VA_START (Args, Fmt);
|
||||
LengthOfPrinted = PrintInternal ((UINTN) -1, (UINTN) -1, gST->ConOut, Fmt, Args);
|
||||
VA_END (Args);
|
||||
return LengthOfPrinted;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Prints a unicode string to the default console,
|
||||
using L"%s" format.
|
||||
|
||||
@param String String pointer.
|
||||
|
||||
@return Length of string printed to the console
|
||||
|
||||
**/
|
||||
UINTN
|
||||
PrintString (
|
||||
IN CHAR16 *String
|
||||
)
|
||||
{
|
||||
return ConsolePrint (L"%s", String);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Prints a chracter to the default console,
|
||||
using L"%c" format.
|
||||
|
||||
@param Character Character to print.
|
||||
|
||||
@return Length of string printed to the console.
|
||||
|
||||
**/
|
||||
UINTN
|
||||
PrintChar (
|
||||
CHAR16 Character
|
||||
)
|
||||
{
|
||||
return ConsolePrint (L"%c", Character);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Prints a formatted unicode string to the default console, at
|
||||
the supplied cursor position.
|
||||
|
||||
@param Column The cursor position to print the string at.
|
||||
@param Row The cursor position to print the string at.
|
||||
@param Fmt Format string.
|
||||
@param ... Variable argument list for format string.
|
||||
|
||||
@return Length of string printed to the console
|
||||
|
||||
**/
|
||||
UINTN
|
||||
EFIAPI
|
||||
PrintAt (
|
||||
IN UINTN Column,
|
||||
IN UINTN Row,
|
||||
IN CHAR16 *Fmt,
|
||||
...
|
||||
)
|
||||
{
|
||||
VA_LIST Args;
|
||||
UINTN LengthOfPrinted;
|
||||
|
||||
VA_START (Args, Fmt);
|
||||
LengthOfPrinted = PrintInternal (Column, Row, gST->ConOut, Fmt, Args);
|
||||
VA_END (Args);
|
||||
return LengthOfPrinted;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Prints a unicode string to the default console, at
|
||||
the supplied cursor position, using L"%s" format.
|
||||
|
||||
@param Column The cursor position to print the string at.
|
||||
@param Row The cursor position to print the string at
|
||||
@param String String pointer.
|
||||
|
||||
@return Length of string printed to the console
|
||||
|
||||
**/
|
||||
UINTN
|
||||
PrintStringAt (
|
||||
IN UINTN Column,
|
||||
IN UINTN Row,
|
||||
IN CHAR16 *String
|
||||
)
|
||||
{
|
||||
return PrintAt (Column, Row, L"%s", String);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Prints a chracter to the default console, at
|
||||
the supplied cursor position, using L"%c" format.
|
||||
|
||||
@param Column The cursor position to print the string at.
|
||||
@param Row The cursor position to print the string at.
|
||||
@param Character Character to print.
|
||||
|
||||
@return Length of string printed to the console.
|
||||
|
||||
**/
|
||||
UINTN
|
||||
PrintCharAt (
|
||||
IN UINTN Column,
|
||||
IN UINTN Row,
|
||||
CHAR16 Character
|
||||
)
|
||||
{
|
||||
return PrintAt (Column, Row, L"%c", Character);
|
||||
}
|
1075
MdeModulePkg/Universal/SetupBrowserDxe/ProcessOptions.c
Normal file
1075
MdeModulePkg/Universal/SetupBrowserDxe/ProcessOptions.c
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -19,7 +19,7 @@
|
||||
BASE_NAME = SetupBrowser
|
||||
FILE_GUID = EBf342FE-B1D3-4EF8-957C-8048606FF671
|
||||
MODULE_TYPE = DXE_DRIVER
|
||||
VERSION_STRING = 2.0
|
||||
VERSION_STRING = 1.0
|
||||
ENTRY_POINT = InitializeSetup
|
||||
|
||||
#
|
||||
@@ -29,12 +29,19 @@
|
||||
#
|
||||
|
||||
[Sources]
|
||||
SetupBrowserStr.uni
|
||||
Setup.c
|
||||
Setup.h
|
||||
IfrParse.c
|
||||
Expression.c
|
||||
InputHandler.c
|
||||
Print.c
|
||||
Presentation.c
|
||||
Expression.h
|
||||
ProcessOptions.c
|
||||
Ui.c
|
||||
Ui.h
|
||||
Colors.h
|
||||
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
@@ -52,27 +59,34 @@
|
||||
HiiLib
|
||||
DevicePathLib
|
||||
PcdLib
|
||||
UefiLib
|
||||
|
||||
[Guids]
|
||||
gEfiIfrTianoGuid ## CONSUMES ## GUID
|
||||
gEfiIfrFrameworkGuid ## CONSUMES ## GUID
|
||||
gEfiHiiPlatformSetupFormsetGuid
|
||||
gEfiHiiStandardFormGuid ## SOMETIMES_CONSUMES ## GUID
|
||||
|
||||
[Protocols]
|
||||
gEfiHiiConfigAccessProtocolGuid ## CONSUMES
|
||||
gEfiHiiStringProtocolGuid ## CONSUMES
|
||||
gEfiFormBrowser2ProtocolGuid ## PRODUCES
|
||||
gEdkiiFormBrowserEx2ProtocolGuid ## PRODUCES
|
||||
gEfiFormBrowserExProtocolGuid ## PRODUCES
|
||||
gEfiHiiConfigRoutingProtocolGuid ## CONSUMES
|
||||
gEfiHiiDatabaseProtocolGuid ## CONSUMES
|
||||
gEfiUnicodeCollation2ProtocolGuid ## CONSUMES
|
||||
gEfiUserManagerProtocolGuid ## SOMETIMES_CONSUMES
|
||||
gEfiDevicePathFromTextProtocolGuid ## SOMETIMES_CONSUMES
|
||||
gEdkiiFormDisplayEngineProtocolGuid ## PRODUCE
|
||||
gEfiFormBrowserExProtocolGuid ## PRODUCE
|
||||
|
||||
[FeaturePcd]
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdFrameworkCompatibilitySupport ## CONSUMES
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserGrayOutTextStatement ## CONSUMES
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowerGrayOutReadOnlyMenu ## CONSUMES
|
||||
|
||||
[Pcd]
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserSubtitleTextColor ## CONSUMES
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextColor ## CONSUMES
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextHighlightColor ## CONSUMES
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundHighlightColor ## CONSUMES
|
||||
|
||||
[Depex]
|
||||
gEfiHiiDatabaseProtocolGuid AND gEfiHiiConfigRoutingProtocolGuid
|
||||
|
Binary file not shown.
4027
MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
Normal file
4027
MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
Normal file
File diff suppressed because it is too large
Load Diff
1067
MdeModulePkg/Universal/SetupBrowserDxe/Ui.h
Normal file
1067
MdeModulePkg/Universal/SetupBrowserDxe/Ui.h
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user