summaryrefslogtreecommitdiff
path: root/specs/bigreq.xml
blob: 0b208a44f6ca93cd2bb2a0e32f95b21283e2baec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
                   "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
[
<!ENTITY % defs SYSTEM "defs.ent"> %defs;
]>

<!-- lifted from troff+ms+XMan by doclifter -->
<book id="bigreq">

<bookinfo>
   <title>Big Requests Extension</title>
   <subtitle>X Consortium Standard</subtitle>
   <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
   <releaseinfo>Version 2.0</releaseinfo>
   <authorgroup>
      <author>
         <firstname>Bob</firstname><surname>Scheifler</surname>
         <affiliation><orgname>X Consortium</orgname></affiliation>
      </author>
   </authorgroup>
   <copyright><year>1993</year><year>1994</year><holder>X Consortium</holder></copyright>

<legalnotice>
<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>

<para>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</para>

<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>

<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>

<para>X Window System is a trademark of The Open Group.</para>
</legalnotice>

</bookinfo>

<chapter id='overview'>
<title>Overview</title>

<para>This extension enables the use of protocol requests that exceed 262140 bytes in length.</para>

<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>

<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>

<para>For example, a normal <function>PolyLine</function> encoding is:</para>

<informaltable pgwide='0' frame='none'>
  <tgroup cols='4' align='left'>
    <colspec colwidth='0.5in' colname='c1'/>
    <colspec colwidth='1.5in' colname='c2'/>
    <colspec colwidth='1.5in' colname='c3'/>
    <colspec colwidth='2.0in' colname='c4'/>
    <thead>
      <row>
        <entry namest="c1" nameend="c4"><function>PolyLine</function></entry>
      </row>
    </thead>
    <tbody>
      <row>
        <entry>1</entry>
        <entry>65</entry>
        <entry></entry>
        <entry>opcode</entry>
      </row>
      <row>
        <entry>1</entry>
        <entry></entry>
        <entry></entry>
        <entry>coordinate-mode</entry>
      </row>
      <row>
        <entry></entry>
        <entry>0</entry>
        <entry>Origin</entry>
        <entry></entry>
      </row>
      <row>
        <entry></entry>
        <entry>1</entry>
        <entry>Previous</entry>
        <entry></entry>
      </row>
      <row>
        <entry>2</entry>
        <entry>3+n</entry>
        <entry></entry>
        <entry></entry>
      </row>
      <row>
        <entry>4</entry>
        <entry>DRAWABLE</entry>
        <entry></entry>
        <entry>drawable</entry>
      </row>
      <row>
        <entry>4</entry>
        <entry>GCONTEXT</entry>
        <entry></entry>
        <entry>gc</entry>
      </row>
      <row>
        <entry>4n</entry>
        <entry>LISTofPOINT</entry>
        <entry></entry>
        <entry>points</entry>
      </row>
     </tbody>
  </tgroup>
</informaltable>

<para>An extended-length <function>PolyLine</function> encoding is:</para>

<informaltable pgwide='0' frame='none'>
  <tgroup cols='4' align='left'>
    <colspec colwidth='0.5in' colname='c1'/>
    <colspec colwidth='1.5in' colname='c2'/>
    <colspec colwidth='1.5in' colname='c3'/>
    <colspec colwidth='2.0in' colname='c4'/>
    <thead>
      <row>
        <entry namest="c1" nameend="c4"><function>PolyLine</function></entry>
      </row>
    </thead>
    <tbody>
      <row>
        <entry>1</entry>
        <entry>65</entry>
        <entry></entry>
        <entry>opcode</entry>
      </row>
      <row>
        <entry>1</entry>
        <entry></entry>
        <entry></entry>
        <entry>coordinate-mode</entry>
      </row>
      <row>
        <entry></entry>
        <entry>0</entry>
        <entry>Origin</entry>
        <entry></entry>
      </row>
      <row>
        <entry></entry>
        <entry>1</entry>
        <entry>Previous</entry>
        <entry></entry>
      </row>
      <row>
        <entry>2</entry>
        <entry>0</entry>
        <entry></entry>
        <entry>extended length flag</entry>
      </row>
      <row>
        <entry>4</entry>
        <entry>4+n</entry>
        <entry></entry>
        <entry>request length</entry>
      </row>
      <row>
        <entry>4</entry>
        <entry>DRAWABLE</entry>
        <entry></entry>
        <entry>drawable</entry>
      </row>
      <row>
        <entry>4</entry>
        <entry>GCONTEXT</entry>
        <entry></entry>
        <entry>gc</entry>
      </row>
      <row>
        <entry>4n</entry>
        <entry>LISTofPOINT</entry>
        <entry></entry>
        <entry>points</entry>
      </row>
     </tbody>
  </tgroup>
</informaltable>

<para>Extended-length protocol encodings, once enabled, can be used on all protocol requests, including all extensions.</para>
</chapter>

<chapter id='requests'>
<title>Requests</title>

<para><function>BigReqEnable</function></para>

<para>   =&gt;</para>

