Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
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
71namespace stage {
72namespace ctrl{
73 class PanelLocator;
74}
75namespace interact {
76
77 using std::unique_ptr;
78 using std::string;
79 using lib::Symbol;
80
81 class UILocationSolver;
82
83
84
92 {
94
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&
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*/
Configuration handle to expose a service implementation through the Depend<SRV> front-end.
Access point to singletons and other kinds of dependencies designated by type.
Definition depend.hpp:281
Token or Atom with distinct identity.
Definition symbol.hpp:120
Describe a location within the UI through structural/topological coordinates.
Definition ui-coord.hpp:131
Access or allocate a UI component view.
V & get()
Access and possibly create just some component view of the desired type.
lib::Depend< model::ElementAccess > elementAccess
Service_LocationSolver locResolver_
Any copy and copy construction prohibited.
Definition nocopy.hpp:38
Per type specific configuration of instances created as service dependencies.
Interface to discover and access raw UI elements in a cross cutting way.
Generic functions to build identification schemes.
Hard wired definitions for the object identification system used within the UI.
Lumiera GTK UI implementation root.
Definition guifacade.cpp:37
Mix-Ins to allow or prohibit various degrees of copying and cloning.
Marker types to indicate a literal string and a Symbol.
A framework for configuration of view access and allocation patterns.