TianoCore EDK2 master
Loading...
Searching...
No Matches
BufferImage.h File Reference
#include "HexEditor.h"

Go to the source code of this file.

Functions

EFI_STATUS HBufferImageInit (VOID)
 
EFI_STATUS HBufferImageCleanup (VOID)
 
EFI_STATUS HBufferImageRefresh (VOID)
 
EFI_STATUS HBufferImageHandleInput (IN EFI_INPUT_KEY *Key)
 
EFI_STATUS HBufferImageBackup (VOID)
 
EFI_STATUS HBufferImageRead (IN CONST CHAR16 *FileName, IN CONST CHAR16 *DiskName, IN UINTN DiskOffset, IN UINTN DiskSize, IN UINTN MemOffset, IN UINTN MemSize, IN EDIT_FILE_TYPE BufferType, IN BOOLEAN Recover)
 
EFI_STATUS HBufferImageSave (IN CHAR16 *FileName, IN CHAR16 *DiskName, IN UINTN DiskOffset, IN UINTN DiskSize, IN UINTN MemOffset, IN UINTN MemSize, IN EDIT_FILE_TYPE BufferType)
 
VOID HBufferImageMovePosition (IN UINTN NewFilePosRow, IN UINTN NewFilePosCol, IN BOOLEAN HighBits)
 
HEFI_EDITOR_LINEHBufferImageCreateLine (VOID)
 
EFI_STATUS HBufferImageFree (VOID)
 
EFI_STATUS HBufferImageDeleteCharacterFromBuffer (IN UINTN Pos, IN UINTN Count, OUT UINT8 *DeleteBuffer)
 
EFI_STATUS HBufferImageAddCharacterToBuffer (IN UINTN Pos, IN UINTN Count, IN UINT8 *AddBuffer)
 
EFI_STATUS HBufferImageBufferToList (IN VOID *Buffer, IN UINTN Bytes)
 
EFI_STATUS HBufferImageListToBuffer (IN VOID *Buffer, IN UINTN Bytes)
 
VOID HBufferImageAdjustMousePosition (IN INT32 TextX, IN INT32 TextY)
 
BOOLEAN HBufferImageIsAtHighBits (IN UINTN Column, OUT UINTN *FCol)
 
UINTN HBufferImageGetTotalSize (VOID)
 

Detailed Description

Defines BufferImage - the view of the file that is visible at any point, as well as the event handlers for editing the file

Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file BufferImage.h.

Function Documentation

◆ HBufferImageAddCharacterToBuffer()

EFI_STATUS HBufferImageAddCharacterToBuffer ( IN UINTN  Pos,
IN UINTN  Count,
IN UINT8 *  AddBuffer 
)

Add character to buffer, add before pos.

Parameters
[in]PosPosition, Pos starting from 0.
[in]CountCount of characters to add.
[in]AddBufferAdd buffer.
Return values
EFI_SUCCESSSuccess.

Definition at line 2018 of file BufferImage.c.

◆ HBufferImageAdjustMousePosition()

VOID HBufferImageAdjustMousePosition ( IN INT32  TextX,
IN INT32  TextY 
)

Move the mouse in the image buffer.

Parameters
[in]TextXThe x-coordinate.
[in]TextYThe y-coordinate.

Definition at line 2291 of file BufferImage.c.

◆ HBufferImageBackup()

EFI_STATUS HBufferImageBackup ( VOID  )

Backup function for HBufferImage. Only a few fields need to be backup. This is for making the file buffer refresh as few as possible.

Return values
EFI_SUCCESSThe operation was successful.

Definition at line 141 of file BufferImage.c.

◆ HBufferImageBufferToList()

EFI_STATUS HBufferImageBufferToList ( IN VOID *  Buffer,
IN UINTN  Bytes 
)

Change the raw buffer to a list of lines for the UI.

Parameters
[in]BufferThe pointer to the buffer to fill.
[in]BytesThe size of the buffer in bytes.
Return values
EFI_SUCCESSThe operation was successful.
EFI_OUT_OF_RESOURCESA memory allocation failed.

Definition at line 2175 of file BufferImage.c.

◆ HBufferImageCleanup()

EFI_STATUS HBufferImageCleanup ( VOID  )

Cleanup function for HBufferImage

Return values
EFI_SUCCESSThe operation was successful.

Definition at line 211 of file BufferImage.c.

◆ HBufferImageCreateLine()

HEFI_EDITOR_LINE * HBufferImageCreateLine ( VOID  )

Create a new line and append it to the line list. Fields affected: NumLines Lines

Return values
NULLcreate line failed.
Returns
the line created.

Definition at line 1040 of file BufferImage.c.

◆ HBufferImageDeleteCharacterFromBuffer()

EFI_STATUS HBufferImageDeleteCharacterFromBuffer ( IN UINTN  Pos,
IN UINTN  Count,
OUT UINT8 *  DeleteBuffer 
)

Delete character from buffer.

Parameters
[in]PosPosition, Pos starting from 0.
[in]CountThe Count of characters to delete.
[out]DeleteBufferThe DeleteBuffer.
Return values
EFI_SUCCESSSuccess

Definition at line 1889 of file BufferImage.c.

◆ HBufferImageFree()

EFI_STATUS HBufferImageFree ( VOID  )

Free the current image.

Return values
EFI_SUCCESSThe operation was successful.

Definition at line 1082 of file BufferImage.c.