<para><emphasis remap='I'>maximum-request-length</emphasis>: CARD32</para>

<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>
</chapter>

<chapter id='events_and_errors'>
<title>Events and Errors</title>

<para>No new events or errors are defined by this extension.</para>
</chapter>

<chapter id='encoding'>
<title>Encoding</title>

<para>Please refer to the X11 Protocol Encoding document as this document uses conventions established there.</para>

<para>The name of this extension is &ldquo;BIG-REQUESTS&rdquo;.</para>

<informaltable pgwide='0' frame='none'>
  <tgroup cols='3' align='left'>
    <colspec colwidth='0.5in' colname='c1'/>
    <colspec colwidth='0.5in' colname='c2'/>
    <colspec colwidth='2.0in' colname='c3'/>
    <thead>
      <row>
        <entry namest="c1" nameend="c3">BigReqEnable</entry>
      </row>
    </thead>
    <tbody>
      <row>
        <entry>1</entry>
        <entry>Card8</entry>
        <entry>opcode</entry>
      </row>
      <row>
        <entry>1</entry>
        <entry>0</entry>
        <entry>bigreq opcode</entry>
      </row>
      <row>
        <entry>2</entry>
        <entry>1</entry>
        <entry>request length</entry>
      </row>
     </tbody>
  </tgroup>
  <tgroup cols='3' align='left'>
    <colspec colwidth='0.5in' colname='c1'/>
    <colspec colwidth='1.5in' colname='c2'/>
    <colspec colwidth='2.0in' colname='c3'/>
    <thead>
      <row>
        <entry namest="c1" nameend="c3">=&gt;</entry>
      </row>
    </thead>
    <tbody>
      <row>
        <entry>1</entry>
        <entry>1</entry>
        <entry>Reply</entry>
      </row>
      <row>
        <entry>1</entry>
        <entry></entry>
        <entry>unused</entry>
      </row>
      <row>
        <entry>2</entry>
        <entry>CARD16</entry>
        <entry>sequence number</entry>
      </row>
      <row>
        <entry>4</entry>
        <entry>0</entry>
        <entry>length</entry>
      </row>
      <row>
        <entry>4</entry>
        <entry>CARD32</entry>
        <entry>maximum-request-length</entry>
      </row>
      <row>
        <entry>2</entry>
        <entry>0</entry>
        <entry>unused</entry>
      </row>
     </tbody>
  </tgroup>
</informaltable>

</chapter>

<chapter id='c_language_binding'>
<title>C language binding</title>

<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
<olink targetdoc='libX11' targetptr='xnextrequest'><function>XNextRequest</function></olink>
to determine the sequence number of a request would no longer get the correct sequence number.  As such,
<olink targetdoc='libX11' targetptr='xopendisplay'><function>XOpenDisplay</function></olink>
will determine if the extension is supported by the server and, if it is, enable extended-length encodings.</para>

<para>The core Xlib functions
<olink targetdoc='libX11' targetptr='xdrawlines'><function>XDrawLines</function></olink>,
<olink targetdoc='libX11' targetptr='xdrawarcs'><function>XDrawArcs</function></olink>,
<olink targetdoc='libX11' targetptr='xfillpolygon'><function>XFillPolygon</function></olink>,
<olink targetdoc='libX11' targetptr='xchangeproperty'><function>XChangeProperty</function></olink>,
<olink targetdoc='libX11' targetptr='xsetcliprectangles'><function>XSetClipRectangles</function></olink>, and
<olink targetdoc='libX11' targetptr='xsetregion'><function>XSetRegion</function></olink>.
are required to use extended-length encodings when necessary, if supported by the server.  Use of extended-length encodings in other core Xlib functions
(<olink targetdoc='libX11' targetptr='xdrawpoints'><function>XDrawPoints</function></olink>,
<olink targetdoc='libX11' targetptr='xdrawrectangles'><function>XDrawRectangles</function></olink>,
<olink targetdoc='libX11' targetptr='xdrawsegments'><function>XDrawSegments</function></olink>.
<olink targetdoc='libX11' targetptr='xfillarcs'><function>XFillArcs</function></olink>,
<olink targetdoc='libX11' targetptr='xfillrectangles'><function>XFillRectangles</function></olink>,
<olink targetdoc='libX11' targetptr='xputimage'><function>XPutImage</function></olink>
is permitted but not required; an Xlib implementation may choose to split the data across multiple smaller requests instead.</para>

<para>To permit clients to know what the maximum-request-length for extended-length encodings is, the following function is added to Xlib:

<funcsynopsis id='xextendedmaxrequestsize'>
<funcprototype>
  <funcdef>long <function>XExtendedMaxRequestSize</function></funcdef>
    <paramdef>Display <parameter> *display</parameter></paramdef>
</funcprototype>
</funcsynopsis>

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>
</chapter>

<chapter id='acknowledgements'>
<title>Acknowledgements</title>

<para>Clive Feather (IXI) originated the extended-length encoding used in this extension proposal.</para>
</chapter>
</book>