48 using LERR_(INDEX_BOUNDS);
80 verify_localPredicates();
88 CHECK (isnil (undef));
90 UICoord uic{
"Γ",
"Δ",
"Θ",
"Ξ",
"Σ",
"Ψ",
"Φ",
"Ω"};
91 CHECK (not isnil (uic));
92 CHECK (8 == uic.size());
94 CHECK (
"Γ-Δ-Θ-Ξ-Σ-Ψ-Φ-Ω" == join(uic,
"-"));
97 CHECK (
"Γ" == uic[UIC_WINDOW]);
98 CHECK (
"Δ" == uic[UIC_PERSP]);
99 CHECK (
"Θ" == uic[UIC_PANEL]);
100 CHECK (
"Ξ" == uic[UIC_VIEW]);
101 CHECK (
"Σ" == uic[UIC_TAB]);
102 CHECK (
"Ψ" == uic[UIC_PATH]);
103 CHECK (
"Φ" == uic[UIC_PATH+1]);
104 CHECK (
"Ω" == uic[UIC_PATH+2]);
107 CHECK (
"Ψ-Φ-Ω" == join(uic.pathSeq(),
"-"));
108 CHECK (
"Ψ/Φ/Ω" == uic.getPath());
113 CHECK (uic[i] == *ii);
119 CHECK (
"UI:Γ[Δ]-Θ.Ξ.Σ/Ψ/Φ/Ω" ==
string(uic));
120 CHECK (
"Γ[Δ]-Θ.Ξ.Σ" == uic.getComp());
121 CHECK (
"Ψ/Φ/Ω" == uic.getPath());
124 uic =
UICoord{
nullptr,
nullptr,
"Θ",
nullptr,
"Σ",
nullptr,
"Φ"};
125 CHECK (7 == uic.size());
128 CHECK (
"UI:?-Θ.*.Σ/*/Φ" ==
string(uic));
129 CHECK (Symbol::EMPTY == uic[UIC_WINDOW]);
130 CHECK (Symbol::EMPTY == uic[UIC_PERSP]);
131 CHECK (
"Θ" == uic[UIC_PANEL]);
132 CHECK (
"*" == uic[UIC_VIEW]);
133 CHECK (
"Σ" == uic[UIC_TAB]);
134 CHECK (
"*" == uic[UIC_PATH]);
135 CHECK (
"Φ" == uic[UIC_PATH+1]);
144 UICoord uic2 = uic1.view(
"view");
145 CHECK (
"UI:window" ==
string(uic1));
146 CHECK (
"UI:window[*]-*.view" ==
string(uic2));
147 CHECK (1 == uic1.size());
148 CHECK (4 == uic2.size());
151 CHECK (
"window" == uic1.getWindow());
152 CHECK (
"window" == uic2.getWindow());
153 CHECK (
"" == uic1.getPersp());
154 CHECK (
"*" == uic2.getPersp());
155 CHECK (
"" == uic1.getPanel());
156 CHECK (
"*" == uic2.getPanel());
157 CHECK (
"" == uic1.getView());
158 CHECK (
"view" == uic2.getView());
159 CHECK (
"" == uic1.getTab());
160 CHECK (
"" == uic2.getTab());
161 CHECK (
"" == uic1.getPath());
162 CHECK (
"" == uic2.getPath());
163 CHECK (
"window" == uic1.getComp());
164 CHECK (
"window[*]-*.view" == uic2.getComp());
171 CHECK (4 == uic3.size());
172 CHECK (
"UI:?.view" ==
string(uic3));
173 CHECK (
"" == uic3.getWindow());
174 CHECK (
"" == uic3.getPersp());
175 CHECK (
"" == uic3.getPanel());
176 CHECK (
"view" == uic3.getView());
179 CHECK (4 == uic4.size());
180 CHECK (
"UI:?[perspective]-*.view" ==
string(uic4));
182 uic4 = uic3.append(
"tab");
183 CHECK (5 == uic4.size());
184 CHECK (
"UI:?.view.tab" ==
string(uic4));
185 uic4 = uic3.prepend(
"panel");
186 CHECK (4 == uic4.size());
187 CHECK (
"UI:?-panel.view" ==
string(uic4));
188 uic4 = uic4.tab(555);
189 CHECK (5 == uic4.size());
190 CHECK (
"UI:?-panel.view.#555" ==
string(uic4));
194 uic4 = uic4.append(
"α/β/γ/δ/ε/λ").truncateTo(9);
195 CHECK (9 == uic4.size());
196 CHECK (
"UI:?-panel.view.#555/α/β/γ/δ" ==
string(uic4));
197 uic4 = uic4.path(
"ε/ε/ε/ε/ε").truncateTo(3);
198 CHECK (3 == uic4.size());
199 CHECK (
"UI:?-panel" ==
string(uic4));
200 uic4 = uic4.append(
"something").truncateTo(2);
201 CHECK (0 == uic4.size());
202 CHECK (
"UI:?" ==
string(uic4));
210 CHECK (
"UI:?" ==
string(uic));
211 CHECK (
"" == uic.getComp());
212 CHECK (
"" == uic.getPath());
214 uic = uic.
path(
"ἁρχή");
215 CHECK (
"UI:?/ἁρχή" ==
string(uic));
216 CHECK (
"" == uic.getComp());
217 CHECK (
"ἁρχή" == uic.getPath());
219 uic = uic.path(
"α/β/γ");
220 CHECK (
"UI:?/α/β/γ" ==
string(uic));
221 CHECK (
"" == uic.getComp());
222 CHECK (
"α/β/γ" == uic.getPath());
224 uic = uic.append(
"δ");
225 CHECK (
"UI:?/α/β/γ/δ" ==
string(uic));
226 CHECK (
"" == uic.getComp());
227 CHECK (
"α/β/γ/δ" == uic.getPath());
229 uic = uic.append(
"");
230 CHECK (
"UI:?/α/β/γ/δ" ==
string(uic));
231 CHECK (
"" == uic.getComp());
232 CHECK (
"α/β/γ/δ" == uic.getPath());
234 uic = uic.append(
"ε/λ/ον");
235 CHECK (
"UI:?/α/β/γ/δ/ε/λ/ον" ==
string(uic));
236 CHECK (
"" == uic.getComp());
237 CHECK (
"α/β/γ/δ/ε/λ/ον" == uic.getPath());
240 CHECK (12 == uic.size());
241 CHECK (Symbol::EMPTY == uic.getView());
242 CHECK (Symbol::EMPTY == uic.getTab());
243 CHECK (Symbol::EMPTY == uic[UIC_WINDOW]);
244 CHECK (Symbol::EMPTY == uic[UIC_PERSP]);
245 CHECK (Symbol::EMPTY == uic[UIC_PANEL]);
246 CHECK (Symbol::EMPTY == uic[UIC_VIEW]);
247 CHECK (Symbol::EMPTY == uic[UIC_TAB]);
248 CHECK (
"α" == uic[UIC_PATH]);
249 CHECK (
"β" == uic[UIC_PATH+1]);
250 CHECK (
"γ" == uic[UIC_PATH+2]);
251 CHECK (
"δ" == uic[UIC_PATH+3]);
252 CHECK (
"ε" == uic[UIC_PATH+4]);
253 CHECK (
"λ" == uic[UIC_PATH+5]);
254 CHECK (
"ον" == uic[UIC_PATH+6]);
256 uic = uic.prepend(
"ειδος");
257 CHECK (
"UI:?.ειδος/α/β/γ/δ/ε/λ/ον" ==
string(uic));
258 CHECK (
"?.ειδος" == uic.getComp());
259 CHECK (
"α/β/γ/δ/ε/λ/ον" == uic.getPath());
260 CHECK (12 == uic.size());
263 CHECK (
"UI:?/α/β/γ/δ/ε/λ/ον" ==
string(uic));
264 CHECK (
"" == uic.getComp());
265 CHECK (
"α/β/γ/δ/ε/λ/ον" == uic.getPath());
267 uic = uic.view(
"ειδος");
268 CHECK (
"UI:?.ειδος.*/α/β/γ/δ/ε/λ/ον" ==
string(uic));
269 CHECK (
"?.ειδος.*" == uic.getComp());
270 CHECK (
"α/β/γ/δ/ε/λ/ον" == uic.getPath());
272 uic = uic.prepend(
"panel");
273 CHECK (
"UI:?-panel.ειδος.*/α/β/γ/δ/ε/λ/ον" ==
string(uic));
274 CHECK (
"?-panel.ειδος.*" == uic.getComp());
275 CHECK (
"α/β/γ/δ/ε/λ/ον" == uic.getPath());
277 uic = uic.view(
nullptr);
278 CHECK (
"UI:?-panel.*.*/α/β/γ/δ/ε/λ/ον" ==
string(uic));
279 CHECK (
"?-panel.*.*" == uic.getComp());
280 CHECK (
"α/β/γ/δ/ε/λ/ον" == uic.getPath());
283 CHECK (
"UI:?-panel.*.#8/α/β/γ/δ/ε/λ/ον" ==
string(uic));
284 CHECK (
"?-panel.*.#8" == uic.getComp());
285 CHECK (
"α/β/γ/δ/ε/λ/ον" == uic.getPath());
288 CHECK (
"UI:?-panel.*/α/β/γ/δ/ε/λ/ον" ==
string(uic));
289 CHECK (
"?-panel.*" == uic.getComp());
290 CHECK (
"α/β/γ/δ/ε/λ/ον" == uic.getPath());
293 CHECK (
"UI:?-panel.*. /α/β/γ/δ/ε/λ/ον" ==
string(uic));
294 CHECK (
"?-panel.*. " == uic.getComp());
295 CHECK (
"α/β/γ/δ/ε/λ/ον" == uic.getPath());
297 uic = uic.prepend(
"perspective");
298 CHECK (
"UI:?[perspective]-panel.*. /α/β/γ/δ/ε/λ/ον" ==
string(uic));
299 CHECK (
"?[perspective]-panel.*. " == uic.getComp());
300 CHECK (
"α/β/γ/δ/ε/λ/ον" == uic.getPath());
302 uic = uic.prepend(
"win");
303 CHECK (
"UI:win[perspective]-panel.*. /α/β/γ/δ/ε/λ/ον" ==
string(uic));
304 CHECK (
"win[perspective]-panel.*. " == uic.getComp());
305 CHECK (
"α/β/γ/δ/ε/λ/ον" == uic.getPath());
308 CHECK (
"UI:win[*]-panel.*. /α/β/γ/δ/ε/λ/ον" ==
string(uic));
309 CHECK (
"win[*]-panel.*. " == uic.getComp());
310 CHECK (
"α/β/γ/δ/ε/λ/ον" == uic.getPath());
311 CHECK (12 == uic.size());
314 CHECK (
"UI:win[*]-panel.*. / " ==
string(uic));
315 CHECK (
"win[*]-panel.*. " == uic.getComp());
316 CHECK (
" " == uic.getPath());
317 CHECK (6 == uic.size());
318 CHECK (
" " == uic[UIC_PATH]);
321 uic = uic.path(
nullptr);
322 CHECK (
"UI:win[*]-panel.*. " ==
string(uic));
323 CHECK (
"win[*]-panel.*. " == uic.getComp());
324 CHECK (
"" == uic.getPath());
325 CHECK (5 == uic.size());
328 uic = uic.append(
nullptr);
329 CHECK (
"UI:win[*]-panel.*. " ==
string(uic));
330 CHECK (
"win[*]-panel.*. " == uic.getComp());
331 CHECK (
"" == uic.getPath());
332 CHECK (5 == uic.size());
334 uic = uic.append(
"*");
335 CHECK (
"UI:win[*]-panel.*. " ==
string(uic));
336 CHECK (
"win[*]-panel.*. " == uic.getComp());
337 CHECK (
"" == uic.getPath());
338 CHECK (5 == uic.size());
340 uic = uic.append(
"**");
341 CHECK (
"UI:win[*]-panel.*. /**" ==
string(uic));
342 CHECK (
"win[*]-panel.*. " == uic.getComp());
343 CHECK (
"**" == uic.getPath());
344 CHECK (
"**" == uic[UIC_PATH]);
345 CHECK (6 == uic.size());
348 CHECK (
"UI:win[*]-panel.*.*/**" ==
string(uic));
349 CHECK (
"win[*]-panel.*.*" == uic.getComp());
350 CHECK (
"**" == uic.getPath());
351 CHECK (6 == uic.size());
354 CHECK (
"UI:win[*]-panel" ==
string(uic));
355 CHECK (
"win[*]-panel" == uic.getComp());
356 CHECK (
"" == uic.getPath());
357 CHECK (3 == uic.size());
364 UICoord u1 {
"Γ",
"Δ",
"Θ",
"Ξ",
"Σ",
"Ψ",
"Φ" };
365 UICoord u11{
"Γ",
"Δ",
"Θ",
"Ξ",
"Σ",
"Ψ",
"Φ",
"Ω"};
366 UICoord u2 {
"Γ",
"Δ",
"Θ",
"Σ",
"Ξ",
"Ψ",
"Φ",
"Ω"};
376 CHECK (u1 ==
UICoord(
"Γ",
"Δ",
"Θ",
"Ξ",
"Σ",
"Ψ",
"Φ" ));
377 CHECK (u1 ==
UICoord(
"Γ",
"Δ",
"Θ",
"Ξ",
"Σ",
"Ψ",
"Φ",
"" ));
378 CHECK (
UICoord(
"Γ",
"Δ",
"Θ",
"Ξ",
"Σ",
"Ψ",
"Φ",
nullptr) ==
UICoord(
"Γ",
"Δ",
"Θ",
"Ξ",
"Σ",
"Ψ",
"Φ"));
380 CHECK (u11 == u1.path(
"Ψ/Φ/Ω//"));
381 CHECK (u11 != u1.path(
"//Ψ/Φ/Ω"));
387 CHECK (not (u1 < u11));
388 CHECK (not (u1 < u1 ));
389 CHECK (not (u1 < u2 ));
390 CHECK (not (u11 < u2 ));
393 CHECK (u11 < u1.view(
"*").window(NULL));
398 verify_localPredicates()
401 UICoord u1 {
"",
"",
"",
"Ξ",
"Σ"};
402 UICoord u2 {
"Γ",
"*",
"Θ",
"Ξ",
"Σ"};
403 UICoord u3 {
"Γ",
"Δ",
"Θ",
"Ξ",
"Σ"};
405 CHECK (not u1.isComplete());
406 CHECK (not u1.isExplicit());
408 CHECK ( u2.isComplete());
409 CHECK (not u2.isExplicit());
411 CHECK ( u3.isComplete());
412 CHECK ( u3.isExplicit());
414 CHECK (u1.isIncomplete());
416 CHECK (not nil.isComplete());
419 CHECK (not u1.isPresent(UIC_WINDOW));
420 CHECK (not u1.isPresent(UIC_PERSP));
421 CHECK (not u1.isPresent(UIC_PANEL));
422 CHECK ( u1.isPresent(UIC_VIEW));
423 CHECK ( u1.isPresent(UIC_TAB));
424 CHECK (not u1.isPresent(UIC_PATH));
425 CHECK (not u1.isPresent(UIC_PATH+1));
427 CHECK ( u2.isPresent(UIC_WINDOW));
428 CHECK (not u2.isPresent(UIC_PERSP));
429 CHECK ( u2.isPresent(UIC_PANEL));
430 CHECK ( u2.isPresent(UIC_VIEW));
431 CHECK ( u2.isPresent(UIC_TAB));
432 CHECK (not u2.isPresent(UIC_PATH));
433 CHECK (not u2.isPresent(UIC_PATH+1));
435 CHECK ( u3.isPresent(UIC_WINDOW));
436 CHECK ( u3.isPresent(UIC_PERSP));
437 CHECK ( u3.isPresent(UIC_PANEL));
438 CHECK ( u3.isPresent(UIC_VIEW));
439 CHECK ( u3.isPresent(UIC_TAB));
440 CHECK (not u3.isPresent(UIC_PATH));
441 CHECK (not u3.isPresent(UIC_PATH+1));
443 CHECK (not u2.isWildcard(UIC_WINDOW));
444 CHECK ( u2.isWildcard(UIC_PERSP));
445 CHECK (not u2.isWildcard(UIC_PANEL));
446 CHECK (not u2.isWildcard(UIC_VIEW));
447 CHECK (not u2.isWildcard(UIC_TAB));
448 CHECK (not u2.isWildcard(UIC_PATH));
449 CHECK (not u2.isWildcard(UIC_PATH+1));
Describe a location within the UI through structural/topological coordinates.
Builder persp(Literal perspectiveID) const
Builder path(Literal pathDefinition) const
convenience builder function so set a full path definition
#define VERIFY_ERROR(ERROR_ID, ERRONEOUS_STATEMENT)
Macro to verify that a statement indeed raises an exception.
Token or Atom with distinct identity.
Simple test class runner.
Lumiera GTK UI implementation root.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
A topological addressing scheme to designate structural locations within the UI.
A collection of frequently used helper functions to support unit testing.
static Builder window(Literal windowID)
Builder: start definition of UI-Coordinates rooted in given window.
bool isIncomplete() const
Adapter for building an implementation of the »Lumiera Forward Iterator« concept. ...