NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
|
This class manages the actual text by storing it in an internal buffer. During an update the TextManager will render the text in the internal buffer into the text block in screen coordinates. More...
#include <TextManager.h>
Public Member Functions | |
TextManager (GenericTerminal *parent=nullptr, int width=80, int height=24, int maxWidth=160, int maxHeight=300) | |
~TextManager () | |
Destructor will reset the internal buffer. More... | |
void | printOutput (const std::string &sLine) |
This is the read-only print function. More... | |
void | insertInput (const std::string &sLine, size_t logicalpos=std::string::npos) |
This is the user input function. More... | |
ViewCursor | toViewCursor (const LogicalCursor &logCursor) const |
Convert a logical cursor to a view cursor. More... | |
ViewCursor | getCurrentViewPos () const |
Returns the current cursor position as view cursor. More... | |
LogicalCursor | toLogicalCursor (const ViewCursor &viewCursor) const |
Convert a view cursor into a logical cursor. More... | |
LogicalCursor | getCurrentLogicalPos () const |
Returns the current cursor position as logical cursor. More... | |
std::string | getRenderedString (size_t viewLine) const |
Return the rendered line for the current viewport setting. More... | |
std::vector< unsigned short > | getRenderedColors (size_t viewLine) const |
Return the rendered colors for the selected viewport line. More... | |
size_t | tab () |
Insert a tab character at the current position. More... | |
void | newLine () |
Adds a new line to the current managed text. More... | |
void | backspace (const LogicalCursor &logCursor) |
Performs a backspace operation. More... | |
void | eraseLine () |
Erase the current line. More... | |
bool | clearRange (const ViewCursor &cursor1, const ViewCursor &cursor2) |
Clears the range between two view cursors. More... | |
void | selectText (const ViewCursor &viewCursor, bool bSelect=true) |
Selects the text at the view cursor position. More... | |
void | unselectAll () |
This member function unselects the whole text at once. More... | |
bool | isSelected (const ViewCursor &viewCursor) const |
Determines, whether the pointed character is selected. More... | |
bool | isSelectedLogical (const LogicalCursor &cursor) const |
Determines, whether the pointed character is selected. More... | |
std::string | getSelectedText () const |
This member function returns the selected text. More... | |
std::string | getCurrentInputLine () const |
Returns the contents of the input line. More... | |
std::string | getPreviousLine () const |
This member function returns the contents of the line before the current input line. More... | |
int | GetSize () const |
int | GetMaxSize () const |
Returns the buffer size of the terminal. More... | |
int | GetHeight () const |
int | GetNumLinesScrolled () const |
int | GetLinesReceived () const |
std::string | GetInputHistory (bool vcursorup=true) |
Get the next history line. More... | |
std::string | GetTextRange (int y, int x0, int x1) const |
Extracts the text between the positions. More... | |
std::string | GetWordAt (int y, int x) const |
Returns the word at the passed position. More... | |
std::string | GetWordStartAt (int y, int x) const |
Returns the word start at the passed position. More... | |
char | GetCharAdjusted (int y, int x) const |
char | GetCharLogical (const LogicalCursor &cursor) const |
Returns the character at the logical position. More... | |
bool | IsUserText (int y, int x) const |
Determines, whether the character at (x,y) is a user text. More... | |
bool | IsEditable (int y, int x) const |
Determines, whether the character at (x,y) is editable text. More... | |
bool | IsEditableLogical (const LogicalCursor &logCursor) const |
Determines, whether the character at the logical position is editable text. More... | |
unsigned short | GetColor (int y, int x) const |
unsigned short | GetColorAdjusted (int y, int x) const |
void | ChangeEditableState () |
Removes the editable flag from the managed text. More... | |
void | SetMaxSize (int newSize) |
void | ResetVirtualCursorLine () |
void | SetColorAdjusted (int y, int x, unsigned short value) |
bool | Scroll (int numLines, bool scrollUp) |
void | Resize (int width, int height) |
void | Reset () |
std::string | operator[] (int index) |
int | AdjustIndex (int index) const |
Private Types | |
enum | { KERNEL_TEXT , USER_TEXT , EDITABLE_TEXT } |
Private Member Functions | |
int | calc_color (int fg, int bg, int flags) |
Helper function for converting the colors into a single int. More... | |
void | updateColors (bool isErrorLine=false) |
Update the colors for the current line. More... | |
void | renderLayout () |
This function renders the layout. More... | |
void | synchronizeRenderedBlock (int linesToDelete) |
Removes parts of the already rendered block. More... | |
size_t | findNextLinebreak (const std::string ¤tLine, size_t currentLinebreak) const |
Find the next linebreak position. More... | |
Private Attributes | |
GenericTerminal * | m_parent |
int | m_topLine |
int | m_bottomLine |
int | m_numLinesScrolledUp |
int | m_viewportWidth |
int | m_viewportHeight |
int | m_linesReceived |
int | m_maxWidth |
int | m_maxHeight |
int | m_virtualCursor |
size_t | m_tabLength |
size_t | m_indentDepth |
std::deque< CharacterVector > | m_managedText |
std::deque< RenderedLine > | m_renderedBlock |
This class manages the actual text by storing it in an internal buffer. During an update the TextManager will render the text in the internal buffer into the text block in screen coordinates.
Definition at line 485 of file TextManager.h.
|
private |
Enumerator | |
---|---|
KERNEL_TEXT | |
USER_TEXT | |
EDITABLE_TEXT |
Definition at line 575 of file TextManager.h.
TextManager::TextManager | ( | GenericTerminal * | parent = nullptr , |
int | width = 80 , |
||
int | height = 24 , |
||
int | maxWidth = 160 , |
||
int | maxHeight = 300 |
||
) |
public constructor TextManager It's a constructor. Yay.
parent | GTerm * [=0] The GTerm that owns this textmanager |
width | int [=80] The starting width in characters |
height | int [=24] The starting height in characters |
maxWidth | int [=160] The maximum possible characters in a line |
maxHeight | int [=100] The maximum lines of history to store |
Definition at line 46 of file TextManager.cpp.
References m_parent, and Reset().
TextManager::~TextManager | ( | ) |
Destructor will reset the internal buffer.
Definition at line 60 of file TextManager.cpp.
References Reset().
int TextManager::AdjustIndex | ( | int | index | ) | const |
private AdjustIndex Adjusts an index within the viewport to the absolute index in the main arrays
index | int The unadjusted index |
Definition at line 1502 of file TextManager.cpp.
References m_numLinesScrolledUp, and m_topLine.
void TextManager::backspace | ( | const LogicalCursor & | logCursor | ) |
Performs a backspace operation.
logCursor | const LogicalCursor& |
This member function performs a backspace operation at the passed logical cursor position. Backspaces are only allowed in the current input line, which is the last line of the managed text (but not necessarily the last line of the viewport line)
Definition at line 636 of file TextManager.cpp.
References LogicalCursor::line, m_managedText, LogicalCursor::pos, renderLayout(), synchronizeRenderedBlock(), and updateColors().
Referenced by GenericTerminal::bs(), GenericTerminal::del(), and GenericTerminal::erase_usercontent_line().
|
private |
Helper function for converting the colors into a single int.
fg | int Color values ranging from 0-15 |
bg | int Color values ranging from 0-15 |
flags | int |
Definition at line 321 of file TextManager.cpp.
Referenced by renderLayout(), and updateColors().
void TextManager::ChangeEditableState | ( | ) |
Removes the editable flag from the managed text.
This member function will switch every editable text to a simple user text
Definition at line 1481 of file TextManager.cpp.
References m_managedText.
Referenced by NumeReTerminal::filterKeyCodes().
bool TextManager::clearRange | ( | const ViewCursor & | cursor1, |
const ViewCursor & | cursor2 | ||
) |
Clears the range between two view cursors.
cursor1 | const ViewCursor& |
cursor2 | const ViewCursor& |
This member function is used to clear the range between the two view cursors. It may even clear the characters, which are spread across multiple lines
Definition at line 706 of file TextManager.cpp.
References LogicalCursor::line, m_managedText, min, LogicalCursor::pos, renderLayout(), synchronizeRenderedBlock(), toLogicalCursor(), and updateColors().
Referenced by GenericTerminal::clear_area(), and GenericTerminal::delSelected().
void TextManager::eraseLine | ( | ) |
Erase the current line.
This member function erases the current line (i.e. the last line of the managed text) completely. This is used, if the printed string starts with a carriage return character
Definition at line 674 of file TextManager.cpp.
References m_managedText, renderLayout(), and synchronizeRenderedBlock().
Referenced by GenericTerminal::erase_line(), and GenericTerminal::normal_output().
|
private |
Find the next linebreak position.
currentLine | const string& |
currentLinebreak | size_t |
This function finds the next possible linebreak position from the current position using a simple heuristic
Definition at line 534 of file TextManager.cpp.
References m_indentDepth, and m_viewportWidth.
Referenced by renderLayout().
char TextManager::GetCharAdjusted | ( | int | y, |
int | x | ||
) | const |
public GetCharAdjusted Gets a character, adjusted for the viewport
y | int The line within the viewport that the character is on |
x | int The character position within that line |
Definition at line 1317 of file TextManager.cpp.
References GetCharLogical(), and toLogicalCursor().
Referenced by GenericTerminal::GetChar(), GenericTerminal::getProcNameSpace(), GenericTerminal::tab(), and GenericTerminal::update_changes().
char TextManager::GetCharLogical | ( | const LogicalCursor & | cursor | ) | const |
Returns the character at the logical position.
cursor | const LogicalCursor& |
Definition at line 1331 of file TextManager.cpp.
References LogicalCursor::line, m_managedText, and LogicalCursor::pos.
Referenced by GenericTerminal::ctrl_left(), GenericTerminal::ctrl_right(), and GetCharAdjusted().
unsigned short TextManager::GetColor | ( | int | y, |
int | x | ||
) | const |
public GetColor Gets an encoded color without adjusting for the viewport
y | int The line number |
x | int The character on that line |
Definition at line 1418 of file TextManager.cpp.
References m_managedText.
unsigned short TextManager::GetColorAdjusted | ( | int | y, |
int | x | ||
) | const |
public GetColorAdjusted Gets an encoded color, adjusted for the viewport
y | int The line number in the viewport |
x | int The character on that line |
Definition at line 1435 of file TextManager.cpp.
References LogicalCursor::line, m_managedText, LogicalCursor::pos, and toLogicalCursor().
Referenced by GenericTerminal::getProcNameSpace(), GenericTerminal::tab(), and GenericTerminal::update_changes().
string TextManager::getCurrentInputLine | ( | ) | const |
Returns the contents of the input line.
This member function will return the contents of the current user input line
Definition at line 889 of file TextManager.cpp.
References m_managedText.
Referenced by GenericTerminal::cursor_down(), GenericTerminal::cursor_up(), and NumeReTerminal::filterKeyCodes().
LogicalCursor TextManager::getCurrentLogicalPos | ( | ) | const |
Returns the current cursor position as logical cursor.
This function returns the current input cursor position (which is already a logical cursor). This position is extracted from the current position in the last line of the managed text
Definition at line 245 of file TextManager.cpp.
References m_managedText.
Referenced by GenericTerminal::delSelected(), getCurrentViewPos(), and GenericTerminal::normal_input().
ViewCursor TextManager::getCurrentViewPos | ( | ) | const |
Returns the current cursor position as view cursor.
This function returns the current input cursor position (which is a logical cursor) and returns it as a view cursor
Definition at line 198 of file TextManager.cpp.
References getCurrentLogicalPos(), m_renderedBlock, and toViewCursor().
Referenced by GenericTerminal::bs(), GenericTerminal::erase_usercontent_line(), GenericTerminal::move_cursor(), GenericTerminal::normal_input(), GenericTerminal::normal_output(), and GenericTerminal::ResizeTerminal().
int TextManager::GetHeight | ( | ) | const |
string TextManager::GetInputHistory | ( | bool | vcursorup = true | ) |
Get the next history line.
vcursorup | bool |
This member function gets the next history line depending on the bool vcursorup
Definition at line 1125 of file TextManager.cpp.
References m_managedText, and m_virtualCursor.
Referenced by GenericTerminal::cursor_down(), and GenericTerminal::cursor_up().
int TextManager::GetLinesReceived | ( | ) | const |
public GetLinesReceived Returns the number of lines received
Definition at line 1579 of file TextManager.cpp.
References m_renderedBlock.
Referenced by GenericTerminal::GetScrollHeight().
int TextManager::GetMaxSize | ( | ) | const |
Returns the buffer size of the terminal.
Definition at line 1591 of file TextManager.cpp.
References m_maxHeight.
Referenced by GenericTerminal::GetScrollHeight().
int TextManager::GetNumLinesScrolled | ( | ) | const |
public GetNumLinesScrolled Returns the number of lines scrolled upwards
Definition at line 1517 of file TextManager.cpp.
References m_numLinesScrolledUp.
Referenced by GenericTerminal::GetScrollPosition(), and GenericTerminal::IsScrolledUp().
string TextManager::getPreviousLine | ( | ) | const |
This member function returns the contents of the line before the current input line.
Definition at line 919 of file TextManager.cpp.
References m_managedText.
vector< unsigned short > TextManager::getRenderedColors | ( | size_t | viewLine | ) | const |
Return the rendered colors for the selected viewport line.
viewLine | size_t |
This function returns the colors for the rendered line, which goes into the selected viewLine. This function requires that the managed text is already rendered
Definition at line 289 of file TextManager.cpp.
References LogicalCursor::line, m_managedText, m_numLinesScrolledUp, m_renderedBlock, m_topLine, m_viewportHeight, LogicalCursor::pos, and GenericTerminal::SELECTED.
Referenced by GenericTerminal::handle_calltip(), and GenericTerminal::update_changes().
string TextManager::getRenderedString | ( | size_t | viewLine | ) | const |
Return the rendered line for the current viewport setting.
viewLine | size_t |
This function returns the rendered line, which goes into the selected viewLine. This function requires that the managed text is already rendered
Definition at line 268 of file TextManager.cpp.
References m_numLinesScrolledUp, m_renderedBlock, m_topLine, and m_viewportHeight.
Referenced by GenericTerminal::handle_calltip(), operator[](), and GenericTerminal::update_changes().
string TextManager::getSelectedText | ( | ) | const |
This member function returns the selected text.
Definition at line 852 of file TextManager.cpp.
References isSelected(), and m_managedText.
Referenced by GenericTerminal::get_selected_text().
int TextManager::GetSize | ( | ) | const |
public GetSize Returns the number of lines stored
Definition at line 1047 of file TextManager.cpp.
References m_managedText.
string TextManager::GetTextRange | ( | int | y, |
int | x0, | ||
int | x1 | ||
) | const |
Extracts the text between the positions.
y | int |
x0 | int |
x1 | int |
Definition at line 1213 of file TextManager.cpp.
References LogicalCursor::line, m_managedText, LogicalCursor::pos, and toLogicalCursor().
Referenced by GenericTerminal::getProcNameSpace().
string TextManager::GetWordAt | ( | int | y, |
int | x | ||
) | const |
Returns the word at the passed position.
y | int |
x | int |
This member function returns the word, which contains the character at (x,y)
Definition at line 1237 of file TextManager.cpp.
References LogicalCursor::line, m_managedText, LogicalCursor::pos, and toLogicalCursor().
string TextManager::GetWordStartAt | ( | int | y, |
int | x | ||
) | const |
Returns the word start at the passed position.
y | int |
x | int |
This member function returns the word start, which contains the character at (x,y)
Definition at line 1281 of file TextManager.cpp.
References LogicalCursor::line, m_managedText, LogicalCursor::pos, and toLogicalCursor().
Referenced by GenericTerminal::tab().
void TextManager::insertInput | ( | const std::string & | sLine, |
size_t | logicalpos = std::string::npos |
||
) |
This is the user input function.
sLine | const string& |
logicalpos | size_t |
Adds the passed stringt to the internal managed text, stores it as user-given text and triggers the rendering section
Definition at line 115 of file TextManager.cpp.
References EDITABLE_TEXT, m_managedText, renderLayout(), synchronizeRenderedBlock(), and updateColors().
Referenced by GenericTerminal::normal_input().
bool TextManager::IsEditable | ( | int | y, |
int | x | ||
) | const |
Determines, whether the character at (x,y) is editable text.
y | int |
x | int |
Definition at line 1372 of file TextManager.cpp.
References LogicalCursor::line, m_managedText, LogicalCursor::pos, and toLogicalCursor().
Referenced by GenericTerminal::bs(), GenericTerminal::cursor_down(), GenericTerminal::cursor_up(), GenericTerminal::del(), GenericTerminal::delSelected(), GenericTerminal::end(), GenericTerminal::erase_usercontent_line(), GenericTerminal::home(), and GenericTerminal::move_cursor_editable_area().
bool TextManager::IsEditableLogical | ( | const LogicalCursor & | logCursor | ) | const |
Determines, whether the character at the logical position is editable text.
logCursor | const LogicalCursor& |
Definition at line 1394 of file TextManager.cpp.
References LogicalCursor::line, m_managedText, and LogicalCursor::pos.
Referenced by GenericTerminal::back(), GenericTerminal::ctrl_left(), GenericTerminal::ctrl_right(), GenericTerminal::cursor_left(), GenericTerminal::cursor_right(), GenericTerminal::delSelected(), GenericTerminal::erase_usercontent_line(), and GenericTerminal::front().
bool TextManager::isSelected | ( | const ViewCursor & | viewCursor | ) | const |
Determines, whether the pointed character is selected.
viewCursor | const ViewCursor& |
This member function returns true, if the character pointed by the passed view cursor is selected
Definition at line 819 of file TextManager.cpp.
References isSelectedLogical(), and toLogicalCursor().
Referenced by GenericTerminal::delSelected(), getSelectedText(), and GenericTerminal::IsSelected().
bool TextManager::isSelectedLogical | ( | const LogicalCursor & | cursor | ) | const |
Determines, whether the pointed character is selected.
cursor | const LogicalCursor& |
Definition at line 835 of file TextManager.cpp.
References LogicalCursor::line, m_managedText, and LogicalCursor::pos.
Referenced by GenericTerminal::delSelected(), and isSelected().
bool TextManager::IsUserText | ( | int | y, |
int | x | ||
) | const |
Determines, whether the character at (x,y) is a user text.
y | int |
x | int |
Definition at line 1349 of file TextManager.cpp.
References LogicalCursor::line, m_managedText, LogicalCursor::pos, and toLogicalCursor().
void TextManager::newLine | ( | ) |
Adds a new line to the current managed text.
This function adds a new line to the internally managed text. If the managed text grows larger than the selected size, the first lines are dropped.
Definition at line 600 of file TextManager.cpp.
References EDITABLE_TEXT, m_managedText, m_maxHeight, renderLayout(), ResetVirtualCursorLine(), and synchronizeRenderedBlock().
Referenced by GenericTerminal::lf(), GenericTerminal::normal_output(), printOutput(), and tab().
string TextManager::operator[] | ( | int | index | ) |
public operator [] Allows access to a given line
index | int The index of the line to retrieve (0 to number of lines displayed) |
Definition at line 963 of file TextManager.cpp.
References getRenderedString().
void TextManager::printOutput | ( | const std::string & | sLine | ) |
This is the read-only print function.
sLine | const string& |
Adds the passed stringt to the internal managed text, stores it as read-only text and triggers the rendering section
Definition at line 76 of file TextManager.cpp.
References KERNEL_TEXT, m_managedText, newLine(), renderLayout(), synchronizeRenderedBlock(), and updateColors().
Referenced by GenericTerminal::normal_output().
|
private |
This function renders the layout.
This function renders the layout for the current terminal size using the internally managed text. The rendered layout is cached, so only the missing lines have to be re- calculated
Definition at line 381 of file TextManager.cpp.
References calc_color(), RenderedLine::colors, RenderedLine::coords, findNextLinebreak(), m_indentDepth, m_managedText, m_renderedBlock, m_topLine, m_viewportHeight, LogicalCursor::pos, RenderedLine::sLine, and toString().
Referenced by backspace(), clearRange(), eraseLine(), insertInput(), newLine(), printOutput(), and Resize().
void TextManager::Reset | ( | ) |
public Reset Clears out the text and resets everything
Definition at line 937 of file TextManager.cpp.
References m_bottomLine, m_indentDepth, m_linesReceived, m_managedText, m_maxHeight, m_numLinesScrolledUp, m_renderedBlock, m_tabLength, m_topLine, and m_viewportHeight.
Referenced by NumeReTerminal::clearTerminal(), GenericTerminal::reset(), TextManager(), and ~TextManager().
|
inline |
Definition at line 536 of file TextManager.h.
References m_managedText, and m_virtualCursor.
Referenced by newLine(), and GenericTerminal::resetAutoComp().
void TextManager::Resize | ( | int | width, |
int | height | ||
) |
public Resize Resizes the stored text to a given number of characters wide and high
width | int The new number of characters displayed |
height | int The new number of lines displayed |
Definition at line 1064 of file TextManager.cpp.
References LogicalCursor::line, m_numLinesScrolledUp, m_renderedBlock, m_topLine, m_viewportHeight, m_viewportWidth, LogicalCursor::pos, renderLayout(), and toLogicalCursor().
Referenced by GenericTerminal::ResizeTerminal().
bool TextManager::Scroll | ( | int | numLines, |
bool | scrollUp | ||
) |
public Scroll Scrolls the viewport the given number of lines up or down
numLines | int The number of lines to scroll |
scrollUp | bool True to scroll up, false to scroll down |
Definition at line 980 of file TextManager.cpp.
References m_numLinesScrolledUp, m_renderedBlock, m_topLine, and m_viewportHeight.
Referenced by GenericTerminal::Scroll().
void TextManager::selectText | ( | const ViewCursor & | viewCursor, |
bool | bSelect = true |
||
) |
Selects the text at the view cursor position.
viewCursor | const ViewCursor& |
bSelect | bool |
This member function is used to (de-)select the character at the position of the passed view cursor
Definition at line 775 of file TextManager.cpp.
References LogicalCursor::line, m_managedText, LogicalCursor::pos, and toLogicalCursor().
Referenced by GenericTerminal::Select().
void TextManager::SetColorAdjusted | ( | int | y, |
int | x, | ||
unsigned short | value | ||
) |
public SetColorAdjusted Sets an encoded color, adjusting the location for the viewport
y | int The line within the viewport |
x | int The character on that line |
value | unsigned short The new encoded color |
Definition at line 1460 of file TextManager.cpp.
References LogicalCursor::line, m_managedText, LogicalCursor::pos, and toLogicalCursor().
void TextManager::SetMaxSize | ( | int | newSize | ) |
public SetMaxSize Sets the maximum number of lines of history
newSize | int The new maximum size |
Definition at line 1533 of file TextManager.cpp.
References m_bottomLine, m_linesReceived, m_managedText, m_maxHeight, m_numLinesScrolledUp, m_renderedBlock, m_topLine, and m_viewportHeight.
Referenced by GenericTerminal::SetTerminalHistory().
|
private |
Removes parts of the already rendered block.
linesToDelete | int |
This private member function removes parts of the already rendered block depending on the number of lines to delete. The number of lines corresponds to the text lines in the managed block. If the number is positive, the lines are deleted from the front, if the number is negative, then the lines are deleted from the back
Definition at line 474 of file TextManager.cpp.
References date::abs(), and m_renderedBlock.
Referenced by backspace(), clearRange(), eraseLine(), insertInput(), newLine(), printOutput(), and tab().
size_t TextManager::tab | ( | ) |
Insert a tab character at the current position.
Definition at line 564 of file TextManager.cpp.
References m_managedText, m_tabLength, newLine(), and synchronizeRenderedBlock().
Referenced by GenericTerminal::normal_output().
LogicalCursor TextManager::toLogicalCursor | ( | const ViewCursor & | viewCursor | ) | const |
Convert a view cursor into a logical cursor.
viewCursor | const ViewCursor& |
This member function converts the passed view cursor (x,y) into a logical cursor (line,position) depending on the current viewport size.
Definition at line 219 of file TextManager.cpp.
References m_numLinesScrolledUp, m_renderedBlock, m_topLine, ViewCursor::x, and ViewCursor::y.
Referenced by GenericTerminal::back(), GenericTerminal::bs(), clearRange(), GenericTerminal::ctrl_left(), GenericTerminal::ctrl_right(), GenericTerminal::cursor_down(), GenericTerminal::cursor_left(), GenericTerminal::cursor_right(), GenericTerminal::cursor_up(), GenericTerminal::del(), GenericTerminal::delSelected(), GenericTerminal::erase_usercontent_line(), GenericTerminal::front(), GetCharAdjusted(), GetColorAdjusted(), GetTextRange(), GetWordAt(), GetWordStartAt(), IsEditable(), isSelected(), IsUserText(), GenericTerminal::move_cursor(), GenericTerminal::normal_input(), Resize(), GenericTerminal::ResizeTerminal(), selectText(), and SetColorAdjusted().
ViewCursor TextManager::toViewCursor | ( | const LogicalCursor & | logCursor | ) | const |
Convert a logical cursor to a view cursor.
logCursor | const LogicalCursor& |
This member function converts the passed logical cursor (line, position) into a view cursor (x, y) for the current viewport size.
Definition at line 144 of file TextManager.cpp.
References LogicalCursor::line, m_indentDepth, m_numLinesScrolledUp, m_renderedBlock, m_topLine, and LogicalCursor::pos.
Referenced by GenericTerminal::back(), GenericTerminal::bs(), GenericTerminal::ctrl_left(), GenericTerminal::ctrl_right(), GenericTerminal::cursor_left(), GenericTerminal::cursor_right(), GenericTerminal::delSelected(), GenericTerminal::erase_usercontent_line(), GenericTerminal::front(), getCurrentViewPos(), GenericTerminal::normal_input(), and GenericTerminal::ResizeTerminal().
void TextManager::unselectAll | ( | ) |
This member function unselects the whole text at once.
Definition at line 798 of file TextManager.cpp.
References m_managedText.
Referenced by NumeReTerminal::ClearSelection(), and NumeReTerminal::MarkSelection().
|
private |
Update the colors for the current line.
isErrorLine | bool |
This function determines the text snippets in the last line of the managed text and creates a color string for those snippets
Definition at line 337 of file TextManager.cpp.
References GenericTerminal::BOLD, calc_color(), GenericTerminal::getSyntax(), NumeReSyntax::highlightError(), NumeReSyntax::highlightLine(), m_managedText, m_parent, NumeReSyntax::SYNTAX_COMMAND, NumeReSyntax::SYNTAX_COMMENT, NumeReSyntax::SYNTAX_CONSTANT, NumeReSyntax::SYNTAX_FUNCTION, NumeReSyntax::SYNTAX_METHODS, NumeReSyntax::SYNTAX_PROCEDURE, NumeReSyntax::SYNTAX_SPECIALVAL, and GenericTerminal::UNDERLINE.
Referenced by backspace(), clearRange(), insertInput(), and printOutput().
|
private |
Definition at line 554 of file TextManager.h.
Referenced by Reset(), and SetMaxSize().
|
private |
Definition at line 564 of file TextManager.h.
Referenced by findNextLinebreak(), renderLayout(), Reset(), and toViewCursor().
|
private |
Definition at line 558 of file TextManager.h.
Referenced by Reset(), and SetMaxSize().
|
private |
Definition at line 566 of file TextManager.h.
Referenced by backspace(), ChangeEditableState(), clearRange(), eraseLine(), GetCharLogical(), GetColor(), GetColorAdjusted(), getCurrentInputLine(), getCurrentLogicalPos(), GetInputHistory(), getPreviousLine(), getRenderedColors(), getSelectedText(), GetSize(), GetTextRange(), GetWordAt(), GetWordStartAt(), insertInput(), IsEditable(), IsEditableLogical(), isSelectedLogical(), IsUserText(), newLine(), printOutput(), renderLayout(), Reset(), ResetVirtualCursorLine(), selectText(), SetColorAdjusted(), SetMaxSize(), tab(), unselectAll(), and updateColors().
|
private |
Definition at line 560 of file TextManager.h.
Referenced by GetMaxSize(), newLine(), Reset(), and SetMaxSize().
|
private |
Definition at line 559 of file TextManager.h.
|
private |
Definition at line 555 of file TextManager.h.
Referenced by AdjustIndex(), GetNumLinesScrolled(), getRenderedColors(), getRenderedString(), Reset(), Resize(), Scroll(), SetMaxSize(), toLogicalCursor(), and toViewCursor().
|
private |
Definition at line 551 of file TextManager.h.
Referenced by TextManager(), and updateColors().
|
private |
Definition at line 567 of file TextManager.h.
Referenced by getCurrentViewPos(), GetLinesReceived(), getRenderedColors(), getRenderedString(), renderLayout(), Reset(), Resize(), Scroll(), SetMaxSize(), synchronizeRenderedBlock(), toLogicalCursor(), and toViewCursor().
|
private |
Definition at line 563 of file TextManager.h.
|
private |
Definition at line 553 of file TextManager.h.
Referenced by AdjustIndex(), getRenderedColors(), getRenderedString(), renderLayout(), Reset(), Resize(), Scroll(), SetMaxSize(), toLogicalCursor(), and toViewCursor().
|
private |
Definition at line 557 of file TextManager.h.
Referenced by getRenderedColors(), getRenderedString(), renderLayout(), Reset(), Resize(), Scroll(), and SetMaxSize().
|
private |
Definition at line 556 of file TextManager.h.
Referenced by findNextLinebreak(), and Resize().
|
private |
Definition at line 561 of file TextManager.h.
Referenced by GetInputHistory(), and ResetVirtualCursorLine().