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 
79 #ifndef GUI_CTRL_CORE_SERVICE_H
80 #define GUI_CTRL_CORE_SERVICE_H
81 
82 
83 #include "lib/error.hpp"
84 #include "lib/nocopy.hpp"
85 #include "lib/idi/entry-id.hpp"
86 #include "lib/diff/gen-node.hpp"
89 #include "gui/ctrl/bus-term.hpp"
90 #include "gui/ctrl/nexus.hpp"
91 
92 
93 namespace gui {
94 namespace ctrl{
95 
97  using lib::diff::Rec;
98 
99 
108  : public BusTerm
110  {
111 
114 
115 
116  virtual void
117  act (GenNode const& command) override
118  {
119  SessionCommand::facade().trigger (command.idi.getSym(), command.data.get<Rec>());
120  }
121 
122 
123  virtual void
124  note (ID subject, GenNode const& stateMark) override
125  {
126  stateRecorder_.recordState (subject, stateMark);
127  }
128 
129 
130  public:
131  explicit
133  : BusTerm(identity, uiBusBackbone_)
134  , uiBusBackbone_{*this}
135  , stateRecorder_{*this}
136  {
137  INFO (gui, "UI-Backbone operative.");
138  }
139 
140  ~CoreService();
141 
142 
143  StateManager&
145  {
146  return stateRecorder_;
147  }
148  };
149 
150 
151 
152 }} // namespace gui::ctrl
153 #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