summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-08-02 15:23:19 +0200
committerDavid Robillard <d@drobilla.net>2020-08-02 15:23:19 +0200
commitbdbdf42f3fe990c713c5437724db39274c387eee (patch)
tree7f921a04fd580da6bcb6fc8975fa2aebfcd93e0f /src/gui
parentec0b87a18623c17c16f6a648fcf277abe14142b7 (diff)
downloadingen-bdbdf42f3fe990c713c5437724db39274c387eee.tar.gz
ingen-bdbdf42f3fe990c713c5437724db39274c387eee.tar.bz2
ingen-bdbdf42f3fe990c713c5437724db39274c387eee.zip
Remove std::shared_ptr alias
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/App.cpp10
-rw-r--r--src/gui/App.hpp27
-rw-r--r--src/gui/Arc.cpp12
-rw-r--r--src/gui/Arc.hpp14
-rw-r--r--src/gui/BreadCrumbs.cpp8
-rw-r--r--src/gui/BreadCrumbs.hpp30
-rw-r--r--src/gui/ConnectWindow.cpp10
-rw-r--r--src/gui/ConnectWindow.hpp4
-rw-r--r--src/gui/GraphBox.cpp18
-rw-r--r--src/gui/GraphBox.hpp38
-rw-r--r--src/gui/GraphCanvas.cpp47
-rw-r--r--src/gui/GraphCanvas.hpp32
-rw-r--r--src/gui/GraphPortModule.cpp14
-rw-r--r--src/gui/GraphPortModule.hpp14
-rw-r--r--src/gui/GraphTreeWindow.cpp37
-rw-r--r--src/gui/GraphTreeWindow.hpp27
-rw-r--r--src/gui/GraphView.cpp8
-rw-r--r--src/gui/GraphView.hpp24
-rw-r--r--src/gui/GraphWindow.hpp11
-rw-r--r--src/gui/LoadGraphWindow.cpp9
-rw-r--r--src/gui/LoadGraphWindow.hpp11
-rw-r--r--src/gui/LoadPluginWindow.cpp40
-rw-r--r--src/gui/LoadPluginWindow.hpp29
-rw-r--r--src/gui/NewSubgraphWindow.cpp6
-rw-r--r--src/gui/NewSubgraphWindow.hpp13
-rw-r--r--src/gui/NodeMenu.cpp7
-rw-r--r--src/gui/NodeMenu.hpp5
-rw-r--r--src/gui/NodeModule.cpp26
-rw-r--r--src/gui/NodeModule.hpp35
-rw-r--r--src/gui/ObjectMenu.cpp3
-rw-r--r--src/gui/ObjectMenu.hpp33
-rw-r--r--src/gui/PluginMenu.cpp5
-rw-r--r--src/gui/PluginMenu.hpp8
-rw-r--r--src/gui/Port.cpp39
-rw-r--r--src/gui/Port.hpp30
-rw-r--r--src/gui/PortMenu.cpp5
-rw-r--r--src/gui/PortMenu.hpp7
-rw-r--r--src/gui/PropertiesWindow.cpp5
-rw-r--r--src/gui/PropertiesWindow.hpp35
-rw-r--r--src/gui/RDFS.cpp4
-rw-r--r--src/gui/RDFS.hpp8
-rw-r--r--src/gui/RenameWindow.cpp5
-rw-r--r--src/gui/RenameWindow.hpp9
-rw-r--r--src/gui/SubgraphModule.cpp7
-rw-r--r--src/gui/SubgraphModule.hpp11
-rw-r--r--src/gui/ThreadedLoader.cpp13
-rw-r--r--src/gui/ThreadedLoader.hpp26
-rw-r--r--src/gui/WindowFactory.cpp34
-rw-r--r--src/gui/WindowFactory.hpp42
-rw-r--r--src/gui/ingen_gui.cpp11
-rw-r--r--src/gui/ingen_gui_lv2.cpp32
51 files changed, 492 insertions, 446 deletions
diff --git a/src/gui/App.cpp b/src/gui/App.cpp
index 76048edb..55787d44 100644
--- a/src/gui/App.cpp
+++ b/src/gui/App.cpp
@@ -112,7 +112,7 @@ App::~App()
delete _window_factory;
}
-SPtr<App>
+std::shared_ptr<App>
App::create(ingen::World& world)
{
suil_init(&world.argc(), &world.argv(), SUIL_ARG_NONE);
@@ -128,7 +128,7 @@ App::create(ingen::World& world)
_main = new Gtk::Main(&world.argc(), &world.argv());
}
- auto app = SPtr<App>{new App(world)};
+ auto app = std::shared_ptr<App>(new App(world));
// Load configuration settings
app->style()->load_settings();
@@ -160,7 +160,7 @@ App::run()
}
void
-App::attach(const SPtr<ingen::Interface>& client)
+App::attach(const std::shared_ptr<ingen::Interface>& client)
{
assert(!_client);
assert(!_store);
@@ -215,7 +215,7 @@ App::request_plugins_if_necessary()
}
}
-SPtr<SigClientInterface>
+std::shared_ptr<SigClientInterface>
App::sig_client()
{
auto qi = std::dynamic_pointer_cast<QueuedInterface>(_client);
@@ -225,7 +225,7 @@ App::sig_client()
return std::dynamic_pointer_cast<SigClientInterface>(_client);
}
-SPtr<Serialiser>
+std::shared_ptr<Serialiser>
App::serialiser()
{
return _world.serialiser();
diff --git a/src/gui/App.hpp b/src/gui/App.hpp
index 0b504361..cef884d6 100644
--- a/src/gui/App.hpp
+++ b/src/gui/App.hpp
@@ -23,7 +23,6 @@
#include "ingen/Status.hpp"
#include "ingen/World.hpp"
#include "ingen/ingen.h"
-#include "ingen/memory.hpp"
#include "lilv/lilv.h"
#include "raul/Deletable.hpp"
@@ -74,7 +73,7 @@ public:
void error_message(const std::string& str);
- void attach(const SPtr<ingen::Interface>& client);
+ void attach(const std::shared_ptr<ingen::Interface>& client);
void detach();
@@ -117,17 +116,17 @@ public:
Style* style() const { return _style; }
WindowFactory* window_factory() const { return _window_factory; }
- ingen::Forge& forge() const { return _world.forge(); }
- SPtr<ingen::Interface> interface() const { return _world.interface(); }
- SPtr<ingen::Interface> client() const { return _client; }
- SPtr<client::ClientStore> store() const { return _store; }
- SPtr<ThreadedLoader> loader() const { return _loader; }
+ ingen::Forge& forge() const { return _world.forge(); }
+ std::shared_ptr<ingen::Interface> interface() const { return _world.interface(); }
+ std::shared_ptr<ingen::Interface> client() const { return _client; }
+ std::shared_ptr<client::ClientStore> store() const { return _store; }
+ std::shared_ptr<ThreadedLoader> loader() const { return _loader; }
- SPtr<client::SigClientInterface> sig_client();
+ std::shared_ptr<client::SigClientInterface> sig_client();
- SPtr<Serialiser> serialiser();
+ std::shared_ptr<Serialiser> serialiser();
- static SPtr<App> create(ingen::World& world);
+ static std::shared_ptr<App> create(ingen::World& world);
void run();
@@ -158,10 +157,10 @@ protected:
static Gtk::Main* _main;
- SPtr<ingen::Interface> _client;
- SPtr<client::ClientStore> _store;
- SPtr<ThreadedLoader> _loader;
- SPtr<StreamWriter> _dumper;
+ std::shared_ptr<ingen::Interface> _client;
+ std::shared_ptr<client::ClientStore> _store;
+ std::shared_ptr<ThreadedLoader> _loader;
+ std::shared_ptr<StreamWriter> _dumper;
Style* _style;
diff --git a/src/gui/Arc.cpp b/src/gui/Arc.cpp
index 02136770..60425ab9 100644
--- a/src/gui/Arc.cpp
+++ b/src/gui/Arc.cpp
@@ -26,14 +26,14 @@
namespace ingen {
namespace gui {
-Arc::Arc(Ganv::Canvas& canvas,
- const SPtr<const client::ArcModel>& model,
- Ganv::Node* src,
- Ganv::Node* dst)
+Arc::Arc(Ganv::Canvas& canvas,
+ const std::shared_ptr<const client::ArcModel>& model,
+ Ganv::Node* src,
+ Ganv::Node* dst)
: Ganv::Edge(canvas, src, dst), _arc_model(model)
{
- SPtr<const client::ObjectModel> tparent = model->tail()->parent();
- SPtr<const client::BlockModel> tparent_block;
+ std::shared_ptr<const client::ObjectModel> tparent = model->tail()->parent();
+ std::shared_ptr<const client::BlockModel> tparent_block;
if ((tparent_block = std::dynamic_pointer_cast<const client::BlockModel>(tparent))) {
if (tparent_block->plugin_uri() == NS_INTERNALS "BlockDelay") {
g_object_set(_gobj, "dash-length", 4.0, nullptr);
diff --git a/src/gui/Arc.hpp b/src/gui/Arc.hpp
index a20c4e5f..ad40d6bf 100644
--- a/src/gui/Arc.hpp
+++ b/src/gui/Arc.hpp
@@ -18,9 +18,9 @@
#define INGEN_GUI_ARC_HPP
#include "ganv/Edge.hpp"
-#include "ingen/memory.hpp"
#include <cassert>
+#include <memory>
namespace ingen {
@@ -35,15 +35,15 @@ namespace gui {
class Arc : public Ganv::Edge
{
public:
- Arc(Ganv::Canvas& canvas,
- const SPtr<const client::ArcModel>& model,
- Ganv::Node* src,
- Ganv::Node* dst);
+ Arc(Ganv::Canvas& canvas,
+ const std::shared_ptr<const client::ArcModel>& model,
+ Ganv::Node* src,
+ Ganv::Node* dst);
- SPtr<const client::ArcModel> model() const { return _arc_model; }
+ std::shared_ptr<const client::ArcModel> model() const { return _arc_model; }
private:
- SPtr<const client::ArcModel> _arc_model;
+ std::shared_ptr<const client::ArcModel> _arc_model;
};
} // namespace gui
diff --git a/src/gui/BreadCrumbs.cpp b/src/gui/BreadCrumbs.cpp
index b75c8670..d265443d 100644
--- a/src/gui/BreadCrumbs.cpp
+++ b/src/gui/BreadCrumbs.cpp
@@ -40,7 +40,7 @@ BreadCrumbs::BreadCrumbs(App& app)
set_can_focus(false);
}
-SPtr<GraphView>
+std::shared_ptr<GraphView>
BreadCrumbs::view(const Raul::Path& path)
{
for (const auto& b : _breadcrumbs) {
@@ -58,7 +58,8 @@ BreadCrumbs::view(const Raul::Path& path)
* children preserved.
*/
void
-BreadCrumbs::build(const Raul::Path& path, const SPtr<GraphView>& view)
+BreadCrumbs::build(const Raul::Path& path,
+ const std::shared_ptr<GraphView>& view)
{
bool old_enable_signal = _enable_signal;
_enable_signal = false;
@@ -156,7 +157,8 @@ BreadCrumbs::build(const Raul::Path& path, const SPtr<GraphView>& view)
* match, otherwise ignoring `view`.
*/
BreadCrumbs::BreadCrumb*
-BreadCrumbs::create_crumb(const Raul::Path& path, const SPtr<GraphView>& view)
+BreadCrumbs::create_crumb(const Raul::Path& path,
+ const std::shared_ptr<GraphView>& view)
{
BreadCrumb* but = manage(new BreadCrumb(
path, ((view && path == view->graph()->path()) ? view : nullptr)));
diff --git a/src/gui/BreadCrumbs.hpp b/src/gui/BreadCrumbs.hpp
index 6f42e573..6fcce24c 100644
--- a/src/gui/BreadCrumbs.hpp
+++ b/src/gui/BreadCrumbs.hpp
@@ -21,7 +21,6 @@
#include "ingen/Message.hpp"
#include "ingen/client/GraphModel.hpp"
-#include "ingen/memory.hpp"
#include "raul/Path.hpp"
#include <gtkmm/box.h>
@@ -30,6 +29,7 @@
#include <cassert>
#include <list>
+#include <memory>
#include <string>
namespace ingen {
@@ -45,11 +45,12 @@ class BreadCrumbs : public Gtk::HBox
public:
explicit BreadCrumbs(App& app);
- SPtr<GraphView> view(const Raul::Path& path);
+ std::shared_ptr<GraphView> view(const Raul::Path& path);
- void build(const Raul::Path& path, const SPtr<GraphView>& view);
+ void build(const Raul::Path& path, const std::shared_ptr<GraphView>& view);
- sigc::signal<void, const Raul::Path&, SPtr<GraphView> > signal_graph_selected;
+ sigc::signal<void, const Raul::Path&, std::shared_ptr<GraphView>>
+ signal_graph_selected;
private:
/** Breadcrumb button.
@@ -64,10 +65,9 @@ private:
class BreadCrumb : public Gtk::ToggleButton
{
public:
- BreadCrumb(const Raul::Path& path,
- const SPtr<GraphView>& view = nullptr)
- : _path(path)
- , _view(view)
+ BreadCrumb(const Raul::Path& path,
+ const std::shared_ptr<GraphView>& view = nullptr)
+ : _path(path), _view(view)
{
assert(!view || view->graph()->path() == path);
set_border_width(0);
@@ -76,13 +76,13 @@ private:
show_all();
}
- void set_view(const SPtr<GraphView>& view) {
+ void set_view(const std::shared_ptr<GraphView>& view) {
assert(!view || view->graph()->path() == _path);
_view = view;
}
- const Raul::Path& path() const { return _path; }
- SPtr<GraphView> view() const { return _view; }
+ const Raul::Path& path() const { return _path; }
+ std::shared_ptr<GraphView> view() const { return _view; }
void set_path(const Raul::Path& path) {
remove();
@@ -98,12 +98,12 @@ private:
}
private:
- Raul::Path _path;
- SPtr<GraphView> _view;
+ Raul::Path _path;
+ std::shared_ptr<GraphView> _view;
};
- BreadCrumb* create_crumb(const Raul::Path& path,
- const SPtr<GraphView>& view = nullptr);
+ BreadCrumb* create_crumb(const Raul::Path& path,
+ const std::shared_ptr<GraphView>& view = nullptr);
void breadcrumb_clicked(BreadCrumb* crumb);
diff --git a/src/gui/ConnectWindow.cpp b/src/gui/ConnectWindow.cpp
index 3e5e5d7c..1afc8c6c 100644
--- a/src/gui/ConnectWindow.cpp
+++ b/src/gui/ConnectWindow.cpp
@@ -130,7 +130,7 @@ ConnectWindow::ingen_response(int32_t id,
}
void
-ConnectWindow::set_connected_to(const SPtr<ingen::Interface>& engine)
+ConnectWindow::set_connected_to(const std::shared_ptr<ingen::Interface>& engine)
{
_app->world().set_interface(engine);
@@ -196,10 +196,10 @@ ConnectWindow::connect_remote(const URI& uri)
{
ingen::World& world = _app->world();
- SPtr<SigClientInterface> sci(new SigClientInterface());
- SPtr<QueuedInterface> qi(new QueuedInterface(sci));
+ auto sci = std::make_shared<SigClientInterface>();
+ auto qi = std::make_shared<QueuedInterface>(sci);
- SPtr<ingen::Interface> iface(world.new_interface(uri, qi));
+ std::shared_ptr<ingen::Interface> iface(world.new_interface(uri, qi));
if (iface) {
world.set_interface(iface);
_app->attach(qi);
@@ -486,7 +486,7 @@ ConnectWindow::gtk_callback()
if (ms_since_last >= 250) {
last = now;
if (_mode == Mode::INTERNAL) {
- SPtr<SigClientInterface> client(new SigClientInterface());
+ auto client = std::make_shared<SigClientInterface>();
_app->world().interface()->set_respondee(client);
_app->attach(client);
_app->register_callbacks();
diff --git a/src/gui/ConnectWindow.hpp b/src/gui/ConnectWindow.hpp
index f350e97d..6d0b6f5a 100644
--- a/src/gui/ConnectWindow.hpp
+++ b/src/gui/ConnectWindow.hpp
@@ -20,7 +20,6 @@
#include "Window.hpp"
#include "ingen/Message.hpp"
-#include "ingen/memory.hpp"
#include "lilv/lilv.h"
#include <gtkmm/builder.h>
@@ -33,6 +32,7 @@
#include <gtkmm/spinbutton.h>
#include <cstdint>
+#include <memory>
#include <string>
namespace ingen {
@@ -57,7 +57,7 @@ public:
ConnectWindow(BaseObjectType* cobject,
Glib::RefPtr<Gtk::Builder> xml);
- void set_connected_to(const SPtr<ingen::Interface>& engine);
+ void set_connected_to(const std::shared_ptr<ingen::Interface>& engine);
void start(App& app, ingen::World& world);
bool attached() const { return _finished_connecting; }
diff --git a/src/gui/GraphBox.cpp b/src/gui/GraphBox.cpp
index 2f561959..557c4261 100644
--- a/src/gui/GraphBox.cpp
+++ b/src/gui/GraphBox.cpp
@@ -190,8 +190,8 @@ GraphBox::~GraphBox()
delete _breadcrumbs;
}
-SPtr<GraphBox>
-GraphBox::create(App& app, const SPtr<const GraphModel>& graph)
+std::shared_ptr<GraphBox>
+GraphBox::create(App& app, const std::shared_ptr<const GraphModel>& graph)
{
GraphBox* result = nullptr;
Glib::RefPtr<Gtk::Builder> xml = WidgetFactory::create("graph_win");
@@ -204,7 +204,7 @@ GraphBox::create(App& app, const SPtr<const GraphModel>& graph)
result->_menu_quit->set_sensitive(false);
}
- return SPtr<GraphBox>(result);
+ return std::shared_ptr<GraphBox>(result);
}
void
@@ -244,8 +244,8 @@ GraphBox::set_status_text(const std::string& text)
}
void
-GraphBox::set_graph_from_path(const Raul::Path& path,
- const SPtr<GraphView>& view)
+GraphBox::set_graph_from_path(const Raul::Path& path,
+ const std::shared_ptr<GraphView>& view)
{
if (view) {
assert(view->graph()->path() == path);
@@ -264,8 +264,8 @@ GraphBox::set_graph_from_path(const Raul::Path& path,
* If `view` is null, a new view will be created.
*/
void
-GraphBox::set_graph(const SPtr<const GraphModel>& graph,
- const SPtr<GraphView>& view)
+GraphBox::set_graph(const std::shared_ptr<const GraphModel>& graph,
+ const std::shared_ptr<GraphView>& view)
{
if (!graph || graph == _graph) {
return;
@@ -352,7 +352,7 @@ GraphBox::set_graph(const SPtr<const GraphModel>& graph,
}
void
-GraphBox::graph_port_added(const SPtr<const PortModel>& port)
+GraphBox::graph_port_added(const std::shared_ptr<const PortModel>& port)
{
if (port->is_input() && _app->can_control(port.get())) {
_menu_view_control_window->property_sensitive() = true;
@@ -360,7 +360,7 @@ GraphBox::graph_port_added(const SPtr<const PortModel>& port)
}
void
-GraphBox::graph_port_removed(const SPtr<const PortModel>& port)
+GraphBox::graph_port_removed(const std::shared_ptr<const PortModel>& port)
{
if (!(port->is_input() && _app->can_control(port.get()))) {
return;
diff --git a/src/gui/GraphBox.hpp b/src/gui/GraphBox.hpp
index e2a1ce98..2bb04c54 100644
--- a/src/gui/GraphBox.hpp
+++ b/src/gui/GraphBox.hpp
@@ -17,7 +17,9 @@
#ifndef INGEN_GUI_GRAPH_BOX_HPP
#define INGEN_GUI_GRAPH_BOX_HPP
-#include <string>
+#include "Window.hpp"
+
+#include "ingen/ingen.h"
#include <gtkmm/alignment.h>
#include <gtkmm/box.h>
@@ -28,10 +30,8 @@
#include <gtkmm/scrolledwindow.h>
#include <gtkmm/statusbar.h>
-#include "ingen/ingen.h"
-#include "ingen/memory.hpp"
-
-#include "Window.hpp"
+#include <memory>
+#include <string>
namespace Raul {
class Path;
@@ -70,36 +70,36 @@ public:
~GraphBox() override;
- static SPtr<GraphBox>
- create(App& app, const SPtr<const client::GraphModel>& graph);
+ static std::shared_ptr<GraphBox>
+ create(App& app, const std::shared_ptr<const client::GraphModel>& graph);
void init_box(App& app);
void set_status_text(const std::string& text);
- void set_graph(const SPtr<const client::GraphModel>& graph,
- const SPtr<GraphView>& view);
+ void set_graph(const std::shared_ptr<const client::GraphModel>& graph,
+ const std::shared_ptr<GraphView>& view);
void set_window(GraphWindow* win) { _window = win; }
bool documentation_is_visible() { return _doc_scrolledwindow->is_visible(); }
void set_documentation(const std::string& doc, bool html);
- SPtr<const client::GraphModel> graph() const { return _graph; }
- SPtr<GraphView> view() const { return _view; }
+ std::shared_ptr<const client::GraphModel> graph() const { return _graph; }
+ std::shared_ptr<GraphView> view() const { return _view; }
void show_port_status(const client::PortModel* port,
const Atom& value);
- void
- set_graph_from_path(const Raul::Path& path, const SPtr<GraphView>& view);
+ void set_graph_from_path(const Raul::Path& path,
+ const std::shared_ptr<GraphView>& view);
void object_entered(const client::ObjectModel* model);
void object_left(const client::ObjectModel* model);
private:
- void graph_port_added(const SPtr<const client::PortModel>& port);
- void graph_port_removed(const SPtr<const client::PortModel>& port);
+ void graph_port_added(const std::shared_ptr<const client::PortModel>& port);
+ void graph_port_removed(const std::shared_ptr<const client::PortModel>& port);
void property_changed(const URI& predicate, const Atom& value);
void show_status(const client::ObjectModel* model);
@@ -144,10 +144,10 @@ private:
void event_show_engine();
void event_clipboard_changed(GdkEventOwnerChange* ev);
- App* _app = nullptr;
- SPtr<const client::GraphModel> _graph;
- SPtr<GraphView> _view;
- GraphWindow* _window = nullptr;
+ App* _app = nullptr;
+ std::shared_ptr<const client::GraphModel> _graph;
+ std::shared_ptr<GraphView> _view;
+ GraphWindow* _window = nullptr;
sigc::connection new_port_connection;
sigc::connection removed_port_connection;
diff --git a/src/gui/GraphCanvas.cpp b/src/gui/GraphCanvas.cpp
index 688e034b..23a3ecf5 100644
--- a/src/gui/GraphCanvas.cpp
+++ b/src/gui/GraphCanvas.cpp
@@ -74,17 +74,17 @@ port_order(const GanvPort* a, const GanvPort* b, void* data)
return 0;
}
-GraphCanvas::GraphCanvas(App& app,
- SPtr<const GraphModel> graph,
- int width,
- int height)
- : Canvas(width, height)
- , _app(app)
- , _graph(std::move(graph))
- , _auto_position_count(0)
- , _menu_x(0)
- , _menu_y(0)
- , _paste_count(0)
+GraphCanvas::GraphCanvas(App& app,
+ std::shared_ptr<const GraphModel> graph,
+ int width,
+ int height)
+ : Canvas(width, height)
+ , _app(app)
+ , _graph(std::move(graph))
+ , _auto_position_count(0)
+ , _menu_x(0)
+ , _menu_y(0)
+ , _paste_count(0)
{
Glib::RefPtr<Gtk::Builder> xml = WidgetFactory::create("canvas_menu");
xml->get_widget("canvas_menu", _menu);
@@ -303,7 +303,7 @@ GraphCanvas::show_port_names(bool b)
}
void
-GraphCanvas::add_plugin(const SPtr<PluginModel>& p)
+GraphCanvas::add_plugin(const std::shared_ptr<PluginModel>& p)
{
if (_internal_menu && _app.uris().ingen_Internal == p->type()) {
_internal_menu->items().push_back(
@@ -323,7 +323,7 @@ GraphCanvas::remove_plugin(const URI& uri)
}
void
-GraphCanvas::add_block(const SPtr<const BlockModel>& bm)
+GraphCanvas::add_block(const std::shared_ptr<const BlockModel>& bm)
{
auto pm = std::dynamic_pointer_cast<const GraphModel>(bm);
NodeModule* module = nullptr;
@@ -341,7 +341,7 @@ GraphCanvas::add_block(const SPtr<const BlockModel>& bm)
}
void
-GraphCanvas::remove_block(const SPtr<const BlockModel>& bm)
+GraphCanvas::remove_block(const std::shared_ptr<const BlockModel>& bm)
{
auto i = _views.find(bm);
@@ -356,7 +356,7 @@ GraphCanvas::remove_block(const SPtr<const BlockModel>& bm)
}
void
-GraphCanvas::add_port(const SPtr<const PortModel>& pm)
+GraphCanvas::add_port(const std::shared_ptr<const PortModel>& pm)
{
GraphPortModule* view = GraphPortModule::create(*this, pm);
_views.emplace(pm, view);
@@ -364,7 +364,7 @@ GraphCanvas::add_port(const SPtr<const PortModel>& pm)
}
void
-GraphCanvas::remove_port(const SPtr<const PortModel>& pm)
+GraphCanvas::remove_port(const std::shared_ptr<const PortModel>& pm)
{
auto i = _views.find(pm);
@@ -382,7 +382,7 @@ GraphCanvas::remove_port(const SPtr<const PortModel>& pm)
}
Ganv::Port*
-GraphCanvas::get_port_view(const SPtr<PortModel>& port)
+GraphCanvas::get_port_view(const std::shared_ptr<PortModel>& port)
{
Ganv::Module* module = _views[port];
@@ -409,7 +409,7 @@ GraphCanvas::get_port_view(const SPtr<PortModel>& port)
/** Called when a connection is added to the model. */
void
-GraphCanvas::connection(const SPtr<const ArcModel>& arc)
+GraphCanvas::connection(const std::shared_ptr<const ArcModel>& arc)
{
Ganv::Port* const tail = get_port_view(arc->tail());
Ganv::Port* const head = get_port_view(arc->head());
@@ -424,7 +424,7 @@ GraphCanvas::connection(const SPtr<const ArcModel>& arc)
/** Called when a connection is removed from the model. */
void
-GraphCanvas::disconnection(const SPtr<const ArcModel>& arc)
+GraphCanvas::disconnection(const std::shared_ptr<const ArcModel>& arc)
{
Ganv::Port* const tail = get_port_view(arc->tail());
Ganv::Port* const head = get_port_view(arc->head());
@@ -664,7 +664,7 @@ GraphCanvas::paste()
std::lock_guard<std::mutex> lock(_app.world().rdf_mutex());
const Glib::ustring str = Gtk::Clipboard::get()->wait_for_text();
- SPtr<Parser> parser = _app.loader()->parser();
+ auto parser = _app.loader()->parser();
const URIs& uris = _app.uris();
const Raul::Path& parent = _graph->path();
if (!parser) {
@@ -732,10 +732,11 @@ GraphCanvas::paste()
continue;
}
- const SPtr<Node> node = c.second;
+ const auto node = c.second;
const Raul::Path& old_path = copy_root.child(node->path());
const URI& old_uri = path_to_uri(old_path);
- const Raul::Path& new_path = avoider.map_path(parent.child(node->path()));
+ const Raul::Path& new_path =
+ avoider.map_path(parent.child(node->path()));
// Copy properties, except those that should not be inherited in copies
Properties props = node->properties();
@@ -839,7 +840,7 @@ GraphCanvas::menu_add_port(const string& sym_base,
void
GraphCanvas::load_plugin(const std::weak_ptr<PluginModel>& weak_plugin)
{
- SPtr<PluginModel> plugin = weak_plugin.lock();
+ auto plugin = weak_plugin.lock();
if (!plugin) {
return;
}
diff --git a/src/gui/GraphCanvas.hpp b/src/gui/GraphCanvas.hpp
index f8b4d432..ffeac64d 100644
--- a/src/gui/GraphCanvas.hpp
+++ b/src/gui/GraphCanvas.hpp
@@ -23,11 +23,11 @@
#include "ganv/Module.hpp"
#include "ingen/Node.hpp"
#include "ingen/client/ArcModel.hpp"
-#include "ingen/memory.hpp"
#include "lilv/lilv.h"
#include "raul/Path.hpp"
#include <map>
+#include <memory>
#include <set>
#include <string>
@@ -47,10 +47,10 @@ class PluginMenu;
class GraphCanvas : public Ganv::Canvas
{
public:
- GraphCanvas(App& app,
- SPtr<const client::GraphModel> graph,
- int width,
- int height);
+ GraphCanvas(App& app,
+ std::shared_ptr<const client::GraphModel> graph,
+ int width,
+ int height);
~GraphCanvas() override = default;
@@ -61,14 +61,14 @@ public:
void show_port_names(bool b);
bool show_port_names() const { return _show_port_names; }
- void add_plugin(const SPtr<client::PluginModel>& p);
+ void add_plugin(const std::shared_ptr<client::PluginModel>& p);
void remove_plugin(const URI& uri);
- void add_block(const SPtr<const client::BlockModel>& bm);
- void remove_block(const SPtr<const client::BlockModel>& bm);
- void add_port(const SPtr<const client::PortModel>& pm);
- void remove_port(const SPtr<const client::PortModel>& pm);
- void connection(const SPtr<const client::ArcModel>& arc);
- void disconnection(const SPtr<const client::ArcModel>& arc);
+ void add_block(const std::shared_ptr<const client::BlockModel>& bm);
+ void remove_block(const std::shared_ptr<const client::BlockModel>& bm);
+ void add_port(const std::shared_ptr<const client::PortModel>& pm);
+ void remove_port(const std::shared_ptr<const client::PortModel>& pm);
+ void connection(const std::shared_ptr<const client::ArcModel>& arc);
+ void disconnection(const std::shared_ptr<const client::ArcModel>& arc);
void get_new_module_location(double& x, double& y);
@@ -106,7 +106,7 @@ private:
Properties get_initial_data(Resource::Graph ctx=Resource::Graph::DEFAULT);
- Ganv::Port* get_port_view(const SPtr<client::PortModel>& port);
+ Ganv::Port* get_port_view(const std::shared_ptr<client::PortModel>& port);
void connect(Ganv::Node* tail,
Ganv::Node* head);
@@ -114,10 +114,10 @@ private:
void disconnect(Ganv::Node* tail,
Ganv::Node* head);
- App& _app;
- SPtr<const client::GraphModel> _graph;
+ App& _app;
+ std::shared_ptr<const client::GraphModel> _graph;
- using Views = std::map<SPtr<const client::ObjectModel>, Ganv::Module*>;
+ using Views = std::map<std::shared_ptr<const client::ObjectModel>, Ganv::Module*>;
Views _views;
int _auto_position_count;
diff --git a/src/gui/GraphPortModule.cpp b/src/gui/GraphPortModule.cpp
index a602f2f0..750a9e5a 100644
--- a/src/gui/GraphPortModule.cpp
+++ b/src/gui/GraphPortModule.cpp
@@ -41,11 +41,12 @@ using namespace client;
namespace gui {
-GraphPortModule::GraphPortModule(GraphCanvas& canvas,
- const SPtr<const client::PortModel>& model)
- : Ganv::Module(canvas, "", 0, 0, false) // FIXME: coords?
- , _model(model)
- , _port(nullptr)
+GraphPortModule::GraphPortModule(
+ GraphCanvas& canvas,
+ const std::shared_ptr<const client::PortModel>& model)
+ : Ganv::Module(canvas, "", 0, 0, false) // FIXME: coords?
+ , _model(model)
+ , _port(nullptr)
{
assert(model);
@@ -64,7 +65,8 @@ GraphPortModule::GraphPortModule(GraphCanvas& canvas,
}
GraphPortModule*
-GraphPortModule::create(GraphCanvas& canvas, const SPtr<const PortModel>& model)
+GraphPortModule::create(GraphCanvas& canvas,
+ const std::shared_ptr<const PortModel>& model)
{
auto* ret = new GraphPortModule(canvas, model);
Port* port = Port::create(canvas.app(), *ret, model, true);
diff --git a/src/gui/GraphPortModule.hpp b/src/gui/GraphPortModule.hpp
index 2bc5111b..06e40dff 100644
--- a/src/gui/GraphPortModule.hpp
+++ b/src/gui/GraphPortModule.hpp
@@ -21,6 +21,7 @@
#include "ganv/Module.hpp"
+#include <memory>
#include <string>
namespace ingen {
@@ -46,7 +47,8 @@ class GraphPortModule : public Ganv::Module
{
public:
static GraphPortModule*
- create(GraphCanvas& canvas, const SPtr<const client::PortModel>& model);
+ create(GraphCanvas& canvas,
+ const std::shared_ptr<const client::PortModel>& model);
App& app() const;
@@ -55,11 +57,11 @@ public:
void set_name(const std::string& n);
- SPtr<const client::PortModel> port() const { return _model; }
+ std::shared_ptr<const client::PortModel> port() const { return _model; }
protected:
- GraphPortModule(GraphCanvas& canvas,
- const SPtr<const client::PortModel>& model);
+ GraphPortModule(GraphCanvas& canvas,
+ const std::shared_ptr<const client::PortModel>& model);
bool show_menu(GdkEventButton* ev);
void set_selected(gboolean b) override;
@@ -68,8 +70,8 @@ protected:
void property_changed(const URI& key, const Atom& value);
- SPtr<const client::PortModel> _model;
- Port* _port;
+ std::shared_ptr<const client::PortModel> _model;
+ Port* _port;
};
} // namespace gui
diff --git a/src/gui/GraphTreeWindow.cpp b/src/gui/GraphTreeWindow.cpp
index 4242c69e..0406184a 100644
--- a/src/gui/GraphTreeWindow.cpp
+++ b/src/gui/GraphTreeWindow.cpp
@@ -75,7 +75,7 @@ GraphTreeWindow::init(App& app, ClientStore& store)
}
void
-GraphTreeWindow::new_object(const SPtr<ObjectModel>& object)
+GraphTreeWindow::new_object(const std::shared_ptr<ObjectModel>& object)
{
auto graph = std::dynamic_pointer_cast<GraphModel>(object);
if (graph) {
@@ -84,7 +84,7 @@ GraphTreeWindow::new_object(const SPtr<ObjectModel>& object)
}
void
-GraphTreeWindow::add_graph(const SPtr<GraphModel>& pm)
+GraphTreeWindow::add_graph(const std::shared_ptr<GraphModel>& pm)
{
if (!pm->parent()) {
Gtk::TreeModel::iterator iter = _graph_treestore->append();
@@ -125,7 +125,7 @@ GraphTreeWindow::add_graph(const SPtr<GraphModel>& pm)
}
void
-GraphTreeWindow::remove_graph(const SPtr<GraphModel>& pm)
+GraphTreeWindow::remove_graph(const std::shared_ptr<GraphModel>& pm)
{
Gtk::TreeModel::iterator i = find_graph(_graph_treestore->children(), pm);
if (i != _graph_treestore->children().end()) {
@@ -134,11 +134,11 @@ GraphTreeWindow::remove_graph(const SPtr<GraphModel>& pm)
}
Gtk::TreeModel::iterator
-GraphTreeWindow::find_graph(Gtk::TreeModel::Children root,
- const SPtr<client::ObjectModel>& graph)
+GraphTreeWindow::find_graph(Gtk::TreeModel::Children root,
+ const std::shared_ptr<client::ObjectModel>& graph)
{
for (Gtk::TreeModel::iterator c = root.begin(); c != root.end(); ++c) {
- SPtr<GraphModel> pm = (*c)[_graph_tree_columns.graph_model_col];
+ std::shared_ptr<GraphModel> pm = (*c)[_graph_tree_columns.graph_model_col];
if (graph == pm) {
return c;
} else if (!(*c)->children().empty()) {
@@ -158,8 +158,8 @@ GraphTreeWindow::show_graph_menu(GdkEventButton* ev)
{
Gtk::TreeModel::iterator active = _graph_tree_selection->get_selected();
if (active) {
- Gtk::TreeModel::Row row = *active;
- SPtr<GraphModel> pm = row[_graph_tree_columns.graph_model_col];
+ Gtk::TreeModel::Row row = *active;
+ std::shared_ptr<GraphModel> pm = row[_graph_tree_columns.graph_model_col];
if (pm) {
_app->log().warn("TODO: graph menu from tree window");
}
@@ -170,9 +170,9 @@ void
GraphTreeWindow::event_graph_activated(const Gtk::TreeModel::Path& path,
Gtk::TreeView::Column* col)
{
- Gtk::TreeModel::iterator active = _graph_treestore->get_iter(path);
- Gtk::TreeModel::Row row = *active;
- SPtr<GraphModel> pm = row[_graph_tree_columns.graph_model_col];
+ Gtk::TreeModel::iterator active = _graph_treestore->get_iter(path);
+ Gtk::TreeModel::Row row = *active;
+ std::shared_ptr<GraphModel> pm = row[_graph_tree_columns.graph_model_col];
_app->window_factory()->present_graph(pm);
}
@@ -180,11 +180,11 @@ GraphTreeWindow::event_graph_activated(const Gtk::TreeModel::Path& path,
void
GraphTreeWindow::event_graph_enabled_toggled(const Glib::ustring& path_str)
{
- Gtk::TreeModel::Path path(path_str);
+ Gtk::TreeModel::Path path(path_str);
Gtk::TreeModel::iterator active = _graph_treestore->get_iter(path);
- Gtk::TreeModel::Row row = *active;
+ Gtk::TreeModel::Row row = *active;
- SPtr<GraphModel> pm = row[_graph_tree_columns.graph_model_col];
+ std::shared_ptr<GraphModel> pm = row[_graph_tree_columns.graph_model_col];
assert(pm);
if (_enable_signal) {
@@ -195,9 +195,10 @@ GraphTreeWindow::event_graph_enabled_toggled(const Glib::ustring& path_str)
}
void
-GraphTreeWindow::graph_property_changed(const URI& key,
- const Atom& value,
- const SPtr<GraphModel>& graph)
+GraphTreeWindow::graph_property_changed(
+ const URI& key,
+ const Atom& value,
+ const std::shared_ptr<GraphModel>& graph)
{
const URIs& uris = _app->uris();
_enable_signal = false;
@@ -214,7 +215,7 @@ GraphTreeWindow::graph_property_changed(const URI& key,
}
void
-GraphTreeWindow::graph_moved(const SPtr<GraphModel>& graph)
+GraphTreeWindow::graph_moved(const std::shared_ptr<GraphModel>& graph)
{
_enable_signal = false;
diff --git a/src/gui/GraphTreeWindow.hpp b/src/gui/GraphTreeWindow.hpp
index 2c988817..9e11b15d 100644
--- a/src/gui/GraphTreeWindow.hpp
+++ b/src/gui/GraphTreeWindow.hpp
@@ -47,16 +47,17 @@ public:
void init(App& app, client::ClientStore& store);
- void new_object(const SPtr<client::ObjectModel>& object);
+ void new_object(const std::shared_ptr<client::ObjectModel>& object);
- void graph_property_changed(const URI& key,
- const Atom& value,
- const SPtr<client::GraphModel>& graph);
+ void
+ graph_property_changed(const URI& key,
+ const Atom& value,
+ const std::shared_ptr<client::GraphModel>& graph);
- void graph_moved(const SPtr<client::GraphModel>& graph);
+ void graph_moved(const std::shared_ptr<client::GraphModel>& graph);
- void add_graph(const SPtr<client::GraphModel>& pm);
- void remove_graph(const SPtr<client::GraphModel>& pm);
+ void add_graph(const std::shared_ptr<client::GraphModel>& pm);
+ void remove_graph(const std::shared_ptr<client::GraphModel>& pm);
void show_graph_menu(GdkEventButton* ev);
protected:
@@ -65,9 +66,9 @@ protected:
void event_graph_enabled_toggled(const Glib::ustring& path_str);
- Gtk::TreeModel::iterator find_graph(
- Gtk::TreeModel::Children root,
- const SPtr<client::ObjectModel>& graph);
+ Gtk::TreeModel::iterator
+ find_graph(Gtk::TreeModel::Children root,
+ const std::shared_ptr<client::ObjectModel>& graph);
GraphTreeView* _graphs_treeview;
@@ -79,9 +80,9 @@ protected:
add(graph_model_col);
}
- Gtk::TreeModelColumn<Glib::ustring> name_col;
- Gtk::TreeModelColumn<bool> enabled_col;
- Gtk::TreeModelColumn<SPtr<client::GraphModel> > graph_model_col;
+ Gtk::TreeModelColumn<Glib::ustring> name_col;
+ Gtk::TreeModelColumn<bool> enabled_col;
+ Gtk::TreeModelColumn<std::shared_ptr<client::GraphModel>> graph_model_col;
};
GraphTreeModelColumns _graph_tree_columns;
diff --git a/src/gui/GraphView.cpp b/src/gui/GraphView.cpp
index c9191a37..88b3d6fe 100644
--- a/src/gui/GraphView.cpp
+++ b/src/gui/GraphView.cpp
@@ -64,7 +64,7 @@ GraphView::init(App& app)
}
void
-GraphView::set_graph(const SPtr<const GraphModel>& graph)
+GraphView::set_graph(const std::shared_ptr<const GraphModel>& graph)
{
assert(!_canvas); // FIXME: remove
@@ -98,8 +98,8 @@ GraphView::set_graph(const SPtr<const GraphModel>& graph)
_canvas->widget().grab_focus();
}
-SPtr<GraphView>
-GraphView::create(App& app, const SPtr<const GraphModel>& graph)
+std::shared_ptr<GraphView>
+GraphView::create(App& app, const std::shared_ptr<const GraphModel>& graph)
{
GraphView* result = nullptr;
Glib::RefPtr<Gtk::Builder> xml = WidgetFactory::create("warehouse_win");
@@ -111,7 +111,7 @@ GraphView::create(App& app, const SPtr<const GraphModel>& graph)
result->init(app);
result->set_graph(graph);
- return SPtr<GraphView>(result);
+ return std::shared_ptr<GraphView>(result);
}
void
diff --git a/src/gui/GraphView.hpp b/src/gui/GraphView.hpp
index 0a4a6d21..29571b67 100644
--- a/src/gui/GraphView.hpp
+++ b/src/gui/GraphView.hpp
@@ -17,8 +17,6 @@
#ifndef INGEN_GUI_GRAPHVIEW_HPP
#define INGEN_GUI_GRAPHVIEW_HPP
-#include "ingen/memory.hpp"
-
#include <gtkmm/box.h>
#include <gtkmm/builder.h>
#include <gtkmm/scrolledwindow.h>
@@ -28,6 +26,8 @@
#include <gtkmm/toolitem.h>
#include <gtkmm/toolitem.h>
+#include <memory>
+
namespace ingen {
class Atom;
@@ -63,15 +63,19 @@ public:
void init(App& app);
- SPtr<GraphCanvas> canvas() const { return _canvas; }
- SPtr<const client::GraphModel> graph() const { return _graph; }
- Gtk::ToolItem* breadcrumb_container() const { return _breadcrumb_container; }
+ std::shared_ptr<GraphCanvas> canvas() const { return _canvas; }
+ std::shared_ptr<const client::GraphModel> graph() const { return _graph; }
+
+ Gtk::ToolItem* breadcrumb_container() const
+ {
+ return _breadcrumb_container;
+ }
- static SPtr<GraphView>
- create(App& app, const SPtr<const client::GraphModel>& graph);
+ static std::shared_ptr<GraphView>
+ create(App& app, const std::shared_ptr<const client::GraphModel>& graph);
private:
- void set_graph(const SPtr<const client::GraphModel>& graph);
+ void set_graph(const std::shared_ptr<const client::GraphModel>& graph);
void process_toggled();
void poly_changed();
@@ -81,8 +85,8 @@ private:
App* _app = nullptr;
- SPtr<const client::GraphModel> _graph;
- SPtr<GraphCanvas> _canvas;
+ std::shared_ptr<const client::GraphModel> _graph;
+ std::shared_ptr<GraphCanvas> _canvas;
Gtk::ScrolledWindow* _canvas_scrolledwindow = nullptr;
Gtk::Toolbar* _toolbar = nullptr;
diff --git a/src/gui/GraphWindow.hpp b/src/gui/GraphWindow.hpp
index 795f0925..96775d82 100644
--- a/src/gui/GraphWindow.hpp
+++ b/src/gui/GraphWindow.hpp
@@ -20,10 +20,9 @@
#include "GraphBox.hpp"
#include "Window.hpp"
-#include "ingen/memory.hpp"
-
#include <gtkmm/builder.h>
+#include <memory>
#include <string>
namespace ingen {
@@ -48,8 +47,12 @@ public:
void init_window(App& app) override;
- SPtr<const client::GraphModel> graph() const { return _box->graph(); }
- GraphBox* box() const { return _box; }
+ std::shared_ptr<const client::GraphModel> graph() const
+ {
+ return _box->graph();
+ }
+
+ GraphBox* box() const { return _box; }
bool documentation_is_visible() { return _box->documentation_is_visible(); }
diff --git a/src/gui/LoadGraphWindow.cpp b/src/gui/LoadGraphWindow.cpp
index d1b2cfd9..5b8bf84f 100644
--- a/src/gui/LoadGraphWindow.cpp
+++ b/src/gui/LoadGraphWindow.cpp
@@ -32,6 +32,7 @@
#include <glibmm/miscutils.h>
#include <list>
+#include <memory>
#include <ostream>
#include <string>
#include <utility>
@@ -95,9 +96,9 @@ LoadGraphWindow::LoadGraphWindow(BaseObjectType* cobject,
}
void
-LoadGraphWindow::present(const SPtr<const GraphModel>& graph,
- bool import,
- const Properties& data)
+LoadGraphWindow::present(const std::shared_ptr<const GraphModel>& graph,
+ bool import,
+ const Properties& data)
{
_import = import;
set_graph(graph);
@@ -115,7 +116,7 @@ LoadGraphWindow::present(const SPtr<const GraphModel>& graph,
* This function MUST be called before using the window in any way!
*/
void
-LoadGraphWindow::set_graph(const SPtr<const GraphModel>& graph)
+LoadGraphWindow::set_graph(const std::shared_ptr<const GraphModel>& graph)
{
_graph = graph;
_symbol_entry->set_text("");
diff --git a/src/gui/LoadGraphWindow.hpp b/src/gui/LoadGraphWindow.hpp
index 7b26eb7d..ab287578 100644
--- a/src/gui/LoadGraphWindow.hpp
+++ b/src/gui/LoadGraphWindow.hpp
@@ -18,7 +18,6 @@
#define INGEN_GUI_LOADGRAPHWINDOW_HPP
#include "ingen/Node.hpp"
-#include "ingen/memory.hpp"
#include <gtkmm/builder.h>
#include <gtkmm/button.h>
@@ -50,11 +49,11 @@ public:
void init(App& app) { _app = &app; }
- void set_graph(const SPtr<const client::GraphModel>& graph);
+ void set_graph(const std::shared_ptr<const client::GraphModel>& graph);
- void present(const SPtr<const client::GraphModel>& graph,
- bool import,
- const Properties& data);
+ void present(const std::shared_ptr<const client::GraphModel>& graph,
+ bool import,
+ const Properties& data);
protected:
void on_show() override;
@@ -74,7 +73,7 @@ private:
Properties _initial_data;
- SPtr<const client::GraphModel> _graph;
+ std::shared_ptr<const client::GraphModel> _graph;
Gtk::Label* _symbol_label = nullptr;
Gtk::Entry* _symbol_entry = nullptr;
diff --git a/src/gui/LoadPluginWindow.cpp b/src/gui/LoadPluginWindow.cpp
index 41702884..134cde1b 100644
--- a/src/gui/LoadPluginWindow.cpp
+++ b/src/gui/LoadPluginWindow.cpp
@@ -28,6 +28,7 @@
#include <algorithm>
#include <cassert>
#include <cstddef>
+#include <memory>
#include <string>
using std::string;
@@ -122,8 +123,8 @@ LoadPluginWindow::LoadPluginWindow(BaseObjectType* cobject,
}
void
-LoadPluginWindow::present(const SPtr<const GraphModel>& graph,
- const Properties& data)
+LoadPluginWindow::present(const std::shared_ptr<const GraphModel>& graph,
+ const Properties& data)
{
set_graph(graph);
_initial_data = data;
@@ -161,7 +162,7 @@ LoadPluginWindow::name_cleared(Gtk::EntryIconPosition pos, const GdkEventButton*
* This function MUST be called before using the window in any way!
*/
void
-LoadPluginWindow::set_graph(const SPtr<const GraphModel>& graph)
+LoadPluginWindow::set_graph(const std::shared_ptr<const GraphModel>& graph)
{
if (_graph) {
_graph = graph;
@@ -196,7 +197,8 @@ LoadPluginWindow::on_show()
}
void
-LoadPluginWindow::set_plugins(const SPtr<const ClientStore::Plugins>& plugins)
+LoadPluginWindow::set_plugins(
+ const std::shared_ptr<const ClientStore::Plugins>& plugins)
{
_rows.clear();
_plugins_liststore->clear();
@@ -210,7 +212,7 @@ LoadPluginWindow::set_plugins(const SPtr<const ClientStore::Plugins>& plugins)
}
void
-LoadPluginWindow::new_plugin(const SPtr<const PluginModel>& pm)
+LoadPluginWindow::new_plugin(const std::shared_ptr<const PluginModel>& pm)
{
if (is_visible()) {
add_plugin(pm);
@@ -220,7 +222,7 @@ LoadPluginWindow::new_plugin(const SPtr<const PluginModel>& pm)
}
static std::string
-get_project_name(const SPtr<const PluginModel>& plugin)
+get_project_name(const std::shared_ptr<const PluginModel>& plugin)
{
std::string name;
if (plugin->lilv_plugin()) {
@@ -246,7 +248,7 @@ get_project_name(const SPtr<const PluginModel>& plugin)
}
static std::string
-get_author_name(const SPtr<const PluginModel>& plugin)
+get_author_name(const std::shared_ptr<const PluginModel>& plugin)
{
std::string name;
if (plugin->lilv_plugin()) {
@@ -260,8 +262,8 @@ get_author_name(const SPtr<const PluginModel>& plugin)
}
void
-LoadPluginWindow::set_row(Gtk::TreeModel::Row& row,
- const SPtr<const PluginModel>& plugin)
+LoadPluginWindow::set_row(Gtk::TreeModel::Row& row,
+ const std::shared_ptr<const PluginModel>& plugin)
{
const URIs& uris = _app->uris();
const Atom& name = plugin->get_property(uris.doap_name);
@@ -291,7 +293,7 @@ LoadPluginWindow::set_row(Gtk::TreeModel::Row& row,
}
void
-LoadPluginWindow::add_plugin(const SPtr<const PluginModel>& plugin)
+LoadPluginWindow::add_plugin(const std::shared_ptr<const PluginModel>& plugin)
{
if (plugin->lilv_plugin() && lilv_plugin_is_replaced(plugin->lilv_plugin())) {
return;
@@ -330,8 +332,7 @@ LoadPluginWindow::plugin_selection_changed()
*_selection->get_selected_rows().begin());
if (iter) {
Gtk::TreeModel::Row row = *iter;
- SPtr<const PluginModel> p = row.get_value(
- _plugins_columns._col_plugin);
+ auto p = row.get_value(_plugins_columns._col_plugin);
_name_offset = _app->store()->child_name_offset(
_graph->path(), p->default_block_symbol());
_name_entry->set_text(generate_module_name(p, _name_offset));
@@ -354,8 +355,9 @@ LoadPluginWindow::plugin_selection_changed()
* sends the notification back.
*/
string
-LoadPluginWindow::generate_module_name(const SPtr<const PluginModel>& plugin,
- int offset)
+LoadPluginWindow::generate_module_name(
+ const std::shared_ptr<const PluginModel>& plugin,
+ int offset)
{
std::stringstream ss;
ss << plugin->default_block_symbol();
@@ -368,11 +370,11 @@ LoadPluginWindow::generate_module_name(const SPtr<const PluginModel>& plugin,
void
LoadPluginWindow::load_plugin(const Gtk::TreeModel::iterator& iter)
{
- const URIs& uris = _app->uris();
- Gtk::TreeModel::Row row = *iter;
- SPtr<const PluginModel> plugin = row.get_value(_plugins_columns._col_plugin);
- bool polyphonic = _polyphonic_checkbutton->get_active();
- string name = _name_entry->get_text();
+ const URIs& uris = _app->uris();
+ Gtk::TreeModel::Row row = *iter;
+ auto plugin = row.get_value(_plugins_columns._col_plugin);
+ bool polyphonic = _polyphonic_checkbutton->get_active();
+ string name = _name_entry->get_text();
if (name.empty()) {
name = generate_module_name(plugin, _name_offset);
diff --git a/src/gui/LoadPluginWindow.hpp b/src/gui/LoadPluginWindow.hpp
index b9cfaf28..cd1bec8a 100644
--- a/src/gui/LoadPluginWindow.hpp
+++ b/src/gui/LoadPluginWindow.hpp
@@ -21,7 +21,6 @@
#include "ingen/Node.hpp"
#include "ingen/client/ClientStore.hpp"
-#include "ingen/memory.hpp"
#include "ingen_config.h"
#include <gtkmm/builder.h>
@@ -31,6 +30,7 @@
#include <gtkmm/treeview.h>
#include <map>
+#include <memory>
#include <string>
namespace ingen {
@@ -54,14 +54,15 @@ public:
LoadPluginWindow(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& xml);
- void set_graph(const SPtr<const client::GraphModel>& graph);
+ void set_graph(const std::shared_ptr<const client::GraphModel>& graph);
- void set_plugins(const SPtr<const client::ClientStore::Plugins>& plugins);
+ void set_plugins(
+ const std::shared_ptr<const client::ClientStore::Plugins>& plugins);
- void add_plugin(const SPtr<const client::PluginModel>& plugin);
+ void add_plugin(const std::shared_ptr<const client::PluginModel>& plugin);
- void present(const SPtr<const client::GraphModel>& graph,
- const Properties& data);
+ void present(const std::shared_ptr<const client::GraphModel>& graph,
+ const Properties& data);
protected:
void on_show() override;
@@ -87,7 +88,7 @@ private:
Gtk::TreeModelColumn<Glib::ustring> _col_uri;
// Not displayed:
- Gtk::TreeModelColumn< SPtr<const client::PluginModel> > _col_plugin;
+ Gtk::TreeModelColumn<std::shared_ptr<const client::PluginModel>> _col_plugin;
};
/** Column for the filter criteria combo box. */
@@ -110,10 +111,10 @@ private:
void name_changed();
void name_cleared(Gtk::EntryIconPosition pos, const GdkEventButton* event);
- void set_row(Gtk::TreeModel::Row& row,
- const SPtr<const client::PluginModel>& plugin);
+ void set_row(Gtk::TreeModel::Row& row,
+ const std::shared_ptr<const client::PluginModel>& plugin);
- void new_plugin(const SPtr<const client::PluginModel>& pm);
+ void new_plugin(const std::shared_ptr<const client::PluginModel>& pm);
void plugin_property_changed(const URI& plugin,
const URI& predicate,
@@ -122,15 +123,15 @@ private:
void plugin_activated(const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* col);
void plugin_selection_changed();
- static std::string
- generate_module_name(const SPtr<const client::PluginModel>& plugin,
- int offset = 0);
+ static std::string generate_module_name(
+ const std::shared_ptr<const client::PluginModel>& plugin,
+ int offset = 0);
void load_plugin(const Gtk::TreeModel::iterator& iter);
Properties _initial_data;
- SPtr<const client::GraphModel> _graph;
+ std::shared_ptr<const client::GraphModel> _graph;
using Rows = std::map<URI, Gtk::TreeModel::iterator>;
Rows _rows;
diff --git a/src/gui/NewSubgraphWindow.cpp b/src/gui/NewSubgraphWindow.cpp
index 228bd91c..cd803e6d 100644
--- a/src/gui/NewSubgraphWindow.cpp
+++ b/src/gui/NewSubgraphWindow.cpp
@@ -49,8 +49,8 @@ NewSubgraphWindow::NewSubgraphWindow(BaseObjectType* cobject,
}
void
-NewSubgraphWindow::present(SPtr<const client::GraphModel> graph,
- Properties data)
+NewSubgraphWindow::present(std::shared_ptr<const client::GraphModel> graph,
+ Properties data)
{
set_graph(graph);
_initial_data = data;
@@ -62,7 +62,7 @@ NewSubgraphWindow::present(SPtr<const client::GraphModel> graph,
* This function MUST be called before using the window in any way!
*/
void
-NewSubgraphWindow::set_graph(SPtr<const client::GraphModel> graph)
+NewSubgraphWindow::set_graph(std::shared_ptr<const client::GraphModel> graph)
{
_graph = graph;
}
diff --git a/src/gui/NewSubgraphWindow.hpp b/src/gui/NewSubgraphWindow.hpp
index 69c35d05..16cf2a21 100644
--- a/src/gui/NewSubgraphWindow.hpp
+++ b/src/gui/NewSubgraphWindow.hpp
@@ -20,7 +20,6 @@
#include "Window.hpp"
#include "ingen/Node.hpp"
-#include "ingen/memory.hpp"
#include <gtkmm/builder.h>
#include <gtkmm/button.h>
@@ -28,6 +27,8 @@
#include <gtkmm/label.h>
#include <gtkmm/spinbutton.h>
+#include <memory>
+
namespace ingen {
namespace client { class GraphModel; }
@@ -46,18 +47,18 @@ public:
NewSubgraphWindow(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& xml);
- void set_graph(SPtr<const client::GraphModel> graph);
+ void set_graph(std::shared_ptr<const client::GraphModel> graph);
- void present(SPtr<const client::GraphModel> graph,
- Properties data);
+ void
+ present(std::shared_ptr<const client::GraphModel> graph, Properties data);
private:
void name_changed();
void ok_clicked();
void cancel_clicked();
- Properties _initial_data;
- SPtr<const client::GraphModel> _graph;
+ Properties _initial_data;
+ std::shared_ptr<const client::GraphModel> _graph;
Gtk::Entry* _name_entry;
Gtk::Label* _message_label;
diff --git a/src/gui/NodeMenu.cpp b/src/gui/NodeMenu.cpp
index 3e9057fc..6c9cf5ce 100644
--- a/src/gui/NodeMenu.cpp
+++ b/src/gui/NodeMenu.cpp
@@ -35,6 +35,7 @@
#include <gtkmm/stock.h>
#include <cstdint>
+#include <memory>
#include <string>
#include <utility>
@@ -56,7 +57,7 @@ NodeMenu::NodeMenu(BaseObjectType* cobject,
}
void
-NodeMenu::init(App& app, SPtr<const client::BlockModel> block)
+NodeMenu::init(App& app, std::shared_ptr<const client::BlockModel> block)
{
ObjectMenu::init(app, block);
@@ -71,7 +72,7 @@ NodeMenu::init(App& app, SPtr<const client::BlockModel> block)
_randomize_menuitem->signal_activate().connect(
sigc::mem_fun(this, &NodeMenu::on_menu_randomize));
- SPtr<PluginModel> plugin = block->plugin_model();
+ auto plugin = block->plugin_model();
if (plugin) {
// Get the plugin to receive related presets
_preset_connection = plugin->signal_preset().connect(
@@ -172,7 +173,7 @@ NodeMenu::on_menu_randomize()
{
_app->interface()->bundle_begin();
- const SPtr<const BlockModel> bm = block();
+ const auto bm = block();
for (const auto& p : bm->ports()) {
if (p->is_input() && _app->can_control(p.get())) {
float min = 0.0f;
diff --git a/src/gui/NodeMenu.hpp b/src/gui/NodeMenu.hpp
index a997e03f..b35919eb 100644
--- a/src/gui/NodeMenu.hpp
+++ b/src/gui/NodeMenu.hpp
@@ -20,7 +20,6 @@
#include "ObjectMenu.hpp"
#include "ingen/client/BlockModel.hpp"
-#include "ingen/memory.hpp"
#include <gtkmm/builder.h>
#include <gtkmm/menu.h>
@@ -42,7 +41,7 @@ public:
NodeMenu(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& xml);
- void init(App& app, SPtr<const client::BlockModel> block);
+ void init(App& app, std::shared_ptr<const client::BlockModel> block);
bool has_control_inputs();
@@ -50,7 +49,7 @@ public:
sigc::signal<void, bool> signal_embed_gui;
protected:
- SPtr<const client::BlockModel> block() const {
+ std::shared_ptr<const client::BlockModel> block() const {
return std::dynamic_pointer_cast<const client::BlockModel>(_object);
}
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp
index 8e6dc0cf..ab197525 100644
--- a/src/gui/NodeModule.cpp
+++ b/src/gui/NodeModule.cpp
@@ -50,13 +50,13 @@ using namespace client;
namespace gui {
-NodeModule::NodeModule(GraphCanvas& canvas,
- SPtr<const BlockModel> block)
- : Ganv::Module(canvas, block->path().symbol(), 0, 0, true)
- , _block(block)
- , _gui_widget(nullptr)
- , _gui_window(nullptr)
- , _initialised(false)
+NodeModule::NodeModule(GraphCanvas& canvas,
+ 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));
@@ -134,9 +134,9 @@ NodeModule::show_menu(GdkEventButton* ev)
}
NodeModule*
-NodeModule::create(GraphCanvas& canvas,
- SPtr<const BlockModel> block,
- bool human)
+NodeModule::create(GraphCanvas& canvas,
+ std::shared_ptr<const BlockModel> block,
+ bool human)
{
auto graph = std::dynamic_pointer_cast<const GraphModel>(block);
@@ -305,7 +305,7 @@ NodeModule::rename()
}
void
-NodeModule::new_port_view(SPtr<const PortModel> port)
+NodeModule::new_port_view(std::shared_ptr<const PortModel> port)
{
Port::create(app(), *this, port);
@@ -319,7 +319,7 @@ NodeModule::new_port_view(SPtr<const PortModel> port)
}
Port*
-NodeModule::port(SPtr<const PortModel> model)
+NodeModule::port(std::shared_ptr<const PortModel> model)
{
for (iterator p = begin(); p != end(); ++p) {
Port* const port = dynamic_cast<Port*>(*p);
@@ -331,7 +331,7 @@ NodeModule::port(SPtr<const PortModel> model)
}
void
-NodeModule::delete_port_view(SPtr<const PortModel> model)
+NodeModule::delete_port_view(std::shared_ptr<const PortModel> model)
{
Port* p = port(model);
if (p) {
diff --git a/src/gui/NodeModule.hpp b/src/gui/NodeModule.hpp
index d4b845cf..55a255a8 100644
--- a/src/gui/NodeModule.hpp
+++ b/src/gui/NodeModule.hpp
@@ -17,10 +17,11 @@
#ifndef INGEN_GUI_NODEMODULE_HPP
#define INGEN_GUI_NODEMODULE_HPP
+#include "Port.hpp"
+
#include "ganv/Module.hpp"
-#include "ingen/memory.hpp"
-#include "Port.hpp"
+#include <memory>
namespace ingen {
namespace client {
@@ -46,26 +47,26 @@ class NodeMenu;
class NodeModule : public Ganv::Module
{
public:
- static NodeModule* create(
- GraphCanvas& canvas,
- SPtr<const client::BlockModel> block,
- bool human);
+ static NodeModule* create(GraphCanvas& canvas,
+ std::shared_ptr<const client::BlockModel> block,
+ bool human);
~NodeModule() override;
App& app() const;
- Port* port(SPtr<const client::PortModel> model);
+ Port* port(std::shared_ptr<const client::PortModel> model);
- void delete_port_view(SPtr<const client::PortModel> model);
+ void delete_port_view(std::shared_ptr<const client::PortModel> model);
virtual void store_location(double ax, double ay);
void show_human_names(bool b);
- SPtr<const client::BlockModel> block() const { return _block; }
+ std::shared_ptr<const client::BlockModel> block() const { return _block; }
protected:
- NodeModule(GraphCanvas& canvas, SPtr<const client::BlockModel> block);
+ NodeModule(GraphCanvas& canvas,
+ std::shared_ptr<const client::BlockModel> block);
virtual bool on_double_click(GdkEventButton* ev);
@@ -81,7 +82,7 @@ protected:
void rename();
void property_changed(const URI& key, const Atom& value);
- void new_port_view(SPtr<const client::PortModel> port);
+ void new_port_view(std::shared_ptr<const client::PortModel> port);
void port_activity(uint32_t index, const Atom& value);
void port_value_changed(uint32_t index, const Atom& value);
@@ -90,12 +91,12 @@ protected:
bool show_menu(GdkEventButton* ev);
- SPtr<const client::BlockModel> _block;
- NodeMenu* _menu;
- SPtr<client::PluginUI> _plugin_ui;
- Gtk::Widget* _gui_widget;
- Gtk::Window* _gui_window; ///< iff popped up
- bool _initialised;
+ std::shared_ptr<const client::BlockModel> _block;
+ NodeMenu* _menu;
+ std::shared_ptr<client::PluginUI> _plugin_ui;
+ Gtk::Widget* _gui_widget;
+ Gtk::Window* _gui_window; ///< iff popped up
+ bool _initialised;
};
} // namespace gui
diff --git a/src/gui/ObjectMenu.cpp b/src/gui/ObjectMenu.cpp
index 11648a30..52fec864 100644
--- a/src/gui/ObjectMenu.cpp
+++ b/src/gui/ObjectMenu.cpp
@@ -25,6 +25,7 @@
#include "ingen/client/ObjectModel.hpp"
#include <cstdint>
+#include <memory>
namespace ingen {
@@ -54,7 +55,7 @@ ObjectMenu::ObjectMenu(BaseObjectType* cobject,
}
void
-ObjectMenu::init(App& app, SPtr<const ObjectModel> object)
+ObjectMenu::init(App& app, std::shared_ptr<const ObjectModel> object)
{
_app = &app;
_object = object;
diff --git a/src/gui/ObjectMenu.hpp b/src/gui/ObjectMenu.hpp
index 8714917e..2f3caa01 100644
--- a/src/gui/ObjectMenu.hpp
+++ b/src/gui/ObjectMenu.hpp
@@ -18,13 +18,14 @@
#define INGEN_GUI_OBJECTMENU_HPP
#include "ingen/client/ObjectModel.hpp"
-#include "ingen/memory.hpp"
#include <gtkmm/builder.h>
#include <gtkmm/checkmenuitem.h>
#include <gtkmm/menu.h>
#include <gtkmm/menuitem.h>
+#include <memory>
+
namespace ingen {
namespace gui {
@@ -43,10 +44,14 @@ public:
ObjectMenu(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& xml);
- void init(App& app, SPtr<const client::ObjectModel> object);
+ void init(App& app, std::shared_ptr<const client::ObjectModel> object);
+
+ std::shared_ptr<const client::ObjectModel> object() const
+ {
+ return _object;
+ }
- SPtr<const client::ObjectModel> object() const { return _object; }
- App* app() const { return _app; }
+ App* app() const { return _app; }
protected:
void on_menu_learn();
@@ -58,16 +63,16 @@ protected:
void property_changed(const URI& predicate, const Atom& value);
- App* _app;
- SPtr<const client::ObjectModel> _object;
- Gtk::MenuItem* _learn_menuitem;
- Gtk::MenuItem* _unlearn_menuitem;
- Gtk::CheckMenuItem* _polyphonic_menuitem;
- Gtk::MenuItem* _disconnect_menuitem;
- Gtk::MenuItem* _rename_menuitem;
- Gtk::MenuItem* _destroy_menuitem;
- Gtk::MenuItem* _properties_menuitem;
- Gtk::SeparatorMenuItem* _separator_menuitem;
+ App* _app;
+ std::shared_ptr<const client::ObjectModel> _object;
+ Gtk::MenuItem* _learn_menuitem;
+ Gtk::MenuItem* _unlearn_menuitem;
+ Gtk::CheckMenuItem* _polyphonic_menuitem;
+ Gtk::MenuItem* _disconnect_menuitem;
+ Gtk::MenuItem* _rename_menuitem;
+ Gtk::MenuItem* _destroy_menuitem;
+ Gtk::MenuItem* _properties_menuitem;
+ Gtk::SeparatorMenuItem* _separator_menuitem;
bool _enable_signal;
};
diff --git a/src/gui/PluginMenu.cpp b/src/gui/PluginMenu.cpp
index 2b2cf037..2f6dfc82 100644
--- a/src/gui/PluginMenu.cpp
+++ b/src/gui/PluginMenu.cpp
@@ -65,7 +65,7 @@ PluginMenu::clear()
}
void
-PluginMenu::add_plugin(SPtr<client::PluginModel> p)
+PluginMenu::add_plugin(std::shared_ptr<client::PluginModel> p)
{
using iterator = ClassMenus::iterator;
@@ -144,7 +144,8 @@ PluginMenu::build_plugin_class_menu(Gtk::Menu* menu,
}
void
-PluginMenu::add_plugin_to_menu(MenuRecord& menu, SPtr<client::PluginModel> p)
+PluginMenu::add_plugin_to_menu(MenuRecord& menu,
+ std::shared_ptr<client::PluginModel> p)
{
const URIs& uris = _world.uris();
LilvWorld* lworld = _world.lilv_world();
diff --git a/src/gui/PluginMenu.hpp b/src/gui/PluginMenu.hpp
index 38831f5a..9b08dc0a 100644
--- a/src/gui/PluginMenu.hpp
+++ b/src/gui/PluginMenu.hpp
@@ -18,7 +18,6 @@
#define INGEN_GUI_PLUGINMENU_HPP
#include "ingen/World.hpp"
-#include "ingen/memory.hpp"
#include "lilv/lilv.h"
#include <gtkmm/menu.h>
@@ -46,9 +45,9 @@ public:
PluginMenu(ingen::World& world);
void clear();
- void add_plugin(SPtr<client::PluginModel> p);
+ void add_plugin(std::shared_ptr<client::PluginModel> p);
- sigc::signal< void, std::weak_ptr<client::PluginModel> > signal_load_plugin;
+ sigc::signal<void, std::weak_ptr<client::PluginModel>> signal_load_plugin;
private:
struct MenuRecord {
@@ -67,7 +66,8 @@ 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,
+ std::shared_ptr<client::PluginModel> p);
void load_plugin(std::weak_ptr<client::PluginModel> weak_plugin);
diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp
index 3da9cf46..a1c43aa5 100644
--- a/src/gui/Port.cpp
+++ b/src/gui/Port.cpp
@@ -44,28 +44,29 @@ namespace ingen {
namespace gui {
Port*
-Port::create(App& app,
- Ganv::Module& module,
- SPtr<const PortModel> pm,
- bool flip)
+Port::create(App& app,
+ Ganv::Module& module,
+ std::shared_ptr<const PortModel> pm,
+ bool flip)
{
return new Port(app, module, pm, port_label(app, pm), flip);
}
/** @param flip Make an input port appear as an output port, and vice versa.
*/
-Port::Port(App& app,
- Ganv::Module& module,
- SPtr<const PortModel> pm,
- const std::string& name,
- bool flip)
- : Ganv::Port(module, name,
- flip ? (!pm->is_input()) : pm->is_input(),
- app.style()->get_port_color(pm.get()))
- , _app(app)
- , _port_model(pm)
- , _entered(false)
- , _flipped(flip)
+Port::Port(App& app,
+ Ganv::Module& module,
+ std::shared_ptr<const PortModel> pm,
+ const std::string& name,
+ bool flip)
+ : Ganv::Port(module,
+ name,
+ flip ? (!pm->is_input()) : pm->is_input(),
+ app.style()->get_port_color(pm.get()))
+ , _app(app)
+ , _port_model(pm)
+ , _entered(false)
+ , _flipped(flip)
{
assert(pm);
@@ -112,7 +113,7 @@ Port::~Port()
}
std::string
-Port::port_label(App& app, SPtr<const PortModel> pm)
+Port::port_label(App& app, std::shared_ptr<const PortModel> pm)
{
if (!pm) {
return "";
@@ -149,7 +150,7 @@ Port::ensure_label()
void
Port::update_metadata()
{
- SPtr<const PortModel> pm = _port_model.lock();
+ auto pm = _port_model.lock();
if (pm && _app.can_control(pm.get()) && pm->is_numeric()) {
auto parent = std::dynamic_pointer_cast<const BlockModel>(pm->parent());
if (parent) {
@@ -513,7 +514,7 @@ bool
Port::on_selected(gboolean b)
{
if (b) {
- SPtr<const PortModel> pm = _port_model.lock();
+ auto pm = _port_model.lock();
if (pm) {
auto block =
std::dynamic_pointer_cast<const BlockModel>(pm->parent());
diff --git a/src/gui/Port.hpp b/src/gui/Port.hpp
index dd5c8b92..c605cdba 100644
--- a/src/gui/Port.hpp
+++ b/src/gui/Port.hpp
@@ -18,7 +18,6 @@
#define INGEN_GUI_PORT_HPP
#include "ganv/Port.hpp"
-#include "ingen/memory.hpp"
#include <gtkmm/menu.h>
@@ -45,15 +44,17 @@ class GraphBox;
class Port : public Ganv::Port
{
public:
- static Port* create(
- App& app,
- Ganv::Module& module,
- SPtr<const client::PortModel> pm,
- bool flip = false);
+ static Port* create(App& app,
+ Ganv::Module& module,
+ std::shared_ptr<const client::PortModel> pm,
+ bool flip = false);
~Port() override;
- SPtr<const client::PortModel> model() const { return _port_model.lock(); }
+ std::shared_ptr<const client::PortModel> model() const
+ {
+ return _port_model.lock();
+ }
bool show_menu(GdkEventButton* ev);
void update_metadata();
@@ -65,13 +66,14 @@ public:
bool on_selected(gboolean b) override;
private:
- Port(App& app,
- Ganv::Module& module,
- SPtr<const client::PortModel> pm,
- const std::string& name,
- bool flip = false);
-
- static std::string port_label(App& app, SPtr<const client::PortModel> pm);
+ Port(App& app,
+ Ganv::Module& module,
+ std::shared_ptr<const client::PortModel> pm,
+ const std::string& name,
+ bool flip = false);
+
+ static std::string
+ port_label(App& app, std::shared_ptr<const client::PortModel> pm);
Gtk::Menu* build_enum_menu();
Gtk::Menu* build_uri_menu();
diff --git a/src/gui/PortMenu.cpp b/src/gui/PortMenu.cpp
index fb706c9b..c8b9807e 100644
--- a/src/gui/PortMenu.cpp
+++ b/src/gui/PortMenu.cpp
@@ -22,7 +22,6 @@
#include "ingen/Interface.hpp"
#include "ingen/client/GraphModel.hpp"
#include "ingen/client/PortModel.hpp"
-#include "ingen/memory.hpp"
#include <memory>
#include <string>
@@ -46,7 +45,9 @@ PortMenu::PortMenu(BaseObjectType* cobject,
}
void
-PortMenu::init(App& app, SPtr<const PortModel> port, bool internal_graph_port)
+PortMenu::init(App& app,
+ std::shared_ptr<const PortModel> port,
+ bool internal_graph_port)
{
const URIs& uris = app.uris();
diff --git a/src/gui/PortMenu.hpp b/src/gui/PortMenu.hpp
index 8cb069f7..9ff632bf 100644
--- a/src/gui/PortMenu.hpp
+++ b/src/gui/PortMenu.hpp
@@ -20,7 +20,6 @@
#include "ObjectMenu.hpp"
#include "ingen/client/PortModel.hpp"
-#include "ingen/memory.hpp"
#include <gtkmm/builder.h>
#include <gtkmm/menu.h>
@@ -39,9 +38,9 @@ public:
PortMenu(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& xml);
- void init(App& app,
- SPtr<const client::PortModel> port,
- bool internal_graph_port = false);
+ void init(App& app,
+ std::shared_ptr<const client::PortModel> port,
+ bool internal_graph_port = false);
private:
void on_menu_disconnect() override;
diff --git a/src/gui/PropertiesWindow.cpp b/src/gui/PropertiesWindow.cpp
index 5c7a58ea..ef832c5b 100644
--- a/src/gui/PropertiesWindow.cpp
+++ b/src/gui/PropertiesWindow.cpp
@@ -33,6 +33,7 @@
#include <cfloat>
#include <climits>
#include <cstdint>
+#include <memory>
#include <set>
#include <utility>
@@ -96,7 +97,7 @@ PropertiesWindow::reset()
}
void
-PropertiesWindow::present(SPtr<const ObjectModel> model)
+PropertiesWindow::present(std::shared_ptr<const ObjectModel> model)
{
set_object(model);
Gtk::Window::present();
@@ -200,7 +201,7 @@ PropertiesWindow::class_supported(const rdfs::URISet& types)
* This function MUST be called before using this object in any way.
*/
void
-PropertiesWindow::set_object(SPtr<const ObjectModel> model)
+PropertiesWindow::set_object(std::shared_ptr<const ObjectModel> model)
{
reset();
_model = model;
diff --git a/src/gui/PropertiesWindow.hpp b/src/gui/PropertiesWindow.hpp
index 015c0a93..d91c9268 100644
--- a/src/gui/PropertiesWindow.hpp
+++ b/src/gui/PropertiesWindow.hpp
@@ -20,7 +20,6 @@
#include "Window.hpp"
#include "ingen/client/BlockModel.hpp"
-#include "ingen/memory.hpp"
#include <gtkmm/alignment.h>
#include <gtkmm/box.h>
@@ -54,8 +53,8 @@ public:
PropertiesWindow(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& xml);
- void present(SPtr<const client::ObjectModel> model);
- void set_object(SPtr<const client::ObjectModel> model);
+ void present(std::shared_ptr<const client::ObjectModel> model);
+ void set_object(std::shared_ptr<const client::ObjectModel> model);
private:
/** Record of a property (row in the table) */
@@ -108,21 +107,21 @@ private:
using Records = std::map<URI, Record>;
Records _records;
- SPtr<const client::ObjectModel> _model;
- ComboColumns _combo_columns;
- Glib::RefPtr<Gtk::ListStore> _key_store;
- sigc::connection _property_connection;
- sigc::connection _property_removed_connection;
- Gtk::VBox* _vbox;
- Gtk::ScrolledWindow* _scrolledwindow;
- Gtk::Table* _table;
- Gtk::ComboBox* _key_combo;
- LV2_URID _value_type;
- Gtk::Bin* _value_bin;
- Gtk::Button* _add_button;
- Gtk::Button* _cancel_button;
- Gtk::Button* _apply_button;
- Gtk::Button* _ok_button;
+ std::shared_ptr<const client::ObjectModel> _model;
+ ComboColumns _combo_columns;
+ Glib::RefPtr<Gtk::ListStore> _key_store;
+ sigc::connection _property_connection;
+ sigc::connection _property_removed_connection;
+ Gtk::VBox* _vbox;
+ Gtk::ScrolledWindow* _scrolledwindow;
+ Gtk::Table* _table;
+ Gtk::ComboBox* _key_combo;
+ LV2_URID _value_type;
+ Gtk::Bin* _value_bin;
+ Gtk::Button* _add_button;
+ Gtk::Button* _cancel_button;
+ Gtk::Button* _apply_button;
+ Gtk::Button* _ok_button;
};
} // namespace gui
diff --git a/src/gui/RDFS.cpp b/src/gui/RDFS.cpp
index 1091c443..5bee419c 100644
--- a/src/gui/RDFS.cpp
+++ b/src/gui/RDFS.cpp
@@ -115,7 +115,7 @@ datatypes(World& world, URISet& types, bool super)
}
URISet
-types(World& world, SPtr<const client::ObjectModel> model)
+types(World& world, std::shared_ptr<const client::ObjectModel> model)
{
using PropIter = Properties::const_iterator;
using PropRange = std::pair<PropIter, PropIter>;
@@ -145,7 +145,7 @@ types(World& world, SPtr<const client::ObjectModel> model)
}
URISet
-properties(World& world, SPtr<const client::ObjectModel> model)
+properties(World& world, std::shared_ptr<const client::ObjectModel> model)
{
URISet properties;
URISet types = rdfs::types(world, model);
diff --git a/src/gui/RDFS.hpp b/src/gui/RDFS.hpp
index d2812bc0..70c46a8e 100644
--- a/src/gui/RDFS.hpp
+++ b/src/gui/RDFS.hpp
@@ -18,10 +18,10 @@
#define INGEN_GUI_RDF_HPP
#include "ingen/URI.hpp"
-#include "ingen/memory.hpp"
#include "lilv/lilv.h"
#include <map>
+#include <memory>
#include <set>
#include <string>
@@ -61,10 +61,12 @@ void datatypes(World& world, URISet& types, bool super);
Objects instances(World& world, const URISet& types);
/** Get all the types which `model` is an instance of. */
-URISet types(World& world, SPtr<const client::ObjectModel> model);
+URISet
+types(World& world, std::shared_ptr<const client::ObjectModel> model);
/** Get all the properties with domains appropriate for `model`. */
-URISet properties(World& world, SPtr<const client::ObjectModel> model);
+URISet
+properties(World& world, std::shared_ptr<const client::ObjectModel> model);
/** Return the range (value types) of `prop`.
* @param recursive If true, include all subclasses.
diff --git a/src/gui/RenameWindow.cpp b/src/gui/RenameWindow.cpp
index 8c5e9edb..b8bd89b8 100644
--- a/src/gui/RenameWindow.cpp
+++ b/src/gui/RenameWindow.cpp
@@ -24,6 +24,7 @@
#include "ingen/client/ObjectModel.hpp"
#include "lv2/core/lv2.h"
+#include <memory>
#include <string>
namespace ingen {
@@ -58,7 +59,7 @@ RenameWindow::RenameWindow(BaseObjectType* cobject,
* This function MUST be called before using this object in any way.
*/
void
-RenameWindow::set_object(SPtr<const ObjectModel> object)
+RenameWindow::set_object(std::shared_ptr<const ObjectModel> object)
{
_object = object;
_symbol_entry->set_text(object->path().symbol());
@@ -68,7 +69,7 @@ RenameWindow::set_object(SPtr<const ObjectModel> object)
}
void
-RenameWindow::present(SPtr<const ObjectModel> object)
+RenameWindow::present(std::shared_ptr<const ObjectModel> object)
{
set_object(object);
_symbol_entry->grab_focus();
diff --git a/src/gui/RenameWindow.hpp b/src/gui/RenameWindow.hpp
index 2ea2d897..49fb93ba 100644
--- a/src/gui/RenameWindow.hpp
+++ b/src/gui/RenameWindow.hpp
@@ -20,13 +20,14 @@
#include "Window.hpp"
#include "ingen/client/ObjectModel.hpp"
-#include "ingen/memory.hpp"
#include <gtkmm/builder.h>
#include <gtkmm/button.h>
#include <gtkmm/entry.h>
#include <gtkmm/label.h>
+#include <memory>
+
namespace ingen {
namespace gui {
@@ -40,16 +41,16 @@ public:
RenameWindow(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& xml);
- void present(SPtr<const client::ObjectModel> object);
+ void present(std::shared_ptr<const client::ObjectModel> object);
private:
- void set_object(SPtr<const client::ObjectModel> object);
+ void set_object(std::shared_ptr<const client::ObjectModel> object);
void values_changed();
void cancel_clicked();
void ok_clicked();
- SPtr<const client::ObjectModel> _object;
+ std::shared_ptr<const client::ObjectModel> _object;
Gtk::Entry* _symbol_entry;
Gtk::Entry* _label_entry;
diff --git a/src/gui/SubgraphModule.cpp b/src/gui/SubgraphModule.cpp
index 1c89d564..1cbc775f 100644
--- a/src/gui/SubgraphModule.cpp
+++ b/src/gui/SubgraphModule.cpp
@@ -36,10 +36,9 @@ using namespace client;
namespace gui {
-SubgraphModule::SubgraphModule(GraphCanvas& canvas,
- SPtr<const GraphModel> graph)
- : NodeModule(canvas, graph)
- , _graph(graph)
+SubgraphModule::SubgraphModule(GraphCanvas& canvas,
+ std::shared_ptr<const GraphModel> graph)
+ : NodeModule(canvas, graph), _graph(graph)
{
assert(graph);
}
diff --git a/src/gui/SubgraphModule.hpp b/src/gui/SubgraphModule.hpp
index 1571c2ee..816d042a 100644
--- a/src/gui/SubgraphModule.hpp
+++ b/src/gui/SubgraphModule.hpp
@@ -17,11 +17,11 @@
#ifndef INGEN_GUI_SUBGRAPHMODULE_HPP
#define INGEN_GUI_SUBGRAPHMODULE_HPP
-#include "ingen/memory.hpp"
-
#include "GraphPortModule.hpp"
#include "NodeModule.hpp"
+#include <memory>
+
namespace ingen {
namespace client {
@@ -40,7 +40,8 @@ class GraphCanvas;
class SubgraphModule : public NodeModule
{
public:
- SubgraphModule(GraphCanvas& canvas, SPtr<const client::GraphModel> graph);
+ SubgraphModule(GraphCanvas& canvas,
+ std::shared_ptr<const client::GraphModel> graph);
~SubgraphModule() override = default;
@@ -51,10 +52,10 @@ public:
void browse_to_graph();
void menu_remove();
- SPtr<const client::GraphModel> graph() const { return _graph; }
+ std::shared_ptr<const client::GraphModel> graph() const { return _graph; }
protected:
- SPtr<const client::GraphModel> _graph;
+ std::shared_ptr<const client::GraphModel> _graph;
};
} // namespace gui
diff --git a/src/gui/ThreadedLoader.cpp b/src/gui/ThreadedLoader.cpp
index 45ac4f7f..41b1320e 100644
--- a/src/gui/ThreadedLoader.cpp
+++ b/src/gui/ThreadedLoader.cpp
@@ -24,6 +24,7 @@
#include "ingen/client/GraphModel.hpp"
#include <cassert>
+#include <memory>
#include <string>
using boost::optional;
@@ -31,7 +32,7 @@ using boost::optional;
namespace ingen {
namespace gui {
-ThreadedLoader::ThreadedLoader(App& app, SPtr<Interface> engine)
+ThreadedLoader::ThreadedLoader(App& app, std::shared_ptr<Interface> engine)
: _app(app)
, _sem(0)
, _engine(std::move(engine))
@@ -52,7 +53,7 @@ ThreadedLoader::~ThreadedLoader()
}
}
-SPtr<Parser>
+std::shared_ptr<Parser>
ThreadedLoader::parser()
{
return _app.world().parser();
@@ -115,7 +116,8 @@ ThreadedLoader::load_graph_event(const FilePath& file_path,
}
void
-ThreadedLoader::save_graph(SPtr<const client::GraphModel> model, const URI& uri)
+ThreadedLoader::save_graph(std::shared_ptr<const client::GraphModel> model,
+ const URI& uri)
{
std::lock_guard<std::mutex> lock(_mutex);
@@ -128,8 +130,9 @@ ThreadedLoader::save_graph(SPtr<const client::GraphModel> model, const URI& uri)
}
void
-ThreadedLoader::save_graph_event(SPtr<const client::GraphModel> model,
- const URI& uri)
+ThreadedLoader::save_graph_event(
+ std::shared_ptr<const client::GraphModel> model,
+ const URI& uri)
{
assert(uri.scheme() == "file");
if (_app.serialiser()) {
diff --git a/src/gui/ThreadedLoader.hpp b/src/gui/ThreadedLoader.hpp
index 3ab8f4a2..ec591a9c 100644
--- a/src/gui/ThreadedLoader.hpp
+++ b/src/gui/ThreadedLoader.hpp
@@ -27,6 +27,7 @@
#include <sigc++/sigc++.h>
#include <list>
+#include <memory>
#include <mutex>
#include <thread>
#include <utility>
@@ -56,7 +57,7 @@ class ThreadedLoader
{
public:
ThreadedLoader(App& app,
- SPtr<Interface> engine);
+ std::shared_ptr<Interface> engine);
~ThreadedLoader();
@@ -66,9 +67,10 @@ public:
boost::optional<Raul::Symbol> engine_symbol,
boost::optional<Properties> engine_data);
- void save_graph(SPtr<const client::GraphModel> model, const URI& uri);
+ void
+ save_graph(std::shared_ptr<const client::GraphModel> model, const URI& uri);
- SPtr<Parser> parser();
+ std::shared_ptr<Parser> parser();
private:
void load_graph_event(const FilePath& file_path,
@@ -76,21 +78,21 @@ private:
boost::optional<Raul::Symbol> engine_symbol,
boost::optional<Properties> engine_data);
- void save_graph_event(SPtr<const client::GraphModel> model,
- const URI& filename);
+ void save_graph_event(std::shared_ptr<const client::GraphModel> model,
+ const URI& filename);
/** Returns nothing and takes no parameters (because they have all been bound) */
using Closure = sigc::slot<void>;
void run();
- App& _app;
- Raul::Semaphore _sem;
- SPtr<Interface> _engine;
- std::mutex _mutex;
- std::list<Closure> _events;
- bool _exit_flag;
- std::thread _thread;
+ App& _app;
+ Raul::Semaphore _sem;
+ std::shared_ptr<Interface> _engine;
+ std::mutex _mutex;
+ std::list<Closure> _events;
+ bool _exit_flag;
+ std::thread _thread;
};
} // namespace gui
diff --git a/src/gui/WindowFactory.cpp b/src/gui/WindowFactory.cpp
index 43a2110c..4a6c2901 100644
--- a/src/gui/WindowFactory.cpp
+++ b/src/gui/WindowFactory.cpp
@@ -99,7 +99,7 @@ WindowFactory::num_open_graph_windows()
}
GraphBox*
-WindowFactory::graph_box(SPtr<const GraphModel> graph)
+WindowFactory::graph_box(std::shared_ptr<const GraphModel> graph)
{
GraphWindow* window = graph_window(graph);
if (window) {
@@ -110,7 +110,7 @@ WindowFactory::graph_box(SPtr<const GraphModel> graph)
}
GraphWindow*
-WindowFactory::graph_window(SPtr<const GraphModel> graph)
+WindowFactory::graph_window(std::shared_ptr<const GraphModel> graph)
{
if (!graph) {
return nullptr;
@@ -122,7 +122,7 @@ WindowFactory::graph_window(SPtr<const GraphModel> graph)
}
GraphWindow*
-WindowFactory::parent_graph_window(SPtr<const BlockModel> block)
+WindowFactory::parent_graph_window(std::shared_ptr<const BlockModel> block)
{
if (!block) {
return nullptr;
@@ -138,9 +138,9 @@ WindowFactory::parent_graph_window(SPtr<const BlockModel> block)
* presented and `preferred` left unmodified.
*/
void
-WindowFactory::present_graph(SPtr<const GraphModel> graph,
- GraphWindow* preferred,
- SPtr<GraphView> view)
+WindowFactory::present_graph(std::shared_ptr<const GraphModel> graph,
+ GraphWindow* preferred,
+ std::shared_ptr<GraphView> view)
{
assert(!view || view->graph() == graph);
@@ -164,8 +164,8 @@ WindowFactory::present_graph(SPtr<const GraphModel> graph,
}
GraphWindow*
-WindowFactory::new_graph_window(SPtr<const GraphModel> graph,
- SPtr<GraphView> view)
+WindowFactory::new_graph_window(std::shared_ptr<const GraphModel> graph,
+ std::shared_ptr<GraphView> view)
{
assert(!view || view->graph() == graph);
@@ -206,8 +206,8 @@ WindowFactory::remove_graph_window(GraphWindow* win, GdkEventAny* ignored)
}
void
-WindowFactory::present_load_plugin(SPtr<const GraphModel> graph,
- Properties data)
+WindowFactory::present_load_plugin(std::shared_ptr<const GraphModel> graph,
+ Properties data)
{
_app.request_plugins_if_necessary();
@@ -230,7 +230,7 @@ WindowFactory::present_load_plugin(SPtr<const GraphModel> graph,
}
void
-WindowFactory::present_load_graph(SPtr<const GraphModel> graph,
+WindowFactory::present_load_graph(std::shared_ptr<const GraphModel> graph,
Properties data)
{
auto w = _graph_windows.find(graph->path());
@@ -243,8 +243,8 @@ WindowFactory::present_load_graph(SPtr<const GraphModel> graph,
}
void
-WindowFactory::present_load_subgraph(SPtr<const GraphModel> graph,
- Properties data)
+WindowFactory::present_load_subgraph(std::shared_ptr<const GraphModel> graph,
+ Properties data)
{
auto w = _graph_windows.find(graph->path());
@@ -256,8 +256,8 @@ WindowFactory::present_load_subgraph(SPtr<const GraphModel> graph,
}
void
-WindowFactory::present_new_subgraph(SPtr<const GraphModel> graph,
- Properties data)
+WindowFactory::present_new_subgraph(std::shared_ptr<const GraphModel> graph,
+ Properties data)
{
auto w = _graph_windows.find(graph->path());
@@ -269,7 +269,7 @@ WindowFactory::present_new_subgraph(SPtr<const GraphModel> graph,
}
void
-WindowFactory::present_rename(SPtr<const ObjectModel> object)
+WindowFactory::present_rename(std::shared_ptr<const ObjectModel> object)
{
auto w = _graph_windows.find(object->path());
if (w == _graph_windows.end()) {
@@ -284,7 +284,7 @@ WindowFactory::present_rename(SPtr<const ObjectModel> object)
}
void
-WindowFactory::present_properties(SPtr<const ObjectModel> object)
+WindowFactory::present_properties(std::shared_ptr<const ObjectModel> object)
{
auto w = _graph_windows.find(object->path());
if (w == _graph_windows.end()) {
diff --git a/src/gui/WindowFactory.hpp b/src/gui/WindowFactory.hpp
index 5b1a6984..00ddce55 100644
--- a/src/gui/WindowFactory.hpp
+++ b/src/gui/WindowFactory.hpp
@@ -18,10 +18,10 @@
#define INGEN_GUI_WINDOWFACTORY_HPP
#include "ingen/Node.hpp"
-#include "ingen/memory.hpp"
#include <cstddef>
#include <map>
+#include <memory>
namespace ingen {
@@ -56,21 +56,30 @@ public:
size_t num_open_graph_windows();
- GraphBox* graph_box(SPtr<const client::GraphModel> graph);
- GraphWindow* graph_window(SPtr<const client::GraphModel> graph);
- GraphWindow* parent_graph_window(SPtr<const client::BlockModel> block);
+ GraphBox* graph_box(std::shared_ptr<const client::GraphModel> graph);
+ GraphWindow* graph_window(std::shared_ptr<const client::GraphModel> graph);
- void present_graph(
- SPtr<const client::GraphModel> graph,
- GraphWindow* preferred = nullptr,
- SPtr<GraphView> view = nullptr);
+ GraphWindow*
+ parent_graph_window(std::shared_ptr<const client::BlockModel> block);
- void present_load_plugin(SPtr<const client::GraphModel> graph, Properties data=Properties());
- void present_load_graph(SPtr<const client::GraphModel> graph, Properties data=Properties());
- void present_load_subgraph(SPtr<const client::GraphModel> graph, Properties data=Properties());
- void present_new_subgraph(SPtr<const client::GraphModel> graph, Properties data=Properties());
- void present_rename(SPtr<const client::ObjectModel> object);
- void present_properties(SPtr<const client::ObjectModel> object);
+ void present_graph(std::shared_ptr<const client::GraphModel> graph,
+ GraphWindow* preferred = nullptr,
+ std::shared_ptr<GraphView> view = nullptr);
+
+ void present_load_plugin(std::shared_ptr<const client::GraphModel> graph,
+ Properties data = Properties());
+
+ void present_load_graph(std::shared_ptr<const client::GraphModel> graph,
+ Properties data = Properties());
+
+ void present_load_subgraph(std::shared_ptr<const client::GraphModel> graph,
+ Properties data = Properties());
+
+ void present_new_subgraph(std::shared_ptr<const client::GraphModel> graph,
+ Properties data = Properties());
+
+ void present_rename(std::shared_ptr<const client::ObjectModel> object);
+ void present_properties(std::shared_ptr<const client::ObjectModel> object);
bool remove_graph_window(GraphWindow* win, GdkEventAny* ignored = nullptr);
@@ -81,8 +90,9 @@ public:
private:
using GraphWindowMap = std::map<Raul::Path, GraphWindow*>;
- GraphWindow* new_graph_window(SPtr<const client::GraphModel> graph,
- SPtr<GraphView> view);
+ GraphWindow*
+ new_graph_window(std::shared_ptr<const client::GraphModel> graph,
+ std::shared_ptr<GraphView> view);
App& _app;
GraphBox* _main_box;
diff --git a/src/gui/ingen_gui.cpp b/src/gui/ingen_gui.cpp
index c26bd205..5830fbba 100644
--- a/src/gui/ingen_gui.cpp
+++ b/src/gui/ingen_gui.cpp
@@ -46,12 +46,15 @@ struct GUIModule : public Module {
app->run();
}
- SPtr<Interface> make_client(World& world) {
- SPtr<SigClientInterface> sci(new SigClientInterface());
- return world.engine() ? sci : SPtr<Interface>(new QueuedInterface(sci));
+ std::shared_ptr<Interface> make_client(World& world)
+ {
+ auto sci = std::make_shared<SigClientInterface>();
+ return world.engine()
+ ? sci
+ : std::shared_ptr<Interface>(new QueuedInterface(sci));
}
- SPtr<gui::App> app;
+ std::shared_ptr<gui::App> app;
};
} // namespace gui
diff --git a/src/gui/ingen_gui_lv2.cpp b/src/gui/ingen_gui_lv2.cpp
index 0bd3c5ec..35e74f7d 100644
--- a/src/gui/ingen_gui_lv2.cpp
+++ b/src/gui/ingen_gui_lv2.cpp
@@ -30,7 +30,6 @@
#include "ingen/client/GraphModel.hpp"
#include "ingen/client/SigClientInterface.hpp"
#include "ingen/ingen.h"
-#include "ingen/memory.hpp"
#include "ingen/paths.hpp"
#include "ingen/runtime_paths.hpp"
#include "lv2/atom/atom.h"
@@ -84,16 +83,16 @@ struct IngenLV2UI {
, sink(nullptr)
{}
- int argc;
- char** argv;
- Forge* forge;
- World* world;
- IngenLV2AtomSink* sink;
- SPtr<gui::App> app;
- SPtr<gui::GraphBox> view;
- SPtr<Interface> engine;
- SPtr<AtomReader> reader;
- SPtr<client::SigClientInterface> client;
+ int argc;
+ char** argv;
+ Forge* forge;
+ World* world;
+ IngenLV2AtomSink* sink;
+ std::shared_ptr<gui::App> app;
+ std::shared_ptr<gui::GraphBox> view;
+ std::shared_ptr<Interface> engine;
+ std::shared_ptr<AtomReader> reader;
+ std::shared_ptr<client::SigClientInterface> client;
};
} // namespace ingen
@@ -107,10 +106,6 @@ instantiate(const LV2UI_Descriptor* descriptor,
LV2UI_Widget* widget,
const LV2_Feature* const* features)
{
-#if __cplusplus >= 201103L
- using ingen::SPtr;
-#endif
-
ingen::set_bundle_path(bundle_path);
ingen::IngenLV2UI* ui = new ingen::IngenLV2UI();
@@ -142,16 +137,15 @@ instantiate(const LV2UI_Descriptor* descriptor,
ui->world->uris(), write_function, controller);
// Set up an engine interface that writes LV2 atoms
- ui->engine = SPtr<ingen::Interface>(
+ ui->engine = std::shared_ptr<ingen::Interface>(
new ingen::AtomWriter(
ui->world->uri_map(), ui->world->uris(), *ui->sink));
ui->world->set_interface(ui->engine);
// Create App and client
- ui->app = ingen::gui::App::create(*ui->world);
- ui->client = SPtr<ingen::client::SigClientInterface>(
- new ingen::client::SigClientInterface());
+ ui->app = ingen::gui::App::create(*ui->world);
+ ui->client = std::make_shared<ingen::client::SigClientInterface>();
ui->app->set_is_plugin(true);
ui->app->attach(ui->client);