Lumiera  0.pre.03
»edityourfreedom«
core-service.hpp
Go to the documentation of this file.
1 /*
2  CORE-SERVICE.hpp - service to address the application core from the UI
3 
4  Copyright (C) Lumiera.org
5  2015, 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 
84 #ifndef GUI_CTRL_CORE_SERVICE_H
85 #define GUI_CTRL_CORE_SERVICE_H
86 
87 
88 #include "lib/error.hpp"
89 #include "lib/nocopy.hpp"
90 #include "lib/idi/entry-id.hpp"
91 #include "lib/diff/gen-node.hpp"
94 #include "gui/ctrl/bus-term.hpp"
95 #include "gui/ctrl/nexus.hpp"
96 
97 
98 namespace gui {
99 namespace ctrl{
100 
102  using lib::diff::Rec;
103 
104 
115  : public BusTerm
117  {
118 
121 
122 
123  virtual void
124  act (GenNode const& command) override
125  {
126  SessionCommand::facade().trigger (command.idi.getSym(), command.data.get<Rec>());
127  }
128 
129 
130  virtual void
131  note (ID subject, GenNode const& stateMark) override
132  {
133  stateRecorder_.recordState (subject, stateMark);
134  }
135 
136 
137  public:
138  explicit
140  : BusTerm(identity, uiBusBackbone_)
141  , uiBusBackbone_{*this}
142  , stateRecorder_{*this}
143  {
144  INFO (gui, "UI-Backbone operative.");
145  }
146 
147  ~CoreService();
148 
149 
150  StateManager&
152  {
153  return stateRecorder_;
154  }
155  };
156 
157 
158 
159 }} // namespace gui::ctrl
160 #endif /*GUI_CTRL_CORE_SERVICE_H*/
Record< GenNode > Rec
Definition: gen-node.hpp:133
Lumiera GTK UI implementation root.
Definition: guifacade.cpp:47
Any copy and copy construction prohibited.
Definition: nocopy.hpp:46
typed symbolic and hash ID for asset-like position accounting.
Definition: entry-id.hpp:128
EntryID const & ID
Definition: bus-term.hpp:116
CoreService(ID identity=lib::idi::EntryID< CoreService >())
string const & getSym() const
Definition: entry-id.hpp:165
Attachment point to the UI-Bus.
static lib::Depend< SessionCommand > facade
static storage for the facade access front-end
Mix-Ins to allow or prohibit various degrees of copying and cloning.
Global access point to invoke commands and cause edit operations within the Session.
void recordState(ID uiElm, StateMark stateMark)
Interface for the operating facility (CoreService) to feed state mark messages to be remembered...
Implementation of the PresentationStateManager interface through associative (key-value) store...
Generic building block for tree shaped (meta)data structures.
virtual void note(ID subject, GenNode const &stateMark) override
capture and record a "state mark" for later replay for restoring UI state.
virtual void act(GenNode const &command) override
prepare or trigger invocation of a command.
Lumiera error handling (C++ interface).
Attachment point to »central services« within the UI-Bus.
Simple map based implementation of the PresentationStateManager interface.
StateRecorder stateRecorder_
Bare symbolic and hash ID used for accounting of asset like entries.
Interface: handling of persistent interface state.
connection point at the UI-Bus.
Definition: bus-term.hpp:105
StateManager & getStateManager()
Core hub and routing table of the UI-Bus.
Major public Interface to the Session subsystem of Lumiera GUI.
generic data element node within a tree
Definition: gen-node.hpp:213
Central hub of the UI-Bus.
Definition: nexus.hpp:76