Change the protocol definition of X-Resource to use ATOMs.
[free-sw/xcb/proto] / src / randr.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <!--
3 Copyright (C) 2006 Jeremy Kolb, Ian Osgood
4 All Rights Reserved.
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to deal
8 in the Software without restriction, including without limitation the rights
9 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in all
14 copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
23 Except as contained in this notice, the names of the authors or their
24 institutions shall not be used in advertising or otherwise to promote the
25 sale, use or other dealings in this Software without prior written
26 authorization from the authors.
27 -->
28
29 <xcb header="randr" extension-xname="RANDR" extension-name="RandR"
30     major-version="1" minor-version="2">
31
32         <import>xproto</import>
33         
34         <!-- Errors -->
35
36         <error name="BadOutput" number="0" />
37         <error name="BadCrtc"   number="1" />
38         <error name="BadMode"   number="2" />
39
40         <!-- Requests -->
41
42         <enum name="Rotation">
43                 <item name="Rotate_0">  <bit>0</bit></item>
44                 <item name="Rotate_90"> <bit>1</bit></item>
45                 <item name="Rotate_180"><bit>2</bit></item>
46                 <item name="Rotate_270"><bit>3</bit></item>
47                 <item name="Reflect_X"> <bit>4</bit></item>
48                 <item name="Reflect_Y"> <bit>5</bit></item>
49         </enum>
50
51         <struct name="ScreenSize">
52                 <field type="INT16" name="width" />   <!-- pixels -->
53                 <field type="INT16" name="height" />
54                 <field type="INT16" name="mwidth" />  <!-- millimeters -->
55                 <field type="INT16" name="mheight" />
56         </struct>
57         
58         <struct name="RefreshRates">
59                 <field type="CARD16" name="nRates" />
60                 <list type="CARD16" name="rates">
61                         <fieldref>nRates</fieldref>
62                 </list>
63         </struct>
64         
65         <request name="QueryVersion" opcode="0">
66                 <field type="CARD32" name="major_version" />
67                 <field type="CARD32" name="minor_version" />
68                 <reply>
69                         <pad bytes="1" />
70                         <field type="CARD32" name="major_version" />
71                         <field type="CARD32" name="minor_version" />
72                         <pad bytes="16" />
73                 </reply>
74         </request>
75         
76         <!-- Skip obsolete opcode 1 so old clients fail immediately -->
77
78         <!-- This is for the 1.1 version request.  I don't believe we need to specify a 1.0 request
79         as few things used randr 1.0.  The only difference is the removal of refresh and padding I think.
80         BEWARE: the docs lie!
81         -->
82         <request name="SetScreenConfig" opcode="2">
83                 <field type="DRAWABLE" name="drawable" />
84                 <field type="TIMESTAMP" name="timestamp" />
85                 <field type="TIMESTAMP" name="config_timestamp" />
86                 <field type="CARD16" name="sizeID" />
87                 <field type="INT16" name="rotation" />
88                 <field type="CARD16" name="rate" />
89                 <pad bytes="2" />
90                 <reply>
91                         <field type="CARD8" name="status" />    <!-- enum SetConfig -->
92                         <field type="TIMESTAMP" name="new_timestamp" />
93                         <field type="TIMESTAMP" name="config_timestamp" />
94                         <field type="WINDOW" name="root" />
95                         <field type="CARD16" name="subpixel_order" />
96                         <pad bytes="10" />
97                 </reply>
98         </request>
99         
100         <!-- opcode 3 is obsolete -->
101
102         <enum name="SetConfig">
103                 <item name="Success"><value>0</value></item>
104                 <item name="InvalidConfigTime"><value>1</value></item>
105                 <item name="InvalidTime"><value>2</value></item>
106                 <item name="Failed"><value>3</value></item>
107         </enum>
108
109         <request name="SelectInput" opcode="4"> 
110                 <field type="WINDOW" name="window" />
111                 <field type="CARD16" name="enable" />  <!-- enum SetConfig -->
112                 <pad bytes="2" />
113         </request>
114
115         <!--
116         I think this is correct.  It works. though I believe nInfo is a bit high...
117         -->
118         <request name="GetScreenInfo" opcode="5">
119                 <field type="WINDOW" name="window" />
120                 <reply>
121                         <field type="CARD8" name="rotations" />
122                         <field type="WINDOW" name="root" />
123                         <field type="TIMESTAMP" name="timestamp" />
124                         <field type="TIMESTAMP" name="config_timestamp" />
125                         <field type="CARD16" name="nSizes" />
126                         <field type="CARD16" name="sizeID" />
127                         <field type="INT16" name="rotation" />
128                         <field type="CARD16" name="rate" />
129                         <field type="CARD16" name="nInfo" />
130                         <pad bytes="2" />
131                         <list type="ScreenSize" name="sizes">
132                             <fieldref>nSizes</fieldref>
133                         </list>
134                         <list type="RefreshRates" name="rates">
135                                 <op op="-">
136                                         <fieldref>nInfo</fieldref>
137                                         <fieldref>nSizes</fieldref>
138                                 </op>
139                         </list>
140                 </reply>
141         </request>
142
143         <!-- new in version 1.2 -->
144
145         <request name="GetScreenSizeRange" opcode="6">
146                 <field type="WINDOW" name="window" />
147                 <reply>
148                         <pad bytes="1" />
149                         <field type="CARD16" name="min_width" />
150                         <field type="CARD16" name="min_height" />
151                         <field type="CARD16" name="max_width" />
152                         <field type="CARD16" name="max_height" />
153                 </reply>
154         </request>
155
156         <request name="SetScreenSize" opcode="7">
157                 <field type="WINDOW" name="window" />
158                 <field type="CARD16" name="width" />    <!-- pixels -->
159                 <field type="CARD16" name="height" />
160                 <field type="CARD32" name="mm_width" />  <!-- millimeters -->
161                 <field type="CARD32" name="mm_height" />
162         </request>
163
164         <!-- for GetScreenResources.ModeInfo.ModeFlag -->
165         <enum name="ModeFlag">
166                 <item name="HsyncPositive"> <bit>0</bit></item>
167                 <item name="HsyncNegative"> <bit>1</bit></item>
168                 <item name="VsyncPositive"> <bit>2</bit></item>
169                 <item name="VsyncNegative"> <bit>3</bit></item>
170                 <item name="Interlace">     <bit>4</bit></item>
171                 <item name="DoubleScan">    <bit>5</bit></item>
172                 <item name="Csync">         <bit>6</bit></item>
173                 <item name="CsyncPositive"> <bit>7</bit></item>
174                 <item name="CsyncNegative"> <bit>8</bit></item>
175                 <item name="HskewPresent">  <bit>9</bit></item>
176                 <item name="Bcast">         <bit>10</bit></item>
177                 <item name="PixelMultiplex"><bit>11</bit></item>
178                 <item name="DoubleClock">   <bit>12</bit></item>
179                 <item name="HalveClock">    <bit>13</bit></item>
180         </enum>
181
182         <struct name="ModeInfo">
183                 <field type="CARD32" name="id" />
184                 <field type="CARD16" name="width" />
185                 <field type="CARD16" name="height" />
186                 <field type="CARD32" name="dot_clock" />
187                 <field type="CARD16" name="hsync_start" />
188                 <field type="CARD16" name="hsync_end" />
189                 <field type="CARD16" name="htotal" />
190                 <field type="CARD16" name="hskew" />
191                 <field type="CARD16" name="vsync_start" />
192                 <field type="CARD16" name="vsync_end" />
193                 <field type="CARD16" name="vtotal" />
194                 <field type="CARD16" name="name_len" />
195                 <field type="CARD32" name="mode_flags" />       <!-- enum ModeFlag -->
196                 <!-- the mode name itself -->
197         </struct>
198
199         <request name="GetScreenResources" opcode="8">
200                 <field type="WINDOW" name="window" />
201                 <reply>
202                         <pad bytes="1" />
203                         <field type="TIMESTAMP" name="timestamp" />
204                         <field type="TIMESTAMP" name="config_timestamp" />
205                         <field type="CARD16" name="num_crtcs" />
206                         <field type="CARD16" name="num_outputs" />
207                         <field type="CARD16" name="num_modes" />
208                         <field type="CARD16" name="names_len" />
209                         <pad bytes="8" />
210                         <list type="CARD32" name="crtcs">
211                             <fieldref>num_crtcs</fieldref>
212                         </list>
213                         <list type="CARD32" name="outputs">
214                             <fieldref>num_outputs</fieldref>
215                         </list>
216                         <list type="ModeInfo" name="modes">
217                             <fieldref>num_modes</fieldref>
218                         </list>
219                         <!-- FIXME: this is *not* null separated!
220                              One must use ModeInfo.name_len from each previous
221                              ModeInfo to infer the position of the name. -->
222                         <list type="BYTE" name="names">
223                             <fieldref>names_len</fieldref>
224                         </list>
225                 </reply>
226         </request>
227
228         <!-- for GetOutputInfo.connection -->
229         <enum name="Connection">
230                 <item name="Connected" />
231                 <item name="Disconnected" />
232                 <item name="Unknown" />
233         </enum>
234
235         <request name="GetOutputInfo" opcode="9">
236                 <field type="CARD32" name="output" />
237                 <field type="TIMESTAMP" name="config_timestamp" />
238                 <reply>
239                         <field type="CARD8" name="status" />    <!-- enum SetConfig -->
240                         <field type="TIMESTAMP" name="timestamp" />
241                         <field type="CARD32" name="crtc" />
242                         <field type="CARD32" name="mm_width" />  <!-- millimeters -->
243                         <field type="CARD32" name="mm_height" />
244                         <field type="CARD8" name="connection" /> <!-- enum Connection -->
245                         <field type="CARD8" name="subpixel_order" />
246                         <field type="CARD16" name="num_crtcs" />
247                         <field type="CARD16" name="num_modes" />
248                         <field type="CARD16" name="num_preferred" />
249                         <field type="CARD16" name="num_clones" />
250                         <field type="CARD16" name="name_len" />
251                         <list type="CARD32" name="crtcs">
252                             <fieldref>num_crtcs</fieldref>
253                         </list>
254                         <list type="CARD32" name="modes">
255                             <fieldref>num_modes</fieldref>
256                         </list>
257                         <list type="CARD32" name="clones">
258                             <fieldref>num_clones</fieldref>
259                         </list>
260                         <list type="BYTE" name="name">
261                             <fieldref>name_len</fieldref>
262                         </list>
263                 </reply>
264         </request>
265
266         <request name="ListOutputProperties" opcode="10">
267                 <field type="CARD32" name="output" />
268                 <reply>
269                         <pad bytes="1" />
270                         <field type="CARD16" name="num_atoms" />
271                         <pad bytes="22" />
272                         <list type="ATOM" name="atoms">
273                                 <fieldref>num_atoms</fieldref>
274                         </list>
275                 </reply>
276         </request>
277
278         <request name="QueryOutputProperty" opcode="11">
279                 <field type="CARD32" name="output" />
280                 <field type="ATOM" name="property" />
281                 <reply>
282                         <pad bytes="1" />
283                         <field type="BOOL" name="pending" />
284                         <field type="BOOL" name="range" />
285                         <field type="BOOL" name="immutable" />
286                         <pad bytes="21" />
287                         <list type="INT32" name="validValues" />
288                 </reply>
289         </request>
290
291         <request name="ConfigureOutputProperty" opcode="12">
292                 <field type="CARD32" name="output" />
293                 <field type="ATOM" name="property" />
294                 <field type="BOOL" name="pending" />
295                 <field type="BOOL" name="range" />
296                 <pad bytes="2" />
297         </request>
298
299         <request name="ChangeOutputProperty" opcode="13">
300                 <field type="CARD32" name="output" />
301                 <field type="ATOM" name="property" />
302                 <field type="ATOM" name="type" />
303                 <field type="CARD8" name="format" />
304                 <field type="CARD8" name="mode" />
305                 <pad bytes="2" />
306                 <field type="CARD32" name="num_units" />
307         </request>
308
309         <request name="DeleteOutputProperty" opcode="14">
310                 <field type="CARD32" name="output" />
311                 <field type="ATOM" name="property" />
312         </request>
313
314         <!-- NOTE: num_items depends on format (8/16/32) -->
315         <request name="GetOutputProperty" opcode="15">
316                 <field type="CARD32" name="output" />
317                 <field type="ATOM" name="property" />
318                 <field type="ATOM" name="type" />
319                 <field type="CARD32" name="long_offset" />
320                 <field type="CARD32" name="long_length" />
321                 <field type="BOOL" name="delete" />
322                 <field type="BOOL" name="pending" />
323                 <reply>
324                         <field type="CARD8" name="format" />
325                         <field type="ATOM" name="type" />
326                         <field type="CARD32" name="bytes_after" />
327                         <field type="CARD32" name="num_items" />
328                         <pad bytes="12" />
329                         <list type="BYTE" name="data">
330                                 <!-- n * format / 8 -->
331                                 <op op="*">
332                                         <fieldref>num_items</fieldref>
333                                         <op op="/">
334                                                 <fieldref>format</fieldref>
335                                                 <value>8</value>
336                                         </op>
337                                 </op>
338                         </list>
339                 </reply>
340         </request>
341
342         <request name="CreateMode" opcode="16">
343                 <field type="WINDOW" name="window" />
344                 <field type="ModeInfo" name="mode_info" />
345                 <reply>
346                         <field type="CARD8" name="status" />    <!-- enum SetConfig -->
347                         <field type="CARD32" name="mode" />
348                 </reply>
349         </request>
350
351         <request name="DestroyMode" opcode="17">
352                 <field type="CARD32" name="mode" />
353         </request>
354
355         <request name="AddOutputMode" opcode="18">
356                 <field type="CARD32" name="output" />
357                 <field type="CARD32" name="mode" />
358         </request>
359
360         <request name="DeleteOutputMode" opcode="19">
361                 <field type="CARD32" name="output" />
362                 <field type="CARD32" name="mode" />
363         </request>
364
365         <request name="GetCrtcInfo" opcode="20">
366                 <field type="CARD32" name="crtc" />
367                 <field type="TIMESTAMP" name="config_timestamp" />
368                 <reply>
369                         <field type="CARD8" name="status" />    <!-- enum SetConfig -->
370                         <field type="TIMESTAMP" name="timestamp" />
371                         <field type="CARD32" name="crtc" />
372                         <field type="INT16" name="x" />
373                         <field type="INT16" name="y" />
374                         <field type="CARD16" name="width" />
375                         <field type="CARD16" name="height" />
376                         <field type="CARD32" name="mode" />
377                         <field type="CARD16" name="rotation" />         <!-- enum Rotation -->
378                         <field type="CARD16" name="rotations" />        <!-- mask of enum Rotation -->
379                         <field type="CARD16" name="num_outputs" />
380                         <field type="CARD16" name="num_possible_outputs" />
381                         <list type="CARD32" name="outputs">
382                                 <fieldref>num_outputs</fieldref>
383                         </list>
384                 </reply>
385         </request>
386
387         <request name="SetCrtcConfig" opcode="21">
388                 <field type="CARD32" name="crtc" />
389                 <field type="TIMESTAMP" name="timestamp" />
390                 <field type="TIMESTAMP" name="config_timestamp" />
391                 <field type="INT16" name="x" />
392                 <field type="INT16" name="y" />
393                 <field type="CARD32" name="mode" />
394                 <field type="CARD16" name="rotation" />         <!-- enum Rotation -->
395                 <reply>
396                         <field type="CARD8" name="status" />    <!-- enum SetConfig -->
397                         <field type="TIMESTAMP" name="timestamp" />
398                 </reply>
399         </request>
400
401         <request name="GetCrtcGammaSize" opcode="22">
402                 <field type="CARD32" name="crtc" />
403                 <reply>
404                         <field type="CARD8" name="status" />    <!-- enum SetConfig -->
405                         <field type="CARD16" name="size" />
406                 </reply>
407         </request>
408
409         <request name="GetCrtcGamma" opcode="23">
410                 <field type="CARD32" name="crtc" />
411                 <reply>
412                         <field type="CARD8" name="status" />    <!-- enum SetConfig -->
413                         <field type="CARD16" name="size" />
414                         <pad bytes="22" />
415                         <list type="CARD16" name="red">
416                                 <fieldref>size</fieldref>
417                         </list>
418                         <list type="CARD16" name="green">
419                                 <fieldref>size</fieldref>
420                         </list>
421                         <list type="CARD16" name="blue">
422                                 <fieldref>size</fieldref>
423                         </list>
424                 </reply>
425         </request>
426
427         <request name="SetCrtcGamma" opcode="24">
428                 <field type="CARD32" name="crtc" />
429                 <field type="CARD16" name="size" />
430                 <pad bytes="2"/>
431                 <list type="CARD16" name="red">
432                         <fieldref>size</fieldref>
433                 </list>
434                 <list type="CARD16" name="green">
435                         <fieldref>size</fieldref>
436                 </list>
437                 <list type="CARD16" name="blue">
438                         <fieldref>size</fieldref>
439                 </list>
440         </request>
441
442         <!-- Events -->
443
444         <enum name="NotifyMask" >
445                 <item name="ScreenChange">  <bit>0</bit></item>
446                 <!-- new in 1.2 -->
447                 <item name="CrtcChange">    <bit>1</bit></item>
448                 <item name="OutputChange">  <bit>2</bit></item>
449                 <item name="OutputProperty"><bit>3</bit></item>
450         </enum>
451         
452         <event name="ScreenChangeNotify" number="0">
453                 <field type="CARD8" name="rotation" />
454                 <field type="TIMESTAMP" name="timestamp" />
455                 <field type="TIMESTAMP" name="config_timestamp" />
456                 <field type="WINDOW" name="root" />
457                 <field type="WINDOW" name="request_window" />
458                 <field type="CARD16" name="sizeID" />
459                 <field type="CARD16" name="subpixel_order" />
460                 <field type="CARD16" name="width" />
461                 <field type="CARD16" name="height" />
462                 <field type="CARD16" name="mwidth" />
463                 <field type="CARD16" name="mheight" />
464         </event>
465
466         <!-- New in version 1.2 -->
467
468         <!-- subcode -->
469         <enum name="Notify" >
470                 <item name="CrtcChange">    <value>0</value></item>
471                 <item name="OutputChange">  <value>1</value></item>
472                 <item name="OutputProperty"><value>2</value></item>
473         </enum>
474
475         <struct name="CrtcChange">
476                 <field type="TIMESTAMP" name="timestamp" />
477                 <field type="WINDOW" name="window" />
478                 <field type="CARD32" name="crtc" />
479                 <field type="CARD32" name="mode" />
480                 <field type="CARD16" name="rotation" />         <!-- enum Rotation -->
481                 <pad bytes="2" />
482                 <field type="INT16" name="x" />
483                 <field type="INT16" name="y" />
484                 <field type="CARD16" name="width" />
485                 <field type="CARD16" name="height" />
486         </struct>
487
488         <struct name="OutputChange">
489                 <field type="TIMESTAMP" name="timestamp" />
490                 <field type="TIMESTAMP" name="config_timestamp" />
491                 <field type="WINDOW" name="window" />
492                 <field type="CARD32" name="output" />
493                 <field type="CARD32" name="crtc" />
494                 <field type="CARD32" name="mode" />
495                 <field type="CARD16" name="rotation" />         <!-- enum Rotation -->
496                 <field type="CARD8" name="connection" />        <!-- enum Connection -->
497                 <field type="CARD8" name="subpixel_order" />
498         </struct>
499
500         <struct name="OutputProperty">
501                 <field type="WINDOW" name="window" />
502                 <field type="CARD32" name="output" />
503                 <field type="ATOM" name="atom" />
504                 <field type="TIMESTAMP" name="timestamp" />
505                 <field type="CARD8" name="status" />            <!-- core enum Property -->
506                 <pad bytes="11" />
507         </struct>
508
509         <union name="NotifyData">
510                 <field type="CrtcChange"     name="cc" />
511                 <field type="OutputChange"   name="oc" />
512                 <field type="OutputProperty" name="op" />
513         </union>
514
515         <event name="Notify" number="1">
516                 <field type="CARD8" name="subCode" />           <!-- enum Notify -->
517                 <field type="NotifyData" name="u" />
518         </event>
519 </xcb>