From 6073dbfcaf23ffcacea0a5ee3c47a8ba90afb0bc Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sun, 24 Sep 2017 17:20:47 +0200 Subject: [PATCH] UI-Coordinates: stub basic access operations (WIP) --- src/gui/interact/ui-coord.hpp | 148 ++++++++++++++++- tests/gui/interact/ui-coord-test.cpp | 4 +- wiki/thinkPad.ichthyo.mm | 230 ++++++++++++++++----------- 3 files changed, 283 insertions(+), 99 deletions(-) diff --git a/src/gui/interact/ui-coord.hpp b/src/gui/interact/ui-coord.hpp index 8321f5e08..8914ec51c 100644 --- a/src/gui/interact/ui-coord.hpp +++ b/src/gui/interact/ui-coord.hpp @@ -53,7 +53,7 @@ #include "lib/symbol.hpp" //#include -//#include +#include //#include @@ -61,13 +61,68 @@ namespace gui { namespace interact { // using std::unique_ptr; -// using std::string; + using std::string; using lib::Literal; // class GlobalCtx; + /** + * @internal Base abstraction for path-like topological coordinates. + */ + class PathArray + { + public: + template + explicit + PathArray (ARGS&& ...args) + { + UNIMPLEMENTED ("initialise path array components"); + } + + // standard copy operations acceptable + + + size_t + size() const + { + UNIMPLEMENTED ("path implementation storage"); + } + + bool + empty() const + { + UNIMPLEMENTED ("path implementation storage"); + } + + + Literal + operator[] (size_t idx) + { + UNIMPLEMENTED ("path implementation storage"); + } + + using iterator = const char*; /////////////TODO placeholder + + iterator begin() const { UNIMPLEMENTED ("content iteration"); } + iterator end() const { UNIMPLEMENTED ("content iteration"); } + + friend iterator begin(PathArray const& pa) { return pa.begin();} + friend iterator end (PathArray const& pa) { return pa.end(); } + }; + + enum UIPathElm + { + UIC_WINDOW, + UIC_PERSP, + UIC_PANEL, + UIC_VIEW, + UIC_TAB, + UIC_PART + }; + + /** * Describe a location within the UI through structural/topological coordinates. * A UICoord specification is a tuple, elaborating a path through the hierarchy @@ -76,15 +131,38 @@ namespace interact { * @todo initial draft as of 9/2017 */ class UICoord + : public PathArray { public: + using PathArray::PathArray; + + /* === Builder API === */ + static UICoord currentWindow() { UNIMPLEMENTED ("UI coordinate builder function to indicate coordinates rooted within the current window"); } + static UICoord + window (Literal windowID) + { + UNIMPLEMENTED ("UI coordinate builder function to indicate coordinates rooted within a specific window"); + } + + static UICoord + view (Literal viewID) + { + UNIMPLEMENTED ("UI coordinate builder function to start a partially defined coordinate path"); + } + + UICoord + persp (Literal perspectiveID) const + { + UNIMPLEMENTED ("augment UI coordinates to mandate a specific perspective to be active within the window"); + } + UICoord view (Literal viewID) const { @@ -103,6 +181,72 @@ namespace interact { UNIMPLEMENTED ("augment UI coordinates to indicate a tab specified by index number"); } + UICoord + append (Literal elmID) const + { + UNIMPLEMENTED ("augment UI coordinates by appending a further component at the end"); + } + + UICoord + prepend (Literal elmID) const + { + UNIMPLEMENTED ("augment partially defined UI coordinates by extending them towards the root"); + } + + + /* === named component access === */ + + Literal + getWindow() const + { + UNIMPLEMENTED ("UI coordinate component access"); + } + + Literal + getPersp() const + { + UNIMPLEMENTED ("UI coordinate component access"); + } + + Literal + getPanel() const + { + UNIMPLEMENTED ("UI coordinate component access"); + } + + Literal + getView() const + { + UNIMPLEMENTED ("UI coordinate component access"); + } + + Literal + getTab() const + { + UNIMPLEMENTED ("UI coordinate component access"); + } + + + /* === String representation === */ + + operator string() const + { + UNIMPLEMENTED ("string representation of UI coordinates"); + } + + string + getComp() const + { + UNIMPLEMENTED ("string representation of UI coordinates: component section"); + } + + string + getPath() const + { + UNIMPLEMENTED ("string representation of UI coordinates: path extension"); + } + + private: public: diff --git a/tests/gui/interact/ui-coord-test.cpp b/tests/gui/interact/ui-coord-test.cpp index f5a6a5352..d024a307b 100644 --- a/tests/gui/interact/ui-coord-test.cpp +++ b/tests/gui/interact/ui-coord-test.cpp @@ -34,10 +34,10 @@ //#include "lib/diff/gen-node.hpp" #include "lib/util.hpp" -//#include +#include -//using std::string; +using std::string; //using lib::idi::EntryID; //using lib::diff::GenNode; //using util::isSameObject; diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 12bf80091..985b78e09 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -3543,86 +3543,7 @@ - - - - - - - - - - - - - - - - - - -

- ...was für verschiedene Arten von Zugriff -

-

- sind denkbar und müssen in der Strategy konfigurierbar sein? -

- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- mögliche -

-

- Komponenten -

- - -
- - - - - - - - - - - - - - - + @@ -3632,10 +3553,9 @@ UI-Koordinaten (UICoord)

- -
+ - + @@ -3685,8 +3605,7 @@ ...and this anchorage can be covered and backed by the currently existing UI configuration

- - +
@@ -3698,8 +3617,7 @@ ...by interpolation of some wildcards

- -
+
@@ -3711,8 +3629,7 @@ ...need to be extended to allow anchoring

- -
+
@@ -3750,8 +3667,7 @@ we may construct the covered part of a given spec, including automatic anchoring.

- - +
@@ -3773,8 +3689,7 @@ designated by the given coordinate spec

- - + @@ -3788,10 +3703,135 @@ + + + + + + + + + + + + + + + + + + +

+ ...was für verschiedene Arten von Zugriff +

+

+ sind denkbar und müssen in der Strategy konfigurierbar sein? +

+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ mögliche +

+

+ Komponenten +

+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ wie funktioniert +

+

+ Pfad-Navigation? +

+ +
+ + + + + + + + + + + + + + + + @@ -3886,7 +3926,7 @@ - + @@ -3919,7 +3959,7 @@ - +