summaryrefslogtreecommitdiff
path: root/Xprint/ps/PsGC.c
diff options
context:
space:
mode:
Diffstat (limited to 'Xprint/ps/PsGC.c')
-rw-r--r--Xprint/ps/PsGC.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/Xprint/ps/PsGC.c b/Xprint/ps/PsGC.c
index ea441cff5..78c83930d 100644
--- a/Xprint/ps/PsGC.c
+++ b/Xprint/ps/PsGC.c
@@ -57,7 +57,6 @@ in this Software without prior written authorization from The Open Group.
* or other dealings in this Software without prior written authorization
* from said copyright holders.
*/
-/* $XFree86: xc/programs/Xserver/Xprint/ps/PsGC.c,v 1.6tsi Exp $ */
/*******************************************************************
**
@@ -157,13 +156,19 @@ PsGetDrawablePrivateStuff(
if( pCon==NULL ) return FALSE;
else
{
+ Colormap c;
+ ColormapPtr cmap;
+
+ c = wColormap((WindowPtr)pDrawable);
+ cmap = (ColormapPtr)LookupIDByType(c, RT_COLORMAP);
+
cPriv = pCon->devPrivates[PsContextPrivateIndex].ptr;
sPriv = (PsScreenPrivPtr)
pDrawable->pScreen->devPrivates[PsScreenPrivateIndex].ptr;
*gc = cPriv->lastGC;
*valid = cPriv->validGC;
*psOut = cPriv->pPsOut;
- *cMap = sPriv->CMap;
+ *cMap = cmap;
return TRUE;
}
default:
@@ -171,6 +176,26 @@ PsGetDrawablePrivateStuff(
}
}
+PsContextPrivPtr
+PsGetPsContextPriv( DrawablePtr pDrawable )
+{
+ XpContextPtr pCon;
+ PsContextPrivPtr cPriv;
+
+ switch(pDrawable->type)
+ {
+ case DRAWABLE_PIXMAP:
+ return FALSE;
+ case DRAWABLE_WINDOW:
+ pCon = PsGetContextFromWindow((WindowPtr)pDrawable);
+ if (pCon != NULL)
+ {
+ return pCon->devPrivates[PsContextPrivateIndex].ptr;
+ }
+ }
+ return NULL;
+}
+
int
PsUpdateDrawableGC(
GCPtr pGC,
@@ -181,6 +206,7 @@ PsUpdateDrawableGC(
GC dGC;
unsigned long valid;
int i;
+ PsContextPrivPtr cPriv;
BoxPtr boxes;
if (!PsGetDrawablePrivateStuff(pDrawable, &dGC, &valid, psOut, cMap))
@@ -232,6 +258,8 @@ PsUpdateDrawableGC(
PsOut_Offset(*psOut, pDrawable->x, pDrawable->y);
PsOut_Clip(*psOut, pGC->clientClipType, (PsClipPtr)pGC->clientClip);
}
+ cPriv = ( PsGetContextFromWindow( (WindowPtr)pDrawable ) )
+ ->devPrivates[PsContextPrivateIndex].ptr;
break;
}
return TRUE;