89 Rec dummyUiStructure = MakeRec()
92 .type(
"perspective-A")
96 .type(
"perspective-B")
97 .set(
"panelX", MakeRec())
98 .set(
"panelXX", MakeRec())
104 UICoord uic{
"window-2",
"*",
"panelX",
"someView"};
107 CHECK (not resolver.isCovered());
108 CHECK ( resolver.canCover());
110 UICoord uic2 = resolver.cover()
111 .extend(
"otherView");
113 CHECK (
"UI:window-2[perspective-B]-panelX.otherView" ==
string(uic2));
147 .type(
"perspective-A")
150 .set(
"firstView", MakeRec())
151 .set(
"secondView", MakeRec())
156 .type(
"perspective-B")
157 .set(
"panelY", MakeRec())
161 .type(
"perspective-C")
164 .set(
"thirdView", MakeRec())
166 .set(
"panelZZ", MakeRec())
177 CHECK (
"window-2" == queryAPI.determineAnchor(uic1));
179 CHECK (
"window-1" == queryAPI.determineAnchor(uic3));
180 CHECK (
"window-3" == queryAPI.determineAnchor(uic4));
181 CHECK (
"window-3" == queryAPI.determineAnchor(uic5));
183 CHECK (2 == queryAPI.determineCoverage(uic1));
184 CHECK (0 == queryAPI.determineCoverage(uic2));
185 CHECK (4 == queryAPI.determineCoverage(uic3));
186 CHECK (1 == queryAPI.determineCoverage(uic4));
187 CHECK (3 == queryAPI.determineCoverage(uic5));
190 CHECK (not isnil(cii));
191 CHECK (
"firstView" == *cii);
193 CHECK (
"secondView" == *cii);
194 CHECK (not isnil(cii));
198 CHECK (
"window-1, window-2, window-3" == join (queryAPI.getChildren (uic3, 0)));
199 CHECK (
"perspective-A" == join (queryAPI.getChildren (uic3, 1)));
200 CHECK (
"panelX" == join (queryAPI.getChildren (uic3, 2)));
201 CHECK (
"firstView, secondView" == join (queryAPI.getChildren (uic3, 3)));
202 CHECK (isnil ( queryAPI.getChildren (uic3, 4)));
204 CHECK (
"window-1, window-2, window-3" == join (queryAPI.getChildren (uic2, 0)));
207 CHECK (
"window-1, window-2, window-3" == join (queryAPI.getChildren (uic5, 0)));
208 CHECK (
"perspective-C" == join (queryAPI.getChildren (uic5, 1)));
209 CHECK (
"panelZ, panelZZ" == join (queryAPI.getChildren (uic5, 2)));
210 CHECK (
"thirdView" == join (queryAPI.getChildren (uic5, 3)));
215 cii = queryAPI.getChildren (uic3, 0);
216 CHECK (
"window-1" == *cii);
217 CHECK (0 == cii.depth());
218 cii.expandChildren();
219 CHECK (1 == cii.depth());
220 CHECK (
"perspective-A" == *cii);
221 cii.expandChildren();
222 CHECK (2 == cii.depth());
223 CHECK (
"panelX" == *cii);
224 cii.expandChildren();
225 CHECK (3 == cii.depth());
226 CHECK (
"firstView" == *cii);
227 CHECK (
"firstView, secondView, window-2, window-3" == join (cii));
243 .type(
"perspective-A")
247 .type(
"perspective-B")
250 .set(
"someView", MakeRec())
268 CHECK ( r1.isAnchored());
269 CHECK (not r2.isAnchored());
270 CHECK ( r3.isAnchored());
271 CHECK ( r4.isAnchored());
272 CHECK ( r5.isAnchored());
273 CHECK (not r6.isAnchored());
275 CHECK ( r1.canAnchor());
276 CHECK (not r2.canAnchor());
277 CHECK ( r3.canAnchor());
278 CHECK ( r4.canAnchor());
279 CHECK ( r5.canAnchor());
280 CHECK ( r6.canAnchor());
328 .set(
"firstView", MakeRec())
329 .set(
"secondView", MakeRec())
335 .set(
"#1", MakeRec())
336 .set(
"#2", MakeRec())
337 .set(
"tab", MakeRec())
344 .set(
"panelY", MakeRec())
355 .set(
"sub", MakeRec())
357 .set(
"#1", MakeRec())
360 .set(
"panelZZ", MakeRec())
367 .
panel(
"panelX"), tree};
368 CHECK (r11.isCovered());
369 CHECK (3 == r11.coverDepth());
375 .
view(
"thirdView"), tree};
376 CHECK (not r12.isCovered());
377 CHECK ( r12.isCoveredPartially());
378 CHECK (3 ==r12.coverDepth());
379 CHECK (
"UI:window-1[persp-A]-panelX.thirdView" ==
string(r12));
382 CHECK (r12.isCovered());
383 CHECK (r12.isCoveredPartially());
384 CHECK (3 ==r12.coverDepth());
385 CHECK (
"UI:window-1[persp-A]-panelX" ==
string(r12));
390 CHECK (
"UI:firstWindow[persp-A]" ==
string(r21));
392 CHECK (
"UI:window-1[persp-A]" ==
string(r21));
396 CHECK (
"UI:window-3" ==
string(r22.cover()));
401 CHECK (
"UI:window-1[*]-*.secondView" ==
string(r31));
402 CHECK (0 ==r31.coverDepth());
403 CHECK (not r31.isCovered());
404 CHECK (r31.canCover());
406 CHECK (r31.isCovered());
407 CHECK (4 == r31.coverDepth());
408 CHECK (
"UI:window-1[persp-A]-panelX.secondView" ==
string(r31));
412 CHECK (
"UI:window-3[persp-C]-panelZ.thirdView.tab/sub" ==
string(r32.cover()));
416 CHECK (
"UI:window-1[persp-A]-panelZ.thirdView.#2" ==
string(r33.cover()));
420 CHECK (
"UI:currentWindow[*]-panelZ.*.tab" ==
string(r34));
421 CHECK (
"UI:window-3[persp-C]-panelZ.thirdView.tab" ==
string(r34.cover()));
424 CHECK (
"UI:currentWindow[.]-panelZ.*.tab" ==
string(r35));
425 CHECK (
"UI:window-3[persp-C]-panelZ.thirdView.tab" ==
string(r35.cover()));
428 CHECK (
"UI:currentWindow[*]-..nonexisting" ==
string(r36));
429 CHECK (
"UI:window-3[persp-C]-panelZ" ==
string(r36.cover()));
434 CHECK (
"UI:window-2" ==
string(r41));
437 CHECK (
"UI:window-2[*]-*" ==
string(r41));
438 CHECK (not r41.canCover());
439 CHECK (
"UI:window-2" ==
string(r41.cover()));
443 CHECK (not r42.canCover());
447 CHECK (not r43.canCover());
451 CHECK (not r44.canCover());
455 CHECK (not r45.canCover());
459 CHECK (not r46.canCover());
463 CHECK (not r47.canCover());
468 CHECK (
"UI:window-3[persp-C]-panelZ.thirdView.tab/sub" ==
string(r51.cover()));
472 CHECK (
"UI:window-1[persp-A]-panelZ.thirdView.tab" ==
string(r52.cover()));
476 CHECK (
"UI:window-1[persp-A]-panelZ.thirdView.#1" ==
string(r531.cover()));
479 CHECK (
"UI:window-1[persp-A]-panelZ.thirdView.tab" ==
string(r532.cover()));
482 CHECK (
"UI:window-3[persp-C]-panelZ.thirdView.#1" ==
string(r533.cover()));
505 .set(
"#1", MakeRec())
506 .set(
"#2", MakeRec())
514 CHECK (3 == r1.coverDepth());
516 CHECK (not r1.isCovered());
517 CHECK (3 == r1.coverDepth());
518 CHECK (r1.isCoveredPartially());
519 CHECK (
"UI:window-2[persp-B]-panelY.otherView.tab" ==
string(r1));
521 CHECK (r1.isCovered());
522 CHECK (
"UI:window-2[persp-B]-panelY" ==
string(r1));
526 CHECK (0 == r2.coverDepth());
528 CHECK (not r2.isCovered());
529 CHECK (4 == r2.coverDepth());
530 CHECK (r2.isCoveredPartially());
531 CHECK (
"UI:window-2[persp-B]-panelY.someView.#3/sub" ==
string(r2));
533 CHECK (
"UI:window-2[persp-B]-panelY.someView" ==
string(r2));
537 CHECK (not r3.canCover());
548 CHECK (
"UI:currentWindow[.]-fantasy.fantomas" ==
string(r5));
549 CHECK (1 == r5.coverDepth());
551 CHECK (not r5.isCovered());
552 CHECK (2 == r5.coverDepth());
553 CHECK (r5.isCoveredPartially());
554 CHECK (
"UI:window-2[persp-B]-fantasy.fantomas" ==
string(r5));
556 CHECK (
"UI:window-2[persp-B]" ==
string(r5));
557 CHECK (2 == r5.coverDepth());
583 .set(
"firstView", MakeRec())
584 .set(
"secondView", MakeRec())
594 .set(
"#1", MakeRec())
595 .set(
"#2", MakeRec())
604 .set(
"thirdView", MakeRec())
611 CHECK (3 == r1.coverDepth());
613 CHECK (
"UI:window-2[persp-B]-panelY" ==
string(r1));
617 CHECK (0 == r2.coverDepth());
618 CHECK (r2.isAnchored());
619 CHECK (not r2.canCover());
620 CHECK (
"UI:firstWindow[*]-*.blah" ==
string(r2));
622 CHECK (
"UI:window-1[*]-*.blah" ==
string(r2));
623 CHECK (0 == r2.coverDepth());
624 CHECK (not r2.canCover());
628 CHECK (0 == r3.coverDepth());
629 CHECK (r3.isAnchored());
630 CHECK (not r3.isCovered());
631 CHECK (r3.canCover());
633 CHECK (not r3.isCovered());
634 CHECK (r3.isCoveredPartially());
635 CHECK (1 == r3.coverDepth());
636 CHECK (
"UI:window-3[*]-*.thirdView" ==
string(r3));
640 CHECK (
"UI:?.thirdView.#2/sub" ==
string(r4));
641 CHECK (not r4.isAnchored());
642 CHECK (0 == r4.coverDepth());
644 CHECK (1 == r4.coverDepth());
645 CHECK (r4.isCoveredPartially());
646 CHECK (
"UI:window-2[*]-*.thirdView.#2/sub" ==
string(r4));
650 CHECK (not r5.isCovered());
651 CHECK (not r5.isCoveredPartially());
652 CHECK (0 == r5.coverDepth());
653 CHECK (r5.canCover());
654 CHECK (1 == r5.coverDepth());
655 CHECK (not r5.isCovered());
656 CHECK (r5.isCoveredPartially());
657 CHECK (
"UI:currentWindow[*]-*.thirdView" ==
string(r5));
659 CHECK (
"UI:window-3[*]-*.thirdView" ==
string(r5));
660 CHECK (1 == r5.coverDepth());
661 CHECK (not r5.isCovered());
663 CHECK (r5.isCovered());
664 CHECK (4 == r5.coverDepth());
665 CHECK (
"UI:window-3[persp-C]-panelZ.thirdView" ==
string(r5));
669 CHECK (not r6.isAnchored());
670 CHECK (not r6.canCover());
672 CHECK (not r6.isAnchored());
673 CHECK (0 == r6.coverDepth());
674 CHECK (
"UI:windows[*]-*.*.*/to/hell" ==
string(r6));
699 .set(
"#1", MakeRec())
700 .set(
"#2", MakeRec())
708 CHECK (
"UI:window-2[persp-B]-panelY" ==
string(r1));
709 CHECK (r1.isCovered());
710 r1.extend (
UICoord().path(
"gappy").tab(2));
711 CHECK (
"UI:window-2[persp-B]-panelY.*.#2/gappy" ==
string(r1));
712 r1.extend (
"seamless");
713 CHECK (
"UI:window-2[persp-B]-panelY.thirdView.#2/seamless" ==
string(r1));
717 CHECK (
"UI:?.thirdView.some/where" ==
string(r2));
718 r2.extend (
"no/where");
719 CHECK (
"UI:window-2[persp-B]-panelY.thirdView.no/where" ==
string(r2));
720 CHECK (r2.isCoveredPartially());
724 CHECK (
"UI:window-2[persp-B]-panelY.thirdView.no/where" ==
string(r2));
726 r2.extend(
UICoord().tab(
"nada"));
727 CHECK (
"UI:window-2[persp-B]-panelY.thirdView.nada" ==
string(r2));
729 CHECK (
"UI:window-2[persp-B]-panelY.thirdView" ==
string(r2));
733 CHECK (not r3.canCover());
734 CHECK (0 == r3.coverDepth());
736 CHECK (1 == r3.coverDepth());
737 CHECK (
"UI:currentWindow[*]-*.*.#1" ==
string(r3));
Token or Atom with distinct identity.
Mutator && set(string const &key, X &&content)
object-like record of data.
Test/Diagnostics: implementation of the LocationQuery-API based on a abstract topological structure g...
decltype(TreeStructureNavigator::buildIterator(0)) ChildIter
Query and mutate UICoord specifications in relation to actual UI topology.
Builder && view(Literal viewID)
augment UI coordinates to indicate a specific view to be used
Builder && tab(Literal tabID)
augment UI coordinates to indicate a specific tab within the view"
Builder && path(Literal pathDef)
augment UI coordinates to define a complete local path
Builder && panel(Literal panelID)
augment UI coordinates to indicate a specific view to be used
Builder && persp(Literal perspectiveID)
augment UI coordinates to mandate a specific perspective to be active within the window
Builder && append(Literal elm)
augment UI coordinates by appending a further component at the end.
Describe a location within the UI through structural/topological coordinates.
static Builder window(Literal windowID)
Builder: start definition of UI-Coordinates rooted in given window.
static Builder firstWindow()
Builder: start definition of UI-Coordinates rooted in the firstWindow
Builder tab(Literal tabID) const
Builder persp(Literal perspectiveID) const
Builder panel(Literal panelID) const
Builder view(Literal viewID) const
static Builder currentWindow()
Builder: start definition of UI-Coordinates rooted in the currentWindow
void verify_simpleUsage()
void verify_queryAnchor()
void verify_backingQuery()
void verify_mutateCoverPartially()
void verify_mutateAnchor()
void verify_mutateCoverage()
void verify_mutateExtend()
Implementation of the stage::interact::LocationQuery interface to work on a GenNode tree.
Generic building block for tree shaped (meta)data structures.
const Symbol UIC_ELIDED
indicate that a component is elided or irrelevant here
Lumiera GTK UI implementation root.
Test runner and basic definitions for tests.
string join(COLL &&coll, string const &delim=", ")
enumerate a collection's contents, separated by delimiter.
bool isnil(lib::time::Duration const &dur)
Simplistic test class runner.
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
A collection of frequently used helper functions to support unit testing.
#define VERIFY_ERROR(ERROR_ID, ERRONEOUS_STATEMENT)
Macro to verify that a statement indeed raises an exception.
Evaluation of UI coordinates against a concrete window topology.
A topological addressing scheme to designate structural locations within the UI.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...