61 #ifndef STAGE_INTERACT_GEN_NODE_LOCATION_QUERY_H 62 #define STAGE_INTERACT_GEN_NODE_LOCATION_QUERY_H 107 : tree_(std::forward<REC>(backingStructure))
117 if (isnil(tree_) or not path.isPresent(UIC_WINDOW))
118 return Symbol::BOTTOM;
120 return getFirstWindow();
122 return getCurrentWindow();
123 if (not tree_.hasAttribute(
string{path.getWindow()}))
124 return Symbol::BOTTOM;
125 return path.getWindow();
134 drillDown (tree_, path, path.size(), depth);
143 Rec
const& node = drillDown (tree_, path, pos, depth);
146 "element %s at pos %d in path %s is in " 147 "contradiction to actual UI structure"}
149 % (depth<path.size()? path[depth] : Symbol::BOTTOM)
161 return Symbol{*tree_.keys()};
166 return Symbol{lib::pull_last (tree_.keys())};
170 resolveElm (
UICoord const& path,
size_t depth)
172 REQUIRE (path.isPresent(depth));
179 drillDown (Rec
const& tree,
UICoord const& path,
size_t maxDepth,
size_t& depth)
181 if (depth<maxDepth and path.isPresent(depth))
183 const char* pathElm = resolveElm (path, depth);
184 if (
hasNode (tree, pathElm, depth))
187 return drillDown (
descendInto(tree,depth-1,pathElm), path, maxDepth, depth);
201 hasNode (Rec
const& tree,
const char* pathElm,
size_t depth)
203 return depth==UIC_PERSP? pathElm == tree.getType()
204 : tree.hasAttribute(pathElm);
211 return depth==UIC_PERSP? tree
212 : tree.get(pathElm).data.get<Rec>();
227 auto internedString = [](
string const& id) ->
Literal 251 expandChildren()
const override 262 Literal currentChild_ = Symbol::BOTTOM;
264 using Pos =
typename PAR::Pos;
267 firstResult ()
override 269 Pos pos = PAR::firstResult();
270 if (pos) currentChild_ = *pos;
275 nextResult(Pos& pos)
override 277 PAR::nextResult (pos);
278 if (pos) currentChild_ = *pos;
286 : PAR{forward<IT> (rawChildIter)}
Test/Diagnostics: implementation of the LocationQuery-API based on a abstract topological structure g...
Describe a location within the UI through structural/topological coordinates.
virtual size_t determineCoverage(UICoord const &path) override
evaluate to what extent a UIcoord spec matches the structure given as GenNode tree ...
inline string literal This is a marker type to indicate that
virtual ChildIter getChildren(UICoord const &path, size_t pos) override
get the sequence of child IDs at a designated position in the backing GenNode tree ...
virtual Literal determineAnchor(UICoord const &path) override
resolve Anchor against GenNode tree
A front-end for using printf-style formatting.
Derived specific exceptions within Lumiera's exception hierarchy.
Token or Atom with distinct identity.
static bool hasNode(Rec const &tree, const char *pathElm, size_t depth)
does the guiding tree contain the element as requested by the UICoord path?
static Rec const & descendInto(Rec const &tree, size_t depth, const char *pathElm)
within tree at level depth descend into the child element designated by pathElm
Marker types to indicate a literal string and a Symbol.
Helper to navigate a tree topology represented as GenNode tree.
Lumiera GTK UI implementation root.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
Interface to locate and move within a tree shaped structure.
const Symbol UIC_CURRENT_WINDOW
window spec to refer to the current window
static TreeStructureNavigator * childNavigator(Rec const &node, size_t depth)
Generic building block for tree shaped (meta)data structures.
auto singleValIterator(VAL &&something)
Build a SingleValIter: convenience free function shortcut, to pick up just any value and wrap it as L...
Interface to discover a backing structure for the purpose of path navigation and resolution.
Lumiera error handling (C++ interface).
static auto buildIterator(TreeStructureNavigator *source)
build a Lumiera Forward Iterator as front-end and managing Handle for a TreeStructureNavigator or sub...
Evaluation of UI coordinates against a concrete window topology.
const Symbol UIC_FIRST_WINDOW
window spec to refer to the first window of the application
Building tree expanding and backtracking evaluations within hierarchical scopes.
auto transformIterator(IT const &src, FUN processingFunc)
Build a TransformIter: convenience free function shortcut, picking up the involved types automaticall...
object-like record of data.
Extension module to build an opaque data source, accessible as Lumiera Forward Iterator.
Standard implementation of the IterSource interface: a wrapped "Lumiera Forward Iterator".
static TreeStructureNavigator * buildNavigator(Rec const &node, size_t depth, IT &&rawIterator)
type rebinding helper to pick up the concrete child iterator type IT