UI-Coordinates: stub to pass compilation
This commit is contained in:
parent
c1f240687b
commit
feb8414016
3 changed files with 75 additions and 4 deletions
|
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -95,8 +95,10 @@
|
|||
|
||||
#include "lib/error.hpp"
|
||||
#include "lib/symbol.hpp"
|
||||
#include "gui/interact/ui-coord.hpp"
|
||||
|
||||
//#include <boost/noncopyable.hpp>
|
||||
#include <functional>
|
||||
//#include <string>
|
||||
//#include <memory>
|
||||
|
||||
|
|
@ -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<UICoord(UICoord)>
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
|
||||
template<typename PAR>
|
||||
class AllocSpec
|
||||
: public std::function<Allocator(PAR)>
|
||||
{
|
||||
public:
|
||||
template<class FUN>
|
||||
AllocSpec(FUN fun)
|
||||
{
|
||||
UNIMPLEMENTED ("generate an allocator builder functor by partial function application");
|
||||
}
|
||||
};
|
||||
|
||||
}}// namespace gui::interact
|
||||
#endif /*GUI_INTERACT_VIEW_SPEC_DSL_H*/
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue