Print.h revision 677833bc953b6cb418c701facbdcf4aa18d6c44e
/* $Xorg: Print.h,v 1.3 2000/08/18 04:05:44 coskrey Exp $ */
/******************************************************************************
******************************************************************************
**
** File: Print.h
**
** Description: Definitions needed by the server, library, and
** clients. Subportion restricted to library and
** clients.
**
** Server, Library, Client portion has:
** o All sz_* defines
** o Revision and Name defines
** o Common defines and constants (e.g. Keywords, Masks)
** o Extension version structure
**
** Library and client subportion has:
** o Convience Marcos
** o Client side data structures
** o Client side event structures (non wire)
** o Library function prototypes
** o some private stuff denoted with _whatever
**
** Printstr.h for server and library, but NOT clients.
**
******************************************************************************
**
** (c) Copyright 1996 Hewlett-Packard Company
** (c) Copyright 1996 International Business Machines Corp.
** (c) Copyright 1996 Sun Microsystems, Inc.
** (c) Copyright 1996 Novell, Inc.
** (c) Copyright 1996 Digital Equipment Corp.
** (c) Copyright 1996 Fujitsu Limited
** (c) Copyright 1996 Hitachi, Ltd.
**
** Permission is hereby granted, free of charge, to any person obtaining a copy
** of this software and associated documentation files (the "Software"), to deal
** in the Software without restriction, including without limitation the rights
** copies of the Software, and to permit persons to whom the Software is
** furnished to do so, subject to the following conditions:
**
** The above copyright notice and this permission notice shall be included in
** all copies or substantial portions of the Software.
**
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
** COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
** IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
** CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**
** Except as contained in this notice, the names of the copyright holders shall
** not be used in advertising or otherwise to promote the sale, use or other
** dealings in this Software without prior written authorization from said
** copyright holders.
**
******************************************************************************
*****************************************************************************/
/* $XFree86: xc/include/extensions/Print.h,v 1.5 2001/01/17 17:53:15 dawes Exp $ */
#ifndef _XpPrint_H_
#define _XpPrint_H_
#ifndef _XP_PRINT_SERVER_
#include <X11/Xresource.h>
#endif /* _XP_PRINT_SERVER_ */
#include <X11/Xfuncproto.h>
/******************************************************************************
*
* Definitions used by the server, library and client.
*/
/********************************************************************
*
* Naming and versioning information.
*/
#define XP_PRINTNAME "XpExtension"
/*
* Add a define below for each major extension release.
*/
#define XP_DONT_CHECK 0
#define XP_INITIAL_RELEASE 1
/*
*/
#define XP_PROTO_MAJOR 1
#define XP_PROTO_MINOR 0
/*
* Identify current version.
*/
#define XP_MAJOR_VERSION XP_PROTO_MAJOR
#define XP_MINOR_VERSION XP_PROTO_MINOR
/*
* Misc version defines.
*/
#define XP_ABSENT 0 /* Prior to XP Print support */
/********************************************************************
*
* Xp Print Error codes.
*/
#define XPBadContext 0 /* Print Context invalid or missing */
/********************************************************************
*
* Xp Print Event masks and codes.
*
*/
#define XPNoEventMask 0 /* not an event - just a null mask */
#define XPPrintMask (1L<<0)
#define XPPrintNotify 0 /* contains "detail" - see below */
#define XPStartJobNotify 0 /* value for "detail" in XPPrintNotify*/
#define XPEndJobNotify 1
#define XPStartDocNotify 2
#define XPEndDocNotify 3
#define XPStartPageNotify 4
#define XPEndPageNotify 5
/********************************************************************
*
* Xp Print Attribute Object codes (subset of ISO DPA 10175). The
* Xp Server can get and set any of the values, while the Xp Library
* may only be able to set a subset of the attribute objects.
*
* note: the codes are also used as "detail" for XPAttributeNotify
*
* note: XPPageAttr is not defined in ISO DPA 10175. It is unique
* to Xp, and its attributes are a proper subset of XPDocAttr.
*/
typedef unsigned char XPAttributes; /* type of Xp*Attr codes */
context needed */
/*
* note: ISO DPA 10175 defines a number of "attribute objects", of
* which POSIX 1387.4 and the SI Xp will only support a
* subset.
*/
/*
* Replacement rules for XpSetAttributes
*/
typedef unsigned char XPAttrReplacement;
#define XPAttrReplace 1
#define XPAttrMerge 2
/*
* Return codes for XpGetDocumentData
*/
typedef unsigned char XPGetDocStatus;
#define XPGetDocFinished 0 /* normal termination */
/*
* Save data types for XpStartJob.
*/
typedef unsigned char XPSaveData;
/*
* Document types for XpStartDoc.
*/
typedef unsigned char XPDocumentType;
/********************************************************************
*
* Xp Print Property Names
*/
#ifndef _XP_PRINT_SERVER_
/******************************************************************************
*
* Definitions used by the library and clients only.
*/
/*******************************************************************
*
* General API defines and such.
*/
/*
* Print Context for XpInitContext and related calls.
*/
/*
* Struct for XpGetPrinterList.
*/
typedef struct {
char *name; /* name */
char *desc; /* localized description */
/*
* Typedefs for XpGetDocumentData
*/
unsigned char *data,
unsigned int data_len,
/*
* Typedefs for XpSetLocaleHinter and XpGetLocaleHinter
*/
typedef char * (*XPHinterProc)(void);
#if 0
/*******************************************************************
*
* Extension version structures.
*
**** this structure is now defined localy in the one file that uses it
**** in order to avoid clashes with its definition in XI.h
*/
typedef struct {
int present;
short major_version;
short minor_version;
#endif
/********************************************************************
*
* Event structs for clients.
*
* note: these events are relative to a print context, and
* not to a window as in core X.
*/
typedef struct {
int type; /* base + XPPrintNotify */
unsigned long serial; /* # of last request processed by server */
int detail; /* XPStartJobNotify, XPEndJobNotify,
XPStartDocNotify, XPEndDocNotify,
XPStartPageNotify, XPEndPageNotify */
} XPPrintEvent;
typedef struct {
int type; /* base + XPAttributeNotify */
unsigned long serial; /* # of last request processed by server */
int detail; /* XPJobAttr, XPDocAttr, XPPageAttr,
XPPrinterAttr, XPSpoolerAttr,
XPMediumAttr, XPServerAttr */
typedef struct {
int type; /* base + XPDataReadyNotify */
unsigned long serial; /* # of last request processed by server */
unsigned long available; /* bytes available for retrieval */
/**********************************************************
*
* Function prototypes for library side.
*/
extern XPContext XpCreateContext (
char *printer_name
);
extern void XpSetContext (
);
extern XPContext XpGetContext (
);
extern void XpDestroyContext (
);
extern Screen *XpGetScreenOfContext (
);
extern Status XpGetPageDimensions (
unsigned short *width, /* return value */
unsigned short *height, /* return value */
);
extern void XpStartJob (
);
extern void XpEndJob (
);
extern void XpCancelJob (
);
extern void XpStartDoc (
);
extern void XpEndDoc (
);
extern void XpCancelDoc (
);
extern void XpPutDocumentData (
unsigned char *data,
int data_len,
char *doc_fmt,
char *options
);
extern Status XpGetDocumentData (
);
extern void XpStartPage (
);
extern void XpEndPage (
);
extern void XpCancelPage (
);
extern void XpSelectInput (
unsigned long event_mask
);
extern unsigned long XpInputSelected (
unsigned long *all_events_mask
);
extern Bool XpSetImageResolution (
int image_res,
int *prev_res
);
extern int XpGetImageResolution (
);
extern char *XpGetAttributes (
);
extern void XpSetAttributes (
char *pool,
);
extern char *XpGetOneAttribute (
char *attribute_name
);
extern XPPrinterList XpGetPrinterList (
char *printer_name,
int *list_count /* return value */
);
extern void XpFreePrinterList (
);
extern void XpRehashPrinterList (
);
extern Status XpQueryVersion (
short *major_version, /* return value */
short *minor_version /* return value */
);
extern Bool XpQueryExtension (
int *event_base_return, /* return value */
int *error_base_return /* return value */
);
extern Screen **XpQueryScreens (
int *list_count /* return value */
);
extern Status XpGetPdmStartParams (
int *format, /* return value */
unsigned char **data, /* return value */
int *nelements /* return value */
);
extern Status XpGetAuthParams (
);
extern Status XpSendAuth (
);
extern Status XpSendOneTicket (
);
extern void XpSetLocaleHinter (
char *hinter_desc
);
extern char *XpGetLocaleHinter (
);
extern char *XpGetLocaleNetString(void);
extern char *XpNotifyPdm (
);
#endif /* _XP_PRINT_SERVER_ */
#endif /* _XpPrint_H_ */