Lumiera  0.pre.03
»edit your freedom«
CanvasHooked< WID, BASE > Class Template Reference

#include "stage/model/canvas-hook.hpp"

Description

template<class WID, class BASE = WID>
class stage::model::CanvasHooked< WID, BASE >

A widget attached onto a display canvas or similar central presentation context.

This decorator is a variation of the ViewHooked decorator, and likewise embodies the widget to be attached; moreover, the attachment is immediately performed at construction time and managed automatically thereafter. When the CanvasHooked element goes out of scope, it is automatically detached from presentation. With the help of the CanvasHooked API, a widget (or similar entity) may control the coordinates of its placement onto some kind of canvas (-> Gtk::Layout), while remaining agnostic regarding any further implementation details of the canvas and its placement thereon.

The canonical example of a CanvasHooked element is the stage::timeline::ClipWidget, as created and managed by the TrackPresenter within the timeline UI. This connection entity allows to place ClipWidget elements into the appropriate display region for this track, without exposing the actual stage::timeline::BodyCanvasWidget to each and every Clip or Label widget.

Template Parameters
WIDtype of the embedded widget, which is to be hooked-up into the view/canvas.
BASEgeneric widget base type, to be used on the associated CanvasHook<BASE>
Remarks
since CanvasHooked represents one distinct attachment to some view or canvas, is has a clear-cut identity and and will be identified by its allocation address.
Warning
since ViewHooked entities call back into the ViewHook on destruction, the latter still needs to be alive at that point. Which basically means you must ensure the ViewHooked "Widgets" are destroyed prior to the "Canvas".

Definition at line 178 of file canvas-hook.hpp.

Public Member Functions

template<typename... ARGS>
 CanvasHooked (typename Canvas::Pos attachmentPos, ARGS &&...args)
 
void moveTo (int xPos, int yPos)
 

Protected Member Functions

CanvasgetCanvas () const
 

Private Types

using Canvas = CanvasHook< BASE >
 

Private Attributes

Canvasview_
 

Additional Inherited Members

- Private Member Functions inherited from NonCopyable
 NonCopyable (NonCopyable const &)=delete
 
NonCopyableoperator= (NonCopyable const &)=delete
 
+ Inheritance diagram for CanvasHooked< WID, BASE >:
+ Collaboration diagram for CanvasHooked< WID, BASE >:

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