Monday, December 24, 2018

Xchar, progress

I was interested in putting a symbol table on the font end of Xchars, and I did. There are four type of symbols, connections, windows, graphics contexts and rectangles. String are attached to rectangles, are not symbol managed.
Rects have to have windows which need connections.  Graphics contexts are ad hoc, and there is a default graphics context. Color and font can be set on any graphic context. Graphics context can be attached to rectangles and windows.

So the hierarchy is fairly simple and he construction of arguments to xcb is driven by the symbol table look ups.  The xcb utilities backing this up are cutnpaste spaghettit from the xcb tutorials.

GC commands look like

NewGC mygc color font;  // color and font optional
SetGC mygc color font;

and the usual:
NewWin, NewRect, PutString.   Rects are key, a string is attached to a rect,and it is rectangles that get drawn or filled. It seems to work, it is not automatic, but close to cutnpast. Makes using Xchar loadable fairly easy.

No comments: