Drag and drop resources are generally specified by an application.
Refer to the documentation for each application to determine which
drag and drop resources you can customize.
Protocol Resources
There are two types of protocols that can be in effect during a drag and drop transaction: preregister and dynamic. Generally, the preregister protocol is more efficient, uses fewer system resources, and provides more attractive drag-over effects. The dynamic protocol provides more attractive and powerful drag-under effects. Motif applications based on Release 1.2 should support both protocols.
You can specify which protocol you want in effect for drag sources and drop sites with the following resources. However, due to other constraints, the system may not be able to use the protocol you requested.
dragInitiatorProtocolStyle resource requests
the protocol style to be used when the client is the initiator of a
drag
dragReceiverProtocolStyle resource requests
the protocol style to be used when the client is a potential receiver
of a drop
These resources can have the following values (the letters in parentheses are used as abbreviations for the values in the table below):
DRAG_NONE (N)
DRAG_DROP_ONLY (X)
DRAG_PREREGISTER (P)
DRAG_PREFER_PREREGISTER (PP)
DRAG_PREFER_RECEIVER (R)
DRAG_PREFER_DYNAMIC (PD)
DRAG_DYNAMIC (D)
The following example specifies that an application
named myapp uses the dynamic protocol both when it is a
drag source and when it is a drag receiver.
myapp*dragInitiatorProtocolStyle: DRAG_DYNAMIC myapp*dragReceiverProtocolStyle: DRAG_DYNAMIC
It may take some experimentation to find the best values for these resources for the applications you are running on your particular system configuration. Here are some guidelines:
DRAG_PREFER_PREREGISTER and for the initiator is
DRAG_PREFER_RECEIVER, unless an application has changed
it.
DRAG_PREFER_PREREGISTER.
DRAG_DYNAMIC or
DRAG_PREFER_DYNAMIC.
DRAG_DYNAMIC.
DRAG_DYNAMIC
protocol may cause unnecessary thrashing. Set the initiator protocol
to DRAG_PREFER_PREREGISTER.
DRAG_PREREGISTER may reduce network
traffic.
DRAG_DYNAMIC or
DRAG_PREREGISTER, visual effects may be lost if the
source and destination have incompatible protocols. Use
DRAG_PREFER_PREREGISTER or
DRAG_PREFER_DYNAMIC if possible.
DRAG_DROP_ONLY value to avoid the time and memory
requirements of drag-over and drag-under effects completely.
The following table shows how a conflict between the source and destination protocols is resolved.
| Initiator Protocol | Receiver Protocol | |||||
|---|---|---|---|---|---|---|
| P | PP | PD | D | X | N | |
| P | P | P | P | X | X | N |
| PP | P | P | P | D | X | N |
| R | P | P | D | D | X | N |
| PD | P | D | D | D | X | N |
| D | X | D | D | D | X | N |
| X | X | X | X | X | X | N |
| N | N | N | N | N | N | N |
The following resources allow you to provide your own default graphics for drag-over situations. These graphics are used only if an application has not specified its own graphics.
defaultSourceCursorIcon
defaultCopyCursorIcon
defaultMoveCursorIcon
defaultLinkCursorIcon
defaultInvalidCursorIcon
defaultValidCursorIcon
defaultNoneCursorIcon
You can specify a pixmap and a mask to use for any part of the drag icon using the following resources:
pixmap
mask
Provide the name of the icon you are creating in addition to the resource. For instance, to specify a pixmap and mask for the invalid state icon, use the following resource specifications:
*defaultInvalidCursorIcon.pixmap: mypixmap *defaultInvalidCursorIcon.mask: mypixmask
You can specify which of the three parts of the drag icon you want to see
with the blendModel resource.
This resource can take the following values:
BLEND_ALL
BLEND_STATE_SOURCE
BLEND_JUST_SOURCE
BLEND_NONE
You can specify how you want the source, state and operation icon
to be located with respect to each other with the
attachment resource. This resource is used for state and
operation icons and ignored for the source icon. The attachment point
for these icons is the lower right corner. Use the attachment style
that gets the icons closest to the position you want, then use an
offset for final adjustment.
The attachment resource can take the following values:
ATTACH_NORTH_WEST
ATTACH_NORTH
ATTACH_NORTH_EAST
ATTACH_EAST
ATTACH_SOUTH_EAST
ATTACH_SOUTH
ATTACH_SOUTH_WEST
ATTACH_WEST
ATTACH_CENTER
ATTACH_HOT
If you
specify the attachment
resource in a resource file, include the name of the
icon to which it refers. For instance, to attach the valid state icon
at the upper left corner of the source icon, use the following specification:
*defaultValidCursorIcon.attachment: ATTACH_NORTH_NORTHWEST
You can move the state and operation icons from the basic attachment point by using offsets. Select the attachment point nearest to the location you want, then make final adjustments with the the following offset resources:
offsetX
offsetY
You can specify how you want the drop site's drag-under visual effects to
appear with the animationStyle resource.
This resource can take the following values:
DRAG_UNDER_HIGHLIGHT
DRAG_UNDER_SHADOW_OUT
DRAG_UNDER_SHADOW_IN
DRAG_UNDER_NONE
DRAG_UNDER_PIXMAP
Use the
animationPixmap, animationMask, and animationPixmapDepth
resources to specify the
pixmap to use if the animation style is DRAG_UNDER_PIXMAP.
Color Resources
Use the following resources to set colors for the drag icon:
validCursoForeground
invalidCursorForeground
noneCursorForeground
For example, the following specifications set the drag icon to blue when it is over a valid drop site, to red when it is over an invalid drop site, and to green when it is not over a drop site.
*validCursorForeground: Blue *invalidCursorForeground: Red *noneCursorForeground: Green