yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
TextEditor Class Reference

#include <text_editor.h>

Collaboration diagram for TextEditor:

Classes

struct  Breakpoint
 
struct  Coordinates
 
struct  EditorState
 
struct  Glyph
 
struct  Identifier
 
struct  LanguageDefinition
 
class  UndoRecord
 

Public Types

enum class  PaletteIndex {
  Default , Keyword , Number , String ,
  CharLiteral , Punctuation , Preprocessor , Identifier ,
  KnownIdentifier , PreprocIdentifier , Comment , MultiLineComment ,
  Background , Cursor , Selection , ErrorMarker ,
  Breakpoint , LineNumber , CurrentLineFill , CurrentLineFillInactive ,
  CurrentLineEdge , Max
}
 
enum class  SelectionMode { Normal , Word , Line }
 
typedef std::string String
 
typedef std::unordered_map< std::string, IdentifierIdentifiers
 
typedef std::unordered_set< std::string > Keywords
 
typedef std::map< int, std::string > ErrorMarkers
 
typedef std::unordered_set< int > Breakpoints
 
typedef std::array< ImU32,(unsigned) PaletteIndex::MaxPalette
 
typedef uint8_t Char
 
typedef std::vector< GlyphLine
 
typedef std::vector< LineLines
 

Public Member Functions

 TextEditor ()
 
 ~TextEditor ()
 
void SetLanguageDefinition (const LanguageDefinition &aLanguageDef)
 
const LanguageDefinitionGetLanguageDefinition () const
 
const PaletteGetPalette () const
 
void SetPalette (const Palette &aValue)
 
void SetErrorMarkers (const ErrorMarkers &aMarkers)
 
void SetBreakpoints (const Breakpoints &aMarkers)
 
void Render (const char *aTitle, const ImVec2 &aSize=ImVec2(), bool aBorder=false)
 
void SetText (const std::string &aText)
 
std::string GetText () const
 
void SetTextLines (const std::vector< std::string > &aLines)
 
std::vector< std::string > GetTextLines () const
 
std::string GetSelectedText () const
 
std::string GetCurrentLineText () const
 
int GetTotalLines () const
 
bool IsOverwrite () const
 
void SetReadOnly (bool aValue)
 
bool IsReadOnly () const
 
bool IsTextChanged () const
 
bool IsCursorPositionChanged () const
 
bool IsColorizerEnabled () const
 
void SetColorizerEnable (bool aValue)
 
Coordinates GetCursorPosition () const
 
void SetCursorPosition (const Coordinates &aPosition)
 
void SetHandleMouseInputs (bool aValue)
 
bool IsHandleMouseInputsEnabled () const
 
void SetHandleKeyboardInputs (bool aValue)
 
bool IsHandleKeyboardInputsEnabled () const
 
void SetImGuiChildIgnored (bool aValue)
 
bool IsImGuiChildIgnored () const
 
void SetShowWhitespaces (bool aValue)
 
bool IsShowingWhitespaces () const
 
void SetTabSize (int aValue)
 
int GetTabSize () const
 
void InsertText (const std::string &aValue)
 
void InsertText (const char *aValue)
 
void MoveUp (int aAmount=1, bool aSelect=false)
 
void MoveDown (int aAmount=1, bool aSelect=false)
 
void MoveLeft (int aAmount=1, bool aSelect=false, bool aWordMode=false)
 
void MoveRight (int aAmount=1, bool aSelect=false, bool aWordMode=false)
 
void MoveTop (bool aSelect=false)
 
void MoveBottom (bool aSelect=false)
 
void MoveHome (bool aSelect=false)
 
void MoveEnd (bool aSelect=false)
 
void SetSelectionStart (const Coordinates &aPosition)
 
void SetSelectionEnd (const Coordinates &aPosition)
 
void SetSelection (const Coordinates &aStart, const Coordinates &aEnd, SelectionMode aMode=SelectionMode::Normal)
 
void SelectWordUnderCursor ()
 
void SelectAll ()
 
bool HasSelection () const
 
void Copy ()
 
void Cut ()
 
void Paste ()
 
void Delete ()
 
bool CanUndo () const
 
bool CanRedo () const
 
void Undo (int aSteps=1)
 
void Redo (int aSteps=1)
 

Static Public Member Functions

static const PaletteGetDarkPalette ()
 
static const PaletteGetLightPalette ()
 
static const PaletteGetRetroBluePalette ()
 

Private Types

typedef std::vector< std::pair< std::regex, PaletteIndex > > RegexList
 
typedef std::vector< UndoRecordUndoBuffer
 

Private Member Functions

void ProcessInputs ()
 
void Colorize (int aFromLine=0, int aCount=-1)
 
void ColorizeRange (int aFromLine=0, int aToLine=0)
 
void ColorizeInternal ()
 
float TextDistanceToLineStart (const Coordinates &aFrom) const
 
void EnsureCursorVisible ()
 
int GetPageSize () const
 
std::string GetText (const Coordinates &aStart, const Coordinates &aEnd) const
 
Coordinates GetActualCursorCoordinates () const
 
Coordinates SanitizeCoordinates (const Coordinates &aValue) const
 
void Advance (Coordinates &aCoordinates) const
 
void DeleteRange (const Coordinates &aStart, const Coordinates &aEnd)
 
int InsertTextAt (Coordinates &aWhere, const char *aValue)
 
void AddUndo (UndoRecord &aValue)
 
Coordinates ScreenPosToCoordinates (const ImVec2 &aPosition) const
 
Coordinates FindWordStart (const Coordinates &aFrom) const
 
Coordinates FindWordEnd (const Coordinates &aFrom) const
 
Coordinates FindNextWord (const Coordinates &aFrom) const
 
int GetCharacterIndex (const Coordinates &aCoordinates) const
 
int GetCharacterColumn (int aLine, int aIndex) const
 
int GetLineCharacterCount (int aLine) const
 
int GetLineMaxColumn (int aLine) const
 
bool IsOnWordBoundary (const Coordinates &aAt) const
 
void RemoveLine (int aStart, int aEnd)
 
void RemoveLine (int aIndex)
 
LineInsertLine (int aIndex)
 
void EnterCharacter (ImWchar aChar, bool aShift)
 
void Backspace ()
 
void DeleteSelection ()
 
std::string GetWordUnderCursor () const
 
std::string GetWordAt (const Coordinates &aCoords) const
 
ImU32 GetGlyphColor (const Glyph &aGlyph) const
 
void HandleKeyboardInputs ()
 
void HandleMouseInputs ()
 
void Render ()
 

Private Attributes

float mLineSpacing
 
Lines mLines
 
EditorState mState
 
UndoBuffer mUndoBuffer
 
int mUndoIndex
 
int mTabSize
 
bool mOverwrite
 
bool mReadOnly
 
bool mWithinRender
 
bool mScrollToCursor
 
bool mScrollToTop
 
bool mTextChanged
 
bool mColorizerEnabled
 
float mTextStart
 
int mLeftMargin
 
bool mCursorPositionChanged
 
int mColorRangeMin
 
int mColorRangeMax
 
SelectionMode mSelectionMode
 
bool mHandleKeyboardInputs
 
bool mHandleMouseInputs
 
bool mIgnoreImGuiChild
 
bool mShowWhitespaces
 
Palette mPaletteBase
 
Palette mPalette
 
LanguageDefinition mLanguageDefinition
 
RegexList mRegexList
 
bool mCheckComments
 
Breakpoints mBreakpoints
 
ErrorMarkers mErrorMarkers
 
ImVec2 mCharAdvance
 
Coordinates mInteractiveStart
 
Coordinates mInteractiveEnd
 
std::string mLineBuffer
 
uint64_t mStartTime
 
float mLastClick
 

Detailed Description

Definition at line 17 of file text_editor.h.

Member Typedef Documentation

◆ String

typedef std::string TextEditor::String

Definition at line 112 of file text_editor.h.

◆ Identifiers

typedef std::unordered_map<std::string, Identifier> TextEditor::Identifiers

Definition at line 113 of file text_editor.h.

◆ Keywords

typedef std::unordered_set<std::string> TextEditor::Keywords

Definition at line 114 of file text_editor.h.

◆ ErrorMarkers

typedef std::map<int, std::string> TextEditor::ErrorMarkers

Definition at line 115 of file text_editor.h.

◆ Breakpoints

typedef std::unordered_set<int> TextEditor::Breakpoints

Definition at line 116 of file text_editor.h.

◆ Palette

