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