Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
body-canvas-widget.cpp File Reference

Implementation details of timeline custom drawing. More...

Go to the source code of this file.

Description

Implementation details of timeline custom drawing.

This translation unit holds the central part of the timeline custom drawing code. While the timeline::TimelineCanvas implementation functions (bottom part of the source) govern the high-level invocation control structure and [entry point](}ref TimelineCancas::on_draw()), the actual drawing is performed by the implementation code within timeline::BodyCanvasWidget, which in turn delegates to the actual drawing mechanism – implemented in the local namespace at the top of this file. The actual drawing is decomposed into some building blocks, like drawing a background, drawing an inset slope etc. These blocks are activated with the help of the timeline::TrackProfile, which in fact enacts a visitor (double-dispatch) mechanism. The actual track profile is a sequence of verbs describing the structure of a vertical cross-section over the track space; it is assembled at runtime within the function timeline::TrackBody::establishTrackSpace(), based on specifications drawn from the real CSS layout definitions. Here, within this translation unit, we define the corresponding timeline::ProfileInterpreter implementations; these are the concrete visitors and are invoked repeatedly to carry out the actual drawing requests.

Todo:
as of 3/2023 the foundation of this rewritten, highly flexible drawing code established, and the layout seemingly behaves reasonably stable and visually as expected, yet with some minor glitches. Any kind of dynamic adjustment in response to expanding/collapsing or the content representation of clips is not yet implemented

Definition in file body-canvas-widget.cpp.

Namespaces

namespace  stage
 Lumiera GTK UI implementation root.
 
namespace  stage::timeline
 The timeline display and editing operations.
 
namespace  stage::timeline::anonymous_namespace{body-canvas-widget.cpp}
 

Typedefs

using CairoC = PCairoContext const &
 
using StyleC = PStyleContext const &
 
using Grounding = TrackGroundingRenderer
 
using Overlay = TrackOverlayRenderer
 

Classes

class  AbstractTrackRenderer
 
class  TrackGroundingRenderer
 
class  TrackOverlayRenderer
 

Functions

cuString slopeClassName (int depth)
 
void setupAdditionalTrackPadding_fromCSS ()
 Adjust the vertical space to accommodate for additional decorations as required by the CSS style rules.
 
template<class PINT , bool isRuler>
auto makeRenderer (DisplayManager &layout, BodyCanvasWidget::ProfileGetter &getProfile)
 

Variables

const int INITIAL_TIMERULER_HEIGHT_px = 30
 
const int INITIAL_CONTENT_HEIGHT_px = 100
 
const int MINIMAL_CONTENT_WIDTH_px = 100
 
lumiera::advice::Request< PStyleContexttrackBodyStyle {"style(trackBody)"}
 request a pre-defined CSS style context for the track body
 
lumiera::advice::Request< PStyleContexttrackRulerStyle {"style(trackRuler)"}
 
const uint SLOPE_CAP_DEPTH = 5
 
const bool RULER = true
 
const bool BODY = false