]>
Commit | Line | Data |
---|---|---|
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 |
47d20b54 | 17 | #define ASCII_POSITION ((0x10 * 3) + 12)\r |
632820d1 | 18 | \r |
19 | typedef struct {\r | |
47d20b54 MK |
20 | UINTN Row;\r |
21 | UINTN Column;\r | |
632820d1 | 22 | } HEFI_EDITOR_POSITION;\r |
23 | \r | |
24 | typedef\r | |
25 | EFI_STATUS\r | |
26 | (*HEFI_MENU_ITEM_FUNCTION) (\r | |
27 | VOID\r | |
28 | );\r | |
29 | \r | |
30 | typedef struct {\r | |
47d20b54 MK |
31 | CHAR16 Name[50];\r |
32 | CHAR16 Key[3];\r | |
33 | HEFI_MENU_ITEM_FUNCTION Function;\r | |
632820d1 | 34 | } HMENU_ITEMS;\r |
35 | \r | |
36 | typedef struct _HEFI_EDITOR_LINE {\r | |
47d20b54 MK |
37 | UINTN Signature;\r |
38 | UINT8 Buffer[0x10];\r | |
39 | UINTN Size; // unit is Unicode\r | |
40 | LIST_ENTRY Link;\r | |
632820d1 | 41 | } HEFI_EDITOR_LINE;\r |
42 | \r | |
43 | typedef struct _HEFI_EDITOR_MENU_ITEM {\r | |
47d20b54 MK |
44 | CHAR16 NameToken;\r |
45 | CHAR16 FunctionKeyToken;\r | |
46 | HEFI_MENU_ITEM_FUNCTION Function;\r | |
632820d1 | 47 | } HEFI_EDITOR_MENU_ITEM;\r |
48 | \r | |
49 | typedef struct {\r | |
47d20b54 MK |
50 | UINT32 Foreground : 4;\r |
51 | UINT32 Background : 4;\r | |
632820d1 | 52 | } HEFI_EDITOR_COLOR_ATTRIBUTES;\r |
53 | \r | |
54 | typedef union {\r | |
47d20b54 MK |
55 | HEFI_EDITOR_COLOR_ATTRIBUTES Colors;\r |
56 | UINTN Data;\r | |
632820d1 | 57 | } HEFI_EDITOR_COLOR_UNION;\r |
58 | \r | |
59 | typedef struct {\r | |
47d20b54 MK |
60 | UINTN Columns;\r |
61 | UINTN Rows;\r | |
632820d1 | 62 | } HEFI_EDITOR_TEXT_MODE;\r |
63 | \r | |
632820d1 | 64 | typedef struct {\r |
47d20b54 | 65 | CHAR16 *Name;\r |
632820d1 | 66 | \r |
47d20b54 MK |
67 | UINTN BlockSize;\r |
68 | UINTN Size;\r | |
69 | UINTN Offset;\r | |
632820d1 | 70 | } HEFI_EDITOR_DISK_IMAGE;\r |
71 | \r | |
72 | typedef struct {\r | |
47d20b54 MK |
73 | EFI_CPU_IO2_PROTOCOL *IoFncs;\r |
74 | UINTN Offset;\r | |
75 | UINTN Size;\r | |
632820d1 | 76 | } HEFI_EDITOR_MEM_IMAGE;\r |
77 | \r | |
78 | typedef struct {\r | |
47d20b54 MK |
79 | CHAR16 *FileName;\r |
80 | UINTN Size; // file size\r | |
81 | BOOLEAN ReadOnly; // file is read-only or not\r | |
632820d1 | 82 | } HEFI_EDITOR_FILE_IMAGE;\r |
83 | \r | |
84 | typedef struct {\r | |
47d20b54 MK |
85 | LIST_ENTRY *ListHead; // list head of lines\r |
86 | HEFI_EDITOR_LINE *Lines; // lines of current file\r | |
87 | UINTN NumLines; // number of lines\r | |
88 | HEFI_EDITOR_LINE *CurrentLine; // current line cursor is at\r | |
89 | HEFI_EDITOR_POSITION DisplayPosition; // cursor position in screen\r | |
90 | HEFI_EDITOR_POSITION MousePosition; // mouse position in screen\r | |
91 | HEFI_EDITOR_POSITION BufferPosition; // cursor position in buffer\r | |
92 | UINTN LowVisibleRow; // the lowest visible row of file position\r | |
93 | BOOLEAN HighBits; // cursor is at the high4 bits or low4 bits\r | |
94 | BOOLEAN Modified; // BUFFER is modified or not\r | |
95 | EDIT_FILE_TYPE BufferType;\r | |
96 | \r | |
97 | HEFI_EDITOR_FILE_IMAGE *FileImage;\r | |
98 | HEFI_EDITOR_DISK_IMAGE *DiskImage;\r | |
99 | HEFI_EDITOR_MEM_IMAGE *MemImage;\r | |
632820d1 | 100 | } HEFI_EDITOR_BUFFER_IMAGE;\r |
101 | \r | |
632820d1 | 102 | typedef struct {\r |
47d20b54 MK |
103 | HEFI_EDITOR_BUFFER_IMAGE *BufferImage;\r |
104 | \r | |
105 | HEFI_EDITOR_COLOR_UNION ColorAttributes;\r | |
106 | HEFI_EDITOR_POSITION ScreenSize; // row number and column number\r | |
107 | EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *TextInputEx;\r | |
108 | BOOLEAN MouseSupported;\r | |
109 | EFI_SIMPLE_POINTER_PROTOCOL *MouseInterface;\r | |
110 | INT32 MouseAccumulatorX;\r | |
111 | INT32 MouseAccumulatorY;\r | |
112 | \r | |
113 | UINTN SelectStart; // starting from 1\r | |
114 | UINTN SelectEnd; // starting from 1\r | |
632820d1 | 115 | } HEFI_EDITOR_GLOBAL_EDITOR;\r |
116 | \r | |
117 | #endif\r |