Lumiera
0.pre.03
»edit your freedom«
|
#include "stage/model/canvas-hook.hpp"
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.
WID | type of the embedded widget, which is to be hooked-up into the view/canvas. |
BASE | generic widget base type, to be used on the associated CanvasHook<BASE> |
Definition at line 187 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 | |
Canvas & | getCanvas () const |
Private Types | |
using | Canvas = CanvasHook< BASE > |
Private Attributes | |
Canvas * | view_ |
Additional Inherited Members | |
Private Member Functions inherited from NonCopyable | |
NonCopyable (NonCopyable const &)=delete | |
NonCopyable & | operator= (NonCopyable const &)=delete |