summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-01-12 23:38:03 +0000
committerDavid Robillard <d@drobilla.net>2013-01-12 23:38:03 +0000
commitdf1447c665e6c3631961297a9d3e9aff4e94c47f (patch)
treec0ff117c362e6d571f430f886ab62f372b59af08 /src/gui
parentbb335dca695273622b7a4ebbefbe9e089edb9ab4 (diff)
downloadingen-df1447c665e6c3631961297a9d3e9aff4e94c47f.tar.gz
ingen-df1447c665e6c3631961297a9d3e9aff4e94c47f.tar.bz2
ingen-df1447c665e6c3631961297a9d3e9aff4e94c47f.zip
Remove Raul::SharedPtr and switch to std::shared_ptr.
Use project local short type aliases for shared_ptr and friends. Move Raul::Disposable and Raul::Manageable into Raul::Maid. Use sets to store machina nodes and edges to avoid O(n) searches. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4939 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/App.cpp18
-rw-r--r--src/gui/App.hpp24
-rw-r--r--src/gui/Arc.cpp10
-rw-r--r--src/gui/Arc.hpp16
-rw-r--r--src/gui/BreadCrumbs.cpp12
-rw-r--r--src/gui/BreadCrumbs.hpp24
-rw-r--r--src/gui/ConnectWindow.cpp16
-rw-r--r--src/gui/ConnectWindow.hpp4
-rw-r--r--src/gui/GraphBox.cpp20
-rw-r--r--src/gui/GraphBox.hpp28
-rw-r--r--src/gui/GraphCanvas.cpp43
-rw-r--r--src/gui/GraphCanvas.hpp38
-rw-r--r--src/gui/GraphPortModule.cpp12
-rw-r--r--src/gui/GraphPortModule.hpp16
-rw-r--r--src/gui/GraphTreeWindow.cpp32
-rw-r--r--src/gui/GraphTreeWindow.hpp24
-rw-r--r--src/gui/GraphView.cpp10
-rw-r--r--src/gui/GraphView.hpp18
-rw-r--r--src/gui/GraphWindow.hpp6
-rw-r--r--src/gui/LoadGraphWindow.cpp8
-rw-r--r--src/gui/LoadGraphWindow.hpp13
-rw-r--r--src/gui/LoadPluginWindow.cpp36
-rw-r--r--src/gui/LoadPluginWindow.hpp28
-rw-r--r--src/gui/NewSubgraphWindow.cpp6
-rw-r--r--src/gui/NewSubgraphWindow.hpp13
-rw-r--r--src/gui/NodeMenu.cpp2
-rw-r--r--src/gui/NodeMenu.hpp4
-rw-r--r--src/gui/NodeModule.cpp18
-rw-r--r--src/gui/NodeModule.hpp28
-rw-r--r--src/gui/ObjectMenu.cpp2
-rw-r--r--src/gui/ObjectMenu.hpp23
-rw-r--r--src/gui/Port.cpp46
-rw-r--r--src/gui/Port.hpp37
-rw-r--r--src/gui/PortMenu.cpp32
-rw-r--r--src/gui/PortMenu.hpp8
-rw-r--r--src/gui/PortPropertiesWindow.cpp4
-rw-r--r--src/gui/PortPropertiesWindow.hpp17
-rw-r--r--src/gui/PropertiesWindow.cpp4
-rw-r--r--src/gui/PropertiesWindow.hpp35
-rw-r--r--src/gui/RDFS.cpp4
-rw-r--r--src/gui/RDFS.hpp6
-rw-r--r--src/gui/RenameWindow.cpp4
-rw-r--r--src/gui/RenameWindow.hpp9
-rw-r--r--src/gui/Style.hpp2
-rw-r--r--src/gui/SubgraphModule.cpp8
-rw-r--r--src/gui/SubgraphModule.hpp8
-rw-r--r--src/gui/ThreadedLoader.cpp12
-rw-r--r--src/gui/ThreadedLoader.hpp24
-rw-r--r--src/gui/WindowFactory.cpp38
-rw-r--r--src/gui/WindowFactory.hpp30
-rw-r--r--src/gui/ingen_gui.cpp2
-rw-r--r--src/gui/ingen_gui_lv2.cpp32
52 files changed, 452 insertions, 462 deletions
diff --git a/src/gui/App.cpp b/src/gui/App.cpp
index 11da12f0..5fcfb57d 100644
--- a/src/gui/App.cpp
+++ b/src/gui/App.cpp
@@ -97,7 +97,7 @@ App::~App()
delete _window_factory;
}
-SharedPtr<App>
+SPtr<App>
App::create(Ingen::World* world)
{
_main = Gtk::Main::instance();
@@ -136,7 +136,7 @@ App::create(Ingen::World* world)
Gtk::RC::parse_string(rc_style);
- return SharedPtr<App>(app);
+ return SPtr<App>(app);
}
void
@@ -155,7 +155,7 @@ App::run()
}
void
-App::attach(SharedPtr<SigClientInterface> client)
+App::attach(SPtr<SigClientInterface> client)
{
assert(!_client);
assert(!_store);
@@ -166,8 +166,8 @@ App::attach(SharedPtr<SigClientInterface> client)
}
_client = client;
- _store = SharedPtr<ClientStore>(new ClientStore(_world->uris(), _world->log(), _world->interface(), client));
- _loader = SharedPtr<ThreadedLoader>(new ThreadedLoader(*this, _world->interface()));
+ _store = SPtr<ClientStore>(new ClientStore(_world->uris(), _world->log(), _world->interface(), client));
+ _loader = SPtr<ThreadedLoader>(new ThreadedLoader(*this, _world->interface()));
_graph_tree_window->init(*this, *_store);
@@ -189,7 +189,7 @@ App::detach()
_loader.reset();
_store.reset();
_client.reset();
- _world->set_interface(SharedPtr<Interface>());
+ _world->set_interface(SPtr<Interface>());
}
}
@@ -202,7 +202,7 @@ App::request_plugins_if_necessary()
}
}
-SharedPtr<Serialisation::Serialiser>
+SPtr<Serialisation::Serialiser>
App::serialiser()
{
if (!_world->serialiser())
@@ -376,10 +376,6 @@ struct IconDestroyNotification {
Glib::RefPtr<Gdk::Pixbuf>
App::icon_from_path(const string& path, int size)
{
- /* If weak references to Glib::Objects are needed somewhere else it will
- probably be a good idea to create a proper WeakPtr class instead of
- using raw pointers, but for a single use this will do. */
-
Glib::RefPtr<Gdk::Pixbuf> buf;
if (path.length() == 0)
return buf;
diff --git a/src/gui/App.hpp b/src/gui/App.hpp
index 2b27de25..e435c4a5 100644
--- a/src/gui/App.hpp
+++ b/src/gui/App.hpp
@@ -28,9 +28,9 @@
#include "ingen/Status.hpp"
#include "ingen/World.hpp"
+#include "ingen/types.hpp"
#include "raul/Atom.hpp"
#include "raul/Deletable.hpp"
-#include "raul/SharedPtr.hpp"
#include "raul/URI.hpp"
namespace Ingen {
@@ -74,7 +74,7 @@ public:
void error_message(const std::string& msg);
- void attach(SharedPtr<Client::SigClientInterface> client);
+ void attach(SPtr<Client::SigClientInterface> client);
void detach();
@@ -108,15 +108,15 @@ public:
Glib::RefPtr<Gdk::Pixbuf> icon_from_path(const std::string& path, int size);
- Ingen::Forge& forge() const { return _world->forge(); }
- SharedPtr<Ingen::Interface> interface() const { return _world->interface(); }
- SharedPtr<Client::SigClientInterface> client() const { return _client; }
- SharedPtr<Client::ClientStore> store() const { return _store; }
- SharedPtr<ThreadedLoader> loader() const { return _loader; }
+ Ingen::Forge& forge() const { return _world->forge(); }
+ SPtr<Ingen::Interface> interface() const { return _world->interface(); }
+ SPtr<Client::SigClientInterface> client() const { return _client; }
+ SPtr<Client::ClientStore> store() const { return _store; }
+ SPtr<ThreadedLoader> loader() const { return _loader; }
- SharedPtr<Serialisation::Serialiser> serialiser();
+ SPtr<Serialisation::Serialiser> serialiser();
- static SharedPtr<App> create(Ingen::World* world);
+ static SPtr<App> create(Ingen::World* world);
void run();
inline Ingen::World* world() const { return _world; }
@@ -152,9 +152,9 @@ protected:
static Gtk::Main* _main;
- SharedPtr<Client::SigClientInterface> _client;
- SharedPtr<Client::ClientStore> _store;
- SharedPtr<ThreadedLoader> _loader;
+ SPtr<Client::SigClientInterface> _client;
+ SPtr<Client::ClientStore> _store;
+ SPtr<ThreadedLoader> _loader;
Style* _style;
diff --git a/src/gui/Arc.cpp b/src/gui/Arc.cpp
index b75f30ae..0289d2b7 100644
--- a/src/gui/Arc.cpp
+++ b/src/gui/Arc.cpp
@@ -19,11 +19,11 @@
namespace Ingen {
namespace GUI {
-Arc::Arc(Ganv::Canvas& canvas,
- boost::shared_ptr<const Client::ArcModel> model,
- Ganv::Node* src,
- Ganv::Node* dst,
- uint32_t color)
+Arc::Arc(Ganv::Canvas& canvas,
+ SPtr<const Client::ArcModel> model,
+ Ganv::Node* src,
+ Ganv::Node* dst,
+ uint32_t color)
: Ganv::Edge(canvas, src, dst, color)
, _arc_model(model)
{
diff --git a/src/gui/Arc.hpp b/src/gui/Arc.hpp
index df6dfbfb..52a03a23 100644
--- a/src/gui/Arc.hpp
+++ b/src/gui/Arc.hpp
@@ -20,7 +20,7 @@
#include <cassert>
#include "ganv/Edge.hpp"
-#include "raul/SharedPtr.hpp"
+#include "ingen/types.hpp"
namespace Ingen {
@@ -35,16 +35,16 @@ namespace GUI {
class Arc : public Ganv::Edge
{
public:
- Arc(Ganv::Canvas& canvas,
- boost::shared_ptr<const Client::ArcModel> model,
- Ganv::Node* src,
- Ganv::Node* dst,
- uint32_t color);
+ Arc(Ganv::Canvas& canvas,
+ SPtr<const Client::ArcModel> model,
+ Ganv::Node* src,
+ Ganv::Node* dst,
+ uint32_t color);
- SharedPtr<const Client::ArcModel> model() const { return _arc_model; }
+ SPtr<const Client::ArcModel> model() const { return _arc_model; }
private:
- SharedPtr<const Client::ArcModel> _arc_model;
+ SPtr<const Client::ArcModel> _arc_model;
};
} // namespace GUI
diff --git a/src/gui/BreadCrumbs.cpp b/src/gui/BreadCrumbs.cpp
index 22142285..8073f933 100644
--- a/src/gui/BreadCrumbs.cpp
+++ b/src/gui/BreadCrumbs.cpp
@@ -39,14 +39,14 @@ BreadCrumbs::BreadCrumbs(App& app)
set_can_focus(false);
}
-SharedPtr<GraphView>
+SPtr<GraphView>
BreadCrumbs::view(const Raul::Path& path)
{
for (const auto& b : _breadcrumbs)
if (b->path() == path)
return b->view();
- return SharedPtr<GraphView>();
+ return SPtr<GraphView>();
}
/** Sets up the crumbs to display @a path.
@@ -55,7 +55,7 @@ BreadCrumbs::view(const Raul::Path& path)
* children preserved.
*/
void
-BreadCrumbs::build(Raul::Path path, SharedPtr<GraphView> view)
+BreadCrumbs::build(Raul::Path path, SPtr<GraphView> view)
{
bool old_enable_signal = _enable_signal;
_enable_signal = false;
@@ -146,11 +146,11 @@ BreadCrumbs::build(Raul::Path path, SharedPtr<GraphView> view)
* match, otherwise ignoring @a view.
*/
BreadCrumbs::BreadCrumb*
-BreadCrumbs::create_crumb(const Raul::Path& path,
- SharedPtr<GraphView> view)
+BreadCrumbs::create_crumb(const Raul::Path& path,
+ SPtr<GraphView> view)
{
BreadCrumb* but = manage(new BreadCrumb(path,
- (view && path == view->graph()->path()) ? view : SharedPtr<GraphView>()));
+ (view && path == view->graph()->path()) ? view : SPtr<GraphView>()));
but->signal_toggled().connect(sigc::bind(sigc::mem_fun(
this, &BreadCrumbs::breadcrumb_clicked), but));
diff --git a/src/gui/BreadCrumbs.hpp b/src/gui/BreadCrumbs.hpp
index cdb11583..933a28dc 100644
--- a/src/gui/BreadCrumbs.hpp
+++ b/src/gui/BreadCrumbs.hpp
@@ -24,9 +24,9 @@
#include <gtkmm/togglebutton.h>
#include "raul/Path.hpp"
-#include "raul/SharedPtr.hpp"
#include "ingen/client/GraphModel.hpp"
+#include "ingen/types.hpp"
#include "GraphView.hpp"
@@ -43,11 +43,11 @@ class BreadCrumbs : public Gtk::HBox
public:
explicit BreadCrumbs(App& app);
- SharedPtr<GraphView> view(const Raul::Path& path);
+ SPtr<GraphView> view(const Raul::Path& path);
- void build(Raul::Path path, SharedPtr<GraphView> view);
+ void build(Raul::Path path, SPtr<GraphView> view);
- sigc::signal<void, const Raul::Path&, SharedPtr<GraphView> > signal_graph_selected;
+ sigc::signal<void, const Raul::Path&, SPtr<GraphView> > signal_graph_selected;
private:
/** Breadcrumb button.
@@ -62,7 +62,7 @@ private:
class BreadCrumb : public Gtk::ToggleButton
{
public:
- BreadCrumb(const Raul::Path& path, SharedPtr<GraphView> view = SharedPtr<GraphView>())
+ BreadCrumb(const Raul::Path& path, SPtr<GraphView> view = SPtr<GraphView>())
: _path(path)
, _view(view)
{
@@ -73,13 +73,13 @@ private:
show_all();
}
- void set_view(SharedPtr<GraphView> view) {
+ void set_view(SPtr<GraphView> view) {
assert(!view || view->graph()->path() == _path);
_view = view;
}
- const Raul::Path& path() const { return _path; }
- SharedPtr<GraphView> view() const { return _view; }
+ const Raul::Path& path() const { return _path; }
+ SPtr<GraphView> view() const { return _view; }
void set_path(const Raul::Path& path) {
remove();
@@ -94,12 +94,12 @@ private:
}
private:
- Raul::Path _path;
- SharedPtr<GraphView> _view;
+ Raul::Path _path;
+ SPtr<GraphView> _view;
};
- BreadCrumb* create_crumb(const Raul::Path& path,
- SharedPtr<GraphView> view = SharedPtr<GraphView>());
+ BreadCrumb* create_crumb(const Raul::Path& path,
+ SPtr<GraphView> view = SPtr<GraphView>());
void breadcrumb_clicked(BreadCrumb* crumb);
diff --git a/src/gui/ConnectWindow.cpp b/src/gui/ConnectWindow.cpp
index ab889461..ca4836b7 100644
--- a/src/gui/ConnectWindow.cpp
+++ b/src/gui/ConnectWindow.cpp
@@ -82,11 +82,11 @@ ConnectWindow::start(App& app, Ingen::World* world)
}
set_connected_to(world->interface());
- connect(world->interface());
+ connect(bool(world->interface()));
}
void
-ConnectWindow::set_connected_to(SharedPtr<Ingen::Interface> engine)
+ConnectWindow::set_connected_to(SPtr<Ingen::Interface> engine)
{
_app->world()->set_interface(engine);
@@ -174,9 +174,9 @@ ConnectWindow::connect(bool existing)
uri = world->interface()->uri();
}
- SharedPtr<ThreadedSigClientInterface> tsci;
+ SPtr<ThreadedSigClientInterface> tsci;
if (world->interface()) {
- tsci = PtrCast<ThreadedSigClientInterface>(
+ tsci = dynamic_ptr_cast<ThreadedSigClientInterface>(
world->interface()->respondee());
}
@@ -200,7 +200,7 @@ ConnectWindow::connect(bool existing)
if (Raul::Process::launch(cmd)) {
const Raul::URI engine_uri(string("tcp://localhost:") + port_str);
- SharedPtr<ThreadedSigClientInterface> tsci(new ThreadedSigClientInterface(1024));
+ SPtr<ThreadedSigClientInterface> tsci(new ThreadedSigClientInterface(1024));
world->set_interface(world->new_interface(engine_uri, tsci));
_app->attach(tsci);
@@ -221,7 +221,7 @@ ConnectWindow::connect(bool existing)
world->engine()->activate();
}
- SharedPtr<SigClientInterface> client(new SigClientInterface());
+ SPtr<SigClientInterface> client(new SigClientInterface());
world->interface()->set_respondee(client);
_app->attach(client);
@@ -239,7 +239,7 @@ ConnectWindow::disconnect()
_attached = false;
_app->detach();
- set_connected_to(SharedPtr<Ingen::Interface>());
+ set_connected_to(SPtr<Ingen::Interface>());
if (!_widgets_loaded)
return;
@@ -418,7 +418,7 @@ ConnectWindow::gtk_callback()
++_connect_stage;
} else if (_connect_stage == 3) {
if (_app->store()->size() > 0) {
- SharedPtr<const GraphModel> root = PtrCast<const GraphModel>(
+ SPtr<const GraphModel> root = dynamic_ptr_cast<const GraphModel>(
_app->store()->object(Raul::Path("/")));
if (root) {
set_connected_to(_app->interface());
diff --git a/src/gui/ConnectWindow.hpp b/src/gui/ConnectWindow.hpp
index ade0f3b1..2efa394f 100644
--- a/src/gui/ConnectWindow.hpp
+++ b/src/gui/ConnectWindow.hpp
@@ -26,8 +26,8 @@
#include <gtkmm/radiobutton.h>
#include <gtkmm/spinbutton.h>
+#include "ingen/types.hpp"
#include "lilv/lilv.h"
-#include "raul/SharedPtr.hpp"
#include "Window.hpp"
@@ -49,7 +49,7 @@ public:
ConnectWindow(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& xml);
- void set_connected_to(SharedPtr<Ingen::Interface> engine);
+ void set_connected_to(SPtr<Ingen::Interface> engine);
void start(App& app, Ingen::World* world);
void ingen_response(int32_t id, Status status, const std::string& subject) {
_attached = true;
diff --git a/src/gui/GraphBox.cpp b/src/gui/GraphBox.cpp
index fd47ee26..84116196 100644
--- a/src/gui/GraphBox.cpp
+++ b/src/gui/GraphBox.cpp
@@ -157,15 +157,15 @@ GraphBox::~GraphBox()
delete _breadcrumbs;
}
-SharedPtr<GraphBox>
-GraphBox::create(App& app, SharedPtr<const GraphModel> graph)
+SPtr<GraphBox>
+GraphBox::create(App& app, SPtr<const GraphModel> graph)
{
GraphBox* result = NULL;
Glib::RefPtr<Gtk::Builder> xml = WidgetFactory::create("graph_win");
xml->get_widget_derived("graph_win_vbox", result);
result->init_box(app);
- result->set_graph(graph, SharedPtr<GraphView>());
- return SharedPtr<GraphBox>(result);
+ result->set_graph(graph, SPtr<GraphView>());
+ return SPtr<GraphBox>(result);
}
void
@@ -193,13 +193,13 @@ GraphBox::init_box(App& app)
}
void
-GraphBox::set_graph_from_path(const Raul::Path& path, SharedPtr<GraphView> view)
+GraphBox::set_graph_from_path(const Raul::Path& path, SPtr<GraphView> view)
{
if (view) {
assert(view->graph()->path() == path);
_app->window_factory()->present_graph(view->graph(), _window, view);
} else {
- SharedPtr<const GraphModel> model = PtrCast<const GraphModel>(
+ SPtr<const GraphModel> model = dynamic_ptr_cast<const GraphModel>(
_app->store()->object(path));
if (model) {
_app->window_factory()->present_graph(model, _window);
@@ -212,8 +212,8 @@ GraphBox::set_graph_from_path(const Raul::Path& path, SharedPtr<GraphView> view)
* If @a view is NULL, a new view will be created.
*/
void
-GraphBox::set_graph(SharedPtr<const GraphModel> graph,
- SharedPtr<GraphView> view)
+GraphBox::set_graph(SPtr<const GraphModel> graph,
+ SPtr<GraphView> view)
{
if (!graph || graph == _graph)
return;
@@ -287,7 +287,7 @@ GraphBox::set_graph(SharedPtr<const GraphModel> graph,
}
void
-GraphBox::graph_port_added(SharedPtr<const PortModel> port)
+GraphBox::graph_port_added(SPtr<const PortModel> port)
{
if (port->is_input() && _app->can_control(port.get())) {
_menu_view_control_window->property_sensitive() = true;
@@ -295,7 +295,7 @@ GraphBox::graph_port_added(SharedPtr<const PortModel> port)
}
void
-GraphBox::graph_port_removed(SharedPtr<const PortModel> port)
+GraphBox::graph_port_removed(SPtr<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 f78d8a2b..663a3c14 100644
--- a/src/gui/GraphBox.hpp
+++ b/src/gui/GraphBox.hpp
@@ -28,7 +28,7 @@
#include <gtkmm/scrolledwindow.h>
#include <gtkmm/statusbar.h>
-#include "raul/SharedPtr.hpp"
+#include "ingen/types.hpp"
#include "Window.hpp"
@@ -67,33 +67,33 @@ public:
const Glib::RefPtr<Gtk::Builder>& xml);
~GraphBox();
- static SharedPtr<GraphBox> create(
- App& app, SharedPtr<const Client::GraphModel> graph);
+ static SPtr<GraphBox> create(
+ App& app, SPtr<const Client::GraphModel> graph);
void init_box(App& app);
- void set_graph(SharedPtr<const Client::GraphModel> graph,
- SharedPtr<GraphView> view);
+ void set_graph(SPtr<const Client::GraphModel> graph,
+ SPtr<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);
- SharedPtr<const Client::GraphModel> graph() const { return _graph; }
- SharedPtr<GraphView> view() const { return _view; }
+ SPtr<const Client::GraphModel> graph() const { return _graph; }
+ SPtr<GraphView> view() const { return _view; }
void show_port_status(const Client::PortModel* model,
const Raul::Atom& value);
- void set_graph_from_path(const Raul::Path& path, SharedPtr<GraphView> view);
+ void set_graph_from_path(const Raul::Path& path, SPtr<GraphView> view);
void object_entered(const Client::ObjectModel* model);
void object_left(const Client::ObjectModel* model);
private:
- void graph_port_added(SharedPtr<const Client::PortModel> port);
- void graph_port_removed(SharedPtr<const Client::PortModel> port);
+ void graph_port_added(SPtr<const Client::PortModel> port);
+ void graph_port_removed(SPtr<const Client::PortModel> port);
void show_status(const Client::ObjectModel* model);
int message_dialog(const Glib::ustring& message,
@@ -124,10 +124,10 @@ private:
void event_show_engine();
void event_clipboard_changed(GdkEventOwnerChange* ev);
- App* _app;
- SharedPtr<const Client::GraphModel> _graph;
- SharedPtr<GraphView> _view;
- GraphWindow* _window;
+ App* _app;
+ SPtr<const Client::GraphModel> _graph;
+ SPtr<GraphView> _view;
+ GraphWindow* _window;
sigc::connection new_port_connection;
sigc::connection removed_port_connection;
diff --git a/src/gui/GraphCanvas.cpp b/src/gui/GraphCanvas.cpp
index 371f7444..3d742e1d 100644
--- a/src/gui/GraphCanvas.cpp
+++ b/src/gui/GraphCanvas.cpp
@@ -59,10 +59,10 @@ using namespace Client;
namespace GUI {
-GraphCanvas::GraphCanvas(App& app,
- SharedPtr<const GraphModel> graph,
- int width,
- int height)
+GraphCanvas::GraphCanvas(App& app,
+ SPtr<const GraphModel> graph,
+ int width,
+ int height)
: Canvas(width, height)
, _app(app)
, _graph(graph)
@@ -207,7 +207,7 @@ GraphCanvas::build_menus()
}
// Add known plugins to menu heirarchy
- SharedPtr<const ClientStore::Plugins> plugins = _app.store()->plugins();
+ SPtr<const ClientStore::Plugins> plugins = _app.store()->plugins();
for (const auto& p : *plugins.get())
add_plugin(p.second);
}
@@ -306,7 +306,7 @@ GraphCanvas::build()
// Create modules for blocks
for (Store::const_iterator i = kids.first; i != kids.second; ++i) {
- SharedPtr<BlockModel> block = PtrCast<BlockModel>(i->second);
+ SPtr<BlockModel> block = dynamic_ptr_cast<BlockModel>(i->second);
if (block && block->parent() == _graph)
add_block(block);
}
@@ -318,7 +318,7 @@ GraphCanvas::build()
// Create arcs
for (const auto& a : _graph->arcs()) {
- connection(PtrCast<ArcModel>(a.second));
+ connection(dynamic_ptr_cast<ArcModel>(a.second));
}
}
@@ -352,7 +352,7 @@ GraphCanvas::show_port_names(bool b)
}
void
-GraphCanvas::add_plugin(SharedPtr<PluginModel> p)
+GraphCanvas::add_plugin(SPtr<PluginModel> p)
{
typedef ClassMenus::iterator iterator;
if (_internal_menu && p->type() == Plugin::Internal) {
@@ -406,10 +406,10 @@ GraphCanvas::add_plugin(SharedPtr<PluginModel> p)
}
void
-GraphCanvas::add_block(SharedPtr<const BlockModel> bm)
+GraphCanvas::add_block(SPtr<const BlockModel> bm)
{
- SharedPtr<const GraphModel> pm = PtrCast<const GraphModel>(bm);
- NodeModule* module;
+ SPtr<const GraphModel> pm = dynamic_ptr_cast<const GraphModel>(bm);
+ NodeModule* module;
if (pm) {
module = SubgraphModule::create(*this, pm, _human_names);
} else {
@@ -427,7 +427,7 @@ GraphCanvas::add_block(SharedPtr<const BlockModel> bm)
}
void
-GraphCanvas::remove_block(SharedPtr<const BlockModel> bm)
+GraphCanvas::remove_block(SPtr<const BlockModel> bm)
{
Views::iterator i = _views.find(bm);
@@ -442,7 +442,7 @@ GraphCanvas::remove_block(SharedPtr<const BlockModel> bm)
}
void
-GraphCanvas::add_port(SharedPtr<const PortModel> pm)
+GraphCanvas::add_port(SPtr<const PortModel> pm)
{
GraphPortModule* view = GraphPortModule::create(*this, pm, _human_names);
_views.insert(std::make_pair(pm, view));
@@ -450,7 +450,7 @@ GraphCanvas::add_port(SharedPtr<const PortModel> pm)
}
void
-GraphCanvas::remove_port(SharedPtr<const PortModel> pm)
+GraphCanvas::remove_port(SPtr<const PortModel> pm)
{
Views::iterator i = _views.find(pm);
@@ -468,7 +468,7 @@ GraphCanvas::remove_port(SharedPtr<const PortModel> pm)
}
Ganv::Port*
-GraphCanvas::get_port_view(SharedPtr<PortModel> port)
+GraphCanvas::get_port_view(SPtr<PortModel> port)
{
Ganv::Module* module = _views[port];
@@ -493,7 +493,7 @@ GraphCanvas::get_port_view(SharedPtr<PortModel> port)
}
void
-GraphCanvas::connection(SharedPtr<const ArcModel> arc)
+GraphCanvas::connection(SPtr<const ArcModel> arc)
{
Ganv::Port* const tail = get_port_view(arc->tail());
Ganv::Port* const head = get_port_view(arc->head());
@@ -507,7 +507,7 @@ GraphCanvas::connection(SharedPtr<const ArcModel> arc)
}
void
-GraphCanvas::disconnection(SharedPtr<const ArcModel> arc)
+GraphCanvas::disconnection(SPtr<const ArcModel> arc)
{
Ganv::Port* const src = get_port_view(arc->tail());
Ganv::Port* const dst = get_port_view(arc->head());
@@ -713,7 +713,7 @@ void
GraphCanvas::paste()
{
Glib::ustring str = Gtk::Clipboard::get()->wait_for_text();
- SharedPtr<Serialisation::Parser> parser = _app.loader()->parser();
+ SPtr<Serialisation::Parser> parser = _app.loader()->parser();
if (!parser) {
_app.log().error("Unable to load parser, paste unavailable\n");
return;
@@ -782,7 +782,8 @@ GraphCanvas::paste()
_pastees.insert(c.first);
}
- builder.connect(PtrCast<const GraphModel>(clipboard.object(_graph->path())));
+ builder.connect(
+ dynamic_ptr_cast<const GraphModel>(clipboard.object(_graph->path())));
}
void
@@ -837,9 +838,9 @@ GraphCanvas::menu_add_port(const string& sym_base, const string& name_base,
}
void
-GraphCanvas::load_plugin(WeakPtr<PluginModel> weak_plugin)
+GraphCanvas::load_plugin(WPtr<PluginModel> weak_plugin)
{
- SharedPtr<PluginModel> plugin = weak_plugin.lock();
+ SPtr<PluginModel> plugin = weak_plugin.lock();
if (!plugin)
return;
diff --git a/src/gui/GraphCanvas.hpp b/src/gui/GraphCanvas.hpp
index 6d4bbc87..77498748 100644
--- a/src/gui/GraphCanvas.hpp
+++ b/src/gui/GraphCanvas.hpp
@@ -27,12 +27,12 @@
#include "ganv/Canvas.hpp"
#include "ganv/Module.hpp"
-#include "raul/SharedPtr.hpp"
+#include "ingen/Node.hpp"
+#include "ingen/client/ArcModel.hpp"
+#include "ingen/types.hpp"
#include "raul/Path.hpp"
#include "NodeModule.hpp"
-#include "ingen/Node.hpp"
-#include "ingen/client/ArcModel.hpp"
namespace Ingen {
@@ -49,10 +49,10 @@ class NodeModule;
class GraphCanvas : public Ganv::Canvas
{
public:
- GraphCanvas(App& app,
- SharedPtr<const Client::GraphModel> graph,
- int width,
- int height);
+ GraphCanvas(App& app,
+ SPtr<const Client::GraphModel> graph,
+ int width,
+ int height);
virtual ~GraphCanvas() {}
@@ -63,13 +63,13 @@ public:
void show_port_names(bool show);
bool show_port_names() const { return _show_port_names; }
- void add_plugin(SharedPtr<Client::PluginModel> pm);
- void add_block(SharedPtr<const Client::BlockModel> bm);
- void remove_block(SharedPtr<const Client::BlockModel> bm);
- void add_port(SharedPtr<const Client::PortModel> pm);
- void remove_port(SharedPtr<const Client::PortModel> pm);
- void connection(SharedPtr<const Client::ArcModel> am);
- void disconnection(SharedPtr<const Client::ArcModel> am);
+ void add_plugin(SPtr<Client::PluginModel> pm);
+ void add_block(SPtr<const Client::BlockModel> bm);
+ void remove_block(SPtr<const Client::BlockModel> bm);
+ void add_port(SPtr<const Client::PortModel> pm);
+ void remove_port(SPtr<const Client::PortModel> pm);
+ void connection(SPtr<const Client::ArcModel> am);
+ void disconnection(SPtr<const Client::ArcModel> am);
void get_new_module_location(double& x, double& y);
@@ -96,7 +96,7 @@ private:
void menu_new_graph();
void menu_load_graph();
void menu_properties();
- void load_plugin(WeakPtr<Client::PluginModel> plugin);
+ void load_plugin(WPtr<Client::PluginModel> plugin);
void build_menus();
@@ -116,7 +116,7 @@ private:
Node::Properties get_initial_data(Resource::Graph ctx=Resource::Graph::DEFAULT);
- Ganv::Port* get_port_view(SharedPtr<Client::PortModel> port);
+ Ganv::Port* get_port_view(SPtr<Client::PortModel> port);
void connect(Ganv::Node* src,
Ganv::Node* dst);
@@ -124,10 +124,10 @@ private:
void disconnect(Ganv::Node* src,
Ganv::Node* dst);
- App& _app;
- SharedPtr<const Client::GraphModel> _graph;
+ App& _app;
+ SPtr<const Client::GraphModel> _graph;
- typedef std::map<SharedPtr<const Client::ObjectModel>, Ganv::Module*> Views;
+ typedef std::map<SPtr<const Client::ObjectModel>, Ganv::Module*> Views;
Views _views;
int _auto_position_count;
diff --git a/src/gui/GraphPortModule.cpp b/src/gui/GraphPortModule.cpp
index d495cbe4..402da865 100644
--- a/src/gui/GraphPortModule.cpp
+++ b/src/gui/GraphPortModule.cpp
@@ -42,14 +42,14 @@ using namespace Client;
namespace GUI {
-GraphPortModule::GraphPortModule(GraphCanvas& canvas,
- SharedPtr<const Client::PortModel> model)
+GraphPortModule::GraphPortModule(GraphCanvas& canvas,
+ SPtr<const Client::PortModel> model)
: Ganv::Module(canvas, "", 0, 0, false) // FIXME: coords?
, _model(model)
{
assert(model);
- assert(PtrCast<const GraphModel>(model->parent()));
+ assert(dynamic_ptr_cast<const GraphModel>(model->parent()));
set_stacked(model->polyphonic());
@@ -61,9 +61,9 @@ GraphPortModule::GraphPortModule(GraphCanvas& canvas,
}
GraphPortModule*
-GraphPortModule::create(GraphCanvas& canvas,
- SharedPtr<const PortModel> model,
- bool human)
+GraphPortModule::create(GraphCanvas& canvas,
+ SPtr<const PortModel> model,
+ bool human)
{
GraphPortModule* ret = new GraphPortModule(canvas, model);
Port* port = Port::create(canvas.app(), *ret, model, human, true);
diff --git a/src/gui/GraphPortModule.hpp b/src/gui/GraphPortModule.hpp
index 722f35c3..9f2c96fd 100644
--- a/src/gui/GraphPortModule.hpp
+++ b/src/gui/GraphPortModule.hpp
@@ -49,9 +49,9 @@ class GraphPortModule : public Ganv::Module
{
public:
static GraphPortModule* create(
- GraphCanvas& canvas,
- SharedPtr<const Client::PortModel> model,
- bool human);
+ GraphCanvas& canvas,
+ SPtr<const Client::PortModel> model,
+ bool human);
App& app() const;
@@ -60,11 +60,11 @@ public:
void set_name(const std::string& n);
- SharedPtr<const Client::PortModel> port() const { return _model; }
+ SPtr<const Client::PortModel> port() const { return _model; }
protected:
- GraphPortModule(GraphCanvas& canvas,
- SharedPtr<const Client::PortModel> model);
+ GraphPortModule(GraphCanvas& canvas,
+ SPtr<const Client::PortModel> model);
bool show_menu(GdkEventButton* ev);
void set_selected(gboolean b);
@@ -73,8 +73,8 @@ protected:
void property_changed(const Raul::URI& predicate, const Raul::Atom& value);
- SharedPtr<const Client::PortModel> _model;
- Port* _port;
+ SPtr<const Client::PortModel> _model;
+ Port* _port;
};
} // namespace GUI
diff --git a/src/gui/GraphTreeWindow.cpp b/src/gui/GraphTreeWindow.cpp
index 7ddbb23a..ff38e707 100644
--- a/src/gui/GraphTreeWindow.cpp
+++ b/src/gui/GraphTreeWindow.cpp
@@ -75,15 +75,15 @@ GraphTreeWindow::init(App& app, ClientStore& store)
}
void
-GraphTreeWindow::new_object(SharedPtr<ObjectModel> object)
+GraphTreeWindow::new_object(SPtr<ObjectModel> object)
{
- SharedPtr<GraphModel> graph = PtrCast<GraphModel>(object);
+ SPtr<GraphModel> graph = dynamic_ptr_cast<GraphModel>(object);
if (graph)
add_graph(graph);
}
void
-GraphTreeWindow::add_graph(SharedPtr<GraphModel> pm)
+GraphTreeWindow::add_graph(SPtr<GraphModel> pm)
{
if (!pm->parent()) {
Gtk::TreeModel::iterator iter = _graph_treestore->append();
@@ -124,7 +124,7 @@ GraphTreeWindow::add_graph(SharedPtr<GraphModel> pm)
}
void
-GraphTreeWindow::remove_graph(SharedPtr<GraphModel> pm)
+GraphTreeWindow::remove_graph(SPtr<GraphModel> pm)
{
Gtk::TreeModel::iterator i = find_graph(_graph_treestore->children(), pm);
if (i != _graph_treestore->children().end())
@@ -132,12 +132,11 @@ GraphTreeWindow::remove_graph(SharedPtr<GraphModel> pm)
}
Gtk::TreeModel::iterator
-GraphTreeWindow::find_graph(
- Gtk::TreeModel::Children root,
- SharedPtr<Client::ObjectModel> graph)
+GraphTreeWindow::find_graph(Gtk::TreeModel::Children root,
+ SPtr<Client::ObjectModel> graph)
{
for (Gtk::TreeModel::iterator c = root.begin(); c != root.end(); ++c) {
- SharedPtr<GraphModel> pm = (*c)[_graph_tree_columns.graph_model_col];
+ SPtr<GraphModel> pm = (*c)[_graph_tree_columns.graph_model_col];
if (graph == pm) {
return c;
} else if ((*c)->children().size() > 0) {
@@ -157,7 +156,7 @@ GraphTreeWindow::show_graph_menu(GdkEventButton* ev)
Gtk::TreeModel::iterator active = _graph_tree_selection->get_selected();
if (active) {
Gtk::TreeModel::Row row = *active;
- SharedPtr<GraphModel> pm = row[_graph_tree_columns.graph_model_col];
+ SPtr<GraphModel> pm = row[_graph_tree_columns.graph_model_col];
if (pm) {
_app->log().warn("TODO: graph menu from tree window");
}
@@ -165,11 +164,12 @@ GraphTreeWindow::show_graph_menu(GdkEventButton* ev)
}
void
-GraphTreeWindow::event_graph_activated(const Gtk::TreeModel::Path& path, Gtk::TreeView::Column* col)
+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;
- SharedPtr<GraphModel> pm = row[_graph_tree_columns.graph_model_col];
+ SPtr<GraphModel> pm = row[_graph_tree_columns.graph_model_col];
_app->window_factory()->present_graph(pm);
}
@@ -181,7 +181,7 @@ GraphTreeWindow::event_graph_enabled_toggled(const Glib::ustring& path_str)
Gtk::TreeModel::iterator active = _graph_treestore->get_iter(path);
Gtk::TreeModel::Row row = *active;
- SharedPtr<GraphModel> pm = row[_graph_tree_columns.graph_model_col];
+ SPtr<GraphModel> pm = row[_graph_tree_columns.graph_model_col];
assert(pm);
if (_enable_signal)
@@ -192,9 +192,9 @@ GraphTreeWindow::event_graph_enabled_toggled(const Glib::ustring& path_str)
}
void
-GraphTreeWindow::graph_property_changed(const Raul::URI& key,
- const Raul::Atom& value,
- SharedPtr<GraphModel> graph)
+GraphTreeWindow::graph_property_changed(const Raul::URI& key,
+ const Raul::Atom& value,
+ SPtr<GraphModel> graph)
{
const URIs& uris = _app->uris();
_enable_signal = false;
@@ -212,7 +212,7 @@ GraphTreeWindow::graph_property_changed(const Raul::URI& key,
}
void
-GraphTreeWindow::graph_moved(SharedPtr<GraphModel> graph)
+GraphTreeWindow::graph_moved(SPtr<GraphModel> graph)
{
_enable_signal = false;
diff --git a/src/gui/GraphTreeWindow.hpp b/src/gui/GraphTreeWindow.hpp
index 3bd50b76..eec8b0d8 100644
--- a/src/gui/GraphTreeWindow.hpp
+++ b/src/gui/GraphTreeWindow.hpp
@@ -47,16 +47,16 @@ public:
void init(App& app, Client::ClientStore& store);
- void new_object(SharedPtr<Client::ObjectModel> object);
+ void new_object(SPtr<Client::ObjectModel> object);
- void graph_property_changed(const Raul::URI& key,
- const Raul::Atom& value,
- SharedPtr<Client::GraphModel> gm);
+ void graph_property_changed(const Raul::URI& key,
+ const Raul::Atom& value,
+ SPtr<Client::GraphModel> gm);
- void graph_moved(SharedPtr<Client::GraphModel> graph);
+ void graph_moved(SPtr<Client::GraphModel> graph);
- void add_graph(SharedPtr<Client::GraphModel> gm);
- void remove_graph(SharedPtr<Client::GraphModel> gm);
+ void add_graph(SPtr<Client::GraphModel> gm);
+ void remove_graph(SPtr<Client::GraphModel> gm);
void show_graph_menu(GdkEventButton* ev);
protected:
@@ -66,8 +66,8 @@ protected:
void event_graph_enabled_toggled(const Glib::ustring& path_str);
Gtk::TreeModel::iterator find_graph(
- Gtk::TreeModel::Children root,
- SharedPtr<Client::ObjectModel> graph);
+ Gtk::TreeModel::Children root,
+ SPtr<Client::ObjectModel> graph);
GraphTreeView* _graphs_treeview;
@@ -79,9 +79,9 @@ protected:
add(graph_model_col);
}
- Gtk::TreeModelColumn<Glib::ustring> name_col;
- Gtk::TreeModelColumn<bool> enabled_col;
- Gtk::TreeModelColumn<SharedPtr<Client::GraphModel> > graph_model_col;
+ Gtk::TreeModelColumn<Glib::ustring> name_col;
+ Gtk::TreeModelColumn<bool> enabled_col;
+ Gtk::TreeModelColumn<SPtr<Client::GraphModel> > graph_model_col;
};
App* _app;
diff --git a/src/gui/GraphView.cpp b/src/gui/GraphView.cpp
index c795861d..8452e9cf 100644
--- a/src/gui/GraphView.cpp
+++ b/src/gui/GraphView.cpp
@@ -67,14 +67,14 @@ GraphView::init(App& app)
}
void
-GraphView::set_graph(SharedPtr<const GraphModel> graph)
+GraphView::set_graph(SPtr<const GraphModel> graph)
{
assert(!_canvas); // FIXME: remove
assert(_breadcrumb_container); // ensure created
_graph = graph;
- _canvas = SharedPtr<GraphCanvas>(new GraphCanvas(*_app, graph, 1600*2, 1200*2));
+ _canvas = SPtr<GraphCanvas>(new GraphCanvas(*_app, graph, 1600*2, 1200*2));
_canvas->build();
_canvas_scrolledwindow->add(_canvas->widget());
@@ -116,15 +116,15 @@ GraphView::set_graph(SharedPtr<const GraphModel> graph)
_canvas->widget().grab_focus();
}
-SharedPtr<GraphView>
-GraphView::create(App& app, SharedPtr<const GraphModel> graph)
+SPtr<GraphView>
+GraphView::create(App& app, SPtr<const GraphModel> graph)
{
GraphView* result = NULL;
Glib::RefPtr<Gtk::Builder> xml = WidgetFactory::create("warehouse_win");
xml->get_widget_derived("graph_view_box", result);
result->init(app);
result->set_graph(graph);
- return SharedPtr<GraphView>(result);
+ return SPtr<GraphView>(result);
}
#if 0
diff --git a/src/gui/GraphView.hpp b/src/gui/GraphView.hpp
index cae073af..c060d02e 100644
--- a/src/gui/GraphView.hpp
+++ b/src/gui/GraphView.hpp
@@ -26,7 +26,7 @@
#include <gtkmm/toolitem.h>
#include <gtkmm/toolitem.h>
-#include "raul/SharedPtr.hpp"
+#include "ingen/types.hpp"
#include "raul/URI.hpp"
namespace Raul { class Atom; }
@@ -61,18 +61,18 @@ public:
void init(App& app);
- SharedPtr<GraphCanvas> canvas() const { return _canvas; }
- SharedPtr<const Client::GraphModel> graph() const { return _graph; }
- Gtk::ToolItem* breadcrumb_container() const { return _breadcrumb_container; }
+ SPtr<GraphCanvas> canvas() const { return _canvas; }
+ SPtr<const Client::GraphModel> graph() const { return _graph; }
+ Gtk::ToolItem* breadcrumb_container() const { return _breadcrumb_container; }
- static SharedPtr<GraphView> create(App& app,
- SharedPtr<const Client::GraphModel> graph);
+ static SPtr<GraphView> create(App& app,
+ SPtr<const Client::GraphModel> graph);
sigc::signal<void, const Client::ObjectModel*> signal_object_entered;
sigc::signal<void, const Client::ObjectModel*> signal_object_left;
private:
- void set_graph(SharedPtr<const Client::GraphModel> graph);
+ void set_graph(SPtr<const Client::GraphModel> graph);
void process_toggled();
void poly_changed();
@@ -90,8 +90,8 @@ private:
App* _app;
- SharedPtr<const Client::GraphModel> _graph;
- SharedPtr<GraphCanvas> _canvas;
+ SPtr<const Client::GraphModel> _graph;
+ SPtr<GraphCanvas> _canvas;
Gtk::ScrolledWindow* _canvas_scrolledwindow;
Gtk::Toolbar* _toolbar;
diff --git a/src/gui/GraphWindow.hpp b/src/gui/GraphWindow.hpp
index a45177ce..bbb25a27 100644
--- a/src/gui/GraphWindow.hpp
+++ b/src/gui/GraphWindow.hpp
@@ -21,7 +21,7 @@
#include <gtkmm/builder.h>
-#include "raul/SharedPtr.hpp"
+#include "ingen/types.hpp"
#include "GraphBox.hpp"
#include "Window.hpp"
@@ -48,8 +48,8 @@ public:
void init_window(App& app);
- SharedPtr<const Client::GraphModel> graph() const { return _box->graph(); }
- GraphBox* box() const { return _box; }
+ SPtr<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 c7e94a0e..1229dd25 100644
--- a/src/gui/LoadGraphWindow.cpp
+++ b/src/gui/LoadGraphWindow.cpp
@@ -95,9 +95,9 @@ LoadGraphWindow::LoadGraphWindow(BaseObjectType* cobject,
}
void
-LoadGraphWindow::present(SharedPtr<const GraphModel> graph,
- bool import,
- Node::Properties data)
+LoadGraphWindow::present(SPtr<const GraphModel> graph,
+ bool import,
+ Node::Properties data)
{
_import = import;
set_graph(graph);
@@ -115,7 +115,7 @@ LoadGraphWindow::present(SharedPtr<const GraphModel> graph,
* This function MUST be called before using the window in any way!
*/
void
-LoadGraphWindow::set_graph(SharedPtr<const GraphModel> graph)
+LoadGraphWindow::set_graph(SPtr<const GraphModel> graph)
{
_graph = graph;
_symbol_entry->set_text("");
diff --git a/src/gui/LoadGraphWindow.hpp b/src/gui/LoadGraphWindow.hpp
index 64ebe99b..a6fa84c8 100644
--- a/src/gui/LoadGraphWindow.hpp
+++ b/src/gui/LoadGraphWindow.hpp
@@ -25,9 +25,8 @@
#include <gtkmm/radiobutton.h>
#include <gtkmm/spinbutton.h>
-#include "raul/SharedPtr.hpp"
-
#include "ingen/Node.hpp"
+#include "ingen/types.hpp"
namespace Ingen {
@@ -49,11 +48,11 @@ public:
void init(App& app) { _app = &app; }
- void set_graph(SharedPtr<const Client::GraphModel> graph);
+ void set_graph(SPtr<const Client::GraphModel> graph);
- void present(SharedPtr<const Client::GraphModel> graph,
- bool import,
- Node::Properties data);
+ void present(SPtr<const Client::GraphModel> graph,
+ bool import,
+ Node::Properties data);
protected:
void on_show();
@@ -73,7 +72,7 @@ private:
Node::Properties _initial_data;
- SharedPtr<const Client::GraphModel> _graph;
+ SPtr<const Client::GraphModel> _graph;
Gtk::Label* _symbol_label;
Gtk::Entry* _symbol_entry;
diff --git a/src/gui/LoadPluginWindow.cpp b/src/gui/LoadPluginWindow.cpp
index 7e61d48d..7b1ac5c7 100644
--- a/src/gui/LoadPluginWindow.cpp
+++ b/src/gui/LoadPluginWindow.cpp
@@ -129,8 +129,8 @@ LoadPluginWindow::LoadPluginWindow(BaseObjectType* cobject,
}
void
-LoadPluginWindow::present(SharedPtr<const GraphModel> graph,
- Node::Properties data)
+LoadPluginWindow::present(SPtr<const GraphModel> graph,
+ Node::Properties data)
{
set_graph(graph);
_initial_data = data;
@@ -170,7 +170,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(SharedPtr<const GraphModel> graph)
+LoadPluginWindow::set_graph(SPtr<const GraphModel> graph)
{
if (_graph) {
_graph = graph;
@@ -205,7 +205,7 @@ LoadPluginWindow::on_show()
}
void
-LoadPluginWindow::set_plugins(SharedPtr<const ClientStore::Plugins> plugins)
+LoadPluginWindow::set_plugins(SPtr<const ClientStore::Plugins> plugins)
{
_rows.clear();
_plugins_liststore->clear();
@@ -219,7 +219,7 @@ LoadPluginWindow::set_plugins(SharedPtr<const ClientStore::Plugins> plugins)
}
void
-LoadPluginWindow::new_plugin(SharedPtr<const PluginModel> pm)
+LoadPluginWindow::new_plugin(SPtr<const PluginModel> pm)
{
if (is_visible())
add_plugin(pm);
@@ -228,7 +228,7 @@ LoadPluginWindow::new_plugin(SharedPtr<const PluginModel> pm)
}
static std::string
-get_project_name(SharedPtr<const PluginModel> plugin)
+get_project_name(SPtr<const PluginModel> plugin)
{
std::string name;
if (plugin->lilv_plugin()) {
@@ -254,7 +254,7 @@ get_project_name(SharedPtr<const PluginModel> plugin)
}
static std::string
-get_author_name(SharedPtr<const PluginModel> plugin)
+get_author_name(SPtr<const PluginModel> plugin)
{
std::string name;
if (plugin->lilv_plugin()) {
@@ -269,7 +269,7 @@ get_author_name(SharedPtr<const PluginModel> plugin)
void
LoadPluginWindow::set_row(Gtk::TreeModel::Row& row,
- SharedPtr<const PluginModel> plugin)
+ SPtr<const PluginModel> plugin)
{
const URIs& uris = _app->uris();
const Raul::Atom& name = plugin->get_property(uris.doap_name);
@@ -303,7 +303,7 @@ LoadPluginWindow::set_row(Gtk::TreeModel::Row& row,
}
void
-LoadPluginWindow::add_plugin(SharedPtr<const PluginModel> plugin)
+LoadPluginWindow::add_plugin(SPtr<const PluginModel> plugin)
{
if (plugin->lilv_plugin() && lilv_plugin_is_replaced(plugin->lilv_plugin())) {
return;
@@ -342,7 +342,7 @@ LoadPluginWindow::plugin_selection_changed()
*_selection->get_selected_rows().begin());
if (iter) {
Gtk::TreeModel::Row row = *iter;
- boost::shared_ptr<const PluginModel> p = row.get_value(
+ SPtr<const PluginModel> p = row.get_value(
_plugins_columns._col_plugin);
_name_offset = _app->store()->child_name_offset(
_graph->path(), p->default_block_symbol());
@@ -366,8 +366,8 @@ LoadPluginWindow::plugin_selection_changed()
* sends the notification back.
*/
string
-LoadPluginWindow::generate_module_name(SharedPtr<const PluginModel> plugin,
- int offset)
+LoadPluginWindow::generate_module_name(SPtr<const PluginModel> plugin,
+ int offset)
{
std::stringstream ss;
ss << plugin->default_block_symbol();
@@ -379,11 +379,11 @@ LoadPluginWindow::generate_module_name(SharedPtr<const PluginModel> plugin,
void
LoadPluginWindow::load_plugin(const Gtk::TreeModel::iterator& iter)
{
- const URIs& uris = _app->uris();
- Gtk::TreeModel::Row row = *iter;
- SharedPtr<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;
+ SPtr<const PluginModel> 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);
@@ -446,7 +446,7 @@ LoadPluginWindow::filter_changed()
const URIs& uris = _app->uris();
for (const auto& p : *_app->store()->plugins().get()) {
- const SharedPtr<PluginModel> plugin = p.second;
+ const SPtr<PluginModel> plugin = p.second;
const Raul::Atom& name = plugin->get_property(uris.doap_name);
switch (criteria) {
diff --git a/src/gui/LoadPluginWindow.hpp b/src/gui/LoadPluginWindow.hpp
index ed2e979c..5c8fad19 100644
--- a/src/gui/LoadPluginWindow.hpp
+++ b/src/gui/LoadPluginWindow.hpp
@@ -26,10 +26,9 @@
#include <gtkmm/treemodel.h>
#include <gtkmm/treeview.h>
-#include "raul/SharedPtr.hpp"
-
#include "ingen/Node.hpp"
#include "ingen/client/ClientStore.hpp"
+#include "ingen/types.hpp"
#include "ingen_config.h"
#include "Window.hpp"
@@ -55,13 +54,13 @@ public:
LoadPluginWindow(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& xml);
- void set_graph(SharedPtr<const Client::GraphModel> graph);
- void set_plugins(SharedPtr<const Client::ClientStore::Plugins> plugins);
+ void set_graph(SPtr<const Client::GraphModel> graph);
+ void set_plugins(SPtr<const Client::ClientStore::Plugins> plugins);
- void add_plugin(SharedPtr<const Client::PluginModel> plugin);
+ void add_plugin(SPtr<const Client::PluginModel> plugin);
- void present(SharedPtr<const Client::GraphModel> graph,
- Node::Properties data);
+ void present(SPtr<const Client::GraphModel> graph,
+ Node::Properties data);
protected:
void on_show();
@@ -87,7 +86,7 @@ private:
Gtk::TreeModelColumn<Glib::ustring> _col_uri;
// Not displayed:
- Gtk::TreeModelColumn< SharedPtr<const Client::PluginModel> > _col_plugin;
+ Gtk::TreeModelColumn< SPtr<const Client::PluginModel> > _col_plugin;
};
/** Column for the filter criteria combo box. */
@@ -112,8 +111,10 @@ private:
void name_cleared(Gtk::EntryIconPosition pos, const GdkEventButton* event);
#endif
- void set_row(Gtk::TreeModel::Row& row, SharedPtr<const Client::PluginModel> plugin);
- void new_plugin(SharedPtr<const Client::PluginModel> plugin);
+ void set_row(Gtk::TreeModel::Row& row,
+ SPtr<const Client::PluginModel> plugin);
+
+ void new_plugin(SPtr<const Client::PluginModel> plugin);
void plugin_property_changed(const Raul::URI& plugin,
const Raul::URI& predicate,
@@ -122,15 +123,14 @@ private:
void plugin_activated(const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* col);
void plugin_selection_changed();
- std::string generate_module_name(
- SharedPtr<const Client::PluginModel> plugin,
- int offset=0);
+ std::string generate_module_name(SPtr<const Client::PluginModel> plugin,
+ int offset=0);
void load_plugin(const Gtk::TreeModel::iterator& iter);
Node::Properties _initial_data;
- SharedPtr<const Client::GraphModel> _graph;
+ SPtr<const Client::GraphModel> _graph;
typedef std::map<Raul::URI, Gtk::TreeModel::iterator> Rows;
Rows _rows;
diff --git a/src/gui/NewSubgraphWindow.cpp b/src/gui/NewSubgraphWindow.cpp
index f2457843..b17cc100 100644
--- a/src/gui/NewSubgraphWindow.cpp
+++ b/src/gui/NewSubgraphWindow.cpp
@@ -49,8 +49,8 @@ NewSubgraphWindow::NewSubgraphWindow(BaseObjectType* cobject,
}
void
-NewSubgraphWindow::present(SharedPtr<const Client::GraphModel> graph,
- Node::Properties data)
+NewSubgraphWindow::present(SPtr<const Client::GraphModel> graph,
+ Node::Properties data)
{
set_graph(graph);
_initial_data = data;
@@ -62,7 +62,7 @@ NewSubgraphWindow::present(SharedPtr<const Client::GraphModel> graph,
* This function MUST be called before using the window in any way!
*/
void
-NewSubgraphWindow::set_graph(SharedPtr<const Client::GraphModel> graph)
+NewSubgraphWindow::set_graph(SPtr<const Client::GraphModel> graph)
{
_graph = graph;
}
diff --git a/src/gui/NewSubgraphWindow.hpp b/src/gui/NewSubgraphWindow.hpp
index 4fef4831..7f3c855b 100644
--- a/src/gui/NewSubgraphWindow.hpp
+++ b/src/gui/NewSubgraphWindow.hpp
@@ -23,9 +23,8 @@
#include <gtkmm/label.h>
#include <gtkmm/spinbutton.h>
-#include "raul/SharedPtr.hpp"
-
#include "ingen/Node.hpp"
+#include "ingen/types.hpp"
#include "Window.hpp"
@@ -47,18 +46,18 @@ public:
NewSubgraphWindow(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& xml);
- void set_graph(SharedPtr<const Client::GraphModel> graph);
+ void set_graph(SPtr<const Client::GraphModel> graph);
- void present(SharedPtr<const Client::GraphModel> graph,
- Node::Properties data);
+ void present(SPtr<const Client::GraphModel> graph,
+ Node::Properties data);
private:
void name_changed();
void ok_clicked();
void cancel_clicked();
- Node::Properties _initial_data;
- SharedPtr<const Client::GraphModel> _graph;
+ Node::Properties _initial_data;
+ SPtr<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 548aa68a..9fe43562 100644
--- a/src/gui/NodeMenu.cpp
+++ b/src/gui/NodeMenu.cpp
@@ -49,7 +49,7 @@ NodeMenu::NodeMenu(BaseObjectType* cobject,
}
void
-NodeMenu::init(App& app, SharedPtr<const Client::BlockModel> block)
+NodeMenu::init(App& app, SPtr<const Client::BlockModel> block)
{
ObjectMenu::init(app, block);
diff --git a/src/gui/NodeMenu.hpp b/src/gui/NodeMenu.hpp
index b307b9a4..969afecf 100644
--- a/src/gui/NodeMenu.hpp
+++ b/src/gui/NodeMenu.hpp
@@ -25,7 +25,7 @@
#include "ObjectMenu.hpp"
#include "ingen/client/BlockModel.hpp"
-#include "raul/SharedPtr.hpp"
+#include "ingen/types.hpp"
namespace Ingen {
namespace GUI {
@@ -40,7 +40,7 @@ public:
NodeMenu(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& xml);
- void init(App& app, SharedPtr<const Client::BlockModel> block);
+ void init(App& app, SPtr<const Client::BlockModel> block);
bool has_control_inputs();
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp
index 46588e6e..77ec41ca 100644
--- a/src/gui/NodeModule.cpp
+++ b/src/gui/NodeModule.cpp
@@ -51,8 +51,8 @@ using namespace Client;
namespace GUI {
-NodeModule::NodeModule(GraphCanvas& canvas,
- SharedPtr<const BlockModel> block)
+NodeModule::NodeModule(GraphCanvas& canvas,
+ SPtr<const BlockModel> block)
: Ganv::Module(canvas, block->path().symbol(), 0, 0, true)
, _block(block)
, _gui_widget(NULL)
@@ -103,11 +103,11 @@ NodeModule::show_menu(GdkEventButton* ev)
}
NodeModule*
-NodeModule::create(GraphCanvas& canvas,
- SharedPtr<const BlockModel> block,
- bool human)
+NodeModule::create(GraphCanvas& canvas,
+ SPtr<const BlockModel> block,
+ bool human)
{
- SharedPtr<const GraphModel> graph = PtrCast<const GraphModel>(block);
+ SPtr<const GraphModel> graph = dynamic_ptr_cast<const GraphModel>(block);
NodeModule* ret = (graph)
? new SubgraphModule(canvas, graph)
@@ -262,7 +262,7 @@ NodeModule::rename()
}
void
-NodeModule::new_port_view(SharedPtr<const PortModel> port)
+NodeModule::new_port_view(SPtr<const PortModel> port)
{
Port::create(app(), *this, port,
app().world()->conf().option("human-names").get_bool());
@@ -277,7 +277,7 @@ NodeModule::new_port_view(SharedPtr<const PortModel> port)
}
Port*
-NodeModule::port(boost::shared_ptr<const PortModel> model)
+NodeModule::port(SPtr<const PortModel> model)
{
for (iterator p = begin(); p != end(); ++p) {
Port* const port = dynamic_cast<Port*>(*p);
@@ -288,7 +288,7 @@ NodeModule::port(boost::shared_ptr<const PortModel> model)
}
void
-NodeModule::delete_port_view(SharedPtr<const PortModel> model)
+NodeModule::delete_port_view(SPtr<const PortModel> model)
{
Port* p = port(model);
if (p) {
diff --git a/src/gui/NodeModule.hpp b/src/gui/NodeModule.hpp
index 3dc7e93e..f1521c5f 100644
--- a/src/gui/NodeModule.hpp
+++ b/src/gui/NodeModule.hpp
@@ -18,7 +18,7 @@
#define INGEN_GUI_NODEMODULE_HPP
#include "ganv/Module.hpp"
-#include "raul/SharedPtr.hpp"
+#include "ingen/types.hpp"
#include "Port.hpp"
@@ -47,25 +47,25 @@ class NodeModule : public Ganv::Module
{
public:
static NodeModule* create(
- GraphCanvas& canvas,
- SharedPtr<const Client::BlockModel> block,
- bool human_names);
+ GraphCanvas& canvas,
+ SPtr<const Client::BlockModel> block,
+ bool human_names);
virtual ~NodeModule();
App& app() const;
- Port* port(boost::shared_ptr<const Client::PortModel> model);
+ Port* port(SPtr<const Client::PortModel> model);
- void delete_port_view(SharedPtr<const Client::PortModel> port);
+ void delete_port_view(SPtr<const Client::PortModel> port);
virtual void store_location(double x, double y);
void show_human_names(bool b);
- SharedPtr<const Client::BlockModel> block() const { return _block; }
+ SPtr<const Client::BlockModel> block() const { return _block; }
protected:
- NodeModule(GraphCanvas& canvas, SharedPtr<const Client::BlockModel> block);
+ NodeModule(GraphCanvas& canvas, SPtr<const Client::BlockModel> block);
virtual bool on_double_click(GdkEventButton* ev);
@@ -80,7 +80,7 @@ protected:
void rename();
void property_changed(const Raul::URI& predicate, const Raul::Atom& value);
- void new_port_view(SharedPtr<const Client::PortModel> port);
+ void new_port_view(SPtr<const Client::PortModel> port);
void value_changed(uint32_t index, const Raul::Atom& value);
void port_activity(uint32_t index, const Raul::Atom& value);
@@ -89,11 +89,11 @@ protected:
bool show_menu(GdkEventButton* ev);
- SharedPtr<const Client::BlockModel> _block;
- NodeMenu* _menu;
- SharedPtr<Client::PluginUI> _plugin_ui;
- Gtk::Widget* _gui_widget;
- Gtk::Window* _gui_window; ///< iff popped up
+ SPtr<const Client::BlockModel> _block;
+ NodeMenu* _menu;
+ SPtr<Client::PluginUI> _plugin_ui;
+ Gtk::Widget* _gui_widget;
+ Gtk::Window* _gui_window; ///< iff popped up
};
} // namespace GUI
diff --git a/src/gui/ObjectMenu.cpp b/src/gui/ObjectMenu.cpp
index 46437e2e..d963aa90 100644
--- a/src/gui/ObjectMenu.cpp
+++ b/src/gui/ObjectMenu.cpp
@@ -51,7 +51,7 @@ ObjectMenu::ObjectMenu(BaseObjectType* cobject,
}
void
-ObjectMenu::init(App& app, SharedPtr<const ObjectModel> object)
+ObjectMenu::init(App& app, SPtr<const ObjectModel> object)
{
_app = &app;
_object = object;
diff --git a/src/gui/ObjectMenu.hpp b/src/gui/ObjectMenu.hpp
index c4648443..63ca666d 100644
--- a/src/gui/ObjectMenu.hpp
+++ b/src/gui/ObjectMenu.hpp
@@ -22,9 +22,8 @@
#include <gtkmm/menu.h>
#include <gtkmm/menuitem.h>
-#include "raul/SharedPtr.hpp"
-
#include "ingen/client/ObjectModel.hpp"
+#include "ingen/types.hpp"
namespace Ingen {
namespace GUI {
@@ -43,7 +42,7 @@ public:
ObjectMenu(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& xml);
- void init(App& app, SharedPtr<const Client::ObjectModel> object);
+ void init(App& app, SPtr<const Client::ObjectModel> object);
protected:
void on_menu_learn();
@@ -55,15 +54,15 @@ protected:
void property_changed(const Raul::URI& predicate, const Raul::Atom& value);
- App* _app;
- SharedPtr<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;
+ 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;
bool _enable_signal;
};
diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp
index 0b85b286..b22339a0 100644
--- a/src/gui/Port.cpp
+++ b/src/gui/Port.cpp
@@ -40,11 +40,11 @@ namespace Ingen {
namespace GUI {
Port*
-Port::create(App& app,
- Ganv::Module& module,
- SharedPtr<const PortModel> pm,
- bool human_name,
- bool flip)
+Port::create(App& app,
+ Ganv::Module& module,
+ SPtr<const PortModel> pm,
+ bool human_name,
+ bool flip)
{
Glib::ustring label;
if (app.world()->conf().option("port-labels").get_bool()) {
@@ -53,7 +53,7 @@ Port::create(App& app,
if (name.type() == app.forge().String) {
label = name.get_string();
} else {
- const SharedPtr<const BlockModel> parent(PtrCast<const BlockModel>(pm->parent()));
+ const SPtr<const BlockModel> parent(dynamic_ptr_cast<const BlockModel>(pm->parent()));
if (parent && parent->plugin_model())
label = parent->plugin_model()->port_human_name(pm->index());
}
@@ -66,11 +66,11 @@ Port::create(App& app,
/** @a flip Make an input port appear as an output port, and vice versa.
*/
-Port::Port(App& app,
- Ganv::Module& module,
- SharedPtr<const PortModel> pm,
- const string& name,
- bool flip)
+Port::Port(App& app,
+ Ganv::Module& module,
+ SPtr<const PortModel> pm,
+ const string& name,
+ bool flip)
: Ganv::Port(module, name,
flip ? (!pm->is_input()) : pm->is_input(),
app.style()->get_port_color(pm.get()))
@@ -115,9 +115,9 @@ Port::~Port()
void
Port::update_metadata()
{
- SharedPtr<const PortModel> pm = _port_model.lock();
+ SPtr<const PortModel> pm = _port_model.lock();
if (_app.can_control(pm.get()) && pm->is_numeric()) {
- boost::shared_ptr<const BlockModel> parent = PtrCast<const BlockModel>(pm->parent());
+ SPtr<const BlockModel> parent = dynamic_ptr_cast<const BlockModel>(pm->parent());
if (parent) {
float min = 0.0f;
float max = 1.0f;
@@ -190,8 +190,8 @@ Port::on_scale_point_activated(float f)
Gtk::Menu*
Port::build_enum_menu()
{
- SharedPtr<const BlockModel> block = PtrCast<BlockModel>(model()->parent());
- Gtk::Menu* menu = Gtk::manage(new Gtk::Menu());
+ SPtr<const BlockModel> block = dynamic_ptr_cast<BlockModel>(model()->parent());
+ Gtk::Menu* menu = Gtk::manage(new Gtk::Menu());
PluginModel::ScalePoints points = block->plugin_model()->port_scale_points(
model()->index());
@@ -220,9 +220,9 @@ Port::on_uri_activated(const Raul::URI& uri)
Gtk::Menu*
Port::build_uri_menu()
{
- World* world = _app.world();
- SharedPtr<const BlockModel> block = PtrCast<BlockModel>(model()->parent());
- Gtk::Menu* menu = Gtk::manage(new Gtk::Menu());
+ World* world = _app.world();
+ SPtr<const BlockModel> block = dynamic_ptr_cast<BlockModel>(model()->parent());
+ Gtk::Menu* menu = Gtk::manage(new Gtk::Menu());
// Get the port designation, which should be a rdf:Property
const Raul::Atom& designation_atom = model()->get_property(
@@ -370,7 +370,7 @@ Port::activity(const Raul::Atom& value)
}
void
-Port::disconnected_from(SharedPtr<PortModel> port)
+Port::disconnected_from(SPtr<PortModel> port)
{
if (!model()->connected() && model()->is_a(_app.uris().lv2_AudioPort)) {
set_fill_color(peak_color(0.0f));
@@ -380,9 +380,9 @@ Port::disconnected_from(SharedPtr<PortModel> port)
GraphBox*
Port::get_graph_box() const
{
- SharedPtr<const GraphModel> graph = PtrCast<const GraphModel>(model()->parent());
+ SPtr<const GraphModel> graph = dynamic_ptr_cast<const GraphModel>(model()->parent());
if (!graph) {
- graph = PtrCast<const GraphModel>(model()->parent()->parent());
+ graph = dynamic_ptr_cast<const GraphModel>(model()->parent()->parent());
}
return _app.window_factory()->graph_box(graph);
@@ -424,9 +424,9 @@ Port::set_selected(gboolean b)
{
if (b != get_selected()) {
Ganv::Port::set_selected(b);
- SharedPtr<const PortModel> pm = _port_model.lock();
+ SPtr<const PortModel> pm = _port_model.lock();
if (pm && b) {
- SharedPtr<const BlockModel> block = PtrCast<BlockModel>(pm->parent());
+ SPtr<const BlockModel> block = dynamic_ptr_cast<BlockModel>(pm->parent());
GraphWindow* win = _app.window_factory()->parent_graph_window(block);
if (win && win->documentation_is_visible() && block->plugin_model()) {
const std::string& doc = block->plugin_model()->port_documentation(
diff --git a/src/gui/Port.hpp b/src/gui/Port.hpp
index 94f66ecd..a9d24c1f 100644
--- a/src/gui/Port.hpp
+++ b/src/gui/Port.hpp
@@ -23,8 +23,7 @@
#include <gtkmm/menu.h>
#include "ganv/Port.hpp"
-#include "raul/SharedPtr.hpp"
-#include "raul/WeakPtr.hpp"
+#include "ingen/types.hpp"
namespace Raul {
class Atom;
@@ -48,31 +47,31 @@ class Port : public Ganv::Port
{
public:
static Port* create(
- App& app,
- Ganv::Module& module,
- SharedPtr<const Client::PortModel> pm,
- bool human_name,
- bool flip = false);
+ App& app,
+ Ganv::Module& module,
+ SPtr<const Client::PortModel> pm,
+ bool human_name,
+ bool flip = false);
~Port();
- SharedPtr<const Client::PortModel> model() const { return _port_model.lock(); }
+ SPtr<const Client::PortModel> model() const { return _port_model.lock(); }
bool show_menu(GdkEventButton* ev);
void update_metadata();
void value_changed(const Raul::Atom& value);
void activity(const Raul::Atom& value);
- void disconnected_from(SharedPtr<Client::PortModel> port);
+ void disconnected_from(SPtr<Client::PortModel> port);
void set_selected(gboolean b);
private:
- Port(App& app,
- Ganv::Module& module,
- SharedPtr<const Client::PortModel> pm,
- const std::string& name,
- bool flip = false);
+ Port(App& app,
+ Ganv::Module& module,
+ SPtr<const Client::PortModel> pm,
+ const std::string& name,
+ bool flip = false);
Gtk::Menu* build_enum_menu();
Gtk::Menu* build_uri_menu();
@@ -86,11 +85,11 @@ private:
void on_uri_activated(const Raul::URI& uri);
bool on_event(GdkEvent* ev);
- App& _app;
- WeakPtr<const Client::PortModel> _port_model;
- bool _pressed : 1;
- bool _entered : 1;
- bool _flipped : 1;
+ App& _app;
+ WPtr<const Client::PortModel> _port_model;
+ bool _pressed : 1;
+ bool _entered : 1;
+ bool _flipped : 1;
};
} // namespace GUI
diff --git a/src/gui/PortMenu.cpp b/src/gui/PortMenu.cpp
index 18e16aa3..76dff135 100644
--- a/src/gui/PortMenu.cpp
+++ b/src/gui/PortMenu.cpp
@@ -19,7 +19,7 @@
#include "ingen/Interface.hpp"
#include "ingen/client/GraphModel.hpp"
#include "ingen/client/PortModel.hpp"
-#include "raul/SharedPtr.hpp"
+#include "ingen/types.hpp"
#include "App.hpp"
#include "PortMenu.hpp"
@@ -44,7 +44,7 @@ PortMenu::PortMenu(BaseObjectType* cobject,
}
void
-PortMenu::init(App& app, SharedPtr<const PortModel> port, bool is_graph_port)
+PortMenu::init(App& app, SPtr<const PortModel> port, bool is_graph_port)
{
const URIs& uris = app.uris();
@@ -63,8 +63,8 @@ PortMenu::init(App& app, SharedPtr<const PortModel> port, bool is_graph_port)
_expose_menuitem->signal_activate().connect(
sigc::mem_fun(this, &PortMenu::on_menu_expose));
- const bool is_control = app.can_control(port.get()) && port->is_numeric();
- const bool is_on_graph = PtrCast<GraphModel>(port->parent());
+ const bool is_control(app.can_control(port.get()) && port->is_numeric());
+ const bool is_on_graph(dynamic_ptr_cast<GraphModel>(port->parent()));
if (!_is_graph_port) {
_polyphonic_menuitem->set_sensitive(false);
@@ -101,9 +101,9 @@ PortMenu::on_menu_disconnect()
void
PortMenu::on_menu_set_min()
{
- const URIs& uris = _app->uris();
- SharedPtr<const PortModel> model = PtrCast<const PortModel>(_object);
- const Raul::Atom& value = model->get_property(uris.ingen_value);
+ const URIs& uris = _app->uris();
+ SPtr<const PortModel> model = dynamic_ptr_cast<const PortModel>(_object);
+ const Raul::Atom& value = model->get_property(uris.ingen_value);
if (value.is_valid())
_app->interface()->set_property(_object->uri(), uris.lv2_minimum, value);
}
@@ -111,9 +111,9 @@ PortMenu::on_menu_set_min()
void
PortMenu::on_menu_set_max()
{
- const URIs& uris = _app->uris();
- SharedPtr<const PortModel> model = PtrCast<const PortModel>(_object);
- const Raul::Atom& value = model->get_property(uris.ingen_value);
+ const URIs& uris = _app->uris();
+ SPtr<const PortModel> model = dynamic_ptr_cast<const PortModel>(_object);
+ const Raul::Atom& value = model->get_property(uris.ingen_value);
if (value.is_valid())
_app->interface()->set_property(_object->uri(), uris.lv2_maximum, value);
}
@@ -121,9 +121,9 @@ PortMenu::on_menu_set_max()
void
PortMenu::on_menu_reset_range()
{
- const URIs& uris = _app->uris();
- SharedPtr<const PortModel> model = PtrCast<const PortModel>(_object);
- SharedPtr<const BlockModel> parent = PtrCast<const BlockModel>(_object->parent());
+ const URIs& uris = _app->uris();
+ SPtr<const PortModel> model = dynamic_ptr_cast<const PortModel>(_object);
+ SPtr<const BlockModel> parent = dynamic_ptr_cast<const BlockModel>(_object->parent());
float min, max;
parent->default_port_value_range(model, min, max);
@@ -142,9 +142,9 @@ PortMenu::on_menu_reset_range()
void
PortMenu::on_menu_expose()
{
- const URIs& uris = _app->uris();
- SharedPtr<const PortModel> port = PtrCast<const PortModel>(_object);
- SharedPtr<const BlockModel> block = PtrCast<const BlockModel>(port->parent());
+ const URIs& uris = _app->uris();
+ SPtr<const PortModel> port = dynamic_ptr_cast<const PortModel>(_object);
+ SPtr<const BlockModel> block = dynamic_ptr_cast<const BlockModel>(port->parent());
const std::string label = block->label() + " " + block->port_label(port);
const Raul::Path path = Raul::Path(block->path() + Raul::Symbol("_" + port->symbol()));
diff --git a/src/gui/PortMenu.hpp b/src/gui/PortMenu.hpp
index 34f2c315..7e375098 100644
--- a/src/gui/PortMenu.hpp
+++ b/src/gui/PortMenu.hpp
@@ -22,7 +22,7 @@
#include <gtkmm/menushell.h>
#include "ingen/client/PortModel.hpp"
-#include "raul/SharedPtr.hpp"
+#include "ingen/types.hpp"
#include "ObjectMenu.hpp"
@@ -39,9 +39,9 @@ public:
PortMenu(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& xml);
- void init(App& app,
- SharedPtr<const Client::PortModel> port,
- bool is_graph_port = false);
+ void init(App& app,
+ SPtr<const Client::PortModel> port,
+ bool is_graph_port = false);
private:
void on_menu_disconnect();
diff --git a/src/gui/PortPropertiesWindow.cpp b/src/gui/PortPropertiesWindow.cpp
index a0162fba..defe8235 100644
--- a/src/gui/PortPropertiesWindow.cpp
+++ b/src/gui/PortPropertiesWindow.cpp
@@ -52,7 +52,7 @@ PortPropertiesWindow::PortPropertiesWindow(BaseObjectType* cob
* This function MUST be called before using this object in any way.
*/
void
-PortPropertiesWindow::present(SharedPtr<const PortModel> pm)
+PortPropertiesWindow::present(SPtr<const PortModel> pm)
{
assert(pm);
@@ -66,7 +66,7 @@ PortPropertiesWindow::present(SharedPtr<const PortModel> pm)
set_title(pm->path() + " Properties - Ingen");
float min = 0.0f, max = 1.0f;
- boost::shared_ptr<BlockModel> parent = PtrCast<BlockModel>(_port_model->parent());
+ SPtr<BlockModel> parent = dynamic_ptr_cast<BlockModel>(_port_model->parent());
if (parent)
parent->port_value_range(_port_model, min, max,
_app->sample_rate());
diff --git a/src/gui/PortPropertiesWindow.hpp b/src/gui/PortPropertiesWindow.hpp
index 309f3968..1cf86aa8 100644
--- a/src/gui/PortPropertiesWindow.hpp
+++ b/src/gui/PortPropertiesWindow.hpp
@@ -22,9 +22,8 @@
#include <gtkmm/builder.h>
#include <gtkmm/spinbutton.h>
-#include "raul/SharedPtr.hpp"
-
#include "ingen/client/PortModel.hpp"
+#include "ingen/types.hpp"
#include "Window.hpp"
@@ -43,7 +42,7 @@ public:
PortPropertiesWindow(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& xml);
- void present(SharedPtr<const Client::PortModel> port_model);
+ void present(SPtr<const Client::PortModel> port_model);
private:
void property_changed(const Raul::URI& key, const Raul::Atom& value);
@@ -56,12 +55,12 @@ private:
float _initial_min;
float _initial_max;
- SharedPtr<const Client::PortModel> _port_model;
- Gtk::SpinButton* _min_spinner;
- Gtk::SpinButton* _max_spinner;
- Gtk::Button* _cancel_button;
- Gtk::Button* _ok_button;
- std::list<sigc::connection> _connections;
+ SPtr<const Client::PortModel> _port_model;
+ Gtk::SpinButton* _min_spinner;
+ Gtk::SpinButton* _max_spinner;
+ Gtk::Button* _cancel_button;
+ Gtk::Button* _ok_button;
+ std::list<sigc::connection> _connections;
};
} // namespace GUI
diff --git a/src/gui/PropertiesWindow.cpp b/src/gui/PropertiesWindow.cpp
index 44d84d70..0f21a4fb 100644
--- a/src/gui/PropertiesWindow.cpp
+++ b/src/gui/PropertiesWindow.cpp
@@ -97,7 +97,7 @@ PropertiesWindow::reset()
}
void
-PropertiesWindow::present(SharedPtr<const ObjectModel> model)
+PropertiesWindow::present(SPtr<const ObjectModel> model)
{
set_object(model);
Gtk::Window::present();
@@ -140,7 +140,7 @@ PropertiesWindow::add_property(const Raul::URI& uri, const Raul::Atom& value)
* This function MUST be called before using this object in any way.
*/
void
-PropertiesWindow::set_object(SharedPtr<const ObjectModel> model)
+PropertiesWindow::set_object(SPtr<const ObjectModel> model)
{
reset();
_model = model;
diff --git a/src/gui/PropertiesWindow.hpp b/src/gui/PropertiesWindow.hpp
index 7ba5e5b6..ad4d3d90 100644
--- a/src/gui/PropertiesWindow.hpp
+++ b/src/gui/PropertiesWindow.hpp
@@ -28,9 +28,8 @@
#include <gtkmm/scrolledwindow.h>
#include <gtkmm/table.h>
-#include "raul/SharedPtr.hpp"
-
#include "ingen/client/BlockModel.hpp"
+#include "ingen/types.hpp"
#include "Window.hpp"
@@ -52,8 +51,8 @@ public:
PropertiesWindow(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& xml);
- void present(SharedPtr<const Client::ObjectModel> model);
- void set_object(SharedPtr<const Client::ObjectModel> model);
+ void present(SPtr<const Client::ObjectModel> model);
+ void set_object(SPtr<const Client::ObjectModel> model);
private:
/** Record of a property (row in the table) */
@@ -96,20 +95,20 @@ private:
typedef std::map<Raul::URI, Record> Records;
Records _records;
- SharedPtr<const Client::ObjectModel> _model;
- ComboColumns _combo_columns;
- Glib::RefPtr<Gtk::ListStore> _key_store;
- Glib::RefPtr<Gtk::ListStore> _value_store;
- sigc::connection _property_connection;
- Gtk::VBox* _vbox;
- Gtk::ScrolledWindow* _scrolledwindow;
- Gtk::Table* _table;
- Gtk::ComboBox* _key_combo;
- Gtk::ComboBox* _value_combo;
- Gtk::Button* _add_button;
- Gtk::Button* _cancel_button;
- Gtk::Button* _apply_button;
- Gtk::Button* _ok_button;
+ SPtr<const Client::ObjectModel> _model;
+ ComboColumns _combo_columns;
+ Glib::RefPtr<Gtk::ListStore> _key_store;
+ Glib::RefPtr<Gtk::ListStore> _value_store;
+ sigc::connection _property_connection;
+ Gtk::VBox* _vbox;
+ Gtk::ScrolledWindow* _scrolledwindow;
+ Gtk::Table* _table;
+ Gtk::ComboBox* _key_combo;
+ Gtk::ComboBox* _value_combo;
+ 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 bec69cee..667e51fe 100644
--- a/src/gui/RDFS.cpp
+++ b/src/gui/RDFS.cpp
@@ -78,7 +78,7 @@ classes(World* world, URISet& types, bool super)
}
URISet
-types(World* world, SharedPtr<const Client::ObjectModel> model)
+types(World* world, SPtr<const Client::ObjectModel> model)
{
typedef Resource::Properties::const_iterator PropIter;
typedef std::pair<PropIter, PropIter> PropRange;
@@ -101,7 +101,7 @@ types(World* world, SharedPtr<const Client::ObjectModel> model)
}
URISet
-properties(World* world, SharedPtr<const Client::ObjectModel> model)
+properties(World* world, SPtr<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 bdc0a7a1..583f5d90 100644
--- a/src/gui/RDFS.hpp
+++ b/src/gui/RDFS.hpp
@@ -22,8 +22,8 @@
#include <glibmm/ustring.h>
+#include "ingen/types.hpp"
#include "raul/URI.hpp"
-#include "raul/SharedPtr.hpp"
namespace Ingen {
@@ -55,10 +55,10 @@ Objects
instances(World* world, const URISet& types);
/** Get all the types which @p model is an instance of. */
-URISet types(World* world, SharedPtr<const Client::ObjectModel> model);
+URISet types(World* world, SPtr<const Client::ObjectModel> model);
/** Get all the properties with domains appropriate for @p model. */
-URISet properties(World* world, SharedPtr<const Client::ObjectModel> model);
+URISet properties(World* world, SPtr<const Client::ObjectModel> model);
} // namespace RDFS
} // namespace GUI
diff --git a/src/gui/RenameWindow.cpp b/src/gui/RenameWindow.cpp
index da9fb2c6..c6815fd7 100644
--- a/src/gui/RenameWindow.cpp
+++ b/src/gui/RenameWindow.cpp
@@ -59,7 +59,7 @@ RenameWindow::RenameWindow(BaseObjectType* cobject,
* This function MUST be called before using this object in any way.
*/
void
-RenameWindow::set_object(SharedPtr<const ObjectModel> object)
+RenameWindow::set_object(SPtr<const ObjectModel> object)
{
_object = object;
_symbol_entry->set_text(object->path().symbol());
@@ -69,7 +69,7 @@ RenameWindow::set_object(SharedPtr<const ObjectModel> object)
}
void
-RenameWindow::present(SharedPtr<const ObjectModel> object)
+RenameWindow::present(SPtr<const ObjectModel> object)
{
set_object(object);
_symbol_entry->grab_focus();
diff --git a/src/gui/RenameWindow.hpp b/src/gui/RenameWindow.hpp
index 03d5e318..718f2863 100644
--- a/src/gui/RenameWindow.hpp
+++ b/src/gui/RenameWindow.hpp
@@ -22,9 +22,8 @@
#include <gtkmm/entry.h>
#include <gtkmm/label.h>
-#include "raul/SharedPtr.hpp"
-
#include "ingen/client/ObjectModel.hpp"
+#include "ingen/types.hpp"
#include "Window.hpp"
@@ -41,16 +40,16 @@ public:
RenameWindow(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& xml);
- void present(SharedPtr<const Client::ObjectModel> object);
+ void present(SPtr<const Client::ObjectModel> object);
private:
- void set_object(SharedPtr<const Client::ObjectModel> object);
+ void set_object(SPtr<const Client::ObjectModel> object);
void values_changed();
void cancel_clicked();
void ok_clicked();
- SharedPtr<const Client::ObjectModel> _object;
+ SPtr<const Client::ObjectModel> _object;
Gtk::Entry* _symbol_entry;
Gtk::Entry* _label_entry;
diff --git a/src/gui/Style.hpp b/src/gui/Style.hpp
index eb6947f8..e871e3fa 100644
--- a/src/gui/Style.hpp
+++ b/src/gui/Style.hpp
@@ -21,8 +21,6 @@
#include <string>
-#include "raul/SharedPtr.hpp"
-
namespace Ingen { namespace Client { class PortModel; } }
namespace Ingen {
diff --git a/src/gui/SubgraphModule.cpp b/src/gui/SubgraphModule.cpp
index 88dbc81b..f4e9dc23 100644
--- a/src/gui/SubgraphModule.cpp
+++ b/src/gui/SubgraphModule.cpp
@@ -36,8 +36,8 @@ using namespace Client;
namespace GUI {
-SubgraphModule::SubgraphModule(GraphCanvas& canvas,
- SharedPtr<const GraphModel> graph)
+SubgraphModule::SubgraphModule(GraphCanvas& canvas,
+ SPtr<const GraphModel> graph)
: NodeModule(canvas, graph)
, _graph(graph)
{
@@ -49,7 +49,7 @@ SubgraphModule::on_double_click(GdkEventButton* event)
{
assert(_graph);
- SharedPtr<GraphModel> parent = PtrCast<GraphModel>(_graph->parent());
+ SPtr<GraphModel> parent = dynamic_ptr_cast<GraphModel>(_graph->parent());
GraphWindow* const preferred = ( (parent && (event->state & GDK_SHIFT_MASK))
? NULL
@@ -92,7 +92,7 @@ SubgraphModule::browse_to_graph()
{
assert(_graph->parent());
- SharedPtr<GraphModel> parent = PtrCast<GraphModel>(_graph->parent());
+ SPtr<GraphModel> parent = dynamic_ptr_cast<GraphModel>(_graph->parent());
GraphWindow* const preferred = (parent)
? app().window_factory()->graph_window(parent)
diff --git a/src/gui/SubgraphModule.hpp b/src/gui/SubgraphModule.hpp
index 569e0fd8..a439c324 100644
--- a/src/gui/SubgraphModule.hpp
+++ b/src/gui/SubgraphModule.hpp
@@ -17,7 +17,7 @@
#ifndef INGEN_GUI_SUBGRAPHMODULE_HPP
#define INGEN_GUI_SUBGRAPHMODULE_HPP
-#include "raul/SharedPtr.hpp"
+#include "ingen/types.hpp"
#include "NodeModule.hpp"
#include "GraphPortModule.hpp"
@@ -41,7 +41,7 @@ class SubgraphModule : public NodeModule
{
public:
SubgraphModule(GraphCanvas& canvas,
- SharedPtr<const Client::GraphModel> controller);
+ SPtr<const Client::GraphModel> controller);
virtual ~SubgraphModule() {}
@@ -52,10 +52,10 @@ public:
void browse_to_graph();
void menu_remove();
- SharedPtr<const Client::GraphModel> graph() const { return _graph; }
+ SPtr<const Client::GraphModel> graph() const { return _graph; }
protected:
- SharedPtr<const Client::GraphModel> _graph;
+ SPtr<const Client::GraphModel> _graph;
};
} // namespace GUI
diff --git a/src/gui/ThreadedLoader.cpp b/src/gui/ThreadedLoader.cpp
index 9575734b..597a728d 100644
--- a/src/gui/ThreadedLoader.cpp
+++ b/src/gui/ThreadedLoader.cpp
@@ -30,7 +30,7 @@ using namespace std;
namespace Ingen {
namespace GUI {
-ThreadedLoader::ThreadedLoader(App& app, SharedPtr<Interface> engine)
+ThreadedLoader::ThreadedLoader(App& app, SPtr<Interface> engine)
: Raul::Thread()
, _app(app)
, _sem(0)
@@ -49,7 +49,7 @@ ThreadedLoader::~ThreadedLoader()
_sem.post();
}
-SharedPtr<Serialisation::Parser>
+SPtr<Serialisation::Parser>
ThreadedLoader::parser()
{
Ingen::World* world = _app.world();
@@ -108,8 +108,8 @@ ThreadedLoader::load_graph(bool merge,
}
void
-ThreadedLoader::save_graph(SharedPtr<const Client::GraphModel> model,
- const string& filename)
+ThreadedLoader::save_graph(SPtr<const Client::GraphModel> model,
+ const string& filename)
{
_mutex.lock();
@@ -122,8 +122,8 @@ ThreadedLoader::save_graph(SharedPtr<const Client::GraphModel> model,
}
void
-ThreadedLoader::save_graph_event(SharedPtr<const Client::GraphModel> model,
- const string& filename)
+ThreadedLoader::save_graph_event(SPtr<const Client::GraphModel> model,
+ const string& filename)
{
if (_app.serialiser()) {
if (filename.find(".ingen") != string::npos)
diff --git a/src/gui/ThreadedLoader.hpp b/src/gui/ThreadedLoader.hpp
index afca29a9..815cfeec 100644
--- a/src/gui/ThreadedLoader.hpp
+++ b/src/gui/ThreadedLoader.hpp
@@ -47,8 +47,8 @@ namespace GUI {
class ThreadedLoader : public Raul::Thread
{
public:
- ThreadedLoader(App& app,
- SharedPtr<Interface> engine);
+ ThreadedLoader(App& app,
+ SPtr<Interface> engine);
~ThreadedLoader();
@@ -58,25 +58,25 @@ public:
boost::optional<Raul::Symbol> engine_symbol,
boost::optional<Node::Properties> engine_data);
- void save_graph(SharedPtr<const Client::GraphModel> model,
- const std::string& filename);
+ void save_graph(SPtr<const Client::GraphModel> model,
+ const std::string& filename);
- SharedPtr<Serialisation::Parser> parser();
+ SPtr<Serialisation::Parser> parser();
private:
- void save_graph_event(SharedPtr<const Client::GraphModel> model,
- const std::string& filename);
+ void save_graph_event(SPtr<const Client::GraphModel> model,
+ const std::string& filename);
/** Returns nothing and takes no parameters (because they have all been bound) */
typedef sigc::slot<void> Closure;
void _run();
- App& _app;
- Raul::Semaphore _sem;
- SharedPtr<Interface> _engine;
- Glib::Mutex _mutex;
- std::list<Closure> _events;
+ App& _app;
+ Raul::Semaphore _sem;
+ SPtr<Interface> _engine;
+ Glib::Mutex _mutex;
+ std::list<Closure> _events;
};
} // namespace GUI
diff --git a/src/gui/WindowFactory.cpp b/src/gui/WindowFactory.cpp
index 983e246b..f8738f40 100644
--- a/src/gui/WindowFactory.cpp
+++ b/src/gui/WindowFactory.cpp
@@ -87,7 +87,7 @@ WindowFactory::num_open_graph_windows()
}
GraphBox*
-WindowFactory::graph_box(SharedPtr<const GraphModel> graph)
+WindowFactory::graph_box(SPtr<const GraphModel> graph)
{
GraphWindow* window = graph_window(graph);
if (window) {
@@ -98,7 +98,7 @@ WindowFactory::graph_box(SharedPtr<const GraphModel> graph)
}
GraphWindow*
-WindowFactory::graph_window(SharedPtr<const GraphModel> graph)
+WindowFactory::graph_window(SPtr<const GraphModel> graph)
{
if (!graph)
return NULL;
@@ -109,12 +109,12 @@ WindowFactory::graph_window(SharedPtr<const GraphModel> graph)
}
GraphWindow*
-WindowFactory::parent_graph_window(SharedPtr<const BlockModel> block)
+WindowFactory::parent_graph_window(SPtr<const BlockModel> block)
{
if (!block)
return NULL;
- return graph_window(PtrCast<GraphModel>(block->parent()));
+ return graph_window(dynamic_ptr_cast<GraphModel>(block->parent()));
}
/** Present a GraphWindow for a Graph.
@@ -124,9 +124,9 @@ WindowFactory::parent_graph_window(SharedPtr<const BlockModel> block)
* presented and @a preferred left unmodified.
*/
void
-WindowFactory::present_graph(SharedPtr<const GraphModel> graph,
- GraphWindow* preferred,
- SharedPtr<GraphView> view)
+WindowFactory::present_graph(SPtr<const GraphModel> graph,
+ GraphWindow* preferred,
+ SPtr<GraphView> view)
{
assert(!view || view->graph() == graph);
@@ -150,8 +150,8 @@ WindowFactory::present_graph(SharedPtr<const GraphModel> graph,
}
GraphWindow*
-WindowFactory::new_graph_window(SharedPtr<const GraphModel> graph,
- SharedPtr<GraphView> view)
+WindowFactory::new_graph_window(SPtr<const GraphModel> graph,
+ SPtr<GraphView> view)
{
assert(!view || view->graph() == graph);
@@ -185,8 +185,8 @@ WindowFactory::remove_graph_window(GraphWindow* win, GdkEventAny* ignored)
}
void
-WindowFactory::present_load_plugin(SharedPtr<const GraphModel> graph,
- Node::Properties data)
+WindowFactory::present_load_plugin(SPtr<const GraphModel> graph,
+ Node::Properties data)
{
_app.request_plugins_if_necessary();
@@ -208,8 +208,8 @@ WindowFactory::present_load_plugin(SharedPtr<const GraphModel> graph,
}
void
-WindowFactory::present_load_graph(SharedPtr<const GraphModel> graph,
- Node::Properties data)
+WindowFactory::present_load_graph(SPtr<const GraphModel> graph,
+ Node::Properties data)
{
GraphWindowMap::iterator w = _graph_windows.find(graph->path());
@@ -220,8 +220,8 @@ WindowFactory::present_load_graph(SharedPtr<const GraphModel> graph,
}
void
-WindowFactory::present_load_subgraph(SharedPtr<const GraphModel> graph,
- Node::Properties data)
+WindowFactory::present_load_subgraph(SPtr<const GraphModel> graph,
+ Node::Properties data)
{
GraphWindowMap::iterator w = _graph_windows.find(graph->path());
@@ -232,8 +232,8 @@ WindowFactory::present_load_subgraph(SharedPtr<const GraphModel> graph,
}
void
-WindowFactory::present_new_subgraph(SharedPtr<const GraphModel> graph,
- Node::Properties data)
+WindowFactory::present_new_subgraph(SPtr<const GraphModel> graph,
+ Node::Properties data)
{
GraphWindowMap::iterator w = _graph_windows.find(graph->path());
@@ -244,7 +244,7 @@ WindowFactory::present_new_subgraph(SharedPtr<const GraphModel> graph,
}
void
-WindowFactory::present_rename(SharedPtr<const ObjectModel> object)
+WindowFactory::present_rename(SPtr<const ObjectModel> object)
{
GraphWindowMap::iterator w = _graph_windows.find(object->path());
if (w == _graph_windows.end())
@@ -257,7 +257,7 @@ WindowFactory::present_rename(SharedPtr<const ObjectModel> object)
}
void
-WindowFactory::present_properties(SharedPtr<const ObjectModel> object)
+WindowFactory::present_properties(SPtr<const ObjectModel> object)
{
GraphWindowMap::iterator w = _graph_windows.find(object->path());
if (w == _graph_windows.end())
diff --git a/src/gui/WindowFactory.hpp b/src/gui/WindowFactory.hpp
index bdeac89d..f68d5847 100644
--- a/src/gui/WindowFactory.hpp
+++ b/src/gui/WindowFactory.hpp
@@ -20,7 +20,7 @@
#include <map>
#include "ingen/Node.hpp"
-#include "raul/SharedPtr.hpp"
+#include "ingen/types.hpp"
namespace Ingen {
@@ -55,23 +55,23 @@ public:
size_t num_open_graph_windows();
- GraphBox* graph_box(SharedPtr<const Client::GraphModel> graph);
- GraphWindow* graph_window(SharedPtr<const Client::GraphModel> graph);
- GraphWindow* parent_graph_window(SharedPtr<const Client::BlockModel> block);
+ 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);
void present_graph(
- SharedPtr<const Client::GraphModel> model,
- GraphWindow* preferred = NULL,
- SharedPtr<GraphView> view = SharedPtr<GraphView>());
+ SPtr<const Client::GraphModel> model,
+ GraphWindow* preferred = NULL,
+ SPtr<GraphView> view = SPtr<GraphView>());
typedef Node::Properties Properties;
- void present_load_plugin(SharedPtr<const Client::GraphModel> graph, Properties data=Properties());
- void present_load_graph(SharedPtr<const Client::GraphModel> graph, Properties data=Properties());
- void present_load_subgraph(SharedPtr<const Client::GraphModel> graph, Properties data=Properties());
- void present_new_subgraph(SharedPtr<const Client::GraphModel> graph, Properties data=Properties());
- void present_rename(SharedPtr<const Client::ObjectModel> object);
- void present_properties(SharedPtr<const Client::ObjectModel> object);
+ 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);
bool remove_graph_window(GraphWindow* win, GdkEventAny* ignored = NULL);
@@ -82,8 +82,8 @@ public:
private:
typedef std::map<Raul::Path, GraphWindow*> GraphWindowMap;
- GraphWindow* new_graph_window(SharedPtr<const Client::GraphModel> graph,
- SharedPtr<GraphView> view);
+ GraphWindow* new_graph_window(SPtr<const Client::GraphModel> graph,
+ SPtr<GraphView> view);
App& _app;
GraphBox* _main_box;
diff --git a/src/gui/ingen_gui.cpp b/src/gui/ingen_gui.cpp
index d5c15ca9..999b2431 100644
--- a/src/gui/ingen_gui.cpp
+++ b/src/gui/ingen_gui.cpp
@@ -25,7 +25,7 @@ struct IngenGUIModule : public Ingen::Module {
app->run();
}
- SharedPtr<Ingen::GUI::App> app;
+ Ingen::SPtr<Ingen::GUI::App> app;
};
extern "C" {
diff --git a/src/gui/ingen_gui_lv2.cpp b/src/gui/ingen_gui_lv2.cpp
index b8a4443b..d95ea82f 100644
--- a/src/gui/ingen_gui_lv2.cpp
+++ b/src/gui/ingen_gui_lv2.cpp
@@ -22,6 +22,7 @@
#include "ingen/client/GraphModel.hpp"
#include "ingen/client/SigClientInterface.hpp"
#include "ingen/runtime_paths.hpp"
+#include "ingen/types.hpp"
#include "lv2/lv2plug.in/ns/extensions/ui/ui.h"
#include "App.hpp"
@@ -62,16 +63,16 @@ struct IngenLV2UI {
, sink(NULL)
{}
- int argc;
- char** argv;
- Ingen::Forge* forge;
- Ingen::World* world;
- IngenLV2AtomSink* sink;
- SharedPtr<Ingen::GUI::App> app;
- SharedPtr<Ingen::GUI::GraphBox> view;
- SharedPtr<Ingen::Interface> engine;
- SharedPtr<Ingen::AtomReader> reader;
- SharedPtr<Ingen::Client::SigClientInterface> client;
+ int argc;
+ char** argv;
+ Ingen::Forge* forge;
+ Ingen::World* world;
+ IngenLV2AtomSink* sink;
+ Ingen::SPtr<Ingen::GUI::App> app;
+ Ingen::SPtr<Ingen::GUI::GraphBox> view;
+ Ingen::SPtr<Ingen::Interface> engine;
+ Ingen::SPtr<Ingen::AtomReader> reader;
+ Ingen::SPtr<Ingen::Client::SigClientInterface> client;
};
static LV2UI_Handle
@@ -113,7 +114,7 @@ instantiate(const LV2UI_Descriptor* descriptor,
ui->world->uris(), write_function, controller);
// Set up an engine interface that writes LV2 atoms
- ui->engine = SharedPtr<Ingen::Interface>(
+ ui->engine = Ingen::SPtr<Ingen::Interface>(
new Ingen::AtomWriter(
ui->world->uri_map(), ui->world->uris(), *ui->sink));
@@ -121,11 +122,11 @@ instantiate(const LV2UI_Descriptor* descriptor,
// Create App and client
ui->app = Ingen::GUI::App::create(ui->world);
- ui->client = SharedPtr<Ingen::Client::SigClientInterface>(
+ ui->client = Ingen::SPtr<Ingen::Client::SigClientInterface>(
new Ingen::Client::SigClientInterface());
ui->app->attach(ui->client);
- ui->reader = SharedPtr<Ingen::AtomReader>(
+ ui->reader = Ingen::SPtr<Ingen::AtomReader>(
new Ingen::AtomReader(ui->world->uri_map(),
ui->world->uris(),
ui->world->log(),
@@ -140,8 +141,9 @@ instantiate(const LV2UI_Descriptor* descriptor,
ui->app->store()->put(Ingen::Node::root_uri(), props);
// Create a GraphBox for the root and set as the UI widget
- SharedPtr<const Ingen::Client::GraphModel> root = PtrCast<const Ingen::Client::GraphModel>(
- ui->app->store()->object(Raul::Path("/")));
+ Ingen::SPtr<const Ingen::Client::GraphModel> root =
+ Ingen::dynamic_ptr_cast<const Ingen::Client::GraphModel>(
+ ui->app->store()->object(Raul::Path("/")));
ui->view = Ingen::GUI::GraphBox::create(*ui->app, root);
ui->view->unparent();
*widget = ui->view->gobj();