sharplispers / clx

a fork of crhodes' fork of danb's fork of the CLX library, an X11 client for Common Lisp
Other
116 stars 46 forks source link

Add support for cmucl #127

Closed rtoy closed 5 years ago

rtoy commented 5 years ago

This is a pretty minimal set of changes to get clx to work with cmucl.

Change *def-clx-class-use-defclass* to be nil for cmucl. Not sure why it was set to use classes for xlib:drawable, xlib:window and xlib:pixmap. This is required because dbe wants to include drawable, which doesn't work when drawable is a class and not a structure.

Implement open-x-stream for cmucl. This is basically a copy from the original clx version in cmucl.

Finally, a few minor changes because with-array-data is now in the "LISP" package, not the "KERNEL" package.

With these changes, the demos seem to work. (The demos want to use open-clx-display, which isn't defined here. Not sure what the best solution is for that.)

rtoy commented 5 years ago

Using open-default-display works. Or at least doesn't seem to be any worse than using open-clx-display.

However, several demos don't really display anything so I'm not sure if it's working or not. I need to compare the results with the clx distributed with cmucl to know for sure.

Also not sure what do with open-clx-display. It's defined in clx-ext.lisp in cmucl which is compiled as part of clx and has lots of other functionality. Not including clx-ext.lisp would break back-compatibility. But maybe the way forward is just to recommend people use clx from quicklisp instead of the cmucl's version. I don't want to have to maintain cmucl's modified version of sharplispers/clx.

rtoy commented 5 years ago

Ok. Some functionality is definitely missing. The demos included with cmucl's clx actually work, like the tower of Hanoi and qix, and maybe others. These don't work here. I need to do some more investigation of the differences between the two versions. Cmucl's version is a hacked of version of sharplispers clx from a while ago.

dkochmanski commented 5 years ago

Thanks, when you know something let us know in a ticket. This looks good to me, merging.

rtoy commented 5 years ago

Thanks for merging.

There are weird things going on and I don't now what the problem is. I have updated cmucl's version of clx with this one (more or less) and when I compile it in with cmucl, most of the demos look like they work. And demos include a window manager frame around them, unlike from here.

rtoy commented 5 years ago

Ah, I was running the clx demo from cmucl's contrib/demo directory. It's similar to clx-demos.lisp, but also quite different. Whatever it's doing, it works much better on cmucl. The plaid, greynetic, fast and slow towers of Hanoi, and bouncing ball demos work very nicely.