Default will allow infinite looping on some macros which return NOTFOUND, and the macro will not close properly. One can exit with cntrl c, but the condition needs to be detected.
Then there is a remaining bug in expression execution, easy to find at this point. Otherwise, the simple device is working a s planned. Solid enough for me.
But now I am interested in the IO snippet, a snippet runs on its own thread and handles xcb messages for keyboard and mouse. That looks to me like a cutnpaste of an XCB snippet from the tutorial, then add the basic command line editing controls.
IO Manager:
The simplest mode is cursor trapped in command window mode. In that mode, the only entrance from IO manager into console exec command is when a completed line is collected by IO manager. Hence, in this mode we should be thread safe, and this mode defaults to standard BASH style window, bottom of screen, scrolling text. in this mode, console lop blocks on get next source string until the IO manager call back occurs, delivering the next source string. The IO manager has direct access to the console source heap, can do line editing right there, make it nice and execute the call back. The simplest mode we will call the default mode, and Default assumes the default modes always.
Now any syntax engine, loadable, can change the mode of IO manager, change it to editable rectangle and work with a local editing function, more handy than a simple line editing. Rectangle IO is what xchars is all about.
The IO manager controls its own xchars windows, by connection identifier. This does not prohibit xchars from supporting multiple windows independently. There is a smooth path on this until we have overlapping rectangles, then we need a boost, a windows manager, but that is an application that goes beyond default capability..
The general case is the IO manager is mutli-threaded, it may have a thread per connection, even a thread per rectangle in xchars, it may be supporting multiple screens. This chaos is managed upward, at the syntax engine. It is a simple, multi-threaded message loop with line editing capability. Any of the snippets can start it up on a separate thread.
No comments:
Post a Comment