home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / doc / extensions / buffer.text next >
Encoding:
Text File  |  1991-07-17  |  44.4 KB  |  1,786 lines

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