|
|
|
|
File: [XFree86 CVS] / xc / include / extensions / Print.h
(download)
Revision: 1.1.1.1 (vendor branch), Sun Dec 22 03:17:32 1996 UTC (16 years, 5 months ago) by dawes Branch: X11R6 CVS Tags: xf-3_9z, xf-3_9y, xf-3_9x, xf-3_9w, xf-3_9v, xf-3_9u, xf-3_9t, xf-3_9s, xf-3_9r, xf-3_9q, xf-3_9p, xf-3_9o, xf-3_9n, xf-3_9m, xf-3_9l, xf-3_9k, xf-3_9jw, xf-3_9jv, xf-3_9ju, xf-3_9jt, xf-3_9js, xf-3_9jr, xf-3_9jq, xf-3_9jp, xf-3_9jo, xf-3_9jn, xf-3_9jm, xf-3_9jl, xf-3_9jk, xf-3_9jj, xf-3_9ji, xf-3_9jh, xf-3_9jg, xf-3_9jf, xf-3_9je, xf-3_9jd, xf-3_9jc, xf-3_9jb, xf-3_9ja, xf-3_9j-branch, xf-3_9j, xf-3_9i, xf-3_9h, xf-3_9g, xf-3_9f, xf-3_9e, xf-3_9d, xf-3_9c, xf-3_9b, xf-3_9a, xf-3_9_16e, xf-3_9_16d, xf-3_9_16c, xf-3_9_16b, xf-3_9_16a, xf-3_9_16, xf-3_9_15d, xf-3_9_15c, xf-3_9_15b, xf-3_9_15a, xf-3_9_15, xf-3_9Py, xf-3_9Px, xf-3_9Pw, xf-3_9Pv, xf-3_9Pu, xf-3_9Pt, xf-3_9Ps, xf-3_9Pr, xf-3_9Pq, xf-3_9Pp, xf-3_9Po, xf-3_9Pn, xf-3_9Pm, xf-3_9Pl, xf-3_9Pk, xf-3_9Pj, xf-3_9Pi, xf-3_9Phb, xf-3_9Pha, xf-3_9Ph-branch, xf-3_9Ph, xf-3_9Pg, xf-3_9Pf, xf-3_9Pe, xf-3_9Pd, xf-3_9Pc, xf-3_9Pb, xf-3_9Pa, xf-3_9P, xf-3_9Nz, xf-3_9Ny, xf-3_9Nx, xf-3_9Nw, xf-3_9Nva, xf-3_9Nv-branch, xf-3_9Nv, xf-3_9Nu, xf-3_9Nt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l, xf-3_2Xk, xf-3_2Xj, xf-3_2Xi, xf-3_2Xh, xf-3_2Xg, xf-3_2Xf, xf-3_2Xe, xf-3_2Xd, xf-3_2Xc, xf-3_2Xb, xf-3_2Xa, xf-3_2At, xf-3_2As, xf-3_2Ar, xf-3_2Aq, xf-3_2Ap, xf-3_2Ao, xf-3_2An, xf-3_2Am, xf-3_2Al, xf-3_2Ak, xf-3_2Aj, xf-3_2Ai, xf-3_2Ah, xf-3_2Ag, xf-3_2Af, xf-3_2Ae, xf-3_2Ad, xf-3_2Ac, xf-3_2Ab, xf-3_2Aa, xf-3_2A, xf-39ja, xf-3331_shark, seq-4321, seq-4316, seq-4304, seq-4282, X11R6-4_3, X11R6-4_2, X11R6-4_1, X11R6-4_0, X11R6-3_2, X11R6-3_1, X11R6-3_0 Branch point for: xf-3_3-branch, xf-3_2A-branch Changes since 1.1: +0 -0 lines X11R6 pre-R6.3 seq-4282 |
/* $XConsortium: Print.h /main/3 1996/12/10 14:59:02 rws $ */
/******************************************************************************
******************************************************************************
**
** 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
** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
** 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.
**
******************************************************************************
*****************************************************************************/
#ifndef _XpPrint_H_
#define _XpPrint_H_
#ifndef _XP_PRINT_SERVER_
#include <X11/Xlib.h>
#include <X11/Xresource.h>
#include <X11/Xauth.h>
#endif /* _XP_PRINT_SERVER_ */
#include <X11/Xfuncproto.h>
_XFUNCPROTOBEGIN
/******************************************************************************
*
* 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
/*
* For each single entry above, create one major/minor pair.
*/
#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 */
#define XP_PRESENT 1 /* With XP Print support */
/********************************************************************
*
* Xp Print Error codes.
*/
#define XP_ERRORS 3 /* number of error types */
#define XPBadContext 0 /* Print Context invalid or missing */
#define XPBadSequence 1 /* Illegal sequence of XP operations */
#define XPBadResourceID 2 /* X-resource not valid */
/********************************************************************
*
* Xp Print Event masks and codes.
*
*/
#define XP_EVENTS 2 /* number of event types */
#define XPNoEventMask 0 /* not an event - just a null mask */
#define XPPrintMask (1L<<0)
#define XPAttributeMask (1L<<1)
#define XPPrintNotify 0 /* contains "detail" - see below */
#define XPAttributeNotify 1 /* 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 */
#define XP_ATTRIBUTES 5 /* those attrs currently supported */
#define XPJobAttr 1 /* get/set */
#define XPDocAttr 2 /* get/set */
#define XPPageAttr 3 /* get/set - subset of XPDocAttr */
#define XPPrinterAttr 4 /* get only (library) */
#define XPServerAttr 5 /* get only (library), no
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.
*/
#define XPMediumAttr 6 /* DPA-Object Medium */
#define XPFontAttr 7 /* DPA-Object Font */
#define XPResAttr 8 /* DPA-Object Resource */
#define XPTransAttr 9 /* DPA-Object Transfer method */
#define XPDelAttr 10 /* DPA-Object Delivery method */
#define XPAuxSPkg 11 /* DPA-Object Auxiliary sheet package */
#define XPAuxS 12 /* DPA-Object Auxiliary sheet */
#define XPFinishAttr 13 /* DPA-Object Finishing */
#define XPOutputAttr 14 /* DPA-Object Output method */
#define XPImpAttr 15 /* DPA-Object Imposition */
#define XPSchedAttr 16 /* DPA-Object Scheduler */
#define XPIntJobAttr 17 /* DPA-Object Initial value job */
#define XPIntDocAttr 18 /* DPA-Object Initial value document */
#define XPResConAttr 19 /* DPA-Object Resource context */
/*
* 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 */
#define XPGetDocSecondConsumer 1 /* setup error */
#define XPGetDocError 2 /* runtime error, see generated error */
/*
* Save data types for XpStartJob.
*/
typedef unsigned char XPSaveData;
#define XPSpool 1 /* Job data sent to spooler */
#define XPGetData 2 /* Job data via XpGetDocumentData */
/*
* Document types for XpStartDoc.
*/
typedef unsigned char XPDocumentType;
#define XPDocNormal 1 /* Doc data handled by Xserver */
#define XPDocRaw 2 /* Doc data passed through Xserver */
/********************************************************************
*
* 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.
*/
typedef XID XPContext;
/*
* Struct for XpGetPrinterList.
*/
typedef struct {
char *name; /* name */
char *desc; /* localized description */
} XPPrinterRec, *XPPrinterList;
/*
* Typedefs for XpGetDocumentData
*/
typedef void (*XPSaveProc)( Display *display,
XPContext context,
unsigned char *data,
unsigned int data_len,
XPointer client_data);
typedef void (*XPFinishProc)( Display *display,
XPContext context,
XPGetDocStatus status,
XPointer client_data);
/*
* Typedefs for XpSetLocaleHinter and XpGetLocaleHinter
*/
typedef char * (*XPHinterProc)();
/*******************************************************************
*
* Extension version structures.
*
*/
typedef struct {
int present;
short major_version;
short minor_version;
} XExtensionVersion;
/********************************************************************
*
* 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 */
Bool send_event; /* true if from a SendEvent request */
Display *display; /* Display the event was read from */
XPContext context; /* print context where operation was requested */
Bool cancel; /* was detailed event canceled */
int detail; /* XPStartJobNotify, XPEndJobNotify,
XPStartDocNotify, XPEndDocNotify,
XPStartPageNotify, XPEndPageNotify */
} XPPrintEvent;
typedef struct {
int type; /* base + XPAttributeNotify */
unsigned long serial; /* # of last request processed by server */
Bool send_event; /* true if from a SendEvent request */
Display *display; /* Display the event was read from */
XPContext context; /* print context where operation was requested */
int detail; /* XPJobAttr, XPDocAttr, XPPageAttr,
XPPrinterAttr, XPSpoolerAttr,
XPMediumAttr, XPServerAttr */
} XPAttributeEvent;
typedef struct {
int type; /* base + XPDataReadyNotify */
unsigned long serial; /* # of last request processed by server */
Bool send_event; /* true if from a SendEvent request */
Display *display; /* Display the event was read from */
XPContext context; /* print context where operation was requested */
unsigned long available; /* bytes available for retrieval */
} XPDataReadyEvent;
/**********************************************************
*
* Function prototypes for library side.
*/
#if NeedFunctionPrototypes
extern XPContext XpCreateContext (
Display *display,
char *printer_name
);
extern void XpSetContext (
Display *display,
XPContext print_context
);
extern XPContext XpGetContext (
Display *display
);
extern void XpDestroyContext (
Display *display,
XPContext print_context
);
extern Screen *XpGetScreenOfContext (
Display *display,
XPContext print_context
);
extern Status XpGetPageDimensions (
Display *display,
XPContext print_context,
unsigned short *width, /* return value */
unsigned short *height, /* return value */
XRectangle *reproducible_area /* return value */
);
extern void XpStartJob (
Display *display,
XPSaveData save_data
);
extern void XpEndJob (
Display *display
);
extern void XpCancelJob (
Display *display,
Bool discard
);
extern void XpStartDoc (
Display *display,
XPDocumentType type
);
extern void XpEndDoc (
Display *display
);
extern void XpCancelDoc (
Display *display,
Bool discard
);
extern void XpPutDocumentData (
Display *display,
Drawable drawable,
unsigned char *data,
int data_len,
char *doc_fmt,
char *options
);
extern Status XpGetDocumentData (
Display *display,
XPContext context,
XPSaveProc save_proc,
XPFinishProc finish_proc,
XPointer client_data
);
extern void XpStartPage (
Display *display,
Window window
);
extern void XpEndPage (
Display *display
);
extern void XpCancelPage (
Display *display,
Bool discard
);
extern void XpSelectInput (
Display *display,
XPContext print_context,
unsigned long event_mask
);
extern unsigned long XpInputSelected (
Display *display,
XPContext print_context,
unsigned long *all_events_mask
);
extern Bool XpSetImageResolution (
Display *display,
XPContext print_context,
int image_res,
int *prev_res
);
extern int XpGetImageResolution (
Display *display,
XPContext print_context
);
extern char *XpGetAttributes (
Display *display,
XPContext print_context,
XPAttributes type
);
extern void XpSetAttributes (
Display *display,
XPContext print_context,
XPAttributes type,
char *pool,
XPAttrReplacement replacement_rule
);
extern char *XpGetOneAttribute (
Display *display,
XPContext print_context,
XPAttributes type,
char *attribute_name
);
extern XPPrinterList XpGetPrinterList (
Display *display,
char *printer_name,
int *list_count /* return value */
);
extern void XpFreePrinterList (
XPPrinterList printer_list
);
extern void XpRehashPrinterList (
Display *display
);
extern Status XpQueryVersion (
Display *display,
short *major_version, /* return value */
short *minor_version /* return value */
);
extern Bool XpQueryExtension (
Display *display,
int *event_base_return, /* return value */
int *error_base_return /* return value */
);
extern Screen **XpQueryScreens (
Display *display,
int *list_count /* return value */
);
extern Status XpGetPdmStartParams (
Display *print_display,
Window print_window,
XPContext print_context,
Display *video_display,
Window video_window,
Display **selection_display, /* return value */
Atom *selection, /* return value */
Atom *type, /* return value */
int *format, /* return value */
unsigned char **data, /* return value */
int *nelements /* return value */
);
extern Status XpGetAuthParams (
Display *print_display,
Display *video_display,
Display **selection_display, /* return value */
Atom *selection, /* return value */
Atom *target /* return value */
);
extern Status XpSendAuth (
Display *display,
Window window
);
extern Status XpSendOneTicket (
Display *display,
Window window,
Xauth *ticket,
Bool more
);
extern void XpSetLocaleHinter (
XPHinterProc hinter_proc,
char *hinter_desc
);
extern char *XpGetLocaleHinter (
XPHinterProc *hinter_proc
);
extern char *XpGetLocaleNetString();
extern char *XpNotifyPdm (
Display *print_display,
Window print_window,
XPContext print_context,
Display *video_display,
Window video_window,
Bool auth_flag
);
#else
extern XPContext XpCreateContext ();
extern void XpSetContext ();
extern XPContext XpGetContext ();
extern void XpDestroyContext ();
extern Screen *XpGetScreenOfContext ();
extern Status XpGetPageDimensions ();
extern void XpStartJob ();
extern void XpEndJob ();
extern void XpCancelJob ();
extern void XpStartDoc ();
extern void XpEndDoc ();
extern void XpCancelDoc ();
extern void XpPutDocumentData ();
extern Status XpGetDocumentData ();
extern void XpStartPage ();
extern void XpEndPage ();
extern void XpCancelPage ();
extern void XpSelectInput ();
extern unsigned long XpInputSelected ();
extern Bool XpSetImageResolution ();
extern int XpGetImageResolution ();
extern char *XpGetAttributes ();
extern void XpSetAttributes ();
extern char *XpGetOneAttribute ();
extern XPPrinterList XpGetPrinterList ();
extern void XpFreePrinterList ();
extern void XpRehashPrinterList ();
extern Status XpQueryVersion ();
extern Bool XpQueryExtension ();
extern Screen **XpQueryScreens ();
extern Status XpGetPdmStartParams ();
extern Status XpGetAuthParams ();
extern Status XpSendAuth ();
extern Status XpSendOneTicket ();
extern void XpSetLocaleHinter ();
extern char *XpGetLocaleHinter ();
extern char *XpGetLocaleNetString ();
extern char *XpNotifyPdm ();
#endif /* NeedFunctionPrototypes */
#endif /* _XP_PRINT_SERVER_ */
_XFUNCPROTOEND
#endif /* _XpPrint_H_ */
|
Powered by ViewCVS 0.9.2 |