diff --git a/src/gui/interact/ui-coord.hpp b/src/gui/interact/ui-coord.hpp index dca841317..8321f5e08 100644 --- a/src/gui/interact/ui-coord.hpp +++ b/src/gui/interact/ui-coord.hpp @@ -62,6 +62,7 @@ namespace interact { // using std::unique_ptr; // using std::string; + using lib::Literal; // class GlobalCtx; @@ -78,9 +79,44 @@ namespace interact { { public: + static UICoord + currentWindow() + { + UNIMPLEMENTED ("UI coordinate builder function to indicate coordinates rooted within the current window"); + } + + UICoord + view (Literal viewID) const + { + UNIMPLEMENTED ("augment UI coordinates to indicate a specific view to be used"); + } + + UICoord + tab (Literal tabID) const + { + UNIMPLEMENTED ("augment UI coordinates to indicate a specific tab within the view"); + } + + UICoord + tab (uint tabIdx) const + { + UNIMPLEMENTED ("augment UI coordinates to indicate a tab specified by index number"); + } private: + public: + friend bool + operator== (UICoord const& l, UICoord const& r) + { + UNIMPLEMENTED ("equality of UI coordinates"); + } + + friend bool + operator!= (UICoord const& l, UICoord const& r) + { + return not (l == r); + } }; diff --git a/src/gui/interact/view-spec-dsl.hpp b/src/gui/interact/view-spec-dsl.hpp index 7d36781d2..0157d1dde 100644 --- a/src/gui/interact/view-spec-dsl.hpp +++ b/src/gui/interact/view-spec-dsl.hpp @@ -95,8 +95,10 @@ #include "lib/error.hpp" #include "lib/symbol.hpp" +#include "gui/interact/ui-coord.hpp" //#include +#include //#include //#include @@ -112,20 +114,53 @@ namespace interact { /** - * A specification to describe the desired location of a - * component view within the Lumiera UI. + * A specification to describe the desired location of a component view within the Lumiera UI. + * ViewSpec is basically a set of [UI coordinates](\ref UICoord), with the additional possibility + * of specifying several alternatives, with the intention to pick the first applicable one. * * @todo initial draft as of 9/2017 */ - class LocationSpec + class ViewSpec { public: + ViewSpec(UICoord coordinates) + { + UNIMPLEMENTED ("build a view spec from explicitly given UI coordinates"); + } + operator UICoord() + { + UNIMPLEMENTED ("resolve a view spec to yield explicit UI coordinates"); + } private: }; + /** + * Allocator is a functor to resolve a given, desired location of a view within the UI, resulting + * in creation or allocation of the view. The result of this invocation are the UI coordinates + * of an existing or newly created view. + */ + class Allocator + : public std::function + { + + }; + + + template + class AllocSpec + : public std::function + { + public: + template + AllocSpec(FUN fun) + { + UNIMPLEMENTED ("generate an allocator builder functor by partial function application"); + } + }; + }}// namespace gui::interact #endif /*GUI_INTERACT_VIEW_SPEC_DSL_H*/ diff --git a/tests/gui/interact/view-spec-dsl-test.cpp b/tests/gui/interact/view-spec-dsl-test.cpp index 14b5e3a9c..a73f119e0 100644 --- a/tests/gui/interact/view-spec-dsl-test.cpp +++ b/tests/gui/interact/view-spec-dsl-test.cpp @@ -112,7 +112,7 @@ namespace test { UICoord realView2 = alloc(targetLocation); CHECK (2 == allocCounter); CHECK (realView2 == UICoord::currentWindow().view("viewID").tab("2")); - CHECK (realView2 != realView); + CHECK (realView2 != realView1); UICoord realView3 = alloc(targetLocation); CHECK (3 == allocCounter);