]> git.proxmox.com Git - mirror_edk2.git/blame - ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEditorTypes.h
add Edit and HexEdit commands.
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / HexEdit / HexEditorTypes.h
CommitLineData
632820d1 1/** @file\r
2 data types that are used by editor\r
3 \r
4 Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>\r
5 This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef _HEDITOR_TYPE_H_\r
16#define _HEDITOR_TYPE_H_\r
17\r
18#include "UefiShellDebug1CommandsLib.h"\r
19#include "EditTitleBar.h"\r
20\r
21#define EFI_EDITOR_LINE_LIST 'eell'\r
22\r
23#define ASCII_POSITION ((0x10 * 3) + 12)\r
24\r
25\r
26typedef struct {\r
27 UINTN Row;\r
28 UINTN Column;\r
29} HEFI_EDITOR_POSITION;\r
30\r
31typedef\r
32EFI_STATUS\r
33(*HEFI_MENU_ITEM_FUNCTION) (\r
34 VOID\r
35 );\r
36\r
37typedef struct {\r
38 CHAR16 Name[50];\r
39 CHAR16 Key[3];\r
40 HEFI_MENU_ITEM_FUNCTION Function;\r
41} HMENU_ITEMS;\r
42\r
43typedef struct _HEFI_EDITOR_LINE {\r
44 UINTN Signature;\r
45 UINT8 Buffer[0x10];\r
46 UINTN Size; // unit is Unicode\r
47 LIST_ENTRY Link;\r
48} HEFI_EDITOR_LINE;\r
49\r
50typedef struct _HEFI_EDITOR_MENU_ITEM {\r
51 CHAR16 NameToken;\r
52 CHAR16 FunctionKeyToken;\r
53 HEFI_MENU_ITEM_FUNCTION Function;\r
54} HEFI_EDITOR_MENU_ITEM;\r
55\r
56typedef struct {\r
57 UINT32 Foreground : 4;\r
58 UINT32 Background : 4;\r
59} HEFI_EDITOR_COLOR_ATTRIBUTES;\r
60\r
61typedef union {\r
62 HEFI_EDITOR_COLOR_ATTRIBUTES Colors;\r
63 UINT8 Data;\r
64} HEFI_EDITOR_COLOR_UNION;\r
65\r
66typedef struct {\r
67 UINTN Columns;\r
68 UINTN Rows;\r
69} HEFI_EDITOR_TEXT_MODE;\r
70\r
71\r
72typedef struct {\r
73 CHAR16 *Name;\r
74\r
75 UINTN BlockSize;\r
76 UINTN Size;\r
77 UINTN Offset;\r
78} HEFI_EDITOR_DISK_IMAGE;\r
79\r
80typedef struct {\r
81 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoFncs;\r
82\r
83 UINTN Offset;\r
84 UINTN Size;\r
85} HEFI_EDITOR_MEM_IMAGE;\r
86\r
87typedef struct {\r
88 CHAR16 *FileName;\r
89 UINTN Size; // file size\r
90 BOOLEAN ReadOnly; // file is read-only or not\r
91} HEFI_EDITOR_FILE_IMAGE;\r
92\r
93typedef struct {\r
94 LIST_ENTRY *ListHead; // list head of lines\r
95 HEFI_EDITOR_LINE *Lines; // lines of current file\r
96 UINTN NumLines; // number of lines\r
97 HEFI_EDITOR_LINE *CurrentLine; // current line cursor is at\r
98 HEFI_EDITOR_POSITION DisplayPosition; // cursor position in screen\r
99 HEFI_EDITOR_POSITION MousePosition; // mouse position in screen\r
100 HEFI_EDITOR_POSITION BufferPosition; // cursor position in buffer\r
101 UINTN LowVisibleRow; // the lowest visible row of file position\r
102 BOOLEAN HighBits; // cursor is at the high4 bits or low4 bits\r
103 BOOLEAN Modified; // BUFFER is modified or not\r
104 EDIT_FILE_TYPE BufferType;\r
105\r
106 HEFI_EDITOR_FILE_IMAGE *FileImage;\r
107 HEFI_EDITOR_DISK_IMAGE *DiskImage;\r
108 HEFI_EDITOR_MEM_IMAGE *MemImage;\r
109\r
110} HEFI_EDITOR_BUFFER_IMAGE;\r
111\r
112typedef struct {\r
113 UINT8 *Buffer;\r
114 UINTN Size;\r
115} HEFI_EDITOR_CLIPBOARD;\r
116\r
117typedef struct {\r
118 HEFI_EDITOR_BUFFER_IMAGE *BufferImage;\r
119 HEFI_EDITOR_CLIPBOARD *Clipboard;\r
120\r
121 HEFI_EDITOR_COLOR_UNION ColorAttributes;\r
122 HEFI_EDITOR_POSITION ScreenSize; // row number and column number\r
123 BOOLEAN MouseSupported;\r
124 EFI_SIMPLE_POINTER_PROTOCOL *MouseInterface;\r
125 INT32 MouseAccumulatorX;\r
126 INT32 MouseAccumulatorY;\r
127\r
128 UINTN SelectStart; // starting from 1\r
129 UINTN SelectEnd; // starting from 1\r
130} HEFI_EDITOR_GLOBAL_EDITOR;\r
131\r
132#endif\r