2 data types that are used by editor
4 Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved. <BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef _HEDITOR_TYPE_H_
10 #define _HEDITOR_TYPE_H_
12 #include "UefiShellDebug1CommandsLib.h"
13 #include "EditTitleBar.h"
15 #define EFI_EDITOR_LINE_LIST SIGNATURE_32 ('e', 'e', 'l', 'l')
17 #define ASCII_POSITION ((0x10 * 3) + 12)
22 } HEFI_EDITOR_POSITION
;
26 (*HEFI_MENU_ITEM_FUNCTION
) (
33 HEFI_MENU_ITEM_FUNCTION Function
;
36 typedef struct _HEFI_EDITOR_LINE
{
39 UINTN Size
; // unit is Unicode
43 typedef struct _HEFI_EDITOR_MENU_ITEM
{
45 CHAR16 FunctionKeyToken
;
46 HEFI_MENU_ITEM_FUNCTION Function
;
47 } HEFI_EDITOR_MENU_ITEM
;
50 UINT32 Foreground
: 4;
51 UINT32 Background
: 4;
52 } HEFI_EDITOR_COLOR_ATTRIBUTES
;
55 HEFI_EDITOR_COLOR_ATTRIBUTES Colors
;
57 } HEFI_EDITOR_COLOR_UNION
;
62 } HEFI_EDITOR_TEXT_MODE
;
70 } HEFI_EDITOR_DISK_IMAGE
;
73 EFI_CPU_IO2_PROTOCOL
*IoFncs
;
76 } HEFI_EDITOR_MEM_IMAGE
;
80 UINTN Size
; // file size
81 BOOLEAN ReadOnly
; // file is read-only or not
82 } HEFI_EDITOR_FILE_IMAGE
;
85 LIST_ENTRY
*ListHead
; // list head of lines
86 HEFI_EDITOR_LINE
*Lines
; // lines of current file
87 UINTN NumLines
; // number of lines
88 HEFI_EDITOR_LINE
*CurrentLine
; // current line cursor is at
89 HEFI_EDITOR_POSITION DisplayPosition
; // cursor position in screen
90 HEFI_EDITOR_POSITION MousePosition
; // mouse position in screen
91 HEFI_EDITOR_POSITION BufferPosition
; // cursor position in buffer
92 UINTN LowVisibleRow
; // the lowest visible row of file position
93 BOOLEAN HighBits
; // cursor is at the high4 bits or low4 bits
94 BOOLEAN Modified
; // BUFFER is modified or not
95 EDIT_FILE_TYPE BufferType
;
97 HEFI_EDITOR_FILE_IMAGE
*FileImage
;
98 HEFI_EDITOR_DISK_IMAGE
*DiskImage
;
99 HEFI_EDITOR_MEM_IMAGE
*MemImage
;
100 } HEFI_EDITOR_BUFFER_IMAGE
;
103 HEFI_EDITOR_BUFFER_IMAGE
*BufferImage
;
105 HEFI_EDITOR_COLOR_UNION ColorAttributes
;
106 HEFI_EDITOR_POSITION ScreenSize
; // row number and column number
107 EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL
*TextInputEx
;
108 BOOLEAN MouseSupported
;
109 EFI_SIMPLE_POINTER_PROTOCOL
*MouseInterface
;
110 INT32 MouseAccumulatorX
;
111 INT32 MouseAccumulatorY
;
113 UINTN SelectStart
; // starting from 1
114 UINTN SelectEnd
; // starting from 1
115 } HEFI_EDITOR_GLOBAL_EDITOR
;