Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
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
34namespace stage {
35
36
38 : coreService_{new ctrl::CoreService}
39 { }
40
41
42 // emit administrative code here...
44
45
48 {
49 return *coreService_;
50 }
51
54 {
55 return coreService_->getStateManager();
56 }
57
58
59
60namespace ctrl {
61
63
64
70
71
72
73
74
75
86 BusTerm::attach (ID identity, Tangible& newNode)
87 {
88 return BusTerm(identity, theBus_.routeAdd (identity,newNode));
89 }
90
91
92
93 /* ==== standard implementation of the BusTerm interface ==== */
94
112 void
113 BusTerm::act (GenNode const& command)
114 {
115 theBus_.act (command);
116 }
117
118
131 void
132 BusTerm::note (ID subject, GenNode const& mark)
133 {
134 theBus_.note (subject,mark);
135 }
136
137
150 bool
151 BusTerm::mark (ID subject, GenNode const& mark)
152 {
153 return theBus_.mark (subject,mark);
154 }
155
156
165 size_t
167 {
168 return theBus_.markAll (mark);
169 }
170
171
184 bool
186 {
187 return theBus_.change(subject, move(diff));
188 }
189
190
196 BusTerm&
197 BusTerm::routeAdd (ID identity, Tangible& node)
198 {
199 return theBus_.routeAdd (identity, node);
200 }
201
202
207 void
209 {
210 if (not isShortCircuit(node))
211 theBus_.routeDetach (node);
212 }
213
214
215 BusTerm::operator string() const
216 {
217 return "BusTerm-" + string(endpointID_);
218 }
219
220
221
222}}// namespace stage::ctrl
unique_ptr< ctrl::CoreService > coreService_
Definition ui-bus.hpp:125
ctrl::BusTerm & getAccessPoint()
Definition ui-bus.cpp:47
ctrl::StateManager & getStateManager()
Definition ui-bus.cpp:53
connection point at the UI-Bus.
Definition bus-term.hpp:98
virtual bool mark(ID subject, GenNode const &mark)
route a state update or notification to the given subject.
Definition ui-bus.cpp:151
virtual void act(GenNode const &command)
prepare or trigger invocation of a command.
Definition ui-bus.cpp:113
BusTerm attach(ID, Tangible &newNode)
Builder function: establish and wire a new BusTerm.
Definition ui-bus.cpp:86
virtual BusTerm & routeAdd(ID, Tangible &)
Definition ui-bus.cpp:197
virtual void routeDetach(ID) noexcept
Definition ui-bus.cpp:208
virtual ~BusTerm()
this is an interface
Definition ui-bus.cpp:66
virtual void note(ID subject, GenNode const &mark)
capture and record a "state mark" for later replay for restoring UI state.
Definition ui-bus.cpp:132
virtual bool change(ID subject, MutationMessage &&diff)
alter and reshape the designated subject by applying the given diff message.
Definition ui-bus.cpp:185
virtual size_t markAll(GenNode const &mark)
broadcast a notification message to all currently connected bus terminals.
Definition ui-bus.cpp:166
EntryID const & ID
Definition bus-term.hpp:107
Interface: handling of persistent interface state.
Interface common to all UI elements of relevance for the Lumiera application.
Definition tangible.hpp:160
Dedicated service node within the UI-Bus to handle command invocation and presentation state.
Lumiera GTK UI implementation root.
Definition guifacade.cpp:37
generic data element node within a tree
Definition gen-node.hpp:224
Opaque message to effect a structural change on a target, which is likewise only known in an abstract...
Under construction: the top level UI controller.