Rename TextEditor members

This commit is contained in:
Kawe Mazidjatari 2022-06-19 10:51:45 +02:00
parent 0c11011567
commit 40a0c8878a
2 changed files with 802 additions and 800 deletions

View File

@ -186,13 +186,13 @@ public:
~TextEditor(); ~TextEditor();
void SetLanguageDefinition(const LanguageDefinition& aLanguageDef); void SetLanguageDefinition(const LanguageDefinition& aLanguageDef);
const LanguageDefinition& GetLanguageDefinition() const { return mLanguageDefinition; } const LanguageDefinition& GetLanguageDefinition() const { return m_LanguageDefinition; }
const Palette& GetPalette() const { return mPaletteBase; } const Palette& GetPalette() const { return m_PaletteBase; }
void SetPalette(const Palette& aValue); void SetPalette(const Palette& aValue);
void SetErrorMarkers(const ErrorMarkers& aMarkers) { mErrorMarkers = aMarkers; } void SetErrorMarkers(const ErrorMarkers& aMarkers) { m_ErrorMarkers = aMarkers; }
void SetBreakpoints(const Breakpoints& aMarkers) { mBreakpoints = aMarkers; } void SetBreakpoints(const Breakpoints& aMarkers) { m_Breakpoints = aMarkers; }
void Render(const char* aTitle, const ImVec2& aSize = ImVec2(), bool aBorder = false); void Render(const char* aTitle, const ImVec2& aSize = ImVec2(), bool aBorder = false);
void SetText(const std::string& aText); void SetText(const std::string& aText);
@ -204,34 +204,34 @@ public:
std::string GetSelectedText() const; std::string GetSelectedText() const;
std::string GetCurrentLineText()const; std::string GetCurrentLineText()const;
int GetTotalLines() const { return (int)mLines.size(); } int GetTotalLines() const { return (int)m_Lines.size(); }
bool IsOverwrite() const { return mOverwrite; } bool IsOverwrite() const { return m_Overwrite; }
void SetReadOnly(bool aValue); void SetReadOnly(bool aValue);
bool IsReadOnly() const { return mReadOnly; } bool IsReadOnly() const { return m_bReadOnly; }
bool IsTextChanged() const { return mTextChanged; } bool IsTextChanged() const { return m_bTextChanged; }
bool IsCursorPositionChanged() const { return mCursorPositionChanged; } bool IsCursorPositionChanged() const { return m_bCursorPositionChanged; }
bool IsColorizerEnabled() const { return mColorizerEnabled; } bool IsColorizerEnabled() const { return m_bColorizerEnabled; }
void SetColorizerEnable(bool aValue); void SetColorizerEnable(bool aValue);
Coordinates GetCursorPosition() const { return GetActualCursorCoordinates(); } Coordinates GetCursorPosition() const { return GetActualCursorCoordinates(); }
void SetCursorPosition(const Coordinates& aPosition); void SetCursorPosition(const Coordinates& aPosition);
inline void SetHandleMouseInputs (bool aValue){ mHandleMouseInputs = aValue;} inline void SetHandleMouseInputs (bool aValue){ m_bHandleMouseInputs = aValue;}
inline bool IsHandleMouseInputsEnabled() const { return mHandleKeyboardInputs; } inline bool IsHandleMouseInputsEnabled() const { return m_bHandleKeyboardInputs; }
inline void SetHandleKeyboardInputs (bool aValue){ mHandleKeyboardInputs = aValue;} inline void SetHandleKeyboardInputs (bool aValue){ m_bHandleKeyboardInputs = aValue;}
inline bool IsHandleKeyboardInputsEnabled() const { return mHandleKeyboardInputs; } inline bool IsHandleKeyboardInputsEnabled() const { return m_bHandleKeyboardInputs; }
inline void SetImGuiChildIgnored (bool aValue){ mIgnoreImGuiChild = aValue;} inline void SetImGuiChildIgnored (bool aValue){ m_bIgnoreImGuiChild = aValue;}
inline bool IsImGuiChildIgnored() const { return mIgnoreImGuiChild; } inline bool IsImGuiChildIgnored() const { return m_bIgnoreImGuiChild; }
inline void SetShowWhitespaces(bool aValue) { mShowWhitespaces = aValue; } inline void SetShowWhitespaces(bool aValue) { m_bShowWhitespaces = aValue; }
inline bool IsShowingWhitespaces() const { return mShowWhitespaces; } inline bool IsShowingWhitespaces() const { return m_bShowWhitespaces; }
void SetTabSize(int aValue); void SetTabSize(int aValue);
inline int GetTabSize() const { return mTabSize; } inline int GetTabSize() const { return m_nTabSize; }
void InsertText(const std::string& aValue); void InsertText(const std::string& aValue);
void InsertText(const char* aValue); void InsertText(const char* aValue);
@ -271,9 +271,9 @@ private:
struct EditorState struct EditorState
{ {
Coordinates mSelectionStart; Coordinates m_SelectionStart;
Coordinates mSelectionEnd; Coordinates m_SelectionEnd;
Coordinates mCursorPosition; Coordinates m_CursorPosition;
}; };
class UndoRecord class UndoRecord
@ -297,16 +297,16 @@ private:
void Undo(TextEditor* aEditor); void Undo(TextEditor* aEditor);
void Redo(TextEditor* aEditor); void Redo(TextEditor* aEditor);
std::string mAdded; std::string m_svAdded;
Coordinates mAddedStart; Coordinates m_AddedStart;
Coordinates mAddedEnd; Coordinates m_AddedEnd;
std::string mRemoved; std::string m_svRemoved;
Coordinates mRemovedStart; Coordinates m_RemovedStart;
Coordinates mRemovedEnd; Coordinates m_RemovedEnd;
EditorState mBefore; EditorState m_Before;
EditorState mAfter; EditorState m_After;
}; };
typedef std::vector<UndoRecord> UndoBuffer; typedef std::vector<UndoRecord> UndoBuffer;
@ -348,42 +348,44 @@ private:
void HandleMouseInputs(); void HandleMouseInputs();
void Render(); void Render();
float mLineSpacing; float m_flLineSpacing;
Lines mLines; Lines m_Lines;
EditorState mState; EditorState m_State;
UndoBuffer mUndoBuffer; UndoBuffer m_UndoBuffer;
int mUndoIndex; int m_nUndoIndex;
int mTabSize; int m_nTabSize;
bool mOverwrite; bool m_Overwrite;
bool mReadOnly; bool m_bReadOnly;
bool mWithinRender; bool m_bWithinRender;
bool mScrollToCursor; bool m_bScrollToCursor;
bool mScrollToTop; bool m_bScrollToTop;
bool mTextChanged; bool m_bTextChanged;
bool mColorizerEnabled; bool m_bColorizerEnabled;
float mTextStart; // position (in pixels) where a code line starts relative to the left of the TextEditor. float m_flTextStart; // position (in pixels) where a code line starts relative to the left of the TextEditor.
int mLeftMargin; int m_nLeftMargin;
bool mCursorPositionChanged; bool m_bCursorPositionChanged;
int mColorRangeMin, mColorRangeMax; int m_nColorRangeMin;
SelectionMode mSelectionMode; int m_nColorRangeMax;
bool mHandleKeyboardInputs; SelectionMode m_SelectionMode;
bool mHandleMouseInputs; bool m_bHandleKeyboardInputs;
bool mIgnoreImGuiChild; bool m_bHandleMouseInputs;
bool mShowWhitespaces; bool m_bIgnoreImGuiChild;
bool m_bShowWhitespaces;
Palette mPaletteBase; Palette m_PaletteBase;
Palette mPalette; Palette m_Palette;
LanguageDefinition mLanguageDefinition; LanguageDefinition m_LanguageDefinition;
RegexList mRegexList; RegexList m_RegexList;
bool mCheckComments; bool m_bCheckComments;
Breakpoints mBreakpoints; Breakpoints m_Breakpoints;
ErrorMarkers mErrorMarkers; ErrorMarkers m_ErrorMarkers;
ImVec2 mCharAdvance; ImVec2 m_CharAdvance;
Coordinates mInteractiveStart, mInteractiveEnd; Coordinates m_InteractiveStart;
std::string mLineBuffer; Coordinates mInteractiveEnd;
uint64_t mStartTime; std::string m__svLineBuffer;
uint64_t m_nStartTime;
float mLastClick; float m_flLastClick;
}; };

File diff suppressed because it is too large Load Diff