Update code to support guid op nest in the statement.
Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14995 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -322,7 +322,9 @@ ProcessExternedOpcode (
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
LIST_ENTRY *Link;
|
LIST_ENTRY *Link;
|
||||||
|
LIST_ENTRY *NestLink;
|
||||||
FORM_DISPLAY_ENGINE_STATEMENT *Statement;
|
FORM_DISPLAY_ENGINE_STATEMENT *Statement;
|
||||||
|
FORM_DISPLAY_ENGINE_STATEMENT *NestStatement;
|
||||||
|
|
||||||
Link = GetFirstNode (&FormData->StatementListOSF);
|
Link = GetFirstNode (&FormData->StatementListOSF);
|
||||||
while (!IsNull (&FormData->StatementListOSF, Link)) {
|
while (!IsNull (&FormData->StatementListOSF, Link)) {
|
||||||
@ -338,6 +340,15 @@ ProcessExternedOpcode (
|
|||||||
Link = GetNextNode (&FormData->StatementListHead, Link);
|
Link = GetNextNode (&FormData->StatementListHead, Link);
|
||||||
|
|
||||||
ProcessUserOpcode(Statement->OpCode);
|
ProcessUserOpcode(Statement->OpCode);
|
||||||
|
|
||||||
|
NestLink = GetFirstNode (&Statement->NestStatementList);
|
||||||
|
while (!IsNull (&Statement->NestStatementList, NestLink)) {
|
||||||
|
NestStatement = FORM_DISPLAY_ENGINE_STATEMENT_FROM_LINK (NestLink);
|
||||||
|
NestLink = GetNextNode (&Statement->NestStatementList, NestLink);
|
||||||
|
|
||||||
|
ProcessUserOpcode(NestStatement->OpCode);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,9 +54,6 @@
|
|||||||
gEdkiiFormDisplayEngineProtocolGuid
|
gEdkiiFormDisplayEngineProtocolGuid
|
||||||
gEdkiiFormBrowserEx2ProtocolGuid
|
gEdkiiFormBrowserEx2ProtocolGuid
|
||||||
|
|
||||||
[Guids]
|
|
||||||
gEfiIfrTianoGuid ## CONSUMES ## GUID
|
|
||||||
|
|
||||||
[Depex]
|
[Depex]
|
||||||
gEfiHiiDatabaseProtocolGuid AND gEfiHiiConfigRoutingProtocolGuid AND gEdkiiFormBrowserEx2ProtocolGuid
|
gEfiHiiDatabaseProtocolGuid AND gEfiHiiConfigRoutingProtocolGuid AND gEdkiiFormBrowserEx2ProtocolGuid
|
||||||
|
|
||||||
|
@ -699,6 +699,13 @@ ConvertStatementToMenu (
|
|||||||
NestStatement = FORM_DISPLAY_ENGINE_STATEMENT_FROM_LINK (NestLink);
|
NestStatement = FORM_DISPLAY_ENGINE_STATEMENT_FROM_LINK (NestLink);
|
||||||
NestLink = GetNextNode (&Statement->NestStatementList, NestLink);
|
NestLink = GetNextNode (&Statement->NestStatementList, NestLink);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Skip the opcode not recognized by Display core.
|
||||||
|
//
|
||||||
|
if (NestStatement->OpCode->OpCode == EFI_IFR_GUID_OP) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
UiAddMenuOption (NestStatement, &MenuItemCount, TRUE);
|
UiAddMenuOption (NestStatement, &MenuItemCount, TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
UINT16 mStatementIndex;
|
UINT16 mStatementIndex;
|
||||||
UINT16 mExpressionOpCodeIndex;
|
UINT16 mExpressionOpCodeIndex;
|
||||||
EFI_QUESTION_ID mUsedQuestionId;
|
EFI_QUESTION_ID mUsedQuestionId;
|
||||||
BOOLEAN mInScopeSubtitle;
|
|
||||||
extern LIST_ENTRY gBrowserStorageList;
|
extern LIST_ENTRY gBrowserStorageList;
|
||||||
/**
|
/**
|
||||||
Initialize Statement header members.
|
Initialize Statement header members.
|
||||||
@ -79,8 +78,6 @@ CreateStatement (
|
|||||||
CopyMem (Statement->Expression->Expression, GetConditionalExpressionList(ExpressStatement), (UINTN) (sizeof (FORM_EXPRESSION *) * ConditionalExprCount));
|
CopyMem (Statement->Expression->Expression, GetConditionalExpressionList(ExpressStatement), (UINTN) (sizeof (FORM_EXPRESSION *) * ConditionalExprCount));
|
||||||
}
|
}
|
||||||
|
|
||||||
Statement->InSubtitle = mInScopeSubtitle;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Insert this Statement into current Form
|
// Insert this Statement into current Form
|
||||||
//
|
//
|
||||||
@ -1039,6 +1036,39 @@ IsExpressionOpCode (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Tell whether this Operand is an Statement OpCode.
|
||||||
|
|
||||||
|
@param Operand Operand of an IFR OpCode.
|
||||||
|
|
||||||
|
@retval TRUE This is an Statement OpCode.
|
||||||
|
@retval FALSE Not an Statement OpCode.
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
IsStatementOpCode (
|
||||||
|
IN UINT8 Operand
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if ((Operand == EFI_IFR_SUBTITLE_OP) ||
|
||||||
|
(Operand == EFI_IFR_TEXT_OP) ||
|
||||||
|
(Operand == EFI_IFR_RESET_BUTTON_OP) ||
|
||||||
|
(Operand == EFI_IFR_REF_OP) ||
|
||||||
|
(Operand == EFI_IFR_ACTION_OP) ||
|
||||||
|
(Operand == EFI_IFR_NUMERIC_OP) ||
|
||||||
|
(Operand == EFI_IFR_ORDERED_LIST_OP) ||
|
||||||
|
(Operand == EFI_IFR_CHECKBOX_OP) ||
|
||||||
|
(Operand == EFI_IFR_STRING_OP) ||
|
||||||
|
(Operand == EFI_IFR_PASSWORD_OP) ||
|
||||||
|
(Operand == EFI_IFR_DATE_OP) ||
|
||||||
|
(Operand == EFI_IFR_TIME_OP) ||
|
||||||
|
(Operand == EFI_IFR_GUID_OP) ||
|
||||||
|
(Operand == EFI_IFR_ONE_OF_OP)) {
|
||||||
|
return TRUE;
|
||||||
|
} else {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Calculate number of Statemens(Questions) and Expression OpCodes.
|
Calculate number of Statemens(Questions) and Expression OpCodes.
|
||||||
@ -1100,6 +1130,7 @@ ParseOpCodes (
|
|||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
FORM_BROWSER_FORM *CurrentForm;
|
FORM_BROWSER_FORM *CurrentForm;
|
||||||
FORM_BROWSER_STATEMENT *CurrentStatement;
|
FORM_BROWSER_STATEMENT *CurrentStatement;
|
||||||
|
FORM_BROWSER_STATEMENT *ParentStatement;
|
||||||
EXPRESSION_OPCODE *ExpressionOpCode;
|
EXPRESSION_OPCODE *ExpressionOpCode;
|
||||||
FORM_EXPRESSION *CurrentExpression;
|
FORM_EXPRESSION *CurrentExpression;
|
||||||
UINT8 Operand;
|
UINT8 Operand;
|
||||||
@ -1132,7 +1163,6 @@ ParseOpCodes (
|
|||||||
BOOLEAN InScopeDisable;
|
BOOLEAN InScopeDisable;
|
||||||
INTN ConditionalExprCount;
|
INTN ConditionalExprCount;
|
||||||
|
|
||||||
mInScopeSubtitle = FALSE;
|
|
||||||
SuppressForQuestion = FALSE;
|
SuppressForQuestion = FALSE;
|
||||||
SuppressForOption = FALSE;
|
SuppressForOption = FALSE;
|
||||||
InScopeDisable = FALSE;
|
InScopeDisable = FALSE;
|
||||||
@ -1180,6 +1210,7 @@ ParseOpCodes (
|
|||||||
|
|
||||||
CurrentForm = NULL;
|
CurrentForm = NULL;
|
||||||
CurrentStatement = NULL;
|
CurrentStatement = NULL;
|
||||||
|
ParentStatement = NULL;
|
||||||
|
|
||||||
ResetScopeStack ();
|
ResetScopeStack ();
|
||||||
|
|
||||||
@ -1270,8 +1301,8 @@ ParseOpCodes (
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case EFI_IFR_THIS_OP:
|
case EFI_IFR_THIS_OP:
|
||||||
ASSERT (CurrentStatement != NULL);
|
ASSERT (ParentStatement != NULL);
|
||||||
ExpressionOpCode->QuestionId = CurrentStatement->QuestionId;
|
ExpressionOpCode->QuestionId = ParentStatement->QuestionId;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EFI_IFR_SECURITY_OP:
|
case EFI_IFR_SECURITY_OP:
|
||||||
@ -1685,9 +1716,6 @@ ParseOpCodes (
|
|||||||
|
|
||||||
CurrentStatement->Flags = ((EFI_IFR_SUBTITLE *) OpCodeData)->Flags;
|
CurrentStatement->Flags = ((EFI_IFR_SUBTITLE *) OpCodeData)->Flags;
|
||||||
CurrentStatement->FakeQuestionId = mUsedQuestionId++;
|
CurrentStatement->FakeQuestionId = mUsedQuestionId++;
|
||||||
if (Scope != 0) {
|
|
||||||
mInScopeSubtitle = TRUE;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EFI_IFR_TEXT_OP:
|
case EFI_IFR_TEXT_OP:
|
||||||
@ -1927,7 +1955,7 @@ ParseOpCodes (
|
|||||||
//
|
//
|
||||||
// Insert to Default Value list of current Question
|
// Insert to Default Value list of current Question
|
||||||
//
|
//
|
||||||
InsertTailList (&CurrentStatement->DefaultListHead, &CurrentDefault->Link);
|
InsertTailList (&ParentStatement->DefaultListHead, &CurrentDefault->Link);
|
||||||
|
|
||||||
if (Scope != 0) {
|
if (Scope != 0) {
|
||||||
InScopeDefault = TRUE;
|
InScopeDefault = TRUE;
|
||||||
@ -1966,16 +1994,15 @@ ParseOpCodes (
|
|||||||
CopyMem (CurrentOption->SuppressExpression->Expression, GetConditionalExpressionList(ExpressOption), (UINTN) (sizeof (FORM_EXPRESSION *) * ConditionalExprCount));
|
CopyMem (CurrentOption->SuppressExpression->Expression, GetConditionalExpressionList(ExpressOption), (UINTN) (sizeof (FORM_EXPRESSION *) * ConditionalExprCount));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ASSERT (ParentStatement != NULL);
|
||||||
//
|
//
|
||||||
// Insert to Option list of current Question
|
// Insert to Option list of current Question
|
||||||
//
|
//
|
||||||
InsertTailList (&CurrentStatement->OptionListHead, &CurrentOption->Link);
|
InsertTailList (&ParentStatement->OptionListHead, &CurrentOption->Link);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Now we know the Storage width of nested Ordered List
|
// Now we know the Storage width of nested Ordered List
|
||||||
//
|
//
|
||||||
ASSERT (CurrentStatement != NULL);
|
if ((ParentStatement->Operand == EFI_IFR_ORDERED_LIST_OP) && (ParentStatement->BufferValue == NULL)) {
|
||||||
if ((CurrentStatement->Operand == EFI_IFR_ORDERED_LIST_OP) && (CurrentStatement->BufferValue == NULL)) {
|
|
||||||
Width = 1;
|
Width = 1;
|
||||||
switch (CurrentOption->Value.Type) {
|
switch (CurrentOption->Value.Type) {
|
||||||
case EFI_IFR_TYPE_NUM_SIZE_8:
|
case EFI_IFR_TYPE_NUM_SIZE_8:
|
||||||
@ -2001,15 +2028,15 @@ ParseOpCodes (
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
CurrentStatement->StorageWidth = (UINT16) (CurrentStatement->MaxContainers * Width);
|
ParentStatement->StorageWidth = (UINT16) (ParentStatement->MaxContainers * Width);
|
||||||
CurrentStatement->BufferValue = AllocateZeroPool (CurrentStatement->StorageWidth);
|
ParentStatement->BufferValue = AllocateZeroPool (ParentStatement->StorageWidth);
|
||||||
CurrentStatement->ValueType = CurrentOption->Value.Type;
|
ParentStatement->ValueType = CurrentOption->Value.Type;
|
||||||
if (CurrentStatement->HiiValue.Type == EFI_IFR_TYPE_BUFFER) {
|
if (ParentStatement->HiiValue.Type == EFI_IFR_TYPE_BUFFER) {
|
||||||
CurrentStatement->HiiValue.Buffer = CurrentStatement->BufferValue;
|
ParentStatement->HiiValue.Buffer = ParentStatement->BufferValue;
|
||||||
CurrentStatement->HiiValue.BufferLen = CurrentStatement->StorageWidth;
|
ParentStatement->HiiValue.BufferLen = ParentStatement->StorageWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
InitializeRequestElement (FormSet, CurrentStatement, CurrentForm);
|
InitializeRequestElement (FormSet, ParentStatement, CurrentForm);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -2026,10 +2053,10 @@ ParseOpCodes (
|
|||||||
|
|
||||||
if (Operand == EFI_IFR_NO_SUBMIT_IF_OP) {
|
if (Operand == EFI_IFR_NO_SUBMIT_IF_OP) {
|
||||||
CurrentExpression->Type = EFI_HII_EXPRESSION_NO_SUBMIT_IF;
|
CurrentExpression->Type = EFI_HII_EXPRESSION_NO_SUBMIT_IF;
|
||||||
InsertTailList (&CurrentStatement->NoSubmitListHead, &CurrentExpression->Link);
|
InsertTailList (&ParentStatement->NoSubmitListHead, &CurrentExpression->Link);
|
||||||
} else {
|
} else {
|
||||||
CurrentExpression->Type = EFI_HII_EXPRESSION_INCONSISTENT_IF;
|
CurrentExpression->Type = EFI_HII_EXPRESSION_INCONSISTENT_IF;
|
||||||
InsertTailList (&CurrentStatement->InconsistentListHead, &CurrentExpression->Link);
|
InsertTailList (&ParentStatement->InconsistentListHead, &CurrentExpression->Link);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -2049,7 +2076,7 @@ ParseOpCodes (
|
|||||||
CopyMem (&CurrentExpression->Error, &((EFI_IFR_WARNING_IF *) OpCodeData)->Warning, sizeof (EFI_STRING_ID));
|
CopyMem (&CurrentExpression->Error, &((EFI_IFR_WARNING_IF *) OpCodeData)->Warning, sizeof (EFI_STRING_ID));
|
||||||
CurrentExpression->TimeOut = ((EFI_IFR_WARNING_IF *) OpCodeData)->TimeOut;
|
CurrentExpression->TimeOut = ((EFI_IFR_WARNING_IF *) OpCodeData)->TimeOut;
|
||||||
CurrentExpression->Type = EFI_HII_EXPRESSION_WARNING_IF;
|
CurrentExpression->Type = EFI_HII_EXPRESSION_WARNING_IF;
|
||||||
InsertTailList (&CurrentStatement->WarningListHead, &CurrentExpression->Link);
|
InsertTailList (&ParentStatement->WarningListHead, &CurrentExpression->Link);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Take a look at next OpCode to see whether current expression consists
|
// Take a look at next OpCode to see whether current expression consists
|
||||||
@ -2160,8 +2187,8 @@ ParseOpCodes (
|
|||||||
// If it is NULL, 1) ParseOpCodes functions may parse the IFR wrongly. Or 2) the IFR
|
// If it is NULL, 1) ParseOpCodes functions may parse the IFR wrongly. Or 2) the IFR
|
||||||
// file is wrongly generated by tools such as VFR Compiler. There may be a bug in VFR Compiler.
|
// file is wrongly generated by tools such as VFR Compiler. There may be a bug in VFR Compiler.
|
||||||
//
|
//
|
||||||
ASSERT (CurrentStatement != NULL);
|
ASSERT (ParentStatement != NULL);
|
||||||
CurrentStatement->ValueExpression = CurrentExpression;
|
ParentStatement->ValueExpression = CurrentExpression;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -2199,8 +2226,8 @@ ParseOpCodes (
|
|||||||
// If it is NULL, 1) ParseOpCodes functions may parse the IFR wrongly. Or 2) the IFR
|
// If it is NULL, 1) ParseOpCodes functions may parse the IFR wrongly. Or 2) the IFR
|
||||||
// file is wrongly generated by tools such as VFR Compiler. There may be a bug in VFR Compiler.
|
// file is wrongly generated by tools such as VFR Compiler. There may be a bug in VFR Compiler.
|
||||||
//
|
//
|
||||||
ASSERT (CurrentStatement != NULL);
|
ASSERT (ParentStatement != NULL);
|
||||||
CurrentStatement->ReadExpression = CurrentExpression;
|
ParentStatement->ReadExpression = CurrentExpression;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Take a look at next OpCode to see whether current expression consists
|
// Take a look at next OpCode to see whether current expression consists
|
||||||
@ -2221,8 +2248,8 @@ ParseOpCodes (
|
|||||||
// If it is NULL, 1) ParseOpCodes functions may parse the IFR wrongly. Or 2) the IFR
|
// If it is NULL, 1) ParseOpCodes functions may parse the IFR wrongly. Or 2) the IFR
|
||||||
// file is wrongly generated by tools such as VFR Compiler. There may be a bug in VFR Compiler.
|
// file is wrongly generated by tools such as VFR Compiler. There may be a bug in VFR Compiler.
|
||||||
//
|
//
|
||||||
ASSERT (CurrentStatement != NULL);
|
ASSERT (ParentStatement != NULL);
|
||||||
CurrentStatement->WriteExpression = CurrentExpression;
|
ParentStatement->WriteExpression = CurrentExpression;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Take a look at next OpCode to see whether current expression consists
|
// Take a look at next OpCode to see whether current expression consists
|
||||||
@ -2264,8 +2291,8 @@ ParseOpCodes (
|
|||||||
// If it is NULL, 1) ParseOpCodes functions may parse the IFR wrongly. Or 2) the IFR
|
// If it is NULL, 1) ParseOpCodes functions may parse the IFR wrongly. Or 2) the IFR
|
||||||
// file is wrongly generated by tools such as VFR Compiler.
|
// file is wrongly generated by tools such as VFR Compiler.
|
||||||
//
|
//
|
||||||
ASSERT (CurrentStatement != NULL);
|
ASSERT (ParentStatement != NULL);
|
||||||
ImageId = &CurrentStatement->ImageId;
|
ImageId = &ParentStatement->ImageId;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2277,16 +2304,16 @@ ParseOpCodes (
|
|||||||
// Refresh
|
// Refresh
|
||||||
//
|
//
|
||||||
case EFI_IFR_REFRESH_OP:
|
case EFI_IFR_REFRESH_OP:
|
||||||
ASSERT (CurrentStatement != NULL);
|
ASSERT (ParentStatement != NULL);
|
||||||
CurrentStatement->RefreshInterval = ((EFI_IFR_REFRESH *) OpCodeData)->RefreshInterval;
|
ParentStatement->RefreshInterval = ((EFI_IFR_REFRESH *) OpCodeData)->RefreshInterval;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Refresh guid.
|
// Refresh guid.
|
||||||
//
|
//
|
||||||
case EFI_IFR_REFRESH_ID_OP:
|
case EFI_IFR_REFRESH_ID_OP:
|
||||||
ASSERT (CurrentStatement != NULL);
|
ASSERT (ParentStatement != NULL);
|
||||||
CopyMem (&CurrentStatement->RefreshGuid, &((EFI_IFR_REFRESH_ID *) OpCodeData)->RefreshEventGroupId, sizeof (EFI_GUID));
|
CopyMem (&ParentStatement->RefreshGuid, &((EFI_IFR_REFRESH_ID *) OpCodeData)->RefreshEventGroupId, sizeof (EFI_GUID));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -2314,8 +2341,8 @@ ParseOpCodes (
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ASSERT (CurrentStatement != NULL);
|
ASSERT (ParentStatement != NULL);
|
||||||
CurrentStatement->Locked = TRUE;
|
ParentStatement->Locked = TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -2335,6 +2362,13 @@ ParseOpCodes (
|
|||||||
ResetScopeStack ();
|
ResetScopeStack ();
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Parent statement end tag found, update ParentStatement info.
|
||||||
|
//
|
||||||
|
if (IsStatementOpCode(ScopeOpCode) && ParentStatement->Operand == ScopeOpCode) {
|
||||||
|
ParentStatement = ParentStatement->ParentStatement;
|
||||||
|
}
|
||||||
|
|
||||||
switch (ScopeOpCode) {
|
switch (ScopeOpCode) {
|
||||||
case EFI_IFR_FORM_SET_OP:
|
case EFI_IFR_FORM_SET_OP:
|
||||||
@ -2361,10 +2395,6 @@ ParseOpCodes (
|
|||||||
CurrentOption = NULL;
|
CurrentOption = NULL;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EFI_IFR_SUBTITLE_OP:
|
|
||||||
mInScopeSubtitle = FALSE;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case EFI_IFR_NO_SUBMIT_IF_OP:
|
case EFI_IFR_NO_SUBMIT_IF_OP:
|
||||||
case EFI_IFR_INCONSISTENT_IF_OP:
|
case EFI_IFR_INCONSISTENT_IF_OP:
|
||||||
case EFI_IFR_WARNING_IF_OP:
|
case EFI_IFR_WARNING_IF_OP:
|
||||||
@ -2456,6 +2486,17 @@ ParseOpCodes (
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (IsStatementOpCode(Operand)) {
|
||||||
|
CurrentStatement->ParentStatement = ParentStatement;
|
||||||
|
if (Scope != 0) {
|
||||||
|
//
|
||||||
|
// Scope != 0, other statements or options may nest in this statement.
|
||||||
|
// Update the ParentStatement info.
|
||||||
|
//
|
||||||
|
ParentStatement = CurrentStatement;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
|
@ -387,18 +387,17 @@ QuestionCheck (
|
|||||||
|
|
||||||
@param DisplayStatement Pointer to the display Statement data strucure.
|
@param DisplayStatement Pointer to the display Statement data strucure.
|
||||||
@param Statement The statement need to check.
|
@param Statement The statement need to check.
|
||||||
@param HostDisplayStatement Pointer to the display Statement data strucure which is an host statement.
|
|
||||||
**/
|
**/
|
||||||
VOID
|
VOID
|
||||||
InitializeDisplayStatement (
|
InitializeDisplayStatement (
|
||||||
IN OUT FORM_DISPLAY_ENGINE_STATEMENT *DisplayStatement,
|
IN OUT FORM_DISPLAY_ENGINE_STATEMENT *DisplayStatement,
|
||||||
IN FORM_BROWSER_STATEMENT *Statement,
|
IN FORM_BROWSER_STATEMENT *Statement
|
||||||
IN FORM_DISPLAY_ENGINE_STATEMENT *HostDisplayStatement
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
LIST_ENTRY *Link;
|
LIST_ENTRY *Link;
|
||||||
QUESTION_OPTION *Option;
|
QUESTION_OPTION *Option;
|
||||||
DISPLAY_QUESTION_OPTION *DisplayOption;
|
DISPLAY_QUESTION_OPTION *DisplayOption;
|
||||||
|
FORM_DISPLAY_ENGINE_STATEMENT *ParentStatement;
|
||||||
|
|
||||||
DisplayStatement->Signature = FORM_DISPLAY_ENGINE_STATEMENT_SIGNATURE;
|
DisplayStatement->Signature = FORM_DISPLAY_ENGINE_STATEMENT_SIGNATURE;
|
||||||
DisplayStatement->Version = FORM_DISPLAY_ENGINE_STATEMENT_VERSION_1;
|
DisplayStatement->Version = FORM_DISPLAY_ENGINE_STATEMENT_VERSION_1;
|
||||||
@ -502,8 +501,10 @@ InitializeDisplayStatement (
|
|||||||
// If this statement is nest in the subtitle, insert to the host statement.
|
// If this statement is nest in the subtitle, insert to the host statement.
|
||||||
// else insert to the form it belongs to.
|
// else insert to the form it belongs to.
|
||||||
//
|
//
|
||||||
if (Statement->InSubtitle) {
|
if (Statement->ParentStatement != NULL) {
|
||||||
InsertTailList(&HostDisplayStatement->NestStatementList, &DisplayStatement->DisplayLink);
|
ParentStatement = GetDisplayStatement(Statement->ParentStatement->OpCode);
|
||||||
|
ASSERT (ParentStatement != NULL);
|
||||||
|
InsertTailList(&ParentStatement->NestStatementList, &DisplayStatement->DisplayLink);
|
||||||
} else {
|
} else {
|
||||||
InsertTailList(&gDisplayFormData.StatementListHead, &DisplayStatement->DisplayLink);
|
InsertTailList(&gDisplayFormData.StatementListHead, &DisplayStatement->DisplayLink);
|
||||||
}
|
}
|
||||||
@ -625,14 +626,12 @@ AddStatementToDisplayForm (
|
|||||||
LIST_ENTRY *Link;
|
LIST_ENTRY *Link;
|
||||||
FORM_BROWSER_STATEMENT *Statement;
|
FORM_BROWSER_STATEMENT *Statement;
|
||||||
FORM_DISPLAY_ENGINE_STATEMENT *DisplayStatement;
|
FORM_DISPLAY_ENGINE_STATEMENT *DisplayStatement;
|
||||||
FORM_DISPLAY_ENGINE_STATEMENT *HostDisplayStatement;
|
|
||||||
UINT8 MinRefreshInterval;
|
UINT8 MinRefreshInterval;
|
||||||
EFI_EVENT RefreshIntervalEvent;
|
EFI_EVENT RefreshIntervalEvent;
|
||||||
FORM_BROWSER_REFRESH_EVENT_NODE *EventNode;
|
FORM_BROWSER_REFRESH_EVENT_NODE *EventNode;
|
||||||
BOOLEAN FormEditable;
|
BOOLEAN FormEditable;
|
||||||
UINT32 ExtraAttribute;
|
UINT32 ExtraAttribute;
|
||||||
|
|
||||||
HostDisplayStatement = NULL;
|
|
||||||
MinRefreshInterval = 0;
|
MinRefreshInterval = 0;
|
||||||
FormEditable = FALSE;
|
FormEditable = FALSE;
|
||||||
|
|
||||||
@ -686,21 +685,13 @@ AddStatementToDisplayForm (
|
|||||||
//
|
//
|
||||||
// Initialize this statement and add it to the display form.
|
// Initialize this statement and add it to the display form.
|
||||||
//
|
//
|
||||||
InitializeDisplayStatement(DisplayStatement, Statement, HostDisplayStatement);
|
InitializeDisplayStatement(DisplayStatement, Statement);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Set the extra attribute.
|
// Set the extra attribute.
|
||||||
//
|
//
|
||||||
DisplayStatement->Attribute |= ExtraAttribute;
|
DisplayStatement->Attribute |= ExtraAttribute;
|
||||||
|
|
||||||
//
|
|
||||||
// Save the Host statement info.
|
|
||||||
// Host statement may has nest statement follow it.
|
|
||||||
//
|
|
||||||
if (!Statement->InSubtitle) {
|
|
||||||
HostDisplayStatement = DisplayStatement;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Statement->Storage != NULL) {
|
if (Statement->Storage != NULL) {
|
||||||
FormEditable = TRUE;
|
FormEditable = TRUE;
|
||||||
}
|
}
|
||||||
|
@ -288,9 +288,11 @@ typedef enum {
|
|||||||
ExpressOption
|
ExpressOption
|
||||||
} EXPRESS_LEVEL;
|
} EXPRESS_LEVEL;
|
||||||
|
|
||||||
|
typedef struct _FORM_BROWSER_STATEMENT FORM_BROWSER_STATEMENT;
|
||||||
|
|
||||||
#define FORM_BROWSER_STATEMENT_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'A')
|
#define FORM_BROWSER_STATEMENT_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'A')
|
||||||
|
|
||||||
typedef struct {
|
struct _FORM_BROWSER_STATEMENT{
|
||||||
UINTN Signature;
|
UINTN Signature;
|
||||||
LIST_ENTRY Link;
|
LIST_ENTRY Link;
|
||||||
|
|
||||||
@ -352,7 +354,8 @@ typedef struct {
|
|||||||
|
|
||||||
EFI_IMAGE_ID ImageId; // nested EFI_IFR_IMAGE
|
EFI_IMAGE_ID ImageId; // nested EFI_IFR_IMAGE
|
||||||
UINT8 RefreshInterval; // nested EFI_IFR_REFRESH, refresh interval(in seconds) for Question value, 0 means no refresh
|
UINT8 RefreshInterval; // nested EFI_IFR_REFRESH, refresh interval(in seconds) for Question value, 0 means no refresh
|
||||||
BOOLEAN InSubtitle; // nesting inside of EFI_IFR_SUBTITLE
|
|
||||||
|
FORM_BROWSER_STATEMENT *ParentStatement;
|
||||||
|
|
||||||
LIST_ENTRY InconsistentListHead;// nested inconsistent expression list (FORM_EXPRESSION)
|
LIST_ENTRY InconsistentListHead;// nested inconsistent expression list (FORM_EXPRESSION)
|
||||||
LIST_ENTRY NoSubmitListHead; // nested nosubmit expression list (FORM_EXPRESSION)
|
LIST_ENTRY NoSubmitListHead; // nested nosubmit expression list (FORM_EXPRESSION)
|
||||||
@ -361,7 +364,7 @@ typedef struct {
|
|||||||
|
|
||||||
FORM_EXPRESSION *ReadExpression; // nested EFI_IFR_READ, provide this question value by read expression.
|
FORM_EXPRESSION *ReadExpression; // nested EFI_IFR_READ, provide this question value by read expression.
|
||||||
FORM_EXPRESSION *WriteExpression; // nested EFI_IFR_WRITE, evaluate write expression after this question value is set.
|
FORM_EXPRESSION *WriteExpression; // nested EFI_IFR_WRITE, evaluate write expression after this question value is set.
|
||||||
} FORM_BROWSER_STATEMENT;
|
};
|
||||||
|
|
||||||
#define FORM_BROWSER_STATEMENT_FROM_LINK(a) CR (a, FORM_BROWSER_STATEMENT, Link, FORM_BROWSER_STATEMENT_SIGNATURE)
|
#define FORM_BROWSER_STATEMENT_FROM_LINK(a) CR (a, FORM_BROWSER_STATEMENT, Link, FORM_BROWSER_STATEMENT_SIGNATURE)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user