DtDndPro.sgm 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <!-- $XConsortium: DtDndPro.sgm /main/10 1996/08/31 14:54:19 rws $ -->
  2. <!-- (c) Copyright 1995 Digital Equipment Corporation. -->
  3. <!-- (c) Copyright 1995 Hewlett-Packard Company. -->
  4. <!-- (c) Copyright 1995 International Business Machines Corp. -->
  5. <!-- (c) Copyright 1995 Sun Microsystems, Inc. -->
  6. <!-- (c) Copyright 1995 Novell, Inc. -->
  7. <!-- (c) Copyright 1995 FUJITSU LIMITED. -->
  8. <!-- (c) Copyright 1995 Hitachi. -->
  9. <refentry id="CDEMX.MAN89.rsml.1">
  10. <refmeta><refentrytitle>DtDndProtocol</refentrytitle><manvolnum>special file
  11. </manvolnum></refmeta>
  12. <refnamediv><refname><structname role="typedef">DtDndProtocol</structname></refname>
  13. <refpurpose>drag and drop matching and transfer protocols</refpurpose></refnamediv>
  14. <!-- CDE Common Source Format, Version 1.0.0-->
  15. <!-- (c) Copyright 1993, 1994, 1995 Hewlett-Packard Company-->
  16. <!-- (c) Copyright 1993, 1994, 1995 International Business Machines Corp.-->
  17. <!-- (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc.-->
  18. <!-- (c) Copyright 1993, 1994, 1995 Novell, Inc.-->
  19. <refsect1>
  20. <title>DESCRIPTION</title>
  21. <para>The drag and drop protocols provide policy for matching and data transfer
  22. between the drag initiator and the drop receiver of file names, selected text
  23. spans and application-defined structured data formats.</para>
  24. <para>The drag and drop protocols use the standard X11 selection targets,
  25. where available, with the addition of several new selection targets where
  26. required.</para>
  27. <para>These protocols provide for the transfer of the following types of data:
  28. </para>
  29. <itemizedlist>
  30. <!-- merged from xo+cde-->
  31. <listitem><para>Selected Text</para>
  32. </listitem><listitem><para>File Names</para>
  33. </listitem><listitem><para>Buffers</para>
  34. </listitem></itemizedlist>
  35. </refsect1>
  36. <refsect1>
  37. <title>PROTOCOL OVERVIEW</title>
  38. <para>Each protocol consists of the following:</para>
  39. <refsect2>
  40. <title>Drag and Drop API Protocol</title>
  41. <para>Each protocol described corresponds to a specific <structname role="typedef">DtDndProtocol</structname> enumeration value.</para>
  42. </refsect2>
  43. <refsect2>
  44. <title>Export/Import Targets</title>
  45. <para>The Motif drag and drop API provides support for matching of the data
  46. transfer protocol between the drag initiator and the various drop receivers.
  47. This allows the user to determine readily which drop sites will accept the
  48. dragged data.</para>
  49. <para>The drag initiator sets the <systemitem class="Resource">XmNexportTargets</systemitem> resource of the <classname>XmDragContext</classname> to the
  50. list of target atoms that describe the data being dragged. The drop receiver
  51. sets the <systemitem class="Resource">XmNimportTargets</systemitem> resource
  52. of the <Symbol>XmDropSite</Symbol> to the list of target atoms that describe
  53. the data that it will accept. The Motif drag and drop subsystem allows drops
  54. when the <systemitem class="Resource">XmNexportTargets</systemitem> and <systemitem class="Resource">XmNimportTargets</systemitem> have at least one target in
  55. common.</para>
  56. </refsect2>
  57. <refsect2>
  58. <title>Data Transfer Protocol</title>
  59. <para>Once the drag initiator has dropped on the drop receiver, the transfer
  60. of data is begun. The transfer is accomplished using X selections and is controlled
  61. by the drop receiver.</para>
  62. <para>The drop receiver starts all transfers by converting the selection into
  63. the ICCCM <systemitem class="Constant">TARGETS</systemitem> target to get
  64. the set of available selection targets. (See the &str-Zi; for a description
  65. of converting targets.) It then chooses the appropriate selections from that
  66. set and requests that the drag initiator convert each requested selection.
  67. Each protocol has a set of selection targets that are used to transfer all
  68. the necessary data. These target conversions are usually initiated by calling <function>XmDropTransferStart</function>.</para>
  69. </refsect2>
  70. <refsect2>
  71. <title>Move Completion</title>
  72. <para>When the operation of the drop is <systemitem class="Constant">XmDROP_MOVE</systemitem>, the drop receiver must complete the move using an appropriate
  73. method. For most data transfers, this is accomplished by converting the selection
  74. into the ICCCM <systemitem class="Constant">DELETE</systemitem> target to
  75. tell the drag initiator that it may delete the data. For most file name transfers,
  76. this is accomplished via the file system.</para>
  77. </refsect2>
  78. </refsect1>
  79. <refsect1>
  80. <title>TEXT TRANSFER PROTOCOL</title>
  81. <para>The text transfer protocol is used to exchange text selections.</para>
  82. <refsect2>
  83. <title>Drag and Drop API</title>
  84. <para>This is the protocol used when a <structname role="typedef">DtDndProtocol</structname> of <systemitem class="Constant">DtDND_TEXT_TRANSFER</systemitem>
  85. is specified.</para>
  86. </refsect2>
  87. <refsect2>
  88. <title>Export/Import Targets</title>
  89. <para>The export or import targets are any of the following; the target describing
  90. the character encoding of the text selection, <systemitem class="Constant">COMPOUND_TEXT</systemitem>, <systemitem class="Constant">STRING</systemitem>
  91. or <systemitem class="Constant">TEXT</systemitem>.</para>
  92. </refsect2>
  93. <refsect2>
  94. <title>Data Transfer Protocol</title>
  95. <para>The transfer of text selections follows the protocols described in the
  96. ICCCM manual. If the character encoding of the drag initiator and drop receiver
  97. are the same, that target should be converted to get the text selection. If
  98. the character encoding are different, the drop receiver should attempt to
  99. convert the standard text targets in the following order: <systemitem class="Constant">COMPOUND_TEXT</systemitem>, <systemitem class="Constant">STRING</systemitem>
  100. or <systemitem class="Constant">TEXT</systemitem>.</para>
  101. </refsect2>
  102. <refsect2>
  103. <title>Move Completion</title>
  104. <para>The move is completed by converting the selection into the ICCCM <systemitem class="Constant">DELETE</systemitem> target.</para>
  105. </refsect2>
  106. </refsect1>
  107. <refsect1>
  108. <title>FILE NAME TRANSFER PROTOCOL</title>
  109. <para>The transfer protocol is used to exchange file names.</para>
  110. <refsect2>
  111. <title>Drag and Drop API</title>
  112. <para>This is the protocol used when a <structname role="typedef">DtDndProtocol</structname> of <systemitem class="Constant">DtDND_FILENAME_TRANSFER</systemitem>
  113. is specified.</para>
  114. </refsect2>
  115. <refsect2>
  116. <title>Export/Import Targets</title>
  117. <para>The export or import targets are <systemitem class="Constant">FILE_NAME</systemitem> and, optionally, <systemitem class="Constant">_DT_NETFILE</systemitem>
  118. if capable of providing the file name in network canonical form using &cdeman.tt.file.netfile; and &cdeman.tt.netfile.file;.</para>
  119. </refsect2>
  120. <refsect2>
  121. <title>Data Transfer Protocol</title>
  122. <para>If the ICCCM <systemitem class="Constant">HOST_NAME</systemitem> target
  123. is in the list of target atoms, it is converted. If the returned host name
  124. is different than the host name for the drop receiver and the <systemitem class="Constant">_DT_NETFILE</systemitem> target is in the list of target
  125. atoms, it is converted. The drag initiator uses &cdeman.tt.file.netfile; to encode the file names and the drop receiver uses &cdeman.tt.netfile.file; to decode the file names.</para>
  126. <para>If the hosts are the same for both the drag initiator and the drop receiver
  127. or either the <systemitem class="Constant">HOST_NAME</systemitem> or the <systemitem class="Constant">_DT_NETFILE</systemitem> targets are not in the list of target
  128. atoms from the drag initiator, the drop receiver converts the ICCCM <systemitem class="Constant">FILE_NAME</systemitem> target. No encoding of the file names
  129. occurs in this case.</para>
  130. </refsect2>
  131. <refsect2>
  132. <title>Move Completion</title>
  133. <para>Moves of file names can be accomplished atomically using standard file
  134. system operations. Drop receivers are encouraged to use the file system. The
  135. drop receiver may alternatively choose to use the ICCCM <systemitem class="Constant">DELETE</systemitem> target to complete the <systemitem class="Constant">XmDROP_MOVE</systemitem> and the drag initiator must be ready to comply.</para>
  136. </refsect2>
  137. </refsect1>
  138. <refsect1>
  139. <title>BUFFER TRANSFER PROTOCOL</title>
  140. <para>The transfer protocol is used to exchange memory buffers.</para>
  141. <refsect2>
  142. <title>Drag and Drop API</title>
  143. <para>This is the protocol used when a <structname role="typedef">DtDndProtocol</structname> of <systemitem class="Constant">DtDND_BUFFER_TRANSFER</systemitem>
  144. is specified.</para>
  145. </refsect2>
  146. <refsect2>
  147. <title>Export/Import Targets</title>
  148. <para>The export and import targets are <systemitem class="Constant">_DT_BUFFER_DATA</systemitem>, <systemitem class="Constant">_DT_BUFFER_LENGTHS</systemitem>
  149. and, optionally, <systemitem class="Constant">_DT_BUFFER_NAMES</systemitem>.
  150. </para>
  151. </refsect2>
  152. <refsect2>
  153. <title>Data Transfer Protocol</title>
  154. <para>The <systemitem class="Constant">_DT_BUFFER_DATA</systemitem> and <systemitem class="Constant">_DT_BUFFER_LENGTHS</systemitem> targets are converted to
  155. transfer the buffer data.</para>
  156. <para>The data of the buffers is encoded into the <systemitem class="Constant">_DT_BUFFER_DATA</systemitem> target as an array of bytes. The lengths in bytes
  157. of each buffer are encoded into <systemitem class="Constant">_DT_BUFFER_LENGTHS</systemitem>. Each length is used to index into the <systemitem class="Constant">_DT_BUFFER_DATA</systemitem> array.</para>
  158. <para>If the <systemitem class="Constant">_DT_BUFFER_NAMES</systemitem> target
  159. is available, it is converted to transfer the names of the buffers.</para>
  160. </refsect2>
  161. <refsect2>
  162. <title>Move Completion</title>
  163. <para>The move is completed by converting the selection into the ICCCM <systemitem class="Constant">DELETE</systemitem> target.</para>
  164. </refsect2>
  165. </refsect1>
  166. <refsect1>
  167. <title>SELECTION TARGETS</title>
  168. <para>The following table describes the selection targets used in the drag
  169. and drop data matching and transfer protocols.</para>
  170. <informaltable remap="center" orient="port">
  171. <tgroup cols="3" colsep="0" rowsep="0">
  172. <?PubTbl tgroup dispwid="6.08in">
  173. <colspec align="left" colwidth="2.27in">
  174. <colspec align="left" colwidth="2.02in">
  175. <colspec align="left" colwidth="2.87in">
  176. <tbody>
  177. <row>
  178. <entry align="left" valign="top"><structname role="typedef">Atom</structname></entry>
  179. <entry align="left" valign="top"><literal>Type</literal></entry>
  180. <entry align="left" valign="top"><literal>Description</literal></entry></row>
  181. <row>
  182. <entry align="left" valign="top">TARGETS</entry>
  183. <entry align="left" valign="top">ATOM</entry>
  184. <entry align="left" valign="top">A list of valid target atoms. See ICCCM section
  185. 2.6.2.</entry></row>
  186. <row>
  187. <entry align="left" valign="top">DELETE</entry>
  188. <entry align="left" valign="top">NULL</entry>
  189. <entry align="left" valign="top">Used to delete the dropped data. If the drop
  190. receiver wishes to perform a move operation on the data, after copying the
  191. data it should request conversion of the <systemitem class="Constant">DELETE</systemitem> target. See ICCCM section 2.6.3.1.</entry></row>
  192. <row>
  193. <entry align="left" valign="top">COMPOUND_TEXT</entry>
  194. <entry align="left" valign="top">COMPOUND_TEXT</entry>
  195. <entry align="left" valign="top">The text selection in compound text format.
  196. See ICCCM section 2.7.1.</entry></row>
  197. <row>
  198. <entry align="left" valign="top">STRING</entry>
  199. <entry align="left" valign="top">STRING</entry>
  200. <entry align="left" valign="top">The text selection in ISO Latin-1 format.
  201. See ICCCM section 2.7.1.</entry></row>
  202. <row>
  203. <entry align="left" valign="top">TEXT</entry>
  204. <entry align="left" valign="top">TEXT</entry>
  205. <entry align="left" valign="top">The text selection in the format preferred
  206. by the selection holder. See ICCCM section 2.7.1.</entry></row>
  207. <row>
  208. <entry align="left" valign="top">HOST_NAME</entry>
  209. <entry align="left" valign="top">TEXT</entry>
  210. <entry align="left" valign="top">The name of the machine running the client
  211. as seen from the machine running the server. See ICCCM section 2.6.2.</entry>
  212. </row>
  213. <row>
  214. <entry align="left" valign="top">FILE_NAME</entry>
  215. <entry align="left" valign="top">TEXT</entry>
  216. <entry align="left" valign="top">The full path name of the files. See ICCCM
  217. section 2.6.2.</entry></row>
  218. <row>
  219. <entry align="left" valign="top">_DT_NETFILE</entry>
  220. <entry align="left" valign="top">TEXT</entry>
  221. <entry align="left" valign="top">The full pathname of the files, each encoded
  222. using &cdeman.tt.file.netfile; and decoded using &cdeman.tt.netfile.file;.</entry></row>
  223. <row>
  224. <entry align="left" valign="top">_DT_BUFFER_DATA</entry>
  225. <entry align="left" valign="top">_DT_BUFFER_DATA</entry>
  226. <entry align="left" valign="top">The buffer data in an array of bytes.</entry>
  227. </row>
  228. <row>
  229. <entry align="left" valign="top">_DT_BUFFER_LENGTHS</entry>
  230. <entry align="left" valign="top">INTEGER</entry>
  231. <entry align="left" valign="top">The lengths in bytes of each buffer in the <systemitem class="Constant">_DT_BUFFER_NAMES</systemitem> array.</entry></row>
  232. <row>
  233. <entry align="left" valign="top">_DT_BUFFER_NAMES</entry>
  234. <entry align="left" valign="top">STRING</entry>
  235. <entry align="left" valign="top">The names of each buffer, suitable for use
  236. as a file name.</entry></row></tbody></tgroup><?Pub Caret></informaltable>
  237. </refsect1>
  238. <refsect1>
  239. <title>SEE ALSO</title>
  240. <para>&cdeman.Dt.Dnd.h;, &cdeman.DtDndDragStart;, &cdeman.DtDndDragStart;, &cdeman.DtDndDropRegister;, &cdeman.DtDndDropUnregister;, &cdeman.XmDropTransferStart;, &cdeman.XmDragContext;, &cdeman.XmDragStart;, &cdeman.XmDropSiteRegister;, &cdeman.XmDropSite;, &cdeman.tt.file.netfile;, &cdeman.tt.netfile.file;, <literal>X11/R5 Inter-Client
  241. Communications Conventions Manual (ICCCM)</literal></para>
  242. </refsect1>
  243. </refentry>
  244. <!--fickle 1.12 mancsf-to-docbook 1.2 08/07/95 01:31:55-->
  245. <?Pub *0000042458>