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 _EDITOR_TYPE_H_
16 #define _EDITOR_TYPE_H_
18 #include "UefiShellDebug1CommandsLib.h"
19 #include "EditTitleBar.h"
20 #include "EditMenuBar.h"
22 #define MIN_POOL_SIZE 125
23 #define MAX_STRING_LENGTH 127
28 } EFI_EDITOR_POSITION
;
32 (*EFI_MENU_ITEM_FUNCTION
) (
39 NewLineTypeCarriageReturn
,
40 NewLineTypeCarriageReturnLineFeed
,
41 NewLineTypeLineFeedCarriageReturn
,
45 #define LINE_LIST_SIGNATURE 'eell'
46 typedef struct _EFI_EDITOR_LINE
{
49 UINTN Size
; // unit is Unicode
50 UINTN TotalSize
; // unit is Unicode, exclude CHAR_NULL
56 UINT32 Foreground
: 4;
57 UINT32 Background
: 4;
58 } EFI_EDITOR_COLOR_ATTRIBUTES
;
61 EFI_EDITOR_COLOR_ATTRIBUTES Colors
;
63 } EFI_EDITOR_COLOR_UNION
;
68 } EFI_EDITOR_TEXT_MODE
;
71 CHAR16
*FileName
; // file name current edited in editor
72 EDIT_FILE_TYPE FileType
; // Unicode file or ASCII file
73 LIST_ENTRY
*ListHead
; // list head of lines
74 EFI_EDITOR_LINE
*Lines
; // lines of current file
75 UINTN NumLines
; // total line numbers
76 EFI_EDITOR_POSITION DisplayPosition
; // cursor position in screen
77 EFI_EDITOR_POSITION FilePosition
; // cursor position in file
78 EFI_EDITOR_POSITION MousePosition
; // mouse position in screen
79 // file position of first byte displayed on screen
81 EFI_EDITOR_POSITION LowVisibleRange
;
83 BOOLEAN FileModified
; // file is modified or not
84 BOOLEAN ModeInsert
; // input mode INS or OVR
85 BOOLEAN ReadOnly
; // file is read-only or not
86 EFI_EDITOR_LINE
*CurrentLine
; // current line cursor is at
87 } EFI_EDITOR_FILE_BUFFER
;
90 EFI_EDITOR_FILE_BUFFER
*FileBuffer
;
92 EFI_EDITOR_COLOR_UNION ColorAttributes
;
93 EFI_EDITOR_POSITION ScreenSize
; // row number and column number
94 EFI_EDITOR_LINE
*CutLine
; // clip board
95 BOOLEAN MouseSupported
;
96 EFI_SIMPLE_POINTER_PROTOCOL
*MouseInterface
;
97 INT32 MouseAccumulatorX
;
98 INT32 MouseAccumulatorY
;
100 } EFI_EDITOR_GLOBAL_EDITOR
;