xc-misc.xml 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
  4. [
  5. <!ENTITY % defs SYSTEM "defs.ent"> %defs;
  6. ]>
  7. <!-- lifted from troff+ms+XMan by doclifter -->
  8. <book id="xc-misc">
  9. <bookinfo>
  10. <title>XC-MISC Extension</title>
  11. <subtitle>X Consortium Standard</subtitle>
  12. <authorgroup>
  13. <author>
  14. <firstname>Bob</firstname><surname>Scheifler</surname>
  15. <affiliation><orgname>X Consortium</orgname></affiliation>
  16. </author>
  17. <author>
  18. <firstname>David</firstname><othername>P.</othername><surname>Wiggins</surname>
  19. <affiliation><orgname>X Consortium</orgname></affiliation>
  20. </author>
  21. </authorgroup>
  22. <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
  23. <releaseinfo>Version 1.1</releaseinfo>
  24. <copyright><year>1994</year><holder>X Consortium</holder></copyright>
  25. <legalnotice>
  26. <para>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the &ldquo;Software&rdquo;), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</para>
  27. <para>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</para>
  28. <para>THE SOFTWARE IS PROVIDED &ldquo;AS IS&rdquo;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</para>
  29. <para>Except as contained in this notice, the name of the X Consortium shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the X Consortium.</para>
  30. <para>X Window System is a trademark of The Open Group.</para>
  31. </legalnotice>
  32. </bookinfo>
  33. <chapter id='Overview'>
  34. <title>Overview</title>
  35. <para>When an X client connects to an X server, it receives a fixed range of
  36. resource IDs to use to identify the client's resources inside the X
  37. server. Xlib hands these out sequentially as needed. When it
  38. overruns the end of the range, an IDChoice protocol error results.
  39. Long running clients, or clients that use resource IDs at a rapid
  40. rate, may encounter this circumstance. When it happens, there are
  41. usually many resource IDs available, but Xlib doesn't know about them.</para>
  42. <para>One approach to solving this problem would be to have Xlib notice when
  43. a resource is freed and recycle its ID for future use. This strategy
  44. runs into difficulties because sometimes freeing one resource causes
  45. others to be freed (for example, when a window is destroyed, so are
  46. its children). To do a complete job, Xlib would have to maintain a
  47. large amount of state that currently resides only in the server (the
  48. entire window tree in the above example). Even if a less
  49. comprehensive strategy was adopted, such as recycling only those IDs
  50. that Xlib can identify without maintaining additional state, the
  51. additional bookkeeping at resource creation and destruction time
  52. would likely introduce unacceptable overhead.</para>
  53. <para>To avoid the problems listed above, the server's complete knowledge of
  54. all resource IDs in use by a client is leveraged. This extension
  55. provides two ways for Xlib to query the server for available resource
  56. IDs. Xlib can use these extension requests behind the scenes when it has
  57. exhausted its current pool of resource IDs.</para>
  58. </chapter>
  59. <chapter id='Requests'>
  60. <title>Requests</title>
  61. <para>
  62. <function>XCMiscGetVersion</function></para>
  63. <itemizedlist>
  64. <listitem><para><parameter>client_major_version</parameter>: CARD16</para></listitem>
  65. <listitem><para><parameter>client_minor_version</parameter>: CARD16</para></listitem>
  66. </itemizedlist>
  67. <para> =&gt;</para>
  68. <itemizedlist>
  69. <listitem><para><parameter>client_major_version</parameter>: CARD16</para></listitem>
  70. <listitem><para><parameter>client_minor_version</parameter>: CARD16</para></listitem>
  71. </itemizedlist>
  72. <para>If supplied, the <parameter>client_major_version</parameter> and
  73. <parameter>client_minor_version</parameter> indicate what version of
  74. the protocol the client wants the server to implement. The server version
  75. numbers returned indicate the protocol this extension actually supports. This
  76. might not equal the version sent by the client. An implementation can
  77. (but need not) support more than one version simultaneously. The
  78. <parameter>server_major_version</parameter> and the <parameter>server_minor_version</parameter> are a
  79. mechanism to support future revisions of the XC-MISC protocol
  80. which may be necessary. In general, the major version would increment
  81. for incompatible changes, and the minor version would increment for
  82. small, upward-compatible changes. Servers that support the protocol
  83. defined in this document will return a
  84. <parameter>server_major_version</parameter> of one (1), and a
  85. <parameter>server_minor_version</parameter> of one (1).</para>
  86. <para><function>XCMiscGetXIDRange</function></para>
  87. <para> =&gt;</para>
  88. <itemizedlist>
  89. <listitem><para><parameter>start_id</parameter>: XID</para></listitem>
  90. <listitem><para><parameter>count</parameter>: CARD32</para></listitem>
  91. </itemizedlist>
  92. <para>This request returns a range of available resource IDs for the client
  93. issuing the request. <parameter>start_id</parameter> is the first
  94. ID in the range. <parameter>count</parameter> is the number of IDs
  95. in the range. The returned range may or may not be the largest possible
  96. range.</para>
  97. <para><function>XCMiscGetXIDList</function></para>
  98. <itemizedlist>
  99. <listitem><para><parameter>count</parameter>: CARD32</para></listitem>
  100. </itemizedlist>
  101. <para> =&gt;</para>
  102. <itemizedlist>
  103. <listitem><para><parameter>ids</parameter>: LISTofXID</para></listitem>
  104. </itemizedlist>
  105. <para>This request returns the a list of individual resource IDs in
  106. <parameter>ids</parameter>.
  107. <parameter>count</parameter> is the number of resource IDs requested.
  108. The number returned may be smaller than the number requested.</para>
  109. </chapter>
  110. <chapter id='Events_and_Errors'>
  111. <title>Events and Errors</title>
  112. <para>No new events or errors are defined by this extension.</para>
  113. </chapter>
  114. <chapter id='Encoding'>
  115. <title>Encoding</title>
  116. <para>Please refer to the X11 Protocol Encoding document as this document uses
  117. conventions established there.</para>
  118. <para>The name of this extension is &ldquo;XC-MISC&rdquo;.</para>
  119. <synopsis>
  120. <function>XCMiscGetVersion</function>
  121. 1 CARD8 opcode
  122. 1 0 XC-MISC opcode
  123. 2 2 request length
  124. 2 CARD16 client_major_version
  125. 2 CARD16 client_minor_version
  126. =&gt;
  127. 1 1 Reply
  128. 1 unused
  129. 2 CARD16 sequence number
  130. 4 0 length
  131. 2 CARD16 server_major_version
  132. 2 CARD16 server_minor_version
  133. 20 unused
  134. </synopsis>
  135. <synopsis>
  136. <function>XCMiscGetXIDRange</function>
  137. 1 CARD8 opcode
  138. 1 1 XC-MISC opcode
  139. 2 1 request length
  140. =&gt;
  141. 1 1 Reply
  142. 1 unused
  143. 2 CARD16 sequence number
  144. 4 0 length
  145. 4 XID start_id
  146. 4 CARD32 count
  147. 16 unused
  148. </synopsis>
  149. <synopsis>
  150. <function>XCMiscGetXIDList</function>
  151. 1 CARD8 opcode
  152. 1 2 XC-MISC opcode
  153. 2 2 request length
  154. 4 CARD32 count
  155. =&gt;
  156. 1 1 Reply
  157. 1 unused
  158. 2 CARD16 sequence number
  159. 4 CARD32 length
  160. 4 CARD32 number of XIDs in ids
  161. 20 unused
  162. 4n LISTofXID ids
  163. </synopsis>
  164. </chapter>
  165. </book>