static BOOL PSDRV_WriteImageMaskHeader(PHYSDEV dev, const BITMAPINFO *info, INT xDst, INT yDst, INT widthDst, INT heightDst, INT widthSrc, INT heightSrc) { PSCOLOR bkgnd, foregnd; assert(info->bmiHeader.biBitCount == 1); /* We'll write the mask with -ve polarity so that the foregnd color corresponds to a bit equal to 0 in the bitmap. */ PSDRV_CreateColor(dev, &foregnd, RGB(info->bmiColors[0].rgbRed, info->bmiColors[0].rgbGreen, info->bmiColors[0].rgbBlue) ); PSDRV_CreateColor(dev, &bkgnd, RGB(info->bmiColors[1].rgbRed, info->bmiColors[1].rgbGreen, info->bmiColors[1].rgbBlue) ); PSDRV_WriteGSave(dev); PSDRV_WriteNewPath(dev); PSDRV_WriteRectangle(dev, xDst, yDst, widthDst, heightDst); PSDRV_WriteSetColor(dev, &bkgnd); PSDRV_WriteFill(dev); PSDRV_WriteGRestore(dev); PSDRV_WriteSetColor(dev, &foregnd); PSDRV_WriteImage(dev, 1, xDst, yDst, widthDst, heightDst, widthSrc, heightSrc, TRUE, info->bmiHeader.biHeight < 0); return TRUE; }
/********************************************************************** * * PSDRV_Fill * */ static BOOL PSDRV_Fill(PHYSDEV dev, BOOL EO) { if(!EO) return PSDRV_WriteFill(dev); else return PSDRV_WriteEOFill(dev); }
/********************************************************************** * * PSDRV_Fill * */ static BOOL PSDRV_Fill(PSDRV_PDEVICE *physDev, BOOL EO) { if(!EO) return PSDRV_WriteFill(physDev); else return PSDRV_WriteEOFill(physDev); }
/*********************************************************************** * PSDRV_ExtTextOut */ BOOL PSDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const RECT *lprect, LPCWSTR str, UINT count, const INT *lpDx ) { PSDRV_PDEVICE *physDev = get_psdrv_dev( dev ); BOOL bResult = TRUE; BOOL bClipped = FALSE; BOOL bOpaque = FALSE; TRACE("(x=%d, y=%d, flags=0x%08x, str=%s, count=%d, lpDx=%p)\n", x, y, flags, debugstr_wn(str, count), count, lpDx); if(physDev->job.id == 0) return FALSE; /* write font if not already written */ PSDRV_SetFont(dev); PSDRV_SetClip(dev); /* set clipping and/or draw background */ if ((flags & (ETO_CLIPPED | ETO_OPAQUE)) && (lprect != NULL)) { PSDRV_WriteGSave(dev); PSDRV_WriteRectangle(dev, lprect->left, lprect->top, lprect->right - lprect->left, lprect->bottom - lprect->top); if (flags & ETO_OPAQUE) { bOpaque = TRUE; PSDRV_WriteGSave(dev); PSDRV_WriteSetColor(dev, &physDev->bkColor); PSDRV_WriteFill(dev); PSDRV_WriteGRestore(dev); } if (flags & ETO_CLIPPED) { bClipped = TRUE; PSDRV_WriteClip(dev); } bResult = PSDRV_Text(dev, x, y, flags, str, count, !(bClipped && bOpaque), lpDx); PSDRV_WriteGRestore(dev); } else { bResult = PSDRV_Text(dev, x, y, flags, str, count, TRUE, lpDx); } PSDRV_ResetClip(dev); return bResult; }
/*********************************************************************** * PSDRV_SetPixel */ COLORREF PSDRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color ) { PSCOLOR pscolor; POINT pt; pt.x = x; pt.y = y; LPtoDP( dev->hdc, &pt, 1 ); PSDRV_SetClip(dev); /* we bracket the setcolor in gsave/grestore so that we don't trash the current pen colour */ PSDRV_WriteGSave(dev); PSDRV_WriteRectangle( dev, pt.x, pt.y, 0, 0 ); PSDRV_CreateColor( dev, &pscolor, color ); PSDRV_WriteSetColor( dev, &pscolor ); PSDRV_WriteFill( dev ); PSDRV_WriteGRestore(dev); PSDRV_ResetClip(dev); return color; }
/*********************************************************************** * * PSDRV_PatBlt */ BOOL PSDRV_PatBlt(PHYSDEV dev, struct bitblt_coords *dst, DWORD dwRop) { switch(dwRop) { case PATCOPY: PSDRV_SetClip(dev); PSDRV_WriteGSave(dev); PSDRV_WriteRectangle(dev, dst->visrect.left, dst->visrect.top, dst->visrect.right - dst->visrect.left, dst->visrect.bottom - dst->visrect.top ); PSDRV_Brush(dev, FALSE); PSDRV_WriteGRestore(dev); PSDRV_ResetClip(dev); return TRUE; case BLACKNESS: case WHITENESS: { PSCOLOR pscol; PSDRV_SetClip(dev); PSDRV_WriteGSave(dev); PSDRV_WriteRectangle(dev, dst->visrect.left, dst->visrect.top, dst->visrect.right - dst->visrect.left, dst->visrect.bottom - dst->visrect.top ); PSDRV_CreateColor( dev, &pscol, (dwRop == BLACKNESS) ? RGB(0,0,0) : RGB(0xff,0xff,0xff) ); PSDRV_WriteSetColor(dev, &pscol); PSDRV_WriteFill(dev); PSDRV_WriteGRestore(dev); PSDRV_ResetClip(dev); return TRUE; } default: FIXME("Unsupported rop %06x\n", dwRop); return FALSE; } }