Saturday, December 8, 2018

Doing xcb with linux

Been getting into the new Xwindows interface.  I never did X, just MS, and I intend to do anything in xcb. But.... xcb needs abut five of its new API to overcome the Xlib blocking effect, after that the remaining xlib code works fine. Hence, not a lot of examples, developers easily defaulting to standard X for most code.

But my Xchars compiles, most of the 4 or 5  routines work, independently. I am still a novice on the message coordination thing and want to avoid threads in the console loop. I don't want to build a polling service for all the various subsystems who may have thrown up a window.  I need a quick gadget somehow.

The easiest is to send an EXPOSE msg to the message loop whenever a window has its strings updated.  hen just call the message loop just before waiting for the next command.  Thus, we get automatic interleaving, subsystems get the process when call, and when no one is being called the Xchars gets the process for the loop. Very simple, ideal for command and control of the linux command bus.

 My Xchars is coming in at 250 lines,but it seems complete to me. You get one font, "fixed". The char positions in x and y computed from the size of the fixed font. You get default screen foreground and background. No hierarchy, all new windows linked to the the screen. No graphics, default boundaries.  The easiest thing to add is font selection. Xchars is easy to manage the strings, easy to fill the window when called. Easy to find and delete strings, they are just a list sorted by Y and X.  Easy to Calculate the invalidated rectangle, though I don't do it.

My force of bloat theory prevails

My Xchars is a cutnpaste of a few tutorials.  Only just today have I really begun to look closely at dynamics, and its simple.  My linux bloat filter work, there are so many methods to get things done in linux, that a good bloat filer can line up the layering, and cutnpase a new control architecture. Not a criticism, really, he system work. But if you don'w have a good bloat filter, if you cannot find common syntax, then you get way lost as all the vowels have been removed.

I posted a lab opy, not working really. But Xchars is like any other linux utility, give it a command words and necessary arguments and it does xcb. Other subsystems mostly make xchar call, and argument list must deal with integer window identifiers. If you keep track of the window IDs, you can read and write to many from the command line. The plan, anyway.

No comments: