Lumiera  0.pre.03
»edit your freedom«
timeline-layout.hpp
Go to the documentation of this file.
1 /*
2  TIMELINE-LAYOUT.hpp - global timeline layout management and display control
3 
4  Copyright (C) Lumiera.org
5  2016, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 */
22 
23 
79 #ifndef STAGE_TIMELINE_TIMELINE_LAYOUT_H
80 #define STAGE_TIMELINE_TIMELINE_LAYOUT_H
81 
82 #include "stage/gtk-base.hpp"
90 #include "lib/time/timevalue.hpp"
91 
92 
93 
94 
95 namespace stage {
96 namespace timeline {
97 
98  using lib::time::Time;
99 
100  class TrackHeadWidget;
101  class TrackBody;
102 
103 
110  : public model::ZoomMetric<DisplayManager>
111  , protected model::ViewHook<TrackHeadWidget>
112  , protected model::ViewHook<TrackBody>
113  , public LayoutElement
114  {
115  Glib::PropertyProxy<int> paneSplitPosition_;
116 
117  BodyCanvasWidget bodyCanvas_;
118  HeaderPaneWidget headerPane_;
119 
120  DisplayEvaluation displayEvaluation_;
121 
122  public:
123  TimelineLayout (Gtk::Paned&);
124  ~TimelineLayout();
125 
129 
130  Gtk::WidgetPath getBodyWidgetPath() const;
131 
132 
133  protected: /* ==== Interface: LayoutManager ===== */
134 
135  void triggerDisplayEvaluation() override;
136 
137  protected: /* ==== Interface: LayoutElement ===== */
138 
139  void establishLayout (DisplayEvaluation&) override;
140  void completeLayout (DisplayEvaluation&) override;
141 
142 
143  protected: /* ==== Interface: DisplayViewHooks===== */
144 
145  model::ViewHook<TrackHeadWidget>& getHeadHook() override { return *this; };
146  model::ViewHook<TrackBody>& getBodyHook() override { return *this; };
147  model::CanvasHook<Gtk::Widget>& getClipHook() override { return bodyCanvas_; };
148 
149  protected: /* ==== Interface: ViewHook ===== */
150 
151  void hook (TrackHeadWidget&) override;
152  void remove (TrackHeadWidget&) override;
153  void rehook (TrackHeadWidget&) noexcept override;
154 
155  void hook (TrackBody&) override;
156  void remove (TrackBody&) override;
157  void rehook (TrackBody&) noexcept override;
158 
159  private:/* ===== Internals ===== */
160  void syncZoomWindow (PAdjustment);
161  void sizeZoomWindow (Gtk::Allocation&);
162  };
163 
164 
165 }}// namespace stage::timeline
166 #endif /*STAGE_TIMELINE_TIMELINE_LAYOUT_H*/
Header pane control area corresponding to a Track with nested child Tracks.
void establishLayout(DisplayEvaluation &) override
TimelineLayout also participates itself in the DisplayEvaluation, notably to set up the basic paramet...
Top-level anchor point for the timeline display (widgets).
Widget to render the body of timeline display, by custom drawing into a canvas control.
Mix-In to implement the DisplayMetric interface on top of a ZoomWindow component, directly embedded h...
Definition: zoom-metric.hpp:73
Interface to represent _"some presentation layout entity",_ with the ability to attach widgets (manag...
Definition: view-hook.hpp:84
void setupStructure(LayoutElement &)
Allow widgets to connect to a common shared presentation context.
Lumiera&#39;s internal time value datatype.
Definition: timevalue.hpp:308
void triggerDisplayEvaluation() override
Perform a complete recursive pass over all elements relevant for layout, reestablish size allocation ...
A collaboration to establish a globally coherent timeline display layout.
void sizeZoomWindow(Gtk::Allocation &)
Signal receiver (slot) to react on changes of the window screen space allocation. ...
Visitor and state holder for a collaborative layout adjustment pass.
Abstraction: service for the widgets to translate themselves into screen layout.
Specialised (abstracted) presentation context with positioning by coordinates.
Lumiera GTK UI implementation root.
Definition: guifacade.cpp:46
void syncZoomWindow(PAdjustment)
Signal receiver (slot) to react on scrollbar changes.
void installRootTrack(TrackHeadWidget &, TrackBody &)
This function is invoked once for each new TimelineWidget, in order to build the starting point for t...
Implementation building block to get the DisplayMetric as defined through a ZoomWindow.
Widget to show an always visible track header area within the timeline UI.
Helper to organise and draw the space allocated for a fork of sub-tracks.
Definition: track-body.hpp:95
Presentation of the timeline workspace by custom drawing on a canvas.
a family of time value like entities and their relationships.
A set of basic GTK includes for the UI.