UI-top-level: simplify name and namespace

the (Presentation)StateManager interface and implementation
seems to fit in more into the ctrl package
This commit is contained in:
Fischlurch 2017-02-19 04:27:09 +01:00
parent 4f1def6366
commit 60adaa5639
10 changed files with 41 additions and 96 deletions

View file

@ -1,5 +1,5 @@
/*
PRESENTATION-STATE-MANAGER.hpp - maintaining persistent interface state
STATE-MANAGER.hpp - maintaining persistent interface state
Copyright (C) Lumiera.org
2016, Hermann Vosseler <Ichthyostega@web.de>
@ -21,7 +21,7 @@
*/
/** @file presentation-state-manager.hpp
/** @file state-manager.hpp
** Interface: a component to maintain persistent interface state.
** Here, "presentation state" is understood as state not rooted within the
** model and without effect on the final rendered result. Most of this state
@ -49,8 +49,8 @@
*/
#ifndef GUI_INTERACT_PRESENTATION_STATE_MANAGER_H
#define GUI_INTERACT_PRESENTATION_STATE_MANAGER_H
#ifndef GUI_CTRL_STATE_MANAGER_H
#define GUI_CTRL_STATE_MANAGER_H
#include "lib/idi/entry-id.hpp"
@ -61,7 +61,7 @@
namespace gui {
namespace interact {
namespace ctrl {
using std::string;
@ -76,11 +76,11 @@ namespace interact {
* element, and recorded per distinct property within each
* element.
*/
class PresentationStateManager
class StateManager
: boost::noncopyable
{
protected:
virtual ~PresentationStateManager(); ///< this is an interface
virtual ~StateManager(); ///< this is an interface
using ID = lib::idi::BareEntryID const&;
using StateMark = lib::diff::GenNode const&;
@ -109,5 +109,5 @@ namespace interact {
}} // namespace gui::interact
#endif /*GUI_INTERACT_PRESENTATION_STATE_MANAGER_H*/
}} // namespace gui::ctrl
#endif /*GUI_CTRL_STATE_MANAGER_H*/

View file

@ -49,7 +49,7 @@
namespace gui {
namespace interact {
namespace ctrl {
using lib::idi::BareEntryID;
using lib::diff::GenNode;
@ -222,5 +222,5 @@ namespace interact {
}} // namespace gui::interact
}} // namespace gui::ctrl
#endif /*GUI_INTERACT_STATE_MAP_GROUPING_STORAGE_H*/

View file

@ -49,22 +49,22 @@
*/
#ifndef GUI_INTERACT_STATE_RECORDER_H
#define GUI_INTERACT_STATE_RECORDER_H
#ifndef GUI_CTRL_STATE_RECORDER_H
#define GUI_CTRL_STATE_RECORDER_H
#include "lib/error.hpp"
#include "lib/idi/entry-id.hpp"
#include "lib/diff/gen-node.hpp"
#include "gui/ctrl/bus-term.hpp"
#include "gui/interact/presentation-state-manager.hpp"
#include "gui/interact/state-map-grouping-storage.hpp"
#include "gui/ctrl/state-manager.hpp"
#include "gui/ctrl/state-map-grouping-storage.hpp"
#include <string>
namespace gui {
namespace interact {
namespace ctrl {
using gui::ctrl::BusTerm;
using lib::diff::GenNode;
@ -89,7 +89,7 @@ namespace interact {
* @see StateMapGroupingStorage storage implementation
*/
class StateRecorder
: public PresentationStateManager
: public StateManager
{
using Storage = StateMapGroupingStorage;
using Record = Storage::Record const&;
@ -198,5 +198,5 @@ namespace interact {
}} // namespace gui::interact
#endif /*GUI_INTERACT_STATE_RECORDER_H*/
}} // namespace gui::ctrl
#endif /*GUI_CTRL_STATE_RECORDER_H*/

View file

@ -29,6 +29,7 @@
//#include "gui/gtk-lumiera.hpp"
#include "gui/ctrl/ui-state.hpp"
#include "gui/ctrl/state-manager.hpp"
#include "gui/interact/focus-tracker.hpp"
//#include "gui/ctrl/global-ctx.hpp"
//#include "lib/util.hpp"
@ -43,6 +44,10 @@ namespace ctrl {
using interact::FocusTracker;
// emit VTable here...
StateManager::~StateManager()
{ }
// emit nested dtor code here...
UiState::~UiState()
{ }

View file

@ -1,62 +0,0 @@
/*
PresentationStateManager - maintaining persistent interface state
Copyright (C) Lumiera.org
2016, Hermann Vosseler <Ichthyostega@web.de>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *****************************************************/
/** @file presentation-state-manager.cpp
** Implementation details of persistent presentation state organisation.
**
** @see BusTerm_test
**
*/
//#include "lib/util.hpp"
//#include "lib/symbol.hpp"
//#include "include/logging.h"
#include "gui/interact/presentation-state-manager.hpp"
//#include <boost/noncopyable.hpp>
//#include <string>
//#include <map>
//using std::map;
//using std::string;
//using util::contains;
//using util::isnil;
namespace gui {
namespace interact {
namespace { // internal details
} // internal details
PresentationStateManager::~PresentationStateManager() { } // Emit VTables here...
/** nonsense */
}} // namespace gui::interact

View file

@ -136,7 +136,9 @@ namespace gui {
}// namespace gui::controller
///////////////////////////////////////////////////////////////////////////////////TICKET #959 : scheduled for termination....
namespace ctrl {
class StateManager;
class CoreService;
class BusTerm;
}

View file

@ -24,7 +24,7 @@
#include "lib/test/run.hpp"
#include "lib/test/test-helper.hpp"
#include "gui/ctrl/bus-term.hpp"
#include "gui/interact/presentation-state-manager.hpp"
#include "gui/ctrl/state-manager.hpp"
#include "test/test-nexus.hpp"
#include "test/mock-elm.hpp"
#include "lib/idi/entry-id.hpp"
@ -38,7 +38,7 @@
using lib::idi::EntryID;
using lib::idi::BareEntryID;
using gui::interact::PresentationStateManager;
using gui::ctrl::StateManager;
using gui::ctrl::BusTerm;
using gui::test::MockElm;
using lib::diff::GenNode;
@ -244,7 +244,7 @@ namespace test {
{
MARK_TEST_FUN
gui::test::Nexus::startNewLog();
PresentationStateManager& stateManager = gui::test::Nexus::useMockStateManager();
StateManager& stateManager = gui::test::Nexus::useMockStateManager();
MockElm mockA("alpha"); BareEntryID alpha = mockA.getID();
MockElm mockB("bravo"); BareEntryID bravo = mockB.getID();
@ -287,7 +287,7 @@ namespace test {
replayStateMark()
{
MARK_TEST_FUN
PresentationStateManager& stateManager = gui::test::Nexus::getMockStateManager();
StateManager& stateManager = gui::test::Nexus::getMockStateManager();
MockElm mockA("alpha");
// no "bravo" this time

View file

@ -23,7 +23,7 @@
#include "lib/test/run.hpp"
#include "lib/test/test-helper.hpp"
#include "gui/interact/state-map-grouping-storage.hpp"
#include "gui/ctrl/state-map-grouping-storage.hpp"
#include "lib/idi/entry-id.hpp"
#include "lib/diff/gen-node.hpp"
#include "lib/util.hpp"
@ -39,7 +39,7 @@ using util::isnil;
namespace gui {
namespace interact{
namespace ctrl {
namespace test {
using lumiera::error::LUMIERA_ERROR_WRONG_TYPE;

View file

@ -50,7 +50,7 @@
#include "lib/test/event-log.hpp"
#include "gui/ctrl/nexus.hpp"
#include "gui/ctrl/mutation-message.hpp"
#include "gui/interact/state-recorder.hpp"
#include "gui/ctrl/state-recorder.hpp"
#include "proc/control/command.hpp"
#include "lib/diff/gen-node.hpp"
#include "lib/idi/entry-id.hpp"
@ -77,8 +77,8 @@ using lib::idi::instanceTypeID;
using lib::test::EventLog;
using gui::ctrl::BusTerm;
using gui::ctrl::MutationMessage;
using gui::interact::PresentationStateManager;
using gui::interact::StateRecorder;
using gui::ctrl::StateManager;
using gui::ctrl::StateRecorder;
using proc::control::Command;
using proc::control::CommandImpl;
using proc::control::HandlingPattern;
@ -609,7 +609,7 @@ namespace test{
: StateRecorder{testNexus()}
{ }
using PresentationStateManager::clearState;
using StateManager::clearState;
};
lib::Depend<SimulatedStateManager> stateManager;
@ -626,7 +626,7 @@ namespace test{
* notification messages appearing after that point
* at the test-UI-Bus will be accounted for.
*/
interact::PresentationStateManager&
ctrl::StateManager&
Nexus::useMockStateManager()
{
// discard possible leftover
@ -642,7 +642,7 @@ namespace test{
return getMockStateManager();
}
interact::PresentationStateManager&
ctrl::StateManager&
Nexus::getMockStateManager()
{
return stateManager();

View file

@ -48,7 +48,7 @@
#include "lib/error.hpp"
#include "gui/ctrl/bus-term.hpp"
#include "gui/model/tangible.hpp"
#include "gui/interact/presentation-state-manager.hpp"
#include "gui/ctrl/state-manager.hpp"
#include "test/placeholder-command.hpp"
#include "lib/test/event-log.hpp"
#include "lib/diff/gen-node.hpp"
@ -97,8 +97,8 @@ namespace test{
static void setStateMarkHandler (StateMarkHandler =StateMarkHandler());
static interact::PresentationStateManager& useMockStateManager();
static interact::PresentationStateManager& getMockStateManager();
static ctrl::StateManager& useMockStateManager();
static ctrl::StateManager& getMockStateManager();
using Cmd = interact::InvocationTrail;