]>
Commit | Line | Data |
---|---|---|
632820d1 | 1 | /** @file\r |
2 | Declares editor types.\r | |
3 | \r | |
4 | Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>\r | |
5 | This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #ifndef _EDITOR_TYPE_H_\r | |
16 | #define _EDITOR_TYPE_H_\r | |
17 | \r | |
18 | #include "UefiShellDebug1CommandsLib.h"\r | |
19 | #include "EditTitleBar.h"\r | |
20 | #include "EditMenuBar.h"\r | |
21 | \r | |
22 | #define MIN_POOL_SIZE 125\r | |
23 | #define MAX_STRING_LENGTH 127\r | |
24 | \r | |
25 | typedef struct {\r | |
26 | UINTN Row;\r | |
27 | UINTN Column;\r | |
28 | } EFI_EDITOR_POSITION;\r | |
29 | \r | |
30 | typedef\r | |
31 | EFI_STATUS\r | |
32 | (*EFI_MENU_ITEM_FUNCTION) (\r | |
33 | VOID\r | |
34 | );\r | |
35 | \r | |
36 | typedef enum {\r | |
37 | NewLineTypeDefault,\r | |
38 | NewLineTypeLineFeed,\r | |
39 | NewLineTypeCarriageReturn,\r | |
40 | NewLineTypeCarriageReturnLineFeed,\r | |
41 | NewLineTypeLineFeedCarriageReturn,\r | |
42 | NewLineTypeUnknown\r | |
43 | } EE_NEWLINE_TYPE;\r | |
44 | \r | |
2b578de0 | 45 | #define LINE_LIST_SIGNATURE SIGNATURE_32 ('e', 'e', 'l', 'l')\r |
632820d1 | 46 | typedef struct _EFI_EDITOR_LINE {\r |
47 | UINTN Signature;\r | |
48 | CHAR16 *Buffer;\r | |
49 | UINTN Size; // unit is Unicode\r | |
50 | UINTN TotalSize; // unit is Unicode, exclude CHAR_NULL\r | |
51 | EE_NEWLINE_TYPE Type;\r | |
52 | LIST_ENTRY Link;\r | |
53 | } EFI_EDITOR_LINE;\r | |
54 | \r | |
55 | typedef struct {\r | |
56 | UINT32 Foreground : 4;\r | |
57 | UINT32 Background : 4;\r | |
58 | } EFI_EDITOR_COLOR_ATTRIBUTES;\r | |
59 | \r | |
60 | typedef union {\r | |
61 | EFI_EDITOR_COLOR_ATTRIBUTES Colors;\r | |
62 | UINTN Data;\r | |
63 | } EFI_EDITOR_COLOR_UNION;\r | |
64 | \r | |
65 | typedef struct {\r | |
66 | UINTN Columns;\r | |
67 | UINTN Rows;\r | |
68 | } EFI_EDITOR_TEXT_MODE;\r | |
69 | \r | |
70 | typedef struct {\r | |
71 | CHAR16 *FileName; // file name current edited in editor\r | |
72 | EDIT_FILE_TYPE FileType; // Unicode file or ASCII file\r | |
73 | LIST_ENTRY *ListHead; // list head of lines\r | |
74 | EFI_EDITOR_LINE *Lines; // lines of current file\r | |
75 | UINTN NumLines; // total line numbers\r | |
76 | EFI_EDITOR_POSITION DisplayPosition; // cursor position in screen\r | |
77 | EFI_EDITOR_POSITION FilePosition; // cursor position in file\r | |
78 | EFI_EDITOR_POSITION MousePosition; // mouse position in screen\r | |
79 | // file position of first byte displayed on screen\r | |
80 | //\r | |
81 | EFI_EDITOR_POSITION LowVisibleRange;\r | |
82 | \r | |
83 | BOOLEAN FileModified; // file is modified or not\r | |
84 | BOOLEAN ModeInsert; // input mode INS or OVR\r | |
85 | BOOLEAN ReadOnly; // file is read-only or not\r | |
86 | EFI_EDITOR_LINE *CurrentLine; // current line cursor is at\r | |
87 | } EFI_EDITOR_FILE_BUFFER;\r | |
88 | \r | |
89 | typedef struct {\r | |
90 | EFI_EDITOR_FILE_BUFFER *FileBuffer;\r | |
91 | \r | |
92 | EFI_EDITOR_COLOR_UNION ColorAttributes;\r | |
93 | EFI_EDITOR_POSITION ScreenSize; // row number and column number\r | |
94 | EFI_EDITOR_LINE *CutLine; // clip board\r | |
95 | BOOLEAN MouseSupported;\r | |
96 | EFI_SIMPLE_POINTER_PROTOCOL *MouseInterface;\r | |
97 | INT32 MouseAccumulatorX;\r | |
98 | INT32 MouseAccumulatorY;\r | |
99 | \r | |
100 | } EFI_EDITOR_GLOBAL_EDITOR;\r | |
101 | \r | |
102 | #endif\r |