1ea1d6981Smrg<?xml version="1.0" encoding="UTF-8" ?>
2ea1d6981Smrg<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3ea1d6981Smrg                   "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
4ea1d6981Smrg[
5ea1d6981Smrg<!ENTITY % defs SYSTEM "defs.ent"> %defs;
6ea1d6981Smrg]>
7ea1d6981Smrg
8ea1d6981Smrg<!-- lifted from troff+ms+XMan by doclifter -->
9ea1d6981Smrg<book id="xc-misc">
10ea1d6981Smrg
11ea1d6981Smrg<bookinfo>
12ea1d6981Smrg   <title>XC-MISC Extension</title>
13ea1d6981Smrg   <subtitle>X Consortium Standard</subtitle>
14ea1d6981Smrg   <authorgroup>
15ea1d6981Smrg      <author>
16ea1d6981Smrg         <firstname>Bob</firstname><surname>Scheifler</surname>
17ea1d6981Smrg         <affiliation><orgname>X Consortium</orgname></affiliation>
18ea1d6981Smrg      </author>
19ea1d6981Smrg      <author>
20ea1d6981Smrg	<firstname>David</firstname><othername>P.</othername><surname>Wiggins</surname>
21ea1d6981Smrg        <affiliation><orgname>X Consortium</orgname></affiliation>
22ea1d6981Smrg      </author>
23ea1d6981Smrg   </authorgroup>
24ea1d6981Smrg   <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
25ea1d6981Smrg   <releaseinfo>Version 1.1</releaseinfo>
26ea1d6981Smrg   <copyright><year>1994</year><holder>X Consortium</holder></copyright>
27ea1d6981Smrg
28ea1d6981Smrg<legalnotice>
29ea1d6981Smrg
30ea1d6981Smrg<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>
31ea1d6981Smrg
32ea1d6981Smrg<para>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</para>
33ea1d6981Smrg
34ea1d6981Smrg<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>
35ea1d6981Smrg
36ea1d6981Smrg<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>
37ea1d6981Smrg
38ea1d6981Smrg<para>X Window System is a trademark of The Open Group.</para>
39ea1d6981Smrg</legalnotice>
40ea1d6981Smrg
41ea1d6981Smrg</bookinfo>
42ea1d6981Smrg
43ea1d6981Smrg<chapter id='Overview'>
44ea1d6981Smrg<title>Overview</title>
45ea1d6981Smrg
46ea1d6981Smrg<para>When an X client connects to an X server, it receives a fixed range of
47ea1d6981Smrgresource IDs to use to identify the client's resources inside the X
48ea1d6981Smrgserver.  Xlib hands these out sequentially as needed.  When it
49ea1d6981Smrgoverruns the end of the range, an IDChoice protocol error results.
50ea1d6981SmrgLong running clients, or clients that use resource IDs at a rapid
51ea1d6981Smrgrate, may encounter this circumstance.  When it happens, there are
52ea1d6981Smrgusually many resource IDs available, but Xlib doesn't know about them.</para>
53ea1d6981Smrg
54ea1d6981Smrg<para>One approach to solving this problem would be to have Xlib notice when
55ea1d6981Smrga resource is freed and recycle its ID for future use.  This strategy
56ea1d6981Smrgruns into difficulties because sometimes freeing one resource causes
57ea1d6981Smrgothers to be freed (for example, when a window is destroyed, so are
58ea1d6981Smrgits children).  To do a complete job, Xlib would have to maintain a
59ea1d6981Smrglarge amount of state that currently resides only in the server (the
60ea1d6981Smrgentire window tree in the above example).  Even if a less
61ea1d6981Smrgcomprehensive strategy was adopted, such as recycling only those IDs
62ea1d6981Smrgthat Xlib can identify without maintaining additional state, the
63ea1d6981Smrgadditional bookkeeping at resource creation and destruction time
64ea1d6981Smrgwould likely introduce unacceptable overhead.</para>
65ea1d6981Smrg
66ea1d6981Smrg<para>To avoid the problems listed above, the server's complete knowledge of
67ea1d6981Smrgall resource IDs in use by a client is leveraged.  This extension
68ea1d6981Smrgprovides two ways for Xlib to query the server for available resource
69ea1d6981SmrgIDs.  Xlib can use these extension requests behind the scenes when it has
70ea1d6981Smrgexhausted its current pool of resource IDs.</para>
71ea1d6981Smrg</chapter>
72ea1d6981Smrg
73ea1d6981Smrg<chapter id='Requests'>
74ea1d6981Smrg<title>Requests</title>
75ea1d6981Smrg
76ea1d6981Smrg<para>
77ea1d6981Smrg<function>XCMiscGetVersion</function></para>
78ea1d6981Smrg
79ea1d6981Smrg<itemizedlist>
80ea1d6981Smrg    <listitem><para><parameter>client_major_version</parameter>: CARD16</para></listitem>
81ea1d6981Smrg    <listitem><para><parameter>client_minor_version</parameter>: CARD16</para></listitem>
82ea1d6981Smrg</itemizedlist>
83ea1d6981Smrg<para>   =&gt;</para>
84ea1d6981Smrg<itemizedlist>
85ea1d6981Smrg    <listitem><para><parameter>client_major_version</parameter>: CARD16</para></listitem>
86ea1d6981Smrg    <listitem><para><parameter>client_minor_version</parameter>: CARD16</para></listitem>
87ea1d6981Smrg</itemizedlist>
88ea1d6981Smrg
89ea1d6981Smrg<para>If supplied, the <parameter>client_major_version</parameter> and
90ea1d6981Smrg<parameter>client_minor_version</parameter> indicate what version of
91ea1d6981Smrgthe protocol the client wants the server to implement.  The server version
92ea1d6981Smrgnumbers returned indicate the protocol this extension actually supports.  This
93ea1d6981Smrgmight not equal the version sent by the client.  An implementation can
94ea1d6981Smrg(but need not) support more than one version simultaneously.  The
95ea1d6981Smrg<parameter>server_major_version</parameter> and the <parameter>server_minor_version</parameter> are a
96ea1d6981Smrgmechanism to support future revisions of the XC-MISC protocol
97ea1d6981Smrgwhich may be necessary.  In general, the major version would increment
98ea1d6981Smrgfor incompatible changes, and the minor version would increment for
99ea1d6981Smrgsmall, upward-compatible changes.  Servers that support the protocol
100ea1d6981Smrgdefined in this document will return a
101ea1d6981Smrg<parameter>server_major_version</parameter> of one (1), and a
102ea1d6981Smrg<parameter>server_minor_version</parameter> of one (1).</para>
103ea1d6981Smrg
104ea1d6981Smrg<para><function>XCMiscGetXIDRange</function></para>
105ea1d6981Smrg
106ea1d6981Smrg<para>   =&gt;</para>
107ea1d6981Smrg<itemizedlist>
108ea1d6981Smrg    <listitem><para><parameter>start_id</parameter>: XID</para></listitem>
109ea1d6981Smrg    <listitem><para><parameter>count</parameter>: CARD32</para></listitem>
110ea1d6981Smrg</itemizedlist>
111ea1d6981Smrg
112ea1d6981Smrg<para>This request returns a range of available resource IDs for the client
113ea1d6981Smrgissuing the request.  <parameter>start_id</parameter> is the first
114ea1d6981SmrgID in the range.  <parameter>count</parameter> is the number of IDs
115ea1d6981Smrgin the range.  The returned range may or may not be the largest possible
116ea1d6981Smrgrange.</para>
117ea1d6981Smrg
118ea1d6981Smrg<para><function>XCMiscGetXIDList</function></para>
119ea1d6981Smrg
120ea1d6981Smrg<itemizedlist>
121ea1d6981Smrg    <listitem><para><parameter>count</parameter>: CARD32</para></listitem>
122ea1d6981Smrg</itemizedlist>
123ea1d6981Smrg<para>   =&gt;</para>
124ea1d6981Smrg<itemizedlist>
125ea1d6981Smrg    <listitem><para><parameter>ids</parameter>: LISTofXID</para></listitem>
126ea1d6981Smrg</itemizedlist>
127ea1d6981Smrg
128ea1d6981Smrg<para>This request returns the a list of individual resource IDs in
129ea1d6981Smrg<parameter>ids</parameter>.
130ea1d6981Smrg<parameter>count</parameter> is the number of resource IDs requested.
131ea1d6981SmrgThe number returned may be smaller than the number requested.</para>
132ea1d6981Smrg</chapter>
133ea1d6981Smrg
134ea1d6981Smrg<chapter id='Events_and_Errors'>
135ea1d6981Smrg<title>Events and Errors</title>
136ea1d6981Smrg
137ea1d6981Smrg<para>No new events or errors are defined by this extension.</para>
138ea1d6981Smrg</chapter>
139ea1d6981Smrg
140ea1d6981Smrg<chapter id='Encoding'>
141ea1d6981Smrg<title>Encoding</title>
142ea1d6981Smrg
143ea1d6981Smrg<para>Please refer to the X11 Protocol Encoding document as this document uses
144ea1d6981Smrgconventions established there.</para>
145ea1d6981Smrg
146ea1d6981Smrg<para>The name of this extension is &ldquo;XC-MISC&rdquo;.</para>
147ea1d6981Smrg
148ea1d6981Smrg<synopsis>
149ea1d6981Smrg<function>XCMiscGetVersion</function>
150ea1d6981Smrg     1     CARD8          opcode
151ea1d6981Smrg     1     0                      XC-MISC opcode
152ea1d6981Smrg     2     2                      request length
153ea1d6981Smrg     2     CARD16         client_major_version
154ea1d6981Smrg     2     CARD16         client_minor_version
155ea1d6981Smrg
156ea1d6981Smrg =&gt;
157ea1d6981Smrg     1     1          Reply
158ea1d6981Smrg     1                unused
159ea1d6981Smrg     2     CARD16     sequence number
160ea1d6981Smrg     4     0          length
161ea1d6981Smrg     2     CARD16     server_major_version
162ea1d6981Smrg     2     CARD16     server_minor_version
163ea1d6981Smrg     20               unused
164ea1d6981Smrg</synopsis>
165ea1d6981Smrg
166ea1d6981Smrg<synopsis>
167ea1d6981Smrg<function>XCMiscGetXIDRange</function>
168ea1d6981Smrg     1     CARD8        opcode
169ea1d6981Smrg     1     1                   XC-MISC opcode
170ea1d6981Smrg     2     1                   request length
171ea1d6981Smrg
172ea1d6981Smrg =&gt;
173ea1d6981Smrg     1     1          Reply
174ea1d6981Smrg     1                unused
175ea1d6981Smrg     2     CARD16     sequence number
176ea1d6981Smrg     4     0          length
177ea1d6981Smrg     4     XID        start_id
178ea1d6981Smrg     4     CARD32     count
179ea1d6981Smrg     16               unused
180ea1d6981Smrg</synopsis>
181ea1d6981Smrg
182ea1d6981Smrg
183ea1d6981Smrg<synopsis>
184ea1d6981Smrg<function>XCMiscGetXIDList</function>
185ea1d6981Smrg     1     CARD8          opcode
186ea1d6981Smrg     1     2                      XC-MISC opcode
187ea1d6981Smrg     2     2                      request length
188ea1d6981Smrg     4     CARD32         count
189ea1d6981Smrg
190ea1d6981Smrg =&gt;
191ea1d6981Smrg     1     1          Reply
192ea1d6981Smrg     1                unused
193ea1d6981Smrg     2     CARD16     sequence number
194ea1d6981Smrg     4     CARD32     length
195ea1d6981Smrg     4     CARD32     number of XIDs in ids
196ea1d6981Smrg     20               unused
197ea1d6981Smrg     4n    LISTofXID  ids
198ea1d6981Smrg</synopsis>
199ea1d6981Smrg</chapter>
200ea1d6981Smrg</book>
201ea1d6981Smrg
202