On 31 Mar 2010, at 17:54, manolo gouy wrote: > Nothing is ready for the X11 platform. > That's where the question mark is.
For X11 there are essentially two separate (but very similar) mechanisms to consider, the ICCM's Selection Buffer mechanism and the later XDnD mechanism. It is not so hard to support both though, they use most of the same bits - and it sounds like a lot of what you have already would apply. The X11 mechanisms work like this (rough overview warning!) For XDND, an app registers with the WM to say that is can accept DND events. Then, if you drag your "object" onto a window of that app, an event will be triggered in the target app. The app can then send you a message to your app asking what formats you can provide data in (I think they call them TARGETS actually, but anyway) and you send back a list of known formats. The receiving app then sends back to say which format (if any) it likes - you can use this to set the cursor appropriately and so forth. Then, if you "drop" the "object" onto the target window, you get another request, for the actual data, and at that point you can do whatever conversions and formatting is required, and send over the data. And that's about it. The spec also has support for a "MULTIPLE" target type, where you can provide the data in several formats at once, which sounds a lot like what you describe for the Mac version, and let the receiver choose from there, but that doesn't seem to get used much - mostly it goes as I described, where you wait until the receiver asks for it in one of the formats you offered. That's the DND way - the SelectionNotify method is broadly similar, it is possible to write code that does both, and the basic flow, and the conversion routines and so forth are much the same. At present, I think we only offer text as a conversion, but for windows we could offer pixel maps or something instead - probably (as Albrecht suggested) by rendering them to an offscreen then pasting that data across to the target. Oh - and all the same things in reverse so we could accept incoming image data? _______________________________________________ fltk-dev mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk-dev
