Code::Blocks
SVN r11506
|
#include <editorcolourset.h>
Private Member Functions | |
void | DoApplyStyle (cbStyledTextCtrl *control, int value, OptionColour *option) |
void | LoadAvailableSets () |
void | Load () |
void | ClearAllOptionColours () |
OptionColour * | GetDefaultOption (HighlightLanguage lang) |
Private Attributes | |
wxString | m_Name |
OptionSetsMap | m_Sets |
wxString | m_PlainTextLexerID |
Stores the id of the plain text file lexer (see lexer_plain.xml). More... | |
Definition at line 79 of file editorcolourset.h.
EditorColourSet::EditorColourSet | ( | const wxString & | setName = COLORSET_DEFAULT | ) |
Definition at line 35 of file editorcolourset.cpp.
References COLORSET_DEFAULT, wxString::IsEmpty(), Load(), LoadAvailableSets(), and m_Name.
EditorColourSet::EditorColourSet | ( | const EditorColourSet & | other | ) |
Definition at line 46 of file editorcolourset.cpp.
References AddOption(), OptionSet::comment, OptionSet::m_BreakLine, OptionSet::m_CaseSensitive, OptionSet::m_DebugLine, OptionSet::m_ErrorLine, OptionSet::m_FileMasks, OptionSet::m_Keywords, OptionSet::m_Langs, OptionSet::m_Lexers, OptionSet::m_originalFileMasks, OptionSet::m_originalKeywords, OptionSet::m_SampleCode, m_Sets, and wxSCI_KEYWORDSET_MAX.
EditorColourSet::~EditorColourSet | ( | ) |
Definition at line 79 of file editorcolourset.cpp.
References ClearAllOptionColours().
HighlightLanguage EditorColourSet::AddHighlightLanguage | ( | int | lexer, |
const wxString & | name | ||
) |
Definition at line 180 of file editorcolourset.cpp.
References _T, wxString::Append(), wxString::GetChar(), GetHighlightLanguage(), HL_NONE, wxString::IsEmpty(), wxString::Length(), m_PlainTextLexerID, m_Sets, wxString::Prepend(), wxIsalnum(), wxIsdigit(), wxIsspace(), wxSCI_LEX_LAST, wxSCI_LEX_NULL, and wxT.
Referenced by EditorLexerLoader::DoLexer().
void EditorColourSet::AddOption | ( | HighlightLanguage | lang, |
const wxString & | name, | ||
int | value, | ||
wxColour | fore = wxNullColour , |
||
wxColour | back = wxNullColour , |
||
bool | bold = false , |
||
bool | italics = false , |
||
bool | underlined = false , |
||
bool | isStyle = true |
||
) |
Definition at line 308 of file editorcolourset.cpp.
References OptionColour::back, OptionColour::bold, OptionColour::fore, HL_NONE, OptionColour::isStyle, OptionColour::italics, m_PlainTextLexerID, OptionColour::name, OptionColour::originalback, OptionColour::originalbold, OptionColour::originalfore, OptionColour::originalisStyle, OptionColour::originalitalics, OptionColour::originalunderlined, OptionColour::underlined, and OptionColour::value.
Referenced by EditorLexerLoader::DoStyles(), and EditorColourSet().
bool EditorColourSet::AddOption | ( | HighlightLanguage | lang, |
OptionColour * | option, | ||
bool | checkIfExists = true |
||
) |
Definition at line 295 of file editorcolourset.cpp.
References GetOptionByValue(), HL_NONE, m_PlainTextLexerID, m_Sets, and OptionColour::value.
HighlightLanguage EditorColourSet::Apply | ( | cbEditor * | editor, |
HighlightLanguage | lang, | ||
bool | colourise | ||
) |
Definition at line 503 of file editorcolourset.cpp.
References wxString::EndsWith(), Manager::Get(), Manager::GetConfigManager(), EditorBase::GetFilename(), GetHighlightLanguage(), GetLanguageForFilename(), cbEditor::GetLeftSplitViewControl(), cbEditor::GetRightSplitViewControl(), HL_AUTO, HL_NONE, wxString::Lower(), ConfigManager::ReadBool(), and wxT.
Referenced by EditorConfigurationDlg::ApplyColours(), DisassemblyDlg::DisassemblyDlg(), cbEditor::SetLanguage(), cbEditor::Split(), and CodeRefactoring::VerifyResult().
void EditorColourSet::Apply | ( | HighlightLanguage | lang, |
cbStyledTextCtrl * | control, | ||
bool | isC, | ||
bool | colourise | ||
) |
Definition at line 540 of file editorcolourset.cpp.
References OptionColour::back, cbHIGHLIGHT_LINE, cbSELECTION, wxScintilla::Colourise(), DoApplyStyle(), wxString::empty(), OptionColour::fore, Manager::Get(), ColourManager::GetColour(), Manager::GetColourManager(), GetDefaultOption(), HL_NONE, OptionColour::isStyle, OptionSet::m_Colours, OptionSet::m_Keywords, OptionSet::m_Lexers, m_PlainTextLexerID, m_Sets, wxScintilla::SetCaretLineBackground(), wxScintilla::SetKeyWords(), wxScintilla::SetLexer(), wxScintilla::SetSelBackground(), wxScintilla::SetSelForeground(), wxScintilla::StyleClearAll(), wxScintilla::StyleSetBackground(), wxScintilla::StyleSetForeground(), OptionColour::value, wxBLACK, wxNullColour, wxSCI_KEYWORDSET_MAX, wxSCI_STYLE_LINENUMBER, wxSCI_STYLE_MAX, and wxT.
|
private |
Definition at line 84 of file editorcolourset.cpp.
References m_Sets.
Referenced by Reset(), and ~EditorColourSet().
|
private |
Definition at line 490 of file editorcolourset.cpp.
References OptionColour::back, OptionColour::bold, OptionColour::fore, OptionColour::italics, wxScintilla::StyleSetBackground(), wxScintilla::StyleSetBold(), wxScintilla::StyleSetForeground(), wxScintilla::StyleSetItalic(), wxScintilla::StyleSetUnderline(), OptionColour::underlined, and wxNullColour.
Referenced by Apply().
wxArrayString EditorColourSet::GetAllHighlightLanguages | ( | ) |
Definition at line 246 of file editorcolourset.cpp.
References wxArrayString::Add(), CompareStringNoCase(), m_PlainTextLexerID, m_Sets, and wxArrayString::Sort().
Referenced by EditorConfigurationDlg::ChangeTheme(), MainFrame::CreateMenubar(), EditorConfigurationDlg::OnColoursCopyAllFrom(), and EditorConfigurationDlg::OnColoursCopyFrom().
bool EditorColourSet::GetCaseSensitivity | ( | HighlightLanguage | lang | ) |
Definition at line 971 of file editorcolourset.cpp.
References HL_NONE, m_PlainTextLexerID, and m_Sets.
CommentToken EditorColourSet::GetCommentToken | ( | HighlightLanguage | lang | ) |
Definition at line 944 of file editorcolourset.cpp.
References _T, CommentToken::boxCommentEnd, CommentToken::boxCommentMid, CommentToken::boxCommentStart, CommentToken::doxygenLineComment, CommentToken::doxygenStreamCommentEnd, CommentToken::doxygenStreamCommentStart, HL_NONE, CommentToken::lineComment, m_Sets, CommentToken::streamCommentEnd, and CommentToken::streamCommentStart.
Referenced by ProjectFileOptionsDlg::FillGeneralProperties(), MainFrame::OnEditBoxCommentSelected(), MainFrame::OnEditCommentSelected(), MainFrame::OnEditStreamCommentSelected(), MainFrame::OnEditToggleCommentSelected(), and MainFrame::OnEditUncommentSelected().
|
private |
Definition at line 390 of file editorcolourset.cpp.
References HL_NONE, OptionSet::m_Colours, m_PlainTextLexerID, m_Sets, OptionColour::name, OptionColour::value, and wxT.
Referenced by Apply().
const wxArrayString & EditorColourSet::GetFileMasks | ( | HighlightLanguage | lang | ) |
Definition at line 877 of file editorcolourset.cpp.
References m_Sets.
Referenced by EditorConfigurationDlg::OnEditFilemasks().
HighlightLanguage EditorColourSet::GetHighlightLanguage | ( | int | lexer | ) |
Definition at line 230 of file editorcolourset.cpp.
References HL_NONE, and m_Sets.
Referenced by AddHighlightLanguage(), Apply(), EditorConfigurationDlg::ChangeTheme(), DisassemblyDlg::DisassemblyDlg(), GetLanguageForFilename(), CodeCompletion::GetProviderStatusFor(), EditorConfigurationDlg::OnChangeLang(), EditorConfigurationDlg::OnColoursCopyAllFrom(), EditorConfigurationDlg::OnColoursCopyFrom(), and MainFrame::OnEditHighlightMode().
HighlightLanguage EditorColourSet::GetHighlightLanguage | ( | const wxString & | name | ) |
Definition at line 218 of file editorcolourset.cpp.
wxString & EditorColourSet::GetKeywords | ( | HighlightLanguage | lang, |
int | idx | ||
) |
Definition at line 832 of file editorcolourset.cpp.
References m_Sets, and wxSCI_KEYWORDSET_MAX.
Referenced by CodeCompletion::DoCodeComplete(), EditKeywordsDlg::UpdateDlg(), and CodeCompletion::UpdateEditorSyntax().
HighlightLanguage EditorColourSet::GetLanguageForFilename | ( | const wxString & | filename | ) |
Definition at line 408 of file editorcolourset.cpp.
References wxString::AfterLast(), wxString::EndsWith(), wxString::Find(), GetHighlightLanguage(), wxRegEx::GetMatch(), HL_NONE, wxString::IsEmpty(), wxFileInputStream::IsOk(), wxString::Lower(), m_Sets, wxRegEx::Matches(), wxString::Matches(), wxTextInputStream::ReadLine(), wxString::StartsWith(), wxString::Trim(), wxFileExists(), wxNOT_FOUND, and wxT.
Referenced by Apply(), CodeCompletion::DoCodeComplete(), and ProjectFileOptionsDlg::FillGeneralProperties().
wxString EditorColourSet::GetLanguageName | ( | HighlightLanguage | lang | ) |
Definition at line 478 of file editorcolourset.cpp.
References _(), wxString::empty(), HL_NONE, m_PlainTextLexerID, and m_Sets.
Referenced by CodeCompletion::DoCodeComplete(), MainFrame::DoUpdateStatusBar(), EditorConfigurationDlg::OnColoursReset(), EditorConfigurationDlg::OnEditFilemasks(), MainFrame::OnEditHighlightMode(), and MainFrame::OnEditMenuUpdateUI().
|
inline |
Definition at line 111 of file editorcolourset.h.
Referenced by EditorConfigurationDlg::AskToSaveTheme(), EditorConfigurationDlg::ChangeTheme(), EditorConfigurationDlg::EndModal(), EditorConfigurationDlg::OnColourTheme(), EditorConfigurationDlg::OnDeleteColourTheme(), and EditorConfigurationDlg::OnRenameColourTheme().
OptionColour * EditorColourSet::GetOptionByIndex | ( | HighlightLanguage | lang, |
int | index | ||
) |
Definition at line 372 of file editorcolourset.cpp.
References HL_NONE, m_PlainTextLexerID, and m_Sets.
Referenced by EditorConfigurationDlg::FillColourComponents(), EditorConfigurationDlg::OnColoursCopyFrom(), EditorConfigurationDlg::OnMenuColoursCopyAllFrom(), and EditorConfigurationDlg::OnMenuColoursCopyFrom().
OptionColour * EditorColourSet::GetOptionByName | ( | HighlightLanguage | lang, |
const wxString & | name | ||
) |
Definition at line 342 of file editorcolourset.cpp.
References HL_NONE, OptionSet::m_Colours, m_PlainTextLexerID, m_Sets, and OptionColour::name.
Referenced by EditorConfigurationDlg::OnMenuColoursCopyAllFrom(), EditorConfigurationDlg::OnMenuColoursCopyFrom(), EditorConfigurationDlg::ReadColours(), and EditorConfigurationDlg::WriteColours().
OptionColour * EditorColourSet::GetOptionByValue | ( | HighlightLanguage | lang, |
int | value | ||
) |
Definition at line 357 of file editorcolourset.cpp.
References HL_NONE, OptionSet::m_Colours, m_PlainTextLexerID, m_Sets, and OptionColour::value.
Referenced by AddOption().
int EditorColourSet::GetOptionCount | ( | HighlightLanguage | lang | ) |
Definition at line 379 of file editorcolourset.cpp.
References HL_NONE, m_PlainTextLexerID, and m_Sets.
Referenced by EditorConfigurationDlg::FillColourComponents(), EditorConfigurationDlg::OnColoursCopyFrom(), and EditorConfigurationDlg::OnMenuColoursCopyAllFrom().
wxString EditorColourSet::GetSampleCode | ( | HighlightLanguage | lang, |
int * | breakLine, | ||
int * | debugLine, | ||
int * | errorLine | ||
) |
Definition at line 893 of file editorcolourset.cpp.
References _T, ConfigManager::GetFolder(), HL_NONE, wxString::IsEmpty(), OptionSet::m_BreakLine, OptionSet::m_DebugLine, OptionSet::m_ErrorLine, m_PlainTextLexerID, OptionSet::m_SampleCode, m_Sets, sdDataGlobal, sdDataUser, wxEmptyString, and wxFileExists().
Referenced by EditorConfigurationDlg::CreateColoursSample().
|
private |
Definition at line 720 of file editorcolourset.cpp.
References _(), _T, OptionColour::back, OptionColour::bold, wxString::c_str(), cbMessageBox(), wxString::Clear(), ConfigManager::DeleteSubPath(), ConfigManager::Exists(), OptionColour::fore, wxString::Format(), Manager::Get(), GetArrayFromString(), Manager::GetConfigManager(), HL_AUTO, HL_NONE, Manager::IsBatchBuild(), OptionColour::isStyle, OptionColour::italics, m_Name, m_Sets, OptionColour::name, wxString::Printf(), ConfigManager::Read(), ConfigManager::ReadBool(), ConfigManager::ReadColour(), OptionColour::underlined, wxEmptyString, wxICON_INFORMATION, and wxSCI_KEYWORDSET_MAX.
Referenced by EditorColourSet(), and Reset().
|
private |
Definition at line 98 of file editorcolourset.cpp.
References _(), _T, cbHIGHLIGHT_LINE, cbSELECTION, Delete(), F(), Manager::Get(), Mgr< FileManager >::Get(), wxDir::GetFirst(), ConfigManager::GetFolder(), Manager::GetLogManager(), wxDir::GetNext(), Manager::IsBatchBuild(), wxString::IsEmpty(), EditorLexerLoader::Load(), FileManager::Load(), LogManager::Log(), m_Sets, wxDir::Open(), sdDataGlobal, sdDataUser, OptionColour::value, wxString::wx_str(), wxDIR_FILES, wxDirExists(), and wxSCI_KEYWORDSET_MAX.
Referenced by EditorColourSet(), and Reset().
void EditorColourSet::Reset | ( | HighlightLanguage | lang | ) |
Definition at line 816 of file editorcolourset.cpp.
References _T, ClearAllOptionColours(), ConfigManager::DeleteSubPath(), Manager::Get(), Manager::GetConfigManager(), Manager::IsBatchBuild(), Load(), LoadAvailableSets(), and m_Name.
Referenced by EditorConfigurationDlg::OnColoursReset().
void EditorColourSet::Save | ( | ) |
Definition at line 625 of file editorcolourset.cpp.
References _T, OptionColour::back, OptionColour::bold, wxString::c_str(), wxString::Clear(), ConfigManager::DeleteSubPath(), OptionColour::fore, wxString::Format(), Manager::Get(), Manager::GetConfigManager(), GetStringFromArray(), HL_AUTO, HL_NONE, Manager::IsBatchBuild(), OptionColour::isStyle, OptionColour::italics, m_Name, m_Sets, OptionColour::name, OptionColour::originalback, OptionColour::originalbold, OptionColour::originalfore, OptionColour::originalisStyle, OptionColour::originalitalics, OptionColour::originalunderlined, wxString::Printf(), OptionColour::underlined, ConfigManager::Write(), and wxSCI_KEYWORDSET_MAX.
Referenced by EditorConfigurationDlg::AskToSaveTheme(), EditorConfigurationDlg::EndModal(), and EditorConfigurationDlg::OnRenameColourTheme().
void EditorColourSet::SetCaseSensitivity | ( | HighlightLanguage | lang, |
bool | CaseSensitive | ||
) |
Definition at line 963 of file editorcolourset.cpp.
References HL_NONE, m_PlainTextLexerID, and m_Sets.
Referenced by EditorLexerLoader::DoLangAttributes().
void EditorColourSet::SetCharacterLexerStyles | ( | HighlightLanguage | lang, |
const std::set< int > & | styles | ||
) |
Definition at line 995 of file editorcolourset.cpp.
References cbStyledTextCtrl::GetCharacterLexerStyles(), HL_NONE, m_PlainTextLexerID, and m_Sets.
Referenced by EditorLexerLoader::DoLangAttributes().
void EditorColourSet::SetCommentLexerStyles | ( | HighlightLanguage | lang, |
const std::set< int > & | styles | ||
) |
Definition at line 987 of file editorcolourset.cpp.
References cbStyledTextCtrl::GetCommentLexerStyles(), HL_NONE, m_PlainTextLexerID, and m_Sets.
Referenced by EditorLexerLoader::DoLangAttributes().
void EditorColourSet::SetCommentToken | ( | HighlightLanguage | lang, |
CommentToken | token | ||
) |
Definition at line 936 of file editorcolourset.cpp.
References HL_NONE, m_PlainTextLexerID, and m_Sets.
Referenced by EditorLexerLoader::DoLangAttributes().
void EditorColourSet::SetFileMasks | ( | HighlightLanguage | lang, |
const wxString & | masks, | ||
const wxString & | separator = _(",") |
||
) |
Definition at line 882 of file editorcolourset.cpp.
References _(), FileFilters::Add(), wxString::Format(), GetArrayFromString(), HL_NONE, wxString::Lower(), m_PlainTextLexerID, and m_Sets.
Referenced by EditorLexerLoader::DoLexer(), and EditorConfigurationDlg::OnEditFilemasks().
void EditorColourSet::SetKeywords | ( | HighlightLanguage | lang, |
int | idx, | ||
const wxString & | keywords | ||
) |
Definition at line 839 of file editorcolourset.cpp.
References _T, wxString::c_str(), HL_NONE, wxString::length(), OptionSet::m_Keywords, m_Sets, and wxSCI_KEYWORDSET_MAX.
Referenced by EditorLexerLoader::DoSingleKeywordNode(), and EditKeywordsDlg::OnSetChange().
|
inline |
Definition at line 112 of file editorcolourset.h.
References _(), GetDefaultOption(), and OptionColour::name.
Referenced by EditorConfigurationDlg::OnRenameColourTheme().
void EditorColourSet::SetPreprocessorLexerStyles | ( | HighlightLanguage | lang, |
const std::set< int > & | styles | ||
) |
Definition at line 1003 of file editorcolourset.cpp.
References cbStyledTextCtrl::GetPreprocessorLexerStyles(), HL_NONE, m_PlainTextLexerID, and m_Sets.
Referenced by EditorLexerLoader::DoLangAttributes().
void EditorColourSet::SetSampleCode | ( | HighlightLanguage | lang, |
const wxString & | sample, | ||
int | breakLine, | ||
int | debugLine, | ||
int | errorLine | ||
) |
Definition at line 925 of file editorcolourset.cpp.
References HL_NONE, OptionSet::m_BreakLine, OptionSet::m_DebugLine, OptionSet::m_ErrorLine, m_PlainTextLexerID, OptionSet::m_SampleCode, and m_Sets.
Referenced by EditorLexerLoader::DoSampleCode().
void EditorColourSet::SetStringLexerStyles | ( | HighlightLanguage | lang, |
const std::set< int > & | styles | ||
) |
Definition at line 979 of file editorcolourset.cpp.
References cbStyledTextCtrl::GetStringLexerStyles(), HL_NONE, m_PlainTextLexerID, and m_Sets.
Referenced by EditorLexerLoader::DoLangAttributes().
void EditorColourSet::UpdateOptionsWithSameName | ( | HighlightLanguage | lang, |
OptionColour * | base | ||
) |
Definition at line 260 of file editorcolourset.cpp.
References OptionColour::back, OptionColour::bold, OptionColour::fore, OptionColour::italics, OptionSet::m_Colours, m_Sets, wxString::Matches(), OptionColour::name, and OptionColour::underlined.
Referenced by EditorConfigurationDlg::WriteColours().
|
private |
Definition at line 147 of file editorcolourset.h.
Referenced by EditorColourSet(), Load(), Reset(), and Save().
|
private |
Stores the id of the plain text file lexer (see lexer_plain.xml).
This is used for files which don't have another more appropriate lexer.
Definition at line 152 of file editorcolourset.h.
Referenced by AddHighlightLanguage(), AddOption(), Apply(), GetAllHighlightLanguages(), GetCaseSensitivity(), GetDefaultOption(), GetLanguageName(), GetOptionByIndex(), GetOptionByName(), GetOptionByValue(), GetOptionCount(), GetSampleCode(), SetCaseSensitivity(), SetCharacterLexerStyles(), SetCommentLexerStyles(), SetCommentToken(), SetFileMasks(), SetPreprocessorLexerStyles(), SetSampleCode(), and SetStringLexerStyles().
|
private |
Definition at line 148 of file editorcolourset.h.
Referenced by AddHighlightLanguage(), AddOption(), Apply(), ClearAllOptionColours(), EditorColourSet(), GetAllHighlightLanguages(), GetCaseSensitivity(), GetCommentToken(), GetDefaultOption(), GetFileMasks(), GetHighlightLanguage(), GetKeywords(), GetLanguageForFilename(), GetLanguageName(), GetOptionByIndex(), GetOptionByName(), GetOptionByValue(), GetOptionCount(), GetSampleCode(), Load(), LoadAvailableSets(), Save(), SetCaseSensitivity(), SetCharacterLexerStyles(), SetCommentLexerStyles(), SetCommentToken(), SetFileMasks(), SetKeywords(), SetPreprocessorLexerStyles(), SetSampleCode(), SetStringLexerStyles(), and UpdateOptionsWithSameName().