#ifndef JUCI_SOURCE_H_ #define JUCI_SOURCE_H_ #include #include #include #include "gtkmm.h" #include using std::string; namespace Source { class Theme { public: const std::unordered_map& tagtable() const; const std::unordered_map& typetable() const; void SetTagTable(const std::unordered_map &tagtable); void InsertTag(const string &key, const string &value); void SetTypeTable(const std::unordered_map &tagtable); void InsertType(const string &key, const string &value); private: std::unordered_map tagtable_; std::unordered_map typetable_; string background_; }; // class Theme class View : public Gtk::TextView { public: View(); string UpdateLine(); void ApplyTheme(const Theme &theme); void OnOpenFile(std::vector &locations, const Theme &theme); private: string GetLine(const Gtk::TextIter &begin); }; // class View class Model{ public: Model(); Theme& theme(); const string filepath(); void SetFilePath(const string &filepath); void SetSourceLocations( const std::vector &locations); std::vector& getSourceLocations() { return locations_; } private: Theme theme_; string filepath_; std::vector locations_; }; class Controller { public: Controller(); View& view(); Model& model(); void OnNewEmptyFile(); void OnOpenFile(const string &filename); Glib::RefPtr buffer(); private: void OnLineEdit(); void OnSaveFile(); protected: View view_; Model model_; }; // class Controller } // namespace Source #endif // JUCI_SOURCE_H_