/* This file is part of Patchage. * Copyright 2007-2020 David Robillard * * Patchage is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation, either version 3 of the License, or (at your option) * any later version. * * Patchage is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. * * You should have received a copy of the GNU General Public License * along with Patchage. If not, see . */ #ifndef PATCHAGE_TEXTVIEWLOG_HPP #define PATCHAGE_TEXTVIEWLOG_HPP #include "ILog.hpp" #include #include #include namespace Gtk { class TextView; } // namespace Gtk namespace patchage { template class Widget; /// Log that writes colored messages to a Gtk TextView class TextViewLog : public ILog { public: explicit TextViewLog(Widget& text_view); TextViewLog(const TextViewLog&) = delete; TextViewLog& operator=(const TextViewLog&) = delete; TextViewLog(TextViewLog&&) = delete; TextViewLog& operator=(TextViewLog&&) = delete; ~TextViewLog() override = default; void info(const std::string& msg) override; void error(const std::string& msg) override; void warning(const std::string& msg) override; int min_height() const; const Widget& text_view() const { return _text_view; } Widget& text_view() { return _text_view; } private: Glib::RefPtr _error_tag; Glib::RefPtr _warning_tag; Widget& _text_view; }; } // namespace patchage #endif // PATCHAGE_TEXTVIEWLOG_HPP