typedef std::array<ImU32, (unsigned)PaletteIndex::Max> TextEditor::Palette

Definition at line 117 of file text_editor.h.

◆ Char

typedef uint8_t TextEditor::Char

Definition at line 118 of file text_editor.h.

◆ Line

typedef std::vector<Glyph> TextEditor::Line

Definition at line 135 of file text_editor.h.

◆ Lines

typedef std::vector<Line> TextEditor::Lines

Definition at line 136 of file text_editor.h.

◆ RegexList

typedef std::vector<std::pair<std::regex, PaletteIndex> > TextEditor::RegexList
private

Definition at line 272 of file text_editor.h.

◆ UndoBuffer

typedef std::vector<UndoRecord> TextEditor::UndoBuffer
private

Definition at line 311 of file text_editor.h.

Member Enumeration Documentation

◆ PaletteIndex

enum class TextEditor::PaletteIndex
strong
Enumerator
Default 
Keyword 
Number 
String 
CharLiteral 
Punctuation 
Preprocessor 
Identifier 
KnownIdentifier 
PreprocIdentifier 
Comment 
MultiLineComment 
Background 
Cursor 
Selection 
ErrorMarker 
Breakpoint 
LineNumber 
CurrentLineFill 
CurrentLineFillInactive 
CurrentLineEdge 
Max 

Definition at line 19 of file text_editor.h.

◆ SelectionMode

enum class TextEditor::SelectionMode
strong
Enumerator
Normal 
Word 
Line 

Definition at line 44 of file text_editor.h.

Constructor & Destructor Documentation

◆ TextEditor()

TextEditor::TextEditor ( )

Definition at line 25 of file text_editor.cc.

References GetDarkPalette(), TextEditor::LanguageDefinition::HLSL(), mLines, SetLanguageDefinition(), and SetPalette().

Here is the call graph for this function:

◆ ~TextEditor()

TextEditor::~TextEditor ( )

Definition at line 56 of file text_editor.cc.

Member Function Documentation

◆ SetLanguageDefinition()

void TextEditor::SetLanguageDefinition ( const LanguageDefinition & aLanguageDef)

◆ GetLanguageDefinition()

const LanguageDefinition & TextEditor::GetLanguageDefinition ( ) const
inline

◆ GetPalette()

const Palette & TextEditor::GetPalette ( ) const
inline

Definition at line 183 of file text_editor.h.

References mPaletteBase.

◆ SetPalette()

void TextEditor::SetPalette ( const Palette & aValue)

Definition at line 69 of file text_editor.cc.

References mPaletteBase.

Referenced by yaze::editor::AssemblyEditor::AssemblyEditor(), and TextEditor().

◆ SetErrorMarkers()

void TextEditor::SetErrorMarkers ( const ErrorMarkers & aMarkers)
inline

Definition at line 186 of file text_editor.h.

References mErrorMarkers.

◆ SetBreakpoints()

void TextEditor::SetBreakpoints ( const Breakpoints & aMarkers)
inline

Definition at line 189 of file text_editor.h.

References mBreakpoints.

◆ Render() [1/2]

void TextEditor::Render ( const char * aTitle,
const ImVec2 & aSize = ImVec2(),
bool aBorder = false )

◆ SetText()

void TextEditor::SetText ( const std::string & aText)

Definition at line 1128 of file text_editor.cc.

References Colorize(), Default, mLines, mScrollToTop, mTextChanged, mUndoBuffer, and mUndoIndex.

Referenced by yaze::editor::ProjectFileEditor::LoadFile(), and yaze::editor::ProjectFileEditor::NewFile().

Here is the call graph for this function:

◆ GetText() [1/2]

std::string TextEditor::GetText ( ) const

◆ SetTextLines()

void TextEditor::SetTextLines ( const std::vector< std::string > & aLines)

Definition at line 1150 of file text_editor.cc.

References Colorize(), Default, mLines, mScrollToTop, mTextChanged, mUndoBuffer, and mUndoIndex.

Here is the call graph for this function:

◆ GetTextLines()

std::vector< std::string > TextEditor::GetTextLines ( ) const

Definition at line 1958 of file text_editor.cc.

References mLines.

◆ GetSelectedText()

std::string TextEditor::GetSelectedText ( ) const

Definition at line 1977 of file text_editor.cc.

