I’m working adding drog and drop plus cut and paste to Cpw for the 2.0 release. I’m familiar with Windows methods for doing this but don’t know much about x11. From what I’ve read the functionality for drag and drop and cut and paste varies for each desktop environment. Curious if some X11 guru out there can give me opinions on a system I’ve come up with.
I’m fiddling with something that looks like this:
Registering for drag & drop and cut & paste:
cpwDragDropCallback( pCpw cpw,
CpwDropCallback ddcb );
The callback receives an object list pointer, and a window id as such:
CpwDragDropCallback ( pCpw cpw,
CpwDDList * list );
where in_out indicates if this a drop/paste (in) or drag/cut (out).
Here’s the list:
and here’s an object which holds or receives data :
There would be some utility routines for creating objects and inserting them into a
DD list object.
A simple text paste object would look like this:
obj.mimeType = “text/plain”
obj.extendedInfo = “”
obj.data = “Hello!”
obj.dataLength = 6
A paste of a tga file would look something like this, where the data is left to
the user to read in:
obj.mimeType = “image/tga”
obj.extendedInfo = “/dir/dir/roadster.tga”
obj.data = 0
obj.dataLength = 0
I’m curious if people think this type of system will work under X11?