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