Remove Framework SetupBrowser. MdeModulePkg\Universal\SetupBrowserDxe is the replacement complying to HII in UEFI 2.1 spec.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4770 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qwang12 2008-02-28 11:57:35 +00:00
parent ae55729b76
commit 62e6733bc7
14 changed files with 0 additions and 12960 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,47 +0,0 @@
/**@file
Copyright (c) 2006, 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.
**/
#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_TEXT EFI_BLUE
#define SUBTITLE_BACKGROUND EFI_BACKGROUND_LIGHTGRAY
#define BANNER_TEXT EFI_BLUE
#define BANNER_BACKGROUND EFI_BACKGROUND_LIGHTGRAY
#define FIELD_TEXT EFI_BLACK
#define FIELD_TEXT_GRAYED EFI_DARKGRAY
#define FIELD_BACKGROUND EFI_BACKGROUND_LIGHTGRAY
#define FIELD_TEXT_HIGHLIGHT EFI_LIGHTGRAY
#define FIELD_BACKGROUND_HIGHLIGHT EFI_BACKGROUND_BLACK
#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

View File

@ -1,286 +0,0 @@
/**@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) 2006, 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.
**/
#include "Print.h"
STATIC
UINTN
_IPrint (
IN UINTN Column,
IN UINTN Row,
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *Out,
IN CHAR16 *fmt,
IN VA_LIST args
)
//
// Display string worker for: Print, PrintAt, IPrint, IPrintAt
//
{
CHAR16 *Buffer;
CHAR16 *BackupBuffer;
UINTN Index;
UINTN PreviousIndex;
//
// 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;
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]);
//
// 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]);
FreePool (Buffer);
FreePool (BackupBuffer);
return EFI_SUCCESS;
}
UINTN
Print (
IN CHAR16 *fmt,
...
)
/*++
Routine Description:
Prints a formatted unicode string to the default console
Arguments:
fmt - Format string
Returns:
Length of string printed to the console
--*/
{
VA_LIST args;
VA_START (args, fmt);
return _IPrint ((UINTN) -1, (UINTN) -1, gST->ConOut, fmt, args);
}
UINTN
PrintString (
CHAR16 *String
)
/*++
Routine Description:
Prints a unicode string to the default console,
using L"%s" format.
Arguments:
String - String pointer.
Returns:
Length of string printed to the console
--*/
{
return Print ((CHAR16 *) L"%s", String);
}
UINTN
PrintChar (
CHAR16 Character
)
/*++
Routine Description:
Prints a chracter to the default console,
using L"%c" format.
Arguments:
Character - Character to print.
Returns:
Length of string printed to the console.
--*/
{
return Print ((CHAR16 *) L"%c", Character);
}
UINTN
PrintAt (
IN UINTN Column,
IN UINTN Row,
IN CHAR16 *fmt,
...
)
/*++
Routine Description:
Prints a formatted unicode string to the default console, at
the supplied cursor position
Arguments:
Column, Row - The cursor position to print the string at
fmt - Format string
Returns:
Length of string printed to the console
--*/
{
VA_LIST args;
VA_START (args, fmt);
return _IPrint (Column, Row, gST->ConOut, fmt, args);
}
UINTN
PrintStringAt (
IN UINTN Column,
IN UINTN Row,
CHAR16 *String
)
/*++
Routine Description:
Prints a unicode string to the default console, at
the supplied cursor position, using L"%s" format.
Arguments:
Column, Row - The cursor position to print the string at
String - String pointer.
Returns:
Length of string printed to the console
--*/
{
return PrintAt (Column, Row, (CHAR16 *) L"%s", String);
}
UINTN
PrintCharAt (
IN UINTN Column,
IN UINTN Row,
CHAR16 Character
)
/*++
Routine Description:
Prints a chracter to the default console, at
the supplied cursor position, using L"%c" format.
Arguments:
Column, Row - The cursor position to print the string at
Character - Character to print.
Returns:
Length of string printed to the console.
--*/
{
return PrintAt (Column, Row, (CHAR16 *) L"%c", Character);
}

View File

