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