Browse Source

Further cleanup of styles.

merge-requests/365/head
eidheim 10 years ago
parent
commit
a59b0fd13f
  1. 40
      src/files.h
  2. 19
      src/source.cc

40
src/files.h

@ -10,9 +10,10 @@ const std::string configjson =
" \"font\": \"Monospace\", //Use \"\" for default font, and for instance \"Monospace 12\" to also set size.\n"
" \"clang_types\": {\n"
" \"43\": \"def:type\",\n"
" \"46\": \"def:preprocessor\",\n"
" \"45\": \"def:type\",\n"
" \"46\": \"def:identifier\",\n"
" \"109\": \"def:constant\",\n"
" \"500\": \"c:included-file\",\n"
" \"500\": \"def:preprocessor\",\n"
" \"702\": \"def:statement\",\n"
" \"705\": \"def:comment\"\n"
" },\n"
@ -127,14 +128,15 @@ const std::string juci_style =
" <_description>Default juCi++ style</_description>\n"
"\n"
" <!-- Palette -->\n"
" <color name=\"white\" value=\"#FFFFFF\"/>\n"
" <color name=\"black\" value=\"#000000\"/>\n"
" <color name=\"gray\" value=\"#888888\"/>\n"
" <color name=\"red\" value=\"#FF0000\"/>\n"
" <color name=\"green\" value=\"#008800\"/>\n"
" <color name=\"blue\" value=\"#0000FF\"/>\n"
" <color name=\"yellow\" value=\"#FFFF00\"/>\n"
" <color name=\"orange\" value=\"#FF8800\"/>\n"
" <color name=\"white\" value=\"#FFFFFF\"/>\n"
" <color name=\"black\" value=\"#000000\"/>\n"
" <color name=\"gray\" value=\"#888888\"/>\n"
" <color name=\"red\" value=\"#CC0000\"/>\n"
" <color name=\"green\" value=\"#008800\"/>\n"
" <color name=\"blue\" value=\"#0000FF\"/>\n"
" <color name=\"yellow\" value=\"#FFFF00\"/>\n"
" <color name=\"orange\" value=\"#FF8800\"/>\n"
" <color name=\"purple\" value=\"#990099\"/>\n"
"\n"
" <!-- Global Settings -->\n"
" <style name=\"current-line\" background=\"#eeeeec\"/>\n"
@ -147,21 +149,15 @@ const std::string juci_style =
" <!-- Search Matching -->\n"
" <style name=\"search-match\" background=\"yellow\"/>\n"
"\n"
" <!-- Comments -->\n"
" <!-- Programming Language -->\n"
" <style name=\"def:comment\" foreground=\"gray\"/>\n"
"\n"
" <!-- Constants -->\n"
" <style name=\"def:constant\" foreground=\"#CC0000\"/>\n"
"\n"
" <!-- Statements -->\n"
" <style name=\"def:constant\" foreground=\"red\"/>\n"
" <style name=\"def:statement\" foreground=\"blue\"/>\n"
" <style name=\"def:type\" foreground=\"blue\"/>\n"
" <style name=\"def:identifier\" foreground=\"purple\"/>\n"
" <style name=\"def:preprocessor\" foreground=\"green\"/>\n"
"\n"
" <!-- Types -->\n"
" <style name=\"def:type\" foreground=\"#0066FF\"/>\n"
"\n"
" <!-- Others -->\n"
" <style name=\"c:included-file\" foreground=\"green\"/>\n"
" <style name=\"def:preprocessor\" foreground=\"#990099\"/>\n"
" <!-- Other -->\n"
" <style name=\"def:error\" foreground=\"red\"/>\n"
" <style name=\"def:warning\" foreground=\"orange\"/>\n"
" <style name=\"def:note\" foreground=\"black\" background=\"yellow\"/>\n"

19
src/source.cc

@ -394,8 +394,10 @@ clang::Index Source::ClangViewParse::clang_index(0, 0);
Source::ClangViewParse::ClangViewParse(const boost::filesystem::path &file_path, const boost::filesystem::path& project_path):
Source::View(file_path), project_path(project_path) {
auto scheme = get_source_buffer()->get_style_scheme();
auto tag_table=get_buffer()->get_tag_table();
for (auto &item : Singleton::Config::source()->clang_types) {
auto style = scheme->get_style(item.second);
if(!tag_table->lookup(item.second)) {
auto style = scheme->get_style(item.second);
auto tag = get_source_buffer()->create_tag(item.second);
if (style) {
DEBUG("Style " + item.second + " found in style " + scheme->get_name());
@ -405,12 +407,13 @@ Source::View(file_path), project_path(project_path) {
tag->property_background() = style->property_background();
if (style->property_strikethrough_set())
tag->property_strikethrough() = style->property_strikethrough();
// // if (style->property_bold_set()) tag->property_weight() = style->property_bold();
// // if (style->property_italic_set()) tag->property_italic() = style->property_italic();
// // if (style->property_line_background_set()) tag->property_line_background() = style->property_line_background();
// // if (style->property_underline_set()) tag->property_underline() = style->property_underline();
} else
DEBUG("Style " + item.second + " not found in " + scheme->get_name());
// // if (style->property_bold_set()) tag->property_weight() = style->property_bold();
// // if (style->property_italic_set()) tag->property_italic() = style->property_italic();
// // if (style->property_line_background_set()) tag->property_line_background() = style->property_line_background();
// // if (style->property_underline_set()) tag->property_underline() = style->property_underline();
} else
DEBUG("Style " + item.second + " not found in " + scheme->get_name());
}
}
INFO("Tagtable filled");
@ -634,7 +637,7 @@ void Source::ClangViewParse::update_syntax() {
try {
last_syntax_tags.emplace(Singleton::Config::source()->clang_types.at(type));
} catch (std::exception) {
cout << range.kind << ": " << range.offsets.first.line << ", " << range.offsets.first.index << endl;
//cout << range.kind << ": " << range.offsets.first.line << ", " << range.offsets.first.index << endl;
continue;
}

Loading…
Cancel
Save