From ff1b22a8898df663372743c985c8c2562cd29482 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Thu, 14 Sep 2017 22:24:54 +0200 Subject: [PATCH] UI-Coordinates: DSL draft (WIP) --- tests/gui/interact/view-spec-dsl-test.cpp | 25 +++++++++++++++++++++++ wiki/thinkPad.ichthyo.mm | 5 ++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/tests/gui/interact/view-spec-dsl-test.cpp b/tests/gui/interact/view-spec-dsl-test.cpp index 5674d0d2e..4e87e3a0e 100644 --- a/tests/gui/interact/view-spec-dsl-test.cpp +++ b/tests/gui/interact/view-spec-dsl-test.cpp @@ -28,6 +28,7 @@ #include "lib/test/run.hpp" //#include "lib/test/test-helper.hpp" #include "gui/interact/view-spec-dsl.hpp" +#include "gui/interact/ui-coord.hpp" //#include "lib/idi/entry-id.hpp" //#include "lib/diff/gen-node.hpp" //#include "lib/util.hpp" @@ -83,6 +84,30 @@ namespace test { void verify_standardUsage() { + using LocSpec = Spec; + using CntSpec = Spec; + + uint allocCounter = 0; + + LocSpec::Builder locationToken =[&](string pathElm) + { + return [pathElm]() + { + return UICoord::currentWindow().view(pathElm); + }; + }; + + CntSpec::Builder allocationToken =[&](uint limit) + { + return [&,limit](UICoord target) + { + if (allocCounter < target) + return UICoord::currentWindow().view(pathElm).elm(++allocCounter); + else + return UICoord::currentWindow().view(pathElm).elm(limit); + }; + }; + UNIMPLEMENTED ("demonstrate the standard usage pattern"); } diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index eb9567564..1ef9baf74 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -3654,7 +3654,7 @@ - + @@ -3847,6 +3847,9 @@ + + +