#pragma once #include "autocomplete.h" #include "mutex.h" #include "source.h" #include namespace Source { class GenericView : public View { public: GenericView(const boost::filesystem::path &file_path, const Glib::RefPtr &language); ~GenericView(); private: void parse_language_file(bool &has_context_class, const boost::property_tree::ptree &pt); std::set keywords; bool is_word_iter(const Gtk::TextIter &iter); std::pair get_word(Gtk::TextIter iter); std::vector> get_words(const Gtk::TextIter &start, const Gtk::TextIter &end); Mutex buffer_words_mutex ACQUIRED_AFTER(autocomplete.prefix_mutex); std::map buffer_words GUARDED_BY(buffer_words_mutex); bool show_prefix_buffer_word GUARDED_BY(buffer_words_mutex) = false; /// To avoid showing the current word if it is unique in document void setup_buffer_words(); Autocomplete autocomplete; std::vector autocomplete_comment; std::vector autocomplete_insert; void setup_autocomplete(); }; } // namespace Source