87#ifndef STAGE_TIMELINE_TRACK_PRESENTER_H
88#define STAGE_TIMELINE_TRACK_PRESENTER_H
115 using std::unique_ptr;
116 using std::make_unique;
120 using lib::diff::collection;
147 hook (WID& widget,
int xPos=0,
int yPos=0)
override
153 move (WID& widget,
int xPos,
int yPos)
override
190 using PFork = unique_ptr<TrackPresenter>;
191 using PClip = unique_ptr<ClipPresenter>;
192 using PMark = unique_ptr<MarkerWidget>;
215 int hookAdjY (
int yPos)
override {
return yPos +
body_.getContentOffsetY(); };
233 head_.setTrackName (name);
234 body_.setTrackName (name);
237 vector<unique_ptr<RulerTrack>>&
240 return body_.bindRulers();
270 : Controller{id, nexus}
319 .isApplicableIf ([&](
GenNode const& spec) ->
bool
321 return TYPE_Ruler == spec.data.recordType();
325 return make_unique<RulerTrack> (spec.idi, this->uiBus_, *this);
328 .isApplicableIf ([&](
GenNode const& spec) ->
bool
334 return make_unique<MarkerWidget> (spec.
idi, this->uiBus_);
336 .attach (collection(
clips_)
337 .isApplicableIf ([&](
GenNode const& spec) ->
bool
347 .isApplicableIf ([&](
GenNode const& spec) ->
bool
353 return make_unique<TrackPresenter> (spec.
idi,
uiBus_, this->display_);
370 subTrack->establishLayout (displayEvaluation);
380 subTrack->completeLayout (displayEvaluation);
398 uint maxVSize = max (explore (clips)
399 .transform([](
PClip const& clip)
401 return clip->determineRequiredVerticalExtension();
403 maxVSize = max (maxVSize,
head_.getContentHeight());
404 this->
body_.accommodateContentHeight (maxVSize);
405 this->
head_.accommodateContentHeight (maxVSize);
442 uint contentHeight =
body_.calcContentHeight();
443 uint overallHeight = contentHeight +
body_.calcSubtrackHeight();
444 head_.syncSubtrackStartHeight (contentHeight);
445 head_.accommodateOverallHeight (overallHeight);
A handle to allow for safe »remote implantation« of an unknown subclass into a given opaque InPlaceBu...
SUB & emplace(SUB &&implementation)
move-construct an instance of a subclass into the opaque buffer
string recordType() const
peek into the type field of a nested Record<GenNode>
Customisable intermediary to abstract mutating operations on arbitrary, hierarchical object-like data...
static Builder< TreeMutator > build()
DSL: start building a custom adapted tree mutator, where the operations are tied by closures or wrapp...
A time interval anchored at a specific point in time.
connection point at the UI-Bus.
Interface to represent _"some presentation layout entity",_ with the ability to place widgets (manage...
Mix-in interface to allow for concrete CanvasHooked widgets to adapt themselves to the metric current...
void mark(GenNode const &)
generic handler for all incoming "state mark" messages
Interface to represent _"some presentation layout entity",_ with the ability to attach widgets (manag...
A widget attached onto a display canvas or similar central presentation context.
Visitor and state holder for a collaborative layout adjustment pass.
bool isCollectPhase() const
Reference frame to organise the presentation related to a specific Track in the Timeline-GUI.
int hookAdjY(int yPos) override
void establishExtension(vector< PClip > &, vector< PMark > &)
Find out about the vertical extension of a single track display.
model::ViewHooked< TrackBody > body_
vector< unique_ptr< RulerTrack > > & bindRulers()
int hookAdjX(int xPos) override
model::CanvasHook< Gtk::Widget > & getClipHook() override
void sync_and_balance(DisplayEvaluation &)
re-flow and adjust after the global layout has been established At this point we can assume that both...
DisplayFrame(DisplayViewHooks &displayAnchor)
model::ViewHooked< TrackHeadWidget > head_
model::ViewHook< TrackHeadWidget > & getHeadHook() override
model::ViewHook< TrackBody > & getBodyHook() override
void setTrackName(cuString &name)
Interface: a compound of anchoring facilities.
Special CanvasHook decorator to apply a (dynamic) offset when attaching or moving Widgets on the shar...
RelativeCanvasHook(model::CanvasHook< WID > &baseHook)
void remove(WID &widget) override
void hook(WID &widget, int xPos=0, int yPos=0) override
virtual int hookAdjY(int yPos)=0
model::CanvasHook< WID > & getAnchorHook() noexcept override
allow to build a derived relative hook with different offset
model::DisplayMetric & getMetric() const override
delegating layout metric to the root canvas
virtual int hookAdjX(int xPos)=0
model::CanvasHook< WID > & refHook_
void move(WID &widget, int xPos, int yPos) override
A View-Model entity to represent a timeline track in the UI.
void relinkContents()
second pass of the DisplayEvaluation: reassemble content to match adjusted layout
void establishLayout(DisplayEvaluation &) override
handle Phase-1 of the DisplayEvaluation pass for this track and its sub-tracks.
void completeLayout(DisplayEvaluation &) override
handle Phase-2 (collect/balancing phase) for this track and its sub-tracks.
void setTrackName(string name)
invoked via diff to show a (changed) track name
TrackPresenter(ID id, ctrl::BusTerm &nexus, DisplayViewHooks &displayAnchor)
virtual void buildMutator(lib::diff::TreeMutator::Handle) override
set up a binding to respond to mutation messages via UiBus
Any copy and copy construction prohibited.
Presentation control element to model and manage a clip within the timeline UI.
Common Abstraction of all sub-controller, coordinated by the UI-Bus.
A collaboration to establish a globally coherent timeline display layout.
A set of basic GTK includes for the UI.
Building tree expanding and backtracking evaluations within hierarchical scopes.
auto explore(IT &&srcSeq)
start building a IterExplorer by suitably wrapping the given iterable source.
unique_ptr< RulerTrack > PRuler
unique_ptr< ClipPresenter > PClip
unique_ptr< TrackPresenter > PFork
unique_ptr< MarkerWidget > PMark
Lumiera GTK UI implementation root.
Mix-Ins to allow or prohibit various degrees of copying and cloning.
generic data element node within a tree
std::optional< X > retrieveAttribute(string key) const
mismatch tolerant convenience shortcut to peek into the attributes of a nested Record
a family of time value like entities and their relationships.
This helper class serves to manage the layout and display of the horizontally extended space of a "tr...
Hard wired key constants and basic definitions for communication with the GUI.
Some small helpers and convenience shortcuts to ease working with collections and sequences (given by...
Allow widgets to connect to a common shared presentation context.