]>
Commit | Line | Data |
---|---|---|
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 | |
2b578de0 | 21 | #define EFI_EDITOR_LINE_LIST SIGNATURE_32 ('e', 'e', 'l', 'l')\r |
632820d1 | 22 | \r |
23 | #define ASCII_POSITION ((0x10 * 3) + 12)\r | |
24 | \r | |
25 | \r | |
26 | typedef struct {\r | |
27 | UINTN Row;\r | |
28 | UINTN Column;\r | |
29 | } HEFI_EDITOR_POSITION;\r | |
30 | \r | |
31 | typedef\r | |
32 | EFI_STATUS\r | |
33 | (*HEFI_MENU_ITEM_FUNCTION) (\r | |
34 | VOID\r | |
35 | );\r | |
36 | \r | |
37 | typedef 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 | |
43 | typedef 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 | |
50 | typedef 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 | |
56 | typedef struct {\r | |
57 | UINT32 Foreground : 4;\r | |
58 | UINT32 Background : 4;\r | |
59 | } HEFI_EDITOR_COLOR_ATTRIBUTES;\r | |
60 | \r | |
61 | typedef union {\r | |
62 | HEFI_EDITOR_COLOR_ATTRIBUTES Colors;\r | |
28981267 | 63 | UINTN Data;\r |
632820d1 | 64 | } HEFI_EDITOR_COLOR_UNION;\r |
65 | \r | |
66 | typedef struct {\r | |
67 | UINTN Columns;\r | |
68 | UINTN Rows;\r | |
69 | } HEFI_EDITOR_TEXT_MODE;\r | |
70 | \r | |
71 | \r | |
72 | typedef 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 | |
80 | typedef 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 | |
87 | typedef 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 | |
93 | typedef 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 | |
632820d1 | 112 | typedef struct {\r |
113 | HEFI_EDITOR_BUFFER_IMAGE *BufferImage;\r | |
632820d1 | 114 | \r |
115 | HEFI_EDITOR_COLOR_UNION ColorAttributes;\r | |
116 | HEFI_EDITOR_POSITION ScreenSize; // row number and column number\r | |
117 | BOOLEAN MouseSupported;\r | |
118 | EFI_SIMPLE_POINTER_PROTOCOL *MouseInterface;\r | |
119 | INT32 MouseAccumulatorX;\r | |
120 | INT32 MouseAccumulatorY;\r | |
121 | \r | |
122 | UINTN SelectStart; // starting from 1\r | |
123 | UINTN SelectEnd; // starting from 1\r | |
124 | } HEFI_EDITOR_GLOBAL_EDITOR;\r | |
125 | \r | |
126 | #endif\r |