diff --git a/src/proc/mobject/session/dummy-session-connection.cpp b/src/proc/mobject/session/dummy-session-connection.cpp index fb6c3e313..e9c677785 100644 --- a/src/proc/mobject/session/dummy-session-connection.cpp +++ b/src/proc/mobject/session/dummy-session-connection.cpp @@ -39,9 +39,12 @@ //#include "lib/symbol.hpp" //#include "include/logging.h" #include "proc/mobject/session/dummy-session-connection.hpp" +#include "proc/mobject/session/root.hpp" #include "proc/control/command-def.hpp" #include "include/ui-protocol.hpp" #include "include/gui-notification-facade.h" +#include "lib/diff/tree-diff-application.hpp" +#include "lib/diff/mutation-message.hpp" #include "lib/diff/gen-node.hpp" //#include "lib/idi/entry-id.hpp" #include "lib/format-string.hpp" @@ -53,6 +56,8 @@ //#include using lib::diff::GenNode; +using lib::diff::MakeRec; +using lib::diff::MutationMessage; //using util::cStr; using util::_Fmt; using std::string; @@ -71,6 +76,16 @@ namespace session { namespace { //Implementation details.... + GenNode + emptyTimeline (string baseID) + { + return MakeRec() + .set(string{gui::ATTR_fork} + ,MakeRec() + .type(string{gui::TYPE_Fork}) + ) + .genNode(baseID); + } } //(End)Implementation details.... @@ -86,10 +101,21 @@ namespace session { /** - * - * @param id - * @return + * Build a population diff message to describe a specific session structure to add */ + MutationMessage + DummySessionConnection::fabricateSeq1 (string baseID) + { + return MutationMessage{ ins (emptyTimeline (baseID)) + }; + } + + + void + DummySessionConnection::applyCopy (MutationMessage const& diff) + { + TODO ("build internal diagnostic data structure, apply a copy of the message"); + } }}// namespace proc::mobject::session @@ -105,6 +131,10 @@ namespace cmd { // using gui::MARK_expand; using gui::GuiNotification; // using util::isYes; + + namespace session = proc::mobject::session; + + using DummySess = session::DummySessionConnection; /* ============ dedicated Fake-Commands ============ */ @@ -124,6 +154,10 @@ COMMAND_DEFINITION (test_fake_injectSequence_1) { string message{_Fmt{"fabricate Sequence_1 (dummyID='%s')"} % dummyID}; GuiNotification::facade().displayInfo (NOTE_INFO, message); + auto popuDiff = DummySess::instance().fabricateSeq1 (dummyID); + DummySess::instance().applyCopy (popuDiff); + auto rootID = session::Root::getID(); + GuiNotification::facade().mutate (rootID, move(popuDiff)); }) .captureUndo ([](string dummyID) -> string { diff --git a/src/proc/mobject/session/dummy-session-connection.hpp b/src/proc/mobject/session/dummy-session-connection.hpp index 521256c16..745785420 100644 --- a/src/proc/mobject/session/dummy-session-connection.hpp +++ b/src/proc/mobject/session/dummy-session-connection.hpp @@ -48,10 +48,15 @@ #include "lib/nocopy.hpp" #include "lib/util.hpp" +#include "lib/diff/tree-diff.hpp" #include "proc/control/command-setup.hpp" #include +namespace lib { +namespace diff{ + class MutationMessage; +}} namespace proc { namespace cmd { @@ -70,6 +75,7 @@ namespace session { //using util::isnil; using std::string; + using lib::diff::MutationMessage; /** * Scaffolding to drive the evolution of the Lumiera application. @@ -83,7 +89,8 @@ namespace session { * @see gui::timeline::TimelineController */ class DummySessionConnection - : util::NonCopyable + : lib::diff::TreeDiffLanguage + , util::NonCopyable { string nothing_; @@ -102,6 +109,11 @@ namespace session { /* == do X == */ /* == forget Y == */ + + MutationMessage fabricateSeq1 (string baseID); + + void applyCopy (MutationMessage const&); + #if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #1042 void setSolution (string const& solution = "") diff --git a/tests/gui/abstract-tangible-test.cpp b/tests/gui/abstract-tangible-test.cpp index c9ffc776a..2bc76eb68 100644 --- a/tests/gui/abstract-tangible-test.cpp +++ b/tests/gui/abstract-tangible-test.cpp @@ -641,8 +641,10 @@ namespace test { * For this to work, the receiver needs to create a custom _diff binding_. * Thus, each subclass of Tangible has to implement the virtual function * Tangible::buildMutator() and hook up those internal structures, which - * are exposed to changes via diff message. Note especially how child - * UI elements are added this way, to populate the contents of the UI. + * are exposed to changes via diff message. This is what we then call a + * "diff binding" (and MockElement is already outfitted this way). Note + * especially how child UI elements can be added recursively, allowing + * gradually to populate the contents of the UI. * * The diff itself is an iterable sequence of _diff verbs_. * Typically, such a diff is generated as the result of some operation diff --git a/tests/library/diff/mutation-message-test.cpp b/tests/library/diff/mutation-message-test.cpp index 6cd9a59cb..3bad00977 100644 --- a/tests/library/diff/mutation-message-test.cpp +++ b/tests/library/diff/mutation-message-test.cpp @@ -1,5 +1,5 @@ /* - MutationMessage(Test) - demonstrate the basics of tree diff representation + MutationMessage(Test) - verify diff mutation message container Copyright (C) Lumiera.org 2017, Hermann Vosseler diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 0c771ab8d..7d9f02839 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -5254,10 +5254,16 @@ - + + + + + + + @@ -5267,11 +5273,11 @@ - - + + - - + +