diff --git a/src/gui/interact/ui-location-solver.hpp b/src/gui/interact/ui-location-solver.hpp index a9135815d..4ab7366aa 100644 --- a/src/gui/interact/ui-location-solver.hpp +++ b/src/gui/interact/ui-location-solver.hpp @@ -65,13 +65,16 @@ namespace interact { : boost::noncopyable { UICoord pattern_; + bool createParents_; public: - LocationClause (UICoord && locationPattern) + LocationClause (UICoord && locationPattern, bool createParents =false) : pattern_{move (locationPattern)} + , createParents_{createParents} { } LocationClause (LocationClause && rr) : pattern_{move (rr.pattern_)} + , createParents_{rr.createParents_} { } }; @@ -87,12 +90,46 @@ namespace interact { public: LocationRule (UICoord && firstRule) : clauses_{} - { - clauses_.emplace_back (move (firstRule)); + { + this->append (move (firstRule)); + } + LocationRule (LocationRule && rr) + : clauses_{move (rr.clauses_)} + { } + + + LocationRule&& + append (UICoord && furtherRule) + { + clauses_.emplace_back (move (furtherRule)); + return move (*this); } }; + /** DSL operator to assemble a sequence of clauses. + * Introduced solely for the purpose of writing location specifications within the + * [ViewSpec-DSL](\ref id-scheme.hpp), this operator acts on several UI-Coordinate specs + * to create a sequence of clauses, to be checked against the currently existing UI topology, + * in the given order, ranging from more specific to more general patterns. + */ + inline LocationRule + operator or (UICoord::Builder && firstRule, UICoord secondRule) + { + return LocationRule{move (firstRule)} + .append (move (secondRule)); + } + + inline LocationRule&& + operator or (LocationRule && ruleSet, UICoord furtherRule) + { + ruleSet.append (move (furtherRule)); + return move(ruleSet); + } + + + + /** * Access or allocate a UI component view * diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 8ed33bd42..a5ea3cfcf 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -9955,6 +9955,48 @@ + + + + + + + + + + + + + + + + + + + + +

+ Komma heißt "and then" in der Logikprogrammierung +

+ + +
+ +
+
+ + + + + + + + + + + + +
@@ -11039,8 +11081,19 @@ - - + + + + + + +

+ was hier vielleicht der Fall sein könnte +

+ + +
+
@@ -11064,6 +11117,41 @@
+ + + + + + + + + +

+ wir haben nicht einfach UI-Coordinaten als DSl-Elemente, +

+

+ sondern einzelne Klauseln, die allerdings jeweils eine UI-Coord wrappen. +

+

+ +

+

+ Wenn man jedoch, rein syntaktisch zu schreiben beginnt "UICoord::window()" +

+

+ dann bekommt man einen UICoord::Builder  und das ist noch keine Klausel! +

+ + +
+ +
+ + + + + +