next up previous contents index
Next: 8. When the Keyboard Up: 7. Drag and Drop Previous: 4. The Drop Protocol   Contents   Index

5. The Preregister Mode

The full protocol described in this chapter so far is only used when both the initiator and receiver have agreed to use the dynamic mode. When using the preregister mode, the initiator grabs the server when the drag starts, and whenever the pointer enters a new top level window, it reads all the drop site information it needs for doing its tracking, visual feedback, etc., from a preregistered database attached to the _MOTIF_DRAG_RECEIVER_INFO property of each participating client top level window. Obviously, no drag X client messages are sent, since no one is listening to them (remember, that the X server is grabbed). The server gets ungrabbed when the user drops the object, at which point the documented drop protocol comes in effect (together with the convention for the transfer success or failure).

For the preregister mode, the _MOTIF_DRAG_RECEIVER_INFO property has also valid information stored in the second half, as descibed in table [*]. In addition, the header (which has a size of 16 bytes) is followed by ``drop site blocks'' that describe the drop sites located within the top level window of a receiver.

Figure: Overall structure of the _MOTIF_DRAG_RECEIVER_INFO property for the preregister mode.
\begin{figure}
\hskip\leftmargin\epsfig {file=DD_DSB.eps,scale=1.09}\end{figure}

For each drop site there is a corresponding drop site block in the _MOTIF_DRAG_RECEIVER_INFO property. Each drop site block starts with a 8 bytes long ``drop site header'', and is followed by a ``visual info block'' and a series of geometry boxes giving geometry information about a drop site. This overall structure is shown in figure [*].


Table: The structure of a drop site block header
Offset Size Description
+0x00 CARD16 Drop Site Flags: bitfield containing various flags which describe the possible operations, the drop type, the animation style, as well as some other things.
+0x02 CARD16 Targets Index: the index of a targets list within the targets table. The first list within the targets table has an index of 0. This index advertises which targets the initiator is willing to handle. This value is used in the same way as the Targets Index of the _MOTIF_DRAG_INITIATOR_INFO property.
+0x04 CARD32 Number of Geometry Boxes: the number of geometry boxes following the visual info block for this drop site block.


- under construction -


next up previous contents index
Next: 8. When the Keyboard Up: 7. Drag and Drop Previous: 4. The Drop Protocol   Contents   Index
Danny Backx
2000-12-13