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

#include "stage/timeline/body-canvas-widget.hpp"

Description

Presentation of the timeline workspace by custom drawing on a canvas.

This widget allows for uniform access and handling of that body area; however, in fact we need several TimelineCanvas spaces, since part of the display needs to stay "pinned" on top (the overview rulers), while the majority of the track body area is packaged into a scrolling pane.

Interface

We have to distinguish two kinds of drawing access to this BodyCanvasWidget:

  • painting of areas for background, profile and for overlays
  • relative attachment of widgets onto this canvas For the former, we use the TrackProfile as a drawing Visitor (double dispatch): The layout code identifies a sequence of spaces (horizontally extended) corresponding to tracks and rulers. This is abstracted into the profile, and can then be (re)rendered as often as necessary by "playback" of this profile. On the other hand, for attachment of sub-widgets onto the canvas (Clips, Effects, Markers) we use the Interface model::CanvasHook, which allows us to break down the access hierarchically. Each sub-Track can be outfitted with its own "virtual canvas", exposed as delegating CanvasHook.

Definition at line 130 of file body-canvas-widget.hpp.

Public Member Functions

 BodyCanvasWidget (DisplayManager &)
 
void disable ()
 
void forceRedraw ()
 
auto get_hadjustment ()
 
auto get_vadjustment ()
 
void installForkRoot (TrackBody &rootTrackBody)
 The Lumiera Timeline model does not rely on a list of tracks, as most conventional video editing software does – rather, each sequence holds a fork of nested scopes. This recursively nested structure is parallelled in the way we organise and draw the timeline representation onto the TimelineCanvas: we use an intermediary entity, the TrackBody as an organisational grouping device, even while we draw all of the timeline representation onto a single global #mainCanvas_ within the (scrollable) #contentArea_. More...
 
- Public Member Functions inherited from CanvasHook< Gtk::Widget >
virtual ~CanvasHook ()
 this is an interface
 
virtual CanvasHook< Gtk::Widget > & getAnchorHook () noexcept
 Anchor point to build chains of related View Hooks.
 
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...
 
- Public Member Functions inherited from LayoutElement
virtual ~LayoutElement ()
 this is an interface
 

Protected Member Functions

void completeLayout (DisplayEvaluation &) override
 
void establishLayout (DisplayEvaluation &) override
 respond to the DisplayEvaluation pass. More...
 
model::DisplayMetricgetMetric () const override
 access the component to handle layout metric
 
void hook (Gtk::Widget &, int xPos=0, int yPos=0) override
 
void move (Gtk::Widget &, int xPos, int yPos) override
 
void remove (Gtk::Widget &) override
 

Private Types

using ProfileGetter = std::function< TrackProfile &()>
 a way to get and possibly (re)compute the current TrackProfile
 

Private Member Functions

void adjustCanvasSize (int canvasWidth, int totalHeight, int rulerHeight)
 After the (recent) display evaluation pass has negotiated the required space for the currently presented content, this function adjusts the actual Gtk::Layout canvas extension to match. More...
 
TimelineCanvasgetCanvas (int yPos)
 
void maybeRebuildLayout ()
 Possibly (re)build the allocation and distribution of layout space. More...
 
void slotStructureChange () noexcept
 force rebuilding of theTrackProfile whenever the global timeline structure changes
 

Private Attributes

Gtk::ScrolledWindow contentArea_
 
ProfileGetter getProfile
 
DisplayManagerlayout_
 
TimelineCanvas mainCanvas_
 
TrackProfile profile_
 
TrackBodyrootBody_
 
Gtk::ScrolledWindow rulerArea_
 
TimelineCanvas rulerCanvas_
 

Member Function Documentation

◆ installForkRoot()

void installForkRoot ( TrackBody rootTrackBody)

The Lumiera Timeline model does not rely on a list of tracks, as most conventional video editing software does – rather, each sequence holds a fork of nested scopes. This recursively nested structure is parallelled in the way we organise and draw the timeline representation onto the TimelineCanvas: we use an intermediary entity, the TrackBody as an organisational grouping device, even while we draw all of the timeline representation onto a single global #mainCanvas_ within the (scrollable) #contentArea_.

Initially install the contents corresponding to the root track fork

Thus, adding the first TrackBody to represent the root track of a Timeline, will also prepare the grounding for any other nested entities to be drawn on top.

Definition at line 500 of file body-canvas-widget.cpp.

◆ get_vadjustment()

auto get_vadjustment ( )
inline

allow the header pane to follow our vertical scrolling movement

Definition at line 154 of file body-canvas-widget.hpp.

◆ establishLayout()

void establishLayout ( DisplayEvaluation )
overrideprotectedvirtual

respond to the DisplayEvaluation pass.

Remarks
assuming that each track has already established it own vertical space requirement, thereby placing the established vertical extension into TrackBody::contentHeight_
Todo:
2/2020 WIP

TODO: anything to publish into the DisplayEvaluation ??

Implements LayoutElement.

Definition at line 617 of file body-canvas-widget.cpp.

◆ maybeRebuildLayout()

void maybeRebuildLayout ( )
private

Possibly (re)build the allocation and distribution of layout space.

Check the internal trigger flag and recalculate the extension of relevant parts.

Remarks
this function will be called on demand right before actual drawing.

Definition at line 527 of file body-canvas-widget.cpp.

◆ adjustCanvasSize()

void adjustCanvasSize ( int  canvasWidth,
int  contentHeight,
int  rulerHeight 
)
private

After the (recent) display evaluation pass has negotiated the required space for the currently presented content, this function adjusts the actual Gtk::Layout canvas extension to match.

Note that we use two Gtk::Layout controls, one to show the overview rules always visible at the top, while the second one is placed into a scrollable pane to accommodate an arbitrary number of tracks.

Definition at line 547 of file body-canvas-widget.cpp.

+ Inheritance diagram for BodyCanvasWidget:
+ Collaboration diagram for BodyCanvasWidget:

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