15.13 Using Extensions to X
An extension is a set of routines and capabilities that a hardware vendor has provided for use on a particular machine, in addition to the standard X library.
Extensions to X are not second-class citizens, and there should be very little to distinguish the use of an extension from that of the core protocol. The only difference is that the application should check to make sure the extension exists and then query the extension to find out the major opcode, additional event types, and additional error types so that the extension can be integrated properly. If the extensions have been written properly so that they initialize themselves when first called, they should be usable just like other X library functions.
XListExtensions() returns a list of all
extensions supported by the server. Once the name of the desired
extension is known, XQueryExtension() should be
called to get specific information about the extension.
XFreeExtensionList() should then be used to free the
memory allocated by XListExtensions().
The standard extensions as of this writing are the Shape extension, which supports non-rectangular windows, the X Input extension, which supports input devices other than the single mouse and keyboard normally connected to an X server, and PEX, a 3-D graphics extension. All extensions are optional, however. Only the Shape extension is available in virtually all X servers as of this writing.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access