TianoCore EDK2 master
|
Go to the source code of this file.
Variables | |
EFI_EDITOR_FILE_BUFFER | FileBuffer |
EFI_EDITOR_FILE_BUFFER | FileBufferBackupVar |
EFI_EDITOR_FILE_BUFFER | FileBufferConst |
BOOLEAN | FileBufferNeedRefresh |
BOOLEAN | FileBufferOnlyLineNeedRefresh |
BOOLEAN | FileBufferMouseNeedRefresh |
BOOLEAN | EditorMouseAction |
Implements filebuffer interface functions.
Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file FileBuffer.c.
Check user specified FileRow is above current screen.
[in] | FileRow | The row of file position ( start from 1 ). |
TRUE | It is above the current screen. |
FALSE | It is not above the current screen. |
Definition at line 2553 of file FileBuffer.c.
EFI_STATUS FileBufferAddChar | ( | IN CHAR16 | Char | ) |
Add a character to the current line.
[in] | Char | The Character to input. |
EFI_SUCCESS | The input was succesful. |
Definition at line 2113 of file FileBuffer.c.
Move the mouse cursor position.
[in] | TextX | The new x-coordinate. |
[in] | TextY | The new y-coordinate. |
Definition at line 3158 of file FileBuffer.c.
EFI_STATUS FileBufferBackup | ( | VOID | ) |
Backup function for FileBuffer. Only backup the following items: Mouse/Cursor position File Name, Type, ReadOnly, Modified Insert Mode
This is for making the file buffer refresh as few as possible.
EFI_SUCCESS | The backup operation was successful. |
Definition at line 117 of file FileBuffer.c.
EFI_STATUS FileBufferCleanup | ( | VOID | ) |
Cleanup function for FileBuffer.
EFI_SUCCESS | The cleanup was successful. |
Definition at line 445 of file FileBuffer.c.
EFI_EDITOR_LINE * FileBufferCreateLine | ( | VOID | ) |
Create a new line and append it to the line list. Fields affected: NumLines Lines
NULL | The create line failed. |
Definition at line 664 of file FileBuffer.c.
EFI_STATUS FileBufferCutLine | ( | OUT EFI_EDITOR_LINE ** | CutLine | ) |
Cut current line out and return a pointer to it.
[out] | CutLine | Upon a successful return pointer to the pointer to the allocated cut line. |
EFI_SUCCESS | The cut was successful. |
EFI_NOT_FOUND | There was no selection to cut. |
EFI_OUT_OF_RESOURCES | A memory allocation failed. |
Definition at line 2791 of file FileBuffer.c.
EFI_STATUS FileBufferDoBackspace | ( | VOID | ) |
Delete the previous character.
EFI_SUCCESS | The delete was successful. |
EFI_OUT_OF_RESOURCES | A memory allocation failed. |
Definition at line 1776 of file FileBuffer.c.
EFI_STATUS FileBufferDoCharInput | ( | IN CONST CHAR16 | Char | ) |
Handles inputs from characters (ASCII key + Backspace + return)
[in] | Char | The input character. |
EFI_SUCCESS | The operation was successful. |
EFI_LOAD_ERROR | There was an error. |
EFI_OUT_OF_RESOURCES | A memory allocation failed. |
Definition at line 2161 of file FileBuffer.c.
EFI_STATUS FileBufferDoDelete | ( | VOID | ) |
Delete current character from current line. This is the effect caused by the 'del' key.
EFI_SUCCESS |
Definition at line 1944 of file FileBuffer.c.
EFI_STATUS FileBufferDoReturn | ( | VOID | ) |
Add a return into line at current position.
EFI_SUCCESS | The insetrion of the character was successful. |
EFI_OUT_OF_RESOURCES | A memory allocation failed. |
Definition at line 1847 of file FileBuffer.c.
EFI_STATUS FileBufferEnd | ( | VOID | ) |
Scroll cursor to end of the current line.
EFI_SUCCESS | The operation was successful. |
Definition at line 2401 of file FileBuffer.c.
EFI_STATUS FileBufferFree | ( | VOID | ) |
Free the existing file lines and reset the modified flag.
EFI_SUCCESS | The operation was successful. |
Definition at line 752 of file FileBuffer.c.
EFI_STATUS FileBufferFreeLines | ( | VOID | ) |
Free all the lines in FileBuffer Fields affected: Lines CurrentLine NumLines ListHead
EFI_SUCCESS | The operation was successful. |
Definition at line 402 of file FileBuffer.c.
EFI_STATUS FileBufferHandleInput | ( | IN CONST EFI_INPUT_KEY * | Key | ) |
Dispatch input to different handler
[in] | Key | The input key. One of: ASCII KEY Backspace/Delete Return Direction key: up/down/left/right/pgup/pgdn Home/End INS |
EFI_SUCCESS | The dispatch was done successfully. |
EFI_LOAD_ERROR | The dispatch was not successful. |
EFI_OUT_OF_RESOURCES | A memory allocation failed. |
Definition at line 2438 of file FileBuffer.c.
EFI_STATUS FileBufferInit | ( | VOID | ) |
Initialization function for FileBuffer.
EFI_SUCCESS | The initialization was successful. |
EFI_LOAD_ERROR | A default name could not be created. |
EFI_OUT_OF_RESOURCES | A memory allocation failed. |
Definition at line 69 of file FileBuffer.c.
According to cursor's file position, adjust screen display
[in] | NewFilePosRow | The row of file position ( start from 1 ). |
[in] | NewFilePosCol | The column of file position ( start from 1 ). |
Definition at line 2677 of file FileBuffer.c.
EFI_STATUS FileBufferPageDown | ( | VOID | ) |
Scroll cursor to next page.
EFI_SUCCESS | The operation wa successful. |
Definition at line 2295 of file FileBuffer.c.
EFI_STATUS FileBufferPageUp | ( | VOID | ) |
Scroll cursor to previous screen.
EFI_SUCCESS | The operation was successful. |
Definition at line 2346 of file FileBuffer.c.
EFI_STATUS FileBufferPasteLine | ( | VOID | ) |
Paste a line into line list.
EFI_SUCCESS | The paste was successful. |
EFI_OUT_OF_RESOURCES | A memory allocation failed. |
Definition at line 2874 of file FileBuffer.c.
EFI_STATUS FileBufferPrintLine | ( | IN CONST EFI_EDITOR_LINE * | Line, |
IN CONST UINTN | Row | ||
) |
Print a line specified by Line on a row specified by Row of the screen.
[in] | Line | The line to print. |
[in] | Row | The row on the screen to print onto (begin from 1). |
EFI_SUCCESS | The printing was successful. |
Definition at line 474 of file FileBuffer.c.
EFI_STATUS FileBufferRead | ( | IN CONST CHAR16 * | FileName, |
IN CONST BOOLEAN | Recover | ||
) |
Read a file from disk into the FileBuffer.
[in] | FileName | The filename to read. |
[in] | Recover | TRUE if is for recover mode, no information printouts. |
EFI_SUCCESS | The load was successful. |
EFI_LOAD_ERROR | The load failed. |
EFI_OUT_OF_RESOURCES | A memory allocation failed. |
EFI_INVALID_PARAMETER | FileName is a directory. |
Definition at line 777 of file FileBuffer.c.
EFI_STATUS FileBufferRefresh | ( | VOID | ) |
Refresh the screen with whats in the buffer.
EFI_SUCCESS | The refresh was successful. |
EFI_LOAD_ERROR | There was an error finding what to write. |
Definition at line 551 of file FileBuffer.c.
Replace SearchLen characters from current position on with Replace.
This will modify the current buffer at the current position.
[in] | Replace | The string to replace. |
[in] | SearchLen | Search string's length. |
EFI_SUCCESS | The operation was successful. |
EFI_OUT_OF_RESOURCES | A memory allocation failed. |
Definition at line 3052 of file FileBuffer.c.
EFI_STATUS FileBufferReplaceAll | ( | IN CHAR16 * | SearchStr, |
IN CHAR16 * | ReplaceStr, | ||
IN UINTN | Offset | ||
) |
Search and replace operation.
[in] | SearchStr | The string to search for. |
[in] | ReplaceStr | The string to replace with. |
[in] | Offset | The column to start at. |
Definition at line 3235 of file FileBuffer.c.
EFI_STATUS FileBufferRestoreMousePosition | ( | VOID | ) |
Function to update the 'screen' to display the mouse position.
EFI_SUCCESS | The backup operation was successful. |
Definition at line 255 of file FileBuffer.c.
EFI_STATUS FileBufferRestorePosition | ( | VOID | ) |
Set the cursor position according to FileBuffer.DisplayPosition.
EFI_SUCCESS | The operation was successful. |
Definition at line 530 of file FileBuffer.c.
EFI_STATUS FileBufferSave | ( | IN CONST CHAR16 * | FileName | ) |
Save lines in FileBuffer to disk
[in] | FileName | The file name for writing. |
EFI_SUCCESS | Data was written. |
EFI_LOAD_ERROR | |
EFI_OUT_OF_RESOURCES | There were not enough resources to write the file. |
Definition at line 1425 of file FileBuffer.c.
EFI_STATUS FileBufferScrollDown | ( | VOID | ) |
Scroll cursor to the next line.
EFI_SUCCESS | The operation was successful. |
Definition at line 2210 of file FileBuffer.c.
EFI_STATUS FileBufferScrollLeft | ( | VOID | ) |
Scroll cursor to left 1 character position.
EFI_SUCCESS | The operation was successful. |
Definition at line 1666 of file FileBuffer.c.
EFI_STATUS FileBufferScrollRight | ( | VOID | ) |
Scroll cursor to right 1 character.
EFI_SUCCESS | The operation was successful. |
Definition at line 2006 of file FileBuffer.c.
EFI_STATUS FileBufferScrollUp | ( | VOID | ) |
Scroll the cursor to previous line.
EFI_SUCCESS | The operation was successful. |
Definition at line 2254 of file FileBuffer.c.
Search string from current position on in file
[in] | Str | The search string. |
[in] | Offset | The offset from current position. |
EFI_SUCCESS | The operation was successful. |
EFI_NOT_FOUND | The string Str was not found. |
Definition at line 2947 of file FileBuffer.c.
EFI_STATUS FileBufferSetFileName | ( | IN CONST CHAR16 * | Str | ) |
Set FileName field in FileBuffer.
Str | The file name to set. |
EFI_SUCCESS | The filename was successfully set. |
EFI_OUT_OF_RESOURCES | A memory allocation failed. |
EFI_INVALID_PARAMETER | Str is not a valid filename. |
Definition at line 719 of file FileBuffer.c.
VOID FileBufferSetModified | ( | VOID | ) |
Set the modified state to TRUE.
Definition at line 3354 of file FileBuffer.c.
According to FileBuffer.NewLineType & FileBuffer.FileType, get the return buffer and size.
[in] | Type | The type of line. |
[out] | Buffer | The buffer to fill. |
[out] | Size | The amount of the buffer used on return. |
Definition at line 1288 of file FileBuffer.c.
EFI_EDITOR_LINE * InternalEditorMiscLineAdvance | ( | IN CONST UINTN | Count, |
IN CONST EFI_EDITOR_LINE * | CurrentLine, | ||
IN CONST LIST_ENTRY * | LineList | ||
) |
Advance to the next Count lines
[in] | Count | The line number to advance by. |
[in] | CurrentLine | The pointer to the current line structure. |
[in] | LineList | The pointer to the linked list of lines. |
NULL | There was an error. |
Definition at line 150 of file FileBuffer.c.
EFI_EDITOR_LINE * InternalEditorMiscLineRetreat | ( | IN CONST UINTN | Count, |
IN CONST EFI_EDITOR_LINE * | CurrentLine, | ||
IN CONST LIST_ENTRY * | LineList | ||
) |
Retreat to the previous Count lines.
[in] | Count | The line number to retreat by. |
[in] | CurrentLine | The pointer to the current line structure. |
[in] | LineList | The pointer to the linked list of lines. |
NULL | There was an error. |
Definition at line 189 of file FileBuffer.c.
Check user specified FileCol is left to current screen.
[in] | FileCol | The column of file position ( start from 1 ). |
TRUE | It is to the left. |
FALSE | It is not to the left. |
Definition at line 2599 of file FileBuffer.c.
VOID LineCat | ( | IN OUT EFI_EDITOR_LINE * | Dest, |
IN EFI_EDITOR_LINE * | Src | ||
) |
Concatenate Src into Dest.
[in,out] | Dest | Destination string |
[in] | Src | Src String. |
Definition at line 1736 of file FileBuffer.c.
VOID LineDeleteAt | ( | IN OUT EFI_EDITOR_LINE * | Line, |
IN UINTN | Pos | ||
) |
Delete a char in line
[in,out] | Line | The line to delete in. |
[in] | Pos | Position to delete the char at ( start from 0 ). |
Definition at line 1712 of file FileBuffer.c.
Insert a char into line
[in] | Line | The line to insert into. |
[in] | Char | The char to insert. |
[in] | Pos | The position to insert the char at ( start from 0 ). |
[in] | StrSize | The current string size ( include CHAR_NULL ),unit is Unicode character. |
Definition at line 2059 of file FileBuffer.c.
EFI_EDITOR_LINE * MoveCurrentLine | ( | IN INTN | Count | ) |
Advance/Retreat lines and set CurrentLine in FileBuffer to it
[in] | Count | The line number to advance/retreat >0 : advance <0: retreat |
NULL | An error occurred. |
Definition at line 2647 of file FileBuffer.c.
EFI_EDITOR_LINE * MoveLine | ( | IN CONST INTN | Count | ) |
Advance/Retreat lines
[in] | Count | line number to advance/retreat >0 : advance <0 : retreat |
NULL | An error occurred. |
Definition at line 228 of file FileBuffer.c.
Check user specified FileCol is right to current screen.
[in] | FileCol | The column of file position ( start from 1 ). |
TRUE | It is to the right. |
FALSE | It is not to the right. |
Definition at line 2622 of file FileBuffer.c.
Check user specified FileRow is under current screen.
[in] | FileRow | The row of file position ( start from 1 ). |
TRUE | It is under the current screen. |
FALSE | It is not under the current screen. |
Definition at line 2576 of file FileBuffer.c.
Change a Unicode string to an ASCII string.
[in] | UStr | The Unicode string. |
[in] | Length | The maximum size of AStr. |
[out] | AStr | ASCII string to pass out. |
Definition at line 1397 of file FileBuffer.c.
|
extern |
Definition at line 24 of file MainTextEditor.c.
EFI_EDITOR_FILE_BUFFER FileBuffer |
Definition at line 13 of file FileBuffer.c.
EFI_EDITOR_FILE_BUFFER FileBufferBackupVar |
Definition at line 14 of file FileBuffer.c.
EFI_EDITOR_FILE_BUFFER FileBufferConst |
BOOLEAN FileBufferMouseNeedRefresh |
Definition at line 57 of file FileBuffer.c.
BOOLEAN FileBufferNeedRefresh |
Definition at line 50 of file FileBuffer.c.
BOOLEAN FileBufferOnlyLineNeedRefresh |
Definition at line 55 of file FileBuffer.c.