4 Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved. <BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef _EDITOR_TYPE_H_
10 #define _EDITOR_TYPE_H_
12 #include "UefiShellDebug1CommandsLib.h"
13 #include "EditTitleBar.h"
14 #include "EditMenuBar.h"
16 #define MIN_POOL_SIZE 125
17 #define MAX_STRING_LENGTH 127
22 } EFI_EDITOR_POSITION
;
26 (*EFI_MENU_ITEM_FUNCTION
) (
33 NewLineTypeCarriageReturn
,
34 NewLineTypeCarriageReturnLineFeed
,
35 NewLineTypeLineFeedCarriageReturn
,
39 #define LINE_LIST_SIGNATURE SIGNATURE_32 ('e', 'e', 'l', 'l')
40 typedef struct _EFI_EDITOR_LINE
{
43 UINTN Size
; // unit is Unicode
44 UINTN TotalSize
; // unit is Unicode, exclude CHAR_NULL
50 UINT32 Foreground
: 4;
51 UINT32 Background
: 4;
52 } EFI_EDITOR_COLOR_ATTRIBUTES
;
55 EFI_EDITOR_COLOR_ATTRIBUTES Colors
;
57 } EFI_EDITOR_COLOR_UNION
;
62 } EFI_EDITOR_TEXT_MODE
;
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
75 EFI_EDITOR_POSITION LowVisibleRange
;
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
;
84 EFI_EDITOR_FILE_BUFFER
*FileBuffer
;
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
;