diff options
Diffstat (limited to 'src/gui/NodeModule.cpp')
-rw-r--r-- | src/gui/NodeModule.cpp | 69 |
1 files changed, 37 insertions, 32 deletions
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp index fe111572..deb8fe52 100644 --- a/src/gui/NodeModule.cpp +++ b/src/gui/NodeModule.cpp @@ -25,28 +25,30 @@ #include "SubgraphModule.hpp" #include "WidgetFactory.hpp" #include "WindowFactory.hpp" - -#include "ganv/Port.hpp" -#include "ingen/Atom.hpp" -#include "ingen/Configuration.hpp" -#include "ingen/Forge.hpp" -#include "ingen/Interface.hpp" -#include "ingen/Log.hpp" -#include "ingen/Properties.hpp" -#include "ingen/Resource.hpp" -#include "ingen/URIs.hpp" -#include "ingen/World.hpp" -#include "ingen/client/BlockModel.hpp" -#include "ingen/client/GraphModel.hpp" // IWYU pragma: keep -#include "ingen/client/PluginModel.hpp" -#include "ingen/client/PluginUI.hpp" -#include "ingen/client/PortModel.hpp" -#include "lv2/atom/util.h" -#include "raul/Path.hpp" -#include "raul/Symbol.hpp" +#include "ingen_config.h" + +#include <ganv/Module.hpp> +#include <ganv/Port.hpp> +#include <ingen/Atom.hpp> +#include <ingen/Configuration.hpp> +#include <ingen/Forge.hpp> +#include <ingen/Interface.hpp> +#include <ingen/Log.hpp> +#include <ingen/Properties.hpp> +#include <ingen/Resource.hpp> +#include <ingen/URI.hpp> +#include <ingen/URIs.hpp> +#include <ingen/World.hpp> +#include <ingen/client/BlockModel.hpp> +#include <ingen/client/GraphModel.hpp> +#include <ingen/client/PluginModel.hpp> +#include <ingen/client/PluginUI.hpp> +#include <ingen/client/PortModel.hpp> +#include <lv2/atom/util.h> +#include <raul/Path.hpp> +#include <raul/Symbol.hpp> #include <glibmm/main.h> -#include <glibmm/signalproxy.h> #include <glibmm/ustring.h> #include <gtkmm/container.h> #include <gtkmm/eventbox.h> @@ -55,6 +57,7 @@ #include <sigc++/adaptors/bind.h> #include <sigc++/adaptors/retype_return.h> #include <sigc++/functors/mem_fun.h> +#include <sigc++/functors/slot.h> #include <sigc++/signal.h> #include <cassert> @@ -77,9 +80,6 @@ NodeModule::NodeModule(GraphCanvas& canvas, const std::shared_ptr<const BlockModel>& block) : Ganv::Module(canvas, block->path().symbol(), 0, 0, true) , _block(block) - , _gui_widget(nullptr) - , _gui_window(nullptr) - , _initialised(false) { block->signal_new_port().connect( sigc::mem_fun(this, &NodeModule::new_port_view)); @@ -129,7 +129,7 @@ bool NodeModule::idle_init() { if (_block->ports().empty()) { - return true; // Need to embed GUI, but ports haven't shown up yet + return true; // Need to embed GUI, but ports haven't shown up yet } // Ports have arrived, embed GUI and deregister this callback @@ -209,7 +209,7 @@ NodeModule::show_human_names(bool b) if (name_property.type() == uris.forge.String) { label = name_property.ptr<char>(); } else { - Glib::ustring hn = block()->plugin_model()->port_human_name( + const Glib::ustring hn = block()->plugin_model()->port_human_name( port->model()->index()); if (!hn.empty()) { label = hn; @@ -410,9 +410,9 @@ NodeModule::popup_gui() _gui_window->present(); return true; - } else { - app().log().warn("No LV2 GUI for %1%\n", _block->path()); } + + app().log().warn("No LV2 GUI for %1%\n", _block->path()); } return false; @@ -451,9 +451,13 @@ NodeModule::on_event(GdkEvent* ev) { if (ev->type == GDK_BUTTON_PRESS && ev->button.button == 3) { return show_menu(&ev->button); - } else if (ev->type == GDK_2BUTTON_PRESS) { + } + + if (ev->type == GDK_2BUTTON_PRESS) { return on_double_click(&ev->button); - } else if (ev->type == GDK_ENTER_NOTIFY) { + } + + if (ev->type == GDK_ENTER_NOTIFY) { GraphBox* const box = app().window_factory()->graph_box( std::dynamic_pointer_cast<const GraphModel>(_block->parent())); if (box) { @@ -530,9 +534,10 @@ NodeModule::on_selected(gboolean selected) if (selected && win->documentation_is_visible()) { std::string doc; - bool html = false; -#ifdef HAVE_WEBKIT - html = true; +#if USE_WEBKIT + const bool html = true; +#else + const bool html = false; #endif if (block()->plugin_model()) { doc = block()->plugin_model()->documentation(html); |