From 198ccff396b6eba6022659d4b60bcde16f6f23c4 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sun, 19 Feb 2017 04:46:13 +0100 Subject: [PATCH] UI-top-level: install presentation state recording service (#1081) --- src/gui/ctrl/core-service.hpp | 14 +++- src/gui/ctrl/state-map-grouping-storage.hpp | 8 +-- src/gui/ctrl/ui-state.cpp | 5 +- src/gui/ctrl/ui-state.hpp | 4 +- src/gui/interact/interaction-director.cpp | 2 +- src/gui/ui-bus.cpp | 9 ++- src/gui/ui-bus.hpp | 3 +- wiki/thinkPad.ichthyo.mm | 72 ++++++++++++++++++++- 8 files changed, 102 insertions(+), 15 deletions(-) diff --git a/src/gui/ctrl/core-service.hpp b/src/gui/ctrl/core-service.hpp index a20d45c58..506dec3fb 100644 --- a/src/gui/ctrl/core-service.hpp +++ b/src/gui/ctrl/core-service.hpp @@ -85,6 +85,7 @@ #include "lib/idi/entry-id.hpp" #include "include/session-command-facade.h" #include "gui/notification-service.hpp" +#include "gui/ctrl/state-recorder.hpp" #include "gui/ctrl/command-handler.hpp" #include "gui/ctrl/bus-term.hpp" #include "gui/ctrl/nexus.hpp" @@ -109,6 +110,7 @@ namespace ctrl{ { Nexus uiBusBackbone_; + StateRecorder stateRecorder_; NotificationService activateNotificationService_; @@ -121,9 +123,9 @@ namespace ctrl{ virtual void - note (ID subject, GenNode const& mark) override + note (ID subject, GenNode const& stateMark) override { - UNIMPLEMENTED ("receive and handle presentation state note messages."); + stateRecorder_.recordState (subject, stateMark); } @@ -132,12 +134,20 @@ namespace ctrl{ CoreService (ID identity =lib::idi::EntryID()) : BusTerm(identity, uiBusBackbone_) , uiBusBackbone_{*this} + , stateRecorder_{*this} , activateNotificationService_(uiBusBackbone_) // opens the GuiNotificationService instance { INFO (gui, "UI-Backbone operative."); } ~CoreService(); + + + StateManager& + getStateManager() + { + return stateRecorder_; + } }; diff --git a/src/gui/ctrl/state-map-grouping-storage.hpp b/src/gui/ctrl/state-map-grouping-storage.hpp index 25be8c5c4..c20184a9a 100644 --- a/src/gui/ctrl/state-map-grouping-storage.hpp +++ b/src/gui/ctrl/state-map-grouping-storage.hpp @@ -33,8 +33,8 @@ */ -#ifndef GUI_INTERACT_STATE_MAP_GROUPING_STORAGE_H -#define GUI_INTERACT_STATE_MAP_GROUPING_STORAGE_H +#ifndef GUI_CTRL_STATE_MAP_GROUPING_STORAGE_H +#define GUI_CTRL_STATE_MAP_GROUPING_STORAGE_H #include "lib/error.hpp" @@ -54,7 +54,7 @@ namespace ctrl { using lib::idi::BareEntryID; using lib::diff::GenNode; using lib::diff::Ref; - using util::unConst; + using ::util::unConst; using std::string; @@ -223,4 +223,4 @@ namespace ctrl { }} // namespace gui::ctrl -#endif /*GUI_INTERACT_STATE_MAP_GROUPING_STORAGE_H*/ +#endif /*GUI_CTRL_STATE_MAP_GROUPING_STORAGE_H*/ diff --git a/src/gui/ctrl/ui-state.cpp b/src/gui/ctrl/ui-state.cpp index bb1337bb9..fa8360a04 100644 --- a/src/gui/ctrl/ui-state.cpp +++ b/src/gui/ctrl/ui-state.cpp @@ -57,8 +57,9 @@ namespace ctrl { * Initialise storage for global interface state * @see ctrl::CoreService */ - UiState::UiState (FocusTracker& focusTracker) - : tracker_{focusTracker} + UiState::UiState (StateManager& stateManager, FocusTracker& focusTracker) + : stateManager_{stateManager} + , tracker_{focusTracker} { } diff --git a/src/gui/ctrl/ui-state.hpp b/src/gui/ctrl/ui-state.hpp index 182545ab0..87ee14a71 100644 --- a/src/gui/ctrl/ui-state.hpp +++ b/src/gui/ctrl/ui-state.hpp @@ -69,6 +69,7 @@ namespace ctrl { // using std::string; // class GlobalCtx; + class StateManager; @@ -83,10 +84,11 @@ namespace ctrl { class UiState : boost::noncopyable { + StateManager& stateManager_; interact::FocusTracker& tracker_; public: - UiState (interact::FocusTracker&); + UiState (StateManager&, interact::FocusTracker&); ~UiState(); private: diff --git a/src/gui/interact/interaction-director.cpp b/src/gui/interact/interaction-director.cpp index 983c352d7..e3a909de6 100644 --- a/src/gui/interact/interaction-director.cpp +++ b/src/gui/interact/interaction-director.cpp @@ -73,7 +73,7 @@ namespace interact { , spotLocator_{new SpotLocator} , navigator_{new Navigator{*spotLocator_}} , tracker_{new FocusTracker{*navigator_}} - , uiState_{new UiState{*tracker_}} + , uiState_{new UiState{globals.uiBus_.getStateManager(), *tracker_}} , assets_{new AssetController{session::Root::getAssetID(), this->uiBus_}} , timelines_{} { diff --git a/src/gui/ui-bus.cpp b/src/gui/ui-bus.cpp index f5a38d7ba..1e706cd15 100644 --- a/src/gui/ui-bus.cpp +++ b/src/gui/ui-bus.cpp @@ -74,7 +74,14 @@ namespace controller { { return *coreService_; } - + + ctrl::StateManager& + UiBus::getStateManager() + { + return coreService_->getStateManager(); + } + + namespace ctrl { diff --git a/src/gui/ui-bus.hpp b/src/gui/ui-bus.hpp index cf586b263..f17360179 100644 --- a/src/gui/ui-bus.hpp +++ b/src/gui/ui-bus.hpp @@ -163,7 +163,8 @@ namespace gui { UiBus(); ~UiBus(); - ctrl::BusTerm& getAccessPoint(); + ctrl::BusTerm& getAccessPoint(); + ctrl::StateManager& getStateManager(); }; diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index d217fbca9..95d737b90 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -2178,9 +2178,75 @@ - - - + + + + + + + + + + + + + + + + + + +

+ wird der Link zwischen CoreService und UI-State dangling +

+ + +
+ + +
+ + + + + + + + + + + + + + + +

+ ...mit der Ausnahme des Automatismus, +

+

+ der es selbst vom Bus abkoppelt +

+ + +
+ +
+
+
+ + + + + + + + + + + + + +