summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal
diff options
context:
space:
mode:
authorEric Dong <eric.dong@intel.com>2015-05-06 09:29:39 +0000
committerydong10 <ydong10@Edk2>2015-05-06 09:29:39 +0000
commit790447b2a515cdce5b13b8bf6e49785aaa58723b (patch)
treef1560570703be404c2698163ffffb7d6a12f9f62 /MdeModulePkg/Universal
parente2a5feb9d6c468c0ddb0caed2581d10585819db5 (diff)
downloadedk2-platforms-790447b2a515cdce5b13b8bf6e49785aaa58723b.tar.xz
MdeModluePkg: Enable refresh opcode to refresh the entire form.
Contributed-under: TianoCore Contribution Agreement 1.0 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@17334 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal')
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c20
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c68
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Setup.h1
3 files changed, 83 insertions, 6 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
index 0e9c82363d..a4a2478c48 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
@@ -2479,8 +2479,24 @@ ParseOpCodes (
// Refresh guid.
//
case EFI_IFR_REFRESH_ID_OP:
- ASSERT (ParentStatement != NULL);
- CopyMem (&ParentStatement->RefreshGuid, &((EFI_IFR_REFRESH_ID *) OpCodeData)->RefreshEventGroupId, sizeof (EFI_GUID));
+ //
+ // Get ScopeOpcode from top of stack
+ //
+ PopScope (&ScopeOpCode);
+ PushScope (ScopeOpCode);
+
+ switch (ScopeOpCode) {
+ case EFI_IFR_FORM_OP:
+ case EFI_IFR_FORM_MAP_OP:
+ ASSERT (CurrentForm != NULL);
+ CopyMem (&CurrentForm->RefreshGuid, &((EFI_IFR_REFRESH_ID *) OpCodeData)->RefreshEventGroupId, sizeof (EFI_GUID));
+ break;
+
+ default:
+ ASSERT (ParentStatement != NULL);
+ CopyMem (&ParentStatement->RefreshGuid, &((EFI_IFR_REFRESH_ID *) OpCodeData)->RefreshEventGroupId, sizeof (EFI_GUID));
+ break;
+ }
break;
//
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
index aa1fedc7b4..c86fdf5856 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
@@ -178,7 +178,7 @@ UpdateStatement (
**/
VOID
EFIAPI
-RefreshEventNotify(
+RefreshEventNotifyForStatement(
IN EFI_EVENT Event,
IN VOID *Context
)
@@ -190,6 +190,23 @@ RefreshEventNotify(
gBS->SignalEvent (mValueChangedEvent);
}
+/**
+ Refresh the questions within this form.
+
+ @param Event The event which has this function related.
+ @param Context The input context info related to this event or the status code return to the caller.
+**/
+VOID
+EFIAPI
+RefreshEventNotifyForForm(
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ )
+{
+ gCurrentSelection->Action = UI_ACTION_REFRESH_FORMSET;
+
+ gBS->SignalEvent (mValueChangedEvent);
+}
/**
Create refresh hook event for statement which has refresh event or interval.
@@ -198,7 +215,7 @@ RefreshEventNotify(
**/
VOID
-CreateRefreshEvent (
+CreateRefreshEventForStatement (
IN FORM_BROWSER_STATEMENT *Statement
)
{
@@ -212,7 +229,7 @@ CreateRefreshEvent (
Status = gBS->CreateEventEx (
EVT_NOTIFY_SIGNAL,
TPL_CALLBACK,
- RefreshEventNotify,
+ RefreshEventNotifyForStatement,
Statement,
&Statement->RefreshGuid,
&RefreshEvent);
@@ -225,6 +242,39 @@ CreateRefreshEvent (
}
/**
+ Create refresh hook event for statement which has refresh event or interval.
+
+ @param Statement The statement need to check.
+
+**/
+VOID
+CreateRefreshEventForForm (
+ IN FORM_BROWSER_FORM *Form
+ )
+{
+ EFI_STATUS Status;
+ EFI_EVENT RefreshEvent;
+ FORM_BROWSER_REFRESH_EVENT_NODE *EventNode;
+
+ //
+ // If question has refresh guid, create the notify function.
+ //
+ Status = gBS->CreateEventEx (
+ EVT_NOTIFY_SIGNAL,
+ TPL_CALLBACK,
+ RefreshEventNotifyForForm,
+ Form,
+ &Form->RefreshGuid,
+ &RefreshEvent);
+ ASSERT_EFI_ERROR (Status);
+
+ EventNode = AllocateZeroPool (sizeof (FORM_BROWSER_REFRESH_EVENT_NODE));
+ ASSERT (EventNode != NULL);
+ EventNode->RefreshEvent = RefreshEvent;
+ InsertTailList(&mRefreshEventList, &EventNode->Link);
+}
+
+/**
Initialize the Display statement structure data.
@@ -308,7 +358,7 @@ InitializeDisplayStatement (
// Create the refresh event process function.
//
if (!CompareGuid (&Statement->RefreshGuid, &gZeroGuid)) {
- CreateRefreshEvent (Statement);
+ CreateRefreshEventForStatement (Statement);
}
//
@@ -560,6 +610,16 @@ AddStatementToDisplayForm (
}
//
+ // Create the refresh event process function for Form.
+ //
+ if (!CompareGuid (&gCurrentSelection->Form->RefreshGuid, &gZeroGuid)) {
+ CreateRefreshEventForForm (gCurrentSelection->Form);
+ if (gDisplayFormData.FormRefreshEvent == NULL) {
+ gDisplayFormData.FormRefreshEvent = mValueChangedEvent;
+ }
+ }
+
+ //
// Update hotkey list field.
//
if (gBrowserSettingScope == SystemLevel || FormEditable) {
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
index 9a300fa966..0a935e80af 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
@@ -406,6 +406,7 @@ typedef struct {
BOOLEAN ModalForm; // Whether this is a modal form.
BOOLEAN Locked; // Whether this form is locked.
+ EFI_GUID RefreshGuid; // Form refresh event guid.
LIST_ENTRY FormViewListHead; // List of type FORMID_INFO is Browser View Form History List.
LIST_ENTRY ExpressionListHead; // List of Expressions (FORM_EXPRESSION)