summaryrefslogtreecommitdiffstats
path: root/src/gui/PluginMenu.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/PluginMenu.hpp')
-rw-r--r--src/gui/PluginMenu.hpp31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/gui/PluginMenu.hpp b/src/gui/PluginMenu.hpp
index 6c7aa6b0..eb0a565a 100644
--- a/src/gui/PluginMenu.hpp
+++ b/src/gui/PluginMenu.hpp
@@ -17,20 +17,28 @@
#ifndef INGEN_GUI_PLUGINMENU_HPP
#define INGEN_GUI_PLUGINMENU_HPP
-#include "ingen/World.hpp"
-#include "ingen/types.hpp"
-#include "lilv/lilv.h"
+#include <lilv/lilv.h>
#include <gtkmm/menu.h>
+#include <sigc++/signal.h>
#include <cstddef>
#include <map>
+#include <memory>
#include <set>
#include <string>
+namespace Gtk {
+class MenuItem;
+} // namespace Gtk
+
namespace ingen {
-namespace client { class PluginModel; }
+class World;
+
+namespace client {
+class PluginModel;
+} // namespace client
namespace gui {
@@ -42,16 +50,18 @@ namespace gui {
class PluginMenu : public Gtk::Menu
{
public:
- PluginMenu(ingen::World& world);
+ explicit PluginMenu(ingen::World& world);
void clear();
- void add_plugin(SPtr<client::PluginModel> p);
+ void add_plugin(const std::shared_ptr<client::PluginModel>& p);
- sigc::signal< void, WPtr<client::PluginModel> > signal_load_plugin;
+ sigc::signal<void, std::weak_ptr<client::PluginModel>> signal_load_plugin;
private:
struct MenuRecord {
- MenuRecord(Gtk::MenuItem* i, Gtk::Menu* m) : item(i), menu(m) {}
+ MenuRecord(Gtk::MenuItem* i, Gtk::Menu* m) noexcept : item(i), menu(m)
+ {}
+
Gtk::MenuItem* item;
Gtk::Menu* menu;
};
@@ -66,9 +76,10 @@ private:
const LV2Children& children,
std::set<const char*>& ancestors);
- void add_plugin_to_menu(MenuRecord& menu, SPtr<client::PluginModel> p);
+ void add_plugin_to_menu(MenuRecord& menu,
+ const std::shared_ptr<client::PluginModel>& p);
- void load_plugin(WPtr<client::PluginModel> weak_plugin);
+ void load_plugin(const std::weak_ptr<client::PluginModel>& weak_plugin);
ingen::World& _world;
MenuRecord _classless_menu;