97 #ifndef STAGE_INTERACT_VIEW_SPEC_DSL_H 98 #define STAGE_INTERACT_VIEW_SPEC_DSL_H 109 #include <functional> 129 using Locator = std::function<UICoord(Literal)>;
142 template<
size_t depth>
153 return locationSolver().solve (rules_, depth, componentID);
155 , rules_{move (ruleToDetermineLocation)}
163 UICoord{std::move (simpleLocationSpec)}}}}
166 operator string()
const 168 return string{rules_};
204 template<
typename... ARGS>
206 :
public std::function<Allocator(ARGS&&...)>
220 using lib::meta::func::_Sig;
223 typedef typename _Fun<FUN>::Ret Ret;
224 typedef typename _Fun<FUN>::Args Args;
225 typedef typename Split<Args>::Head Arg1;
226 typedef typename Split<Args>::Tail FurtherArgs;
228 static_assert (std::is_convertible<UICoord, Arg1>::value,
229 "Allocator function must accept UICoordinates (where to create/locate) as first argument");
230 static_assert (std::is_convertible<Ret, UICoord>::value,
231 "Allocator function must produce UICoordinates (of the actually allocated UI element)");
232 static_assert (std::is_convertible<FurtherArgs, Types<ARGS...>>::value,
233 "Additional parameters of the allocator function must match the AllocSpec<ARGS> template parameters");
236 using ArgTuple = Tuple<FurtherArgs>;
240 ArgTuple params {forward<decltype(args)> (args)...};
241 return PApply<FUN,FurtherArgs>::bindBack (fun, params);
249 : std::function<
Allocator(ARGS&&...)> {buildPartialApplicator (forward<FUN> (fun))}
269 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...