1 /* 2 * Copyright (C) 1999-2015 Paul Davis <paul@linuxaudiosystems.com> 3 * Copyright (C) 2015-2017 Robin Gareus <robin@gareus.org> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License along 16 * with this program; if not, write to the Free Software Foundation, Inc., 17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 */ 19 20 #ifndef __pbd_gtkmm_textviewer_h__ 21 #define __pbd_gtkmm_textviewer_h__ 22 23 #include <string> 24 25 #include <gtkmm/box.h> 26 #include <gtkmm/button.h> 27 #include <gtkmm/textview.h> 28 #include <gtkmm/scrolledwindow.h> 29 #include <gtkmm/window.h> 30 31 #include "pbd/transmitter.h" 32 33 #include "gtkmm2ext/visibility.h" 34 35 namespace Gtkmm2ext { 36 37 class LIBGTKMM2EXT_API TextViewer : public Gtk::Window, public Transmitter 38 { 39 Gtk::TextView etext; 40 Gtk::VBox vbox1; 41 Gtk::VBox vbox2; 42 Gtk::ScrolledWindow scrollwin; 43 Gtk::Button dismiss; 44 bool _editable; 45 46 void toggle_edit (); 47 void toggle_word_wrap (); 48 void signal_released_handler (); 49 50 public: 51 TextViewer (size_t width, size_t height); text()52 Gtk::TextView& text() { return etext; } dismiss_button()53 Gtk::Button& dismiss_button() { return dismiss; } 54 55 void scroll_to_bottom (); 56 57 void deliver (); 58 }; 59 60 } /* namespace */ 61 62 #endif // __pbd_gtkmm_textviewer_h__ 63