53 root = doc.FirstChildElement(
"CodeBlocks_lexer_properties");
57 root = doc.FirstChildElement(
"Code::Blocks_lexer_properties");
64 lexer = root->FirstChildElement(
"Lexer");
76 if (!node->Attribute(
"name") || !node->Attribute(
"index"))
83 int lexer = atol(node->Attribute(
"index"));
99 bool foundSelection =
false, foundActiveLine =
false;
100 bool foundMatchBrace =
false, foundBraceError =
false;
101 bool foundIndentationGuide =
false;
103 TiXmlElement* style = node->FirstChildElement(
"Style");
106 if (style->Attribute(
"name") && style->Attribute(
"index"))
112 bool bold = style->Attribute(
"bold") ? atol(style->Attribute(
"bold")) != 0 :
false;
113 bool italics = style->Attribute(
"italics") ? atol(style->Attribute(
"italics")) != 0 :
false;
114 bool underlined = style->Attribute(
"underlined") ? atol(style->Attribute(
"underlined")) != 0 :
false;
125 fgarray[0].ToLong(&R);
126 fgarray[1].ToLong(&G);
127 fgarray[2].ToLong(&
B);
128 fgcolour.
Set((
unsigned char)R,(
unsigned char)G,(
unsigned char)
B);
134 bgarray[0].ToLong(&R);
135 bgarray[1].ToLong(&G);
136 bgarray[2].ToLong(&
B);
137 bgcolour.
Set((
unsigned char)R,(
unsigned char)G,(
unsigned char)
B);
140 for (
size_t i = 0; i < indices.GetCount(); ++i)
142 if (indices[i].IsEmpty())
145 indices[i].ToLong(&value);
150 foundSelection =
true;
153 foundActiveLine =
true;
156 foundMatchBrace =
true;
159 foundBraceError =
true;
162 foundIndentationGuide =
true;
176 style = style->NextSiblingElement(
"Style");
182 wxColour(217, 217, 217),
false,
false,
false,
false);
184 if (!foundActiveLine)
187 wxColour(255, 255, 160),
false,
false,
false,
false);
189 if (!foundMatchBrace)
194 if (!foundBraceError)
199 if (!foundIndentationGuide)
208 TiXmlElement* keywords = node->FirstChildElement(
"Keywords");
219 TiXmlElement* keywords = node->FirstChildElement(nodename.
mb_str());
223 int keyidx = keywords->Attribute(
"index") ? atol(keywords->Attribute(
"index")) : -1;
229 wxString value(keywords->Attribute(
"value"), wxConvUTF8);
232 #if wxCHECK_VERSION(3, 0, 0) 239 keywords = keywords->NextSiblingElement(nodename.
mb_str());
245 TiXmlElement* sample = node->FirstChildElement(
"SampleCode");
251 int breakLine = sample->Attribute(
"breakpoint_line") ? atol(sample->Attribute(
"breakpoint_line")) : -1;
252 int debugLine = sample->Attribute(
"debug_line") ? atol(sample->Attribute(
"debug_line")) : -1;
253 int errorLine = sample->Attribute(
"error_line") ? atol(sample->Attribute(
"error_line")) : -1;
259 TiXmlElement* attribs = node->FirstChildElement(
"LanguageAttributes");
263 bool CaseSensitive = attribs->Attribute(
"CaseSensitive") ? atol(attribs->Attribute(
"CaseSensitive")) != 0 :
false;
280 std::set<int> CommentLexerStyles, CharacterLexerStyles, StringLexerStyles, PreprocessorLexerStyles;
281 bool hasLexerStylesSet =
false;
290 if ( hasLexerStylesSet )
305 for (
unsigned int i = 0; i < strarray.Count(); ++i )
308 strarray[i].ToLong(&style);
309 styles.insert((
unsigned int)style);
void SetSampleCode(HighlightLanguage lang, const wxString &sample, int breakLine, int debugLine, int errorLine)
DLLIMPORT wxArrayString GetArrayFromString(const wxString &text, const wxString &separator=DEFAULT_ARRAY_SEP, bool trimSpaces=true)
static Manager * Get()
Use Manager::Get() to get a pointer to its instance Manager::Get() is guaranteed to never return an i...
#define wxSCI_STYLE_INDENTGUIDE
void DoLexer(TiXmlElement *node)
void DoSingleKeywordNode(HighlightLanguage language, TiXmlElement *node, const wxString &nodename)
void 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)
void SetCharacterLexerStyles(HighlightLanguage lang, const std::set< int > &styles)
const wxCharBuffer mb_str(const wxMBConv &conv=wxConvLibc) const
void DoLangAttributes(HighlightLanguage language, TiXmlElement *node)
void Set(unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha=wxALPHA_OPAQUE)
#define wxSCI_STYLE_BRACEBAD
void DoSampleCode(HighlightLanguage language, TiXmlElement *node)
EditorLexerLoader(EditorColourSet *target)
int Replace(wxString *text, const wxString &replacement, size_t maxMatches=0) const
wxString FileName() const
DLLIMPORT wxString cbC2U(const char *str)
Return str as a proper unicode-compatible string.
void Load(LoaderBase *loader)
void SetPreprocessorLexerStyles(HighlightLanguage lang, const std::set< int > &styles)
void SetFileMasks(HighlightLanguage lang, const wxString &masks, const wxString &=_(","))
void SetKeywords(HighlightLanguage lang, int idx, const wxString &keywords)
void SetCaseSensitivity(HighlightLanguage lang, bool CaseSensitive)
LogManager * GetLogManager() const
const int cbHIGHLIGHT_LINE
const wxString & _(const wxString &string)
EditorColourSet * m_pTarget
void Log(const wxString &msg, int i=app_log, Logger::level lv=Logger::info)
HighlightLanguage AddHighlightLanguage(int lexer, const wxString &name)
bool DoLangAttributesLexerStyles(TiXmlElement *attribs, const char *attributeName, std::set< int > &styles)
void SetStringLexerStyles(HighlightLanguage lang, const std::set< int > &styles)
virtual ~EditorLexerLoader()
void DoStyles(HighlightLanguage language, TiXmlElement *node)
#define wxSCI_STYLE_BRACELIGHT
void DoKeywords(HighlightLanguage language, TiXmlElement *node)