2 @c This is part of the SXEmacs Lisp Reference Manual.
3 @c Copyright (C) 1998 Oliver Graf <ograf@fga.de>
4 @c Original reference is (c) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
5 @c Copyright (C) 2005 Sebastian Freundt <hroptatyr@sxemacs.org>
6 @c See the file lispref.texi for copying conditions.
7 @setfilename ../../info/dragndrop.texi
9 @node Drag and Drop, Modes, Scrollbars, Top
10 @chapter Drag and Drop
13 @emph{WARNING}: the Drag'n'Drop API is still under development and the
14 interface may change! The current implementation is considered experimental.
16 Drag'n'drop is a way to transfer information between multiple applications.
17 To do this several GUIs define their own protocols. Examples are OffiX, CDE,
18 Motif, KDE, GNOME, and many more. To catch all these protocols,
19 SXEmacs provides a generic API.
21 One prime idea behind the API is to use a data interface that is
22 transparent for all systems. The author thinks that this is best
23 archived by using URL and MIME data, cause any internet enabled system
24 must support these for email already. SXEmacs also already provides
25 powerful interfaces to support these types of data (tm and w3).
28 * Supported Protocols:: Which low-level protocols are supported.
29 * Drop Interface:: How SXEmacs handles a drop from another application.
30 * Drag Interface:: Calls to initiate a drag from SXEmacs.
34 @node Supported Protocols
35 @section Supported Protocols
37 The current release of SXEmacs only support a small set of Drag'n'drop
38 protocols. Some of these only support limited options available in the API.
41 * OffiX DND:: A generic X based protocol.
42 * CDE dt:: Common Desktop Environment used on suns.
43 * Loose ends:: The other protocols.
51 @emph{WARNING}: If you compile in OffiX, you may not be able to use
52 multiple X displays successfully. If the two servers are from
53 different vendors, the results may be unpredictable.
55 The OffiX Drag'n'Drop protocol is part of a X API/Widget library created by
56 Cesar Crusius. It is based on X-Atoms and ClientMessage events, and works with
57 any X platform supporting them.
59 OffiX is supported if 'offix is member of the variable dragdrop-protocols, or
60 the feature 'offix is defined.
62 Unfortunately it uses it's own data types. Examples are: File, Files,
63 Exe, Link, URL, MIME. The API tries to choose the right type for the data that
64 is dragged from SXEmacs (well, not yet...).
66 SXEmacs supports both MIME and URL drags and drops using this API. No application
67 interaction is possible while dragging is in progress.
69 For information about the OffiX project have a look at http://leb.net/~offix/
76 CDE stands for Common Desktop Environment. It is based on the Motif
77 widget library. It's drag'n'drop protocol is also an abstraction of the
78 Motif protocol (so it might be possible, that SXEmacs will also support
79 the Motif protocol soon).
81 CDE has three different types: file, buffer, and text. SXEmacs only uses
82 file and buffer drags. The API will disallow full URL drags, only file
83 method URLs are passed through.
85 Buffer drags are always converted to plain text.
89 @subsection Loose ends
91 The following protocols will be supported soon: Xdnd, Motif, Xde (if I
92 get some specs), KDE OffiX (if KDE can find XEmacs windows).
94 In particular Xdnd will be one of the protocols that can benefit from
95 the SXEmacs API, cause it also uses MIME types to encode dragged data.
99 @section Drop Interface
103 For each activated low-level protocol, an internal routine will catch
104 incoming drops and convert them to a dragdrop-drop type
107 This misc-user-event has its function argument set to
108 @code{dragdrop-drop-dispatch} and the object contains the data of the drop
109 (converted to URL/MIME specific data). This function will search the variable
110 @code{experimental-dragdrop-drop-functions} for a function that can handle the
113 To modify the drop behavior, the user can modify the variable
114 @code{experimental-dragdrop-drop-functions}. Each element of this list
115 specifies a possible handler for dropped data. The first one that can handle
116 the data will return @code{t} and exit. Another possibility is to set a
117 extent-property with the same name. Extents are checked prior to the
120 The customization group @code{drag-n-drop} shows all variables of user
125 @section Drag Interface
129 This describes the drag API (not implemented yet).