88 #ifndef STAGE_INTERACT_VIEW_SPEC_DSL_H 89 #define STAGE_INTERACT_VIEW_SPEC_DSL_H 100 #include <functional> 120 using Locator = std::function<UICoord(Literal)>;
133 template<
size_t depth>
144 return locationSolver().solve (rules_, depth, componentID);
146 , rules_{move (ruleToDetermineLocation)}
154 UICoord{std::move (simpleLocationSpec)}}}}
157 operator string()
const 159 return string{rules_};
195 template<
typename... ARGS>
197 :
public std::function<Allocator(ARGS&&...)>
211 using lib::meta::func::_Sig;
214 typedef typename _Fun<FUN>::Ret Ret;
215 typedef typename _Fun<FUN>::Args Args;
216 typedef typename Split<Args>::Head Arg1;
217 typedef typename Split<Args>::Tail FurtherArgs;
219 static_assert (std::is_convertible<UICoord, Arg1>::value,
220 "Allocator function must accept UICoordinates (where to create/locate) as first argument");
221 static_assert (std::is_convertible<Ret, UICoord>::value,
222 "Allocator function must produce UICoordinates (of the actually allocated UI element)");
223 static_assert (std::is_convertible<FurtherArgs, Types<ARGS...>>::value,
224 "Additional parameters of the allocator function must match the AllocSpec<ARGS> template parameters");
227 using ArgTuple = Tuple<FurtherArgs>;
231 ArgTuple params {forward<decltype(args)> (args)...};
232 return PApply<FUN,FurtherArgs>::bindBack (fun, params);
240 : std::function<
Allocator(ARGS&&...)> {buildPartialApplicator (forward<FUN> (fun))}
260 static_assert (not
sizeof(V),
"unknown generic view type");
std::function< UICoord(UICoord)> Allocator
Allocator is a functor to resolve a given, desired location of a view within the UI, resulting in creation or allocation of the view – which happens as side-effect. The result of this invocation are the UI coordinates of an existing or newly created view.
Describe a location within the UI through structural/topological coordinates.
typename BuildTupleType< TYPES >::Type Tuple
Build a std::tuple from types given as type sequence.
static auto buildPartialApplicator(FUN &&fun)
Generic Component View descriptors.
inline string literal This is a marker type to indicate that
A specification to describe the desired location of a component view within the Lumiera UI...
Partial function application and building a complete function closure.
Access point to singletons and other kinds of dependencies designated by type.
Metaprogramming with tuples-of-types and the std::tuple record.
Descriptor< VIEW > & viewSpec()
Access point: Factory for "view specs".
A single location specification to be matched and fulfilled.
Metaprogramming tools for transforming functor types.
Marker types to indicate a literal string and a Symbol.
Lumiera GTK UI implementation root.
A topological addressing scheme to designate structural locations within the UI.
A solver to match incomplete coordinate specifications against the actual UI topology.
Singleton services and Dependency Injection.
Lumiera error handling (C++ interface).
A rule to determine some location by matching against the UI-tree.
LocatorSpec(UICoord::Builder &&simpleLocationSpec)
shortcut to allow initialisation from UI-Coordinate builder expression
std::function< UICoord(Literal)> Locator
Locator is a functor to resolve to a topological location in the UI-tree.
LocatorSpec< UIC_VIEW > ViewSpec
A specification to describe the desired location of a component view within the Lumiera UI...
A specification to describe the strategy for allocating (placing, retrieving) a component view...