summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.clang-tidy1
-rw-r--r--src/gui/NewSubgraphWindow.cpp7
-rw-r--r--src/gui/NewSubgraphWindow.hpp4
-rw-r--r--src/gui/NodeMenu.cpp2
-rw-r--r--src/gui/NodeMenu.hpp2
-rw-r--r--src/gui/NodeModule.cpp16
-rw-r--r--src/gui/NodeModule.hpp18
-rw-r--r--src/gui/ObjectMenu.cpp3
-rw-r--r--src/gui/ObjectMenu.hpp3
-rw-r--r--src/gui/PluginMenu.cpp8
-rw-r--r--src/gui/PluginMenu.hpp8
-rw-r--r--src/gui/Port.cpp20
-rw-r--r--src/gui/Port.hpp20
-rw-r--r--src/gui/PortMenu.cpp6
-rw-r--r--src/gui/PortMenu.hpp4
-rw-r--r--src/gui/PropertiesWindow.cpp4
-rw-r--r--src/gui/PropertiesWindow.hpp4
-rw-r--r--src/gui/RDFS.cpp5
-rw-r--r--src/gui/RDFS.hpp5
-rw-r--r--src/gui/RenameWindow.cpp4
-rw-r--r--src/gui/RenameWindow.hpp4
-rw-r--r--src/gui/Style.cpp4
-rw-r--r--src/gui/Style.hpp4
-rw-r--r--src/gui/SubgraphModule.cpp4
-rw-r--r--src/gui/SubgraphModule.hpp4
-rw-r--r--src/gui/ThreadedLoader.cpp27
-rw-r--r--src/gui/ThreadedLoader.hpp27
-rw-r--r--src/gui/WindowFactory.cpp42
-rw-r--r--src/gui/WindowFactory.hpp44
29 files changed, 163 insertions, 141 deletions
diff --git a/.clang-tidy b/.clang-tidy
index 8f602116..2534cb2b 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -61,7 +61,6 @@ Checks: >
-misc-no-recursion,
-misc-unused-parameters,
-modernize-use-trailing-return-type,
- -performance-unnecessary-value-param,
-portability-simd-intrinsics,
-readability-convert-member-functions-to-static,
-readability-implicit-bool-conversion,
diff --git a/src/gui/NewSubgraphWindow.cpp b/src/gui/NewSubgraphWindow.cpp
index cd803e6d..cf98519a 100644
--- a/src/gui/NewSubgraphWindow.cpp
+++ b/src/gui/NewSubgraphWindow.cpp
@@ -25,6 +25,7 @@
#include <cstdint>
#include <string>
+#include <utility>
namespace ingen {
namespace gui {
@@ -50,9 +51,9 @@ NewSubgraphWindow::NewSubgraphWindow(BaseObjectType* cobject,
void
NewSubgraphWindow::present(std::shared_ptr<const client::GraphModel> graph,
- Properties data)
+ const Properties& data)
{
- set_graph(graph);
+ set_graph(std::move(graph));
_initial_data = data;
Gtk::Window::present();
}
@@ -64,7 +65,7 @@ NewSubgraphWindow::present(std::shared_ptr<const client::GraphModel> graph,
void
NewSubgraphWindow::set_graph(std::shared_ptr<const client::GraphModel> graph)
{
- _graph = graph;
+ _graph = std::move(graph);
}
/** Called every time the user types into the name input box.
diff --git a/src/gui/NewSubgraphWindow.hpp b/src/gui/NewSubgraphWindow.hpp
index 16cf2a21..ff078029 100644
--- a/src/gui/NewSubgraphWindow.hpp
+++ b/src/gui/NewSubgraphWindow.hpp
@@ -49,8 +49,8 @@ public:
void set_graph(std::shared_ptr<const client::GraphModel> graph);
- void
- present(std::shared_ptr<const client::GraphModel> graph, Properties data);
+ void present(std::shared_ptr<const client::GraphModel> graph,
+ const Properties& data);
private:
void name_changed();
diff --git a/src/gui/NodeMenu.cpp b/src/gui/NodeMenu.cpp
index 944a3810..dcf7c9ef 100644
--- a/src/gui/NodeMenu.cpp
+++ b/src/gui/NodeMenu.cpp
@@ -54,7 +54,7 @@ NodeMenu::NodeMenu(BaseObjectType* cobject,
}
void
-NodeMenu::init(App& app, std::shared_ptr<const client::BlockModel> block)
+NodeMenu::init(App& app, const std::shared_ptr<const client::BlockModel>& block)
{
ObjectMenu::init(app, block);
diff --git a/src/gui/NodeMenu.hpp b/src/gui/NodeMenu.hpp
index b35919eb..381dbf14 100644
--- a/src/gui/NodeMenu.hpp
+++ b/src/gui/NodeMenu.hpp
@@ -41,7 +41,7 @@ public:
NodeMenu(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& xml);
- void init(App& app, std::shared_ptr<const client::BlockModel> block);
+ void init(App& app, const std::shared_ptr<const client::BlockModel>& block);
bool has_control_inputs();
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp
index e09a3479..daa8df41 100644
--- a/src/gui/NodeModule.cpp
+++ b/src/gui/NodeModule.cpp
@@ -53,8 +53,8 @@ using client::PortModel;
namespace gui {
-NodeModule::NodeModule(GraphCanvas& canvas,
- std::shared_ptr<const BlockModel> block)
+NodeModule::NodeModule(GraphCanvas& canvas,
+ const std::shared_ptr<const BlockModel>& block)
: Ganv::Module(canvas, block->path().symbol(), 0, 0, true)
, _block(block)
, _gui_widget(nullptr)
@@ -137,9 +137,9 @@ NodeModule::show_menu(GdkEventButton* ev)
}
NodeModule*
-NodeModule::create(GraphCanvas& canvas,
- std::shared_ptr<const BlockModel> block,
- bool human)
+NodeModule::create(GraphCanvas& canvas,
+ const std::shared_ptr<const BlockModel>& block,
+ bool human)
{
auto graph = std::dynamic_pointer_cast<const GraphModel>(block);
@@ -308,7 +308,7 @@ NodeModule::rename()
}
void
-NodeModule::new_port_view(std::shared_ptr<const PortModel> port)
+NodeModule::new_port_view(const std::shared_ptr<const PortModel>& port)
{
Port::create(app(), *this, port);
@@ -322,7 +322,7 @@ NodeModule::new_port_view(std::shared_ptr<const PortModel> port)
}
Port*
-NodeModule::port(std::shared_ptr<const PortModel> model)
+NodeModule::port(const std::shared_ptr<const PortModel>& model)
{
for (auto* p : *this) {
auto* const port = dynamic_cast<Port*>(p);
@@ -334,7 +334,7 @@ NodeModule::port(std::shared_ptr<const PortModel> model)
}
void
-NodeModule::delete_port_view(std::shared_ptr<const PortModel> model)
+NodeModule::delete_port_view(const std::shared_ptr<const PortModel>& model)
{
Port* const p = port(model);
diff --git a/src/gui/NodeModule.hpp b/src/gui/NodeModule.hpp
index 55a255a8..b4378fac 100644
--- a/src/gui/NodeModule.hpp
+++ b/src/gui/NodeModule.hpp
@@ -47,17 +47,19 @@ class NodeMenu;
class NodeModule : public Ganv::Module
{
public:
- static NodeModule* create(GraphCanvas& canvas,
- std::shared_ptr<const client::BlockModel> block,
- bool human);
+ static NodeModule*
+ create(GraphCanvas& canvas,
+ const std::shared_ptr<const client::BlockModel>& block,
+ bool human);
~NodeModule() override;
App& app() const;
- Port* port(std::shared_ptr<const client::PortModel> model);
+ Port* port(const std::shared_ptr<const client::PortModel>& model);
- void delete_port_view(std::shared_ptr<const client::PortModel> model);
+ void
+ delete_port_view(const std::shared_ptr<const client::PortModel>& model);
virtual void store_location(double ax, double ay);
void show_human_names(bool b);
@@ -65,8 +67,8 @@ public:
std::shared_ptr<const client::BlockModel> block() const { return _block; }
protected:
- NodeModule(GraphCanvas& canvas,
- std::shared_ptr<const client::BlockModel> block);
+ NodeModule(GraphCanvas& canvas,
+ const std::shared_ptr<const client::BlockModel>& block);
virtual bool on_double_click(GdkEventButton* ev);
@@ -82,7 +84,7 @@ protected:
void rename();
void property_changed(const URI& key, const Atom& value);
- void new_port_view(std::shared_ptr<const client::PortModel> port);
+ void new_port_view(const 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);
diff --git a/src/gui/ObjectMenu.cpp b/src/gui/ObjectMenu.cpp
index 91185cee..935ff683 100644
--- a/src/gui/ObjectMenu.cpp
+++ b/src/gui/ObjectMenu.cpp
@@ -52,7 +52,8 @@ ObjectMenu::ObjectMenu(BaseObjectType* cobject,
}
void
-ObjectMenu::init(App& app, std::shared_ptr<const client::ObjectModel> object)
+ObjectMenu::init(App& app,
+ const std::shared_ptr<const client::ObjectModel>& object)
{
_app = &app;
_object = object;
diff --git a/src/gui/ObjectMenu.hpp b/src/gui/ObjectMenu.hpp
index 2f3caa01..834fec1b 100644
--- a/src/gui/ObjectMenu.hpp
+++ b/src/gui/ObjectMenu.hpp
@@ -44,7 +44,8 @@ public:
ObjectMenu(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& xml);
- void init(App& app, std::shared_ptr<const client::ObjectModel> object);
+ void
+ init(App& app, const std::shared_ptr<const client::ObjectModel>& object);
std::shared_ptr<const client::ObjectModel> object() const
{
diff --git a/src/gui/PluginMenu.cpp b/src/gui/PluginMenu.cpp
index 2f6dfc82..849e652e 100644
--- a/src/gui/PluginMenu.cpp
+++ b/src/gui/PluginMenu.cpp
@@ -65,7 +65,7 @@ PluginMenu::clear()
}
void
-PluginMenu::add_plugin(std::shared_ptr<client::PluginModel> p)
+PluginMenu::add_plugin(const std::shared_ptr<client::PluginModel>& p)
{
using iterator = ClassMenus::iterator;
@@ -144,8 +144,8 @@ PluginMenu::build_plugin_class_menu(Gtk::Menu* menu,
}
void
-PluginMenu::add_plugin_to_menu(MenuRecord& menu,
- std::shared_ptr<client::PluginModel> p)
+PluginMenu::add_plugin_to_menu(MenuRecord& menu,
+ const std::shared_ptr<client::PluginModel>& p)
{
const URIs& uris = _world.uris();
LilvWorld* lworld = _world.lilv_world();
@@ -171,7 +171,7 @@ PluginMenu::add_plugin_to_menu(MenuRecord& menu,
}
void
-PluginMenu::load_plugin(std::weak_ptr<client::PluginModel> weak_plugin)
+PluginMenu::load_plugin(const std::weak_ptr<client::PluginModel>& weak_plugin)
{
signal_load_plugin.emit(weak_plugin);
}
diff --git a/src/gui/PluginMenu.hpp b/src/gui/PluginMenu.hpp
index 9b08dc0a..cfdf9f76 100644
--- a/src/gui/PluginMenu.hpp
+++ b/src/gui/PluginMenu.hpp
@@ -45,7 +45,7 @@ public:
PluginMenu(ingen::World& world);
void clear();
- void add_plugin(std::shared_ptr<client::PluginModel> p);
+ void add_plugin(const std::shared_ptr<client::PluginModel>& p);
sigc::signal<void, std::weak_ptr<client::PluginModel>> signal_load_plugin;
@@ -66,10 +66,10 @@ private:
const LV2Children& children,
std::set<const char*>& ancestors);
- void add_plugin_to_menu(MenuRecord& menu,
- std::shared_ptr<client::PluginModel> p);
+ void add_plugin_to_menu(MenuRecord& menu,
+ const std::shared_ptr<client::PluginModel>& p);
- void load_plugin(std::weak_ptr<client::PluginModel> weak_plugin);
+ void load_plugin(const std::weak_ptr<client::PluginModel>& weak_plugin);
ingen::World& _world;
MenuRecord _classless_menu;
diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp
index e7c6b959..062b9936 100644
--- a/src/gui/Port.cpp
+++ b/src/gui/Port.cpp
@@ -48,21 +48,21 @@ using client::PortModel;
namespace gui {
Port*
-Port::create(App& app,
- Ganv::Module& module,
- std::shared_ptr<const PortModel> pm,
- bool flip)
+Port::create(App& app,
+ Ganv::Module& module,
+ const 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,
- std::shared_ptr<const PortModel> pm,
- const std::string& name,
- bool flip)
+Port::Port(App& app,
+ Ganv::Module& module,
+ const std::shared_ptr<const PortModel>& pm,
+ const std::string& name,
+ bool flip)
: Ganv::Port(module,
name,
flip ? (!pm->is_input()) : pm->is_input(),
@@ -117,7 +117,7 @@ Port::~Port()
}
std::string
-Port::port_label(App& app, std::shared_ptr<const PortModel> pm)
+Port::port_label(App& app, const std::shared_ptr<const PortModel>& pm)
{
if (!pm) {
return "";
diff --git a/src/gui/Port.hpp b/src/gui/Port.hpp
index c605cdba..245b0565 100644
--- a/src/gui/Port.hpp
+++ b/src/gui/Port.hpp
@@ -44,10 +44,10 @@ class GraphBox;
class Port : public Ganv::Port
{
public:
- static Port* create(App& app,
- Ganv::Module& module,
- std::shared_ptr<const client::PortModel> pm,
- bool flip = false);
+ static Port* create(App& app,
+ Ganv::Module& module,
+ const std::shared_ptr<const client::PortModel>& pm,
+ bool flip = false);
~Port() override;
@@ -66,14 +66,14 @@ public:
bool on_selected(gboolean b) override;
private:
- Port(App& app,
- Ganv::Module& module,
- std::shared_ptr<const client::PortModel> pm,
- const std::string& name,
- bool flip = false);
+ Port(App& app,
+ Ganv::Module& module,
+ const 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);
+ port_label(App& app, const 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 09cd2bea..c07162ff 100644
--- a/src/gui/PortMenu.cpp
+++ b/src/gui/PortMenu.cpp
@@ -47,9 +47,9 @@ PortMenu::PortMenu(BaseObjectType* cobject,
}
void
-PortMenu::init(App& app,
- std::shared_ptr<const PortModel> port,
- bool internal_graph_port)
+PortMenu::init(App& app,
+ const 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 9ff632bf..7a9c6225 100644
--- a/src/gui/PortMenu.hpp
+++ b/src/gui/PortMenu.hpp
@@ -38,8 +38,8 @@ public:
PortMenu(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& xml);
- void init(App& app,
- std::shared_ptr<const client::PortModel> port,
+ void init(App& app,
+ const std::shared_ptr<const client::PortModel>& port,
bool internal_graph_port = false);
private:
diff --git a/src/gui/PropertiesWindow.cpp b/src/gui/PropertiesWindow.cpp
index 6abd6c06..86118b23 100644
--- a/src/gui/PropertiesWindow.cpp
+++ b/src/gui/PropertiesWindow.cpp
@@ -97,7 +97,7 @@ PropertiesWindow::reset()
}
void
-PropertiesWindow::present(std::shared_ptr<const ObjectModel> model)
+PropertiesWindow::present(const std::shared_ptr<const ObjectModel>& model)
{
set_object(model);
Gtk::Window::present();
@@ -203,7 +203,7 @@ PropertiesWindow::class_supported(const rdfs::URISet& types)
* This function MUST be called before using this object in any way.
*/
void
-PropertiesWindow::set_object(std::shared_ptr<const ObjectModel> model)
+PropertiesWindow::set_object(const std::shared_ptr<const ObjectModel>& model)
{
reset();
_model = model;
diff --git a/src/gui/PropertiesWindow.hpp b/src/gui/PropertiesWindow.hpp
index d91c9268..6bd14340 100644
--- a/src/gui/PropertiesWindow.hpp
+++ b/src/gui/PropertiesWindow.hpp
@@ -53,8 +53,8 @@ public:
PropertiesWindow(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& xml);
- void present(std::shared_ptr<const client::ObjectModel> model);
- void set_object(std::shared_ptr<const client::ObjectModel> model);
+ void present(const std::shared_ptr<const client::ObjectModel>& model);
+ void set_object(const std::shared_ptr<const client::ObjectModel>& model);
private:
/** Record of a property (row in the table) */
diff --git a/src/gui/RDFS.cpp b/src/gui/RDFS.cpp
index 5bee419c..f72d5400 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, std::shared_ptr<const client::ObjectModel> model)
+types(World& world, const std::shared_ptr<const client::ObjectModel>& model)
{
using PropIter = Properties::const_iterator;
using PropRange = std::pair<PropIter, PropIter>;
@@ -145,7 +145,8 @@ types(World& world, std::shared_ptr<const client::ObjectModel> model)
}
URISet
-properties(World& world, std::shared_ptr<const client::ObjectModel> model)
+properties(World& world,
+ const 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 70c46a8e..4fac5546 100644
--- a/src/gui/RDFS.hpp
+++ b/src/gui/RDFS.hpp
@@ -62,11 +62,12 @@ Objects instances(World& world, const URISet& types);
/** Get all the types which `model` is an instance of. */
URISet
-types(World& world, std::shared_ptr<const client::ObjectModel> model);
+types(World& world, const std::shared_ptr<const client::ObjectModel>& model);
/** Get all the properties with domains appropriate for `model`. */
URISet
-properties(World& world, std::shared_ptr<const client::ObjectModel> model);
+properties(World& world,
+ const 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 dbda594c..dc49e535 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(std::shared_ptr<const ObjectModel> object)
+RenameWindow::set_object(const std::shared_ptr<const ObjectModel>& object)
{
_object = object;
_symbol_entry->set_text(object->path().symbol());
@@ -69,7 +69,7 @@ RenameWindow::set_object(std::shared_ptr<const ObjectModel> object)
}
void
-RenameWindow::present(std::shared_ptr<const ObjectModel> object)
+RenameWindow::present(const 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 49fb93ba..b2734a0c 100644
--- a/src/gui/RenameWindow.hpp
+++ b/src/gui/RenameWindow.hpp
@@ -41,10 +41,10 @@ public:
RenameWindow(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& xml);
- void present(std::shared_ptr<const client::ObjectModel> object);
+ void present(const std::shared_ptr<const client::ObjectModel>& object);
private:
- void set_object(std::shared_ptr<const client::ObjectModel> object);
+ void set_object(const std::shared_ptr<const client::ObjectModel>& object);
void values_changed();
void cancel_clicked();
diff --git a/src/gui/Style.cpp b/src/gui/Style.cpp
index e91f6c4b..fa6b974b 100644
--- a/src/gui/Style.cpp
+++ b/src/gui/Style.cpp
@@ -57,7 +57,7 @@ Style::Style(App& app)
* the default location.
*/
void
-Style::load_settings(std::string filename)
+Style::load_settings(const std::string& filename)
{
/* ... */
}
@@ -66,7 +66,7 @@ Style::load_settings(std::string filename)
* default location.
*/
void
-Style::save_settings(std::string filename)
+Style::save_settings(const std::string& filename)
{
/* ... */
}
diff --git a/src/gui/Style.hpp b/src/gui/Style.hpp
index bb403ffd..e5423734 100644
--- a/src/gui/Style.hpp
+++ b/src/gui/Style.hpp
@@ -33,8 +33,8 @@ class Style
public:
explicit Style(App& app);
- void load_settings(std::string filename = "");
- void save_settings(std::string filename = "");
+ void load_settings(const std::string& filename = "");
+ void save_settings(const std::string& filename = "");
void apply_settings();
diff --git a/src/gui/SubgraphModule.cpp b/src/gui/SubgraphModule.cpp
index e4f3d2df..76e285b2 100644
--- a/src/gui/SubgraphModule.cpp
+++ b/src/gui/SubgraphModule.cpp
@@ -36,8 +36,8 @@ using client::GraphModel;
namespace gui {
-SubgraphModule::SubgraphModule(GraphCanvas& canvas,
- std::shared_ptr<const GraphModel> graph)
+SubgraphModule::SubgraphModule(GraphCanvas& canvas,
+ const 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 816d042a..5ff57bcc 100644
--- a/src/gui/SubgraphModule.hpp
+++ b/src/gui/SubgraphModule.hpp
@@ -40,8 +40,8 @@ class GraphCanvas;
class SubgraphModule : public NodeModule
{
public:
- SubgraphModule(GraphCanvas& canvas,
- std::shared_ptr<const client::GraphModel> graph);
+ SubgraphModule(GraphCanvas& canvas,
+ const std::shared_ptr<const client::GraphModel>& graph);
~SubgraphModule() override = default;
diff --git a/src/gui/ThreadedLoader.cpp b/src/gui/ThreadedLoader.cpp
index 41b1320e..edc1ad4c 100644
--- a/src/gui/ThreadedLoader.cpp
+++ b/src/gui/ThreadedLoader.cpp
@@ -72,11 +72,11 @@ ThreadedLoader::run()
}
void
-ThreadedLoader::load_graph(bool merge,
- const FilePath& file_path,
- optional<Raul::Path> engine_parent,
- optional<Raul::Symbol> engine_symbol,
- optional<Properties> engine_data)
+ThreadedLoader::load_graph(bool merge,
+ const FilePath& file_path,
+ const optional<Raul::Path>& engine_parent,
+ const optional<Raul::Symbol>& engine_symbol,
+ const optional<Properties>& engine_data)
{
std::lock_guard<std::mutex> lock(_mutex);
@@ -100,10 +100,10 @@ ThreadedLoader::load_graph(bool merge,
}
void
-ThreadedLoader::load_graph_event(const FilePath& file_path,
- optional<Raul::Path> engine_parent,
- optional<Raul::Symbol> engine_symbol,
- optional<Properties> engine_data)
+ThreadedLoader::load_graph_event(const FilePath& file_path,
+ const optional<Raul::Path>& engine_parent,
+ const optional<Raul::Symbol>& engine_symbol,
+ const optional<Properties>& engine_data)
{
std::lock_guard<std::mutex> lock(_app.world().rdf_mutex());
@@ -116,8 +116,9 @@ ThreadedLoader::load_graph_event(const FilePath& file_path,
}
void
-ThreadedLoader::save_graph(std::shared_ptr<const client::GraphModel> model,
- const URI& uri)
+ThreadedLoader::save_graph(
+ const std::shared_ptr<const client::GraphModel>& model,
+ const URI& uri)
{
std::lock_guard<std::mutex> lock(_mutex);
@@ -131,8 +132,8 @@ ThreadedLoader::save_graph(std::shared_ptr<const client::GraphModel> model,
void
ThreadedLoader::save_graph_event(
- std::shared_ptr<const client::GraphModel> model,
- const URI& uri)
+ const 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 1a0d764f..9189dbd6 100644
--- a/src/gui/ThreadedLoader.hpp
+++ b/src/gui/ThreadedLoader.hpp
@@ -61,25 +61,26 @@ public:
~ThreadedLoader();
- void load_graph(bool merge,
- const FilePath& file_path,
- boost::optional<Raul::Path> engine_parent,
- boost::optional<Raul::Symbol> engine_symbol,
- boost::optional<Properties> engine_data);
+ void load_graph(bool merge,
+ const FilePath& file_path,
+ const boost::optional<Raul::Path>& engine_parent,
+ const boost::optional<Raul::Symbol>& engine_symbol,
+ const boost::optional<Properties>& engine_data);
- void
- save_graph(std::shared_ptr<const client::GraphModel> model, const URI& uri);
+ void save_graph(const std::shared_ptr<const client::GraphModel>& model,
+ const URI& uri);
std::shared_ptr<Parser> parser();
private:
- void load_graph_event(const FilePath& file_path,
- boost::optional<Raul::Path> engine_parent,
- boost::optional<Raul::Symbol> engine_symbol,
- boost::optional<Properties> engine_data);
+ void load_graph_event(const FilePath& file_path,
+ const boost::optional<Raul::Path>& engine_parent,
+ const boost::optional<Raul::Symbol>& engine_symbol,
+ const boost::optional<Properties>& engine_data);
- void save_graph_event(std::shared_ptr<const client::GraphModel> model,
- const URI& uri);
+ void
+ save_graph_event(const std::shared_ptr<const client::GraphModel>& model,
+ const URI& uri);
/** Returns nothing and takes no parameters (because they have all been bound) */
using Closure = sigc::slot<void>;
diff --git a/src/gui/WindowFactory.cpp b/src/gui/WindowFactory.cpp
index a394f3f5..80f61235 100644
--- a/src/gui/WindowFactory.cpp
+++ b/src/gui/WindowFactory.cpp
@@ -101,7 +101,7 @@ WindowFactory::num_open_graph_windows()
}
GraphBox*
-WindowFactory::graph_box(std::shared_ptr<const GraphModel> graph)
+WindowFactory::graph_box(const std::shared_ptr<const GraphModel>& graph)
{
GraphWindow* window = graph_window(graph);
if (window) {
@@ -112,7 +112,7 @@ WindowFactory::graph_box(std::shared_ptr<const GraphModel> graph)
}
GraphWindow*
-WindowFactory::graph_window(std::shared_ptr<const GraphModel> graph)
+WindowFactory::graph_window(const std::shared_ptr<const GraphModel>& graph)
{
if (!graph) {
return nullptr;
@@ -124,7 +124,8 @@ WindowFactory::graph_window(std::shared_ptr<const GraphModel> graph)
}
GraphWindow*
-WindowFactory::parent_graph_window(std::shared_ptr<const BlockModel> block)
+WindowFactory::parent_graph_window(
+ const std::shared_ptr<const BlockModel>& block)
{
if (!block) {
return nullptr;
@@ -140,9 +141,9 @@ WindowFactory::parent_graph_window(std::shared_ptr<const BlockModel> block)
* presented and `preferred` left unmodified.
*/
void
-WindowFactory::present_graph(std::shared_ptr<const GraphModel> graph,
- GraphWindow* preferred,
- std::shared_ptr<GraphView> view)
+WindowFactory::present_graph(const std::shared_ptr<const GraphModel>& graph,
+ GraphWindow* preferred,
+ const std::shared_ptr<GraphView>& view)
{
assert(!view || view->graph() == graph);
@@ -166,8 +167,8 @@ WindowFactory::present_graph(std::shared_ptr<const GraphModel> graph,
}
GraphWindow*
-WindowFactory::new_graph_window(std::shared_ptr<const GraphModel> graph,
- std::shared_ptr<GraphView> view)
+WindowFactory::new_graph_window(const std::shared_ptr<const GraphModel>& graph,
+ const std::shared_ptr<GraphView>& view)
{
assert(!view || view->graph() == graph);
@@ -208,8 +209,9 @@ WindowFactory::remove_graph_window(GraphWindow* win, GdkEventAny* ignored)
}
void
-WindowFactory::present_load_plugin(std::shared_ptr<const GraphModel> graph,
- Properties data)
+WindowFactory::present_load_plugin(
+ const std::shared_ptr<const GraphModel>& graph,
+ const Properties& data)
{
_app.request_plugins_if_necessary();
@@ -233,8 +235,9 @@ WindowFactory::present_load_plugin(std::shared_ptr<const GraphModel> graph,
}
void
-WindowFactory::present_load_graph(std::shared_ptr<const GraphModel> graph,
- Properties data)
+WindowFactory::present_load_graph(
+ const std::shared_ptr<const GraphModel>& graph,
+ const Properties& data)
{
auto w = _graph_windows.find(graph->path());
@@ -246,8 +249,9 @@ WindowFactory::present_load_graph(std::shared_ptr<const GraphModel> graph,
}
void
-WindowFactory::present_load_subgraph(std::shared_ptr<const GraphModel> graph,
- Properties data)
+WindowFactory::present_load_subgraph(
+ const std::shared_ptr<const GraphModel>& graph,
+ const Properties& data)
{
auto w = _graph_windows.find(graph->path());
@@ -259,8 +263,9 @@ WindowFactory::present_load_subgraph(std::shared_ptr<const GraphModel> graph,
}
void
-WindowFactory::present_new_subgraph(std::shared_ptr<const GraphModel> graph,
- Properties data)
+WindowFactory::present_new_subgraph(
+ const std::shared_ptr<const GraphModel>& graph,
+ const Properties& data)
{
auto w = _graph_windows.find(graph->path());
@@ -272,7 +277,7 @@ WindowFactory::present_new_subgraph(std::shared_ptr<const GraphModel> graph,
}
void
-WindowFactory::present_rename(std::shared_ptr<const ObjectModel> object)
+WindowFactory::present_rename(const std::shared_ptr<const ObjectModel>& object)
{
auto w = _graph_windows.find(object->path());
if (w == _graph_windows.end()) {
@@ -287,7 +292,8 @@ WindowFactory::present_rename(std::shared_ptr<const ObjectModel> object)
}
void
-WindowFactory::present_properties(std::shared_ptr<const ObjectModel> object)
+WindowFactory::present_properties(
+ const 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 00ddce55..e6968bad 100644
--- a/src/gui/WindowFactory.hpp
+++ b/src/gui/WindowFactory.hpp
@@ -56,30 +56,38 @@ public:
size_t num_open_graph_windows();
- GraphBox* graph_box(std::shared_ptr<const client::GraphModel> graph);
- GraphWindow* graph_window(std::shared_ptr<const client::GraphModel> graph);
+ GraphBox* graph_box(const std::shared_ptr<const client::GraphModel>& graph);
GraphWindow*
- parent_graph_window(std::shared_ptr<const client::BlockModel> block);
+ graph_window(const std::shared_ptr<const client::GraphModel>& graph);
- void present_graph(std::shared_ptr<const client::GraphModel> graph,
- GraphWindow* preferred = nullptr,
- std::shared_ptr<GraphView> view = nullptr);
+ GraphWindow*
+ parent_graph_window(const std::shared_ptr<const client::BlockModel>& block);
+
+ void present_graph(const std::shared_ptr<const client::GraphModel>& graph,
+ GraphWindow* preferred = nullptr,
+ const std::shared_ptr<GraphView>& view = nullptr);
+
+ void
+ present_load_plugin(const std::shared_ptr<const client::GraphModel>& graph,
+ const Properties& data = Properties());
- void present_load_plugin(std::shared_ptr<const client::GraphModel> graph,
- Properties data = Properties());
+ void
+ present_load_graph(const std::shared_ptr<const client::GraphModel>& graph,
+ const Properties& data = Properties());
- void present_load_graph(std::shared_ptr<const client::GraphModel> graph,
- Properties data = Properties());
+ void present_load_subgraph(
+ const std::shared_ptr<const client::GraphModel>& graph,
+ const Properties& data = Properties());
- void present_load_subgraph(std::shared_ptr<const client::GraphModel> graph,
- Properties data = Properties());
+ void
+ present_new_subgraph(const std::shared_ptr<const client::GraphModel>& graph,
+ const Properties& data = Properties());
- void present_new_subgraph(std::shared_ptr<const client::GraphModel> graph,
- Properties data = Properties());
+ void
+ present_rename(const std::shared_ptr<const client::ObjectModel>& object);
- void present_rename(std::shared_ptr<const client::ObjectModel> object);
- void present_properties(std::shared_ptr<const client::ObjectModel> object);
+ void present_properties(const std::shared_ptr<const client::ObjectModel>& object);
bool remove_graph_window(GraphWindow* win, GdkEventAny* ignored = nullptr);
@@ -91,8 +99,8 @@ private:
using GraphWindowMap = std::map<Raul::Path, GraphWindow*>;
GraphWindow*
- new_graph_window(std::shared_ptr<const client::GraphModel> graph,
- std::shared_ptr<GraphView> view);
+ new_graph_window(const std::shared_ptr<const client::GraphModel>& graph,
+ const std::shared_ptr<GraphView>& view);
App& _app;
GraphBox* _main_box;