29 #ifndef STAGE_TIMELINE_TRACK_PROFILE_H 30 #define STAGE_TIMELINE_TRACK_PROFILE_H 57 virtual void ruler(uint h) =0;
58 virtual void gap(uint h) =0;
59 virtual void content(uint h) =0;
60 virtual void open() =0;
61 virtual void close(uint n) =0;
63 virtual void coda(uint pad) =0;
65 static const size_t MAX_ARG_SIZE =
sizeof(size_t);
81 using Elements = std::vector<SlopeVerb>;
84 int pinnedPrefixCnt = 0;
92 return elements.empty();
104 for (
auto& slopeVerb : elements)
105 slopeVerb.applyTo (interpreter);
114 template<
typename FUN,
typename...ARGS>
116 append (FUN&& handler,
Literal token, ARGS&&... params)
118 elements.emplace_back (forward<FUN>(handler), token, forward<ARGS>(params)...);
121 #define TOKEN_BUILDER(_TOK_) \ 122 template<typename...ARGS> \ 124 append_ ## _TOK_ (ARGS&&... params)\ 126 this->append (&ProfileInterpreter::_TOK_, STRINGIFY(_TOK_), forward<ARGS>(params)...); \ 130 TOKEN_BUILDER (
ruler)
134 TOKEN_BUILDER (
close)
147 if (lastEntryIs(
"close"))
148 incrementLastCloseSlope();
154 getPrecedingSlopeUp()
156 if (lastEntryIs(
"close"))
157 return elements.back().accessArg<uint>();
164 pinnedPrefixCnt = elements.size();
169 lastEntryIs (
Literal expectedToken)
171 return not isnil(elements)
172 and elements.back()->getID() == expectedToken;
176 incrementLastCloseSlope()
178 REQUIRE (lastEntryIs (
"close"));
179 uint& slopeDepth = elements.back().accessArg<uint>();
185 filterSegment(
bool selectPrefixPart)
187 struct CountingFilter
195 bool isPrefixPart = 0 < cnt--;
196 return selectPrefix? isPrefixPart : not isPrefixPart;
202 .filter (CountingFilter{pinnedPrefixCnt, selectPrefixPart});
223 for (
auto& slopeVerb : filterSegment(isRulerSegment))
224 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