Paratactic form for UI protocol

This commit is contained in:
Tony Garnock-Jones 2021-12-23 22:01:09 -05:00
parent 9264f435d4
commit 26043cb21c
2 changed files with 37 additions and 46 deletions

View File

@ -1,11 +1,7 @@
´³bundle·µ³ui„´³schema·³version³ definitions·³Fill´³orµµ±fixed´³atom³Double„„µ±fill´³rec´³lit³fill„´³tupleµ´³named³weight´³atom³ SignedInteger„„´³named³rank´³atom³ SignedInteger„„„„„„„„³Click´³rec´³lit³click„´³tupleµ´³named³widget´³refµ„³WidgetId„„„„„³Color´³rec´³lit³rgba„´³tupleµ´³named³red´³atom³Double„„´³named³green´³atom³Double„„´³named³blue´³atom³Double„„´³named³alpha´³atom³Double„„„„„³State´³rec´³lit³state„´³tupleµ´³named³widget´³refµ„³WidgetId„„´³named³key³any„´³named³value³any„„„„³Touch´³rec´³lit³touch„´³tupleµ´³named³widget´³refµ„³WidgetId„„´³named³touchId³any„„„„³Sizing´³rec´³lit³sizing„´³tupleµ´³named³ideal´³atom³Double„„´³named³stretch´³refµ„³Fill„„´³named³shrink´³refµ„³Fill„„„„„³BoxSize´³rec´³lit³box-size„´³tupleµ´³named³
horizontal´³refµ„³Sizing„„´³named³vertical´³refµ„³Sizing„„„„„³LeafType´³orµµ±blank´³lit³blank„„µ±text´³lit³text„„µ±slider´³lit³slider„„„„³NodeType´³orµµ±column´³lit³column„„µ±row´³lit³row„„„„³Ordering´³orµµ±double´³atom³Double„„µ±string´³atom³String„„„„³WidgetId³any³
ShowWidget´³rec´³lit³show„´³tupleµ´³named³ positions´³refµ„³WidgetSelector„„´³named³widget´³refµ„³
WidgetTree„„´³named³order´³refµ„³Ordering„„´³named³client´³embedded´³refµ„³WidgetClientProtocol„„„„„„³
WidgetTree´³orµµ±node´³rec´³lit³node„´³tupleµ´³named³type´³refµ„³NodeType„„´³named³
attributes´³refµ„³WidgetAttributes„„´³named³children´³seqof´³refµ„³
WidgetTree„„„„„„„µ±leaf´³rec´³lit³leaf„´³tupleµ´³named³type´³refµ„³LeafType„„´³named³
attributes´³refµ„³WidgetAttributes„„„„„„„„³WidgetInstance´³rec´³lit³widget-instance„´³tupleµ´³named³server´³embedded³any„„„„„³WidgetSelector´³orµµ±attributeEquals´³rec´³lit³=„´³tupleµ´³named³key´³atom³Symbol„„´³named³value³any„„„„„µ±and´³rec´³lit³and„´³tupleµ´³named³ selectors´³seqof´³refµ„³WidgetSelector„„„„„„„„„³WidgetAttributes´³dictof´³atom³Symbol„³any„³WidgetClientProtocol´³refµ„³WidgetInstance„„³ embeddedType€„„µ³hayes„´³schema·³version³ definitions·³Result´³rec´³lit³result„´³tupleµ´³named³text´³atom³String„„´³named³tag´³refµ„³ MaybeString„„´³named³fields´³refµ„³ MaybeStrings„„„„„³ MaybeString´³orµµ±present´³atom³String„„µ±absent´³lit€„„„„³ MaybeStrings´³orµµ±present´³seqof´³atom³String„„„µ±absent´³lit€„„„„³ ModemPresent´³rec´³lit³modem„´³tupleµ´³lit³hayes„´³named³
´³bundle·µ³ui„´³schema·³version³ definitions·³Fill´³orµµ±fixed´³atom³Double„„µ±fill´³rec´³lit³fill„´³tupleµ´³named³weight´³atom³ SignedInteger„„´³named³rank´³atom³ SignedInteger„„„„„„„„³Root´³rec´³lit³root„´³tupleµ´³named³id´³refµ„³WidgetId„„´³named³order´³refµ„³SortKey„„„„„³Click´³rec´³lit³click„´³tupleµ´³named³widget´³refµ„³WidgetId„„„„„³Color´³rec´³lit³rgba„´³tupleµ´³named³red´³atom³Double„„´³named³green´³atom³Double„„´³named³blue´³atom³Double„„´³named³alpha´³atom³Double„„„„„³State´³rec´³lit³state„´³tupleµ´³named³widget´³refµ„³WidgetId„„´³named³key³any„´³named³value³any„„„„³Touch´³rec´³lit³touch„´³tupleµ´³named³widget´³refµ„³WidgetId„„´³named³touchId³any„„„„³Parent´³rec´³lit³parent„´³tupleµ´³named³id´³refµ„³WidgetId„„´³named³parentId´³refµ„³WidgetId„„´³named³order´³refµ„³SortKey„„„„„³Sizing´³rec´³lit³sizing„´³tupleµ´³named³ideal´³atom³Double„„´³named³stretch´³refµ„³Fill„„´³named³shrink´³refµ„³Fill„„„„„³Widget´³rec´³lit³widget„´³tupleµ´³named³id´³refµ„³WidgetId„„´³named³type´³refµ„³
WidgetType„„„„„³Window´³rec´³lit³window„´³tupleµ´³named³title´³atom³String„„´³named³space´³embedded³any„„„„„³BoxSize´³rec´³lit³box-size„´³tupleµ´³named³
horizontal´³refµ„³Sizing„„´³named³vertical´³refµ„³Sizing„„„„„³SortKey´³orµµ±double´³atom³Double„„µ±string´³atom³String„„„„³LeafType´³orµµ±blank´³lit³blank„„µ±text´³lit³text„„µ±slider´³lit³slider„„„„³NodeType´³orµµ±column´³lit³column„„µ±row´³lit³row„„„„³WidgetId³any³ Attribute´³rec´³lit³ attribute„´³tupleµ´³named³id´³refµ„³WidgetId„„´³named³key´³atom³Symbol„„´³named³value³any„„„„³
WidgetType´³orµµ±NodeType´³refµ„³NodeType„„µ±LeafType´³refµ„³LeafType„„„„³WidgetInstance´³rec´³lit³widget-instance„´³tupleµ´³named³id´³refµ„³WidgetId„„´³named³instance´³embedded³any„„„„„„³ embeddedType€„„µ³hayes„´³schema·³version³ definitions·³Result´³rec´³lit³result„´³tupleµ´³named³text´³atom³String„„´³named³tag´³refµ„³ MaybeString„„´³named³fields´³refµ„³ MaybeStrings„„„„„³ MaybeString´³orµµ±present´³atom³String„„µ±absent´³lit€„„„„³ MaybeStrings´³orµµ±present´³seqof´³atom³String„„„µ±absent´³lit€„„„„³ ModemPresent´³rec´³lit³modem„´³tupleµ´³lit³hayes„´³named³
devicePath´³atom³String„„´³named³ dataspace´³embedded´³refµ„³InternalProtocol„„„„„„³ CommandResult´³rec´³lit³command-result„´³tupleµ´³named³ commandText´³atom³String„„´³named³results´³seqof´³refµ„³Result„„„´³named³ finalResult´³atom³String„„„„„³ExecuteCommand´³rec´³lit³execute-command„´³tupleµ´³named³ commandText´³atom³String„„´³named³replyTo´³refµ„³CommandContinuation„„„„„³InternalProtocol³any³CommandContinuation´³orµµ± replyWanted´³embedded´³refµ„³ CommandResult„„„µ± fireAndForget´³lit€„„„„³UnsolicitedResultCode´³rec´³lit³ unsolicited„´³tupleµ´³named³result´³refµ„³Result„„„„„„³ embeddedType€„„µ³ telephony„´³schema·³version³ definitions·³CallId´³atom³ SignedInteger„³CallType´³orµµ±voice´³lit³voice„„µ±data´³lit³data„„µ±fax´³lit³fax„„„„³ CallState´³orµµ±hold´³lit³hold„„µ±original´³lit³original„„µ±connect´³lit³connect„„µ±incoming´³lit³incoming„„µ±waiting´³lit³waiting„„µ±end´³lit³end„„µ±alerting´³lit³alerting„„„„³ PlaceCall´³rec´³lit³
place-call„´³tupleµ´³named³
devicePath´³atom³String„„´³named³peer´³atom³String„„„„„³

