TianoCore EDK2 master
Loading...
Searching...
No Matches
MainTextEditor.c File Reference
#include "TextEditor.h"
#include "EditStatusBar.h"
#include "EditInputBar.h"
#include "EditMenuBar.h"

Go to the source code of this file.

Functions

EFI_STATUS MainCommandOpenFile (VOID)
 
EFI_STATUS MainCommandSwitchFileType (VOID)
 
EFI_STATUS MainCommandGotoLine (VOID)
 
EFI_STATUS MainCommandSaveFile (VOID)
 
EFI_STATUS MainCommandDisplayHelp (VOID)
 
EFI_STATUS MainCommandExit (VOID)
 
EFI_STATUS MainCommandSearch (VOID)
 
EFI_STATUS MainCommandSearchReplace (VOID)
 
EFI_STATUS MainCommandCutLine (VOID)
 
EFI_STATUS MainCommandPasteLine (VOID)
 
EFI_STATUS MainEditorInit (VOID)
 
EFI_STATUS MainEditorCleanup (VOID)
 
VOID MainEditorRefresh (VOID)
 
INT32 GetTextX (IN INT32 GuidX)
 
INT32 GetTextY (IN INT32 GuidY)
 
EFI_STATUS MainEditorHandleMouseInput (IN EFI_SIMPLE_POINTER_STATE MouseState)
 
EFI_STATUS MainEditorKeyInput (VOID)
 
EFI_STATUS MainEditorSetCutLine (EFI_EDITOR_LINE *Line)
 
EFI_STATUS MainEditorBackup (VOID)
 

Variables

BOOLEAN EditorFirst
 
BOOLEAN EditorExit
 
BOOLEAN EditorMouseAction
 
EFI_EDITOR_FILE_BUFFER FileBuffer
 
BOOLEAN FileBufferNeedRefresh
 
BOOLEAN FileBufferOnlyLineNeedRefresh
 
BOOLEAN FileBufferMouseNeedRefresh
 
EFI_EDITOR_FILE_BUFFER FileBufferBackupVar
 
EFI_EDITOR_GLOBAL_EDITOR MainEditor
 
EFI_STRING_ID MainMenuHelpInfo []
 
MENU_ITEM_FUNCTION MainControlBasedMenuFunctions []
 
EDITOR_MENU_ITEM MainMenuItems []
 
EFI_EDITOR_COLOR_ATTRIBUTES OriginalColors
 
INTN OriginalMode
 
EFI_EDITOR_GLOBAL_EDITOR MainEditorConst
 

Detailed Description

Implements editor interface functions.

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

Definition in file MainTextEditor.c.

Function Documentation

◆ GetTextX()

INT32 GetTextX ( IN INT32  GuidX)

Get's the resultant location of the cursor based on the relative movement of the Mouse.

Parameters
[in]GuidXThe relative mouse movement.
Returns
The X location of the mouse.

Definition at line 1708 of file MainTextEditor.c.

◆ GetTextY()

INT32 GetTextY ( IN INT32  GuidY)

Get's the resultant location of the cursor based on the relative movement of the Mouse.

Parameters
[in]GuidYThe relative mouse movement.
Returns
The Y location of the mouse.

Definition at line 1729 of file MainTextEditor.c.

◆ MainCommandCutLine()

EFI_STATUS MainCommandCutLine ( VOID  )

cut current line to clipboard

Return values
EFI_SUCCESSThe operation was successful.
EFI_OUT_OF_RESOURCESA memory allocation failed.
EFI_LOAD_ERRORA load error occurred.

Definition at line 473 of file MainTextEditor.c.

◆ MainCommandDisplayHelp()

EFI_STATUS MainCommandDisplayHelp ( VOID  )

Show help information for the editor.

Return values
EFI_SUCCESSThe operation was successful.

Definition at line 1366 of file MainTextEditor.c.

◆ MainCommandExit()

EFI_STATUS MainCommandExit ( VOID  )

exit editor

Return values
EFI_SUCCESSThe operation was successful.
EFI_OUT_OF_RESOURCESA memory allocation failed.
EFI_LOAD_ERRORA load error occurred.

Definition at line 997 of file MainTextEditor.c.

◆ MainCommandGotoLine()

EFI_STATUS MainCommandGotoLine ( VOID  )

move cursor to specified lines

Return values
EFI_SUCCESSThe operation was successful.

Definition at line 1075 of file MainTextEditor.c.

◆ MainCommandOpenFile()

EFI_STATUS MainCommandOpenFile ( VOID  )

Load a file from disk to editor

Return values
EFI_SUCCESSThe operation was successful.
EFI_LOAD_ERRORA load error occurred.
EFI_OUT_OF_RESOURCESA memory allocation failed.

Definition at line 282 of file MainTextEditor.c.

◆ MainCommandPasteLine()

EFI_STATUS MainCommandPasteLine ( VOID  )

paste line to file buffer.

Return values
EFI_SUCCESSThe operation was successful.
EFI_OUT_OF_RESOURCESA memory allocation failed.
EFI_LOAD_ERRORA load error occurred.

Definition at line 511 of file MainTextEditor.c.

◆ MainCommandSaveFile()

EFI_STATUS MainCommandSaveFile ( VOID  )

Save current file to disk, you can save to current file name or save to another file name.

Return values
EFI_SUCCESSThe file was saved correctly.
EFI_OUT_OF_RESOURCESA memory allocation failed.
EFI_LOAD_ERRORA file access error occurred.

Definition at line 1151 of file MainTextEditor.c.

◆ MainCommandSearch()

EFI_STATUS MainCommandSearch ( VOID  )

search string in file buffer

Return values
EFI_SUCCESSThe operation was successful.
EFI_OUT_OF_RESOURCESA memory allocation failed.
EFI_LOAD_ERRORA load error occurred.

Definition at line 542 of file MainTextEditor.c.

◆ MainCommandSearchReplace()

EFI_STATUS MainCommandSearchReplace ( VOID  )

search string in file buffer, and replace it with another str

Return values
EFI_SUCCESSThe operation was successful.
EFI_OUT_OF_RESOURCESA memory allocation failed.
EFI_LOAD_ERRORA load error occurred.

Search string in file buffer, and replace it with another str.

Return values
EFI_SUCCESSThe operation was successful.
EFI_OUT_OF_RESOURCESA memory allocation failed.
EFI_LOAD_ERRORA load error occurred.

Definition at line 687 of file MainTextEditor.c.

◆ MainCommandSwitchFileType()

EFI_STATUS MainCommandSwitchFileType ( VOID  )

Switch a file from ASCII to UNICODE or vise-versa.

Return values
EFI_SUCCESSThe switch was ok or a warning was presented.

Definition at line 440 of file MainTextEditor.c.

◆ MainEditorBackup()

EFI_STATUS MainEditorBackup ( VOID  )

Backup function for MainEditor

Return values
EFI_SUCCESSThe operation was successful.

Definition at line 1985 of file MainTextEditor.c.

◆ MainEditorCleanup()

EFI_STATUS MainEditorCleanup ( VOID  )

The cleanup function for MainEditor.

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

Definition at line 1611 of file MainTextEditor.c.

◆ MainEditorHandleMouseInput()

EFI_STATUS MainEditorHandleMouseInput ( IN EFI_SIMPLE_POINTER_STATE  MouseState)

Support mouse movement. Move the cursor.

Parameters
[in]MouseStateThe current mouse state.
Return values
EFI_SUCCESSThe operation was successful.
EFI_NOT_FOUNDThere was no mouse support found.

Definition at line 1752 of file MainTextEditor.c.

◆ MainEditorInit()

EFI_STATUS MainEditorInit ( VOID  )

The initialization function for MainEditor.

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

Definition at line 1463 of file MainTextEditor.c.

◆ MainEditorKeyInput()

EFI_STATUS MainEditorKeyInput ( VOID  )

Handle user key input. This routes to other functions for the actions.

Return values
EFI_SUCCESSThe operation was successful.
EFI_LOAD_ERRORA load error occurred.
EFI_OUT_OF_RESOURCESA memory allocation failed.

Definition at line 1850 of file MainTextEditor.c.

◆ MainEditorRefresh()

VOID MainEditorRefresh ( VOID  )

Refresh the main editor component.

Definition at line 1656 of file MainTextEditor.c.

◆ MainEditorSetCutLine()

EFI_STATUS MainEditorSetCutLine ( EFI_EDITOR_LINE Line)

Set clipboard

Parameters
[in]LineA pointer to the line to be set to clipboard
Return values
EFI_SUCCESSThe operation was successful.
EFI_OUT_OF_RESOURCESA memory allocation failed.

Definition at line 1953 of file MainTextEditor.c.

Variable Documentation

◆ EditorExit

BOOLEAN EditorExit

Definition at line 22 of file MainTextEditor.c.

◆ EditorFirst

BOOLEAN EditorFirst

