next up previous contents index
Next: 6. Starting a Drag Up: 2. Protocol Basics Previous: 4. The Targets Table   Contents   Index

5. Advertising a Receiver

A receiver advertises itself by placing a property with the name _MOTIF_DRAG_RECEIVER_INFO (of type _MOTIF_DRAG_RECEIVER_INFO, size is 8) on its top level window. Depending on the protocol styles the receiver can handle (dynamic mode and/or preregister mode), this property contains more or less data. But at least the property must be 16 bytes long.

_MOTIF_DRAG_RECEIVER_INFO

Table: The structure of the _MOTIF_DRAG_RECEIVER_INFO property describes a drag and drop receiver.
Offset Size Description
+0x00 BYTE Byte Order: either 'B' (MSB first) or 'l' (LSB first).
+0x01 BYTE Protocol Version of Receiver: currently 0.
+0x02 BYTE Protocol Style: one of the protocol styles listed in table [*]
+0x03 BYTE Padding.
+0x04 CARD32 Proxy Window: - under construction -
+0x08 CARD16 Number of Drop Sites: number of drop site blocks, which are immediately following this header.
+0x0A CARD16 Padding.
+0x0C CARD32 Total Size: - under construction -


The second half of the header shown in table [*] is only used in the preregister mode. For the dynamic mode and when the drop site is a drop-only site, then the second half within the header is not needed. Because the preregister mode is really tricky, we're discussing it later in more detail.


Table: Drag protocol styles.
Identifier Value
XmDRAG_NONE 0x00
XmDRAG_DROP_ONLY 0x01
XmDRAG_PREFER_PREREGISTER 0x02
XmDRAG_PREREGISTER 0x03
XmDRAG_PREFER_DYNAMIC 0x04
XmDRAG_DYNAMIC 0x05
XmDRAG_PREFER_RECEIVER 0x06


When a receiver signals that it can handle the dynamic mode, then it will accept and answer the drag messages sent by the initiator as specified in the next section. If the protocol style of the receiver is drop-only, then the initiator should not send any drag messages. The only message the initiator is allowed to send then is the XmDROP_START message. In this case the visual effects during the drag and drop gesture should indicate to the user that the whole top level window of the receiver works as a single drop site accepting all possible targets and operations.

A receiver with a protocol style of XmDRAG_NONE wants not to be disturbed by drag and drop operations at all. The initiator should provide appropriate visual feedback whenever the drag icon is over such a receiver.


next up previous contents index
Next: 6. Starting a Drag Up: 2. Protocol Basics Previous: 4. The Targets Table   Contents   Index
Danny Backx
2000-12-13