summaryrefslogtreecommitdiff
path: root/xserver/hw/xprint/ps
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2008-11-02 15:26:35 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2008-11-02 15:26:35 +0000
commitdbca69c8a4f3e2d1ccb4f89152213b2861b33af6 (patch)
treef8963ef73903a7b4374adc2354dffbaa905112ac /xserver/hw/xprint/ps
parent33b2029f322f3c238b7ba528083195ad8dde33e1 (diff)
xserver 1.5.2. tested by ckuethe@, oga@, and others.
Diffstat (limited to 'xserver/hw/xprint/ps')
-rw-r--r--xserver/hw/xprint/ps/Makefile.in70
-rw-r--r--xserver/hw/xprint/ps/Ps.h11
-rw-r--r--xserver/hw/xprint/ps/PsGC.c14
-rw-r--r--xserver/hw/xprint/ps/PsInit.c50
-rw-r--r--xserver/hw/xprint/ps/PsMisc.c17
-rw-r--r--xserver/hw/xprint/ps/PsPixmap.c6
-rw-r--r--xserver/hw/xprint/ps/PsPrint.c33
-rw-r--r--xserver/hw/xprint/ps/PsText.c4
-rw-r--r--xserver/hw/xprint/ps/PsWindow.c251
-rw-r--r--xserver/hw/xprint/ps/psout.h2
-rw-r--r--xserver/hw/xprint/ps/psout_ft.c2
-rw-r--r--xserver/hw/xprint/ps/psout_ftpstype1.c2
12 files changed, 121 insertions, 341 deletions
diff --git a/xserver/hw/xprint/ps/Makefile.in b/xserver/hw/xprint/ps/Makefile.in
index 6e5ca186e..f4785bea7 100644
--- a/xserver/hw/xprint/ps/Makefile.in
+++ b/xserver/hw/xprint/ps/Makefile.in
@@ -126,8 +126,6 @@ BSD_KQUEUE_APM_FALSE = @BSD_KQUEUE_APM_FALSE@
BSD_KQUEUE_APM_TRUE = @BSD_KQUEUE_APM_TRUE@
BUILDDOCS_FALSE = @BUILDDOCS_FALSE@
BUILDDOCS_TRUE = @BUILDDOCS_TRUE@
-BUILD_DARWIN_FALSE = @BUILD_DARWIN_FALSE@
-BUILD_DARWIN_TRUE = @BUILD_DARWIN_TRUE@
BUILD_DATE = @BUILD_DATE@
BUILD_IOPORT_FALSE = @BUILD_IOPORT_FALSE@
BUILD_IOPORT_TRUE = @BUILD_IOPORT_TRUE@
@@ -199,6 +197,10 @@ DMX_FALSE = @DMX_FALSE@
DMX_TRUE = @DMX_TRUE@
DPMSExtension_FALSE = @DPMSExtension_FALSE@
DPMSExtension_TRUE = @DPMSExtension_TRUE@
+DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@
+DRI2PROTO_LIBS = @DRI2PROTO_LIBS@
+DRI2_FALSE = @DRI2_FALSE@
+DRI2_TRUE = @DRI2_TRUE@
DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@
DRIPROTO_LIBS = @DRIPROTO_LIBS@
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
@@ -228,7 +230,7 @@ FREEBSD_KLDLOAD_FALSE = @FREEBSD_KLDLOAD_FALSE@
FREEBSD_KLDLOAD_TRUE = @FREEBSD_KLDLOAD_TRUE@
FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
FREETYPE_LIBS = @FREETYPE_LIBS@
-FREETYPE_REQUIRES = @FREETYPE_REQUIRES@
+GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_FALSE = @GLX_FALSE@
GLX_TRUE = @GLX_TRUE@
@@ -242,8 +244,8 @@ HAVE_AGL_FRAMEWORK_FALSE = @HAVE_AGL_FRAMEWORK_FALSE@
HAVE_AGL_FRAMEWORK_TRUE = @HAVE_AGL_FRAMEWORK_TRUE@
HAVE_DBUS_FALSE = @HAVE_DBUS_FALSE@
HAVE_DBUS_TRUE = @HAVE_DBUS_TRUE@
-HAVE_X_PLUGIN_FALSE = @HAVE_X_PLUGIN_FALSE@
-HAVE_X_PLUGIN_TRUE = @HAVE_X_PLUGIN_TRUE@
+HAVE_XPLUGIN_FALSE = @HAVE_XPLUGIN_FALSE@
+HAVE_XPLUGIN_TRUE = @HAVE_XPLUGIN_TRUE@
HP300_VIDEO_FALSE = @HP300_VIDEO_FALSE@
HP300_VIDEO_TRUE = @HP300_VIDEO_TRUE@
HPPA_VIDEO_FALSE = @HPPA_VIDEO_FALSE@
@@ -284,6 +286,9 @@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@
KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@
KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@
KDRIVE_TRUE = @KDRIVE_TRUE@
+LAUNCHD = @LAUNCHD@
+LAUNCHD_FALSE = @LAUNCHD_FALSE@
+LAUNCHD_TRUE = @LAUNCHD_TRUE@
LDFLAGS = @LDFLAGS@
LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@
LEX = @LEX@
@@ -338,6 +343,8 @@ OBJCFLAGS = @OBJCFLAGS@
OBJCLINK = @OBJCLINK@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OPENSSL_CFLAGS = @OPENSSL_CFLAGS@
+OPENSSL_LIBS = @OPENSSL_LIBS@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
@@ -345,12 +352,11 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@
+PCIACCESS_LIBS = @PCIACCESS_LIBS@
+PCI_TXT_IDS_PATH = @PCI_TXT_IDS_PATH@
PERL = @PERL@
-PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
-PIXMAN_LIBS = @PIXMAN_LIBS@
PKG_CONFIG = @PKG_CONFIG@
-PLIST_VENDOR_WEB = @PLIST_VENDOR_WEB@
-PLIST_VERSION_STRING = @PLIST_VERSION_STRING@
PPC_VIDEO_FALSE = @PPC_VIDEO_FALSE@
PPC_VIDEO_TRUE = @PPC_VIDEO_TRUE@
PROJECTROOT = @PROJECTROOT@
@@ -362,13 +368,12 @@ RECORD_FALSE = @RECORD_FALSE@
RECORD_TRUE = @RECORD_TRUE@
RES_FALSE = @RES_FALSE@
RES_TRUE = @RES_TRUE@
-RGB_DB = @RGB_DB@
SCREENSAVER_FALSE = @SCREENSAVER_FALSE@
SCREENSAVER_TRUE = @SCREENSAVER_TRUE@
SECURE_RPC_FALSE = @SECURE_RPC_FALSE@
SECURE_RPC_TRUE = @SECURE_RPC_TRUE@
SED = @SED@
-SERVERCONFIGdir = @SERVERCONFIGdir@
+SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@
SET_MAKE = @SET_MAKE@
SGI_VIDEO_FALSE = @SGI_VIDEO_FALSE@
SGI_VIDEO_TRUE = @SGI_VIDEO_TRUE@
@@ -384,20 +389,21 @@ SPARC64_VIDEO_TRUE = @SPARC64_VIDEO_TRUE@
STRIP = @STRIP@
SUN_KBD_MODE_FALSE = @SUN_KBD_MODE_FALSE@
SUN_KBD_MODE_TRUE = @SUN_KBD_MODE_TRUE@
-SYS_LIBS = @SYS_LIBS@
TSLIB_CFLAGS = @TSLIB_CFLAGS@
TSLIB_FALSE = @TSLIB_FALSE@
TSLIB_LIBS = @TSLIB_LIBS@
TSLIB_TRUE = @TSLIB_TRUE@
USE_CURSES_FALSE = @USE_CURSES_FALSE@
USE_CURSES_TRUE = @USE_CURSES_TRUE@
-USE_RGB_BUILTIN_FALSE = @USE_RGB_BUILTIN_FALSE@
-USE_RGB_BUILTIN_TRUE = @USE_RGB_BUILTIN_TRUE@
+UTILS_SYS_LIBS = @UTILS_SYS_LIBS@
VENDOR_MAN_VERSION = @VENDOR_MAN_VERSION@
VENDOR_NAME = @VENDOR_NAME@
VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@
VENDOR_RELEASE = @VENDOR_RELEASE@
VERSION = @VERSION@
+X11APP_ARCHS = @X11APP_ARCHS@
+X11APP_FALSE = @X11APP_FALSE@
+X11APP_TRUE = @X11APP_TRUE@
X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@
X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@
XACE_FALSE = @XACE_FALSE@
@@ -414,18 +420,22 @@ XDMCP_LIBS = @XDMCP_LIBS@
XDMCP_TRUE = @XDMCP_TRUE@
XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@
XDMXCONFIG_DEP_LIBS = @XDMXCONFIG_DEP_LIBS@
+XDMX_CFLAGS = @XDMX_CFLAGS@
XDMX_LIBS = @XDMX_LIBS@
+XDMX_SYS_LIBS = @XDMX_SYS_LIBS@
XEGLMODULES_CFLAGS = @XEGLMODULES_CFLAGS@
-XEGLMODULES_LIBS = @XEGLMODULES_LIBS@
XEGL_FALSE = @XEGL_FALSE@
XEGL_LIBS = @XEGL_LIBS@
+XEGL_SYS_LIBS = @XEGL_SYS_LIBS@
XEGL_TRUE = @XEGL_TRUE@
XEPHYR_CFLAGS = @XEPHYR_CFLAGS@
+XEPHYR_DRI_LIBS = @XEPHYR_DRI_LIBS@
XEPHYR_FALSE = @XEPHYR_FALSE@
+XEPHYR_HAS_DRI_FALSE = @XEPHYR_HAS_DRI_FALSE@
+XEPHYR_HAS_DRI_TRUE = @XEPHYR_HAS_DRI_TRUE@
XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XEPHYR_TRUE = @XEPHYR_TRUE@
-XERRORDB_PATH = @XERRORDB_PATH@
XEVIE_FALSE = @XEVIE_FALSE@
XEVIE_TRUE = @XEVIE_TRUE@
XF86BIGFONT_FALSE = @XF86BIGFONT_FALSE@
@@ -449,10 +459,12 @@ XGLXMODULES_CFLAGS = @XGLXMODULES_CFLAGS@
XGLXMODULES_LIBS = @XGLXMODULES_LIBS@
XGLX_FALSE = @XGLX_FALSE@
XGLX_LIBS = @XGLX_LIBS@
+XGLX_SYS_LIBS = @XGLX_SYS_LIBS@
XGLX_TRUE = @XGLX_TRUE@
XGL_FALSE = @XGL_FALSE@
XGL_LIBS = @XGL_LIBS@
XGL_MODULE_PATH = @XGL_MODULE_PATH@
+XGL_SYS_LIBS = @XGL_SYS_LIBS@
XGL_TRUE = @XGL_TRUE@
XINERAMA_FALSE = @XINERAMA_FALSE@
XINERAMA_TRUE = @XINERAMA_TRUE@
@@ -466,19 +478,18 @@ XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@
XNESTMODULES_LIBS = @XNESTMODULES_LIBS@
XNEST_FALSE = @XNEST_FALSE@
XNEST_LIBS = @XNEST_LIBS@
+XNEST_SYS_LIBS = @XNEST_SYS_LIBS@
XNEST_TRUE = @XNEST_TRUE@
XORGCFG_DEP_CFLAGS = @XORGCFG_DEP_CFLAGS@
XORGCFG_DEP_LIBS = @XORGCFG_DEP_LIBS@
XORGCONFIG_DEP_CFLAGS = @XORGCONFIG_DEP_CFLAGS@
XORGCONFIG_DEP_LIBS = @XORGCONFIG_DEP_LIBS@
-XORG_BUS_FREEBSDPCI_FALSE = @XORG_BUS_FREEBSDPCI_FALSE@
-XORG_BUS_FREEBSDPCI_TRUE = @XORG_BUS_FREEBSDPCI_TRUE@
+XORG_BUS_BSDPCI_FALSE = @XORG_BUS_BSDPCI_FALSE@
+XORG_BUS_BSDPCI_TRUE = @XORG_BUS_BSDPCI_TRUE@
XORG_BUS_IX86PCI_FALSE = @XORG_BUS_IX86PCI_FALSE@
XORG_BUS_IX86PCI_TRUE = @XORG_BUS_IX86PCI_TRUE@
XORG_BUS_LINUXPCI_FALSE = @XORG_BUS_LINUXPCI_FALSE@
XORG_BUS_LINUXPCI_TRUE = @XORG_BUS_LINUXPCI_TRUE@
-XORG_BUS_NETBSDPCI_FALSE = @XORG_BUS_NETBSDPCI_FALSE@
-XORG_BUS_NETBSDPCI_TRUE = @XORG_BUS_NETBSDPCI_TRUE@
XORG_BUS_PPCPCI_FALSE = @XORG_BUS_PPCPCI_FALSE@
XORG_BUS_PPCPCI_TRUE = @XORG_BUS_PPCPCI_TRUE@
XORG_BUS_SPARCPCI_FALSE = @XORG_BUS_SPARCPCI_FALSE@
@@ -486,7 +497,6 @@ XORG_BUS_SPARCPCI_TRUE = @XORG_BUS_SPARCPCI_TRUE@
XORG_BUS_SPARC_FALSE = @XORG_BUS_SPARC_FALSE@
XORG_BUS_SPARC_TRUE = @XORG_BUS_SPARC_TRUE@
XORG_CFLAGS = @XORG_CFLAGS@
-XORG_CORE_LIBS = @XORG_CORE_LIBS@
XORG_FALSE = @XORG_FALSE@
XORG_INCS = @XORG_INCS@
XORG_LIBS = @XORG_LIBS@
@@ -496,23 +506,31 @@ XORG_MODULES_CFLAGS = @XORG_MODULES_CFLAGS@
XORG_MODULES_LIBS = @XORG_MODULES_LIBS@
XORG_OS = @XORG_OS@
XORG_OS_SUBDIR = @XORG_OS_SUBDIR@
+XORG_SYS_LIBS = @XORG_SYS_LIBS@
XORG_TRUE = @XORG_TRUE@
+XPRINTMODULES_CFLAGS = @XPRINTMODULES_CFLAGS@
+XPRINTMODULES_LIBS = @XPRINTMODULES_LIBS@
XPRINTPROTO_CFLAGS = @XPRINTPROTO_CFLAGS@
XPRINTPROTO_LIBS = @XPRINTPROTO_LIBS@
XPRINT_CFLAGS = @XPRINT_CFLAGS@
XPRINT_FALSE = @XPRINT_FALSE@
XPRINT_LIBS = @XPRINT_LIBS@
+XPRINT_SYS_LIBS = @XPRINT_SYS_LIBS@
XPRINT_TRUE = @XPRINT_TRUE@
XP_USE_FREETYPE_FALSE = @XP_USE_FREETYPE_FALSE@
XP_USE_FREETYPE_TRUE = @XP_USE_FREETYPE_TRUE@
XQUARTZ_FALSE = @XQUARTZ_FALSE@
XQUARTZ_TRUE = @XQUARTZ_TRUE@
+XREGISTRY_FALSE = @XREGISTRY_FALSE@
+XREGISTRY_TRUE = @XREGISTRY_TRUE@
XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@
XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@
XSDLSERVER_FALSE = @XSDLSERVER_FALSE@
XSDLSERVER_TRUE = @XSDLSERVER_TRUE@
XSDL_INCS = @XSDL_INCS@
XSDL_LIBS = @XSDL_LIBS@
+XSELINUX_FALSE = @XSELINUX_FALSE@
+XSELINUX_TRUE = @XSELINUX_TRUE@
XSERVERCFLAGS_CFLAGS = @XSERVERCFLAGS_CFLAGS@
XSERVERCFLAGS_LIBS = @XSERVERCFLAGS_LIBS@
XSERVERLIBS_CFLAGS = @XSERVERLIBS_CFLAGS@
@@ -520,12 +538,14 @@ XSERVERLIBS_LIBS = @XSERVERLIBS_LIBS@
XSERVER_DTRACE_FALSE = @XSERVER_DTRACE_FALSE@
XSERVER_DTRACE_TRUE = @XSERVER_DTRACE_TRUE@
XSERVER_LIBS = @XSERVER_LIBS@
+XSERVER_SYS_LIBS = @XSERVER_SYS_LIBS@
XTRAP_FALSE = @XTRAP_FALSE@
XTRAP_TRUE = @XTRAP_TRUE@
XTSTEXAMPLES_DEP_CFLAGS = @XTSTEXAMPLES_DEP_CFLAGS@
XTSTEXAMPLES_DEP_LIBS = @XTSTEXAMPLES_DEP_LIBS@
XVFB_FALSE = @XVFB_FALSE@
XVFB_LIBS = @XVFB_LIBS@
+XVFB_SYS_LIBS = @XVFB_SYS_LIBS@
XVFB_TRUE = @XVFB_TRUE@
XVMC_FALSE = @XVMC_FALSE@
XVMC_TRUE = @XVMC_TRUE@
@@ -550,7 +570,7 @@ XWIN_PRIMARYFB_TRUE = @XWIN_PRIMARYFB_TRUE@
XWIN_RANDR_FALSE = @XWIN_RANDR_FALSE@
XWIN_RANDR_TRUE = @XWIN_RANDR_TRUE@
XWIN_SERVER_NAME = @XWIN_SERVER_NAME@
-XWIN_SYSTEM_LIBS = @XWIN_SYSTEM_LIBS@
+XWIN_SYS_LIBS = @XWIN_SYS_LIBS@
XWIN_TRUE = @XWIN_TRUE@
XWIN_XV_FALSE = @XWIN_XV_FALSE@
XWIN_XV_TRUE = @XWIN_XV_TRUE@
@@ -558,6 +578,11 @@ X_PRIVSEP_FALSE = @X_PRIVSEP_FALSE@
X_PRIVSEP_TRUE = @X_PRIVSEP_TRUE@
YACC = @YACC@
__XCONFIGFILE__ = @__XCONFIGFILE__@
+abi_ansic = @abi_ansic@
+abi_extension = @abi_extension@
+abi_font = @abi_font@
+abi_videodrv = @abi_videodrv@
+abi_xinput = @abi_xinput@
ac_ct_AR = @ac_ct_AR@
ac_ct_AS = @ac_ct_AS@
ac_ct_CC = @ac_ct_CC@
@@ -600,6 +625,7 @@ host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
+launchagentsdir = @launchagentsdir@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
diff --git a/xserver/hw/xprint/ps/Ps.h b/xserver/hw/xprint/ps/Ps.h
index 3adad39e4..a25e9891a 100644
--- a/xserver/hw/xprint/ps/Ps.h
+++ b/xserver/hw/xprint/ps/Ps.h
@@ -121,10 +121,10 @@ typedef char *XPointer;
* Public index variables from PsInit.c
*/
-extern int PsScreenPrivateIndex;
-extern int PsWindowPrivateIndex;
-extern int PsContextPrivateIndex;
-extern int PsPixmapPrivateIndex;
+extern DevPrivateKey PsScreenPrivateKey;
+extern DevPrivateKey PsWindowPrivateKey;
+extern DevPrivateKey PsContextPrivateKey;
+extern DevPrivateKey PsPixmapPrivateKey;
extern XpValidatePoolsRec PsValidatePoolsRec;
/*
@@ -517,7 +517,6 @@ extern Bool PsUnmapWindow(WindowPtr pWin);
extern void PsCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
RegionPtr prgnSrc);
extern Bool PsChangeWindowAttributes(WindowPtr pWin, unsigned long mask);
-extern void PsPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what);
extern Bool PsDestroyWindow(WindowPtr pWin);
/*
@@ -575,7 +574,7 @@ extern void PsSetFillColor(DrawablePtr pDrawable, GCPtr pGC, PsOutPtr psOut,
*/
extern PixmapPtr PsCreatePixmap(ScreenPtr pScreen, int width, int height,
- int depth);
+ int depth, unsigned usage_hint);
extern void PsScrubPixmap(PixmapPtr pPixmap);
extern Bool PsDestroyPixmap(PixmapPtr pPixmap);
extern DisplayListPtr PsGetFreeDisplayBlock(PsPixmapPrivPtr priv);
diff --git a/xserver/hw/xprint/ps/PsGC.c b/xserver/hw/xprint/ps/PsGC.c
index 3ec07a77a..19898c90e 100644
--- a/xserver/hw/xprint/ps/PsGC.c
+++ b/xserver/hw/xprint/ps/PsGC.c
@@ -162,9 +162,11 @@ PsGetDrawablePrivateStuff(
c = wColormap((WindowPtr)pDrawable);
cmap = (ColormapPtr)LookupIDByType(c, RT_COLORMAP);
- cPriv = pCon->devPrivates[PsContextPrivateIndex].ptr;
+ cPriv = (PsContextPrivPtr)
+ dixLookupPrivate(&pCon->devPrivates, PsContextPrivateKey);
sPriv = (PsScreenPrivPtr)
- pDrawable->pScreen->devPrivates[PsScreenPrivateIndex].ptr;
+ dixLookupPrivate(&pDrawable->pScreen->devPrivates,
+ PsScreenPrivateKey);
*gc = cPriv->lastGC;
*valid = cPriv->validGC;
*psOut = cPriv->pPsOut;
@@ -189,7 +191,8 @@ PsGetPsContextPriv( DrawablePtr pDrawable )
pCon = PsGetContextFromWindow((WindowPtr)pDrawable);
if (pCon != NULL)
{
- return pCon->devPrivates[PsContextPrivateIndex].ptr;
+ return (PsContextPrivPtr)
+ dixLookupPrivate(&pCon->devPrivates, PsContextPrivateKey);
}
}
return NULL;
@@ -257,8 +260,9 @@ PsUpdateDrawableGC(
PsOut_Offset(*psOut, pDrawable->x, pDrawable->y);
PsOut_Clip(*psOut, pGC->clientClipType, (PsClipPtr)pGC->clientClip);
}
- cPriv = ( PsGetContextFromWindow( (WindowPtr)pDrawable ) )
- ->devPrivates[PsContextPrivateIndex].ptr;
+ cPriv = (PsContextPrivPtr)dixLookupPrivate(
+ &PsGetContextFromWindow((WindowPtr)pDrawable)->devPrivates,
+ PsContextPrivateKey);
break;
}
return TRUE;
diff --git a/xserver/hw/xprint/ps/PsInit.c b/xserver/hw/xprint/ps/PsInit.c
index 639908f73..72bd7bd7c 100644
--- a/xserver/hw/xprint/ps/PsInit.c
+++ b/xserver/hw/xprint/ps/PsInit.c
@@ -97,10 +97,10 @@ static void AllocatePsPrivates(ScreenPtr pScreen);
static int PsInitContext(XpContextPtr pCon);
static int PsDestroyContext(XpContextPtr pCon);
-int PsScreenPrivateIndex;
-int PsContextPrivateIndex;
-int PsPixmapPrivateIndex;
-int PsWindowPrivateIndex;
+DevPrivateKey PsScreenPrivateKey = &PsScreenPrivateKey;
+DevPrivateKey PsContextPrivateKey = &PsContextPrivateKey;
+DevPrivateKey PsPixmapPrivateKey = &PsPixmapPrivateKey;
+DevPrivateKey PsWindowPrivateKey = &PsWindowPrivateKey;
#ifdef GLXEXT
extern void GlxWrapInitVisuals(miInitVisualsProcPtr *);
@@ -152,7 +152,8 @@ InitializePsDriver(ndx, pScreen, argc, argv)
AllocatePsPrivates(pScreen);
#if 0
- pPriv = (PsScreenPrivPtr)pScreen->devPrivates[PsScreenPrivateIndex].ptr;
+ pPriv = (PsScreenPrivPtr)
+ dixLookupPrivate(&pScreen->devPrivates, PsScreenPrivateKey);
pPriv->resDB = rmdb;
#endif
@@ -169,8 +170,6 @@ InitializePsDriver(ndx, pScreen, argc, argv)
pScreen->ChangeWindowAttributes = PsChangeWindowAttributes;
pScreen->RealizeWindow = PsMapWindow;
pScreen->UnrealizeWindow = PsUnmapWindow;
- pScreen->PaintWindowBackground = PsPaintWindow;
- pScreen->PaintWindowBorder = PsPaintWindow;
pScreen->CloseScreen = PsCloseScreen;
pScreen->CopyWindow = PsCopyWindow;
/* XXX Hard routine to write! */
@@ -476,28 +475,12 @@ InitializePsDriver(ndx, pScreen, argc, argv)
static void
AllocatePsPrivates(ScreenPtr pScreen)
{
- static unsigned long PsGeneration = 0;
+ dixRequestPrivate(PsWindowPrivateKey, sizeof(PsWindowPrivRec));
+ dixRequestPrivate(PsContextPrivateKey, sizeof(PsContextPrivRec));
+ dixRequestPrivate(PsPixmapPrivateKey, sizeof(PsPixmapPrivRec));
- if((unsigned long)PsGeneration != serverGeneration)
- {
- PsScreenPrivateIndex = AllocateScreenPrivateIndex();
-
- PsWindowPrivateIndex = AllocateWindowPrivateIndex();
- AllocateWindowPrivate(pScreen, PsWindowPrivateIndex,
- sizeof(PsWindowPrivRec));
-
- PsContextPrivateIndex = XpAllocateContextPrivateIndex();
- XpAllocateContextPrivate(PsContextPrivateIndex,
- sizeof(PsContextPrivRec));
-
- PsPixmapPrivateIndex = AllocatePixmapPrivateIndex();
- AllocatePixmapPrivate(pScreen, PsPixmapPrivateIndex,
- sizeof(PsPixmapPrivRec));
-
- PsGeneration = serverGeneration;
- }
- pScreen->devPrivates[PsScreenPrivateIndex].ptr =
- (pointer)xalloc(sizeof(PsScreenPrivRec));
+ dixSetPrivate(&pScreen->devPrivates, PsScreenPrivateKey,
+ xalloc(sizeof(PsScreenPrivRec)));
}
/*
@@ -552,8 +535,8 @@ PsInitContext(pCon)
/*
* Set up the context privates
*/
- pConPriv =
- (PsContextPrivPtr)pCon->devPrivates[PsContextPrivateIndex].ptr;
+ pConPriv = (PsContextPrivPtr)
+ dixLookupPrivate(&pCon->devPrivates, PsContextPrivateKey);
memset(pConPriv, 0, sizeof(PsContextPrivRec));
pConPriv->jobFileName = (char *)NULL;
@@ -622,8 +605,8 @@ static Bool
PsDestroyContext(pCon)
XpContextPtr pCon;
{
- PsContextPrivPtr pConPriv =
- (PsContextPrivPtr)pCon->devPrivates[PsContextPrivateIndex].ptr;
+ PsContextPrivPtr pConPriv = (PsContextPrivPtr)
+ dixLookupPrivate(&pCon->devPrivates, PsContextPrivateKey);
if( pConPriv->pJobFile!=(FILE *)NULL )
{
@@ -655,7 +638,8 @@ PsGetContextFromWindow(win)
while( win )
{
- pPriv = (PsWindowPrivPtr)win->devPrivates[PsWindowPrivateIndex].ptr;
+ pPriv = (PsWindowPrivPtr)
+ dixLookupPrivate(&win->devPrivates, PsWindowPrivateKey);
if( pPriv->validContext ) return pPriv->context;
win = win->parent;
}
diff --git a/xserver/hw/xprint/ps/PsMisc.c b/xserver/hw/xprint/ps/PsMisc.c
index 0df039e0b..8d5005f91 100644
--- a/xserver/hw/xprint/ps/PsMisc.c
+++ b/xserver/hw/xprint/ps/PsMisc.c
@@ -175,7 +175,7 @@ GetPropString(
if(atom != BAD_RESOURCE)
{
WindowPtr pPropWin;
- int n;
+ int rc, n;
*/
/*
@@ -186,15 +186,12 @@ GetPropString(
for(pPropWin = pWin; pPropWin != (WindowPtr)NULL;
pPropWin = pPropWin->parent)
{
- for(pProp = (PropertyPtr)(wUserProps(pPropWin));
- pProp != (PropertyPtr)NULL;
- pProp = pProp->next)
- {
- if (pProp->propertyName == atom)
- break;
- }
- if(pProp != (PropertyPtr)NULL)
- break;
+ rc = dixLookupProperty(&pProp, pPropWin, atom,
+ serverClient, DixReadAccess);
+ if (rc == Success)
+ break;
+ else
+ pProp = NULL;
}
if(pProp == (PropertyPtr)NULL)
return (char *)NULL;
diff --git a/xserver/hw/xprint/ps/PsPixmap.c b/xserver/hw/xprint/ps/PsPixmap.c
index c3259c98c..a588f4276 100644
--- a/xserver/hw/xprint/ps/PsPixmap.c
+++ b/xserver/hw/xprint/ps/PsPixmap.c
@@ -79,6 +79,7 @@ in this Software without prior written authorization from The Open Group.
#include "windowstr.h"
#include "gcstruct.h"
+#include "privates.h"
#include "Ps.h"
@@ -91,7 +92,8 @@ PsCreatePixmap(
ScreenPtr pScreen,
int width,
int height,
- int depth)
+ int depth,
+ unsigned usage_hint)
{
PixmapPtr pPixmap;
@@ -110,6 +112,7 @@ PsCreatePixmap(
pPixmap->drawable.height = height;
pPixmap->devKind = 0;
pPixmap->refcnt = 1;
+ pPixmap->devPrivates = NULL;
pPixmap->devPrivate.ptr = (PsPixmapPrivPtr)xcalloc(1, sizeof(PsPixmapPrivRec));
if( !pPixmap->devPrivate.ptr )
@@ -196,6 +199,7 @@ PsDestroyPixmap(PixmapPtr pPixmap)
PsScrubPixmap(pPixmap);
xfree(priv);
+ dixFreePrivates(pPixmap->devPrivates);
xfree(pPixmap);
return TRUE;
}
diff --git a/xserver/hw/xprint/ps/PsPrint.c b/xserver/hw/xprint/ps/PsPrint.c
index 4571c07d7..386646858 100644
--- a/xserver/hw/xprint/ps/PsPrint.c
+++ b/xserver/hw/xprint/ps/PsPrint.c
@@ -165,8 +165,8 @@ PsStartJob(
Bool sendClientData,
ClientPtr client)
{
- PsContextPrivPtr pConPriv =
- (PsContextPrivPtr)pCon->devPrivates[PsContextPrivateIndex].ptr;
+ PsContextPrivPtr pConPriv = (PsContextPrivPtr)
+ dixLookupPrivate(&pCon->devPrivates, PsContextPrivateKey);
/*
* Create a temporary file to store the printer output.
@@ -191,8 +191,8 @@ PsEndJob(
struct stat buffer;
int error;
- PsContextPrivPtr priv =
- (PsContextPrivPtr)pCon->devPrivates[PsContextPrivateIndex].ptr;
+ PsContextPrivPtr priv = (PsContextPrivPtr)
+ dixLookupPrivate(&pCon->devPrivates, PsContextPrivateKey);
if (cancel == True) {
if (priv->getDocClient != (ClientPtr) NULL) {
@@ -291,10 +291,10 @@ PsStartPage(
{
int iorient, iplex, icount, ires;
unsigned short iwd, iht;
- PsContextPrivPtr pConPriv =
- (PsContextPrivPtr)pCon->devPrivates[PsContextPrivateIndex].ptr;
- PsWindowPrivPtr pWinPriv =
- (PsWindowPrivPtr)pWin->devPrivates[PsWindowPrivateIndex].ptr;
+ PsContextPrivPtr pConPriv = (PsContextPrivPtr)
+ dixLookupPrivate(&pCon->devPrivates, PsContextPrivateKey);
+ PsWindowPrivPtr pWinPriv = (PsWindowPrivPtr)
+ dixLookupPrivate(&pWin->devPrivates, PsWindowPrivateKey);
/*
* Put a pointer to the context in the window private structure
@@ -337,10 +337,10 @@ PsEndPage(
XpContextPtr pCon,
WindowPtr pWin)
{
- PsWindowPrivPtr pWinPriv =
- (PsWindowPrivPtr)pWin->devPrivates[PsWindowPrivateIndex].ptr;
- PsContextPrivPtr pConPriv =
- (PsContextPrivPtr)pCon->devPrivates[PsContextPrivateIndex].ptr;
+ PsWindowPrivPtr pWinPriv = (PsWindowPrivPtr)
+ dixLookupPrivate(&pWin->devPrivates, PsWindowPrivateKey);
+ PsContextPrivPtr pConPriv = (PsContextPrivPtr)
+ dixLookupPrivate(&pCon->devPrivates, PsContextPrivateKey);
PsOut_EndPage(pConPriv->pPsOut);
@@ -366,8 +366,8 @@ PsStartDoc(XpContextPtr pCon, XPDocumentType type)
int iorient, iplex, icount, ires;
unsigned short iwd, iht;
char *title;
- PsContextPrivPtr pConPriv =
- (PsContextPrivPtr)pCon->devPrivates[PsContextPrivateIndex].ptr;
+ PsContextPrivPtr pConPriv = (PsContextPrivPtr)
+ dixLookupPrivate(&pCon->devPrivates, PsContextPrivateKey);
/* get job level attributes */
title = XpGetOneAttribute(pCon, XPJobAttr, "job-name");
@@ -420,7 +420,8 @@ PsDocumentData(
len_opt)
return BadValue;
- cPriv = pCon->devPrivates[PsContextPrivateIndex].ptr;
+ cPriv = (PsContextPrivPtr)
+ dixLookupPrivate(&pCon->devPrivates, PsContextPrivateKey);
psOut = cPriv->pPsOut;
if (pDraw)
@@ -448,7 +449,7 @@ PsGetDocumentData(
int maxBufferSize)
{
PsContextPrivPtr pPriv = (PsContextPrivPtr)
- pCon->devPrivates[PsContextPrivateIndex].ptr;
+ dixLookupPrivate(&pCon->devPrivates, PsContextPrivateKey);
pPriv->getDocClient = client;
pPriv->getDocBufSize = maxBufferSize;
diff --git a/xserver/hw/xprint/ps/PsText.c b/xserver/hw/xprint/ps/PsText.c
index 98cf15345..872c0f427 100644
--- a/xserver/hw/xprint/ps/PsText.c
+++ b/xserver/hw/xprint/ps/PsText.c
@@ -535,7 +535,7 @@ PsPolyGlyphBlt(
nbyLine = BitmapBytePad(width);
- pbits = (unsigned char *)ALLOCATE_LOCAL(height*nbyLine);
+ pbits = (unsigned char *)xalloc(height*nbyLine);
if (!pbits){
PsDestroyPixmap(pPixmap);
return;
@@ -576,6 +576,6 @@ PsPolyGlyphBlt(
x += pci->metrics.characterWidth;
}
- DEALLOCATE_LOCAL(pbits);
+ xfree(pbits);
FreeScratchGC(pGCtmp);
}
diff --git a/xserver/hw/xprint/ps/PsWindow.c b/xserver/hw/xprint/ps/PsWindow.c
index 1317fd704..8bfde4b0d 100644
--- a/xserver/hw/xprint/ps/PsWindow.c
+++ b/xserver/hw/xprint/ps/PsWindow.c
@@ -123,9 +123,9 @@ PsCreateWindow(WindowPtr pWin)
Bool status = Success;
ScreenPtr pScreen = pWin->drawable.pScreen;
PsScreenPrivPtr pScreenPriv = (PsScreenPrivPtr)
- pScreen->devPrivates[PsScreenPrivateIndex].ptr;
+ dixLookupPrivate(&pScreen->devPrivates, PsScreenPrivateKey);
PsWindowPrivPtr pWinPriv = (PsWindowPrivPtr)
- pWin->devPrivates[PsWindowPrivateIndex].ptr;
+ dixLookupPrivate(&pWin->devPrivates, PsWindowPrivateKey);
/*
* Initialize this window's private struct.
@@ -154,9 +154,9 @@ PsCreateWindow(WindowPtr pWin)
{
propName = MakeAtom(propStrings[i], strlen(propStrings[i]),
TRUE);
- ChangeWindowProperty(pWin, propName, XA_STRING, 8,
- PropModeReplace, strlen(propVal),
- (pointer)propVal, FALSE);
+ dixChangeWindowProperty(serverClient, pWin, propName, XA_STRING,
+ 8, PropModeReplace, strlen(propVal),
+ (pointer)propVal, FALSE);
xfree(propVal);
}
}
@@ -165,7 +165,8 @@ PsCreateWindow(WindowPtr pWin)
return status;
#endif
- pPriv = (PsWindowPrivPtr)pWin->devPrivates[PsWindowPrivateIndex].ptr;
+ pPriv = (PsWindowPrivPtr)
+ dixLookupPrivate(&pWin->devPrivates, PsWindowPrivateKey);
pPriv->validContext = 0;
return TRUE;
@@ -213,244 +214,6 @@ PsChangeWindowAttributes(
return TRUE;
}
-
-void
-PsPaintWindow(
- WindowPtr pWin,
- RegionPtr pRegion,
- int what)
-{
- WindowPtr pRoot;
-
-#define FUNCTION 0
-#define FOREGROUND 1
-#define TILE 2
-#define FILLSTYLE 3
-#define ABSX 4
-#define ABSY 5
-#define CLIPMASK 6
-#define SUBWINDOW 7
-#define COUNT_BITS 8
-
- pointer gcval[7];
- pointer newValues [COUNT_BITS];
-
- BITS32 gcmask, index, mask;
- RegionRec prgnWin;
- DDXPointRec oldCorner;
- BoxRec box;
- WindowPtr pBgWin;
- GCPtr pGC;
- register int i;
- register BoxPtr pbox;
- register ScreenPtr pScreen = pWin->drawable.pScreen;
- register xRectangle *prect;
- int numRects;
-
- gcmask = 0;
-
- /*
- * We don't want to paint a window that has no place to put the
- * PS output.
- */
- if( PsGetContextFromWindow(pWin)==(XpContextPtr)NULL ) return;
-
- if( what==PW_BACKGROUND )
- {
- switch(pWin->backgroundState)
- {
- case None: return;
- case ParentRelative:
- (*pWin->parent->drawable.pScreen->PaintWindowBackground)
- (pWin->parent, pRegion, what);
- return;
- case BackgroundPixel:
- newValues[FOREGROUND] = (pointer)pWin->background.pixel;
- newValues[FILLSTYLE] = (pointer)FillSolid;
- gcmask |= GCForeground | GCFillStyle;
- break;
- case BackgroundPixmap:
- newValues[TILE] = (pointer)pWin->background.pixmap;
- newValues[FILLSTYLE] = (pointer)FillTiled;
- gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin;
- break;
- }
- }
- else
- {
- if( pWin->borderIsPixel )
- {
- newValues[FOREGROUND] = (pointer)pWin->border.pixel;
- newValues[FILLSTYLE] = (pointer)FillSolid;
- gcmask |= GCForeground | GCFillStyle;
- }
- else
- {
- newValues[TILE] = (pointer)pWin->border.pixmap;
- newValues[FILLSTYLE] = (pointer)FillTiled;
- gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin;
- }
- }
-
- prect = (xRectangle *)ALLOCATE_LOCAL(REGION_NUM_RECTS(pRegion) *
- sizeof(xRectangle));
- if( !prect ) return;
-
- newValues[FUNCTION] = (pointer)GXcopy;
- gcmask |= GCFunction | GCClipMask;
-
- i = pScreen->myNum;
- pRoot = WindowTable[i];
-
- pBgWin = pWin;
- if (what == PW_BORDER)
- {
- while( pBgWin->backgroundState==ParentRelative ) pBgWin = pBgWin->parent;
- }
-
- pGC = GetScratchGC(pWin->drawable.depth, pWin->drawable.pScreen);
- if( !pGC )
- {
- DEALLOCATE_LOCAL(prect);
- return;
- }
- /*
- * mash the clip list so we can paint the border by
- * mangling the window in place, pretending it
- * spans the entire screen
- */
- if( what==PW_BORDER )
- {
- prgnWin = pWin->clipList;
- oldCorner.x = pWin->drawable.x;
- oldCorner.y = pWin->drawable.y;
- pWin->drawable.x = pWin->drawable.y = 0;
- box.x1 = 0;
- box.y1 = 0;
- box.x2 = pScreen->width;
- box.y2 = pScreen->height;
- REGION_INIT(pScreen, &pWin->clipList, &box, 1);
- pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- newValues[ABSX] = (pointer)(long)pBgWin->drawable.x;
- newValues[ABSY] = (pointer)(long)pBgWin->drawable.y;
- }
- else
- {
- newValues[ABSX] = (pointer)0;
- newValues[ABSY] = (pointer)0;
- }
-
-/*
- * XXX Backing store is turned off for the PS driver
-
- if( pWin->backStorage )
- (*pWin->drawable.pScreen->DrawGuarantee) (pWin, pGC, GuaranteeVisBack);
- */
-
- mask = gcmask;
- gcmask = 0;
- i = 0;
- while( mask )
- {
- index = lowbit (mask);
- mask &= ~index;
- switch(index)
- {
- case GCFunction:
- if( (pointer)(long)pGC->alu!=newValues[FUNCTION] )
- {
- gcmask |= index;
- gcval[i++] = newValues[FUNCTION];
- }
- break;
- case GCTileStipXOrigin:
- if( (pointer)(long)pGC->patOrg.x!=newValues[ABSX] )
- {
- gcmask |= index;
- gcval[i++] = newValues[ABSX];
- }
- break;
- case GCTileStipYOrigin:
- if( (pointer)(long)pGC->patOrg.y!=newValues[ABSY] )
- {
- gcmask |= index;
- gcval[i++] = newValues[ABSY];
- }
- break;
- case GCClipMask:
- if( (pointer)pGC->clientClipType!=(pointer)CT_NONE )
- {
- gcmask |= index;
- gcval[i++] = (pointer)CT_NONE;
- }
- break;
- case GCSubwindowMode:
- if( (pointer)pGC->subWindowMode!=newValues[SUBWINDOW] )
- {
- gcmask |= index;
- gcval[i++] = newValues[SUBWINDOW];
- }
- break;
- case GCTile:
- if( pGC->tileIsPixel || (pointer)pGC->tile.pixmap!=newValues[TILE] )
- {
- gcmask |= index;
- gcval[i++] = newValues[TILE];
- }
- break;
- case GCFillStyle:
- if( (pointer)pGC->fillStyle!=newValues[FILLSTYLE] )
- {
- gcmask |= index;
- gcval[i++] = newValues[FILLSTYLE];
- }
- break;
- case GCForeground:
- if( (pointer)pGC->fgPixel!=newValues[FOREGROUND] )
- {
- gcmask |= index;
- gcval[i++] = newValues[FOREGROUND];
- }
- break;
- }
- }
-
- if( gcmask ) DoChangeGC(pGC, gcmask, (XID *)gcval, 1);
-
- if( pWin->drawable.serialNumber!=pGC->serialNumber )
- ValidateGC((DrawablePtr)pWin, pGC);
-
- numRects = REGION_NUM_RECTS(pRegion);
- pbox = REGION_RECTS(pRegion);
- for( i=numRects ; --i >= 0 ; pbox++,prect++ )
- {
- prect->x = pbox->x1 - pWin->drawable.x;
- prect->y = pbox->y1 - pWin->drawable.y;
- prect->width = pbox->x2 - pbox->x1;
- prect->height = pbox->y2 - pbox->y1;
- }
- prect -= numRects;
- (*pGC->ops->PolyFillRect)((DrawablePtr)pWin, pGC, numRects, prect);
- DEALLOCATE_LOCAL(prect);
-
-/*
- * XXX Backing store is turned off for the PS driver
-
- if( pWin->backStorage )
- (*pWin->drawable.pScreen->DrawGuarantee) (pWin, pGC, GuaranteeNothing);
- */
-
- if( what==PW_BORDER )
- {
- REGION_UNINIT(pScreen, &pWin->clipList);
- pWin->clipList = prgnWin;
- pWin->drawable.x = oldCorner.x;
- pWin->drawable.y = oldCorner.y;
- pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- }
- FreeScratchGC(pGC);
-}
-
/*ARGSUSED*/
Bool
PsDestroyWindow(WindowPtr pWin)
diff --git a/xserver/hw/xprint/ps/psout.h b/xserver/hw/xprint/ps/psout.h
index 3e19d5a67..1138e4afe 100644
--- a/xserver/hw/xprint/ps/psout.h
+++ b/xserver/hw/xprint/ps/psout.h
@@ -169,7 +169,7 @@ typedef signed __int64 PsOutColor;
defined(ia64) || defined(__ia64__) || \
defined(__sparc64__) || defined(_LP64) || \
defined(__s390x__) || \
- defined(amd64) || defined (__amd64__) || \
+ defined(amd64) || defined (__amd64__) || defined(__x86_64__) || \
defined (__powerpc64__) || \
(defined(sgi) && (_MIPS_SZLONG == 64))
typedef signed long PsOutColor;
diff --git a/xserver/hw/xprint/ps/psout_ft.c b/xserver/hw/xprint/ps/psout_ft.c
index b10d9e592..30939f972 100644
--- a/xserver/hw/xprint/ps/psout_ft.c
+++ b/xserver/hw/xprint/ps/psout_ft.c
@@ -280,6 +280,8 @@ PsOut_FreeType_Text16(FontPtr pFont, PsOutPtr self, int x, int y, unsigned short
else
{
sprintf(buf, "%s", baseFontName);
+ xfree(self->FontName);
+ self->FontName = NULL;
}
if( self->FontSize == -1 )
diff --git a/xserver/hw/xprint/ps/psout_ftpstype1.c b/xserver/hw/xprint/ps/psout_ftpstype1.c
index 2d40c186a..572e13601 100644
--- a/xserver/hw/xprint/ps/psout_ftpstype1.c
+++ b/xserver/hw/xprint/ps/psout_ftpstype1.c
@@ -124,7 +124,7 @@ int PsOut_DownloadFreeType1(PsOutPtr self, const char *psfontname, FontPtr pFont
switch(childpid)
{
case -1:
- FatalError("PS DDX internal error: Cannot fork() converter child process, errno=%d\n", (int)errno);
+ FatalError("PS DDX internal error: Cannot fork() converter child process, %s\n", strerror(errno));
break;
case 0: /* child */
fclose(self->Fp);