diff --git a/src/gui/model/tangible.cpp b/src/gui/model/tangible.cpp index b2e5883a7..787006b78 100644 --- a/src/gui/model/tangible.cpp +++ b/src/gui/model/tangible.cpp @@ -33,6 +33,8 @@ //#include "lib/symbol.hpp" //#include "include/logging.h" #include "gui/model/tangible.hpp" +#include "gui/model/widget.hpp" +#include "gui/model/controller.hpp" //#include //#include @@ -65,9 +67,8 @@ namespace model { * @param arguments suitable tuple of values, to be used to outfit the prototype */ void - Tangible::prepareCommand (InvocationTrail const& prototype, Rec&& arguments) + Tangible::prepareCommand (Cmd const& prototype, Rec&& arguments) { - TODO ("invoke some hook for instrumentation?"); uiBus_.act (prototype.bind(std::forward(arguments))); } @@ -78,10 +79,9 @@ namespace model { * which needs to be outfitted with arguments and ready for invocation. */ void - Tangible::issueCommand (InvocationTrail const& preparedAction) + Tangible::issueCommand (Cmd const& preparedAction) { - TODO ("invoke some hook for instrumentation?"); - uiBus_.act (prototype.bang()); + uiBus_.act (preparedAction.bang()); } diff --git a/src/gui/model/tangible.hpp b/src/gui/model/tangible.hpp index d1044926c..eec3cbca5 100644 --- a/src/gui/model/tangible.hpp +++ b/src/gui/model/tangible.hpp @@ -68,14 +68,15 @@ namespace model { : boost::noncopyable { protected: - using interact::InvocationTrail; - using lib::diff::GenNode; - using lib::diff::Rec; + using GenNode = lib::diff::GenNode; + using Cmd = interact::InvocationTrail; + using Rec = lib::diff::Rec; + using ID = lib::idi::BareEntryID; ctrl::BusTerm uiBus_; - Tangible(EntryID identity, ctrl::BusTerm nexus) + Tangible(ID identity, ctrl::BusTerm& nexus) : uiBus_(nexus.attach(identity)) { } @@ -84,8 +85,8 @@ namespace model { void reset(); - void prepareCommand (InvocationTrail const& prototype, Rec&& arguments); - void issueCommand (InvocationTrail const& preparedAction); + void prepareCommand (Cmd const& prototype, Rec&& arguments); + void issueCommand (Cmd const& preparedAction); void slotExpand(); void slotReveal(); @@ -96,8 +97,14 @@ namespace model { void noteMark(); protected: - virtual void doExpand() =0; - virtual void doReveal() =0; + virtual void doReset() =0; + virtual void doExpand() =0; + virtual void doReveal() =0; + + virtual void doMsg() =0; + virtual void doErr() =0; + virtual void doFlash() =0; + virtual void doMark() =0; private: }; diff --git a/tests/gui/abstract-tangible-test.cpp b/tests/gui/abstract-tangible-test.cpp index 25301f911..55d934cbb 100644 --- a/tests/gui/abstract-tangible-test.cpp +++ b/tests/gui/abstract-tangible-test.cpp @@ -47,6 +47,7 @@ #include "lib/test/run.hpp" #include "lib/test/test-helper.hpp" +#include "test/mock-elm.hpp" #include "lib/error.hpp" //#include "gui/model/session-facade.hpp" //#include "gui/model/diagnostics.hpp" @@ -64,7 +65,6 @@ //using std::cout; //using std::endl; -using lib::error::LUMIERA_ERROR_ASSERTION; namespace gui { diff --git a/tests/gui/test/mock-elm.hpp b/tests/gui/test/mock-elm.hpp index 56967e595..967000497 100644 --- a/tests/gui/test/mock-elm.hpp +++ b/tests/gui/test/mock-elm.hpp @@ -47,14 +47,19 @@ //#include "lib/util.hpp" #include "gui/model/tangible.hpp" #include "lib/diff/record.hpp" +#include "test/nexus.hpp" //#include #include namespace gui { + namespace error = lumiera::error; + using error::LUMIERA_ERROR_ASSERTION; + namespace test{ + // using lib::HashVal; // using util::isnil; using lib::idi::EntryID; @@ -79,28 +84,52 @@ namespace test{ /* ==== Tangible interface ==== */ - virtual void - act (GenNode command) override + virtual void doReset() { - UNIMPLEMENTED (""); + UNIMPLEMENTED ("mock doReset"); } - virtual void note (GenNode mark) =0; - virtual void mark (GenNode mark) =0; - virtual void act (EntryID subject, GenNode command) =0; - virtual void note (EntryID subject, GenNode mark) =0; - virtual void mark (EntryID subject, GenNode mark) =0; + virtual void doExpand() + { + UNIMPLEMENTED ("mock doExpand"); + } + + virtual void doReveal() + { + UNIMPLEMENTED ("mock doReveal"); + } + + virtual void doMsg() + { + UNIMPLEMENTED ("mock doMsg"); + } + + virtual void doErr() + { + UNIMPLEMENTED ("mock doErr"); + } + + virtual void doFlash() + { + UNIMPLEMENTED ("mock doFlash"); + } + + virtual void doMark() + { + UNIMPLEMENTED ("mock doMark"); + } protected: public: explicit MockElm(string id) - : gui::model::Tangible(TODO_generate_identity, TestNexus::hook()) + : MockElm(EntryID(id)) { } explicit - MockElm(EntryID identity, ctrl::BusTerm&& nexus =TestNexus::hook()) + MockElm(ID identity, ctrl::BusTerm& nexus =Nexus::testUI()) + : gui::model::Tangible(identity, nexus) { } };