Saturday, December 22, 2018

xcb generates ids

xcb_generate_id (c);  // c is your connection, we ignore the connection for the moment

What is an ID? Something like an address, and when you send a request for a screen widget, the request can be bound to an id, so both the screen manager and calling application agree on the screen widget.

Whew, that is not the point. The point is, Xchar will generate ids to identify particular strings and string blocks on the screen.  The basic object in Xchars is the printable string of text, and Xchars expects there to be many string objects over many windows.  Xchars uses an extremely fast look up, a few computer instructions, to go from the id to the text block on the window.

Callers can provide a string id of eight characters or less, instead of having an ID auto generated generated.  User ID should not noticeably affect performance.  The  call API include new string block, color changes, delete, replace, etc:  All APIs thus have the form:

api_name(id,arg1.arg2 arg3....  

The arguments identify mostly color and position. A vey simple API.  Then for advanced Xchars application, the entire xbc call API is available via the Xchars windows, users beware. Xchars will simply allow pass through on a blind basis, at first. All arguments are void *, or simply 64 bit values of some sort.  Xchars will use some standardmap[ping serived from teh xcb standard API which was derived from the standard header which was derived by some fool making the xml definition of xcb, wow! I will just add another chain and map from a string of longs to the various arguments. Fairly easy with the help of gcc, it tells you the exact form an xcb all needs:

 (long, long*, long**, long***, long*****... I mean how many friggen argument forms can gcc generate, all 64 bit? So I run gcc and it tells me how many asterisks I need in front of a 64 bit value before it shuts up, they are all 64 bit flip flops inside the processor. Tisiswht Imean by moving the semantics upstairs.  Everything maps fro a coporate ides (Thestandard corporate window, report, action, process..) maps to a series of long with some number of asterisks, so gcc won't bitch.  Add a command word so xcb and caller can agree on the number of asterisks.

No comments: