Lumiera
0.pre.03
»edit your freedom«
|
A UI-Coordinate resolver is a special builder, which is initialised by the given coordinate spec, and also attached to a "location query API", which allows to investigate the current actual UI structure. The builder then exposes query and mutation operations, to determine to what extent the coordinate spec is "covered" by the real UI, and to match and expand any wildcards in the coordinate spec (pattern).
Definition at line 72 of file ui-coord-resolver-test.cpp.
Private Member Functions | |
virtual void | run (Arg) |
void | verify_backingQuery () |
void | verify_mutateAnchor () |
void | verify_mutateCoverage () |
void | verify_mutateCoverPartially () |
void | verify_mutateExtend () |
void | verify_queryAnchor () |
void | verify_simpleUsage () |
|
inlineprivate |
Definition at line 95 of file ui-coord-resolver-test.cpp.
|
inlineprivate |
This test actually uses a dummy implementation of the interface, which, instead of navigating an actual UI topology, just uses a Record<GenNode>
(a "GenNode tree") to emulate the hierarchical structure of UI components.
set(key, val)
builder function, and for each nested scope, we start a new nested builder with MakeRec()
.currentWindow
to be the last one in list – in a real UI this would of course not be a configurable property of the LocationQuery, but rather just reflect the transient window state and return the currently activated window Definition at line 151 of file ui-coord-resolver-test.cpp.
|
inlineprivate |
Definition at line 247 of file ui-coord-resolver-test.cpp.
|
inlineprivate |
Since an UI coordinate path with gaps and wildcards could match anywhere, even several times, we need to perform an exhaustive search with backtracking over the whole tree. By convention, we use the first maximal solution, which can be just a partial solution, leaving an additional uncovered trailing part of the UI coordinate spec. Whenever a coordinate spec is not explicit, has wildcards or a leading gap, we need to perform the full matching algorithm, even to just answer the question if coverage is possible. The result, i.e. the computed coverage, is cached internally, and can be used to mutate the UI coordinate spec to match that coverage.
This test verifies various corner cases; especially there is a rule to prevent a partial match based on wildcards solely, rather we require at least one explicit match to qualify as partial solution.
Definition at line 329 of file ui-coord-resolver-test.cpp.
|
inlineprivate |
This is a variation of the UICoordResolver::cover() operation, which likewise resolves any wildcards; but here we tolerate additional elements below the covered part, as long as those are explicit. The typical use case is when we're about to create a new UI element at a specific existing anchor location within the UI. The extraneous uncovered part then describes those extra element yet to be created.
Definition at line 504 of file ui-coord-resolver-test.cpp.
|
inlineprivate |
This operation changes only the window part of the coordinate spec; it might use the result of a preceding coverage solution search or even trigger such a search, but only to find out about the root window.
Definition at line 584 of file ui-coord-resolver-test.cpp.
|
inlineprivate |
Contrary to just appending something to the path (which is a basic path operation available on the generic path builder), a path extension is always rooted at the end of the actually covered part of the UI coordinates. So extending a path implies search for a coverage solution, followed by truncating the path to the covered part. There are two flavours of extending a path:
Definition at line 698 of file ui-coord-resolver-test.cpp.