38 #ifndef STAGE_TIMELINE_TRACK_PROFILE_H 39 #define STAGE_TIMELINE_TRACK_PROFILE_H 66 virtual void ruler(uint h) =0;
67 virtual void gap(uint h) =0;
68 virtual void content(uint h) =0;
69 virtual void open() =0;
70 virtual void close(uint n) =0;
72 virtual void coda(uint pad) =0;
74 static const size_t MAX_ARG_SIZE =
sizeof(size_t);
90 using Elements = std::vector<SlopeVerb>;
93 int pinnedPrefixCnt = 0;
101 return elements.empty();
113 for (
auto& slopeVerb : elements)
114 slopeVerb.applyTo (interpreter);
123 template<
typename FUN,
typename...ARGS>
125 append (FUN&& handler,
Literal token, ARGS&&... params)
127 elements.emplace_back (forward<FUN>(handler), token, forward<ARGS>(params)...);
130 #define TOKEN_BUILDER(_TOK_) \ 131 template<typename...ARGS> \ 133 append_ ## _TOK_ (ARGS&&... params)\ 135 this->append (&ProfileInterpreter::_TOK_, STRINGIFY(_TOK_), forward<ARGS>(params)...); \ 139 TOKEN_BUILDER (
ruler)
143 TOKEN_BUILDER (
close)
156 if (lastEntryIs(
"close"))
157 incrementLastCloseSlope();
163 getPrecedingSlopeUp()
165 if (lastEntryIs(
"close"))
166 return elements.back().accessArg<uint>();
173 pinnedPrefixCnt = elements.size();
178 lastEntryIs (
Literal expectedToken)
180 return not isnil(elements)
181 and elements.back()->getID() == expectedToken;
185 incrementLastCloseSlope()
187 REQUIRE (lastEntryIs (
"close"));
188 uint& slopeDepth = elements.back().accessArg<uint>();
194 filterSegment(
bool selectPrefixPart)
196 struct CountingFilter
204 bool isPrefixPart = 0 < cnt--;
205 return selectPrefix? isPrefixPart : not isPrefixPart;
211 .filter (CountingFilter{pinnedPrefixCnt, selectPrefixPart});
232 for (
auto& slopeVerb : filterSegment(isRulerSegment))
233 slopeVerb.applyTo (interpreter);
virtual void open()=0
indicate entering a nested structure, typically as 3D inset
IterQueue< T > elements(T const &elm)
convenience free function to build an iterable sequence
auto explore(IT &&srcSeq)
start building a IterExplorer by suitably wrapping the given iterable source.
virtual void content(uint h)=0
represent a content area with the given vertical extension
A self-contained token to embody a specific yet abstracted operation, together with a concrete set of...
inline string literal This is a marker type to indicate that
virtual void close(uint n)=0
indicate the end of n nested structures, typically by ascending back n levels
virtual ~ProfileInterpreter()
this is an interface
virtual void prelude()=0
start the track presentation at top of the timeline
Marker types to indicate a literal string and a Symbol.
Description of the structure and arrangement of tracks for display in the UI.
A specific double dispatch variation for function invocation.
Lumiera GTK UI implementation root.
virtual void gap(uint h)=0
represent a gap to structure the display
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
virtual void coda(uint pad)=0
closing part of the timeline below track display, with pad additional padding
Building tree expanding and backtracking evaluations within hierarchical scopes.
A set of basic GTK includes for the UI.
virtual void ruler(uint h)=0
represent an overview/ruler track with the given height