2 data types that are used by editor
4 Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef _HEDITOR_TYPE_H_
16 #define _HEDITOR_TYPE_H_
18 #include "UefiShellDebug1CommandsLib.h"
19 #include "EditTitleBar.h"
21 #define EFI_EDITOR_LINE_LIST SIGNATURE_32 ('e', 'e', 'l', 'l')
23 #define ASCII_POSITION ((0x10 * 3) + 12)
29 } HEFI_EDITOR_POSITION
;
33 (*HEFI_MENU_ITEM_FUNCTION
) (
40 HEFI_MENU_ITEM_FUNCTION Function
;
43 typedef struct _HEFI_EDITOR_LINE
{
46 UINTN Size
; // unit is Unicode
50 typedef struct _HEFI_EDITOR_MENU_ITEM
{
52 CHAR16 FunctionKeyToken
;
53 HEFI_MENU_ITEM_FUNCTION Function
;
54 } HEFI_EDITOR_MENU_ITEM
;
57 UINT32 Foreground
: 4;
58 UINT32 Background
: 4;
59 } HEFI_EDITOR_COLOR_ATTRIBUTES
;
62 HEFI_EDITOR_COLOR_ATTRIBUTES Colors
;
64 } HEFI_EDITOR_COLOR_UNION
;
69 } HEFI_EDITOR_TEXT_MODE
;
78 } HEFI_EDITOR_DISK_IMAGE
;
81 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL
*IoFncs
;
85 } HEFI_EDITOR_MEM_IMAGE
;
89 UINTN Size
; // file size
90 BOOLEAN ReadOnly
; // file is read-only or not
91 } HEFI_EDITOR_FILE_IMAGE
;
94 LIST_ENTRY
*ListHead
; // list head of lines
95 HEFI_EDITOR_LINE
*Lines
; // lines of current file
96 UINTN NumLines
; // number of lines
97 HEFI_EDITOR_LINE
*CurrentLine
; // current line cursor is at
98 HEFI_EDITOR_POSITION DisplayPosition
; // cursor position in screen
99 HEFI_EDITOR_POSITION MousePosition
; // mouse position in screen
100 HEFI_EDITOR_POSITION BufferPosition
; // cursor position in buffer
101 UINTN LowVisibleRow
; // the lowest visible row of file position
102 BOOLEAN HighBits
; // cursor is at the high4 bits or low4 bits
103 BOOLEAN Modified
; // BUFFER is modified or not
104 EDIT_FILE_TYPE BufferType
;
106 HEFI_EDITOR_FILE_IMAGE
*FileImage
;
107 HEFI_EDITOR_DISK_IMAGE
*DiskImage
;
108 HEFI_EDITOR_MEM_IMAGE
*MemImage
;
110 } HEFI_EDITOR_BUFFER_IMAGE
;
113 HEFI_EDITOR_BUFFER_IMAGE
*BufferImage
;
115 HEFI_EDITOR_COLOR_UNION ColorAttributes
;
116 HEFI_EDITOR_POSITION ScreenSize
; // row number and column number
117 BOOLEAN MouseSupported
;
118 EFI_SIMPLE_POINTER_PROTOCOL
*MouseInterface
;
119 INT32 MouseAccumulatorX
;
120 INT32 MouseAccumulatorY
;
122 UINTN SelectStart
; // starting from 1
123 UINTN SelectEnd
; // starting from 1
124 } HEFI_EDITOR_GLOBAL_EDITOR
;