See [1 ] for a discussion of the limitations and problems with the XLEL.
Lars H, 8 March 2007: I just encountered an awkward misfeature of this XLEL: Coordinates of lines drawn on the canvas will be rounded to integers! Sure enough, the canvas stores item coordinates as floats (doubles, even), and Aqua (or Quartz 2D [4 ], if we're technical) thinks a point is a pair of floats too, but on its way from one to the other it has to pass through the Xlib Emulation Layer, and Xlib thinks a point is a pair of integers (shorts, even), so any subpixel precision is lost.
While this is not a show-stopper, it does put some restrictions on the kind of things one can do on the canvas. It is probably also relevant for any discussion of antialiasing in Tk, but I don't know whether it would be pro or con...
DKF: Neutral for font rendering; we don't render individual characters but rather segments of text (i.e. all in the same font/color/style).
PT 15-Sep-2003: Tk implements the following Xlib functions, which constitute the XLEL. Some functions are in the xlib subdirectory of the Tk distribution. They map to corresponding functions on the different platforms and the original Xlib functions on systems using X11. Other functions reside in the platform's subdirectories and the 'generic' subdirectory. Note, the functions in the 'mac' directory are no longer supported/included in Tk 8.5.
xlib/xbytes.c: (defines a table to reverse bit order of bytes) xlib/xcolors.c: (contains the routines used to map from X color names to RGB and pixel values, all colors used by Tk are defined here) XParseColor FindColor (not an Xlib function) xlib/xdraw.c: XDrawLine -> maps to macosx/tkMacOSXDraw.c and win/tkWinDraw.c (called XDrawLines there) XFillRectangle -> maps to macosx/tkMacOSXDraw.c and win/tkWinDraw.c (called XFillRectangles there) xlib/xgc.c: (contains generic routines for manipulating X graphics) 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 */ xlib/ximage.c: (contains X bitmap and image routines) XCreateBitmapFromData xlib/xutil.c: (contains generic X emulation routines) XInternAtom XGetVisualInfo
win/tkWinDraw.c | macosx/tkMacOSXDraw.c | mac/tkMacDraw.c:
XCopyArea XCopyPlane XDrawLines (mapped from xlib/xdraw.c) XDrawSegments (only macosx and mac) XFillPolygon XDrawRectangle XDrawRectangles (only macosx) XFillRectangles (mapped from xlib/xdraw.c) * XDrawArc XDrawArcs (only macosx) XFillArc XFillArcs (only macosx) XMaxRequestSize (only macosx)
(Hmm, XFillArcs and XDrawArcs are never called anywhere in the core. Why are they there??)
XGrabPointer XUngrabPointer XDefineCursor
XKeycodeToKeysym XGetModifierMapping XFreeModifiermap XKeysymToString XStringToKeysym XKeysymToKeycode
XDestroyWindow XMapWindow XUnmapWindow XResizeWindow XMoveResizeWindow XMoveWindow XRaiseWindow XConfigureWindow
XSetInputFocus XGrabKeyboard XUngrabKeyboard XQueryPointer
XKeycodeToKeysym XGetModifierMapping XFreeModifiermap XKeysymToString XStringToKeysym XKeysymToMacKeycode (only macosx; not an Xlib function) XKeysymToKeycode
macosx/tkMacOSXSubwindows.c | win/tkWinWindow.c:
XDestroyWindow XMapWindow XUnmapWindow XResizeWindow XMoveResizeWindow XMoveWindow XRaiseWindow XLowerWindow (only macosx) XConfigureWindow XClearWindow (only win) XChangeWindowAttributes (only win)
macosx/tkMacOSXXStubs.c | win/tkWinImage.c:
XCreateImage XGetImage XGetImageZPixmap (only win; not an Xlib function)
XAllocColor XFreeColors XCreateColormap XFreeColormap
XGrabKeyboard XUngrabKeyboard XQueryPointer XWarpPointer XGetInputFocus XSetInputFocus