75 Rec dummyUiStructure = MakeRec()
79 .set(
"exclusivePanel", MakeRec())
94 CHECK (isnil (solver.solve (rule,
UIC_VIEW,
"worldview")));
98 rule.append(
UICoord().panel(
"exclusivePanel"));
102 CHECK (not isnil (location));
105 CHECK (
"UI:window-1[perspective]-exclusivePanel.worldview" ==
string(location));
110 CHECK (resolver.isCoveredPartially());
111 CHECK (not resolver.isCoveredTotally());
112 CHECK (
UIC_VIEW == resolver.coverDepth());
143 .set (
"up", MakeRec())
150 .set (
"sink", MakeRec())
164 CHECK (isnil (solver.solve (r1,
UIC_PATH,
"to/salvation")));
165 CHECK (isnil (solver.solve (r1,
UIC_WINDOW,
"redemption")));
168 r1.append (
UICoord().path(
"down/to").create());
169 auto s1 = solver.solve(r1,
UIC_PATH+2,
"hell");
170 CHECK (
"UI:win[A]-thePanel.theView.#5/down/to/hell" ==
string{s1});
175 CHECK ( isnil (solver.solve (r2,
UIC_PATH+3,
"sink")));
178 CHECK ( isnil (solver.solve (r2,
UIC_VIEW,
"theView")));
180 CHECK (not isnil (solver.solve (r2,
UIC_PATH+1,
"any")));
181 CHECK (not isnil (solver.solve (r2,
UIC_PATH+2,
"kitchen")));
187 CHECK (
"UI:win" ==
string{solver.solve (r31,
UIC_WINDOW,
"wigwam")});
191 CHECK (
"UI:win" ==
string{solver.solve (r32,
UIC_WINDOW,
"wigwam")});
195 CHECK (isnil (solver.solve (r33,
UIC_WINDOW,
"wigwam")));
199 CHECK (
"UI:win" ==
string{solver.solve (r34,
UIC_WINDOW,
"wigwam")});
203 CHECK (
"UI:windux" ==
string{solver.solve (r35,
UIC_WINDOW,
"wigwam")});
208 CHECK (
"UI:win[A]" ==
string{solver.solve (r41,
UIC_PERSP,
"x")});
209 CHECK (
"UI:win[A]-x" ==
string{solver.solve (r41,
UIC_PANEL,
"x")});
213 CHECK (
"UI:win[A]" ==
string{solver.solve (r42,
UIC_PERSP,
"x")});
214 CHECK (
"UI:win[A]-x" ==
string{solver.solve (r42,
UIC_PANEL,
"x")});
218 CHECK (isnil (solver.solve (r43,
UIC_PERSP,
"x")));
219 CHECK (isnil (solver.solve (r43,
UIC_PANEL,
"x")));
223 CHECK (
"UI:win[Ω]" ==
string{solver.solve (r44,
UIC_PERSP,
"x")});
224 CHECK (
"UI:win[Ω]-x" ==
string{solver.solve (r44,
UIC_PANEL,
"x")});
228 LocationRule r51{
UICoord(
"firstWindow",
"A",
"thePanel",
"theView",
"#5",
"down",
"the",
"kitchen")};
229 CHECK (
"UI:win[A]-thePanel.theView.#5/down/the/kitchen" ==
string{solver.solve (r51,
UIC_PATH+2,
"drain")});
230 CHECK (
"UI:win[A]-thePanel.theView.#5/down/the/kitchen/drain" ==
string{solver.solve (r51,
UIC_PATH+3,
"drain")});
234 CHECK (
"UI:win[A]-thePanel.theView.#5/down/the/kitchen" ==
string{solver.solve (r52,
UIC_PATH+2,
"drain")});
235 CHECK (
"UI:win[A]-thePanel.theView.#5/down/the/kitchen/drain" ==
string{solver.solve (r52,
UIC_PATH+3,
"drain")});
239 CHECK (isnil (solver.solve (r53,
UIC_PATH+2,
"drain")));
240 CHECK (isnil (solver.solve (r53,
UIC_PATH+3,
"drain")));
244 CHECK (
"UI:win[A]-thePanel.theView.#5/down/the/drain" ==
string{solver.solve (r54,
UIC_PATH+2,
"drain")});
245 CHECK (
"UI:win[A]-thePanel.theView.#5/down/the/drain/drain" ==
string{solver.solve (r54,
UIC_PATH+3,
"drain")});
248 LocationRule r55{
UICoord(
"rearWindow",
"A",
"thePanel",
"theView",
"#5",
"down",
"the",
"kitchen")};
249 CHECK (isnil (solver.solve (r55,
UIC_PATH+2,
"floor")));
250 CHECK (isnil (solver.solve (r55,
UIC_PATH+3,
"floor")));
254 CHECK (
"UI:rearWindow[A]-thePanel.theView.#5/down/the/kitchen" ==
string{solver.solve (r56,
UIC_PATH+2,
"floor")});
255 CHECK (
"UI:rearWindow[A]-thePanel.theView.#5/down/the/kitchen/floor" ==
string{solver.solve (r56,
UIC_PATH+3,
"floor")});
260 CHECK (
"UI:win[A]-thePanel.theView.#5/down/the/kitchen" ==
string{solver.solve (r61,
UIC_PATH+2,
"drain")});
263 CHECK (
"UI:win[A]-thePanel.theView.#5/down/the/kitchen/drain" ==
string{solver.solve (r61,
UIC_PATH+3,
"drain")});
267 CHECK (
"UI:win[A]-thePanel.theView.#5/down/the/kitchen" ==
string{solver.solve (r62,
UIC_PATH+2,
"window")});
270 CHECK (
"UI:win[A]-thePanel.theView.#5/down/the/kitchen/window" ==
string{solver.solve (r62,
UIC_PATH+3,
"window")});
274 CHECK (isnil (solver.solve (r63,
UIC_PATH+2,
"kitchen")));
278 CHECK (
"UI:win[A]-thePanel.theView.#5/down/the/road" ==
string{solver.solve (r64,
UIC_PATH+2,
"drain")});
282 CHECK (isnil (solver.solve (r65,
UIC_PATH+2,
"kitchen")));
286 CHECK (isnil (solver.solve (r66,
UIC_PATH+2,
"kitchen")));
292 CHECK (
"UI:win[A]-thePanel.theView.#5/down/time" ==
string{solver.solve (r71,
UIC_PATH+1,
"time")});
297 CHECK (
"UI:win[A]-thePanel.theView.#5/down/time" ==
string{solver.solve (r72,
UIC_PATH+1,
"time")});
301 r73.append (
UICoord().path(
"down/"));
302 CHECK (
"UI:win[A]-thePanel.theView.#5/up/link" ==
string{solver.solve (r73,
UIC_PATH+1,
"time")});
306 r74.append (
UICoord().path(
"down/"));
307 CHECK (
"UI:win[A]-thePanel.theView.#5/down/time" ==
string{solver.solve (r74,
UIC_PATH+1,
"time")});
312 CHECK (
"UI:win[A]-thePanel.theView.#5/up/time" ==
string{solver.solve (r75,
UIC_PATH+1,
"time")});
317 CHECK (
"UI:win[A]-thePanel.theView.#5/down/link" ==
string{solver.solve (r76,
UIC_PATH+1,
"time")});
322 CHECK (isnil (solver.solve (r77,
UIC_PATH+1,
"time")));
324 CHECK (
string{r77} ==
"=~ .. UI:?/up/link"
325 "\n OR UI:?/town/link create!");
343 std::unique_ptr<GenNodeLocationQuery> query;
356 location.
append (
UICoord().panel(
"asset").view(
"asset").create());
360 cout << location << endl;
368 .set (
"viewer", MakeRec()));
369 CHECK (
"UI:win[edit]-viewer.video" ==
string{solver.solve (location,
UIC_VIEW,
"video")});
376 .set (
"viewer", MakeRec()))
380 .set (
"viewer", MakeRec()));
381 CHECK (
"UI:woe[gloomy]-viewer.video" ==
string{solver.solve (location,
UIC_VIEW,
"video")});
388 .set (
"viewer", MakeRec()))
392 .set (
"timeline", MakeRec()));
393 CHECK (
"UI:win[murky]-viewer.video" ==
string{solver.solve (location,
UIC_VIEW,
"video")});
402 .set(
"timeline", MakeRec()))
408 .set (
"asset", MakeRec())
410 CHECK (
"UI:woe[asset]-panel.asset" ==
string{solver.solve (location,
UIC_VIEW,
"video")});
444 .set (
"asset", MakeRec())
446 auto solution = solver.solve (location,
UIC_TAB,
"video");
447 CHECK (
"UI:win[shady]-asset.asset.video" ==
string{solution});
456 .set(
"timeline", MakeRec()))
460 solution = solver.solve (location,
UIC_VIEW,
"video");
461 CHECK (
"UI:woe[shoddy]-viewer.video" ==
string{solution});
466 solution = solver.solve (location,
UIC_TAB,
"engine");
467 CHECK (
"UI:meta[config]-infobox.inspect.engine" ==
string{solution});
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...
A rule to determine some location by matching against the UI-tree.
Query and mutate UICoord specifications in relation to actual UI topology.
Builder && panel(Literal panelID)
augment UI coordinates to indicate a specific view to be used
LocationClause create()
interprets the current (inline) builder contents as create clause, which has the meaning "create a ne...
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 path(Literal pathDefinition) const
convenience builder function so set a full path definition
Builder persp(Literal perspectiveID) const
Builder panel(Literal panelID) const
static Builder currentWindow()
Builder: start definition of UI-Coordinates rooted in the currentWindow
Service to determine the location of an UI component view.
void verify_cornerCases()
void verify_standardSituations()
void simple_usage_example()
Implementation of the stage::interact::LocationQuery interface to work on a GenNode tree.
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.
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.
A topological addressing scheme to designate structural locations within the UI.
A solver to match incomplete coordinate specifications against the actual UI topology.