Change the protocol definition of X-Resource to use ATOMs.
[free-sw/xcb/proto] / src / xprint.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <!--
3 Copyright (C) 2005 Jeremy Kolb.
4 All Rights Reserved.
5
6 Permission is hereby granted, free of charge, to any person ob/Sintaining 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="xprint" extension-xname="XpExtension" extension-name="XPrint"
30     extension-multiword="true" major-version="1" minor-version="0">
31
32     <!-- Conforms to XPRINT 1.0 -->
33
34     <import>xproto</import>
35     
36     <!-- Types -->
37     <struct name="PRINTER">
38         <field type="CARD32" name="nameLen" />
39         <list type="STRING8" name="name">
40             <fieldref>nameLen</fieldref>
41         </list>
42         <!-- Padding -->
43         <field type="CARD32" name="descLen" />
44         <list type="STRING8" name="description">
45             <fieldref>descLen</fieldref>
46         </list>
47         <!-- More padding -->
48     </struct>
49
50     <!--<typedef oldname="CARD32" newname="PCONTEXT" />-->
51     <xidtype name="PCONTEXT" />
52     <typedef oldname="char" newname="STRING8" />
53
54     <!-- "PrintGetDocumentData" -->
55     <enum name="GetDoc">
56         <item name="Finished"><value>0</value></item>
57             <item name="SecondConsumer"><value>1</value></item>
58     </enum>
59
60     <!-- Event Mask ("PrintSelectInput") -->
61     <enum name="EvMask">
62         <item name="NoEventMask"><value>0x00000000</value></item>
63         <item name="PrintMask"><value>0x00000001</value></item>
64         <item name="AttributeMask"><value>0x00000002</value></item>
65     </enum>
66
67     <!-- "PrintNotify" detail -->
68     <enum name="Detail">
69         <item name="StartJobNotify"><value>1</value></item>
70         <item name="EndJobNotify"><value>2</value></item>
71         <item name="StartDocNotify"><value>3</value></item>
72         <item name="EndDocNotify"><value>4</value></item>
73         <item name="StartPageNotify"><value>5</value></item>
74         <item name="EndPageNotify"><value>6</value></item>
75     </enum>
76
77     <!-- "AttributeNotify" detail -->
78     <enum name="Attr">
79         <item name="JobAttr"><value>1</value></item>
80         <item name="DocAttr"><value>2</value></item>
81         <item name="PageAttr"><value>3</value></item>
82         <item name="PrinterAttr"><value>4</value></item>
83         <item name="ServerAttr"><value>5</value></item>
84         <item name="MediumAttr"><value>6</value></item>
85         <item name="SpoolerAttr"><value>7</value></item>
86     </enum>
87     
88     
89     <!-- Requests -->
90     <request name="PrintQueryVersion" opcode="0">
91         <reply>
92             <pad bytes="1" />
93             <field type="CARD16" name="major_version" />
94             <field type="CARD16" name="minor_version" />
95         </reply>
96     </request>
97
98     <request name="PrintGetPrinterList" opcode="1">
99         <field type="CARD32" name="printerNameLen" />
100         <field type="CARD32" name="localeLen" />
101         <list type="STRING8" name="printer_name">
102             <fieldref>printerNameLen</fieldref>
103         </list>
104         <!-- There's some padding in here... -->
105         <list type="STRING8" name="locale">
106             <fieldref>localeLen</fieldref>
107         </list>
108         <reply>
109             <pad bytes="1" />
110             <field type="CARD32" name="listCount" />
111             <pad bytes="20" />
112             <list type="PRINTER" name="printers">
113                 <fieldref>listCount</fieldref>
114             </list>
115         </reply>
116     </request>
117
118     <request name="PrintRehashPrinterList" opcode="20" />
119
120     <request name="CreateContext" opcode="2">
121         <field type="CARD32" name="context_id" />
122         <field type="CARD32" name="printerNameLen" />
123         <field type="CARD32" name="localeLen" />
124         <list type="STRING8" name="printerName">
125             <fieldref>printerNameLen</fieldref>
126         </list>
127         <!-- padding -->
128         <list type="STRING8" name="locale">
129             <fieldref>localeLen</fieldref>
130         </list>
131     </request>
132
133     <request name="PrintSetContext" opcode="3">
134         <field type="CARD32" name="context" />
135     </request>
136
137     <request name="PrintGetContext" opcode="4">
138         <reply>
139             <pad bytes="1" />
140             <field type="CARD32" name="context" />
141         </reply>
142     </request>
143
144     <request name="PrintDestroyContext" opcode="5">
145         <field type="CARD32" name="context" />
146     </request>
147
148     <request name="PrintGetScreenOfContext" opcode="6">
149         <reply>
150             <pad bytes="1" />
151             <field type="WINDOW" name="root" />
152         </reply>
153     </request>
154
155     <request name="PrintStartJob" opcode="7">
156         <field type="CARD8" name="output_mode"/>
157     </request>
158
159     <request name="PrintEndJob" opcode="8">
160         <field type="BOOL"  name="cancel" />
161     </request>
162
163     <request name="PrintStartDoc" opcode="9">
164         <field type="CARD8" name="driver_mode" />
165     </request>
166
167     <request name="PrintEndDoc" opcode="10">
168         <field type="BOOL" name="cancel" />
169     </request>
170
171     <request name="PrintPutDocumentData" opcode="11">
172         <field type="DRAWABLE" name="drawable" />
173         <field type="CARD32" name="len_data" />
174         <field type="CARD16" name="len_fmt" />
175         <field type="CARD16" name="len_options" />
176         <list type="BYTE" name="data">
177             <fieldref>len_data</fieldref>
178         </list>
179         <!-- padding -->
180         <list type="STRING8" name="doc_format" />
181         <!-- padding -->
182         <list type="STRING8" name="options" />
183     </request>
184
185     <request name="PrintGetDocumentData" opcode="12">
186         <field type="PCONTEXT" name="context" />
187         <field type="CARD32" name="max_bytes" />
188         <reply>
189             <pad bytes="1" />
190             <field type="CARD32" name="status_code" />
191             <field type="CARD32" name="finished_flag" />
192             <field type="CARD32" name="dataLen" />
193             <pad bytes="12" />
194             <list type="BYTE" name="data">
195                 <fieldref>dataLen</fieldref>
196             </list>
197         </reply>
198     </request>
199
200     <request name="PrintStartPage" opcode="13">
201         <field type="WINDOW" name="window" />
202     </request>
203
204     <request name="PrintEndPage" opcode="14">
205         <field type="BOOL" name="cancel" />
206         <pad bytes="3" />
207     </request>
208
209     <request name="PrintSelectInput" opcode="15">
210         <field type="PCONTEXT" name="context" />
211         <valueparam value-mask-type="CARD32"
212                     value-mask-name="event_mask"
213                     value-list-name="event_list" />
214     </request>
215
216     <request name="PrintInputSelected" opcode="16">
217         <field type="PCONTEXT" name="context" />
218         <reply>
219             <pad bytes="1" />
220             <valueparam value-mask-type="CARD32"
221                             value-mask-name="event_mask"
222                             value-list-name="event_list" />
223             <valueparam value-mask-type="CARD32"
224                             value-mask-name="all_events_mask"
225                             value-list-name="all_events_list" />
226         </reply>
227     </request>
228
229     <request name="PrintGetAttributes" opcode="17">
230         <field type="PCONTEXT" name="context" />
231         <field type="CARD8" name="pool" />
232         <pad bytes="3" />
233         <reply>
234             <pad bytes="1" />
235             <field type="CARD32" name="stringLen" />
236             <pad bytes="20" />
237             <field type="STRING8" name="attributes" />
238         </reply>
239     </request>
240
241     <request name="PrintGetOneAttributes" opcode="19">
242         <field type="PCONTEXT" name="context" />
243         <field type="CARD32" name="nameLen" />
244         <field type="CARD8" name="pool" />
245         <pad bytes="3" />
246         <list type="STRING8" name="name">
247             <fieldref>nameLen</fieldref>
248         </list>
249         <reply>
250             <pad bytes="1" />
251             <field type="CARD32" name="valueLen" />
252             <pad bytes="20" />
253             <list type="STRING8" name="value">
254                 <fieldref>valueLen</fieldref>
255             </list>
256         </reply>
257     </request>
258
259     <request name="PrintSetAttributes" opcode="18">
260         <field type="PCONTEXT" name="context" />
261         <field type="CARD32" name="stringLen" />
262         <field type="CARD8" name="pool" />
263         <field type="CARD8" name="rule" />
264         <pad bytes="2" />
265         <list type="STRING8" name="attributes" />
266     </request>
267
268     <request name="PrintGetPageDimensions" opcode="21">
269         <field type="PCONTEXT" name="context" />
270         <reply>
271             <pad bytes="1" />
272             <field type="CARD16" name="width" />
273             <field type="CARD16" name="height" />
274             <field type="CARD16" name="offset_x" />
275             <field type="CARD16" name="offset_y" />
276             <field type="CARD16" name="reproducible_width" />
277             <field type="CARD16" name="reproducible_height" />
278         </reply>
279     </request>
280
281     <request name="PrintQueryScreens" opcode="22">
282         <reply>
283             <pad bytes="1" />
284             <field type="CARD32" name="listCount" />
285             <pad bytes="20" />
286             <list type="WINDOW" name="roots">
287                 <fieldref>listCount</fieldref>
288             </list>
289             <!-- There may be a WINDOW rootWindow here... -->
290         </reply>
291     </request>
292
293     <request name="PrintSetImageResolution" opcode="23">
294         <field type="PCONTEXT" name="context" />
295         <field type="CARD16" name="image_resolution" />
296         <reply>
297             <field type="BOOL" name="status" />
298             <field type="CARD16" name="previous_resolutions" />
299         </reply>
300     </request>
301
302     <request name="PrintGetImageResolution" opcode="24">
303         <field type="PCONTEXT" name="context" />
304         <reply>
305             <pad bytes="1" />
306             <field type="CARD16" name="image_resolution" />
307         </reply>
308     </request>
309
310
311     <!-- Events -->
312     <event name="Notify" number="0">
313         <field type="CARD8" name="detail" />
314         <field type="PCONTEXT" name="context" />
315         <field type="BOOL" name="cancel" />
316     </event>
317
318     <event name="AttributNotify" number="1">
319         <field type="CARD8" name="detail" />
320         <field type="PCONTEXT" name="context" />
321     </event>
322
323     <!-- Errors -->
324     <error name="BadContext" number="0" />
325     <error name="BadSequence" number="1" />
326
327 </xcb>
328