aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2015-03-04 13:29:02 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2015-04-04 10:59:50 +0200
commitf5f280417cb0af489406c8c3234e4ad69b008c74 (patch)
treea243624941f62bad00610b28795a5ae45e0b8c0c
parentebe00df38f264ef71dac3c73d416a74685c8cbd2 (diff)
downloadnx-libs-f5f280417cb0af489406c8c3234e4ad69b008c74.tar.gz
nx-libs-f5f280417cb0af489406c8c3234e4ad69b008c74.tar.bz2
nx-libs-f5f280417cb0af489406c8c3234e4ad69b008c74.zip
imake cleanup: Drop all references to XprtServer and BuildXprint*.
-rwxr-xr-xdebian/rules1
-rw-r--r--nx-X11/config/cf/README8
-rw-r--r--nx-X11/config/cf/X11.tmpl35
-rw-r--r--nx-X11/config/cf/host.def17
-rw-r--r--nx-X11/config/cf/xf86site.def6
-rw-r--r--nx-X11/config/cf/xfree86.cf4
-rw-r--r--nx-X11/config/cf/xorgsite.def6
-rw-r--r--nx-X11/include/extensions/Imakefile1
-rw-r--r--nx-X11/include/extensions/Print.h552
-rw-r--r--nx-X11/include/extensions/Printstr.h783
-rw-r--r--nx-X11/lib/Imakefile6
-rw-r--r--nx-X11/programs/Imakefile7
-rw-r--r--nx-X11/programs/Xserver/Imakefile76
-rw-r--r--nx-X11/programs/Xserver/Xext/Imakefile11
-rw-r--r--nx-X11/programs/Xserver/Xext/xprint.c2760
-rw-r--r--nx-X11/programs/Xserver/dix/Imakefile6
-rw-r--r--nx-X11/programs/Xserver/dix/main.c9
-rw-r--r--nx-X11/programs/Xserver/dix/xpstubs.c27
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Imakefile3
-rw-r--r--nx-X11/programs/Xserver/mi/miinitext.c45
-rw-r--r--nx-X11/programs/Xserver/os/Imakefile2
-rw-r--r--nx-X11/programs/Xserver/os/utils.c13
-rw-r--r--nx-libs.spec2
23 files changed, 12 insertions, 4368 deletions
diff --git a/debian/rules b/debian/rules
index d3532b36b..445f015cf 100755
--- a/debian/rules
+++ b/debian/rules
@@ -48,7 +48,6 @@ override_dh_install:
rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/extensions/XK*.h
rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/extensions/*Xv*.h
rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/extensions/xtrap*.h
- rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/extensions/Print*.h
rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/extensions/XRes*.h
rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/extensions/record*.h
rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/extensions/xf86vmode.h
diff --git a/nx-X11/config/cf/README b/nx-X11/config/cf/README
index 051d58748..e1b65a378 100644
--- a/nx-X11/config/cf/README
+++ b/nx-X11/config/cf/README
@@ -325,14 +325,6 @@ X11.tmpl provides defaults for the following variables:
XdmDir directory in which to install xdm files
XdmServersType type of xdm Xservers file to install
XinitDir directory in which to install xinit files
- XPrintDir parent of X Print server config directory
- XprtServer build the X Print server
- XpRasterDDX include the raster print ddx driver
- XpColorPclDDX include the color PCL print ddx driver
- XpMonoPclDDX include the monochrome PCL print ddx driver
- XpPostScriptDDX include the PostScript print ddx driver
- XpPdfDDX include the PDF print ddx driver
- XpSvgDDX include the SVG print ddx driver
XmanLocalSearchPath non-standard path for man pages
XtErrorPrefix leading text in XtError() msg; eg. 'X Toolkit '
XtWarningPrefix leading text in XtWarning()msg, same as above
diff --git a/nx-X11/config/cf/X11.tmpl b/nx-X11/config/cf/X11.tmpl
index 09dbc8f70..71a5d26e7 100644
--- a/nx-X11/config/cf/X11.tmpl
+++ b/nx-X11/config/cf/X11.tmpl
@@ -373,8 +373,7 @@ XORGRELSTRING = XorgManVersionString
#if (!defined(XF86Server) || !XF86Server) && (!defined (XorgServer) || !XorgServer)
#define BuildFontLib (BuildLibraries || BuildServer)
#else
-#define BuildFontLib (BuildLibraries || \
- (BuildServer && !DoLoadableServer) || XprtServer)
+#define BuildFontLib (BuildLibraries || (BuildServer && !DoLoadableServer))
#endif
#endif
#ifndef BuildFontCache
@@ -486,19 +485,6 @@ XORGRELSTRING = XorgManVersionString
#define XpSvgDDX YES
#endif
-#ifndef BuildXprint
-#define BuildXprint YES
-#endif
-#ifndef XprtServer
-#define XprtServer (BuildServer && BuildXprint)
-#endif
-#ifndef BuildXprintLib
-#define BuildXprintLib (!BuildServersOnly && BuildXprint)
-#endif
-#ifndef BuildXprintClients
-#define BuildXprintClients BuildXprintLib
-#endif
-
#ifndef BuildScreenSaverExt
#define BuildScreenSaverExt NO
#endif
@@ -978,17 +964,6 @@ FCHOWN_DEFINES = -DHAS_FCHOWN
#ifndef PrintOnlyServer
#define PrintOnlyServer YES
#endif
-#ifndef XprintDefines
-#if BuildXprint
-#if PrintOnlyServer
-#define XprintDefines -DXPRINT -DPIXPRIV
-#else
-#define XprintDefines -DXPRINT -DLOADABLEPRINTDDX -DPIXPRIV
-#endif
-#else
-#define XprintDefines /**/
-#endif
-#endif
#ifndef XkbDefines
#if BuildXKB
#define XkbDefines -DXKB
@@ -1221,7 +1196,7 @@ FCHOWN_DEFINES = -DHAS_FCHOWN
ShapeDefines XInputDefines XkbDefines LbxDefines AppgroupDefines \
XCSecurityDefines CupDefines PervasiveDBEDefines \
XF86BigfontExtensionDefines DPMSDefines \
- XprintDefines XineramaDefines \
+ XineramaDefines \
SitePervasiveExtensionDefines RenderDefines RandRDefines \
XfixesDefines XDamageDefines CompositeDefines XevieDefines \
RootlessDefines
@@ -1522,9 +1497,6 @@ FCHOWN_DEFINES = -DHAS_FCHOWN
#ifndef ServerConfigDir
#define ServerConfigDir $(LIBDIR)/xserver
#endif
-#ifndef XPrintDir
-#define XPrintDir ServerConfigDir
-#endif
#ifndef EtcX11Directory
#define EtcX11Directory /etc/X11
#endif
@@ -1657,7 +1629,6 @@ XCOMM X Window System make variables; these need to be coordinated with rules
XLOCALEDIR = XLocaleDir /* locale files */
LBXPROXYDIR = LbxproxyDir /* lbxproxy files */
PROXYMANAGERDIR = ProxyManagerDir /* proxy manager config files */
- XPRINTDIR = XPrintDir /* print config file root */
XAPPLOADDIR = XAppLoadDir /* application default resource dir */
FONTCFLAGS = FontCompilerFlags
@@ -2908,7 +2879,7 @@ UnsharedLibReferences(XA,NX_Xa,$(XALIBSRC))
#endif
#ifndef BuildXaw
-#define BuildXaw (BuildXprintLib && !BuildServersOnly)
+#define BuildXaw !BuildServersOnly
#endif
/* AWIDGETSRC is needed by libXaw6 and libXaw7 */
diff --git a/nx-X11/config/cf/host.def b/nx-X11/config/cf/host.def
index 4a5f4b21a..cae87f153 100644
--- a/nx-X11/config/cf/host.def
+++ b/nx-X11/config/cf/host.def
@@ -76,21 +76,6 @@ XCOMM $XFree86: xc/config/cf/xf86site.def,v 3.186 2003/06/25 18:06:22 eich Exp $
#define XorgServer NO
/*
- * To disable building Xprt, uncomment this.
- *
-#define XprtServer NO
- */
-#define XprtServer NO
-
-/*
- * Xprint is needed by Xprt. You can disable it if
- * you are not going to build Xprt.
- *
-#define BuildXprint NO
- */
-#define BuildXprint NO
-
-/*
* Building libraries with NX enhancements is disabled
* by default. You should enable this in your host.def.
*
@@ -949,8 +934,6 @@ XCOMM $XFree86: xc/config/cf/xf86site.def,v 3.186 2003/06/25 18:06:22 eich Exp $
#define BuildServersOnly YES
#define DefaultFontPath /usr/NX/share/fonts/misc/,/usr/NX/share/fonts/TTF/
#define DefaultRGBDatabase /usr/NX/share/rgb
-#define XprtServer NO
-#define BuildXprint NO
#define BuildFontServer NO
#define BuildFreeType NO
#define BuildXTrueType NO
diff --git a/nx-X11/config/cf/xf86site.def b/nx-X11/config/cf/xf86site.def
index ca429c9b9..db89ffe4c 100644
--- a/nx-X11/config/cf/xf86site.def
+++ b/nx-X11/config/cf/xf86site.def
@@ -45,12 +45,6 @@ XCOMM $XFree86: xc/config/cf/xf86site.def,v 3.186 2003/06/25 18:06:22 eich Exp $
*/
/*
- * To disable building Xprt, uncomment this.
- *
-#define XprtServer NO
- */
-
-/*
* Set the default server (ie the one that gets the sym-link to "X")
*
#define ServerToInstall XFree86
diff --git a/nx-X11/config/cf/xfree86.cf b/nx-X11/config/cf/xfree86.cf
index ea82a9d22..5832096ec 100644
--- a/nx-X11/config/cf/xfree86.cf
+++ b/nx-X11/config/cf/xfree86.cf
@@ -1876,10 +1876,6 @@ IPLAN2P8_DEFS = -DUSE_IPLAN2P8
# define UseServerLock YES
#endif
-#ifndef XprtServer
-# define XprtServer YES
-#endif
-
#ifndef ServerExtraDefines
# define ServerExtraDefines XFree86ServerDefines
#endif
diff --git a/nx-X11/config/cf/xorgsite.def b/nx-X11/config/cf/xorgsite.def
index ee0c5db98..6083ce5b3 100644
--- a/nx-X11/config/cf/xorgsite.def
+++ b/nx-X11/config/cf/xorgsite.def
@@ -45,12 +45,6 @@ XCOMM $XFree86: xc/config/cf/xf86site.def,v 3.186 2003/06/25 18:06:22 eich Exp $
*/
/*
- * To disable building Xprt, uncomment this.
- *
-#define XprtServer NO
- */
-
-/*
* Set the default server (ie the one that gets the sym-link to "X")
*
#define ServerToInstall Xorg
diff --git a/nx-X11/include/extensions/Imakefile b/nx-X11/include/extensions/Imakefile
index 269b8bbf7..63b9365dc 100644
--- a/nx-X11/include/extensions/Imakefile
+++ b/nx-X11/include/extensions/Imakefile
@@ -92,7 +92,6 @@ HEADERS = Xext.h \
security.h securstr.h \
shape.h shapestr.h \
sync.h syncstr.h \
- Print.h Printstr.h \
Xcup.h Xcupstr.h \
dpms.h dpmsstr.h \
XEVI.h XEVIstr.h
diff --git a/nx-X11/include/extensions/Print.h b/nx-X11/include/extensions/Print.h
deleted file mode 100644
index 2d45082c5..000000000
--- a/nx-X11/include/extensions/Print.h
+++ /dev/null
@@ -1,552 +0,0 @@
-/* $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
- ** 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.
- **
- ******************************************************************************
- *****************************************************************************/
-/* $XFree86: xc/include/extensions/Print.h,v 1.4 2000/01/25 18:37:31 dawes Exp $ */
-
-#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)(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;
-} XExtensionVersion;
-#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 */
- 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.
- */
-
-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(void);
-
-extern char *XpNotifyPdm (
- Display *print_display,
- Window print_window,
- XPContext print_context,
- Display *video_display,
- Window video_window,
- Bool auth_flag
-);
-
-#endif /* _XP_PRINT_SERVER_ */
-
-_XFUNCPROTOEND
-
-#endif /* _XpPrint_H_ */
diff --git a/nx-X11/include/extensions/Printstr.h b/nx-X11/include/extensions/Printstr.h
deleted file mode 100644
index 45ac7a596..000000000
--- a/nx-X11/include/extensions/Printstr.h
+++ /dev/null
@@ -1,783 +0,0 @@
-/* $Xorg: Printstr.h,v 1.3 2000/08/18 04:05:44 coskrey Exp $ */
-/******************************************************************************
- ******************************************************************************
- **
- ** File: Printstr.h
- **
- ** Description: Definitions needed by the server and library, but
- ** not clients.
- **
- ** Print.h for server, library and 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.
- **
- ******************************************************************************
- *****************************************************************************/
-/* $XFree86: xc/include/extensions/Printstr.h,v 1.5 2001/08/01 00:44:35 tsi Exp $ */
-
-
-#ifndef _XpPrintstr_H_
-#define _XpPrintstr_H_
-
-/*
- * NEED_EVENTS and NEED_REPLIES are hacks to limit the linker symbol-table
- * size. When function prototypes are needed from Print.h, this sets up
- * a cascading dependency on Printstr.h and eventually Xproto.h to provide
- * the event and reply struct definitions.
- */
-#ifndef NEED_EVENTS
-#define NEED_EVENTS
-#endif /* NEED_EVENTS */
-
-#define NEED_REPLIES
-
-#include <X11/Xproto.h>
-#ifndef _XP_PRINT_SERVER_
-#include <X11/Xlib.h>
-#endif /* _XP_PRINT_SERVER_ */
-
-/*
- * Pull in other definitions. Print.h will hide some things if we're
- * doing server side work.
- */
-#include <X11/extensions/Print.h>
-
-#include <X11/Xfuncproto.h>
-
-_XFUNCPROTOBEGIN
-
-/******************************************************************************
- *
- * Protocol requests constants and alignment values
- *
- * Note: Xlib macro's expect X_ABC where ABC is the name of the
- * protocol request.
- */
-#define X_PrintQueryVersion 0
-#define X_PrintGetPrinterList 1
-#define X_PrintCreateContext 2
-#define X_PrintSetContext 3
-#define X_PrintGetContext 4
-#define X_PrintDestroyContext 5
-#define X_PrintGetContextScreen 6
-#define X_PrintStartJob 7
-#define X_PrintEndJob 8
-#define X_PrintStartDoc 9
-#define X_PrintEndDoc 10
-#define X_PrintPutDocumentData 11
-#define X_PrintGetDocumentData 12
-#define X_PrintStartPage 13
-#define X_PrintEndPage 14
-#define X_PrintSelectInput 15
-#define X_PrintInputSelected 16
-#define X_PrintGetAttributes 17
-#define X_PrintSetAttributes 18
-#define X_PrintGetOneAttribute 19
-#define X_PrintRehashPrinterList 20
-#define X_PrintGetPageDimensions 21
-#define X_PrintQueryScreens 22
-#define X_PrintSetImageResolution 23
-#define X_PrintGetImageResolution 24
-
-/********************************************************************
- *
- * Protocol data types
- */
-#define PCONTEXT CARD32
-#define WINDOW CARD32
-#define DRAWABLE CARD32
-#define BITMASK CARD32
-
-/******************************************************************************
- *
- * Event wire struct definitions
- *
- * Note: Xlib macro's expect xABC struct names and sz_xABC size
- * constants where ABC is the name of the protocol request.
- */
-
-
-/*********************************************************************
- *
- * Events.
- *
- * See Print.h for the protocol "type" values.
- */
-typedef struct _xPrintPrintEvent {
- BYTE type; /* XPPrintNotify + extEntry->eventBase */
- BYTE detail; /* XPStartJobNotify, XPEndJobNotify,
- XPStartDocNotify, XPEndDocNotify,
- XPStartPageNotify, XPEndPageNotify */
- CARD16 sequenceNumber B16;
- PCONTEXT printContext B32; /* print context */
- BOOL cancel; /* canceled flag */
- CARD8 pad1; /* rest is unused */
- CARD16 pad2 B16;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
- CARD32 pad7 B32;
-} xPrintPrintEvent;
-#define sz_xPrintPrintEvent 32;
-
-typedef struct _xPrintAttributeEvent {
- BYTE type; /* XPAttributeNotify + extEntry->eventBase */
- BYTE detail; /* XPJobAttr, XPDocAttr, XPPageAttr,
- XPPrinterAttr, XPSpoolerAttr,
- XPMediumAttr, XPServerAttr */
- CARD16 sequenceNumber B16;
- PCONTEXT printContext B32; /* print context */
- CARD32 pad1 B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xPrintAttributeEvent;
-#define sz_xPrintAttributeEvent 32;
-
-
-/*********************************************************************
- *
- * Requests
- */
-typedef struct _PrintQueryVersion {
- CARD8 reqType; /* always PrintReqCode */
- CARD8 printReqType; /* always X_PrintQueryVersion */
- CARD16 length B16;
-} xPrintQueryVersionReq;
-#define sz_xPrintQueryVersionReq 4
-
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD16 majorVersion B16; /* major version of Xp protocol */
- CARD16 minorVersion B16; /* minor version of Xp protocol */
- CARD32 pad1 B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
-} xPrintQueryVersionReply;
-#define sz_xPrintQueryVersionReply 32
-
-
-typedef struct _PrintGetPrinterList {
- CARD8 reqType; /* always PrintReqCode */
- CARD8 printReqType; /* always X_PrintGetPrinterList */
- CARD16 length B16;
- CARD32 printerNameLen B32; /* length of printer name */
- CARD32 localeLen B32; /* length of locale string */
-
- /* variable portion *****************************************
- STRING8 printerName; * printer name *
- BYTE pad(printerNameLen) * unused *
- STRING8 locale; * locale *
- BYTE pad(localeLen) * unused *
- ************************************************************/
-} xPrintGetPrinterListReq;
-#define sz_xPrintGetPrinterListReq 12
-
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 listCount B32; /* of PRINTER recs below */
- CARD32 pad1 B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
-
- /* variable portion *****************************************
- CARD32 nameLen B32; * length of name in bytes *
- STRING8 name; * name *
- BYTE pad(nameLen) * unused *
-
- CARD32 descLen B32; * length of desc in bytes *
- STRING8 desc; * localized description *
- BYTE pad(descLen) * unused *
- ************************************************************/
-} xPrintGetPrinterListReply;
-#define sz_xPrintGetPrinterListReply 32
-
-
-typedef struct _PrintRehashPrinterList {
- CARD8 reqType; /* always PrintReqCode */
- CARD8 printReqType; /* always X_PrintRehashPrinterList */
- CARD16 length B16;
-} xPrintRehashPrinterListReq;
-#define sz_xPrintRehashPrinterListReq 4
-
-
-typedef struct _PrintCreateContext {
- CARD8 reqType; /* always PrintReqCode */
- CARD8 printReqType; /* always X_PrintInitSetContext */
- CARD16 length B16;
- CARD32 contextID B32; /* ID for context */
- CARD32 printerNameLen B32; /* length of printerName in bytes */
- CARD32 localeLen B32; /* length of locale in bytes */
-
- /* variable portion *****************************************
- STRING8 printerName * printer name *
- BYTE pad(printerNameLen) * unused *
- STRING8 locale * locale *
- BYTE pad(locale) * unused *
- ************************************************************/
-} xPrintCreateContextReq;
-#define sz_xPrintCreateContextReq 16
-
-
-typedef struct _PrintSetContext {
- CARD8 reqType; /* always PrintReqCode */
- CARD8 printReqType; /* always X_PrintSetContext */
- CARD16 length B16;
- PCONTEXT printContext B32; /* print context */
-} xPrintSetContextReq;
-#define sz_xPrintSetContextReq 8
-
-
-typedef struct _PrintGetContext {
- CARD8 reqType; /* always PrintReqCode */
- CARD8 printReqType; /* always X_PrintGetContext */
- CARD16 length B16;
-} xPrintGetContextReq;
-#define sz_xPrintGetContextReq 4
-
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- PCONTEXT printContext B32; /* print context */
- CARD32 pad1 B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
-} xPrintGetContextReply;
-#define sz_xPrintGetContextReply 32
-
-
-typedef struct _PrintDestroyContext {
- CARD8 reqType; /* always PrintReqCode */
- CARD8 printReqType; /* always X_PrintDestroyContext */
- CARD16 length B16;
- PCONTEXT printContext B32; /* print context */
-} xPrintDestroyContextReq;
-#define sz_xPrintDestroyContextReq 8
-
-
-typedef struct _PrintGetContextScreen {
- CARD8 reqType; /* always PrintReqCode */
- CARD8 printReqType; /* always X_PrintGetContextScreen */
- CARD16 length B16;
- PCONTEXT printContext B32; /* print context */
-} xPrintGetContextScreenReq;
-#define sz_xPrintGetContextScreenReq 8
-
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- WINDOW rootWindow; /* screenPtr represented as rootWin */
- CARD32 pad1 B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
-} xPrintGetContextScreenReply;
-#define sz_xPrintGetContextScreenReply 32
-
-
-typedef struct _PrintStartJob {
- CARD8 reqType; /* always PrintReqCode */
- CARD8 printReqType; /* always X_PrintStartJob */
- CARD16 length B16;
- CARD8 saveData; /* save data boolean */
- CARD8 pad1;
- CARD16 pad2 B16;
-} xPrintStartJobReq;
-#define sz_xPrintStartJobReq 8
-
-typedef struct _PrintEndJob {
- CARD8 reqType; /* always PrintReqCode */
- CARD8 printReqType; /* always X_PrintEndJob */
- CARD16 length B16;
- BOOL cancel; /* cancel boolean */
- CARD8 pad1;
- CARD16 pad2 B16;
-} xPrintEndJobReq;
-#define sz_xPrintEndJobReq 8
-
-
-typedef struct _PrintStartDoc {
- CARD8 reqType; /* always PrintReqCode */
- CARD8 printReqType; /* always X_PrintStartDoc */
- CARD16 length B16;
- CARD8 type; /* type for document */
- CARD8 pad1;
- CARD16 pad2 B16;
-} xPrintStartDocReq;
-#define sz_xPrintStartDocReq 8
-
-typedef struct _PrintEndDoc {
- CARD8 reqType; /* always PrintReqCode */
- CARD8 printReqType; /* always X_PrintEndDoc */
- CARD16 length B16;
- BOOL cancel; /* cancel boolean */
- CARD8 pad1;
- CARD16 pad2 B16;
-} xPrintEndDocReq;
-#define sz_xPrintEndDocReq 8
-
-
-typedef struct _PrintPutDocumentData {
- CARD8 reqType; /* always PrintReqCode */
- CARD8 printReqType; /* always X_PrintPutDocumentData */
- CARD16 length B16;
- DRAWABLE drawable B32; /* target drawable */
- CARD32 len_data B32; /* big len in bytes */
- CARD16 len_fmt; /* len in bytes */
- CARD16 len_options; /* len in bytes */
-
- /* variable portion *****************************************
- LISTofBYTE data; * data *
- BYTE pad(len_data) * unused *
- STRING8 doc_fmt; * ISO compliant desc of data type *
- BYTE pad(len_fmt) * unused *
- STRING8 options; * additional device-dependent desc *
- BYTE pad(len_options) * unused *
- ************************************************************/
-} xPrintPutDocumentDataReq;
-#define sz_xPrintPutDocumentDataReq 16
-
-
-typedef struct _PrintGetDocumentData {
- CARD8 reqType; /* always PrintReqCode */
- CARD8 printReqType; /* always X_PrintGetDocumentData */
- CARD16 length B16;
- PCONTEXT printContext B32; /* print context */
- CARD32 maxBufferSize B32; /* maximum buffer size requested */
-} xPrintGetDocumentDataReq;
-#define sz_xPrintGetDocumentDataReq 12
-
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 statusCode B32; /* status code for reply */
- CARD32 finishedFlag B32; /* is this the last reply */
- CARD32 dataLen B32; /* data length */
- CARD32 pad1 B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
-
- /* variable portion *****************************************
- LISTofBYTE data; * data *
- BYTE pad(count) * unused *
- ************************************************************/
-} xPrintGetDocumentDataReply;
-#define sz_xPrintGetDocumentDataReply 32
-
-
-typedef struct _PrintStartPage {
- CARD8 reqType; /* always PrintReqCode */
- CARD8 printReqType; /* always X_PrintStartPage */
- CARD16 length B16;
- WINDOW window B32; /* window */
-} xPrintStartPageReq;
-#define sz_xPrintStartPageReq 8
-
-typedef struct _PrintEndPage {
- CARD8 reqType; /* always PrintReqCode */
- CARD8 printReqType; /* always X_PrintEndPage */
- CARD16 length B16;
- BOOL cancel; /* cancel boolean */
- CARD8 pad1;
- CARD16 pad2 B16;
-} xPrintEndPageReq;
-#define sz_xPrintEndPageReq 8
-
-
-typedef struct _PrintSelectInput {
- CARD8 reqType; /* always PrintReqCode */
- CARD8 printReqType; /* always X_PrintSelectInput */
- CARD16 length B16;
- PCONTEXT printContext B32; /* print context */
- BITMASK eventMask B32;
-} xPrintSelectInputReq;
-#define sz_xPrintSelectInputReq 12
-
-
-typedef struct _PrintInputSelected {
- CARD8 reqType; /* always PrintReqCode */
- CARD8 printReqType; /* always X_PrintInputSelected */
- CARD16 length B16;
- PCONTEXT printContext B32; /* print context */
-} xPrintInputSelectedReq;
-#define sz_xPrintInputSelectedReq 8
-
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- BITMASK eventMask B32; /* your event mask */
- BITMASK allEventsMask B32; /* all event mask */
- CARD32 pad1 B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
-} xPrintInputSelectedReply;
-#define sz_xPrintInputSelectedReply 32
-
-typedef struct _PrintGetAttributes {
- CARD8 reqType; /* always PrintReqCode */
- CARD8 printReqType; /* always X_PrintGetAttributes */
- CARD16 length B16;
- PCONTEXT printContext B32; /* print context */
- CARD8 type; /* type */
- CARD8 pad1; /* unused */
- CARD16 pad2 B16; /* unused */
-} xPrintGetAttributesReq;
-#define sz_xPrintGetAttributesReq 12
-
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 stringLen B32; /* length of xrm db string */
- CARD32 pad1 B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
-
- /* variable portion *****************************************
- STRING8 string; * xrm db as a string *
- BYTE pad(stringLen) * unused *
- ************************************************************/
-} xPrintGetAttributesReply;
-#define sz_xPrintGetAttributesReply 32
-
-
-typedef struct _PrintSetAttributes {
- CARD8 reqType; /* always PrintReqCode */
- CARD8 printReqType; /* always X_PrintSetAttributes */
- CARD16 length B16;
- PCONTEXT printContext B32; /* print context */
- CARD32 stringLen B32; /* length of xrm db string */
- CARD8 type; /* type */
- CARD8 rule; /* replacement rule */
- CARD16 pad1 B16; /* unused */
-
- /* variable portion *****************************************
- STRING8 string; * xrm db as a string *
- BYTE pad(stringLen) * unused *
- ************************************************************/
-} xPrintSetAttributesReq;
-#define sz_xPrintSetAttributesReq 16
-
-
-typedef struct _PrintGetOneAttribute {
- CARD8 reqType; /* always PrintReqCode */
- CARD8 printReqType; /* always X_PrintGetOneAttribute */
- CARD16 length B16;
- PCONTEXT printContext B32; /* print context */
- CARD32 nameLen; /* length of name string */
- CARD8 type; /* type */
- CARD8 pad1; /* unused */
- CARD16 pad2 B16; /* unused */
-
- /* variable portion *****************************************
- STRING8 name; * name as a string *
- BYTE pad(name) * unused *
- ************************************************************/
-} xPrintGetOneAttributeReq;
-#define sz_xPrintGetOneAttributeReq 16
-
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 valueLen B32; /* length of value string */
- CARD32 pad1 B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
-
- /* variable portion *****************************************
- STRING8 value; * value as a string *
- BYTE pad(value) * unused *
- ************************************************************/
-} xPrintGetOneAttributeReply;
-#define sz_xPrintGetOneAttributeReply 32
-
-
-typedef struct _PrintGetPageDimensions {
- CARD8 reqType; /* always PrintReqCode */
- CARD8 printReqType; /* always X_PrintGetPageDimensions */
- CARD16 length B16;
- PCONTEXT printContext B32; /* print context */
-} xPrintGetPageDimensionsReq;
-#define sz_xPrintGetPageDimensionsReq 8
-
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD16 width; /* total pixel width */
- CARD16 height; /* total pixel height */
- CARD16 rx; /* reproducable x pixel offset */
- CARD16 ry; /* reproducable y pixel offset */
- CARD16 rwidth; /* reproducable x pixel width */
- CARD16 rheight; /* reproducable y pixel width */
- CARD32 pad1 B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
-} xPrintGetPageDimensionsReply;
-#define sz_xPrintGetPageDimensionsReply 32
-
-
-typedef struct _PrintQueryScreens {
- CARD8 reqType; /* always PrintReqCode */
- CARD8 printReqType; /* always X_PrintQueryScreens */
- CARD16 length B16;
-} xPrintQueryScreensReq;
-#define sz_xPrintQueryScreensReq 4
-
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 listCount; /* number of screens following */
- CARD32 pad1 B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
-
- /* variable portion *****************************************
- WINDOW rootWindow; * root window of screen *
- ************************************************************/
-} xPrintQueryScreensReply;
-#define sz_xPrintQueryScreensReply 32
-
-typedef struct _PrintSetImageResolution {
- CARD8 reqType; /* always PrintReqCode */
- CARD8 printReqType; /* always X_PrintSetImageResolution */
- CARD16 length B16;
- PCONTEXT printContext B32; /* print context */
- CARD16 imageRes B16; /* image resolution */
- CARD16 pad1 B16;
-} xPrintSetImageResolutionReq;
-#define sz_xPrintSetImageResolutionReq 12
-
-typedef struct {
- BYTE type; /* X_Reply */
- BOOL status; /* accepted or not */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD16 prevRes B16; /* previous resolution */
- CARD16 pad1 B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xPrintSetImageResolutionReply;
-#define sz_xPrintSetImageResolutionReply 32
-
-typedef struct _PrintGetImageResolution {
- CARD8 reqType; /* always PrintReqCode */
- CARD8 printReqType; /* always X_PrintGetImageResolution */
- CARD16 length B16;
- PCONTEXT printContext B32; /* print context */
-} xPrintGetImageResolutionReq;
-#define sz_xPrintGetImageResolutionReq 8
-
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD16 imageRes B16; /* image resolution */
- CARD16 pad1 B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xPrintGetImageResolutionReply;
-#define sz_xPrintGetImageResolutionReply 32
-
-#ifndef _XP_PRINT_SERVER_
-/***********************************************************************
- *
- * Library-only definitions.
- */
-extern XPHinterProc _xp_hinter_proc;
-extern char *_xp_hinter_desc;
-extern int _xp_hinter_init;
-
-#else /* _XP_PRINT_SERVER_ */
-
-/***********************************************************************
- *
- * Server-only definitions shared between the extension and DDX layers.
- *
- */
-
-/*
- * Internal return code used to indicate that the requesting
- * client has been suspended.
- */
-#define Suspended 84
-
-struct _XpContext;
-
-extern void XpRegisterPrinterScreen(
- ScreenPtr pScreen,
- int (*CreateContext)(struct _XpContext *));
-
-typedef struct _xpprintFuncs {
- int (*StartJob)(
- struct _XpContext * /* pContext */,
- Bool /* sendClientData */,
- ClientPtr /* client */);
- int (*EndJob)(struct _XpContext *, int);
- int (*StartDoc)(
- struct _XpContext * /* pContext */,
- XPDocumentType /* type */);
- int (*EndDoc)(struct _XpContext *, int);
- int (*StartPage)(
- struct _XpContext * /* pContext */,
- WindowPtr /* pWin */);
- int (*EndPage)(
- struct _XpContext * /* pContext */,
- WindowPtr /* pWin */);
- int (*PutDocumentData)(
- struct _XpContext * /* pContext */,
- DrawablePtr /* pDraw */,
- char * /* pData */,
- int /* len_data */,
- char * /* pDoc_fmt */,
- int /* len_fmt */,
- char * /* pOptions */,
- int /* len_options */,
- ClientPtr /* client */);
- int (*GetDocumentData)(
- struct _XpContext * /* pContext */,
- ClientPtr /* client */,
- int /* maxBufferSize */);
- int (*DestroyContext)(
- struct _XpContext *); /* pContext */
- char *(*GetAttributes)(
- struct _XpContext *,
- XPAttributes /* pool */);
- char *(*GetOneAttribute)(
- struct _XpContext * /* pContext */,
- XPAttributes /* pool */,
- char * /* attrs */);
- int (*SetAttributes)(
- struct _XpContext * /* pContext */,
- XPAttributes /* pool */,
- char * /* attrs */);
- int (*AugmentAttributes)(
- struct _XpContext * /* pContext */,
- XPAttributes /* pool */,
- char * /* attrs */);
- int (*GetMediumDimensions)(
- struct _XpContext * /* pPrintContext */,
- CARD16 * /* pWidth */,
- CARD16 * /* pHeight */);
- int (*GetReproducibleArea)(
- struct _XpContext * /* pPrintContext */,
- xRectangle * /* pRect */);
- int (*SetImageResolution)(
- struct _XpContext * /* pPrintContext */,
- int /* imageRes */,
- Bool * /* pStatus */);
-} XpDriverFuncs, *XpDriverFuncsPtr;
-
-/*
- * Each print context is represented by one of the following structs
- * associated with a resource ID of type RTcontext . A pointer to
- * the context is placed in the Xp extension's devPrivates
- * element in each client * which establishes a context via
- * either initContext or setContext.
- * The context pointer is also placed in the struct indicated by the
- * RTpage resource associated with each StartPage'd window.
- */
-typedef struct _XpContext {
- XID contextID;
- char *printerName;
- int screenNum; /* screen containing the printer */
- struct _XpClient *clientHead; /* list of clients */
- CARD32 state;
- VisualID pageWin;
- DevUnion *devPrivates;
- XpDriverFuncs funcs;
- ClientPtr clientSlept;
- int imageRes;
-} XpContextRec, *XpContextPtr;
-
-#include <X11/fonts/fontstruct.h> /* FontResolutionPtr */
-
-extern Bool XpAllocateContextPrivate(int, unsigned);
-extern FontResolutionPtr XpGetClientResolutions(ClientPtr, int *);
-extern XpContextPtr XpContextOfClient(ClientPtr);
-extern XpContextPtr XpGetPrintContext(ClientPtr);
-extern int XpAllocateContextPrivateIndex(void);
-extern int XpRehashPrinterList(void);
-extern void XpSetFontResFunc(ClientPtr);
-extern void XpUnsetFontResFunc(ClientPtr);
-extern void XpRegisterInitFunc(ScreenPtr, char *, int (*)(struct _XpContext *));
-
-#endif /* _XP_PRINT_SERVER_ */
-
-_XFUNCPROTOEND
-
-#endif /* _XpPrintstr_H_ */
diff --git a/nx-X11/lib/Imakefile b/nx-X11/lib/Imakefile
index 1266724c7..721d3fff4 100644
--- a/nx-X11/lib/Imakefile
+++ b/nx-X11/lib/Imakefile
@@ -181,10 +181,6 @@ REGEXDIR = regex
XALIBDIR = Xa
#endif
-#if BuildXprintLib
-XPRINTLIBDIRS = Xp XprintUtil XprintAppUtil
-#endif
-
#if BuildFontCacheLib
FONTCACHELIBDIR = Xfontcache
#endif
@@ -221,7 +217,7 @@ LINTSUBDIRS = $(XAULIBDIR) $(XDMCPLIBDIR) $(X11LIBDIR) \
$(OLDXLIBDIR) $(ICELIBDIR) $(SMLIBDIR) $(XEXTLIBDIR) $(XTLIBDIR) \
$(SSLIBDIR) $(XF86MISCLIBDIR) $(XF86VMLIBDIR) $(XF86DGALIBDIR) \
$(XF86RUSHLIBDIR) $(XMULIBDIR) $(XMUULIBDIR) $(XPMLIBDIR) \
- $(XPRINTLIBDIRS) $(XAW6LIBDIR) $(XAW7LIBDIR) $(XAWLIBDIR) \
+ $(XAW6LIBDIR) $(XAW7LIBDIR) $(XAWLIBDIR) \
$(XINPUTLIBDIR) $(XTSTLIBDIR) $(FSLIBDIR) $(XKBLIBDIR) \
$(XKBUILIBDIR) $(LBXUTILDIR) $(XALIBDIR) $(EXPATBUILDDIR) \
$(XVLIBDIR) $(GLXLIBDIR) $(GLULIBDIR) $(GLWLIBDIR) \
diff --git a/nx-X11/programs/Imakefile b/nx-X11/programs/Imakefile
index 9480baf6e..acecc3be0 100644
--- a/nx-X11/programs/Imakefile
+++ b/nx-X11/programs/Imakefile
@@ -57,9 +57,6 @@ SCREENSAVESRCDIR = beforelight
#if BuildLBX
LBXPROXYSRCDIR = lbxproxy
#endif
-#if BuildXprintClients
- XPSRCDIRS = xplsprinters xprehashprinterlist xphelloworld xpr
-#endif
PROXYMGRSRCDIR = proxymngr
RSTARTSRCDIR = rstart
SMPROXYSRCDIR = smproxy
@@ -109,10 +106,6 @@ XTRAPCLIENTDIRS = xtrap
#if BuildDPSClients
DPSCLIENTDIRS = dpsinfo dpsexec texteroids
#endif
-#if BuildDBElib && BuildXprintClients
- DBECLIENTDIRS = xdbedizzy
-#endif
-
XPMCLIENTDIRS = cxpm sxpm
#if BuildGLXLibrary
diff --git a/nx-X11/programs/Xserver/Imakefile b/nx-X11/programs/Xserver/Imakefile
index 979a9468c..c25103373 100644
--- a/nx-X11/programs/Xserver/Imakefile
+++ b/nx-X11/programs/Xserver/Imakefile
@@ -158,49 +158,6 @@ INSTPGMFLAGS =
LIBCWRAPPER = os/libcwrapper.o
#endif
-#if BuildXprint
-
-XPCONFIGDIR = XpConfig
-
-#ifndef XpRasterDDX
-#define XpRasterDDX YES
-#endif
-#ifndef XpColorPclDDX
-#define XpColorPclDDX YES
-#endif
-#ifndef XpMonoPclDDX
-#define XpMonoPclDDX NO
-#endif
-#ifndef XpPostScriptDDX
-#define XpPostScriptDDX YES
-#endif
-
-#if XpRasterDDX
-XPRASTLIB = Xprint/raster/LibraryTargetName(raster)
-#endif
-#if XpColorPclDDX
-XPPCLLIB = Xprint/pcl/LibraryTargetName(pcl)
-#endif
-#if XpMonoPclDDX
-XPMPCLLIB = Xprint/pcl-mono/LibraryTargetName(pcl)
-#endif
-#if XpPostScriptDDX
-XPPSLIB = Xprint/ps/LibraryTargetName(ps)
-#endif
-
-XPDDXLIBS = Xprint/LibraryTargetName(printer) \
- $(XPRASTLIB) $(XPPCLLIB) $(XPMPCLLIB) $(XPPSLIB)
-XPDDXFBLIBS = $(MFB) $(CFB32)
-#if !PrintOnlyServer
- XPFBLIBS = $(XPDDXFBLIBS)
- XPDDX = $(XPDDXLIBS)
-#endif
- XPDDXDIR = Xprint
-#endif
-#if !BuildXprint || PrintOnlyServer
-XPFBLIBS = dix/LibraryTargetName(xpstubs)
-#endif
-
#if BuildRender
RENDERDIR = render
RENDERLIB = $(RENDERDIR)/librender.a
@@ -834,39 +791,6 @@ ServerDriverSDKTarget(Xorg)
#endif
#endif /* XorgServer */
-#if defined(XprtServer) && XprtServer
-XCOMM
-XCOMM Print Server
-XCOMM
-MFBSUBDIR = mfb
-CFB8SUBDIR = cfb
-CFB32SUBDIR = cfb32
-MIDAMAGEDIR = miext/damage
-XPSUBDIRS = $(STDDIRS) $(MFBDIR) $(CFB8DIR) $(CFB32DIR) $(DEPDIRS) \
- $(MIDAMAGEDIR)
-XPOBJS = Xprint/ddxInit.o Xprint/dpmsstubs.o Xprint/miinitext.o
-#if PrintOnlyServer
-XPLIBS = PreFbLibs $(XPDDXLIBS) $(XPDDXFBLIBS) PostFbLibs
-#else
-XPLIBS = PreFbLibs PostFbLibs
-#endif
-#if (defined(SunArchitecture) || defined(SparcArchitecture)) && \
- defined(SVR4Architecture)
-XPSYSLIBS = $(FONTLIBS) $(CBRT) $(SYSLIBS) $(XONLYLIB) -lw
-#else
-XPSYSLIBS = $(FONTLIBS) $(CBRT) $(SYSLIBS) $(XONLYLIB)
-#endif
-#if HasParallelMake
-MakeMutex($(XPSUBDIRS) $(XPOBJS) $(XPLIBS) $(XPSYSLIBS))
-#endif
-#if ForceServerRemake
-$(XPOBJS) $(XPLIBS) $(XPSYSLIBS):: $(XPSUBDIRS)
- @if [ -f $@ ]; then touch $@ >/dev/null 2>&1 || exit 0; fi
-#endif
-ServerTarget(Xprt,$(XPSUBDIRS),$(XPOBJS), \
- $(LIBCWRAPPER) $(XPLIBS) $(LOADABLEEXTS),$(XPSYSLIBS))
-#endif /* XprtServer */
-
#if defined(NXAgentServer) && NXAgentServer
XCOMM
XCOMM Nested server with NXlib-based ddx and compressed transport.
diff --git a/nx-X11/programs/Xserver/Xext/Imakefile b/nx-X11/programs/Xserver/Xext/Imakefile
index 6846c2892..6c2c060f8 100644
--- a/nx-X11/programs/Xserver/Xext/Imakefile
+++ b/nx-X11/programs/Xserver/Xext/Imakefile
@@ -131,16 +131,11 @@ XF86BIGFOBJS = xf86bigfont.o
XEVIEOBJS = xevie.o
#endif
-#if BuildXprint
- XPRINTSRCS = xprint.c
- XPRINTOBJS = xprint.o
-#endif
-
SRCS = shape.c $(SHMSRCS) $(MULTIBUFSRC) \
mitmisc.c xtest.c xtest1di.c xtest1dd.c sleepuntil.c \
bigreq.c sync.c $(SCRNSAVSRC) xcmisc.c $(VIDMODESRCS) \
$(XF86MISCSRCS) $(XF86BIGFSRCS) $(XF86DGASRCS) $(SECURITYSRCS) \
- $(APPGROUPSRCS) $(XPRINTSRCS) $(CUPSRCS) $(PNRXSRCS) $(DPMSSRCS) \
+ $(APPGROUPSRCS) $(CUPSRCS) $(PNRXSRCS) $(DPMSSRCS) \
$(XEVIESRCS) \
$(EVISRCS) $(XVSRCS) $(FONTCACHESRCS) $(XRESSRCS) $(DMXSRCS)
@@ -148,11 +143,11 @@ XF86BIGFOBJS = xf86bigfont.o
mitmisc.o xtest.o xtest1di.o xtest1dd.o sleepuntil.o \
bigreq.o sync.o $(SCRNSAVOBJ) xcmisc.o $(VIDMODEOBJS) \
$(XF86MISCOBJS) $(XF86BIGFOBJS) $(XF86DGAOBJS) $(SECURITYOBJS) \
- $(APPGROUPOBJS) $(XPRINTOBJS) $(CUPOBJS) $(PNRXOBJS) $(DPMSOBJS) \
+ $(APPGROUPOBJS) $(CUPOBJS) $(PNRXOBJS) $(DPMSOBJS) \
$(XEVIEOBJS) \
$(EVIOBJS) $(XVOBJS) $(FONTCACHEOBJS) $(XRESOBJS) $(DMXOBJS)
- SOBJS = $(SHMOBJS) $(APPGROUPOBJS) $(SECURITYOBJS) $(XPRINTOBJS) \
+ SOBJS = $(SHMOBJS) $(APPGROUPOBJS) $(SECURITYOBJS) \
shape.o xtest.o xtest1di.o xtest1dd.o sleepuntil.o $(PNRXOBJS) \
$(XEVIEOBJS) \
$(XF86BIGFOBJS)
diff --git a/nx-X11/programs/Xserver/Xext/xprint.c b/nx-X11/programs/Xserver/Xext/xprint.c
deleted file mode 100644
index 60512d372..000000000
--- a/nx-X11/programs/Xserver/Xext/xprint.c
+++ /dev/null
@@ -1,2760 +0,0 @@
-/* $Xorg: xprint.c,v 1.5 2001/03/05 20:42:26 pookie Exp $ */
-/*
-(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.
-*/
-/*******************************************************************
-**
-** *********************************************************
-** *
-** * File: xprint.c
-** *
-** * Copyright: Copyright 1993, 1995 Hewlett-Packard Company
-** *
-** * Copyright 1989 by The Massachusetts Institute of Technology
-** *
-** * Permission to use, copy, modify, and distribute this
-** * software and its documentation for any purpose and without
-** * fee is hereby granted, provided that the above copyright
-** * notice appear in all copies and that both that copyright
-** * notice and this permission notice appear in supporting
-** * documentation, and that the name of MIT not be used in
-** * advertising or publicity pertaining to distribution of the
-** * software without specific prior written permission.
-** * M.I.T. makes no representation about the suitability of
-** * this software for any purpose. It is provided "as is"
-** * without any express or implied warranty.
-** *
-** * MIT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-** * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
-** * NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MIT BE LI-
-** * ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-** * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-** * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-** * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
-** * THE USE OR PERFORMANCE OF THIS SOFTWARE.
-** *
-** *********************************************************
-**
-********************************************************************/
-/* $XFree86: xc/programs/Xserver/Xext/xprint.c,v 1.14tsi Exp $ */
-
-#define _XP_PRINT_SERVER_
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <X11/X.h>
-#include <X11/Xos.h>
-#define NEED_EVENTS
-#include <X11/Xproto.h>
-#undef NEED_EVENTS
-#include "misc.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "extnsionst.h"
-#include "dixstruct.h"
-#include <X11/Xatom.h>
-#include <X11/extensions/Print.h>
-#include <X11/extensions/Printstr.h>
-#include "../Xprint/DiPrint.h"
-#include "../Xprint/attributes.h"
-#include "modinit.h"
-
-static void XpResetProc(ExtensionEntry *);
-
-static int ProcXpDispatch(ClientPtr);
-static int ProcXpSwappedDispatch(ClientPtr);
-
-static int ProcXpQueryVersion(ClientPtr);
-static int ProcXpGetPrinterList(ClientPtr);
-static int ProcXpCreateContext(ClientPtr);
-static int ProcXpSetContext(ClientPtr);
-static int ProcXpGetContext(ClientPtr);
-static int ProcXpDestroyContext(ClientPtr);
-static int ProcXpGetContextScreen(ClientPtr);
-static int ProcXpStartJob(ClientPtr);
-static int ProcXpEndJob(ClientPtr);
-static int ProcXpStartDoc(ClientPtr);
-static int ProcXpEndDoc(ClientPtr);
-static int ProcXpStartPage(ClientPtr);
-static int ProcXpEndPage(ClientPtr);
-static int ProcXpSelectInput(ClientPtr);
-static int ProcXpInputSelected(ClientPtr);
-static int ProcXpPutDocumentData(ClientPtr);
-static int ProcXpGetDocumentData(ClientPtr);
-static int ProcXpGetAttributes(ClientPtr);
-static int ProcXpGetOneAttribute(ClientPtr);
-static int ProcXpSetAttributes(ClientPtr);
-static int ProcXpRehashPrinterList(ClientPtr);
-static int ProcXpQueryScreens(ClientPtr);
-static int ProcXpGetPageDimensions(ClientPtr);
-static int ProcXpSetImageResolution(ClientPtr);
-static int ProcXpGetImageResolution(ClientPtr);
-
-static void SwapXpNotifyEvent(xPrintPrintEvent *, xPrintPrintEvent *);
-static void SwapXpAttributeEvent(xPrintAttributeEvent *, xPrintAttributeEvent *);
-
-static int SProcXpGetPrinterList(ClientPtr);
-static int SProcXpCreateContext(ClientPtr);
-static int SProcXpSetContext(ClientPtr);
-static int SProcXpGetContext(ClientPtr);
-static int SProcXpDestroyContext(ClientPtr);
-static int SProcXpGetContextScreen(ClientPtr);
-static int SProcXpStartJob(ClientPtr);
-static int SProcXpEndJob(ClientPtr);
-static int SProcXpStartDoc(ClientPtr);
-static int SProcXpEndDoc(ClientPtr);
-static int SProcXpStartPage(ClientPtr);
-static int SProcXpEndPage(ClientPtr);
-static int SProcXpSelectInput(ClientPtr);
-static int SProcXpInputSelected(ClientPtr);
-static int SProcXpPutDocumentData(ClientPtr);
-static int SProcXpGetDocumentData(ClientPtr);
-static int SProcXpGetAttributes(ClientPtr);
-static int SProcXpGetOneAttribute(ClientPtr);
-static int SProcXpSetAttributes(ClientPtr);
-static int SProcXpRehashPrinterList(ClientPtr);
-static int SProcXpGetPageDimensions(ClientPtr);
-static int SProcXpSetImageResolution(ClientPtr);
-static int SProcXpGetImageResolution(ClientPtr);
-
-static void SendXpNotify(XpContextPtr, int, int);
-static void SendAttributeNotify(XpContextPtr, int);
-static int XpFreeClient(pointer, XID);
-static int XpFreeContext(pointer, XID);
-static int XpFreePage(pointer, XID);
-static Bool XpCloseScreen(int, ScreenPtr);
-static CARD32 GetAllEventMasks(XpContextPtr);
-static struct _XpClient *CreateXpClient(ClientPtr);
-static void InitContextPrivates(XpContextPtr);
-static void ResetContextPrivates(void);
-static struct _XpClient *FindClient(XpContextPtr, ClientPtr);
-static struct _XpClient *AcquireClient(XpContextPtr, ClientPtr);
-
-typedef struct _driver {
- struct _driver *next;
- char *name;
- int (* CreateContext)(XpContextPtr);
-} XpDriverRec, *XpDriverPtr;
-
-typedef struct _xpScreen {
- Bool (* CloseScreen)(int, ScreenPtr);
- struct _driver *drivers;
-} XpScreenRec, *XpScreenPtr;
-
-/*
- * Each context has a list of XpClients indicating which clients have
- * associated this context with their connection.
- * Each such client has a RTclient resource allocated for it,
- * and this per-client
- * resource is used to delete the XpClientRec if/when the client closes
- * its connection.
- * The list of XpClients is also walked if/when the context is destroyed
- * so that the ContextPtr can be removed from the client's devPrivates.
- */
-typedef struct _XpClient {
- struct _XpClient *pNext;
- ClientPtr client;
- XpContextPtr context;
- CARD32 eventMask;
- XID contextClientID; /* unneeded sanity check? */
-} XpClientRec, *XpClientPtr;
-
-static void FreeXpClient(XpClientPtr, Bool);
-
-/*
- * Each StartPage request specifies a window which forms the top level
- * window of the page. One of the following structs is created as a
- * RTpage resource with the same ID as the window itself. This enables
- * us to clean up when/if the window is destroyed, and to prevent the
- * same window from being simultaneously referenced in multiple contexts.
- * The page resource is created at the first StartPage on a given window,
- * and is only destroyed when/if the window is destroyed. When the
- * EndPage is recieved (or an EndDoc or EndJob) the context field is
- * set to NULL, but the resource remains alive.
- */
-typedef struct _XpPage {
- XpContextPtr context;
-} XpPageRec, *XpPagePtr;
-
-typedef struct _XpStPageRec {
- XpContextPtr pContext;
- Bool slept;
- XpPagePtr pPage;
- WindowPtr pWin;
-} XpStPageRec, *XpStPagePtr;
-
-typedef struct _XpStDocRec {
- XpContextPtr pContext;
- Bool slept;
- CARD8 type;
-} XpStDocRec, *XpStDocPtr;
-
-#define QUADPAD(x) ((((x)+3)>>2)<<2)
-
-/*
- * Possible bit-mask values in the "state" field of a XpContextRec.
- */
-#define JOB_STARTED (1 << 0)
-#define DOC_RAW_STARTED (1 << 1)
-#define DOC_COOKED_STARTED (1 << 2)
-#define PAGE_STARTED (1 << 3)
-#define GET_DOC_DATA_STARTED (1 << 4)
-#define JOB_GET_DATA (1 << 5)
-
-static XpScreenPtr XpScreens[MAXSCREENS];
-static unsigned char XpReqCode;
-static int XpEventBase;
-static int XpErrorBase;
-static unsigned long XpGeneration = 0;
-static int XpClientPrivateIndex;
-
-/* Variables for the context private machinery.
- * These must be initialized at compile time because
- * main() calls InitOutput before InitExtensions, and the
- * output drivers are likely to call AllocateContextPrivate.
- * These variables are reset at CloseScreen time. CloseScreen
- * is used because it occurs after FreeAllResources, and before
- * the next InitOutput cycle.
- */
-static int contextPrivateCount = 0;
-static int contextPrivateLen = 0;
-static unsigned *contextPrivateSizes = (unsigned *)NULL;
-static unsigned totalContextSize = sizeof(XpContextRec);
-
-/*
- * There are three types of resources involved. One is the resource associated
- * with the context itself, with an ID specified by a printing client. The
- * next is a resource created by us on the client's behalf (and unknown to
- * the client) when a client inits or sets a context which allows us to
- * track each client's interest in events
- * on a particular context, and also allows us to clean up this interest
- * record when/if the client's connection is closed. Finally, there is
- * a resource created for each window that's specified in a StartPage. This
- * resource carries the same ID as the window itself, and enables us to
- * easily prevent the same window being referenced in multiple contexts
- * simultaneously, and enables us to clean up if the window is destroyed
- * before the EndPage.
- */
-static RESTYPE RTclient, RTcontext, RTpage;
-
-/*
- * allEvents is the OR of all the legal event mask bits.
- */
-static CARD32 allEvents = XPPrintMask | XPAttributeMask;
-
-
-/*******************************************************************************
- *
- * ExtensionInit, Driver Init functions, QueryVersion, and Dispatch procs
- *
- ******************************************************************************/
-
-/*
- * XpExtensionInit
- *
- * Called from InitExtensions in main() usually through miinitextension
- *
- */
-
-void
-XpExtensionInit(INITARGS)
-{
- ExtensionEntry *extEntry;
- int i;
-
- RTclient = CreateNewResourceType(XpFreeClient);
- RTcontext = CreateNewResourceType(XpFreeContext);
- RTpage = CreateNewResourceType(XpFreePage);
- if (RTclient && RTcontext && RTpage &&
- (extEntry = AddExtension(XP_PRINTNAME, XP_EVENTS, XP_ERRORS,
- ProcXpDispatch, ProcXpSwappedDispatch,
- XpResetProc, StandardMinorOpcode)))
- {
- XpReqCode = (unsigned char)extEntry->base;
- XpEventBase = extEntry->eventBase;
- XpErrorBase = extEntry->errorBase;
- EventSwapVector[XpEventBase] = (EventSwapPtr) SwapXpNotifyEvent;
- EventSwapVector[XpEventBase+1] = (EventSwapPtr) SwapXpAttributeEvent;
- }
-
- if(XpGeneration != serverGeneration)
- {
- XpClientPrivateIndex = AllocateClientPrivateIndex();
- /*
- * We allocate 0 length & simply stuff a pointer to the
- * ContextRec in the DevUnion.
- */
- if(AllocateClientPrivate(XpClientPrivateIndex, 0) != TRUE)
- {
- /* we can't alloc a client private, should we bail??? XXX */
- }
- XpGeneration = serverGeneration;
- }
-
- for(i = 0; i < MAXSCREENS; i++)
- {
- /*
- * If a screen has registered with our extension, then we
- * wrap the screen's CloseScreen function to allow us to
- * reset our ContextPrivate stuff. Note that this
- * requires a printing DDX to call XpRegisterInitFunc
- * _before_ this extension is initialized - i.e. at screen init
- * time, _not_ at root window creation time.
- */
- if(XpScreens[i] != (XpScreenPtr)NULL)
- {
- XpScreens[i]->CloseScreen = screenInfo.screens[i]->CloseScreen;
- screenInfo.screens[i]->CloseScreen = XpCloseScreen;
- }
- }
- DeclareExtensionSecurity(XP_PRINTNAME, TRUE);
-}
-
-static void
-XpResetProc(ExtensionEntry *extEntry)
-{
- /*
- * We can't free up the XpScreens recs here, because extensions are
- * closed before screens, and our CloseScreen function uses the XpScreens
- * recs.
-
- int i;
-
- for(i = 0; i < MAXSCREENS; i++)
- {
- if(XpScreens[i] != (XpScreenPtr)NULL)
- Xfree(XpScreens[i]);
- XpScreens[i] = (XpScreenPtr)NULL;
- }
- */
-}
-
-static Bool
-XpCloseScreen(int index, ScreenPtr pScreen)
-{
- Bool (* CloseScreen)(int, ScreenPtr);
-
- CloseScreen = XpScreens[index]->CloseScreen;
- if(XpScreens[index] != (XpScreenPtr)NULL)
- {
- XpDriverPtr pDriv, nextDriv;
-
- pDriv = XpScreens[index]->drivers;
- while(pDriv != (XpDriverPtr)NULL)
- {
- nextDriv = pDriv->next;
- Xfree(pDriv);
- pDriv = nextDriv;
- }
- Xfree(XpScreens[index]);
- }
- XpScreens[index] = (XpScreenPtr)NULL;
-
- /*
- * It's wasteful to call ResetContextPrivates() at every CloseScreen,
- * but it's the best we know how to do for now. We do this because we
- * have to wait until after all resources have been freed (so we know
- * how to free the ContextRecs), and before the next InitOutput cycle.
- * See dix/main.c for the order of initialization and reset.
- */
- ResetContextPrivates();
- return (*CloseScreen)(index, pScreen);
-}
-
-#if 0 /* NOT USED */
-static void
-FreeScreenEntry(XpScreenPtr pScreenEntry)
-{
- XpDriverPtr pDriver;
-
- pDriver = pScreenEntry->drivers;
- while(pDriver != (XpDriverPtr)NULL)
- {
- XpDriverPtr tmp;
-
- tmp = pDriver->next;
- xfree(pDriver);
- pDriver = tmp;
- }
- xfree(pScreenEntry);
-}
-#endif
-
-/*
- * XpRegisterInitFunc tells the print extension which screens
- * are printers as opposed to displays, and what drivers are
- * supported on each screen. This eliminates the need of
- * allocating print-related private structures on windows on _all_ screens.
- * It also hands the extension a pointer to the routine to be called
- * whenever a context gets created for a particular driver on this screen.
- */
-void
-XpRegisterInitFunc(ScreenPtr pScreen, char *driverName, int (*initContext)(struct _XpContext *))
-{
- XpDriverPtr pDriver;
-
- if(XpScreens[pScreen->myNum] == 0)
- {
- if((XpScreens[pScreen->myNum] =
- (XpScreenPtr) Xalloc(sizeof(XpScreenRec))) == 0)
- return;
- XpScreens[pScreen->myNum]->CloseScreen = 0;
- XpScreens[pScreen->myNum]->drivers = 0;
- }
-
- if((pDriver = (XpDriverPtr)Xalloc(sizeof(XpDriverRec))) == 0)
- return;
- pDriver->next = XpScreens[pScreen->myNum]->drivers;
- pDriver->name = driverName;
- pDriver->CreateContext = initContext;
- XpScreens[pScreen->myNum]->drivers = pDriver;
-}
-
-static int
-ProcXpDispatch(ClientPtr client)
-{
- REQUEST(xReq);
-
- switch(stuff->data)
- {
- case X_PrintQueryVersion:
- return ProcXpQueryVersion(client);
- case X_PrintGetPrinterList:
- return ProcXpGetPrinterList(client);
- case X_PrintCreateContext:
- return ProcXpCreateContext(client);
- case X_PrintSetContext:
- return ProcXpSetContext(client);
- case X_PrintGetContext:
- return ProcXpGetContext(client);
- case X_PrintDestroyContext:
- return ProcXpDestroyContext(client);
- case X_PrintGetContextScreen:
- return ProcXpGetContextScreen(client);
- case X_PrintStartJob:
- return ProcXpStartJob(client);
- case X_PrintEndJob:
- return ProcXpEndJob(client);
- case X_PrintStartDoc:
- return ProcXpStartDoc(client);
- case X_PrintEndDoc:
- return ProcXpEndDoc(client);
- case X_PrintStartPage:
- return ProcXpStartPage(client);
- case X_PrintEndPage:
- return ProcXpEndPage(client);
- case X_PrintSelectInput:
- return ProcXpSelectInput(client);
- case X_PrintInputSelected:
- return ProcXpInputSelected(client);
- case X_PrintPutDocumentData:
- return ProcXpPutDocumentData(client);
- case X_PrintGetDocumentData:
- return ProcXpGetDocumentData(client);
- case X_PrintSetAttributes:
- return ProcXpSetAttributes(client);
- case X_PrintGetAttributes:
- return ProcXpGetAttributes(client);
- case X_PrintGetOneAttribute:
- return ProcXpGetOneAttribute(client);
- case X_PrintRehashPrinterList:
- return ProcXpRehashPrinterList(client);
- case X_PrintQueryScreens:
- return ProcXpQueryScreens(client);
- case X_PrintGetPageDimensions:
- return ProcXpGetPageDimensions(client);
- case X_PrintSetImageResolution:
- return ProcXpSetImageResolution(client);
- case X_PrintGetImageResolution:
- return ProcXpGetImageResolution(client);
- default:
- return BadRequest;
- }
-}
-
-static int
-ProcXpSwappedDispatch(ClientPtr client)
-{
- int temp;
- REQUEST(xReq);
-
- switch(stuff->data)
- {
- case X_PrintQueryVersion:
- swaps(&stuff->length, temp);
- return ProcXpQueryVersion(client);
- case X_PrintGetPrinterList:
- return SProcXpGetPrinterList(client);
- case X_PrintCreateContext:
- return SProcXpCreateContext(client);
- case X_PrintSetContext:
- return SProcXpSetContext(client);
- case X_PrintGetContext:
- return SProcXpGetContext(client);
- case X_PrintDestroyContext:
- return SProcXpDestroyContext(client);
- case X_PrintGetContextScreen:
- return SProcXpGetContextScreen(client);
- case X_PrintStartJob:
- return SProcXpStartJob(client);
- case X_PrintEndJob:
- return SProcXpEndJob(client);
- case X_PrintStartDoc:
- return SProcXpStartDoc(client);
- case X_PrintEndDoc:
- return SProcXpEndDoc(client);
- case X_PrintStartPage:
- return SProcXpStartPage(client);
- case X_PrintEndPage:
- return SProcXpEndPage(client);
- case X_PrintSelectInput:
- return SProcXpSelectInput(client);
- case X_PrintInputSelected:
- return SProcXpInputSelected(client);
- case X_PrintPutDocumentData:
- return SProcXpPutDocumentData(client);
- case X_PrintGetDocumentData:
- return SProcXpGetDocumentData(client);
- case X_PrintSetAttributes:
- return SProcXpSetAttributes(client);
- case X_PrintGetAttributes:
- return SProcXpGetAttributes(client);
- case X_PrintGetOneAttribute:
- return SProcXpGetOneAttribute(client);
- case X_PrintRehashPrinterList:
- return SProcXpRehashPrinterList(client);
- case X_PrintQueryScreens:
- swaps(&stuff->length, temp);
- return ProcXpQueryScreens(client);
- case X_PrintGetPageDimensions:
- return SProcXpGetPageDimensions(client);
- case X_PrintSetImageResolution:
- return SProcXpSetImageResolution(client);
- case X_PrintGetImageResolution:
- return SProcXpGetImageResolution(client);
- default:
- return BadRequest;
- }
-}
-
-static int
-ProcXpQueryVersion(ClientPtr client)
-{
- /* REQUEST(xPrintQueryVersionReq); */
- xPrintQueryVersionReply rep;
- register int n;
- long l;
-
- REQUEST_SIZE_MATCH(xPrintQueryVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = XP_MAJOR_VERSION;
- rep.minorVersion = XP_MINOR_VERSION;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, l);
- swaps(&rep.majorVersion, n);
- swaps(&rep.minorVersion, n);
- }
- WriteToClient(client, sz_xPrintQueryVersionReply, (char *)&rep);
- return client->noClientException;
-}
-
-/*******************************************************************************
- *
- * GetPrinterList : Return a list of all printers associated with this
- * server. Calls XpDiGetPrinterList, which is defined in
- * the device-independent code in Xserver/Xprint.
- *
- ******************************************************************************/
-
-static int
-ProcXpGetPrinterList(ClientPtr client)
-{
- REQUEST(xPrintGetPrinterListReq);
- int totalSize;
- int numEntries;
- XpDiListEntry **pList;
- xPrintGetPrinterListReply *rep;
- int n, i, totalBytes;
- long l;
- char *curByte;
-
- REQUEST_AT_LEAST_SIZE(xPrintGetPrinterListReq);
-
- totalSize = ((sz_xPrintGetPrinterListReq) >> 2) +
- ((stuff->printerNameLen + 3) >> 2) +
- ((stuff->localeLen + 3) >> 2);
- if(totalSize != client->req_len)
- return BadLength;
-
- pList = XpDiGetPrinterList(stuff->printerNameLen, (char *)(stuff + 1),
- stuff->localeLen, (char *)((stuff + 1) +
- QUADPAD(stuff->printerNameLen)));
-
- for(numEntries = 0, totalBytes = sz_xPrintGetPrinterListReply;
- pList[numEntries] != (XpDiListEntry *)NULL;
- numEntries++)
- {
- totalBytes += 2 * sizeof(CARD32);
- totalBytes += QUADPAD(strlen(pList[numEntries]->name));
- totalBytes += QUADPAD(strlen(pList[numEntries]->description));
- }
-
- if((rep = (xPrintGetPrinterListReply *)xalloc(totalBytes)) ==
- (xPrintGetPrinterListReply *)NULL)
- return BadAlloc;
-
- rep->type = X_Reply;
- rep->length = (totalBytes - sz_xPrintGetPrinterListReply) >> 2;
- rep->sequenceNumber = client->sequence;
- rep->listCount = numEntries;
- if (client->swapped) {
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, l);
- swapl(&rep->listCount, l);
- }
-
- for(i = 0, curByte = (char *)(rep + 1); i < numEntries; i++)
- {
- CARD32 *pCrd;
- int len;
-
- pCrd = (CARD32 *)curByte;
- len = strlen(pList[i]->name);
- *pCrd = len;
- if (client->swapped)
- swapl((long *)curByte, l);
- curByte += sizeof(CARD32);
- strncpy(curByte, pList[i]->name, len);
- curByte += QUADPAD(len);
-
- pCrd = (CARD32 *)curByte;
- len = strlen(pList[i]->description);
- *pCrd = len;
- if (client->swapped)
- swapl((long *)curByte, l);
- curByte += sizeof(CARD32);
- strncpy(curByte, pList[i]->description, len);
- curByte += QUADPAD(len);
- }
-
- XpDiFreePrinterList(pList);
-
- WriteToClient(client, totalBytes, (char *)rep);
- xfree(rep);
- return client->noClientException;
-}
-
-/*******************************************************************************
- *
- * QueryScreens: Returns the list of screens which are associated with
- * print drivers.
- *
- ******************************************************************************/
-
-static int
-ProcXpQueryScreens(ClientPtr client)
-{
- /* REQUEST(xPrintQueryScreensReq); */
- int i, numPrintScreens, totalSize;
- WINDOW *pWinId;
- xPrintQueryScreensReply *rep;
- long l;
-
- REQUEST_SIZE_MATCH(xPrintQueryScreensReq);
-
- rep = (xPrintQueryScreensReply *)xalloc(sz_xPrintQueryScreensReply);
- pWinId = (WINDOW *)(rep + 1);
-
- for(i = 0, numPrintScreens = 0, totalSize = sz_xPrintQueryScreensReply;
- i < MAXSCREENS; i++)
- {
- /*
- * If a screen has registered with our extension, then it's
- * a printer screen.
- */
- if(XpScreens[i] != (XpScreenPtr)NULL)
- {
- numPrintScreens++;
- totalSize += sizeof(WINDOW);
- rep = (xPrintQueryScreensReply *)xrealloc(rep, totalSize);
- /* fix of bug: pWinId should be set again after reallocate rep */
- pWinId = (WINDOW *)(rep + 1);
- *pWinId = WindowTable[i]->drawable.id;
- if (client->swapped)
- swapl((long *)pWinId, l);
- }
- }
-
- rep->type = X_Reply;
- rep->sequenceNumber = client->sequence;
- rep->length = (totalSize - sz_xPrintQueryScreensReply) >> 2;
- rep->listCount = numPrintScreens;
- if (client->swapped)
- {
- int n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, l);
- swapl(&rep->listCount, l);
- }
-
- WriteToClient(client, totalSize, (char *)rep);
- xfree(rep);
- return client->noClientException;
-}
-
-static int
-ProcXpGetPageDimensions(ClientPtr client)
-{
- REQUEST(xPrintGetPageDimensionsReq);
- CARD16 width, height;
- xRectangle rect;
- xPrintGetPageDimensionsReply rep;
- XpContextPtr pContext;
- int result;
-
- REQUEST_SIZE_MATCH(xPrintGetPageDimensionsReq);
-
- if((pContext =(XpContextPtr)SecurityLookupIDByType(client,
- stuff->printContext,
- RTcontext,
- SecurityReadAccess))
- == (XpContextPtr)NULL)
- {
- client->errorValue = stuff->printContext;
- return XpErrorBase+XPBadContext;
- }
-
- if((pContext->funcs.GetMediumDimensions == 0) ||
- (pContext->funcs.GetReproducibleArea == 0))
- return BadImplementation;
-
- result = pContext->funcs.GetMediumDimensions(pContext, &width, &height);
- if(result != Success)
- return result;
-
- result = pContext->funcs.GetReproducibleArea(pContext, &rect);
- if(result != Success)
- return result;
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.width = width;
- rep.height = height;
- rep.rx = rect.x;
- rep.ry = rect.y;
- rep.rwidth = rect.width;
- rep.rheight = rect.height;
-
- if(client->swapped)
- {
- int n;
- long l;
-
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, l);
- swaps(&rep.width, n);
- swaps(&rep.height, n);
- swaps(&rep.rx, n);
- swaps(&rep.ry, n);
- swaps(&rep.rwidth, n);
- swaps(&rep.rheight, n);
- }
-
- WriteToClient(client, sz_xPrintGetPageDimensionsReply, (char *)&rep);
- return client->noClientException;
-}
-
-static int
-ProcXpSetImageResolution(ClientPtr client)
-{
- REQUEST(xPrintSetImageResolutionReq);
- xPrintSetImageResolutionReply rep;
- XpContextPtr pContext;
- Bool status;
- int result;
-
- REQUEST_SIZE_MATCH(xPrintSetImageResolutionReq);
-
- if((pContext =(XpContextPtr)SecurityLookupIDByType(client,
- stuff->printContext,
- RTcontext,
- SecurityWriteAccess))
- == (XpContextPtr)NULL)
- {
- client->errorValue = stuff->printContext;
- return XpErrorBase+XPBadContext;
- }
-
- rep.prevRes = pContext->imageRes;
- if(pContext->funcs.SetImageResolution != 0) {
- result = pContext->funcs.SetImageResolution(pContext,
- (int)stuff->imageRes,
- &status);
- if(result != Success)
- status = FALSE;
- } else
- status = FALSE;
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.status = status;
-
- if(client->swapped)
- {
- int n;
- long l;
-
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, l);
- swaps(&rep.prevRes, n);
- }
-
- WriteToClient(client, sz_xPrintSetImageResolutionReply, (char *)&rep);
- return client->noClientException;
-}
-
-static int
-ProcXpGetImageResolution(ClientPtr client)
-{
- REQUEST(xPrintGetImageResolutionReq);
- xPrintGetImageResolutionReply rep;
- XpContextPtr pContext;
-
- REQUEST_SIZE_MATCH(xPrintGetImageResolutionReq);
-
- if((pContext =(XpContextPtr)SecurityLookupIDByType(client,
- stuff->printContext,
- RTcontext,
- SecurityReadAccess))
- == (XpContextPtr)NULL)
- {
- client->errorValue = stuff->printContext;
- return XpErrorBase+XPBadContext;
- }
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.imageRes = pContext->imageRes;
-
- if(client->swapped)
- {
- int n;
- long l;
-
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, l);
- swaps(&rep.imageRes, n);
- }
-
- WriteToClient(client, sz_xPrintGetImageResolutionReply, (char *)&rep);
- return client->noClientException;
-}
-
-/*******************************************************************************
- *
- * RehashPrinterList : Cause the server's list of printers to be rebuilt.
- * This allows new printers to be added, or old ones
- * deleted without needing to restart the server.
- *
- ******************************************************************************/
-
-static int
-ProcXpRehashPrinterList(ClientPtr client)
-{
- /* REQUEST(xPrintRehashPrinterListReq); */
-
- REQUEST_SIZE_MATCH(xPrintRehashPrinterListReq);
-
- return XpRehashPrinterList();
-}
-
-/******************************************************************************
- *
- * Context functions: Init, Set, Destroy, FreeContext
- * AllocateContextPrivateIndex, AllocateContextPrivate
- * and supporting functions.
- *
- * Init creates a context, creates a XpClientRec for the calling
- * client, and stores the contextPtr in the client's devPrivates.
- *
- * Set creates a XpClientRec for the calling client, and stores the
- * contextPtr in the client's devPrivates unless the context is None.
- * If the context is None, then the client's connection association
- * with any context is removed.
- *
- * Destroy frees any and all XpClientRecs associated with the context,
- * frees the context itself, and removes the contextPtr from any
- * relevant client devPrivates.
- *
- * FreeContext is called by FreeResource to free up a context.
- *
- ******************************************************************************/
-
-/*
- * CreateContext creates and initializes the memory for the context itself.
- * The driver's CreateContext function
- * is then called.
- */
-static int
-ProcXpCreateContext(ClientPtr client)
-{
- REQUEST(xPrintCreateContextReq);
- XpScreenPtr pPrintScreen;
- WindowPtr pRoot;
- char *driverName;
- XpContextPtr pContext;
- int result = Success;
- XpDriverPtr pDriver;
-
- REQUEST_AT_LEAST_SIZE(xPrintCreateContextReq);
-
- LEGAL_NEW_RESOURCE(stuff->contextID, client);
-
- /*
- * Check to see if the printer name is valid.
- */
- if((pRoot = XpDiValidatePrinter((char *)(stuff + 1), stuff->printerNameLen)) ==
- (WindowPtr)NULL)
- return BadMatch;
-
- pPrintScreen = XpScreens[pRoot->drawable.pScreen->myNum];
-
- /*
- * Allocate and add the context resource.
- */
- if((pContext = (XpContextPtr) xalloc(totalContextSize)) ==
- (XpContextPtr) NULL)
- return BadAlloc;
-
- InitContextPrivates(pContext);
-
- if(AddResource(stuff->contextID, RTcontext, (pointer) pContext)
- != TRUE)
- {
- xfree(pContext);
- return BadAlloc;
- }
-
- pContext->contextID = stuff->contextID;
- pContext->clientHead = (XpClientPtr)NULL;
- pContext->screenNum = pRoot->drawable.pScreen->myNum;
- pContext->state = 0;
- pContext->clientSlept = (ClientPtr)NULL;
- pContext->imageRes = 0;
-
- pContext->funcs.DestroyContext = 0;
- pContext->funcs.StartJob = 0;
- pContext->funcs.EndJob = 0;
- pContext->funcs.StartDoc = 0;
- pContext->funcs.EndDoc = 0;
- pContext->funcs.StartPage = 0;
- pContext->funcs.EndPage = 0;
- pContext->funcs.PutDocumentData = 0;
- pContext->funcs.GetDocumentData = 0;
- pContext->funcs.GetAttributes = 0;
- pContext->funcs.GetOneAttribute = 0;
- pContext->funcs.SetAttributes = 0;
- pContext->funcs.AugmentAttributes = 0;
- pContext->funcs.GetMediumDimensions = 0;
- pContext->funcs.GetReproducibleArea = 0;
- pContext->funcs.SetImageResolution = 0;
-
- if((pContext->printerName = (char *)xalloc(stuff->printerNameLen + 1)) ==
- (char *)NULL)
- {
- /* Freeing the context also causes the XpClients to be freed. */
- FreeResource(stuff->contextID, RT_NONE);
- return BadAlloc;
- }
- strncpy(pContext->printerName, (char *)(stuff + 1), stuff->printerNameLen);
- pContext->printerName[stuff->printerNameLen] = (char)'\0';
-
- driverName = XpDiGetDriverName(pRoot->drawable.pScreen->myNum,
- pContext->printerName);
-
- for(pDriver = pPrintScreen->drivers;
- pDriver != (XpDriverPtr)NULL;
- pDriver = pDriver->next)
- {
- if(!strcmp(driverName, pDriver->name))
- {
- if(pDriver->CreateContext != 0)
- pDriver->CreateContext(pContext);
- else
- return BadImplementation;
- break;
- }
- }
-
- if (client->noClientException != Success)
- return client->noClientException;
- else
- return result;
-}
-
-/*
- * SetContext creates the calling client's contextClient resource,
- * and stashes the contextID in the client's devPrivate.
- */
-static int
-ProcXpSetContext(ClientPtr client)
-{
- REQUEST(xPrintSetContextReq);
-
- XpContextPtr pContext;
- XpClientPtr pPrintClient;
- int result = Success;
-
- REQUEST_AT_LEAST_SIZE(xPrintSetContextReq);
-
- if((pContext = client->devPrivates[XpClientPrivateIndex].ptr) !=
- (pointer)NULL)
- {
- /*
- * Erase this client's knowledge of its old context, if any.
- */
- if((pPrintClient = FindClient(pContext, client)) != (XpClientPtr)NULL)
- {
- XpUnsetFontResFunc(client);
-
- if(pPrintClient->eventMask == 0)
- FreeXpClient(pPrintClient, TRUE);
- }
-
- client->devPrivates[XpClientPrivateIndex].ptr = (pointer)NULL;
- }
- if(stuff->printContext == None)
- return Success;
-
- /*
- * Check to see that the supplied XID is really a valid print context
- * in this server.
- */
- if((pContext =(XpContextPtr)SecurityLookupIDByType(client,
- stuff->printContext,
- RTcontext,
- SecurityWriteAccess))
- == (XpContextPtr)NULL)
- {
- client->errorValue = stuff->printContext;
- return XpErrorBase+XPBadContext;
- }
-
- if((pPrintClient = AcquireClient(pContext, client)) == (XpClientPtr)NULL)
- return BadAlloc;
-
- client->devPrivates[XpClientPrivateIndex].ptr = pContext;
-
- XpSetFontResFunc(client);
-
- if (client->noClientException != Success)
- return client->noClientException;
- else
- return result;
-}
-
-XpContextPtr
-XpGetPrintContext(ClientPtr client)
-{
- return (client->devPrivates[XpClientPrivateIndex].ptr);
-}
-
-static int
-ProcXpGetContext(ClientPtr client)
-{
- /* REQUEST(xPrintGetContextReq); */
- xPrintGetContextReply rep;
-
- XpContextPtr pContext;
- register int n;
- register long l;
-
- REQUEST_SIZE_MATCH(xPrintGetContextReq);
-
- if((pContext = client->devPrivates[XpClientPrivateIndex].ptr) ==
- (pointer)NULL)
- rep.printContext = None;
- else
- rep.printContext = pContext->contextID;
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, l);
- swapl(&rep.printContext, l);
- }
- WriteToClient(client, sz_xPrintGetContextReply, (char *)&rep);
- return client->noClientException;
-}
-
-
-/*
- * DestroyContext frees the context associated with the calling client.
- * It operates by freeing the context resource ID, thus causing XpFreeContext
- * to be called.
- */
-static int
-ProcXpDestroyContext(ClientPtr client)
-{
- REQUEST(xPrintDestroyContextReq);
-
- XpContextPtr pContext;
-
- REQUEST_SIZE_MATCH(xPrintDestroyContextReq);
-
- if((pContext =(XpContextPtr)SecurityLookupIDByType(client,
- stuff->printContext,
- RTcontext,
- SecurityDestroyAccess))
- == (XpContextPtr)NULL)
- {
- client->errorValue = stuff->printContext;
- return XpErrorBase+XPBadContext;
- }
-
- XpUnsetFontResFunc(client);
-
- FreeResource(pContext->contextID, RT_NONE);
-
- return Success;
-}
-
-static int
-ProcXpGetContextScreen(ClientPtr client)
-{
- REQUEST(xPrintGetContextScreenReq);
- xPrintGetContextScreenReply rep;
- XpContextPtr pContext;
- int n;
- long l;
-
- if((pContext =(XpContextPtr)SecurityLookupIDByType(client,
- stuff->printContext,
- RTcontext,
- SecurityReadAccess))
- == (XpContextPtr)NULL)
- return XpErrorBase+XPBadContext;
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.rootWindow = WindowTable[pContext->screenNum]->drawable.id;
-
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, l);
- swapl(&rep.rootWindow, l);
- }
-
- WriteToClient(client, sz_xPrintGetContextScreenReply, (char *)&rep);
- return client->noClientException;
-}
-
-/*
- * XpFreeContext is the routine called by dix:FreeResource when a context
- * resource ID is freed.
- * It checks to see if there's a partial job pending on the context, and
- * if so it calls the appropriate End procs with the cancel flag set.
- * It calls the driver's DestroyContext routine to allow the driver to clean
- * up any context-related memory or state.
- * It calls FreeXpClient to free all the
- * associated XpClientRecs and to set all the client->devPrivates to NULL.
- * It frees the printer name string, and frees the context
- * itself.
- */
-static int
-XpFreeContext(pointer data, XID id)
-{
- XpContextPtr pContext = (XpContextPtr)data;
-
- /* Clean up any pending job on this context */
- if(pContext->state != 0)
- {
- if(pContext->state & PAGE_STARTED)
- {
- WindowPtr pWin = (WindowPtr )LookupIDByType(
- pContext->pageWin, RT_WINDOW);
- XpPagePtr pPage = (XpPagePtr)LookupIDByType(
- pContext->pageWin, RTpage);
-
- pContext->funcs.EndPage(pContext, pWin);
- SendXpNotify(pContext, XPEndPageNotify, TRUE);
- pContext->state &= ~PAGE_STARTED;
- if(pPage)
- pPage->context = (XpContextPtr)NULL;
- }
- if((pContext->state & DOC_RAW_STARTED) ||
- (pContext->state & DOC_COOKED_STARTED))
- {
- pContext->funcs.EndDoc(pContext, TRUE);
- SendXpNotify(pContext, XPEndDocNotify, TRUE);
- pContext->state &= ~DOC_RAW_STARTED;
- pContext->state &= ~DOC_COOKED_STARTED;
- }
- if(pContext->funcs.EndJob != 0)
- {
- pContext->funcs.EndJob(pContext, TRUE);
- SendXpNotify(pContext, XPEndJobNotify, TRUE);
- pContext->state &= ~JOB_STARTED;
- pContext->state &= ~GET_DOC_DATA_STARTED;
- }
- }
-
- /*
- * Tell the driver we're destroying the context
- * This allows the driver to free and ContextPrivate data
- */
- if(pContext->funcs.DestroyContext != 0)
- pContext->funcs.DestroyContext(pContext);
-
- /* Free up all the XpClientRecs */
- while(pContext->clientHead != (XpClientPtr)NULL)
- {
- FreeXpClient(pContext->clientHead, TRUE);
- }
-
- xfree(pContext->printerName);
- xfree(pContext);
- return Success; /* ??? */
-}
-
-/*
- * XpFreeClient is the routine called by dix:FreeResource when a RTclient
- * is freed. It simply calls the FreeXpClient routine to do the work.
- */
-static int
-XpFreeClient(pointer data, XID id)
-{
- FreeXpClient((XpClientPtr)data, TRUE);
- return Success;
-}
-
-/*
- * FreeXpClient
- * frees the ClientRec passed in, and sets the client->devPrivates to NULL
- * if the client->devPrivates points to the same context as the XpClient.
- * Called from XpFreeContext(from FreeResource), and
- * XpFreeClient. The boolean freeResource specifies whether or not to call
- * FreeResource for the XpClientRec's XID. We should free it except if we're
- * called from XpFreeClient (which is itself called from FreeResource for the
- * XpClientRec's XID).
- */
-static void
-FreeXpClient(XpClientPtr pXpClient, Bool freeResource)
-{
- XpClientPtr pCurrent, pPrev;
- XpContextPtr pContext = pXpClient->context;
-
- /*
- * If we're freeing the clientRec associated with the context tied
- * to the client's devPrivates, then we need to clear the devPrivates.
- */
- if(pXpClient->client->devPrivates[XpClientPrivateIndex].ptr ==
- pXpClient->context)
- {
- pXpClient->client->devPrivates[XpClientPrivateIndex].ptr =
- (pointer)NULL;
- }
-
- for(pPrev = (XpClientPtr)NULL, pCurrent = pContext->clientHead;
- pCurrent != (XpClientPtr)NULL;
- pCurrent = pCurrent->pNext)
- {
- if(pCurrent == pXpClient)
- {
- if(freeResource == TRUE)
- FreeResource (pCurrent->contextClientID, RTclient);
-
- if (pPrev != (XpClientPtr)NULL)
- pPrev->pNext = pCurrent->pNext;
- else
- pContext->clientHead = pCurrent->pNext;
-
- xfree (pCurrent);
- break;
- }
- pPrev = pCurrent;
- }
-}
-
-/*
- * CreateXpClient takes a ClientPtr and returns a pointer to a
- * XpClientRec which it allocates. It also initializes the Rec,
- * including adding a resource on behalf of the client to enable the
- * freeing of the Rec when the client's connection is closed.
- */
-static XpClientPtr
-CreateXpClient(ClientPtr client)
-{
- XpClientPtr pNewPrintClient;
- XID clientResource;
-
- if((pNewPrintClient = (XpClientPtr)xalloc(sizeof(XpClientRec))) ==
- (XpClientPtr)NULL)
- return (XpClientPtr)NULL;
-
- clientResource = FakeClientID(client->index);
- if(!AddResource(clientResource, RTclient, (pointer)pNewPrintClient))
- {
- xfree (pNewPrintClient);
- return (XpClientPtr)NULL;
- }
-
- pNewPrintClient->pNext = (XpClientPtr)NULL;
- pNewPrintClient->client = client;
- pNewPrintClient->context = (XpContextPtr)NULL;
- pNewPrintClient->eventMask = 0;
- pNewPrintClient->contextClientID = clientResource;
-
- return pNewPrintClient;
-}
-
-/*
- * XpFreePage is the routine called by dix:FreeResource to free the page
- * resource built with the same ID as a page window. It checks to see
- * if we're in the middle of a page, and if so calls the driver's EndPage
- * function with 'cancel' set TRUE. It frees the memory associated with
- * the page resource.
- */
-static int
-XpFreePage(pointer data, XID id)
-{
- XpPagePtr page = (XpPagePtr)data;
- int result = Success;
- WindowPtr pWin = (WindowPtr )LookupIDByType(id, RT_WINDOW);
-
- /* Check to see if the window's being deleted in the middle of a page */
- if(page->context != (XpContextPtr)NULL &&
- page->context->state & PAGE_STARTED)
- {
- if(page->context->funcs.EndPage != 0)
- result = page->context->funcs.EndPage(page->context, pWin);
- SendXpNotify(page->context, XPEndPageNotify, (int)TRUE);
- page->context->pageWin = 0; /* None, NULL??? XXX */
- }
-
- xfree(page);
- return result;
-}
-
-/*
- * ContextPrivate machinery.
- * Context privates are intended for use by the drivers, allowing the
- * drivers to maintain context-specific data. The driver should free
- * the associated data at DestroyContext time.
- */
-
-static void
-InitContextPrivates(XpContextPtr context)
-{
- register char *ptr;
- DevUnion *ppriv;
- register unsigned *sizes;
- register unsigned size;
- register int i;
-
- if (totalContextSize == sizeof(XpContextRec))
- ppriv = (DevUnion *)NULL;
- else
- ppriv = (DevUnion *)(context + 1);
-
- context->devPrivates = ppriv;
- sizes = contextPrivateSizes;
- ptr = (char *)(ppriv + contextPrivateLen);
- for (i = contextPrivateLen; --i >= 0; ppriv++, sizes++)
- {
- if ( (size = *sizes) )
- {
- ppriv->ptr = (pointer)ptr;
- ptr += size;
- }
- else
- ppriv->ptr = (pointer)NULL;
- }
-}
-
-static void
-ResetContextPrivates(void)
-{
- contextPrivateCount = 0;
- contextPrivateLen = 0;
- xfree(contextPrivateSizes);
- contextPrivateSizes = (unsigned *)NULL;
- totalContextSize = sizeof(XpContextRec);
-
-}
-
-int
-XpAllocateContextPrivateIndex(void)
-{
- return contextPrivateCount++;
-}
-
-Bool
-XpAllocateContextPrivate(int index, unsigned amount)
-{
- unsigned oldamount;
-
- if (index >= contextPrivateLen)
- {
- unsigned *nsizes;
- nsizes = (unsigned *)xrealloc(contextPrivateSizes,
- (index + 1) * sizeof(unsigned));
- if (!nsizes)
- return FALSE;
- while (contextPrivateLen <= index)
- {
- nsizes[contextPrivateLen++] = 0;
- totalContextSize += sizeof(DevUnion);
- }
- contextPrivateSizes = nsizes;
- }
- oldamount = contextPrivateSizes[index];
- if (amount > oldamount)
- {
- contextPrivateSizes[index] = amount;
- totalContextSize += (amount - oldamount);
- }
- return TRUE;
-}
-
-static XpClientPtr
-AcquireClient(XpContextPtr pContext, ClientPtr client)
-{
- XpClientPtr pXpClient;
-
- if((pXpClient = FindClient(pContext, client)) != (XpClientPtr)NULL)
- return pXpClient;
-
- if((pXpClient = CreateXpClient(client)) == (XpClientPtr)NULL)
- return (XpClientPtr)NULL;
-
- pXpClient->context = pContext;
- pXpClient->pNext = pContext->clientHead;
- pContext->clientHead = pXpClient;
-
- return pXpClient;
-}
-
-static XpClientPtr
-FindClient(XpContextPtr pContext, ClientPtr client)
-{
- XpClientPtr pXpClient;
-
- for(pXpClient = pContext->clientHead; pXpClient != (XpClientPtr)NULL;
- pXpClient = pXpClient->pNext)
- {
- if(pXpClient->client == client) return pXpClient;
- }
- return (XpClientPtr)NULL;
-}
-
-
-/******************************************************************************
- *
- * Start/End Functions: StartJob, EndJob, StartDoc, EndDoc, StartPage, EndPage
- *
- ******************************************************************************/
-
-static int
-ProcXpStartJob(ClientPtr client)
-{
- REQUEST(xPrintStartJobReq);
- XpContextPtr pContext;
- int result = Success;
-
- REQUEST_SIZE_MATCH(xPrintStartJobReq);
-
- /* Check to see that a context has been established by this client. */
- if((pContext = (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr)
- == (XpContextPtr)NULL)
- return XpErrorBase+XPBadContext;
-
- if(pContext->state != 0)
- return XpErrorBase+XPBadSequence;
-
- if(stuff->saveData != XPSpool && stuff->saveData != XPGetData)
- {
- client->errorValue = stuff->saveData;
- return BadValue;
- }
-
- if(pContext->funcs.StartJob != 0)
- result = pContext->funcs.StartJob(pContext,
- (stuff->saveData == XPGetData)? TRUE:FALSE,
- client);
- else
- return BadImplementation;
-
- pContext->state = JOB_STARTED;
- if(stuff->saveData == XPGetData)
- pContext->state |= JOB_GET_DATA;
-
- SendXpNotify(pContext, XPStartJobNotify, FALSE);
-
- if (client->noClientException != Success)
- return client->noClientException;
- else
- return result;
-}
-
-static int
-ProcXpEndJob(ClientPtr client)
-{
- REQUEST(xPrintEndJobReq);
- int result = Success;
- XpContextPtr pContext;
-
- REQUEST_SIZE_MATCH(xPrintEndJobReq);
-
- if((pContext = (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr)
- == (XpContextPtr)NULL)
- return XpErrorBase+XPBadSequence;
-
- if(!(pContext->state & JOB_STARTED))
- return XpErrorBase+XPBadSequence;
-
- /* Check for missing EndDoc */
- if((pContext->state & DOC_RAW_STARTED) ||
- (pContext->state & DOC_COOKED_STARTED))
- {
- if(pContext->state & PAGE_STARTED)
- {
- WindowPtr pWin = (WindowPtr )LookupIDByType(
- pContext->pageWin, RT_WINDOW);
- XpPagePtr pPage = (XpPagePtr)LookupIDByType(
- pContext->pageWin, RTpage);
-
- if(stuff->cancel != TRUE)
- return XpErrorBase+XPBadSequence;
-
- if(pContext->funcs.EndPage != 0)
- result = pContext->funcs.EndPage(pContext, pWin);
- else
- return BadImplementation;
-
- SendXpNotify(pContext, XPEndPageNotify, TRUE);
-
- pContext->state &= ~PAGE_STARTED;
-
- if(pPage)
- pPage->context = (XpContextPtr)NULL;
-
- if(result != Success) return result;
- }
-
- if(pContext->funcs.EndDoc != 0)
- result = pContext->funcs.EndDoc(pContext, stuff->cancel);
- else
- return BadImplementation;
-
- SendXpNotify(pContext, XPEndDocNotify, stuff->cancel);
- }
-
- if(pContext->funcs.EndJob != 0)
- result = pContext->funcs.EndJob(pContext, stuff->cancel);
- else
- return BadImplementation;
-
- pContext->state = 0;
-
- SendXpNotify(pContext, XPEndJobNotify, stuff->cancel);
-
- if (client->noClientException != Success)
- return client->noClientException;
- else
- return result;
-}
-
-static Bool
-DoStartDoc(ClientPtr client, XpStDocPtr c)
-{
- XpContextPtr pContext = c->pContext;
-
- if(c->pContext->state & JOB_GET_DATA &&
- !(c->pContext->state & GET_DOC_DATA_STARTED))
- {
- if(!c->slept)
- {
- c->slept = TRUE;
- ClientSleep(client, (ClientSleepProcPtr)DoStartDoc, (pointer) c);
- c->pContext->clientSlept = client;
- }
- return TRUE;
- }
-
- if(pContext->funcs.StartDoc != 0)
- (void) pContext->funcs.StartDoc(pContext, c->type);
- else
- {
- SendErrorToClient(client, XpReqCode, X_PrintStartPage, 0,
- BadImplementation);
- return TRUE;
- }
-
- if(c->type == XPDocNormal)
- pContext->state |= DOC_COOKED_STARTED;
- else
- pContext->state |= DOC_RAW_STARTED;
-
- SendXpNotify(pContext, XPStartDocNotify, (int)FALSE);
-
- xfree(c);
- return TRUE;
-}
-
-static int
-ProcXpStartDoc(ClientPtr client)
-{
- REQUEST(xPrintStartDocReq);
- int result = Success;
- XpContextPtr pContext;
- XpStDocPtr c;
-
- REQUEST_SIZE_MATCH(xPrintStartDocReq);
-
- if((pContext = (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr)
- == (XpContextPtr)NULL)
- return XpErrorBase+XPBadSequence;
-
- if(!(pContext->state & JOB_STARTED) ||
- pContext->state & DOC_RAW_STARTED ||
- pContext->state & DOC_COOKED_STARTED)
- return XpErrorBase+XPBadSequence;
-
- if(stuff->type != XPDocNormal && stuff->type != XPDocRaw)
- {
- client->errorValue = stuff->type;
- return BadValue;
- }
-
- c = (XpStDocPtr)xalloc(sizeof(XpStDocRec));
- c->pContext = pContext;
- c->type = stuff->type;
- c->slept = FALSE;
- (void)DoStartDoc(client, c);
-
- if (client->noClientException != Success)
- return client->noClientException;
- else
- return result;
-}
-
-static int
-ProcXpEndDoc(ClientPtr client)
-{
- REQUEST(xPrintEndDocReq);
- XpContextPtr pContext;
- int result = Success;
-
- REQUEST_SIZE_MATCH(xPrintEndDocReq);
-
- if((pContext = (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr)
- == (XpContextPtr)NULL)
- return XpErrorBase+XPBadSequence;
-
- if(!(pContext->state & DOC_RAW_STARTED) &&
- !(pContext->state & DOC_COOKED_STARTED))
- return XpErrorBase+XPBadSequence;
-
- if(pContext->state & PAGE_STARTED)
- {
- if(stuff->cancel == TRUE)
- {
- WindowPtr pWin = (WindowPtr )LookupIDByType(
- pContext->pageWin, RT_WINDOW);
- XpPagePtr pPage = (XpPagePtr)LookupIDByType(
- pContext->pageWin, RTpage);
-
- if(pContext->funcs.EndPage != 0)
- result = pContext->funcs.EndPage(pContext, pWin);
- else
- return BadImplementation;
-
- SendXpNotify(pContext, XPEndPageNotify, TRUE);
-
- if(pPage)
- pPage->context = (XpContextPtr)NULL;
- }
- else
- return XpErrorBase+XPBadSequence;
- if(result != Success)
- return result;
- }
-
- if(pContext->funcs.EndDoc != 0)
- result = pContext->funcs.EndDoc(pContext, stuff->cancel);
- else
- return BadImplementation;
-
- pContext->state &= ~DOC_RAW_STARTED;
- pContext->state &= ~DOC_COOKED_STARTED;
-
- SendXpNotify(pContext, XPEndDocNotify, stuff->cancel);
-
- if (client->noClientException != Success)
- return client->noClientException;
- else
- return result;
-}
-
-static Bool
-DoStartPage(
- ClientPtr client,
- XpStPagePtr c)
-{
- WindowPtr pWin = c->pWin;
- int result = Success;
- XpContextPtr pContext = c->pContext;
- XpPagePtr pPage;
-
- if(c->pContext->state & JOB_GET_DATA &&
- !(c->pContext->state & GET_DOC_DATA_STARTED))
- {
- if(!c->slept)
- {
- c->slept = TRUE;
- ClientSleep(client, (ClientSleepProcPtr)DoStartPage, (pointer) c);
- c->pContext->clientSlept = client;
- }
- return TRUE;
- }
-
- if(!(pContext->state & DOC_COOKED_STARTED))
- {
- /* Implied StartDoc if it was omitted */
- if(pContext->funcs.StartDoc != 0)
- result = pContext->funcs.StartDoc(pContext, XPDocNormal);
- else
- {
- SendErrorToClient(client, XpReqCode, X_PrintStartPage, 0,
- BadImplementation);
- return TRUE;
- }
-
- if(result != Success)
- {
- SendErrorToClient(client, XpReqCode, X_PrintStartPage, 0, result);
- return TRUE;
- }
-
- pContext->state |= DOC_COOKED_STARTED;
- SendXpNotify(pContext, XPStartDocNotify, (int)FALSE);
- }
-
- /* ensure the window's not already being used as a page */
- if((pPage = (XpPagePtr)LookupIDByType(c->pWin->drawable.id, RTpage)) !=
- (XpPagePtr)NULL)
- {
- if(pPage->context != (XpContextPtr)NULL)
- {
- SendErrorToClient(client, XpReqCode, X_PrintStartPage, 0,
- BadWindow);
- return TRUE;
- }
- }
- else
- {
- if((pPage = (XpPagePtr)xalloc(sizeof(XpPageRec))) == (XpPagePtr)NULL)
- {
- SendErrorToClient(client, XpReqCode, X_PrintStartPage, 0,
- BadAlloc);
- return TRUE;
- }
- if(AddResource(c->pWin->drawable.id, RTpage, pPage) == FALSE)
- {
- xfree(pPage);
- SendErrorToClient(client, XpReqCode, X_PrintStartPage, 0,
- BadAlloc);
- return TRUE;
- }
- }
-
- pPage->context = pContext;
- pContext->pageWin = c->pWin->drawable.id;
-
- if(pContext->funcs.StartPage != 0)
- result = pContext->funcs.StartPage(pContext, pWin);
- else
- {
- SendErrorToClient(client, XpReqCode, X_PrintStartPage, 0,
- BadImplementation);
- return TRUE;
- }
-
- pContext->state |= PAGE_STARTED;
-
- (void)MapWindow(pWin, client);
-
- SendXpNotify(pContext, XPStartPageNotify, (int)FALSE);
-
- return TRUE;
-}
-
-static int
-ProcXpStartPage(ClientPtr client)
-{
- REQUEST(xPrintStartPageReq);
- WindowPtr pWin;
- int result = Success;
- XpContextPtr pContext;
- XpStPagePtr c;
-
- REQUEST_SIZE_MATCH(xPrintStartPageReq);
-
- if((pContext = (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr)
- == (XpContextPtr)NULL)
- return XpErrorBase+XPBadSequence;
-
- if(!(pContext->state & JOB_STARTED))
- return XpErrorBase+XPBadSequence;
-
- /* can't have pages in a raw documented */
- if(pContext->state & DOC_RAW_STARTED)
- return XpErrorBase+XPBadSequence;
-
- if(pContext->state & PAGE_STARTED)
- return XpErrorBase+XPBadSequence;
-
- pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
- SecurityWriteAccess);
- if (!pWin || pWin->drawable.pScreen->myNum != pContext->screenNum)
- return BadWindow;
-
- if((c = (XpStPagePtr)xalloc(sizeof(XpStPageRec))) == (XpStPagePtr)NULL)
- return BadAlloc;
- c->pContext = pContext;
- c->slept = FALSE;
- c->pWin = pWin;
-
- (void)DoStartPage(client, c);
-
- if (client->noClientException != Success)
- return client->noClientException;
- else
- return result;
-}
-
-static int
-ProcXpEndPage(ClientPtr client)
-{
- REQUEST(xPrintEndPageReq);
- int result = Success;
- XpContextPtr pContext;
- XpPagePtr page;
- WindowPtr pWin;
-
- REQUEST_SIZE_MATCH(xPrintEndPageReq);
-
- if((pContext = (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr)
- == (XpContextPtr)NULL)
- return XpErrorBase+XPBadSequence;
-
- if(!(pContext->state & PAGE_STARTED))
- return XpErrorBase+XPBadSequence;
-
- pWin = (WindowPtr )LookupIDByType(pContext->pageWin, RT_WINDOW);
-
- /* Call the ddx's EndPage proc. */
- if(pContext->funcs.EndPage != 0)
- result = pContext->funcs.EndPage(pContext, pWin);
- else
- return BadImplementation;
-
- if((page = (XpPagePtr)LookupIDByType(pContext->pageWin, RTpage)) !=
- (XpPagePtr)NULL)
- page->context = (XpContextPtr)NULL;
-
- pContext->state &= ~PAGE_STARTED;
- pContext->pageWin = 0; /* None, NULL??? XXX */
-
- (void)UnmapWindow(pWin, FALSE);
-
- SendXpNotify(pContext, XPEndPageNotify, stuff->cancel);
-
- if (client->noClientException != Success)
- return client->noClientException;
- else
- return result;
-}
-
-/*******************************************************************************
- *
- * Document Data Functions: PutDocumentData, GetDocumentData
- *
- ******************************************************************************/
-
-static int
-ProcXpPutDocumentData(ClientPtr client)
-{
- REQUEST(xPrintPutDocumentDataReq);
- XpContextPtr pContext;
- DrawablePtr pDraw;
- int result = Success;
- unsigned totalSize;
- char *pData, *pDoc_fmt, *pOptions;
-
- REQUEST_AT_LEAST_SIZE(xPrintPutDocumentDataReq);
-
- if((pContext = (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr)
- == (XpContextPtr)NULL)
- return XpErrorBase+XPBadSequence;
-
- if(!(pContext->state & DOC_RAW_STARTED) &&
- !(pContext->state & DOC_COOKED_STARTED))
- return XpErrorBase+XPBadSequence;
-
- if (stuff->drawable) {
- if (pContext->state & DOC_RAW_STARTED)
- return BadDrawable;
- pDraw = (DrawablePtr)LookupDrawable(stuff->drawable, client);
- if (!pDraw || pDraw->pScreen->myNum != pContext->screenNum)
- return BadDrawable;
- } else {
- if (pContext->state & DOC_COOKED_STARTED)
- return BadDrawable;
- pDraw = NULL;
- }
-
- pData = (char *)(&stuff[1]);
-
- totalSize = (stuff->len_data + 3) >> 2;
- pDoc_fmt = pData + (totalSize << 2);
-
- totalSize += (stuff->len_fmt + 3) >> 2;
- pOptions = pData + (totalSize << 2);
-
- totalSize += (stuff->len_options + 3) >> 2;
- if((totalSize + (sz_xPrintPutDocumentDataReq >> 2)) != client->req_len)
- return BadLength;
-
- if(pContext->funcs.PutDocumentData != 0)
- {
- result = (*pContext->funcs.PutDocumentData)(pContext, pDraw,
- pData, stuff->len_data,
- pDoc_fmt, stuff->len_fmt,
- pOptions, stuff->len_options,
- client);
- }
- else
- return BadImplementation;
-
- if (client->noClientException != Success)
- return client->noClientException;
- else
- return result;
-}
-
-static int
-ProcXpGetDocumentData(ClientPtr client)
-{
- REQUEST(xPrintGetDocumentDataReq);
- xPrintGetDocumentDataReply rep;
- XpContextPtr pContext;
- int result = Success;
-
- REQUEST_SIZE_MATCH(xPrintGetDocumentDataReq);
-
- if((pContext = (XpContextPtr)SecurityLookupIDByType(client,
- stuff->printContext,
- RTcontext,
- SecurityWriteAccess))
- == (XpContextPtr)NULL)
- {
- client->errorValue = stuff->printContext;
- return XpErrorBase+XPBadContext;
- }
-
- if(pContext->funcs.GetDocumentData == 0)
- return BadImplementation;
-
- if(!(pContext->state & JOB_GET_DATA) ||
- pContext->state & GET_DOC_DATA_STARTED)
- return XpErrorBase+XPBadSequence;
-
- if(stuff->maxBufferSize <= 0)
- {
- client->errorValue = stuff->maxBufferSize;
- return BadValue; /* gotta have a positive buffer size */
- }
-
- result = (*pContext->funcs.GetDocumentData)(pContext, client,
- stuff->maxBufferSize);
- if(result != Success)
- {
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.dataLen = 0;
- rep.statusCode = 1;
- rep.finishedFlag = TRUE;
- if (client->swapped) {
- int n;
- long l;
-
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.statusCode, l); /* XXX Why are these longs??? */
- swapl(&rep.finishedFlag, l); /* XXX Why are these longs??? */
- }
- (void)WriteToClient(client,sz_xPrintGetDocumentDataReply,(char *)&rep);
- }
- else
- pContext->state |= GET_DOC_DATA_STARTED;
-
- if(pContext->clientSlept != (ClientPtr)NULL)
- {
- ClientSignal(pContext->clientSlept);
- ClientWakeup(pContext->clientSlept);
- pContext->clientSlept = (ClientPtr)NULL;
- }
-
- return result;
-}
-
-/*******************************************************************************
- *
- * Attribute requests: GetAttributes, SetAttributes, GetOneAttribute
- *
- ******************************************************************************/
-
-static int
-ProcXpGetAttributes(ClientPtr client)
-{
- REQUEST(xPrintGetAttributesReq);
- XpContextPtr pContext;
- char *attrs;
- xPrintGetAttributesReply *pRep;
- int totalSize, n;
- unsigned long l;
-
- REQUEST_SIZE_MATCH(xPrintGetAttributesReq);
-
- if(stuff->type < XPJobAttr || stuff->type > XPServerAttr)
- {
- client->errorValue = stuff->type;
- return BadValue;
- }
-
- if(stuff->type != XPServerAttr)
- {
- if((pContext = (XpContextPtr)SecurityLookupIDByType(
- client,
- stuff->printContext,
- RTcontext,
- SecurityReadAccess))
- == (XpContextPtr)NULL)
- {
- client->errorValue = stuff->printContext;
- return XpErrorBase+XPBadContext;
- }
-
- if(pContext->funcs.GetAttributes == 0)
- return BadImplementation;
- if((attrs = (*pContext->funcs.GetAttributes)(pContext, stuff->type)) ==
- (char *)NULL)
- return BadAlloc;
- }
- else
- {
- if((attrs = XpGetAttributes((XpContextPtr)NULL, XPServerAttr)) ==
- (char *)NULL)
- return BadAlloc;
- }
-
- totalSize = sz_xPrintGetAttributesReply + QUADPAD(strlen(attrs));
- if((pRep = (xPrintGetAttributesReply *)malloc(totalSize)) ==
- (xPrintGetAttributesReply *)NULL)
- return BadAlloc;
-
- pRep->type = X_Reply;
- pRep->length = (totalSize - sz_xPrintGetAttributesReply) >> 2;
- pRep->sequenceNumber = client->sequence;
- pRep->stringLen = strlen(attrs);
-
- if (client->swapped) {
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, l);
- swapl(&pRep->stringLen, l);
- }
-
- strncpy((char*)(pRep + 1), attrs, strlen(attrs));
- xfree(attrs);
-
- WriteToClient(client, totalSize, (char *)pRep);
-
- xfree(pRep);
-
- return client->noClientException;
-}
-
-static int
-ProcXpSetAttributes(ClientPtr client)
-{
- REQUEST(xPrintSetAttributesReq);
- int result = Success;
- XpContextPtr pContext;
- char *attr;
-
- REQUEST_AT_LEAST_SIZE(xPrintSetAttributesReq);
-
- if(stuff->type < XPJobAttr || stuff->type > XPServerAttr)
- {
- client->errorValue = stuff->type;
- return BadValue;
- }
-
- /*
- * Disallow changing of read-only attribute pools
- */
- if(stuff->type == XPPrinterAttr || stuff->type == XPServerAttr)
- return BadMatch;
-
- if((pContext = (XpContextPtr)SecurityLookupIDByType(
- client,
- stuff->printContext,
- RTcontext,
- SecurityWriteAccess))
- == (XpContextPtr)NULL)
- {
- client->errorValue = stuff->printContext;
- return XpErrorBase+XPBadContext;
- }
-
- if(pContext->funcs.SetAttributes == 0)
- return BadImplementation;
-
- /*
- * Check for attributes being set after their relevant phase
- * has already begun (e.g. Job attributes set after StartJob).
- */
- if((pContext->state & JOB_STARTED) && stuff->type == XPJobAttr)
- return XpErrorBase+XPBadSequence;
- if(((pContext->state & DOC_RAW_STARTED) ||
- (pContext->state & DOC_COOKED_STARTED)) && stuff->type == XPDocAttr)
- return XpErrorBase+XPBadSequence;
- if((pContext->state & PAGE_STARTED) && stuff->type == XPPageAttr)
- return XpErrorBase+XPBadSequence;
-
- if((attr = (char *)malloc(stuff->stringLen + 1)) == (char *)NULL)
- return BadAlloc;
-
- strncpy(attr, (char *)(stuff + 1), stuff->stringLen);
- attr[stuff->stringLen] = (char)'\0';
-
- if(stuff->rule == XPAttrReplace)
- (*pContext->funcs.SetAttributes)(pContext, stuff->type, attr);
- else if(stuff->rule == XPAttrMerge)
- (*pContext->funcs.AugmentAttributes)(pContext, stuff->type, attr);
- else
- {
- client->errorValue = stuff->rule;
- result = BadValue;
- }
-
- xfree(attr);
-
- SendAttributeNotify(pContext, stuff->type);
-
- return result;
-}
-
-static int
-ProcXpGetOneAttribute(ClientPtr client)
-{
- REQUEST(xPrintGetOneAttributeReq);
- XpContextPtr pContext;
- char *value, *attrName;
- xPrintGetOneAttributeReply *pRep;
- int totalSize;
- int n;
- unsigned long l;
-
- REQUEST_AT_LEAST_SIZE(xPrintGetOneAttributeReq);
-
- totalSize = ((sz_xPrintGetOneAttributeReq) >> 2) +
- ((stuff->nameLen + 3) >> 2);
- if(totalSize != client->req_len)
- return BadLength;
-
- if(stuff->type < XPJobAttr || stuff->type > XPServerAttr)
- {
- client->errorValue = stuff->type;
- return BadValue;
- }
-
- if((attrName = (char *)malloc(stuff->nameLen + 1)) == (char *)NULL)
- return BadAlloc;
- strncpy(attrName, (char *)(stuff+1), stuff->nameLen);
- attrName[stuff->nameLen] = (char)'\0';
-
- if(stuff->type != XPServerAttr)
- {
- if((pContext = (XpContextPtr)SecurityLookupIDByType(
- client,
- stuff->printContext,
- RTcontext,
- SecurityReadAccess))
- == (XpContextPtr)NULL)
- {
- client->errorValue = stuff->printContext;
- return XpErrorBase+XPBadContext;
- }
-
- if(pContext->funcs.GetOneAttribute == 0)
- return BadImplementation;
- if((value = (*pContext->funcs.GetOneAttribute)(pContext, stuff->type,
- attrName)) == (char *)NULL)
- return BadAlloc;
- }
- else
- {
- if((value = XpGetOneAttribute((XpContextPtr)NULL, XPServerAttr,
- attrName)) == (char *)NULL)
- return BadAlloc;
- }
-
- free(attrName);
-
- totalSize = sz_xPrintGetOneAttributeReply + QUADPAD(strlen(value));
- if((pRep = (xPrintGetOneAttributeReply *)malloc(totalSize)) ==
- (xPrintGetOneAttributeReply *)NULL)
- return BadAlloc;
-
- pRep->type = X_Reply;
- pRep->length = (totalSize - sz_xPrintGetOneAttributeReply) >> 2;
- pRep->sequenceNumber = client->sequence;
- pRep->valueLen = strlen(value);
-
- if (client->swapped) {
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, l);
- swapl(&pRep->valueLen, l);
- }
-
- strncpy((char*)(pRep + 1), value, strlen(value));
-
- WriteToClient(client, totalSize, (char *)pRep);
-
- xfree(pRep);
-
- return client->noClientException;
-}
-
-/*******************************************************************************
- *
- * Print Event requests: SelectInput InputSelected, SendXpNotify
- *
- ******************************************************************************/
-
-
-static int
-ProcXpSelectInput(ClientPtr client)
-{
- REQUEST(xPrintSelectInputReq);
- int result = Success;
- XpContextPtr pContext;
- XpClientPtr pPrintClient;
-
- REQUEST_SIZE_MATCH(xPrintSelectInputReq);
-
- /*
- * Check to see that the supplied XID is really a valid print context
- * in this server.
- */
- if((pContext=(XpContextPtr)SecurityLookupIDByType(client,
- stuff->printContext,
- RTcontext,
- SecurityWriteAccess))
- == (XpContextPtr)NULL)
- {
- client->errorValue = stuff->printContext;
- return XpErrorBase+XPBadContext;
- }
-
- if(stuff->eventMask & ~allEvents)
- {
- client->errorValue = stuff->eventMask;
- return BadValue; /* bogus event mask bits */
- }
-
- if((pPrintClient = AcquireClient(pContext, client)) == (XpClientPtr)NULL)
- return BadAlloc;
-
- pPrintClient->eventMask = stuff->eventMask;
-
- return result;
-}
-
-static int
-ProcXpInputSelected(ClientPtr client)
-{
- REQUEST(xPrintInputSelectedReq);
- xPrintInputSelectedReply rep;
- register int n;
- long l;
- XpClientPtr pXpClient;
- XpContextPtr pContext;
-
- REQUEST_SIZE_MATCH(xPrintInputSelectedReq);
-
- if((pContext=(XpContextPtr)SecurityLookupIDByType(client,
- stuff->printContext,
- RTcontext,
- SecurityReadAccess))
- == (XpContextPtr)NULL)
- {
- client->errorValue = stuff->printContext;
- return XpErrorBase+XPBadContext;
- }
-
- pXpClient = FindClient(pContext, client);
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.eventMask = (pXpClient != (XpClientPtr)NULL)? pXpClient->eventMask : 0;
- rep.allEventsMask = GetAllEventMasks(pContext);
-
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, l);
- swapl(&rep.eventMask, l);
- swapl(&rep.allEventsMask, l);
- }
-
- WriteToClient(client, sz_xPrintInputSelectedReply, (char *)&rep);
- return client->noClientException;
-}
-
-static void
-SendAttributeNotify(XpContextPtr pContext, int which)
-{
- XpClientPtr pXpClient;
- xPrintAttributeEvent ae;
- ClientPtr client;
-
- pXpClient = pContext->clientHead;
- if(pXpClient == (XpClientPtr)NULL)
- return; /* Nobody's interested in the events (or this context). */
-
- for (pXpClient = pContext->clientHead;
- pXpClient != (XpClientPtr)NULL;
- pXpClient = pXpClient->pNext)
- {
- client = pXpClient->client;
- if (client == serverClient || client->clientGone ||
- !(pXpClient->eventMask & XPAttributeMask))
- continue;
- ae.type = XPAttributeNotify + XpEventBase;
- ae.detail = which;
- ae.printContext = pContext->contextID;
- ae.sequenceNumber = client->sequence;
- WriteEventsToClient (client, 1, (xEvent *) &ae);
- }
-}
-
-static void
-SendXpNotify(XpContextPtr pContext, int which, int val)
-{
- XpClientPtr pXpClient;
- xPrintPrintEvent pe;
- ClientPtr client;
-
- pXpClient = pContext->clientHead;
- if(pXpClient == (XpClientPtr)NULL)
- return; /* Nobody's interested in the events (or this context). */
-
- for (pXpClient = pContext->clientHead;
- pXpClient != (XpClientPtr)NULL;
- pXpClient = pXpClient->pNext)
- {
- client = pXpClient->client;
- if (client == serverClient || client->clientGone ||
- !(pXpClient->eventMask & XPPrintMask))
- continue;
- pe.type = XPPrintNotify + XpEventBase;
- pe.detail = which;
- pe.printContext = pContext->contextID;
- pe.cancel = (Bool)val;
- pe.sequenceNumber = client->sequence;
- WriteEventsToClient (client, 1, (xEvent *) &pe);
- }
-}
-
-static CARD32
-GetAllEventMasks(XpContextPtr pContext)
-{
- XpClientPtr pPrintClient;
- CARD32 totalMask = (CARD32)0;
-
- for (pPrintClient = pContext->clientHead;
- pPrintClient != (XpClientPtr)NULL;
- pPrintClient = pPrintClient->pNext)
- {
- totalMask |= pPrintClient->eventMask;
- }
- return totalMask;
-}
-
-/*
- * XpContextOfClient - returns the XpContextPtr to the context
- * associated with the specified client, or NULL if the client
- * does not currently have a context set.
- */
-XpContextPtr
-XpContextOfClient(ClientPtr client)
-{
- return (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr;
-}
-
-
-/*******************************************************************************
- *
- * Swap-request functions
- *
- ******************************************************************************/
-
-static int
-SProcXpCreateContext(ClientPtr client)
-{
- int i;
- long n;
-
- REQUEST(xPrintCreateContextReq);
-
- swaps(&stuff->length, i);
- swapl(&stuff->contextID, n);
- swapl(&stuff->printerNameLen, n);
- swapl(&stuff->localeLen, n);
- return ProcXpCreateContext(client);
-}
-
-static int
-SProcXpGetPrinterList(ClientPtr client)
-{
- int i;
- long n;
-
- REQUEST(xPrintGetPrinterListReq);
-
- swaps(&stuff->length, i);
- swapl(&stuff->printerNameLen, n);
- swapl(&stuff->localeLen, n);
- return ProcXpGetPrinterList(client);
-}
-
-static int
-SProcXpRehashPrinterList(ClientPtr client)
-{
- int i;
-
- REQUEST(xPrintRehashPrinterListReq);
- swaps(&stuff->length, i);
- return ProcXpRehashPrinterList(client);
-}
-
-static int
-SProcXpSetContext(ClientPtr client)
-{
- int i;
-
- REQUEST(xPrintSetContextReq);
- swaps(&stuff->length, i);
- swapl(&stuff->printContext, i);
- return ProcXpSetContext(client);
-}
-
-static int
-SProcXpGetContext(ClientPtr client)
-{
- int i;
-
- REQUEST(xPrintGetContextReq);
- swaps(&stuff->length, i);
- return ProcXpGetContext(client);
-}
-
-static int
-SProcXpDestroyContext(ClientPtr client)
-{
- int i;
- long n;
-
- REQUEST(xPrintDestroyContextReq);
- swaps(&stuff->length, i);
- swapl(&stuff->printContext, n);
- return ProcXpDestroyContext(client);
-}
-
-static int
-SProcXpGetContextScreen(ClientPtr client)
-{
- int i;
- long n;
-
- REQUEST(xPrintGetContextScreenReq);
- swaps(&stuff->length, i);
- swapl(&stuff->printContext, n);
- return ProcXpGetContextScreen(client);
-}
-
-static int
-SProcXpInputSelected(ClientPtr client)
-{
- int i;
- long n;
-
- REQUEST(xPrintInputSelectedReq);
- swaps(&stuff->length, i);
- swapl(&stuff->printContext, n);
- return ProcXpInputSelected(client);
-}
-
-static int
-SProcXpStartJob(ClientPtr client)
-{
- int i;
-
- REQUEST(xPrintStartJobReq);
- swaps(&stuff->length, i);
- return ProcXpStartJob(client);
-}
-
-static int
-SProcXpEndJob(ClientPtr client)
-{
- int i;
-
- REQUEST(xPrintEndJobReq);
- swaps(&stuff->length, i);
- return ProcXpEndJob(client);
-}
-
-static int
-SProcXpStartDoc(ClientPtr client)
-{
- int i;
-
- REQUEST(xPrintStartDocReq);
- swaps(&stuff->length, i);
- return ProcXpStartDoc(client);
-}
-
-static int
-SProcXpEndDoc(ClientPtr client)
-{
- int i;
-
- REQUEST(xPrintEndDocReq);
- swaps(&stuff->length, i);
- return ProcXpEndDoc(client);
-}
-
-static int
-SProcXpStartPage(ClientPtr client)
-{
- int i;
- long n;
-
- REQUEST(xPrintStartPageReq);
- swaps(&stuff->length, i);
- swapl(&stuff->window, n);
- return ProcXpStartPage(client);
-}
-
-static int
-SProcXpEndPage(ClientPtr client)
-{
- int i;
-
- REQUEST(xPrintEndPageReq);
- swaps(&stuff->length, i);
- return ProcXpEndPage(client);
-}
-
-static int
-SProcXpPutDocumentData(ClientPtr client)
-{
- long n;
- int i;
-
- REQUEST(xPrintPutDocumentDataReq);
- swaps(&stuff->length, i);
- swapl(&stuff->drawable, n);
- swapl(&stuff->len_data, n);
- swaps(&stuff->len_fmt, i);
- swaps(&stuff->len_options, i);
- return ProcXpPutDocumentData(client);
-}
-
-static int
-SProcXpGetDocumentData(ClientPtr client)
-{
- long n;
- int i;
-
- REQUEST(xPrintGetDocumentDataReq);
- swaps(&stuff->length, i);
- swapl(&stuff->printContext, n);
- swapl(&stuff->maxBufferSize, n);
- return ProcXpGetDocumentData(client);
-}
-
-static int
-SProcXpGetAttributes(ClientPtr client)
-{
- long n;
- int i;
-
- REQUEST(xPrintGetAttributesReq);
- swaps(&stuff->length, i);
- swapl(&stuff->printContext, n);
- return ProcXpGetAttributes(client);
-}
-
-static int
-SProcXpSetAttributes(ClientPtr client)
-{
- long n;
- int i;
-
- REQUEST(xPrintSetAttributesReq);
- swaps(&stuff->length, i);
- swapl(&stuff->printContext, n);
- swapl(&stuff->stringLen, n);
- return ProcXpSetAttributes(client);
-}
-
-static int
-SProcXpGetOneAttribute(ClientPtr client)
-{
- long n;
- int i;
-
- REQUEST(xPrintGetOneAttributeReq);
- swaps(&stuff->length, i);
- swapl(&stuff->printContext, n);
- swapl(&stuff->nameLen, n);
- return ProcXpGetOneAttribute(client);
-}
-
-static int
-SProcXpSelectInput(ClientPtr client)
-{
- long n;
- int i;
-
- REQUEST(xPrintSelectInputReq);
- swaps(&stuff->length, i);
- swapl(&stuff->eventMask, n);
- swapl(&stuff->printContext, n);
- return ProcXpSelectInput(client);
-}
-
-static int
-SProcXpGetPageDimensions(ClientPtr client)
-{
- long n;
- int i;
-
- REQUEST(xPrintGetPageDimensionsReq);
- swaps(&stuff->length, i);
- swapl(&stuff->printContext, n);
- return ProcXpGetPageDimensions(client);
-}
-
-static int
-SProcXpSetImageResolution(ClientPtr client)
-{
- long n;
- int i;
-
- REQUEST(xPrintSetImageResolutionReq);
- swaps(&stuff->length, i);
- swapl(&stuff->printContext, n);
- swaps(&stuff->imageRes, i);
- return ProcXpSetImageResolution(client);
-}
-
-static int
-SProcXpGetImageResolution(ClientPtr client)
-{
- long n;
- int i;
-
- REQUEST(xPrintGetImageResolutionReq);
- swaps(&stuff->length, i);
- swapl(&stuff->printContext, n);
- return ProcXpGetImageResolution(client);
-}
-
-static void
-SwapXpNotifyEvent(xPrintPrintEvent *src, xPrintPrintEvent *dst)
-{
- /*
- * Swap the sequence number and context fields.
- */
- cpswaps(src->sequenceNumber, dst->sequenceNumber);
- cpswapl(src->printContext, dst->printContext);
-
- /*
- * Copy the byte-long fields.
- */
- dst->type = src->type;
- dst->detail = src->detail;
- dst->cancel = src->cancel;
-}
-
-static void
-SwapXpAttributeEvent(xPrintAttributeEvent *src, xPrintAttributeEvent *dst)
-{
- /*
- * Swap the sequence number and context fields.
- */
- cpswaps(src->sequenceNumber, dst->sequenceNumber);
- cpswapl(src->printContext, dst->printContext);
-
- /*
- * Copy the byte-long fields.
- */
- dst->type = src->type;
- dst->detail = src->detail;
-}
diff --git a/nx-X11/programs/Xserver/dix/Imakefile b/nx-X11/programs/Xserver/dix/Imakefile
index 529e5623e..a0d420851 100644
--- a/nx-X11/programs/Xserver/dix/Imakefile
+++ b/nx-X11/programs/Xserver/dix/Imakefile
@@ -7,10 +7,8 @@ XCOMM $XFree86: xc/programs/Xserver/dix/Imakefile,v 3.17 2003/04/15 18:30:43 ala
#include <Server.tmpl>
-#if !BuildXprint || PrintOnlyServer
XPSRC = xpstubs.c
XPOBJ = xpstubs.o
-#endif
#if !HasFfs
FFS_SRC = ffs.c
@@ -27,7 +25,7 @@ OBJS = atom.o colormap.o cursor.o devices.o dispatch.o dixutils.o events.o \
tables.o window.o initatoms.o dixfonts.o privates.o pixmap.o $(FFS_OBJ)
INCLUDES = -I../include -I$(XINCLUDESRC) -I$(FONTINCSRC) -I$(EXTINCSRC) \
- -I$(SERVERSRC)/Xext -I$(SERVERSRC)/lbx -I../Xprint
+ -I$(SERVERSRC)/Xext -I$(SERVERSRC)/lbx
LINTLIBS = ../os/llib-los.ln
/*
@@ -94,8 +92,6 @@ SpecialCObjectRule(pixmap,$(ICONFIGFILES),$(_NOOP_))
SpecialCObjectRule(privates,$(ICONFIGFILES),$(_NOOP_))
SpecialCObjectRule(window,$(ICONFIGFILES),$(QUARTZ_DEFINES))
-#if !BuildXprint || PrintOnlyServer
NormalLibraryTarget(xpstubs,$(XPOBJ))
-#endif
DependTarget()
diff --git a/nx-X11/programs/Xserver/dix/main.c b/nx-X11/programs/Xserver/dix/main.c
index 6a8f79a96..270de6ced 100644
--- a/nx-X11/programs/Xserver/dix/main.c
+++ b/nx-X11/programs/Xserver/dix/main.c
@@ -104,9 +104,6 @@ Equipment Corporation.
#include "site.h"
#include "dixfont.h"
#include "extnsionst.h"
-#ifdef XPRINT
-#include "DiPrint.h"
-#endif
#ifdef PANORAMIX
#include "panoramiXsrv.h"
#else
@@ -255,9 +252,6 @@ main(int argc, char *argv[], char *envp[])
display = "0";
InitGlobals();
-#ifdef XPRINT
- PrinterInitGlobals();
-#endif
/* Quartz support on Mac OS X requires that the Cocoa event loop be in
* the main thread. This allows the X server main to be called again
@@ -370,9 +364,6 @@ main(int argc, char *argv[], char *envp[])
InitCallbackManager();
InitVisualWrap();
InitOutput(&screenInfo, argc, argv);
-#ifdef XPRINT
- PrinterInitOutput(&screenInfo, argc, argv);
-#endif
if (screenInfo.numScreens < 1)
FatalError("no screens found");
diff --git a/nx-X11/programs/Xserver/dix/xpstubs.c b/nx-X11/programs/Xserver/dix/xpstubs.c
index 5135cc398..89481c601 100644
--- a/nx-X11/programs/Xserver/dix/xpstubs.c
+++ b/nx-X11/programs/Xserver/dix/xpstubs.c
@@ -33,9 +33,6 @@ from The Open Group.
#include "misc.h"
#include <X11/fonts/font.h>
-#ifdef XPRINT
-#include "DiPrint.h"
-#endif
Bool
XpClientIsBitmapClient(
@@ -51,27 +48,3 @@ XpClientIsPrintClient(
{
return FALSE;
}
-#ifdef XPRINT
-int
-PrinterOptions(
- int argc,
- char **argv,
- int i)
-{
- return i;
-}
-void
-PrinterInitOutput(
- ScreenInfo *pScreenInfo,
- int argc,
- char **argv)
-{
-}
-void PrinterUseMsg(void)
-{
-}
-void PrinterInitGlobals(void)
-{
-}
-#endif /* XPRINT */
-
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Imakefile b/nx-X11/programs/Xserver/hw/nxagent/Imakefile
index 6c075fa9f..874e82565 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Imakefile
+++ b/nx-X11/programs/Xserver/hw/nxagent/Imakefile
@@ -66,6 +66,7 @@ SRCS = NXwindow.c \
Composite.c \
Pixels.c \
stubs.c \
+ xpstubs.c \
miinitext.c \
$(SRCS1)
@@ -128,6 +129,7 @@ OBJS = NXwindow.o \
Composite.o \
Pixels.o \
stubs.o \
+ xpstubs.o \
miinitext.o \
$(OBJS1)
@@ -220,6 +222,7 @@ DEFINES = -g $(OS_DEFINES) $(EXT_DEFINES) $(UPG_DEFINES) $(NX_DEFINES) \
all:: $(OBJS)
LinkSourceFile(stubs.c,$(SERVERSRC)/Xi)
+LinkSourceFile(xpstubs.c,$(SERVERSRC)/dix)
SpecialCObjectRule(Init,$(ICONFIGFILES),$(_NOOP_))
LinkSourceFile(miinitext.c,$(SERVERSRC)/mi)
SpecialCObjectRule(miinitext,$(ICONFIGFILES), $(_NOOP_))
diff --git a/nx-X11/programs/Xserver/mi/miinitext.c b/nx-X11/programs/Xserver/mi/miinitext.c
index f3be9da5d..b70a6a67e 100644
--- a/nx-X11/programs/Xserver/mi/miinitext.c
+++ b/nx-X11/programs/Xserver/mi/miinitext.c
@@ -73,34 +73,6 @@ SOFTWARE.
#undef GLXEXT
#endif
-/* Make sure Xprt only announces extensions it supports */
-#ifdef PRINT_ONLY_SERVER
-#undef MITSHM /* this is incompatible to the vector-based Xprint DDX */
-#undef XKB
-#undef PANORAMIX
-#undef RES
-#undef XINPUT
-#undef XV
-#undef SCREENSAVER
-#undef XIDLE
-#undef XRECORD
-#undef XF86VIDMODE
-#undef XF86MISC
-#undef XFreeXDGA
-#undef XF86DRI
-#undef DPMSExtension
-#undef DPSEXT
-#undef FONTCACHE
-#undef DAMAGE
-#undef XFIXES
-#undef XEVIE
-#else
-#ifndef LOADABLEPRINTDDX
-#undef XPRINT
-#endif /* LOADABLEPRINTDDX */
-#endif /* PRINT_ONLY_SERVER */
-
-
extern Bool noTestExtensions;
#ifdef BIGREQS
@@ -232,9 +204,6 @@ typedef void (*InitExtension)(INITARGS);
#define _XLBX_SERVER_
#include <X11/extensions/lbxstr.h>
#endif
-#ifdef XPRINT
-#include "Print.h"
-#endif
#ifdef XAPPGROUP
#define _XAG_SERVER_
#include <X11/extensions/Xagstr.h>
@@ -321,9 +290,6 @@ extern void XagExtensionInit(INITARGS);
#ifdef XCSECURITY
extern void SecurityExtensionInit(INITARGS);
#endif
-#ifdef XPRINT
-extern void XpExtensionInit(INITARGS);
-#endif
#ifdef XF86BIGFONT
extern void XFree86BigfontExtensionInit(INITARGS);
#endif
@@ -606,9 +572,6 @@ InitExtensions(argc, argv)
#ifdef XCSECURITY
if (!noSecurityExtension) SecurityExtensionInit();
#endif
-#ifdef XPRINT
- XpExtensionInit(); /* server-specific extension, cannot be disabled */
-#endif
#ifdef TOGCUP
if (!noXcupExtension) XcupExtensionInit();
#endif
@@ -642,11 +605,6 @@ InitExtensions(argc, argv)
if (!noGlxExtension) DarwinGlxExtensionInit();
#endif
#endif
-#ifdef DPSEXT
-#ifndef XPRINT
- if (!noDPSExtension) DPSExtensionInit();
-#endif
-#endif
#ifdef XFIXES
/* must be before Render to layer DisplayCursor correctly */
if (!noXFixesExtension) XFixesExtensionInit();
@@ -717,9 +675,6 @@ static ExtensionModule staticExtensions[] = {
#ifdef XCSECURITY
{ SecurityExtensionInit, SECURITY_EXTENSION_NAME, &noSecurityExtension, NULL, NULL },
#endif
-#ifdef XPRINT
- { XpExtensionInit, XP_PRINTNAME, NULL, NULL, NULL },
-#endif
#ifdef PANORAMIX
{ PanoramiXExtensionInit, PANORAMIX_PROTOCOL_NAME, &noPanoramiXExtension, NULL, NULL },
#endif
diff --git a/nx-X11/programs/Xserver/os/Imakefile b/nx-X11/programs/Xserver/os/Imakefile
index 22be06074..55f8e41fb 100644
--- a/nx-X11/programs/Xserver/os/Imakefile
+++ b/nx-X11/programs/Xserver/os/Imakefile
@@ -166,7 +166,7 @@ BOOTSTRAPCFLAGS =
$(RANDOM_DEFINES) $(BUGMSG) $(XTRANS_FAILDEFINES) $(NX_DEFINES)
INCLUDES = -I. -I../include -I$(XINCLUDESRC) -I$(EXTINCSRC) \
-I$(SERVERSRC)/Xext -I$(FONTINCSRC) -I$(SERVERSRC)/render \
- -I$(TOP)/lib/Xau -I../lbx -I../Xprint Krb5Includes $(NX_INCLUDES)
+ -I$(TOP)/lib/Xau -I../lbx Krb5Includes $(NX_INCLUDES)
DEPEND_DEFINES = $(DBM_DEFINES) $(XDMCP_DEFINES) $(EXT_DEFINES) \
$(TRANS_INCLUDES) $(CONNECTION_FLAGS) $(GETPEER_DEFINES) \
DependDefines
diff --git a/nx-X11/programs/Xserver/os/utils.c b/nx-X11/programs/Xserver/os/utils.c
index 79e49d5b1..5f189c949 100644
--- a/nx-X11/programs/Xserver/os/utils.c
+++ b/nx-X11/programs/Xserver/os/utils.c
@@ -147,10 +147,6 @@ OR PERFORMANCE OF THIS SOFTWARE.
#include "picture.h"
#endif
-#ifdef XPRINT
-#include "DiPrint.h"
-#endif
-
Bool noTestExtensions;
#ifdef BIGREQS
Bool noBigReqExtension = FALSE;
@@ -691,9 +687,6 @@ void UseMsg(void)
#ifdef XCSECURITY
ErrorF("-sp file security policy file\n");
#endif
-#ifdef XPRINT
- PrinterUseMsg();
-#endif
ErrorF("-su disable any save under support\n");
ErrorF("-t # mouse threshold (pixels)\n");
ErrorF("-terminate terminate at server reset\n");
@@ -1102,12 +1095,6 @@ ProcessCommandLine(int argc, char *argv[])
i = skip - 1;
}
#endif
-#ifdef XPRINT
- else if ((skip = PrinterOptions(argc, argv, i)) != i)
- {
- i = skip - 1;
- }
-#endif
#ifdef XCSECURITY
else if ((skip = XSecurityOptions(argc, argv, i)) != i)
{
diff --git a/nx-libs.spec b/nx-libs.spec
index ad9a09b5f..2e6c5da4c 100644
--- a/nx-libs.spec
+++ b/nx-libs.spec
@@ -1005,8 +1005,6 @@ ln -s -f ../../../../%{_lib}/libXext.so.6 %{buildroot}%{_libdir}/nx/X11/Xinerama
%{_includedir}/nx/X11/ap_keysym.h
%{_includedir}/nx/X11/keysym.h
%{_includedir}/nx/X11/keysymdef.h
-%{_includedir}/nx/X11/extensions/Print.h
-%{_includedir}/nx/X11/extensions/Printstr.h
%{_includedir}/nx/X11/extensions/XI.h
%{_includedir}/nx/X11/extensions/XIproto.h
%{_includedir}/nx/X11/extensions/XResproto.h