]> git.proxmox.com Git - mirror_edk2.git/blame - ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditorTypes.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[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
56ba3746 5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
632820d1 6\r
7**/\r
8\r
9#ifndef _EDITOR_TYPE_H_\r
10#define _EDITOR_TYPE_H_\r
11\r
12#include "UefiShellDebug1CommandsLib.h"\r
13#include "EditTitleBar.h"\r
14#include "EditMenuBar.h"\r
15\r
47d20b54
MK
16#define MIN_POOL_SIZE 125\r
17#define MAX_STRING_LENGTH 127\r
632820d1 18\r
19typedef struct {\r
47d20b54
MK
20 UINTN Row;\r
21 UINTN Column;\r
632820d1 22} EFI_EDITOR_POSITION;\r
23\r
24typedef\r
25EFI_STATUS\r
26(*EFI_MENU_ITEM_FUNCTION) (\r
27 VOID\r
28 );\r
29\r
30typedef enum {\r
31 NewLineTypeDefault,\r
32 NewLineTypeLineFeed,\r
33 NewLineTypeCarriageReturn,\r
34 NewLineTypeCarriageReturnLineFeed,\r
35 NewLineTypeLineFeedCarriageReturn,\r
36 NewLineTypeUnknown\r
37} EE_NEWLINE_TYPE;\r
38\r
2b578de0 39#define LINE_LIST_SIGNATURE SIGNATURE_32 ('e', 'e', 'l', 'l')\r
632820d1 40typedef struct _EFI_EDITOR_LINE {\r
47d20b54
MK
41 UINTN Signature;\r
42 CHAR16 *Buffer;\r
43 UINTN Size; // unit is Unicode\r
44 UINTN TotalSize; // unit is Unicode, exclude CHAR_NULL\r
45 EE_NEWLINE_TYPE Type;\r
46 LIST_ENTRY Link;\r
632820d1 47} EFI_EDITOR_LINE;\r
48\r
49typedef struct {\r
47d20b54
MK
50 UINT32 Foreground : 4;\r
51 UINT32 Background : 4;\r
632820d1 52} EFI_EDITOR_COLOR_ATTRIBUTES;\r
53\r
54typedef union {\r
47d20b54
MK
55 EFI_EDITOR_COLOR_ATTRIBUTES Colors;\r
56 UINTN Data;\r
632820d1 57} EFI_EDITOR_COLOR_UNION;\r
58\r
59typedef struct {\r
47d20b54
MK
60 UINTN Columns;\r
61 UINTN Rows;\r
632820d1 62} EFI_EDITOR_TEXT_MODE;\r
63\r
64typedef struct {\r
47d20b54
MK
65 CHAR16 *FileName; // file name current edited in editor\r
66 EDIT_FILE_TYPE FileType; // Unicode file or ASCII file\r
67 LIST_ENTRY *ListHead; // list head of lines\r
68 EFI_EDITOR_LINE *Lines; // lines of current file\r
69 UINTN NumLines; // total line numbers\r
70 EFI_EDITOR_POSITION DisplayPosition; // cursor position in screen\r
71 EFI_EDITOR_POSITION FilePosition; // cursor position in file\r
72 EFI_EDITOR_POSITION MousePosition; // mouse position in screen\r
632820d1 73 // file position of first byte displayed on screen\r
74 //\r
47d20b54 75 EFI_EDITOR_POSITION LowVisibleRange;\r
632820d1 76\r
47d20b54
MK
77 BOOLEAN FileModified; // file is modified or not\r
78 BOOLEAN ModeInsert; // input mode INS or OVR\r
79 BOOLEAN ReadOnly; // file is read-only or not\r
80 EFI_EDITOR_LINE *CurrentLine; // current line cursor is at\r
632820d1 81} EFI_EDITOR_FILE_BUFFER;\r
82\r
83typedef struct {\r
47d20b54
MK
84 EFI_EDITOR_FILE_BUFFER *FileBuffer;\r
85\r
86 EFI_EDITOR_COLOR_UNION ColorAttributes;\r
87 EFI_EDITOR_POSITION ScreenSize; // row number and column number\r
88 EFI_EDITOR_LINE *CutLine; // clip board\r
89 EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *TextInputEx;\r
90 BOOLEAN MouseSupported;\r
91 EFI_SIMPLE_POINTER_PROTOCOL *MouseInterface;\r
92 INT32 MouseAccumulatorX;\r
93 INT32 MouseAccumulatorY;\r
632820d1 94} EFI_EDITOR_GLOBAL_EDITOR;\r
95\r
96#endif\r