2017-03-08 04:25:33 +01:00
|
|
|
/*
|
2017-04-17 20:00:07 +02:00
|
|
|
CmdContext - interface to access command context binding services within the UI
|
2017-03-08 04:25:33 +01:00
|
|
|
|
|
|
|
|
Copyright (C) Lumiera.org
|
|
|
|
|
2017, 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.
|
|
|
|
|
|
|
|
|
|
* *****************************************************/
|
|
|
|
|
|
|
|
|
|
|
2017-04-17 20:00:07 +02:00
|
|
|
/** @file cmd-context.cpp
|
|
|
|
|
** Implementation details of support for context-bound commands.
|
2017-03-08 04:25:33 +01:00
|
|
|
**
|
2017-04-08 16:24:36 +02:00
|
|
|
** @see TODO___cmd-access-test.cpp
|
2017-03-08 04:25:33 +01:00
|
|
|
**
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//#include "lib/util.hpp"
|
|
|
|
|
//#include "lib/symbol.hpp"
|
|
|
|
|
//#include "include/logging.h"
|
2017-04-17 20:00:07 +02:00
|
|
|
#include "gui/interact/cmd-context.hpp"
|
2017-03-08 04:25:33 +01:00
|
|
|
|
|
|
|
|
//#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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-17 20:00:07 +02:00
|
|
|
CmdContext::~CmdContext() { } // Emit dtors of embedded objects here...
|
2017-03-08 04:25:33 +01:00
|
|
|
|
|
|
|
|
|
2017-04-17 20:44:25 +02:00
|
|
|
/** global static service accessor function.
|
|
|
|
|
* @remarks the implementation of this function taps into the UI-Backbone
|
|
|
|
|
* to access the InteractionDirector for the context interaction state
|
|
|
|
|
*/
|
|
|
|
|
CmdContext&
|
|
|
|
|
CmdContext::of (Symbol cmdID, string ctxID)
|
|
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED ("context-bound commands: tap into the InteractionDirector to access the interaction state");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @remarks this service is used to resolve command arguments
|
|
|
|
|
* based on the current state of UI interaction. This can be used
|
|
|
|
|
* to get e.g. the scope enclosing the element currently in focus
|
|
|
|
|
*/
|
|
|
|
|
CmdContext::Resolver::operator LuidH ()
|
|
|
|
|
{
|
|
|
|
|
REQUIRE (this->spec > 0); //note we can access the spec embedded in the Resolver struct
|
|
|
|
|
UNIMPLEMENTED ("forward the resolution operation, probably to InteractionDirector or similar...");
|
|
|
|
|
}
|
2017-03-08 04:25:33 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/** nonsense */
|
|
|
|
|
|
|
|
|
|
}} // namespace gui::interact
|