/**@file\r
Implementation for handling the User Interface option processing.\r
- \r
+\r
Copyright (c) 2006 - 2007 Intel Corporation. <BR>\r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
**/\r
\r
Number = *NvRamMap;\r
}\r
UnicodeValueToString (\r
- FormattedNumber, \r
- FALSE, \r
- (UINTN) Number, \r
+ FormattedNumber,\r
+ FALSE,\r
+ (UINTN) Number,\r
(sizeof (FormattedNumber) / sizeof (FormattedNumber[0]))\r
);\r
Number = (UINT16) GetStringWidth (FormattedNumber);\r
Number = Tag->Default;\r
\r
UnicodeValueToString (\r
- FormattedNumber, \r
- FALSE, \r
- (UINTN) Number, \r
+ FormattedNumber,\r
+ FALSE,\r
+ (UINTN) Number,\r
(sizeof (FormattedNumber) / sizeof (FormattedNumber[0]))\r
);\r
Number = (UINT16) GetStringWidth (FormattedNumber);\r
*OptionString[0] = LEFT_NUMERIC_DELIMITER;\r
\r
UnicodeValueToString (\r
- FormattedNumber, \r
- FALSE, \r
- (UINTN) Time.Month, \r
+ FormattedNumber,\r
+ FALSE,\r
+ (UINTN) Time.Month,\r
(sizeof (FormattedNumber) / sizeof (FormattedNumber[0]))\r
);\r
Number = (UINT16) GetStringWidth (FormattedNumber);\r
SetUnicodeMem (OptionString[0], 4, L' ');\r
\r
UnicodeValueToString (\r
- FormattedNumber, \r
- FALSE, \r
- (UINTN) Time.Day, \r
+ FormattedNumber,\r
+ FALSE,\r
+ (UINTN) Time.Day,\r
(sizeof (FormattedNumber) / sizeof (FormattedNumber[0]))\r
);\r
Number = (UINT16) GetStringWidth (FormattedNumber);\r
VariableDefinition->FakeNvRamMap[Tag->Id + 1] = (UINT8) (Tag->Value >> 8);\r
SetUnicodeMem (OptionString[0], 7, L' ');\r
UnicodeValueToString (\r
- FormattedNumber, \r
- FALSE, \r
- (UINTN) Time.Year, \r
+ FormattedNumber,\r
+ FALSE,\r
+ (UINTN) Time.Year,\r
(sizeof (FormattedNumber) / sizeof (FormattedNumber[0]))\r
);\r
Number = (UINT16) GetStringWidth (FormattedNumber);\r
case 0:\r
*OptionString[0] = LEFT_NUMERIC_DELIMITER;\r
UnicodeValueToString (\r
- FormattedNumber, \r
- FALSE, \r
- (UINTN) Time.Hour, \r
+ FormattedNumber,\r
+ FALSE,\r
+ (UINTN) Time.Hour,\r
(sizeof (FormattedNumber) / sizeof (FormattedNumber[0]))\r
);\r
Number = (UINT16) GetStringWidth (FormattedNumber);\r
case 1:\r
SetUnicodeMem (OptionString[0], 4, L' ');\r
UnicodeValueToString (\r
- FormattedNumber, \r
- FALSE, \r
- (UINTN) Time.Minute, \r
+ FormattedNumber,\r
+ FALSE,\r
+ (UINTN) Time.Minute,\r
(sizeof (FormattedNumber) / sizeof (FormattedNumber[0]))\r
);\r
Number = (UINT16) GetStringWidth (FormattedNumber);\r
case 2:\r
SetUnicodeMem (OptionString[0], 7, L' ');\r
UnicodeValueToString (\r
- FormattedNumber, \r
- FALSE, \r
- (UINTN) Time.Second, \r
+ FormattedNumber,\r
+ FALSE,\r
+ (UINTN) Time.Second,\r
(sizeof (FormattedNumber) / sizeof (FormattedNumber[0]))\r
);\r
Number = (UINT16) GetStringWidth (FormattedNumber);\r
}\r
\r
/**\r
- Split StringPtr to several lines of strings stored in FormattedString and the glyph width of \r
+ Split StringPtr to several lines of strings stored in FormattedString and the glyph width of\r
each line cannot exceed gHelpBlockWidth.\r
\r
@param StringPtr The pointer of string\r
@param FormattedString The pointer of format string\r
- @param RowCount The count of row \r
- \r
+ @param RowCount The count of row\r
+\r
**/\r
VOID\r
ProcessHelpString (\r
// every three elements of IndexArray form a screen-line of string:[ IndexArray[i*3], IndexArray[i*3+1] )\r
// IndexArray[i*3+2] stores the initial glyph width of single character. to save this is because we want\r
// to bring the width directive of the last line to current screen-line.\r
- // e.g.: "\wideabcde ... fghi", if "fghi" also has width directive but is splitted to the next screen-line \r
+ // e.g.: "\wideabcde ... fghi", if "fghi" also has width directive but is splitted to the next screen-line\r
// different from that of "\wideabcde", we should remember the width directive.\r
//\r
AllocateSize = 0x20;\r
*FormattedString = NULL;\r
}\r
\r
- for (PrevCurrIndex = 0, CurrIndex = 0, LineCount = 0, LastSpaceIndex = 0, \r
- IndexArray[0] = 0, GlyphWidth = 1, GlyphOffset = 0, LastSpaceGlyphWidth = 1, LineStartGlyphWidth = 1; \r
- (StringPtr[CurrIndex] != CHAR_NULL); \r
+ for (PrevCurrIndex = 0, CurrIndex = 0, LineCount = 0, LastSpaceIndex = 0,\r
+ IndexArray[0] = 0, GlyphWidth = 1, GlyphOffset = 0, LastSpaceGlyphWidth = 1, LineStartGlyphWidth = 1;\r
+ (StringPtr[CurrIndex] != CHAR_NULL);\r
CurrIndex ++) {\r
\r
if (LineCount == AllocateSize) {\r
}\r
\r
switch (StringPtr[CurrIndex]) {\r
- \r
+\r
case NARROW_CHAR:\r
case WIDE_CHAR:\r
GlyphWidth = ((StringPtr[CurrIndex] == WIDE_CHAR) ? 2 : 1);\r
GlyphWidth = LastSpaceGlyphWidth;\r
} else if (GlyphOffset > BlockWidth) {\r
//\r
- // the word is too long to fit one screen-line and we don't get the chance \r
+ // the word is too long to fit one screen-line and we don't get the chance\r
// of GlyphOffset == BlockWidth because GlyphWidth = 2\r
//\r
CurrIndex --;\r
}\r
- \r
+\r
IndexArray[LineCount*3] = PrevCurrIndex;\r
IndexArray[LineCount*3+1] = CurrIndex + 1;\r
IndexArray[LineCount*3+2] = LineStartGlyphWidth;\r
for (CurrIndex = 0; CurrIndex < LineCount; CurrIndex ++) {\r
*(*FormattedString + CurrIndex * 2 * (BlockWidth + 1)) = (CHAR16)((IndexArray[CurrIndex*3+2] == 2) ? WIDE_CHAR : NARROW_CHAR);\r
StrnCpy (\r
- *FormattedString + CurrIndex * 2 * (BlockWidth + 1) + 1, \r
- StringPtr + IndexArray[CurrIndex*3], \r
+ *FormattedString + CurrIndex * 2 * (BlockWidth + 1) + 1,\r
+ StringPtr + IndexArray[CurrIndex*3],\r
IndexArray[CurrIndex*3+1]-IndexArray[CurrIndex*3]\r
);\r
}\r