On Tue, Jul 22, 2014 at 8:21 PM, Andreas Kupries <[email protected]>
wrote:

> Having heard about termbox only through this thread I just had a quick
> look over the API ...
>
> The blit() function seems to be the core for windowing, copying a
> cell-rectangle into the main termbox buffer.
>
> Have a display-list of windows = rectangles, and blit() them into the
> main buffer, from back to front before presenting the result.
>

It currently looks like that's the approach i'll need to take. i'll first
need a Window class where i can store the necessary bits for each window
and keep track of child windows for GC purposes, but that won't be hard to
do.


> Missing features to help with this
> - Can't blit() rect's out of the main buffer (to save state, before
> blitting in a modal window, for example)
>

i (coincidentally) emails the author asking about the ability to
save/restore blocks. No answer yet, but it was only an hour or so ago.

Looking at the "godit" link from Gour, it seems it is indeed possible to
implement multi-windowing, popup window support, etc., using only the
available APIs. See the screenshots - it looks a lot like emacs and is
implemented in "go":

https://github.com/nsf/godit

- Can't redirect the put()/change() APIs to work on rect's outside of
> the main buffer.
>

That's where the Window class (fairly analog to a curses Window) would come
in. It would need its own variants which translate the coordinates into the
global ("stdscr") space. The fact that there's only one output routine
(tb_change_cell(); tb_put_cell() is just a convenience wrapper around that
one) should mean that higher-level code has to wrap less stuff. In curses
there are many routines which have to be specialized for windows vs pads vs
panel.

BTW: termbox got the coordinates right: (x,y) instead of (y,x).

Curses is dead. Long live curses.

Still, something to keep track off.
> Might be interesting to see how it meshes with "linenoise".
>

termbox provides all the low-level bits you'd need to implement
linenoise-like editing, but it would be a bit of work to do, at least in C
- might be easier in script code. Speaking of: it took me all of a couple
hours to bind the 12-or-so functions to script space, and i'm quite certain
you could implement a TCL module for it faster than that. My point is only
- in the off chance that you want to experiment with it, doing so would not
require a huge time sink.

Will post screenshots if/when i've got something interesting to show. The
core API binding is finished (plus a few extras, e.g. clearing the screen
using given fg/bg attributes), but i'm not yet sure if i'm in the mood to
hack on it further tonight.

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf
_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to