@ -1,33 +0,0 @@
/**@file
Private data for Print.c
Copyright (c) 2006, 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.
**/
#ifndef _PRINT_H_
#define _PRINT_H_
#include "Setup.h"
#define LEFT_JUSTIFY 0x01
#define PREFIX_SIGN 0x02
#define PREFIX_BLANK 0x04
#define COMMA_TYPE 0x08
#define LONG_TYPE 0x10
#define PREFIX_ZERO 0x20
//
// Largest number of characters that can be printed out.
//
#define EFI_DRIVER_LIB_MAX_PRINT_BUFFER (80 * 4)
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,515 +0,0 @@
/**@file
Copyright (c) 2006, 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.
**/
#ifndef _SETUP_H
#define _SETUP_H
#include <FrameworkDxe.h>
#include <Protocol/FrameworkFormCallback.h>
#include <Protocol/FrameworkFormBrowser.h>
#include <Protocol/FrameworkHii.h>
#include <Protocol/Print.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiDriverEntryPoint.h>
#include <Library/PrintLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/FrameworkHiiLib.h>
#include <Library/GraphicsLib.h>
//
// This is the generated header file which includes whatever needs to be exported (strings + IFR)
//
extern UINT8 SetupBrowserStrings[];
//
// Screen definitions
//
#define BANNER_HEIGHT 4
#define BANNER_COLUMNS 3
#define FRONT_PAGE_HEADER_HEIGHT 4
#define NONE_FRONT_PAGE_HEADER_HEIGHT 3
#define LEFT_SKIPPED_COLUMNS 4
#define FOOTER_HEIGHT 4
#define STATUS_BAR_HEIGHT 1
#define SCROLL_ARROW_HEIGHT 1
#define POPUP_PAD_SPACE_COUNT 5
#define POPUP_FRAME_WIDTH 2
#define EFI_SETUP_APPLICATION_SUBCLASS 0x00
#define EFI_GENERAL_APPLICATION_SUBCLASS 0x01
#define EFI_FRONT_PAGE_SUBCLASS 0x02
#define EFI_SINGLE_USE_SUBCLASS 0x03 // Used to display a single entity and then exit
//
// Definition for function key setting
//
#define NONE_FUNCTION_KEY_SETTING 0
#define DEFAULT_FUNCTION_KEY_SETTING (FUNCTION_ONE | FUNCTION_TWO | FUNCTION_NINE | FUNCTION_TEN)
#define FUNCTION_ONE (1 << 0)
#define FUNCTION_TWO (1 << 1)
#define FUNCTION_NINE (1 << 2)
#define FUNCTION_TEN (1 << 3)
typedef struct {
EFI_GUID FormSetGuid;
UINTN KeySetting;
} FUNCTIION_KEY_SETTING;
//
// Character definitions
//
#define CHAR_SPACE 0x0020
#define UPPER_LOWER_CASE_OFFSET 0x20
//
// Time definitions
//
#define ONE_SECOND 10000000
//
// Display definitions
//
#define LEFT_HYPER_DELIMITER L'<'
#define RIGHT_HYPER_DELIMITER L'>'
#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 YES_ANSWER L'Y'
#define NO_ANSWER L'N'
//
// Up to how many lines does the ordered list display
//
#define ORDERED_LIST_SIZE 4
//
// This is the Input Error Message
//
#define INPUT_ERROR 1
//
// This is the NV RAM update required Message
//
#define NV_UPDATE_REQUIRED 2
//
// Refresh the Status Bar with flags
//
#define REFRESH_STATUS_BAR 0xff
//
// This width is basically the sum of the prompt and option widths
//
#define QUESTION_BLOCK_WIDTH 50
//
// Width of the Language Description (Using ISO-639-2 3 ASCII letter standard)
//
#define LANG_DESC_WIDTH 3
//
// Maximum Number of Binaries we can see
//
#define MAX_BINARIES 255
//
// Invalid Handle
//
#define EFI_HII_INVALID_HANDLE 0xFFFF
//
// Invalid Offset Value
//
#define INVALID_OFFSET_VALUE 0xFFFF
struct StringPart {
struct StringPart *Next;
CHAR8 String[QUESTION_BLOCK_WIDTH + 2];
};
//
// The tag definition defines the data associated with a tag (an operation
// in the IFR lingo). The tag is thus a modified union of all the data
// required for tags. The user should be careful to only rely upon information
// relevant to that tag as the contents of other fields is undefined.
//
// The intent here is for this to be all of the data associated with a particular tag.
// Some of this data is extracted from the IFR and left alone. Other data will be derived
// when the page is selected (since that's the first time we really know what language the
// page is to be displayed in) and still other data will vary based on the selection.
// If you'd like to consider alternatives, let me know. This structure has grown somewhat organically.
// It gets a new item stuffed in it when a new item is needed. When I finally decided I needed the
// StringPart structure, items got added here, for example.
//
typedef struct {
UINT8 Operand; // The operand (first byte) of the variable length tag.
EFI_GUID GuidValue; // Primarily for FormSet data
EFI_PHYSICAL_ADDRESS CallbackHandle;
UINT16 Class;
UINT16 SubClass;
UINT16 NumberOfLines; // The number of lines the tag takes up on the page. Adjusted when we display the page as it can change from language to language.
UINT16 PageLine;
UINT16 PageColumn;
UINT16 OptionWidth; // The option can be wider than the column usually associated with options. This is the width on the last option line
STRING_REF Text; // Used for title, subtitle, prompt, etc. This is the string token associated with the string. This token is language independent.
STRING_REF TextTwo; // Used for title, subtitle, prompt, etc. This is the string token associated with the string. This token is language independent.
STRING_REF Help; // Null means no help Same as above but for languages.
UINT16 Consistency; // Do we need to check this opcode against consistency? If > 0, yes.
UINT16 Id;
UINT16 Id2; // The questions (mainly) have identifiers associated with them. These are filled in from the IFR tags and used by e.g. the RPN calculations. (com1 is set to, versus com2 is set to)
//
// These are the three values that are created to determine where in the variable the data is stored. This should, in general,
// be allocated by the build tool. The one major issue is, once storage is allocated for something, it can't be reallocated or we will get a mess.
//
UINT16 StorageStart;
//
// These are the three values that are created to determine where in the variable the data is stored. This should, in general,
// be allocated by the build tool. The one major issue is, once storage is allocated for something, it can't be reallocated or we will get a mess.
//
UINT8 StorageWidth;
//
// These are the three values that are created to determine where in the variable the data is stored. This should, in general,
// be allocated by the build tool. The one major issue is, once storage is allocated for something, it can't be reallocated or we will get a mess.
//
UINT16 Value;
//
// (Default or current)
//
UINT8 Flags;
UINT16 Key;
//
// Used to preserve a value during late consistency checking
//
UINT16 OldValue;
UINT16 Minimum;
UINT16 Maximum;
UINT16 Step;
UINT16 Default;
UINT16 NvDataSize;
UINT16 ConsistencyId;
BOOLEAN GrayOut;
BOOLEAN Suppress;
UINT16 Encoding; // Data from the tags. The first three are used by the numeric input. Encoding is used by the password stuff (a placeholder today - may go away).
UINT16 *IntList; // List of the values possible for a list question
//
// The string is obtained from the string list and formatted into lines and the lines are held in this linked list.
// If we have more than a screen's worth of items, we will end up with cases where we have to display the last couple
// lines of a tag's string above the currently selected one, or, display a few lines of a tag at the bottom of a screen.
//
struct StringPart *StringList;
BOOLEAN ResetRequired; // Primarily used to determine if a reset is required by changing this op-code.
UINT16 VariableNumber; // Used to define which variable the StorageStart will be pertinent for (0-based) For single variable VFR this will always be 0.
//
// Used to define which variable the StorageStart will be pertinent for (0-based) This is used for boolean check of ID versus ID
// so that a user can compare the value of one variable.field content versus another variable.field content.
//
UINT16 VariableNumber2;
} EFI_TAG;
#define EFI_FORM_DATA_SIGNATURE EFI_SIGNATURE_32 ('F', 'o', 'r', 'm')
typedef struct {
UINTN Signature;
EFI_HII_PROTOCOL *Hii;
EFI_FORM_BROWSER_PROTOCOL FormConfig;
} EFI_FORM_CONFIGURATION_DATA;
#define EFI_FORM_DATA_FROM_THIS(a) CR (a, EFI_FORM_CONFIGURATION_DATA, FormConfig, EFI_FORM_DATA_SIGNATURE)
typedef struct _EFI_VARIABLE_DEFINITION {
CHAR8 *NvRamMap;
CHAR8 *FakeNvRamMap; // This is where the storage for NULL devices go (e.g. RTC)
EFI_GUID Guid;
UINT16 VariableId;
UINT16 VariableSize;
UINT16 VariableFakeSize; // For dynamically created and NULL device options, this is the latest size
CHAR16 *VariableName;
struct _EFI_VARIABLE_DEFINITION *Next;
struct _EFI_VARIABLE_DEFINITION *Previous;
} EFI_VARIABLE_DEFINITION;
typedef struct {
UINT32 Length; // Length in bytes between beginning of struc and end of Strings
CHAR8 LanguageCode[4]; // ISO-639-2 language code with a null-terminator
RELOFST PrintableLanguageName; // Translated name of the Language, "English"/"Espanol" etc
UINT32 Attributes; // If on, the language is intended to be printed right to left. The default (off) is to print left to right.
RELOFST StringsPointers[1]; // Pointing to string offset from beginning of String Binary
EFI_STRING Strings[1]; // Array of String Entries. Note the number of entries for Strings and StringsPointers will be the same
} EFI_LANGUAGE_SET;
//
// This encapsulates all the pointers associated with found IFR binaries
//
typedef struct _FRAMEWORK_EFI_IFR_BINARY {
struct _FRAMEWORK_EFI_IFR_BINARY *Next;
VOID *IfrPackage; // Handy for use in freeing the data later since this is the header of the buffer
VOID *FormBinary;
FRAMEWORK_EFI_HII_HANDLE Handle;
STRING_REF TitleToken;
BOOLEAN UnRegisterOnExit;
} FRAMEWORK_EFI_IFR_BINARY;
//
// This encapsulates all the questions (tags) for a particular Form Set
//
typedef struct _EFI_FORM_TAGS {
struct _EFI_FORM_TAGS *Next;
EFI_TAG *Tags;
} EFI_FORM_TAGS;
//
// This is the database of all inconsistency data. Each op-code associated
// with inconsistency will be tracked here. This optimizes the search requirement
// since we will back mark the main tag structure with the op-codes that have reference
// to inconsistency data. This way when parsing the main tag structure and encountering
// the inconsistency mark - we can search this database to know what the inconsistency
// parameters are for that entry.
//
typedef struct _EFI_INCONSISTENCY_DATA {
struct _EFI_INCONSISTENCY_DATA *Next;
struct _EFI_INCONSISTENCY_DATA *Previous;
UINT8 Operand;
STRING_REF Popup;
UINT16 QuestionId1;
UINT16 QuestionId2;
UINT16 Value;
UINT16 ListLength;
UINT16 ConsistencyId;
UINT16 *ValueList;
UINT16 VariableNumber;
UINT16 VariableNumber2;
UINT8 Width;
} EFI_INCONSISTENCY_DATA;
//
// Encapsulating all found Tag information from all sources
// Each encapsulation also contains the NvRamMap buffer and the Size of the NV store
//
typedef struct _EFI_FILE_FORM_TAGS {
struct _EFI_FILE_FORM_TAGS *NextFile;
EFI_INCONSISTENCY_DATA *InconsistentTags;
EFI_VARIABLE_DEFINITION *VariableDefinitions;
EFI_FORM_TAGS FormTags;
} EFI_FILE_FORM_TAGS;
typedef struct {
STRING_REF Banner[BANNER_HEIGHT][BANNER_COLUMNS];
} BANNER_DATA;
//
// Head of the Binary structures
//
FRAMEWORK_EFI_IFR_BINARY *gBinaryDataHead;
//
// The IFR binary that the user chose to run
//
UINTN gActiveIfr;
EFI_HII_PROTOCOL *Hii;
VOID *CachedNVEntry;
BANNER_DATA *BannerData;
FRAMEWORK_EFI_HII_HANDLE FrontPageHandle;
STRING_REF FrontPageTimeOutTitle;
INT16 FrontPageTimeOutValue;
UINTN gClassOfVfr;
UINTN gFunctionKeySetting;
BOOLEAN gResetRequired;
BOOLEAN gExitRequired;
BOOLEAN gSaveRequired;
BOOLEAN gNvUpdateRequired;
UINT16 gConsistencyId;
UINTN gPriorMenuEntry;
FRAMEWORK_EFI_HII_HANDLE gHiiHandle;
BOOLEAN gFirstIn;
VOID *gPreviousValue;
UINT16 gDirection;
EFI_SCREEN_DESCRIPTOR gScreenDimensions;
BOOLEAN gUpArrow;
BOOLEAN gDownArrow;
BOOLEAN gTimeOnScreen;
BOOLEAN gDateOnScreen;
//
// Browser Global Strings
//
CHAR16 *gFunctionOneString;
CHAR16 *gFunctionTwoString;
CHAR16 *gFunctionNineString;
CHAR16 *gFunctionTenString;
CHAR16 *gEnterString;
CHAR16 *gEnterCommitString;
CHAR16 *gEscapeString;
CHAR16 *gMoveHighlight;
CHAR16 *gMakeSelection;
CHAR16 *gNumericInput;
CHAR16 *gToggleCheckBox;
CHAR16 *gPromptForPassword;
CHAR16 *gPromptForNewPassword;
CHAR16 *gConfirmPassword;
CHAR16 *gConfirmError;
CHAR16 *gPressEnter;
CHAR16 *gEmptyString;
CHAR16 *gAreYouSure;
CHAR16 *gYesResponse;
CHAR16 *gNoResponse;
CHAR16 *gMiniString;
CHAR16 *gPlusString;
CHAR16 *gMinusString;
CHAR16 *gAdjustNumber;
CHAR16 gPromptBlockWidth;
CHAR16 gOptionBlockWidth;
CHAR16 gHelpBlockWidth;
//
// Global Procedure Defines
//
VOID
InitializeBrowserStrings (
VOID
)
;
UINTN
Print (
IN CHAR16 *fmt,
...
)
;
UINTN
PrintString (
CHAR16 *String
)
;
UINTN
PrintChar (
CHAR16 Character
)
;
UINTN
PrintAt (
IN UINTN Column,
IN UINTN Row,
IN CHAR16 *fmt,
...
)
;
UINTN
PrintStringAt (
IN UINTN Column,
IN UINTN Row,
CHAR16 *String
)
;
UINTN
PrintCharAt (
IN UINTN Column,
IN UINTN Row,
CHAR16 Character
)
;
VOID
DisplayPageFrame (
VOID
)
;
CHAR16 *
GetToken (
IN STRING_REF IfrBinaryTitle,
IN FRAMEWORK_EFI_HII_HANDLE HiiHandle
)
;
VOID
GetTagCount (
IN UINT8 *RawFormSet,
IN OUT UINT16 *NumberOfTags
)
;
VOID
GetNumericHeader (
IN EFI_TAG *Tag,
IN UINT8 *RawFormSet,
IN UINT16 Index,
IN UINT16 NumberOfLines,
IN EFI_FILE_FORM_TAGS *FileFormTags,
IN UINT16 CurrentVariable
)
;
VOID
GetQuestionHeader (
IN EFI_TAG *Tag,
IN UINT8 *RawFormSet,
IN UINT16 Index,
IN EFI_FILE_FORM_TAGS *FileFormTags,
IN UINT16 CurrentVariable
)
;
VOID
CreateSharedPopUp (
IN UINTN RequestedWidth,
IN UINTN NumberOfLines,
IN CHAR16 **ArrayOfStrings
)
;
EFI_STATUS
CreateDialog (
IN UINTN NumberOfLines,
IN BOOLEAN HotKey,
IN UINTN MaximumStringSize,
OUT CHAR16 *StringBuffer,
OUT EFI_INPUT_KEY *KeyValue,
IN CHAR16 *String,
...
)
;
#endif

View File

@ -1,73 +0,0 @@
#/** @file
# Component description file for SetupBrowser module.
#
# This driver initializes Setup for the brower and installs FormBrowser protocol.
# Copyright (c) 2006 - 2007, 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.
#
#
#**/
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = SetupBrowser
FILE_GUID = EBf342FE-B1D3-4EF8-957C-8048606FF670
MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0
EDK_RELEASE_VERSION = 0x00020000
EFI_SPECIFICATION_VERSION = 0x00020000
ENTRY_POINT = InitializeSetup
#
# The following information is for reference only and not required by the build tools.
#
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
#
# Create Event Guid C Name: EFI_EVENT_TIMER Event Type: EVENT_GROUP_GUID
#
[Sources.common]
Colors.h
Ui.h
Ui.c
ProcessOptions.c
Presentation.c
Print.h
Print.c
InputHandler.c
Boolean.c
Setup.h
Setup.c
SetupBrowserStr.uni
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
IntelFrameworkPkg/IntelFrameworkPkg.dec
[LibraryClasses]
GraphicsLib
FrameworkHiiLib
UefiRuntimeServicesTableLib
UefiBootServicesTableLib
PrintLib
UefiDriverEntryPoint
MemoryAllocationLib
BaseMemoryLib
DebugLib
BaseLib
[Protocols]
gEfiPrintProtocolGuid # PROTOCOL ALWAYS_PRODUCED
gEfiFormBrowserProtocolGuid # PROTOCOL ALWAYS_PRODUCED
gEfiFormCallbackProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiHiiProtocolGuid # PROTOCOL ALWAYS_CONSUMED

View File

@ -1,102 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<MsaHeader>
<ModuleName>SetupBrowser</ModuleName>
<ModuleType>DXE_DRIVER</ModuleType>
<GuidValue>EBf342FE-B1D3-4EF8-957C-8048606FF670</GuidValue>
<Version>1.0</Version>
<Abstract>Component description file for SetupBrowser module.</Abstract>
<Description>This driver initializes Setup for the brower and installs FormBrowser protocol.</Description>
<Copyright>Copyright (c) 2006 - 2007, Intel Corporation</Copyright>
<License>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.</License>
<Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
</MsaHeader>
<ModuleDefinitions>
<SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>
<BinaryModule>false</BinaryModule>
<OutputFileBasename>SetupBrowser</OutputFileBasename>
</ModuleDefinitions>
<LibraryClassDefinitions>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>BaseLib</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>DebugLib</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>BaseMemoryLib</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>MemoryAllocationLib</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>UefiDriverEntryPoint</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>PrintLib</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>UefiBootServicesTableLib</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>UefiRuntimeServicesTableLib</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>HiiLib</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>EdkGraphicsLib</Keyword>
</LibraryClass>
</LibraryClassDefinitions>
<SourceFiles>
<Filename>SetupBrowserStr.uni</Filename>
<Filename>Setup.c</Filename>
<Filename>Setup.h</Filename>
<Filename>Boolean.c</Filename>
<Filename>InputHandler.c</Filename>
<Filename>Print.c</Filename>
<Filename>Print.h</Filename>
<Filename>Presentation.c</Filename>
<Filename>ProcessOptions.c</Filename>
<Filename>Ui.c</Filename>
<Filename>Ui.h</Filename>
<Filename>Colors.h</Filename>
</SourceFiles>
<PackageDependencies>
<Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
<Package PackageGuid="68169ab0-d41b-4009-9060-292c253ac43d"/>
</PackageDependencies>
<Protocols>
<Protocol Usage="ALWAYS_CONSUMED">
<ProtocolCName>gEfiHiiProtocolGuid</ProtocolCName>
</Protocol>
<Protocol Usage="ALWAYS_CONSUMED">
<ProtocolCName>gEfiFormCallbackProtocolGuid</ProtocolCName>
</Protocol>
<Protocol Usage="ALWAYS_PRODUCED">
<ProtocolCName>gEfiFormBrowserProtocolGuid</ProtocolCName>
</Protocol>
<Protocol Usage="ALWAYS_PRODUCED">
<ProtocolCName>gEfiPrintProtocolGuid</ProtocolCName>
</Protocol>
</Protocols>
<Events>
<CreateEvents>
<EventTypes EventGuidCName="EFI_EVENT_TIMER" Usage="ALWAYS_CONSUMED">
<EventType>EVENT_GROUP_GUID</EventType>
</EventTypes>
</CreateEvents>
</Events>
<Externs>
<Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>
<Specification>EDK_RELEASE_VERSION 0x00020000</Specification>
<Extern>
<ModuleEntryPoint>InitializeSetup</ModuleEntryPoint>
</Extern>
</Externs>
</ModuleSurfaceArea>

