From f1c793f7e2148b10610a09a459d9e89b39d2d87b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 19 Mar 2017 13:26:38 +0100 Subject: Fix round-trip preservation of property contexts --- ingen/client/ClientStore.hpp | 6 +++-- ingen/client/PluginUI.hpp | 3 ++- ingen/client/SigClientInterface.hpp | 16 ++++++++----- ingen/client/ThreadedSigClientInterface.hpp | 36 +++++++++++++++++------------ 4 files changed, 37 insertions(+), 24 deletions(-) (limited to 'ingen/client') diff --git a/ingen/client/ClientStore.hpp b/ingen/client/ClientStore.hpp index 84a95b7b..1887bed3 100644 --- a/ingen/client/ClientStore.hpp +++ b/ingen/client/ClientStore.hpp @@ -79,7 +79,8 @@ public: void delta(const Raul::URI& uri, const Properties& remove, - const Properties& add); + const Properties& add, + Resource::Graph ctx = Resource::Graph::DEFAULT); void copy(const Raul::URI& old_uri, const Raul::URI& new_uri); @@ -89,7 +90,8 @@ public: void set_property(const Raul::URI& subject_path, const Raul::URI& predicate, - const Atom& value); + const Atom& value, + Resource::Graph ctx = Resource::Graph::DEFAULT); void connect(const Raul::Path& tail, const Raul::Path& head); diff --git a/ingen/client/PluginUI.hpp b/ingen/client/PluginUI.hpp index d4d47e3b..c44cad82 100644 --- a/ingen/client/PluginUI.hpp +++ b/ingen/client/PluginUI.hpp @@ -78,7 +78,8 @@ public: INGEN_SIGNAL(property_changed, void, const Raul::URI&, // Subject const Raul::URI&, // Predicate - const Atom&); // Object + const Atom&, // Object + Resource::Graph); // Context Ingen::World* world() const { return _world; } SPtr block() const { return _block; } diff --git a/ingen/client/SigClientInterface.hpp b/ingen/client/SigClientInterface.hpp index a65806f4..7e903fab 100644 --- a/ingen/client/SigClientInterface.hpp +++ b/ingen/client/SigClientInterface.hpp @@ -53,14 +53,14 @@ public: INGEN_SIGNAL(bundle_end, void) INGEN_SIGNAL(error, void, std::string) INGEN_SIGNAL(put, void, Raul::URI, Properties, Resource::Graph) - INGEN_SIGNAL(delta, void, Raul::URI, Properties, Properties) + INGEN_SIGNAL(delta, void, Raul::URI, Properties, Properties, Resource::Graph) INGEN_SIGNAL(object_copied, void, Raul::URI, Raul::URI) INGEN_SIGNAL(object_moved, void, Raul::Path, Raul::Path) INGEN_SIGNAL(object_deleted, void, Raul::URI) INGEN_SIGNAL(connection, void, Raul::Path, Raul::Path) INGEN_SIGNAL(disconnection, void, Raul::Path, Raul::Path) INGEN_SIGNAL(disconnect_all, void, Raul::Path, Raul::Path) - INGEN_SIGNAL(property_change, void, Raul::URI, Raul::URI, Atom) + INGEN_SIGNAL(property_change, void, Raul::URI, Raul::URI, Atom, Resource::Graph) /** Fire pending signals. Only does anything on derived classes (that may queue) */ virtual bool emit_signals() { return false; } @@ -90,8 +90,9 @@ protected: void delta(const Raul::URI& uri, const Properties& remove, - const Properties& add) - { EMIT(delta, uri, remove, add); } + const Properties& add, + Resource::Graph ctx = Resource::Graph::DEFAULT) + { EMIT(delta, uri, remove, add, ctx); } void connect(const Raul::Path& tail, const Raul::Path& head) { EMIT(connection, tail, head); } @@ -111,8 +112,11 @@ protected: void disconnect_all(const Raul::Path& graph, const Raul::Path& path) { EMIT(disconnect_all, graph, path); } - void set_property(const Raul::URI& subject, const Raul::URI& key, const Atom& value) - { EMIT(property_change, subject, key, value); } + void set_property(const Raul::URI& subject, + const Raul::URI& key, + const Atom& value, + Resource::Graph ctx = Resource::Graph::DEFAULT) + { EMIT(property_change, subject, key, value, ctx); } void undo() {} void redo() {} diff --git a/ingen/client/ThreadedSigClientInterface.hpp b/ingen/client/ThreadedSigClientInterface.hpp index db3aad44..219fd8d1 100644 --- a/ingen/client/ThreadedSigClientInterface.hpp +++ b/ingen/client/ThreadedSigClientInterface.hpp @@ -87,8 +87,9 @@ public: void delta(const Raul::URI& path, const Properties& remove, - const Properties& add) - { push_sig(sigc::bind(delta_slot, path, remove, add)); } + const Properties& add, + Resource::Graph ctx = Resource::Graph::DEFAULT) + { push_sig(sigc::bind(delta_slot, path, remove, add, ctx)); } void connect(const Raul::Path& tail, const Raul::Path& head) { push_sig(sigc::bind(connection_slot, tail, head)); } @@ -108,8 +109,11 @@ public: void disconnect_all(const Raul::Path& graph, const Raul::Path& path) { push_sig(sigc::bind(disconnect_all_slot, graph, path)); } - void set_property(const Raul::URI& subject, const Raul::URI& key, const Atom& value) - { push_sig(sigc::bind(property_change_slot, subject, key, value)); } + void set_property(const Raul::URI& subject, + const Raul::URI& key, + const Atom& value, + Resource::Graph ctx = Resource::Graph::DEFAULT) + { push_sig(sigc::bind(property_change_slot, subject, key, value, ctx)); } /** Process all queued events - Called from GTK thread to emit signals. */ bool emit_signals() { @@ -149,22 +153,24 @@ private: Raul::SRSWQueue _sigs; - typedef Resource::Graph Graph; + using Graph = Resource::Graph; + using Path = Raul::Path; + using URI = Raul::URI; sigc::slot bundle_begin_slot; sigc::slot bundle_end_slot; sigc::slot response_slot; sigc::slot error_slot; - sigc::slot new_plugin_slot; - sigc::slot put_slot; - sigc::slot delta_slot; - sigc::slot connection_slot; - sigc::slot object_deleted_slot; - sigc::slot object_moved_slot; - sigc::slot object_copied_slot; - sigc::slot disconnection_slot; - sigc::slot disconnect_all_slot; - sigc::slot property_change_slot; + sigc::slot new_plugin_slot; + sigc::slot put_slot; + sigc::slot delta_slot; + sigc::slot connection_slot; + sigc::slot object_deleted_slot; + sigc::slot object_moved_slot; + sigc::slot object_copied_slot; + sigc::slot disconnection_slot; + sigc::slot disconnect_all_slot; + sigc::slot property_change_slot; }; } // namespace Client -- cgit v1.2.1