Lumiera  0.pre.03
»edit your freedom«
ui-bus.cpp
Go to the documentation of this file.
1 /*
2  UiBus - UI model and control backbone
3 
4  Copyright (C)
5  2008, Joel Holdsworth <joel@airwebreathe.org.uk>
6  2015, Hermann Vosseler <Ichthyostega@web.de>
7 
8   **Lumiera** is free software; you can redistribute it and/or modify it
9   under the terms of the GNU General Public License as published by the
10   Free Software Foundation; either version 2 of the License, or (at your
11   option) any later version. See the file COPYING for further details.
12 
13 * *****************************************************************/
14 
15 
30 #include "stage/ui-bus.hpp"
32 
33 
34 namespace stage {
36 namespace controller {
37 
38  Controller::Controller (model::Project& modelProject)
39  : project_(modelProject)
40  , playback_()
41  { }
42 
43 
44 
45  ctrl::PlaybackController& Controller::get_playback_controller()
46  {
47  return playback_;
48  }
49 
50 }// namespace stage::controller
52 
53 
54  UiBus::UiBus()
55  : coreService_{new ctrl::CoreService}
56  { }
57 
58 
59  // emit administrative code here...
60  UiBus::~UiBus() { }
61 
62 
63  ctrl::BusTerm&
64  UiBus::getAccessPoint()
65  {
66  return *coreService_;
67  }
68 
69  ctrl::StateManager&
70  UiBus::getStateManager()
71  {
72  return coreService_->getStateManager();
73  }
74 
75 
76 
77 namespace ctrl {
78 
79  CoreService::~CoreService() { }
80 
81 
83  BusTerm::~BusTerm()
84  {
85  theBus_.routeDetach (this->endpointID_);
86  }
87 
88 
89 
90 
91 
92 
102  BusTerm
103  BusTerm::attach (ID identity, Tangible& newNode)
104  {
105  return BusTerm(identity, theBus_.routeAdd (identity,newNode));
106  }
107 
108 
109 
110  /* ==== standard implementation of the BusTerm interface ==== */
111 
129  void
130  BusTerm::act (GenNode const& command)
131  {
132  theBus_.act (command);
133  }
134 
135 
148  void
149  BusTerm::note (ID subject, GenNode const& mark)
150  {
151  theBus_.note (subject,mark);
152  }
153 
154 
167  bool
168  BusTerm::mark (ID subject, GenNode const& mark)
169  {
170  return theBus_.mark (subject,mark);
171  }
172 
173 
182  size_t
183  BusTerm::markAll (GenNode const& mark)
184  {
185  return theBus_.markAll (mark);
186  }
187 
188 
201  bool
202  BusTerm::change (ID subject, MutationMessage&& diff)
203  {
204  return theBus_.change(subject, move(diff));
205  }
206 
207 
213  BusTerm&
214  BusTerm::routeAdd (ID identity, Tangible& node)
215  {
216  return theBus_.routeAdd (identity, node);
217  }
218 
219 
224  void
225  BusTerm::routeDetach(ID node) noexcept
226  {
227  if (not isShortCircuit(node))
228  theBus_.routeDetach (node);
229  }
230 
231 
232  BusTerm::operator string() const
233  {
234  return "BusTerm-" + string(endpointID_);
235  }
236 
237 
238 
239 }}// namespace stage::ctrl
virtual void routeDetach(ID) noexcept
Definition: ui-bus.cpp:225
connection point at the UI-Bus.
Definition: bus-term.hpp:96
Under construction: the top level UI controller.
Opaque message to effect a structural change on a target, which is likewise only known in an abstract...
Dedicated service node within the UI-Bus to handle command invocation and presentation state...
Lumiera GTK UI implementation root.
Definition: guifacade.cpp:37
virtual BusTerm & routeAdd(ID, Tangible &)
Definition: ui-bus.cpp:214
Interface common to all UI elements of relevance for the Lumiera application.
Definition: tangible.hpp:156
virtual void act(GenNode const &command)
prepare or trigger invocation of a command.
Definition: ui-bus.cpp:130
generic data element node within a tree
Definition: gen-node.hpp:222