LocationQuery: compensate for the special representation of perspective info
this assymetry in representation was introduced deliberately, to test the design's ability to cope with such complications
This commit is contained in:
parent
c39442a287
commit
800407637a
3 changed files with 97 additions and 5 deletions
|
|
@ -179,17 +179,42 @@ namespace interact {
|
||||||
return lib::transform (node.keys(), internedString);
|
return lib::transform (node.keys(), internedString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static Rec const&
|
static Rec const&
|
||||||
drillDown (Rec const& tree, UICoord const& path, size_t maxDepth, size_t& depth)
|
drillDown (Rec const& tree, UICoord const& path, size_t maxDepth, size_t& depth)
|
||||||
{
|
{
|
||||||
if (depth<maxDepth and path.isPresent(depth))
|
if (depth<maxDepth and path.isPresent(depth))
|
||||||
{
|
{
|
||||||
const char* pathElm = path[depth];
|
const char* pathElm = path[depth];
|
||||||
if (tree.hasAttribute(pathElm))
|
if (hasNode(tree, pathElm, depth))
|
||||||
return drillDown (tree.get(pathElm).data.get<Rec>(), path, maxDepth, ++depth);
|
{
|
||||||
|
++depth;
|
||||||
|
return drillDown (descendInto(tree,pathElm,depth), path, maxDepth, depth);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return tree;
|
return tree;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** does the guiding tree contain the element as requested by the UICoord path?
|
||||||
|
* @remark this function abstracts a special asymmetry of the tree representation:
|
||||||
|
* at `level==UIC_PERSP` (level 2), the perspective info is packed into the type
|
||||||
|
* meta attribute. This was done on purpose, to verify our design is able to
|
||||||
|
* handle such implementation intricacies, which we expect to encounter
|
||||||
|
* when navigating the widgets of a real-world UI toolkit set
|
||||||
|
*/
|
||||||
|
static bool
|
||||||
|
hasNode (Rec const& tree, const char* pathElm, size_t depth)
|
||||||
|
{
|
||||||
|
return depth==UIC_PERSP? pathElm == tree.getType()
|
||||||
|
: tree.hasAttribute(pathElm);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Rec const&
|
||||||
|
descendInto (Rec const& tree, const char* pathElm, size_t depth)
|
||||||
|
{
|
||||||
|
return depth==UIC_PERSP? tree // perspective info is attached as type at the parent node
|
||||||
|
: tree.get(pathElm).data.get<Rec>();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ namespace interact {
|
||||||
|
|
||||||
|
|
||||||
/** evaluate to what extent a UIcoord spec matches the actual UI
|
/** evaluate to what extent a UIcoord spec matches the actual UI
|
||||||
* @return the depth to which the given spec is _"covered"_ by the actual UI
|
* @return the depth to which the given spec is _"covered"_ by the actual UI.
|
||||||
* Can be zero, in which case the given coordinates can not be resolved
|
* Can be zero, in which case the given coordinates can not be resolved
|
||||||
* and addressed within the currently existing windows, panes and views.
|
* and addressed within the currently existing windows, panes and views.
|
||||||
* @note this operation does not perform any _resolution_ or interpolation of wildcards,
|
* @note this operation does not perform any _resolution_ or interpolation of wildcards,
|
||||||
|
|
|
||||||
|
|
@ -4577,7 +4577,7 @@
|
||||||
</node>
|
</node>
|
||||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1506984645747" ID="ID_517262443" MODIFIED="1508625810426" TEXT="verify_backingQuery">
|
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1506984645747" ID="ID_517262443" MODIFIED="1508625810426" TEXT="verify_backingQuery">
|
||||||
<icon BUILTIN="pencil"/>
|
<icon BUILTIN="pencil"/>
|
||||||
<node CREATED="1508809610790" ID="ID_1860790851" MODIFIED="1509142631190" TEXT="Builder-Syntax war falsch">
|
<node CREATED="1508809610790" FOLDED="true" ID="ID_1860790851" MODIFIED="1509145537374" TEXT="Builder-Syntax war falsch">
|
||||||
<icon BUILTIN="button_ok"/>
|
<icon BUILTIN="button_ok"/>
|
||||||
<node CREATED="1508809620762" ID="ID_236111511" MODIFIED="1508809630860" TEXT="muß die Attribute-Collection nutzen"/>
|
<node CREATED="1508809620762" ID="ID_236111511" MODIFIED="1508809630860" TEXT="muß die Attribute-Collection nutzen"/>
|
||||||
<node CREATED="1508809631448" ID="ID_956153388" MODIFIED="1508809644482" TEXT="Builder wohl noch nie für diesen Fall verwendet"/>
|
<node CREATED="1508809631448" ID="ID_956153388" MODIFIED="1508809644482" TEXT="Builder wohl noch nie für diesen Fall verwendet"/>
|
||||||
|
|
@ -4617,7 +4617,74 @@
|
||||||
<icon BUILTIN="ksmiletris"/>
|
<icon BUILTIN="ksmiletris"/>
|
||||||
</node>
|
</node>
|
||||||
</node>
|
</node>
|
||||||
<node CREATED="1509142651113" ID="ID_99734013" MODIFIED="1509142657805" TEXT="Spezialbehandlung Perspektive"/>
|
<node CREATED="1509142651113" ID="ID_99734013" MODIFIED="1509145529638">
|
||||||
|
<richcontent TYPE="NODE"><html>
|
||||||
|
<head>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>
|
||||||
|
Spezialbehandlung
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Perspektive
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
</richcontent>
|
||||||
|
<icon BUILTIN="button_ok"/>
|
||||||
|
<node CREATED="1509143055036" ID="ID_810015478" MODIFIED="1509143099748" TEXT="absichtlich unorthogonal repräsentiert">
|
||||||
|
<richcontent TYPE="NOTE"><html>
|
||||||
|
<head>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>
|
||||||
|
...um zu prüfen, ob das allgemeine Design
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
mit solchen Asymetrien umgehen kann,
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
welche ziemlich sicher noch viel mehr
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
bei der Navigation in einem realen GUI auftreten
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
</richcontent>
|
||||||
|
</node>
|
||||||
|
<node CREATED="1509143404342" ID="ID_708195081" MODIFIED="1509143411493" TEXT="drillDown aufbohren">
|
||||||
|
<icon BUILTIN="ksmiletris"/>
|
||||||
|
<node CREATED="1509143431491" ID="ID_1535839304" MODIFIED="1509143436685" TEXT="Pfad normal weiterverarbeiten"/>
|
||||||
|
<node CREATED="1509143437202" ID="ID_1489524396" MODIFIED="1509143442917" TEXT="aber Abstieg im Baum manipulieren"/>
|
||||||
|
</node>
|
||||||
|
<node CREATED="1509143453151" ID="ID_373632759" MODIFIED="1509143457604" TEXT="speziell...">
|
||||||
|
<node CREATED="1509143459519" ID="ID_1727095948" MODIFIED="1509143468809" TEXT="existenz-Check läuft anders">
|
||||||
|
<node CREATED="1509143492194" ID="ID_835507213" MODIFIED="1509143513852" TEXT="getType und stringvergleich"/>
|
||||||
|
<node CREATED="1509143514352" ID="ID_730111393" MODIFIED="1509143519963" TEXT="statt hasAttribute"/>
|
||||||
|
</node>
|
||||||
|
<node CREATED="1509143469429" ID="ID_1414723485" MODIFIED="1509143481984" TEXT="keinen Abstiegs-Schritt machen"/>
|
||||||
|
</node>
|
||||||
|
<node CREATED="1509143542611" ID="ID_114168871" MODIFIED="1509143583963" TEXT="Schwein gehabt, rekursiv programmiert">
|
||||||
|
<richcontent TYPE="NOTE"><html>
|
||||||
|
<head>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>
|
||||||
|
...und ich hab mir letzte Woche noch solche Vorwürfe gemacht,
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
daß ich mich wieder mal "akademisch" verspielt habe.... :-P
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
</richcontent>
|
||||||
|
<icon BUILTIN="ksmiletris"/>
|
||||||
|
</node>
|
||||||
|
</node>
|
||||||
</node>
|
</node>
|
||||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1506984645748" ID="ID_1254044275" MODIFIED="1506984664457" TEXT="verify_queryAnchor">
|
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1506984645748" ID="ID_1254044275" MODIFIED="1506984664457" TEXT="verify_queryAnchor">
|
||||||
<icon BUILTIN="flag-yellow"/>
|
<icon BUILTIN="flag-yellow"/>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue