summaryrefslogtreecommitdiffstats
path: root/src/gui/MessagesWindow.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-08-01 03:43:23 -0400
committerDavid Robillard <d@drobilla.net>2016-08-01 03:44:00 -0400
commit902703efa9425a0630053c10229de911e23a2a43 (patch)
tree078b44cf205f8f7a3265142ff95b36f08f56fa05 /src/gui/MessagesWindow.hpp
parentff6d8a87f9569a42c7827428f2329280c9b633b9 (diff)
downloadingen-902703efa9425a0630053c10229de911e23a2a43.tar.gz
ingen-902703efa9425a0630053c10229de911e23a2a43.tar.bz2
ingen-902703efa9425a0630053c10229de911e23a2a43.zip
Show colorized log output in messages window
Diffstat (limited to 'src/gui/MessagesWindow.hpp')
-rw-r--r--src/gui/MessagesWindow.hpp23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/gui/MessagesWindow.hpp b/src/gui/MessagesWindow.hpp
index f3215daf..193ef18d 100644
--- a/src/gui/MessagesWindow.hpp
+++ b/src/gui/MessagesWindow.hpp
@@ -1,6 +1,6 @@
/*
This file is part of Ingen.
- Copyright 2007-2015 David Robillard <http://drobilla.net/>
+ Copyright 2007-2016 David Robillard <http://drobilla.net/>
Ingen is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free
@@ -17,11 +17,14 @@
#ifndef INGEN_GUI_MESSAGESWINDOW_HPP
#define INGEN_GUI_MESSAGESWINDOW_HPP
+#include <mutex>
+#include <sstream>
#include <string>
#include <gtkmm/builder.h>
#include <gtkmm/button.h>
#include <gtkmm/textview.h>
+#include "lv2/lv2plug.in/ns/ext/log/log.h"
#include "Window.hpp"
@@ -41,14 +44,24 @@ public:
MessagesWindow(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& xml);
- void post(const std::string& str);
+ void init_window(App& app);
+
+ int log(LV2_URID type, const char* fmt, va_list args);
+ void flush();
+
+ void post_error(const std::string& str);
private:
void clear_clicked();
- Gtk::TextView* _textview;
- Gtk::Button* _clear_button;
- Gtk::Button* _close_button;
+ std::mutex _mutex;
+ std::stringstream _stream;
+ Gtk::TextView* _textview;
+ Gtk::Button* _clear_button;
+ Gtk::Button* _close_button;
+
+ Glib::RefPtr<Gtk::TextTag> _error_tag;
+ std::map< LV2_URID, Glib::RefPtr<Gtk::TextTag> > _tags;
};
} // namespace GUI