|
|||||||||||||||||
Searching XEmacs
Quick Links
About XEmacs
|
Drag-n-Drop Interface ChangesOwner: ??? Effort: ??? Dependencies: Lisp Interface Changes Abstract: I propose completely redoing the drag-n-drop interface to make it powerful and extensible enough to support such concepts as drag over and drag under visuals and context menus invoked when a drag is done with the right mouse button, to allow drop handlers to be defined for all sorts of graphical elements including buffers, extents, mode lines, toolbar items, menubar items, glyphs, etc., and to allow different packages to add and remove drop handlers for the same drop sites without interfering with each other. The changes are extensive enough that I think they can only be implemented in version 22, and the drag-n-drop interface should remain experimental until then. The new drag-n-drop interface centers around the twin concepts of drop site and drop handler. A drop site specifies a particular graphical element where an object can be dropped onto, and a drop handler encapsulates all of the behavior that happens when such an object is dragged over and dropped onto a drop site. Each drop site has an object associated with it which is passed to
functions that are part of the drop handlers associated with that
site. The type of this object depends on the graphical element that
comprises the drop site. The drop site object can be a buffer, an
extent, a glyph, a menu path, a toolbar item path, etc. (These last
two object types are defined in
Lisp Interface Changes
in the sections on menu and toolbar API changes. If we wanted to
allow drops onto other kinds of drop sites, for example mode lines, we
would have to create corresponding path objects). Each such object
type should be able to be accessed using the generalized property
interface defined above, and should have a property called
Each drop handler has an object of type A drop handler is added to a drop site using the
Logically, the drop handlers associated with a particular drop site are an ordered list. The first drop handler whose specified MIME type matches the MIME type of the object being dragged or dropped controls what happens to this object. This is important particularly because the specified MIME type of the drop handler can be a regular expression that, for example, matches all audio objects with any sub-type. In the current drag-n-drop API, there is a distinction made between objects with an associated MIME type and objects with an associated URL. I think that this distinction is arbitrary, and should not exist. All objects should have a MIME type associated with them, and a new XEmacs-specific MIME type should be defined for URLs, file names, etc. as necessary. I am not even sure that this is necessary, however, as the MIME specification may specify a general concept of a pointer or link to an object, which is exactly what we want. Also in some cases (for example, the name of a file that is locally available), the pointer or link will have another MIME type associated with it, which is the type of the object that is being pointed to. I am not quite sure how we should handle URL and file name objects being dragged, but I am positive that it needs to be integrated with the mechanism used when an object itself is being dragged or dropped. As is described in
a separate page,
the Ben Wing |
||||||||||||||||
|
|
||||||||||||||||
Conform with <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Automatically validated by PSGML