Lumiera  0.pre.03
»edit your freedom«
timeline-gui.cpp
Go to the documentation of this file.
1 /*
2  TimelineGui - top-level anchor point and placeholder for "the timeline"
3 
4  Copyright (C) Lumiera.org
5  2018, 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 
36 #include "stage/gtk-base.hpp"
39 
40 #include <utility>
41 
43 using std::unique_ptr;
44 
45 
46 namespace stage {
47 namespace timeline {
48 
49 
54  TimelineGui::TimelineGui (ID identity, ID trackID)
55  : timelineID_{identity}
56  , rootTrackID_{trackID}
57  { }
58 
64  : WLink{r}, util::Cloneable{}
65  , timelineID_{r.timelineID_}
66  , rootTrackID_{r.rootTrackID_}
67  { }
68 
70  : WLink{std::move (rr)}
71  , timelineID_{rr.timelineID_}
72  , rootTrackID_{rr.rootTrackID_}
73  { }
74 
75  TimelineGui::~TimelineGui()
76  {
77  if (this->isActive())
78  TODO ("cascading destruction of the TimelineWidget");
79  }
80 
81 
94  unique_ptr<TimelinePage>
96  {
97  TimelineWidget* widget;
98  unique_ptr<TimelinePage> pageHandle {widget = new TimelineWidget{timelineID_, rootTrackID_, nexus}};
99  this->connect (*widget);
100  return pageHandle;
101  }
102 
103 
110  void
112  {
113  if (this->isActive())
114  operator*().buildMutator (buffer); // delegate to TimelineController
115  else // else when no widget exists...
116  buffer.emplace(
118  .ignoreAllChanges()); // ...consume and ignore diff
119  }
120 
121 
122 }}// namespace stage::timeline
smart-Handle as anchor point for "the UI representation" of a timeline.
connection point at the UI-Bus.
Definition: bus-term.hpp:105
TimelineGui(ID identity, ID trackID)
Initially, TimelineGui is just an empty placeholder handle.
Anchor point and placeholder for the UI representation of a Timeline from the session.
std::unique_ptr< TimelinePage > buildTimelineWidget(BusTerm &)
actually build a TimelineWidget to enact the role represented by this smart-handle ...
static Builder< TreeMutator > build()
DSL: start building a custom adapted tree mutator, where the operations are tied by closures or wrapp...
SUB & emplace(SUB &&implementation)
move-construct an instance of a subclass into the opaque buffer
A handle to allow for safe »remote implantation« of an unknown subclass into a given opaque InPlaceBu...
Definition: record.hpp:113
Core timeline display (custom widget).
Lumiera GTK UI implementation root.
Definition: guifacade.cpp:46
Types marked with this mix-in may be created by copy-construction (or move construction), but may be not reassigned thereafter.
Definition: nocopy.hpp:91
A set of basic GTK includes for the UI.
void buildMutator(lib::diff::TreeMutator::Handle buffer) override
forwarding implementation of the DiffMutable interface, delegating through the referred TimelineWidge...
This file defines the core component of the Lumiera GUI.
Customisable intermediary to abstract mutating operations on arbitrary, hierarchical object-like data...