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