52 #ifndef STAGE_INTERACT_GEN_NODE_LOCATION_QUERY_H 53 #define STAGE_INTERACT_GEN_NODE_LOCATION_QUERY_H 98 : tree_(std::forward<REC>(backingStructure))
108 if (isnil(tree_) or not path.isPresent(UIC_WINDOW))
109 return Symbol::BOTTOM;
111 return getFirstWindow();
113 return getCurrentWindow();
114 if (not tree_.hasAttribute(
string{path.getWindow()}))
115 return Symbol::BOTTOM;
116 return path.getWindow();
125 drillDown (tree_, path, path.size(), depth);
134 Rec
const& node = drillDown (tree_, path, pos, depth);
137 "element %s at pos %d in path %s is in " 138 "contradiction to actual UI structure"}
140 % (depth<path.size()? path[depth] : Symbol::BOTTOM)
152 return Symbol{*tree_.keys()};
157 return Symbol{lib::pull_last (tree_.keys())};
161 resolveElm (
UICoord const& path,
size_t depth)
163 REQUIRE (path.isPresent(depth));
170 drillDown (Rec
const& tree,
UICoord const& path,
size_t maxDepth,
size_t& depth)
172 if (depth<maxDepth and path.isPresent(depth))
174 const char* pathElm = resolveElm (path, depth);
175 if (
hasNode (tree, pathElm, depth))
178 return drillDown (
descendInto(tree,depth-1,pathElm), path, maxDepth, depth);
192 hasNode (Rec
const& tree,
const char* pathElm,
size_t depth)
194 return depth==UIC_PERSP? pathElm == tree.getType()
195 : tree.hasAttribute(pathElm);
202 return depth==UIC_PERSP? tree
203 : tree.get(pathElm).data.get<Rec>();
218 auto internedString = [](
string const& id) ->
Literal 242 expandChildren()
const override 253 Literal currentChild_ = Symbol::BOTTOM;
255 using Pos =
typename PAR::Pos;
258 firstResult ()
override 260 Pos pos = PAR::firstResult();
261 if (pos) currentChild_ = *pos;
266 nextResult(Pos& pos)
override 268 PAR::nextResult (pos);
269 if (pos) currentChild_ = *pos;
277 : 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