Basically the X11 package doesn't work. The reason is h2pas. It converts typedef char* XPointer; to type TXPointer = char;
That (of course) leads to some very nasty effects, such as different sizes of structs (since sizeof(pchar) is 4 and sizeof(char) is 1) and all the bad things resulting from that. e.g. even ScreenOfDisplay doesn't work - it is actually a macro that accesses PXPrivDisplay(dpy)^.screens[scr] and of course TXPrivDisplay is incorrect... :)
I can't fix h2pas, but I'm attaching diffs for the X11 units - x, xlib and xutil. I also included a translation of the X11 keysymdefs and implemented the macros properly in xlib and xutil, so that programming for raw X with fpc, isn't more terrible than programming for raw X with gcc.
The new keysym unit has to be added to the makefiles or it has to be converted to an include file, and included in the xlib unit. BTW isn't it better to merge the X, Xlib and Xutil units into only one unit - Xlib?
I changed a few types to what I think is more correct. (e.g. from char to byte, etc.) Hope that doesn't break the units from the other packages that use xlib. (but it shouldn't, as the changes are few)
x11.tar.bz2
Description: BZip2 compressed data