117ca54c3Smrg/* $Xorg: Printstr.h,v 1.3 2000/08/18 04:05:44 coskrey Exp $ */
217ca54c3Smrg/******************************************************************************
317ca54c3Smrg ******************************************************************************
417ca54c3Smrg **
517ca54c3Smrg ** File:         Printstr.h
617ca54c3Smrg **
717ca54c3Smrg ** Description: Definitions needed by the server and library, but
817ca54c3Smrg **              not clients.
917ca54c3Smrg **
1017ca54c3Smrg **              Print.h for server, library and clients.
1117ca54c3Smrg **
1217ca54c3Smrg ******************************************************************************
1317ca54c3Smrg **
1417ca54c3Smrg ** (c) Copyright 1996 Hewlett-Packard Company
1517ca54c3Smrg ** (c) Copyright 1996 International Business Machines Corp.
1668872e7fSmrg ** (c) Copyright 1996, Oracle and/or its affiliates.
1717ca54c3Smrg ** (c) Copyright 1996 Novell, Inc.
1817ca54c3Smrg ** (c) Copyright 1996 Digital Equipment Corp.
1917ca54c3Smrg ** (c) Copyright 1996 Fujitsu Limited
2017ca54c3Smrg ** (c) Copyright 1996 Hitachi, Ltd.
2117ca54c3Smrg **
2217ca54c3Smrg ** Permission is hereby granted, free of charge, to any person obtaining a copy
2317ca54c3Smrg ** of this software and associated documentation files (the "Software"), to deal
2417ca54c3Smrg ** in the Software without restriction, including without limitation the rights
2517ca54c3Smrg ** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2617ca54c3Smrg ** copies of the Software, and to permit persons to whom the Software is
2717ca54c3Smrg ** furnished to do so, subject to the following conditions:
2817ca54c3Smrg **
2917ca54c3Smrg ** The above copyright notice and this permission notice shall be included in
3017ca54c3Smrg ** all copies or substantial portions of the Software.
3117ca54c3Smrg **
3217ca54c3Smrg ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
3317ca54c3Smrg ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
3417ca54c3Smrg ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
3517ca54c3Smrg ** COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
3617ca54c3Smrg ** IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
3717ca54c3Smrg ** CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3817ca54c3Smrg **
3917ca54c3Smrg ** Except as contained in this notice, the names of the copyright holders shall
4017ca54c3Smrg ** not be used in advertising or otherwise to promote the sale, use or other
4117ca54c3Smrg ** dealings in this Software without prior written authorization from said
4217ca54c3Smrg ** copyright holders.
4317ca54c3Smrg **
4417ca54c3Smrg ******************************************************************************
4517ca54c3Smrg *****************************************************************************/
4617ca54c3Smrg/* $XFree86: xc/include/extensions/Printstr.h,v 1.5 2001/08/01 00:44:35 tsi Exp $ */
4717ca54c3Smrg
4817ca54c3Smrg
4917ca54c3Smrg#ifndef _XpPrintstr_H_
5017ca54c3Smrg#define _XpPrintstr_H_
5117ca54c3Smrg
5217ca54c3Smrg/*
5317ca54c3Smrg * NEED_EVENTS and NEED_REPLIES are hacks to limit the linker symbol-table
5417ca54c3Smrg * size.   When function prototypes are needed from Print.h, this sets up
5517ca54c3Smrg * a cascading dependency on Printstr.h and eventually Xproto.h to provide
5617ca54c3Smrg * the event and reply struct definitions.
5717ca54c3Smrg */
5817ca54c3Smrg#ifndef NEED_EVENTS
5917ca54c3Smrg#define NEED_EVENTS
6017ca54c3Smrg#endif /* NEED_EVENTS */
6117ca54c3Smrg
6217ca54c3Smrg#define NEED_REPLIES
6317ca54c3Smrg
6417ca54c3Smrg#include <X11/Xproto.h>
6517ca54c3Smrg#ifndef _XP_PRINT_SERVER_
6617ca54c3Smrg#include <X11/Xlib.h>
6717ca54c3Smrg#endif /* _XP_PRINT_SERVER_ */
6817ca54c3Smrg
6917ca54c3Smrg/*
7017ca54c3Smrg * Pull in other definitions.  Print.h will hide some things if we're
7117ca54c3Smrg * doing server side work.
7217ca54c3Smrg */
7317ca54c3Smrg#include <X11/extensions/Print.h>
7417ca54c3Smrg
7517ca54c3Smrg#include <X11/Xfuncproto.h>
7617ca54c3Smrg
7717ca54c3Smrg_XFUNCPROTOBEGIN
7817ca54c3Smrg
7917ca54c3Smrg/******************************************************************************
8017ca54c3Smrg *
8117ca54c3Smrg * Protocol requests constants and alignment values
8217ca54c3Smrg *
8317ca54c3Smrg * Note: Xlib macro's expect X_ABC where ABC is the name of the
8417ca54c3Smrg * protocol request.
8517ca54c3Smrg */
8617ca54c3Smrg#define X_PrintQueryVersion		0
8717ca54c3Smrg#define X_PrintGetPrinterList		1
8817ca54c3Smrg#define X_PrintCreateContext		2
8917ca54c3Smrg#define X_PrintSetContext		3
9017ca54c3Smrg#define X_PrintGetContext		4
9117ca54c3Smrg#define X_PrintDestroyContext		5
9217ca54c3Smrg#define X_PrintGetContextScreen		6
9317ca54c3Smrg#define X_PrintStartJob			7
9417ca54c3Smrg#define X_PrintEndJob			8
9517ca54c3Smrg#define X_PrintStartDoc			9
9617ca54c3Smrg#define X_PrintEndDoc			10
9717ca54c3Smrg#define X_PrintPutDocumentData		11
9817ca54c3Smrg#define X_PrintGetDocumentData		12
9917ca54c3Smrg#define X_PrintStartPage		13
10017ca54c3Smrg#define X_PrintEndPage			14
10117ca54c3Smrg#define X_PrintSelectInput		15
10217ca54c3Smrg#define X_PrintInputSelected		16
10317ca54c3Smrg#define X_PrintGetAttributes		17
10417ca54c3Smrg#define X_PrintSetAttributes		18
10517ca54c3Smrg#define X_PrintGetOneAttribute		19
10617ca54c3Smrg#define X_PrintRehashPrinterList	20
10717ca54c3Smrg#define X_PrintGetPageDimensions	21
10817ca54c3Smrg#define X_PrintQueryScreens		22
10917ca54c3Smrg#define X_PrintSetImageResolution	23
11017ca54c3Smrg#define X_PrintGetImageResolution	24
11117ca54c3Smrg
11217ca54c3Smrg/********************************************************************
11317ca54c3Smrg *
11417ca54c3Smrg * Protocol data types
11517ca54c3Smrg */
11617ca54c3Smrg#define PCONTEXT CARD32
11717ca54c3Smrg#define WINDOW   CARD32
11817ca54c3Smrg#define DRAWABLE CARD32
11917ca54c3Smrg#define BITMASK  CARD32
12017ca54c3Smrg
12117ca54c3Smrg/******************************************************************************
12217ca54c3Smrg *
12317ca54c3Smrg * Event wire struct definitions
12417ca54c3Smrg *
12517ca54c3Smrg * Note: Xlib macro's expect xABC struct names and sz_xABC size
12617ca54c3Smrg * constants where ABC is the name of the protocol request.
12717ca54c3Smrg */
12817ca54c3Smrg
12917ca54c3Smrg
13017ca54c3Smrg/*********************************************************************
13117ca54c3Smrg *
13217ca54c3Smrg * Events.
13317ca54c3Smrg *
13417ca54c3Smrg * See Print.h for the protocol "type" values.
13517ca54c3Smrg */
13617ca54c3Smrgtypedef struct _xPrintPrintEvent {
13717ca54c3Smrg	BYTE type;		/* XPPrintNotify + extEntry->eventBase */
13817ca54c3Smrg	BYTE detail;		/* XPStartJobNotify, XPEndJobNotify,
13917ca54c3Smrg				   XPStartDocNotify, XPEndDocNotify,
14017ca54c3Smrg				   XPStartPageNotify, XPEndPageNotify */
141ea1d6981Smrg	CARD16 sequenceNumber;
142ea1d6981Smrg	PCONTEXT printContext;	/* print context */
14317ca54c3Smrg	BOOL   cancel;		/* canceled flag */
14417ca54c3Smrg	CARD8  pad1;		/* rest is unused */
145ea1d6981Smrg	CARD16 pad2;
146ea1d6981Smrg	CARD32 pad3;
147ea1d6981Smrg	CARD32 pad4;
148ea1d6981Smrg	CARD32 pad5;
149ea1d6981Smrg	CARD32 pad6;
150ea1d6981Smrg	CARD32 pad7;
15117ca54c3Smrg} xPrintPrintEvent;
15217ca54c3Smrg#define sz_xPrintPrintEvent 32;
15317ca54c3Smrg
15417ca54c3Smrgtypedef struct _xPrintAttributeEvent {
15517ca54c3Smrg	BYTE   type;		/* XPAttributeNotify + extEntry->eventBase */
15617ca54c3Smrg	BYTE   detail;		/* XPJobAttr, XPDocAttr, XPPageAttr,
15717ca54c3Smrg				   XPPrinterAttr, XPSpoolerAttr,
15817ca54c3Smrg				   XPMediumAttr, XPServerAttr */
159ea1d6981Smrg	CARD16 sequenceNumber;
160ea1d6981Smrg	PCONTEXT printContext;	/* print context */
161ea1d6981Smrg	CARD32 pad1;
162ea1d6981Smrg	CARD32 pad2;
163ea1d6981Smrg	CARD32 pad3;
164ea1d6981Smrg	CARD32 pad4;
165ea1d6981Smrg	CARD32 pad5;
166ea1d6981Smrg	CARD32 pad6;
16717ca54c3Smrg} xPrintAttributeEvent;
16817ca54c3Smrg#define sz_xPrintAttributeEvent 32;
16917ca54c3Smrg
17017ca54c3Smrg
17117ca54c3Smrg/*********************************************************************
17217ca54c3Smrg *
17317ca54c3Smrg * Requests
17417ca54c3Smrg */
17517ca54c3Smrgtypedef struct _PrintQueryVersion {
17617ca54c3Smrg	CARD8	reqType;		/* always PrintReqCode */
17717ca54c3Smrg	CARD8	printReqType;		/* always X_PrintQueryVersion */
178ea1d6981Smrg	CARD16	length;
17917ca54c3Smrg} xPrintQueryVersionReq;
18017ca54c3Smrg#define sz_xPrintQueryVersionReq	4
18117ca54c3Smrg
18217ca54c3Smrgtypedef struct {
18317ca54c3Smrg	BYTE	type;			/* X_Reply */
18417ca54c3Smrg	CARD8	unused;			/* not used */
185ea1d6981Smrg	CARD16	sequenceNumber;
186ea1d6981Smrg	CARD32	length;
187ea1d6981Smrg	CARD16	majorVersion;		/* major version of Xp protocol */
188ea1d6981Smrg	CARD16	minorVersion;		/* minor version of Xp protocol */
189ea1d6981Smrg	CARD32	pad1;
190ea1d6981Smrg	CARD32	pad2;
191ea1d6981Smrg	CARD32	pad3;
192ea1d6981Smrg	CARD32	pad4;
193ea1d6981Smrg	CARD32	pad5;
19417ca54c3Smrg} xPrintQueryVersionReply;
19517ca54c3Smrg#define sz_xPrintQueryVersionReply	32
19617ca54c3Smrg
19717ca54c3Smrg
19817ca54c3Smrgtypedef struct _PrintGetPrinterList {
19917ca54c3Smrg	CARD8	reqType;		/* always PrintReqCode */
20017ca54c3Smrg	CARD8	printReqType;		/* always X_PrintGetPrinterList */
201ea1d6981Smrg	CARD16	length;
202ea1d6981Smrg	CARD32	printerNameLen;		/* length of printer name */
203ea1d6981Smrg	CARD32	localeLen;		/* length of locale string */
20417ca54c3Smrg
20517ca54c3Smrg	/* variable portion *****************************************
20617ca54c3Smrg	STRING8	printerName;		 * printer name *
20717ca54c3Smrg	BYTE	pad(printerNameLen)	 * unused *
20817ca54c3Smrg	STRING8	locale;			 * locale *
20917ca54c3Smrg	BYTE	pad(localeLen)		 * unused *
21017ca54c3Smrg	************************************************************/
21117ca54c3Smrg} xPrintGetPrinterListReq;
21217ca54c3Smrg#define sz_xPrintGetPrinterListReq	12
21317ca54c3Smrg
21417ca54c3Smrgtypedef struct {
21517ca54c3Smrg	BYTE	type;			/* X_Reply */
21617ca54c3Smrg	CARD8	unused;			/* not used */
217ea1d6981Smrg	CARD16	sequenceNumber;
218ea1d6981Smrg	CARD32	length;
219ea1d6981Smrg	CARD32	listCount;		/* of PRINTER recs below */
220ea1d6981Smrg	CARD32	pad1;
221ea1d6981Smrg	CARD32	pad2;
222ea1d6981Smrg	CARD32	pad3;
223ea1d6981Smrg	CARD32	pad4;
224ea1d6981Smrg	CARD32	pad5;
22517ca54c3Smrg
22617ca54c3Smrg	/* variable portion *****************************************
227ea1d6981Smrg	CARD32	nameLen;		* length of name in bytes *
22817ca54c3Smrg	STRING8	name;			* name *
22917ca54c3Smrg	BYTE	pad(nameLen)		* unused *
23017ca54c3Smrg
231ea1d6981Smrg	CARD32	descLen;		* length of desc in bytes *
23217ca54c3Smrg	STRING8	desc;			* localized description *
23317ca54c3Smrg	BYTE	pad(descLen)		* unused *
23417ca54c3Smrg	************************************************************/
23517ca54c3Smrg} xPrintGetPrinterListReply;
23617ca54c3Smrg#define sz_xPrintGetPrinterListReply	32
23717ca54c3Smrg
23817ca54c3Smrg
23917ca54c3Smrgtypedef struct _PrintRehashPrinterList {
24017ca54c3Smrg	CARD8	reqType;		/* always PrintReqCode */
24117ca54c3Smrg	CARD8	printReqType;		/* always X_PrintRehashPrinterList */
242ea1d6981Smrg	CARD16	length;
24317ca54c3Smrg} xPrintRehashPrinterListReq;
24417ca54c3Smrg#define sz_xPrintRehashPrinterListReq	4
24517ca54c3Smrg
24617ca54c3Smrg
24717ca54c3Smrgtypedef struct _PrintCreateContext {
24817ca54c3Smrg	CARD8	reqType;		/* always PrintReqCode */
24917ca54c3Smrg	CARD8	printReqType;		/* always X_PrintInitSetContext */
250ea1d6981Smrg	CARD16	length;
251ea1d6981Smrg	CARD32	contextID;		/* ID for context */
252ea1d6981Smrg	CARD32	printerNameLen;		/* length of printerName in bytes */
253ea1d6981Smrg	CARD32	localeLen;		/* length of locale in bytes */
25417ca54c3Smrg
25517ca54c3Smrg	/* variable portion *****************************************
25617ca54c3Smrg	STRING8	printerName		 * printer name *
25717ca54c3Smrg	BYTE	pad(printerNameLen)	 * unused *
25817ca54c3Smrg	STRING8	locale			 * locale *
25917ca54c3Smrg	BYTE	pad(locale)		 * unused *
26017ca54c3Smrg	************************************************************/
26117ca54c3Smrg} xPrintCreateContextReq;
26217ca54c3Smrg#define sz_xPrintCreateContextReq	16
26317ca54c3Smrg
26417ca54c3Smrg
26517ca54c3Smrgtypedef struct _PrintSetContext {
26617ca54c3Smrg	CARD8	reqType;		/* always PrintReqCode */
26717ca54c3Smrg	CARD8	printReqType;		/* always X_PrintSetContext */
268ea1d6981Smrg	CARD16	length;
269ea1d6981Smrg	PCONTEXT printContext;		/* print context */
27017ca54c3Smrg} xPrintSetContextReq;
27117ca54c3Smrg#define sz_xPrintSetContextReq		8
27217ca54c3Smrg
27317ca54c3Smrg
27417ca54c3Smrgtypedef struct _PrintGetContext {
27517ca54c3Smrg	CARD8	reqType;		/* always PrintReqCode */
27617ca54c3Smrg	CARD8	printReqType;		/* always X_PrintGetContext */
277ea1d6981Smrg	CARD16	length;
27817ca54c3Smrg} xPrintGetContextReq;
27917ca54c3Smrg#define sz_xPrintGetContextReq		4
28017ca54c3Smrg
28117ca54c3Smrgtypedef struct {
28217ca54c3Smrg	BYTE	type;			/* X_Reply */
28317ca54c3Smrg	CARD8	unused;			/* not used */
284ea1d6981Smrg	CARD16	sequenceNumber;
285ea1d6981Smrg	CARD32	length;
286ea1d6981Smrg	PCONTEXT printContext;		/* print context */
287ea1d6981Smrg	CARD32	pad1;
288ea1d6981Smrg	CARD32	pad2;
289ea1d6981Smrg	CARD32	pad3;
290ea1d6981Smrg	CARD32	pad4;
291ea1d6981Smrg	CARD32	pad5;
29217ca54c3Smrg} xPrintGetContextReply;
29317ca54c3Smrg#define sz_xPrintGetContextReply	32
29417ca54c3Smrg
29517ca54c3Smrg
29617ca54c3Smrgtypedef struct _PrintDestroyContext {
29717ca54c3Smrg	CARD8	reqType;		/* always PrintReqCode */
29817ca54c3Smrg	CARD8	printReqType;		/* always X_PrintDestroyContext */
299ea1d6981Smrg	CARD16	length;
300ea1d6981Smrg	PCONTEXT printContext;		/* print context */
30117ca54c3Smrg} xPrintDestroyContextReq;
30217ca54c3Smrg#define sz_xPrintDestroyContextReq	8
30317ca54c3Smrg
30417ca54c3Smrg
30517ca54c3Smrgtypedef struct _PrintGetContextScreen {
30617ca54c3Smrg	CARD8	reqType;		/* always PrintReqCode */
30717ca54c3Smrg	CARD8	printReqType;		/* always X_PrintGetContextScreen */
308ea1d6981Smrg	CARD16	length;
309ea1d6981Smrg	PCONTEXT printContext;		/* print context */
31017ca54c3Smrg} xPrintGetContextScreenReq;
31117ca54c3Smrg#define sz_xPrintGetContextScreenReq	8
31217ca54c3Smrg
31317ca54c3Smrgtypedef struct {
31417ca54c3Smrg	BYTE	type;			/* X_Reply */
31517ca54c3Smrg	CARD8	unused;			/* not used */
316ea1d6981Smrg	CARD16	sequenceNumber;
317ea1d6981Smrg	CARD32	length;
31817ca54c3Smrg	WINDOW  rootWindow;		/* screenPtr represented as rootWin */
319ea1d6981Smrg	CARD32	pad1;
320ea1d6981Smrg	CARD32	pad2;
321ea1d6981Smrg	CARD32	pad3;
322ea1d6981Smrg	CARD32	pad4;
323ea1d6981Smrg	CARD32	pad5;
32417ca54c3Smrg} xPrintGetContextScreenReply;
32517ca54c3Smrg#define sz_xPrintGetContextScreenReply	32
32617ca54c3Smrg
32717ca54c3Smrg
32817ca54c3Smrgtypedef struct _PrintStartJob {
32917ca54c3Smrg	CARD8	reqType;		/* always PrintReqCode */
33017ca54c3Smrg	CARD8	printReqType;		/* always X_PrintStartJob */
331ea1d6981Smrg	CARD16	length;
33217ca54c3Smrg	CARD8	saveData;		/* save data boolean */
33317ca54c3Smrg	CARD8	pad1;
334ea1d6981Smrg	CARD16	pad2;
33517ca54c3Smrg} xPrintStartJobReq;
33617ca54c3Smrg#define sz_xPrintStartJobReq		8
33717ca54c3Smrg
33817ca54c3Smrgtypedef struct _PrintEndJob {
33917ca54c3Smrg	CARD8	reqType;		/* always PrintReqCode */
34017ca54c3Smrg	CARD8	printReqType;		/* always X_PrintEndJob */
341ea1d6981Smrg	CARD16	length;
34217ca54c3Smrg	BOOL	cancel;			/* cancel boolean */
34317ca54c3Smrg	CARD8	pad1;
344ea1d6981Smrg	CARD16	pad2;
34517ca54c3Smrg} xPrintEndJobReq;
34617ca54c3Smrg#define sz_xPrintEndJobReq		8
34717ca54c3Smrg
34817ca54c3Smrg
34917ca54c3Smrgtypedef struct _PrintStartDoc {
35017ca54c3Smrg	CARD8	reqType;		/* always PrintReqCode */
35117ca54c3Smrg	CARD8	printReqType;		/* always X_PrintStartDoc */
352ea1d6981Smrg	CARD16	length;
35317ca54c3Smrg	CARD8	type;			/* type for document */
35417ca54c3Smrg	CARD8	pad1;
355ea1d6981Smrg	CARD16	pad2;
35617ca54c3Smrg} xPrintStartDocReq;
35717ca54c3Smrg#define sz_xPrintStartDocReq		8
35817ca54c3Smrg
35917ca54c3Smrgtypedef struct _PrintEndDoc {
36017ca54c3Smrg	CARD8	reqType;		/* always PrintReqCode */
36117ca54c3Smrg	CARD8	printReqType;		/* always X_PrintEndDoc */
362ea1d6981Smrg	CARD16	length;
36317ca54c3Smrg	BOOL	cancel;			/* cancel boolean */
36417ca54c3Smrg	CARD8	pad1;
365ea1d6981Smrg	CARD16	pad2;
36617ca54c3Smrg} xPrintEndDocReq;
36717ca54c3Smrg#define sz_xPrintEndDocReq		8
36817ca54c3Smrg
36917ca54c3Smrg
37017ca54c3Smrgtypedef struct _PrintPutDocumentData {
37117ca54c3Smrg	CARD8	reqType;		/* always PrintReqCode */
37217ca54c3Smrg	CARD8	printReqType;		/* always X_PrintPutDocumentData */
373ea1d6981Smrg	CARD16	length;
374ea1d6981Smrg	DRAWABLE drawable;		/* target drawable */
375ea1d6981Smrg	CARD32	len_data;		/* big len in bytes */
37617ca54c3Smrg	CARD16	len_fmt;		/* len in bytes */
37717ca54c3Smrg	CARD16	len_options;		/* len in bytes */
37817ca54c3Smrg
37917ca54c3Smrg	/* variable portion *****************************************
38017ca54c3Smrg	LISTofBYTE	data;		 * data *
38117ca54c3Smrg	BYTE		pad(len_data)	 * unused *
38217ca54c3Smrg	STRING8		doc_fmt;	 * ISO compliant desc of data type *
38317ca54c3Smrg	BYTE		pad(len_fmt)	 * unused *
38417ca54c3Smrg	STRING8		options;	 * additional device-dependent desc *
38517ca54c3Smrg	BYTE		pad(len_options) * unused *
38617ca54c3Smrg	************************************************************/
38717ca54c3Smrg} xPrintPutDocumentDataReq;
38817ca54c3Smrg#define sz_xPrintPutDocumentDataReq	16
38917ca54c3Smrg
39017ca54c3Smrg
39117ca54c3Smrgtypedef struct _PrintGetDocumentData {
39217ca54c3Smrg	CARD8	reqType;		/* always PrintReqCode */
39317ca54c3Smrg	CARD8	printReqType;		/* always X_PrintGetDocumentData */
394ea1d6981Smrg	CARD16	length;
395ea1d6981Smrg	PCONTEXT printContext;		/* print context */
396ea1d6981Smrg	CARD32	maxBufferSize;		/* maximum buffer size requested */
39717ca54c3Smrg} xPrintGetDocumentDataReq;
39817ca54c3Smrg#define sz_xPrintGetDocumentDataReq	12
39917ca54c3Smrg
40017ca54c3Smrgtypedef struct {
40117ca54c3Smrg	BYTE	type;			/* X_Reply */
40217ca54c3Smrg	CARD8	unused;			/* not used */
403ea1d6981Smrg	CARD16	sequenceNumber;
404ea1d6981Smrg	CARD32	length;
405ea1d6981Smrg	CARD32	statusCode;		/* status code for reply */
406ea1d6981Smrg	CARD32	finishedFlag;		/* is this the last reply */
407ea1d6981Smrg	CARD32	dataLen;		/* data length */
408ea1d6981Smrg	CARD32	pad1;
409ea1d6981Smrg	CARD32	pad2;
410ea1d6981Smrg	CARD32	pad3;
41117ca54c3Smrg
41217ca54c3Smrg	/* variable portion *****************************************
41317ca54c3Smrg	LISTofBYTE	data;		 * data *
41417ca54c3Smrg	BYTE		pad(count)	 * unused *
41517ca54c3Smrg	************************************************************/
41617ca54c3Smrg} xPrintGetDocumentDataReply;
41717ca54c3Smrg#define sz_xPrintGetDocumentDataReply	32
41817ca54c3Smrg
41917ca54c3Smrg
42017ca54c3Smrgtypedef struct _PrintStartPage {
42117ca54c3Smrg	CARD8	reqType;		/* always PrintReqCode */
42217ca54c3Smrg	CARD8	printReqType;		/* always X_PrintStartPage */
423ea1d6981Smrg	CARD16	length;
424ea1d6981Smrg	WINDOW	window;			/* window */
42517ca54c3Smrg} xPrintStartPageReq;
42617ca54c3Smrg#define sz_xPrintStartPageReq		8
42717ca54c3Smrg
42817ca54c3Smrgtypedef struct _PrintEndPage {
42917ca54c3Smrg	CARD8	reqType;		/* always PrintReqCode */
43017ca54c3Smrg	CARD8	printReqType;		/* always X_PrintEndPage */
431ea1d6981Smrg	CARD16	length;
43217ca54c3Smrg	BOOL	cancel;			/* cancel boolean */
43317ca54c3Smrg	CARD8	pad1;
434ea1d6981Smrg	CARD16	pad2;
43517ca54c3Smrg} xPrintEndPageReq;
43617ca54c3Smrg#define sz_xPrintEndPageReq		8
43717ca54c3Smrg
43817ca54c3Smrg
43917ca54c3Smrgtypedef struct _PrintSelectInput {
44017ca54c3Smrg        CARD8   reqType;        	/* always PrintReqCode */
44117ca54c3Smrg	CARD8   printReqType;		/* always X_PrintSelectInput */
442ea1d6981Smrg	CARD16	length;
443ea1d6981Smrg	PCONTEXT printContext;		/* print context */
444ea1d6981Smrg	BITMASK	eventMask;
44517ca54c3Smrg} xPrintSelectInputReq;
44617ca54c3Smrg#define sz_xPrintSelectInputReq		12
44717ca54c3Smrg
44817ca54c3Smrg
44917ca54c3Smrgtypedef struct _PrintInputSelected {
45017ca54c3Smrg        CARD8   reqType;        	/* always PrintReqCode */
45117ca54c3Smrg	CARD8   printReqType;		/* always X_PrintInputSelected */
452ea1d6981Smrg	CARD16	length;
453ea1d6981Smrg	PCONTEXT printContext;		/* print context */
45417ca54c3Smrg} xPrintInputSelectedReq;
45517ca54c3Smrg#define sz_xPrintInputSelectedReq	8
45617ca54c3Smrg
45717ca54c3Smrgtypedef struct {
45817ca54c3Smrg	BYTE	type;			/* X_Reply */
45917ca54c3Smrg	CARD8	unused;			/* not used */
460ea1d6981Smrg	CARD16	sequenceNumber;
461ea1d6981Smrg	CARD32	length;
462ea1d6981Smrg	BITMASK	eventMask;		/* your event mask */
463ea1d6981Smrg	BITMASK	allEventsMask;		/* all event mask */
464ea1d6981Smrg	CARD32	pad1;
465ea1d6981Smrg	CARD32	pad2;
466ea1d6981Smrg	CARD32	pad3;
467ea1d6981Smrg	CARD32	pad4;
46817ca54c3Smrg} xPrintInputSelectedReply;
46917ca54c3Smrg#define sz_xPrintInputSelectedReply	32
47017ca54c3Smrg
47117ca54c3Smrgtypedef struct _PrintGetAttributes {
47217ca54c3Smrg        CARD8   reqType;        	/* always PrintReqCode */
47317ca54c3Smrg	CARD8   printReqType;		/* always X_PrintGetAttributes */
474ea1d6981Smrg	CARD16	length;
475ea1d6981Smrg	PCONTEXT printContext;		/* print context */
47617ca54c3Smrg        CARD8   type;			/* type */
47717ca54c3Smrg        CARD8   pad1;			/* unused */
478ea1d6981Smrg        CARD16  pad2;			/* unused */
47917ca54c3Smrg} xPrintGetAttributesReq;
48017ca54c3Smrg#define sz_xPrintGetAttributesReq	12
48117ca54c3Smrg
48217ca54c3Smrgtypedef struct {
48317ca54c3Smrg	BYTE	type;			/* X_Reply */
48417ca54c3Smrg	CARD8	unused;			/* not used */
485ea1d6981Smrg	CARD16	sequenceNumber;
486ea1d6981Smrg	CARD32	length;
487ea1d6981Smrg	CARD32	stringLen;		/* length of xrm db string */
488ea1d6981Smrg	CARD32	pad1;
489ea1d6981Smrg	CARD32	pad2;
490ea1d6981Smrg	CARD32	pad3;
491ea1d6981Smrg	CARD32	pad4;
492ea1d6981Smrg	CARD32	pad5;
49317ca54c3Smrg
49417ca54c3Smrg        /* variable portion *****************************************
49517ca54c3Smrg	STRING8	string;                  * xrm db as a string *
49617ca54c3Smrg	BYTE	pad(stringLen)           * unused *
49717ca54c3Smrg        ************************************************************/
49817ca54c3Smrg} xPrintGetAttributesReply;
49917ca54c3Smrg#define sz_xPrintGetAttributesReply	32
50017ca54c3Smrg
50117ca54c3Smrg
50217ca54c3Smrgtypedef struct _PrintSetAttributes {
50317ca54c3Smrg        CARD8   reqType;        	/* always PrintReqCode */
50417ca54c3Smrg	CARD8   printReqType;		/* always X_PrintSetAttributes */
505ea1d6981Smrg	CARD16	length;
506ea1d6981Smrg	PCONTEXT printContext;		/* print context */
507ea1d6981Smrg	CARD32	stringLen;		/* length of xrm db string */
50817ca54c3Smrg        CARD8   type;                   /* type */
50917ca54c3Smrg	CARD8   rule;			/* replacement rule */
510ea1d6981Smrg	CARD16  pad1;			/* unused */
51117ca54c3Smrg
51217ca54c3Smrg        /* variable portion *****************************************
51317ca54c3Smrg	STRING8	string;                  * xrm db as a string *
51417ca54c3Smrg	BYTE	pad(stringLen)           * unused *
51517ca54c3Smrg        ************************************************************/
51617ca54c3Smrg} xPrintSetAttributesReq;
51717ca54c3Smrg#define sz_xPrintSetAttributesReq	16
51817ca54c3Smrg
51917ca54c3Smrg
52017ca54c3Smrgtypedef struct _PrintGetOneAttribute {
52117ca54c3Smrg        CARD8   reqType;        	/* always PrintReqCode */
52217ca54c3Smrg	CARD8   printReqType;		/* always X_PrintGetOneAttribute */
523ea1d6981Smrg	CARD16	length;
524ea1d6981Smrg	PCONTEXT printContext;		/* print context */
52517ca54c3Smrg	CARD32	nameLen;		/* length of name string */
52617ca54c3Smrg        CARD8   type;			/* type */
52717ca54c3Smrg        CARD8   pad1;			/* unused */
528ea1d6981Smrg        CARD16  pad2;			/* unused */
52917ca54c3Smrg
53017ca54c3Smrg        /* variable portion *****************************************
53117ca54c3Smrg	STRING8	name;			 * name as a string *
53217ca54c3Smrg	BYTE	pad(name)		 * unused *
53317ca54c3Smrg        ************************************************************/
53417ca54c3Smrg} xPrintGetOneAttributeReq;
53517ca54c3Smrg#define sz_xPrintGetOneAttributeReq	16
53617ca54c3Smrg
53717ca54c3Smrgtypedef struct {
53817ca54c3Smrg	BYTE	type;			/* X_Reply */
53917ca54c3Smrg	CARD8	unused;			/* not used */
540ea1d6981Smrg	CARD16	sequenceNumber;
541ea1d6981Smrg	CARD32	length;
542ea1d6981Smrg	CARD32	valueLen;		/* length of value string */
543ea1d6981Smrg	CARD32	pad1;
544ea1d6981Smrg	CARD32	pad2;
545ea1d6981Smrg	CARD32	pad3;
546ea1d6981Smrg	CARD32	pad4;
547ea1d6981Smrg	CARD32	pad5;
54817ca54c3Smrg
54917ca54c3Smrg        /* variable portion *****************************************
55017ca54c3Smrg	STRING8	value;			 * value as a string *
55117ca54c3Smrg	BYTE	pad(value)		 * unused *
55217ca54c3Smrg        ************************************************************/
55317ca54c3Smrg} xPrintGetOneAttributeReply;
55417ca54c3Smrg#define sz_xPrintGetOneAttributeReply	32
55517ca54c3Smrg
55617ca54c3Smrg
55717ca54c3Smrgtypedef struct _PrintGetPageDimensions {
55817ca54c3Smrg	CARD8	reqType;		/* always PrintReqCode */
55917ca54c3Smrg	CARD8	printReqType;		/* always X_PrintGetPageDimensions */
560ea1d6981Smrg	CARD16	length;
561ea1d6981Smrg	PCONTEXT printContext;		/* print context */
56217ca54c3Smrg} xPrintGetPageDimensionsReq;
56317ca54c3Smrg#define sz_xPrintGetPageDimensionsReq	8
56417ca54c3Smrg
56517ca54c3Smrgtypedef struct {
56617ca54c3Smrg	BYTE	type;			/* X_Reply */
56717ca54c3Smrg	CARD8	unused;			/* not used */
568ea1d6981Smrg	CARD16	sequenceNumber;
569ea1d6981Smrg	CARD32	length;
57017ca54c3Smrg	CARD16	width;			/* total pixel width */
57117ca54c3Smrg	CARD16	height;			/* total pixel height */
572d63b911fSmrg	CARD16	rx;			/* reproducible x pixel offset */
573d63b911fSmrg	CARD16	ry;			/* reproducible y pixel offset */
574d63b911fSmrg	CARD16	rwidth;			/* reproducible x pixel width */
575d63b911fSmrg	CARD16	rheight;		/* reproducible y pixel width */
576ea1d6981Smrg	CARD32	pad1;
577ea1d6981Smrg	CARD32	pad2;
578ea1d6981Smrg	CARD32	pad3;
57917ca54c3Smrg} xPrintGetPageDimensionsReply;
58017ca54c3Smrg#define sz_xPrintGetPageDimensionsReply	32
58117ca54c3Smrg
58217ca54c3Smrg
58317ca54c3Smrgtypedef struct _PrintQueryScreens {
58417ca54c3Smrg	CARD8	reqType;		/* always PrintReqCode */
58517ca54c3Smrg	CARD8	printReqType;		/* always X_PrintQueryScreens */
586ea1d6981Smrg	CARD16	length;
58717ca54c3Smrg} xPrintQueryScreensReq;
58817ca54c3Smrg#define sz_xPrintQueryScreensReq	4
58917ca54c3Smrg
59017ca54c3Smrgtypedef struct {
59117ca54c3Smrg	BYTE	type;			/* X_Reply */
59217ca54c3Smrg	CARD8	unused;			/* not used */
593ea1d6981Smrg	CARD16	sequenceNumber;
594ea1d6981Smrg	CARD32	length;
59517ca54c3Smrg	CARD32	listCount;		/* number of screens following */
596ea1d6981Smrg	CARD32	pad1;
597ea1d6981Smrg	CARD32	pad2;
598ea1d6981Smrg	CARD32	pad3;
599ea1d6981Smrg	CARD32	pad4;
600ea1d6981Smrg	CARD32	pad5;
60117ca54c3Smrg
60217ca54c3Smrg        /* variable portion *****************************************
60317ca54c3Smrg	WINDOW	rootWindow;		 * root window of screen *
60417ca54c3Smrg        ************************************************************/
60517ca54c3Smrg} xPrintQueryScreensReply;
60617ca54c3Smrg#define sz_xPrintQueryScreensReply	32
60717ca54c3Smrg
60817ca54c3Smrgtypedef struct _PrintSetImageResolution {
60917ca54c3Smrg	CARD8	reqType;		/* always PrintReqCode */
61017ca54c3Smrg	CARD8	printReqType;		/* always X_PrintSetImageResolution */
611ea1d6981Smrg	CARD16	length;
612ea1d6981Smrg	PCONTEXT printContext;		/* print context */
613ea1d6981Smrg	CARD16 imageRes;		/* image resolution */
614ea1d6981Smrg	CARD16 pad1;
61517ca54c3Smrg} xPrintSetImageResolutionReq;
61617ca54c3Smrg#define sz_xPrintSetImageResolutionReq	12
61717ca54c3Smrg
61817ca54c3Smrgtypedef struct {
61917ca54c3Smrg	BYTE	type;			/* X_Reply */
62017ca54c3Smrg	BOOL	status;			/* accepted or not */
621ea1d6981Smrg	CARD16	sequenceNumber;
622ea1d6981Smrg	CARD32	length;
623ea1d6981Smrg	CARD16	prevRes;		/* previous resolution */
624ea1d6981Smrg	CARD16	pad1;
625ea1d6981Smrg	CARD32	pad2;
626ea1d6981Smrg	CARD32	pad3;
627ea1d6981Smrg	CARD32	pad4;
628ea1d6981Smrg	CARD32	pad5;
629ea1d6981Smrg	CARD32	pad6;
63017ca54c3Smrg} xPrintSetImageResolutionReply;
63117ca54c3Smrg#define sz_xPrintSetImageResolutionReply 32
63217ca54c3Smrg
63317ca54c3Smrgtypedef struct _PrintGetImageResolution {
63417ca54c3Smrg	CARD8	reqType;		/* always PrintReqCode */
63517ca54c3Smrg	CARD8	printReqType;		/* always X_PrintGetImageResolution */
636ea1d6981Smrg	CARD16	length;
637ea1d6981Smrg	PCONTEXT printContext;		/* print context */
63817ca54c3Smrg} xPrintGetImageResolutionReq;
63917ca54c3Smrg#define sz_xPrintGetImageResolutionReq	8
64017ca54c3Smrg
64117ca54c3Smrgtypedef struct {
64217ca54c3Smrg	BYTE	type;			/* X_Reply */
64317ca54c3Smrg	CARD8	unused;
644ea1d6981Smrg	CARD16	sequenceNumber;
645ea1d6981Smrg	CARD32	length;
646ea1d6981Smrg	CARD16	imageRes;		/* image resolution */
647ea1d6981Smrg	CARD16	pad1;
648ea1d6981Smrg	CARD32	pad2;
649ea1d6981Smrg	CARD32	pad3;
650ea1d6981Smrg	CARD32	pad4;
651ea1d6981Smrg	CARD32	pad5;
652ea1d6981Smrg	CARD32	pad6;
65317ca54c3Smrg} xPrintGetImageResolutionReply;
65417ca54c3Smrg#define sz_xPrintGetImageResolutionReply 32
65517ca54c3Smrg
65617ca54c3Smrg#ifndef _XP_PRINT_SERVER_
65717ca54c3Smrg/***********************************************************************
65817ca54c3Smrg *
65917ca54c3Smrg * Library-only definitions.
66017ca54c3Smrg */
66117ca54c3Smrgextern XPHinterProc  _xp_hinter_proc;
66217ca54c3Smrgextern char         *_xp_hinter_desc;
66317ca54c3Smrgextern int           _xp_hinter_init;
66417ca54c3Smrg
66517ca54c3Smrg#else /* _XP_PRINT_SERVER_ */
66617ca54c3Smrg
66717ca54c3Smrg/***********************************************************************
66817ca54c3Smrg *
66917ca54c3Smrg * Server-only definitions shared between the extension and DDX layers.
67017ca54c3Smrg *
67117ca54c3Smrg */
67217ca54c3Smrg
67317ca54c3Smrg/*
67417ca54c3Smrg * Internal return code used to indicate that the requesting
67517ca54c3Smrg * client has been suspended.
67617ca54c3Smrg */
67717ca54c3Smrg#define Suspended 84
67817ca54c3Smrg
67917ca54c3Smrgstruct _XpContext;
68017ca54c3Smrg
68117ca54c3Smrgextern void XpRegisterPrinterScreen(
68217ca54c3Smrg    ScreenPtr pScreen,
68317ca54c3Smrg    int (*CreateContext)(struct _XpContext *));
68417ca54c3Smrg
68517ca54c3Smrgtypedef struct _xpprintFuncs {
68617ca54c3Smrg    int (*StartJob)(
68717ca54c3Smrg	struct _XpContext *	/* pContext */,
68817ca54c3Smrg	Bool			/* sendClientData */,
68917ca54c3Smrg	ClientPtr		/* client */);
69017ca54c3Smrg    int (*EndJob)(struct _XpContext *, int);
69117ca54c3Smrg    int (*StartDoc)(
69217ca54c3Smrg	struct _XpContext *	/* pContext */,
69317ca54c3Smrg	XPDocumentType		/* type */);
69417ca54c3Smrg    int (*EndDoc)(struct _XpContext *, int);
69517ca54c3Smrg    int (*StartPage)(
69617ca54c3Smrg	struct _XpContext *	/* pContext */,
69717ca54c3Smrg	WindowPtr		/* pWin */);
69817ca54c3Smrg    int (*EndPage)(
69917ca54c3Smrg	struct _XpContext *	/* pContext */,
70017ca54c3Smrg	WindowPtr		/* pWin */);
70117ca54c3Smrg    int (*PutDocumentData)(
70217ca54c3Smrg	struct _XpContext *	/* pContext */,
70317ca54c3Smrg    	DrawablePtr		/* pDraw */,
70417ca54c3Smrg	char *			/* pData */,
70517ca54c3Smrg	int			/* len_data */,
70617ca54c3Smrg	char *			/* pDoc_fmt */,
70717ca54c3Smrg	int			/* len_fmt */,
70817ca54c3Smrg	char *			/* pOptions */,
70917ca54c3Smrg	int			/* len_options */,
71017ca54c3Smrg	ClientPtr		/* client */);
71117ca54c3Smrg    int (*GetDocumentData)(
71217ca54c3Smrg	struct _XpContext *	/* pContext */,
71317ca54c3Smrg	ClientPtr		/* client */,
71417ca54c3Smrg	int			/* maxBufferSize */);
71517ca54c3Smrg    int (*DestroyContext)(
71617ca54c3Smrg	struct _XpContext *);	/* pContext */
71717ca54c3Smrg    char *(*GetAttributes)(
71817ca54c3Smrg	struct _XpContext *,
71917ca54c3Smrg	XPAttributes 		/* pool */);
72017ca54c3Smrg    char *(*GetOneAttribute)(
72117ca54c3Smrg	struct _XpContext *	/* pContext */,
72217ca54c3Smrg	XPAttributes 		/* pool */,
72317ca54c3Smrg	char *			/* attrs */);
72417ca54c3Smrg    int (*SetAttributes)(
72517ca54c3Smrg	struct _XpContext *	/* pContext */,
72617ca54c3Smrg	XPAttributes 		/* pool */,
72717ca54c3Smrg	char *			/* attrs */);
72817ca54c3Smrg    int (*AugmentAttributes)(
72917ca54c3Smrg	struct _XpContext *	/* pContext */,
73017ca54c3Smrg	XPAttributes 		/* pool */,
73117ca54c3Smrg	char *			/* attrs */);
73217ca54c3Smrg    int (*GetMediumDimensions)(
73317ca54c3Smrg	struct _XpContext *	/* pPrintContext */,
73417ca54c3Smrg	CARD16 *		/* pWidth */,
73517ca54c3Smrg	CARD16 *		/* pHeight */);
73617ca54c3Smrg    int (*GetReproducibleArea)(
73717ca54c3Smrg	struct _XpContext *	/* pPrintContext */,
73817ca54c3Smrg	xRectangle *		/* pRect */);
73917ca54c3Smrg    int (*SetImageResolution)(
74017ca54c3Smrg	struct _XpContext *	/* pPrintContext */,
74117ca54c3Smrg	int			/* imageRes */,
74217ca54c3Smrg	Bool *			/* pStatus */);
74317ca54c3Smrg} XpDriverFuncs, *XpDriverFuncsPtr;
74417ca54c3Smrg
74517ca54c3Smrg/*
74617ca54c3Smrg * Each print context is represented by one of the following structs
74717ca54c3Smrg * associated with a resource ID of type RTcontext .  A pointer to
74817ca54c3Smrg * the context is placed in the Xp extension's devPrivates
74917ca54c3Smrg * element in each client * which establishes a context via
75017ca54c3Smrg * either initContext or setContext.
75117ca54c3Smrg * The context pointer is also placed in the struct indicated by the
75217ca54c3Smrg * RTpage resource associated with each StartPage'd window.
75317ca54c3Smrg */
75417ca54c3Smrgtypedef struct _XpContext {
75517ca54c3Smrg        XID contextID;
75617ca54c3Smrg        char *printerName;
75717ca54c3Smrg        int screenNum;          /* screen containing the printer */
75817ca54c3Smrg        struct _XpClient *clientHead; /* list of clients */
75917ca54c3Smrg        CARD32 state;
76017ca54c3Smrg        VisualID pageWin;
76117ca54c3Smrg        PrivateRec *devPrivates;
76217ca54c3Smrg        XpDriverFuncs funcs;
76317ca54c3Smrg	ClientPtr clientSlept;
76417ca54c3Smrg	int imageRes;
76517ca54c3Smrg} XpContextRec, *XpContextPtr;
76617ca54c3Smrg
76717ca54c3Smrg#include <X11/fonts/fontstruct.h>	/* FontResolutionPtr */
76817ca54c3Smrg
76917ca54c3Smrgextern FontResolutionPtr XpGetClientResolutions(ClientPtr, int *);
77017ca54c3Smrgextern XpContextPtr XpContextOfClient(ClientPtr);
77117ca54c3Smrgextern XpContextPtr XpGetPrintContext(ClientPtr);
77217ca54c3Smrgextern int XpRehashPrinterList(void);
77317ca54c3Smrgextern void XpSetFontResFunc(ClientPtr);
77417ca54c3Smrgextern void XpUnsetFontResFunc(ClientPtr);
77517ca54c3Smrgextern void XpRegisterInitFunc(ScreenPtr, char *, int (*)(struct _XpContext *));
77617ca54c3Smrg
77717ca54c3Smrg#endif /* _XP_PRINT_SERVER_ */
77817ca54c3Smrg
77917ca54c3Smrg_XFUNCPROTOEND
78017ca54c3Smrg
78117ca54c3Smrg#endif /* _XpPrintstr_H_ */
782