Lumiera  0.pre.03
»edit your freedom«
gesture-state.cpp
Go to the documentation of this file.
1 /*
2  GestureState - holder for interaction-state dedicated to specific gestures
3 
4  Copyright (C) Lumiera.org
5  2021, 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 
40 #include "stage/gtk-base.hpp"
43 #include "lib/format-string.hpp"
44 //#include "lib/symbol.hpp"
45 //#include "lib/util.hpp"
46 
47 //#include <string>
48 //#include <map>
49 using util::_Fmt;
50 
51 //using std::map;
52 //using std::string;
53 
54 //using util::contains;
55 //using util::isnil;
56 
57 namespace stage {
58 namespace interact {
59 
60  namespace error = lumiera::error;
61 
62  namespace { // internal details
63 
64  } // internal details
65 
66 
67 
68  GestureState::~GestureState() { } // emit dtors of managed objects here....
69 
70  GestureState::GestureState()
71  : dragRelocate_{new DragRelocateController{}}
72  { }
73 
74 
75 
76 
77 
85  GestureState::getStateFor (Action action, Scope qualifier)
86  {
87  if (DRAG==action and ON_TIMELINE==qualifier)
88  return *dragRelocate_;
89  else
90  throw error::State (_Fmt{"Unforeseen interaction state in Lumiera UI requested. "
91  "GestureState::getStateFor... Action=%d Scope=%d"}
92  % action
93  % qualifier);
94  }
95 
96 
97 }} // namespace stage::interact
InteractionState & getStateFor(Action action, Scope qualifier)
Decode the classification of the kind of interaction and gesture, and thus translate to a concrete In...
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.
Derived specific exceptions within Lumiera&#39;s exception hierarchy.
Definition: error.hpp:199
Lumiera GTK UI implementation root.
Definition: guifacade.cpp:46
Gesture controller for dragging objects within the Timeline display.
A set of basic GTK includes for the UI.
Concrete implementation of a dragging gesture to relocate an UI entity.