[Y-devel] Drag and Drop
Andreas Karafyllis ankar at homodigitalis.net
Sun Feb 29 21:29:45 GMT 2004
Hi everyone,
I studied the last week's messages of this mailing list and I noticed that no
one mentioned something about implementing "Drag and Drop" cababilities in Y.
If I missed it, please forgive me...
I find "Drag and Drop" (I will use DnD from mow on) a very important feature.
One of the weakness of X is that it does not have a standard DnD protocol.
For a look of the actual de-facto standart protocol in X (XDND) look here:
https://www.newplanetsoftware.com/xdnd/
Interesting is also the XDS protocol which is based on XDND and is used in the
ROX-Filer:
https://www.newplanetsoftware.com/xds/
I am not an expert in this area, but I think the Y DnD protocol will have very
few similarities to the XDND due to the fact that in Y all the widgets reside
on the server side. This basic architectural property of Y makes I think (and
I hope :-)) not very hard to implement such a protocol in Y.
I write here some of my thoughts. May be you find them simplistic, are however
a start.
Some terminology first:
dnd-data: The data that are transfered as result of the DnD operation. It
could be text that the user selected from a text editor, a URL, a file.
dnd-icon: An icon that is used as "visual metaphor" of the data being
transfered and it is attached to the mouse pointer during the DnD.
dnd-pointer: An alternative to the dnd-icon. A mouse pointer with a shape that
indicates that DnD is taking place.
dnd-source: The client from where the draging of an object is initiated.
dnd-target: The client where the object is dropped.
A) Start of Dragging:
The dragging is initiated by the dnd-source by sending a "Drag" message to the
Y-Server during an active Mouse Drag event. This message contains:
i) The type of the dnd-data(to indicate the type of the dnd-data we can use
MIME)
ii) A dnd-icon or the shape of a dnd-pointer
It is entirely decided from the dnd-source if a mouse drag should be
interpreted as a start of a DnD operation
B) Dragging
The Y-Server accepts the event only if the mouse drag is still active. It
draws then the dnd-icon so that it follows the mouse's movement.
C) Dropping
We need a "Drop" property for widgets of the dnd-target. This property
inidicates that
a) The widget can accept Drop events
b) The type of the dnd-data the widget can accept.
Drop-events are send to the *dnd-source* after the user drops the dnd-icon
upon a widget of the dnd-target by releasing the mouse bouton. The server
will generate this event of-course only if the Drop property of the widget is
set and only if the type of the dnd-data are compitible with the type of the
data that the widget accepts. A special "Not allowed" symbol can be drawed
over the dnd-icon while the pointer is over widgets that do not accept the
Drop.
D) Transfering
After the dnd-source receives the Drop event, it sends the DnD data to the
Y-Server and the server forwards the dnd-data to the dnd-target.
Alternative(efficient but more complicated): the Y-server says the dnd-source
how to contact the dnd-target and then the dnd-source transfers the data
diret to the dnd-target using some kind of IPC.
I am very interested to hear your thoughts too. Please correct me if I
misunderstood something in the Y architecture. I am not yet familiar with the
Y source code. I just started to manage the gnu-arch :-)
I am willing to contribute to this task. Based on the discussion here I can
write a small paper and the start coding. I am very experienced in C (and
less in C++) under Linux.
Have a nice time
Andreas Karafyllis
PS: from my name is rather obvious that I am not a native english speaker. I
am Greek who lives in Germany... :)
More information about the Y-devel mailing list
2026 © www.Y-Windows.Org - All Rights Reserved