|
PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
|
#include <TextEditor.h>
Classes | |
| struct | Breakpoint |
| struct | Coordinates |
| struct | Glyph |
| struct | Identifier |
| struct | LanguageDefinition |
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, Identifier > | Identifiers |
| 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::Max > | Palette |
| typedef uint8_t | Char |
| typedef std::vector< Glyph > | Line |
| typedef std::vector< Line > | Lines |
Public Member Functions | |
| TextEditor () | |
| ~TextEditor () | |
| void | SetLanguageDefinition (const LanguageDefinition &aLanguageDef) |
| const LanguageDefinition & | GetLanguageDefinition () const |
| const Palette & | GetPalette () 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 Palette & | GetDarkPalette () |
| static const Palette & | GetLightPalette () |
| static const Palette & | GetRetroBluePalette () |
Definition at line 13 of file TextEditor.h.
| typedef std::unordered_set<int> TextEditor::Breakpoints |
Definition at line 132 of file TextEditor.h.
| typedef uint8_t TextEditor::Char |
Definition at line 134 of file TextEditor.h.
| typedef std::map<int, std::string> TextEditor::ErrorMarkers |
Definition at line 131 of file TextEditor.h.
| typedef std::unordered_map<std::string, Identifier> TextEditor::Identifiers |
Definition at line 129 of file TextEditor.h.
| typedef std::unordered_set<std::string> TextEditor::Keywords |
Definition at line 130 of file TextEditor.h.
| typedef std::vector<Glyph> TextEditor::Line |
Definition at line 148 of file TextEditor.h.
| typedef std::vector<Line> TextEditor::Lines |
Definition at line 149 of file TextEditor.h.
| typedef std::array<ImU32, (unsigned)PaletteIndex::Max> TextEditor::Palette |
Definition at line 133 of file TextEditor.h.
| typedef std::string TextEditor::String |
Definition at line 128 of file TextEditor.h.
|
strong |
Definition at line 16 of file TextEditor.h.
|
strong |
| Enumerator | |
|---|---|
| Normal | |
| Word | |
| Line | |
Definition at line 42 of file TextEditor.h.
| TextEditor::TextEditor | ( | ) |
Definition at line 26 of file TextEditor.cpp.
References GetDarkPalette(), TextEditor::LanguageDefinition::HLSL(), SetLanguageDefinition(), and SetPalette().
| TextEditor::~TextEditor | ( | ) |
Definition at line 56 of file TextEditor.cpp.
| bool TextEditor::CanRedo | ( | ) | const |
Definition at line 1988 of file TextEditor.cpp.
Referenced by Redo().
| bool TextEditor::CanUndo | ( | ) | const |
Definition at line 1983 of file TextEditor.cpp.
Referenced by Undo().
| void TextEditor::Copy | ( | ) |
Definition at line 1909 of file TextEditor.cpp.
References GetSelectedText(), HasSelection(), and TextEditor::Coordinates::mLine.
Referenced by Cut().
| void TextEditor::Cut | ( | ) |
Definition at line 1928 of file TextEditor.cpp.
References Copy(), GetSelectedText(), HasSelection(), and IsReadOnly().
| void TextEditor::Delete | ( | ) |
Definition at line 1757 of file TextEditor.cpp.
References GetSelectedText(), GetText(), HasSelection(), and SetCursorPosition().
| std::string TextEditor::GetCurrentLineText | ( | ) | const |
Definition at line 2121 of file TextEditor.cpp.
References GetText().
|
inline |
Definition at line 218 of file TextEditor.h.
Referenced by SelectWordUnderCursor().
|
static |
Definition at line 2005 of file TextEditor.cpp.
Referenced by LauncherUI::LauncherUI(), and TextEditor().
|
inline |
Definition at line 189 of file TextEditor.h.
|
static |
Definition at line 2033 of file TextEditor.cpp.
|
inline |
Definition at line 191 of file TextEditor.h.
|
static |
Definition at line 2061 of file TextEditor.cpp.
| std::string TextEditor::GetSelectedText | ( | ) | const |
|
inline |
Definition at line 234 of file TextEditor.h.
| std::string TextEditor::GetText | ( | ) | const |
Definition at line 2090 of file TextEditor.cpp.
References GetText().
Referenced by Delete(), GetCurrentLineText(), GetSelectedText(), and GetText().
| std::vector< std::string > TextEditor::GetTextLines | ( | ) | const |
Definition at line 2095 of file TextEditor.cpp.
|
inline |
Definition at line 207 of file TextEditor.h.
| bool TextEditor::HasSelection | ( | ) | const |
| void TextEditor::InsertText | ( | const char * | aValue | ) |
Definition at line 1468 of file TextEditor.cpp.
References SetCursorPosition(), and SetSelection().
| void TextEditor::InsertText | ( | const std::string & | aValue | ) |
Definition at line 1463 of file TextEditor.cpp.
References InsertText().
Referenced by InsertText(), and Paste().
|
inline |
Definition at line 215 of file TextEditor.h.
|
inline |
Definition at line 213 of file TextEditor.h.
|
inline |
Definition at line 225 of file TextEditor.h.
|
inline |
Definition at line 222 of file TextEditor.h.
|
inline |
Definition at line 228 of file TextEditor.h.
|
inline |
Definition at line 208 of file TextEditor.h.
|
inline |
Definition at line 211 of file TextEditor.h.
|
inline |
Definition at line 231 of file TextEditor.h.
|
inline |
Definition at line 212 of file TextEditor.h.
| void TextEditor::MoveBottom | ( | bool | aSelect = false | ) |
| void TextEditor::MoveDown | ( | int | aAmount = 1, |
| bool | aSelect = false |
||
| ) |
Definition at line 1524 of file TextEditor.cpp.
References SetSelection().
| void TextEditor::MoveEnd | ( | bool | aSelect = false | ) |
Definition at line 1732 of file TextEditor.cpp.
References SetCursorPosition(), and SetSelection().
| void TextEditor::MoveHome | ( | bool | aSelect = false | ) |
Definition at line 1707 of file TextEditor.cpp.
References SetCursorPosition(), and SetSelection().
| void TextEditor::MoveLeft | ( | int | aAmount = 1, |
| bool | aSelect = false, |
||
| bool | aWordMode = false |
||
| ) |
Definition at line 1557 of file TextEditor.cpp.
References Normal, SetSelection(), and Word.
| void TextEditor::MoveRight | ( | int | aAmount = 1, |
| bool | aSelect = false, |
||
| bool | aWordMode = false |
||
| ) |
Definition at line 1623 of file TextEditor.cpp.
References Normal, SetSelection(), and Word.
| void TextEditor::MoveTop | ( | bool | aSelect = false | ) |
Definition at line 1674 of file TextEditor.cpp.
References SetCursorPosition(), and SetSelection().
| void TextEditor::MoveUp | ( | int | aAmount = 1, |
| bool | aSelect = false |
||
| ) |
Definition at line 1498 of file TextEditor.cpp.
References SetSelection().
| void TextEditor::Paste | ( | ) |
Definition at line 1953 of file TextEditor.cpp.
References GetSelectedText(), HasSelection(), InsertText(), and IsReadOnly().
| void TextEditor::Redo | ( | int | aSteps = 1 | ) |
Definition at line 1999 of file TextEditor.cpp.
References CanRedo().
| void TextEditor::Render | ( | const char * | aTitle, |
| const ImVec2 & | aSize = ImVec2(), |
||
| bool | aBorder = false |
||
| ) |
Definition at line 1120 of file TextEditor.cpp.
References Background, and Render().
Referenced by Render().
| void TextEditor::SelectAll | ( | ) |
Definition at line 1899 of file TextEditor.cpp.
References SetSelection().
| void TextEditor::SelectWordUnderCursor | ( | ) |
Definition at line 1893 of file TextEditor.cpp.
References GetCursorPosition(), and SetSelection().
|
inline |
Definition at line 195 of file TextEditor.h.
| void TextEditor::SetColorizerEnable | ( | bool | aValue | ) |
Definition at line 1391 of file TextEditor.cpp.
| void TextEditor::SetCursorPosition | ( | const Coordinates & | aPosition | ) |
Definition at line 1396 of file TextEditor.cpp.
Referenced by Delete(), InsertText(), MoveEnd(), MoveHome(), and MoveTop().
|
inline |
Definition at line 194 of file TextEditor.h.
|
inline |
Definition at line 224 of file TextEditor.h.
|
inline |
Definition at line 221 of file TextEditor.h.
|
inline |
Definition at line 227 of file TextEditor.h.
| void TextEditor::SetLanguageDefinition | ( | const LanguageDefinition & | aLanguageDef | ) |
Definition at line 60 of file TextEditor.cpp.
References TextEditor::LanguageDefinition::mTokenRegexStrings.
Referenced by LauncherUI::LauncherUI(), and TextEditor().
| void TextEditor::SetPalette | ( | const Palette & | aValue | ) |
Definition at line 71 of file TextEditor.cpp.
Referenced by LauncherUI::LauncherUI(), and TextEditor().
| void TextEditor::SetReadOnly | ( | bool | aValue | ) |
Definition at line 1386 of file TextEditor.cpp.
| void TextEditor::SetSelection | ( | const Coordinates & | aStart, |
| const Coordinates & | aEnd, | ||
| SelectionMode | aMode = SelectionMode::Normal |
||
| ) |
Definition at line 1420 of file TextEditor.cpp.
References Line, Normal, and Word.
Referenced by InsertText(), MoveDown(), MoveEnd(), MoveHome(), MoveLeft(), MoveRight(), MoveTop(), MoveUp(), SelectAll(), and SelectWordUnderCursor().
| void TextEditor::SetSelectionEnd | ( | const Coordinates & | aPosition | ) |
Definition at line 1413 of file TextEditor.cpp.
| void TextEditor::SetSelectionStart | ( | const Coordinates & | aPosition | ) |
Definition at line 1406 of file TextEditor.cpp.
|
inline |
Definition at line 230 of file TextEditor.h.
Referenced by LauncherUI::LauncherUI().
| void TextEditor::SetTabSize | ( | int | aValue | ) |
Definition at line 1458 of file TextEditor.cpp.
Referenced by LauncherUI::LauncherUI().
| void TextEditor::SetText | ( | const std::string & | aText | ) |
Definition at line 1155 of file TextEditor.cpp.
References Default.
| void TextEditor::SetTextLines | ( | const std::vector< std::string > & | aLines | ) |
Definition at line 1182 of file TextEditor.cpp.
References Default.
| void TextEditor::Undo | ( | int | aSteps = 1 | ) |
Definition at line 1993 of file TextEditor.cpp.
References CanUndo().