Lumiera  0.pre.03
»edit your freedom«
canvas-hook.hpp File Reference

Go to the source code of this file.

Description

Specialised (abstracted) presentation context with positioning by coordinates.

This expands the idea behind the ViewHook abstraction, and works in a similar way, in close collaboration with the corresponding CanvasHooked entity (abstraction). Elements relying on those abstractions maintain an attachment to "their view", while remaining agnostic about the view's implementation details. However, the key point with this extended variant of the abstraction is that elements can be placed onto a coordinate system or canvas, and they can be moved to a different position.

A CanvasHooked element is basically a decorator directly attached to the element, adding automatic detachment on destruction, similar to a smart-ptr. So the "hooked" widget will live within the common allocation, together with its attachment; the whole arrangement must be set up at construction time

  • the combined CanvasHooked<W> must be non-copyable, since it can be expected for the canvas to store some pointer to the attached widget.
  • moreover, the canvas/presentation need to be available and activated when constructing the widget(s) due to the interwoven lifecycle.
  • and, most notably, the presentation/canvas (the CanvasHook) must be arranged such as to outlive the attached widgets, since they call back on destruction. In the typical usage situation these points can be ensured naturally by housing the widgets in some detail data structure owned by the top level presentation frame.
See also
CanvasHook_test

Definition in file canvas-hook.hpp.

#include "lib/time/timevalue.hpp"
#include "lib/nocopy.hpp"
#include "lib/util.hpp"
#include <utility>

Classes

class  CanvasHook< WID >
 Interface to represent _"some presentation layout entity",_ with the ability to place widgets (managed elsewhere) onto it, as well as to relocate those widgets to another position. More...
 
class  CanvasHooked< WID, BASE >
 A widget attached onto a display canvas or similar central presentation context. More...
 
class  DisplayMetric
 Mix-in interface to allow for concrete CanvasHooked widgets to adapt themselves to the metric currently employed on the canvas. More...
 
struct  CanvasHook< WID >::Pos
 

Namespaces

 stage
 Lumiera GTK UI implementation root.
 
 stage::model
 The Lumiera GTK-GUI uses a thin proxy layer data model on top of the actual "high-level-model", which lives in the Steam-Layer below.
 

Class Documentation

◆ stage::model::CanvasHook::Pos

struct stage::model::CanvasHook::Pos
Class Members
CanvasHook * view
int x
int y
+ Collaboration diagram for CanvasHook< WID >::Pos: