]> git.proxmox.com Git - mirror_edk2.git/blame - ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEditorTypes.h
ShellPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / HexEdit / HexEditorTypes.h
CommitLineData
632820d1 1/** @file\r
2 data types that are used by editor\r
ba0014b9 3\r
5563281f 4 Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved. <BR>\r
56ba3746 5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
632820d1 6\r
7**/\r
8\r
9#ifndef _HEDITOR_TYPE_H_\r
10#define _HEDITOR_TYPE_H_\r
11\r
12#include "UefiShellDebug1CommandsLib.h"\r
13#include "EditTitleBar.h"\r
14\r
2b578de0 15#define EFI_EDITOR_LINE_LIST SIGNATURE_32 ('e', 'e', 'l', 'l')\r
632820d1 16\r
17#define ASCII_POSITION ((0x10 * 3) + 12)\r
18\r
19\r
20typedef struct {\r
21 UINTN Row;\r
22 UINTN Column;\r
23} HEFI_EDITOR_POSITION;\r
24\r
25typedef\r
26EFI_STATUS\r
27(*HEFI_MENU_ITEM_FUNCTION) (\r
28 VOID\r
29 );\r
30\r
31typedef struct {\r
32 CHAR16 Name[50];\r
33 CHAR16 Key[3];\r
34 HEFI_MENU_ITEM_FUNCTION Function;\r
35} HMENU_ITEMS;\r
36\r
37typedef struct _HEFI_EDITOR_LINE {\r
38 UINTN Signature;\r
39 UINT8 Buffer[0x10];\r
40 UINTN Size; // unit is Unicode\r
41 LIST_ENTRY Link;\r
42} HEFI_EDITOR_LINE;\r
43\r
44typedef struct _HEFI_EDITOR_MENU_ITEM {\r
45 CHAR16 NameToken;\r
46 CHAR16 FunctionKeyToken;\r
47 HEFI_MENU_ITEM_FUNCTION Function;\r
48} HEFI_EDITOR_MENU_ITEM;\r
49\r
50typedef struct {\r
51 UINT32 Foreground : 4;\r
52 UINT32 Background : 4;\r
53} HEFI_EDITOR_COLOR_ATTRIBUTES;\r
54\r
55typedef union {\r
56 HEFI_EDITOR_COLOR_ATTRIBUTES Colors;\r
28981267 57 UINTN Data;\r
632820d1 58} HEFI_EDITOR_COLOR_UNION;\r
59\r
60typedef struct {\r
61 UINTN Columns;\r
62 UINTN Rows;\r
63} HEFI_EDITOR_TEXT_MODE;\r
64\r
65\r
66typedef struct {\r
67 CHAR16 *Name;\r
68\r
69 UINTN BlockSize;\r
70 UINTN Size;\r
71 UINTN Offset;\r
72} HEFI_EDITOR_DISK_IMAGE;\r
73\r
74typedef struct {\r
e90153cb
RN
75 EFI_CPU_IO2_PROTOCOL *IoFncs;\r
76 UINTN Offset;\r
77 UINTN Size;\r
632820d1 78} HEFI_EDITOR_MEM_IMAGE;\r
79\r
80typedef struct {\r
81 CHAR16 *FileName;\r
82 UINTN Size; // file size\r
83 BOOLEAN ReadOnly; // file is read-only or not\r
84} HEFI_EDITOR_FILE_IMAGE;\r
85\r
86typedef struct {\r
87 LIST_ENTRY *ListHead; // list head of lines\r
88 HEFI_EDITOR_LINE *Lines; // lines of current file\r
89 UINTN NumLines; // number of lines\r
90 HEFI_EDITOR_LINE *CurrentLine; // current line cursor is at\r
91 HEFI_EDITOR_POSITION DisplayPosition; // cursor position in screen\r
92 HEFI_EDITOR_POSITION MousePosition; // mouse position in screen\r
93 HEFI_EDITOR_POSITION BufferPosition; // cursor position in buffer\r
94 UINTN LowVisibleRow; // the lowest visible row of file position\r
95 BOOLEAN HighBits; // cursor is at the high4 bits or low4 bits\r
96 BOOLEAN Modified; // BUFFER is modified or not\r
97 EDIT_FILE_TYPE BufferType;\r
98\r
99 HEFI_EDITOR_FILE_IMAGE *FileImage;\r
100 HEFI_EDITOR_DISK_IMAGE *DiskImage;\r
101 HEFI_EDITOR_MEM_IMAGE *MemImage;\r
102\r
103} HEFI_EDITOR_BUFFER_IMAGE;\r
104\r
632820d1 105typedef struct {\r
5563281f
RN
106 HEFI_EDITOR_BUFFER_IMAGE *BufferImage;\r
107\r
108 HEFI_EDITOR_COLOR_UNION ColorAttributes;\r
109 HEFI_EDITOR_POSITION ScreenSize; // row number and column number\r
110 EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *TextInputEx;\r
111 BOOLEAN MouseSupported;\r
112 EFI_SIMPLE_POINTER_PROTOCOL *MouseInterface;\r
113 INT32 MouseAccumulatorX;\r
114 INT32 MouseAccumulatorY;\r
115\r
116 UINTN SelectStart; // starting from 1\r
117 UINTN SelectEnd; // starting from 1\r
632820d1 118} HEFI_EDITOR_GLOBAL_EDITOR;\r
119\r
120#endif\r