all repos — taro @ ad0d62741889e1e984c58c5f0a88246aacd62ed7

mblaze frontend in uxn + crystal

getting ready to add complexity
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEkFh6dA+k/6CXFXU4O3+8IhROY5gFAmQT8DcACgkQO3+8IhRO
Y5i2Bw//QGxtUM9ql3uDYvcCEbVj+AbvaegH7+BEuvc+n1f1cY7v4y6PLNvSFGfx
YCFZv5aNdqf4bnvTwD4ZdfW8Fw4VmLTM5usSmIE6Gks56O2xI76KBTL6EL5u6aeU
XT2QDCZZ0jBc9u2Q+xzhYlus6i2B5MBEVXIDt+paVm5LOWnd6dAAAMT+fIu/QPWz
6YyXo6CqUR3ks6cLXz/UmPyfRcVJwhokiI0c6CeXLiZxqbooDQ6IZFvO8esxuprD
PFj7gv38vFPAs3HgzcCPZsqmhd1bj/lZmaLfNt/gHxOIfjJeymH0QRqe3al8p2a8
nEdFjGJ2xBHQuOtgsrfnCQ71jx+ypQTSUx+xTeljpOcZGZClqQOmzLXVNjbpzYif
g8/KPwxrYu+iFJyXdO2hYO0m8iMBLgdM2LqTmNPVcEJB0RRNm0DD3HkOa/NjPhfy
axErCM7VqjkyNDkcg3kdgSqQ/OxxWqVfxYdY41HYVdtEIEKEh4zkOvRzLMpl88US
JhGBeGrcHWEkzpjTKOWAbr6v7YtzEAhYaHTd364gSNuLU5gJ6+yXCGG5kY8ZUxw+
TMPUX9wQzz66gTgX/x+oFLeGdxxdEyPIwHrYG5EPnsoq4pBFN90O2e4/EmPyisvc
HuICbLjVcx4dvvj7bzqouDiDco795Lx5cafDfM/CEi5960Vsg4Y=
=rQA/
-----END PGP SIGNATURE-----
commit

ad0d62741889e1e984c58c5f0a88246aacd62ed7

parent

0f44a9fff7bbf94628ec6175215b1200466ac1ea

3 files changed, 49 insertions(+), 16 deletions(-)

jump to
A README.md

@@ -0,0 +1,14 @@

+# taro + +`mblaze` frontend in `uxn` and `crystal` + +## messages + +Even messages go from `taro-ctl` to the `uxn` windows. + +- `0`: mailbox list +- `2`: list mail in mailbox + +Odd messages go from the `uxn` windows to `taro-ctl`. + +- `1`: change/refresh mailbox
M taro-ctl.crtaro-ctl.cr

@@ -22,7 +22,6 @@ @data

end def initialize(@type, @data) - end end

@@ -114,6 +113,12 @@

end class MblazeProxy + @mailbox : String + + def initialize + @mailbox = "INBOX" + end + def list_mail(box : String = "INBOX") mailCmd = " mbox=${MBOX_ROOT}/#{box}

@@ -132,6 +137,10 @@

io = IO::Memory.new Process.run(mailCmd, shell: true, output: io) return io.to_s + end + + def set_mbox(box : String) + @mailbox = box end end

@@ -179,6 +188,8 @@ select

when taro.mainWindow.lifetime.receive? exit when m = taro.mainWindow.msg.receive - # do something + case m.type + when 1 then taro.mblaze.set_mbox(m.data.to_s) + end end end
M taro-ls.taltaro-ls.tal

@@ -1,6 +1,13 @@

( taro-ls: list mail, navigate mailboxes, and perform actions on mail ) +( message types ) + +%MBOX_LIST { #00 } +%GET_MBOX { #01 } %MAIL_LIST { #02 } + +( UI constants ) + %TOP_SECTION { #0020 } %BOTTOM_SECTION { #0040 }

@@ -21,10 +28,11 @@ ( variables )

|0000 -@wipe_fg [ $1 ] +@refresh [ &mboxes $1 &list $1 &fg $1 ] @resizing [ $1 &x $2 &y $2 &dx $2 &dy $2 ] @decoding [ $1 &msg_type $1 &counting $1 &count $2 &processed $2 ] -@list [ &bytes $2 &len $1 &offset $2 &elem_offset $1 &top $2 &height $1 &select_index $2 &update $1 ] +@mboxes [ &bytes $2 &len $1 &offset $2 &elem_offset $1 &top $2 &height $1 &select_index $2 &sb_len $1 &sb_pos $2 &sb_step $2 ] +@list [ &bytes $2 &len $1 &offset $2 &elem_offset $1 &top $2 &height $1 &select_index $2 &sb_len $1 &sb_pos $2 &sb_step $2 ] @sb [ &len $1 &pos $2 &step $2 ] ( program )

@@ -40,7 +48,7 @@ #0180 .Screen/width DEO2

#0200 .Screen/height DEO2 .Screen/height DEI2 TOP_SECTION BOTTOM_SECTION ADD2 SUB2 #03 SFT2 NIP .list/height STZ - #01 .wipe_fg STZ + #01 .refresh/fg STZ ;on_screen .Screen/vector DEO2 ;on_mouse .Mouse/vector DEO2

@@ -67,7 +75,7 @@ DUP MAIL_LIST NEQ ,&no_mail_list JCN

POP ;list_data .decoding/processed LDZ2 ADD2 STA decode_inc_count .list/bytes STZ2 ,&count JMP - #01 .list/update STZ + #01 .refresh/list STZ &no_mail_list POP

@@ -93,12 +101,12 @@ .decoding/processed LDZ2 INC2 DUP2 .decoding/processed STZ2

JMP2r @decode_is_done ( -- bit ) - #01 .list/update STZ + #01 .refresh/list STZ .decoding/processed LDZ2 .decoding/count LDZ2 EQU2 JMP2r @on_mouse ( -> ) - #01 .wipe_fg STZ + #01 .refresh/fg STZ get_select_idx_by_mouse .resizing LDZ #00 EQU ,&resz_check JCN

@@ -150,7 +158,7 @@ .Screen/height DEI2 #0008 ADD2 .Screen/height DEO2

,&chk_release JMP &chk_release - #01 .list/update STZ + #01 .refresh/list STZ .Screen/height DEI2 TOP_SECTION BOTTOM_SECTION ADD2 SUB2 #03 SFT2 NIP .list/height STZ .Mouse/state DEI

@@ -159,16 +167,16 @@

@on_screen ( -> ) - .list/update LDZ #00 EQU ,&no_list JCN + .refresh/list LDZ #00 EQU ,&no_list JCN draw_mail_list draw_scrollbar - #00 .list/update STZ + #00 .refresh/list STZ &no_list - .wipe_fg LDZ #00 EQU ,&no_fg JCN + .refresh/fg LDZ #00 EQU ,&no_fg JCN clear_fg draw_resize_handle draw_cursor - #00 .wipe_fg STZ + #00 .refresh/fg STZ &no_fg BRK

@@ -349,7 +357,7 @@ .Mouse/y DEI2 .Screen/height DEI2 BOTTOM_SECTION SUB2 GTH2 ,&done JCN

.Mouse/y DEI2 TOP_SECTION SUB2 #03 SFT2 .list/top LDZ2 ADD2 .list/select_index STZ2 - #01 .list/update STZ + #01 .refresh/list STZ .Mouse/state DEI #00 EQU ,&no_click JCN .list/select_index LDZ2 .list/len LDZ2 GTH2 ,&no_click JCN &no_click

@@ -364,7 +372,7 @@ .list/len LDZ2 #00 .list/height LDZ LTH2 ,&no_scroll_up JCN

.list/top LDZ2 #0000 EQU2 ,&no_scroll_up JCN .list/top LDZ2 #0001 SUB2 .list/top STZ2 ;update_sb_pos JSR2 - #01 .list/update STZ + #01 .refresh/list STZ &no_scroll_up JMP2r

@@ -373,7 +381,7 @@ .list/len LDZ2 #00 .list/height LDZ LTH2 ,&no_scroll_down JCN

.list/top LDZ2 #00 .list/height LDZ ADD2 .list/len LDZ2 EQU2 ,&no_scroll_down JCN .list/top LDZ2 INC2 .list/top STZ2 ;update_sb_pos JSR2 - #01 .list/update STZ + #01 .refresh/list STZ &no_scroll_down JMP2r