UI-Coordinates: elaborate and simplify DSL draft (WIP)
This commit is contained in:
parent
ff1b22a889
commit
c1f240687b
3 changed files with 131 additions and 67 deletions
|
|
@ -26,9 +26,10 @@
|
|||
|
||||
|
||||
#include "lib/test/run.hpp"
|
||||
//#include "lib/test/test-helper.hpp"
|
||||
#include "lib/test/test-helper.hpp"
|
||||
#include "gui/interact/view-spec-dsl.hpp"
|
||||
#include "gui/interact/ui-coord.hpp"
|
||||
#include "lib/format-cout.hpp"
|
||||
//#include "lib/idi/entry-id.hpp"
|
||||
//#include "lib/diff/gen-node.hpp"
|
||||
//#include "lib/util.hpp"
|
||||
|
|
@ -48,6 +49,7 @@ namespace interact {
|
|||
namespace test {
|
||||
|
||||
// using lumiera::error::LUMIERA_ERROR_WRONG_TYPE;
|
||||
using lib::test::showSizeof;
|
||||
|
||||
namespace { //Test fixture...
|
||||
|
||||
|
|
@ -84,31 +86,41 @@ namespace test {
|
|||
void
|
||||
verify_standardUsage()
|
||||
{
|
||||
using LocSpec = Spec<UICoord()>;
|
||||
using CntSpec = Spec<UICoord(UICoord)>;
|
||||
|
||||
uint allocCounter = 0;
|
||||
|
||||
LocSpec::Builder<string> locationToken =[&](string pathElm)
|
||||
{
|
||||
return [pathElm]()
|
||||
{
|
||||
return UICoord::currentWindow().view(pathElm);
|
||||
};
|
||||
};
|
||||
// Simulation/Example for an allocator-builder
|
||||
AllocSpec<uint> limitAllocation =[&](UICoord target, uint limit)
|
||||
{
|
||||
if (allocCounter < limit)
|
||||
return target.tab(++allocCounter);
|
||||
else
|
||||
return target.tab(limit);
|
||||
};
|
||||
/////////TODO verify this...
|
||||
cout << showSizeof(limitAllocation) <<endl;
|
||||
|
||||
CntSpec::Builder<uint> 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");
|
||||
// the actual View Specification would then be written as...
|
||||
ViewSpec locate = UICoord::currentWindow().view("viewID");
|
||||
Allocator alloc = limitAllocation(3);
|
||||
|
||||
// ...and it would be evaluated as follows
|
||||
UICoord targetLocation = locate;
|
||||
UICoord realView1 = alloc(targetLocation);
|
||||
CHECK (1 == allocCounter);
|
||||
CHECK (realView1 == UICoord::currentWindow().view("viewID").tab("1"));
|
||||
|
||||
UICoord realView2 = alloc(targetLocation);
|
||||
CHECK (2 == allocCounter);
|
||||
CHECK (realView2 == UICoord::currentWindow().view("viewID").tab("2"));
|
||||
CHECK (realView2 != realView);
|
||||
|
||||
UICoord realView3 = alloc(targetLocation);
|
||||
CHECK (3 == allocCounter);
|
||||
CHECK (realView3 == UICoord::currentWindow().view("viewID").tab("3"));
|
||||
|
||||
UICoord realView3b = alloc(targetLocation);
|
||||
CHECK (3 == allocCounter);
|
||||
CHECK (realView3b == realView3);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2747,7 +2747,7 @@ Command instances are like prototypes -- thus each additional level of different
|
|||
see the description in &rarr; CommandSetup
|
||||
</pre>
|
||||
</div>
|
||||
<div title="GuiComponentView" creator="Ichthyostega" modifier="Ichthyostega" created="201709021521" modified="201709091319" tags="def GuiPattern design" changecount="28">
|
||||
<div title="GuiComponentView" creator="Ichthyostega" modifier="Ichthyostega" created="201709021521" modified="201709222301" tags="def GuiPattern design" changecount="33">
|
||||
<pre>//A view within the UI, featuring some component of relevance to »the model«.//
|
||||
While any UI is comprised of numerous widgets acting as //view of something,// only some of those views play the prominent role to act as //building block component// of the user interface.
|
||||
Such UI component views exhibit some substantial traits
|
||||
|
|
@ -2785,41 +2785,41 @@ Since view allocation offers a choice amongst several complex patterns of behavi
|
|||
;Timeline
|
||||
:add to group of timelines within the timelinePanel
|
||||
{{{
|
||||
count = unlimited
|
||||
alloc = unlimited
|
||||
locate = panel(timeline)
|
||||
}}}
|
||||
;Viewer
|
||||
:here multiple alternatives are conceivable
|
||||
:* allow only a single view instance in the whole application
|
||||
{{{
|
||||
count = onlyOne
|
||||
alloc = onlyOne
|
||||
locate = external(beamer)
|
||||
or perspective(mediaView), panel(viewer)
|
||||
or perspective(mediaView).panel(viewer)
|
||||
or existingPanel(viewer)
|
||||
or firstWindow, panel(viewer)
|
||||
or firstWindow().panel(viewer)
|
||||
}}}
|
||||
:* allow two viewer panels (the standard layout of editing applications)
|
||||
{{{
|
||||
count = limitPerWindow(2)
|
||||
locate = perspective(edit), existingPanel(viewer)
|
||||
or currentWindow, existingPanel(viewer)
|
||||
alloc = limitPerWindow(2)
|
||||
locate = perspective(edit).existingPanel(viewer)
|
||||
or currentWindow().existingPanel(viewer)
|
||||
or existingPanel(viewer)
|
||||
or panel(viewer)
|
||||
}}}
|
||||
;(Asset)Bin
|
||||
:within the dedicated asset panel, add to the appropriate group for the kind of asset
|
||||
{{{
|
||||
count = unlimited
|
||||
locate = currentWindow, perspective(edit), existingPanel(asset), existingGroup
|
||||
or perspective(asset), panel(asset)
|
||||
or firstWindow, panel(asset)
|
||||
alloc = unlimited
|
||||
locate = currentWindow().perspective(edit).existingPanel(asset).existingGroup()
|
||||
or perspective(asset).panel(asset)
|
||||
or firstWindow().panel(asset)
|
||||
}}}
|
||||
;~Error-Log
|
||||
:use the current {{{InfoBoxPanel}}} if such exists, fall back to using a single view on the primary window
|
||||
{{{
|
||||
count = limitPerWindow(1)
|
||||
locate = currentWindow, existingPanel(infobox)
|
||||
or firstWindow, panel(infobox)
|
||||
alloc = limitPerWindow(1)
|
||||
locate = currentWindow().existingPanel(infobox)
|
||||
or firstWindow().panel(infobox)
|
||||
}}}
|
||||
;Playcontrol
|
||||
://not determined yet what we'll need here....//
|
||||
|
|
@ -2829,13 +2829,19 @@ locate = currentWindow, existingPanel(infobox)
|
|||
* the tokens themselves are provided as constants
|
||||
* in fact those tokens are functors
|
||||
* and are opaquely bound into {{{ViewLocator}}}'s implementation
|
||||
__Signatures__:
|
||||
|
||||
!!!Signatures
|
||||
;locate
|
||||
:is run first and determines the UICoord of the target view
|
||||
;count
|
||||
:is run on those coordinates and actually //allocates// the view
|
||||
:is evaluated first and determines the UICoord of the target view
|
||||
:is a disjunction of alternative specs, which are resolved to use the first applicable one
|
||||
;alloc
|
||||
:the //Allocator// is run on those coordinates and actually //allocates// the view
|
||||
:returns coordinates of an (now) existing view
|
||||
__Tokens__:
|
||||
;allocator specs
|
||||
:these are //builder functions// to yield a specifically parametrised allocator
|
||||
:typical example is an allocator to create only a limited number of view instances per window
|
||||
:the actual builder tokens are synthesised by partial function application on the given lambda
|
||||
!!!Spec Tokens
|
||||
;locate
|
||||
:firstWindow
|
||||
: currentWindow
|
||||
|
|
@ -2843,7 +2849,7 @@ __Tokens__:
|
|||
: panel(id)
|
||||
: existingPanel(id)
|
||||
: existingGroup {{red{WIP 9/17 not clear if possible}}}
|
||||
;count
|
||||
;alloc
|
||||
: unlimited
|
||||
: onlyOne
|
||||
: limitPerWindow(cnt)
|
||||
|
|
@ -9609,6 +9615,22 @@ The dispatch of //diff messages// is directly integrated into the UI-Bus -- whic
|
|||
|
||||
The Graphical User interface, the upper layer in this hierarchy, embodies everything of tangible relevance to the user working with the application. The interplay with Proc-Layer, the middle layer below the UI, is organised along the distinction between two realms of equal importance: on one side, there is the immediate //mechanics of the interface,// which is implemented directly within the ~UI-Layer, based on the Graphical User Interface Toolkit. And, on the other side, there are those //core concerns of working with media,// which are cast into the HighLevelModel at the heart of the middle layer.</pre>
|
||||
</div>
|
||||
<div title="UICoord" creator="Ichthyostega" modifier="Ichthyostega" created="201709222300" tags="def draft spec GuiPattern" changecount="1">
|
||||
<pre>//A topological addressing scheme to designate structural locations within the UI.//
|
||||
Contrary to conventional screen pixel coordinates, here we aim at a topological description of the UI structure. Such a framework of structural reference allows us
|
||||
* to refer to some "place" or "space" within the interface
|
||||
* to remember and return to such a location
|
||||
* to move a [[work focus (»Spot«)|Spot]] structurally within the UI
|
||||
* to describe and configure the pattern view access and arrangement
|
||||
|
||||
As starting point for the design of such a framework, we'll pick the notion of an access path within a hierarchical structure
|
||||
* the top-level window
|
||||
* the perspective used within that window
|
||||
* the panel within this window
|
||||
* a view group within the panel
|
||||
* plus a locally defined access path further down to the actual UI element
|
||||
</pre>
|
||||
</div>
|
||||
<div title="ViewConnection" modifier="Ichthyostega" created="201105221854" modified="201501091154" tags="def Model SessionLogic" changecount="3">
|
||||
<pre>For any kind of playback to happen, timeline elements (or similar model objects) need to be attached to a Viewer element through a special kind of [[binding|BindingMO]], called a ''view connection''. In the most general case, this creates an additional OutputMapping (and in the typical standard case, this boils down to a 1:1 association, sending the master bus of each media kind to the standard OutputDesignation for that kind).
|
||||
|
||||
|
|
|
|||
|
|
@ -3856,13 +3856,13 @@
|
|||
<node CREATED="1504886227678" ID="ID_1936525982" MODIFIED="1504886237440" TEXT="existiert | machbar | unmöglich"/>
|
||||
<node CREATED="1504959598053" ID="ID_952692651" MODIFIED="1504959601728" TEXT="Zielkoordinaten"/>
|
||||
</node>
|
||||
<node CREATED="1504959603212" ID="ID_627664382" MODIFIED="1504959626084" TEXT="count ->">
|
||||
<node CREATED="1504959603212" ID="ID_627664382" MODIFIED="1506120296338" TEXT="alloc ->">
|
||||
<node CREATED="1504959659068" ID="ID_389794808" MODIFIED="1504959776009" TEXT="allocator(Zielkoordinaten, managementScope, limit)"/>
|
||||
<node CREATED="1504959829510" ID="ID_570145960" MODIFIED="1504959849583" TEXT="POST: neuer / alter View unter Zielkoordinaten erreichbar"/>
|
||||
<node CREATED="1504959871472" ID="ID_864423184" MODIFIED="1504959912350" TEXT="ggfs rekonfigurieren..."/>
|
||||
</node>
|
||||
<node CREATED="1504961752279" ID="ID_361507996" MODIFIED="1504961755930" TEXT="Signaturen">
|
||||
<node CREATED="1504961759077" ID="ID_627682268" MODIFIED="1504961783294" TEXT="locate: UICoord()"/>
|
||||
<node CREATED="1504961759077" ID="ID_627682268" MODIFIED="1506120318232" TEXT="locate: UICoord"/>
|
||||
<node CREATED="1504961784098" ID="ID_268457753" MODIFIED="1504961799644" TEXT="count: UICoord(UICoord)"/>
|
||||
</node>
|
||||
</node>
|
||||
|
|
@ -3878,12 +3878,26 @@
|
|||
<node CREATED="1504962671884" ID="ID_583107872" MODIFIED="1504962679447" TEXT="braucht verdeckten Parameter"/>
|
||||
</node>
|
||||
</node>
|
||||
<node CREATED="1504962013068" ID="ID_1352068125" MODIFIED="1504962127304" TEXT="Spec.count">
|
||||
<node CREATED="1504962013068" ID="ID_1352068125" MODIFIED="1506120263447" TEXT="Spec.alloc">
|
||||
<node CREATED="1504962685443" ID="ID_663273997" MODIFIED="1504962691725" TEXT="unlimited"/>
|
||||
<node CREATED="1504962692881" ID="ID_261391829" MODIFIED="1504962697437" TEXT="onlyOne"/>
|
||||
<node CREATED="1504962700536" ID="ID_1061344108" MODIFIED="1504962713898" TEXT="limitPerWindow(cnt)"/>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#fdfdcf" COLOR="#ff0000" CREATED="1506034501537" ID="ID_262802757" MODIFIED="1506034504945" TEXT="TODO">
|
||||
<icon BUILTIN="flag-pink"/>
|
||||
<node CREATED="1506034518068" ID="ID_1413583873" MODIFIED="1506034529021" TEXT="ViewSpecDSL wird für Location Spec zuständig"/>
|
||||
<node CREATED="1506034529729" ID="ID_1906856590" MODIFIED="1506034536316" TEXT="Keine Generics mehr notwendig"/>
|
||||
<node CREATED="1506034536976" ID="ID_760545085" MODIFIED="1506034547716" TEXT="locationSpec ist direkt eine UICoord">
|
||||
<node CREATED="1506114845775" ID="ID_98017975" MODIFIED="1506114856697" TEXT="muß DSL-Elemente unterstützen"/>
|
||||
<node CREATED="1506034566805" ID="ID_726919191" MODIFIED="1506034578279" TEXT="ODER-Behandlung wandert in UICoord"/>
|
||||
<node CREATED="1506114863020" ID="ID_1749053457" MODIFIED="1506114874020" TEXT="Problem: existingPanel(id)">
|
||||
<icon BUILTIN="messagebox_warning"/>
|
||||
</node>
|
||||
</node>
|
||||
<node CREATED="1506120453114" ID="ID_1626834388" MODIFIED="1506120467404" TEXT="abgekürzte Schreibweise für Allocator-Spec"/>
|
||||
<node CREATED="1506034548376" ID="ID_36109866" MODIFIED="1506034558754" TEXT="count -> umbenennen in alloc"/>
|
||||
</node>
|
||||
<node CREATED="1504833110793" ID="ID_10881417" MODIFIED="1504833114828" TEXT="Ausdrücke">
|
||||
<node CREATED="1504833126079" ID="ID_286801467" MODIFIED="1504884923889" TEXT="konkret">
|
||||
<cloud COLOR="#e6d0a4"/>
|
||||
|
|
@ -3891,14 +3905,14 @@
|
|||
<icon BUILTIN="pencil"/>
|
||||
<node CREATED="1504833146196" ID="ID_278904211" MODIFIED="1504833149680" TEXT="Timeline">
|
||||
<node CREATED="1504833174961" ID="ID_1294462811" MODIFIED="1504833187018" TEXT="im Timeline-Panel der Gruppe hinzufügen"/>
|
||||
<node CREATED="1504882791007" ID="ID_1520721786" MODIFIED="1504883085368">
|
||||
<node CREATED="1504882791007" ID="ID_1520721786" MODIFIED="1506121426383">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
count = unlimited
|
||||
alloc = unlimited
|
||||
</p>
|
||||
<p>
|
||||
locate = panel(timeline)
|
||||
|
|
@ -3910,46 +3924,46 @@
|
|||
</node>
|
||||
<node CREATED="1504833569692" ID="ID_1069272084" MODIFIED="1504833620713" TEXT="Viewer">
|
||||
<node CREATED="1504834559240" ID="ID_423545167" MODIFIED="1504834569219" TEXT="nur ein einziger(global)"/>
|
||||
<node CREATED="1504883102734" ID="ID_81147050" MODIFIED="1504883517558">
|
||||
<node CREATED="1504883102734" ID="ID_81147050" MODIFIED="1506121418376">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
count = onlyOne
|
||||
alloc = onlyOne
|
||||
</p>
|
||||
<p>
|
||||
locate = external(beamer)
|
||||
</p>
|
||||
<p>
|
||||
               or perspective(mediaView), panel(viewer)
|
||||
               or perspective(mediaView).panel(viewer)
|
||||
</p>
|
||||
<p>
|
||||
               or existingPanel(viewer)
|
||||
</p>
|
||||
<p>
|
||||
               or firstWindow, panel(viewer)
|
||||
               or firstWindow().panel(viewer)
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
</node>
|
||||
<node CREATED="1504834569831" ID="ID_1909335075" MODIFIED="1504883625292" TEXT="maximal 2 Viewer Panel"/>
|
||||
<node CREATED="1504883107916" ID="ID_1351734300" MODIFIED="1504883958167">
|
||||
<node CREATED="1504883107916" ID="ID_1351734300" MODIFIED="1506121412122">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
count = limitPerWindow(2)
|
||||
alloc = limitPerWindow(2)
|
||||
</p>
|
||||
<p>
|
||||
locate = perspective(edit), existingPanel(viewer)
|
||||
locate = perspective(edit).existingPanel(viewer)
|
||||
</p>
|
||||
<p>
|
||||
               or currentWindow, existingPanel(viewer)
|
||||
               or currentWindow().existingPanel(viewer)
|
||||
</p>
|
||||
<p>
|
||||
               or existingPanel(viewer)
|
||||
|
|
@ -3976,23 +3990,23 @@
|
|||
</html>
|
||||
</richcontent>
|
||||
</node>
|
||||
<node CREATED="1504883110076" ID="ID_199732103" MODIFIED="1504884259907">
|
||||
<node CREATED="1504883110076" ID="ID_199732103" MODIFIED="1506121405019">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
count = unlimited
|
||||
alloc = unlimited
|
||||
</p>
|
||||
<p>
|
||||
locate = currentWindow, perspective(edit), existingPanel(asset), existingGroup
|
||||
locate = currentWindow().perspective(edit).existingPanel(asset).existingGroup()
|
||||
</p>
|
||||
<p>
|
||||
               or perspective(asset), panel(asset)
|
||||
               or perspective(asset)panel(asset)
|
||||
</p>
|
||||
<p>
|
||||
               or firstWindow, panel(asset)
|
||||
               or firstWindow().panel(asset)
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -4001,20 +4015,20 @@
|
|||
</node>
|
||||
<node CREATED="1504833574246" ID="ID_1680764695" MODIFIED="1504876896530" TEXT="FehlerLog">
|
||||
<node CREATED="1504834859584" ID="ID_693499241" MODIFIED="1504834866267" TEXT="im aktuellen Infobox-Panel"/>
|
||||
<node CREATED="1504883112068" ID="ID_308640581" MODIFIED="1504884348903">
|
||||
<node CREATED="1504883112068" ID="ID_308640581" MODIFIED="1506121397123">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
count = limitPerWindow(1)
|
||||
alloc = limitPerWindow(1)
|
||||
</p>
|
||||
<p>
|
||||
locate = currentWindow, existingPanel(infobox)
|
||||
locate = currentWindow().existingPanel(infobox)
|
||||
</p>
|
||||
<p>
|
||||
               or firstWindow, panel(infobox)
|
||||
               or firstWindow().panel(infobox)
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -4052,7 +4066,23 @@
|
|||
<node CREATED="1504881091345" ID="ID_453622973" MODIFIED="1504881104355" TEXT="Menge von Spezifikationen"/>
|
||||
<node CREATED="1504881104919" ID="ID_1302649814" MODIFIED="1504881111442" TEXT="diese sind inhärent getypt"/>
|
||||
<node CREATED="1504881124612" ID="ID_41842721" MODIFIED="1504881139230" TEXT="Spezifikation per Zuweisung"/>
|
||||
<node CREATED="1504881139794" ID="ID_1982949721" MODIFIED="1504881148853" TEXT="zugewiesener Ausdruck ist passend getypt"/>
|
||||
<node CREATED="1504881139794" ID="ID_1982949721" MODIFIED="1504881148853" TEXT="zugewiesener Ausdruck ist passend getypt">
|
||||
<node CREATED="1506120341257" ID="ID_1629432417" MODIFIED="1506120348204" TEXT="Loaction-Spec">
|
||||
<node CREATED="1506120349336" ID="ID_1516960868" MODIFIED="1506120360234" TEXT="Menge von UI-Koordinaten"/>
|
||||
<node CREATED="1506120361846" ID="ID_1024931059" MODIFIED="1506120367057" TEXT="unterstützt Alternativen"/>
|
||||
<node CREATED="1506120367605" ID="ID_1489367458" MODIFIED="1506120372537" TEXT="wählt den ersten anwendbaren"/>
|
||||
</node>
|
||||
<node CREATED="1506120374116" ID="ID_1552148308" MODIFIED="1506120378224" TEXT="Allocator-Def">
|
||||
<node CREATED="1506120380940" ID="ID_1553891423" MODIFIED="1506120390942" TEXT="ein Funktor UICorrd(UIcoord)"/>
|
||||
<node CREATED="1506120391506" ID="ID_1217740236" MODIFIED="1506120406556" TEXT="Semantik: nimmt Spec und erzeugt konkretes Ziel"/>
|
||||
<node CREATED="1506120410863" ID="ID_1205747223" MODIFIED="1506120419162" TEXT="Allocaotor-Specs">
|
||||
<node CREATED="1506120420910" ID="ID_6299376" MODIFIED="1506120425113" TEXT="Hilfs-Tokens"/>
|
||||
<node CREATED="1506120425773" ID="ID_195710124" MODIFIED="1506120434234" TEXT="partielle Funktionsanwendung">
|
||||
<icon BUILTIN="idea"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node CREATED="1504881149417" ID="ID_178442113" MODIFIED="1504881192191" TEXT="Alternativen">
|
||||
<node CREATED="1504881193043" ID="ID_1759689335" MODIFIED="1504882609481" TEXT="Komma-Operator">
|
||||
<icon BUILTIN="button_cancel"/>
|
||||
|
|
|
|||
Loading…
Reference in a new issue