The Common Desktop Environment provides a drag-and-drop API,
that is layered on top of the Motif 2.1 drag-and-drop API, to provide
convenient, consistent, and interoperable drag and drop across the
desktop. The Common Desktop Environment drag-and-drop API makes
it easier for developers to implement drag and drop. With drag and
drop, users can manipulate objects on the screen directly by grabbing
them, dragging them around the display, and dropping them on other
objects to change the object's location or perform a data transfer.
Motif 2.1 drag and drop provides low-level drag-and-drop mechanisms;
Common Desktop Environment drag and drop incorporates policies for
those mechanisms.
Common Desktop Environment drag and drop consists of an API
and protocols to simplify the interface to Motif drag and drop.
It implements policies such as the buffer transfer protocol and
the drag cursors' appearances. Use the Common Desktop Environment
drag-and-drop API, with its built-in policies, to ensure interoperability
through consistency. Common Desktop Environment drag-and-drop policies
are compatible with standard Motif 2.1 drag-and-drop protocols for
text and file name transfers.
Common Desktop Environment drag and drop uses the X selection
mechanism to transfer data. Suitable targets exist and are registered
with the X Consortium. Two desktop applications can agree to transfer
data through the text, file name, or data transfer protocols.
The existing Motif 2.1 API for drag and drop is flexible and,
therefore, is somewhat difficult for nonexpert developers to use.
The Common Desktop Environment drag-and-drop API provides some convenience
functions that result in an API that is simpler and easier to use:
Manages the configuration
and appearance of drag icons.
Common Desktop Environment drag and drop provides graphics
for the default source, state, and operation icons that compose
the drag icon in Motif 2.1.
Defines a buffer transfer protocol.
Motif 2.1 drag and drop defines protocols for file name and
text string only.
Enables animation upon drop.
The drop zone can define an animation procedure that is called
when the drop completes.
Provides enumeration of targets for TEXT
and FILE_NAME transfers.
Provides dual registration.
You can register a text widget as a drop zone for data other
than text, while preserving the ability to accept text drops.
Provides prioritized drop formats.
The order in which you specify protocols for the drop zone
indicates the relative priority of the protocols desired.
Demo Programs |
 |
You can find the drag-and-drop demos in /usr/dt/examples/dtdnd.
Read the README file for detailed
information on the demos.
For more information on Common Desktop Environment drag and
drop, see the relevant man pages and the Programmer's
Guide.