From b38489d41c942efb670618927a19e629584aba13 Mon Sep 17 00:00:00 2001 From: eidheim Date: Mon, 27 Jul 2015 15:55:14 +0200 Subject: [PATCH] Added style example with commented out search path addition. --- juci/source.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/juci/source.cc b/juci/source.cc index 88b510a..f97c5b5 100644 --- a/juci/source.cc +++ b/juci/source.cc @@ -242,6 +242,16 @@ bool Source::View::on_key_press_event(GdkEventKey* key) { //// GenericView //// ///////////////////// Source::GenericView::GenericView(const std::string& file_path, const std::string& project_path) : View(file_path, project_path) { + auto style_scheme_manager=Gsv::StyleSchemeManager::get_default(); + //TODO: add?: style_scheme_manager->prepend_search_path("~/.juci/"); + auto scheme=style_scheme_manager->get_scheme("classic"); + if(scheme) { + get_source_buffer()->set_style_scheme(scheme); + auto style=scheme->get_style("def:comment"); + if(style) + cout << "TODO, in progress: def:comment in scheme " << scheme->get_name() << " has color " << style->property_foreground() << endl; + } + auto language_manager=Gsv::LanguageManager::get_default(); bool result_uncertain = false; auto content_type = Gio::content_type_guess(file_path, get_buffer()->get_text(), result_uncertain);