References GetText(), TextEditor::EditorState::mSelectionEnd, TextEditor::EditorState::mSelectionStart, and mState.

Referenced by Backspace(), Copy(), Cut(), Delete(), EnterCharacter(), and Paste().

Here is the call graph for this function:

◆ GetCurrentLineText()

std::string TextEditor::GetCurrentLineText ( ) const

Definition at line 1981 of file text_editor.cc.

References GetLineMaxColumn(), GetText(), TextEditor::EditorState::mCursorPosition, TextEditor::Coordinates::mLine, and mState.

Here is the call graph for this function:

◆ GetTotalLines()

int TextEditor::GetTotalLines ( ) const
inline

◆ IsOverwrite()

bool TextEditor::IsOverwrite ( ) const
inline

◆ SetReadOnly()

void TextEditor::SetReadOnly ( bool aValue)

Definition at line 1336 of file text_editor.cc.

References mReadOnly.

◆ IsReadOnly()

bool TextEditor::IsReadOnly ( ) const
inline

Definition at line 206 of file text_editor.h.

References mReadOnly.

Referenced by Cut(), HandleKeyboardInputs(), and Paste().

◆ IsTextChanged()

bool TextEditor::IsTextChanged ( ) const
inline

Definition at line 207 of file text_editor.h.

References mTextChanged.

Referenced by yaze::editor::ProjectFileEditor::IsModified().

◆ IsCursorPositionChanged()

bool TextEditor::IsCursorPositionChanged ( ) const
inline

Definition at line 208 of file text_editor.h.

References mCursorPositionChanged.

◆ IsColorizerEnabled()

bool TextEditor::IsColorizerEnabled ( ) const
inline

Definition at line 210 of file text_editor.h.

References mColorizerEnabled.

◆ SetColorizerEnable()

void TextEditor::SetColorizerEnable ( bool aValue)

Definition at line 1340 of file text_editor.cc.

References mColorizerEnabled.

◆ GetCursorPosition()

Coordinates TextEditor::GetCursorPosition ( ) const
inline

◆ SetCursorPosition()

void TextEditor::SetCursorPosition ( const Coordinates & aPosition)

◆ SetHandleMouseInputs()

void TextEditor::SetHandleMouseInputs ( bool aValue)
inline

Definition at line 216 of file text_editor.h.

References mHandleMouseInputs.

◆ IsHandleMouseInputsEnabled()

bool TextEditor::IsHandleMouseInputsEnabled ( ) const
inline

Definition at line 217 of file text_editor.h.

References mHandleKeyboardInputs.

◆ SetHandleKeyboardInputs()

void TextEditor::SetHandleKeyboardInputs ( bool aValue)
inline

Definition at line 221 of file text_editor.h.

References mHandleKeyboardInputs.

◆ IsHandleKeyboardInputsEnabled()

bool TextEditor::IsHandleKeyboardInputsEnabled ( ) const
inline

Definition at line 224 of file text_editor.h.

References mHandleKeyboardInputs.

◆ SetImGuiChildIgnored()

void TextEditor::SetImGuiChildIgnored ( bool aValue)
inline

Definition at line 228 of file text_editor.h.

References mIgnoreImGuiChild.

◆ IsImGuiChildIgnored()

bool TextEditor::IsImGuiChildIgnored ( ) const
inline

Definition at line 229 of file text_editor.h.

References mIgnoreImGuiChild.

◆ SetShowWhitespaces()

void TextEditor::SetShowWhitespaces ( bool aValue)
inline

◆ IsShowingWhitespaces()

bool TextEditor::IsShowingWhitespaces ( ) const
inline

Definition at line 232 of file text_editor.h.

References mShowWhitespaces.

◆ SetTabSize()

void TextEditor::SetTabSize ( int aValue)

Definition at line 1400 of file text_editor.cc.

References mTabSize.

Referenced by yaze::editor::ProjectFileEditor::ProjectFileEditor().

◆ GetTabSize()

int TextEditor::GetTabSize ( ) const
inline

Definition at line 235 of file text_editor.h.

References mTabSize.

◆ InsertText() [1/2]

void TextEditor::InsertText ( const std::string & aValue)

Definition at line 1404 of file text_editor.cc.

References InsertText().

Referenced by InsertText(), and Paste().

Here is the call graph for this function:

◆ InsertText() [2/2]

void TextEditor::InsertText ( const char * aValue)

◆ MoveUp()

void TextEditor::MoveUp ( int aAmount = 1,
bool aSelect = false )

◆ MoveDown()

void TextEditor::MoveDown ( int aAmount = 1,
bool aSelect = false )

◆ MoveLeft()

◆ MoveRight()

◆ MoveTop()

void TextEditor::MoveTop ( bool aSelect = false)

Definition at line 1590 of file text_editor.cc.

References TextEditor::EditorState::mCursorPosition, mInteractiveEnd, mInteractiveStart, mState, SetCursorPosition(), and SetSelection().

Referenced by HandleKeyboardInputs().

Here is the call graph for this function:

◆ MoveBottom()

void TextEditor::MoveBottom ( bool aSelect = false)

Referenced by HandleKeyboardInputs().

◆ MoveHome()

void TextEditor::MoveHome ( bool aSelect = false)

◆ MoveEnd()

void TextEditor::MoveEnd ( bool aSelect = false)

◆ SetSelectionStart()

void TextEditor::SetSelectionStart ( const Coordinates & aPosition)

Definition at line 1352 of file text_editor.cc.

References TextEditor::EditorState::mSelectionEnd, TextEditor::EditorState::mSelectionStart, mState, and SanitizeCoordinates().

Here is the call graph for this function:

◆ SetSelectionEnd()

void TextEditor::SetSelectionEnd ( const Coordinates & aPosition)

Definition at line 1358 of file text_editor.cc.

References TextEditor::EditorState::mSelectionEnd, TextEditor::EditorState::mSelectionStart, mState, and SanitizeCoordinates().

Here is the call graph for this function:

◆ SetSelection()

◆ SelectWordUnderCursor()

void TextEditor::SelectWordUnderCursor ( )

Definition at line 1781 of file text_editor.cc.

References FindWordEnd(), FindWordStart(), GetCursorPosition(), and SetSelection().

Here is the call graph for this function:

◆ SelectAll()

void TextEditor::SelectAll ( )

Definition at line 1786 of file text_editor.cc.

References mLines, and SetSelection().

Referenced by HandleKeyboardInputs().

Here is the call graph for this function:

◆ HasSelection()

bool TextEditor::HasSelection ( ) const

◆ Copy()

void TextEditor::Copy ( )

◆ Cut()

◆ Paste()

◆ Delete()

◆ CanUndo()

bool TextEditor::CanUndo ( ) const

◆ CanRedo()

bool TextEditor::CanRedo ( ) const

Definition at line 1859 of file text_editor.cc.

References mReadOnly, mUndoBuffer, and mUndoIndex.

Referenced by Redo().

◆ Undo()

void TextEditor::Undo ( int aSteps = 1)

Definition at line 1863 of file text_editor.cc.

References CanUndo(), mUndoBuffer, and mUndoIndex.

Referenced by yaze::editor::AssemblyEditor::DrawEditMenu(), HandleKeyboardInputs(), and yaze::editor::AssemblyEditor::Undo().

Here is the call graph for this function:

◆ Redo()

void TextEditor::Redo ( int aSteps = 1)

Definition at line 1868 of file text_editor.cc.

References CanRedo(), mUndoBuffer, and mUndoIndex.

Referenced by yaze::editor::AssemblyEditor::DrawEditMenu(), HandleKeyboardInputs(), and yaze::editor::AssemblyEditor::Redo().

Here is the call graph for this function:

◆ GetDarkPalette()

const TextEditor::Palette & TextEditor::GetDarkPalette ( )
static

◆ GetLightPalette()

const TextEditor::Palette & TextEditor::GetLightPalette ( )
static

Definition at line 1900 of file text_editor.cc.

◆ GetRetroBluePalette()

const TextEditor::Palette & TextEditor::GetRetroBluePalette ( )
static

Definition at line 1927 of file text_editor.cc.

◆ ProcessInputs()

void TextEditor::ProcessInputs ( )
private

Definition at line 1987 of file text_editor.cc.

◆ Colorize()

void TextEditor::Colorize ( int aFromLine = 0,
int aCount = -1 )
private

◆ ColorizeRange()

◆ ColorizeInternal()

◆ TextDistanceToLineStart()

float TextEditor::TextDistanceToLineStart ( const Coordinates & aFrom) const
private