File diff suppressed because it is too large Load Diff

View File

@ -1,428 +0,0 @@
/**@file
Copyright (c) 2006, 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.
**/
#ifndef _UI_H
#define _UI_H
//
// Globals
//
#define REGULAR_NUMERIC 0
#define TIME_NUMERIC 1
#define DATE_NUMERIC 2
typedef enum {
UiNoOperation,
UiDefault,
UiSelect,
UiUp,
UiDown,
UiLeft,
UiRight,
UiReset,
UiSave,
UiPrevious,
UiPageUp,
UiPageDown,
UiMaxOperation
} UI_SCREEN_OPERATION;
typedef enum {
CfInitialization,
CfCheckSelection,
CfRepaint,
CfRefreshHighLight,
CfUpdateHelpString,
CfPrepareToReadKey,
CfReadKey,
CfScreenOperation,
CfUiPrevious,
CfUiSelect,
CfUiReset,
CfUiLeft,
CfUiRight,
CfUiUp,
CfUiPageUp,
CfUiPageDown,
CfUiDown,
CfUiSave,
CfUiDefault,
CfUiNoOperation,
CfExit,
CfMaxControlFlag
} UI_CONTROL_FLAG;
#define UI_MENU_OPTION_SIGNATURE EFI_SIGNATURE_32 ('u', 'i', 'm', 'm')
#define UI_MENU_LIST_SIGNATURE EFI_SIGNATURE_32 ('u', 'i', 'm', 'l')
typedef struct {
UINTN Signature;
LIST_ENTRY Link;
UINTN Row;
UINTN Col;
UINTN OptCol;
CHAR16 *Description;
UINTN Skip;
UINTN IfrNumber;
VOID *FormBinary;
FRAMEWORK_EFI_HII_HANDLE Handle;
EFI_TAG *Tags;
UINTN TagIndex;
EFI_TAG *ThisTag;
UINT16 FormId;
BOOLEAN Previous;
UINT16 EntryNumber;
UINT16 Consistency;
BOOLEAN GrayOut;
} UI_MENU_OPTION;
typedef struct {
UINTN Signature;
LIST_ENTRY MenuLink;
UI_MENU_OPTION Selection;
UINTN FormerEntryNumber;
} UI_MENU_LIST;
typedef struct _MENU_REFRESH_ENTRY {
struct _MENU_REFRESH_ENTRY *Next;
EFI_FILE_FORM_TAGS *FileFormTagsHead;
UINTN CurrentColumn;
UINTN CurrentRow;
UINTN CurrentAttribute;
UI_MENU_OPTION *MenuOption; // Describes the entry needing an update
} MENU_REFRESH_ENTRY;
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;
LIST_ENTRY Menu;
LIST_ENTRY gMenuList;
MENU_REFRESH_ENTRY *gMenuRefreshHead;
INTN gEntryNumber;
BOOLEAN gLastOpr;
//
// Global Functions
//
VOID
UiInitMenu (
VOID
)
;
VOID
UiInitMenuList (
VOID
)
;
VOID
UiRemoveMenuListEntry (
IN UI_MENU_OPTION *Selection,
OUT UI_MENU_OPTION **PreviousSelection
)
;
VOID
UiFreeMenuList (
VOID
)
;
VOID
UiAddMenuListEntry (
IN UI_MENU_OPTION *Selection
)
;
VOID
UiFreeMenu (
VOID
)
;
VOID
UiAddMenuOption (
IN CHAR16 *String,
IN FRAMEWORK_EFI_HII_HANDLE Handle,
IN EFI_TAG *Tag,
IN VOID *FormBinary,
IN UINTN IfrNumber
)
;
VOID
UiAddSubMenuOption (
IN CHAR16 *String,
IN FRAMEWORK_EFI_HII_HANDLE Handle,
IN EFI_TAG *Tag,
IN UINTN TagIndex,
IN UINT16 FormId,
IN UINT16 MenuItemCount
)
;
UI_MENU_OPTION *
UiDisplayMenu (
IN BOOLEAN SubMenu,
IN EFI_FILE_FORM_TAGS *FileFormTagsHead,
OUT FRAMEWORK_EFI_IFR_DATA_ARRAY *PageData
)
;
VOID
InitPage (
VOID
)
;
UI_MENU_OPTION *
SetupBrowser (
IN UI_MENU_OPTION *Selection,
IN BOOLEAN Callback,
IN EFI_FILE_FORM_TAGS *FileFormTagsHead,
IN UINT8 *CallbackData
)
;
VOID
SetUnicodeMem (
IN VOID *Buffer,
IN UINTN Size,
IN CHAR16 Value
)
;
EFI_STATUS
UiWaitForSingleEvent (
IN EFI_EVENT Event,
IN UINT64 Timeout OPTIONAL
)
;
VOID
CreatePopUp (
IN UINTN ScreenWidth,
IN UINTN NumberOfLines,
IN CHAR16 *ArrayOfStrings,
...
)
;
EFI_STATUS
ReadString (
IN UI_MENU_OPTION *MenuOption,
OUT CHAR16 *StringPtr
)
;
EFI_STATUS
ReadPassword (
IN UI_MENU_OPTION *MenuOption,
IN BOOLEAN PromptForPassword,
IN EFI_TAG *Tag,
IN FRAMEWORK_EFI_IFR_DATA_ARRAY *PageData,
IN BOOLEAN SecondEntry,
IN EFI_FILE_FORM_TAGS *FileFormTags,
OUT CHAR16 *StringPtr
)
;
VOID
EncodePassword (
IN CHAR16 *Password,
IN UINT8 MaxSize
)
;
EFI_STATUS
GetSelectionInputPopUp (
IN UI_MENU_OPTION *MenuOption,
IN EFI_TAG *Tag,
IN UINTN ValueCount,
OUT UINT16 *Value,
OUT UINT16 *KeyValue
)
;
EFI_STATUS
GetSelectionInputLeftRight (
IN UI_MENU_OPTION *MenuOption,
IN EFI_TAG *Tag,
IN UINTN ValueCount,
OUT UINT16 *Value
)
;
EFI_STATUS
GetNumericInput (
IN UI_MENU_OPTION *MenuOption,
IN EFI_FILE_FORM_TAGS *FileFormTagsHead,
IN BOOLEAN ManualInput,
IN EFI_TAG *Tag,
IN UINTN NumericType,
OUT UINT16 *Value
)
;
VOID
UpdateStatusBar (
IN UINTN MessageType,
IN UINT8 Flags,
IN BOOLEAN State
)
;
EFI_STATUS
ProcessOptions (
IN UI_MENU_OPTION *MenuOption,
IN BOOLEAN Selected,
IN EFI_FILE_FORM_TAGS *FileFormTagsHead,
IN FRAMEWORK_EFI_IFR_DATA_ARRAY *PageData,
OUT CHAR16 **OptionString
)
;
VOID
ProcessHelpString (
IN CHAR16 *StringPtr,
OUT CHAR16 **FormattedString,
IN UINTN RowCount
)
;
VOID
UpdateKeyHelp (
IN UI_MENU_OPTION *Selection,
IN BOOLEAN Selected
)
;
BOOLEAN
ValueIsNotValid (
IN BOOLEAN Complex,
IN UINT16 Value,
IN EFI_TAG *Tag,
IN EFI_FILE_FORM_TAGS *FileFormTags,
IN STRING_REF *PopUp
)
;
VOID
FreeData (
IN EFI_FILE_FORM_TAGS *FileFormTagsHead,
IN CHAR16 *FormattedString,
IN CHAR16 *OptionString
)
;
VOID
ClearLines (
UINTN LeftColumn,
UINTN RightColumn,
UINTN TopRow,
UINTN BottomRow,
UINTN TextAttribute
)
;
UINTN
GetStringWidth (
CHAR16 *String
)
;
UINT16
GetLineByWidth (
IN CHAR16 *InputString,
IN UINT16 LineWidth,
IN OUT UINTN *Index,
OUT CHAR16 **OutputString
)
;
UINT16
GetWidth (
IN EFI_TAG *Tag,
IN FRAMEWORK_EFI_HII_HANDLE Handle
)
;
VOID
NewStrCat (
CHAR16 *Destination,
CHAR16 *Source
)
;
VOID
IfrToFormTag (
IN UINT8 OpCode,
IN EFI_TAG *TargetTag,
IN VOID *FormData,
EFI_VARIABLE_DEFINITION *VariableDefinitionsHead
)
;
EFI_STATUS
ExtractNvValue (
IN EFI_FILE_FORM_TAGS *FileFormTags,
IN UINT16 VariableId,
IN UINT16 VariableSize,
IN UINT16 OffsetValue,
OUT VOID **Buffer
)
;
EFI_STATUS
ExtractRequestedNvMap (
IN EFI_FILE_FORM_TAGS *FileFormTags,
IN UINT16 VariableId,
OUT EFI_VARIABLE_DEFINITION **VariableDefinition
)
;
BOOLEAN
ValueIsScroll (
IN BOOLEAN Direction,
IN LIST_ENTRY *CurrentPos
)
;
UINTN
AdjustDateAndTimePosition (
IN BOOLEAN DirectionUp,
IN LIST_ENTRY **CurrentPosition
)
;
EFI_STATUS
WaitForKeyStroke (
OUT EFI_INPUT_KEY *Key
)
;
#endif // _UI_H