Git init
[framework/uifw/xorg/proto/x11proto-xext.git] / specs / multibuf.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
6 <!-- lifted from troff+ms+XMan by doclifter -->
7 <book id="buffer">
8
9 <bookinfo>
10    <title>Extending X for Double-Buffering, Multi-Buffering, and Stereo</title>
11    <releaseinfo>X Version 11, Release 6.4</releaseinfo>
12
13    <authorgroup>
14       <othercredit>
15          <firstname>Jeffrey</firstname><surname>Friedberg</surname>
16       </othercredit>
17       <othercredit>
18          <firstname>Larry</firstname><surname>Seiler</surname>
19       </othercredit>
20       <othercredit>
21          <firstname>Jeff</firstname><surname>Vroom</surname>
22       </othercredit>
23    </authorgroup>
24    <copyright><year>1989</year><holder>Digital Equipment Corporation</holder></copyright>
25    <copyright><year>1989</year><holder>X Consortium</holder></copyright>
26    <copyright><year>1994</year><holder>X Consortium</holder></copyright>
27    <releaseinfo>Version 3.3</releaseinfo>
28    <affiliation><orgname>X Consortium</orgname></affiliation>
29
30 <legalnotice>
31 <para>
32 Permission to use, copy, modify, and distribute this documentation for any
33 purpose and without fee is hereby granted, provided that the above copyright
34 notice and this permission notice appear in all copies.
35 Digital Equipment Corporation makes no representations
36 about the suitability for any purpose of the information in
37 this document.  This documentation is provided "as is"
38 without express or implied warranty.  This document
39 is subject to change.
40 </para>
41 <para>
42 Permission is hereby granted, free of charge, to any person obtaining a copy
43 of this software and associated documentation files (the ``Software''), to deal
44 in the Software without restriction, including without limitation the rights
45 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
46 copies of the Software, and to permit persons to whom the Software is
47 furnished to do so, subject to the following conditions:
48 </para>
49 <para>
50 The above copyright notice and this permission notice shall be included in
51 all copies or substantial portions of the Software.
52 </para>
53 <para>
54 THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
55 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
56 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
57 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
58 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
59 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
60 </para>
61 <para>
62 Except as contained in this notice, the name of the X Consortium shall not be
63 used in advertising or otherwise to promote the sale, use or other dealings
64 in this Software without prior written authorization from the X Consortium.
65 </para>
66 <para>
67 <emphasis remap='I'>X Window System</emphasis> is a trademark of X Consortium, Inc.
68 </para>
69
70 </legalnotice>
71 </bookinfo>
72
73 <chapter>
74 <title>TITLE</title>
75 <warning><para>
76 The <emphasis remap='I'>Multi-Buffering</emphasis> extension described here
77 was a draft standard of the X Consortium prior to Release 6.1.  It has been
78 superseded by the Double Buffer
79 Extension (DBE).  DBE is an X Consortium Standard as of Release 6.1.
80 </para></warning>
81
82 <sect1 id="introduction">
83 <title>Introduction</title>
84
85 <para>
86 Several proposals have been written that address some of the
87 issues surrounding the support of double-buffered, multi-buffered,
88 and stereo windows in the X Window System:
89 </para>
90
91 <itemizedlist>
92   <listitem>
93     <para>
94 <emphasis remap='I'>Extending X for Double-Buffering,</emphasis>
95 Jeffrey Friedberg, Larry Seiler, Randi Rost.
96     </para>
97   </listitem>
98   <listitem>
99     <para>
100 <emphasis remap='I'>(Proposal for) Double-Buffering Extensions</emphasis>,
101 Jeff Vroom.
102     </para>
103   </listitem>
104   <listitem>
105     <para>
106 <emphasis remap='I'>An Extension to X.11 for Displays with Multiple Buffers,</emphasis>
107 David S.H. Rosenthal.
108     </para>
109   </listitem>
110   <listitem>
111     <para>
112 <emphasis remap='I'>A Multiple Buffering/Stereo Proposal</emphasis>,
113 Mark Patrick.
114     </para>
115   </listitem>
116 </itemizedlist>
117
118 <para>
119 The authors of this proposal have tried to unify the above documents
120 to yield a proposal that incorporates support for double-buffering,
121 multi-buffering, and stereo in a way that is acceptable to all concerned.
122 </para>
123 </sect1>
124
125 <sect1 id="goals">
126 <title>Goals</title>
127
128 <para>
129 Clients should be able to:
130 </para>
131
132 <itemizedlist>
133   <listitem>
134     <para>
135 Associate multiple buffers with a window.
136     </para>
137   </listitem>
138   <listitem>
139     <para>
140 Paint in any buffer associated with a window.
141     </para>
142   </listitem>
143   <listitem>
144     <para>
145 Display any buffer associated with a window.
146     </para>
147   </listitem>
148   <listitem>
149     <para>
150 Display a series of buffers in a window in rapid succession
151 to achieve a <emphasis remap='I'>smooth</emphasis> animation.
152     </para>
153   </listitem>
154   <listitem>
155     <para>
156 Request simultaneous display of different buffers in different windows.
157     </para>
158   </listitem>
159 </itemizedlist>
160
161 <para>
162 In addition, the extension should:
163 </para>
164
165 <itemizedlist>
166   <listitem>
167     <para>
168 Allow existing X applications to run unchanged.
169     </para>
170   </listitem>
171   <listitem>
172     <para>
173 Support a range of implementation methods that can capitalize on
174 existing hardware features.
175     </para>
176   </listitem>
177 </itemizedlist>
178
179 </sect1>
180
181 <sect1 id="image_buffers">
182 <title>Image Buffers</title>
183
184 <para>
185 Normal windows are created using the standard
186 <function>CreateWindow</function> request:
187 </para>
188
189 <literallayout class="monospaced">
190 CreateWindow
191      parent          : WINDOW
192      w_id            : WINDOW
193      depth           : CARD8
194      visual          : VISUALID or CopyFromParent
195      x, y            : INT16
196      width, height   : INT16
197      border_width    : INT16
198      value_mask      : BITMASK
199      value_list      : LISTofVALUE
200 </literallayout>
201
202 <para>
203 This request allocates a set of window attributes and
204 a buffer into which an image can be drawn.
205 The contents of this <emphasis remap='I'>image buffer</emphasis> will
206 be displayed when the window is mapped to the screen.
207 </para>
208
209 <para>
210 To support double-buffering and multi-buffering,
211 we introduce the notion that additional image buffers can
212 be created and bound together to form groups.
213 The following rules will apply:
214 </para>
215
216 <itemizedlist>
217   <listitem>
218     <para>
219 All image buffers in a group will have the same
220 visual type, depth, and geometry (ie: width and height).
221     </para>
222   </listitem>
223   <listitem>
224     <para>
225 Only one image buffer per group can be displayed
226 at a time.
227     </para>
228   </listitem>
229   <listitem>
230     <para>
231 Draw operations can occur to any image buffer at
232 any time.
233     </para>
234   </listitem>
235   <listitem>
236     <para>
237 Window management requests (<function>MapWindow</function>, <function>DestroyWindow</function>,
238 <function>ConfigureWindow</function>, etc...)
239 affect all image buffers associated with a window.
240     </para>
241   </listitem>
242   <listitem>
243     <para>
244 Appropriate resize and exposure events will be generated
245 for every image buffer that is affected by a window
246 management operation.
247     </para>
248   </listitem>
249 </itemizedlist>
250
251 <para>
252 By allowing draw operations to occur on any image buffer at any time,
253 a client could, on a multi-threaded multi-processor server,
254 simultaneously build up images for display.
255 To support this, each buffer must have its own resource ID.
256 Since buffers are different than windows and pixmaps
257 (buffers are not hierarchical and pixmaps cannot be displayed)
258 a new resource, <function>Buffer</function>, is introduced.
259 Furthermore, a <function>Buffer</function> is also a <function>Drawable</function>, thus
260 draw operations may also be performed on buffers simply
261 by passing a buffer ID to the existing pixmap/window
262 interface.
263 </para>
264
265 <para>
266 To allow existing X applications to work unchanged, we assume
267 a window ID passed in a draw request, for a multi-buffered
268 window, will be an <emphasis remap='I'>alias</emphasis> for the ID of the currently
269 displayed image buffer.  Any draw requests (eq: <function>GetImage</function>) on
270 the window will be relative to the displayed image buffer.
271 </para>
272
273 <para>
274 In window management requests, only a window ID will be
275 accepted.  Requests like <function>QueryTree</function>, will continue to
276 return only window ID's.  Most events will return
277 just the window ID.  Some new events, described in a subsequent
278 section, will return a buffer ID.
279 </para>
280
281 <para>
282 When a window has backing store the contents of the window
283 are saved off-screen.  Likewise, when the contents of an image
284 buffer of a multi-buffer window is saved off-screen, it is
285 said to have backing store.  This applies to all image buffers,
286 whether or not they are selected for display.
287 </para>
288
289 <para>
290 In some multi-buffer implementations, undisplayed buffers might be
291 implemented using pixmaps.  Since the contents of pixmaps exist
292 off-screen and are not affected by occlusion, these image buffers
293 in effect have backing store.
294 </para>
295
296 <para>
297 On the other hand, both the displayed and undisplayed image buffers
298 might be implemented using a subset of the on-screen pixels.
299 In this case, unless the contents of an image buffer are saved
300 off-screen, these image buffers in effect do not have backing store.
301 </para>
302
303 <para>
304 Output to any image buffer of an unmapped multi-buffered window
305 that does not have backing store is discarded.  Output to any
306 image buffer of a mapped multi-buffer window will be performed;
307 however, portions of an image buffer may be occluded or clipped.
308 </para>
309
310 <para>
311 When an unmapped multi-buffered window becomes mapped, the contents
312 of any image buffer buffer that did not have backing store is
313 tiled with the background and zero or more exposure events are
314 generated.  If no background is defined for the window, then
315 the screen contents are not altered and the contents of any
316 undisplayed image buffers are undefined.  If backing store was
317 maintained for an image buffer, then no exposure events are generated.
318 </para>
319 </sect1>
320
321 <sect1 id="new_requests">
322 <title>New Requests</title>
323
324 <para>
325 The new request, <function>CreateImageBuffers</function>, creates a group of
326 image buffers and associates them with a normal X window:
327 </para>
328
329 <literallayout class="monospaced">
330 CreateImageBuffers
331      w_id           : WINDOW
332      buffers        : LISTofBUFFER
333      update_action  : {Undefined,Background,Untouched,Copied}
334      update_hint    : {Frequent,Intermittent,Static}
335      =&gt;
336      number_buffers : CARD16
337
338      (Errors: Window, IDChoice, Value)
339 </literallayout>
340
341 <para>
342 One image buffer will be associated with each ID passed in
343 <emphasis remap='I'>buffers</emphasis>.
344 The first buffer of the list is referred to as buffer[0], the next
345 buffer[1], and so on.  Each buffer will have the same visual type
346 and geometry as the window.
347 Buffer[0] will refer to the image buffer already associated
348 with the window ID and its contents will not be modified.
349 The displayed image buffer attribute is set to buffer[0].
350 </para>
351
352 <para>
353 Image buffers for the remaining ID's (buffer[1],...) are allocated.
354 If the window is mapped, or if these image buffers have backing
355 store, their contents will be tiled with the window background
356 (if no background is defined, the buffer contents are undefined),
357 and zero or more expose events will be generated for each of these
358 buffers.  The contents of an image buffer is undefined when
359 the window is unmapped and the buffer does not have backing store.
360 </para>
361
362 <para>
363 If the window already has a group of image buffers
364 associated with it (ie: from a previous <function>CreateImageBuffers</function> request)
365 the actions described for <function>DestroyImageBuffers</function> are performed first
366 (this will delete the association of the previous buffer ID's and
367 their buffers as well as de-allocate all buffers except for the
368 one already associated with the window ID).
369 </para>
370
371 <para>
372 To allow a server implementation to efficiently allocate the
373 buffers, the total number of buffers required and
374 the update action (how they will behave during an update)
375 is specified "up front" in the request.
376 If the server cannot allocate all the buffers requested, the
377 total number of buffers actually allocated will be returned.
378 No <function>Alloc</function> errors will be generated \- buffer[0] can
379 always be associated with the existing displayed image buffer.
380 </para>
381
382 <para>
383 For example, an application that wants to animate a short movie
384 loop may request 64 image buffers.  The server may only be able to
385 support 16 image buffers of this type, size, and depth.
386 The application can then decide 16 buffers is sufficient and may
387 truncate the movie loop, or it may decide it really needs
388 64 and will free the buffers and complain to the user.
389 </para>
390
391 <para>
392 One might be tempted to provide a request that inquires whether
393 <emphasis remap='I'>n</emphasis>
394 buffers of a particular type, size, and depth
395 <emphasis remap='I'>could</emphasis> be allocated.
396 But if the query is decoupled from the actual allocation,
397 another client could sneak in and take the buffers before the
398 original client has allocated them.
399 </para>
400
401 <para>
402 While any buffer of a group can be selected for display,
403 some applications may display buffers in a predictable order
404 (ie: the movie loop application).  The
405 <emphasis remap='I'>list order</emphasis>
406 (buffer[0], buffer[1], ...) will be used as a hint by the
407 server as to which buffer will be displayed next.
408 A client displaying buffers in this order may see a
409 performance improvement.
410 </para>
411
412 <para>
413 <emphasis remap='I'>update_action</emphasis> indicates what should happen to a previously
414 displayed buffer when a different buffer becomes displayed.
415 Possible actions are:
416 </para>
417
418 <variablelist>
419   <varlistentry>
420     <term>Undefined</term>
421     <listitem>
422       <para>
423 The contents of the buffer that was
424 last displayed will become undefined after the update.  This
425 is the most efficient action since it allows the implementation
426 to trash the contents of the buffer if it needs to.
427       </para>
428     </listitem>
429   </varlistentry>
430   <varlistentry>
431     <term>Background</term>
432     <listitem>
433       <para>
434 The contents of the buffer that was
435 last displayed will be set to the background of the window after the update.
436 The background action allows devices to use a fast clear
437 capability during an update.
438       </para>
439     </listitem>
440   </varlistentry>
441   <varlistentry>
442     <term>Untouched</term>
443     <listitem>
444       <para>
445 The contents of the buffer that was
446 last displayed will be untouched after the update.  Used
447 primarily when cycling through images that have already
448 been drawn.
449       </para>
450     </listitem>
451   </varlistentry>
452   <varlistentry>
453     <term>Copied</term>
454     <listitem>
455       <para>
456 The contents of the buffer that was
457 last displayed will become the same as those that are being
458 displayed after the update.  This is useful when incrementally
459 adding to an image.
460       </para>
461     </listitem>
462   </varlistentry>
463 </variablelist>
464
465
466
467 <para>
468 <emphasis remap='I'>update_hint</emphasis> indicates how often the client will
469 request a different buffer to be displayed.
470 This hint will allow smart server implementations to choose the
471 most efficient means to support a multi-buffered window based
472 on the current need of the application (dumb implementations
473 may choose to ignore this hint).  Possible hints are:
474 </para>
475
476 <variablelist>
477   <varlistentry>
478     <term>Frequent</term>
479     <listitem>
480       <para>
481 An animation or movie loop is
482 being attempted and the fastest, most efficient means for
483 multi-buffering should be employed.
484       </para>
485     </listitem>
486   </varlistentry>
487   <varlistentry>
488     <term>Intermittent</term>
489     <listitem>
490       <para>
491 The displayed image will be
492 changed every so often.  This is common for images that are
493 displayed at a rate slower than a second.  For example, a
494 clock that is updated only once a minute.
495       </para>
496     </listitem>
497   </varlistentry>
498   <varlistentry>
499     <term>Static</term>
500     <listitem>
501       <para>
502 The displayed image buffer will
503 not be changed any time soon.  Typically set by an application
504 whenever there is a pause in the animation.
505       </para>
506     </listitem>
507   </varlistentry>
508 </variablelist>
509
510 <para>
511 To display an image buffer the following request can be used:
512 </para>
513
514 <literallayout class="monospaced">
515 DisplayImageBuffers
516      buffers         : LISTofBUFFER
517      min_delay       : CARD16
518      max_delay       : CARD16
519
520      (Errors: Buffer, Match)
521 </literallayout>
522
523 <para>
524 The image buffers listed will become displayed as simultaneously
525 as possible and the update action, bound at
526 <function>CreateImageBuffers</function>
527 time, will be performed.
528 </para>
529
530 <para>
531 A list of buffers is specified to
532 allow the server to efficiently change the display of more than one
533 window at a time (ie: when a global screen swap method is used).
534 Attempting to simultaneously display
535 multiple image buffers from the same window is an error
536 (<function>Match</function>) since it violates the rule that only one
537 image buffer per group can be displayed at a time.
538 </para>
539
540 <para>
541 If a specified buffer is already displayed,
542 any delays and update action will still be
543 performed for that buffer.  In this instance,
544 only the update action of <emphasis remap='I'>Background</emphasis>
545 (and possibly
546 <emphasis remap='I'>Undefined</emphasis>) will have any affect on the
547 contents of the displayed buffer.  These semantics allow
548 an animation application to successfully execute
549 even when there is only a single buffer available
550 for a window.
551 </para>
552 <para>
553 <!-- .LP -->
554 When a <function>DisplayImageBuffers</function> request is made to an unmapped
555 multi-buffered window, the effect of the update action depends
556 on whether the image buffers involved have backing store.
557 When the target of the update action is an image buffer that
558 does not have backing store, output is discarded.  When the
559 target image buffer does have backing store, the update is performed;
560 however, when the source of the update is an image buffer does not
561 have backing store (as in the case of update action
562 <emphasis remap='I'>Copied</emphasis>), the
563 contents of target image buffer will become undefined.
564 </para>
565 <para>
566 <!-- .LP -->
567 <emphasis remap='I'>min_delay</emphasis> and
568 <emphasis remap='I'>max_delay</emphasis> put a bound on how long the
569 server should wait before processing the display request.
570 For each of the windows to be updated by this request, at least
571 <emphasis remap='I'>min_delay</emphasis> milli-seconds should elapse since
572 the last
573 time any of the windows were updated; conversely, no window
574 should have to wait more than <emphasis remap='I'>max_delay</emphasis>
575 milli-seconds before being updated.
576 </para>
577
578 <para>
579 <emphasis remap='I'>min_delay</emphasis> allows an application to
580 <emphasis remap='I'>slow down</emphasis> an animation or movie loop so that
581 it appears
582 synchronized at a rate the server can support given the current load.
583 For example, a <emphasis remap='I'>min_delay</emphasis> of 100 indicates the
584 server should
585 wait at least 1/10 of a second since the last time any of the
586 windows were updated.  A <emphasis remap='I'>min_delay</emphasis> of zero
587 indicates no waiting is necessary.
588 </para>
589
590 <para>
591 <emphasis remap='I'>max_delay</emphasis> can be thought of as an additional
592 delay beyond <emphasis remap='I'>min_delay</emphasis> the server is allowed
593 to wait
594 to facilitate such things as efficient update of multiple windows.
595 If <emphasis remap='I'>max_delay</emphasis> would require an update before
596 <emphasis remap='I'>min_delay</emphasis>
597 is satisfied, then the server should process the display request as
598 soon as the <emphasis remap='I'>min_delay</emphasis> requirement is met.  A
599 typical value for <emphasis remap='I'>max_delay</emphasis> is zero.
600 </para>
601
602 <para>
603 To implement the above functionality, the time since the last
604 update by a <function>DisplayImageBuffers</function> request for each
605 multi-buffered
606 window needs to be saved as state by the server.
607 The server may delay execution of the <function>DisplayImageBuffers</function>
608 request until the appropriate time (e.g. by requeuing the
609 request after computing the timeout);
610 however, the entire request must be processed in one operation.
611 Request execution indivisibility must be maintained.  When
612 a server is implemented with internal concurrency, the
613 extension must adhere to the same concurrency semantics
614 as those defined for the core protocol.
615 </para>
616
617 <para>
618 To explicitly clear a rectangular area of an image buffer to
619 the window background, the following request can be used:
620 </para>
621
622 <literallayout class="monospaced">
623 ClearImageBufferArea
624      buffer          : BUFFER
625      x, y            : INT16
626      w, h            : CARD16
627      exposures       : BOOL
628
629      (Errors: Buffer, Value)
630 </literallayout>
631
632 <para>
633 Like the X <function>ClearArea</function> request,
634 <emphasis remap='I'>x</emphasis> and <emphasis remap='I'>y</emphasis>
635 are relative to
636 the window's origin and specify the upper-left corner of the rectangle.
637 If <emphasis remap='I'>width</emphasis> is zero, it is replaced with the
638 current window width
639 minus <emphasis remap='I'>x</emphasis>.  If
640 <emphasis remap='I'>height</emphasis> is zero it is replaced with the current
641 window height minus <emphasis remap='I'>y</emphasis>.  If the window has a
642 defined background tile, the rectangle is tiled with a plane mask of all ones,
643 a function of <emphasis remap='I'>Copy</emphasis>, and a subwindow-mode of
644 <emphasis remap='I'>ClipByChildren</emphasis>.
645 If the window has background <emphasis remap='I'>None</emphasis>, the
646 contents of the buffer
647 are not changed.  In either case, if
648 <emphasis remap='I'>exposures</emphasis> is true, then one or
649 more exposure events are generated for regions of the rectangle that are
650 either visible or are being retained in backing store.
651 </para>
652
653 <para>
654 <!-- .LP -->
655 The group of image buffers allocated by a
656 <function>CreateImageBuffers</function>
657 request can be destroyed with the following request:
658 </para>
659
660 <literallayout class="monospaced">
661 DestroyImageBuffers
662      w_id          : WINDOW
663
664      (Error: Window)
665 </literallayout>
666
667 <para>
668 The association between the buffer ID's and their corresponding
669 image buffers are deleted.  Any image buffers not selected for
670 display are de-allocated.  If the window is not multi-buffered,
671 the request is ignored.
672 </para>
673
674 </sect1>
675
676 <sect1 id="attributes">
677 <title>Attributes</title>
678
679 <para>
680 The following attributes will be associated with each window that
681 is multi-buffered:
682 </para>
683
684 <literallayout class="monospaced">
685      displayed_buffer : CARD16
686      update_action    : {Undefined,Background,Untouched,Copied}
687      update_hint      : {Frequent,Intermittent,Static}
688      window_mode      : {Mono,Stereo}
689      buffers          : LISTofBUFFER
690 </literallayout>
691
692 <para>
693 <emphasis remap='I'>displayed_buffer</emphasis> is set to the
694 <emphasis remap='I'>index</emphasis> of the currently
695 displayed image buffer (for stereo windows, this will be
696 the index of the left buffer \- the index of the right buffer
697 is simply <emphasis remap='I'>index</emphasis>+1).
698 <emphasis remap='I'>window_mode</emphasis> indicates whether this window is
699 <emphasis remap='I'>Mono</emphasis> or <emphasis remap='I'>Stereo</emphasis>.
700 The ID for each buffer associated with the window is recorded
701 in the <emphasis remap='I'>buffers</emphasis> list.
702 The above attributes can be queried with the following request:
703 </para>
704
705 <literallayout class="monospaced">
706 GetMultiBufferAttributes
707      w_id             : WINDOW
708      =&gt;
709      displayed_buffer : CARD16
710      update_action    : {Undefined,Background,Untouched,Copied}
711      update_hint      : {Frequent,Intermittent,Static}
712      window_mode      : {Mono,Stereo}
713      buffers          : LISTofBUFFER
714
715      (Errors: Window, Access, Value)
716 </literallayout>
717
718 <para>
719 If the window is not multi-buffered, a <function>Access</function> error
720 will be generated.
721 The only multi-buffer attribute that can be explicitly set
722 is <emphasis remap='I'>update_hint</emphasis>.  Rather than have a specific
723 request to set this attribute, a generic set request is provided to
724 allow for future expansion:
725 </para>
726
727 <literallayout class="monospaced">
728 SetMultiBufferAttributes
729      w_id            : WINDOW
730      value_mask      : BITMASK
731      value_list      : LISTofVALUE
732
733      (Errors: Window, Match, Value)
734 </literallayout>
735
736 <para>
737 If the window is not multi-buffered, a <function>Match</function> error
738 will be generated.
739 The following attributes are maintained for each buffer of a
740 multi-buffered window:
741 </para>
742
743 <literallayout class="monospaced">
744      window           : WINDOW
745      event_mask       : SETofEVENT
746      index            : CARD16
747      side             : {Mono,Left,Right}
748 </literallayout>
749
750 <para>
751 <emphasis remap='I'>window</emphasis> indicates the window this buffer is
752 associated with.
753 <emphasis remap='I'>event_mask</emphasis> specifies which events, relevant to
754 buffers, will be sent back to the client via the associated buffer ID
755 (initially no events are selected).
756 <emphasis remap='I'>index</emphasis> is the list position (0, 1, ...) of the
757 buffer.
758 <emphasis remap='I'>side</emphasis> indicates whether this buffer is
759 associated with
760 the left side or right side of a stereo window.
761 For non-stereo windows, this attribute will be set to
762 <emphasis remap='I'>Mono</emphasis>.
763 These attributes can be queried with the following request:
764 </para>
765
766 <literallayout class="monospaced">
767 GetBufferAttributes
768      buffer          : BUFFER
769      =&gt;
770      window           : WINDOW
771      event_mask       : SETofEVENT
772      index            : CARD16
773      side             : {Mono,Left,Right}
774
775      (Errors: Buffer, Value)
776 </literallayout>
777
778 <para>
779 The only buffer attribute that can be explicitly set
780 is <emphasis remap='I'>event_mask</emphasis>.
781 The only events that are valid are
782 <function>Expose</function> and the new
783 <function>ClobberNotify</function> and <function>UpdateNotify</function>
784 event (see Events section below). <!-- xref -->
785 A <function>Value</function> error will be generated if an event not
786 selectable for a buffer is specified in an event mask.
787 Rather than have a specific request
788 to set this attribute, a generic set request is provided to
789 allow for future expansion:
790 </para>
791
792 <literallayout class="monospaced">
793 SetBufferAttributes
794      buffer          : BUFFER
795      value_mask      : BITMASK
796      value_list      : LISTofVALUE
797
798      (Errors: Buffer, Value)
799 </literallayout>
800
801 <para>
802 Clients may want to query the server about basic multi-buffer
803 and stereo capability on a per screen basis.  The following request
804 returns a large list of information
805 that would most likely be read once by Xlib for each screen, and used as a
806 data base for other Xlib queries:
807 </para>
808
809 <literallayout class="monospaced">
810 GetBufferInfo
811      root            : WINDOW
812      =&gt;
813      info            : LISTofSCREEN_INFO
814 </literallayout>
815
816 <para>
817 Where <function>SCREEN_INFO</function> and
818 <function>BUFFER_INFO</function> are defined as:
819 </para>
820
821 <literallayout class="monospaced">
822      SCREEN_INFO     : [ normal_info : LISTofBUFFER_INFO,
823                          stereo_info : LISTofBUFFER_INFO ]
824
825      BUFFER_INFO     : [ visual      : VISUALID,
826                          max_buffers : CARD16,
827                          depth       : CARD8 ]
828 </literallayout>
829
830 <para>
831 Information regarding multi-buffering of normal (mono) windows
832 is returned in the <emphasis remap='I'>normal_info</emphasis> list.
833 The <emphasis remap='I'>stereo_info</emphasis>
834 list contains information about stereo windows.
835 If the <emphasis remap='I'>stereo_info</emphasis> list is empty, stereo
836 windows are
837 not supported on the screen.  If
838 <emphasis remap='I'>max_buffers</emphasis> is zero,
839 the maximum number of buffers for the depth and visual is
840 a function of the size of the created window and current
841 memory limitations.
842 </para>
843
844 <para>
845 The following request returns the major and minor version numbers
846 of this extension:
847 </para>
848
849 <literallayout class="monospaced">
850 GetBufferVersion
851      =&gt;
852      major_number    : CARD8
853      minor_number    : CARD8
854 </literallayout>
855
856 <para>
857 The version numbers are an escape hatch in case future revisions of
858 the protocol are necessary.  In general, the major version would
859 increment for incompatible changes, and the minor version would
860 increment for small upward compatible changes.  Barring changes, the
861 major version will be 1, and the minor version will be 1.
862 </para>
863 </sect1>
864
865 <sect1 id="events">
866 <title>Events</title>
867
868 <para>
869 All events normally generated for single-buffered
870 windows are also generated for multi-buffered windows.
871 Most of these events (ie: <function>ConfigureNotify</function>) will
872 only be generated for the window and not for each buffer.
873 These events will return a window ID.
874 </para>
875
876 <para>
877 <function>Expose</function> events will be generated for both the window
878 and any buffer affected.  When this event is generated for
879 a buffer, the same event structure will be used
880 but a buffer ID is returned instead of a window ID.
881 Clients, when processing these events, will know whether an
882 ID returned in an event structure is for a window or a buffer
883 by comparing the returned ID to the ones returned when the
884 window and buffer were created.
885 </para>
886
887 <para>
888 <function>GraphicsExposure</function> and
889 <function>NoExposure</function> are generated
890 using whatever ID is specified in the graphics operation.
891 If a window ID is specified, the event will contain the
892 window ID.  If a buffer ID is specified, the event will
893 contain the buffer ID.
894 </para>
895 <para>
896 In some implementations, moving a window
897 over a multi-buffered window may cause one or more of its buffers
898 to get overwritten or become unwritable.  To allow a
899 client drawing into one of these buffers the opportunity
900 to stop drawing until some portion of the buffer is
901 writable, the following event is added:
902 </para>
903
904 <literallayout class="monospaced">
905 ClobberNotify
906      buffer         :  BUFFER
907      state          : {Unclobbered,PartiallyClobbered,FullyClobbered}
908 </literallayout>
909
910 <para>
911 The <function>ClobberNotify</function> event is reported to clients selecting
912 <emphasis remap='I'>ClobberNotify</emphasis> on a buffer.  When a buffer
913 that was fully
914 or partially clobbered becomes unclobbered, an event with
915 <emphasis remap='I'>Unclobbered</emphasis>
916 is generated.  When a buffer that was unclobbered becomes
917 partially clobbered, an event with
918 <emphasis remap='I'>PartiallyClobbered</emphasis>
919 is generated.  When a buffer that was unclobbered or
920 partially clobbered becomes fully clobbered, an event with
921 <emphasis remap='I'>FullyClobbered</emphasis> is generated.
922 </para>
923
924 <para>
925 <function>ClobberNotify</function> events on a given buffer are
926 generated before any <function>Expose</function> events on that buffer,
927 but it is not required that all <function>ClobberNotify</function>
928 events on all buffers be generated before all
929 <function>Expose</function> events on all buffers.
930 </para>
931
932 <para>
933 The ordering of <function>ClobberNotify</function> events with respect
934 to <function>VisibilityNotify</function> events is not constrained.
935 </para>
936
937 <para>
938 If multiple buffers were used as an image FIFO between an image
939 server and the X display server, then the FIFO manager would like
940 to know when a buffer that was previously displayed, has been
941 undisplayed and updated, as the side effect of a
942 <function>DisplayImageBuffers</function>
943 request.  This allows the FIFO manager to load up a future frame as
944 soon as a buffer becomes available.  To support this,
945 the following event is added:
946 </para>
947
948 <literallayout class="monospaced">
949 UpdateNotify
950      buffer         :  BUFFER
951 </literallayout>
952
953 <para>
954 The <function>UpdateNotify</function> event is reported to clients selecting
955 <emphasis remap='I'>UpdateNotify</emphasis> on a buffer.  Whenever a buffer
956 becomes <emphasis remap='I'>updated</emphasis>
957 (e.g. its update action is performed as part of a
958 <function>DisplayImageBuffers</function>
959 request), an <function>UpdateNotify</function> event is generated.
960 </para>
961 </sect1>
962
963 <sect1 id="errors">
964 <title>Errors</title>
965
966 <para>
967 The following error type has been added to support
968 this extension:
969 </para>
970
971 <sect2 id="buffer_2">
972 <title>Buffer</title>
973 <para>
974 A value for a BUFFER argument does not name a defined BUFFER.
975 </para>
976 </sect2>
977
978 <sect2 id="double_buffering_normal_windows">
979 <title>Double-Buffering Normal Windows</title>
980
981 <para>
982 The following pseudo-code fragment illustrates how to create and display
983 a double-buffered image:
984 </para>
985
986 <literallayout class="monospaced">
987 /*
988  * Create a normal window
989  */
990 CreateWindow( W, ... )
991
992 /*
993  * Create two image buffers.  Assume after display, buffer
994  * contents become "undefined".  Assume we will "frequently"
995  * update the display.  Abort if we don't get two buffers,
996  */
997 n = CreateImageBuffers( W, [B0,B1], Undefined, Frequent )
998 if (n != 2) &lt;abort&gt;
999
1000 /*
1001  * Map window to the screen
1002  */
1003 MapWindow( W )
1004
1005 /*
1006  * Draw images using alternate buffers, display every
1007  * 1/10 of a second.  Note we draw B1 first so it will
1008  * "pop" on the screen
1009  */
1010 while animating
1011 {
1012      &lt;draw picture using B1&gt;
1013      DisplayImageBuffers( [B1], 100, 0 )
1014
1015      &lt;draw picture using B0&gt;
1016      DisplayImageBuffers( [B0], 100, 0 )
1017 }
1018
1019 /*
1020  * Strip image buffers and leave window with
1021  * contents of last displayed image buffer.
1022  */
1023 DestroyImageBuffers( W )
1024 </literallayout>
1025
1026 </sect2>
1027
1028 <sect2 id="multi_buffering_normal_windows">
1029 <title>Multi-Buffering Normal Windows</title>
1030
1031 <para>
1032 Multi-buffered images are also supported by these requests.
1033 The following pseudo-code fragment illustrates how to create a
1034 a multi-buffered image and cycle through the images to
1035 simulate a movie loop:
1036 </para>
1037
1038 <literallayout class="monospaced">
1039 /*
1040  * Create a normal window
1041  */
1042 CreateWindow( W, ... )
1043
1044 /*
1045  * Create 'N' image buffers.  Assume after display, buffer
1046  * contents are "untouched".  Assume we will "frequently"
1047  * update the display.  Abort if we don't get all the buffers.
1048  */
1049 n = CreateImageBuffers( W, [B0,B1,...,B(N-1)], Untouched, Frequent )
1050 if (n != N) &lt;abort&gt;
1051
1052 /*
1053  * Map window to screen
1054  */
1055 MapWindow( W )
1056
1057 /*
1058  * Draw each frame of movie one per buffer
1059  */
1060 foreach frame
1061      &lt;draw frame using B(i)&gt;
1062
1063 /*
1064  * Cycle through frames, one frame every 1/10 of a second.
1065  */
1066 while animating
1067 {
1068      foreach frame
1069           DisplayImageBuffers( [B(i)], 100, 0 )
1070 }
1071 </literallayout>
1072
1073 </sect2>
1074
1075 <sect2 id="stereo_windows">
1076 <title>Stereo Windows</title>
1077 <para>
1078 <emphasis remap='I'>How</emphasis> stereo windows are supported on a server
1079 is implementation
1080 dependent.  A server may contain specialized hardware that allows
1081 left and right images to be toggled at field or frame rates.  The
1082 stereo affect may only be perceived with the aid of special
1083 viewing glasses.  The <emphasis remap='I'>display</emphasis> of a
1084 stereo picture should
1085 be independent of how often the contents of the picture are
1086 <emphasis remap='I'>updated</emphasis> by an application.  Double and
1087 multi-buffering
1088 of images should be possible regardless of whether the image
1089 is displayed normally or in stereo.
1090 </para>
1091
1092 <para>
1093 To achieve this goal, a simple extension to normal windows
1094 is suggested.  Stereo windows are just like normal windows
1095 except the displayed image is made up of a left image
1096 buffer and a right image buffer.  To create a stereo window,
1097 a client makes the following request:
1098 </para>
1099
1100 <literallayout class="monospaced">
1101 CreateStereoWindow
1102      parent          : WINDOW
1103      w_id            : WINDOW
1104      left, right     : BUFFER
1105      depth           : CARD8
1106      visual          : VISUALID or CopyFromParent
1107      x, y            : INT16
1108      width, height   : INT16
1109      border_width    : INT16
1110      value_mask      : BITMASK
1111      value_list      : LISTofVALUE
1112
1113      (Errors: Alloc, Color, Cursor, Match,
1114               Pixmap, Value, Window)
1115 </literallayout>
1116
1117 <para>
1118 This request, modeled after the <function>CreateWindow</function> request,
1119 adds just two new parameters: <emphasis remap='I'>left</emphasis> and
1120 <emphasis remap='I'>right</emphasis>.
1121 For stereo, it is essential that one can distinguish whether
1122 a draw operation is to occur on the left image or right image.
1123 While an internal mode could have been added to achieve this,
1124 using two buffer ID's allows clients to simultaneously build up
1125 the left and right components of a stereo image.  These
1126 ID's always refer to (are an alias for) the left and right
1127 image buffers that are currently <emphasis remap='I'>displayed</emphasis>.
1128 </para>
1129
1130 <para>
1131 Like normal windows, the window ID is used whenever a window
1132 management operation is to be performed.  Window queries would
1133 also return this window ID (eg: <function>QueryTree</function>) as would most
1134 events.  Like the window ID, the left and right buffer ID's
1135 each have their own event mask.  They can be set and queried
1136 using the <function>Set/GetBufferAttributes</function> requests.
1137 </para>
1138
1139 <para>
1140 Using the window ID of a stereo window in a draw request
1141 (eg: <function>GetImage</function>) results in pixels that are
1142 <emphasis remap='I'>undefined</emphasis>.
1143 Possible semantics are that both left and right images get
1144 drawn, or just a single side is operated on (existing applications
1145 will have to be re-written to explicitly use the left and right
1146 buffer ID's in order to successfully create, fetch, and store
1147 stereo images).
1148 </para>
1149
1150 <para>
1151 Having an explicit <function>CreateStereoWindow</function> request is helpful
1152 in that a server implementation will know from the onset whether
1153 a stereo window is desired and can return appropriate status
1154 to the client if it cannot support this functionality.
1155 </para>
1156
1157 <para>
1158 Some hardware may support separate stereo and non-stereo modes,
1159 perhaps with different vertical resolutions.  For example, the
1160 vertical resolution in stereo mode may be half that of non-stereo
1161 mode.  Selecting one mode or the other must be done through some
1162 means outside of this extension (eg: by providing a separate
1163 screen for each hardware display mode).  The screen attributes
1164 (ie: x/y resolution) for a screen that supports normal windows,
1165 may differ from a screen that supports stereo windows;
1166 however, all windows, regardless of type, displayed on the
1167 same screen must have the same screen attributes
1168 (ie: pixel aspect ratio).
1169 </para>
1170
1171 <para>
1172 If a screen that supports stereo windows also supports
1173 normal windows, then the images presented to the left and
1174 right eyes for normal windows should be the same
1175 (ie: have no stereo offset).
1176 </para>
1177
1178 </sect2>
1179
1180 <sect2 id="single_buffered_stereo_windows">
1181 <title>Single-Buffered Stereo Windows</title>
1182
1183 <para>
1184 The following shows how to create and display a single-buffered
1185 stereo image:
1186 </para>
1187 <literallayout class="monospaced">
1188 /*
1189  * Create the stereo window, map it the screen,
1190  * and draw the left and right images
1191  */
1192 CreateStereoWindow( W, L, R, ... )
1193
1194 MapWindow( W )
1195
1196 &lt;draw picture using L,R&gt;
1197 </literallayout>
1198 </sect2>
1199
1200 <sect2 id="double_buffering_stereo_windows">
1201 <title>Double-Buffering Stereo Windows</title>
1202
1203 <para>
1204 Additional image buffers may be added to a stereo window
1205 to allow double or multi-buffering of stereo images.
1206 Simply use the the <function>CreateImageBuffers</function> request.
1207 Even numbered buffers (0,2,...) will be left buffers.
1208 Odd numbered buffers (1,3,...) will be right buffers.
1209 Displayable stereo images are formed by consecutive
1210 left/right pairs of image buffers.  For example,
1211 (buffer[0],buffer[1]) form the first displayable
1212 stereo image; (buffer[2],buffer[3]) the next;
1213 and so on.
1214 </para>
1215
1216 <para>
1217 The <function>CreateImageBuffers</function> request will only create
1218 pairs of left and right image buffers for stereo windows.
1219 By always pairing left and right image
1220 buffers together, implementations might be able to
1221 perform some type of optimization.  If an odd number
1222 of buffers is specified, a <function>Value</function> error is generated.
1223 All the rules mentioned at the start of this proposal
1224 still apply to the image buffers supported by a stereo window.
1225 </para>
1226
1227 <para>
1228 To display a image buffer pair of a multi-buffered stereo image,
1229 either the left buffer ID or right buffer ID may be specified in a
1230 <function>DisplayImageBuffers</function> request, but not both.
1231 </para>
1232
1233 <para>
1234 To double-buffer a stereo window:
1235 </para>
1236
1237 <literallayout class="monospaced">
1238 /*
1239  * Create stereo window and map it to the screen
1240  */
1241 CreateStereoWindow( W, L, R, ... )
1242
1243 /*
1244  * Create two pairs of image buffers.  Assume after display,
1245  * buffer contents become "undefined".  Assume we will "frequently"
1246  * update the display.  Abort if we did get all the buffers.
1247  */
1248 n = CreateImageBuffers( W, [L0,R0,L1,R1], Undefined, Frequently )
1249 if (n != 4) &lt;abort&gt;
1250
1251 /*
1252  * Map window to the screen
1253  */
1254 MapWindow( W )
1255
1256 /*
1257  * Draw images using alternate buffers,
1258  * display every 1/10 of a second.
1259  */
1260 while animating
1261 {
1262      &lt;draw picture using L1,R1&gt;
1263      DisplayImageBuffers( [L1], 100, 0 )
1264
1265      &lt;draw picture using L0,R0&gt;
1266      DisplayImageBuffers( [L0], 100, 0 )
1267 }
1268 </literallayout>
1269
1270 </sect2>
1271
1272 <sect2 id="multi_buffering_stereo_windows">
1273 <title>Multi-Buffering Stereo Windows</title>
1274
1275 <para>
1276 To cycle through <emphasis remap='I'>N</emphasis> stereo images:
1277 </para>
1278
1279 <literallayout class="monospaced">
1280 /*
1281  * Create stereo window
1282  */
1283 CreateStereoWindow( W, L, R, ... )
1284
1285 /*
1286  * Create N pairs of image buffers.  Assume after display,
1287  * buffer contents are "untouched".  Assume we will "frequently"
1288  * update the display.  Abort if we don't get all the buffers.
1289  */
1290 n = CreateImageBuffers( W, [L0,R0,...,L(N-1),R(N-1)], Untouched, Frequently )
1291 if (n != N*2) &lt;abort&gt;
1292
1293 /*
1294  * Map window to screen
1295  */
1296 MapWindow( W )
1297
1298 /*
1299  * Draw the left and right halves of each image
1300  */
1301 foreach stereo image
1302      &lt;draw picture using L(i),R(i)&gt;
1303
1304 /*
1305  * Cycle through images every 1/10 of a second
1306  */
1307 while animating
1308 {
1309      foreach stereo image
1310           DisplayImageBuffers( [L(i)], 100, 0 )
1311 }
1312 </literallayout>
1313 </sect2>
1314
1315 <sect2 id="protocol_encoding">
1316 <title>Protocol Encoding</title>
1317
1318 <para>
1319 The official name of this extension is "Multi-Buffering".
1320 When this string passed to <function>QueryExtension</function> the
1321 information returned should be interpreted as follows:
1322 </para>
1323
1324 <variablelist>
1325   <varlistentry>
1326     <term>major-opcode</term>
1327     <listitem>
1328       <para>
1329 Specifies the major opcode of this extension.
1330 The first byte of each extension request should
1331 specify this value.
1332       </para>
1333     </listitem>
1334   </varlistentry>
1335   <varlistentry>
1336     <term>first-event</term>
1337     <listitem>
1338       <para>
1339 Specifies the code that will be returned when
1340 <function>ClobberNotify</function> events are generated.
1341       </para>
1342     </listitem>
1343   </varlistentry>
1344   <varlistentry>
1345     <term>first-error</term>
1346     <listitem>
1347       <para>
1348 Specifies the code that will be returned when
1349 <function>Buffer</function> errors are generated.
1350       </para>
1351     </listitem>
1352   </varlistentry>
1353 </variablelist>
1354
1355 <para>
1356 The following sections describe the protocol
1357 encoding for this extension.
1358 </para>
1359 </sect2>
1360 </sect1>
1361
1362 <sect1 id="type">
1363 <title>TYPES</title>
1364
1365 <literallayout class="monospaced">
1366 BUFFER_INFO
1367
1368 4       VISUALID     visual
1369 2       CARD16       max-buffers
1370 1       CARD8        depth
1371 1                    unused
1372 </literallayout>
1373
1374 <literallayout class="monospaced">
1375 SETofBUFFER_EVENT
1376
1377         #x00008000   Exposure
1378         #x02000000   ClobberNotify
1379         #x04000000   UpdateNotify
1380 </literallayout>
1381
1382 </sect1>
1383
1384 <sect1 id="events_2">
1385 <title>EVENTS</title>
1386
1387 <literallayout class="monospaced">
1388 <function>ClobberNotify</function>
1389 1       see <emphasis remap='I'>first-event</emphasis> code
1390 1                                unused
1391 2       CARD16                   sequence number
1392 4       BUFFER                   buffer
1393 1                                state
1394         0 Unclobbered
1395         1 PartiallyClobbered
1396         2 FullyClobbered
1397 23                                unused
1398 </literallayout>
1399
1400 <literallayout class="monospaced">
1401 <function>UpdateNotify</function>
1402 1 <emphasis remap='I'>first-event</emphasis>+1 code
1403 1                       unused
1404 2      CARD16           sequence number
1405 4      BUFFER           buffer
1406 24                      unused
1407 </literallayout>
1408
1409 </sect1>
1410 <sect1 id="errors_2">
1411 <title>ERRORS</title>
1412
1413 <literallayout class="monospaced">
1414 <function>Buffer</function>
1415 1     0                 Error
1416 1     see <emphasis remap='I'>first-error</emphasis> code
1417 2     CARD16                 sequence number
1418 4     CARD32                 bad resource id
1419 2     CARD16                 minor-opcode
1420 1     CARD8                  major-opcode
1421 21                           unused
1422 </literallayout>
1423
1424 </sect1>
1425
1426 <sect1 id="requests">
1427 <title>REQUESTS</title>
1428
1429 <literallayout class="monospaced">
1430 <function>GetBufferVersion</function>
1431 1       see <emphasis remap='I'>major-opcode</emphasis>         major-opcode
1432 1       0                  minor-opcode
1433 2       1                  request length
1434 -&gt;
1435 1       1                  Reply
1436 1                          unused
1437 2       CARD16             sequencenumber
1438 4       0                  reply length
1439 1       CARD8              majorversion number
1440 1       CARD8              minorversion number
1441 22                         unused
1442
1443
1444 <function>CreateImageBuffers</function>
1445
1446 1        see <emphasis remap='I'>major-opcode</emphasis>  major-opcode
1447 1        1                 minor-opcode
1448 2        3+n               requestlength
1449 4        WINDOW            wid
1450 1                          update-action
1451          0 Undefined
1452          1 Background
1453          2 Untouched
1454          3 Copied
1455 1                          update-hint
1456          0 Frequent
1457          1 Intermittent
1458          2 Static
1459 2                          unused
1460 4n     LISTofBUFFER        buffer-list
1461 -&gt;
1462 1        1                 Reply
1463 1                          unused
1464 2      CARD16              sequencenumber
1465 4      0                   reply length
1466 2      CARD16              number-buffers
1467 22                         unused
1468
1469
1470 <function>DestroyImageBuffers</function>
1471
1472 1        see <emphasis remap='I'>major-opcode</emphasis>  major-opcode
1473 1       2                  minor-opcode
1474 2       2                  request length
1475 4       WINDOW             wid
1476
1477
1478 <function>DisplayImageBuffers</function>
1479
1480
1481 1        see <emphasis remap='I'>major-opcode</emphasis>  major-opcode
1482 2        2+n               requestlength
1483 2        CARD16            min-delay
1484 2        CARD16            max-delay
1485 4n       LISTofBUFFER      buffer-list
1486
1487
1488 <function>SetMultiBufferAttributes</function>
1489
1490 1        see <emphasis remap='I'>major-opcode</emphasis>  major-opcode
1491 1        4                 minor-opcode
1492 2        3+n               requestlength
1493 4        WINDOW            wid
1494 4        BITMASK           value-mask (has n bits set to 1)
1495          #x00000001        update-hint
1496 4n        LISTofVALUE      value-list
1497 VALUEs
1498 1                          update-hint
1499          0 Frequent
1500          1 Intermittent
1501          2 Static
1502
1503
1504 <function>GetMultiBufferAttributes</function>
1505
1506 1        see <emphasis remap='I'>major-opcode</emphasis>  major-opcode
1507 1        5                 minor-opcode
1508 2        2                 request length
1509 4        WINDOW            wid
1510 ®
1511 1        1                 Reply
1512 1                          unused
1513 2        CARD16            sequencenumber
1514 4        n                 reply length
1515 2        CARD16            displayed-buffer
1516 1                          update-action
1517          0 Undefined
1518          1 Background
1519          2 Untouched
1520          3 Copied
1521 1                          update-hint
1522          0 Frequent
1523          1 Intermittent
1524          2 Static
1525 1                          window-mode
1526          0 Mono
1527          1 Stereo
1528 19                         unused
1529 4n       LISTofBUFFER      buffer list
1530
1531
1532 <function>SetBufferAttributes</function>
1533
1534 1        see <emphasis remap='I'>major-opcode</emphasis>  major-opcode
1535 1        6                 minor-opcode
1536 2        3+n               requestlength
1537 4        BUFFER            buffer
1538 4        BITMASK           value-mask (has n bits set to 1)
1539          #x00000001        event-mask
1540 4n       LISTofVALUE       value-list
1541 VALUEs
1542 4        SETofBUFFER_EVENT event-mask
1543
1544 <function>GetBufferAttributes</function>
1545
1546 1        see <emphasis remap='I'>major-opcode</emphasis>  major-opcode
1547 1        7                 minor-opcode
1548 2        2                 request length
1549 4        BUFFER            buffer
1550 -&gt;
1551 1        1                 Reply
1552 1                          unused
1553 2        CARD16            sequencenumber
1554 4        0                 reply length
1555 4        WINDOW            wid
1556 4        SETofBUFFER_EVENT event-mask
1557 2        CARD16            index
1558          1 side
1559          0 Mono
1560          1 Left
1561          2 Right
1562 13                         unused
1563
1564 <function>GetBufferInfo</function>
1565
1566 1        see <emphasis remap='I'>major-opcode</emphasis>  major-opcode
1567 1        8                   minor-opcode
1568 2        2                   request length
1569 4        WINDOW              root
1570 ®
1571 1        1                   Reply
1572 1                            unused
1573 2        CARD16              sequencenumber
1574 4        2(n+m)              replylength
1575 2        n                   number BUFFER_INFO in normal-info
1576 2        m                   number BUFFER_INFO in stereo-info
1577 20                           unused
1578 8n       LISTofBUFFER_INFO   normal-info
1579 8m       LISTofBUFFER_INFO   stereo-info
1580
1581 <function>CreateStereoWindow</function>
1582
1583 1        see <emphasis remap='I'>major-opcode</emphasis>  major-opcode
1584 1        9 minor-opcode
1585 2        11+n                    requestlength
1586 3                                unused
1587 1        CARD8                   depth
1588 4        WINDOW                  wid
1589 4        WINDOW                  parent
1590 4        BUFFER                  left
1591 4        BUFFER                  right
1592 2        INT16                   x
1593 2        INT16                   y
1594 2        CARD16                  width
1595 2        CARD16                  height
1596 2        CARD16                  border-width
1597 2                                class
1598          0 CopyFromParent
1599          1 InputOutput
1600          2 InputOnly
1601 4        VISUALID                visual
1602          0 CopyFromParent
1603 4        BITMASK                 value-mask (has n bits set to 1)
1604          encodings are the same
1605          as for CreateWindow
1606 4n       LISTofVALUE             value-list
1607          encodings are the same
1608          as for CreateWindow
1609
1610
1611 <function>ClearImageBufferArea</function>
1612
1613 1 see major-opcode major-opcode
1614 1        10                      minor-opcode
1615 2        5                       request length
1616 4        WINDOW                  buffer
1617 2        INT16                   x
1618 2        INT16                   y
1619 2        CARD16                  width
1620 2        CARD16                  height
1621 3                                unused
1622 1        BOOL                    exposures
1623
1624 </literallayout>
1625
1626 </sect1>
1627 </chapter>
1628 </book>