Definition at line 2225 of file text_editor.cc.

References GetCharacterIndex(), TextEditor::Coordinates::mLine, mLines, and mTabSize.

Referenced by EnsureCursorVisible(), and Render().

Here is the call graph for this function:

◆ EnsureCursorVisible()

void TextEditor::EnsureCursorVisible ( )
private

◆ GetPageSize()

int TextEditor::GetPageSize ( ) const
private

Definition at line 2289 of file text_editor.cc.

References mCharAdvance.

Referenced by HandleKeyboardInputs().

◆ GetText() [2/2]

std::string TextEditor::GetText ( const Coordinates & aStart,
const Coordinates & aEnd ) const
private

Definition at line 73 of file text_editor.cc.

References GetCharacterIndex(), TextEditor::Coordinates::mLine, and mLines.

Here is the call graph for this function:

◆ GetActualCursorCoordinates()

TextEditor::Coordinates TextEditor::GetActualCursorCoordinates ( ) const
private

Definition at line 106 of file text_editor.cc.

References TextEditor::EditorState::mCursorPosition, mState, and SanitizeCoordinates().

Referenced by Backspace(), Copy(), Delete(), EnsureCursorVisible(), EnterCharacter(), GetCursorPosition(), InsertText(), MoveLeft(), and Paste().

Here is the call graph for this function:

◆ SanitizeCoordinates()

TextEditor::Coordinates TextEditor::SanitizeCoordinates ( const Coordinates & aValue) const
private

◆ Advance()

void TextEditor::Advance ( Coordinates & aCoordinates) const
private

Definition at line 182 of file text_editor.cc.

References GetCharacterColumn(), GetCharacterIndex(), TextEditor::Coordinates::mColumn, TextEditor::Coordinates::mLine, and mLines.

Referenced by Backspace(), and Delete().

Here is the call graph for this function:

◆ DeleteRange()

void TextEditor::DeleteRange ( const Coordinates & aStart,
const Coordinates & aEnd )
private

◆ InsertTextAt()

int TextEditor::InsertTextAt ( Coordinates & aWhere,
const char * aValue )
private

◆ AddUndo()

void TextEditor::AddUndo ( UndoRecord & aValue)
private

Definition at line 277 of file text_editor.cc.

References mReadOnly, mUndoBuffer, and mUndoIndex.

Referenced by Backspace(), Cut(), Delete(), EnterCharacter(), and Paste().

◆ ScreenPosToCoordinates()

TextEditor::Coordinates TextEditor::ScreenPosToCoordinates ( const ImVec2 & aPosition) const
private

Definition at line 295 of file text_editor.cc.

References mCharAdvance, mLines, mTabSize, mTextStart, and SanitizeCoordinates().

Referenced by HandleMouseInputs(), and Render().

Here is the call graph for this function:

◆ FindWordStart()

TextEditor::Coordinates TextEditor::FindWordStart ( const Coordinates & aFrom) const
private

Definition at line 350 of file text_editor.cc.

References GetCharacterColumn(), GetCharacterIndex(), TextEditor::Coordinates::mLine, and mLines.

Referenced by GetWordAt(), MoveLeft(), SelectWordUnderCursor(), and SetSelection().

Here is the call graph for this function:

◆ FindWordEnd()

TextEditor::Coordinates TextEditor::FindWordEnd ( const Coordinates & aFrom) const
private

Definition at line 382 of file text_editor.cc.

References GetCharacterColumn(), GetCharacterIndex(), TextEditor::Coordinates::mLine, and mLines.

Referenced by GetWordAt(), SelectWordUnderCursor(), and SetSelection().

Here is the call graph for this function:

◆ FindNextWord()

TextEditor::Coordinates TextEditor::FindNextWord ( const Coordinates & aFrom) const
private

Definition at line 413 of file text_editor.cc.

References GetCharacterColumn(), GetCharacterIndex(), GetLineMaxColumn(), TextEditor::Coordinates::mLine, and mLines.

Referenced by MoveRight().

Here is the call graph for this function:

◆ GetCharacterIndex()

◆ GetCharacterColumn()

int TextEditor::GetCharacterColumn ( int aLine,
int aIndex ) const
private

Definition at line 473 of file text_editor.cc.

References mLines, and mTabSize.

