| Drag-and-Drop in GTK+ and GNOME | |||
|---|---|---|---|
| <<< Previous | Home | Next >>> | |
A number of different protocols for drag-and-drop have been used under Unix and the X Window System. Historically, the commonly used protocols have been the Motif and OfficeX protocols, along with a number of proprietary vendor-specific protocols. The Motif protocol is the native drag-and-drop protocol of the Motif toolkit. [1] The protocol provides a comprehensive set of capabilities, but is very complex to implement and not documented. A fairly complete job reverse-engineering the protocol was done by the LessTif project [2] but in general, the Motif protocol is not a satisfactory solution for non-Motif applications.
The OfficeX protocol is much a simpler protocol that has been used in a number of free software projects. It covers the basics of drag-and-drop, but has no provision for dynamically communicating between the source and target to provide the correct feedback. A modified version of OfficeX protocol is used in KDE. [3]
Clearly, there was a need for a new protocol with similar capabilities to the Motif protocol, but simpler to implement and available as an open, public, standard. This need was filled by the Xdnd protocol. [4] The Xdnd protocol was developed by a group of interested developers, including representives from Red Hat Software [5] , Troll Tech [6] (the makers of the Qt Toolkit), and a number of different free software projects. It is a lightweight protocol that allows for feedback during the drag, and flexible negotiation of drag action and the format of transferred data. It also provides the necessary mechanism to for an additional type of action: "ask". For this action, when the drop occurs, a menu pops up allowing the user to select an action. This mode of operation is often easier on the user than requiring them to remember an obscure set of modifier keys for each drag action.
The Xdnd protocol has rapidly gained support. Not only is it supported by two of the most commonly used toolkits, GTK+ and Qt, but support for it is also being added, or has been added to a number of applications not using these toolkits, such as XEmacs [7] and StarOffice. [8] However, there is still a large installed base of programs using the Motif toolkit that support only Motif drag-and-drop.
| [1] | |
| [2] | |
| [3] | |
| [4] | |
| [5] | |
| [6] | |
| [7] | |
| [8] |