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="bigreq">
10ea1d6981Smrg
11ea1d6981Smrg<bookinfo>
12ea1d6981Smrg   <title>Big Requests Extension</title>
13ea1d6981Smrg   <subtitle>X Consortium Standard</subtitle>
14ea1d6981Smrg   <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
15ea1d6981Smrg   <releaseinfo>Version 2.0</releaseinfo>
16ea1d6981Smrg   <authorgroup>
17ea1d6981Smrg      <author>
18ea1d6981Smrg         <firstname>Bob</firstname><surname>Scheifler</surname>
19ea1d6981Smrg         <affiliation><orgname>X Consortium</orgname></affiliation>
20ea1d6981Smrg      </author>
21ea1d6981Smrg   </authorgroup>
22ea1d6981Smrg   <copyright><year>1993</year><year>1994</year><holder>X Consortium</holder></copyright>
23ea1d6981Smrg
24ea1d6981Smrg<legalnotice>
25ea1d6981Smrg<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>
26ea1d6981Smrg
27ea1d6981Smrg<para>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</para>
28ea1d6981Smrg
29ea1d6981Smrg<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>
30ea1d6981Smrg
31ea1d6981Smrg<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>
32ea1d6981Smrg
33ea1d6981Smrg<para>X Window System is a trademark of The Open Group.</para>
34ea1d6981Smrg</legalnotice>
35ea1d6981Smrg
36ea1d6981Smrg</bookinfo>
37ea1d6981Smrg
38ea1d6981Smrg<chapter id='Overview'>
39ea1d6981Smrg<title>Overview</title>
40ea1d6981Smrg
41ea1d6981Smrg<para>This extension enables the use of protocol requests that exceed 262140 bytes in length.</para>
42ea1d6981Smrg
43ea1d6981Smrg<para>The core protocol restricts the maximum length of a protocol request to 262140 bytes, in that it uses a 16-bit length field specifying the number of 4-byte units in the request.  This is a problem in the core protocol when joining large numbers of lines (<symbol role='Pn'>PolyLine</symbol>) or arcs (<symbol role='Pn'>PolyArc</symbol>), since these requests cannot be broken up into smaller requests without disturbing the rendering of the join points.  It is also much more of a problem for protocol extensions, such as the PEX extension for 3D graphics and the XIE extension for imaging, that need to send long data lists in output commands.</para>
44ea1d6981Smrg
45ea1d6981Smrg<para>This extension defines a mechanism for extending the length field beyond 16 bits.  If the normal 16-bit length field of the protocol request is zero, then an additional 32-bit field containing the actual length (in 4-byte units) is inserted into the request, immediately following the 16-bit length field.</para>
46ea1d6981Smrg
47ea1d6981Smrg<para>For example, a normal <function>PolyLine</function> encoding is:</para>
48ea1d6981Smrg
49ea1d6981Smrg<informaltable id='PolyLine' frame='none'>
50ea1d6981Smrg  <?dbfo keep-together="always" ?>
51ea1d6981Smrg  <tgroup cols='4' align='left' colsep='0' rowsep='0'>
52ea1d6981Smrg    <colspec colname='c1' colwidth='1.0*'/>
53ea1d6981Smrg    <colspec colname='c2' colwidth='3.0*'/>
54ea1d6981Smrg    <colspec colname='c3' colwidth='2.0*'/>
55ea1d6981Smrg    <colspec colname='c4' colwidth='11.0*'/>
56ea1d6981Smrg    <thead>
57ea1d6981Smrg      <row>
58ea1d6981Smrg        <entry namest="c1" nameend="c4"><function>PolyLine</function></entry>
59ea1d6981Smrg      </row>
60ea1d6981Smrg    </thead>
61ea1d6981Smrg    <tbody>
62ea1d6981Smrg      <row>
63ea1d6981Smrg        <entry>1</entry>
64ea1d6981Smrg        <entry>65</entry>
65ea1d6981Smrg        <entry></entry>
66ea1d6981Smrg        <entry>opcode</entry>
67ea1d6981Smrg      </row>
68ea1d6981Smrg      <row>
69ea1d6981Smrg        <entry>1</entry>
70ea1d6981Smrg        <entry></entry>
71ea1d6981Smrg        <entry></entry>
72ea1d6981Smrg        <entry>coordinate-mode</entry>
73ea1d6981Smrg      </row>
74ea1d6981Smrg      <row>
75ea1d6981Smrg        <entry></entry>
76ea1d6981Smrg        <entry>0</entry>
77ea1d6981Smrg        <entry>Origin</entry>
78ea1d6981Smrg        <entry></entry>
79ea1d6981Smrg      </row>
80ea1d6981Smrg      <row>
81ea1d6981Smrg        <entry></entry>
82ea1d6981Smrg        <entry>1</entry>
83ea1d6981Smrg        <entry>Previous</entry>
84ea1d6981Smrg        <entry></entry>
85ea1d6981Smrg      </row>
86ea1d6981Smrg      <row>
87ea1d6981Smrg        <entry>2</entry>
88ea1d6981Smrg        <entry>3+n</entry>
89ea1d6981Smrg        <entry></entry>
90ea1d6981Smrg        <entry></entry>
91ea1d6981Smrg      </row>
92ea1d6981Smrg      <row>
93ea1d6981Smrg        <entry>4</entry>
94ea1d6981Smrg        <entry>DRAWABLE</entry>
95ea1d6981Smrg        <entry></entry>
96ea1d6981Smrg        <entry>drawable</entry>
97ea1d6981Smrg      </row>
98ea1d6981Smrg      <row>
99ea1d6981Smrg        <entry>4</entry>
100ea1d6981Smrg        <entry>GCONTEXT</entry>
101ea1d6981Smrg        <entry></entry>
102ea1d6981Smrg        <entry>gc</entry>
103ea1d6981Smrg      </row>
104ea1d6981Smrg      <row>
105ea1d6981Smrg        <entry>4n</entry>
106ea1d6981Smrg        <entry>LISTofPOINT</entry>
107ea1d6981Smrg        <entry></entry>
108ea1d6981Smrg        <entry>points</entry>
109ea1d6981Smrg      </row>
110ea1d6981Smrg     </tbody>
111ea1d6981Smrg  </tgroup>
112ea1d6981Smrg</informaltable>
113ea1d6981Smrg
114ea1d6981Smrg<para>An extended-length <function>PolyLine</function> encoding is:</para>
115ea1d6981Smrg
116ea1d6981Smrg<informaltable frame='none'>
117ea1d6981Smrg  <?dbfo keep-together="always" ?>
118ea1d6981Smrg  <tgroup cols='4' align='left' colsep='0' rowsep='0'>
119ea1d6981Smrg    <colspec colname='c1' colwidth='1.0*'/>
120ea1d6981Smrg    <colspec colname='c2' colwidth='3.0*'/>
121ea1d6981Smrg    <colspec colname='c3' colwidth='2.0*'/>
122ea1d6981Smrg    <colspec colname='c4' colwidth='11.0*'/>
123ea1d6981Smrg    <thead>
124ea1d6981Smrg      <row>
125ea1d6981Smrg        <entry namest="c1" nameend="c4"><function>PolyLine</function></entry>
126ea1d6981Smrg      </row>
127ea1d6981Smrg    </thead>
128ea1d6981Smrg    <tbody>
129ea1d6981Smrg      <row>
130ea1d6981Smrg        <entry>1</entry>
131ea1d6981Smrg        <entry>65</entry>
132ea1d6981Smrg        <entry></entry>
133ea1d6981Smrg        <entry>opcode</entry>
134ea1d6981Smrg      </row>
135ea1d6981Smrg      <row>
136ea1d6981Smrg        <entry>1</entry>
137ea1d6981Smrg        <entry></entry>
138ea1d6981Smrg        <entry></entry>
139ea1d6981Smrg        <entry>coordinate-mode</entry>
140ea1d6981Smrg      </row>
141ea1d6981Smrg      <row>
142ea1d6981Smrg        <entry></entry>
143ea1d6981Smrg        <entry>0</entry>
144ea1d6981Smrg        <entry>Origin</entry>
145ea1d6981Smrg        <entry></entry>
146ea1d6981Smrg      </row>
147ea1d6981Smrg      <row>
148ea1d6981Smrg        <entry></entry>
149ea1d6981Smrg        <entry>1</entry>
150ea1d6981Smrg        <entry>Previous</entry>
151ea1d6981Smrg        <entry></entry>
152ea1d6981Smrg      </row>
153ea1d6981Smrg      <row>
154ea1d6981Smrg        <entry>2</entry>
155ea1d6981Smrg        <entry>0</entry>
156ea1d6981Smrg        <entry></entry>
157ea1d6981Smrg        <entry>extended length flag</entry>
158ea1d6981Smrg      </row>
159ea1d6981Smrg      <row>
160ea1d6981Smrg        <entry>4</entry>
161ea1d6981Smrg        <entry>4+n</entry>
162ea1d6981Smrg        <entry></entry>
163ea1d6981Smrg        <entry>request length</entry>
164ea1d6981Smrg      </row>
165ea1d6981Smrg      <row>
166ea1d6981Smrg        <entry>4</entry>
167ea1d6981Smrg        <entry>DRAWABLE</entry>
168ea1d6981Smrg        <entry></entry>
169ea1d6981Smrg        <entry>drawable</entry>
170ea1d6981Smrg      </row>
171ea1d6981Smrg      <row>
172ea1d6981Smrg        <entry>4</entry>
173ea1d6981Smrg        <entry>GCONTEXT</entry>
174ea1d6981Smrg        <entry></entry>
175ea1d6981Smrg        <entry>gc</entry>
176ea1d6981Smrg      </row>
177ea1d6981Smrg      <row>
178ea1d6981Smrg        <entry>4n</entry>
179ea1d6981Smrg        <entry>LISTofPOINT</entry>
180ea1d6981Smrg        <entry></entry>
181ea1d6981Smrg        <entry>points</entry>
182ea1d6981Smrg      </row>
183ea1d6981Smrg     </tbody>
184ea1d6981Smrg  </tgroup>
185ea1d6981Smrg</informaltable>
186ea1d6981Smrg
187ea1d6981Smrg<para>Extended-length protocol encodings, once enabled, can be used on all protocol requests, including all extensions.</para>
188ea1d6981Smrg</chapter>
189ea1d6981Smrg
190ea1d6981Smrg<chapter id='Requests'>
191ea1d6981Smrg<title>Requests</title>
192ea1d6981Smrg
193ea1d6981Smrg<para><function>BigReqEnable</function></para>
194ea1d6981Smrg
195ea1d6981Smrg<para>   =&gt;</para>
196ea1d6981Smrg
197ea1d6981Smrg<para><emphasis remap='I'>maximum-request-length</emphasis>: CARD32</para>
198ea1d6981Smrg
199ea1d6981Smrg<para>This request enables extended-length protocol requests for the requesting client.  It also returns the maximum length of a request, in 4-byte units, that can be used in extended-length protocol requests.  This value will always be greater than the maximum-request-length returned in the connection setup information.</para>
200ea1d6981Smrg</chapter>
201ea1d6981Smrg
202ea1d6981Smrg<chapter id='Events_and_Errors'>
203ea1d6981Smrg<title>Events and Errors</title>
204ea1d6981Smrg
205ea1d6981Smrg<para>No new events or errors are defined by this extension.</para>
206ea1d6981Smrg</chapter>
207ea1d6981Smrg
208ea1d6981Smrg<chapter id='Encoding'>
209ea1d6981Smrg<title>Encoding</title>
210ea1d6981Smrg
211ea1d6981Smrg<para>Please refer to the X11 Protocol Encoding document as this document uses conventions established there.</para>
212ea1d6981Smrg
213ea1d6981Smrg<para>The name of this extension is &ldquo;BIG-REQUESTS&rdquo;.</para>
214ea1d6981Smrg
215ea1d6981Smrg<informaltable frame='none'>
216ea1d6981Smrg  <?dbfo keep-together="always" ?>
217ea1d6981Smrg  <tgroup cols='3' align='left' colsep='0' rowsep='0'>
218ea1d6981Smrg    <colspec colname='c1' colwidth='1.0*'/>
219ea1d6981Smrg    <colspec colname='c2' colwidth='2.0*'/>
220ea1d6981Smrg    <colspec colname='c3' colwidth='15.0*'/>
221ea1d6981Smrg    <thead>
222ea1d6981Smrg      <row>
223ea1d6981Smrg        <entry namest="c1" nameend="c3">BigReqEnable</entry>
224ea1d6981Smrg      </row>
225ea1d6981Smrg    </thead>
226ea1d6981Smrg    <tbody>
227ea1d6981Smrg      <row>
228ea1d6981Smrg        <entry>1</entry>
229ea1d6981Smrg        <entry>Card8</entry>
230ea1d6981Smrg        <entry>opcode</entry>
231ea1d6981Smrg      </row>
232ea1d6981Smrg      <row>
233ea1d6981Smrg        <entry>1</entry>
234ea1d6981Smrg        <entry>0</entry>
235ea1d6981Smrg        <entry>bigreq opcode</entry>
236ea1d6981Smrg      </row>
237ea1d6981Smrg      <row>
238ea1d6981Smrg        <entry>2</entry>
239ea1d6981Smrg        <entry>1</entry>
240ea1d6981Smrg        <entry>request length</entry>
241ea1d6981Smrg      </row>
242ea1d6981Smrg     </tbody>
243ea1d6981Smrg  </tgroup>
244ea1d6981Smrg  <tgroup cols='3' align='left' colsep='0' rowsep='0'>
245ea1d6981Smrg    <colspec colname='c1' colwidth='1.0*'/>
246ea1d6981Smrg    <colspec colname='c2' colwidth='2.0*'/>
247ea1d6981Smrg    <colspec colname='c3' colwidth='15.0*'/>
248ea1d6981Smrg    <thead>
249ea1d6981Smrg      <row>
250ea1d6981Smrg        <entry namest="c1" nameend="c3">=&gt;</entry>
251ea1d6981Smrg      </row>
252ea1d6981Smrg    </thead>
253ea1d6981Smrg    <tbody>
254ea1d6981Smrg      <row>
255ea1d6981Smrg        <entry>1</entry>
256ea1d6981Smrg        <entry>1</entry>
257ea1d6981Smrg        <entry>Reply</entry>
258ea1d6981Smrg      </row>
259ea1d6981Smrg      <row>
260ea1d6981Smrg        <entry>1</entry>
261ea1d6981Smrg        <entry></entry>
262ea1d6981Smrg        <entry>unused</entry>
263ea1d6981Smrg      </row>
264ea1d6981Smrg      <row>
265ea1d6981Smrg        <entry>2</entry>
266ea1d6981Smrg        <entry>CARD16</entry>
267ea1d6981Smrg        <entry>sequence number</entry>
268ea1d6981Smrg      </row>
269ea1d6981Smrg      <row>
270ea1d6981Smrg        <entry>4</entry>
271ea1d6981Smrg        <entry>0</entry>
272ea1d6981Smrg        <entry>length</entry>
273ea1d6981Smrg      </row>
274ea1d6981Smrg      <row>
275ea1d6981Smrg        <entry>4</entry>
276ea1d6981Smrg        <entry>CARD32</entry>
277ea1d6981Smrg        <entry>maximum-request-length</entry>
278ea1d6981Smrg      </row>
279ea1d6981Smrg      <row>
280ea1d6981Smrg        <entry>20</entry>
281ea1d6981Smrg        <entry></entry>
282ea1d6981Smrg        <entry>unused</entry>
283ea1d6981Smrg      </row>
284ea1d6981Smrg     </tbody>
285ea1d6981Smrg  </tgroup>
286ea1d6981Smrg</informaltable>
287ea1d6981Smrg
288ea1d6981Smrg</chapter>
289ea1d6981Smrg
290ea1d6981Smrg<chapter id='C_Language_Binding'>
291ea1d6981Smrg<title>C language binding</title>
292ea1d6981Smrg
293ea1d6981Smrg<para>It is desirable for core Xlib, and other extensions, to use this extension internally when necessary.  It is also desirable to make the use of this extension as transparent as possible to the X client.  For example, if enabling of the extension were delayed until the first time it was needed, an application that used
294ea1d6981Smrg<olink targetdoc='libX11' targetptr='XNextRequest'><function>XNextRequest</function></olink>
295ea1d6981Smrgto determine the sequence number of a request would no longer get the correct sequence number.  As such,
296ea1d6981Smrg<olink targetdoc='libX11' targetptr='XOpenDisplay'><function>XOpenDisplay</function></olink>
297ea1d6981Smrgwill determine if the extension is supported by the server and, if it is, enable extended-length encodings.</para>
298ea1d6981Smrg
299ea1d6981Smrg<para>The core Xlib functions
300ea1d6981Smrg<olink targetdoc='libX11' targetptr='XDrawLines'><function>XDrawLines</function></olink>,
301ea1d6981Smrg<olink targetdoc='libX11' targetptr='XDrawArcs'><function>XDrawArcs</function></olink>,
302ea1d6981Smrg<olink targetdoc='libX11' targetptr='XFillPolygon'><function>XFillPolygon</function></olink>,
303ea1d6981Smrg<olink targetdoc='libX11' targetptr='XChangeProperty'><function>XChangeProperty</function></olink>,
304ea1d6981Smrg<olink targetdoc='libX11' targetptr='XSetClipRectangles'><function>XSetClipRectangles</function></olink>, and
305ea1d6981Smrg<olink targetdoc='libX11' targetptr='XSetRegion'><function>XSetRegion</function></olink>.
306ea1d6981Smrgare required to use extended-length encodings when necessary, if supported by the server.  Use of extended-length encodings in other core Xlib functions
307ea1d6981Smrg(<olink targetdoc='libX11' targetptr='XDrawPoints'><function>XDrawPoints</function></olink>,
308ea1d6981Smrg<olink targetdoc='libX11' targetptr='XDrawRectangles'><function>XDrawRectangles</function></olink>,
309ea1d6981Smrg<olink targetdoc='libX11' targetptr='XDrawSegments'><function>XDrawSegments</function></olink>.
310ea1d6981Smrg<olink targetdoc='libX11' targetptr='XFillArcs'><function>XFillArcs</function></olink>,
311ea1d6981Smrg<olink targetdoc='libX11' targetptr='XFillRectangles'><function>XFillRectangles</function></olink>,
312ea1d6981Smrg<olink targetdoc='libX11' targetptr='XPutImage'><function>XPutImage</function></olink>
313ea1d6981Smrgis permitted but not required; an Xlib implementation may choose to split the data across multiple smaller requests instead.</para>
314ea1d6981Smrg
315ea1d6981Smrg<para>To permit clients to know what the maximum-request-length for extended-length encodings is, the following function is added to Xlib:
316ea1d6981Smrg
317ea1d6981Smrg<funcsynopsis id='XExtendedMaxRequestSize'>
318ea1d6981Smrg<funcprototype>
319ea1d6981Smrg  <funcdef>long <function>XExtendedMaxRequestSize</function></funcdef>
320ea1d6981Smrg    <paramdef>Display <parameter> *display</parameter></paramdef>
321ea1d6981Smrg</funcprototype>
322ea1d6981Smrg</funcsynopsis>
323ea1d6981Smrg
324ea1d6981SmrgReturns zero (0) if the specified display does not support this extension, otherwise returns the maximum-request-length (in 4-byte units) supported by the server through the extended-length encoding.</para>
325ea1d6981Smrg</chapter>
326ea1d6981Smrg
327ea1d6981Smrg<chapter id='Acknowledgements'>
328ea1d6981Smrg<title>Acknowledgements</title>
329ea1d6981Smrg
330ea1d6981Smrg<para>Clive Feather (IXI) originated the extended-length encoding used in this extension proposal.</para>
331ea1d6981Smrg</chapter>
332ea1d6981Smrg</book>
333