mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-25 16:05:27 +03:00
dill: move %mor case into $blit
This lets us send a single blit around, instead of sending facts for every individual blit in a draw event.
This commit is contained in:
parent
87ac253b8d
commit
8906d1c17d
@ -122,7 +122,7 @@
|
||||
=+ (~(gut by bin) ses *source)
|
||||
=* dev -
|
||||
=| moz=(list card:agent:gall)
|
||||
=| biz=(list dill-blit:dill)
|
||||
=| biz=(list blit:dill) ::TODO should be per-session
|
||||
|%
|
||||
++ this .
|
||||
++ klr klr:format
|
||||
@ -284,13 +284,13 @@
|
||||
^- (list card:agent:gall)
|
||||
?~ biz (flop moz)
|
||||
:_ (flop moz)
|
||||
=/ =dill-blit:dill ?~(t.biz i.biz [%mor (flop biz)])
|
||||
=/ =blit:dill ?~(t.biz i.biz [%mor (flop biz)])
|
||||
::TODO remove /drum after dill cleans up
|
||||
::TODO but once we remove it, the empty trailing segment of
|
||||
:: /dill/[ses] would prevent outsiders from subscribing
|
||||
:: to the default session...
|
||||
=/ to=(list path) [/dill/[ses] ?~(ses ~[/drum] ~)]
|
||||
[%give %fact to %dill-blit !>(dill-blit)]
|
||||
[%give %fact to %dill-blit !>(blit)]
|
||||
::
|
||||
++ se-adze :: update connections
|
||||
^+ .
|
||||
@ -473,7 +473,7 @@
|
||||
+>(eel (~(put in eel) gyl))
|
||||
::
|
||||
++ se-blit :: give output
|
||||
|= bil=dill-blit:dill
|
||||
|= bil=blit:dill
|
||||
+>(biz [bil biz])
|
||||
::
|
||||
++ se-blit-sys :: output to system
|
||||
@ -640,7 +640,7 @@
|
||||
%d ?^ buf.say.inp
|
||||
ta-del
|
||||
?: =([our.hid %dojo] gyl)
|
||||
+>(..ta (se-blit qit+~)) :: quit pier
|
||||
+>(..ta (se-blit-sys %qit ~)) :: quit pier
|
||||
+>(..ta (se-klin gyl)) :: unlink app
|
||||
%e +>(pos.inp (lent buf.say.inp))
|
||||
%f (ta-aro %r)
|
||||
|
@ -1088,8 +1088,9 @@
|
||||
[%clr ~] :: clear the screen
|
||||
[%hop p=$@(@ud [r=@ud c=@ud])] :: set cursor col/pos
|
||||
[%klr p=stub] :: put styled
|
||||
[%put p=(list @c)] :: put text at cursor
|
||||
[%mor p=(list blit)] :: multiple blits
|
||||
[%nel ~] :: newline
|
||||
[%put p=(list @c)] :: put text at cursor
|
||||
[%sag p=path q=*] :: save to jamfile
|
||||
[%sav p=path q=@] :: save to file
|
||||
[%url p=@t] :: activate url
|
||||
@ -1099,12 +1100,12 @@
|
||||
$% belt :: client input
|
||||
[%cru p=@tas q=(list tank)] :: echo error
|
||||
[%hey ~] :: refresh
|
||||
::TODO inconsistent with %hit and %hop
|
||||
[%rez p=@ud q=@ud] :: resize, cols, rows
|
||||
[%yow p=gill:gall] :: connect to app
|
||||
== ::
|
||||
+$ dill-blit :: arvo output
|
||||
$% blit :: client output
|
||||
[%mor p=(list dill-blit)] :: multiple blits
|
||||
[%qit ~] :: close console
|
||||
== ::
|
||||
+$ flog :: sent to %dill
|
||||
|
@ -178,13 +178,10 @@
|
||||
++ from :: receive blit
|
||||
|= bit=dill-blit
|
||||
^+ +>
|
||||
?: ?=(%mor -.bit)
|
||||
|- ^+ +>.^$
|
||||
?~ p.bit +>.^$
|
||||
$(p.bit t.p.bit, +>.^$ ^$(bit i.p.bit))
|
||||
?: ?=(%qit -.bit)
|
||||
(dump %logo ~)
|
||||
(done %blit [bit ~])
|
||||
::TODO so why is this a (list blit) again?
|
||||
(done %blit bit ~)
|
||||
::
|
||||
++ sponsor
|
||||
^- ship
|
||||
|
@ -18,6 +18,7 @@
|
||||
%nel b+&
|
||||
%url s+p.blit
|
||||
%wyp b+&
|
||||
%mor a+(turn p.blit ^blit)
|
||||
::
|
||||
%sag
|
||||
%- pairs
|
||||
|
@ -10,7 +10,9 @@ export const csi = (cmd: string, ...args: number[]) => {
|
||||
export const showBlit = (term: Terminal, blit: Blit) => {
|
||||
let out = '';
|
||||
|
||||
if ('bel' in blit) {
|
||||
if ('mor' in blit) {
|
||||
return blit.mor.map(b => showBlit(term, b));
|
||||
} else if ('bel' in blit) {
|
||||
out += '\x07';
|
||||
} else if ('clr' in blit) {
|
||||
term.clear();
|
||||
|
@ -27,8 +27,9 @@ export type Blit =
|
||||
| { clr: null } // clear the screen
|
||||
| { hop: number | { r: number, c: number } } // set cursor col/pos
|
||||
| { klr: Stub[] } // put styled
|
||||
| { put: string[] } // put text at cursor
|
||||
| { mor: Blit[] } // multiple blits
|
||||
| { nel: null } // newline
|
||||
| { put: string[] } // put text at cursor
|
||||
| { sag: { path: string, file: string } } // save to jamfile
|
||||
| { sav: { path: string, file: string } } // save to file
|
||||
| { url: string } // activate url
|
||||
|
@ -1353,7 +1353,17 @@ _term_ef_blit(u3_utty* uty_u,
|
||||
_term_it_show_tour(uty_u, u3k(u3t(blt)));
|
||||
} break;
|
||||
|
||||
case c3__mor: //TMP backwards compatibility
|
||||
case c3__mor: {
|
||||
if (u3_nul != u3t(blt)) {
|
||||
u3_noun bis = u3t(blt);
|
||||
while (u3_nul != bis) {
|
||||
_term_ef_blit(uty_u, u3k(u3h(bis)));
|
||||
bis = u3t(bis);
|
||||
}
|
||||
break;
|
||||
}
|
||||
//TMP fall through to nel for backwards compatibility
|
||||
}
|
||||
case c3__nel: {
|
||||
_term_it_show_nel(uty_u);
|
||||
} break;
|
||||
|
Loading…
Reference in New Issue
Block a user