Direct manipulation offers various ways for source and target applications to exchange data. To accomplish the exchange, a separate conversation must be established to transfer each data object from the source to the target. The target must inform the source about the rendering mechanism it is using and the format in which the data is to be exchanged. The target can establish the conversations to run in parallel, or it can initiate the conversations in a serial fashion.
The target determines which rendering mechanism and format to use in the following manner:
This rendering conveys all information about the data. A target can determine if it supports the native rendering mechanism and format by using the following functions:
This is especially good for a Copy operation, because the user does not lose data about the object as occurs when the object is moved.
The target can determine the next best rendering mechanism and format to use through repeated calls to DrgVerifyRMF. The calls are made starting with the most desirable rendering mechanism and format pair and progressing to the least desirable pair. Once a pair that the source supports has been found, the target can exchange the data.
The following sample code shows how the target checks the rendering mechanism and format:
/* Now, we need to look at each item in turn */ for (i = 0; i < cItems; i++) { dragItem = DrgQueryDragitemPtr(dragInfo, i); /* Make sure we can move for a Move request */ /* or copy for a Copy */ if (((dragItem->fsSupportedOps & DO_COPYABLE) && (usOp == (USHORT)DO_COPY)) || ((dragItem->fsSupportedOps & DO_MOVEABLE) && (usOp == (USHORT)DO_MOVE))) { /* Check the rendering format */ if (DrgVerifyRMF(dragItem, "DRM_OS2FILE", "DRF_UNKNOWN")) usIndicator = DOR_DROP; else usIndicator = DOR_NEVERDROP; } else usIndicator = DOR_NODROPOP; }