ViewSpec: rearrange dependencies to simplify testing

...but still not clear yet what we actually need to access from within the ViewSpecDSL_test
This commit is contained in:
Fischlurch 2018-04-05 22:23:34 +02:00
parent 2f899a921c
commit eae775b725
3 changed files with 6 additions and 15 deletions

View file

@ -84,7 +84,7 @@ namespace interact {
InteractionDirector::InteractionDirector (GlobalCtx& globals)
: model::Controller(session::Root::getID(), globals.uiBus_.getAccessPoint())
, globalCtx_(globals)
, viewLocator_{new ViewLocator{globals}}
, viewLocator_{new ViewLocator{globals.windowLoc_}}
, spotLocator_{new SpotLocator}
, navigator_{*spotLocator_, *viewLocator_} // Service exposed as Depend<LocationQuery>
, tracker_{new FocusTracker{*navigator_}}

View file

@ -44,7 +44,6 @@
#include "gui/ctrl/panel-locator.hpp"
#include "gui/ctrl/window-locator.hpp"
#include "gui/interact/ui-coord-resolver.hpp"
#include "gui/ctrl/global-ctx.hpp"
#include "lib/depend.hpp"
#include "lib/symbol.hpp"
//#include "lib/util.hpp"
@ -71,8 +70,8 @@ namespace interact {
ViewLocator::ViewLocator (ctrl::GlobalCtx& uiTopLevel)
: globals_{uiTopLevel}
ViewLocator::ViewLocator (ctrl::WindowLocator& windowLocatorService)
: windowLoc_{windowLocatorService}
, locResolver_{LocationQuery::service}
{ }
@ -86,13 +85,7 @@ namespace interact {
PanelLocator&
ViewLocator::panelLocator()
{
return globals_.windowLoc_.locatePanel();
}
WindowLocator&
ViewLocator::windowLocator()
{
return globals_.windowLoc_;
return windowLoc_.locatePanel();
}

View file

@ -69,7 +69,6 @@
namespace gui {
namespace ctrl{
class GlobalCtx;
class PanelLocator;
class WindowLocator;
}
@ -92,12 +91,12 @@ namespace interact {
{
using Service_LocationSolver = lib::DependInject<UILocationSolver>::ServiceInstance<>;
ctrl::GlobalCtx& globals_;
ctrl::WindowLocator& windowLoc_;
Service_LocationSolver locResolver_;
public:
ViewLocator (ctrl::GlobalCtx&);
ViewLocator (ctrl::WindowLocator&);
~ViewLocator();
@ -110,7 +109,6 @@ namespace interact {
private:
/* === accessors to sibling global services === */
ctrl::PanelLocator& panelLocator();
ctrl::WindowLocator& windowLocator();
};