diff --git a/src/gui/model/tangible.hpp b/src/gui/model/tangible.hpp index c629e4601..984a3ebb8 100644 --- a/src/gui/model/tangible.hpp +++ b/src/gui/model/tangible.hpp @@ -133,6 +133,7 @@ #include #include +#include #include @@ -174,6 +175,8 @@ namespace model { void reset(); + template + void prepareCommand (Cmd const& prototype, ARGS&&...); void prepareCommand (Cmd const& prototype, Rec&& arguments); void issueCommand (Cmd const& preparedAction); @@ -202,6 +205,20 @@ namespace model { + /** convenience shortcut to issue a command with several arguments */ + template + inline void + Tangible::prepareCommand (Cmd const& prototype, ARGS&&... args) + { + using GenNodeIL = std::initializer_list; + + prepareCommand (prototype, + Rec (Rec::TYPE_NIL_SYM, GenNodeIL{} + ,GenNodeIL {std::forward (args)...})); + } // not typed, no attributes, all arguments as children + + + /** generic handler for all incoming "state mark" messages */ inline void Tangible::mark (GenNode const& stateMark) diff --git a/src/lib/diff/record.hpp b/src/lib/diff/record.hpp index 7a923f89c..764574aa6 100644 --- a/src/lib/diff/record.hpp +++ b/src/lib/diff/record.hpp @@ -148,6 +148,7 @@ namespace diff{ public: static const string TYPE_NIL; + static const Symbol TYPE_NIL_SYM; Record() : type_(TYPE_NIL) @@ -377,7 +378,10 @@ namespace diff{ }; template - const string Record::TYPE_NIL = "NIL"; + const Symbol Record::TYPE_NIL_SYM = "NIL"; + + template + const string Record::TYPE_NIL = string(TYPE_NIL_SYM); diff --git a/tests/gui/bus-term-test.cpp b/tests/gui/bus-term-test.cpp index 6b7e80fb2..3eee81d01 100644 --- a/tests/gui/bus-term-test.cpp +++ b/tests/gui/bus-term-test.cpp @@ -198,7 +198,7 @@ namespace test { CHECK (not cmd.canExec()); - mock.prepareCommand(cmd, Rec({text, clip, luid})); + mock.prepareCommand (cmd, text, clip, luid); CHECK (cmd.canExec()); CHECK (gui::test::Nexus::wasBound(cmd, text, clip, luid)); diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index aad86f4f7..5deacb593 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -137,7 +137,7 @@ - + @@ -167,7 +167,7 @@ - + @@ -282,7 +282,7 @@ - + @@ -479,7 +479,7 @@ - + @@ -493,10 +493,10 @@

- +
- - + +