Lumiera  0.pre.03
»edit your freedom«
DisplayFrame Class Reference

#include "stage/timeline/track-presenter.hpp"

Description

Reference frame to organise the presentation related to a specific Track in the Timeline-GUI.

With the help of such a common frame of reference, we solve the problem that each individual track display needs to hook into two distinct UI presentation structures: the track head controls and the presentation of track contents on the BodyCanvasWidget.

Note
the RelativeCanvasHook sub-interface is initialised by chaining with the given displayAnchor. Now, since RelativeCanvasHook itself removes intermediary delegates when chaining, in the end the #getClipHook() exposes the top-level canvas, while applying our local #hookAdjX()

Definition at line 213 of file track-presenter.hpp.

Public Member Functions

 DisplayFrame (DisplayViewHooks &displayAnchor)
 
vector< unique_ptr< RulerTrack > > & bindRulers ()
 
void establishExtension (vector< PClip > &, vector< PMark > &)
 Find out about the vertical extension of a single track display. More...
 
model::ViewHook< TrackBody > & getBodyHook () override
 
model::CanvasHook< Gtk::Widget > & getClipHook () override
 
model::ViewHook< TrackHeadWidget > & getHeadHook () override
 
void setTrackName (cuString &name)
 
void sync_and_balance (DisplayEvaluation &)
 re-flow and adjust after the global layout has been established At this point we can assume that both header and body are updated and have valid extensions within their perimeter. More...
 
- Public Member Functions inherited from DisplayViewHooks
virtual ~DisplayViewHooks ()
 this is an interface
 
- Public Member Functions inherited from RelativeCanvasHook< Gtk::Widget >
 RelativeCanvasHook (model::CanvasHook< Gtk::Widget > &baseHook)
 
- Public Member Functions inherited from CanvasHook< Gtk::Widget >
virtual ~CanvasHook ()
 this is an interface
 
Pos hookedAt (int x, int y)
 
Pos hookedAt (Time start, int downshift=0)
 build the "construction hook" for a CanvasHooked element, which is to be attached to some timeline canvas view. More...
 

Private Member Functions

int hookAdjX (int xPos) override
 
int hookAdjY (int yPos) override
 
- Private Member Functions inherited from NonCopyable
 NonCopyable (NonCopyable const &)=delete
 
NonCopyableoperator= (NonCopyable const &)=delete
 

Private Attributes

model::ViewHooked< TrackBodybody_
 
model::ViewHooked< TrackHeadWidgethead_
 

Additional Inherited Members

- Protected Member Functions inherited from RelativeCanvasHook< Gtk::Widget >
model::DisplayMetricgetMetric () const override
 delegating layout metric to the root canvas
 

Member Function Documentation

◆ establishExtension()

void establishExtension ( vector< PClip > &  clips,
vector< PMark > &   
)
inline

Find out about the vertical extension of a single track display.

Note
will be invoked during the first recursive walk, at which point the TrackProfile has not yet been established; the latter will happen after returning from that recursive walk. Thus within this first pass, we can only adjust local sizes within the content area, while the second pass, in #relinkContents() can also investigate the track body vertical extension, defined by the TrackProfile.

Definition at line 405 of file track-presenter.hpp.

◆ sync_and_balance()

void sync_and_balance ( DisplayEvaluation )
inline

re-flow and adjust after the global layout has been established At this point we can assume that both header and body are updated and have valid extensions within their perimeter.

But the coordination of track head display and body content might be out of sync and needs readjustments. This second pass gives the opportunity to fix such discrepancies by further increasing vertical extension, but this also has the consequence to trigger yet another DisplayEvaluation, since any readjustment invalidates the global layout. However, since all adjustments are done by increasing monotonously, after several recursions the layout will be balanced eventually.

Note
We can increase a head to match body size. Otherwise, if the body is too small, we're out of luck, since the Profile is already calculated. However, since we accommodated the local extension within each content area prior to calculating the Profile, chances are that such a discrepancy is small.
Remarks
we could also consider to transport a remaining discrepancy downwards by using a state variable in the DisplayEvaluation

Definition at line 449 of file track-presenter.hpp.

+ Inheritance diagram for DisplayFrame:
+ Collaboration diagram for DisplayFrame:

The documentation for this class was generated from the following file: