Sunday, January 13, 2019

Then some quick rules on rectangles

IO manager collects and formats input for a particular rectangle, and the rectangle tightly binds IO manager and xchars.  IO manager maintains the string of chars, rectangle already to fit the rectangle as need be. Xchars keeps a pointer back to strings per rect basis.


I have just greatly simplified xchars, it no longer manages strings as all, it just converts them to fonts on the rectangle.  Basically it does the sensible thing, it folds bluntly on overflow.

We get a very sharp division between string management and font management, let xchars become the font interface, it will link with a font library and expose that library to the Bus..   IO manager with the default command line need only run up and down lines on the string, or left on right on the current line.

Now the keyboard library works well here, but so does the key mapping code I posted.  The dfault case is standard US keyboard,. Keymapping works, I have included the linux input-event-codes and IO can work directly with those flags. You can use the cursor to move along the commnd line. For output, the application can grab another rectangle, but console sticks with its 80 by 1 rect with line history scroll.

What happens to all the printfs?

We redirect them to the printf rectangle,make it look like a file descriptor, then map descriptors.  There must be a string manager between printf and rect, as printfs scroll. The easiest method is a fifo, he string manager reads the fifo and maintains the xchars read string buffer, a two step process,but quick. In fact, I will make that a pat of IO manager, grabbing from the fifo fd and filling the corresponding rect string.

My non blocking read:
The call to event will not block, and returns -1 on not ready. he if statement goes left to right and stops if no fd on its left to right test has data, otherwise it falls through on the first hit.  This is compiler fast, it works, I get a snappy result, the mix of keyboard and mouse. But libev is about as fast and need not compile in the fds. But, the point is, we are ready to handle redirected printfs, make them work as usual on the users rectangle with a fifo. Thus, any snippet doing work can throw up a small rect for printfs..

if(  (  (  imd = event(fmd,&ie)  ) <=0) && (   (  ikd = event(fkd,&ie)  ) <= 0)  )

No comments: