A little work on sdpy/terminal interop and apng debugging

Posted 2021-01-04

I spent my code time this week mostly working on application code, but did a little library work on my apng.d and terminal.d.

Core D Development Statistics

In the community

Community announcements

See more at the announce forum.

What Adam is working on

animated png

My arsd.apng lib was bare minimal and even a little buggy until recently. I made a apng render method in there that draws it to a canvas and you can then draw them. Doing a apng viewer is fairly easy with my stuff now.

terminal integration with simpledisplay

Additionally, terminal.d had a method to integrate with arsd.simpledisplay's event loop, but it was minimal. You could use them together but the events were all independent; the terminal would be like a separate window. Sometimes, that's exactly what you want and that functionality is still there.

In addition to that though is now SdpyIntegratedKeys, which takes a SimpleWindow parameter and forwards key events from the terminal to that window, as if they were typed in the window. Its destructor will then detach cleanly (which meant fixing some very old bugs in terminal.d that before I would just say "don't do this". Well now you can do that. I'll write more about this some other time but the short version is delegates in a struct dtor were bad and now they aren't.).

The reason I wanted this is using mplayer and mpv, you can use arrow keys in either terminal or window to seek the media. I just wanted that too in my own thing and since it was easy enough to code, I added it.

Reminder about dwidder!

My little dwidder site is still up btw https://dwidder.arsdnet.net/

I post something for these entries too so if you want to comment that's one possibility to post to.