Referenced by Advance(), EnterCharacter(), FindNextWord(), FindWordEnd(), FindWordStart(), MoveLeft(), and MoveRight().

◆ GetLineCharacterCount()

int TextEditor::GetLineCharacterCount ( int aLine) const
private

Definition at line 490 of file text_editor.cc.

References mLines.

◆ GetLineMaxColumn()

int TextEditor::GetLineMaxColumn ( int aLine) const
private

◆ IsOnWordBoundary()

bool TextEditor::IsOnWordBoundary ( const Coordinates & aAt) const
private

Definition at line 516 of file text_editor.cc.

References GetCharacterIndex(), mColorizerEnabled, TextEditor::Coordinates::mColumn, TextEditor::Coordinates::mLine, and mLines.

Referenced by SetSelection().

Here is the call graph for this function:

◆ RemoveLine() [1/2]

void TextEditor::RemoveLine ( int aStart,
int aEnd )
private

Definition at line 531 of file text_editor.cc.

References mBreakpoints, mErrorMarkers, mLines, mReadOnly, and mTextChanged.

Referenced by Backspace(), Delete(), and DeleteRange().

◆ RemoveLine() [2/2]

void TextEditor::RemoveLine ( int aIndex)
private

Definition at line 560 of file text_editor.cc.

References mBreakpoints, mErrorMarkers, mLines, mReadOnly, and mTextChanged.

◆ InsertLine()

TextEditor::Line & TextEditor::InsertLine ( int aIndex)
private

Definition at line 588 of file text_editor.cc.

References mBreakpoints, mErrorMarkers, mLines, and mReadOnly.

Referenced by EnterCharacter(), and InsertTextAt().

◆ EnterCharacter()

◆ Backspace()

◆ DeleteSelection()

void TextEditor::DeleteSelection ( )
private

◆ GetWordUnderCursor()

std::string TextEditor::GetWordUnderCursor ( ) const
private

Definition at line 607 of file text_editor.cc.

References GetCursorPosition(), and GetWordAt().

Here is the call graph for this function:

◆ GetWordAt()

std::string TextEditor::GetWordAt ( const Coordinates & aCoords) const
private

Definition at line 612 of file text_editor.cc.

References FindWordEnd(), FindWordStart(), GetCharacterIndex(), TextEditor::Coordinates::mLine, and mLines.

Referenced by GetWordUnderCursor(), and Render().

Here is the call graph for this function:

◆ GetGlyphColor()

◆ HandleKeyboardInputs()

void TextEditor::HandleKeyboardInputs ( )
private

◆ HandleMouseInputs()

void TextEditor::HandleMouseInputs ( )
private

Definition at line 731 of file text_editor.cc.

References Line, TextEditor::EditorState::mCursorPosition, mInteractiveEnd, mInteractiveStart, mLastClick, mSelectionMode, mState, Normal, ScreenPosToCoordinates(), SetSelection(), and Word.

Referenced by Render().

Here is the call graph for this function:

◆ Render() [2/2]

Member Data Documentation

◆ mLineSpacing

float TextEditor::mLineSpacing
private

Definition at line 350 of file text_editor.h.

Referenced by Render().

◆ mLines

◆ mState

◆ mUndoBuffer

UndoBuffer TextEditor::mUndoBuffer
private

Definition at line 353 of file text_editor.h.

Referenced by AddUndo(), CanRedo(), Redo(), SetText(), SetTextLines(), and Undo().

◆ mUndoIndex

int TextEditor::mUndoIndex
private

Definition at line 354 of file text_editor.h.

Referenced by AddUndo(), CanRedo(), CanUndo(), Redo(), SetText(), SetTextLines(), and Undo().

◆ mTabSize

◆ mOverwrite

bool TextEditor::mOverwrite
private

Definition at line 357 of file text_editor.h.

Referenced by EnterCharacter(), HandleKeyboardInputs(), IsOverwrite(), and Render().

◆ mReadOnly

◆ mWithinRender

bool TextEditor::mWithinRender
private

Definition at line 359 of file text_editor.h.

Referenced by EnsureCursorVisible(), and Render().

◆ mScrollToCursor

bool TextEditor::mScrollToCursor
private

Definition at line 360 of file text_editor.h.

Referenced by EnsureCursorVisible(), and Render().

◆ mScrollToTop

