From 4e91c3e467c06bee6564c854d45adf25c4fb3331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lien=20Sell=C3=A6g?= Date: Tue, 17 Mar 2015 09:24:53 +0100 Subject: [PATCH] Teddy --- juci/source.cc | 18 +++++++++--------- juci/source.h | 13 ++++++++++++- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/juci/source.cc b/juci/source.cc index ca45c53..1739386 100644 --- a/juci/source.cc +++ b/juci/source.cc @@ -31,8 +31,8 @@ string Source::View::GetLine(const Gtk::TextIter &begin) { // Applies theme in textview void Source::View::ApplyTheme(const Source::Theme &theme) { for (auto &item : theme.tagtable()) { - std::cout << "Apply: f: " << item.first << ", s: " << - item.second << std::endl; + // std::cout << "Apply: f: " << item.first << ", s: " << + // item.second << std::endl; get_buffer()->create_tag(item.first)->property_foreground() = item.second; } } @@ -56,15 +56,15 @@ void Source::View::OnOpenFile(std::vector &locations, if (end < 0) end = 0; if (begin < 0) begin = 0; - std::cout << "Libc: "; - std::cout << "type: " << type; - std::cout << " linum_s: " << linum_start+1 << " linum_e: " << linum_end+1; - std::cout << ", begin: " << begin << ", end: " << end << std::endl; + // std::cout << "Libc: "; + // std::cout << "type: " << type; + // std::cout << " linum_s: " << linum_start+1 << " linum_e: " << linum_end+1; + // std::cout << ", begin: " << begin << ", end: " << end << std::endl; Gtk::TextIter begin_iter = buffer->get_iter_at_line_offset(linum_start, begin); Gtk::TextIter end_iter = buffer->get_iter_at_line_offset(linum_end, end); - std::cout << get_buffer()->get_text(begin_iter, end_iter) << std::endl; + // std::cout << get_buffer()->get_text(begin_iter, end_iter) << std::endl; if (begin_iter.get_line() == end_iter.get_line()) { buffer->apply_tag_by_name(theme.typetable().at(type), begin_iter, end_iter); @@ -108,7 +108,7 @@ void Source::Theme::SetTagTable( //// Model //// /////////////// Source::Model::Model() : - theme_() {/* + theme_() { std::cout << "Model constructor run" << std::endl; boost::property_tree::ptree pt; boost::property_tree::json_parser::read_json("config.json", pt); @@ -124,7 +124,7 @@ Source::Model::Model() : // std::cout << "inserting type. " << pi.first << pi.second.get_value() << std::endl; } } - }*/ + } } Source::Theme& Source::Model::theme() { diff --git a/juci/source.h b/juci/source.h index 135d0a3..65a145d 100644 --- a/juci/source.h +++ b/juci/source.h @@ -10,7 +10,18 @@ using std::string; namespace Source { - class Theme { + + class Config() { + // læs json + + // + + private: + + } + + + class Config { public: const std::unordered_map& tagtable() const; const std::unordered_map& typetable() const;