![]() |
Lumiera 0.pre.04
»edit your freedom«
|
#include "stage/widget/element-box-widget.hpp"
A basic building block of the Lumiera UI.
Representation of an entity, with a marker icon, a menu, descriptive label and possibly a content renderer (e.g. for a video clip). Depending on the presentation intent, the widget can be set to a fixed horizontal extension, to allow presentation on a time calibrated canvas. Pre-defined styling and bindings to expand the display and to invoke a menu are provided.
Definition at line 134 of file element-box-widget.hpp.
Classes | |
| class | Config |
| struct | Strategy |
Public Member Functions | |
| template<class... QS> | |
| ElementBoxWidget (Kind kind, Type type, QS ...qualifiers) | |
| setup an ElementBoxWidget with suitable presentation style. | |
| ElementBoxWidget (Config) | |
| ~ElementBoxWidget () | |
| void | setName (cuString &) |
| cuString | getName () const |
| void | set_label (cuString &s) |
| redirect Gtk::Frame setters to ElementBoxWidget | |
| cuString | get_label () const |
Private Types | |
| using | _Base = Gtk::EventBox |
Private Member Functions | |
| Gtk::SizeRequestMode | get_request_mode_vfunc () const final |
Layout trend for ElementBoxWidget is nailed down (final) to "height-for-width". | |
| void | get_preferred_width_vfunc (int &, int &) const override |
| Layout preferences are delegated through the Strategy. | |
| void | get_preferred_height_vfunc (int &, int &) const override |
| void | get_preferred_height_for_width_vfunc (int, int &, int &) const override |
| void | on_size_allocate (Gtk::Allocation &) override |
| Tap into the notification of screen space allocation to possibly enforce size constraints. | |
| void | imposeSizeConstraint (int, int) |
| Ensure the child widgets can be represented and possibly adjust or hide content, in case the extension of ElementBoxWidget is explicitly constrained in size. | |
Private Attributes | |
| Strategy | strategy_ |
| actual layout strategy binding for this widget | |
| IDLabel | label_ |
| Gtk::Frame | frame_ |
|
inline |
setup an ElementBoxWidget with suitable presentation style.
| widgetKind | the basic presentation intent |
| type | qualify the type of data represented by this object |
| qualifiers | pass further qualifiers to fine-tune the presentation |
Definition at line 293 of file element-box-widget.hpp.
| ElementBoxWidget | ( | Config | config | ) |
Definition at line 191 of file element-box-widget.cpp.
References stage::CLASS_background, stage::CLASS_elementbox, stage::CLASS_elementbox_idlabel, ElementBoxWidget::frame_, ElementBoxWidget::Config::getName(), stage::ID_element, ElementBoxWidget::label_, and IDLabel::setCaption().
Here is the call graph for this function:| ~ElementBoxWidget | ( | ) |
Definition at line 113 of file element-box-widget.cpp.
|
private |
Definition at line 137 of file element-box-widget.hpp.
| void setName | ( | cuString & | nameID | ) |
Definition at line 214 of file element-box-widget.cpp.
References ElementBoxWidget::label_, and IDLabel::setCaption().
Referenced by ElementBoxWidget::set_label(), and TrackHeadWidget::setTrackName().
Here is the call graph for this function:
Here is the caller graph for this function:| cuString getName | ( | ) | const |
Definition at line 220 of file element-box-widget.cpp.
References IDLabel::getCaption(), and ElementBoxWidget::label_.
Referenced by ElementBoxWidget::get_label().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
redirect Gtk::Frame setters to ElementBoxWidget
Definition at line 168 of file element-box-widget.hpp.
References ElementBoxWidget::setName().
Here is the call graph for this function:
|
inline |
Definition at line 169 of file element-box-widget.hpp.
References ElementBoxWidget::getName().
Here is the call graph for this function:
|
finalprivate |
Layout trend for ElementBoxWidget is nailed down (final) to "height-for-width".
The reason is, some of the use cases entail placing the element box onto a canvas with horizontal extension calibrated to time units; doing so requires us to control the extension, which is delegated through the strategy
Definition at line 232 of file element-box-widget.cpp.
|
overrideprivate |
Layout preferences are delegated through the Strategy.
Gtk::Layout), where the calculation takes minimum_width as starting point. The returned values will always be respected, while the GTK layout engine might increase the given extensions...adjust_size_allocation on the GTK-class, which typically delegates to gtk_widget_real_adjust_size_allocation, and the latter invokessize_allocate VFunc, which passes through the Gtk::Widget::on_size_allocate() and after that by default stores this allocation into the widget's private data. Definition at line 260 of file element-box-widget.cpp.
References ElementBoxWidget::Strategy::getWidth, ElementBoxWidget::Strategy::is_size_constrained(), and ElementBoxWidget::strategy_.
Here is the call graph for this function:
|
overrideprivate |
Definition at line 273 of file element-box-widget.cpp.
References ElementBoxWidget::Strategy::getHeight, ElementBoxWidget::Strategy::shall_control_height(), and ElementBoxWidget::strategy_.
Here is the call graph for this function:
|
overrideprivate |
Definition at line 282 of file element-box-widget.cpp.
References ElementBoxWidget::Strategy::getHeight, ElementBoxWidget::Strategy::is_size_constrained(), ElementBoxWidget::Strategy::shall_control_height(), and ElementBoxWidget::strategy_.
Here is the call graph for this function:
|
overrideprivate |
Tap into the notification of screen space allocation to possibly enforce size constraints.
Generally speaking, explicit size constrained widgets are not a concept supported by GTK, due to its flexible layout model and the use of CSS for styling and theming. Unfortunately we need this feature, in order to implement Clip widgets on a time calibrated canvas. Thus we use an implementation trick: we report our size constraints as "natural size" to GTK, knowing that GTK will respect those extensions (unless the widget is placed into a container with fill-alignment). However, by doing so, we have effectively lied to GTK with respect to our child widgets. Thus we now have to take on the responsibility to somehow make those child widgets fit into the limited size allocation....
Definition at line 302 of file element-box-widget.cpp.
References ElementBoxWidget::imposeSizeConstraint(), ElementBoxWidget::Strategy::is_size_constrained(), and ElementBoxWidget::strategy_.
Here is the call graph for this function:
|
private |
Ensure the child widgets can be represented and possibly adjust or hide content, in case the extension of ElementBoxWidget is explicitly constrained in size.
visible it will respond properly to queries regarding the required extension Definition at line 319 of file element-box-widget.cpp.
References IDLabel::imposeSizeConstraint(), and ElementBoxWidget::label_.
Referenced by ElementBoxWidget::on_size_allocate().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
actual layout strategy binding for this widget
Definition at line 148 of file element-box-widget.hpp.
Referenced by ElementBoxWidget::get_preferred_height_for_width_vfunc(), ElementBoxWidget::get_preferred_height_vfunc(), ElementBoxWidget::get_preferred_width_vfunc(), and ElementBoxWidget::on_size_allocate().
|
private |
Definition at line 150 of file element-box-widget.hpp.
Referenced by ElementBoxWidget::ElementBoxWidget(), ElementBoxWidget::getName(), ElementBoxWidget::imposeSizeConstraint(), and ElementBoxWidget::setName().
|
private |
Definition at line 151 of file element-box-widget.hpp.
Referenced by ElementBoxWidget::ElementBoxWidget().
Inheritance diagram for ElementBoxWidget:
Collaboration diagram for ElementBoxWidget: