Commit graph

166 commits

Author SHA1 Message Date
8097485dbf ViewSpec: integrate the simple View access case (Unit test PASS)
This finishes the first round of design drafts in this area.
Right now it seems difficult to get any further, since most of
the actual view creation and management in the UI is not yet coded.
2018-06-15 18:02:08 +02:00
800fc5915a ViewSpec: recast the ElementAccess API to work around the design problem
...it is not really solved, rather postponed.
But who knows. Maybe it's already good enough...
2018-06-15 16:42:51 +02:00
f55a8f606b ...one month later: pick up after the LAC.18 Berlin
...happened to be completely absorbed by the preparations
for my workshop about Yoshimi and musical presets
2018-06-14 17:02:34 +02:00
363d24ba91 ViewSpec: unsuccessful atempt to implement the allocator token
looks like we're hitting a design mismatch here....

...and unfortunately I have to abandon this task now and concentrate
on preparation of my talk at LAC.2018 in June
2018-06-14 15:13:06 +02:00
f1ea503cfa ViewSpec: singleton factory to organise the actual ViewSpec DSL tokens
it seems apropriate to move the base definition of gui::idi::Descriptor<VIEW>
into view-spec-dsl.hpp and only retain the actual DSL definitions in id-scheme.hpp
2018-05-06 01:45:38 +02:00
d0538a55ff ViewSpec: implement the generic access function in ViewLocator
still missing: internal wiring from the allocation token(s) of the DSL
into the ElementAccess service designed last week.
2018-04-15 03:07:54 +02:00
ba3d9e57b5 ViewSpec: draft a way to code an integration test for ViewLocator (#1129)
The original goal for #1129 (ViewSpecDSL_test) is impossible to accomplish,
at least within our existing test framework. Thus I'll limit myself to coding
a clean-room integration test with purely synthetic DSL definitions and mock widgets
2018-04-15 01:39:46 +02:00
a565fc3321 ElementAccess: rearrange files according to namespace 2018-04-14 02:06:31 +02:00
ca9abaa9d9 ElementAccess: change wiring in ViewLocator into a dependency
...reduce immediate coupling, since we do not really now what actions ElementAccess
will actually perform, and this is likely to remain this way for some time.
So just let it sit there are an on-demand dependency.

Moreover, create an (empty placeholder) implementation within WindowLocator.
So everything is set now for the actual implementation to be filled in
2018-04-07 02:55:47 +02:00
09359cf92a ElementAccess: initial brainstorming about the interface mechanics 2018-04-07 02:28:29 +02:00
dc97ab5546 ElementAccess: consider helper to encapsulte access to actual GTK structures (#1134) 2018-04-07 01:00:25 +02:00
eae775b725 ViewSpec: rearrange dependencies to simplify testing
...but still not clear yet what we actually need to access from within the ViewSpecDSL_test
2018-04-05 22:23:34 +02:00
64d5f868ea ViewSpec: and finally solve the daunting problem of service access
this is f***ng unbelievable.
Its just two lines of code now
VICTORY!
2018-04-04 04:37:13 +02:00
cb6155c85e ViewSpec: now turn the UILocationSolver into yet another global service
feels a bit uncanny after all
can't be *that* easy
2018-04-04 03:59:11 +02:00
4de2ea2abe ViewSpec: get rid of all the lambdas and global vars. LocationQuery is a service now
Harvesting the fruits of the DependencyFactory rework....
2018-04-04 03:48:53 +02:00
71bb2b48b6 ViewSpec: pick up with dependency-injection into the DSL tokens (#1126)
Attempt to find my way back to the point
where the digression regarding dependency-injection started.

As it turns out, this was a valuable digression, since we can rid ourselves
from lots of ad-hoc functionality, which basically does in a shitty way
what DependencyFactory now provides as standard solution


FIRST STEP is to expose the Navigator as generic "LocationQuery" service
through lib::Depend<LocationQuery>
2018-04-04 03:29:26 +02:00
685a9b84ee Library: replace boost::noncopyable by our own library solution
Benefits
 - get rid of yet another pervasive Boost dependency
 - define additional more fine grained policies (move only, clonable)
2018-03-24 05:35:13 +01:00
9ca9b1b89a ViewSpec: clarify how the inline DSL spec is transformed into a rule set
several nested repackaging ctor calls here.
In the end, it's an UICoord array, which is moved into heap storage within the rules set
2018-03-05 00:56:43 +01:00
69f87e994c ViewSpec: decide how to cast the types for building the DSL
we'll use a typedef to represent the default case
and provide the level within the UI-Tree as template parameter for the generic case

This avoids wrapping each definition into a builder function, which will be
the same function for 99% of the cases, and it looks rather compact and natural
for the default case, while still retaining genericity.

Another alternative would have been to inject the Tree-level at the invocation;
but doing so feels more like magic for me.
2018-02-24 04:25:41 +01:00
41b8d12b66 ViewSpec: reconsider how to build and structure the DSL (#1126)
...in the light of all the foundation components and frameworks created meanwhile
2018-02-23 05:07:39 +01:00
b6360b2e9c LocationSolver: automatically inject persp(UIC_ELIDED) (closes #1128)
decided to add a very specific preprocessing here, to make the DSL notation more natural.
My guess is that most people won't spot the presence of this tiny bit of magic,
and it would be way more surprising to have rules like

UICoord::currentWindow().panel("viewer").create()

fail in most cases, simply because there is a wildcard on the perspective
and the panel viewer does not (yet) exist. In such a case, we now turn the
perspective into a "existential quantified" wildcard, which is treated as if
the actually existing element was written explicitly into the pattern.
2018-02-17 05:11:34 +01:00
0f26f1e0f4 LocationSolver: Documentation and clean-up (#1127) 2018-02-17 03:45:07 +01:00
66cd1fcea8 UI-Coordinates: fix insidious bug
util::contains used to pick the overload for strings,
i.e. it first converted the UI-Coordinates to diagnostic output format
and then searched that string for '*' to determine if the pattern is explicit

works as expected, but not what you'd intend....
...and breaks spectacularly once you search for something as innocuous as '.'
2018-02-16 06:41:42 +01:00
983c490644 LocationSolver: test coverage for existentially quantified elements (#1128)
...and again spotted some really insidious bugs
2018-02-16 06:37:43 +01:00
0b21e816e3 LocationSolver: implement support for elided elements (#1128)
when used in a pattern for matching against the UI tree,
an element marked as UIC_ELIDED = "." is treated as existentially quantified.

This means, we assume / verify there *is* an element at that level,
but we do not care about what this element actually is. Within the
implementation, the handling is similar to a wildcard, yet such a
spec is not classified as a wildcard (it *is* an explicit element,
just not explicitly named).

The relevant consequence is that such an element matches at a leaf
position, while match on wildcards on leaf positions is prohibited,
to prevent arbitrary and nonsensical wildcard matches against
open ended patterns. Especially we need such an existential pattern
to express a rule to create elements from scratch, but within a
specific window with arbitrary (but existing) perspective.
2018-02-16 06:35:26 +01:00
98cab32a08 LocationSolver: several rule match test cases 2018-02-14 03:02:44 +01:00
92bf317d29 LocationSolver: long explicit path test cases
...and here a bug was hiding. gotcha
2018-02-13 02:46:43 +01:00
e04f61fe0d LocationSolver: length discriminating test cases 2018-02-11 04:16:58 +01:00
820abe2bef LocationSolver: provide DSL notation to write "create clauses" 2018-02-11 04:00:59 +01:00
a1ee7574ef LocationSolver: reorganise and complete the decision logic (#1127) 2018-02-09 23:49:36 +01:00
f8dd3a7030 LocationSolver: draft the success cases for a location solution 2018-02-09 04:10:53 +01:00
66bbf146a6 LocationSolver: implement this additional resolving flavour
coverPartially() now computes coverage solution and moves
that solution into place, while retaining the extraneous, uncovered part
2018-02-09 03:30:45 +01:00
c88a68a2a0 LocationSolver: need yet another flavour of the coordinate resolving mechanism
...this happens when you design a subsystem bottom-up
You build five items just to find out that in fact you need only a sixth item....
2018-02-08 03:00:38 +01:00
6022a8afb1 LocationSolver: draft outline of the solving loop 2018-02-08 02:50:48 +01:00
bf314482da LocationSolver: draft the simple usage scenario (unit test) (#1127) 2018-02-08 00:37:02 +01:00
1238d416fc LocationSolver: draft the DSL syntax for sequential alternatives (#1126)
turns out to be somewhat tricky.
The easy shot would be to use the comma operator,
but I don't like that idea, since in logic programming, comma means "and then".

So I prefer an || operator, similar to short-circuit evaluation of boolean OR

Unfortunately, OR binds stronger than assignment, so we need to trick our way
into a smooth DSL syntax by wrapping into intermediary marker types, and accept
rvalue references only, as additional safeguard to enforce the intended inline
definition syntax typical for DSL usage.
2018-02-07 04:24:33 +01:00
10d2cafba9 LocationSolver: draft entities involved in location solving (#1127)
basically this will be built on top of the path matching / resolving mechanism coded thus far.
but we'll need some additional flags and some DSL magic
2018-02-07 04:03:39 +01:00
136e78d023 DockAccess: decide on next steps towards integration (#1126) 2018-02-01 23:08:43 +01:00
1334dfb00d DockAccess: consider how to access the "location query" service
...which also involves some concept how actually to resolve location specifications
2018-01-15 03:56:28 +01:00
3c32cd5acb UI-top-level: decide upon the relation of ViewLocator and Navigator
...and how the former can rely on the latter, abstracted as LocationQuery
2018-01-15 03:56:28 +01:00
22e823fad5 DockAccess: finish setup of allocation specifications within the DSL 2018-01-15 03:56:23 +01:00
b6961e8f03 DockAccess: better pass functor as const& into partial application
seems to be the most orthogonal way to strip adornments from the SIG type
Moreover, we want to move the functor into the closure, where it will be stored anyay.
From there on, we can pass as const& into the binder (for creating the partially closed functor)
2018-01-13 00:58:08 +01:00
90a5d76fc9 DockAccess: solution how to bind partial application into generic lambda
...as it turned out, the result type was the problem: the lambda we provide
typically does not yield an Allocator, but only its baseclass function<UICoord(UICoord)>

solution: make Allocator a typedef, we don't expect any further functionality
2018-01-13 00:20:01 +01:00
5dea8eea1f DockAccess: draft how the partial application-builder for the DSL might work
...but not yet able to get it to compile.
Problem seems to be the generic lambda, which is itself a template.
Thus we need a way to instantiate that template with the correct arguments
prior to binding it into a std::function

been there, seen that recently (-> TreeExplorer, the Expander had a similar problem)
2018-01-12 05:50:01 +01:00
7385b3f525 DockAccess: pick up planning where I left it last September (#1104)
...this was quite an extensive digression, which basically gave us
a solid foundation for topological addressing and pattern matching
within the "interface space"
2018-01-11 02:48:51 +01:00
7dd69003b5 Navigator: finish path matching resolver for UI coordinates (closes #1107) 2018-01-10 04:42:49 +01:00
722c49e5ff Navigator: finish coverage of path extension 2018-01-10 04:21:42 +01:00
2d66293c32 Navigator: test for path extension now basically working as intended 2018-01-09 02:12:00 +01:00
ff24f81d3f Navigator: implement extension by (partial) UI-Coordinate spec
rationale: sometimes (likely this is even the standard case) we do not just
want to "extend", rather we want to extent at very specific levels.

This is easy to implement, based on the existing building blocks for path manipulation
2018-01-09 00:50:54 +01:00
55c196e5a2 Navigator: define test cases for path extension after coverage 2018-01-08 23:49:24 +01:00