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

Description

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

Public Member Functions

 TimelineCanvas (_Renderer groundingFun, _Renderer overlayFun)
 

Private Types

using _Renderer = std::function< void(CairoC)>
 

Private Member Functions

void closeCanvas (CairoC)
 Finish and close the virtual drawing canvas established by openCanvas(). More...
 
void drawGrounding (CairoC)
 Establish and render the structure of (possibly nested) tracks and overview rulers. More...
 
void drawOverlays (CairoC)
 
virtual bool on_draw (CairoC) override
 Custom drawing of the timeline content area. More...
 
void openCanvas (CairoC)
 Prepare the drawing canvas to work within our virtual canvas coordinate system. More...
 

Private Attributes

_Renderer renderGrounding_
 
_Renderer renderOverlay_
 

Member Function Documentation

◆ on_draw()

bool on_draw ( CairoC  cox)
overrideprivatevirtual

Custom drawing of the timeline content area.

The inherited Gtk::Layout::on_draw(Context) handles all drawing of child widgets placed onto the virtual canvas. Thus we need to fill in the structure of the tracks in the timeline background, and any non-standard overlay elements, including tags and markers, indicators, locators (edit point and playhead) and (semi-transparent) range selections.

Todo:
according to the documentation for signal_draw(), the framework passes the actually visible area as clipping region. In theory, this information could be used to reduce the load of canvas painting and repainting, which becomes crucial for responsiveness on large sessions ////////////////////////////////////TICKET #1191

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

◆ openCanvas()

void openCanvas ( CairoC  cox)
private

Prepare the drawing canvas to work within our virtual canvas coordinate system.

Remarks
GTK passes a context related to the actual window area; however, we need to create a uniform virtual canvas, shared by the child widgets, the backgrounding and any overlays. To make this work, we have to connect to the scrollbar adjustments, since GTK does this only for the child widgets on the canvas, not for any custom painting.

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

◆ closeCanvas()

void closeCanvas ( CairoC  cox)
private

Finish and close the virtual drawing canvas established by openCanvas().

Discard any coordinate offsets, stroke and drawing settings applied within.

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

◆ drawGrounding()

void drawGrounding ( CairoC  cox)
private

Establish and render the structure of (possibly nested) tracks and overview rulers.

Parameters
coxcairo drawing context for custom drawing, adjusted for our virtual canvas.

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

◆ drawOverlays()

void drawOverlays ( CairoC  cox)
private
Parameters
coxcairo drawing context of the virtual canvas for custom drawing.

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

+ Inheritance diagram for TimelineCanvas:
+ Collaboration diagram for TimelineCanvas:

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