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