]> git.proxmox.com Git - mirror_edk2.git/blob - ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEditorTypes.h
ShellPkg: Apply uncrustify changes
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / HexEdit / HexEditorTypes.h
1 /** @file
2 data types that are used by editor
3
4 Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved. <BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #ifndef _HEDITOR_TYPE_H_
10 #define _HEDITOR_TYPE_H_
11
12 #include "UefiShellDebug1CommandsLib.h"
13 #include "EditTitleBar.h"
14
15 #define EFI_EDITOR_LINE_LIST SIGNATURE_32 ('e', 'e', 'l', 'l')
16
17 #define ASCII_POSITION ((0x10 * 3) + 12)
18
19 typedef struct {
20 UINTN Row;
21 UINTN Column;
22 } HEFI_EDITOR_POSITION;
23
24 typedef
25 EFI_STATUS
26 (*HEFI_MENU_ITEM_FUNCTION) (
27 VOID
28 );
29
30 typedef struct {
31 CHAR16 Name[50];
32 CHAR16 Key[3];
33 HEFI_MENU_ITEM_FUNCTION Function;
34 } HMENU_ITEMS;
35
36 typedef struct _HEFI_EDITOR_LINE {
37 UINTN Signature;
38 UINT8 Buffer[0x10];
39 UINTN Size; // unit is Unicode
40 LIST_ENTRY Link;
41 } HEFI_EDITOR_LINE;
42
43 typedef struct _HEFI_EDITOR_MENU_ITEM {
44 CHAR16 NameToken;
45 CHAR16 FunctionKeyToken;
46 HEFI_MENU_ITEM_FUNCTION Function;
47 } HEFI_EDITOR_MENU_ITEM;
48
49 typedef struct {
50 UINT32 Foreground : 4;
51 UINT32 Background : 4;
52 } HEFI_EDITOR_COLOR_ATTRIBUTES;
53
54 typedef union {
55 HEFI_EDITOR_COLOR_ATTRIBUTES Colors;
56 UINTN Data;
57 } HEFI_EDITOR_COLOR_UNION;
58
59 typedef struct {
60 UINTN Columns;
61 UINTN Rows;
62 } HEFI_EDITOR_TEXT_MODE;
63
64 typedef struct {
65 CHAR16 *Name;
66
67 UINTN BlockSize;
68 UINTN Size;
69 UINTN Offset;
70 } HEFI_EDITOR_DISK_IMAGE;
71
72 typedef struct {
73 EFI_CPU_IO2_PROTOCOL *IoFncs;
74 UINTN Offset;
75 UINTN Size;
76 } HEFI_EDITOR_MEM_IMAGE;
77
78 typedef struct {
79 CHAR16 *FileName;
80 UINTN Size; // file size
81 BOOLEAN ReadOnly; // file is read-only or not
82 } HEFI_EDITOR_FILE_IMAGE;
83
84 typedef struct {
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;
96
97 HEFI_EDITOR_FILE_IMAGE *FileImage;
98 HEFI_EDITOR_DISK_IMAGE *DiskImage;
99 HEFI_EDITOR_MEM_IMAGE *MemImage;
100 } HEFI_EDITOR_BUFFER_IMAGE;
101
102 typedef struct {
103 HEFI_EDITOR_BUFFER_IMAGE *BufferImage;
104
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;
112
113 UINTN SelectStart; // starting from 1
114 UINTN SelectEnd; // starting from 1
115 } HEFI_EDITOR_GLOBAL_EDITOR;
116
117 #endif