Definition at line 17 of file MainTextEditor.c.

◆ EditorMouseAction

BOOLEAN EditorMouseAction

Definition at line 24 of file MainTextEditor.c.

◆ FileBuffer

EFI_EDITOR_FILE_BUFFER FileBuffer
extern

Definition at line 13 of file FileBuffer.c.

◆ FileBufferBackupVar

EFI_EDITOR_FILE_BUFFER FileBufferBackupVar
extern

Definition at line 14 of file FileBuffer.c.

◆ FileBufferMouseNeedRefresh

BOOLEAN FileBufferMouseNeedRefresh
extern

Definition at line 57 of file FileBuffer.c.

◆ FileBufferNeedRefresh

BOOLEAN FileBufferNeedRefresh
extern

Definition at line 50 of file FileBuffer.c.

◆ FileBufferOnlyLineNeedRefresh

BOOLEAN FileBufferOnlyLineNeedRefresh
extern

Definition at line 55 of file FileBuffer.c.

◆ MainControlBasedMenuFunctions

MENU_ITEM_FUNCTION MainControlBasedMenuFunctions[]
Initial value:
= {
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
}
EFI_STATUS MainCommandDisplayHelp(VOID)
EFI_STATUS MainCommandGotoLine(VOID)
EFI_STATUS MainCommandOpenFile(VOID)
EFI_STATUS MainCommandCutLine(VOID)
EFI_STATUS MainCommandExit(VOID)
EFI_STATUS MainCommandSwitchFileType(VOID)
EFI_STATUS MainCommandPasteLine(VOID)
EFI_STATUS MainCommandSearchReplace(VOID)
EFI_STATUS MainCommandSaveFile(VOID)
EFI_STATUS MainCommandSearch(VOID)
#define NULL
Definition: Base.h:319

Definition at line 183 of file MainTextEditor.c.

◆ MainEditor

Definition at line 36 of file MainTextEditor.c.

◆ MainEditorConst

EFI_EDITOR_GLOBAL_EDITOR MainEditorConst
Initial value:
= {
&FileBuffer,
{
{ 0, 0}
},
{
0,
0
},
}
#define FALSE
Definition: Base.h:307

Definition at line 1441 of file MainTextEditor.c.

◆ MainMenuHelpInfo

EFI_STRING_ID MainMenuHelpInfo[]
Initial value:
= {
STRING_TOKEN (STR_EDIT_HELP_TITLE),
STRING_TOKEN (STR_EDIT_HELP_BLANK),
STRING_TOKEN (STR_EDIT_HELP_LIST_TITLE),
STRING_TOKEN (STR_EDIT_HELP_DIV),
STRING_TOKEN (STR_EDIT_HELP_GO_TO_LINE),
STRING_TOKEN (STR_EDIT_HELP_SAVE_FILE),
STRING_TOKEN (STR_EDIT_HELP_EXIT),
STRING_TOKEN (STR_EDIT_HELP_SEARCH),
STRING_TOKEN (STR_EDIT_HELP_SEARCH_REPLACE),
STRING_TOKEN (STR_EDIT_HELP_CUT_LINE),
STRING_TOKEN (STR_EDIT_HELP_PASTE_LINE),
STRING_TOKEN (STR_EDIT_HELP_OPEN_FILE),
STRING_TOKEN (STR_EDIT_HELP_FILE_TYPE),
STRING_TOKEN (STR_EDIT_HELP_BLANK),
STRING_TOKEN (STR_EDIT_HELP_EXIT_HELP),
STRING_TOKEN (STR_EDIT_HELP_BLANK),
STRING_TOKEN (STR_EDIT_HELP_BLANK),
STRING_TOKEN (STR_EDIT_HELP_BLANK),
STRING_TOKEN (STR_EDIT_HELP_BLANK),
STRING_TOKEN (STR_EDIT_HELP_BLANK),
STRING_TOKEN (STR_EDIT_HELP_BLANK),
STRING_TOKEN (STR_EDIT_HELP_BLANK),
STRING_TOKEN (STR_EDIT_HELP_DIV),
0
}
#define STRING_TOKEN(t)

Help info that will be displayed.

Definition at line 156 of file MainTextEditor.c.

◆ MainMenuItems

EDITOR_MENU_ITEM MainMenuItems[]

Definition at line 213 of file MainTextEditor.c.

◆ OriginalColors

Definition at line 1435 of file MainTextEditor.c.

◆ OriginalMode

INTN OriginalMode

Definition at line 1436 of file MainTextEditor.c.