◆ HBufferImageGetTotalSize()

UINTN HBufferImageGetTotalSize ( VOID  )

Get the size of the open buffer.

Return values
Thesize in bytes.

Definition at line 1850 of file BufferImage.c.

◆ HBufferImageHandleInput()

EFI_STATUS HBufferImageHandleInput ( IN EFI_INPUT_KEY Key)

Dispatch input to different handler

Parameters
[in]KeyThe input key: the keys can be: ASCII KEY Backspace/Delete Direction key: up/down/left/right/pgup/pgdn Home/End INS
Return values
EFI_SUCCESSThe operation was successful.
EFI_LOAD_ERRORA load error occurred.
EFI_OUT_OF_RESOURCESA Memory allocation failed.

Definition at line 2387 of file BufferImage.c.

◆ HBufferImageInit()

EFI_STATUS HBufferImageInit ( VOID  )

Initialization function for HBufferImage

Return values
EFI_SUCCESSThe operation was successful.
EFI_LOAD_ERRORA load error occurred.

Definition at line 78 of file BufferImage.c.

◆ HBufferImageIsAtHighBits()

BOOLEAN HBufferImageIsAtHighBits ( IN UINTN  Column,
OUT UINTN FCol 
)

Function to decide if a column number is stored in the high bits.

Parameters
[in]ColumnThe column to examine.
[out]FColThe actual column number.
Return values
TRUEThe actual column was in high bits and is now in FCol.
FALSEThere was not a column number in the high bits.

Definition at line 425 of file BufferImage.c.

◆ HBufferImageListToBuffer()

EFI_STATUS HBufferImageListToBuffer ( IN VOID *  Buffer,
IN UINTN  Bytes 
)

Change the list of lines from the UI to a raw buffer.

Parameters
[in]BufferThe pointer to the buffer to fill.
[in]BytesThe size of the buffer in bytes.
Return values
EFI_SUCCESSThe operation was successful.

Definition at line 2238 of file BufferImage.c.

◆ HBufferImageMovePosition()

VOID HBufferImageMovePosition ( IN UINTN  NewFilePosRow,
IN UINTN  NewFilePosCol,
IN BOOLEAN  HighBits 
)

According to cursor's file position, adjust screen display.

Parameters
[in]NewFilePosRowRow of file position ( start from 1 ).
[in]NewFilePosColColumn of file position ( start from 1 ).
[in]HighBitsCursor will on high4 bits or low4 bits.

Definition at line 1419 of file BufferImage.c.

◆ HBufferImageRead()

EFI_STATUS HBufferImageRead ( IN CONST CHAR16 *  FileName,
IN CONST CHAR16 *  DiskName,
IN UINTN  DiskOffset,
IN UINTN  DiskSize,
IN UINTN  MemOffset,
IN UINTN  MemSize,
IN EDIT_FILE_TYPE  BufferType,
IN BOOLEAN  Recover 
)

Read an image into a buffer friom a source.

Parameters
[in]FileNamePointer to the file name. OPTIONAL and ignored if not FileTypeFileBuffer.
[in]DiskNamePointer to the disk name. OPTIONAL and ignored if not FileTypeDiskBuffer.
[in]DiskOffsetOffset into the disk. OPTIONAL and ignored if not FileTypeDiskBuffer.
[in]DiskSizeSize of the disk buffer. OPTIONAL and ignored if not FileTypeDiskBuffer.
[in]MemOffsetOffset into the Memory. OPTIONAL and ignored if not FileTypeMemBuffer.
[in]MemSizeSize of the Memory buffer. OPTIONAL and ignored if not FileTypeMemBuffer.
[in]BufferTypeThe type of buffer to save. IGNORED.
[in]RecoverTRUE for recovermode, FALSE otherwise.
Returns
EFI_SUCCESS The operation was successful.

Definition at line 909 of file BufferImage.c.

◆ HBufferImageRefresh()

EFI_STATUS HBufferImageRefresh ( VOID  )

Refresh function for HBufferImage.

Return values
EFI_SUCCESSThe operation was successful.
EFI_LOAD_ERRORA Load error occurred.

Definition at line 740 of file BufferImage.c.

◆ HBufferImageSave()

EFI_STATUS HBufferImageSave ( IN CHAR16 *  FileName,
IN CHAR16 *  DiskName,
IN UINTN  DiskOffset,
IN UINTN  DiskSize,
IN UINTN  MemOffset,
IN UINTN  MemSize,
IN EDIT_FILE_TYPE  BufferType 
)

Save the current image.

Parameters
[in]FileNamePointer to the file name. OPTIONAL and ignored if not FileTypeFileBuffer.
[in]DiskNamePointer to the disk name. OPTIONAL and ignored if not FileTypeDiskBuffer.
[in]DiskOffsetOffset into the disk. OPTIONAL and ignored if not FileTypeDiskBuffer.
[in]DiskSizeSize of the disk buffer. OPTIONAL and ignored if not FileTypeDiskBuffer.
[in]MemOffsetOffset into the Memory. OPTIONAL and ignored if not FileTypeMemBuffer.
[in]MemSizeSize of the Memory buffer. OPTIONAL and ignored if not FileTypeMemBuffer.
[in]BufferTypeThe type of buffer to save. IGNORED.
Returns
EFI_SUCCESS The operation was successful.

Definition at line 976 of file BufferImage.c.