Lumiera
0.pre.03
»edit your freedom«
|
Go to the source code of this file.
Evaluation of UI coordinates against a concrete window topology.
UI-Coordinates allow to describe and locate an interface component within the Lumiera GUI through a topological access path. As such these coordinate specifications are abstract, and need to be related, attached or resolved against the actual configuration of widgets in the UI. Through this relation it becomes possible to pose meaningful queries over these coordinates, or to build, rebuild and remould a coordinate specification.
We need to avoid tainting with the intrinsics of the actual UI toolkit though – which indicates the UICoordResolver should be designed as an abstract intermediary, built on top of a command and query interface, provided by the Navigator and backed by the actual UI configuration.
The abstraction used to found this interface is twofold. For one, we rely on the notion of logical, topological Coordinates in User Interface space. And secondly, we rely on a very limited form of navigation: we navigate a tree-shaped (abstracted) structure just by
flatMap
operation known from functional programming. Together, these two capabilities allow us to build exploring and backtracking evaluations, which is enough to build a secondary helper component on top, the stage::interact::UICoordResolverSuch a resolver can be used to relate and match a given, incomplete UI coordinate specification (a "pattern") against the actual UI topology. Evaluation is accomplished by first constituting an anchoring, followed by traversal of the coordinate spec and matching against a navigation path within the actual UI window configuration. This process might involve interpretation of some meta-symbols and interpolation of wildcards.
As indicated above, the coordinate resolver internally relies on a context query interface, to find out about existing windows, panels, views and tabs and to navigate the real UI structure. The actual implementation of this context query interface is backed by the Navigator component exposed through the InteractionDirector.
In addition to the locally decidable properties of a coordinate spec, which are the explicitness and the presence of some component, several contextual predications may be queried:
In addition to querying the interpretation of a given coordinate spec with respect to the current UI environment, it is also possible to rewrite or extend the spec based on this environment
Definition in file ui-coord-resolver.hpp.
#include "lib/error.hpp"
#include "lib/symbol.hpp"
#include "lib/format-string.hpp"
#include "stage/interact/ui-coord.hpp"
#include "lib/iter-explorer.hpp"
#include "lib/iter-source.hpp"
#include "lib/depend.hpp"
#include "lib/util.hpp"
#include <utility>
#include <memory>
Classes | |
class | LocationQuery |
Interface to discover a backing structure for the purpose of path navigation and resolution. More... | |
struct | UICoordResolver::Resolution |
class | TreeStructureNavigator |
Interface to locate and move within a tree shaped structure. More... | |
class | UICoordResolver |
Query and mutate UICoord specifications in relation to actual UI topology. More... | |
Namespaces | |
stage | |
Lumiera GTK UI implementation root. | |
stage::interact | |
UI interaction control. | |
struct stage::interact::UICoordResolver::Resolution |
Class Members | ||
---|---|---|
const char * | anchor | |
size_t | depth | |
unique_ptr< UICoord > | covfefe | |
bool | isResolved |