Version 6 of Xlib

Updated 2003-09-15 22:32:07

Xlib is the library that X uses for applications to communicate with the X server. It's a higher level library built upon the X protocol. It hides the details of the protocol. It's often used for writing widgets, and Tk emulates many Xlib functions on platforms that don't have X, such as Win32 and the Mac (see below).

There are two bindings for Xlib. The first was written in Lisp many years ago, and the newer version is written in C. X.org has archives that contain the Lisp version. Tk AFAIK has always used the C version.

If you want to learn how to program in Xlib I (GPS) suggest you look for the Xlib Programming Manual by Adrian Nye. The postscript papers included in the X documentation are quite good as well, but tend to be verbose.


PT 15-Sep-2003: Tk implements the following Xlib functions:

 xbytes.c:

 xcolors.c:
   XParseColor

 xdraw.c:
   XDrawLine
   XFillRectangle

 xgc:
   XCreateGC
   XChangeGC
   XFreeGC
   XSetForeground
   XSetBackground
   XSetDashes
   XSetFunction
   XSetFillRule
   XSetFillStyle
   XSetTSOrigin
   XSetFont
   XSetArcMode
   XSetStipple
   XSetLineAttributes
   XSetClipOrgin
   TkSetRegion
   XSetClipMask
   XCreateFontCursor /* not implemented */
   XDrawImageString  /* not implemented */
   XDrawPoint
   XDrawSegments /* not implemented */
   XFetchBuffer /* not implemented */
   XFetchName /* not implemented */
   XListProperties /* not implemented */
   XMapRaised /* not implemented */
   XPutImage /* not implemented */
   XQueryTextExtents /* not implemented */
   XReparentWindow /* not implemented */
   XRotateBuffers /* not implemented */
   XStoreBuffer /* not implemented */
   XUndefineCursor /* not implemented */

 ximage.c:
   XCreateBitmapFromData

 xutil.c:
   XInternAtom
   XGetVisualInfo

References