]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellDebug1CommandsLib/EditTitleBar.c
ShellPkg: Update header file including style
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / EditTitleBar.c
index 1f71c8b18bfc4a1f9a1ad00e92830fca08c830d6..727605ccad08eef384fa210ea863866c2c5a249c 100644 (file)
@@ -1,7 +1,8 @@
 /** @file\r
   Implements titlebar interface functions.\r
 \r
-  Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>\r
+  (C) Copyright 2013 Hewlett-Packard Development Company, L.P.<BR>\r
+  Copyright (c) 2005 - 2014, Intel Corporation. All rights reserved. <BR>\r
   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
@@ -26,7 +27,6 @@ CHAR16  *Title = NULL;
   @retval EFI_OUT_OF_RESOURCES  A memory allocation failed.\r
 **/\r
 EFI_STATUS\r
-EFIAPI\r
 MainTitleBarInit (\r
   CONST CHAR16 *Prompt\r
   )\r
@@ -51,7 +51,6 @@ MainTitleBarInit (
   Clean up the memory used.\r
 **/\r
 VOID\r
-EFIAPI\r
 MainTitleBarCleanup (\r
   VOID\r
   )\r
@@ -79,18 +78,21 @@ typedef union {
   @param[in] Modified           TRUE if the file was modified.  FALSE otherwise.\r
   @param[in] LastCol            The last printable column.\r
   @param[in] LastRow            The last printable row.\r
+  @param[in] Offset             The offset into the file. (only for mem/disk)\r
+  @param[in] Size               The file's size. (only for mem/disk)\r
 \r
   @retval EFI_SUCCESS           The operation was successful.\r
 **/\r
 EFI_STATUS\r
-EFIAPI\r
 MainTitleBarRefresh (\r
   IN CONST CHAR16                 *FileName OPTIONAL,\r
   IN CONST EDIT_FILE_TYPE         FileType,\r
-  IN BOOLEAN                      ReadOnly,\r
-  IN BOOLEAN                      Modified,\r
-  IN UINTN                        LastCol,\r
-  IN UINTN                        LastRow\r
+  IN CONST BOOLEAN                ReadOnly,\r
+  IN CONST BOOLEAN                Modified,\r
+  IN CONST UINTN                  LastCol,\r
+  IN CONST UINTN                  LastRow,\r
+  IN CONST UINTN                  Offset,\r
+  IN CONST UINTN                  Size\r
   )\r
 {\r
   TITLE_BAR_COLOR_UNION   Orig;\r
@@ -103,10 +105,11 @@ MainTitleBarRefresh (
   // backup the old screen attributes\r
   //\r
   Orig.Data             = gST->ConOut->Mode->Attribute;\r
-  New.Colors.Foreground = Orig.Colors.Background;\r
-  New.Colors.Background = Orig.Colors.Foreground;\r
+  New.Data              = 0;\r
+  New.Colors.Foreground = Orig.Colors.Background & 0xF;\r
+  New.Colors.Background = Orig.Colors.Foreground & 0x7;\r
 \r
-  gST->ConOut->SetAttribute (gST->ConOut, New.Data);\r
+  gST->ConOut->SetAttribute (gST->ConOut, New.Data & 0x7F);\r
 \r
   //\r
   // clear the title line\r
@@ -165,6 +168,8 @@ MainTitleBarRefresh (
     case FileTypeAscii:\r
     case FileTypeUnicode:\r
       if (FileType == FileTypeAscii){\r
+        ShellPrintEx (-1,-1, L"     ASCII     ");\r
+      } else {\r
         ShellPrintEx (-1,-1, L"     UNICODE   ");\r
       }\r
       //\r
@@ -181,9 +186,11 @@ MainTitleBarRefresh (
       //\r
       // Print the offset.\r
       //\r
-      ASSERT(FALSE);\r
+      ShellPrintEx (-1,-1, L"Offset %X | Size %X", Offset, Size);\r
     case FileTypeFileBuffer:\r
       break;\r
+    default:\r
+      break;\r
   }\r
   //\r
   // print modified field\r