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)
5  2018, Hermann Vosseler <Ichthyostega@web.de>
6 
7   **Lumiera** is free software; you can redistribute it and/or modify it
8   under the terms of the GNU General Public License as published by the
9   Free Software Foundation; either version 2 of the License, or (at your
10   option) any later version. See the file COPYING for further details.
11 
12 * *****************************************************************/
13 
14 
27 #include "stage/gtk-base.hpp"
30 
31 #include <utility>
32 
34 using std::unique_ptr;
35 
36 
37 namespace stage {
38 namespace timeline {
39 
40 
45  TimelineGui::TimelineGui (ID identity, ID trackID)
46  : timelineID_{identity}
47  , rootTrackID_{trackID}
48  { }
49 
55  : WLink{r}, util::Cloneable{}
56  , timelineID_{r.timelineID_}
57  , rootTrackID_{r.rootTrackID_}
58  { }
59 
61  : WLink{std::move (rr)}
62  , timelineID_{rr.timelineID_}
63  , rootTrackID_{rr.rootTrackID_}
64  { }
65 
66  TimelineGui::~TimelineGui()
67  {
68  if (this->isActive())
69  TODO ("cascading destruction of the TimelineWidget");
70  }
71 
72 
85  unique_ptr<TimelinePage>
87  {
88  TimelineWidget* widget;
89  unique_ptr<TimelinePage> pageHandle {widget = new TimelineWidget{timelineID_, rootTrackID_, nexus}};
90  this->connect (*widget);
91  return pageHandle;
92  }
93 
94 
101  void
103  {
104  if (this->isActive())
105  operator*().buildMutator (buffer); // delegate to TimelineController
106  else // else when no widget exists...
107  buffer.emplace(
109  .ignoreAllChanges()); // ...consume and ignore diff
110  }
111 
112 
113 }}// 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:96
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:104
Core timeline display (custom widget).
Lumiera GTK UI implementation root.
Definition: guifacade.cpp:37
Types marked with this mix-in may be duplicated by copy-construction, yet may not be moved or transfe...
Definition: nocopy.hpp:95
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...