From 77c5573c8059b8aa680a0a092b8f74ed996a4dcd Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Fri, 22 Dec 2017 22:37:39 +0100 Subject: [PATCH] Navigator: draft a navigation helper interface ...which also happens to include sibling and child iteration; this is an attempt to reconcile the inner contradictions of the design (we need both absolute flexibility for the type of each child level iterator yet we want just a single, generic iterator front-end) --- src/gui/interact/ui-coord-resolver.cpp | 7 +++++++ src/gui/interact/ui-coord-resolver.hpp | 18 +++++++++++++++-- wiki/thinkPad.ichthyo.mm | 28 ++++++++++++++++---------- 3 files changed, 40 insertions(+), 13 deletions(-) diff --git a/src/gui/interact/ui-coord-resolver.cpp b/src/gui/interact/ui-coord-resolver.cpp index 0883c65c3..de3292930 100644 --- a/src/gui/interact/ui-coord-resolver.cpp +++ b/src/gui/interact/ui-coord-resolver.cpp @@ -41,6 +41,13 @@ using lib::Symbol; namespace gui { namespace interact { + // emit typeinfo and VTables here.... + TreeStructureNavigator::~TreeStructureNavigator() { } + + LocationQuery::~LocationQuery() { } + + + /** @internal working data for path resolution */ struct UICoordResolver::ResolutionState { diff --git a/src/gui/interact/ui-coord-resolver.hpp b/src/gui/interact/ui-coord-resolver.hpp index 70d367689..a09fafaa0 100644 --- a/src/gui/interact/ui-coord-resolver.hpp +++ b/src/gui/interact/ui-coord-resolver.hpp @@ -84,7 +84,21 @@ namespace interact { : public lib::IterSource { public: - virtual ~TreeStructureNavigator() { } ///< this is an interface + virtual ~TreeStructureNavigator(); ///< this is an interface + + /** expand into exploration of child elements at "current position". + * At any point, a TreeStructureNavicator instance indicates and represents a position + * within a tree-like structure. At the same time, it is part of a sequence of siblings, + * which is accessible through iteration. This operation now allows to extend visitation + * of siblings by consuming the current element and replacing it with the sequence of its + * immediate child elements, exposing the first one as the _"current position"_. + * @return pointer to a new heap allocated TreeStructureNavigator implementation, which + * represents the sequence of children. The object `this` will not be affected. + * @note it is the caller's responsibility to own and manage the generated navigator. + * The typical (and recommended) way to achieve this is to rely on the embedded + * type #iterator, which exposes an appropriately wired iterator::expandChildren() + */ + virtual TreeStructureNavigator* expandChildren() const =0; }; @@ -101,7 +115,7 @@ namespace interact { class LocationQuery { public: - virtual ~LocationQuery() { } ///< this is an interface + virtual ~LocationQuery(); ///< this is an interface using ChildIter = lib::IterSource::iterator; diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 34d8d94c3..206cc51ec 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -7578,8 +7578,8 @@ - - + + @@ -7602,8 +7602,8 @@ - - + + @@ -7622,7 +7622,7 @@ - + @@ -7684,7 +7684,7 @@ - + @@ -7702,7 +7702,7 @@ - + @@ -7729,7 +7729,7 @@ - + @@ -7917,7 +7917,7 @@ - + @@ -8016,8 +8016,14 @@ - - + + + + + + + +