Display engine base on class opcode to detect whether in
frontpage form.Now remove class/subclass and use ClassGuid to
judge whether in frontpage form

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan...@intel.com>
---
.../Universal/BdsDxe/FrontPageVfr.Vfr              |  4 +---
MdeModulePkg/Include/Guid/FormsetClassGuid.h       | 25 ++++++++++++++++++++++
.../CustomizedDisplayLib/CustomizedDisplayLib.inf  |  3 ++-
.../CustomizedDisplayLibInternal.c                 | 23 +++++++++++++++++++-
.../CustomizedDisplayLibInternal.h                 |  3 ++-
MdeModulePkg/MdeModulePkg.dec                      |  3 +++
MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c  |  1 +
.../Universal/SetupBrowserDxe/Presentation.c       | 17 +++++++++++++++
MdeModulePkg/Universal/SetupBrowserDxe/Setup.h     |  1 +
9 files changed, 74 insertions(+), 6 deletions(-)
create mode 100644 MdeModulePkg/Include/Guid/FormsetClassGuid.h

diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr 
b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr
index d5fe4f4..a2d92df 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr
@@ -1,10 +1,10 @@
///** @file
//
 //    Browser formset.
//
-//  Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
+//  Copyright (c) 2007 - 2015, 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
//
@@ -39,12 +39,10 @@
formset
   guid     = FRONT_PAGE_FORMSET_GUID,
   title    = STRING_TOKEN(STR_FRONT_PAGE_TITLE),
   help     = STRING_TOKEN(STR_NULL_STRING),
   classguid = FRONT_PAGE_FORMSET_GUID,
-  class    = FRONT_PAGE_CLASS,
-  subclass = FRONT_PAGE_SUBCLASS,
   form formid = FRONT_PAGE_FORM_ID,
        title  = STRING_TOKEN(STR_FRONT_PAGE_TITLE);
     banner
diff --git a/MdeModulePkg/Include/Guid/FormsetClassGuid.h 
b/MdeModulePkg/Include/Guid/FormsetClassGuid.h
new file mode 100644
index 0000000..1bd2b44
--- /dev/null
+++ b/MdeModulePkg/Include/Guid/FormsetClassGuid.h
@@ -0,0 +1,25 @@
+/** @file
+  ClassGuid defined in FormSet.
+
+Copyright (c) 2015, 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 __FORMSET_CLASS_GUID_H__
+#define __FORMSET_CLASS_GUID_H__
+
+#define FRONT_PAGE_FORMSET_GUID \
+  { \
+    0x9e0c30bc, 0x3f06, 0x4ba6, {0x82, 0x88, 0x9, 0x17, 0x9b, 0x85, 0x5d, 
0xbe} \
+  }
+
+extern EFI_GUID gFrontPageFormSetGuid;
+
+#endif
diff --git a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf 
b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
index cdcc256..d699275 100644
--- a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
+++ b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
@@ -1,9 +1,9 @@
## @file
# Customize display library used by display engine.
#
-#  Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2013 - 2015, 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
@@ -52,10 +52,11 @@
   DevicePathLib
   PcdLib
 [Guids]
   gEfiIfrTianoGuid  ## SOMETIMES_CONSUMES   ## UNDEFINED
+  gFrontPageFormSetGuid  ## SOMETIMES_CONSUMES   ## UNDEFINED

 [Protocols]
 [Pcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserSubtitleTextColor               ## 
CONSUMES
diff --git 
a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c 
b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c
index ad4bc9a..d6cf698 100644
--- a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c
+++ b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c
@@ -1,10 +1,10 @@
/** @file
   This library class defines a set of interfaces to customize Display module
-Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2013-2015, 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.

@@ -254,11 +254,32 @@ PrintFramework (
VOID
ProcessUserOpcode(
   IN  EFI_IFR_OP_HEADER         *OpCodeData
   )
{
+  EFI_GUID *   ClassGuid;
+  UINT8        ClassGuidNum;
+
+  ClassGuid    = NULL;
+  ClassGuidNum = 0;
+
   switch (OpCodeData->OpCode) {
+    case EFI_IFR_FORM_SET_OP:
+      //
+      // process the statement outside of form,if it is formset op, get its 
classguid and compared with gFrontPageFormSetGuid
+      //
+      ClassGuidNum = (UINT8)(((EFI_IFR_FORM_SET *)OpCodeData)->Flags & 0x3);
+      ClassGuid    = (EFI_GUID *)(VOID *)((UINT8 *)OpCodeData + sizeof 
(EFI_IFR_FORM_SET));
+      while (ClassGuidNum-- > 0){
+        if (CompareGuid(&gFrontPageFormSetGuid,ClassGuid)){
+          gClassOfVfr = FORMSET_CLASS_FRONT_PAGE;
+          break;
+        }
+        ClassGuid ++;
+      }
+      break;
+
     case EFI_IFR_GUID_OP:
       if (CompareGuid (&gEfiIfrTianoGuid, (EFI_GUID *)((CHAR8*) OpCodeData + 
sizeof (EFI_IFR_OP_HEADER)))) {
         //
         // Tiano specific GUIDed opcodes
         //
diff --git 
a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.h 
b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.h
index 7342b50..e5f4526 100644
--- a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.h
+++ b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.h
@@ -1,10 +1,10 @@
/** @file
   This library class defines a set of interfaces to customize Display module
-Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2013-2015, 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.

@@ -35,10 +35,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
EXPRESS OR IMPLIED.
#include <Protocol/DevicePathFromText.h>
 #include <Guid/MdeModuleHii.h>
#include <Guid/HiiPlatformSetupFormset.h>
#include <Guid/HiiFormMapMethodGuid.h>
+#include <Guid/FormsetClassGuid.h>
 #include <Library/PrintLib.h>
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 4d89a57..89f1b07 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -291,10 +291,13 @@
   ## GUID indicates the LZMA custom compress/decompress algorithm.
   #  Include/Guid/LzmaDecompress.h
   gLzmaCustomDecompressGuid      = { 0xEE4E5898, 0x3914, 0x4259, { 0x9D, 0x6E, 
0xDC, 0x7B, 0xD7, 0x94, 0x03, 0xCF }}
   gLzmaF86CustomDecompressGuid     = { 0xD42AE6BD, 0x1352, 0x4bfb, { 0x90, 
0x9A, 0xCA, 0x72, 0xA6, 0xEA, 0xE8, 0x89 }}
+  #  Include/Guid/FormsetClassGuid.h
+  gFrontPageFormSetGuid           = { 0x9e0c30bc, 0x3f06, 0x4ba6, {0x82, 0x88, 
0x9, 0x17, 0x9b, 0x85, 0x5d, 0xbe }}
+
[Ppis]
   ## Include/Ppi/AtaController.h
   gPeiAtaControllerPpiGuid       = { 0xa45e60d1, 0xc719, 0x44aa, { 0xb0, 0x7a, 
0xaa, 0x77, 0x7f, 0x85, 0x90, 0x6d }}
   ## Include/Ppi/UsbHostController.h
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c 
b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
index 3785c32..4540560 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
@@ -1707,10 +1707,11 @@ ParseOpCodes (
         return EFI_INVALID_PARAMETER;
       }
       CopyMem (&FormSet->FormSetTitle, &((EFI_IFR_FORM_SET *) 
OpCodeData)->FormSetTitle, sizeof (EFI_STRING_ID));
       CopyMem (&FormSet->Help,         &((EFI_IFR_FORM_SET *) 
OpCodeData)->Help,         sizeof (EFI_STRING_ID));
+      FormSet->OpCode = (EFI_IFR_OP_HEADER *) OpCodeData;//save the opcode 
address of formset
       if (OpCodeLength > OFFSET_OF (EFI_IFR_FORM_SET, Flags)) {
         //
         // The formset OpCode contains ClassGuid
         //
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c 
b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
index 002a86a..bdf2f8a 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
@@ -544,10 +544,27 @@ AddStatementToDisplayForm (
     InsertTailList(&gDisplayFormData.StatementListOSF, 
&DisplayStatement->DisplayLink);
   }
   //
+  // Process the formset which has ClassGuid and treat this formset as 
statement outside the form.
+  //
+  if (&gCurrentSelection->FormSet->ClassGuid != NULL) {
+    DisplayStatement = AllocateZeroPool (sizeof 
(FORM_DISPLAY_ENGINE_STATEMENT));
+    ASSERT (DisplayStatement != NULL);
+
+    DisplayStatement->Signature = FORM_DISPLAY_ENGINE_STATEMENT_SIGNATURE;
+    DisplayStatement->Version   = FORM_DISPLAY_ENGINE_STATEMENT_VERSION_1;
+    DisplayStatement->OpCode = gCurrentSelection->FormSet->OpCode;
+
+    InitializeListHead (&DisplayStatement->NestStatementList);
+    InitializeListHead (&DisplayStatement->OptionListHead);
+
+    InsertTailList(&gDisplayFormData.StatementListOSF, 
&DisplayStatement->DisplayLink);
+  }
+
+  //
   // Process the statement in this form.
   //
   Link = GetFirstNode (&gCurrentSelection->Form->StatementListHead);
   while (!IsNull (&gCurrentSelection->Form->StatementListHead, Link)) {
     Statement = FORM_BROWSER_STATEMENT_FROM_LINK (Link);
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h 
b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
index c8aa9dd..82bc23b 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
@@ -452,10 +452,11 @@ typedef struct {
   UINT8                           NumberOfClassGuid;
   EFI_GUID                        ClassGuid[3];         // Up to three 
ClassGuid
   UINT16                          Class;                // Tiano extended 
Class code
   UINT16                          SubClass;             // Tiano extended 
Subclass code
   EFI_IMAGE_ID                    ImageId;
+  EFI_IFR_OP_HEADER               *OpCode;              //mainly for formset 
op to get ClassGuid
   FORM_BROWSER_STATEMENT          *StatementBuffer;     // Buffer for all 
Statements and Questions
   EXPRESSION_OPCODE               *ExpressionBuffer;    // Buffer for all 
Expression OpCode
   FORM_BROWSER_FORM               *SaveFailForm;        // The form which 
failed to save.
   FORM_BROWSER_STATEMENT          *SaveFailStatement;   // The Statement which 
failed to save.
--
1.9.5.msysgit.1
------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to