Code::Blocks
SVN r11506
|
Public Member Functions | |
cbEditorInternalData (cbEditor *owner, LoaderBase *fileLoader=nullptr) | |
~cbEditorInternalData () | |
void | StripTrailingSpaces () |
Strip trailing blanks before saving. More... | |
void | EnsureFinalLineEnd () |
Add extra blank line to the file. More... | |
void | EnsureConsistentLineEnds () |
Make sure all the lines end with the same EOL mode. More... | |
void | SetLineNumberColWidth (bool both=true) |
Set line number column width. More... | |
void | SetFoldingColWidth (bool both=true) |
wxString | GetUrl () |
Static Public Member Functions | |
static wxString | GetLineIndentString (int line, cbStyledTextCtrl *stc) |
static int | DetectIndentStyle (cbStyledTextCtrl *stc) |
Detect the indentation style used in a document. More... | |
Public Attributes | |
cbEditor * | m_pOwner |
bool | m_strip_trailing_spaces |
bool | m_ensure_final_line_end |
bool | m_ensure_consistent_line_ends |
int | m_LastMarginMenuLine |
int | m_LastDebugLine |
bool | mFoldingLimit |
int | mFoldingLimitLevel |
wxFontEncoding | m_encoding |
bool | m_useByteOrderMark |
int | m_byteOrderMarkLength |
int | m_lineNumbersWidth |
int | m_lineNumbersWidth2 |
LoaderBase * | m_pFileLoader |
Definition at line 96 of file cbeditor.cpp.
|
inline |
Definition at line 100 of file cbeditor.cpp.
References _T, LogManager::DebugLog(), F(), Manager::Get(), EncodingDetector::GetBOMSizeInBytes(), EncodingDetector::GetFontEncoding(), Manager::GetLogManager(), wxLocale::GetSystemEncoding(), EncodingDetector::IsOK(), m_byteOrderMarkLength, m_encoding, m_pFileLoader, m_useByteOrderMark, wxStopWatch::Time(), and EncodingDetector::UsesBOM().
|
inline |
Definition at line 133 of file cbeditor.cpp.
References m_pFileLoader.
|
inlinestatic |
Detect the indentation style used in a document.
Values for the thresholds are from trial and error over many example files. If this function is not certain on the style used, it will return -1.
Definition at line 402 of file cbeditor.cpp.
References wxString::Find(), wxScintilla::GetLineCount(), GetLineIndentString(), wxString::IsEmpty(), wxString::Length(), wxNOT_FOUND, and wxT.
Referenced by cbEditor::InternalSetEditorStyleAfterFileOpen().
|
inline |
Make sure all the lines end with the same EOL mode.
Definition at line 185 of file cbeditor.cpp.
References wxScintilla::ConvertEOLs(), cbEditor::GetControl(), and wxScintilla::GetEOLMode().
Referenced by cbEditor::Save().
|
inline |
Add extra blank line to the file.
Definition at line 174 of file cbeditor.cpp.
References cbEditor::GetControl(), wxScintilla::GetEOLMode(), GetEOLStr(), wxScintilla::GetLineCount(), wxScintilla::InsertText(), and wxScintilla::PositionFromLine().
Referenced by cbEditor::Save().
|
inlinestatic |
Definition at line 375 of file cbeditor.cpp.
References _T, wxScintilla::GetCurrentPos(), wxScintilla::GetLine(), wxString::Length(), and wxScintilla::LineFromPosition().
Referenced by DetectIndentStyle(), and cbEditor::GetLineIndentString().
|
inline |
Definition at line 306 of file cbeditor.cpp.
References wxString::Find(), wxString::find_last_not_of(), wxScintilla::GetCharAt(), cbEditor::GetControl(), wxScintilla::GetCurrentPos(), wxScintilla::GetLexer(), wxScintilla::GetLineCount(), wxScintilla::GetLineEndPosition(), wxRegEx::GetMatch(), wxScintilla::GetSelectedText(), wxScintilla::GetStyleAt(), wxScintilla::GetTextRange(), wxString::Length(), wxRegEx::Matches(), wxString::Replace(), ParserConsts::space, wxEmptyString, wxSCI_C_STRING, wxSCI_C_STRINGEOL, wxSCI_LEX_CPP, and wxT.
Referenced by cbEditor::AddToContextMenu(), and cbEditor::OnContextMenuEntry().
|
inline |
Definition at line 280 of file cbeditor.cpp.
References C_FOLDING_MARGIN, cbEditor::GetControl(), wxFont::GetPointSize(), wxScintilla::GetZoom(), cbEditor::m_pControl, cbEditor::m_pControl2, wxScintilla::SetMarginWidth(), wxScintilla::StyleGetFont(), and wxSCI_STYLE_DEFAULT.
Referenced by cbEditor::OnZoom().
|
inline |
Set line number column width.
Definition at line 193 of file cbeditor.cpp.
References _T, C_LINE_MARGIN, Manager::Get(), Manager::GetConfigManager(), cbEditor::GetControl(), wxScintilla::GetLineCount(), m_lineNumbersWidth, m_lineNumbersWidth2, cbEditor::m_pControl, cbEditor::m_pControl2, ConfigManager::ReadBool(), ConfigManager::ReadInt(), wxScintilla::SetMarginWidth(), wxScintilla::TextWidth(), and wxSCI_STYLE_LINENUMBER.
Referenced by cbEditor::OnEditorModified(), cbEditor::OnZoom(), cbEditor::Print(), cbEditor::SetEditorStyleAfterFileOpen(), and cbEditor::SetProjectFile().
|
inline |
Strip trailing blanks before saving.
Definition at line 145 of file cbeditor.cpp.
References _T, wxScintilla::GetCharAt(), cbEditor::GetControl(), wxScintilla::GetLexer(), wxScintilla::GetLineCount(), wxScintilla::GetLineEndPosition(), wxScintilla::PositionFromLine(), wxScintilla::ReplaceTarget(), wxScintilla::SetTargetEnd(), wxScintilla::SetTargetStart(), and wxSCI_LEX_DIFF.
Referenced by cbEditor::Save().
int cbEditorInternalData::m_byteOrderMarkLength |
Definition at line 495 of file cbeditor.cpp.
Referenced by cbEditorInternalData(), and cbEditor::Open().
wxFontEncoding cbEditorInternalData::m_encoding |
Definition at line 493 of file cbeditor.cpp.
Referenced by cbEditorInternalData(), cbEditor::CreateEditor(), cbEditor::GetEncoding(), cbEditor::Open(), and cbEditor::SetEncoding().
bool cbEditorInternalData::m_ensure_consistent_line_ends |
Definition at line 485 of file cbeditor.cpp.
Referenced by cbEditor::Save(), and cbEditor::SetEditorStyleBeforeFileOpen().
bool cbEditorInternalData::m_ensure_final_line_end |
Definition at line 484 of file cbeditor.cpp.
Referenced by cbEditor::Save(), and cbEditor::SetEditorStyleBeforeFileOpen().
int cbEditorInternalData::m_LastDebugLine |
Definition at line 488 of file cbeditor.cpp.
Referenced by cbEditor::SetDebugLine().
int cbEditorInternalData::m_LastMarginMenuLine |
Definition at line 487 of file cbeditor.cpp.
Referenced by cbEditor::OnBeforeBuildContextMenu(), and cbEditor::OnContextMenuEntry().
int cbEditorInternalData::m_lineNumbersWidth |
Definition at line 497 of file cbeditor.cpp.
Referenced by SetLineNumberColWidth().
int cbEditorInternalData::m_lineNumbersWidth2 |
Definition at line 498 of file cbeditor.cpp.
Referenced by SetLineNumberColWidth().
LoaderBase* cbEditorInternalData::m_pFileLoader |
Definition at line 500 of file cbeditor.cpp.
Referenced by cbEditorInternalData(), cbEditor::DoInitializations(), cbEditor::Open(), and ~cbEditorInternalData().
cbEditor* cbEditorInternalData::m_pOwner |
Definition at line 98 of file cbeditor.cpp.
bool cbEditorInternalData::m_strip_trailing_spaces |
Definition at line 483 of file cbeditor.cpp.
Referenced by cbEditor::Save(), and cbEditor::SetEditorStyleBeforeFileOpen().
bool cbEditorInternalData::m_useByteOrderMark |
Definition at line 494 of file cbeditor.cpp.
Referenced by cbEditorInternalData(), cbEditor::GetUseBom(), cbEditor::Open(), and cbEditor::SetUseBom().
bool cbEditorInternalData::mFoldingLimit |
Definition at line 490 of file cbeditor.cpp.
Referenced by cbEditor::DoFoldAll(), and cbEditor::SetEditorStyleBeforeFileOpen().
int cbEditorInternalData::mFoldingLimitLevel |
Definition at line 491 of file cbeditor.cpp.
Referenced by cbEditor::DoFoldAll(), and cbEditor::SetEditorStyleBeforeFileOpen().