2 Defines BufferImage - the view of the file that is visible at any point,
3 as well as the event handlers for editing the file
5 Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #ifndef _LIB_BUFFER_IMAGE_H_
17 #define _LIB_BUFFER_IMAGE_H_
19 #include "HexEditor.h"
22 Initialization function for HBufferImage
24 @retval EFI_SUCCESS The operation was successful.
25 @retval EFI_LOAD_ERROR A load error occured.
33 Cleanup function for HBufferImage
35 @retval EFI_SUCCESS The operation was successful.
43 Refresh function for HBufferImage.
45 @retval EFI_SUCCESS The operation was successful.
46 @retval EFI_LOAD_ERROR A Load error occured.
55 Dispatch input to different handler
57 @param[in] Key The input key:
61 Direction key: up/down/left/right/pgup/pgdn
65 @retval EFI_SUCCESS The operation was successful.
66 @retval EFI_LOAD_ERROR A load error occured.
67 @retval EFI_OUT_OF_RESOURCES A Memory allocation failed.
70 HBufferImageHandleInput (
75 Backup function for HBufferImage. Only a few fields need to be backup.
76 This is for making the file buffer refresh as few as possible.
78 @retval EFI_SUCCESS The operation was successful.
86 Read an image into a buffer friom a source.
88 @param[in] FileName Pointer to the file name. OPTIONAL and ignored if not FileTypeFileBuffer.
89 @param[in] DiskName Pointer to the disk name. OPTIONAL and ignored if not FileTypeDiskBuffer.
90 @param[in] DiskOffset Offset into the disk. OPTIONAL and ignored if not FileTypeDiskBuffer.
91 @param[in] DiskSize Size of the disk buffer. OPTIONAL and ignored if not FileTypeDiskBuffer.
92 @param[in] MemOffset Offset into the Memory. OPTIONAL and ignored if not FileTypeMemBuffer.
93 @param[in] MemSize Size of the Memory buffer. OPTIONAL and ignored if not FileTypeMemBuffer.
94 @param[in] BufferType The type of buffer to save. IGNORED.
95 @param[in] Recover TRUE for recovermode, FALSE otherwise.
97 @return EFI_SUCCESS The operation was successful.
102 IN CONST CHAR16
*FileName
,
103 IN CONST CHAR16
*DiskName
,
108 IN EDIT_FILE_TYPE BufferType
,
113 Save the current image.
115 @param[in] FileName Pointer to the file name. OPTIONAL and ignored if not FileTypeFileBuffer.
116 @param[in] DiskName Pointer to the disk name. OPTIONAL and ignored if not FileTypeDiskBuffer.
117 @param[in] DiskOffset Offset into the disk. OPTIONAL and ignored if not FileTypeDiskBuffer.
118 @param[in] DiskSize Size of the disk buffer. OPTIONAL and ignored if not FileTypeDiskBuffer.
119 @param[in] MemOffset Offset into the Memory. OPTIONAL and ignored if not FileTypeMemBuffer.
120 @param[in] MemSize Size of the Memory buffer. OPTIONAL and ignored if not FileTypeMemBuffer.
121 @param[in] BufferType The type of buffer to save. IGNORED.
123 @return EFI_SUCCESS The operation was successful.
133 IN EDIT_FILE_TYPE BufferType
137 According to cursor's file position, adjust screen display.
139 @param[in] NewFilePosRow Row of file position ( start from 1 ).
140 @param[in] NewFilePosCol Column of file position ( start from 1 ).
141 @param[in] HighBits Cursor will on high4 bits or low4 bits.
144 HBufferImageMovePosition (
145 IN UINTN NewFilePosRow
,
146 IN UINTN NewFilePosCol
,
152 Create a new line and append it to the line list.
157 @retval NULL create line failed.
158 @return the line created.
162 HBufferImageCreateLine (
167 Free the current image.
169 @retval EFI_SUCCESS The operation was successful.
177 Delete character from buffer.
179 @param[in] Pos Position, Pos starting from 0.
180 @param[in] Count The Count of characters to delete.
181 @param[out] DeleteBuffer The DeleteBuffer.
183 @retval EFI_SUCCESS Success
186 HBufferImageDeleteCharacterFromBuffer (
189 OUT UINT8
*DeleteBuffer
193 Add character to buffer, add before pos.
195 @param[in] Pos Position, Pos starting from 0.
196 @param[in] Count Count of characters to add.
197 @param[in] AddBuffer Add buffer.
199 @retval EFI_SUCCESS Success.
202 HBufferImageAddCharacterToBuffer (
209 Change the raw buffer to a list of lines for the UI.
211 @param[in] Buffer The pointer to the buffer to fill.
212 @param[in] Bytes The size of the buffer in bytes.
214 @retval EFI_SUCCESS The operation was successful.
215 @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
219 HBufferImageBufferToList (
225 Change the list of lines from the UI to a raw buffer.
227 @param[in] Buffer The pointer to the buffer to fill.
228 @param[in] Bytes The size of the buffer in bytes.
230 @retval EFI_SUCCESS The operation was successful.
234 HBufferImageListToBuffer (
240 Move the mouse in the image buffer.
242 @param[in] TextX The x-coordinate.
243 @param[in] TextY The y-coordinate.
247 HBufferImageAdjustMousePosition (
253 Function to decide if a column number is stored in the high bits.
255 @param[in] Column The column to examine.
256 @param[out] FCol The actual column number.
258 @retval TRUE The actual column was in high bits and is now in FCol.
259 @retval FALSE There was not a column number in the high bits.
262 HBufferImageIsAtHighBits (
268 Get the size of the open buffer.
270 @retval The size in bytes.
273 HBufferImageGetTotalSize (