bool TextEditor::mScrollToTop
private

Definition at line 361 of file text_editor.h.

Referenced by Render(), SetText(), and SetTextLines().

◆ mTextChanged

bool TextEditor::mTextChanged
private

◆ mColorizerEnabled

bool TextEditor::mColorizerEnabled
private

◆ mTextStart

float TextEditor::mTextStart
private

Definition at line 364 of file text_editor.h.

Referenced by EnsureCursorVisible(), Render(), and ScreenPosToCoordinates().

◆ mLeftMargin

int TextEditor::mLeftMargin
private

Definition at line 366 of file text_editor.h.

Referenced by Render().

◆ mCursorPositionChanged

bool TextEditor::mCursorPositionChanged
private

Definition at line 367 of file text_editor.h.

Referenced by IsCursorPositionChanged(), Render(), SetCursorPosition(), and SetSelection().

◆ mColorRangeMin

int TextEditor::mColorRangeMin
private

Definition at line 368 of file text_editor.h.

Referenced by Colorize(), and ColorizeInternal().

◆ mColorRangeMax

int TextEditor::mColorRangeMax
private

Definition at line 368 of file text_editor.h.

Referenced by Colorize(), and ColorizeInternal().

◆ mSelectionMode

SelectionMode TextEditor::mSelectionMode
private

Definition at line 369 of file text_editor.h.

Referenced by HandleMouseInputs().

◆ mHandleKeyboardInputs

bool TextEditor::mHandleKeyboardInputs
private

◆ mHandleMouseInputs

bool TextEditor::mHandleMouseInputs
private

Definition at line 371 of file text_editor.h.

Referenced by Render(), and SetHandleMouseInputs().

◆ mIgnoreImGuiChild

bool TextEditor::mIgnoreImGuiChild
private

Definition at line 372 of file text_editor.h.

Referenced by IsImGuiChildIgnored(), Render(), and SetImGuiChildIgnored().

◆ mShowWhitespaces

bool TextEditor::mShowWhitespaces
private

Definition at line 373 of file text_editor.h.

Referenced by IsShowingWhitespaces(), Render(), and SetShowWhitespaces().

◆ mPaletteBase

Palette TextEditor::mPaletteBase
private

Definition at line 375 of file text_editor.h.

Referenced by GetPalette(), Render(), and SetPalette().

◆ mPalette

Palette TextEditor::mPalette
private

Definition at line 376 of file text_editor.h.

Referenced by GetGlyphColor(), Render(), and Render().

◆ mLanguageDefinition

LanguageDefinition TextEditor::mLanguageDefinition
private

◆ mRegexList

RegexList TextEditor::mRegexList
private

Definition at line 378 of file text_editor.h.

Referenced by ColorizeRange(), and SetLanguageDefinition().

◆ mCheckComments

bool TextEditor::mCheckComments
private

Definition at line 380 of file text_editor.h.

Referenced by Colorize(), and ColorizeInternal().

◆ mBreakpoints

Breakpoints TextEditor::mBreakpoints
private

Definition at line 381 of file text_editor.h.

Referenced by InsertLine(), RemoveLine(), RemoveLine(), Render(), and SetBreakpoints().

◆ mErrorMarkers

ErrorMarkers TextEditor::mErrorMarkers
private

Definition at line 382 of file text_editor.h.

Referenced by Backspace(), InsertLine(), RemoveLine(), RemoveLine(), Render(), and SetErrorMarkers().

◆ mCharAdvance

ImVec2 TextEditor::mCharAdvance
private

Definition at line 383 of file text_editor.h.

Referenced by EnsureCursorVisible(), GetPageSize(), Render(), and ScreenPosToCoordinates().

◆ mInteractiveStart

Coordinates TextEditor::mInteractiveStart
private

◆ mInteractiveEnd

Coordinates TextEditor::mInteractiveEnd
private

◆ mLineBuffer

std::string TextEditor::mLineBuffer
private

Definition at line 385 of file text_editor.h.

Referenced by Render().

◆ mStartTime

uint64_t TextEditor::mStartTime
private

Definition at line 386 of file text_editor.h.

Referenced by Render().

◆ mLastClick

float TextEditor::mLastClick
private

Definition at line 388 of file text_editor.h.

Referenced by HandleMouseInputs().


The documentation for this class was generated from the following files: