Sunday, January 20, 2019

The direct xcb interface for xchars

typedef int XcbType(XCB *);
typedef struct{
XcbType * Connect;
XcbType * Window;
XcbType * GC;
XcbType * SetGC;
XcbType * Font;
XcbType * RGB;
XcbType * Text;
XcbType * Poll;
XcbType * Geometry;
} XcbTypes ;
extern XcbTypes   XcbDirect;

 Looks like this, above. Plin text entries, all use the same argument structure.

Every call to one of the interfaces require an XCB thing. That thing is an explosion of xcb type face, enough to make you eyes roll, but you don't need to look a it much. You mainly learn the correct order to call the entry points, any they will fill in you xcb thing like a form.

 I am still learning the sequences, like when we should keep a gc, and is their a default gc and how long can I keep a cursor thing, until I change it? Easy stuff, just keep trying things in different order.

One can link directly to xchars at start time,hide its entry points, have a private copy. Then the app would use the direct interface only.  The one can create a binding at load time and still use the direct entry. I don't use it, it is a pain to set up and I would have to invent and test the setup code.  The common interfaces on the Bus and packed char are plenty fast enough for command line. Flush might use it.

No comments: