]> git.sesse.net Git - rdpsrv/blob - Xserver/include/extensions/Printstr.h
Import X server from vnc-3.3.7.
[rdpsrv] / Xserver / include / extensions / Printstr.h
1 /* $XConsortium: Printstr.h /main/2 1996/11/16 15:20:15 rws $ */
2 /******************************************************************************
3  ******************************************************************************
4  **
5  ** File:         Printstr.h
6  **
7  ** Description: Definitions needed by the server and library, but
8  **              not clients.
9  **
10  **              Print.h for server, library and clients.
11  **
12  ******************************************************************************
13  **
14  ** (c) Copyright 1996 Hewlett-Packard Company
15  ** (c) Copyright 1996 International Business Machines Corp.
16  ** (c) Copyright 1996 Sun Microsystems, Inc.
17  ** (c) Copyright 1996 Novell, Inc.
18  ** (c) Copyright 1996 Digital Equipment Corp.
19  ** (c) Copyright 1996 Fujitsu Limited
20  ** (c) Copyright 1996 Hitachi, Ltd.
21  ** 
22  ** Permission is hereby granted, free of charge, to any person obtaining a copy
23  ** of this software and associated documentation files (the "Software"), to deal
24  ** in the Software without restriction, including without limitation the rights
25  ** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
26  ** copies of the Software, and to permit persons to whom the Software is
27  ** furnished to do so, subject to the following conditions:
28  **
29  ** The above copyright notice and this permission notice shall be included in
30  ** all copies or substantial portions of the Software.
31  **
32  ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
33  ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
34  ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
35  ** COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
36  ** IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
37  ** CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
38  **
39  ** Except as contained in this notice, the names of the copyright holders shall
40  ** not be used in advertising or otherwise to promote the sale, use or other
41  ** dealings in this Software without prior written authorization from said
42  ** copyright holders.
43  **
44  ******************************************************************************
45  *****************************************************************************/
46
47
48 #ifndef _XpPrintstr_H_
49 #define _XpPrintstr_H_
50
51 /*
52  * NEED_EVENTS and NEED_REPLIES are hacks to limit the linker symbol-table
53  * size.   When function prototypes are needed from Print.h, this sets up
54  * a cascading dependency on Printstr.h and eventually Xproto.h to provide
55  * the event and reply struct definitions.
56  */
57 #ifndef NEED_EVENTS
58 #define NEED_EVENTS
59 #endif /* NEED_EVENTS */
60
61 #define NEED_REPLIES
62
63 #include <X11/Xproto.h>
64 #ifndef _XP_PRINT_SERVER_
65 #include <X11/Xlib.h>
66 #endif /* _XP_PRINT_SERVER_ */
67
68 /*
69  * Pull in other definitions.  Print.h will hide some things if we're
70  * doing server side work.
71  */
72 #include <X11/extensions/Print.h>
73
74 #include <X11/Xfuncproto.h>
75
76 _XFUNCPROTOBEGIN
77
78 /******************************************************************************
79  *
80  * Protocol requests constants and alignment values
81  *
82  * Note: Xlib macro's expect X_ABC where ABC is the name of the
83  * protocol request.
84  */
85 #define X_PrintQueryVersion             0
86 #define X_PrintGetPrinterList           1
87 #define X_PrintCreateContext            2
88 #define X_PrintSetContext               3
89 #define X_PrintGetContext               4
90 #define X_PrintDestroyContext           5
91 #define X_PrintGetContextScreen         6
92 #define X_PrintStartJob                 7
93 #define X_PrintEndJob                   8
94 #define X_PrintStartDoc                 9
95 #define X_PrintEndDoc                   10
96 #define X_PrintPutDocumentData          11
97 #define X_PrintGetDocumentData          12
98 #define X_PrintStartPage                13
99 #define X_PrintEndPage                  14
100 #define X_PrintSelectInput              15
101 #define X_PrintInputSelected            16
102 #define X_PrintGetAttributes            17
103 #define X_PrintSetAttributes            18
104 #define X_PrintGetOneAttribute          19
105 #define X_PrintRehashPrinterList        20
106 #define X_PrintGetPageDimensions        21
107 #define X_PrintQueryScreens             22
108 #define X_PrintSetImageResolution       23
109 #define X_PrintGetImageResolution       24
110
111 /********************************************************************
112  *
113  * Protocol data types
114  */
115 #define PCONTEXT CARD32
116 #define WINDOW   CARD32
117 #define DRAWABLE CARD32
118 #define BITMASK  CARD32
119
120 /******************************************************************************
121  *
122  * Event wire struct definitions
123  *
124  * Note: Xlib macro's expect xABC struct names and sz_xABC size
125  * constants where ABC is the name of the protocol request.
126  */
127
128
129 /*********************************************************************
130  *
131  * Events.
132  *
133  * See Print.h for the protocol "type" values.
134  */
135 typedef struct _xPrintPrintEvent {
136         BYTE type;              /* XPPrintNotify + extEntry->eventBase */
137         BYTE detail;            /* XPStartJobNotify, XPEndJobNotify,
138                                    XPStartDocNotify, XPEndDocNotify,
139                                    XPStartPageNotify, XPEndPageNotify */
140         CARD16 sequenceNumber B16;
141         PCONTEXT printContext B32; /* print context */
142         BOOL   cancel;          /* canceled flag */
143         CARD8  pad1;            /* rest is unused */
144         CARD16 pad2 B16;
145         CARD32 pad3 B32;
146         CARD32 pad4 B32;
147         CARD32 pad5 B32;
148         CARD32 pad6 B32;
149         CARD32 pad7 B32;
150 } xPrintPrintEvent;
151 #define sz_xPrintPrintEvent 32;
152
153 typedef struct _xPrintAttributeEvent {
154         BYTE   type;            /* XPAttributeNotify + extEntry->eventBase */
155         BYTE   detail;          /* XPJobAttr, XPDocAttr, XPPageAttr,
156                                    XPPrinterAttr, XPSpoolerAttr,
157                                    XPMediumAttr, XPServerAttr */
158         CARD16 sequenceNumber B16;
159         PCONTEXT printContext B32; /* print context */
160         CARD32 pad1 B32;
161         CARD32 pad2 B32;
162         CARD32 pad3 B32;
163         CARD32 pad4 B32;
164         CARD32 pad5 B32;
165         CARD32 pad6 B32;
166 } xPrintAttributeEvent;
167 #define sz_xPrintAttributeEvent 32;
168
169
170 /*********************************************************************
171  *
172  * Requests
173  */
174 typedef struct _PrintQueryVersion {
175         CARD8   reqType;                /* always PrintReqCode */
176         CARD8   printReqType;           /* always X_PrintQueryVersion */
177         CARD16  length B16;
178 } xPrintQueryVersionReq;
179 #define sz_xPrintQueryVersionReq        4
180
181 typedef struct {
182         BYTE    type;                   /* X_Reply */
183         CARD8   unused;                 /* not used */
184         CARD16  sequenceNumber B16;
185         CARD32  length B32;
186         CARD16  majorVersion B16;       /* major version of Xp protocol */
187         CARD16  minorVersion B16;       /* minor version of Xp protocol */
188         CARD32  pad1 B32;
189         CARD32  pad2 B32;
190         CARD32  pad3 B32;
191         CARD32  pad4 B32;
192         CARD32  pad5 B32;
193 } xPrintQueryVersionReply;
194 #define sz_xPrintQueryVersionReply      32
195
196
197 typedef struct _PrintGetPrinterList {
198         CARD8   reqType;                /* always PrintReqCode */
199         CARD8   printReqType;           /* always X_PrintGetPrinterList */
200         CARD16  length B16;
201         CARD32  printerNameLen B32;     /* length of printer name */
202         CARD32  localeLen B32;          /* length of locale string */
203
204         /* variable portion *****************************************
205         STRING8 printerName;             * printer name *
206         BYTE    pad(printerNameLen)      * unused *
207         STRING8 locale;                  * locale *
208         BYTE    pad(localeLen)           * unused *
209         ************************************************************/
210 } xPrintGetPrinterListReq;
211 #define sz_xPrintGetPrinterListReq      12
212
213 typedef struct {
214         BYTE    type;                   /* X_Reply */
215         CARD8   unused;                 /* not used */
216         CARD16  sequenceNumber B16;
217         CARD32  length B32;
218         CARD32  listCount B32;          /* of PRINTER recs below */
219         CARD32  pad1 B32;
220         CARD32  pad2 B32;
221         CARD32  pad3 B32;
222         CARD32  pad4 B32;
223         CARD32  pad5 B32;
224
225         /* variable portion *****************************************
226         CARD32  nameLen B32;            * length of name in bytes *
227         STRING8 name;                   * name *
228         BYTE    pad(nameLen)            * unused *
229
230         CARD32  descLen B32;            * length of desc in bytes *
231         STRING8 desc;                   * localized description *
232         BYTE    pad(descLen)            * unused *
233         ************************************************************/
234 } xPrintGetPrinterListReply;
235 #define sz_xPrintGetPrinterListReply    32
236
237
238 typedef struct _PrintRehashPrinterList {
239         CARD8   reqType;                /* always PrintReqCode */
240         CARD8   printReqType;           /* always X_PrintRehashPrinterList */
241         CARD16  length B16;
242 } xPrintRehashPrinterListReq;
243 #define sz_xPrintRehashPrinterListReq   4
244
245
246 typedef struct _PrintCreateContext {
247         CARD8   reqType;                /* always PrintReqCode */
248         CARD8   printReqType;           /* always X_PrintInitSetContext */
249         CARD16  length B16;
250         CARD32  contextID B32;          /* ID for context */
251         CARD32  printerNameLen B32;     /* length of printerName in bytes */
252         CARD32  localeLen B32;          /* length of locale in bytes */
253
254         /* variable portion *****************************************
255         STRING8 printerName              * printer name *
256         BYTE    pad(printerNameLen)      * unused *
257         STRING8 locale                   * locale *
258         BYTE    pad(locale)              * unused *
259         ************************************************************/
260 } xPrintCreateContextReq;               
261 #define sz_xPrintCreateContextReq       16
262
263
264 typedef struct _PrintSetContext {
265         CARD8   reqType;                /* always PrintReqCode */
266         CARD8   printReqType;           /* always X_PrintSetContext */
267         CARD16  length B16;
268         PCONTEXT printContext B32;      /* print context */
269 } xPrintSetContextReq;          
270 #define sz_xPrintSetContextReq          8
271
272
273 typedef struct _PrintGetContext {
274         CARD8   reqType;                /* always PrintReqCode */
275         CARD8   printReqType;           /* always X_PrintGetContext */
276         CARD16  length B16;
277 } xPrintGetContextReq;          
278 #define sz_xPrintGetContextReq          4
279
280 typedef struct {
281         BYTE    type;                   /* X_Reply */
282         CARD8   unused;                 /* not used */
283         CARD16  sequenceNumber B16;
284         CARD32  length B32;
285         PCONTEXT printContext B32;      /* print context */
286         CARD32  pad1 B32;
287         CARD32  pad2 B32;
288         CARD32  pad3 B32;
289         CARD32  pad4 B32;
290         CARD32  pad5 B32;
291 } xPrintGetContextReply;
292 #define sz_xPrintGetContextReply        32
293
294
295 typedef struct _PrintDestroyContext {
296         CARD8   reqType;                /* always PrintReqCode */
297         CARD8   printReqType;           /* always X_PrintDestroyContext */
298         CARD16  length B16;
299         PCONTEXT printContext B32;      /* print context */
300 } xPrintDestroyContextReq;              
301 #define sz_xPrintDestroyContextReq      8
302
303
304 typedef struct _PrintGetContextScreen {
305         CARD8   reqType;                /* always PrintReqCode */
306         CARD8   printReqType;           /* always X_PrintGetContextScreen */
307         CARD16  length B16;
308         PCONTEXT printContext B32;      /* print context */
309 } xPrintGetContextScreenReq;            
310 #define sz_xPrintGetContextScreenReq    8
311
312 typedef struct {
313         BYTE    type;                   /* X_Reply */
314         CARD8   unused;                 /* not used */
315         CARD16  sequenceNumber B16;
316         CARD32  length B32;
317         WINDOW  rootWindow;             /* screenPtr represented as rootWin */
318         CARD32  pad1 B32;
319         CARD32  pad2 B32;
320         CARD32  pad3 B32;
321         CARD32  pad4 B32;
322         CARD32  pad5 B32;
323 } xPrintGetContextScreenReply;
324 #define sz_xPrintGetContextScreenReply  32
325
326
327 typedef struct _PrintStartJob {
328         CARD8   reqType;                /* always PrintReqCode */
329         CARD8   printReqType;           /* always X_PrintStartJob */
330         CARD16  length B16;
331         CARD8   saveData;               /* save data boolean */
332         CARD8   pad1;
333         CARD16  pad2 B16;
334 } xPrintStartJobReq;            
335 #define sz_xPrintStartJobReq            8
336
337 typedef struct _PrintEndJob {
338         CARD8   reqType;                /* always PrintReqCode */
339         CARD8   printReqType;           /* always X_PrintEndJob */
340         CARD16  length B16;
341         BOOL    cancel;                 /* cancel boolean */
342         CARD8   pad1;
343         CARD16  pad2 B16;
344 } xPrintEndJobReq;
345 #define sz_xPrintEndJobReq              8
346
347
348 typedef struct _PrintStartDoc {
349         CARD8   reqType;                /* always PrintReqCode */
350         CARD8   printReqType;           /* always X_PrintStartDoc */
351         CARD16  length B16;
352         CARD8   type;                   /* type for document */
353         CARD8   pad1;
354         CARD16  pad2 B16;
355 } xPrintStartDocReq;            
356 #define sz_xPrintStartDocReq            8
357
358 typedef struct _PrintEndDoc {
359         CARD8   reqType;                /* always PrintReqCode */
360         CARD8   printReqType;           /* always X_PrintEndDoc */
361         CARD16  length B16;
362         BOOL    cancel;                 /* cancel boolean */
363         CARD8   pad1;
364         CARD16  pad2 B16;
365 } xPrintEndDocReq;
366 #define sz_xPrintEndDocReq              8
367
368
369 typedef struct _PrintPutDocumentData {
370         CARD8   reqType;                /* always PrintReqCode */
371         CARD8   printReqType;           /* always X_PrintPutDocumentData */
372         CARD16  length B16;
373         DRAWABLE drawable B32;          /* target drawable */
374         CARD32  len_data B32;           /* big len in bytes */
375         CARD16  len_fmt;                /* len in bytes */
376         CARD16  len_options;            /* len in bytes */
377
378         /* variable portion *****************************************
379         LISTofBYTE      data;            * data *
380         BYTE            pad(len_data)    * unused *
381         STRING8         doc_fmt;         * ISO compliant desc of data type *
382         BYTE            pad(len_fmt)     * unused *
383         STRING8         options;         * additional device-dependent desc *
384         BYTE            pad(len_options) * unused *
385         ************************************************************/
386 } xPrintPutDocumentDataReq;
387 #define sz_xPrintPutDocumentDataReq     16
388
389
390 typedef struct _PrintGetDocumentData {
391         CARD8   reqType;                /* always PrintReqCode */
392         CARD8   printReqType;           /* always X_PrintGetDocumentData */
393         CARD16  length B16;
394         PCONTEXT printContext B32;      /* print context */
395         CARD32  maxBufferSize B32;      /* maximum buffer size requested */
396 } xPrintGetDocumentDataReq;             
397 #define sz_xPrintGetDocumentDataReq     12
398
399 typedef struct {
400         BYTE    type;                   /* X_Reply */
401         CARD8   unused;                 /* not used */
402         CARD16  sequenceNumber B16;
403         CARD32  length B32;
404         CARD32  statusCode B32;         /* status code for reply */
405         CARD32  finishedFlag B32;       /* is this the last reply */
406         CARD32  dataLen B32;            /* data length */
407         CARD32  pad1 B32;
408         CARD32  pad2 B32;
409         CARD32  pad3 B32;
410
411         /* variable portion *****************************************
412         LISTofBYTE      data;            * data *
413         BYTE            pad(count)       * unused *
414         ************************************************************/
415 } xPrintGetDocumentDataReply;
416 #define sz_xPrintGetDocumentDataReply   32
417
418
419 typedef struct _PrintStartPage {
420         CARD8   reqType;                /* always PrintReqCode */
421         CARD8   printReqType;           /* always X_PrintStartPage */
422         CARD16  length B16;
423         WINDOW  window B32;             /* window */
424 } xPrintStartPageReq;           
425 #define sz_xPrintStartPageReq           8
426
427 typedef struct _PrintEndPage {
428         CARD8   reqType;                /* always PrintReqCode */
429         CARD8   printReqType;           /* always X_PrintEndPage */
430         CARD16  length B16;
431         BOOL    cancel;                 /* cancel boolean */
432         CARD8   pad1;
433         CARD16  pad2 B16;
434 } xPrintEndPageReq;
435 #define sz_xPrintEndPageReq             8
436
437
438 typedef struct _PrintSelectInput {
439         CARD8   reqType;                /* always PrintReqCode */
440         CARD8   printReqType;           /* always X_PrintSelectInput */
441         CARD16  length B16;
442         PCONTEXT printContext B32;      /* print context */
443         BITMASK eventMask B32;
444 } xPrintSelectInputReq;
445 #define sz_xPrintSelectInputReq         12
446
447
448 typedef struct _PrintInputSelected {
449         CARD8   reqType;                /* always PrintReqCode */
450         CARD8   printReqType;           /* always X_PrintInputSelected */
451         CARD16  length B16;
452         PCONTEXT printContext B32;      /* print context */
453 } xPrintInputSelectedReq;
454 #define sz_xPrintInputSelectedReq       8
455
456 typedef struct {
457         BYTE    type;                   /* X_Reply */
458         CARD8   unused;                 /* not used */
459         CARD16  sequenceNumber B16;
460         CARD32  length B32;
461         BITMASK eventMask B32;          /* your event mask */
462         BITMASK allEventsMask B32;      /* all event mask */
463         CARD32  pad1 B32;
464         CARD32  pad2 B32;
465         CARD32  pad3 B32;
466         CARD32  pad4 B32;
467 } xPrintInputSelectedReply;
468 #define sz_xPrintInputSelectedReply     32
469
470 typedef struct _PrintGetAttributes {
471         CARD8   reqType;                /* always PrintReqCode */
472         CARD8   printReqType;           /* always X_PrintGetAttributes */
473         CARD16  length B16;
474         PCONTEXT printContext B32;      /* print context */
475         CARD8   type;                   /* type */
476         CARD8   pad1;                   /* unused */
477         CARD16  pad2 B16;               /* unused */
478 } xPrintGetAttributesReq;
479 #define sz_xPrintGetAttributesReq       12
480
481 typedef struct {
482         BYTE    type;                   /* X_Reply */
483         CARD8   unused;                 /* not used */
484         CARD16  sequenceNumber B16;
485         CARD32  length B32;
486         CARD32  stringLen B32;          /* length of xrm db string */
487         CARD32  pad1 B32;
488         CARD32  pad2 B32;
489         CARD32  pad3 B32;
490         CARD32  pad4 B32;
491         CARD32  pad5 B32;
492
493         /* variable portion *****************************************
494         STRING8 string;                  * xrm db as a string *
495         BYTE    pad(stringLen)           * unused *
496         ************************************************************/
497 } xPrintGetAttributesReply;
498 #define sz_xPrintGetAttributesReply     32
499
500
501 typedef struct _PrintSetAttributes {
502         CARD8   reqType;                /* always PrintReqCode */
503         CARD8   printReqType;           /* always X_PrintSetAttributes */
504         CARD16  length B16;
505         PCONTEXT printContext B32;      /* print context */
506         CARD32  stringLen B32;          /* length of xrm db string */
507         CARD8   type;                   /* type */
508         CARD8   rule;                   /* replacement rule */
509         CARD16  pad1 B16;               /* unused */
510
511         /* variable portion *****************************************
512         STRING8 string;                  * xrm db as a string *
513         BYTE    pad(stringLen)           * unused *
514         ************************************************************/
515 } xPrintSetAttributesReq;
516 #define sz_xPrintSetAttributesReq       16
517
518
519 typedef struct _PrintGetOneAttribute {
520         CARD8   reqType;                /* always PrintReqCode */
521         CARD8   printReqType;           /* always X_PrintGetOneAttribute */
522         CARD16  length B16;
523         PCONTEXT printContext B32;      /* print context */
524         CARD32  nameLen;                /* length of name string */
525         CARD8   type;                   /* type */
526         CARD8   pad1;                   /* unused */
527         CARD16  pad2 B16;               /* unused */
528
529         /* variable portion *****************************************
530         STRING8 name;                    * name as a string *
531         BYTE    pad(name)                * unused *
532         ************************************************************/
533 } xPrintGetOneAttributeReq;
534 #define sz_xPrintGetOneAttributeReq     16
535
536 typedef struct {
537         BYTE    type;                   /* X_Reply */
538         CARD8   unused;                 /* not used */
539         CARD16  sequenceNumber B16;
540         CARD32  length B32;
541         CARD32  valueLen B32;           /* length of value string */
542         CARD32  pad1 B32;
543         CARD32  pad2 B32;
544         CARD32  pad3 B32;
545         CARD32  pad4 B32;
546         CARD32  pad5 B32;
547
548         /* variable portion *****************************************
549         STRING8 value;                   * value as a string *
550         BYTE    pad(value)               * unused *
551         ************************************************************/
552 } xPrintGetOneAttributeReply;
553 #define sz_xPrintGetOneAttributeReply   32
554
555
556 typedef struct _PrintGetPageDimensions {
557         CARD8   reqType;                /* always PrintReqCode */
558         CARD8   printReqType;           /* always X_PrintGetPageDimensions */
559         CARD16  length B16;
560         PCONTEXT printContext B32;      /* print context */
561 } xPrintGetPageDimensionsReq;           
562 #define sz_xPrintGetPageDimensionsReq   8
563
564 typedef struct {
565         BYTE    type;                   /* X_Reply */
566         CARD8   unused;                 /* not used */
567         CARD16  sequenceNumber B16;
568         CARD32  length B32;
569         CARD16  width;                  /* total pixel width */
570         CARD16  height;                 /* total pixel height */
571         CARD16  rx;                     /* reproducable x pixel offset */
572         CARD16  ry;                     /* reproducable y pixel offset */
573         CARD16  rwidth;                 /* reproducable x pixel width */
574         CARD16  rheight;                /* reproducable y pixel width */
575         CARD32  pad1 B32;
576         CARD32  pad2 B32;
577         CARD32  pad3 B32;
578 } xPrintGetPageDimensionsReply;
579 #define sz_xPrintGetPageDimensionsReply 32
580
581
582 typedef struct _PrintQueryScreens {
583         CARD8   reqType;                /* always PrintReqCode */
584         CARD8   printReqType;           /* always X_PrintQueryScreens */
585         CARD16  length B16;
586 } xPrintQueryScreensReq;                
587 #define sz_xPrintQueryScreensReq        4
588
589 typedef struct {
590         BYTE    type;                   /* X_Reply */
591         CARD8   unused;                 /* not used */
592         CARD16  sequenceNumber B16;
593         CARD32  length B32;
594         CARD32  listCount;              /* number of screens following */
595         CARD32  pad1 B32;
596         CARD32  pad2 B32;
597         CARD32  pad3 B32;
598         CARD32  pad4 B32;
599         CARD32  pad5 B32;
600
601         /* variable portion *****************************************
602         WINDOW  rootWindow;              * root window of screen *
603         ************************************************************/
604 } xPrintQueryScreensReply;
605 #define sz_xPrintQueryScreensReply      32
606
607 typedef struct _PrintSetImageResolution {
608         CARD8   reqType;                /* always PrintReqCode */
609         CARD8   printReqType;           /* always X_PrintSetImageResolution */
610         CARD16  length B16;
611         PCONTEXT printContext B32;      /* print context */
612         CARD16 imageRes B16;            /* image resolution */
613         CARD16 pad1 B16;
614 } xPrintSetImageResolutionReq;
615 #define sz_xPrintSetImageResolutionReq  12
616
617 typedef struct {
618         BYTE    type;                   /* X_Reply */
619         BOOL    status;                 /* accepted or not */
620         CARD16  sequenceNumber B16;
621         CARD32  length B32;
622         CARD16  prevRes B16;            /* previous resolution */
623         CARD16  pad1 B32;
624         CARD32  pad2 B32;
625         CARD32  pad3 B32;
626         CARD32  pad4 B32;
627         CARD32  pad5 B32;
628         CARD32  pad6 B32;
629 } xPrintSetImageResolutionReply;
630 #define sz_xPrintSetImageResolutionReply 32
631
632 typedef struct _PrintGetImageResolution {
633         CARD8   reqType;                /* always PrintReqCode */
634         CARD8   printReqType;           /* always X_PrintGetImageResolution */
635         CARD16  length B16;
636         PCONTEXT printContext B32;      /* print context */
637 } xPrintGetImageResolutionReq;
638 #define sz_xPrintGetImageResolutionReq  8
639
640 typedef struct {
641         BYTE    type;                   /* X_Reply */
642         CARD8   unused;
643         CARD16  sequenceNumber B16;
644         CARD32  length B32;
645         CARD16  imageRes B16;           /* image resolution */
646         CARD16  pad1 B32;
647         CARD32  pad2 B32;
648         CARD32  pad3 B32;
649         CARD32  pad4 B32;
650         CARD32  pad5 B32;
651         CARD32  pad6 B32;
652 } xPrintGetImageResolutionReply;
653 #define sz_xPrintGetImageResolutionReply 32
654
655 #ifndef _XP_PRINT_SERVER_
656 /***********************************************************************
657  *
658  * Library-only definitions.
659  */
660 extern XPHinterProc  _xp_hinter_proc;
661 extern char         *_xp_hinter_desc;
662 extern int           _xp_hinter_init;
663
664 #endif /* _XP_PRINT_SERVER_ */
665
666 #ifdef _XP_PRINT_SERVER_
667 /***********************************************************************
668  *
669  * Server-only definitions shared between the extension and DDX layers.
670  *
671  */
672  
673 /*
674  * Internal return code used to indicate that the requesting
675  * client has been suspended.
676  */
677 #define Suspended 84
678
679 extern void XpRegisterPrinterScreen(
680     ScreenPtr pScreen,
681     int (*CreateContext)());
682
683 typedef struct _xpprintFuncs {
684     int (*StartJob)(); /* pContext, client */
685     int (*EndJob)(); /* pContext, client */
686     int (*StartDoc)(); /* pContext, client */
687     int (*EndDoc)(); /* pContext, client */
688     int (*StartPage)(); /* pContext, pWin, client, exposures */
689     int (*EndPage)(); /* pContext, client */
690     int (*PutDocumentData)(); /* pContext,pDraw,pData,len_data,pFmt,len_fmt,pOpt,len_opt, client */
691     int (*GetDocumentData)(); /* pContext,pData,len_data,pFmt,len_fmt,pOpt,len_opt, client */
692     int (*DestroyContext)(); /* pContext, client */
693     char *(*GetAttributes)(); /* pContext, pool */
694     char *(*GetOneAttribute)(); /* pContext, pool, attr */
695     int (*SetAttributes)(); /* pContext, pool, attrs */
696     int (*AugmentAttributes)(); /* pContext, pool, attrs */
697     int (*GetMediumDimensions)(); /* pPrintContext, pWidth, pHeight */
698     int (*GetReproducibleArea)(); /* pPrintContext, pRect */
699     int (*SetImageResolution)(); /* pPrintContext, imageRes, pStatus */
700 } XpDriverFuncs, *XpDriverFuncsPtr;
701
702 /*
703  * Each print context is represented by one of the following structs
704  * associated with a resource ID of type RTcontext .  A pointer to
705  * the context is placed in the Xp extension's devPrivates
706  * element in each client * which establishes a context via
707  * either initContext or setContext.
708  * The context pointer is also placed in the struct indicated by the
709  * RTpage resource associated with each StartPage'd window.
710  */
711 typedef struct _XpContext {
712         XID contextID;
713         char *printerName;
714         int screenNum;          /* screen containing the printer */
715         struct _XpClient *clientHead; /* list of clients */
716         CARD32 state;
717         VisualID pageWin;
718         DevUnion *devPrivates;
719         XpDriverFuncs funcs;
720         ClientPtr clientSlept;
721         int imageRes;
722 } XpContextRec, *XpContextPtr;
723
724 extern XpContextPtr XpGetPrintContext(
725     ClientPtr client);
726
727 #endif /* _XP_PRINT_SERVER_ */
728
729 _XFUNCPROTOEND
730
731 #endif /* _XpPrintstr_H_ */
732