Jonathan Harris <jhar(a)tardis.ed.ac.uk> writes:
> By the way: how does windos handle a drag (i.e. when is a press
a drag)?
It's up to the application to initiate a drag operation. The win32 user
interface guidlines recommend that the application should initiate a
drag operation when the user clicks and holds the left-button (with or
without modifiers) within selected text. Most applications also initiate
a drag when the right button (button3 in XEmacs) is used in the same
way.
Ah, we're on our own...
Do you know Xdnd (the protocol used by KDE)? It only uses MIME data in
drags. If you drag some files, the mime type url/* is used, where * is some
action verb (i.e. move or copy).
Because the state of the Ctrl modifier is examined at _drop_ time,
but
affects whether the _dragged_ text should be deleted, dragging is a
two-stage operation and needs both a start-drag and a stop-drag
function.
I pass the modifier into the misc-user event as you can see in event-Xt.c
(x_event_to_emacs_event). So we can check this also...
The new functions are in a file called dragdrop.el. A patch will follow soon
(next two hours).
I imagine that you're aiming for the lisp-level dispatch
functions to be
independant of the dnd system in use. Does the desired mswindows
behaviour that I've described sound consistent with that goal?
The independent drop function is already here: dragdrop-drop-dispatch (also
defined in dragdrop.el -- look into tests/Dnd/droptest.el for an example).
Drag *should* work semilar. I will create a misc-user-event if the button is
held down for a specified time (some ms). This will have
dragdrop-drag-dispatch as function. This function can do what it wants with
the thing, for example calling the right low-level-protocol function.
Actually, dnd for text uses a different and more complicated win32
API
than dnd for files. I don't plan to implement dnd for _text_ for XEmacs
21.0. This means that for XEmacs 21.0, the mswindows code won't be able
to initiate drags and will only have to handle file drops.
Then you should be able to complete the changes after I have send the next
patch... But don't forget to convert filepaths to URLs
('file:/usr/tmp/test.txt' is converted to '/usr/tmp/test.txt' by the
default
dragdrop-drop-dispatch function).
Regards,
Oliver.