From 31bb486c913795c8b67d1c4dbaae2bdec4943fc9 Mon Sep 17 00:00:00 2001 From: raywu Date: Thu, 13 Sep 2018 16:11:56 +0800 Subject: SLP1.0 / SLP2.0 / Default Password / Logo / Fix Boot Order --- EDK/MiniSetup/EzportPlus/EzportPlus.cif | 14 + EDK/MiniSetup/EzportPlus/EzportPlus.mak | 130 +++ EDK/MiniSetup/EzportPlus/EzportPlus.sdl | 1073 +++++++++++++++++++++++ EDK/MiniSetup/EzportPlus/ezportplus.c | 1251 +++++++++++++++++++++++++++ EDK/MiniSetup/EzportPlus/ezportplus.h | 141 +++ EDK/MiniSetup/EzportPlus/style.c | 625 ++++++++++++++ EDK/MiniSetup/EzportPlus/style.h | 255 ++++++ EDK/MiniSetup/EzportPlus/stylecommon.c | 1437 +++++++++++++++++++++++++++++++ 8 files changed, 4926 insertions(+) create mode 100644 EDK/MiniSetup/EzportPlus/EzportPlus.cif create mode 100644 EDK/MiniSetup/EzportPlus/EzportPlus.mak create mode 100644 EDK/MiniSetup/EzportPlus/EzportPlus.sdl create mode 100644 EDK/MiniSetup/EzportPlus/ezportplus.c create mode 100644 EDK/MiniSetup/EzportPlus/ezportplus.h create mode 100644 EDK/MiniSetup/EzportPlus/style.c create mode 100644 EDK/MiniSetup/EzportPlus/style.h create mode 100644 EDK/MiniSetup/EzportPlus/stylecommon.c (limited to 'EDK/MiniSetup/EzportPlus') diff --git a/EDK/MiniSetup/EzportPlus/EzportPlus.cif b/EDK/MiniSetup/EzportPlus/EzportPlus.cif new file mode 100644 index 0000000..ca213fe --- /dev/null +++ b/EDK/MiniSetup/EzportPlus/EzportPlus.cif @@ -0,0 +1,14 @@ + + name = "TSE Sources - Style - EzportPlus" + category = ModulePart + LocalRoot = "EDK\MiniSetup\EzportPlus" + RefName = "EzportPlus" +[files] +"EzportPlus.sdl" +"EzportPlus.mak" +"ezportplus.c" +"ezportplus.h" +"stylecommon.c" +"style.h" +"style.c" + diff --git a/EDK/MiniSetup/EzportPlus/EzportPlus.mak b/EDK/MiniSetup/EzportPlus/EzportPlus.mak new file mode 100644 index 0000000..8be7589 --- /dev/null +++ b/EDK/MiniSetup/EzportPlus/EzportPlus.mak @@ -0,0 +1,130 @@ +##*****************************************************************## +##*****************************************************************## +##*****************************************************************## +##** **## +##** (C)Copyright 1985-2010, American Megatrends, Inc. **## +##** **## +##** All Rights Reserved. **## +##** **## +##** 5555 Oakbrook Pkwy , Norcross, GA 30071 **## +##** **## +##** Phone (770)-246-8600 **## +##** **## +##*****************************************************************## +##*****************************************************************## +##*****************************************************************## +## $Archive: /Alaska/SOURCE/Modules/AMITSE2_0/AMITSE/EzportPlus/EzportPlus.mak $ +## +## $Author: Arunsb $ +## +## $Revision: 2 $ +## +## $Date: 10/18/12 6:07a $ +## +##*****************************************************************## +##*****************************************************************## +## Revision History +## ---------------- +## $Log: /Alaska/SOURCE/Modules/AMITSE2_0/AMITSE/EzportPlus/EzportPlus.mak $ +# +# 2 10/18/12 6:07a Arunsb +# Updated for 2.16.1235 QA submission +## +## 2 10/10/12 12:43p Arunsb +## Synched the source for v2.16.1232, backup with Aptio +# +# 1 3/28/11 11:51p Madhans +# [TAG] EIP54968 +# [Category] Improvement +# [Description] To Support different style modules in TSE generically +# [Files] Ezport module updated. EzportPlus and Legacy Styles Modules +# added. +# +# 5 2/19/10 1:02p Madhans +# Updated for TSE 2.01. Refer Changelog.log for File change history. +## +## 5 2/19/10 8:15a Mallikarjunanv +## updated year in copyright message +## +## 4 8/17/09 12:23p Presannar +## Removed Include path to Core directory +## +## 3 6/24/09 6:10p Madhans +## Made TSE_USE_EDK_LIBRARY=OFF to not to refer EDK module. +## +## 2 6/12/09 2:36p Blaines +## Update coding standard +## +## 1 6/04/09 8:05p Madhans +# +# 1 4/28/09 11:15p Madhans +# Tse 2.0 Code complete Checkin. +## +## 3 4/28/09 9:39p Madhans +## Tse 2.0 Code complete Checkin. +## +## 2 4/24/09 9:35p Blaines +## +## 1 12/18/08 7:59p Madhans +## Intial version of TSE Lite sources +## +## +##*****************************************************************## +##*****************************************************************## + +# MAK file for the eModule:TseLite + +TSE_STYLE_INCLUDES = \ + -I $(TSE_STYLE_DIR) \ +!if "$(UEFI_SOURCES_SUPPORT)" == "1" + -I $(UEFISRC_DIR) \ +!endif + -I $(TSESRC_DIR) \ + -I $(TSESRC_DIR)\AMILOGO \ + -I $(TSELITESRC_DIR) \ + -I $(TSEBIN_DIR) \ + -I $(TSEBIN_DIR)\Inc \ +!if "$(TSE_BOARD_SOURCE_SUPPORT)" == "1" + -I $(TSE_BOARD_DIR)\ +!endif + -I $(PROJECT_DIR)\Include\Protocol \ + -I $(PROJECT_DIR) \ + -I $(PROJECT_DIR)\Include \ + -I $(BUILD_DIR) \ + +$(BUILD_DIR)\TseStyleEzportPlus.lib : TseStyleLib + +TseStyleLib : $(BUILD_DIR)\EzportPlus.mak TseStyleLibBinEzportPlus + +$(BUILD_DIR)\EzportPlus.mak : $(TSE_STYLE_DIR)\$(@B).cif $(TSE_STYLE_DIR)\$(@B).mak $(BUILD_RULES) + $(CIF2MAK) $(TSE_STYLE_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS) + +!if "$(TSE_USE_EDK_LIBRARY)" == "1" +TSE_DEFAULTS = $(EDK_DEFAULTS) +!else +TSE_DEFAULTS = $(BUILD_DEFAULTS) +!endif + +TseStyleLibBinEzportPlus : + $(MAKE) /$(MAKEFLAGS) $(TSE_DEFAULTS)\ + /f $(BUILD_DIR)\EzportPlus.mak all\ + "MY_INCLUDES=$(TSE_STYLE_INCLUDES)"\ + "UNI_INCLUDE_PATH=$(TSEBIN_DIR)"\ + TYPE=LIBRARY \ + "EXT_HEADERS=$(BUILD_DIR)\token.h"\ + LIBRARY_NAME=$(BUILD_DIR)\TseStyleEzportPlus.lib\ + "CFLAGS=$(CFLAGS) /DTSE_FOR_APTIO_4_50" + +##*****************************************************************## +##*****************************************************************## +##** **## +##** (C)Copyright 1985-2010, American Megatrends, Inc. **## +##** **## +##** All Rights Reserved. **## +##** **## +##** 5555 Oakbrook Pkwy , Norcross, GA 30071 **## +##** **## +##** Phone (770)-246-8600 **## +##** **## +##*****************************************************************## +##*****************************************************************## diff --git a/EDK/MiniSetup/EzportPlus/EzportPlus.sdl b/EDK/MiniSetup/EzportPlus/EzportPlus.sdl new file mode 100644 index 0000000..faca143 --- /dev/null +++ b/EDK/MiniSetup/EzportPlus/EzportPlus.sdl @@ -0,0 +1,1073 @@ +TOKEN + Name = "TSE_STYLE_EZPORTPLUS_SUPPORT" + Value = "0" + Help = "Main switch to enable EzportPlus Style in TSE" + TokenType = Boolean + TargetEQU = Yes + TargetMAK = Yes + Master = Yes +End + +TOKEN + Name = "SETUP_STYLE_EZPORTPLUS" + Value = "1" + Help = "Condition to support EzportPlus Style Sources" + TokenType = Boolean + TargetH = Yes +End + +TOKEN + Name = "TSE_STYLE_SOURCES_SUPPORT" + Value = "1" + Help = "Don't Edit." + TokenType = Boolean + TargetMAK = Yes + TargetH = Yes +End + +TOKEN + Name = "SETUP_STYLE_FULL_SCREEN" + Value = "1" + Help = "Condition to support full screen layout" + TokenType = Boolean + TargetH = Yes +End + +TOKEN + Name = "STYLE_FULL_MAX_ROWS" + Value = "(UINT8)(31)" + Help = "Maximum rows in full screen mode" + TokenType = Expression + TargetH = Yes +End + +TOKEN + Name = "STYLE_FULL_MAX_COLS" + Value = "(UINT8)(100)" + Help = "Maximum columns in full screen mode" + TokenType = Expression + TargetH = Yes +End + +TOKEN + Name = "STYLE_STD_MAX_ROWS" + Value = "(UINT8)(24)" + Help = "Maximum rows in standard mode" + TokenType = Expression + TargetH = Yes +End + +TOKEN + Name = "STYLE_STD_MAX_COLS" + Value = "(UINT8)(80)" + Help = "Maximum columns in Standard mode" + TokenType = Expression + TargetH = Yes +End + +TOKEN + Name = "PAGEBORDER_FULL_X" + Value = "(UINT8)(0)" + Help = "X-Coordinate position of the Page border. (Default 0)" + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "PAGEBORDER_FULL_Y" + Value = "(UINT8)(2)" + Help = "Y-Coordinate position of the Page border. (Default 2)" + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "PAGEBORDER_FULL_W" + Value = "(UINT8)(STYLE_FULL_MAX_COLS)" + Help = "Horizontal width of the page border" + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "PAGEBORDER_FULL_H" + Value = "(UINT8)(STYLE_FULL_MAX_ROWS - 4)" + Help = "Vertical height of the page border" + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "FULL_VERTICAL_MAIN_DIVIDER" + Value = "(UINT8)(STYLE_FULL_MAX_COLS*2/3)" + Help = "Vertical divider (border) position between the MainFrame window and (helper and Navigation) frame windows." + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "FULL_HORIZONTAL_HELP_DIVIDER" + Value = "(UINT8)(4)" + Help = "Horizontal divider (border) position between Help and Navigation frame windows." + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "TITLE_FULL_X" + Value = "(UINT8)(0)" + Help = "X-Coordinate position of the Title bar frame. (Default 0)" + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "TITLE_FULL_Y" + Value = "(UINT8)(0)" + Help = "Y-Coordinate position of the Title bar frame. (Default 0)" + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "TITLE_FULL_W" + Value = "(UINT8)(STYLE_FULL_MAX_COLS)" + Help = "Horizontal Width of the Title bar frame. " + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "TITLE_FULL_H" + Value = "(UINT8)(1)" + Help = "Vertical Height of the Title bar frame" + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "MENU_FULL_X" + Value = "(UINT8)(0)" + Help = "X-Coordinate position of the Menu bar frame" + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "MENU_FULL_Y" + Value = "(UINT8)(1)" + Help = "Y-Coordinate position of the Menu bar frame" + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "MENU_FULL_W" + Value = "(UINT8)(STYLE_FULL_MAX_COLS)" + Help = "Horizontal Width of the Menu bar frame" + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "MENU_FULL_H" + Value = "(UINT8)(1)" + Help = "Vertical Height of the Menu bar frame" + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "HELPTITLE_FULL_X" + Value = "(UINT8)(FULL_VERTICAL_MAIN_DIVIDER+1)" + Help = "X-Coordinate position of the Help frame window." + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "HELPTITLE_FULL_Y" + Value = "(UINT8)(PAGEBORDER_FULL_Y+1)" + Help = "Y-Coordinate position of the Help frame window." + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "HELPTITLE_FULL_W" + Value = "(UINT8)(PAGEBORDER_FULL_W - FULL_VERTICAL_MAIN_DIVIDER-2)" + Help = "Horizontal Width of the Help frame window." + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "HELPTITLE_FULL_H" + Value = "(UINT8)(FULL_HORIZONTAL_HELP_DIVIDER - PAGEBORDER_FULL_Y - 2)" + Help = "Vertical Height of the Help frame window." + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "HELP_FULL_X" + Value = "(UINT8)(FULL_VERTICAL_MAIN_DIVIDER+1)" + Help = "X-Coordinate position of the Navigation frame window." + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "HELP_FULL_Y" + Value = "(UINT8)(FULL_HORIZONTAL_HELP_DIVIDER+1)" + Help = "Y-Coordinate position of the Navigation frame window." + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "HELP_FULL_W" + Value = "(UINT8)(PAGEBORDER_FULL_W - FULL_VERTICAL_MAIN_DIVIDER-2)" + Help = "Horizontal Width of the Navigation frame window." + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "HELP_FULL_H" + Value = "(UINT8)(PAGEBORDER_FULL_H - FULL_HORIZONTAL_HELP_DIVIDER)" + Help = "Vertical Height of the Navigation frame window." + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "MAIN_FULL_X" + Value = "(UINT8)(PAGEBORDER_FULL_X+1)" + Help = "X-Coordinate position of the Main frame window." + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "MAIN_FULL_Y" + Value = "(UINT8)(PAGEBORDER_FULL_Y+1)" + Help = "Y-Coordinate position of the Main frame window." + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "MAIN_FULL_W" + Value = "(UINT8)(FULL_VERTICAL_MAIN_DIVIDER - 2)" + Help = "Horizontal Width of the Main frame window." + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "MAIN_FULL_H" + Value = "(UINT8)(PAGEBORDER_FULL_H-2)" + Help = "Vertical Height of the Main frame window." + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "NAV_FULL_X" + Value = "(UINT8)(0)" + Help = "X-Coordinate position of the Nav frame window" + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "NAV_FULL_Y" + Value = "(UINT8)(PAGEBORDER_FULL_Y+PAGEBORDER_FULL_H)" + Help = "Y-Coordinate position of the Help Title frame window." + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "NAV_FULL_W" + Value = "(UINT8)(STYLE_FULL_MAX_COLS)" + Help = "Horizontal Width of the Help Title frame window" + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "NAV_FULL_H" + Value = "(UINT8)(2)" + Help = "Vertical Height of the Help Title frame window" + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "PAGEBORDER_X" + Value = "(UINT8)(0)" + Help = "X-Coordinate position of the Page border. (Default 0)" + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "PAGEBORDER_Y" + Value = "(UINT8)(2)" + Help = "Y-Coordinate position of the Page border. (Default 2)" + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "PAGEBORDER_W" + Value = "(UINT8)(STYLE_STD_MAX_COLS)" + Help = "Horizontal width of the page border" + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "PAGEBORDER_H" + Value = "(UINT8)(STYLE_STD_MAX_ROWS - 3)" + Help = "Vertical height of the page border." + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "VERTICAL_MAIN_DIVIDER" + Value = "(UINT8)(STYLE_STD_MAX_COLS*2/3)" + Help = "Vertical divider (border) position between the MainFrame window and (helper and Navigation) frame windows." + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "HORIZONTAL_HELP_DIVIDER" + Value = "(UINT8)(4)" + Help = "Horizontal divider (border) position between Help and Navigation frame windows." + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "TITLE_X" + Value = "(UINT8)(0)" + Help = "X-Coordinate position of the Title bar frame. (Default 0)" + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "TITLE_Y" + Value = "(UINT8)(0)" + Help = "Y-Coordinate position of the Title bar frame. (Default 0)" + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "TITLE_W" + Value = "(UINT8)(STYLE_STD_MAX_COLS)" + Help = "Horizontal Width of the Title bar frame" + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "TITLE_H" + Value = "(UINT8)(1)" + Help = "Vertical Height of the Title bar frame" + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "MENU_X" + Value = "(UINT8)(0)" + Help = "X-Coordinate position of the Menu bar frame" + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "MENU_Y" + Value = "(UINT8)(1)" + Help = "Y-Coordinate position of the Menu bar frame" + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "MENU_W" + Value = "(UINT8)(STYLE_STD_MAX_COLS)" + Help = "Horizontal Width of the Menu bar frame" + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "MENU_H" + Value = "1" + Help = "Vertical Height of the Menu bar frame" + TokenType = Integer + TargetH = Yes + +End + +TOKEN + Name = "HELPTITLE_X" + Value = "(UINT8)(VERTICAL_MAIN_DIVIDER+1)" + Help = "X-Coordinate position of the Help Title frame window" + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "HELPTITLE_Y" + Value = "(UINT8)(PAGEBORDER_Y+1)" + Help = "Y-Coordinate position of the Help Title frame window." + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "HELPTITLE_W" + Value = "(UINT8)(PAGEBORDER_W - VERTICAL_MAIN_DIVIDER-2)" + Help = "Horizontal Width of the Help Title frame window" + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "HELPTITLE_H" + Value = "(UINT8)(HORIZONTAL_HELP_DIVIDER - PAGEBORDER_Y - 2)" + Help = "Vertical Height of the Help Title frame window" + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "HELP_X" + Value = "(UINT8)(VERTICAL_MAIN_DIVIDER+1)" + Help = "X-Coordinate position of the Help frame window." + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "HELP_Y" + Value = "(UINT8)(HORIZONTAL_HELP_DIVIDER+1)" + Help = "Y-Coordinate position of the Help frame window." + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "HELP_W" + Value = "(UINT8)(PAGEBORDER_W - VERTICAL_MAIN_DIVIDER-2)" + Help = "Horizontal Width of the Help frame window." + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "HELP_H" + Value = "(UINT8)(PAGEBORDER_H - HORIZONTAL_HELP_DIVIDER)" + Help = "Vertical Height of the Help frame window." + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "MAIN_X" + Value = "(UINT8)(PAGEBORDER_X+1)" + Help = "X-Coordinate position of the Main frame window." + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "MAIN_Y" + Value = "(UINT8)(PAGEBORDER_Y+1)" + Help = "Y-Coordinate position of the Main frame window." + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "MAIN_W" + Value = "(UINT8)(VERTICAL_MAIN_DIVIDER - 2)" + Help = "Horizontal Width of the Main frame window." + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "MAIN_H" + Value = "(UINT8)(PAGEBORDER_H-2)" + Help = "Vertical Height of the Main frame window." + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "NAV_X" + Value = "(UINT8)(0)" + Help = "X-Coordinate position of the Navigation frame window." + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "NAV_Y" + Value = "(UINT8)(PAGEBORDER_Y+PAGEBORDER_H)" + Help = "Y-Coordinate position of the Navigation frame window." + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "NAV_W" + Value = "(UINT8)(STYLE_MAX_COLS)" + Help = "Horizontal Width of the Navigation frame window." + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "NAV_H" + Value = "(UINT8)(2)" + Help = "Vertical Height of the Navigation frame window." + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "PAGE_BGCOLOR" + Value = "(UINT8)(EFI_BACKGROUND_LIGHTGRAY)" + Help = "Background Color of the main area (Main, Help, and Navigation Frames) in a page." + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "PAGE_FGCOLOR" + Value = "(UINT8)(EFI_BLACK)" + Help = "Foreground and Border Color of main area in a page (Default EFI_BLUE)" + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "MAIN_BGCOLOR" + Value = "(UINT8)(PAGE_BGCOLOR)" + Help = "Background Color of the Main frame." + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "MAIN_FGCOLOR" + Value = "(UINT8)(EFI_BLUE)" + Help = "Foreground Color of the Main frame." + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "TITLE_BGCOLOR" + Value = "(UINT8)(EFI_BACKGROUND_CYAN)" + Help = "Background Color of the Title bar frame." + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "TITLE_FGCOLOR" + Value = "(UINT8)(EFI_BLACK)" + Help = "Foreground Color of the Title bar frame" + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "MENU_BGCOLOR" + Value = "(UINT8)(EFI_BACKGROUND_BLUE)" + Help = "Background color of the Menu bar frame" + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "MENU_FGCOLOR" + Value = "(UINT8)(EFI_LIGHTGRAY)" + Help = "Foreground Color of the Menu bar frame" + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "SELECTED_MENU_BGCOLOR" + Value = "(UINT8)(EFI_BACKGROUND_LIGHTGRAY)" + Help = "Background color of the Selected Menu in the Menu bar frame" + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "SELECTED_MENU_FGCOLOR" + Value = "(UINT8)(EFI_BLUE)" + Help = "Foreground Color of the Selected Menu in the Menu bar frame" + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "HELP_BGCOLOR" + Value = "(UINT8)(PAGE_BGCOLOR)" + Help = "Background color of the Help Frame (Default PAGE_BGCOLOR)" + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "HELP_FGCOLOR" + Value = "(UINT8)(EFI_BLACK)" + Help = "Foreground Color of the Help Frame (Default PAGE_FGCOLOR)" + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "HELPTITLE_BGCOLOR" + Value = "(UINT8)(PAGE_BGCOLOR)" + Help = "Background color of the Help Title Frame" + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "HELPTITLE_FGCOLOR" + Value = "(UINT8)(EFI_BLACK)" + Help = "Foreground Color of the Help Title Frame" + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "NAV_BGCOLOR" + Value = "(UINT8)(EFI_BACKGROUND_CYAN)" + Help = "Background color of the Navigation Frame" + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "NAV_FGCOLOR" + Value = "(UINT8)(EFI_BLACK)" + Help = "Foreground Color of the Navigation Frame" + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "SCROLLBAR_BGCOLOR" + Value = "(UINT8)(PAGE_BGCOLOR)" + Help = "Background color of the Scroll bar (Default PAGE_BGCOLOR)" + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "SCROLLBAR_FGCOLOR" + Value = "(UINT8)(MAIN_FGCOLOR)" + Help = "Foreground Color of the Scroll bar (Default PAGE_FGCOLOR)" + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "SCROLLBAR_UPARROW_BGCOLOR" + Value = "(UINT8)(PAGE_BGCOLOR)" + Help = "Background color of the Scroll bar Up-Arrow (Default PAGE_BGCOLOR)" + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "SCROLLBAR_UPARROW_FGCOLOR" + Value = "(UINT8)(MAIN_FGCOLOR)" + Help = "Foreground Color of the Scroll bar Up-Arrow (Default PAGE_FGCOLOR)" + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "SCROLLBAR_DOWNARROW_BGCOLOR" + Value = "(UINT8)(PAGE_BGCOLOR)" + Help = "Background color of the Scroll bar Down-Arrow (Default PAGE_BGCOLOR)" + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "SCROLLBAR_DOWNARROW_FGCOLOR" + Value = "(UINT8)(MAIN_FGCOLOR)" + Help = "Foreground Color of the Scroll bar Down-Arrow (Default PAGE_FGCOLOR)" + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "POPUP_BGCOLOR" + Value = "(UINT8)(EFI_BACKGROUND_BLUE)" + Help = "Background Color of Popup Windows, and Message Boxes (Default EFI_BACKGROUND_BLUE)" + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "POPUP_FGCOLOR" + Value = "(UINT8)(EFI_WHITE)" + Help = "Foreground Color of Popup Windows, and Message Boxes (Default EFI_WHITE)" + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "FOCUS_COLOR" + Value = "(UINT8)(EFI_WHITE)" + Help = "Focused label and control text color (Default EFI_WHITE)" + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "LABEL_FOCUS_COLOR" + Value = "(UINT8)(FOCUS_COLOR)" + Help = "Focused label text color (Default same as FOCUS_COLOR)" + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "CONTROL_FOCUS_COLOR" + Value = "(UINT8)(FOCUS_COLOR)" + Help = "Focused control text color (Default same as FOCUS_COLOR)" + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "NON_FOCUS_COLOR" + Value = "(UINT8)(MAIN_FGCOLOR)" + Help = "Non Focused label and control text color (Default PAGE_FGCOLOR)" + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "LABEL_NON_FOCUS_COLOR" + Value = "(UINT8)(NON_FOCUS_COLOR)" + Help = "Non Focused label text color (Default same as NON_FOCUS_COLOR)" + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "CONTROL_NON_FOCUS_COLOR" + Value = "(UINT8)(EFI_BLACK)" + Help = "Non Focused control text color (Default same as NON_FOCUS_COLOR)" + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "PAGE_LINK_COLOR" + Value = "(UINT8)(MAIN_FGCOLOR)" + Help = "Submenu text color (Default PAGE_FGCOLOR)" + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "EDIT_BGCOLOR" + Value = "(UINT8)(EFI_BACKGROUND_BLUE)" + Help = "Background color of focused edit controls" + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "EDIT_FGCOLOR" + Value = "(UINT8)(EFI_WHITE)" + Help = "Foreground color of focused edit controls" + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "TEXT_COLOR" + Value = "(UINT8)(EFI_BLUE)" + Help = "Foreround color of text controls" + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "MEMO_COLOR" + Value = "(UINT8)(EFI_BLACK)" + Help = "Foreground color of Memo controls" + TokenType = Expression + TargetH = Yes + Range = "0x0-0x0f" +End + +TOKEN + Name = "FULL_STYLE_CONTROL_LEFT_MARGIN" + Value = "37" + Help = "Control column left margin in full screen mode" + TokenType = Integer + TargetH = Yes +End + +TOKEN + Name = "FULL_STYLE_CONTROL_LEFT_PAD" + Value = "2" + Help = "Control left padding in full screen mode" + TokenType = Integer + TargetH = Yes + +End + +TOKEN + Name = "FULL_STYLE_CONTROL_RIGHT_AREA_WIDTH" + Value = "((UINT8)FULL_VERTICAL_MAIN_DIVIDER - FULL_STYLE_CONTROL_LEFT_MARGIN - FULL_STYLE_CONTROL_LEFT_PAD)" + Help = "Control column width in full screen mode" + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "STYLE_CONTROL_LEFT_MARGIN" + Value = "24" + Help = "Control column left margin" + TokenType = Integer + TargetH = Yes + +End + +TOKEN + Name = "STYLE_CONTROL_LEFT_PAD" + Value = "2" + Help = "Control left padding" + TokenType = Integer + TargetH = Yes + +End + +TOKEN + Name = "STYLE_CONTROL_RIGHT_AREA_WIDTH" + Value = "((UINT8)VERTICAL_MAIN_DIVIDER - STYLE_CONTROL_LEFT_MARGIN - STYLE_CONTROL_LEFT_PAD)" + Help = "Control column width" + TokenType = Expression + TargetH = Yes +End + +TOKEN + Name = "FULL_STYLE_LABEL_LEFT_MARGIN" + Value = "2" + Help = "Label column left margin in full screen mode" + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "STYLE_LABEL_LEFT_MARGIN" + Value = "2" + Help = "Label column left margin in normal screen mode" + TokenType = Expression + TargetH = Yes + +End + +TOKEN + Name = "STYLE_SCROLLBAR_ROLLOVER" + Value = "1" + Help = "Support rollover when the scroll limit has been reached" + TokenType = Boolean + TargetH = Yes +End + +TOKEN + Name = "STYLE_PAGE_FIRSTITEM_FOCUS" + Value = "0" + Help = "Reset focus to the first item when navigating to a new page. (Default 0 => Set focus to previously selected item)" + TokenType = Boolean + TargetH = Yes +End + +TOKEN + Name = "STYLE_SUBPAGE_FIRSTITEM_FOCUS" + Value = "0" + Help = "Reset focus to the first item when navigating back from submenu. (Default 0 => Set focus to previously selected item)" + TokenType = Boolean + TargetH = Yes +End + +TOKEN + Name = "STYLE_HOTKEY_FAILSAFE" + Value = "SCAN_F6" + Help = " Hot Key to load fail safe values" + TokenType = Expression + TargetH = Yes +End + +TOKEN + Name = "STYLE_SHADOW_SUPPORT" + Value = "1" + Help = " To enable/disable shadow support" + TokenType = Boolean + TargetH = Yes +End + +TOKEN + Name = "STYLE_SPACEKEY_INCREMENT" + Value = "1" + Help = " < need to add help >" + TokenType = Integer + TargetH = Yes +End + +TOKEN + Name = "OVERRIDE_PopupPwdHandleActionOverRide" + Value = "0" + Help = "set to 1 to display password prompts for old, new, and confirm in the same window." + TokenType = Boolean + TargetH = Yes +End + +TOKEN + Name = "OVERRIDE_PopupPwdAuthenticateIDEPwd" + Value = "0" + Help = "set to 1 if oem wants to override the PopupPwdAuthenticateIDEPwd function from Board module." + TokenType = Boolean + TargetH = Yes +End + + +PATH + Name = "TSE_STYLE_DIR" +End + +MODULE + Help = "Includes EzportPlus.mak to Project" + File = "EzportPlus.mak" +End + +ELINK + Name = "$(BUILD_DIR)\TSEStyleEzportPlus.lib" + Parent = "$(TSE_STYLE_DIR)\TSEStyleEzportPlus$(ARCH).lib" + InvokeOrder = ReplaceParent +End + + diff --git a/EDK/MiniSetup/EzportPlus/ezportplus.c b/EDK/MiniSetup/EzportPlus/ezportplus.c new file mode 100644 index 0000000..7e24636 --- /dev/null +++ b/EDK/MiniSetup/EzportPlus/ezportplus.c @@ -0,0 +1,1251 @@ +//*****************************************************************// +//*****************************************************************// +//*****************************************************************// +//** **// +//** (C)Copyright 1985-2011, American Megatrends, Inc. **// +//** **// +//** All Rights Reserved. **// +//** **// +//** 5555 Oakbrook Pkwy , Norcross, GA 30071 **// +//** **// +//** Phone: (770)-246-8600 **// +//** **// +//*****************************************************************// +//*****************************************************************// +//*****************************************************************// +// $Archive: /Alaska/SOURCE/Modules/AMITSE2_0/AMITSE/EzportPlus/ezportplus.c $ +// +// $Author: Premkumara $ +// +// $Revision: 12 $ +// +// $Date: 2/11/13 6:06a $ +// +//*****************************************************************// +//*****************************************************************// +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/AMITSE2_0/AMITSE/EzportPlus/ezportplus.c $ +// +// 12 2/11/13 6:06a Premkumara +// [TAG] EIP112628 +// [Category] Bug Fix +// [Severity] Important +// [Symptom] (JP000E)SETUP_GO_TO_EXIT_PAGE_ON_EXIT_KEY does not work on +// 4.6.2_TSE_2_15_1234 +// [RootCause] The Exit FormID value will change if any form is +// generated before Exit page +// [Solution] Handled Exit FormID from Binary and handling Exit FormID +// from binary +// [Files] Ezport.c, Ezport.sdl, Legacy.c, Legacy.sdl, EzportPlus.c, +// EzportPlus.sdl +// +// 11 10/18/12 6:07a Arunsb +// Updated for 2.16.1235 QA submission +// +// 2 10/10/12 12:43p Arunsb +// Synched the source for v2.16.1232, backup with Aptio +// +// 10 1/18/12 7:37a Premkumara +// [TAG] EIP79958 +// [Category] Bug Fix +// [Severity] Normal +// [Symptom] Softkeyboard is not launched for Password control in +// EzportPlus style module +// [RootCause] Soft keyboard was not launched for Password field in +// EzportPlus module +// [Solution] Launched Softkeyboard properly in EzportPlus style module +// [Files] EzportPlus.c +// +// 9 1/06/12 5:05p Blaines +// [TAG] - EIP 77887 +// [Category]- Function Request +// [Synopsis]- Change input system password box in same window +// [Description] - Display and get System password prompts for old, new, +// and confirm text in the same window, +// +// [Files] +// StyleTokens.c, StyleStr.uni, EzportPlus.sdl, ezportplus.c +// +// 8 12/14/11 6:24p Blaines +// Added code to suppress the warnings from static code analyzer +// +// 7 12/14/11 3:50p Blaines +// EIP:74899 Fixed issue with message not getting disaplayed when password +// is cleared. +// +// 6 12/14/11 2:00p Blaines +// EIP:74899 Add missing interactive support +// +// 5 12/14/11 1:37p Blaines +// Fix in _PopupPasswordActivate function for IDE password applied to +// _EzportPlusPopupPasswordActivate. +// +// 4 12/13/11 6:15p Blaines +// Remove error message when ESC key pressed. +// Display message when password is cleared. +// +// 3 11/23/11 1:26p Blaines +// [TAG] - EIP 74899 +// [Category]- Function Request +// [Synopsis]- Change input password box in same window +// [Description] - Display Hdd and System password prompts for old, new, +// and confirm text in the same window, +// +// [Files] +// StyleTokens.c, StyleStr.uni, EzportPlus.sdl, ezportplus.c +// +// 2 6/29/11 12:36p Rajashakerg +// [TAG] EIP47086 +// [Category] New Feature +// [Description] Right clicking from the Main page is not exiting from +// BIOS setup. +// +// [Files] minisetup.h, Ezport\style.h,Ezport\EzportBin.sdl, +// Ezport\EzportBin.mak, Ezport\ezport.c, Ezport\EzportBin.cif, +// EzportPlus\style.h, EzportPlus\EzportPlusBin.sdl, EzportPlusBin.mak, +// EzportPlus\EzportPlusBin.cif, EzportPlus\ezportplus.c, Legacy\style.h, +// Legacy\EzportPlusBin.sdl, Legacy\LegacyBin.mak, Legacy\LegacyBin.cif, +// Legacy\legacy.c, TseLiteBin.sdl, TseLite.cif, Memo.c, frame.c, +// application.h, application.c, commonoem.h, CommonHelper.c +// +// 1 3/28/11 11:51p Madhans +// [TAG] EIP54968 +// [Category] Improvement +// [Description] To Support different style modules in TSE generically +// [Files] Ezport module updated. EzportPlus and Legacy Styles Modules +// added. +// +// 8 6/17/10 2:59p Madhans +// Dynamic parsing support in TSE. +// +// 7 4/16/10 5:13p Madhans +// Changes for Tse 2.02. Please see Changelog.log for more details. +// +// 6 2/19/10 1:02p Madhans +// Updated for TSE 2.01. Refer Changelog.log for File change history. +// +// 10 2/19/10 8:15a Mallikarjunanv +// updated year in copyright message +// +// 9 2/15/10 10:12p Madhans +// To avoid warnings +// +// 8 1/09/10 6:11a Mallikarjunanv +// Updated TSE2.01 Release sources with coding standards +// +// 7 8/24/09 5:15p Blaines +// Fix issue setting title and helptitle background color after clear +// screen +// +// 6 8/13/09 1:22p Blaines +// Support BgColor for MAIN_FRAME, NAV_FRAME, and HELP_FRAME +// +// 5 8/04/09 6:57p Blaines +// Add Support for Exit Page SDL tokens +// +// 3 6/23/09 6:54p Blaines +// Coding standard update, +// Remove spaces from file header to allow proper chm function list +// creation. +// +// 2 6/12/09 2:36p Blaines +// Update coding standard +// +// 1 6/04/09 8:05p Madhans +// +// 3 5/07/09 10:35a Madhans +// Changes after Bin module +// +// 9 5/05/09 3:20p Blaines +// +// 8 5/04/09 6:52p Blaines +// Support customizable Help and Nav frame text Foreground color +// +// 7 5/01/09 9:25p Blaines +// +// 6 4/30/09 9:54p Blaines +// +// 4 4/28/09 9:39p Madhans +// Tse 2.0 Code complete Checkin. +// +// 3 4/24/09 9:35p Blaines +// +// 1 12/18/08 7:59p Madhans +// Intial version of TSE Lite sources +//*****************************************************************// +//*****************************************************************// +// +// +// Name: ezportplus.c +// +// Description: Main file for ezportplus style module. +// +// +//********************************************************************** +#include "minisetup.h" +#include "ezportplus.h" + +extern STYLECOLORS Colors ; +extern AMI_IFR_MENU gMenuData ; +extern UINTN gInvalidPasswordFailMsgBox; + +extern UINTN gLabelLeftMargin ; +extern UINTN gControlLeftMargin ; +extern UINTN gControlLeftPad ; +extern UINTN gControlRightAreaWidth ; +extern BOOLEAN IsPasswordSupportNonCaseSensitive(); + +static CALLBACK_SUBMENU gMenuCallbackData = { { CALLBACK_TYPE_MENU, sizeof(CALLBACK_MENU) }, 0 }; +static CALLBACK_SUBMENU gSubmenuCallbackData = { { CALLBACK_TYPE_SUBMENU, sizeof(CALLBACK_SUBMENU) }, 0 }; +static CALLBACK_VARIABLE gVariableCallbackData = { { CALLBACK_TYPE_VARIABLE, sizeof(CALLBACK_VARIABLE) }, 0, 0, 0, NULL }; +static CALLBACK_PASSWORD gPasswordCallbackData = { { CALLBACK_TYPE_PASSWORD, sizeof(CALLBACK_PASSWORD) }, 0, 0, 0, NULL, TRUE }; + +VOID _FrameSubmenuCallback( FRAME_DATA *frame, SUBMENU_DATA *submenu, VOID *cookie ); +VOID _FrameMenuCallback( FRAME_DATA *frame, MENU_DATA *menu, VOID *cookie ); + +BOOLEAN gotoExitOnEscKey(EFI_GUID *exitFormGuid, UINT16 *pageClass, UINT16 *pageSubclass, UINT16 *pageFormID);//EIP-112628 + +#if SETUP_STYLE_EZPORTPLUS + +#if SETUP_STYLE_FULL_SCREEN +static FRAME_INFO _gStyleFullSubFrames[] = +{ +// { FrameType Drawable Border, BorderType, Width, Height, Top, Left, FGColor, BGColor } + { TITLE_FRAME, TRUE, FALSE, 0, TITLE_FULL_W, TITLE_FULL_H, TITLE_FULL_Y, TITLE_FULL_X, TITLE_FGCOLOR, TITLE_BGCOLOR },// TITLE + { SUBTITLE_FRAME, TRUE, FALSE, 0, MENU_FULL_W, MENU_FULL_H, MENU_FULL_Y, MENU_FULL_X, MENU_FGCOLOR, MENU_BGCOLOR },// SUBTITLE (MENU) + { HELPTITLE_FRAME, TRUE, FALSE, 0, HELPTITLE_FULL_W, HELPTITLE_FULL_H, HELPTITLE_FULL_Y, HELPTITLE_FULL_X, HELPTITLE_FGCOLOR, HELPTITLE_BGCOLOR },// HELP TITLE (Copyright) + { HELP_FRAME, TRUE, FALSE, 0, HELP_FULL_W, HELP_FULL_H, HELP_FULL_Y, HELP_FULL_X, HELP_FGCOLOR, HELP_BGCOLOR },// HELP + { MAIN_FRAME, TRUE, FALSE, 0, MAIN_FULL_W, MAIN_FULL_H, MAIN_FULL_Y, MAIN_FULL_X, PAGE_FGCOLOR, MAIN_BGCOLOR },// Main + { NAV_FRAME, TRUE, FALSE, 0, NAV_FULL_W, NAV_FULL_H, NAV_FULL_Y, NAV_FULL_X, NAV_FGCOLOR, NAV_BGCOLOR }// NAVIGATION + +}; +#endif + +static FRAME_INFO _gStyleStandardSubFrames[] = +{ +// { FrameType Drawable Border, BorderType, Width, Height, Top, Left, FGColor, BGColor } + { TITLE_FRAME, TRUE, FALSE, 0, TITLE_W, TITLE_H, TITLE_Y, TITLE_X, TITLE_FGCOLOR, TITLE_BGCOLOR },// TITLE + { SUBTITLE_FRAME, TRUE, FALSE, 0, MENU_W, MENU_H, MENU_Y, MENU_X, MENU_FGCOLOR, MENU_BGCOLOR },// SUBTITLE (MENU) + { HELPTITLE_FRAME, TRUE, FALSE, 0, HELPTITLE_W,HELPTITLE_H,HELPTITLE_Y,HELPTITLE_X,HELPTITLE_FGCOLOR, HELPTITLE_BGCOLOR },// HELP TITLE (Copyright) + { HELP_FRAME, TRUE, FALSE, 0, HELP_W, HELP_H, HELP_Y, HELP_X, HELP_FGCOLOR, HELP_BGCOLOR },// HELP + { MAIN_FRAME, TRUE, FALSE, 0, MAIN_W, MAIN_H, MAIN_Y, MAIN_X, PAGE_FGCOLOR, MAIN_BGCOLOR },// Main + { NAV_FRAME, TRUE, FALSE, 0, NAV_W, NAV_H, NAV_Y, NAV_X, NAV_FGCOLOR, NAV_BGCOLOR }// NAVIGATION + +}; + +AMITSE_CONTROL_MAP gTseControlMap[] = +{ +// ControlType ControlMethods CallbackSuppored CallbackFunction CallbackContext + { CONTROL_TYPE_MENU, (CONTROL_METHODS*)&gMenu, TRUE, (VOID*)(UINTN)&_FrameMenuCallback, (VOID*)(UINTN)&gMenuCallbackData}, + { CONTROL_TYPE_SUBMENU, (CONTROL_METHODS*)&gSubMenu,TRUE, (VOID*)(UINTN)&_FrameSubmenuCallback, (VOID*) &gSubmenuCallbackData}, + { CONTROL_TYPE_LABEL, (CONTROL_METHODS*)&gLabel, TRUE, (VOID*)(UINTN)&StyleLabelCallback, (VOID*) NULL}, + { CONTROL_TYPE_TEXT, (CONTROL_METHODS*)&gText, FALSE,(VOID*)NULL, (VOID*) NULL}, + { CONTROL_TYPE_POPUP_STRING, (CONTROL_METHODS*)&gPopupString, TRUE, (VOID*)(UINTN)&_FrameVariableCallback, (VOID*) &gVariableCallbackData}, + { CONTROL_TYPE_DATE, (CONTROL_METHODS*)&gDate, FALSE, (VOID*)NULL, (VOID*) NULL}, + { CONTROL_TYPE_TIME, (CONTROL_METHODS*)&gTime, FALSE, (VOID*)NULL, (VOID*) NULL}, + { CONTROL_TYPE_POPUPSEL, (CONTROL_METHODS*)&gPopupSel, TRUE, (VOID*)(UINTN)&_FrameVariableCallback, (VOID*) &gVariableCallbackData}, + // Checkbox is just popup sel + { CONTROL_TYPE_CHECKBOX, (CONTROL_METHODS*)&gPopupSel, TRUE, (VOID*)(UINTN)&_FrameVariableCallback, (VOID*) &gVariableCallbackData}, + { CONTROL_TYPE_MEMO, (CONTROL_METHODS*)&gMemo, FALSE, (VOID*)NULL, (VOID*)NULL}, + { CONTROL_TYPE_NUMERIC, (CONTROL_METHODS*)&gNumeric, TRUE, (VOID*)(UINTN)&_FrameVariableCallback, (VOID*) &gVariableCallbackData}, + { CONTROL_TYPE_ORDERED_LIST, (CONTROL_METHODS*)&gOrdListBox, TRUE, (VOID*)(UINTN)&_FrameVariableCallback, (VOID*) &gVariableCallbackData}, + { CONTROL_TYPE_PASSWORD, (CONTROL_METHODS*)&gPopupPassword, TRUE, (VOID*)(UINTN)&_FramePasswordCallback, (VOID*)&gPasswordCallbackData}, + { CONTROL_TYPE_ACTION, (CONTROL_METHODS*)&gUefiAction, TRUE, (VOID*)(UINTN) &StyleLabelCallback, (VOID*) NULL}, + { CONTROL_TYPE_RESET, (CONTROL_METHODS*)&gResetButton, TRUE, (VOID*)(UINTN) &StyleLabelCallback, (VOID*) NULL},//EIP:56413 Updated the Reset Button Control information + // CONTROL_TYPE_NULL need to be last member + { CONTROL_TYPE_NULL, (CONTROL_METHODS*)NULL, FALSE, (VOID*)NULL, (VOID*) NULL} +}; + +static FRAME_INFO *_gStyleSubFrames = _gStyleStandardSubFrames ; + +UINT8 gVerticalMainDivider = VERTICAL_MAIN_DIVIDER ; +UINT8 gHorizontalHelpDivider = HORIZONTAL_HELP_DIVIDER ; + +// +//---------------------------------------------------------------------------- +// Procedure: OverRideStyleInit +// +// Description: Function to initialize style +// +// Input: VOID +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID OverRideStyleInit( VOID ) +{ + + gLabelLeftMargin = STYLE_LABEL_LEFT_MARGIN ; + gControlLeftMargin = STYLE_CONTROL_LEFT_MARGIN ; + gControlLeftPad = STYLE_CONTROL_LEFT_PAD ; + gControlRightAreaWidth = STYLE_CONTROL_RIGHT_AREA_WIDTH ; + + +#if SETUP_STYLE_FULL_SCREEN + if ( gMaxCols == STYLE_FULL_MAX_COLS ) + { + _gStyleSubFrames = _gStyleFullSubFrames; + + gVerticalMainDivider = FULL_VERTICAL_MAIN_DIVIDER ; + gHorizontalHelpDivider = FULL_HORIZONTAL_HELP_DIVIDER ; + + gLabelLeftMargin = FULL_STYLE_LABEL_LEFT_MARGIN ; + gControlLeftMargin = FULL_STYLE_CONTROL_LEFT_MARGIN ; + gControlLeftPad = FULL_STYLE_CONTROL_LEFT_PAD ; + gControlRightAreaWidth = FULL_STYLE_CONTROL_RIGHT_AREA_WIDTH ; + } +#endif + + if(gLabelLeftMargin < 2) + gLabelLeftMargin = 2 ; + +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleFrameIndexOf +// +// Description: Function to get frame index +// +// Input: UINT32 frameType +// +// Output: UINT32 index +// +//---------------------------------------------------------------------------- +// +UINT32 StyleFrameIndexOf( UINT32 frameType ) +{ + UINT32 FrameCount ; + UINT32 i; + + FrameCount = sizeof(_gStyleStandardSubFrames) / sizeof(FRAME_INFO); + + + for ( i = 0; i < FrameCount; i++ ) + { + if( _gStyleSubFrames[i].FrameType == frameType ){ + return i ; + break ; + } + } + + return i ; + +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleGetPageFrames +// +// Description: Function to number of frames +// +// Input: UINT32 page +// +// Output: UINT32 number of frames +// +//---------------------------------------------------------------------------- +// +UINT32 StyleGetPageFrames( UINT32 page ) +{ + return sizeof(_gStyleStandardSubFrames) / sizeof(FRAME_INFO); +} +// +//---------------------------------------------------------------------------- +// Procedure: OverRideStyleDrawPageBorder +// +// Description: Function to draw page border +// +// Input: UINT32 page +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID OverRideStyleDrawPageBorder( UINT32 page ) +{ + PAGE_DATA *Page ; + FRAME_DATA *fTitle, *fMenu, *fHelptitle ; + + CHAR16 *line; + UINT8 lineNumber; + UINT8 start, end, col; + UINT8 pbx,pby,pbw,pbh; + UINT8 vertDivider = VERTICAL_MAIN_DIVIDER ; + UINT8 horzDivider = HORIZONTAL_HELP_DIVIDER; + + Page = gApp->PageList[page]; + + fTitle = Page->FrameList[StyleFrameIndexOf(TITLE_FRAME)]; + fHelptitle = Page->FrameList[StyleFrameIndexOf(HELPTITLE_FRAME)]; + fMenu = Page->FrameList[StyleFrameIndexOf(SUBTITLE_FRAME)]; + + pbx = PAGEBORDER_X; + pby = PAGEBORDER_Y; + pbw = PAGEBORDER_W; + pbh = PAGEBORDER_H; + + if ( gMaxCols == STYLE_FULL_MAX_COLS ) + { + vertDivider = FULL_VERTICAL_MAIN_DIVIDER ; + horzDivider = FULL_HORIZONTAL_HELP_DIVIDER; + pbx = PAGEBORDER_FULL_X; + pby = PAGEBORDER_FULL_Y; + pbw = PAGEBORDER_FULL_W; + pbh = PAGEBORDER_FULL_H; + } + + + line = EfiLibAllocateZeroPool( (gMaxCols + 1) * sizeof(CHAR16) ); + if ( line == NULL ) + return; + + ClearLinesWithoutFlush( fTitle->FrameData.Top, fTitle->FrameData.Height, fTitle->FrameData.BGColor | fTitle->FrameData.FGColor ); + ClearLinesWithoutFlush( fHelptitle->FrameData.Top, fHelptitle->FrameData.Height, fHelptitle->FrameData.BGColor | fHelptitle->FrameData.FGColor ); + ClearLinesWithoutFlush( fMenu->FrameData.Top, fMenu->FrameData.Height, fMenu->FrameData.BGColor | fMenu->FrameData.FGColor ); + ClearLinesWithoutFlush( pby, pbh, PAGE_BGCOLOR | PAGE_FGCOLOR ); + + + DrawWindow( pbx, pby, pbw, pbh, PAGE_BGCOLOR| PAGE_FGCOLOR, TRUE, FALSE ); + + // Hidden line in first page + if (Page->PageData.PageIdIndex == FIRST_PAGE_ID_INDEX) + { + gBS->FreePool( line ); + return; + } + + MemFillUINT16Buffer( &line[1], gMaxCols - 1, BOXDRAW_HORIZONTAL ); + + line[0] = BOXDRAW_DOWN_HORIZONTAL; + line[1] = L'\0'; + DrawString( vertDivider, pby, line ); + + line[0] = BOXDRAW_UP_HORIZONTAL; + DrawString( vertDivider, pby+pbh-1, line ); + + // center divider + line[0] = BOXDRAW_VERTICAL; + + col = vertDivider ; + start = pby+1; + end = pby+pbh-1 ; + + for ( lineNumber = start; lineNumber < end ; lineNumber++ ) + DrawString( col, lineNumber, line ); + + // Horizontal Help divider + MemFillUINT16Buffer( &line[1], gMaxCols - 1, BOXDRAW_HORIZONTAL ); + line[0] = BOXDRAW_VERTICAL; + //line[1] = BOXDRAW_HORIZONTAL; + line[gMaxCols - vertDivider-1] = L'\0'; + DrawString(col, horzDivider, line ); + + FlushLines( 0, end-1 ); + + gBS->FreePool( line ); + +} +// +//---------------------------------------------------------------------------- +// Procedure: OverRideStyleGetFrameInitData +// +// Description: Function to get frame initialization data +// +// Input: UINT32 page, UINT32 frame +// +// Output: VOID* +// +//---------------------------------------------------------------------------- +// +VOID *OverRideStyleGetFrameInitData( UINT32 page, UINT32 frame ) +{ + return &_gStyleSubFrames[frame]; +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleFrameAddTitle +// +// Description: Function to add frame title +// +// Input: FRAME_DATA *frame, UINT32 frameType, CONTROL_INFO * dummy +// +// Output: EFI_STATUS +// +//---------------------------------------------------------------------------- +// +EFI_STATUS StyleFrameAddTitle( FRAME_DATA *frame, UINT32 frameType,CONTROL_INFO * dummy ) +{ + return EFI_UNSUPPORTED; +} + +#endif /* SETUP_STYLE_EZPORTPLUS */ + +// +//---------------------------------------------------------------------------- +// Procedure: EzportPlusHandleEscKey +// +// Description: Function to handle ESC Hotkey action +// +// Input: APPLICATION_DATA *app, HOTKEY_DATA *hotkey, VOID *cookie +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID EzportPlusHandleEscKey( APPLICATION_DATA *app, HOTKEY_DATA *hotkey, VOID *cookie ) +{ + UINT16 pageClass = 0, pageSubclass = 0, pageFormID = 0; + EFI_GUID ExitPageGuid; + + + if(FormBrowserHandleValid()) + app->Quit = TRUE; + + else if ( gotoExitOnEscKey (&ExitPageGuid, &pageClass, &pageSubclass, &pageFormID) )//EIP-112628 + { + UINT32 i=0; + PAGE_INFO *pageInfo; + + for ( i = 0; i < gPages->PageCount; i++ ) + { + pageInfo = (PAGE_INFO *)((UINTN)gApplicationData + gPages->PageList[i]); + if ( + ( EfiCompareGuid(&ExitPageGuid,&(gPageIdInfo[pageInfo->PageIdIndex].PageGuid)) ) && + ( pageClass == gPageIdInfo[pageInfo->PageIdIndex].PageClass ) && + ( pageSubclass == gPageIdInfo[pageInfo->PageIdIndex].PageSubClass ) && + ( pageFormID == pageInfo->PageFormID ) + ) + { + gApp->CurrentPage = i; // Page found go to exit page + gApp->CompleteRedraw = TRUE; + gApp->Fixed = FALSE; + break; + } + } + if(i >= gPages->PageCount) //Page not found exit application + app->Quit = ExitApplication(); + } + + else + app->Quit = ExitApplication(); +} +// +//---------------------------------------------------------------------------- +// Procedure: EzportPlusHandleSaveExitKey +// +// Description: Function to handle Save and Exit Hotkey action +// +// Input: APPLICATION_DATA *app, HOTKEY_DATA *hotkey, VOID *cookie +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID EzportPlusHandleSaveExitKey( APPLICATION_DATA *app, HOTKEY_DATA *hotkey, VOID *cookie ) +{ + app->Quit = SaveAndExit(); +} +// +//---------------------------------------------------------------------------- +// Procedure: EzportPlusHandlePrevValuesKey +// +// Description: Function to handle Load Previous value Hotkey action +// +// Input: APPLICATION_DATA *app, HOTKEY_DATA *hotkey, VOID *cookie +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID EzportPlusHandlePrevValuesKey( APPLICATION_DATA *app, HOTKEY_DATA *hotkey, VOID *cookie ) +{ + if ( app->CurrentPage != 0 ) + LoadPreviousValues( TRUE ); +} +// +//---------------------------------------------------------------------------- +// Procedure: EzportPlusHandleFailsafeKey +// +// Description: Function to handle Load Failsafe values Hotkey action +// +// Input: APPLICATION_DATA *app, HOTKEY_DATA *hotkey, VOID *cookie +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID EzportPlusHandleFailsafeKey( APPLICATION_DATA *app, HOTKEY_DATA *hotkey, VOID *cookie ) +{ + if ( app->CurrentPage != 0 ) + LoadFailsafeDefaults(); +} +// +//---------------------------------------------------------------------------- +// Procedure: EzportPlusHandleOptimalKey +// +// Description: Function to handle Load Optimal values Hotkey action +// +// Input: APPLICATION_DATA *app, HOTKEY_DATA *hotkey, VOID *cookie +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID EzportPlusHandleOptimalKey( APPLICATION_DATA *app, HOTKEY_DATA *hotkey, VOID *cookie ) +{ + if ( app->CurrentPage != 0 ) + LoadOptimalDefaults(); +} +// +//---------------------------------------------------------------------------- +// Procedure: EzportPlusHandleHelpKey +// +// Description: Function to handle Help Hotkey action +// +// Input: APPLICATION_DATA *app, HOTKEY_DATA *hotkey, VOID *cookie +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID EzportPlusHandleHelpKey( APPLICATION_DATA *app, HOTKEY_DATA *hotkey, VOID *cookie ) +{ + if ( app->CurrentPage != 0 ) + ShowHelpMessageBox(); +} +// +//---------------------------------------------------------------------------- +// Procedure: EzportPlusHandlePrnScrnKey +// +// Description: Function to handle print screen Hotkey action +// +// Input: APPLICATION_DATA *app, HOTKEY_DATA *hotkey, VOID *cookie +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID EzportPlusHandlePrnScrnKey( APPLICATION_DATA *app, HOTKEY_DATA *hotkey, VOID *cookie ) +{ + TseHotkeyPrintScreenSupport(); +} + +//EIP:47086 - Right clicking from the Main page is not exiting from BIOS setup. +//EIP:47086 START +// +//---------------------------------------------------------------------------- +// Procedure: EzportPlusMainFrameHandlewithMouse +// +// Description: Function to handle Main Frame with Mouse +// +// Input: APPLICATION_DATA *app, HOTCLICK_DATA *hotkey, VOID *cookie +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID EzportPlusMainFrameHandlewithMouse( APPLICATION_DATA *app, HOTCLICK_DATA *hotclick, VOID *cookie ) +{ + if(app->Action->Input.Data.MouseInfo.ButtonStatus == TSEMOUSE_RIGHT_CLICK) + app->Quit = ExitApplication(); +} + +// +//---------------------------------------------------------------------------- +// Procedure: EzportPlusHelpFrameHandlewithMouse +// +// Description: Function to handle Help Frame with Mouse +// +// Input: APPLICATION_DATA *app, HOTCLICK_DATA *hotkey, VOID *cookie +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID EzportPlusHelpFrameHandlewithMouse( APPLICATION_DATA *app, HOTCLICK_DATA *hotclick, VOID *cookie ) +{ + + +} + +// +//---------------------------------------------------------------------------- +// Procedure: EzportPlusNavFrameHandlewithMouse +// +// Description: Function to handle Navigation Frame with Mouse +// +// Input: APPLICATION_DATA *app, HOTCLICK_DATA *hotkey, VOID *cookie +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID EzportPlusNavFrameHandlewithMouse( APPLICATION_DATA *app, HOTCLICK_DATA *hotclick, VOID *cookie ) +{ +} +//EIP:47086 END + + + + +//EIP:74899 START +#if OVERRIDE_PopupPwdHandleActionOverRide +extern VOID UpdatePasswordToNonCaseSensitive(CHAR16 *Password, UINTN PwdLength); +extern UINT8 CallbackShowMessageBox( UINTN data, UINT8 type ); +extern UINTN gClearPasswordMsgBox ; + +EFI_STATUS _EzportPlusPopupPasswordHandleAction( VOID *popuppassword, VOID *Data); +EFI_STATUS PopupPwdHandleActionOverRide(POPUP_PASSWORD_DATA *popuppassword, ACTION_DATA *Data) +{ + return _EzportPlusPopupPasswordHandleAction(popuppassword, Data); +} +// +//---------------------------------------------------------------------------- +// Procedure: EzportPlusShowPasswordErrorMessageBox +// +// Description: Function to Display the password failed message box +// +// Input: None +// +// Output: None +// +//---------------------------------------------------------------------------- +// +VOID EzportPlusShowPasswordErrorMessageBox( VOID ) +{ + UINT8 sel = 0 ; + AMI_POST_MGR_KEY OutKey ; + + PostManagerDisplayMsgBoxEx( + HiiGetString( gHiiHandle, STRING_TOKEN(STR_ERROR)), + HiiGetString( gHiiHandle, STRING_TOKEN(STR_ERROR_PSWD)), + NULL, MSGBOX_EX_CATAGORY_WARNING, MSGBOX_TYPE_OK, + NULL, 0, NULL, 0, &sel, &OutKey + ) ; + TSEStringReadLoopExitHook();//EIP-79958 Exit softkeyboard after display Error Msg Box +} +// +//---------------------------------------------------------------------------- +// Procedure: EzportPlusShowPasswordSuccessMessageBox +// +// Description: Function to Display the password success message box +// +// Input: None +// +// Output: None +// +//---------------------------------------------------------------------------- +// +VOID EzportPlusShowPasswordSuccessMessageBox( VOID ) +{ + UINT8 sel = 0 ; + AMI_POST_MGR_KEY OutKey ; + + PostManagerDisplayMsgBoxEx( + HiiGetString( gHiiHandle, STRING_TOKEN(STR_SUCCESS)), + HiiGetString( gHiiHandle, STRING_TOKEN(STR_PASSWORD_SUCCESS_MSG)), + NULL, MSGBOX_EX_CATAGORY_SUCCESS, MSGBOX_TYPE_OK, + NULL, 0, NULL, 0, &sel, &OutKey + ) ; + TSEStringReadLoopExitHook();//EIP-79958 Exit SoftKeyboard after displayed Successful Msg Box +} +// +//---------------------------------------------------------------------------- +// Procedure: EzportPlusShowPasswordClearedMessageBox +// +// Description: Function to Display the password success message box +// +// Input: None +// +// Output: None +// +//---------------------------------------------------------------------------- +// +VOID EzportPlusShowPasswordClearedMessageBox( VOID ) +{ + UINT8 sel = 0 ; + AMI_POST_MGR_KEY OutKey ; + + PostManagerDisplayMsgBoxEx( + HiiGetString( gHiiHandle, STRING_TOKEN(STR_INFO)), + HiiGetString( gHiiHandle, STRING_TOKEN(STR_PASSWORD_CLEARED_MSG)), + NULL, MSGBOX_EX_CATAGORY_QUERY, MSGBOX_TYPE_OK, + NULL, 0, NULL, 0, &sel, &OutKey + ) ; + TSEStringReadLoopExitHook(); //EIP-79958 Exit Softkeyboard after displayed Clear Old Password Msg Box +} +// +//---------------------------------------------------------------------------- +// Procedure: EzportPlusPopupPasswordSetPrompt +// +// Description: Function to display password prompts for new, and confirm in the same window. +// +// Input: POPUP_PASSWORD_DATA *PopupPassword, +// UINT16 NewPrompt, +// CHAR16 **NewPwd, +// UINT16 ConfirmPrompt, +// CHAR16 **ConfirmPwd, +// +// Output: Status +// +//---------------------------------------------------------------------------- +// +EFI_STATUS EzportPlusPopupPasswordSetPrompt(POPUP_PASSWORD_DATA *PopupPassword, UINT16 NewPrompt, CHAR16 **NewPwd, UINT16 ConfirmPrompt, CHAR16 **ConfirmPwd) +{ + EFI_STATUS Status = EFI_SUCCESS ; + + UINT8 Length = (UINT8)UefiGetMaxValue(PopupPassword->ControlData.ControlPtr); + + TEXT_INPUT_TEMPLATE SetPasswordPrompt[2] = + { + {NewPrompt, Length, TSE_FILTER_KEY_NULL, TRUE, NULL}, + {ConfirmPrompt, Length, TSE_FILTER_KEY_NULL, TRUE, NULL} + }; + + UINT16 Title = STRING_TOKEN(STR_SET_PASSWORD_PROMPT) ; + + *NewPwd = EfiLibAllocateZeroPool((Length+1) * sizeof(CHAR16) ); + *ConfirmPwd = EfiLibAllocateZeroPool((Length+1) * sizeof(CHAR16) ); + + SetPasswordPrompt[0].Value = *NewPwd ; + SetPasswordPrompt[1].Value = *ConfirmPwd ; + + + if ( *NewPwd == NULL || *ConfirmPwd == NULL) + return EFI_OUT_OF_RESOURCES ; + + TSEStringReadLoopEntryHook(); //EIP-79958 Launch Softkeyboard on selecting Password control for setting password + + Status = PostManagerDisplayTextBox( + gHiiHandle, + Title, + SetPasswordPrompt, + 2, + NULL + ) ; + + return Status; +} +// +//---------------------------------------------------------------------------- +// Procedure: EzportPlusPopupPasswordChangePrompt +// +// Description: Function to display password prompts for old, new, and confirm in the same window. +// +// Input: POPUP_PASSWORD_DATA *PopupPassword, +// UINT16 OldPrompt, +// CHAR16 **OldPwd, +// UINT16 NewPrompt, +// CHAR16 **NewPwd, +// UINT16 ConfirmPrompt, +// CHAR16 **ConfirmPwd, +// +// Output: Status +// +//---------------------------------------------------------------------------- +// +EFI_STATUS EzportPlusPopupPasswordChangePrompt(POPUP_PASSWORD_DATA *PopupPassword, UINT16 OldPrompt, CHAR16 **OldPwd, UINT16 NewPrompt, CHAR16 **NewPwd, UINT16 ConfirmPrompt, CHAR16 **ConfirmPwd) +{ + + EFI_STATUS Status = EFI_SUCCESS ; + + UINT8 Length = (UINT8)UefiGetMaxValue(PopupPassword->ControlData.ControlPtr); + + TEXT_INPUT_TEMPLATE ChangePasswordPrompt[3] = + { + {OldPrompt, Length, TSE_FILTER_KEY_NULL, TRUE, NULL}, + {NewPrompt, Length, TSE_FILTER_KEY_NULL, TRUE, NULL}, + {ConfirmPrompt, Length, TSE_FILTER_KEY_NULL, TRUE, NULL} + }; + + UINT16 Title = STRING_TOKEN(STR_CHANGE_PASSWORD_PROMPT) ; + + *OldPwd = EfiLibAllocateZeroPool((Length+1) * sizeof(CHAR16) ); + *NewPwd = EfiLibAllocateZeroPool((Length+1) * sizeof(CHAR16) ); + *ConfirmPwd = EfiLibAllocateZeroPool((Length+1) * sizeof(CHAR16) ); + + ChangePasswordPrompt[0].Value = *OldPwd ; + ChangePasswordPrompt[1].Value = *NewPwd ; + ChangePasswordPrompt[2].Value = *ConfirmPwd ; + + + if ( *OldPwd == NULL || NewPwd == NULL || *ConfirmPwd == NULL) + return EFI_OUT_OF_RESOURCES ; + + TSEStringReadLoopEntryHook(); //EIP-79958 Launch Softkeyboard on selecting Password control for changing password + + Status = PostManagerDisplayTextBox( + gHiiHandle, + Title, + ChangePasswordPrompt, + 3, + NULL + ) ; + + return Status; +} + +BOOLEAN IsPasswordSupportNonCaseSensitive(); +// +//---------------------------------------------------------------------------- +// Procedure: _EzportPlusPopupPasswordActivate +// +// Description: function to set and activate a password +// +// Input: POPUP_PASSWORD_DATA *popuppassword +// +// Output: status +// +//---------------------------------------------------------------------------- +// +EFI_STATUS _EzportPlusPopupPasswordActivate(POPUP_PASSWORD_DATA *popuppassword) +{ + EFI_STATUS Status = EFI_UNSUPPORTED; + BOOLEAN AbortUpdate = FALSE, ChangePwd = FALSE, ClearPwd = FALSE ; + CHAR16 /* *TempText=NULL,*/ *Text=NULL,*NewPswd=NULL,*ConfirmNewPswd=NULL; + VOID *data = popuppassword->ControlData.ControlPtr; + UINTN NewPwLen = 0, ConfirmPwLen = 0; + + if( PopupPwdAuthenticateIDEPwd(popuppassword,&AbortUpdate,data) != EFI_SUCCESS) + { + + AbortUpdate = FALSE; + + if(PopupPasswordCheckInstalled(popuppassword)) + { + + ChangePwd = TRUE ; + Status = EzportPlusPopupPasswordChangePrompt(popuppassword, STRING_TOKEN(STR_OLD_PSWD), &Text, STRING_TOKEN(STR_NEW_PSWD), &NewPswd, STRING_TOKEN(STR_CONFIRM_NEW_PSWD), &ConfirmNewPswd) ; + + if( Status ) + AbortUpdate = TRUE; + else + { + if(!PopupPasswordAuthenticate( popuppassword, Text )) + { + // optional message to user: "wrong password" and exit + //CallbackShowMessageBox( (UINTN)gInvalidPasswordFailMsgBox, MSGBOX_TYPE_OK ); + EzportPlusShowPasswordErrorMessageBox(); + AbortUpdate = TRUE; + } + } + } + } +#if OVERRIDE_PopupPwdAuthenticateIDEPwd && SETUP_IDE_SECURITY_SUPPORT + else + { + BOOLEAN bCheckUser = FALSE; + BOOLEAN EnabledBit = FALSE; + UINTN size = 0; + IDE_SECURITY_CONFIG *ideSecConfig; + VOID* DataPtr = TSEIDEPasswordGetDataPtr(gCurrIDESecPage); + ideSecConfig = VarGetVariable( VARIABLE_ID_IDE_SECURITY, &size ); + + //EIP-75352 Suppress the warnings from static code analyzer + if (NULL != ideSecConfig) { + + if(ideSecConfig->Enabled) EnabledBit = TRUE; + + if(EnabledBit) + { + if(UefiGetQuestionOffset(data) /*data->QuestionId*/ == STRUCT_OFFSET(IDE_SECURITY_CONFIG,IDEUserPassword)) + bCheckUser = TRUE; + + if(bCheckUser || ideSecConfig->MasterPasswordStatus) + { + //Status = _DoPopupEdit( *popuppassword, STRING_TOKEN(STR_OLD_PSWD), &Text); + ChangePwd = TRUE ; + Status = EzportPlusPopupPasswordChangePrompt(popuppassword, STRING_TOKEN(STR_OLD_PSWD), &Text, STRING_TOKEN(STR_NEW_PSWD), &NewPswd, STRING_TOKEN(STR_CONFIRM_NEW_PSWD), &ConfirmNewPswd) ; + + if(Status ) + { + AbortUpdate = TRUE; + } + else + { + Status = TSEIDEPasswordAuthenticate( Text, DataPtr, bCheckUser ); + if(EFI_ERROR( Status )) + { + //CallbackShowMessageBox( (UINTN)gInvalidPasswordFailMsgBox, MSGBOX_TYPE_OK ); + EzportPlusShowPasswordErrorMessageBox(); + AbortUpdate = TRUE; + } + else + { + NewPwLen = EfiStrLen(NewPswd); + ConfirmPwLen = EfiStrLen(ConfirmNewPswd); + + if(NewPwLen == 0 && ConfirmPwLen == 0) + { + ClearPwd = TRUE ; + } + } + } + } + } + + MemFreePointer((VOID **) &ideSecConfig); + } + } +#endif + + if(AbortUpdate == FALSE) + { +Password: + + if(ChangePwd == FALSE) + { + Status = EzportPlusPopupPasswordSetPrompt(popuppassword, STRING_TOKEN(STR_NEW_PSWD), &NewPswd, STRING_TOKEN(STR_CONFIRM_NEW_PSWD), &ConfirmNewPswd) ; + + if(!Status && EfiStrLen(NewPswd) == 0) + { + //Report Message box + EzportPlusShowPasswordErrorMessageBox(); + Status = EFI_UNSUPPORTED; + } + } + + if(!Status) + { + NewPwLen = EfiStrLen(NewPswd); + ConfirmPwLen = EfiStrLen(ConfirmNewPswd); + //EIP-39764 : non case sensitive support during setting password + if( IsPasswordSupportNonCaseSensitive() && (NewPwLen != 0)) { + UpdatePasswordToNonCaseSensitive(NewPswd, NewPwLen); + } + + if (VARIABLE_ID_IDE_SECURITY != popuppassword->ControlData.ControlVariable) + { + if(PopupPasswordCheckInstalled(popuppassword)) + { + // Override the minmax validation for password clearing + if(NewPwLen == 0 && ConfirmPwLen == 0) + { + //Report Message box for Clearing Old password + if(CallbackShowMessageBox( (UINTN)gClearPasswordMsgBox, MSGBOX_TYPE_YESNO )!= MSGBOX_YES) + { + ChangePwd = FALSE ; + ClearPwd = FALSE ; + goto Password; + //Status = EFI_UNSUPPORTED; //Do not clear the password + } + else + { + ClearPwd = TRUE ; + } + } + } + }else if( (NewPwLen < (UINT8)UefiGetMinValue(popuppassword->ControlData.ControlPtr)) || + (NewPwLen > (UINT8)UefiGetMaxValue(popuppassword->ControlData.ControlPtr)) + ) + { + //Report Message box + EzportPlusShowPasswordErrorMessageBox(); + + Status = EFI_UNSUPPORTED; + } + + if( ClearPwd == TRUE) + { + if(ConfirmNewPswd) + StringZeroFreeMemory ((VOID **)&ConfirmNewPswd); + + ConfirmNewPswd = EfiLibAllocateZeroPool( sizeof(CHAR16) ); + + if(ConfirmNewPswd) + { + *ConfirmNewPswd = '\0'; //Set confirmation password to null string + } + else + { + Status = EFI_OUT_OF_RESOURCES; + } + + } + } + + if ( !Status ) + { + //EIP-39764 : non case sensitive support during setting password + if( IsPasswordSupportNonCaseSensitive() && EfiStrLen(ConfirmNewPswd)) { + NewPwLen = EfiStrLen(ConfirmNewPswd); + UpdatePasswordToNonCaseSensitive( ConfirmNewPswd, NewPwLen ); + } + if ( EfiStrCmp(NewPswd, ConfirmNewPswd)==0 ) + { + //EIP-75521 Support for Interactive Password control + if(popuppassword->Text != NULL){ + MemFreePointer( (VOID **)&popuppassword->Text ); + } + popuppassword->Text = (CHAR16 *) EfiLibAllocateZeroPool((NewPwLen + 1) * sizeof(CHAR16)); + EfiStrCpy(popuppassword->Text, NewPswd); + + //save new password + if ( ( popuppassword->Callback != NULL ) && ( popuppassword->Cookie != NULL ) ) + { + VOID *ifrData = popuppassword->ControlData.ControlPtr; + CALLBACK_PASSWORD *callbackData = (CALLBACK_PASSWORD *)popuppassword->Cookie; + + callbackData->Variable = popuppassword->ControlData.ControlVariable; + callbackData->Offset = UefiGetQuestionOffset(ifrData); + callbackData->Length = (UINT8)UefiGetMaxValue(ifrData) * sizeof(CHAR16); + callbackData->Data = (VOID *)NewPswd; + UefiPreControlUpdate(&(popuppassword->ControlData)); + popuppassword->Callback( popuppassword->Container,popuppassword, popuppassword->Cookie ); + + PopupPwdUpdateIDEPwd (); + } + + + //For interactive control invoke the formcallback function. + if(UefiIsInteractive(&popuppassword->ControlData)) + { + VOID *Handle = popuppassword->ControlData.ControlHandle; + UINT16 Key = UefiGetControlKey(&(popuppassword->ControlData)); + CONTROL_DATA *Control = (CONTROL_DATA *)NULL; + + //Call the callback passing the input value and value size. + Status = CallFormCallBack( &(popuppassword->ControlData),Key,0,AMI_CALLBACK_CONTROL_UPDATE); + + Control = GetUpdatedControlData((CONTROL_DATA*)popuppassword, CONTROL_TYPE_PASSWORD, Handle, Key); + if(Control == NULL){ //Control deleted. + return EFI_SUCCESS; + } + if(Control != (CONTROL_DATA *)popuppassword){ + popuppassword = (POPUP_PASSWORD_DATA *)Control; //Control Updated. + } + } + + popuppassword->ControlActive = FALSE; + + if(ClearPwd) + { + EzportPlusShowPasswordClearedMessageBox(); + } + else if(NewPwLen != 0) + { + EzportPlusShowPasswordSuccessMessageBox(); + } + } + else + { + EzportPlusShowPasswordErrorMessageBox(); + } + } + } + + StringZeroFreeMemory ((VOID **)&Text); //EIP67735 zeroing the password prompt memories + StringZeroFreeMemory ((VOID **)&NewPswd); + StringZeroFreeMemory ((VOID **)&ConfirmNewPswd); + + TSEStringReadLoopExitHook();//EIP-79958 Exit softkeyboard on pressing ESC + return EFI_SUCCESS; +} + +// +//---------------------------------------------------------------------------- +// Procedure: _EzportPlusPopupPasswordHandleAction +// +// Description: function to handle the password actions +// +// Input: POPUP_PASSWORD_DATA *popuppassword, , ACTION_DATA *Data +// +// Output: status +// +//---------------------------------------------------------------------------- +// +EFI_STATUS _EzportPlusPopupPasswordHandleAction( POPUP_PASSWORD_DATA *popuppassword, ACTION_DATA *Data) +{ + EFI_STATUS Status = EFI_UNSUPPORTED; + if ( Data->Input.Type == ACTION_TYPE_TIMER ) + return Status; + + + if ( Data->Input.Type == ACTION_TYPE_KEY ) + { + CONTROL_ACTION Action; + + //Get mapping + Action = MapControlKeysHook(Data->Input.Data.AmiKey); + + if(ControlActionSelect == Action) + { + if(UefiIsInteractive(&popuppassword->ControlData)) + if(PopupPasswordFormCallback(&(popuppassword->ControlData),UefiGetControlKey(&(popuppassword->ControlData)),0) == EFI_SUCCESS) + return EFI_SUCCESS; + + return _EzportPlusPopupPasswordActivate(popuppassword); + } + } + + if(Data->Input.Type == ACTION_TYPE_MOUSE) + { + if(ControlActionSelect == MapControlMouseActionHook(&Data->Input.Data.MouseInfo)) + { + if( popuppassword->Top == (Data->Input.Data.MouseInfo.Top) ) + { + if(UefiIsInteractive(&popuppassword->ControlData)) + if(PopupPasswordFormCallback(&(popuppassword->ControlData),UefiGetControlKey(&(popuppassword->ControlData)),0) == EFI_SUCCESS) + return EFI_SUCCESS; + + return _EzportPlusPopupPasswordActivate(popuppassword); + } + } + } + return Status; +} +#endif + + +#if OVERRIDE_PopupPwdAuthenticateIDEPwd + +EFI_STATUS PopupPwdAuthenticateIDEPwd(POPUP_PASSWORD_DATA *popuppassword, BOOLEAN *AbortUpdate,VOID *data) +{ +#if SETUP_IDE_SECURITY_SUPPORT + EFI_STATUS Status = EFI_UNSUPPORTED; + CHAR16 *Text=NULL; + if(popuppassword->ControlData.ControlVariable == VARIABLE_ID_IDE_SECURITY ) + { + //if drive is locked ask for the old password to unlock the drive + VOID* DataPtr = TSEIDEPasswordGetDataPtr(gCurrIDESecPage); + BOOLEAN bCheckUser = FALSE; + BOOLEAN EnabledBit = FALSE; + UINTN size = 0; + IDE_SECURITY_CONFIG *ideSecConfig; + + ideSecConfig = VarGetVariable( VARIABLE_ID_IDE_SECURITY, &size ); + + //EIP-75352 Suppress the warnings from static code analyzer + if (NULL == ideSecConfig) + return EFI_NOT_FOUND; + + if(ideSecConfig->Enabled) EnabledBit = TRUE; + + if(EnabledBit) + { + return EFI_SUCCESS; + } + + MemFreePointer((VOID **) &ideSecConfig); + return EFI_SUCCESS; + } + return EFI_UNSUPPORTED; +#else + return EFI_UNSUPPORTED; +#endif +} +#endif +//EIP:74899 END +//*****************************************************************// +//*****************************************************************// +//** **// +//** (C)Copyright 1985-2011, American Megatrends, Inc. **// +//** **// +//** All Rights Reserved. **// +//** **// +//** 5555 Oakbrook Pkwy , Norcross, GA 30071 **// +//** **// +//** Phone: (770)-246-8600 **// +//** **// +//*****************************************************************// +//*****************************************************************// diff --git a/EDK/MiniSetup/EzportPlus/ezportplus.h b/EDK/MiniSetup/EzportPlus/ezportplus.h new file mode 100644 index 0000000..225b8f6 --- /dev/null +++ b/EDK/MiniSetup/EzportPlus/ezportplus.h @@ -0,0 +1,141 @@ +//*****************************************************************// +//*****************************************************************// +//*****************************************************************// +//** **// +//** (C)Copyright 1985-2010, American Megatrends, Inc. **// +//** **// +//** All Rights Reserved. **// +//** **// +//** 5555 Oakbrook Pkwy , Norcross, GA 30071 **// +//** **// +//** Phone (770)-246-8600 **// +//** **// +//*****************************************************************// +//*****************************************************************// +//*****************************************************************// +// $Archive: /Alaska/SOURCE/Modules/AMITSE2_0/AMITSE/EzportPlus/ezportplus.h $ +// +// $Author: Arunsb $ +// +// $Revision: 2 $ +// +// $Date: 10/18/12 6:07a $ +// +//*****************************************************************// +//*****************************************************************// +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/AMITSE2_0/AMITSE/EzportPlus/ezportplus.h $ +// +// 2 10/18/12 6:07a Arunsb +// Updated for 2.16.1235 QA submission +// +// 2 10/10/12 12:43p Arunsb +// Synched the source for v2.16.1232, backup with Aptio +// +// 1 3/28/11 11:51p Madhans +// [TAG] EIP54968 +// [Category] Improvement +// [Description] To Support different style modules in TSE generically +// [Files] Ezport module updated. EzportPlus and Legacy Styles Modules +// added. +// +// 5 2/19/10 1:02p Madhans +// Updated for TSE 2.01. Refer Changelog.log for File change history. +// +// 6 2/19/10 8:15a Mallikarjunanv +// updated year in copyright message +// +// 5 1/09/10 6:12a Mallikarjunanv +// Updated TSE2.01 Release sources with coding standards +// +// 4 8/24/09 5:15p Blaines +// Fix issue setting title and helptitle background color after clear +// screen +// +// 3 8/18/09 6:34p Blaines +// Support additional date styles +// +// 2 6/12/09 2:36p Blaines +// Update coding standard +// +// 1 6/04/09 8:05p Madhans +// +// 3 5/07/09 10:35a Madhans +// Changes after Bin module +// +// 2 4/29/09 9:02p Madhans +// Bug Fixes after unit Testing.. +// +// 1 4/28/09 11:14p Madhans +// Tse 2.0 Code complete Checkin. +// +// 3 4/28/09 9:39p Madhans +// Tse 2.0 Code complete Checkin. +// +// 2 4/24/09 9:35p Blaines +// +// 1 12/18/08 7:59p Madhans +// Intial version of TSE Lite sources +//*****************************************************************// +//*****************************************************************// +// +// +// Name: ezportplus.h +// +// Description: Main header file for ezportplus style module. +// +// +//********************************************************************** +#ifndef _EZPORTPLUS_H_ +#define _EZPORTPLUS_H_ + +#if SETUP_STYLE_EZPORTPLUS + +VOID OverRideStyleInit( VOID ); +VOID OverRideStyleDrawPageBorder( UINT32 page ); +VOID *OverRideStyleGetFrameInitData( UINT32 page, UINT32 frame ); + +#if SETUP_STYLE_FULL_SCREEN + #define STYLE_MAX_COLS STYLE_FULL_MAX_COLS + #define STYLE_MAX_ROWS STYLE_FULL_MAX_ROWS +#else + #define STYLE_MAX_COLS STYLE_STD_MAX_COLS + #define STYLE_MAX_ROWS STYLE_STD_MAX_ROWS +#endif + +#define EFI_BACKGROUND_WHITE (EFI_WHITE << 4) +#define STYLE_CLEAR_SCREEN_COLOR (HELPTITLE_BGCOLOR | EFI_WHITE) + + +// Style Overrides... +#define STYLE_OVERRIDE_INIT +#define STYLE_OVERRIDE_PAGE_BORDER +#define STYLE_OVERRIDE_FRAME_INIT_DATA +#define STYLE_OVERRIDE_CONTROL_OVERFLOW +#define STYLE_OVERRIDE_INITIALIZE_FRAME +#define STYLE_OVERRIDE_INITIALIZE_OEM_FRAME +#define STYLE_OVERRIDE_NAV_TOKEN +#define STYLE_OVERRIDE_ADD_CONTROLS +#define STYLE_OVERRIDE_FIRST_PAGE +#define STYLE_OVERRIDE_VERSION_STRING +#define STYLE_OVERRIDE_FRAME_DRAWABLE + +#define MENU_COMPLETE_REDRAW 1 +#define SUBMENU_COMPLETE_REDRAW 2 +#endif /* SETUP_STYLE_EZPORTPLUS */ + +#endif /* _EZPORTPLUS_H_ */ +//*****************************************************************// +//*****************************************************************// +//** **// +//** (C)Copyright 1985-2010, American Megatrends, Inc. **// +//** **// +//** All Rights Reserved. **// +//** **// +//** 5555 Oakbrook Pkwy , Norcross, GA 30071 **// +//** **// +//** Phone: (770)-246-8600 **// +//** **// +//*****************************************************************// +//*****************************************************************// diff --git a/EDK/MiniSetup/EzportPlus/style.c b/EDK/MiniSetup/EzportPlus/style.c new file mode 100644 index 0000000..ca83694 --- /dev/null +++ b/EDK/MiniSetup/EzportPlus/style.c @@ -0,0 +1,625 @@ +//*****************************************************************// +//*****************************************************************// +//*****************************************************************// +//** **// +//** (C)Copyright 1985-2011, American Megatrends, Inc. **// +//** **// +//** All Rights Reserved. **// +//** **// +//** 5555 Oakbrook Pkwy , Norcross, GA 30071 **// +//** **// +//** Phone: (770)-246-8600 **// +//** **// +//*****************************************************************// +//*****************************************************************// +//*****************************************************************// +// $Archive: /Alaska/SOURCE/Modules/AMITSE2_0/AMITSE/EzportPlus/style.c $ +// +// $Author: Premkumara $ +// +// $Revision: 4 $ +// +// $Date: 5/02/14 4:05a $ +// +//*****************************************************************// +//*****************************************************************// +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/AMITSE2_0/AMITSE/EzportPlus/style.c $ +// +// 4 5/02/14 4:05a Premkumara +// [TAG] EIP151966 +// [Category] Improvement +// [Description] Added the implementation for getting the BIOS build +// year dynamically +// from TimeStamp.h file and updated the Build year in copyright message +// in both Setup and POST. +// [Files] style.c,style.c,style.c,notify.c,minisetupext.c,CommonHelper +// .c, +// AmiTSEStr.uni,AMITSE.mak +// +// 3 10/18/12 6:07a Arunsb +// Updated for 2.16.1235 QA submission +// +// 2 10/10/12 12:43p Arunsb +// Synched the source for v2.16.1232, backup with Aptio +// +// 2 6/23/11 5:46a Rajashakerg +// [TAG] EIP63073 +// [Category] New Feature +// [Description] Source modules in TSE should get the version details +// from binary in run time not at build time +// [Files] CommonHelper.c, minisetupext.c, notify.c, Ezport\style.c, +// EzportPlus\style.c, Legacy\style.c +// +// 1 3/28/11 11:51p Madhans +// [TAG] EIP54968 +// [Category] Improvement +// [Description] To Support different style modules in TSE generically +// [Files] Ezport module updated. EzportPlus and Legacy Styles Modules +// added. +// +// 4 2/19/10 1:02p Madhans +// Updated for TSE 2.01. Refer Changelog.log for File change history. +// +// 6 2/19/10 8:15a Mallikarjunanv +// updated year in copyright message +// +// 5 2/04/10 11:16p Madhans +// Navgation help for Mouse Added +// +// 4 1/09/10 6:13a Mallikarjunanv +// Updated TSE2.01 Release sources with coding standards +// +// 3 6/23/09 6:54p Blaines +// Coding standard update, +// Remove spaces from file header to allow proper chm function list +// creation. +// +// 2 6/12/09 2:36p Blaines +// Update coding standard +// +// 1 6/04/09 8:05p Madhans +// +// 3 5/07/09 10:35a Madhans +// Changes after Bin module +// +// 2 4/29/09 9:02p Madhans +// Bug Fixes after unit Testing.. +// +// 1 4/28/09 11:15p Madhans +// Tse 2.0 Code complete Checkin. +// +// 1 4/28/09 9:39p Madhans +// Tse 2.0 Code complete Checkin. +// +// 1 12/18/08 7:59p Madhans +// Intial version of TSE Lite sources +//*****************************************************************// +//*****************************************************************// +// +// +// Name: style.c +// +// Description: Contains style override functions. +// +// +//********************************************************************** +#include "minisetup.h" + +extern UINT8 gVerticalMainDivider ; +extern UINT8 gHorizontalHelpDivider ; +extern UINT16 gStrNavToken; + +VOID _StyleAddSpacing( FRAME_DATA *frame ); +VOID GetTseBuildVersion(UINTN *TseMajor, UINTN *TseMinor, UINTN *TseBuild); +VOID GetTseBuildYear(UINT16 *TseBuildYear);//EIP 151966 : Use BIOS build year for copyright message + +#if SETUP_STYLE_EZPORTPLUS + + + +STYLECOLORS Colors = +{ + TEXT_COLOR, //EFI_WHITE, //FGColor + PAGE_BGCOLOR, //BGColor + NON_FOCUS_COLOR, //EFI_BLUE, //secondary FGcolor + PAGE_BGCOLOR, //secondary BGColor + CONTROL_FOCUS_COLOR, //EFI_WHITE, //SelFGColor + PAGE_BGCOLOR, //SelBGColor + CONTROL_NON_FOCUS_COLOR, //EFI_BLUE, //NSelFGColor + PAGE_BGCOLOR, //NSelBGColor + PAGE_BGCOLOR, //LabelBGColor + LABEL_FOCUS_COLOR, //EFI_WHITE, //LabelFGColor + LABEL_NON_FOCUS_COLOR, //EFI_BLUE, //NSelLabelFGColor + EDIT_BGCOLOR, //EditBGColor + EDIT_FGCOLOR, //EFI_WHITE, //EditFGColor + POPUP_FGCOLOR, //popupFGColor + POPUP_BGCOLOR //popupBGColor +}; +// +//---------------------------------------------------------------------------- +// Procedure: OverRideStyleHandleControlOverflow +// +// Description: Function to handle contro overflow +// +// Input: FRAME_DATA *frame, CONTROL_DATA *control, UINT16 count +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +EFI_STATUS OverRideStyleHandleControlOverflow( FRAME_DATA *frame, CONTROL_DATA *control, UINT16 count ) +{ + EFI_STATUS Status = EFI_UNSUPPORTED; + CONTROL_DATA *tempcontrol; + UINT16 i=0,Height=0; + UINT8 BORDER=(frame->FrameData.Border==TRUE)?1:0 ; + + // show scrollbar if neccessary + frame->UseScrollbar = FALSE; + + for(i = 0; i < count; i++) + { + tempcontrol = (CONTROL_DATA*)(frame->ControlList[i]); + if( (Height + tempcontrol->Height ) <= frame->FrameData.Height-2*BORDER ) + { + Height = Height + tempcontrol->Height; + frame->LastVisibleCtrl = i; + } + else + { + Status = EFI_SUCCESS; + break; + } + } + + return Status; +} + +static AMI_IFR_MENU gMenuData = {CONTROL_TYPE_MENU,2}; +// +//---------------------------------------------------------------------------- +// Procedure: OverRideStyleInitializeFrame +// +// Description: Function to initialize frame +// +// Input: FRAME_DATA *frame, UINT32 frameType, PAGE_INFO *data +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +EFI_STATUS OverRideStyleInitializeFrame( FRAME_DATA *frame, UINT32 frameType, PAGE_INFO *data ) +{ + EFI_STATUS Status = EFI_INVALID_PARAMETER; + UINT8 justify = JUSTIFY_LEFT /*, BORDER=(frame->FrameData.Border==TRUE)?1:0*/ ; + STYLECOLORS saveColors ; + + CONTROL_INFO dummy; + + UINT32 FrameType = frame->FrameData.FrameType ; + + saveColors = Colors ; + + //Allows controls to match the Background Color of the Frame + Colors.BGColor = frame->FrameData.BGColor ; + Colors.SecBGColor = frame->FrameData.BGColor ; + Colors.SelBGColor = frame->FrameData.BGColor ; + Colors.NSelBGColor = frame->FrameData.BGColor ; + Colors.LabelBGColor = frame->FrameData.BGColor ; + Colors.PopupBGColor = frame->FrameData.BGColor ; + + switch ( FrameType ) + { + case MAIN_FRAME: + if(LABEL_FOCUS_COLOR != FOCUS_COLOR) + Colors.LabelFGColor = LABEL_FOCUS_COLOR ; + + if(CONTROL_FOCUS_COLOR != FOCUS_COLOR) + Colors.SelFGColor = CONTROL_FOCUS_COLOR; + + if(LABEL_NON_FOCUS_COLOR != NON_FOCUS_COLOR) + Colors.NSelLabelFGColor = LABEL_NON_FOCUS_COLOR ; + + if(CONTROL_NON_FOCUS_COLOR != NON_FOCUS_COLOR) + Colors.NSelFGColor = CONTROL_NON_FOCUS_COLOR ; + + if (frame->PageID == FIRST_PAGE_ID_INDEX) + { + // Reset frame width + frame->FrameData.Width = (UINT8)(gMaxCols - gLabelLeftMargin - 1); + + // Reset clear frame area width + gBS->FreePool(frame->BlankLine); + frame->BlankLine = EfiLibAllocateZeroPool( sizeof(CHAR16) * (frame->FrameData.Width + 1) ); + if ( frame->BlankLine != NULL ) + MemFillUINT16Buffer( frame->BlankLine, frame->FrameData.Width, L' ' ); + } + Status = _FrameAddControls( frame, data ); + break; + + case SUBTITLE_FRAME: + Colors.SecBGColor = SELECTED_MENU_BGCOLOR ; + Colors.SecFGColor = SELECTED_MENU_FGCOLOR ; + Colors.PopupBGColor = MENU_BGCOLOR ; + Colors.PopupFGColor = MENU_FGCOLOR ; + + MemSet( &dummy, sizeof(dummy), 0 ); + dummy.ControlHandle = gHiiHandle; + dummy.ControlType = CONTROL_TYPE_MENU; + dummy.ControlPtr = (VOID*)&gMenuData; + dummy.ControlPageID = data->PageID; + dummy.ControlFlags.ControlVisible = TRUE; + Status=gFrame.AddControl(frame,&dummy); + break; + + case TITLE_FRAME: + + + case NAV_FRAME: + + justify = JUSTIFY_CENTER; + Status = _FrameAddTitle( frame, FrameType, data ); + if ( ! EFI_ERROR( Status ) ) + { + MEMO_DATA *memo = (MEMO_DATA *)frame->ControlList[0]; + + if(FrameType == NAV_FRAME ) + { + memo->ControlData.ControlPtr= (VOID*) UefiCreateSubTitleTemplate(STRING_TOKEN(STR_NAV_STRINGS_5)); + if ( gMaxCols <= 80 ) + { + gMaxRows=25; + memo->ControlData.ControlPtr= (VOID*) UefiCreateSubTitleTemplate(STRING_TOKEN(STR_NAV_STRINGS_6)); + } + } + if (FrameType == HELPTITLE_FRAME) + justify = JUSTIFY_CENTER; // EIP25281.style + + gMemo.SetJustify( memo, justify ); + } + + break; + case HELP_FRAME: + + justify = JUSTIFY_LEFT; + case HELPTITLE_FRAME: + Status = _FrameAddTitle( frame, FrameType, data ); + if ( ! EFI_ERROR( Status ) ) + { + MEMO_DATA *memo = (MEMO_DATA *)frame->ControlList[0]; + + if(FrameType == NAV_FRAME ) + { + memo->ControlData.ControlPtr= (VOID*) UefiCreateSubTitleTemplate(STRING_TOKEN(STR_NAV_STRINGS_5)); + if ( gMaxCols <= 80 ) + { + memo->ControlData.ControlPtr= (VOID*) UefiCreateSubTitleTemplate(STRING_TOKEN(STR_NAV_STRINGS_6)); + } + } + if (FrameType == HELPTITLE_FRAME) + justify = JUSTIFY_CENTER; // EIP25281.style + + gMemo.SetJustify( memo, justify ); + } + break; + + case SCROLLBAR_FRAME: + // not implemented at this time + Status = EFI_SUCCESS; + break; + + default: + //Status = StyleInitializeOemFrame( frame, frame->FrameData.FrameType, data ) ; + break; + } + + + Colors = saveColors; + + // initialize frame scroll colors + frame->FrameData.ScrlFGColor = SCROLLBAR_FGCOLOR ; + frame->FrameData.ScrlBGColor = SCROLLBAR_BGCOLOR ; + frame->FrameData.ScrlUpFGColor = SCROLLBAR_UPARROW_FGCOLOR ; + frame->FrameData.ScrlUpBGColor = SCROLLBAR_UPARROW_BGCOLOR ; + frame->FrameData.ScrlDnFGColor = SCROLLBAR_DOWNARROW_FGCOLOR ; + frame->FrameData.ScrlDnBGColor = SCROLLBAR_DOWNARROW_BGCOLOR ; + + return Status; + +} +// +//---------------------------------------------------------------------------- +// Procedure: OverRideStyleGetNavToken +// +// Description: Function to get navigation frame token +// +// Input: UINT32 page number +// +// Output: UINT16 token +// +//---------------------------------------------------------------------------- +// +UINT16 OverRideStyleGetNavToken( UINT32 page ) +{ + UINT16 Token=0; + + Token = STRING_TOKEN(STR_NAV_STRINGS_5); + + if ( gMaxCols <= 80 ) + { + Token = STRING_TOKEN(STR_NAV_STRINGS_6); + } + + return Token ;// return gStrNavToken; +} + + + +static AMI_IFR_LABEL gFailSafeLabel = { 0, 0, STRING_TOKEN(STR_LOAD_FAILSAFE), STRING_TOKEN(STR_LOAD_FAILSAFE_HELP) }; +static AMI_IFR_LABEL gOptimalLabel = { 0, 0, STRING_TOKEN(STR_LOAD_OPTIMAL), STRING_TOKEN(STR_LOAD_OPTIMAL_HELP) }; +static AMI_IFR_LABEL gSaveExitLabel = { 0, 0, STRING_TOKEN(STR_SAVE_EXIT), STRING_TOKEN(STR_SAVE_EXIT_HELP) }; +static AMI_IFR_LABEL gExitLabel = { 0, 0, STRING_TOKEN(STR_EXIT), STRING_TOKEN(STR_EXIT_HELP) }; +static AMI_IFR_LABEL gSaveResetLabel = { 0, 0, STRING_TOKEN(STR_SAVE_RESET), STRING_TOKEN(STR_SAVE_RESET_HELP) }; +static AMI_IFR_LABEL gResetLabel = { 0, 0, STRING_TOKEN(STR_RESET), STRING_TOKEN(STR_RESET_HELP) }; + +// +//---------------------------------------------------------------------------- +// Procedure: OverRideStyleAddAdditionalControls +// +// Description: Function to add additional controls +// +// Input: FRAME_DATA *frame, UINT32 controlNumber, BOOLEAN focus +// +// Output: EFI_STATUS +// +//---------------------------------------------------------------------------- +// +EFI_STATUS OverRideStyleAddAdditionalControls( FRAME_DATA *frame, UINT32 controlNumber, BOOLEAN focus ) +{ + EFI_STATUS Status = EFI_SUCCESS; + CONTROL_DATA **control; + UINT32 i; + + if ( frame->PageID != 0 ) + return Status; + + control = frame->ControlList; + + for ( i = 0; i < frame->ControlCount; i++, control++ ) + { + (*control)->Methods->Destroy( *control, TRUE ); + } + + // initialize counter of control in frame and set focus to false (at this point the are no controls in the frame) + frame->ControlCount =0; + frame->NullCount=0; + focus=0; + controlNumber=0; + + // add controls for boot manager, language, failsafe, optimal, save & exit, exit without saving +/* Status = _StyleAddControl( frame, CONTROL_TYPE_SUBMENU, &gBootManagerRef, &controlNumber, &focus ); + if ( EFI_ERROR( Status ) ) + return Status; + + Status = _StyleAddControl( frame, CONTROL_TYPE_SUBMENU, &gLanguageRef, &controlNumber, &focus ); + if ( EFI_ERROR( Status ) ) + return Status; +*/ + Status = _StyleAddControl( frame, CONTROL_TYPE_LABEL, &gFailSafeLabel, &controlNumber, &focus ); + if ( EFI_ERROR( Status ) ) + return Status; + + Status = _StyleAddControl( frame, CONTROL_TYPE_LABEL, &gOptimalLabel, &controlNumber, &focus ); + if ( EFI_ERROR( Status ) ) + return Status; + + Status = _StyleAddControl( frame, CONTROL_TYPE_LABEL, &gSaveExitLabel, &controlNumber, &focus ); + if ( EFI_ERROR( Status ) ) + return Status; + + Status = _StyleAddControl( frame, CONTROL_TYPE_LABEL, &gExitLabel, &controlNumber, &focus ); + + Status = _StyleAddControl( frame, CONTROL_TYPE_LABEL, &gSaveResetLabel, &controlNumber, &focus ); + if ( EFI_ERROR( Status ) ) + return Status; + + Status = _StyleAddControl( frame, CONTROL_TYPE_LABEL, &gResetLabel, &controlNumber, &focus ); + + return Status; +} +// +//---------------------------------------------------------------------------- +// Procedure: OverRideStyleSelectFirstDisplayPage +// +// Description: Function to set first page display +// +// Input: VOID +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID OverRideStyleSelectFirstDisplayPage( VOID ) +{ + gApp->CurrentPage = 1; +} +// +//---------------------------------------------------------------------------- +// Procedure: OverRideStyleUpdateVersionString +// +// Description: Function to update version string +// +// Input: VOID +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID OverRideStyleUpdateVersionString( VOID ) +{ + CHAR16 *string = NULL, *newString = NULL; + UINTN length, TseMajor,TseMinor, TseBuild; + UINT16 TseBuildYear=0; + UINTN i; + + for ( i = 0; i < gLangCount; i++ ) + { + string = HiiGetStringLanguage( gHiiHandle, STRING_TOKEN(STR_MAIN_COPYRIGHT), gLanguages[i].Unicode ); + if ( string == NULL ) + return; + + length = EfiStrLen(string) + 10; + newString = EfiLibAllocateZeroPool( length * sizeof(CHAR16) ); + if ( newString != NULL ) + { + //EIP 63073 : Source modules in TSE should get the version details from binary in run time not at build time + GetTseBuildVersion(&TseMajor,&TseMinor,&TseBuild); + //EIP 151966 : Use BIOS build year for copyright message + GetTseBuildYear(&TseBuildYear); + SPrint( newString, length * sizeof(CHAR16), string, TseMajor, TseMinor, TseBuild,TseBuildYear ); + HiiChangeStringLanguage( gHiiHandle, STRING_TOKEN(STR_MAIN_COPYRIGHT), gLanguages[i].Unicode, newString ); + } + + MemFreePointer( (VOID **)&newString ); + MemFreePointer( (VOID **)&string ); + //EIP 151966 : Use BIOS build year for copyright message + string = HiiGetStringLanguage( gHiiHandle, STRING_TOKEN(STR_MAIN_TITLE), gLanguages[i].Unicode ); + if ( string == NULL ) + return; + length = EfiStrLen(string) + 10; + newString = EfiLibAllocateZeroPool( length * sizeof(CHAR16) ); + if ( newString != NULL ) + { + //EIP 151966 : Use BIOS build year for copyright message + GetTseBuildYear(&TseBuildYear); + SPrint( newString, length * sizeof(CHAR16), string, TseBuildYear ); + HiiChangeStringLanguage( gHiiHandle, STRING_TOKEN(STR_MAIN_TITLE), gLanguages[i].Unicode, newString ); + } + MemFreePointer( (VOID **)&newString ); + MemFreePointer( (VOID **)&string ); + } +} +// +//---------------------------------------------------------------------------- +// Procedure: OverRideStyleFrameDrawable +// +// Description: Function to determine if frame is drawable +// +// Input: FRAME_DATA *frame +// +// Output: EFI_STATUS +// +//---------------------------------------------------------------------------- +// +EFI_STATUS OverRideStyleFrameDrawable( FRAME_DATA *frame ) +{ + EFI_STATUS Status = EFI_SUCCESS; + static UINTN TempRightAreaWidth = 0; + + if (frame->PageID == FIRST_PAGE_ID_INDEX) + { + + switch ( frame->FrameData.FrameType ) + { + // Hidden NAV and HELP frame + case HELP_FRAME: + case HELPTITLE_FRAME: + Status = EFI_UNSUPPORTED; + break; + + // Set right area width + case MAIN_FRAME: + if (TempRightAreaWidth == 0) + { + // Set right area width + TempRightAreaWidth = gControlRightAreaWidth; + gControlRightAreaWidth = gMaxCols - gControlLeftMargin - gLabelLeftMargin - 2; + } + break; + } + + return Status; + } + if (TempRightAreaWidth != 0) + { + gControlRightAreaWidth = TempRightAreaWidth; + TempRightAreaWidth = 0; + } + return Status; +} +// +//---------------------------------------------------------------------------- +// Procedure: _StyleAddSpacing +// +// Description: Function to add spacing +// +// Input: FRAME_DATA *frame +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID _StyleAddSpacing( FRAME_DATA *frame ) +{ + _StyleAddControl( frame, CONTROL_TYPE_NULL, NULL, NULL, NULL ); + if ( frame->ControlCount == 7 ) + _StyleAddControl( frame, CONTROL_TYPE_NULL, NULL, NULL, NULL ); +} +// +//---------------------------------------------------------------------------- +// Procedure: _StyleAddControl +// +// Description: Function to add controls +// +// Input: FRAME_DATA *frame, UINT16 type, VOID *data, UINT32 *controlNumber, BOOLEAN *focus +// +// Output: EFI_STATUS +// +//---------------------------------------------------------------------------- +// +EFI_STATUS _StyleAddControl( FRAME_DATA *frame, UINT16 type, VOID *data, UINT32 *controlNumber, BOOLEAN *focus ) +{ + EFI_STATUS Status; + CONTROL_INFO dummy; + + MemSet( &dummy, sizeof(dummy), 0 ); + dummy.ControlHandle = (VOID*)(UINTN)INVALID_HANDLE; + + dummy.ControlType = type; + dummy.ControlPtr = (VOID*)data; + dummy.ControlFlags.ControlVisible = TRUE; + + Status = gFrame.AddControl( frame, &dummy ); + if ( EFI_ERROR( Status ) ) + return Status; + + if ( type != CONTROL_TYPE_NULL ) + { + if ( ! *focus ) + { + if ( _FrameSetControlFocus( frame, *controlNumber ) ) + { + frame->CurrentControl = *controlNumber; + *focus = TRUE; + } + } + + (*controlNumber)++; + } + + return Status; +} +#endif +//*****************************************************************// +//*****************************************************************// +//** **// +//** (C)Copyright 1985-2011, American Megatrends, Inc. **// +//** **// +//** All Rights Reserved. **// +//** **// +//** 5555 Oakbrook Pkwy , Norcross, GA 30071 **// +//** **// +//** Phone: (770)-246-8600 **// +//** **// +//*****************************************************************// +//*****************************************************************// diff --git a/EDK/MiniSetup/EzportPlus/style.h b/EDK/MiniSetup/EzportPlus/style.h new file mode 100644 index 0000000..b4c3cde --- /dev/null +++ b/EDK/MiniSetup/EzportPlus/style.h @@ -0,0 +1,255 @@ +//*****************************************************************// +//*****************************************************************// +//*****************************************************************// +//** **// +//** (C)Copyright 1985-2011, American Megatrends, Inc. **// +//** **// +//** All Rights Reserved. **// +//** **// +//** 5555 Oakbrook Pkwy , Norcross, GA 30071 **// +//** **// +//** Phone (770)-246-8600 **// +//** **// +//*****************************************************************// +//*****************************************************************// +//*****************************************************************// +// $Archive: /Alaska/SOURCE/Modules/AMITSE2_0/AMITSE/EzportPlus/style.h $ +// +// $Author: Arunsb $ +// +// $Revision: 3 $ +// +// $Date: 10/18/12 6:07a $ +// +//*****************************************************************// +//*****************************************************************// +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/AMITSE2_0/AMITSE/EzportPlus/style.h $ +// +// 3 10/18/12 6:07a Arunsb +// Updated for 2.16.1235 QA submission +// +// 2 10/10/12 12:43p Arunsb +// Synched the source for v2.16.1232, backup with Aptio +// +// 2 6/29/11 12:33p Rajashakerg +// [TAG] EIP47086 +// [Category] New Feature +// [Description] Right clicking from the Main page is not exiting from +// BIOS setup. +// +// [Files] minisetup.h, Ezport\style.h,Ezport\EzportBin.sdl, +// Ezport\EzportBin.mak, Ezport\ezport.c, Ezport\EzportBin.cif, +// EzportPlus\style.h, EzportPlus\EzportPlusBin.sdl, EzportPlusBin.mak, +// EzportPlus\EzportPlusBin.cif, EzportPlus\ezportplus.c, Legacy\style.h, +// Legacy\EzportPlusBin.sdl, Legacy\LegacyBin.mak, Legacy\LegacyBin.cif, +// Legacy\legacy.c, TseLiteBin.sdl, TseLite.cif, Memo.c, frame.c, +// application.h, application.c, commonoem.h, CommonHelper.c +// +// 1 3/28/11 11:51p Madhans +// [TAG] EIP54968 +// [Category] Improvement +// [Description] To Support different style modules in TSE generically +// [Files] Ezport module updated. EzportPlus and Legacy Styles Modules +// added. +// +// 8 11/18/10 6:38p Blaines +// [TAG] - EIP 45374 +// [Category]- Function Request +// [Synopsis]- Need method to configure Post Menu programmatically, Items +// requested +// - Exit Keys +// - Font Colors +// - Background Colors. +// [Solution] +// - Create hook to set window color, +// - Add AMI_POSTMENU_ATTRIB_EXIT_KEY attribute to POSTMENU_TEMPLATE to +// configure exit keys. +// [Files] - stylecommon.c, style.h, listbox.c, minisetupext.c, +// AMIPostMgr.h +// +// 7 4/16/10 5:13p Madhans +// Changes for Tse 2.02. Please see Changelog.log for more details. +// +// 6 2/26/10 8:53p Madhans +// For TSE 2.01.1024. refer changelog.log for file checkin history . +// +// 8 2/26/10 1:30p Madhans +// To avoid build issues with EDK. +// +// 7 2/19/10 8:15a Mallikarjunanv +// updated year in copyright message +// +// 6 2/05/10 6:04p Madhans +// Mouse action override from Style Module. +// +// 5 8/19/09 11:13a Blaines +// Update OEM Override prototypes +// +// 4 8/18/09 6:35p Blaines +// Support additional date styles +// +// 3 8/17/09 12:23p Presannar +// Removed References to Tiano.h +// +// 2 6/12/09 2:36p Blaines +// Update coding standard +// +// 1 6/04/09 8:05p Madhans +// +// 4 5/20/09 3:37p Blaines +// Add functions to access date format and Scroll behavior +// +// 3 5/18/09 12:18p Blaines +// Fix Help Frame text scroll +// Add OEM Style override prototype declarations +// +// 2 5/07/09 10:35a Madhans +// Changes after Bin module +// +// 1 4/28/09 11:15p Madhans +// Tse 2.0 Code complete Checkin. +// +// 3 4/24/09 9:35p Blaines +// +// 1 12/18/08 7:58p Madhans +// Intial version of TSE Lite sources +//*****************************************************************// +//*****************************************************************// +// +// +// Name: style.h +// +// Description: Style override prototypes. +// +// +//********************************************************************** +//#define SETUP_STYLE_FULL_SCREEN 1 +//#define SETUP_GO_TO_EXIT_PAGE_ON_EXIT_KEY 0 + +#ifndef _STYLE_H_ +#define _STYLE_H_ + +#if TSE_USE_EDK_LIBRARY +#include "Tiano.h" +#else +#include "Efi.h" +#endif + +//#define SETUP_STYLE_EZPORTPLUS 1 +#include "ezportplus.h" +#include "page.h" +#include "frame.h" + +INTN GetWindowLevel( UINT16 PageID); +EFI_STATUS StyleGetWindowColor(UINT8 *Color, INTN Level, UINT8 WindowType) ; +EFI_STATUS StyleGetMessageboxColor( UINT8 MessageBoxType, UINT8 *Color); +EFI_STATUS StyleControlColor(FRAME_DATA *frame, STYLECOLORS *Colors); +EFI_STATUS OverRideControlColor(FRAME_DATA *frame, STYLECOLORS *Colors); +VOID StyleInit( VOID ); +VOID StyleExit( VOID ); +VOID StyleDrawPageBorder( UINT32 page ); +UINT32 StyleGetPageFrames( UINT32 page ); +UINT32 StyleFrameIndexOf( UINT32 frameType ); +VOID StyleBeforeFrame( FRAME_DATA *frame ) ; +EFI_STATUS StyleFrameDrawable( FRAME_DATA *frame ); +VOID StyleUpdateFrameStrings(PAGE_DATA *page); +VOID * StyleGetFrameInitData( UINT32 page, UINT32 frame ); + +EFI_STATUS StyleFrameHandleMouse( FRAME_DATA *frame, MOUSE_INFO MouseInfo); +EFI_STATUS StyleFrameHandleTimer( FRAME_DATA *frame, ACTION_DATA *action ); +EFI_STATUS StyleFrameHandleKey( FRAME_DATA *frame, EFI_INPUT_KEY Key ); +EFI_STATUS StyleHandleControlOverflow( FRAME_DATA *frame, CONTROL_DATA *control, UINT16 count ); +EFI_STATUS StyleInitializeFrame( FRAME_DATA *frame, UINT32 frameType, PAGE_INFO *data ); +UINT16 StyleGetNavToken( UINT32 page ); +EFI_STATUS StyleAddAdditionalControls( FRAME_DATA *frame, UINT32 controlNumber, BOOLEAN focus ); + +//EFI_STATUS StyleMenuCallback( FRAME_DATA *frame, MENU_DATA *menu, CALLBACK_MENU *data ); +VOID StyleLabelCallback( FRAME_DATA *frame, LABEL_DATA *label, VOID *cookie ); + +EFI_STATUS _StyleAddControl( FRAME_DATA *frame, UINT16 type, VOID *data, UINT32 *number, BOOLEAN *focus ); +UINT16 StyleLanguagePage( SUBMENU_DATA *submenu ); +UINT16 StyleBootManagerPage( SUBMENU_DATA *submenu ); +BOOLEAN StyleHelpAreaScrollable(VOID); +VOID StylePageItemFocus(PAGE_DATA *page, FRAME_DATA *frame ); +VOID StyleSubPageItemFocus(PAGE_DATA *page, FRAME_DATA *frame ); +BOOLEAN StyleGetShadowSupport(VOID); +VOID StyleDrawScrollBar(FRAME_DATA *frame, UINT32 FirstLine, UINT32 LastLine, UINT32 modVal, + UINT32 sizeOfBar, UINT32 numOfBlocks, BOOLEAN bEraseScrollBar); + +VOID StyleDrawHelpScrollBar( MEMO_DATA *memo, UINT16 height); + + +VOID StyleSelectFirstDisplayPage( VOID ); +VOID StyleAddExtraPagesData( VOID ); +EFI_STATUS StyleGetSpecialColor( UINT16 ControlType, UINT8 *Color); +UINTN StyleGetDateFormat(VOID); +BOOLEAN StyleShowDay(VOID); +BOOLEAN StyleGetScrollBehavior(VOID) ; + +VOID StyleFrameSetControlPositions(FRAME_DATA *frame, UINT32 *pOtherEnd); +extern HOTKEY_TEMPLATE gHotKeyInfo[]; +extern HOTCLICK_TEMPLATE gHotClickInfo[];//EIP:47086 - Right clicking from the Main page is not exiting from BIOS setup. +extern UINT32 gHotKeyCount; +extern UINT32 gHotClickCount;//EIP:47086 - Right clicking from the Main page is not exiting from BIOS setup. +//extern UINT8 gLabelLeftMargin ; +//extern UINT8 gControlLeftMargin ; +//extern FRAME_INFO _gStyleStandardSubFrames[] ; +extern UINT32 gSubFrameCount ; +extern EFI_STATUS FrameDrawScrollBar (FRAME_DATA *frame, UINT32 FirstLine, UINT32 LastLine, UINT32 modVal, UINT32 sizeOfBar, UINT32 numOfBlocks, BOOLEAN bEraseScrollBar); +EFI_STATUS StyleFrameAddTitle( FRAME_DATA *frame, UINT32 frameType,CONTROL_INFO * dummy ); + + +//Common Overrides +EFI_STATUS OverRideStyleHandleControlOverflow( FRAME_DATA *frame, CONTROL_DATA *control, UINT16 count ); +EFI_STATUS OverRideStyleInitializeFrame( FRAME_DATA *frame, UINT32 frameType, PAGE_INFO *data ); +UINT16 OverRideStyleGetNavToken( UINT32 page ); +EFI_STATUS OverRideStyleAddAdditionalControls( FRAME_DATA *frame, UINT32 controlNumber, BOOLEAN focus ); +VOID OverRideStyleSelectFirstDisplayPage( VOID ); +VOID OverRideStyleUpdateVersionString( VOID ); +EFI_STATUS OverRideStyleFrameDrawable( FRAME_DATA *frame ); + +//Oem Overrides +UINTN OEMStyleGetDateFormat(VOID); +EFI_STATUS OEMGetSpecialColor(UINT16 ControlType, UINT8 *Color); +VOID OEMStyleBeforeFrame( FRAME_DATA *frame ); +VOID OEMStyleUpdateFrameStrings( PAGE_DATA *page ); +EFI_STATUS OEMStyleFrameDrawable( FRAME_DATA *frame ); +VOID OEMStyleInit( VOID ); +VOID OEMStyleExit( VOID ); +VOID OEMStyleDrawPageBorder( UINT32 page ); +VOID OEMDrawScrollBar(FRAME_DATA *frame, UINT32 FirstLine, UINT32 LastLine, UINT32 modVal, UINT32 sizeOfBar, UINT32 numOfBlocks, BOOLEAN bEraseScrollBar); +VOID OEMDrawHelpScrollBar( MEMO_DATA *memo, UINT16 height); +VOID *OEMStyleGetFrameInitData( UINT32 page, UINT32 frame ); +EFI_STATUS OEMStyleFrameHandleKey( FRAME_DATA *frame, EFI_INPUT_KEY Key ); +EFI_STATUS OEMStyleHandleControlOverflow( FRAME_DATA *frame, CONTROL_DATA *control, UINT16 count ); +EFI_STATUS OEMStyleInitializeFrame( FRAME_DATA *frame, UINT32 frameType, PAGE_INFO *data ); +UINT16 OEMStyleGetNavToken( UINT32 page ); +EFI_STATUS OEMStyleAddAdditionalControls( FRAME_DATA *frame, UINT32 controlNumber, BOOLEAN focus ); +UINT16 OEMStyleLanguagePage( SUBMENU_DATA *submenu ); +UINT16 OEMStyleBootManagerPage( SUBMENU_DATA *submenu ); +VOID OEMStyleLabelCallback( FRAME_DATA *frame, LABEL_DATA *label, VOID *cookie ); +VOID OEMStyleSelectFirstDisplayPage( VOID ); +VOID OEMStyleAddExtraPagesData(VOID); +UINTN OEMStyleGetTextMode( UINTN Rows, UINTN Cols ); +VOID OEMStyleUpdateVersionString( VOID ); +VOID OEMStyleFrameSetControlPositions(FRAME_DATA *frame, UINT32 *pOtherEnd); +VOID OEMOverRideComponent(VOID); +VOID OEMStylePageItemFocus(PAGE_DATA *page, FRAME_DATA *frame ); +VOID OEMStyleSubPageItemFocus(PAGE_DATA *page, FRAME_DATA *frame ); + +#endif /* _STYLE_H_ */ +//*****************************************************************// +//*****************************************************************// +//** **// +//** (C)Copyright 1985-2011, American Megatrends, Inc. **// +//** **// +//** All Rights Reserved. **// +//** **// +//** 5555 Oakbrook Pkwy , Norcross, GA 30071 **// +//** **// +//** Phone: (770)-246-8600 **// +//** **// +//*****************************************************************// +//*****************************************************************// diff --git a/EDK/MiniSetup/EzportPlus/stylecommon.c b/EDK/MiniSetup/EzportPlus/stylecommon.c new file mode 100644 index 0000000..6f70096 --- /dev/null +++ b/EDK/MiniSetup/EzportPlus/stylecommon.c @@ -0,0 +1,1437 @@ +//*****************************************************************// +//*****************************************************************// +//*****************************************************************// +//** **// +//** (C)Copyright 1985-2013, American Megatrends, Inc. **// +//** **// +//** All Rights Reserved. **// +//** **// +//** 5555 Oakbrook Pkwy , Norcross, GA 30071 **// +//** **// +//** Phone: (770)-246-8600 **// +//** **// +//*****************************************************************// +//*****************************************************************// +//*****************************************************************// +// $Archive: /Alaska/SOURCE/Modules/AMITSE2_0/AMITSE/EzportPlus/stylecommon.c $ +// +// $Author: Rajashakerg $ +// +// $Revision: 13 $ +// +// $Date: 3/16/13 2:18a $ +// +//*****************************************************************// +//*****************************************************************// +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/AMITSE2_0/AMITSE/EzportPlus/stylecommon.c $ +// +// 13 3/16/13 2:18a Rajashakerg +// [TAG] EIP111479 +// [Category] Bug Fix +// [Severity] Normal +// [Symptom] BIOS dialog box is crashed with special +// monitor(160,53,1280*1024) +// [RootCause] DesiredTextMode was not set properly. +// [Solution] Provided proper mode number while setting text mode. +// [Files] postmgmtext.c, Ezport\stylecommon.c, +// EzportPlus\stylecommon.c, Legacy\stylecommon.c +// +// 12 2/10/13 11:56p Rajashakerg +// [TAG] EIP104521 +// [Category] Improvement +// [Description] Customer needs AMITSE modification to popup boxes so +// highlighted choices can be seen via VT100 console redirection +// [Files] AMITSE.sdl, CommonHelper.c, Ezport\stylecommon.c, +// EzportPlus\stylecommon.c, Legacy\stylecommon.c +// +// 11 10/18/12 6:07a Arunsb +// Updated for 2.16.1235 QA submission +// +// 3 10/10/12 12:43p Arunsb +// Synched the source for v2.16.1232, backup with Aptio +// +// 9 9/17/12 6:27a Rajashakerg +// Updated EIP changes for 2.16 release. +// +// 7 8/29/12 4:28p Arunsb +// [TAG] EIP94702 +// [Description] Support for Native Resolution in POST/BOOT +// [Files] amitse.sdl, commonhelper.c, commonoem.c, boot.c, logo.c, +// notify.c, postmgmt.c, tselite\minisetupext.c, ezport/stylecommon.c, +// ezportplus/stylecommon.c andlegacy/stylecommon.c +// +// 6 4/03/12 3:05a Premkumara +// [TAG] EIP84150 +// [Category] Bug Fix +// [Severity] Normal +// [Symptom] All the timers for mouse drivers before exiting from setup +// is not stopped +// [RootCause] MouseDestroy() is not called StopPointingDevice() +// function to stop Mouse device +// [Solution] StopPointingDevice() function is called in MouseDestroy() +// function +// [Files] Mouse.c, Protocol.c, Ezport/StyleCommon.c, +// EzportPlus/StyleCommon.c, Legacy/StyleCommon.c, Minisetupext.c +// +// 5 12/13/11 6:15p Blaines +// Remove error message when ESC key pressed. +// Display message when password is cleared. +// +// 4 11/28/11 1:29a Premkumara +// [TAG] EIP75384 +// [Category] Improvement +// [Description] Suppress the warnings from static code analyzer +// [Files] UefiWapper.c, Hii.c, Expression.c, CtrlCond.c, PopupSel.c, +// Minisetupext.c, Menu.c, Date.c, Ezport\Stylecommon.c, +// EzportPlus\StyleCommon.c, +// +// 3 11/14/11 6:55p Blaines +// [TAG] - EIP 75486 +// [Category]- Function Request +// [Synopsis]- Support grayout condition for readonly controls. +// [Description] - Display readonly controls as grayout, non-selectable. +// [Files] +// AMITSE.sdl, CommonHelper.c, Minisetupext.h, stylecommon.c, Legacy.c, +// date.c, edit.c, label.c, memo.c, menu.c,, numeric.c, ordlistbox.c, +// PopupPassword.c, +// PopupSel.c, PopupString.c, ResetButton.c, SubMenu.c, Text.c, Time.c, +// UefiAction.c, ctrlcond.c, +// +// 2 11/09/11 10:06a Premkumara +// [TAG] EIP74375 +// [Category] Improvement +// [Description] Control STYLE_HELP_AREA_SCROLLBAR from binary +// [Files] CommonHelper.c, AMITSE.sdl, StyleHook.h, +// Legacy\StyleCommon.c, Legacy.sdl, +// EzportPlus\StyleCommon.c, EzportPlus.sdl, Ezport\StyleCommon.c, +// Ezport.sdl +// +// 1 3/28/11 11:51p Madhans +// [TAG] EIP54968 +// [Category] Improvement +// [Description] To Support different style modules in TSE generically +// [Files] Ezport module updated. EzportPlus and Legacy Styles Modules +// added. +// +// 8 1/06/11 7:54p Blaines +// [TAG] - EIP 51678 +// [Category]- Enhancment +// [Severity]- Mordarate +// [Symptom]- Style function should allow OEM to override default +// implementation. +// +// [Rootcause] - Style function does not provide override macro. +// [Solution] - Add Macro Overrides to the following functions: +// +// StyleGetClearScreenColor, +// StyleGetPageLinkColor, +// StyleGetScrollBarUpArrowColor , +// StyleGetScrollBarDownArrowColor. +// +// [Files] - stylecommon.c +// +// 7 11/18/10 6:38p Blaines +// [TAG] - EIP 45374 +// [Category]- Function Request +// [Synopsis]- Need method to configure Post Menu programmatically, Items +// requested +// - Exit Keys +// - Font Colors +// - Background Colors. +// [Solution] +// - Create hook to set window color, +// - Add AMI_POSTMENU_ATTRIB_EXIT_KEY attribute to POSTMENU_TEMPLATE to +// configure exit keys. +// [Files] - stylecommon.c, style.h, listbox.c, minisetupext.c, +// AMIPostMgr.h +// +// 6 4/16/10 5:13p Madhans +// Changes for Tse 2.02. Please see Changelog.log for more details. +// +// 5 2/19/10 1:02p Madhans +// Updated for TSE 2.01. Refer Changelog.log for File change history. +// +// 8 2/19/10 8:15a Mallikarjunanv +// updated year in copyright message +// +// 7 2/05/10 6:04p Madhans +// Mouse action override from Style Module. +// +// 6 11/09/09 4:44a Mallikarjunanv +// Eip-30111 : fixed the issue to update the help if +// STYLE_PAGE_FIRSTITEM_FOCUS token enabled. +// +// 5 8/18/09 6:35p Blaines +// Support additional date styles +// +// 4 8/13/09 1:24p Blaines +// EIP #24980 Fix to properly display right area text; +// +// +// 3 6/23/09 6:54p Blaines +// Coding standard update, +// Remove spaces from file header to allow proper chm function list +// creation. +// +// 2 6/12/09 2:36p Blaines +// Update coding standard +// +// 1 6/04/09 8:05p Madhans +// +// 4 5/20/09 3:37p Blaines +// Add functions to access date format and Scroll behavior +// +// 3 5/18/09 12:18p Blaines +// Fix Help Frame text scroll +// Add OEM Style override prototype declarations +// +// 2 5/07/09 10:35a Madhans +// Changes after Bin module +// +// 1 4/28/09 11:15p Madhans +// Tse 2.0 Code complete Checkin. +// +// 4 4/28/09 9:39p Madhans +// Tse 2.0 Code complete Checkin. +// +// 3 4/24/09 9:35p Blaines +// +// 1 12/18/08 7:59p Madhans +// Intial version of TSE Lite sources +//*****************************************************************// +//*****************************************************************// +// +// +// Name: stylecommon.c +// +// Description: Contains generic or default style functions. +// +// +//********************************************************************** +#include "minisetup.h" + +#if SETUP_STYLE_EZPORTPLUS + + +VOID _StyleControlSubmenu( CONTROL_INFO *control, UINT16 pageID, VOID *ref ); +VOID UpdatePageFocusedItemHelp(PAGE_DATA *page); +// +//-------------------------------------------------------------------------- +// +// Name: StyleControlColor +// +// Description: Adds controls to the frame +// +// Input: FRAME_DATA *frame - Pointer to the frame data +// STYLECOLORS Colors - Color scheme +// +// Output: EFI_STATUS Status - EFI_SUCCESS if successful, else +// EFI_UNSUPPORTED +// +//-------------------------------------------------------------------------- +// +EFI_STATUS StyleControlColor(FRAME_DATA *frame, STYLECOLORS *Colors) +{ + //Note: Blaines 01/12/09 + //The goal here is to allow controls to match the BGColor of their frame. + //Normally this is handled in StyleInitializeFrame(), before controls are added to the frame. + //But this function is called dynamically during runtime (after pages/frames/controls are styled) + //Since controls derive their colors from [STYLECOLORS Colors], + //we'll temporarly modify it before controls are added to this frame, then restore it. + + EFI_STATUS Status = EFI_SUCCESS; + + #ifdef STYLE_OEM_CONTROL_COLOR + Status = OEMControlColor(frame, Colors); + #else + #ifdef STYLE_CONTROL_COLOR + Status = OverRideControlColor(frame, Colors); + #else + //Temporarly Match the BGColor of the frame + Colors->BGColor = frame->FrameData.BGColor ; + Colors->SecBGColor = frame->FrameData.BGColor ; + Colors->SelBGColor = frame->FrameData.BGColor ; + Colors->NSelBGColor = frame->FrameData.BGColor ; + Colors->LabelBGColor = frame->FrameData.BGColor ; + Colors->PopupBGColor = frame->FrameData.BGColor ; + + #endif + + #endif + + return Status ; +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleGetSpecialColor +// +// Description: Function to get control special color +// +// Input: UINT16 ControlType, UINT8 *Color +// +// Output: status +// +//---------------------------------------------------------------------------- +// +EFI_STATUS StyleGetSpecialColor( UINT16 ControlType, UINT8 *Color) +{ + EFI_STATUS Status = EFI_SUCCESS;; + + #ifdef STYLE_OEM_SPECIAL_COLOR + Status = OEMGetSpecialColor(ControlType, Color); + #else + + + switch ( ControlType ) + { + case CONTROL_TYPE_MEMO: + if (Color !=NULL) *Color = MEMO_COLOR ; + break; + + case CONTROL_TYPE_TEXT: + if (Color !=NULL) *Color = TEXT_COLOR ; + break; + + default: + Status = EFI_UNSUPPORTED;; + break; + } + #endif + + return Status ; +} +// +//---------------------------------------------------------------------------- +// Procedure: GetWindowLevel +// +// Description: Function to get window level +// +// Input: UINT16 PageID +// +// Output: INTN Level +// +//---------------------------------------------------------------------------- +// +INTN GetWindowLevel( UINT16 PageID) +{ + INTN zIndex = 0 ; + UINT16 TempID = PageID ; + + while(gApp->PageList[TempID]->PageData.PageParentID) + { + TempID = gApp->PageList[TempID]->PageData.PageParentID ; + zIndex += 1 ; + } + + return zIndex ; +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleGetWindowColor +// +// Description: Function to get window color +// +// Input: UINT8 *Color - Window Color +// INTN Level - Window Level +// UINT8 Type - Window Type (0->Setup, 1->PostMenu) +// +// Output: status +// +//---------------------------------------------------------------------------- +// +EFI_STATUS StyleGetWindowColor(UINT8 *Color, INTN Level, UINT8 WindowType) +{ + return EFI_SUCCESS ; + +} + +VOID GetMessageboxColorHook(UINT8 **Color); +// +//---------------------------------------------------------------------------- +// Procedure: StyleGetMessageboxColor +// +// Description: Function to get control Messagebox color +// +// Input: UINT16 ControlType, UINT8 *Color +// +// Output: status +// +//---------------------------------------------------------------------------- +// +EFI_STATUS StyleGetMessageboxColor( UINT8 MessageBoxType, UINT8 *Color) +{ + EFI_STATUS Status = EFI_SUCCESS;; + + if(Color == NULL) + return Status ; + + + switch ( MessageBoxType ) + { + case MSGBOX_EX_CATAGORY_HELP: + *Color = EFI_BACKGROUND_LIGHTGRAY | EFI_BLUE ; + break; + + case MSGBOX_EX_CATAGORY_QUERY: + *Color = EFI_BACKGROUND_CYAN | EFI_WHITE ; + break; + + case MSGBOX_EX_CATAGORY_SUCCESS: + *Color = EFI_BACKGROUND_GREEN | EFI_WHITE ; + break; + + case MSGBOX_EX_CATAGORY_WARNING: + *Color = EFI_BACKGROUND_RED | EFI_WHITE ; + break; + + case MSGBOX_EX_CATAGORY_ERROR: + *Color = EFI_BACKGROUND_RED | EFI_WHITE ; + break; + + case MSGBOX_EX_CATAGORY_PROGRESS: + *Color = EFI_BACKGROUND_LIGHTGRAY | EFI_WHITE ; + break; + + case MSGBOX_EX_CATAGORY_HALT: + *Color = EFI_BACKGROUND_LIGHTGRAY | EFI_WHITE ; + break; + + case MSGBOX_EX_CATAGORY_NORMAL: + + default: + *Color = EFI_BACKGROUND_BLUE | EFI_WHITE ; + + break; + } + + GetMessageboxColorHook(&Color); + return Status ; +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleBeforeFrame +// +// Description: Function to alter frame styling before frame is drawn +// +// Input: FRAME_DATA *frame +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID StyleBeforeFrame( FRAME_DATA *frame ) +{ + #ifdef STYLE_OEM_BEFORE_FRAME + OEMStyleBeforeFrame(frame); + #else + #ifdef STYLE_OVERRIDE_BEFORE_FRAME // from EzportPlus.h + OverRideStyleBeforeFrame(frame ); // From ezportplus.c + #endif + + #endif +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleUpdateFrameStrings +// +// Description: Function to update frame strings +// +// Input: PAGE_DATA *page +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID StyleUpdateFrameStrings( PAGE_DATA *page ) +{ + #ifdef STYLE_OEM_FRAME_TOKEN // SDL + OEMStyleUpdateFrameStrings(page); // OEM + #else + #ifdef STYLE_OVERRIDE_FRAME_TOKEN // from EzportPlus.h + OverRideStyleUpdateFrameStrings(page ); // From ezportplus.c + #endif + #endif +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleFrameDrawable +// +// Description: Function to determine if frame is drawable +// +// Input: FRAME_DATA *frame +// +// Output: EFI_STATUS +// +//---------------------------------------------------------------------------- +// +EFI_STATUS StyleFrameDrawable( FRAME_DATA *frame ) +{ + EFI_STATUS Status = EFI_SUCCESS; + + #ifdef STYLE_OEM_FRAME_DRAWABLE // SDL + Status = OEMStyleFrameDrawable(frame); // OEM + #else + #ifdef STYLE_OVERRIDE_FRAME_DRAWABLE // from EzportPlus.h + Status = OverRideStyleFrameDrawable(frame ); // From ezportplus.c + #endif + #endif + + return Status ; +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleInit +// +// Description: Function to initialize style +// +// Input: VOID +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID StyleInit( VOID ) +{ + SetDesiredTextMode(); + OverRideStyleInit(); // From ezportplus.c + +#ifdef STYLE_OEM_INIT // SDL + OEMStyleInit(); // OEM +#endif + MouseInit(); //EIP-84150 +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleExit +// +// Description: Function to do style initialization on exit +// +// Input: VOID +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID StyleExit( VOID ) +{ + #ifdef STYLE_OEM_STYLE_EXIT // SDL + OEMStyleExit(); // OEM + #else + #ifdef STYLE_OVERRIDE_EXIT // from EzportPlus.h + OverRideStyleExit(); // From ezportplus.c + #endif + #endif + MouseDestroy(); //EIP-84150 +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleDrawPageBorder +// +// Description: Function to draw the page border +// +// Input: UINT32 page number +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID StyleDrawPageBorder( UINT32 page ) +{ + #ifdef STYLE_OEM_PAGE_BORDER // SDL + OEMStyleDrawPageBorder(page); // OEM + #else + #ifdef STYLE_OVERRIDE_PAGE_BORDER // from EzportPlus.h + OverRideStyleDrawPageBorder(page); // From ezportplus.c + #else + ClearScreen( EFI_BACKGROUND_BLUE | EFI_WHITE ); + #endif + #endif + +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleDrawScrollBar +// +// Description: Function to draw the frame scrollbar +// +// Input: FRAME_DATA *frame, UINT32 FirstLine, UINT32 LastLine, UINT32 modVal, UINT32 sizeOfBar, UINT32 numOfBlocks, BOOLEAN bEraseScrollBar +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID StyleDrawScrollBar(FRAME_DATA *frame, UINT32 FirstLine, UINT32 LastLine, UINT32 modVal, + UINT32 sizeOfBar, UINT32 numOfBlocks, BOOLEAN bEraseScrollBar) +{ + #ifdef STYLE_OEM_SCROLLBAR + OEMDrawScrollBar(frame, FirstLine, LastLine, modVal, sizeOfBar, numOfBlocks, bEraseScrollBar); + #else + #ifdef STYLE_OVERRIDE_SCROLLBAR + OverRideDrawScrollBar(frame, FirstLine, LastLine, modVal, sizeOfBar, numOfBlocks, bEraseScrollBar); + #else + FrameDrawScrollBar(frame, FirstLine, LastLine, modVal, sizeOfBar, numOfBlocks, bEraseScrollBar); + #endif + #endif + +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleDrawHelpScrollBar +// +// Description: Function to draw the help frame scrollbar +// +// Input: MEMO_DATA *memo, UINT16 height +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID StyleDrawHelpScrollBar( MEMO_DATA *memo, UINT16 height) +{ + #ifdef STYLE_OEM_DRAW_HELP_SCROLLBAR + OEMDrawHelpScrollBar(memo, height); + #else + #ifdef STYLE_OVERRIDE_HELP_SCROLLBAR + OverRideDrawHelpScrollBar(memo, height); + #else + if(IsHelpAreaScrollBarSupport()) + MemoDrawScrollBar(memo, height); + #endif + #endif + +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleGetFrameInitData +// +// Description: Function to get frame initialization data +// +// Input: UINT32 page number, UINT32 frame number +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID *StyleGetFrameInitData( UINT32 page, UINT32 frame ) +{ + #ifdef STYLE_OEM_FRAME_INIT_DATA + return OEMStyleGetFrameInitData(page, frame); + #else + #ifdef STYLE_OVERRIDE_FRAME_INIT_DATA // from EzportPlus.h + return OverRideStyleGetFrameInitData(page, frame); // From ezportplus.c + #else + return NULL; + #endif + #endif + +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleFrameHandleKey +// +// Description: Function to handle frame action keys +// +// Input: FRAME_DATA *frame, EFI_INPUT_KEY Key +// +// Output: EFI_STATUS +// +//---------------------------------------------------------------------------- +// +EFI_STATUS StyleFrameHandleKey( FRAME_DATA *frame, EFI_INPUT_KEY Key ) +{ + EFI_STATUS Status = EFI_UNSUPPORTED;; + + #ifdef STYLE_OEM_HANDLE_KEY // SDL + Status = OEMStyleFrameHandleKey(frame, Key); // OEM + #else + #ifdef STYLE_OVERRIDE_HANDLE_KEY // from EzportPlus.h + Status = OverRideStyleFrameHandleKey(frame, Key); // From ezportplus.c + #endif + #endif + + return Status ; +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleFrameHandleMouse +// +// Description: Function to handle frame using mouse +// +// Input: FRAME_DATA *frame, +// MOUSE_INFO MouseInfo +// +// Output: EFI_STATUS +// +//---------------------------------------------------------------------------- +// +EFI_STATUS StyleFrameHandleMouse( FRAME_DATA *frame, MOUSE_INFO MouseInfo) +{ + EFI_STATUS Status = EFI_UNSUPPORTED;; + + #ifdef STYLE_OEM_HANDLE_MOUSE + Status = OEMStyleFrameHandleMouse(frame, MouseInfo); + #else + #ifdef STYLE_OVERRIDE_HANDLE_MOUSE + Status = OverRideStyleFrameHandleMouse(frame, MouseInfo); + #endif + #endif + + return Status ; +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleFrameHandleTimer +// +// Description: Function to handle frame timer action +// +// Input: FRAME_DATA *frame, ACTION_DATA *action +// +// Output: EFI_STATUS +// +//---------------------------------------------------------------------------- +// +EFI_STATUS StyleFrameHandleTimer( FRAME_DATA *frame, ACTION_DATA *action ) +{ + EFI_STATUS Status = EFI_UNSUPPORTED;; + + #ifdef STYLE_OEM_HANDLE_TIMER + Status = OEMStyleFrameHandleTimer(frame, action); + #else + #ifdef STYLE_OVERRIDE_HANDLE_TIMER + Status = OverRideStyleFrameHandleTimer(frame, action); + #endif + #endif + + return Status ; +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleHandleControlOverflow +// +// Description: Function to handle control overflow +// +// Input: FRAME_DATA *frame, CONTROL_DATA *control, UINT16 count +// +// Output: EFI_STATUS +// +//---------------------------------------------------------------------------- +// +EFI_STATUS StyleHandleControlOverflow( FRAME_DATA *frame, CONTROL_DATA *control, UINT16 count ) +{ + EFI_STATUS Status = EFI_OUT_OF_RESOURCES; + + #ifdef STYLE_OEM_CONTROL_OVERFLOW + Status = OEMStyleHandleControlOverflow(frame, control, count ); + #else + #ifdef STYLE_OVERRIDE_CONTROL_OVERFLOW + Status = OverRideStyleHandleControlOverflow(frame, control, count ); + #endif + #endif + + return Status ; + +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleInitializeFrame +// +// Description: Function to Initialize frame +// +// Input: FRAME_DATA *frame, UINT32 frameType, PAGE_INFO *data +// +// Output: EFI_STATUS +// +//---------------------------------------------------------------------------- +// +EFI_STATUS StyleInitializeFrame( FRAME_DATA *frame, UINT32 frameType, PAGE_INFO *data ) +{ + EFI_STATUS Status = EFI_SUCCESS;; + + #ifdef STYLE_OEM_INITIALIZE_FRAME + Status = OEMStyleInitializeFrame(frame, frameType, data ); + #else + #ifdef STYLE_OVERRIDE_INITIALIZE_FRAME + Status = OverRideStyleInitializeFrame(frame, frameType, data); //style.c + #endif + #endif + + return Status ; + +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleGetNavToken +// +// Description: Function to get navigation token +// +// Input: UINT32 page +// +// Output: UINT16 token number +// +//---------------------------------------------------------------------------- +// +UINT16 StyleGetNavToken( UINT32 page ) +{ + UINT16 i=0 ; + + #ifdef STYLE_OEM_NAV_TOKEN + i = OEMStyleGetNavToken(page ); + #else + #ifdef STYLE_OVERRIDE_NAV_TOKEN + i = OverRideStyleGetNavToken(page); + #endif + #endif + + return i ; +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleAddAdditionalControls +// +// Description: Function to add additinal controls +// +// Input: FRAME_DATA *frame, UINT32 controlNumber, BOOLEAN focus +// +// Output: EFI_STATUS +// +//---------------------------------------------------------------------------- +// +EFI_STATUS StyleAddAdditionalControls( FRAME_DATA *frame, UINT32 controlNumber, BOOLEAN focus ) +{ + EFI_STATUS Status = EFI_SUCCESS; + + #ifdef STYLE_OEM_ADD_CONTROLS + Status = OEMStyleAddAdditionalControls(frame, controlNumber, focus ); + #else + #ifdef STYLE_OVERRIDE_ADD_CONTROLS + Status = OverRideStyleAddAdditionalControls(frame, controlNumber, focus); + #endif + #endif + + return Status ; +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleLanguagePage +// +// Description: Function to set Language page +// +// Input: SUBMENU_DATA *submenu +// +// Output: UINT16 page number +// +//---------------------------------------------------------------------------- +// +UINT16 StyleLanguagePage( SUBMENU_DATA *submenu ) +{ + UINT16 i = 0 ; + + #ifdef STYLE_OEM_LANGUAGE_PAGE + i = OEMStyleLanguagePage(submenu ); + #else + #ifdef STYLE_OVERRIDE_LANGUAGE_PAGE + i = OverRideStyleLanguagePage(submenu); + #endif + #endif + + return i ; +} + + + +static UINT16 _gBootManagerPageID = 0; +/*static*/ UINT16 _gHDOrderPageID = 0; +/*static*/ UINT16 _gCDOrderPageID = 0; +/*static*/ UINT16 _gFDOrderPageID = 0; +/*static*/ UINT16 _gNetOrderPageID = 0; +/*static*/ UINT16 _gBevOrderPageID = 0; + +// +//---------------------------------------------------------------------------- +// Procedure: StyleBootManagerPage +// +// Description: Function to set boot manager page +// +// Input: SUBMENU_DATA *submenu +// +// Output: UINT16 page number +// +//---------------------------------------------------------------------------- +// +UINT16 StyleBootManagerPage( SUBMENU_DATA *submenu ) +{ + UINT16 i = 0 ; + + #ifdef STYLE_OEM_BM_PAGE + i = OEMStyleBootManagerPage(submenu ); + #else + #ifdef STYLE_OVERRIDE_BM_PAGE + i = OverRideStyleBootManagerPage(submenu); + #endif + #endif + + return i ; +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleLabelCallback +// +// Description: Function to set label callback +// +// Input: FRAME_DATA *frame, LABEL_DATA *label, VOID *cookie +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID StyleLabelCallback( FRAME_DATA *frame, LABEL_DATA *label, VOID *cookie ) +{ + #ifdef STYLE_OEM_LABEL_CALLBACK + OEMStyleLabelCallback(frame, label, cookie ); + #else + #ifdef STYLE_OVERRIDE_LABEL_CALLBACK + OverRideStyleLabelCallback(frame, label, cookie ); + #endif + #endif +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleSelectFirstDisplayPage +// +// Description: Function to set the first display page +// +// Input: VOID +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID StyleSelectFirstDisplayPage( VOID ) +{ + #ifdef STYLE_OEM_FIRST_PAGE + OEMStyleSelectFirstDisplayPage(); + #else + #ifdef STYLE_OVERRIDE_FIRST_PAGE + OverRideStyleSelectFirstDisplayPage(); + #endif + #endif +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleAddExtraPagesData +// +// Description: Function to add extra pages +// +// Input: VOID +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID StyleAddExtraPagesData(VOID) +{ + #ifdef STYLE_OEM_ADD_EXTRA_PAGES + OEMStyleAddExtraPagesData(); + #else + #ifdef STYLE_OVERRIDE_ADD_EXTRA_PAGES + OverRideStyleAddExtraPagesData(); + #endif + #endif +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleGetTextMode +// +// Description: Function to get text mode +// +// Input: UINTN Rows, UINTN Cols +// +// Output: UNNTN mode +// +//---------------------------------------------------------------------------- +// +UINTN StyleGetTextMode( UINTN Rows, UINTN Cols ) +{ + EFI_STATUS Status; + INT32 i; + UINTN ModeRows, ModeCols; + + #ifdef STYLE_OEM_GET_TEXT_MODE + i = OEMStyleGetTextMode( Rows, Cols ); + #else + #ifdef STYLE_OVERRIDE_GET_TEXT_MODE + i = OverRideStyleGetTextMode( Rows, Cols); + #else + // Default Implementation + for ( i = 0; i < gST->ConOut->Mode->MaxMode; i++ ) + { + Status = gST->ConOut->QueryMode( gST->ConOut, i, &ModeCols, &ModeRows ); + if ( EFI_ERROR( Status ) ) + continue; + + if ( ( Cols == ModeCols ) && ( Rows == ModeRows ) ) + return i; + } + + // return MaxMode if the mode wasn't found + #endif + #endif + + return i; +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleUpdateVersionString +// +// Description: Function to set the version string +// +// Input: VOID +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID StyleUpdateVersionString( VOID ) +{ + #ifdef STYLE_OEM_VERSION_STRING + OEMStyleUpdateVersionString(); + #else + #ifdef STYLE_OVERRIDE_VERSION_STRING + OverRideStyleUpdateVersionString(); + #endif + #endif +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleFrameSetControlPositions +// +// Description: Function to set control positioning in a frame +// +// Input: FRAME_DATA *frame, UINT32 *pOtherEnd +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID StyleFrameSetControlPositions(FRAME_DATA *frame, UINT32 *pOtherEnd) +{ + UINT32 u32Height = 0; + UINT32 i; + CONTROL_DATA *control; + UINT8 u8ChkResult; + + #ifdef STYLE_OEM_FRAME_CONTROL_POSITION + OEMStyleFrameSetControlPositions(frame, pOtherEnd); + #else + #ifdef STYLE_OVERRIDE_FRAME_CONTROL_POSITION + OverRideStyleFrameSetControlPositions(frame, pOtherEnd); + #else + //Move reference end variable based on action + if(pOtherEnd == &(frame->LastVisibleCtrl)) + { + i = frame->FirstVisibleCtrl; + } + else + { + i = frame->LastVisibleCtrl; + } + + //Calculate other end variable + while( (pOtherEnd == &(frame->LastVisibleCtrl)) ? (i < frame->ControlCount) : TRUE ) + { + control = frame->ControlList[i]; + + //EIP 75486 Support grayout condition for readonly controls + u8ChkResult = CheckControlCondition( &(control->ControlData) ); + + if((COND_NONE == u8ChkResult) || (COND_GRAYOUT == u8ChkResult)) + { + if( (u32Height + control->Height) < frame->FrameData.Height ) + { + *pOtherEnd = i; + u32Height += control->Height; + } + else + break; //We cant accommodate + } + else + *pOtherEnd = i; //we can accomodate a suppressed control + + if(pOtherEnd == &(frame->LastVisibleCtrl)) + i++; + else + { + // i>=0 in while loop will result in infinite loop + // break statement should be introduced inside + if (i == 0) + break; + i--; + } + } + + #endif + #endif + +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleOverRideComponent +// +// Description: Function to override component or control functionality +// +// Input: VOID +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID StyleOverRideComponent(VOID) +{ + #ifdef STYLE_OEM_COMPONENT_OVERRIDE // SDL + OEMOverRideComponent(); // OEM + #else + #ifdef STYLE_COMPONENT_OVERRIDE // from EzportPlus.h + OverRideComponent(); // From ezportplus.c + #endif + #endif +} +// +//---------------------------------------------------------------------------- +// Procedure: _StyleControlSubmenu +// +// Description: Function to initialize submenu control +// +// Input: CONTROL_INFO control, UINT16 pageID, VOID *ref +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID _StyleControlSubmenu( CONTROL_INFO *control, UINT16 pageID, VOID *ref ) +{ + control->ControlHandle = gHiiHandle; + control->ControlType = CONTROL_TYPE_SUBMENU; + control->ControlFlags.ControlVisible = TRUE; + control->ControlPtr = (VOID*)ref; + control->ControlPageID = pageID; + control->ControlDestPageID = 0; +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleHelpAreaScrollable +// +// Description: Function to get Help area scroll support +// +// Input: VOID +// +// Output: BOOLEAN +// +//---------------------------------------------------------------------------- +// +BOOLEAN StyleHelpAreaScrollable(VOID) +{ + if(IsHelpAreaScrollBarSupport()) + return TRUE ; + else + return FALSE; +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleGetShadowSupport +// +// Description: Function to get shadow support +// +// Input: VOID +// +// Output: BOOLEAN +// +//---------------------------------------------------------------------------- +// +BOOLEAN StyleGetShadowSupport(VOID) +{ + if(STYLE_SHADOW_SUPPORT) + return TRUE ; + else + return FALSE; +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleGetScrollBehavior +// +// Description: Function to get scroll behavior +// +// Input: VOID +// +// Output: BOOLEAN +// +//---------------------------------------------------------------------------- +// +BOOLEAN StyleGetScrollBehavior(VOID) +{ + return STYLE_SCROLLBAR_ROLLOVER ; // 0 - Item Limit, 1 - Rollover + +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleGetDateFormat +// +// Description: Function to get date format +// +// Input: VOID +// +// Output: BOOLEAN +// +//---------------------------------------------------------------------------- +// +UINTN StyleGetDateFormat(VOID) +{ + #ifdef STYLE_OEM_DATE_FOMAT + return OEMStyleGetDateFormat(); + #else + return STYLE_DATE_FORMAT; + #endif +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleShowDay +// +// Description: Function to show day in date format +// +// Input: VOID +// +// Output: BOOLEAN +// +//---------------------------------------------------------------------------- +// +BOOLEAN StyleShowDay(VOID) +{ + return STYLE_SHOW_DAY ; + +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleGetStdMaxRows +// +// Description: Function to max number of columns +// +// Input: VOID +// +// Output: STYLE_STD_MAX_ROWS +// +//---------------------------------------------------------------------------- +// +UINTN StyleGetStdMaxRows(VOID) +{ + return STYLE_STD_MAX_ROWS; +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleGetStdMaxCols +// +// Description: Function to get max number of rows +// +// Input: VOID +// +// Output: STYLE_STD_MAX_COLS +// +//---------------------------------------------------------------------------- +// +UINTN StyleGetStdMaxCols(VOID) +{ + return STYLE_STD_MAX_COLS; +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleGetClearScreenColor +// +// Description: Function to Get Clear Screen Color +// +// Input: VOID +// +// Output: STYLE_CLEAR_SCREEN_COLOR +// +//---------------------------------------------------------------------------- +// +UINTN StyleGetClearScreenColor(VOID) +{ + #ifdef STYLE_OVERRIDE_CLEAR_SCREEN_COLOR + return OverRideStyleGetClearScreenColor(); + #else + return STYLE_CLEAR_SCREEN_COLOR; + #endif +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleGetPageLinkColor +// +// Description: Function to PageLink (Submenu) color +// +// Input: VOID +// +// Output: PAGE_LINK_FGCOLOR +// +//---------------------------------------------------------------------------- +// +UINT8 StyleGetPageLinkColor(VOID) +{ + #ifdef STYLE_OVERRIDE_PAGELINK_COLOR + return OverRideStyleGetPageLinkColor(); + #else + return PAGE_LINK_COLOR; + #endif +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleGetScrollBarColor +// +// Description: Function to get scrollbar color +// +// Input: VOID +// +// Output: FGCOLOR|BGCOLOR +// +//---------------------------------------------------------------------------- +// +UINT8 StyleGetScrollBarColor(VOID) +{ + #ifdef STYLE_OVERRIDE_SCROLLBAR_COLOR + return OverRideStyleGetScrollBarColor(); + #else + return (SCROLLBAR_FGCOLOR | SCROLLBAR_BGCOLOR) ; + #endif +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleGetScrollBarUpArrowColor +// +// Description: Function to get scrollbar UpArrow Color +// +// Input: VOID +// +// Output: FGCOLOR|BGCOLOR +// +//---------------------------------------------------------------------------- +// +UINT8 StyleGetScrollBarUpArrowColor(VOID) +{ + #ifdef STYLE_OVERRIDE_SCROLLBAR_UP_ARROW_COLOR + return OverRideStyleGetScrollBarUpArrowColor(); + #else + return (SCROLLBAR_UPARROW_FGCOLOR | SCROLLBAR_UPARROW_BGCOLOR) ; + #endif +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleGetScrollBarDownArrowColor +// +// Description: Function to get scrollbar downarrow color +// +// Input: VOID +// +// Output: FGCOLOR|BGCOLOR +// +//---------------------------------------------------------------------------- +// +UINT8 StyleGetScrollBarDownArrowColor(VOID) +{ + #ifdef STYLE_OVERRIDE_SCROLLBAR_DOWN_ARROW_COLOR + return OverRideStyleGetScrollBarDownArrowColor(); + #else + return (SCROLLBAR_DOWNARROW_FGCOLOR | SCROLLBAR_DOWNARROW_BGCOLOR) ; + #endif +} +// +//---------------------------------------------------------------------------- +// Procedure: StylePageItemFocus +// +// Description: This function is called whenever a user navigates to a new page. +// OEMs may use this hook to set item focus. +// The default behavior sets focus to the previously focused page item. +// +// Input: PAGE_DATA *page, FRAME_DATA *frame +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID StylePageItemFocus(PAGE_DATA *page, FRAME_DATA *frame ) +{ + + #ifdef STYLE_OEM_PAGE_ITEM_FOCUS + OEMStylePageItemFocus(page, frame); + #else + #ifdef STYLE_OVERRIDE_PAGE_ITEM_FOCUS + OverRideStylePageItemFocus(page, frame); + #else + if(STYLE_PAGE_FIRSTITEM_FOCUS) + { + UINT32 i; + for ( i = 0; i < frame->ControlCount; i++ ) + { + + if ( _FrameSetControlFocus( frame, i ) ) + { + frame->FirstVisibleCtrl = 0; + break; + } + } + ///Eip:30111 fix - Update the Help based on the Focussed Item + UpdatePageFocusedItemHelp(page); + } + #endif + #endif +} +// +//---------------------------------------------------------------------------- +// Procedure: StyleSubPageItemFocus +// +// Description: This function is called whenever a user returns (or navigates back) +// from a submenu page causing a complete page redraw. OEMs may use this hook to set item focus. +// The default behavior sets focus to the previously focused page item. +// +// Input: PAGE_DATA *page, FRAME_DATA *frame +// +// Output: VOID +// +//---------------------------------------------------------------------------- +// +VOID StyleSubPageItemFocus(PAGE_DATA *page, FRAME_DATA *frame ) +{ + #ifdef STYLE_OEM_SUBPAGE_ITEM_FOCUS // SDL + OEMStyleSubPageItemFocus(page, frame); // OEM + #else + #ifdef STYLE_OVERRIDE_SUBPAGE_ITEM_FOCUS // from EzportPlus.h + OverRideStyleSubPageItemFocus(page, frame); // From ezportplus.c + #else + if(STYLE_SUBPAGE_FIRSTITEM_FOCUS) + { + UINT32 i; + + for ( i = 0; i < frame->ControlCount; i++ ) + { + if ( _FrameSetControlFocus( frame, i ) ) + { + frame->FirstVisibleCtrl = 0; + break; + } + } + } + #endif + #endif +} +#endif +//*****************************************************************// +//*****************************************************************// +//** **// +//** (C)Copyright 1985-2013, American Megatrends, Inc. **// +//** **// +//** All Rights Reserved. **// +//** **// +//** 5555 Oakbrook Pkwy , Norcross, GA 30071 **// +//** **// +//** Phone: (770)-246-8600 **// +//** **// +//*****************************************************************// +//*****************************************************************// -- cgit v1.2.3