View File

@ -1,46 +1,16 @@
version 1 .
; Data types
; Assertion. Creates a space for Widget/Parent/Attribute assertions etc.
Window = <window @title string @space #!any> .
WidgetTree =
/ <node @type NodeType @attributes WidgetAttributes @children [WidgetTree ...]>
/ <leaf @type LeafType @attributes WidgetAttributes>
.
NodeType = =column / =row .
WidgetAttributes = { symbol: any ...:... } .
LeafType =
/ =blank
/ =text
/ =slider
.
WidgetSelector =
/ @attributeEquals <= @key symbol @value any>
/ <and @selectors [WidgetSelector ...]>
.
Fill = @fixed double / <fill @weight int @rank int> .
Sizing = <sizing @ideal double @stretch Fill @shrink Fill> .
BoxSize = <box-size @horizontal Sizing @vertical Sizing> .
; Commonly set under key `id` in WidgetAttributes.
WidgetId = any .
Color = <rgba @red double @green double @blue double @alpha double> .
WidgetClientProtocol = WidgetInstance .
; Assertions, within the space created as part of a Window assertion.
Widget = <widget @id WidgetId @type WidgetType> .
Parent = <parent @id WidgetId @parentId WidgetId @order SortKey> .
Root = <root @id WidgetId @order SortKey> .
Attribute = <attribute @id WidgetId @key symbol @value any> .
; Assertion
ShowWidget = <show
@positions WidgetSelector
@widget WidgetTree
@order Ordering
@client #!WidgetClientProtocol > .
Ordering = @double double / @string string .
; Assertion
WidgetInstance = <widget-instance @server #!any> .
WidgetInstance = <widget-instance @id WidgetId @instance #!any> .
; Assertion
Touch = <touch @widget WidgetId @touchId any> .
@ -50,3 +20,28 @@ Click = <click @widget WidgetId> .
; Assertion
State = <state @widget WidgetId @key any @value any> .
; Data types
WidgetId = any .
SortKey = @double double / @string string .
WidgetType = NodeType / LeafType .
NodeType =
/ =column
/ =row
.
LeafType =
/ =blank
/ =text
/ =slider
.
Color = <rgba @red double @green double @blue double @alpha double> .
; Box-and-glue layout
Fill = @fixed double / <fill @weight int @rank int> .
Sizing = <sizing @ideal double @stretch Fill @shrink Fill> .
BoxSize = <box-size @horizontal Sizing @vertical Sizing> .