⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mibstore.c

📁 远程桌面连接工具
💻 C
📖 第 1 页 / 共 5 页
字号:
	if (pixExposed){	    REGION_UNION(pDst->pScreen, winExposed, winExposed, pixExposed);	    REGION_DESTROY(pDst->pScreen, pixExposed);	}    } else	winExposed = pixExposed;    EPILOGUE (pGC);    return winExposed;}/*- *----------------------------------------------------------------------- * miBSCopyPlane -- * * Results: *	None. * * Side Effects: * *----------------------------------------------------------------------- */static RegionPtrmiBSCopyPlane (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty, plane)    DrawablePtr	  pSrc;    DrawablePtr	  pDst;    register GC   *pGC;    int     	  srcx,		  srcy;    int     	  w,		  h;    int     	  dstx,		  dsty;    unsigned long  plane;{    BoxPtr	pExtents;    long	dx, dy;    int		bsrcx, bsrcy, bw, bh, bdstx, bdsty;    RegionPtr	winExposed = 0, pixExposed = 0;    SETUP_BACKING(pDst, pGC);    PROLOGUE(pGC);    if ((pSrc != pDst) ||	(!miBSDoCopy((WindowPtr)pSrc, pGC, srcx, srcy, w, h, dstx, dsty,		     plane,  pGC->ops->CopyPlane, &winExposed)))    {	/*	 * always copy to the backing store first, miBSDoCopy	 * returns FALSE if the *source* region is disjoint	 * from the backing store saved region.  So, copying	 * *to* the backing store is always safe	 */	if (pGC->clientClipType != CT_PIXMAP)	{	    /*	     * adjust srcx, srcy, w, h, dstx, dsty to be clipped to	     * the backing store.  An unnecessary optimisation,	     * but a useful one when GetSpans is slow.	     */	    pExtents = REGION_EXTENTS(pDst->pScreen,				      (RegionPtr)pBackingGC->clientClip);	    bsrcx = srcx;	    bsrcy = srcy;	    bw = w;	    bh = h;	    bdstx = dstx;	    bdsty = dsty;	    dx = pExtents->x1 - bdstx;	    if (dx > 0)	    {		bsrcx += dx;		bdstx += dx;		bw -= dx;	    }	    dy = pExtents->y1 - bdsty;	    if (dy > 0)	    {		bsrcy += dy;		bdsty += dy;		bh -= dy;	    }	    dx = (bdstx + bw) - pExtents->x2;	    if (dx > 0)		bw -= dx;	    dy = (bdsty + bh) - pExtents->y2;	    if (dy > 0)		bh -= dy;	    if (bw > 0 && bh > 0)		pixExposed = (* pBackingGC->ops->CopyPlane) (pSrc, 				    pBackingDrawable,				    pBackingGC, bsrcx, bsrcy, bw, bh,				    bdstx - pBackingStore->x,				    bdsty - pBackingStore->y, plane);	}	else	    pixExposed = (* pBackingGC->ops->CopyPlane) (pSrc, 				    pBackingDrawable,				    pBackingGC, srcx, srcy, w, h,				    dstx - pBackingStore->x,				    dsty - pBackingStore->y, plane);	winExposed = (* pGC->ops->CopyPlane) (pSrc, pDst, pGC, srcx, srcy, w, h,			      dstx, dsty, plane);	    }    /*     * compute the composite graphics exposure region     */    if (winExposed)    {	if (pixExposed)	{	    REGION_UNION(pDst->pScreen, winExposed, winExposed, pixExposed);	    REGION_DESTROY(pDst->pScreen, pixExposed);	}    } else	winExposed = pixExposed;    EPILOGUE (pGC);    return winExposed;}/*- *----------------------------------------------------------------------- * miBSPolyPoint -- *	Perform a PolyPoint, routing output to backing-store as needed. * * Results: *	None. * * Side Effects: * *----------------------------------------------------------------------- */static voidmiBSPolyPoint (pDrawable, pGC, mode, npt, pptInit)    DrawablePtr pDrawable;    GCPtr	pGC;    int		mode;		/* Origin or Previous */    int		npt;    xPoint 	*pptInit;{    xPoint	  *pptCopy;    SETUP_BACKING (pDrawable, pGC);    PROLOGUE(pGC);    pptCopy = (xPoint *)ALLOCATE_LOCAL(npt*sizeof(xPoint));    if (pptCopy)    {	copyPoints(pptInit, pptCopy, npt, mode);	(* pGC->ops->PolyPoint) (pDrawable, pGC, mode, npt, pptInit);	(* pBackingGC->ops->PolyPoint) (pBackingDrawable,				   pBackingGC, mode, npt, pptCopy);	DEALLOCATE_LOCAL(pptCopy);    }    EPILOGUE (pGC);}/*- *----------------------------------------------------------------------- * miBSPolyLines -- *	Perform a Polylines, routing output to backing-store as needed. * * Results: * * Side Effects: * *----------------------------------------------------------------------- */static voidmiBSPolylines (pDrawable, pGC, mode, npt, pptInit)    DrawablePtr	  pDrawable;    GCPtr   	  pGC;    int	    	  mode;    int	    	  npt;    DDXPointPtr	  pptInit;{    DDXPointPtr	pptCopy;    SETUP_BACKING (pDrawable, pGC);    PROLOGUE(pGC);    pptCopy = (DDXPointPtr)ALLOCATE_LOCAL(npt*sizeof(DDXPointRec));    if (pptCopy)    {	copyPoints(pptInit, pptCopy, npt, mode);	(* pGC->ops->Polylines)(pDrawable, pGC, mode, npt, pptInit);	(* pBackingGC->ops->Polylines)(pBackingDrawable,				  pBackingGC, mode, npt, pptCopy);	DEALLOCATE_LOCAL(pptCopy);    }    EPILOGUE (pGC);}/*- *----------------------------------------------------------------------- * miBSPolySegment -- *	Perform a PolySegment, routing output to backing-store as needed. * * Results: *	None. * * Side Effects: * *----------------------------------------------------------------------- */static voidmiBSPolySegment(pDrawable, pGC, nseg, pSegs)    DrawablePtr pDrawable;    GCPtr 	pGC;    int		nseg;    xSegment	*pSegs;{    xSegment	*pSegsCopy;    SETUP_BACKING (pDrawable, pGC);    PROLOGUE(pGC);    pSegsCopy = (xSegment *)ALLOCATE_LOCAL(nseg*sizeof(xSegment));    if (pSegsCopy)    {	copyData(pSegs, pSegsCopy, nseg << 1, MoreCopy0);	(* pGC->ops->PolySegment)(pDrawable, pGC, nseg, pSegs);	(* pBackingGC->ops->PolySegment)(pBackingDrawable,				    pBackingGC, nseg, pSegsCopy);	DEALLOCATE_LOCAL(pSegsCopy);    }    EPILOGUE (pGC);}/*- *----------------------------------------------------------------------- * miBSPolyRectangle -- *	Perform a PolyRectangle, routing output to backing-store as needed. * * Results: *	None * * Side Effects: * *----------------------------------------------------------------------- */static voidmiBSPolyRectangle(pDrawable, pGC, nrects, pRects)    DrawablePtr	pDrawable;    GCPtr	pGC;    int		nrects;    xRectangle	*pRects;{    xRectangle	*pRectsCopy;    SETUP_BACKING (pDrawable, pGC);    PROLOGUE(pGC);    pRectsCopy =(xRectangle *)ALLOCATE_LOCAL(nrects*sizeof(xRectangle));    if (pRectsCopy)    {	copyData(pRects, pRectsCopy, nrects, MoreCopy2);	(* pGC->ops->PolyRectangle)(pDrawable, pGC, nrects, pRects);	(* pBackingGC->ops->PolyRectangle)(pBackingDrawable,				      pBackingGC, nrects, pRectsCopy);	DEALLOCATE_LOCAL(pRectsCopy);    }    EPILOGUE (pGC);}/*- *----------------------------------------------------------------------- * miBSPolyArc -- *	Perform a PolyArc, routing output to backing-store as needed. * * Results: * * Side Effects: * *----------------------------------------------------------------------- */static voidmiBSPolyArc(pDrawable, pGC, narcs, parcs)    DrawablePtr	pDrawable;    GCPtr	pGC;    int		narcs;    xArc	*parcs;{    xArc  *pArcsCopy;    SETUP_BACKING (pDrawable, pGC);    PROLOGUE(pGC);    pArcsCopy = (xArc *)ALLOCATE_LOCAL(narcs*sizeof(xArc));    if (pArcsCopy)    {	copyData(parcs, pArcsCopy, narcs, MoreCopy4);	(* pGC->ops->PolyArc)(pDrawable, pGC, narcs, parcs);	(* pBackingGC->ops->PolyArc)(pBackingDrawable, pBackingGC,				narcs, pArcsCopy);	DEALLOCATE_LOCAL(pArcsCopy);    }    EPILOGUE (pGC);}/*- *----------------------------------------------------------------------- * miBSFillPolygon -- *	Perform a FillPolygon, routing output to backing-store as needed. * * Results: *	None. * * Side Effects: * *----------------------------------------------------------------------- */static voidmiBSFillPolygon(pDrawable, pGC, shape, mode, count, pPts)    DrawablePtr		pDrawable;    register GCPtr	pGC;    int			shape, mode;    register int	count;    DDXPointPtr		pPts;{    DDXPointPtr	pPtsCopy;    SETUP_BACKING (pDrawable, pGC);    PROLOGUE(pGC);    pPtsCopy = (DDXPointPtr)ALLOCATE_LOCAL(count*sizeof(DDXPointRec));    if (pPtsCopy)    {	copyPoints(pPts, pPtsCopy, count, mode);	(* pGC->ops->FillPolygon)(pDrawable, pGC, shape, mode, count, pPts);	(* pBackingGC->ops->FillPolygon)(pBackingDrawable,				    pBackingGC, shape, mode,				    count, pPtsCopy);	DEALLOCATE_LOCAL(pPtsCopy);    }    EPILOGUE (pGC);}/*- *----------------------------------------------------------------------- * miBSPolyFillRect -- *	Perform a PolyFillRect, routing output to backing-store as needed. * * Results: *	None. * * Side Effects: * *----------------------------------------------------------------------- */static voidmiBSPolyFillRect(pDrawable, pGC, nrectFill, prectInit)    DrawablePtr pDrawable;    GCPtr	pGC;    int		nrectFill; 	/* number of rectangles to fill */    xRectangle	*prectInit;  	/* Pointer to first rectangle to fill */{    xRectangle	*pRectCopy;    SETUP_BACKING (pDrawable, pGC);    PROLOGUE(pGC);    pRectCopy =	(xRectangle *)ALLOCATE_LOCAL(nrectFill*sizeof(xRectangle));    if (pRectCopy)    {	copyData(prectInit, pRectCopy, nrectFill, MoreCopy2);	(* pGC->ops->PolyFillRect)(pDrawable, pGC, nrectFill, prectInit);	(* pBackingGC->ops->PolyFillRect)(pBackingDrawable,				     pBackingGC, nrectFill, pRectCopy);	DEALLOCATE_LOCAL(pRectCopy);    }    EPILOGUE (pGC);}/*- *----------------------------------------------------------------------- * miBSPolyFillArc -- *	Perform a PolyFillArc, routing output to backing-store as needed. * * Results: *	None. * * Side Effects: * *----------------------------------------------------------------------- */static voidmiBSPolyFillArc(pDrawable, pGC, narcs, parcs)    DrawablePtr	pDrawable;    GCPtr	pGC;    int		narcs;    xArc	*parcs;{    xArc  *pArcsCopy;    SETUP_BACKING (pDrawable, pGC);    PROLOGUE(pGC);    pArcsCopy = (xArc *)ALLOCATE_LOCAL(narcs*sizeof(xArc));    if (pArcsCopy)    {	copyData(parcs, pArcsCopy, narcs, MoreCopy4);	(* pGC->ops->PolyFillArc)(pDrawable, pGC, narcs, parcs);	(* pBackingGC->ops->PolyFillArc)(pBackingDrawable,				    pBackingGC, narcs, pArcsCopy);	DEALLOCATE_LOCAL(pArcsCopy);    }    EPILOGUE (pGC);}/*- *----------------------------------------------------------------------- * miBSPolyText8 -- *	Perform a PolyText8, routing output to backing-store as needed. * * Results: * * Side Effects: * *----------------------------------------------------------------------- */static intmiBSPolyText8(pDrawable, pGC, x, y, count, chars)    DrawablePtr pDrawable;    GCPtr	pGC;    int		x, y;    int 	count;    char	*chars;{    int	    result;    SETUP_BACKING (pDrawable, pGC);    PROLOGUE(pGC);    result = (* pGC->ops->PolyText8)(pDrawable, pGC, x, y, count, chars);    (* pBackingGC->ops->PolyText8)(pBackingDrawable, pBackingGC,				   x - pBackingStore->x, y - pBackingStore->y,				   count, chars);    EPILOGUE (pGC);    return result;}/*- *----------------------------------------------------------------------- * miBSPolyText16 -- *	Perform a PolyText16, routing output to backing-store as needed. * * Results: * * Side Effects: * *----------------------------------------------------------------------- */static intmiBSPolyText16(pDrawable, pGC, x, y, count, chars)    DrawablePtr pDrawable;    GCPtr	pGC;    int		x, y;    int		count;    unsigned short *chars;{    int	result;    SETUP_BACKING (pDrawable, pGC);    PROLOGUE(pGC);    result = (* pGC->ops->PolyText16)(pDrawable, pGC, x, y, count, chars);    (* pBackingGC->ops->PolyText16)(pBackingDrawable, pBackingGC,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -