Lumiera  0.pre.03
»edit your freedom«
cmd-context.cpp
Go to the documentation of this file.
1 /*
2  CmdContext - interface to access command context binding services within the UI
3 
4  Copyright (C)
5  2017, Hermann Vosseler <Ichthyostega@web.de>
6 
7   **Lumiera** is free software; you can redistribute it and/or modify it
8   under the terms of the GNU General Public License as published by the
9   Free Software Foundation; either version 2 of the License, or (at your
10   option) any later version. See the file COPYING for further details.
11 
12 * *****************************************************************/
13 
14 
28 //#include "lib/util.hpp"
29 //#include "lib/symbol.hpp"
30 #include "lib/depend.hpp"
31 //#include "include/logging.h"
32 #include "include/ui-protocol.hpp"
35 #include "lib/format-string.hpp"
36 
37 //#include <string>
38 //#include <map>
39 
40 //using std::map;
41 //using std::string;
42 
43 //using util::contains;
44 //using util::isnil;
45 using util::_Fmt;
46 
47 namespace stage {
48 namespace interact {
49  namespace error = lumiera::error;
50 
51  namespace { // internal details
53 
54  inline InteractionState&
55  selectStateImplementation (Symbol ctxID)
56  {
57  if ( GESTURE_dragReolcate == ctxID)
58  return gestures().getStateFor (GestureState::DRAG, GestureState::ON_TIMELINE);
59  throw error::Config (_Fmt{"Unknown Context-ID '%s' encountered in Gesture wiring."}
60  % ctxID);
61  }
62  } // internal details
63 
64 
65 
66  Subject::~Subject() { } // Emit VTable here...
67 
69 
70 
71 
77  CmdContext::of (Symbol cmdID, Symbol ctxID)
78  {
79 
80  return CmdContext {selectStateImplementation(ctxID), cmdID};
81  }
82 
83 
84  void
86  {
87  REQUIRE (subject_);
88  iState_.linkTrigger (*subject_, cmdID_);
89  }
90 
91 
92 
99  CmdContext::Resolver::operator LuidH ()
100  {
101  REQUIRE (this->spec > 0); //note we can access the spec embedded in the Resolver struct
102  UNIMPLEMENTED ("forward the resolution operation, probably to InteractionDirector or similar...");
103  }
104 
105 
108 }} // namespace stage::interact
Hard wired key constants and basic definitions for communication with the GUI.
virtual ~Subject()
this is an interface
Definition: cmd-context.cpp:66
Sub-Service of the InteractionDirector: Hold and maintain InteractionState.
Front-end for printf-style string template interpolation.
A front-end for using printf-style formatting.
Abstract foundation for context dependent UI interactions.
Access point to singletons and other kinds of dependencies designated by type.
Definition: depend.hpp:280
void setupRelocateDrag()
Terminal builder operation: establish the infrastructure for the already defined participants to be i...
Definition: cmd-context.cpp:85
Derived specific exceptions within Lumiera&#39;s exception hierarchy.
Definition: error.hpp:190
Token or Atom with distinct identity.
Definition: symbol.hpp:117
static CmdContext of(Symbol cmdID, Symbol ctxID)
global static service accessor function.
Definition: cmd-context.cpp:77
Lumiera GTK UI implementation root.
Definition: guifacade.cpp:37
Singleton services and Dependency Injection.
Hash implementation based on a lumiera unique object id (LUID) When invoking the default ctor...
Builder to define a binding to relate some entity or place within the UI with a specific from of inte...
Abstraction: support for binding command invocation into an UI context.
virtual ~GestureObserver()
this is an interface
Definition: cmd-context.cpp:68