ShellPkg/[hex]edit: use SimpleTextInEx to read console
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / Edit / TextEditorTypes.h
CommitLineData
632820d1 1/** @file\r
2 Declares editor types.\r
3\r
5563281f 4 Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved. <BR>\r
632820d1 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 _EDITOR_TYPE_H_\r
16#define _EDITOR_TYPE_H_\r
17\r
18#include "UefiShellDebug1CommandsLib.h"\r
19#include "EditTitleBar.h"\r
20#include "EditMenuBar.h"\r
21\r
664fd587
RN
22#define MIN_POOL_SIZE 125\r
23#define MAX_STRING_LENGTH 127\r
632820d1 24\r
25typedef struct {\r
26 UINTN Row;\r
27 UINTN Column;\r
28} EFI_EDITOR_POSITION;\r
29\r
30typedef\r
31EFI_STATUS\r
32(*EFI_MENU_ITEM_FUNCTION) (\r
33 VOID\r
34 );\r
35\r
36typedef enum {\r
37 NewLineTypeDefault,\r
38 NewLineTypeLineFeed,\r
39 NewLineTypeCarriageReturn,\r
40 NewLineTypeCarriageReturnLineFeed,\r
41 NewLineTypeLineFeedCarriageReturn,\r
42 NewLineTypeUnknown\r
43} EE_NEWLINE_TYPE;\r
44\r
2b578de0 45#define LINE_LIST_SIGNATURE SIGNATURE_32 ('e', 'e', 'l', 'l')\r
632820d1 46typedef struct _EFI_EDITOR_LINE {\r
47 UINTN Signature;\r
48 CHAR16 *Buffer;\r
49 UINTN Size; // unit is Unicode\r
50 UINTN TotalSize; // unit is Unicode, exclude CHAR_NULL\r
51 EE_NEWLINE_TYPE Type;\r
52 LIST_ENTRY Link;\r
53} EFI_EDITOR_LINE;\r
54\r
55typedef struct {\r
56 UINT32 Foreground : 4;\r
57 UINT32 Background : 4;\r
58} EFI_EDITOR_COLOR_ATTRIBUTES;\r
59\r
60typedef union {\r
61 EFI_EDITOR_COLOR_ATTRIBUTES Colors;\r
62 UINTN Data;\r
63} EFI_EDITOR_COLOR_UNION;\r
64\r
65typedef struct {\r
66 UINTN Columns;\r
67 UINTN Rows;\r
68} EFI_EDITOR_TEXT_MODE;\r
69\r
70typedef struct {\r
71 CHAR16 *FileName; // file name current edited in editor\r
72 EDIT_FILE_TYPE FileType; // Unicode file or ASCII file\r
73 LIST_ENTRY *ListHead; // list head of lines\r
74 EFI_EDITOR_LINE *Lines; // lines of current file\r
75 UINTN NumLines; // total line numbers\r
76 EFI_EDITOR_POSITION DisplayPosition; // cursor position in screen\r
77 EFI_EDITOR_POSITION FilePosition; // cursor position in file\r
78 EFI_EDITOR_POSITION MousePosition; // mouse position in screen\r
79 // file position of first byte displayed on screen\r
80 //\r
81 EFI_EDITOR_POSITION LowVisibleRange;\r
82\r
83 BOOLEAN FileModified; // file is modified or not\r
84 BOOLEAN ModeInsert; // input mode INS or OVR\r
85 BOOLEAN ReadOnly; // file is read-only or not\r
86 EFI_EDITOR_LINE *CurrentLine; // current line cursor is at\r
87} EFI_EDITOR_FILE_BUFFER;\r
88\r
89typedef struct {\r
5563281f
RN
90 EFI_EDITOR_FILE_BUFFER *FileBuffer;\r
91\r
92 EFI_EDITOR_COLOR_UNION ColorAttributes;\r
93 EFI_EDITOR_POSITION ScreenSize; // row number and column number\r
94 EFI_EDITOR_LINE *CutLine; // clip board\r
95 EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *TextInputEx;\r
96 BOOLEAN MouseSupported;\r
97 EFI_SIMPLE_POINTER_PROTOCOL *MouseInterface;\r
98 INT32 MouseAccumulatorX;\r
99 INT32 MouseAccumulatorY;\r
632820d1 100\r
101} EFI_EDITOR_GLOBAL_EDITOR;\r
102\r
103#endif\r