On Thu, Aug 30, 2007 at 10:58:40PM -0400, Joubert Nel wrote:
Hello Tamas,
I'm experimenting with the xlib-context and have modified lines 170 and 172 to set maxheight and maxwidth to a large number.
This allows the resulting Xlib window to be resizable.
Before I continue down this path, I'd like to know whether you are open to the idea of expanding xlib-context so that it can play host to an interactive UI, instead of only *presenting* graphics. I'm thinking about creating a mechanism for passing along Xlib events etc. to a code that consumes cl-cairo2.
Hi Joubert,
Generally, I am happy to accept contributions.
However, I don't really understand what you are doing. Presenting graphics is very simple and can be done with little user interaction, since the flow of data is one way (Lisp application -> pixmap buffer -> X11 display). This allows a particularly simple event model, where I can start the event loops as threads and the "main" application doesn't need to care about them any longer. This suits me fine, the purpose of this context was that I could debug my cairo code while watching stuff happen on screen.
In an application where the GUI is not a sideshow but the main feature, you would have a single event loop that orchestrates everything, including GUI management and whatever background processes you need. Plain vanilla Xlib is not really suitable for that, as it is a pain in the ass to program. That's why people came up with toolkits like Gtk or Qt. I would suggest that you familiarize yourself with the framework of your choice, and then ask on the appropriate mailing list (cairo list is a good place to start).
The only thing to keep in mind is that cl-cairo2 will need an Xlib display, a visual and a drawable to create a surface. Once you have that, you can use all the drawing efunctions and take care of syncing in the event loop. If I recall correctly, I have seen some gtk & cl library which would be suitable, but I can't recall which.
Maybe I can help more if you tell us what it is you are trying to achieve (what kind of application etc). Do you have any prior experience with using any of the X toolkits?
HTH,
Tamas