diff --git a/src/gui/interact/interaction-director.cpp b/src/gui/interact/interaction-director.cpp index 6b3cbf740..750e35c4a 100644 --- a/src/gui/interact/interaction-director.cpp +++ b/src/gui/interact/interaction-director.cpp @@ -83,9 +83,9 @@ namespace interact { InteractionDirector::InteractionDirector (GlobalCtx& globals) : model::Controller(session::Root::getID(), globals.uiBus_.getAccessPoint()) , globalCtx_(globals) - , viewLocator_{new ViewLocator{globals.windowLoc_.locatePanel()}} + , viewLocator_{new ViewLocator{globals, [this]() -> LocationQuery& { return *navigator_; }}} , spotLocator_{new SpotLocator} - , navigator_{new Navigator{*spotLocator_}} + , navigator_{new Navigator{*spotLocator_, *viewLocator_}} , tracker_{new FocusTracker{*navigator_}} , uiState_{new UiState{globals.uiBus_.getStateManager(), *tracker_}} , assets_{new AssetController{session::Root::getAssetID(), this->uiBus_}} diff --git a/src/gui/interact/navigator.cpp b/src/gui/interact/navigator.cpp index e8e05a22c..dce9e238f 100644 --- a/src/gui/interact/navigator.cpp +++ b/src/gui/interact/navigator.cpp @@ -23,8 +23,14 @@ /** @file navigator.cpp ** Implementation of global interface navigation mechanisms. + ** Especially we implement the LocationQuery interface, which exposes the structures + ** of the UI as an abstracted, tree-shaped topology. This task adds up to levelling all the + ** specifics of accessing individual components and to assemble them into a virtual component tree. + ** The actual details of component access are thereby delegated to the ViewLocator, which is a sibling + ** service maintained by the InteractionDirector. ** ** @todo WIP 2/2017 early draft / foundations of "interaction control" + ** @todo WIP 1/2018 integrating the concept of UI-Coordinate navigation and resolution. Still WIP-WIP-WIP... */ @@ -47,11 +53,36 @@ namespace interact { { } - Navigator::Navigator (SpotLocator& spotLocator) - : spotLocator_{spotLocator} + Navigator::Navigator (SpotLocator& spotLoc, ViewLocator& viewLoc) + : spotLocator_{spotLoc} + , viewLocator_{viewLoc} { } + /* ==== implementing the LocationQuery API ==== */ + + Literal + Navigator::determineAnchor (UICoord const& path) + { + UNIMPLEMENTED ("LocationQuery in real UI: resolve anchor point of given UI-Coordinates"); + } + + + size_t + Navigator::determineCoverage (UICoord const& path) + { + UNIMPLEMENTED ("LocationQuery in real UI: determine explicit coverage of given UI-Coordinates"); + } + + + LocationQuery::ChildIter + Navigator::getChildren (UICoord const& path, size_t pos) + { + UNIMPLEMENTED ("LocationQuery in real UI: build child iterator rooted at given point in the UI tree"); + } + + + /** */ diff --git a/src/gui/interact/navigator.hpp b/src/gui/interact/navigator.hpp index d8fe237e1..475e49802 100644 --- a/src/gui/interact/navigator.hpp +++ b/src/gui/interact/navigator.hpp @@ -39,6 +39,7 @@ #define GUI_INTERACT_NAVIGATOR_H #include "gui/gtk-base.hpp" +#include "gui/interact/ui-coord-resolver.hpp" #include //#include @@ -53,6 +54,7 @@ namespace interact { // class GlobalCtx; class SpotLocator; + class ViewLocator; @@ -63,14 +65,21 @@ namespace interact { * @see UiCoordResolver */ class Navigator - : boost::noncopyable + : public LocationQuery + , boost::noncopyable { SpotLocator& spotLocator_; + ViewLocator& viewLocator_; public: - Navigator (SpotLocator&); + Navigator (SpotLocator&, ViewLocator&); ~Navigator (); + /* === LocationQuery API === */ + Literal determineAnchor (UICoord const& path) override final; + size_t determineCoverage (UICoord const& path) override final; + ChildIter getChildren (UICoord const& path, size_t pos) override final; + private: }; diff --git a/src/gui/interact/view-locator.cpp b/src/gui/interact/view-locator.cpp index eebd1a551..92c6b7b01 100644 --- a/src/gui/interact/view-locator.cpp +++ b/src/gui/interact/view-locator.cpp @@ -29,13 +29,18 @@ #include "gui/interact/view-locator.hpp" -//#include "gui/ctrl/global-ctx.hpp" +#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/symbol.hpp" //#include "lib/util.hpp" //using util::cStr; //using util::isnil; using lib::Symbol; +using gui::ctrl::PanelLocator; +using gui::ctrl::WindowLocator; namespace gui { @@ -52,11 +57,29 @@ namespace interact { ViewLocator::~ViewLocator() { } - ViewLocator::ViewLocator (ctrl::PanelLocator& panelLocator) - : panelLoc_{panelLocator} + ViewLocator::ViewLocator (ctrl::GlobalCtx& uiTopLevel, std::function getLocQuery) + : globals_{uiTopLevel} + , locationQuery{getLocQuery} { } + /* === Service accessors within global context === */ + + PanelLocator& + ViewLocator::panelLocator() + { + return globals_.windowLoc_.locatePanel(); + } + + WindowLocator& + ViewLocator::windowLocator() + { + return globals_.windowLoc_; + } + + + + /** */ diff --git a/src/gui/interact/view-locator.hpp b/src/gui/interact/view-locator.hpp index 9c1077824..e23d3cff2 100644 --- a/src/gui/interact/view-locator.hpp +++ b/src/gui/interact/view-locator.hpp @@ -45,19 +45,26 @@ #include "gui/gtk-base.hpp" #include "gui/id-scheme.hpp" -#include "gui/ctrl/panel-locator.hpp" #include +#include //#include //#include namespace gui { +namespace ctrl{ + class GlobalCtx; + class PanelLocator; + class WindowLocator; +} namespace interact { // using std::unique_ptr; // using std::string; + using std::function; + class LocationQuery; // class GlobalCtx; @@ -70,10 +77,10 @@ namespace interact { class ViewLocator : boost::noncopyable { - ctrl::PanelLocator& panelLoc_; + ctrl::GlobalCtx& globals_; public: - ViewLocator (ctrl::PanelLocator&); + ViewLocator (ctrl::GlobalCtx&, function); ~ViewLocator(); @@ -84,6 +91,10 @@ namespace interact { V& get(); private: + /* === accessors to sibling global services === */ + function locationQuery; + ctrl::PanelLocator& panelLocator(); + ctrl::WindowLocator& windowLocator(); }; diff --git a/wiki/renderengine.html b/wiki/renderengine.html index 8db9fada5..67e4008a8 100644 --- a/wiki/renderengine.html +++ b/wiki/renderengine.html @@ -3705,7 +3705,7 @@ Especially the focus navigation entails the use of some kind of ubiquitous [[coo -
+
//the top-level controller within the UI.//
 In Lumiera, the structures of the model within the [[Session]] (the so called HighLevelModel) are mapped onto corresponding [[tangible UI entities|UI-Element]], which serve as a front-end to represent those entities towards the user. Within this model, there is a //conceptual root node// -- which logically corresponds to the session itself. This [[root element in model|ModelRootMO]] links together the actual top-level entities, which are the (multiple) timelines, together with the asset management and defaults and rules configuration within the session.
 
@@ -3726,7 +3726,7 @@ The InteractionDirector is part of the model, and thus we have to distinguish be
 :anything related to forming and tracking of user interactions → InteractionControl
 :* the SpotLocator is what is "moved" when the [[Spot]] of current activity moves
 :* the FocusTracker is responsible for //detecting changes in current selection and focus.//
-:* the [[Navigator]] is a special controller to handle moving the SpotLocator
+:* the [[Navigator]] is a special controller to handle moving the SpotLocator within the UI tree topology
 
 !Collaborations
 * several global actions are exposed here, like opening the session and creating a new timeline.<br/>Such operations are typically bound into menu and action buttons, and in turn invoke [[commands|CommandHandling]] into the Session
@@ -3736,6 +3736,9 @@ The InteractionDirector is part of the model, and thus we have to distinguish be
 ** or can exist only once per top level window
 ** some might even be required once per window
 ** while others may be duplicated locally or globally
+
+!!!cyclic dependencies
+The InteractionDirector interconnects various aspects of UI management and thus can be expected to exhibit cyclic dependencies on several levels. Bootstraping the InteractionDirector is thus a tricky procedure and requires all participating services to operate demand-driven. In fact, these services represent some aspects of the same whole -- the UI. They are bounded by thematic considerations, not so much implementation concerns, and many of them rely on their siblings actually provide some essential part of their service. For example, the Navigator exposes the UI as topological tree structure, while the ViewLocator encapsulates the concrete access paths towards specific kinds of UI entities (views, panels). Obviously, the Navigator needs the ViewLocator to build its tree abstraction on top. But, thematically, //resolving a view// is part of accessing and / or creating  some view, and thus the ViewLocator becomes indirectly dependent on the tree topology established by the Navigator.
 
diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index cd73856cd..3a1c66372 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -762,7 +762,7 @@ - + @@ -2436,7 +2436,7 @@ - + @@ -2447,7 +2447,7 @@

- +
@@ -4201,6 +4201,15 @@ + + + + + + + + + @@ -9009,27 +9018,138 @@ - +

- Integration + Integration ViewLocator

Resolver / Navigator

-
+ +
+ + + + + + + + + + + + + + + +

+ aber auch: Resolver +

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

+ die Regel ist: +

+

+ Bei zyklischen Abhängigkeiten erfolgt der Ringschluß +

+

+ an einer Stelle über eine allgemeine Abstraktion +

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

+ implementiert LocationQuery +

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

+ ...als Namespace-globale Variable mit externer Linkage +

+ + +
+
+
@@ -9121,7 +9241,7 @@ - + @@ -10424,9 +10544,10 @@ - + + - + @@ -10476,19 +10597,20 @@ - - + + - - + + - + - + + @@ -19304,8 +19426,8 @@ - - + + @@ -19352,7 +19474,7 @@ - +