wineps.drv: Pass a generic PHYSDEV to all graphics functions.
This commit is contained in:
parent
ba2a6ee983
commit
10dcba499f
|
@ -28,7 +28,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
|
|||
*
|
||||
* PSDRV_PatBlt
|
||||
*/
|
||||
BOOL CDECL PSDRV_PatBlt(PSDRV_PDEVICE *physDev, INT x, INT y, INT width, INT height, DWORD dwRop)
|
||||
BOOL CDECL PSDRV_PatBlt(PHYSDEV dev, INT x, INT y, INT width, INT height, DWORD dwRop)
|
||||
{
|
||||
POINT pt[2];
|
||||
|
||||
|
@ -36,16 +36,16 @@ BOOL CDECL PSDRV_PatBlt(PSDRV_PDEVICE *physDev, INT x, INT y, INT width, INT hei
|
|||
pt[0].y = y;
|
||||
pt[1].x = x + width;
|
||||
pt[1].y = y + height;
|
||||
LPtoDP( physDev->hdc, pt, 2 );
|
||||
LPtoDP( dev->hdc, pt, 2 );
|
||||
|
||||
switch(dwRop) {
|
||||
case PATCOPY:
|
||||
PSDRV_SetClip(physDev);
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_WriteRectangle(physDev, pt[0].x, pt[0].y, pt[1].x - pt[0].x, pt[1].y - pt[0].y );
|
||||
PSDRV_Brush(physDev, FALSE);
|
||||
PSDRV_WriteGRestore(physDev);
|
||||
PSDRV_ResetClip(physDev);
|
||||
PSDRV_SetClip(dev);
|
||||
PSDRV_WriteGSave(dev);
|
||||
PSDRV_WriteRectangle(dev, pt[0].x, pt[0].y, pt[1].x - pt[0].x, pt[1].y - pt[0].y );
|
||||
PSDRV_Brush(dev, FALSE);
|
||||
PSDRV_WriteGRestore(dev);
|
||||
PSDRV_ResetClip(dev);
|
||||
return TRUE;
|
||||
|
||||
case BLACKNESS:
|
||||
|
@ -53,15 +53,14 @@ BOOL CDECL PSDRV_PatBlt(PSDRV_PDEVICE *physDev, INT x, INT y, INT width, INT hei
|
|||
{
|
||||
PSCOLOR pscol;
|
||||
|
||||
PSDRV_SetClip(physDev);
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_WriteRectangle(physDev, pt[0].x, pt[0].y, pt[1].x - pt[0].x, pt[1].y - pt[0].y );
|
||||
PSDRV_CreateColor( physDev, &pscol, (dwRop == BLACKNESS) ?
|
||||
RGB(0,0,0) : RGB(0xff,0xff,0xff) );
|
||||
PSDRV_WriteSetColor(physDev, &pscol);
|
||||
PSDRV_WriteFill(physDev);
|
||||
PSDRV_WriteGRestore(physDev);
|
||||
PSDRV_ResetClip(physDev);
|
||||
PSDRV_SetClip(dev);
|
||||
PSDRV_WriteGSave(dev);
|
||||
PSDRV_WriteRectangle(dev, pt[0].x, pt[0].y, pt[1].x - pt[0].x, pt[1].y - pt[0].y );
|
||||
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:
|
||||
|
|
|
@ -90,7 +90,7 @@ static BOOL get_bitmap_info( const void *ptr, LONG *width, LONG *height, WORD *b
|
|||
* Uses level 2 PostScript
|
||||
*/
|
||||
|
||||
static BOOL PSDRV_WriteImageHeader(PSDRV_PDEVICE *physDev, const BITMAPINFO *info, INT xDst,
|
||||
static BOOL PSDRV_WriteImageHeader(PHYSDEV dev, const BITMAPINFO *info, INT xDst,
|
||||
INT yDst, INT widthDst, INT heightDst,
|
||||
INT widthSrc, INT heightSrc)
|
||||
{
|
||||
|
@ -99,36 +99,36 @@ static BOOL PSDRV_WriteImageHeader(PSDRV_PDEVICE *physDev, const BITMAPINFO *inf
|
|||
|
||||
switch(info->bmiHeader.biBitCount) {
|
||||
case 8:
|
||||
PSDRV_WriteIndexColorSpaceBegin(physDev, 255);
|
||||
PSDRV_WriteIndexColorSpaceBegin(dev, 255);
|
||||
for(i = 0; i < 256; i++) {
|
||||
map[i] = info->bmiColors[i].rgbRed |
|
||||
info->bmiColors[i].rgbGreen << 8 |
|
||||
info->bmiColors[i].rgbBlue << 16;
|
||||
}
|
||||
PSDRV_WriteRGB(physDev, map, 256);
|
||||
PSDRV_WriteIndexColorSpaceEnd(physDev);
|
||||
PSDRV_WriteRGB(dev, map, 256);
|
||||
PSDRV_WriteIndexColorSpaceEnd(dev);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
PSDRV_WriteIndexColorSpaceBegin(physDev, 15);
|
||||
PSDRV_WriteIndexColorSpaceBegin(dev, 15);
|
||||
for(i = 0; i < 16; i++) {
|
||||
map[i] = info->bmiColors[i].rgbRed |
|
||||
info->bmiColors[i].rgbGreen << 8 |
|
||||
info->bmiColors[i].rgbBlue << 16;
|
||||
}
|
||||
PSDRV_WriteRGB(physDev, map, 16);
|
||||
PSDRV_WriteIndexColorSpaceEnd(physDev);
|
||||
PSDRV_WriteRGB(dev, map, 16);
|
||||
PSDRV_WriteIndexColorSpaceEnd(dev);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
PSDRV_WriteIndexColorSpaceBegin(physDev, 1);
|
||||
PSDRV_WriteIndexColorSpaceBegin(dev, 1);
|
||||
for(i = 0; i < 2; i++) {
|
||||
map[i] = info->bmiColors[i].rgbRed |
|
||||
info->bmiColors[i].rgbGreen << 8 |
|
||||
info->bmiColors[i].rgbBlue << 16;
|
||||
}
|
||||
PSDRV_WriteRGB(physDev, map, 2);
|
||||
PSDRV_WriteIndexColorSpaceEnd(physDev);
|
||||
PSDRV_WriteRGB(dev, map, 2);
|
||||
PSDRV_WriteIndexColorSpaceEnd(dev);
|
||||
break;
|
||||
|
||||
case 15:
|
||||
|
@ -139,7 +139,7 @@ static BOOL PSDRV_WriteImageHeader(PSDRV_PDEVICE *physDev, const BITMAPINFO *inf
|
|||
PSCOLOR pscol;
|
||||
pscol.type = PSCOLOR_RGB;
|
||||
pscol.value.rgb.r = pscol.value.rgb.g = pscol.value.rgb.b = 0.0;
|
||||
PSDRV_WriteSetColor(physDev, &pscol);
|
||||
PSDRV_WriteSetColor(dev, &pscol);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -148,7 +148,7 @@ static BOOL PSDRV_WriteImageHeader(PSDRV_PDEVICE *physDev, const BITMAPINFO *inf
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
PSDRV_WriteImage(physDev, info->bmiHeader.biBitCount, xDst, yDst,
|
||||
PSDRV_WriteImage(dev, info->bmiHeader.biBitCount, xDst, yDst,
|
||||
widthDst, heightDst, widthSrc, heightSrc, FALSE);
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ static BOOL PSDRV_WriteImageHeader(PSDRV_PDEVICE *physDev, const BITMAPINFO *inf
|
|||
* Uses level 2 PostScript
|
||||
*/
|
||||
|
||||
static BOOL PSDRV_WriteImageMaskHeader(PSDRV_PDEVICE *physDev, const BITMAPINFO *info, INT xDst,
|
||||
static BOOL PSDRV_WriteImageMaskHeader(PHYSDEV dev, const BITMAPINFO *info, INT xDst,
|
||||
INT yDst, INT widthDst, INT heightDst,
|
||||
INT widthSrc, INT heightSrc)
|
||||
{
|
||||
|
@ -186,18 +186,18 @@ static BOOL PSDRV_WriteImageMaskHeader(PSDRV_PDEVICE *physDev, const BITMAPINFO
|
|||
the foregnd color corresponds to a bit equal to
|
||||
0 in the bitmap.
|
||||
*/
|
||||
PSDRV_CreateColor(physDev, &foregnd, map[0]);
|
||||
PSDRV_CreateColor(physDev, &bkgnd, map[1]);
|
||||
PSDRV_CreateColor(dev, &foregnd, map[0]);
|
||||
PSDRV_CreateColor(dev, &bkgnd, map[1]);
|
||||
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_WriteNewPath(physDev);
|
||||
PSDRV_WriteRectangle(physDev, xDst, yDst, widthDst, heightDst);
|
||||
PSDRV_WriteSetColor(physDev, &bkgnd);
|
||||
PSDRV_WriteFill(physDev);
|
||||
PSDRV_WriteGRestore(physDev);
|
||||
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(physDev, &foregnd);
|
||||
PSDRV_WriteImage(physDev, 1, xDst, yDst, widthDst, heightDst,
|
||||
PSDRV_WriteSetColor(dev, &foregnd);
|
||||
PSDRV_WriteImage(dev, 1, xDst, yDst, widthDst, heightDst,
|
||||
widthSrc, heightSrc, TRUE);
|
||||
|
||||
return TRUE;
|
||||
|
@ -222,7 +222,7 @@ static inline DWORD max_ascii85_size(DWORD size)
|
|||
* bit depths.
|
||||
* Compression not implemented.
|
||||
*/
|
||||
INT CDECL PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT widthDst,
|
||||
INT CDECL PSDRV_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst,
|
||||
INT heightDst, INT xSrc, INT ySrc,
|
||||
INT widthSrc, INT heightSrc, const void *bits,
|
||||
const BITMAPINFO *info, UINT wUsage, DWORD dwRop )
|
||||
|
@ -236,7 +236,7 @@ INT CDECL PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT w
|
|||
BYTE *dst_ptr, *bitmap, *rle, *ascii85;
|
||||
DWORD rle_len, ascii85_len, bitmap_size;
|
||||
|
||||
TRACE("%p (%d,%d %dx%d) -> (%d,%d %dx%d)\n", physDev->hdc,
|
||||
TRACE("%p (%d,%d %dx%d) -> (%d,%d %dx%d)\n", dev->hdc,
|
||||
xSrc, ySrc, widthSrc, heightSrc, xDst, yDst, widthDst, heightDst);
|
||||
|
||||
if (!get_bitmap_info( info, &fullSrcWidth, &fullSrcHeight, &bpp, &compression )) return FALSE;
|
||||
|
@ -257,7 +257,7 @@ INT CDECL PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT w
|
|||
pt[0].y = yDst;
|
||||
pt[1].x = xDst + widthDst;
|
||||
pt[1].y = yDst + heightDst;
|
||||
LPtoDP( physDev->hdc, pt, 2 );
|
||||
LPtoDP( dev->hdc, pt, 2 );
|
||||
xDst = pt[0].x;
|
||||
yDst = pt[0].y;
|
||||
widthDst = pt[1].x - pt[0].x;
|
||||
|
@ -266,11 +266,11 @@ INT CDECL PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT w
|
|||
switch(bpp) {
|
||||
|
||||
case 1:
|
||||
PSDRV_SetClip(physDev);
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_SetClip(dev);
|
||||
PSDRV_WriteGSave(dev);
|
||||
|
||||
/* Use imagemask rather than image */
|
||||
PSDRV_WriteImageMaskHeader(physDev, info, xDst, yDst, widthDst, heightDst,
|
||||
PSDRV_WriteImageMaskHeader(dev, info, xDst, yDst, widthDst, heightDst,
|
||||
widthSrc, heightSrc);
|
||||
src_ptr = bits;
|
||||
if(stride < 0) src_ptr += (fullSrcHeight + 1) * stride;
|
||||
|
@ -284,9 +284,9 @@ INT CDECL PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT w
|
|||
break;
|
||||
|
||||
case 4:
|
||||
PSDRV_SetClip(physDev);
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_WriteImageHeader(physDev, info, xDst, yDst, widthDst, heightDst,
|
||||
PSDRV_SetClip(dev);
|
||||
PSDRV_WriteGSave(dev);
|
||||
PSDRV_WriteImageHeader(dev, info, xDst, yDst, widthDst, heightDst,
|
||||
widthSrc, heightSrc);
|
||||
src_ptr = bits;
|
||||
if(stride < 0) src_ptr += (fullSrcHeight + 1) * stride;
|
||||
|
@ -300,9 +300,9 @@ INT CDECL PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT w
|
|||
break;
|
||||
|
||||
case 8:
|
||||
PSDRV_SetClip(physDev);
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_WriteImageHeader(physDev, info, xDst, yDst, widthDst, heightDst,
|
||||
PSDRV_SetClip(dev);
|
||||
PSDRV_WriteGSave(dev);
|
||||
PSDRV_WriteImageHeader(dev, info, xDst, yDst, widthDst, heightDst,
|
||||
widthSrc, heightSrc);
|
||||
src_ptr = bits;
|
||||
if(stride < 0) src_ptr += (fullSrcHeight + 1) * stride;
|
||||
|
@ -315,9 +315,9 @@ INT CDECL PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT w
|
|||
|
||||
case 15:
|
||||
case 16:
|
||||
PSDRV_SetClip(physDev);
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_WriteImageHeader(physDev, info, xDst, yDst, widthDst, heightDst,
|
||||
PSDRV_SetClip(dev);
|
||||
PSDRV_WriteGSave(dev);
|
||||
PSDRV_WriteImageHeader(dev, info, xDst, yDst, widthDst, heightDst,
|
||||
widthSrc, heightSrc);
|
||||
|
||||
|
||||
|
@ -349,9 +349,9 @@ INT CDECL PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT w
|
|||
break;
|
||||
|
||||
case 24:
|
||||
PSDRV_SetClip(physDev);
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_WriteImageHeader(physDev, info, xDst, yDst, widthDst, heightDst,
|
||||
PSDRV_SetClip(dev);
|
||||
PSDRV_WriteGSave(dev);
|
||||
PSDRV_WriteImageHeader(dev, info, xDst, yDst, widthDst, heightDst,
|
||||
widthSrc, heightSrc);
|
||||
|
||||
src_ptr = bits;
|
||||
|
@ -372,9 +372,9 @@ INT CDECL PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT w
|
|||
break;
|
||||
|
||||
case 32:
|
||||
PSDRV_SetClip(physDev);
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_WriteImageHeader(physDev, info, xDst, yDst, widthDst, heightDst,
|
||||
PSDRV_SetClip(dev);
|
||||
PSDRV_WriteGSave(dev);
|
||||
PSDRV_WriteImageHeader(dev, info, xDst, yDst, widthDst, heightDst,
|
||||
widthSrc, heightSrc);
|
||||
|
||||
src_ptr = bits;
|
||||
|
@ -406,10 +406,10 @@ INT CDECL PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT w
|
|||
ascii85 = HeapAlloc(GetProcessHeap(), 0, max_ascii85_size(rle_len));
|
||||
ascii85_len = ASCII85_encode(rle, rle_len, ascii85);
|
||||
HeapFree(GetProcessHeap(), 0, rle);
|
||||
PSDRV_WriteData(physDev, ascii85, ascii85_len);
|
||||
PSDRV_WriteData(dev, ascii85, ascii85_len);
|
||||
HeapFree(GetProcessHeap(), 0, ascii85);
|
||||
PSDRV_WriteSpool(physDev, "~>\n", 3);
|
||||
PSDRV_WriteGRestore(physDev);
|
||||
PSDRV_ResetClip(physDev);
|
||||
PSDRV_WriteSpool(dev, "~>\n", 3);
|
||||
PSDRV_WriteGRestore(dev);
|
||||
PSDRV_ResetClip(dev);
|
||||
return abs(heightSrc);
|
||||
}
|
||||
|
|
|
@ -27,8 +27,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
|
|||
/***********************************************************************
|
||||
* SelectBrush (WINEPS.@)
|
||||
*/
|
||||
HBRUSH CDECL PSDRV_SelectBrush( PSDRV_PDEVICE *physDev, HBRUSH hbrush )
|
||||
HBRUSH CDECL PSDRV_SelectBrush( PHYSDEV dev, HBRUSH hbrush )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
LOGBRUSH logbrush;
|
||||
|
||||
if (!GetObjectA( hbrush, sizeof(logbrush), &logbrush )) return 0;
|
||||
|
@ -41,14 +42,14 @@ HBRUSH CDECL PSDRV_SelectBrush( PSDRV_PDEVICE *physDev, HBRUSH hbrush )
|
|||
switch(logbrush.lbStyle) {
|
||||
|
||||
case BS_SOLID:
|
||||
PSDRV_CreateColor(physDev, &physDev->brush.color, logbrush.lbColor);
|
||||
PSDRV_CreateColor(dev, &physDev->brush.color, logbrush.lbColor);
|
||||
break;
|
||||
|
||||
case BS_NULL:
|
||||
break;
|
||||
|
||||
case BS_HATCHED:
|
||||
PSDRV_CreateColor(physDev, &physDev->brush.color, logbrush.lbColor);
|
||||
PSDRV_CreateColor(dev, &physDev->brush.color, logbrush.lbColor);
|
||||
break;
|
||||
|
||||
case BS_PATTERN:
|
||||
|
@ -68,11 +69,13 @@ HBRUSH CDECL PSDRV_SelectBrush( PSDRV_PDEVICE *physDev, HBRUSH hbrush )
|
|||
/***********************************************************************
|
||||
* SetDCBrushColor (WINEPS.@)
|
||||
*/
|
||||
COLORREF CDECL PSDRV_SetDCBrushColor( PSDRV_PDEVICE *physDev, COLORREF color )
|
||||
COLORREF CDECL PSDRV_SetDCBrushColor( PHYSDEV dev, COLORREF color )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
|
||||
if (GetCurrentObject( physDev->hdc, OBJ_BRUSH ) == GetStockObject( DC_BRUSH ))
|
||||
{
|
||||
PSDRV_CreateColor( physDev, &physDev->brush.color, color );
|
||||
PSDRV_CreateColor( dev, &physDev->brush.color, color );
|
||||
physDev->brush.set = FALSE;
|
||||
}
|
||||
return color;
|
||||
|
@ -84,8 +87,9 @@ COLORREF CDECL PSDRV_SetDCBrushColor( PSDRV_PDEVICE *physDev, COLORREF color )
|
|||
* PSDRV_SetBrush
|
||||
*
|
||||
*/
|
||||
static BOOL PSDRV_SetBrush(PSDRV_PDEVICE *physDev)
|
||||
static BOOL PSDRV_SetBrush( PHYSDEV dev )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
LOGBRUSH logbrush;
|
||||
BOOL ret = TRUE;
|
||||
|
||||
|
@ -98,7 +102,7 @@ static BOOL PSDRV_SetBrush(PSDRV_PDEVICE *physDev)
|
|||
switch (logbrush.lbStyle) {
|
||||
case BS_SOLID:
|
||||
case BS_HATCHED:
|
||||
PSDRV_WriteSetColor(physDev, &physDev->brush.color);
|
||||
PSDRV_WriteSetColor(dev, &physDev->brush.color);
|
||||
break;
|
||||
|
||||
case BS_NULL:
|
||||
|
@ -119,12 +123,12 @@ static BOOL PSDRV_SetBrush(PSDRV_PDEVICE *physDev)
|
|||
* PSDRV_Fill
|
||||
*
|
||||
*/
|
||||
static BOOL PSDRV_Fill(PSDRV_PDEVICE *physDev, BOOL EO)
|
||||
static BOOL PSDRV_Fill(PHYSDEV dev, BOOL EO)
|
||||
{
|
||||
if(!EO)
|
||||
return PSDRV_WriteFill(physDev);
|
||||
return PSDRV_WriteFill(dev);
|
||||
else
|
||||
return PSDRV_WriteEOFill(physDev);
|
||||
return PSDRV_WriteEOFill(dev);
|
||||
}
|
||||
|
||||
|
||||
|
@ -133,12 +137,12 @@ static BOOL PSDRV_Fill(PSDRV_PDEVICE *physDev, BOOL EO)
|
|||
* PSDRV_Clip
|
||||
*
|
||||
*/
|
||||
static BOOL PSDRV_Clip(PSDRV_PDEVICE *physDev, BOOL EO)
|
||||
static BOOL PSDRV_Clip(PHYSDEV dev, BOOL EO)
|
||||
{
|
||||
if(!EO)
|
||||
return PSDRV_WriteClip(physDev);
|
||||
return PSDRV_WriteClip(dev);
|
||||
else
|
||||
return PSDRV_WriteEOClip(physDev);
|
||||
return PSDRV_WriteEOClip(dev);
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
|
@ -146,8 +150,9 @@ static BOOL PSDRV_Clip(PSDRV_PDEVICE *physDev, BOOL EO)
|
|||
* PSDRV_Brush
|
||||
*
|
||||
*/
|
||||
BOOL PSDRV_Brush(PSDRV_PDEVICE *physDev, BOOL EO)
|
||||
BOOL PSDRV_Brush(PHYSDEV dev, BOOL EO)
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
LOGBRUSH logbrush;
|
||||
BOOL ret = TRUE;
|
||||
|
||||
|
@ -162,56 +167,56 @@ BOOL PSDRV_Brush(PSDRV_PDEVICE *physDev, BOOL EO)
|
|||
|
||||
switch (logbrush.lbStyle) {
|
||||
case BS_SOLID:
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_SetBrush(physDev);
|
||||
PSDRV_Fill(physDev, EO);
|
||||
PSDRV_WriteGRestore(physDev);
|
||||
PSDRV_WriteGSave(dev);
|
||||
PSDRV_SetBrush(dev);
|
||||
PSDRV_Fill(dev, EO);
|
||||
PSDRV_WriteGRestore(dev);
|
||||
break;
|
||||
|
||||
case BS_HATCHED:
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_SetBrush(physDev);
|
||||
PSDRV_WriteGSave(dev);
|
||||
PSDRV_SetBrush(dev);
|
||||
|
||||
switch(logbrush.lbHatch) {
|
||||
case HS_VERTICAL:
|
||||
case HS_CROSS:
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_Clip(physDev, EO);
|
||||
PSDRV_WriteHatch(physDev);
|
||||
PSDRV_WriteStroke(physDev);
|
||||
PSDRV_WriteGRestore(physDev);
|
||||
PSDRV_WriteGSave(dev);
|
||||
PSDRV_Clip(dev, EO);
|
||||
PSDRV_WriteHatch(dev);
|
||||
PSDRV_WriteStroke(dev);
|
||||
PSDRV_WriteGRestore(dev);
|
||||
if(logbrush.lbHatch == HS_VERTICAL)
|
||||
break;
|
||||
/* else fallthrough for HS_CROSS */
|
||||
|
||||
case HS_HORIZONTAL:
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_Clip(physDev, EO);
|
||||
PSDRV_WriteRotate(physDev, 90.0);
|
||||
PSDRV_WriteHatch(physDev);
|
||||
PSDRV_WriteStroke(physDev);
|
||||
PSDRV_WriteGRestore(physDev);
|
||||
PSDRV_WriteGSave(dev);
|
||||
PSDRV_Clip(dev, EO);
|
||||
PSDRV_WriteRotate(dev, 90.0);
|
||||
PSDRV_WriteHatch(dev);
|
||||
PSDRV_WriteStroke(dev);
|
||||
PSDRV_WriteGRestore(dev);
|
||||
break;
|
||||
|
||||
case HS_FDIAGONAL:
|
||||
case HS_DIAGCROSS:
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_Clip(physDev, EO);
|
||||
PSDRV_WriteRotate(physDev, -45.0);
|
||||
PSDRV_WriteHatch(physDev);
|
||||
PSDRV_WriteStroke(physDev);
|
||||
PSDRV_WriteGRestore(physDev);
|
||||
PSDRV_WriteGSave(dev);
|
||||
PSDRV_Clip(dev, EO);
|
||||
PSDRV_WriteRotate(dev, -45.0);
|
||||
PSDRV_WriteHatch(dev);
|
||||
PSDRV_WriteStroke(dev);
|
||||
PSDRV_WriteGRestore(dev);
|
||||
if(logbrush.lbHatch == HS_FDIAGONAL)
|
||||
break;
|
||||
/* else fallthrough for HS_DIAGCROSS */
|
||||
|
||||
case HS_BDIAGONAL:
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_Clip(physDev, EO);
|
||||
PSDRV_WriteRotate(physDev, 45.0);
|
||||
PSDRV_WriteHatch(physDev);
|
||||
PSDRV_WriteStroke(physDev);
|
||||
PSDRV_WriteGRestore(physDev);
|
||||
PSDRV_WriteGSave(dev);
|
||||
PSDRV_Clip(dev, EO);
|
||||
PSDRV_WriteRotate(dev, 45.0);
|
||||
PSDRV_WriteHatch(dev);
|
||||
PSDRV_WriteStroke(dev);
|
||||
PSDRV_WriteGRestore(dev);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -219,7 +224,7 @@ BOOL PSDRV_Brush(PSDRV_PDEVICE *physDev, BOOL EO)
|
|||
ret = FALSE;
|
||||
break;
|
||||
}
|
||||
PSDRV_WriteGRestore(physDev);
|
||||
PSDRV_WriteGRestore(dev);
|
||||
break;
|
||||
|
||||
case BS_NULL:
|
||||
|
@ -236,10 +241,10 @@ BOOL PSDRV_Brush(PSDRV_PDEVICE *physDev, BOOL EO)
|
|||
GetBitmapBits( (HBITMAP)logbrush.lbHatch, bm.bmWidthBytes * bm.bmHeight, bits);
|
||||
|
||||
if(physDev->pi->ppd->LanguageLevel > 1) {
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_WritePatternDict(physDev, &bm, bits);
|
||||
PSDRV_Fill(physDev, EO);
|
||||
PSDRV_WriteGRestore(physDev);
|
||||
PSDRV_WriteGSave(dev);
|
||||
PSDRV_WritePatternDict(dev, &bm, bits);
|
||||
PSDRV_Fill(dev, EO);
|
||||
PSDRV_WriteGRestore(dev);
|
||||
} else {
|
||||
FIXME("Trying to set a pattern brush on a level 1 printer\n");
|
||||
ret = FALSE;
|
||||
|
@ -255,10 +260,10 @@ BOOL PSDRV_Brush(PSDRV_PDEVICE *physDev, BOOL EO)
|
|||
TRACE("size %dx%dx%d\n", bmi->bmiHeader.biWidth,
|
||||
bmi->bmiHeader.biHeight, bmi->bmiHeader.biBitCount);
|
||||
if(physDev->pi->ppd->LanguageLevel > 1) {
|
||||
PSDRV_WriteGSave(physDev);
|
||||
ret = PSDRV_WriteDIBPatternDict(physDev, bmi, usage);
|
||||
PSDRV_Fill(physDev, EO);
|
||||
PSDRV_WriteGRestore(physDev);
|
||||
PSDRV_WriteGSave(dev);
|
||||
ret = PSDRV_WriteDIBPatternDict(dev, bmi, usage);
|
||||
PSDRV_Fill(dev, EO);
|
||||
PSDRV_WriteGRestore(dev);
|
||||
} else {
|
||||
FIXME("Trying to set a pattern brush on a level 1 printer\n");
|
||||
ret = FALSE;
|
||||
|
|
|
@ -155,9 +155,10 @@ static VOID ScaleFont(const AFM *afm, LONG lfHeight, PSFONT *font,
|
|||
* Set up physDev->font for a builtin font
|
||||
*
|
||||
*/
|
||||
BOOL PSDRV_SelectBuiltinFont(PSDRV_PDEVICE *physDev, HFONT hfont,
|
||||
BOOL PSDRV_SelectBuiltinFont(PHYSDEV dev, HFONT hfont,
|
||||
LOGFONTW *plf, LPSTR FaceName)
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
AFMLISTENTRY *afmle;
|
||||
FONTFAMILY *family;
|
||||
BOOL bd = FALSE, it = FALSE;
|
||||
|
@ -232,15 +233,17 @@ BOOL PSDRV_SelectBuiltinFont(PSDRV_PDEVICE *physDev, HFONT hfont,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteSetBuiltinFont(PSDRV_PDEVICE *physDev)
|
||||
BOOL PSDRV_WriteSetBuiltinFont(PHYSDEV dev)
|
||||
{
|
||||
return PSDRV_WriteSetFont(physDev,
|
||||
physDev->font.fontinfo.Builtin.afm->FontName,
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
|
||||
return PSDRV_WriteSetFont(dev, physDev->font.fontinfo.Builtin.afm->FontName,
|
||||
physDev->font.size, physDev->font.escapement);
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteBuiltinGlyphShow(PSDRV_PDEVICE *physDev, LPCWSTR str, INT count)
|
||||
BOOL PSDRV_WriteBuiltinGlyphShow(PHYSDEV dev, LPCWSTR str, INT count)
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
int i;
|
||||
LPCSTR name;
|
||||
|
||||
|
@ -248,7 +251,7 @@ BOOL PSDRV_WriteBuiltinGlyphShow(PSDRV_PDEVICE *physDev, LPCWSTR str, INT count)
|
|||
{
|
||||
name = PSDRV_UVMetrics(str[i], physDev->font.fontinfo.Builtin.afm)->N->sz;
|
||||
|
||||
PSDRV_WriteGlyphShow(physDev, name);
|
||||
PSDRV_WriteGlyphShow(dev, name);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@ -257,8 +260,10 @@ BOOL PSDRV_WriteBuiltinGlyphShow(PSDRV_PDEVICE *physDev, LPCWSTR str, INT count)
|
|||
/***********************************************************************
|
||||
* PSDRV_GetTextMetrics
|
||||
*/
|
||||
BOOL CDECL PSDRV_GetTextMetrics(PSDRV_PDEVICE *physDev, TEXTMETRICW *metrics)
|
||||
BOOL CDECL PSDRV_GetTextMetrics(PHYSDEV dev, TEXTMETRICW *metrics)
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
|
||||
assert(physDev->font.fontloc == Builtin);
|
||||
|
||||
memcpy(metrics, &(physDev->font.fontinfo.Builtin.tm),
|
||||
|
@ -308,9 +313,10 @@ const AFMMETRICS *PSDRV_UVMetrics(LONG UV, const AFM *afm)
|
|||
/***********************************************************************
|
||||
* PSDRV_GetTextExtentExPoint
|
||||
*/
|
||||
BOOL CDECL PSDRV_GetTextExtentExPoint(PSDRV_PDEVICE *physDev, LPCWSTR str, INT count,
|
||||
BOOL CDECL PSDRV_GetTextExtentExPoint(PHYSDEV dev, LPCWSTR str, INT count,
|
||||
INT maxExt, LPINT lpnFit, LPINT alpDx, LPSIZE size)
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
int nfit = 0;
|
||||
int i;
|
||||
float width = 0.0;
|
||||
|
@ -346,8 +352,9 @@ BOOL CDECL PSDRV_GetTextExtentExPoint(PSDRV_PDEVICE *physDev, LPCWSTR str, INT c
|
|||
/***********************************************************************
|
||||
* PSDRV_GetCharWidth
|
||||
*/
|
||||
BOOL CDECL PSDRV_GetCharWidth(PSDRV_PDEVICE *physDev, UINT firstChar, UINT lastChar, LPINT buffer)
|
||||
BOOL CDECL PSDRV_GetCharWidth(PHYSDEV dev, UINT firstChar, UINT lastChar, LPINT buffer)
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
UINT i;
|
||||
|
||||
assert(physDev->font.fontloc == Builtin);
|
||||
|
@ -406,9 +413,9 @@ static UINT PSDRV_GetFontMetric(HDC hdc, const AFM *afm,
|
|||
/***********************************************************************
|
||||
* PSDRV_EnumDeviceFonts
|
||||
*/
|
||||
BOOL CDECL PSDRV_EnumDeviceFonts( PSDRV_PDEVICE *physDev, LPLOGFONTW plf,
|
||||
FONTENUMPROCW proc, LPARAM lp )
|
||||
BOOL CDECL PSDRV_EnumDeviceFonts( PHYSDEV dev, LPLOGFONTW plf, FONTENUMPROCW proc, LPARAM lp )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
ENUMLOGFONTEXW lf;
|
||||
NEWTEXTMETRICEXW tm;
|
||||
BOOL b, bRet = 0;
|
||||
|
|
|
@ -35,8 +35,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
|
|||
* small clip area in the printer dc that it can still write raw
|
||||
* PostScript to the driver and expect this code not to be clipped.
|
||||
*/
|
||||
void PSDRV_SetClip( PSDRV_PDEVICE *physDev )
|
||||
void PSDRV_SetClip( PHYSDEV dev )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
CHAR szArrayName[] = "clippath";
|
||||
DWORD size;
|
||||
RGNDATA *rgndata = NULL;
|
||||
|
@ -67,20 +68,20 @@ void PSDRV_SetClip( PSDRV_PDEVICE *physDev )
|
|||
|
||||
GetRegionData(hrgn, size, rgndata);
|
||||
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_WriteGSave(dev);
|
||||
|
||||
/* check for NULL region */
|
||||
if (rgndata->rdh.nCount == 0)
|
||||
{
|
||||
/* set an empty clip path. */
|
||||
PSDRV_WriteRectClip(physDev, 0, 0, 0, 0);
|
||||
PSDRV_WriteRectClip(dev, 0, 0, 0, 0);
|
||||
}
|
||||
/* optimize when it is a simple region */
|
||||
else if (rgndata->rdh.nCount == 1)
|
||||
{
|
||||
RECT *pRect = (RECT *)rgndata->Buffer;
|
||||
|
||||
PSDRV_WriteRectClip(physDev, pRect->left, pRect->top,
|
||||
PSDRV_WriteRectClip(dev, pRect->left, pRect->top,
|
||||
pRect->right - pRect->left,
|
||||
pRect->bottom - pRect->top);
|
||||
}
|
||||
|
@ -89,20 +90,20 @@ void PSDRV_SetClip( PSDRV_PDEVICE *physDev )
|
|||
UINT i;
|
||||
RECT *pRect = (RECT *)rgndata->Buffer;
|
||||
|
||||
PSDRV_WriteArrayDef(physDev, szArrayName, rgndata->rdh.nCount * 4);
|
||||
PSDRV_WriteArrayDef(dev, szArrayName, rgndata->rdh.nCount * 4);
|
||||
|
||||
for (i = 0; i < rgndata->rdh.nCount; i++, pRect++)
|
||||
{
|
||||
PSDRV_WriteArrayPut(physDev, szArrayName, i * 4,
|
||||
PSDRV_WriteArrayPut(dev, szArrayName, i * 4,
|
||||
pRect->left);
|
||||
PSDRV_WriteArrayPut(physDev, szArrayName, i * 4 + 1,
|
||||
PSDRV_WriteArrayPut(dev, szArrayName, i * 4 + 1,
|
||||
pRect->top);
|
||||
PSDRV_WriteArrayPut(physDev, szArrayName, i * 4 + 2,
|
||||
PSDRV_WriteArrayPut(dev, szArrayName, i * 4 + 2,
|
||||
pRect->right - pRect->left);
|
||||
PSDRV_WriteArrayPut(physDev, szArrayName, i * 4 + 3,
|
||||
PSDRV_WriteArrayPut(dev, szArrayName, i * 4 + 3,
|
||||
pRect->bottom - pRect->top);
|
||||
}
|
||||
PSDRV_WriteRectClip2(physDev, szArrayName);
|
||||
PSDRV_WriteRectClip2(dev, szArrayName);
|
||||
}
|
||||
}
|
||||
end:
|
||||
|
@ -114,13 +115,14 @@ end:
|
|||
/***********************************************************************
|
||||
* PSDRV_ResetClip
|
||||
*/
|
||||
void PSDRV_ResetClip( PSDRV_PDEVICE *physDev )
|
||||
void PSDRV_ResetClip( PHYSDEV dev )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
HRGN hrgn = CreateRectRgn(0,0,0,0);
|
||||
BOOL empty;
|
||||
|
||||
empty = !GetClipRgn(physDev->hdc, hrgn);
|
||||
if(!empty && !physDev->pathdepth)
|
||||
PSDRV_WriteGRestore(physDev);
|
||||
PSDRV_WriteGRestore(dev);
|
||||
DeleteObject(hrgn);
|
||||
}
|
||||
|
|
|
@ -60,9 +60,9 @@ BOOL PSDRV_CopyColor(PSCOLOR *col1, PSCOLOR *col2)
|
|||
* Result is grey scale if ColorDevice field of ppd is CD_False else an
|
||||
* rgb colour is produced.
|
||||
*/
|
||||
void PSDRV_CreateColor( PSDRV_PDEVICE *physDev, PSCOLOR *pscolor,
|
||||
COLORREF wincolor )
|
||||
void PSDRV_CreateColor( PHYSDEV dev, PSCOLOR *pscolor, COLORREF wincolor )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
int ctype = wincolor >> 24;
|
||||
float r, g, b;
|
||||
|
||||
|
@ -90,9 +90,10 @@ void PSDRV_CreateColor( PSDRV_PDEVICE *physDev, PSCOLOR *pscolor,
|
|||
/***********************************************************************
|
||||
* PSDRV_SetBkColor
|
||||
*/
|
||||
COLORREF CDECL PSDRV_SetBkColor( PSDRV_PDEVICE *physDev, COLORREF color )
|
||||
COLORREF CDECL PSDRV_SetBkColor( PHYSDEV dev, COLORREF color )
|
||||
{
|
||||
PSDRV_CreateColor(physDev, &physDev->bkColor, color);
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
PSDRV_CreateColor(dev, &physDev->bkColor, color);
|
||||
return color;
|
||||
}
|
||||
|
||||
|
@ -100,9 +101,10 @@ COLORREF CDECL PSDRV_SetBkColor( PSDRV_PDEVICE *physDev, COLORREF color )
|
|||
/***********************************************************************
|
||||
* PSDRV_SetTextColor
|
||||
*/
|
||||
COLORREF CDECL PSDRV_SetTextColor( PSDRV_PDEVICE *physDev, COLORREF color )
|
||||
COLORREF CDECL PSDRV_SetTextColor( PHYSDEV dev, COLORREF color )
|
||||
{
|
||||
PSDRV_CreateColor(physDev, &physDev->font.color, color);
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
PSDRV_CreateColor(dev, &physDev->font.color, color);
|
||||
physDev->font.set = FALSE;
|
||||
return color;
|
||||
}
|
||||
|
|
|
@ -49,14 +49,13 @@ BOOL WINAPI GetTransform( HDC hdc, DWORD which, XFORM *xform );
|
|||
/****************************************************************************
|
||||
* get_download_name
|
||||
*/
|
||||
static void get_download_name(PSDRV_PDEVICE *physDev, LPOUTLINETEXTMETRICA
|
||||
potm, char **str)
|
||||
static void get_download_name(PHYSDEV dev, LPOUTLINETEXTMETRICA potm, char **str)
|
||||
{
|
||||
int len;
|
||||
char *p;
|
||||
DWORD size;
|
||||
|
||||
size = GetFontData(physDev->hdc, MS_MAKE_TAG('n','a','m','e'), 0, NULL, 0);
|
||||
size = GetFontData(dev->hdc, MS_MAKE_TAG('n','a','m','e'), 0, NULL, 0);
|
||||
if(size != 0 && size != GDI_ERROR)
|
||||
{
|
||||
BYTE *name = HeapAlloc(GetProcessHeap(), 0, size);
|
||||
|
@ -74,7 +73,7 @@ static void get_download_name(PSDRV_PDEVICE *physDev, LPOUTLINETEXTMETRICA
|
|||
USHORT offset;
|
||||
} *name_record;
|
||||
|
||||
GetFontData(physDev->hdc, MS_MAKE_TAG('n','a','m','e'), 0, name, size);
|
||||
GetFontData(dev->hdc, MS_MAKE_TAG('n','a','m','e'), 0, name, size);
|
||||
count = GET_BE_WORD(name + 2);
|
||||
strings = name + GET_BE_WORD(name + 4);
|
||||
name_record = (typeof(name_record))(name + 6);
|
||||
|
@ -197,8 +196,10 @@ static BOOL get_bbox(HDC hdc, RECT *rc, UINT *emsize)
|
|||
* Set up physDev->font for a downloadable font
|
||||
*
|
||||
*/
|
||||
BOOL PSDRV_SelectDownloadFont(PSDRV_PDEVICE *physDev)
|
||||
BOOL PSDRV_SelectDownloadFont(PHYSDEV dev)
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
|
||||
physDev->font.fontloc = Download;
|
||||
physDev->font.fontinfo.Download = NULL;
|
||||
|
||||
|
@ -246,8 +247,9 @@ static inline float ps_round(float f)
|
|||
* Write setfont for download font.
|
||||
*
|
||||
*/
|
||||
BOOL PSDRV_WriteSetDownloadFont(PSDRV_PDEVICE *physDev)
|
||||
BOOL PSDRV_WriteSetDownloadFont(PHYSDEV dev)
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
char *ps_name;
|
||||
LPOUTLINETEXTMETRICA potm;
|
||||
DWORD len = GetOutlineTextMetricsA(physDev->hdc, 0, NULL);
|
||||
|
@ -261,7 +263,7 @@ BOOL PSDRV_WriteSetDownloadFont(PSDRV_PDEVICE *physDev)
|
|||
potm = HeapAlloc(GetProcessHeap(), 0, len);
|
||||
GetOutlineTextMetricsA(physDev->hdc, len, potm);
|
||||
|
||||
get_download_name(physDev, potm, &ps_name);
|
||||
get_download_name(dev, potm, &ps_name);
|
||||
physDev->font.fontinfo.Download = is_font_downloaded(physDev, ps_name);
|
||||
|
||||
if (!GetObjectW( GetCurrentObject(physDev->hdc, OBJ_FONT), sizeof(lf), &lf ))
|
||||
|
@ -297,7 +299,7 @@ BOOL PSDRV_WriteSetDownloadFont(PSDRV_PDEVICE *physDev)
|
|||
return FALSE;
|
||||
}
|
||||
if(!is_room_for_font(physDev))
|
||||
PSDRV_EmptyDownloadList(physDev, TRUE);
|
||||
PSDRV_EmptyDownloadList(dev, TRUE);
|
||||
|
||||
pdl = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*pdl));
|
||||
pdl->ps_name = HeapAlloc(GetProcessHeap(), 0, strlen(ps_name)+1);
|
||||
|
@ -305,11 +307,11 @@ BOOL PSDRV_WriteSetDownloadFont(PSDRV_PDEVICE *physDev)
|
|||
pdl->next = NULL;
|
||||
|
||||
if(physDev->pi->ppd->TTRasterizer == RO_Type42) {
|
||||
pdl->typeinfo.Type42 = T42_download_header(physDev, ps_name, &bbox, emsize);
|
||||
pdl->typeinfo.Type42 = T42_download_header(dev, ps_name, &bbox, emsize);
|
||||
pdl->type = Type42;
|
||||
}
|
||||
if(pdl->typeinfo.Type42 == NULL) {
|
||||
pdl->typeinfo.Type1 = T1_download_header(physDev, ps_name, &bbox, emsize);
|
||||
pdl->typeinfo.Type1 = T1_download_header(dev, ps_name, &bbox, emsize);
|
||||
pdl->type = Type1;
|
||||
}
|
||||
pdl->next = physDev->downloaded_fonts;
|
||||
|
@ -319,13 +321,12 @@ BOOL PSDRV_WriteSetDownloadFont(PSDRV_PDEVICE *physDev)
|
|||
if(pdl->type == Type42) {
|
||||
char g_name[MAX_G_NAME + 1];
|
||||
get_glyph_name(physDev->hdc, 0, g_name);
|
||||
T42_download_glyph(physDev, pdl, 0, g_name);
|
||||
T42_download_glyph(dev, pdl, 0, g_name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PSDRV_WriteSetFont(physDev, ps_name, physDev->font.size,
|
||||
physDev->font.escapement);
|
||||
PSDRV_WriteSetFont(dev, ps_name, physDev->font.size, physDev->font.escapement);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, ps_name);
|
||||
HeapFree(GetProcessHeap(), 0, potm);
|
||||
|
@ -345,9 +346,10 @@ void get_glyph_name(HDC hdc, WORD index, char *name)
|
|||
* Download and write out a number of glyphs
|
||||
*
|
||||
*/
|
||||
BOOL PSDRV_WriteDownloadGlyphShow(PSDRV_PDEVICE *physDev, WORD *glyphs,
|
||||
BOOL PSDRV_WriteDownloadGlyphShow(PHYSDEV dev, WORD *glyphs,
|
||||
UINT count)
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
UINT i;
|
||||
char g_name[MAX_G_NAME + 1];
|
||||
assert(physDev->font.fontloc == Download);
|
||||
|
@ -356,18 +358,16 @@ BOOL PSDRV_WriteDownloadGlyphShow(PSDRV_PDEVICE *physDev, WORD *glyphs,
|
|||
case Type42:
|
||||
for(i = 0; i < count; i++) {
|
||||
get_glyph_name(physDev->hdc, glyphs[i], g_name);
|
||||
T42_download_glyph(physDev, physDev->font.fontinfo.Download,
|
||||
glyphs[i], g_name);
|
||||
PSDRV_WriteGlyphShow(physDev, g_name);
|
||||
T42_download_glyph(dev, physDev->font.fontinfo.Download, glyphs[i], g_name);
|
||||
PSDRV_WriteGlyphShow(dev, g_name);
|
||||
}
|
||||
break;
|
||||
|
||||
case Type1:
|
||||
for(i = 0; i < count; i++) {
|
||||
get_glyph_name(physDev->hdc, glyphs[i], g_name);
|
||||
T1_download_glyph(physDev, physDev->font.fontinfo.Download,
|
||||
glyphs[i], g_name);
|
||||
PSDRV_WriteGlyphShow(physDev, g_name);
|
||||
T1_download_glyph(dev, physDev->font.fontinfo.Download, glyphs[i], g_name);
|
||||
PSDRV_WriteGlyphShow(dev, g_name);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -384,8 +384,9 @@ BOOL PSDRV_WriteDownloadGlyphShow(PSDRV_PDEVICE *physDev, WORD *glyphs,
|
|||
* Clear the list of downloaded fonts
|
||||
*
|
||||
*/
|
||||
BOOL PSDRV_EmptyDownloadList(PSDRV_PDEVICE *physDev, BOOL write_undef)
|
||||
BOOL PSDRV_EmptyDownloadList(PHYSDEV dev, BOOL write_undef)
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
DOWNLOAD *pdl, *old;
|
||||
static const char undef[] = "/%s findfont 40 scalefont setfont /%s undefinefont\n";
|
||||
char buf[sizeof(undef) + 200];
|
||||
|
@ -402,7 +403,7 @@ BOOL PSDRV_EmptyDownloadList(PSDRV_PDEVICE *physDev, BOOL write_undef)
|
|||
while(pdl) {
|
||||
if(write_undef) {
|
||||
sprintf(buf, undef, default_font, pdl->ps_name);
|
||||
PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
}
|
||||
|
||||
switch(pdl->type) {
|
||||
|
|
|
@ -47,9 +47,11 @@ static const char psbegindocument[] =
|
|||
"%%BeginDocument: Wine passthrough\n";
|
||||
|
||||
|
||||
DWORD write_spool( PSDRV_PDEVICE *physDev, const void *data, DWORD num )
|
||||
DWORD write_spool( PHYSDEV dev, const void *data, DWORD num )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
DWORD written;
|
||||
|
||||
if (!WritePrinter(physDev->job.hprinter, (LPBYTE) data, num, &written) || (written != num))
|
||||
return SP_OUTOFDISK;
|
||||
|
||||
|
@ -59,9 +61,11 @@ DWORD write_spool( PSDRV_PDEVICE *physDev, const void *data, DWORD num )
|
|||
/**********************************************************************
|
||||
* ExtEscape (WINEPS.@)
|
||||
*/
|
||||
INT CDECL PSDRV_ExtEscape( PSDRV_PDEVICE *physDev, INT nEscape, INT cbInput, LPCVOID in_data,
|
||||
INT CDECL PSDRV_ExtEscape( PHYSDEV dev, INT nEscape, INT cbInput, LPCVOID in_data,
|
||||
INT cbOutput, LPVOID out_data )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
|
||||
switch(nEscape)
|
||||
{
|
||||
case QUERYESCSUPPORT:
|
||||
|
@ -275,10 +279,10 @@ INT CDECL PSDRV_ExtEscape( PSDRV_PDEVICE *physDev, INT nEscape, INT cbInput, LPC
|
|||
* in_data[0] instead.
|
||||
*/
|
||||
if(!physDev->job.in_passthrough) {
|
||||
write_spool(physDev, psbegindocument, sizeof(psbegindocument)-1);
|
||||
write_spool(dev, psbegindocument, sizeof(psbegindocument)-1);
|
||||
physDev->job.in_passthrough = TRUE;
|
||||
}
|
||||
return write_spool(physDev,((char*)in_data)+2,*(const WORD*)in_data);
|
||||
return write_spool(dev,((char*)in_data)+2,*(const WORD*)in_data);
|
||||
}
|
||||
|
||||
case POSTSCRIPT_IGNORE:
|
||||
|
@ -317,7 +321,7 @@ INT CDECL PSDRV_ExtEscape( PSDRV_PDEVICE *physDev, INT nEscape, INT cbInput, LPC
|
|||
info->RenderMode, info->FillMode, info->BkMode);
|
||||
switch(info->RenderMode) {
|
||||
case RENDERMODE_NO_DISPLAY:
|
||||
PSDRV_WriteClosePath(physDev); /* not sure if this is necessary, but it can't hurt */
|
||||
PSDRV_WriteClosePath(dev); /* not sure if this is necessary, but it can't hurt */
|
||||
break;
|
||||
case RENDERMODE_OPEN:
|
||||
case RENDERMODE_CLOSED:
|
||||
|
@ -335,17 +339,17 @@ INT CDECL PSDRV_ExtEscape( PSDRV_PDEVICE *physDev, INT nEscape, INT cbInput, LPC
|
|||
switch(mode) {
|
||||
case CLIP_SAVE:
|
||||
TRACE("CLIP_TO_PATH: CLIP_SAVE\n");
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_WriteGSave(dev);
|
||||
return 1;
|
||||
case CLIP_RESTORE:
|
||||
TRACE("CLIP_TO_PATH: CLIP_RESTORE\n");
|
||||
PSDRV_WriteGRestore(physDev);
|
||||
PSDRV_WriteGRestore(dev);
|
||||
return 1;
|
||||
case CLIP_INCLUSIVE:
|
||||
TRACE("CLIP_TO_PATH: CLIP_INCLUSIVE\n");
|
||||
/* FIXME to clip or eoclip ? (see PATH_INFO.FillMode) */
|
||||
PSDRV_WriteClip(physDev);
|
||||
PSDRV_WriteNewPath(physDev);
|
||||
PSDRV_WriteClip(dev);
|
||||
PSDRV_WriteNewPath(dev);
|
||||
return 1;
|
||||
case CLIP_EXCLUSIVE:
|
||||
FIXME("CLIP_EXCLUSIVE: not implemented\n");
|
||||
|
@ -364,19 +368,21 @@ INT CDECL PSDRV_ExtEscape( PSDRV_PDEVICE *physDev, INT nEscape, INT cbInput, LPC
|
|||
/************************************************************************
|
||||
* PSDRV_StartPage
|
||||
*/
|
||||
INT CDECL PSDRV_StartPage( PSDRV_PDEVICE *physDev )
|
||||
INT CDECL PSDRV_StartPage( PHYSDEV dev )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
|
||||
if(!physDev->job.OutOfPage) {
|
||||
FIXME("Already started a page?\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(physDev->job.PageNo++ == 0) {
|
||||
if(!PSDRV_WriteHeader( physDev, physDev->job.DocName ))
|
||||
if(!PSDRV_WriteHeader( dev, physDev->job.DocName ))
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(!PSDRV_WriteNewPage( physDev ))
|
||||
if(!PSDRV_WriteNewPage( dev ))
|
||||
return 0;
|
||||
physDev->job.OutOfPage = FALSE;
|
||||
return 1;
|
||||
|
@ -386,15 +392,17 @@ INT CDECL PSDRV_StartPage( PSDRV_PDEVICE *physDev )
|
|||
/************************************************************************
|
||||
* PSDRV_EndPage
|
||||
*/
|
||||
INT CDECL PSDRV_EndPage( PSDRV_PDEVICE *physDev )
|
||||
INT CDECL PSDRV_EndPage( PHYSDEV dev )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
|
||||
if(physDev->job.OutOfPage) {
|
||||
FIXME("Already ended a page?\n");
|
||||
return 1;
|
||||
}
|
||||
if(!PSDRV_WriteEndPage( physDev ))
|
||||
if(!PSDRV_WriteEndPage( dev ))
|
||||
return 0;
|
||||
PSDRV_EmptyDownloadList(physDev, FALSE);
|
||||
PSDRV_EmptyDownloadList(dev, FALSE);
|
||||
physDev->job.OutOfPage = TRUE;
|
||||
return 1;
|
||||
}
|
||||
|
@ -403,8 +411,9 @@ INT CDECL PSDRV_EndPage( PSDRV_PDEVICE *physDev )
|
|||
/************************************************************************
|
||||
* PSDRV_StartDocA
|
||||
*/
|
||||
static INT PSDRV_StartDocA( PSDRV_PDEVICE *physDev, const DOCINFOA *doc )
|
||||
static INT PSDRV_StartDocA( PHYSDEV dev, const DOCINFOA *doc )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
DOC_INFO_1A di;
|
||||
|
||||
TRACE("(%p, %p) => %s, %s, %s\n", physDev, doc, debugstr_a(doc->lpszDocName),
|
||||
|
@ -460,13 +469,13 @@ static INT PSDRV_StartDocA( PSDRV_PDEVICE *physDev, const DOCINFOA *doc )
|
|||
/************************************************************************
|
||||
* PSDRV_StartDoc
|
||||
*/
|
||||
INT CDECL PSDRV_StartDoc( PSDRV_PDEVICE *physDev, const DOCINFOW *doc )
|
||||
INT CDECL PSDRV_StartDoc( PHYSDEV dev, const DOCINFOW *doc )
|
||||
{
|
||||
DOCINFOA docA;
|
||||
INT ret, len;
|
||||
LPSTR docname = NULL, output = NULL, datatype = NULL;
|
||||
|
||||
TRACE("(%p, %p) => %d,%s,%s,%s\n", physDev, doc, doc->cbSize, debugstr_w(doc->lpszDocName),
|
||||
TRACE("(%p, %p) => %d,%s,%s,%s\n", dev, doc, doc->cbSize, debugstr_w(doc->lpszDocName),
|
||||
debugstr_w(doc->lpszOutput), debugstr_w(doc->lpszDatatype));
|
||||
|
||||
docA.cbSize = doc->cbSize;
|
||||
|
@ -493,7 +502,7 @@ INT CDECL PSDRV_StartDoc( PSDRV_PDEVICE *physDev, const DOCINFOW *doc )
|
|||
docA.lpszDatatype = datatype;
|
||||
docA.fwType = doc->fwType;
|
||||
|
||||
ret = PSDRV_StartDocA(physDev, &docA);
|
||||
ret = PSDRV_StartDocA(dev, &docA);
|
||||
|
||||
HeapFree( GetProcessHeap(), 0, docname );
|
||||
HeapFree( GetProcessHeap(), 0, output );
|
||||
|
@ -505,9 +514,11 @@ INT CDECL PSDRV_StartDoc( PSDRV_PDEVICE *physDev, const DOCINFOW *doc )
|
|||
/************************************************************************
|
||||
* PSDRV_EndDoc
|
||||
*/
|
||||
INT CDECL PSDRV_EndDoc( PSDRV_PDEVICE *physDev )
|
||||
INT CDECL PSDRV_EndDoc( PHYSDEV dev )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
INT ret = 1;
|
||||
|
||||
if(!physDev->job.id) {
|
||||
FIXME("hJob == 0. Now what?\n");
|
||||
return 0;
|
||||
|
@ -515,9 +526,9 @@ INT CDECL PSDRV_EndDoc( PSDRV_PDEVICE *physDev )
|
|||
|
||||
if(!physDev->job.OutOfPage) {
|
||||
WARN("Somebody forgot an EndPage\n");
|
||||
PSDRV_EndPage( physDev );
|
||||
PSDRV_EndPage( dev );
|
||||
}
|
||||
PSDRV_WriteFooter( physDev );
|
||||
PSDRV_WriteFooter( dev );
|
||||
|
||||
ret = EndDocPrinter(physDev->job.hprinter);
|
||||
ClosePrinter(physDev->job.hprinter);
|
||||
|
|
|
@ -36,8 +36,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
|
|||
/***********************************************************************
|
||||
* SelectFont (WINEPS.@)
|
||||
*/
|
||||
HFONT CDECL PSDRV_SelectFont( PSDRV_PDEVICE *physDev, HFONT hfont, HANDLE gdiFont )
|
||||
HFONT CDECL PSDRV_SelectFont( PHYSDEV dev, HFONT hfont, HANDLE gdiFont )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
LOGFONTW lf;
|
||||
BOOL subst = FALSE;
|
||||
char FaceName[LF_FACESIZE];
|
||||
|
@ -112,28 +113,30 @@ HFONT CDECL PSDRV_SelectFont( PSDRV_PDEVICE *physDev, HFONT hfont, HANDLE gdiFon
|
|||
physDev->font.set = FALSE;
|
||||
|
||||
if(gdiFont && !subst) {
|
||||
if(PSDRV_SelectDownloadFont(physDev))
|
||||
if(PSDRV_SelectDownloadFont(dev))
|
||||
return 0; /* use gdi font */
|
||||
}
|
||||
|
||||
PSDRV_SelectBuiltinFont(physDev, hfont, &lf, FaceName);
|
||||
PSDRV_SelectBuiltinFont(dev, hfont, &lf, FaceName);
|
||||
return (HFONT)1; /* use device font */
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* PSDRV_SetFont
|
||||
*/
|
||||
BOOL PSDRV_SetFont( PSDRV_PDEVICE *physDev )
|
||||
BOOL PSDRV_SetFont( PHYSDEV dev )
|
||||
{
|
||||
PSDRV_WriteSetColor(physDev, &physDev->font.color);
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
|
||||
PSDRV_WriteSetColor(dev, &physDev->font.color);
|
||||
if(physDev->font.set) return TRUE;
|
||||
|
||||
switch(physDev->font.fontloc) {
|
||||
case Builtin:
|
||||
PSDRV_WriteSetBuiltinFont(physDev);
|
||||
PSDRV_WriteSetBuiltinFont(dev);
|
||||
break;
|
||||
case Download:
|
||||
PSDRV_WriteSetDownloadFont(physDev);
|
||||
PSDRV_WriteSetDownloadFont(dev);
|
||||
break;
|
||||
default:
|
||||
ERR("fontloc = %d\n", physDev->font.fontloc);
|
||||
|
|
|
@ -39,7 +39,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
|
|||
*
|
||||
* Performs a world-to-viewport transformation on the specified width.
|
||||
*/
|
||||
INT PSDRV_XWStoDS( PSDRV_PDEVICE *physDev, INT width )
|
||||
INT PSDRV_XWStoDS( PHYSDEV dev, INT width )
|
||||
{
|
||||
POINT pt[2];
|
||||
|
||||
|
@ -47,45 +47,47 @@ INT PSDRV_XWStoDS( PSDRV_PDEVICE *physDev, INT width )
|
|||
pt[0].y = 0;
|
||||
pt[1].x = width;
|
||||
pt[1].y = 0;
|
||||
LPtoDP( physDev->hdc, pt, 2 );
|
||||
LPtoDP( dev->hdc, pt, 2 );
|
||||
return pt[1].x - pt[0].x;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* PSDRV_DrawLine
|
||||
*/
|
||||
static void PSDRV_DrawLine( PSDRV_PDEVICE *physDev )
|
||||
static void PSDRV_DrawLine( PHYSDEV dev )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
|
||||
if(physDev->pathdepth)
|
||||
return;
|
||||
|
||||
if (physDev->pen.style == PS_NULL)
|
||||
PSDRV_WriteNewPath(physDev);
|
||||
PSDRV_WriteNewPath(dev);
|
||||
else
|
||||
PSDRV_WriteStroke(physDev);
|
||||
PSDRV_WriteStroke(dev);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* PSDRV_LineTo
|
||||
*/
|
||||
BOOL CDECL PSDRV_LineTo(PSDRV_PDEVICE *physDev, INT x, INT y)
|
||||
BOOL CDECL PSDRV_LineTo(PHYSDEV dev, INT x, INT y)
|
||||
{
|
||||
POINT pt[2];
|
||||
|
||||
TRACE("%d %d\n", x, y);
|
||||
|
||||
GetCurrentPositionEx( physDev->hdc, pt );
|
||||
GetCurrentPositionEx( dev->hdc, pt );
|
||||
pt[1].x = x;
|
||||
pt[1].y = y;
|
||||
LPtoDP( physDev->hdc, pt, 2 );
|
||||
LPtoDP( dev->hdc, pt, 2 );
|
||||
|
||||
PSDRV_SetPen(physDev);
|
||||
PSDRV_SetPen(dev);
|
||||
|
||||
PSDRV_SetClip(physDev);
|
||||
PSDRV_WriteMoveTo(physDev, pt[0].x, pt[0].y );
|
||||
PSDRV_WriteLineTo(physDev, pt[1].x, pt[1].y );
|
||||
PSDRV_DrawLine(physDev);
|
||||
PSDRV_ResetClip(physDev);
|
||||
PSDRV_SetClip(dev);
|
||||
PSDRV_WriteMoveTo(dev, pt[0].x, pt[0].y );
|
||||
PSDRV_WriteLineTo(dev, pt[1].x, pt[1].y );
|
||||
PSDRV_DrawLine(dev);
|
||||
PSDRV_ResetClip(dev);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -94,8 +96,9 @@ BOOL CDECL PSDRV_LineTo(PSDRV_PDEVICE *physDev, INT x, INT y)
|
|||
/***********************************************************************
|
||||
* PSDRV_Rectangle
|
||||
*/
|
||||
BOOL CDECL PSDRV_Rectangle( PSDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom )
|
||||
BOOL CDECL PSDRV_Rectangle( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
RECT rect;
|
||||
|
||||
TRACE("%d %d - %d %d\n", left, top, right, bottom);
|
||||
|
@ -112,19 +115,19 @@ BOOL CDECL PSDRV_Rectangle( PSDRV_PDEVICE *physDev, INT left, INT top, INT right
|
|||
if(physDev->job.in_passthrough && !physDev->job.had_passthrough_rect && GetROP2(physDev->hdc) == R2_NOP) {
|
||||
char buf[256];
|
||||
sprintf(buf, "N %d %d %d %d B\n", rect.right - rect.left, rect.bottom - rect.top, rect.left, rect.top);
|
||||
write_spool(physDev, buf, strlen(buf));
|
||||
write_spool(dev, buf, strlen(buf));
|
||||
physDev->job.had_passthrough_rect = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
PSDRV_SetPen(physDev);
|
||||
PSDRV_SetPen(dev);
|
||||
|
||||
PSDRV_SetClip(physDev);
|
||||
PSDRV_WriteRectangle(physDev, rect.left, rect.top, rect.right - rect.left,
|
||||
PSDRV_SetClip(dev);
|
||||
PSDRV_WriteRectangle(dev, rect.left, rect.top, rect.right - rect.left,
|
||||
rect.bottom - rect.top );
|
||||
PSDRV_Brush(physDev,0);
|
||||
PSDRV_DrawLine(physDev);
|
||||
PSDRV_ResetClip(physDev);
|
||||
PSDRV_Brush(dev,0);
|
||||
PSDRV_DrawLine(dev);
|
||||
PSDRV_ResetClip(dev);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -132,7 +135,7 @@ BOOL CDECL PSDRV_Rectangle( PSDRV_PDEVICE *physDev, INT left, INT top, INT right
|
|||
/***********************************************************************
|
||||
* PSDRV_RoundRect
|
||||
*/
|
||||
BOOL CDECL PSDRV_RoundRect( PSDRV_PDEVICE *physDev, INT left, INT top, INT right,
|
||||
BOOL CDECL PSDRV_RoundRect( PHYSDEV dev, INT left, INT top, INT right,
|
||||
INT bottom, INT ell_width, INT ell_height )
|
||||
{
|
||||
RECT rect[2];
|
||||
|
@ -145,7 +148,7 @@ BOOL CDECL PSDRV_RoundRect( PSDRV_PDEVICE *physDev, INT left, INT top, INT right
|
|||
rect[1].top = 0;
|
||||
rect[1].right = ell_width;
|
||||
rect[1].bottom = ell_height;
|
||||
LPtoDP( physDev->hdc, (POINT *)rect, 4 );
|
||||
LPtoDP( dev->hdc, (POINT *)rect, 4 );
|
||||
|
||||
left = rect[0].left;
|
||||
top = rect[0].top;
|
||||
|
@ -159,27 +162,27 @@ BOOL CDECL PSDRV_RoundRect( PSDRV_PDEVICE *physDev, INT left, INT top, INT right
|
|||
if (ell_width > right - left) ell_width = right - left;
|
||||
if (ell_height > bottom - top) ell_height = bottom - top;
|
||||
|
||||
PSDRV_WriteSpool(physDev, "%RoundRect\n",11);
|
||||
PSDRV_SetPen(physDev);
|
||||
PSDRV_WriteSpool(dev, "%RoundRect\n",11);
|
||||
PSDRV_SetPen(dev);
|
||||
|
||||
PSDRV_SetClip(physDev);
|
||||
PSDRV_WriteMoveTo( physDev, left, top + ell_height/2 );
|
||||
PSDRV_WriteArc( physDev, left + ell_width/2, top + ell_height/2, ell_width,
|
||||
PSDRV_SetClip(dev);
|
||||
PSDRV_WriteMoveTo( dev, left, top + ell_height/2 );
|
||||
PSDRV_WriteArc( dev, left + ell_width/2, top + ell_height/2, ell_width,
|
||||
ell_height, 90.0, 180.0);
|
||||
PSDRV_WriteLineTo( physDev, right - ell_width/2, top );
|
||||
PSDRV_WriteArc( physDev, right - ell_width/2, top + ell_height/2, ell_width,
|
||||
PSDRV_WriteLineTo( dev, right - ell_width/2, top );
|
||||
PSDRV_WriteArc( dev, right - ell_width/2, top + ell_height/2, ell_width,
|
||||
ell_height, 0.0, 90.0);
|
||||
PSDRV_WriteLineTo( physDev, right, bottom - ell_height/2 );
|
||||
PSDRV_WriteArc( physDev, right - ell_width/2, bottom - ell_height/2, ell_width,
|
||||
PSDRV_WriteLineTo( dev, right, bottom - ell_height/2 );
|
||||
PSDRV_WriteArc( dev, right - ell_width/2, bottom - ell_height/2, ell_width,
|
||||
ell_height, -90.0, 0.0);
|
||||
PSDRV_WriteLineTo( physDev, right - ell_width/2, bottom);
|
||||
PSDRV_WriteArc( physDev, left + ell_width/2, bottom - ell_height/2, ell_width,
|
||||
PSDRV_WriteLineTo( dev, right - ell_width/2, bottom);
|
||||
PSDRV_WriteArc( dev, left + ell_width/2, bottom - ell_height/2, ell_width,
|
||||
ell_height, 180.0, -90.0);
|
||||
PSDRV_WriteClosePath( physDev );
|
||||
PSDRV_WriteClosePath( dev );
|
||||
|
||||
PSDRV_Brush(physDev,0);
|
||||
PSDRV_DrawLine(physDev);
|
||||
PSDRV_ResetClip(physDev);
|
||||
PSDRV_Brush(dev,0);
|
||||
PSDRV_DrawLine(dev);
|
||||
PSDRV_ResetClip(dev);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -188,7 +191,7 @@ BOOL CDECL PSDRV_RoundRect( PSDRV_PDEVICE *physDev, INT left, INT top, INT right
|
|||
*
|
||||
* Does the work of Arc, Chord and Pie. lines is 0, 1 or 2 respectively.
|
||||
*/
|
||||
static BOOL PSDRV_DrawArc( PSDRV_PDEVICE *physDev, INT left, INT top,
|
||||
static BOOL PSDRV_DrawArc( PHYSDEV dev, INT left, INT top,
|
||||
INT right, INT bottom, INT xstart, INT ystart,
|
||||
INT xend, INT yend, int lines )
|
||||
{
|
||||
|
@ -201,13 +204,13 @@ static BOOL PSDRV_DrawArc( PSDRV_PDEVICE *physDev, INT left, INT top,
|
|||
rect.top = top;
|
||||
rect.right = right;
|
||||
rect.bottom = bottom;
|
||||
LPtoDP( physDev->hdc, (POINT *)&rect, 2 );
|
||||
LPtoDP( dev->hdc, (POINT *)&rect, 2 );
|
||||
start.x = xstart;
|
||||
start.y = ystart;
|
||||
end.x = xend;
|
||||
end.y = yend;
|
||||
LPtoDP( physDev->hdc, &start, 1 );
|
||||
LPtoDP( physDev->hdc, &end, 1 );
|
||||
LPtoDP( dev->hdc, &start, 1 );
|
||||
LPtoDP( dev->hdc, &end, 1 );
|
||||
|
||||
x = (rect.left + rect.right) / 2;
|
||||
y = (rect.top + rect.bottom) / 2;
|
||||
|
@ -227,22 +230,22 @@ static BOOL PSDRV_DrawArc( PSDRV_PDEVICE *physDev, INT left, INT top,
|
|||
start_angle *= 180.0 / PI;
|
||||
end_angle *= 180.0 / PI;
|
||||
|
||||
PSDRV_WriteSpool(physDev,"%DrawArc\n", 9);
|
||||
PSDRV_SetPen(physDev);
|
||||
PSDRV_WriteSpool(dev,"%DrawArc\n", 9);
|
||||
PSDRV_SetPen(dev);
|
||||
|
||||
PSDRV_SetClip(physDev);
|
||||
PSDRV_SetClip(dev);
|
||||
if(lines == 2) /* pie */
|
||||
PSDRV_WriteMoveTo(physDev, x, y);
|
||||
PSDRV_WriteMoveTo(dev, x, y);
|
||||
else
|
||||
PSDRV_WriteNewPath( physDev );
|
||||
PSDRV_WriteNewPath( dev );
|
||||
|
||||
PSDRV_WriteArc(physDev, x, y, w, h, start_angle, end_angle);
|
||||
PSDRV_WriteArc(dev, x, y, w, h, start_angle, end_angle);
|
||||
if(lines == 1 || lines == 2) { /* chord or pie */
|
||||
PSDRV_WriteClosePath(physDev);
|
||||
PSDRV_Brush(physDev,0);
|
||||
PSDRV_WriteClosePath(dev);
|
||||
PSDRV_Brush(dev,0);
|
||||
}
|
||||
PSDRV_DrawLine(physDev);
|
||||
PSDRV_ResetClip(physDev);
|
||||
PSDRV_DrawLine(dev);
|
||||
PSDRV_ResetClip(dev);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -251,36 +254,36 @@ static BOOL PSDRV_DrawArc( PSDRV_PDEVICE *physDev, INT left, INT top,
|
|||
/***********************************************************************
|
||||
* PSDRV_Arc
|
||||
*/
|
||||
BOOL CDECL PSDRV_Arc( PSDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom,
|
||||
BOOL CDECL PSDRV_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
|
||||
INT xstart, INT ystart, INT xend, INT yend )
|
||||
{
|
||||
return PSDRV_DrawArc( physDev, left, top, right, bottom, xstart, ystart, xend, yend, 0 );
|
||||
return PSDRV_DrawArc( dev, left, top, right, bottom, xstart, ystart, xend, yend, 0 );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* PSDRV_Chord
|
||||
*/
|
||||
BOOL CDECL PSDRV_Chord( PSDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom,
|
||||
BOOL CDECL PSDRV_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
|
||||
INT xstart, INT ystart, INT xend, INT yend )
|
||||
{
|
||||
return PSDRV_DrawArc( physDev, left, top, right, bottom, xstart, ystart, xend, yend, 1 );
|
||||
return PSDRV_DrawArc( dev, left, top, right, bottom, xstart, ystart, xend, yend, 1 );
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* PSDRV_Pie
|
||||
*/
|
||||
BOOL CDECL PSDRV_Pie( PSDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom,
|
||||
BOOL CDECL PSDRV_Pie( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
|
||||
INT xstart, INT ystart, INT xend, INT yend )
|
||||
{
|
||||
return PSDRV_DrawArc( physDev, left, top, right, bottom, xstart, ystart, xend, yend, 2 );
|
||||
return PSDRV_DrawArc( dev, left, top, right, bottom, xstart, ystart, xend, yend, 2 );
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* PSDRV_Ellipse
|
||||
*/
|
||||
BOOL CDECL PSDRV_Ellipse( PSDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom)
|
||||
BOOL CDECL PSDRV_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT bottom)
|
||||
{
|
||||
INT x, y, w, h;
|
||||
RECT rect;
|
||||
|
@ -291,23 +294,23 @@ BOOL CDECL PSDRV_Ellipse( PSDRV_PDEVICE *physDev, INT left, INT top, INT right,
|
|||
rect.top = top;
|
||||
rect.right = right;
|
||||
rect.bottom = bottom;
|
||||
LPtoDP( physDev->hdc, (POINT *)&rect, 2 );
|
||||
LPtoDP( dev->hdc, (POINT *)&rect, 2 );
|
||||
|
||||
x = (rect.left + rect.right) / 2;
|
||||
y = (rect.top + rect.bottom) / 2;
|
||||
w = rect.right - rect.left;
|
||||
h = rect.bottom - rect.top;
|
||||
|
||||
PSDRV_WriteSpool(physDev, "%Ellipse\n", 9);
|
||||
PSDRV_SetPen(physDev);
|
||||
PSDRV_WriteSpool(dev, "%Ellipse\n", 9);
|
||||
PSDRV_SetPen(dev);
|
||||
|
||||
PSDRV_SetClip(physDev);
|
||||
PSDRV_WriteNewPath(physDev);
|
||||
PSDRV_WriteArc(physDev, x, y, w, h, 0.0, 360.0);
|
||||
PSDRV_WriteClosePath(physDev);
|
||||
PSDRV_Brush(physDev,0);
|
||||
PSDRV_DrawLine(physDev);
|
||||
PSDRV_ResetClip(physDev);
|
||||
PSDRV_SetClip(dev);
|
||||
PSDRV_WriteNewPath(dev);
|
||||
PSDRV_WriteArc(dev, x, y, w, h, 0.0, 360.0);
|
||||
PSDRV_WriteClosePath(dev);
|
||||
PSDRV_Brush(dev,0);
|
||||
PSDRV_DrawLine(dev);
|
||||
PSDRV_ResetClip(dev);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -315,7 +318,7 @@ BOOL CDECL PSDRV_Ellipse( PSDRV_PDEVICE *physDev, INT left, INT top, INT right,
|
|||
/***********************************************************************
|
||||
* PSDRV_PolyPolyline
|
||||
*/
|
||||
BOOL CDECL PSDRV_PolyPolyline( PSDRV_PDEVICE *physDev, const POINT* pts, const DWORD* counts,
|
||||
BOOL CDECL PSDRV_PolyPolyline( PHYSDEV dev, const POINT* pts, const DWORD* counts,
|
||||
DWORD polylines )
|
||||
{
|
||||
DWORD polyline, line, total;
|
||||
|
@ -326,24 +329,24 @@ BOOL CDECL PSDRV_PolyPolyline( PSDRV_PDEVICE *physDev, const POINT* pts, const D
|
|||
for (polyline = total = 0; polyline < polylines; polyline++) total += counts[polyline];
|
||||
if (!(dev_pts = HeapAlloc( GetProcessHeap(), 0, total * sizeof(*dev_pts) ))) return FALSE;
|
||||
memcpy( dev_pts, pts, total * sizeof(*dev_pts) );
|
||||
LPtoDP( physDev->hdc, dev_pts, total );
|
||||
LPtoDP( dev->hdc, dev_pts, total );
|
||||
|
||||
pt = dev_pts;
|
||||
|
||||
PSDRV_WriteSpool(physDev, "%PolyPolyline\n",14);
|
||||
PSDRV_SetPen(physDev);
|
||||
PSDRV_SetClip(physDev);
|
||||
PSDRV_WriteSpool(dev, "%PolyPolyline\n",14);
|
||||
PSDRV_SetPen(dev);
|
||||
PSDRV_SetClip(dev);
|
||||
|
||||
for(polyline = 0; polyline < polylines; polyline++) {
|
||||
PSDRV_WriteMoveTo(physDev, pt->x, pt->y);
|
||||
PSDRV_WriteMoveTo(dev, pt->x, pt->y);
|
||||
pt++;
|
||||
for(line = 1; line < counts[polyline]; line++, pt++)
|
||||
PSDRV_WriteLineTo(physDev, pt->x, pt->y);
|
||||
PSDRV_WriteLineTo(dev, pt->x, pt->y);
|
||||
}
|
||||
HeapFree( GetProcessHeap(), 0, dev_pts );
|
||||
|
||||
PSDRV_DrawLine(physDev);
|
||||
PSDRV_ResetClip(physDev);
|
||||
PSDRV_DrawLine(dev);
|
||||
PSDRV_ResetClip(dev);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -351,16 +354,16 @@ BOOL CDECL PSDRV_PolyPolyline( PSDRV_PDEVICE *physDev, const POINT* pts, const D
|
|||
/***********************************************************************
|
||||
* PSDRV_Polyline
|
||||
*/
|
||||
BOOL CDECL PSDRV_Polyline( PSDRV_PDEVICE *physDev, const POINT* pt, INT count )
|
||||
BOOL CDECL PSDRV_Polyline( PHYSDEV dev, const POINT* pt, INT count )
|
||||
{
|
||||
return PSDRV_PolyPolyline( physDev, pt, (LPDWORD) &count, 1 );
|
||||
return PSDRV_PolyPolyline( dev, pt, (LPDWORD) &count, 1 );
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* PSDRV_PolyPolygon
|
||||
*/
|
||||
BOOL CDECL PSDRV_PolyPolygon( PSDRV_PDEVICE *physDev, const POINT* pts, const INT* counts,
|
||||
BOOL CDECL PSDRV_PolyPolygon( PHYSDEV dev, const POINT* pts, const INT* counts,
|
||||
UINT polygons )
|
||||
{
|
||||
DWORD polygon, total;
|
||||
|
@ -372,31 +375,31 @@ BOOL CDECL PSDRV_PolyPolygon( PSDRV_PDEVICE *physDev, const POINT* pts, const IN
|
|||
for (polygon = total = 0; polygon < polygons; polygon++) total += counts[polygon];
|
||||
if (!(dev_pts = HeapAlloc( GetProcessHeap(), 0, total * sizeof(*dev_pts) ))) return FALSE;
|
||||
memcpy( dev_pts, pts, total * sizeof(*dev_pts) );
|
||||
LPtoDP( physDev->hdc, dev_pts, total );
|
||||
LPtoDP( dev->hdc, dev_pts, total );
|
||||
|
||||
pt = dev_pts;
|
||||
|
||||
PSDRV_WriteSpool(physDev, "%PolyPolygon\n",13);
|
||||
PSDRV_SetPen(physDev);
|
||||
PSDRV_SetClip(physDev);
|
||||
PSDRV_WriteNewPath(physDev);
|
||||
PSDRV_WriteSpool(dev, "%PolyPolygon\n",13);
|
||||
PSDRV_SetPen(dev);
|
||||
PSDRV_SetClip(dev);
|
||||
PSDRV_WriteNewPath(dev);
|
||||
|
||||
for(polygon = 0; polygon < polygons; polygon++) {
|
||||
PSDRV_WriteMoveTo(physDev, pt->x, pt->y);
|
||||
PSDRV_WriteMoveTo(dev, pt->x, pt->y);
|
||||
pt++;
|
||||
for(line = 1; line < counts[polygon]; line++, pt++)
|
||||
PSDRV_WriteLineTo(physDev, pt->x, pt->y);
|
||||
PSDRV_WriteClosePath(physDev);
|
||||
PSDRV_WriteLineTo(dev, pt->x, pt->y);
|
||||
PSDRV_WriteClosePath(dev);
|
||||
}
|
||||
HeapFree( GetProcessHeap(), 0, dev_pts );
|
||||
|
||||
if(GetPolyFillMode( physDev->hdc ) == ALTERNATE)
|
||||
PSDRV_Brush(physDev, 1);
|
||||
if(GetPolyFillMode( dev->hdc ) == ALTERNATE)
|
||||
PSDRV_Brush(dev, 1);
|
||||
else /* WINDING */
|
||||
PSDRV_Brush(physDev, 0);
|
||||
PSDRV_Brush(dev, 0);
|
||||
|
||||
PSDRV_DrawLine(physDev);
|
||||
PSDRV_ResetClip(physDev);
|
||||
PSDRV_DrawLine(dev);
|
||||
PSDRV_ResetClip(dev);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -404,48 +407,47 @@ BOOL CDECL PSDRV_PolyPolygon( PSDRV_PDEVICE *physDev, const POINT* pts, const IN
|
|||
/***********************************************************************
|
||||
* PSDRV_Polygon
|
||||
*/
|
||||
BOOL CDECL PSDRV_Polygon( PSDRV_PDEVICE *physDev, const POINT* pt, INT count )
|
||||
BOOL CDECL PSDRV_Polygon( PHYSDEV dev, const POINT* pt, INT count )
|
||||
{
|
||||
return PSDRV_PolyPolygon( physDev, pt, &count, 1 );
|
||||
return PSDRV_PolyPolygon( dev, pt, &count, 1 );
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* PSDRV_SetPixel
|
||||
*/
|
||||
COLORREF CDECL PSDRV_SetPixel( PSDRV_PDEVICE *physDev, INT x, INT y, COLORREF color )
|
||||
COLORREF CDECL PSDRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color )
|
||||
{
|
||||
PSCOLOR pscolor;
|
||||
POINT pt;
|
||||
|
||||
pt.x = x;
|
||||
pt.y = y;
|
||||
LPtoDP( physDev->hdc, &pt, 1 );
|
||||
LPtoDP( dev->hdc, &pt, 1 );
|
||||
|
||||
PSDRV_SetClip(physDev);
|
||||
PSDRV_SetClip(dev);
|
||||
/* we bracket the setcolor in gsave/grestore so that we don't trash
|
||||
the current pen colour */
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_WriteRectangle( physDev, pt.x, pt.y, 0, 0 );
|
||||
PSDRV_CreateColor( physDev, &pscolor, color );
|
||||
PSDRV_WriteSetColor( physDev, &pscolor );
|
||||
PSDRV_WriteFill( physDev );
|
||||
PSDRV_WriteGRestore(physDev);
|
||||
PSDRV_ResetClip(physDev);
|
||||
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_PaintRgn
|
||||
*/
|
||||
BOOL CDECL PSDRV_PaintRgn( PSDRV_PDEVICE *physDev, HRGN hrgn )
|
||||
BOOL CDECL PSDRV_PaintRgn( PHYSDEV dev, HRGN hrgn )
|
||||
{
|
||||
|
||||
RGNDATA *rgndata = NULL;
|
||||
RECT *pRect;
|
||||
DWORD size, i;
|
||||
|
||||
TRACE("hdc=%p\n", physDev->hdc);
|
||||
TRACE("hdc=%p\n", dev->hdc);
|
||||
|
||||
size = GetRegionData(hrgn, 0, NULL);
|
||||
rgndata = HeapAlloc( GetProcessHeap(), 0, size );
|
||||
|
@ -458,15 +460,15 @@ BOOL CDECL PSDRV_PaintRgn( PSDRV_PDEVICE *physDev, HRGN hrgn )
|
|||
if (rgndata->rdh.nCount == 0)
|
||||
goto end;
|
||||
|
||||
LPtoDP(physDev->hdc, (POINT*)rgndata->Buffer, rgndata->rdh.nCount * 2);
|
||||
LPtoDP(dev->hdc, (POINT*)rgndata->Buffer, rgndata->rdh.nCount * 2);
|
||||
|
||||
PSDRV_SetClip(physDev);
|
||||
PSDRV_WriteNewPath(physDev);
|
||||
PSDRV_SetClip(dev);
|
||||
PSDRV_WriteNewPath(dev);
|
||||
for(i = 0, pRect = (RECT*)rgndata->Buffer; i < rgndata->rdh.nCount; i++, pRect++)
|
||||
PSDRV_WriteRectangle(physDev, pRect->left, pRect->top, pRect->right - pRect->left, pRect->bottom - pRect->top);
|
||||
PSDRV_WriteRectangle(dev, pRect->left, pRect->top, pRect->right - pRect->left, pRect->bottom - pRect->top);
|
||||
|
||||
PSDRV_Brush(physDev, 0);
|
||||
PSDRV_ResetClip(physDev);
|
||||
PSDRV_Brush(dev, 0);
|
||||
PSDRV_ResetClip(dev);
|
||||
|
||||
end:
|
||||
HeapFree(GetProcessHeap(), 0, rgndata);
|
||||
|
|
|
@ -381,8 +381,10 @@ BOOL CDECL PSDRV_CreateDC( HDC hdc, PSDRV_PDEVICE **pdev, LPCWSTR driver, LPCWST
|
|||
/**********************************************************************
|
||||
* PSDRV_DeleteDC
|
||||
*/
|
||||
BOOL CDECL PSDRV_DeleteDC( PSDRV_PDEVICE *physDev )
|
||||
BOOL CDECL PSDRV_DeleteDC( PHYSDEV dev )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
|
||||
TRACE("\n");
|
||||
|
||||
HeapFree( PSDRV_Heap, 0, physDev->Devmode );
|
||||
|
@ -396,8 +398,10 @@ BOOL CDECL PSDRV_DeleteDC( PSDRV_PDEVICE *physDev )
|
|||
/**********************************************************************
|
||||
* ResetDC (WINEPS.@)
|
||||
*/
|
||||
HDC CDECL PSDRV_ResetDC( PSDRV_PDEVICE *physDev, const DEVMODEW *lpInitData )
|
||||
HDC CDECL PSDRV_ResetDC( PHYSDEV dev, const DEVMODEW *lpInitData )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
|
||||
if(lpInitData) {
|
||||
DEVMODEA *devmodeA = DEVMODEdupWtoA(PSDRV_Heap, lpInitData);
|
||||
PSDRV_MergeDevmodes(physDev->Devmode, (PSDRV_DEVMODEA *)devmodeA, physDev->pi);
|
||||
|
@ -410,8 +414,10 @@ HDC CDECL PSDRV_ResetDC( PSDRV_PDEVICE *physDev, const DEVMODEW *lpInitData )
|
|||
/***********************************************************************
|
||||
* GetDeviceCaps (WINEPS.@)
|
||||
*/
|
||||
INT CDECL PSDRV_GetDeviceCaps( PSDRV_PDEVICE *physDev, INT cap )
|
||||
INT CDECL PSDRV_GetDeviceCaps( PHYSDEV dev, INT cap )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
|
||||
switch(cap)
|
||||
{
|
||||
case DRIVERVERSION:
|
||||
|
|
|
@ -37,8 +37,9 @@ static const char PEN_alternate[] = "1";
|
|||
/***********************************************************************
|
||||
* SelectPen (WINEPS.@)
|
||||
*/
|
||||
HPEN CDECL PSDRV_SelectPen( PSDRV_PDEVICE *physDev, HPEN hpen )
|
||||
HPEN CDECL PSDRV_SelectPen( PHYSDEV dev, HPEN hpen )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
LOGPEN logpen;
|
||||
|
||||
if (!GetObjectW( hpen, sizeof(logpen), &logpen ))
|
||||
|
@ -66,7 +67,7 @@ HPEN CDECL PSDRV_SelectPen( PSDRV_PDEVICE *physDev, HPEN hpen )
|
|||
physDev->pen.width = logpen.lopnWidth.x;
|
||||
if ((logpen.lopnStyle & PS_GEOMETRIC) || (physDev->pen.width > 1))
|
||||
{
|
||||
physDev->pen.width = PSDRV_XWStoDS( physDev, physDev->pen.width );
|
||||
physDev->pen.width = PSDRV_XWStoDS( dev, physDev->pen.width );
|
||||
if(physDev->pen.width < 0) physDev->pen.width = -physDev->pen.width;
|
||||
}
|
||||
if (hpen == GetStockObject( DC_PEN ))
|
||||
|
@ -88,7 +89,7 @@ HPEN CDECL PSDRV_SelectPen( PSDRV_PDEVICE *physDev, HPEN hpen )
|
|||
case PS_ENDCAP_FLAT: physDev->pen.endcap = 0; break;
|
||||
}
|
||||
|
||||
PSDRV_CreateColor(physDev, &physDev->pen.color, logpen.lopnColor);
|
||||
PSDRV_CreateColor(dev, &physDev->pen.color, logpen.lopnColor);
|
||||
physDev->pen.style = logpen.lopnStyle & PS_STYLE_MASK;
|
||||
|
||||
switch(physDev->pen.style) {
|
||||
|
@ -129,10 +130,12 @@ HPEN CDECL PSDRV_SelectPen( PSDRV_PDEVICE *physDev, HPEN hpen )
|
|||
/***********************************************************************
|
||||
* SetDCPenColor (WINEPS.@)
|
||||
*/
|
||||
COLORREF CDECL PSDRV_SetDCPenColor( PSDRV_PDEVICE *physDev, COLORREF color )
|
||||
COLORREF CDECL PSDRV_SetDCPenColor( PHYSDEV dev, COLORREF color )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
|
||||
if (GetCurrentObject( physDev->hdc, OBJ_PEN ) == GetStockObject( DC_PEN ))
|
||||
PSDRV_CreateColor( physDev, &physDev->pen.color, color );
|
||||
PSDRV_CreateColor( dev, &physDev->pen.color, color );
|
||||
return color;
|
||||
}
|
||||
|
||||
|
@ -142,13 +145,15 @@ COLORREF CDECL PSDRV_SetDCPenColor( PSDRV_PDEVICE *physDev, COLORREF color )
|
|||
* PSDRV_SetPen
|
||||
*
|
||||
*/
|
||||
BOOL PSDRV_SetPen(PSDRV_PDEVICE *physDev)
|
||||
BOOL PSDRV_SetPen( PHYSDEV dev )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
|
||||
if (physDev->pen.style != PS_NULL) {
|
||||
PSDRV_WriteSetColor(physDev, &physDev->pen.color);
|
||||
PSDRV_WriteSetColor(dev, &physDev->pen.color);
|
||||
|
||||
if(!physDev->pen.set) {
|
||||
PSDRV_WriteSetPen(physDev);
|
||||
PSDRV_WriteSetPen(dev);
|
||||
physDev->pen.set = TRUE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -186,8 +186,9 @@ static const char psarraydef[] =
|
|||
static const char psenddocument[] =
|
||||
"\n%%EndDocument\n";
|
||||
|
||||
DWORD PSDRV_WriteSpool(PSDRV_PDEVICE *physDev, LPCSTR lpData, DWORD cch)
|
||||
DWORD PSDRV_WriteSpool(PHYSDEV dev, LPCSTR lpData, DWORD cch)
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
int num, num_left = cch;
|
||||
|
||||
if(physDev->job.quiet) {
|
||||
|
@ -196,18 +197,18 @@ DWORD PSDRV_WriteSpool(PSDRV_PDEVICE *physDev, LPCSTR lpData, DWORD cch)
|
|||
}
|
||||
|
||||
if(physDev->job.in_passthrough) { /* Was in PASSTHROUGH mode */
|
||||
write_spool( physDev, psenddocument, sizeof(psenddocument)-1 );
|
||||
write_spool( dev, psenddocument, sizeof(psenddocument)-1 );
|
||||
physDev->job.in_passthrough = physDev->job.had_passthrough_rect = FALSE;
|
||||
}
|
||||
|
||||
if(physDev->job.OutOfPage) { /* Will get here after NEWFRAME Escape */
|
||||
if( !PSDRV_StartPage(physDev) )
|
||||
if( !PSDRV_StartPage(dev) )
|
||||
return 0;
|
||||
}
|
||||
|
||||
do {
|
||||
num = min(num_left, 0x8000);
|
||||
if(write_spool( physDev, lpData, num ) != num)
|
||||
if(write_spool( dev, lpData, num ) != num)
|
||||
return 0;
|
||||
lpData += num;
|
||||
num_left -= num;
|
||||
|
@ -217,16 +218,16 @@ DWORD PSDRV_WriteSpool(PSDRV_PDEVICE *physDev, LPCSTR lpData, DWORD cch)
|
|||
}
|
||||
|
||||
|
||||
static INT PSDRV_WriteFeature(PSDRV_PDEVICE *physDev, LPCSTR feature, LPCSTR value, LPCSTR invocation)
|
||||
static INT PSDRV_WriteFeature(PHYSDEV dev, LPCSTR feature, LPCSTR value, LPCSTR invocation)
|
||||
{
|
||||
|
||||
char *buf = HeapAlloc( PSDRV_Heap, 0, sizeof(psbeginfeature) +
|
||||
strlen(feature) + strlen(value));
|
||||
|
||||
sprintf(buf, psbeginfeature, feature, value);
|
||||
write_spool( physDev, buf, strlen(buf) );
|
||||
write_spool( physDev, invocation, strlen(invocation) );
|
||||
write_spool( physDev, psendfeature, strlen(psendfeature) );
|
||||
write_spool( dev, buf, strlen(buf) );
|
||||
write_spool( dev, invocation, strlen(invocation) );
|
||||
write_spool( dev, psendfeature, strlen(psendfeature) );
|
||||
|
||||
HeapFree( PSDRV_Heap, 0, buf );
|
||||
return 1;
|
||||
|
@ -288,8 +289,9 @@ static char *escape_title(LPCSTR str)
|
|||
}
|
||||
|
||||
|
||||
INT PSDRV_WriteHeader( PSDRV_PDEVICE *physDev, LPCSTR title )
|
||||
INT PSDRV_WriteHeader( PHYSDEV dev, LPCSTR title )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
char *buf, *escaped_title;
|
||||
INPUTSLOT *slot;
|
||||
PAGESIZE *page;
|
||||
|
@ -318,28 +320,28 @@ INT PSDRV_WriteHeader( PSDRV_PDEVICE *physDev, LPCSTR title )
|
|||
sprintf(buf, psheader, escaped_title, llx, lly, urx, ury);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, escaped_title);
|
||||
if( write_spool( physDev, buf, strlen(buf) ) != strlen(buf) ) {
|
||||
if( write_spool( dev, buf, strlen(buf) ) != strlen(buf) ) {
|
||||
WARN("WriteSpool error\n");
|
||||
HeapFree( PSDRV_Heap, 0, buf );
|
||||
return 0;
|
||||
}
|
||||
HeapFree( PSDRV_Heap, 0, buf );
|
||||
|
||||
write_spool( physDev, psbeginprolog, strlen(psbeginprolog) );
|
||||
write_spool( physDev, psprolog, strlen(psprolog) );
|
||||
write_spool( physDev, psendprolog, strlen(psendprolog) );
|
||||
write_spool( physDev, psbeginsetup, strlen(psbeginsetup) );
|
||||
write_spool( dev, psbeginprolog, strlen(psbeginprolog) );
|
||||
write_spool( dev, psprolog, strlen(psprolog) );
|
||||
write_spool( dev, psendprolog, strlen(psendprolog) );
|
||||
write_spool( dev, psbeginsetup, strlen(psbeginsetup) );
|
||||
|
||||
if(physDev->Devmode->dmPublic.u1.s1.dmCopies > 1) {
|
||||
char copies_buf[100];
|
||||
sprintf(copies_buf, "mark {\n << /NumCopies %d >> setpagedevice\n} stopped cleartomark\n", physDev->Devmode->dmPublic.u1.s1.dmCopies);
|
||||
write_spool(physDev, copies_buf, strlen(copies_buf));
|
||||
write_spool(dev, copies_buf, strlen(copies_buf));
|
||||
}
|
||||
|
||||
for(slot = physDev->pi->ppd->InputSlots; slot; slot = slot->next) {
|
||||
if(slot->WinBin == physDev->Devmode->dmPublic.u1.s1.dmDefaultSource) {
|
||||
if(slot->InvocationString) {
|
||||
PSDRV_WriteFeature(physDev, "*InputSlot", slot->Name,
|
||||
PSDRV_WriteFeature(dev, "*InputSlot", slot->Name,
|
||||
slot->InvocationString);
|
||||
break;
|
||||
}
|
||||
|
@ -349,7 +351,7 @@ INT PSDRV_WriteHeader( PSDRV_PDEVICE *physDev, LPCSTR title )
|
|||
LIST_FOR_EACH_ENTRY(page, &physDev->pi->ppd->PageSizes, PAGESIZE, entry) {
|
||||
if(page->WinPage == physDev->Devmode->dmPublic.u1.s1.dmPaperSize) {
|
||||
if(page->InvocationString) {
|
||||
PSDRV_WriteFeature(physDev, "*PageSize", page->Name,
|
||||
PSDRV_WriteFeature(dev, "*PageSize", page->Name,
|
||||
page->InvocationString);
|
||||
break;
|
||||
}
|
||||
|
@ -361,22 +363,23 @@ INT PSDRV_WriteHeader( PSDRV_PDEVICE *physDev, LPCSTR title )
|
|||
for(duplex = physDev->pi->ppd->Duplexes; duplex; duplex = duplex->next) {
|
||||
if(duplex->WinDuplex == win_duplex) {
|
||||
if(duplex->InvocationString) {
|
||||
PSDRV_WriteFeature(physDev, "*Duplex", duplex->Name,
|
||||
PSDRV_WriteFeature(dev, "*Duplex", duplex->Name,
|
||||
duplex->InvocationString);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
write_spool( physDev, psendsetup, strlen(psendsetup) );
|
||||
write_spool( dev, psendsetup, strlen(psendsetup) );
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
INT PSDRV_WriteFooter( PSDRV_PDEVICE *physDev )
|
||||
INT PSDRV_WriteFooter( PHYSDEV dev )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
char *buf;
|
||||
|
||||
buf = HeapAlloc( PSDRV_Heap, 0, sizeof(psfooter) + 100 );
|
||||
|
@ -387,7 +390,7 @@ INT PSDRV_WriteFooter( PSDRV_PDEVICE *physDev )
|
|||
|
||||
sprintf(buf, psfooter, physDev->job.PageNo);
|
||||
|
||||
if( write_spool( physDev, buf, strlen(buf) ) != strlen(buf) ) {
|
||||
if( write_spool( dev, buf, strlen(buf) ) != strlen(buf) ) {
|
||||
WARN("WriteSpool error\n");
|
||||
HeapFree( PSDRV_Heap, 0, buf );
|
||||
return 0;
|
||||
|
@ -398,9 +401,9 @@ INT PSDRV_WriteFooter( PSDRV_PDEVICE *physDev )
|
|||
|
||||
|
||||
|
||||
INT PSDRV_WriteEndPage( PSDRV_PDEVICE *physDev )
|
||||
INT PSDRV_WriteEndPage( PHYSDEV dev )
|
||||
{
|
||||
if( write_spool( physDev, psendpage, sizeof(psendpage)-1 ) != sizeof(psendpage)-1 ) {
|
||||
if( write_spool( dev, psendpage, sizeof(psendpage)-1 ) != sizeof(psendpage)-1 ) {
|
||||
WARN("WriteSpool error\n");
|
||||
return 0;
|
||||
}
|
||||
|
@ -410,8 +413,9 @@ INT PSDRV_WriteEndPage( PSDRV_PDEVICE *physDev )
|
|||
|
||||
|
||||
|
||||
INT PSDRV_WriteNewPage( PSDRV_PDEVICE *physDev )
|
||||
INT PSDRV_WriteNewPage( PHYSDEV dev )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
char *buf;
|
||||
char name[100];
|
||||
signed int xtrans, ytrans, rotation;
|
||||
|
@ -444,7 +448,7 @@ INT PSDRV_WriteNewPage( PSDRV_PDEVICE *physDev )
|
|||
physDev->logPixelsX, physDev->logPixelsY,
|
||||
xtrans, ytrans, rotation);
|
||||
|
||||
if( write_spool( physDev, buf, strlen(buf) ) != strlen(buf) ) {
|
||||
if( write_spool( dev, buf, strlen(buf) ) != strlen(buf) ) {
|
||||
WARN("WriteSpool error\n");
|
||||
HeapFree( PSDRV_Heap, 0, buf );
|
||||
return 0;
|
||||
|
@ -454,40 +458,40 @@ INT PSDRV_WriteNewPage( PSDRV_PDEVICE *physDev )
|
|||
}
|
||||
|
||||
|
||||
BOOL PSDRV_WriteMoveTo(PSDRV_PDEVICE *physDev, INT x, INT y)
|
||||
BOOL PSDRV_WriteMoveTo(PHYSDEV dev, INT x, INT y)
|
||||
{
|
||||
char buf[100];
|
||||
|
||||
sprintf(buf, psmoveto, x, y);
|
||||
return PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
return PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteLineTo(PSDRV_PDEVICE *physDev, INT x, INT y)
|
||||
BOOL PSDRV_WriteLineTo(PHYSDEV dev, INT x, INT y)
|
||||
{
|
||||
char buf[100];
|
||||
|
||||
sprintf(buf, pslineto, x, y);
|
||||
return PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
return PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
}
|
||||
|
||||
|
||||
BOOL PSDRV_WriteStroke(PSDRV_PDEVICE *physDev)
|
||||
BOOL PSDRV_WriteStroke(PHYSDEV dev)
|
||||
{
|
||||
return PSDRV_WriteSpool(physDev, psstroke, sizeof(psstroke)-1);
|
||||
return PSDRV_WriteSpool(dev, psstroke, sizeof(psstroke)-1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
BOOL PSDRV_WriteRectangle(PSDRV_PDEVICE *physDev, INT x, INT y, INT width,
|
||||
BOOL PSDRV_WriteRectangle(PHYSDEV dev, INT x, INT y, INT width,
|
||||
INT height)
|
||||
{
|
||||
char buf[100];
|
||||
|
||||
sprintf(buf, psrectangle, x, y, width, height, -width);
|
||||
return PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
return PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteArc(PSDRV_PDEVICE *physDev, INT x, INT y, INT w, INT h, double ang1,
|
||||
BOOL PSDRV_WriteArc(PHYSDEV dev, INT x, INT y, INT w, INT h, double ang1,
|
||||
double ang2)
|
||||
{
|
||||
char buf[256];
|
||||
|
@ -497,11 +501,11 @@ BOOL PSDRV_WriteArc(PSDRV_PDEVICE *physDev, INT x, INT y, INT w, INT h, double a
|
|||
push_lc_numeric("C");
|
||||
sprintf(buf, psarc, x, y, w, h, -ang2, -ang1);
|
||||
pop_lc_numeric();
|
||||
return PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
return PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
}
|
||||
|
||||
|
||||
BOOL PSDRV_WriteSetFont(PSDRV_PDEVICE *physDev, const char *name, matrix size, INT escapement)
|
||||
BOOL PSDRV_WriteSetFont(PHYSDEV dev, const char *name, matrix size, INT escapement)
|
||||
{
|
||||
char *buf;
|
||||
|
||||
|
@ -515,13 +519,14 @@ BOOL PSDRV_WriteSetFont(PSDRV_PDEVICE *physDev, const char *name, matrix size, I
|
|||
|
||||
sprintf(buf, pssetfont, name, size.xx, size.xy, size.yx, size.yy, -escapement);
|
||||
|
||||
PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
HeapFree(PSDRV_Heap, 0, buf);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteSetColor(PSDRV_PDEVICE *physDev, PSCOLOR *color)
|
||||
BOOL PSDRV_WriteSetColor(PHYSDEV dev, PSCOLOR *color)
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
char buf[256];
|
||||
|
||||
PSDRV_CopyColor(&physDev->inkColor, color);
|
||||
|
@ -531,13 +536,13 @@ BOOL PSDRV_WriteSetColor(PSDRV_PDEVICE *physDev, PSCOLOR *color)
|
|||
sprintf(buf, pssetrgbcolor, color->value.rgb.r, color->value.rgb.g,
|
||||
color->value.rgb.b);
|
||||
pop_lc_numeric();
|
||||
return PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
return PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
|
||||
case PSCOLOR_GRAY:
|
||||
push_lc_numeric("C");
|
||||
sprintf(buf, pssetgray, color->value.gray.i);
|
||||
pop_lc_numeric();
|
||||
return PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
return PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
|
||||
default:
|
||||
ERR("Unkonwn colour type %d\n", color->type);
|
||||
|
@ -547,12 +552,13 @@ BOOL PSDRV_WriteSetColor(PSDRV_PDEVICE *physDev, PSCOLOR *color)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteSetPen(PSDRV_PDEVICE *physDev)
|
||||
BOOL PSDRV_WriteSetPen(PHYSDEV dev)
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
char buf[256];
|
||||
|
||||
sprintf(buf, pssetline, physDev->pen.width, physDev->pen.join, physDev->pen.endcap);
|
||||
PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
|
||||
if(physDev->pen.dash) {
|
||||
sprintf(buf, pssetdash, physDev->pen.dash, 0);
|
||||
|
@ -560,12 +566,12 @@ BOOL PSDRV_WriteSetPen(PSDRV_PDEVICE *physDev)
|
|||
else
|
||||
sprintf(buf, pssetdash, "", 0);
|
||||
|
||||
PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteGlyphShow(PSDRV_PDEVICE *physDev, LPCSTR g_name)
|
||||
BOOL PSDRV_WriteGlyphShow(PHYSDEV dev, LPCSTR g_name)
|
||||
{
|
||||
char buf[128];
|
||||
int l;
|
||||
|
@ -577,79 +583,79 @@ BOOL PSDRV_WriteGlyphShow(PSDRV_PDEVICE *physDev, LPCSTR g_name)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
PSDRV_WriteSpool(physDev, buf, l);
|
||||
PSDRV_WriteSpool(dev, buf, l);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteFill(PSDRV_PDEVICE *physDev)
|
||||
BOOL PSDRV_WriteFill(PHYSDEV dev)
|
||||
{
|
||||
return PSDRV_WriteSpool(physDev, psfill, sizeof(psfill)-1);
|
||||
return PSDRV_WriteSpool(dev, psfill, sizeof(psfill)-1);
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteEOFill(PSDRV_PDEVICE *physDev)
|
||||
BOOL PSDRV_WriteEOFill(PHYSDEV dev)
|
||||
{
|
||||
return PSDRV_WriteSpool(physDev, pseofill, sizeof(pseofill)-1);
|
||||
return PSDRV_WriteSpool(dev, pseofill, sizeof(pseofill)-1);
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteGSave(PSDRV_PDEVICE *physDev)
|
||||
BOOL PSDRV_WriteGSave(PHYSDEV dev)
|
||||
{
|
||||
return PSDRV_WriteSpool(physDev, psgsave, sizeof(psgsave)-1);
|
||||
return PSDRV_WriteSpool(dev, psgsave, sizeof(psgsave)-1);
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteGRestore(PSDRV_PDEVICE *physDev)
|
||||
BOOL PSDRV_WriteGRestore(PHYSDEV dev)
|
||||
{
|
||||
return PSDRV_WriteSpool(physDev, psgrestore, sizeof(psgrestore)-1);
|
||||
return PSDRV_WriteSpool(dev, psgrestore, sizeof(psgrestore)-1);
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteNewPath(PSDRV_PDEVICE *physDev)
|
||||
BOOL PSDRV_WriteNewPath(PHYSDEV dev)
|
||||
{
|
||||
return PSDRV_WriteSpool(physDev, psnewpath, sizeof(psnewpath)-1);
|
||||
return PSDRV_WriteSpool(dev, psnewpath, sizeof(psnewpath)-1);
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteClosePath(PSDRV_PDEVICE *physDev)
|
||||
BOOL PSDRV_WriteClosePath(PHYSDEV dev)
|
||||
{
|
||||
return PSDRV_WriteSpool(physDev, psclosepath, sizeof(psclosepath)-1);
|
||||
return PSDRV_WriteSpool(dev, psclosepath, sizeof(psclosepath)-1);
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteClip(PSDRV_PDEVICE *physDev)
|
||||
BOOL PSDRV_WriteClip(PHYSDEV dev)
|
||||
{
|
||||
return PSDRV_WriteSpool(physDev, psclip, sizeof(psclip)-1);
|
||||
return PSDRV_WriteSpool(dev, psclip, sizeof(psclip)-1);
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteEOClip(PSDRV_PDEVICE *physDev)
|
||||
BOOL PSDRV_WriteEOClip(PHYSDEV dev)
|
||||
{
|
||||
return PSDRV_WriteSpool(physDev, pseoclip, sizeof(pseoclip)-1);
|
||||
return PSDRV_WriteSpool(dev, pseoclip, sizeof(pseoclip)-1);
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteHatch(PSDRV_PDEVICE *physDev)
|
||||
BOOL PSDRV_WriteHatch(PHYSDEV dev)
|
||||
{
|
||||
return PSDRV_WriteSpool(physDev, pshatch, sizeof(pshatch)-1);
|
||||
return PSDRV_WriteSpool(dev, pshatch, sizeof(pshatch)-1);
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteRotate(PSDRV_PDEVICE *physDev, float ang)
|
||||
BOOL PSDRV_WriteRotate(PHYSDEV dev, float ang)
|
||||
{
|
||||
char buf[256];
|
||||
|
||||
push_lc_numeric("C");
|
||||
sprintf(buf, psrotate, ang);
|
||||
pop_lc_numeric();
|
||||
return PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
return PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteIndexColorSpaceBegin(PSDRV_PDEVICE *physDev, int size)
|
||||
BOOL PSDRV_WriteIndexColorSpaceBegin(PHYSDEV dev, int size)
|
||||
{
|
||||
char buf[256];
|
||||
sprintf(buf, "[/Indexed /DeviceRGB %d\n<\n", size);
|
||||
return PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
return PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteIndexColorSpaceEnd(PSDRV_PDEVICE *physDev)
|
||||
BOOL PSDRV_WriteIndexColorSpaceEnd(PHYSDEV dev)
|
||||
{
|
||||
static const char buf[] = ">\n] setcolorspace\n";
|
||||
return PSDRV_WriteSpool(physDev, buf, sizeof(buf) - 1);
|
||||
return PSDRV_WriteSpool(dev, buf, sizeof(buf) - 1);
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteRGB(PSDRV_PDEVICE *physDev, COLORREF *map, int number)
|
||||
BOOL PSDRV_WriteRGB(PHYSDEV dev, COLORREF *map, int number)
|
||||
{
|
||||
char *buf = HeapAlloc(PSDRV_Heap, 0, number * 7 + 1), *ptr;
|
||||
int i;
|
||||
|
@ -661,12 +667,12 @@ BOOL PSDRV_WriteRGB(PSDRV_PDEVICE *physDev, COLORREF *map, int number)
|
|||
((i & 0x7) == 0x7) || (i == number - 1) ? '\n' : ' ');
|
||||
ptr += 7;
|
||||
}
|
||||
PSDRV_WriteSpool(physDev, buf, number * 7);
|
||||
PSDRV_WriteSpool(dev, buf, number * 7);
|
||||
HeapFree(PSDRV_Heap, 0, buf);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL PSDRV_WriteImageDict(PSDRV_PDEVICE *physDev, WORD depth,
|
||||
static BOOL PSDRV_WriteImageDict(PHYSDEV dev, WORD depth,
|
||||
INT widthSrc, INT heightSrc, char *bits)
|
||||
{
|
||||
static const char start[] = "<<\n"
|
||||
|
@ -684,7 +690,7 @@ static BOOL PSDRV_WriteImageDict(PSDRV_PDEVICE *physDev, WORD depth,
|
|||
sprintf(buf, start, widthSrc, heightSrc,
|
||||
(depth < 8) ? depth : 8, widthSrc, -heightSrc, heightSrc);
|
||||
|
||||
PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
|
||||
switch(depth) {
|
||||
case 8:
|
||||
|
@ -704,20 +710,20 @@ static BOOL PSDRV_WriteImageDict(PSDRV_PDEVICE *physDev, WORD depth,
|
|||
break;
|
||||
}
|
||||
|
||||
PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
|
||||
if(!bits) {
|
||||
PSDRV_WriteSpool(physDev, end, sizeof(end) - 1);
|
||||
PSDRV_WriteSpool(dev, end, sizeof(end) - 1);
|
||||
} else {
|
||||
sprintf(buf, endbits, bits);
|
||||
PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
}
|
||||
|
||||
HeapFree(PSDRV_Heap, 0, buf);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteImage(PSDRV_PDEVICE *physDev, WORD depth, INT xDst, INT yDst,
|
||||
BOOL PSDRV_WriteImage(PHYSDEV dev, WORD depth, INT xDst, INT yDst,
|
||||
INT widthDst, INT heightDst, INT widthSrc,
|
||||
INT heightSrc, BOOL mask)
|
||||
{
|
||||
|
@ -727,17 +733,17 @@ BOOL PSDRV_WriteImage(PSDRV_PDEVICE *physDev, WORD depth, INT xDst, INT yDst,
|
|||
char buf[100];
|
||||
|
||||
sprintf(buf, start, xDst, yDst, widthDst, heightDst);
|
||||
PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
PSDRV_WriteImageDict(physDev, depth, widthSrc, heightSrc, NULL);
|
||||
PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
PSDRV_WriteImageDict(dev, depth, widthSrc, heightSrc, NULL);
|
||||
if(mask)
|
||||
PSDRV_WriteSpool(physDev, imagemask, sizeof(imagemask) - 1);
|
||||
PSDRV_WriteSpool(dev, imagemask, sizeof(imagemask) - 1);
|
||||
else
|
||||
PSDRV_WriteSpool(physDev, image, sizeof(image) - 1);
|
||||
PSDRV_WriteSpool(dev, image, sizeof(image) - 1);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
BOOL PSDRV_WriteBytes(PSDRV_PDEVICE *physDev, const BYTE *bytes, DWORD number)
|
||||
BOOL PSDRV_WriteBytes(PHYSDEV dev, const BYTE *bytes, DWORD number)
|
||||
{
|
||||
char *buf = HeapAlloc(PSDRV_Heap, 0, number * 3 + 1);
|
||||
char *ptr;
|
||||
|
@ -753,19 +759,19 @@ BOOL PSDRV_WriteBytes(PSDRV_PDEVICE *physDev, const BYTE *bytes, DWORD number)
|
|||
ptr++;
|
||||
}
|
||||
}
|
||||
PSDRV_WriteSpool(physDev, buf, ptr - buf);
|
||||
PSDRV_WriteSpool(dev, buf, ptr - buf);
|
||||
HeapFree(PSDRV_Heap, 0, buf);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteData(PSDRV_PDEVICE *physDev, const BYTE *data, DWORD number)
|
||||
BOOL PSDRV_WriteData(PHYSDEV dev, const BYTE *data, DWORD number)
|
||||
{
|
||||
int num, num_left = number;
|
||||
|
||||
do {
|
||||
num = min(num_left, 60);
|
||||
PSDRV_WriteSpool(physDev, (LPCSTR)data, num);
|
||||
PSDRV_WriteSpool(physDev, "\n", 1);
|
||||
PSDRV_WriteSpool(dev, (LPCSTR)data, num);
|
||||
PSDRV_WriteSpool(dev, "\n", 1);
|
||||
data += num;
|
||||
num_left -= num;
|
||||
} while(num_left);
|
||||
|
@ -773,45 +779,46 @@ BOOL PSDRV_WriteData(PSDRV_PDEVICE *physDev, const BYTE *data, DWORD number)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteArrayPut(PSDRV_PDEVICE *physDev, CHAR *pszArrayName, INT nIndex, LONG lObject)
|
||||
BOOL PSDRV_WriteArrayPut(PHYSDEV dev, CHAR *pszArrayName, INT nIndex, LONG lObject)
|
||||
{
|
||||
char buf[100];
|
||||
|
||||
sprintf(buf, psarrayput, pszArrayName, nIndex, lObject);
|
||||
return PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
return PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteArrayDef(PSDRV_PDEVICE *physDev, CHAR *pszArrayName, INT nSize)
|
||||
BOOL PSDRV_WriteArrayDef(PHYSDEV dev, CHAR *pszArrayName, INT nSize)
|
||||
{
|
||||
char buf[100];
|
||||
|
||||
sprintf(buf, psarraydef, pszArrayName, nSize);
|
||||
return PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
return PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteRectClip(PSDRV_PDEVICE *physDev, INT x, INT y, INT w, INT h)
|
||||
BOOL PSDRV_WriteRectClip(PHYSDEV dev, INT x, INT y, INT w, INT h)
|
||||
{
|
||||
char buf[100];
|
||||
|
||||
sprintf(buf, psrectclip, x, y, w, h);
|
||||
return PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
return PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteRectClip2(PSDRV_PDEVICE *physDev, CHAR *pszArrayName)
|
||||
BOOL PSDRV_WriteRectClip2(PHYSDEV dev, CHAR *pszArrayName)
|
||||
{
|
||||
char buf[100];
|
||||
|
||||
sprintf(buf, psrectclip2, pszArrayName);
|
||||
return PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
return PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
}
|
||||
|
||||
BOOL PSDRV_WritePatternDict(PSDRV_PDEVICE *physDev, BITMAP *bm, BYTE *bits)
|
||||
BOOL PSDRV_WritePatternDict(PHYSDEV dev, BITMAP *bm, BYTE *bits)
|
||||
{
|
||||
static const char mypat[] = "/mypat\n";
|
||||
static const char do_pattern[] = "<<\n /PaintType 1\n /PatternType 1\n /TilingType 1\n "
|
||||
"/BBox [0 0 %d %d]\n /XStep %d\n /YStep %d\n /PaintProc {\n begin\n 0 0 translate\n"
|
||||
" %d %d scale\n mypat image\n end\n }\n>>\n matrix makepattern setpattern\n";
|
||||
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
char *buf, *ptr;
|
||||
INT w, h, x, y, w_mult, h_mult;
|
||||
COLORREF map[2];
|
||||
|
@ -827,32 +834,33 @@ BOOL PSDRV_WritePatternDict(PSDRV_PDEVICE *physDev, BITMAP *bm, BYTE *bits)
|
|||
ptr += 2;
|
||||
}
|
||||
}
|
||||
PSDRV_WriteSpool(physDev, mypat, sizeof(mypat) - 1);
|
||||
PSDRV_WriteImageDict(physDev, 1, 8, 8, buf);
|
||||
PSDRV_WriteSpool(physDev, "def\n", 4);
|
||||
PSDRV_WriteSpool(dev, mypat, sizeof(mypat) - 1);
|
||||
PSDRV_WriteImageDict(dev, 1, 8, 8, buf);
|
||||
PSDRV_WriteSpool(dev, "def\n", 4);
|
||||
|
||||
PSDRV_WriteIndexColorSpaceBegin(physDev, 1);
|
||||
PSDRV_WriteIndexColorSpaceBegin(dev, 1);
|
||||
map[0] = GetTextColor( physDev->hdc );
|
||||
map[1] = GetBkColor( physDev->hdc );
|
||||
PSDRV_WriteRGB(physDev, map, 2);
|
||||
PSDRV_WriteIndexColorSpaceEnd(physDev);
|
||||
PSDRV_WriteRGB(dev, map, 2);
|
||||
PSDRV_WriteIndexColorSpaceEnd(dev);
|
||||
|
||||
/* Windows seems to scale patterns so that a one pixel corresponds to 1/300" */
|
||||
w_mult = (physDev->logPixelsX + 150) / 300;
|
||||
h_mult = (physDev->logPixelsY + 150) / 300;
|
||||
sprintf(buf, do_pattern, w * w_mult, h * h_mult, w * w_mult, h * h_mult, w * w_mult, h * h_mult);
|
||||
PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
|
||||
HeapFree(PSDRV_Heap, 0, buf);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteDIBPatternDict(PSDRV_PDEVICE *physDev, BITMAPINFO *bmi, UINT usage)
|
||||
BOOL PSDRV_WriteDIBPatternDict(PHYSDEV dev, BITMAPINFO *bmi, UINT usage)
|
||||
{
|
||||
static const char mypat[] = "/mypat\n";
|
||||
static const char do_pattern[] = "<<\n /PaintType 1\n /PatternType 1\n /TilingType 1\n "
|
||||
"/BBox [0 0 %d %d]\n /XStep %d\n /YStep %d\n /PaintProc {\n begin\n 0 0 translate\n"
|
||||
" %d %d scale\n mypat image\n end\n }\n>>\n matrix makepattern setpattern\n";
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
char *buf, *ptr;
|
||||
BYTE *bits;
|
||||
INT w, h, x, y, colours, w_mult, h_mult;
|
||||
|
@ -883,21 +891,21 @@ BOOL PSDRV_WriteDIBPatternDict(PSDRV_PDEVICE *physDev, BITMAPINFO *bmi, UINT usa
|
|||
ptr += 2;
|
||||
}
|
||||
}
|
||||
PSDRV_WriteSpool(physDev, mypat, sizeof(mypat) - 1);
|
||||
PSDRV_WriteImageDict(physDev, 1, 8, 8, buf);
|
||||
PSDRV_WriteSpool(physDev, "def\n", 4);
|
||||
PSDRV_WriteSpool(dev, mypat, sizeof(mypat) - 1);
|
||||
PSDRV_WriteImageDict(dev, 1, 8, 8, buf);
|
||||
PSDRV_WriteSpool(dev, "def\n", 4);
|
||||
|
||||
PSDRV_WriteIndexColorSpaceBegin(physDev, 1);
|
||||
map[0] = GetTextColor( physDev->hdc );
|
||||
map[1] = GetBkColor( physDev->hdc );
|
||||
PSDRV_WriteRGB(physDev, map, 2);
|
||||
PSDRV_WriteIndexColorSpaceEnd(physDev);
|
||||
PSDRV_WriteIndexColorSpaceBegin(dev, 1);
|
||||
map[0] = GetTextColor( dev->hdc );
|
||||
map[1] = GetBkColor( dev->hdc );
|
||||
PSDRV_WriteRGB(dev, map, 2);
|
||||
PSDRV_WriteIndexColorSpaceEnd(dev);
|
||||
|
||||
/* Windows seems to scale patterns so that a one pixel corresponds to 1/300" */
|
||||
w_mult = (physDev->logPixelsX + 150) / 300;
|
||||
h_mult = (physDev->logPixelsY + 150) / 300;
|
||||
sprintf(buf, do_pattern, w * w_mult, h * h_mult, w * w_mult, h * h_mult, w * w_mult, h * h_mult);
|
||||
PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
HeapFree(PSDRV_Heap, 0, buf);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -386,6 +386,10 @@ typedef struct {
|
|||
PSDRV_DEVMODEA *dlgdm;
|
||||
} PSDRV_DLGINFO;
|
||||
|
||||
static inline PSDRV_PDEVICE *get_psdrv_dev( PHYSDEV dev )
|
||||
{
|
||||
return (PSDRV_PDEVICE *)dev;
|
||||
}
|
||||
|
||||
/*
|
||||
* Every glyph name in the Adobe Glyph List and the 35 core PostScript fonts
|
||||
|
@ -419,66 +423,63 @@ extern BOOL PSDRV_AddAFMtoList(FONTFAMILY **head, const AFM *afm,
|
|||
BOOL *p_added) DECLSPEC_HIDDEN;
|
||||
extern void PSDRV_FreeAFMList( FONTFAMILY *head ) DECLSPEC_HIDDEN;
|
||||
|
||||
extern INT PSDRV_XWStoDS( PSDRV_PDEVICE *physDev, INT width ) DECLSPEC_HIDDEN;
|
||||
extern INT PSDRV_XWStoDS( PHYSDEV dev, INT width ) DECLSPEC_HIDDEN;
|
||||
|
||||
extern BOOL PSDRV_Brush(PSDRV_PDEVICE *physDev, BOOL EO) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_SetFont( PSDRV_PDEVICE *physDev ) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_SetPen( PSDRV_PDEVICE *physDev ) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_Brush(PHYSDEV dev, BOOL EO) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_SetFont( PHYSDEV dev ) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_SetPen( PHYSDEV dev ) DECLSPEC_HIDDEN;
|
||||
|
||||
extern void PSDRV_SetClip(PSDRV_PDEVICE* phyDev) DECLSPEC_HIDDEN;
|
||||
extern void PSDRV_ResetClip(PSDRV_PDEVICE* phyDev) DECLSPEC_HIDDEN;
|
||||
extern void PSDRV_SetClip( PHYSDEV dev ) DECLSPEC_HIDDEN;
|
||||
extern void PSDRV_ResetClip( PHYSDEV dev ) DECLSPEC_HIDDEN;
|
||||
|
||||
extern BOOL PSDRV_CopyColor(PSCOLOR *col1, PSCOLOR *col2) DECLSPEC_HIDDEN;
|
||||
extern void PSDRV_CreateColor( PSDRV_PDEVICE *physDev, PSCOLOR *pscolor,
|
||||
extern void PSDRV_CreateColor( PHYSDEV dev, PSCOLOR *pscolor,
|
||||
COLORREF wincolor ) DECLSPEC_HIDDEN;
|
||||
extern char PSDRV_UnicodeToANSI(int u) DECLSPEC_HIDDEN;
|
||||
|
||||
extern INT PSDRV_WriteHeader( PSDRV_PDEVICE *physDev, LPCSTR title ) DECLSPEC_HIDDEN;
|
||||
extern INT PSDRV_WriteFooter( PSDRV_PDEVICE *physDev ) DECLSPEC_HIDDEN;
|
||||
extern INT PSDRV_WriteNewPage( PSDRV_PDEVICE *physDev ) DECLSPEC_HIDDEN;
|
||||
extern INT PSDRV_WriteEndPage( PSDRV_PDEVICE *physDev ) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteMoveTo(PSDRV_PDEVICE *physDev, INT x, INT y) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteLineTo(PSDRV_PDEVICE *physDev, INT x, INT y) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteStroke(PSDRV_PDEVICE *physDev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteRectangle(PSDRV_PDEVICE *physDev, INT x, INT y, INT width,
|
||||
INT height) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteRRectangle(PSDRV_PDEVICE *physDev, INT x, INT y, INT width,
|
||||
INT height) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteSetFont(PSDRV_PDEVICE *physDev, const char *name, matrix size,
|
||||
INT escapement) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteGlyphShow(PSDRV_PDEVICE *physDev, LPCSTR g_name) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteSetPen(PSDRV_PDEVICE *physDev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteArc(PSDRV_PDEVICE *physDev, INT x, INT y, INT w, INT h,
|
||||
extern INT PSDRV_WriteHeader( PHYSDEV dev, LPCSTR title ) DECLSPEC_HIDDEN;
|
||||
extern INT PSDRV_WriteFooter( PHYSDEV dev ) DECLSPEC_HIDDEN;
|
||||
extern INT PSDRV_WriteNewPage( PHYSDEV dev ) DECLSPEC_HIDDEN;
|
||||
extern INT PSDRV_WriteEndPage( PHYSDEV dev ) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteMoveTo(PHYSDEV dev, INT x, INT y) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteLineTo(PHYSDEV dev, INT x, INT y) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteStroke(PHYSDEV dev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteRectangle(PHYSDEV dev, INT x, INT y, INT width, INT height) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteRRectangle(PHYSDEV dev, INT x, INT y, INT width, INT height) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteSetFont(PHYSDEV dev, const char *name, matrix size, INT escapement) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteGlyphShow(PHYSDEV dev, LPCSTR g_name) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteSetPen(PHYSDEV dev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteArc(PHYSDEV dev, INT x, INT y, INT w, INT h,
|
||||
double ang1, double ang2) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteSetColor(PSDRV_PDEVICE *physDev, PSCOLOR *color) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteSetBrush(PSDRV_PDEVICE *physDev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteFill(PSDRV_PDEVICE *physDev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteEOFill(PSDRV_PDEVICE *physDev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteGSave(PSDRV_PDEVICE *physDev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteGRestore(PSDRV_PDEVICE *physDev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteNewPath(PSDRV_PDEVICE *physDev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteClosePath(PSDRV_PDEVICE *physDev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteClip(PSDRV_PDEVICE *physDev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteRectClip(PSDRV_PDEVICE *physDev, INT x, INT y, INT w, INT h) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteRectClip2(PSDRV_PDEVICE *physDev, CHAR *pszArrayName) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteEOClip(PSDRV_PDEVICE *physDev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteHatch(PSDRV_PDEVICE *physDev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteRotate(PSDRV_PDEVICE *physDev, float ang) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteIndexColorSpaceBegin(PSDRV_PDEVICE *physDev, int size) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteIndexColorSpaceEnd(PSDRV_PDEVICE *physDev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteRGB(PSDRV_PDEVICE *physDev, COLORREF *map, int number) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteImage(PSDRV_PDEVICE *physDev, WORD depth, INT xDst, INT yDst,
|
||||
extern BOOL PSDRV_WriteSetColor(PHYSDEV dev, PSCOLOR *color) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteSetBrush(PHYSDEV dev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteFill(PHYSDEV dev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteEOFill(PHYSDEV dev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteGSave(PHYSDEV dev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteGRestore(PHYSDEV dev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteNewPath(PHYSDEV dev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteClosePath(PHYSDEV dev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteClip(PHYSDEV dev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteRectClip(PHYSDEV dev, INT x, INT y, INT w, INT h) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteRectClip2(PHYSDEV dev, CHAR *pszArrayName) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteEOClip(PHYSDEV dev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteHatch(PHYSDEV dev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteRotate(PHYSDEV dev, float ang) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteIndexColorSpaceBegin(PHYSDEV dev, int size) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteIndexColorSpaceEnd(PHYSDEV dev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteRGB(PHYSDEV dev, COLORREF *map, int number) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteImage(PHYSDEV dev, WORD depth, INT xDst, INT yDst,
|
||||
INT widthDst, INT heightDst, INT widthSrc,
|
||||
INT heightSrc, BOOL mask) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteBytes(PSDRV_PDEVICE *physDev, const BYTE *bytes, DWORD number) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteData(PSDRV_PDEVICE *physDev, const BYTE *byte, DWORD number) DECLSPEC_HIDDEN;
|
||||
extern DWORD PSDRV_WriteSpool(PSDRV_PDEVICE *physDev, LPCSTR lpData, DWORD cch) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WritePatternDict(PSDRV_PDEVICE *physDev, BITMAP *bm, BYTE *bits) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteDIBPatternDict(PSDRV_PDEVICE *physDev, BITMAPINFO *bmi, UINT usage) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteArrayPut(PSDRV_PDEVICE *physDev, CHAR *pszArrayName, INT nIndex, LONG lCoord) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteArrayDef(PSDRV_PDEVICE *physDev, CHAR *pszArrayName, INT nSize) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteBytes(PHYSDEV dev, const BYTE *bytes, DWORD number) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteData(PHYSDEV dev, const BYTE *byte, DWORD number) DECLSPEC_HIDDEN;
|
||||
extern DWORD PSDRV_WriteSpool(PHYSDEV dev, LPCSTR lpData, DWORD cch) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WritePatternDict(PHYSDEV dev, BITMAP *bm, BYTE *bits) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteDIBPatternDict(PHYSDEV dev, BITMAPINFO *bmi, UINT usage) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteArrayPut(PHYSDEV dev, CHAR *pszArrayName, INT nIndex, LONG lCoord) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteArrayDef(PHYSDEV dev, CHAR *pszArrayName, INT nSize) DECLSPEC_HIDDEN;
|
||||
|
||||
extern INT CDECL PSDRV_StartPage( PSDRV_PDEVICE *physDev ) DECLSPEC_HIDDEN;
|
||||
extern INT CDECL PSDRV_StartPage( PHYSDEV dev ) DECLSPEC_HIDDEN;
|
||||
|
||||
INT PSDRV_GlyphListInit(void) DECLSPEC_HIDDEN;
|
||||
const GLYPHNAME *PSDRV_GlyphName(LPCSTR szName) DECLSPEC_HIDDEN;
|
||||
|
@ -488,31 +489,30 @@ BOOL PSDRV_GetType1Metrics(void) DECLSPEC_HIDDEN;
|
|||
const AFMMETRICS *PSDRV_UVMetrics(LONG UV, const AFM *afm) DECLSPEC_HIDDEN;
|
||||
SHORT PSDRV_CalcAvgCharWidth(const AFM *afm) DECLSPEC_HIDDEN;
|
||||
|
||||
extern BOOL PSDRV_SelectBuiltinFont(PSDRV_PDEVICE *physDev, HFONT hfont,
|
||||
extern BOOL PSDRV_SelectBuiltinFont(PHYSDEV dev, HFONT hfont,
|
||||
LOGFONTW *plf, LPSTR FaceName) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteSetBuiltinFont(PSDRV_PDEVICE *physDev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteBuiltinGlyphShow(PSDRV_PDEVICE *physDev, LPCWSTR str, INT count) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteSetBuiltinFont(PHYSDEV dev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteBuiltinGlyphShow(PHYSDEV dev, LPCWSTR str, INT count) DECLSPEC_HIDDEN;
|
||||
|
||||
extern BOOL PSDRV_SelectDownloadFont(PSDRV_PDEVICE *physDev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteSetDownloadFont(PSDRV_PDEVICE *physDev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteDownloadGlyphShow(PSDRV_PDEVICE *physDev, WORD *glpyhs,
|
||||
UINT count) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_EmptyDownloadList(PSDRV_PDEVICE *physDev, BOOL write_undef) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_SelectDownloadFont(PHYSDEV dev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteSetDownloadFont(PHYSDEV dev) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_WriteDownloadGlyphShow(PHYSDEV dev, WORD *glpyhs, UINT count) DECLSPEC_HIDDEN;
|
||||
extern BOOL PSDRV_EmptyDownloadList(PHYSDEV dev, BOOL write_undef) DECLSPEC_HIDDEN;
|
||||
|
||||
extern DWORD write_spool( PSDRV_PDEVICE *physDev, const void *data, DWORD num ) DECLSPEC_HIDDEN;
|
||||
extern DWORD write_spool( PHYSDEV dev, const void *data, DWORD num ) DECLSPEC_HIDDEN;
|
||||
|
||||
#define MAX_G_NAME 31 /* max length of PS glyph name */
|
||||
extern void get_glyph_name(HDC hdc, WORD index, char *name) DECLSPEC_HIDDEN;
|
||||
|
||||
extern TYPE1 *T1_download_header(PSDRV_PDEVICE *physDev, char *ps_name,
|
||||
extern TYPE1 *T1_download_header(PHYSDEV dev, char *ps_name,
|
||||
RECT *bbox, UINT emsize) DECLSPEC_HIDDEN;
|
||||
extern BOOL T1_download_glyph(PSDRV_PDEVICE *physDev, DOWNLOAD *pdl,
|
||||
extern BOOL T1_download_glyph(PHYSDEV dev, DOWNLOAD *pdl,
|
||||
DWORD index, char *glyph_name) DECLSPEC_HIDDEN;
|
||||
extern void T1_free(TYPE1 *t1) DECLSPEC_HIDDEN;
|
||||
|
||||
extern TYPE42 *T42_download_header(PSDRV_PDEVICE *physDev, char *ps_name,
|
||||
extern TYPE42 *T42_download_header(PHYSDEV dev, char *ps_name,
|
||||
RECT *bbox, UINT emsize) DECLSPEC_HIDDEN;
|
||||
extern BOOL T42_download_glyph(PSDRV_PDEVICE *physDev, DOWNLOAD *pdl,
|
||||
extern BOOL T42_download_glyph(PHYSDEV dev, DOWNLOAD *pdl,
|
||||
DWORD index, char *glyph_name) DECLSPEC_HIDDEN;
|
||||
extern void T42_free(TYPE42 *t42) DECLSPEC_HIDDEN;
|
||||
|
||||
|
|
|
@ -29,17 +29,18 @@
|
|||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
|
||||
|
||||
static BOOL PSDRV_Text(PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags,
|
||||
static BOOL PSDRV_Text(PHYSDEV dev, INT x, INT y, UINT flags,
|
||||
LPCWSTR str, UINT count,
|
||||
BOOL bDrawBackground, const INT *lpDx);
|
||||
|
||||
/***********************************************************************
|
||||
* PSDRV_ExtTextOut
|
||||
*/
|
||||
BOOL CDECL PSDRV_ExtTextOut( PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags,
|
||||
BOOL CDECL 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;
|
||||
|
@ -50,50 +51,51 @@ BOOL CDECL PSDRV_ExtTextOut( PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags,
|
|||
if(physDev->job.id == 0) return FALSE;
|
||||
|
||||
/* write font if not already written */
|
||||
PSDRV_SetFont(physDev);
|
||||
PSDRV_SetFont(dev);
|
||||
|
||||
PSDRV_SetClip(physDev);
|
||||
PSDRV_SetClip(dev);
|
||||
|
||||
/* set clipping and/or draw background */
|
||||
if ((flags & (ETO_CLIPPED | ETO_OPAQUE)) && (lprect != NULL))
|
||||
{
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_WriteRectangle(physDev, lprect->left, lprect->top, lprect->right - lprect->left,
|
||||
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(physDev);
|
||||
PSDRV_WriteSetColor(physDev, &physDev->bkColor);
|
||||
PSDRV_WriteFill(physDev);
|
||||
PSDRV_WriteGRestore(physDev);
|
||||
PSDRV_WriteGSave(dev);
|
||||
PSDRV_WriteSetColor(dev, &physDev->bkColor);
|
||||
PSDRV_WriteFill(dev);
|
||||
PSDRV_WriteGRestore(dev);
|
||||
}
|
||||
|
||||
if (flags & ETO_CLIPPED)
|
||||
{
|
||||
bClipped = TRUE;
|
||||
PSDRV_WriteClip(physDev);
|
||||
PSDRV_WriteClip(dev);
|
||||
}
|
||||
|
||||
bResult = PSDRV_Text(physDev, x, y, flags, str, count, !(bClipped && bOpaque), lpDx);
|
||||
PSDRV_WriteGRestore(physDev);
|
||||
bResult = PSDRV_Text(dev, x, y, flags, str, count, !(bClipped && bOpaque), lpDx);
|
||||
PSDRV_WriteGRestore(dev);
|
||||
}
|
||||
else
|
||||
{
|
||||
bResult = PSDRV_Text(physDev, x, y, flags, str, count, TRUE, lpDx);
|
||||
bResult = PSDRV_Text(dev, x, y, flags, str, count, TRUE, lpDx);
|
||||
}
|
||||
|
||||
PSDRV_ResetClip(physDev);
|
||||
PSDRV_ResetClip(dev);
|
||||
return bResult;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* PSDRV_Text
|
||||
*/
|
||||
static BOOL PSDRV_Text(PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags, LPCWSTR str,
|
||||
static BOOL PSDRV_Text(PHYSDEV dev, INT x, INT y, UINT flags, LPCWSTR str,
|
||||
UINT count, BOOL bDrawBackground, const INT *lpDx)
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
|
||||
WORD *glyphs = NULL;
|
||||
|
||||
if (!count)
|
||||
|
@ -102,13 +104,13 @@ static BOOL PSDRV_Text(PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags, LPCWSTR
|
|||
if(physDev->font.fontloc == Download)
|
||||
glyphs = (LPWORD)str;
|
||||
|
||||
PSDRV_WriteMoveTo(physDev, x, y);
|
||||
PSDRV_WriteMoveTo(dev, x, y);
|
||||
|
||||
if(!lpDx) {
|
||||
if(physDev->font.fontloc == Download)
|
||||
PSDRV_WriteDownloadGlyphShow(physDev, glyphs, count);
|
||||
PSDRV_WriteDownloadGlyphShow(dev, glyphs, count);
|
||||
else
|
||||
PSDRV_WriteBuiltinGlyphShow(physDev, str, count);
|
||||
PSDRV_WriteBuiltinGlyphShow(dev, str, count);
|
||||
}
|
||||
else {
|
||||
UINT i;
|
||||
|
@ -116,9 +118,9 @@ static BOOL PSDRV_Text(PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags, LPCWSTR
|
|||
|
||||
for(i = 0; i < count-1; i++) {
|
||||
if(physDev->font.fontloc == Download)
|
||||
PSDRV_WriteDownloadGlyphShow(physDev, glyphs + i, 1);
|
||||
PSDRV_WriteDownloadGlyphShow(dev, glyphs + i, 1);
|
||||
else
|
||||
PSDRV_WriteBuiltinGlyphShow(physDev, str + i, 1);
|
||||
PSDRV_WriteBuiltinGlyphShow(dev, str + i, 1);
|
||||
if(flags & ETO_PDY)
|
||||
{
|
||||
offset.x += lpDx[i * 2];
|
||||
|
@ -126,12 +128,12 @@ static BOOL PSDRV_Text(PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags, LPCWSTR
|
|||
}
|
||||
else
|
||||
offset.x += lpDx[i];
|
||||
PSDRV_WriteMoveTo(physDev, x + offset.x, y + offset.y);
|
||||
PSDRV_WriteMoveTo(dev, x + offset.x, y + offset.y);
|
||||
}
|
||||
if(physDev->font.fontloc == Download)
|
||||
PSDRV_WriteDownloadGlyphShow(physDev, glyphs + i, 1);
|
||||
PSDRV_WriteDownloadGlyphShow(dev, glyphs + i, 1);
|
||||
else
|
||||
PSDRV_WriteBuiltinGlyphShow(physDev, str + i, 1);
|
||||
PSDRV_WriteBuiltinGlyphShow(dev, str + i, 1);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
|
|
@ -70,7 +70,7 @@ static inline WORD get_be_word(const void *p) { return RtlUshortByteSwap(*(WOR
|
|||
static inline DWORD get_be_dword(const void *p) { return RtlUlongByteSwap(*(DWORD*)p); }
|
||||
#endif
|
||||
|
||||
TYPE1 *T1_download_header(PSDRV_PDEVICE *physDev, char *ps_name, RECT *bbox, UINT emsize)
|
||||
TYPE1 *T1_download_header(PHYSDEV dev, char *ps_name, RECT *bbox, UINT emsize)
|
||||
{
|
||||
char *buf;
|
||||
TYPE1 *t1;
|
||||
|
@ -113,7 +113,7 @@ TYPE1 *T1_download_header(PSDRV_PDEVICE *physDev, char *ps_name, RECT *bbox, UIN
|
|||
sprintf(buf, dict, ps_name, t1->emsize, t1->emsize,
|
||||
bbox->left, bbox->bottom, bbox->right, bbox->top);
|
||||
|
||||
PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, buf);
|
||||
return t1;
|
||||
|
@ -512,8 +512,7 @@ static inline BOOL on_point(const glyph_outline *outline, WORD pt)
|
|||
return outline->flags[pt] & 1;
|
||||
}
|
||||
|
||||
BOOL T1_download_glyph(PSDRV_PDEVICE *physDev, DOWNLOAD *pdl, DWORD index,
|
||||
char *glyph_name)
|
||||
BOOL T1_download_glyph(PHYSDEV dev, DOWNLOAD *pdl, DWORD index, char *glyph_name)
|
||||
{
|
||||
DWORD len;
|
||||
WORD cur_pt, cont;
|
||||
|
@ -551,9 +550,9 @@ BOOL T1_download_glyph(PSDRV_PDEVICE *physDev, DOWNLOAD *pdl, DWORD index,
|
|||
outline.flags = NULL;
|
||||
outline.end_pts = NULL;
|
||||
outline.pts = NULL;
|
||||
get_hmetrics(physDev->hdc, index, &outline.lsb, &outline.advance);
|
||||
get_hmetrics(dev->hdc, index, &outline.lsb, &outline.advance);
|
||||
|
||||
if(!append_glyph_outline(physDev->hdc, index, &outline)) return FALSE;
|
||||
if(!append_glyph_outline(dev->hdc, index, &outline)) return FALSE;
|
||||
|
||||
charstring = str_init(100);
|
||||
curpos.x = outline.lsb;
|
||||
|
@ -633,14 +632,14 @@ BOOL T1_download_glyph(PSDRV_PDEVICE *physDev, DOWNLOAD *pdl, DWORD index,
|
|||
strlen(pdl->ps_name) + strlen(glyph_name) + 100);
|
||||
|
||||
sprintf(buf, "%%%%glyph %04x\n", index);
|
||||
PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
|
||||
len = str_get_bytes(charstring, &bytes);
|
||||
sprintf(buf, glyph_def_begin, pdl->ps_name, glyph_name, len);
|
||||
PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
PSDRV_WriteBytes(physDev, bytes, len);
|
||||
PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
PSDRV_WriteBytes(dev, bytes, len);
|
||||
sprintf(buf, glyph_def_end);
|
||||
PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
str_free(charstring);
|
||||
|
||||
t1->glyph_sent[index] = TRUE;
|
||||
|
|
|
@ -134,7 +134,7 @@ static BOOL get_glyf_pos(TYPE42 *t42, DWORD index, DWORD *start, DWORD *end)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
TYPE42 *T42_download_header(PSDRV_PDEVICE *physDev, char *ps_name,
|
||||
TYPE42 *T42_download_header(PHYSDEV dev, char *ps_name,
|
||||
RECT *bbox, UINT emsize)
|
||||
{
|
||||
DWORD i, j, tablepos, nb_blocks, glyf_off = 0, loca_off = 0, cur_off;
|
||||
|
@ -173,7 +173,7 @@ TYPE42 *T42_download_header(PSDRV_PDEVICE *physDev, char *ps_name,
|
|||
t42->num_of_written_tables = 0;
|
||||
|
||||
for(i = 0; i < num_of_tables; i++) {
|
||||
LoadTable(physDev->hdc, t42->tables + i);
|
||||
LoadTable(dev->hdc, t42->tables + i);
|
||||
if(t42->tables[i].len > 0xffff && t42->tables[i].write) break;
|
||||
if(t42->tables[i].write) t42->num_of_written_tables++;
|
||||
if(t42->tables[i].MS_tag == MS_MAKE_TAG('l','o','c','a'))
|
||||
|
@ -207,13 +207,13 @@ TYPE42 *T42_download_header(PSDRV_PDEVICE *physDev, char *ps_name,
|
|||
(float)bbox->right / emsize, (float)bbox->top / emsize);
|
||||
pop_lc_numeric();
|
||||
|
||||
PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
|
||||
t42->num_of_written_tables++; /* explicitly add glyf */
|
||||
sprintf(buf, TT_offset_table, t42->num_of_written_tables,
|
||||
t42->num_of_written_tables, t42->num_of_written_tables, t42->num_of_written_tables);
|
||||
|
||||
PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
|
||||
tablepos = 12 + t42->num_of_written_tables * 16;
|
||||
cur_off = 12;
|
||||
|
@ -222,7 +222,7 @@ TYPE42 *T42_download_header(PSDRV_PDEVICE *physDev, char *ps_name,
|
|||
sprintf(buf, TT_table_dir_entry, FLIP_ORDER(t42->tables[i].MS_tag),
|
||||
t42->tables[i].check, t42->tables[i].len ? tablepos : 0,
|
||||
t42->tables[i].len);
|
||||
PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
tablepos += ((t42->tables[i].len + 3) & ~3);
|
||||
if(t42->tables[i].MS_tag == MS_MAKE_TAG('l','o','c','a'))
|
||||
loca_off = cur_off;
|
||||
|
@ -230,19 +230,19 @@ TYPE42 *T42_download_header(PSDRV_PDEVICE *physDev, char *ps_name,
|
|||
}
|
||||
sprintf(buf, TT_table_dir_entry, FLIP_ORDER(t42->tables[t42->glyf_tab].MS_tag),
|
||||
t42->tables[t42->glyf_tab].check, tablepos, t42->tables[t42->glyf_tab].len);
|
||||
PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
PSDRV_WriteSpool(physDev, "00>\n", 4); /* add an extra byte for old PostScript rips */
|
||||
PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
PSDRV_WriteSpool(dev, "00>\n", 4); /* add an extra byte for old PostScript rips */
|
||||
glyf_off = cur_off;
|
||||
|
||||
for(i = 0; i < num_of_tables; i++) {
|
||||
if(t42->tables[i].len == 0 || !t42->tables[i].write) continue;
|
||||
PSDRV_WriteSpool(physDev, "<", 1);
|
||||
PSDRV_WriteSpool(dev, "<", 1);
|
||||
for(j = 0; j < ((t42->tables[i].len + 3) & ~3); j++) {
|
||||
sprintf(buf, "%02x", t42->tables[i].data[j]);
|
||||
PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
if(j % 16 == 15) PSDRV_WriteSpool(physDev, "\n", 1);
|
||||
PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
if(j % 16 == 15) PSDRV_WriteSpool(dev, "\n", 1);
|
||||
}
|
||||
PSDRV_WriteSpool(physDev, "00>\n", 4); /* add an extra byte for old PostScript rips */
|
||||
PSDRV_WriteSpool(dev, "00>\n", 4); /* add an extra byte for old PostScript rips */
|
||||
}
|
||||
|
||||
/* glyf_blocks is a 0 terminated list, holding the start offset of each block. For simplicity
|
||||
|
@ -261,17 +261,17 @@ TYPE42 *T42_download_header(PSDRV_PDEVICE *physDev, char *ps_name,
|
|||
t42->glyf_blocks[nb_blocks-1] = end;
|
||||
}
|
||||
|
||||
PSDRV_WriteSpool(physDev, "[ ", 2);
|
||||
PSDRV_WriteSpool(dev, "[ ", 2);
|
||||
for(i = 1; t42->glyf_blocks[i]; i++) {
|
||||
sprintf(buf,"%d ", t42->glyf_blocks[i] - t42->glyf_blocks[i-1] + 1);
|
||||
/* again add one byte for old PostScript rips */
|
||||
PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
if(i % 8 == 0)
|
||||
PSDRV_WriteSpool(physDev, "\n", 1);
|
||||
PSDRV_WriteSpool(dev, "\n", 1);
|
||||
}
|
||||
PSDRV_WriteSpool(physDev, storage, sizeof(storage) - 1);
|
||||
PSDRV_WriteSpool(dev, storage, sizeof(storage) - 1);
|
||||
sprintf(buf, end, loca_off, glyf_off);
|
||||
PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
HeapFree(GetProcessHeap(), 0, buf);
|
||||
return t42;
|
||||
}
|
||||
|
@ -279,7 +279,7 @@ TYPE42 *T42_download_header(PSDRV_PDEVICE *physDev, char *ps_name,
|
|||
|
||||
|
||||
|
||||
BOOL T42_download_glyph(PSDRV_PDEVICE *physDev, DOWNLOAD *pdl, DWORD index,
|
||||
BOOL T42_download_glyph(PHYSDEV dev, DOWNLOAD *pdl, DWORD index,
|
||||
char *glyph_name)
|
||||
{
|
||||
DWORD start, end, i;
|
||||
|
@ -326,8 +326,8 @@ BOOL T42_download_glyph(PSDRV_PDEVICE *physDev, DOWNLOAD *pdl, DWORD index,
|
|||
sg_index = GET_BE_WORD(sg_start + 2);
|
||||
|
||||
TRACE("Sending subglyph %04x for glyph %04x\n", sg_index, index);
|
||||
get_glyph_name(physDev->hdc, sg_index, sg_name);
|
||||
T42_download_glyph(physDev, pdl, sg_index, sg_name);
|
||||
get_glyph_name(dev->hdc, sg_index, sg_name);
|
||||
T42_download_glyph(dev, pdl, sg_index, sg_name);
|
||||
sg_start += 4;
|
||||
if(sg_flags & ARG_1_AND_2_ARE_WORDS)
|
||||
sg_start += 4;
|
||||
|
@ -351,18 +351,18 @@ BOOL T42_download_glyph(PSDRV_PDEVICE *physDev, DOWNLOAD *pdl, DWORD index,
|
|||
/* we don't have a string for the gdir and glyf tables, but we do have a
|
||||
string for the TT header. So the offset we need is tables - 2 */
|
||||
sprintf(buf, "%d %d\n", t42->num_of_written_tables - 2 + i, start - t42->glyf_blocks[i-1]);
|
||||
PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
|
||||
PSDRV_WriteSpool(physDev, "<", 1);
|
||||
PSDRV_WriteSpool(dev, "<", 1);
|
||||
for(i = start; i < end; i++) {
|
||||
sprintf(buf, "%02x", *(t42->tables[t42->glyf_tab].data + i));
|
||||
PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
if((i - start) % 16 == 15)
|
||||
PSDRV_WriteSpool(physDev, "\n", 1);
|
||||
PSDRV_WriteSpool(dev, "\n", 1);
|
||||
}
|
||||
PSDRV_WriteSpool(physDev, ">\n", 2);
|
||||
PSDRV_WriteSpool(dev, ">\n", 2);
|
||||
sprintf(buf, glyph_def, pdl->ps_name, index, glyph_name, index);
|
||||
PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
PSDRV_WriteSpool(dev, buf, strlen(buf));
|
||||
|
||||
t42->glyph_sent[index] = TRUE;
|
||||
HeapFree(GetProcessHeap(), 0, buf);
|
||||
|
|
Loading…
Reference in New Issue