Lumiera  0.pre.03
»edit your freedom«
view-locator.hpp
Go to the documentation of this file.
1 /*
2  VIEW-LOCATOR.hpp - access and allocation of UI component views
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 
55 #ifndef STAGE_INTERACT_VIEW_LOCATOR_H
56 #define STAGE_INTERACT_VIEW_LOCATOR_H
57 
58 #include "lib/depend-inject.hpp"
59 #include "stage/id-scheme.hpp"
62 #include "lib/idi/genfunc.hpp"
63 #include "lib/symbol.hpp"
64 #include "lib/nocopy.hpp"
65 
66 #include <functional>
67 #include <string>
68 #include <memory>
69 
70 
71 namespace stage {
72 namespace ctrl{
73  class PanelLocator;
74 }
75 namespace interact {
76 
77  using std::unique_ptr;
78  using std::string;
79  using lib::Symbol;
80 
81  class UILocationSolver;
82 
83 
84 
92  {
94 
96  Service_LocationSolver locResolver_;
97 
98 
99  public:
100  ViewLocator ();
101  ~ViewLocator();
102 
103 
107  template<class V>
108  V& get();
109 
110  private:
111  /* === accessors to sibling global services === */
112 
113  };
114 
115 
116 
117  template<class V>
118  inline V&
119  ViewLocator::get()
120  {
121  auto& viewSpec = idi::viewSpec<V>();
122  Symbol viewID{lib::idi::typeSymbol<V>()};
123 
124  UICoord targetLocation = viewSpec.locate(viewID);
125  UICoord realView = viewSpec.alloc (targetLocation);
126 
127  return elementAccess().access<V> (realView);
128  }
129 
130 
131 }}// namespace stage::interact
132 #endif /*STAGE_INTERACT_VIEW_LOCATOR_H*/
Access or allocate a UI component view.
Describe a location within the UI through structural/topological coordinates.
Definition: ui-coord.hpp:129
Hard wired definitions for the object identification system used within the UI.
Configuration handle to expose a service implementation through the Depend<SRV> front-end.
A framework for configuration of view access and allocation patterns.
Any copy and copy construction prohibited.
Definition: nocopy.hpp:37
Per type specific configuration of instances created as service dependencies.
Access point to singletons and other kinds of dependencies designated by type.
Definition: depend.hpp:280
Generic functions to build identification schemes.
Interface to discover and access raw UI elements in a cross cutting way.
Descriptor< VIEW > & viewSpec()
Access point: Factory for "view specs".
Token or Atom with distinct identity.
Definition: symbol.hpp:117
Mix-Ins to allow or prohibit various degrees of copying and cloning.
Marker types to indicate a literal string and a Symbol.
Lumiera GTK UI implementation root.
Definition: guifacade.cpp:37