Commit 10dcba49 authored by Alexandre Julliard's avatar Alexandre Julliard

wineps.drv: Pass a generic PHYSDEV to all graphics functions.

parent ba2a6ee9
...@@ -28,7 +28,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv); ...@@ -28,7 +28,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
* *
* PSDRV_PatBlt * 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]; POINT pt[2];
...@@ -36,16 +36,16 @@ BOOL CDECL PSDRV_PatBlt(PSDRV_PDEVICE *physDev, INT x, INT y, INT width, INT hei ...@@ -36,16 +36,16 @@ BOOL CDECL PSDRV_PatBlt(PSDRV_PDEVICE *physDev, INT x, INT y, INT width, INT hei
pt[0].y = y; pt[0].y = y;
pt[1].x = x + width; pt[1].x = x + width;
pt[1].y = y + height; pt[1].y = y + height;
LPtoDP( physDev->hdc, pt, 2 ); LPtoDP( dev->hdc, pt, 2 );
switch(dwRop) { switch(dwRop) {
case PATCOPY: case PATCOPY:
PSDRV_SetClip(physDev); PSDRV_SetClip(dev);
PSDRV_WriteGSave(physDev); PSDRV_WriteGSave(dev);
PSDRV_WriteRectangle(physDev, pt[0].x, pt[0].y, pt[1].x - pt[0].x, pt[1].y - pt[0].y ); PSDRV_WriteRectangle(dev, pt[0].x, pt[0].y, pt[1].x - pt[0].x, pt[1].y - pt[0].y );
PSDRV_Brush(physDev, FALSE); PSDRV_Brush(dev, FALSE);
PSDRV_WriteGRestore(physDev); PSDRV_WriteGRestore(dev);
PSDRV_ResetClip(physDev); PSDRV_ResetClip(dev);
return TRUE; return TRUE;
case BLACKNESS: case BLACKNESS:
...@@ -53,15 +53,14 @@ BOOL CDECL PSDRV_PatBlt(PSDRV_PDEVICE *physDev, INT x, INT y, INT width, INT hei ...@@ -53,15 +53,14 @@ BOOL CDECL PSDRV_PatBlt(PSDRV_PDEVICE *physDev, INT x, INT y, INT width, INT hei
{ {
PSCOLOR pscol; PSCOLOR pscol;
PSDRV_SetClip(physDev); PSDRV_SetClip(dev);
PSDRV_WriteGSave(physDev); PSDRV_WriteGSave(dev);
PSDRV_WriteRectangle(physDev, pt[0].x, pt[0].y, pt[1].x - pt[0].x, pt[1].y - pt[0].y ); PSDRV_WriteRectangle(dev, pt[0].x, pt[0].y, pt[1].x - pt[0].x, pt[1].y - pt[0].y );
PSDRV_CreateColor( physDev, &pscol, (dwRop == BLACKNESS) ? PSDRV_CreateColor( dev, &pscol, (dwRop == BLACKNESS) ? RGB(0,0,0) : RGB(0xff,0xff,0xff) );
RGB(0,0,0) : RGB(0xff,0xff,0xff) ); PSDRV_WriteSetColor(dev, &pscol);
PSDRV_WriteSetColor(physDev, &pscol); PSDRV_WriteFill(dev);
PSDRV_WriteFill(physDev); PSDRV_WriteGRestore(dev);
PSDRV_WriteGRestore(physDev); PSDRV_ResetClip(dev);
PSDRV_ResetClip(physDev);
return TRUE; return TRUE;
} }
default: default:
......
...@@ -90,7 +90,7 @@ static BOOL get_bitmap_info( const void *ptr, LONG *width, LONG *height, WORD *b ...@@ -90,7 +90,7 @@ static BOOL get_bitmap_info( const void *ptr, LONG *width, LONG *height, WORD *b
* Uses level 2 PostScript * 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 yDst, INT widthDst, INT heightDst,
INT widthSrc, INT heightSrc) INT widthSrc, INT heightSrc)
{ {
...@@ -99,36 +99,36 @@ static BOOL PSDRV_WriteImageHeader(PSDRV_PDEVICE *physDev, const BITMAPINFO *inf ...@@ -99,36 +99,36 @@ static BOOL PSDRV_WriteImageHeader(PSDRV_PDEVICE *physDev, const BITMAPINFO *inf
switch(info->bmiHeader.biBitCount) { switch(info->bmiHeader.biBitCount) {
case 8: case 8:
PSDRV_WriteIndexColorSpaceBegin(physDev, 255); PSDRV_WriteIndexColorSpaceBegin(dev, 255);
for(i = 0; i < 256; i++) { for(i = 0; i < 256; i++) {
map[i] = info->bmiColors[i].rgbRed | map[i] = info->bmiColors[i].rgbRed |
info->bmiColors[i].rgbGreen << 8 | info->bmiColors[i].rgbGreen << 8 |
info->bmiColors[i].rgbBlue << 16; info->bmiColors[i].rgbBlue << 16;
} }
PSDRV_WriteRGB(physDev, map, 256); PSDRV_WriteRGB(dev, map, 256);
PSDRV_WriteIndexColorSpaceEnd(physDev); PSDRV_WriteIndexColorSpaceEnd(dev);
break; break;
case 4: case 4:
PSDRV_WriteIndexColorSpaceBegin(physDev, 15); PSDRV_WriteIndexColorSpaceBegin(dev, 15);
for(i = 0; i < 16; i++) { for(i = 0; i < 16; i++) {
map[i] = info->bmiColors[i].rgbRed | map[i] = info->bmiColors[i].rgbRed |
info->bmiColors[i].rgbGreen << 8 | info->bmiColors[i].rgbGreen << 8 |
info->bmiColors[i].rgbBlue << 16; info->bmiColors[i].rgbBlue << 16;
} }
PSDRV_WriteRGB(physDev, map, 16); PSDRV_WriteRGB(dev, map, 16);
PSDRV_WriteIndexColorSpaceEnd(physDev); PSDRV_WriteIndexColorSpaceEnd(dev);
break; break;
case 1: case 1:
PSDRV_WriteIndexColorSpaceBegin(physDev, 1); PSDRV_WriteIndexColorSpaceBegin(dev, 1);
for(i = 0; i < 2; i++) { for(i = 0; i < 2; i++) {
map[i] = info->bmiColors[i].rgbRed | map[i] = info->bmiColors[i].rgbRed |
info->bmiColors[i].rgbGreen << 8 | info->bmiColors[i].rgbGreen << 8 |
info->bmiColors[i].rgbBlue << 16; info->bmiColors[i].rgbBlue << 16;
} }
PSDRV_WriteRGB(physDev, map, 2); PSDRV_WriteRGB(dev, map, 2);
PSDRV_WriteIndexColorSpaceEnd(physDev); PSDRV_WriteIndexColorSpaceEnd(dev);
break; break;
case 15: case 15:
...@@ -139,7 +139,7 @@ static BOOL PSDRV_WriteImageHeader(PSDRV_PDEVICE *physDev, const BITMAPINFO *inf ...@@ -139,7 +139,7 @@ static BOOL PSDRV_WriteImageHeader(PSDRV_PDEVICE *physDev, const BITMAPINFO *inf
PSCOLOR pscol; PSCOLOR pscol;
pscol.type = PSCOLOR_RGB; pscol.type = PSCOLOR_RGB;
pscol.value.rgb.r = pscol.value.rgb.g = pscol.value.rgb.b = 0.0; pscol.value.rgb.r = pscol.value.rgb.g = pscol.value.rgb.b = 0.0;
PSDRV_WriteSetColor(physDev, &pscol); PSDRV_WriteSetColor(dev, &pscol);
break; break;
} }
...@@ -148,7 +148,7 @@ static BOOL PSDRV_WriteImageHeader(PSDRV_PDEVICE *physDev, const BITMAPINFO *inf ...@@ -148,7 +148,7 @@ static BOOL PSDRV_WriteImageHeader(PSDRV_PDEVICE *physDev, const BITMAPINFO *inf
return FALSE; return FALSE;
} }
PSDRV_WriteImage(physDev, info->bmiHeader.biBitCount, xDst, yDst, PSDRV_WriteImage(dev, info->bmiHeader.biBitCount, xDst, yDst,
widthDst, heightDst, widthSrc, heightSrc, FALSE); widthDst, heightDst, widthSrc, heightSrc, FALSE);
return TRUE; return TRUE;
} }
...@@ -166,7 +166,7 @@ static BOOL PSDRV_WriteImageHeader(PSDRV_PDEVICE *physDev, const BITMAPINFO *inf ...@@ -166,7 +166,7 @@ static BOOL PSDRV_WriteImageHeader(PSDRV_PDEVICE *physDev, const BITMAPINFO *inf
* Uses level 2 PostScript * 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 yDst, INT widthDst, INT heightDst,
INT widthSrc, INT heightSrc) INT widthSrc, INT heightSrc)
{ {
...@@ -186,18 +186,18 @@ static BOOL PSDRV_WriteImageMaskHeader(PSDRV_PDEVICE *physDev, const BITMAPINFO ...@@ -186,18 +186,18 @@ static BOOL PSDRV_WriteImageMaskHeader(PSDRV_PDEVICE *physDev, const BITMAPINFO
the foregnd color corresponds to a bit equal to the foregnd color corresponds to a bit equal to
0 in the bitmap. 0 in the bitmap.
*/ */
PSDRV_CreateColor(physDev, &foregnd, map[0]); PSDRV_CreateColor(dev, &foregnd, map[0]);
PSDRV_CreateColor(physDev, &bkgnd, map[1]); PSDRV_CreateColor(dev, &bkgnd, map[1]);
PSDRV_WriteGSave(physDev); PSDRV_WriteGSave(dev);
PSDRV_WriteNewPath(physDev); PSDRV_WriteNewPath(dev);
PSDRV_WriteRectangle(physDev, xDst, yDst, widthDst, heightDst); PSDRV_WriteRectangle(dev, xDst, yDst, widthDst, heightDst);
PSDRV_WriteSetColor(physDev, &bkgnd); PSDRV_WriteSetColor(dev, &bkgnd);
PSDRV_WriteFill(physDev); PSDRV_WriteFill(dev);
PSDRV_WriteGRestore(physDev); PSDRV_WriteGRestore(dev);
PSDRV_WriteSetColor(physDev, &foregnd); PSDRV_WriteSetColor(dev, &foregnd);
PSDRV_WriteImage(physDev, 1, xDst, yDst, widthDst, heightDst, PSDRV_WriteImage(dev, 1, xDst, yDst, widthDst, heightDst,
widthSrc, heightSrc, TRUE); widthSrc, heightSrc, TRUE);
return TRUE; return TRUE;
...@@ -222,7 +222,7 @@ static inline DWORD max_ascii85_size(DWORD size) ...@@ -222,7 +222,7 @@ static inline DWORD max_ascii85_size(DWORD size)
* bit depths. * bit depths.
* Compression not implemented. * 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 heightDst, INT xSrc, INT ySrc,
INT widthSrc, INT heightSrc, const void *bits, INT widthSrc, INT heightSrc, const void *bits,
const BITMAPINFO *info, UINT wUsage, DWORD dwRop ) const BITMAPINFO *info, UINT wUsage, DWORD dwRop )
...@@ -236,7 +236,7 @@ INT CDECL PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT w ...@@ -236,7 +236,7 @@ INT CDECL PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT w
BYTE *dst_ptr, *bitmap, *rle, *ascii85; BYTE *dst_ptr, *bitmap, *rle, *ascii85;
DWORD rle_len, ascii85_len, bitmap_size; 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); xSrc, ySrc, widthSrc, heightSrc, xDst, yDst, widthDst, heightDst);
if (!get_bitmap_info( info, &fullSrcWidth, &fullSrcHeight, &bpp, &compression )) return FALSE; 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 ...@@ -257,7 +257,7 @@ INT CDECL PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT w
pt[0].y = yDst; pt[0].y = yDst;
pt[1].x = xDst + widthDst; pt[1].x = xDst + widthDst;
pt[1].y = yDst + heightDst; pt[1].y = yDst + heightDst;
LPtoDP( physDev->hdc, pt, 2 ); LPtoDP( dev->hdc, pt, 2 );
xDst = pt[0].x; xDst = pt[0].x;
yDst = pt[0].y; yDst = pt[0].y;
widthDst = pt[1].x - pt[0].x; widthDst = pt[1].x - pt[0].x;
...@@ -266,11 +266,11 @@ INT CDECL PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT w ...@@ -266,11 +266,11 @@ INT CDECL PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT w
switch(bpp) { switch(bpp) {
case 1: case 1:
PSDRV_SetClip(physDev); PSDRV_SetClip(dev);
PSDRV_WriteGSave(physDev); PSDRV_WriteGSave(dev);
/* Use imagemask rather than image */ /* Use imagemask rather than image */
PSDRV_WriteImageMaskHeader(physDev, info, xDst, yDst, widthDst, heightDst, PSDRV_WriteImageMaskHeader(dev, info, xDst, yDst, widthDst, heightDst,
widthSrc, heightSrc); widthSrc, heightSrc);
src_ptr = bits; src_ptr = bits;
if(stride < 0) src_ptr += (fullSrcHeight + 1) * stride; 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 ...@@ -284,9 +284,9 @@ INT CDECL PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT w
break; break;
case 4: case 4:
PSDRV_SetClip(physDev); PSDRV_SetClip(dev);
PSDRV_WriteGSave(physDev); PSDRV_WriteGSave(dev);
PSDRV_WriteImageHeader(physDev, info, xDst, yDst, widthDst, heightDst, PSDRV_WriteImageHeader(dev, info, xDst, yDst, widthDst, heightDst,
widthSrc, heightSrc); widthSrc, heightSrc);
src_ptr = bits; src_ptr = bits;
if(stride < 0) src_ptr += (fullSrcHeight + 1) * stride; 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 ...@@ -300,9 +300,9 @@ INT CDECL PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT w
break; break;
case 8: case 8:
PSDRV_SetClip(physDev); PSDRV_SetClip(dev);
PSDRV_WriteGSave(physDev); PSDRV_WriteGSave(dev);
PSDRV_WriteImageHeader(physDev, info, xDst, yDst, widthDst, heightDst, PSDRV_WriteImageHeader(dev, info, xDst, yDst, widthDst, heightDst,
widthSrc, heightSrc); widthSrc, heightSrc);
src_ptr = bits; src_ptr = bits;
if(stride < 0) src_ptr += (fullSrcHeight + 1) * stride; 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 ...@@ -315,9 +315,9 @@ INT CDECL PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT w
case 15: case 15:
case 16: case 16:
PSDRV_SetClip(physDev); PSDRV_SetClip(dev);
PSDRV_WriteGSave(physDev); PSDRV_WriteGSave(dev);
PSDRV_WriteImageHeader(physDev, info, xDst, yDst, widthDst, heightDst, PSDRV_WriteImageHeader(dev, info, xDst, yDst, widthDst, heightDst,
widthSrc, heightSrc); widthSrc, heightSrc);
...@@ -349,9 +349,9 @@ INT CDECL PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT w ...@@ -349,9 +349,9 @@ INT CDECL PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT w
break; break;
case 24: case 24:
PSDRV_SetClip(physDev); PSDRV_SetClip(dev);
PSDRV_WriteGSave(physDev); PSDRV_WriteGSave(dev);
PSDRV_WriteImageHeader(physDev, info, xDst, yDst, widthDst, heightDst, PSDRV_WriteImageHeader(dev, info, xDst, yDst, widthDst, heightDst,
widthSrc, heightSrc); widthSrc, heightSrc);
src_ptr = bits; src_ptr = bits;
...@@ -372,9 +372,9 @@ INT CDECL PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT w ...@@ -372,9 +372,9 @@ INT CDECL PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT w
break; break;
case 32: case 32:
PSDRV_SetClip(physDev); PSDRV_SetClip(dev);
PSDRV_WriteGSave(physDev); PSDRV_WriteGSave(dev);
PSDRV_WriteImageHeader(physDev, info, xDst, yDst, widthDst, heightDst, PSDRV_WriteImageHeader(dev, info, xDst, yDst, widthDst, heightDst,
widthSrc, heightSrc); widthSrc, heightSrc);
src_ptr = bits; src_ptr = bits;
...@@ -406,10 +406,10 @@ INT CDECL PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT w ...@@ -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 = HeapAlloc(GetProcessHeap(), 0, max_ascii85_size(rle_len));
ascii85_len = ASCII85_encode(rle, rle_len, ascii85); ascii85_len = ASCII85_encode(rle, rle_len, ascii85);
HeapFree(GetProcessHeap(), 0, rle); HeapFree(GetProcessHeap(), 0, rle);
PSDRV_WriteData(physDev, ascii85, ascii85_len); PSDRV_WriteData(dev, ascii85, ascii85_len);
HeapFree(GetProcessHeap(), 0, ascii85); HeapFree(GetProcessHeap(), 0, ascii85);
PSDRV_WriteSpool(physDev, "~>\n", 3); PSDRV_WriteSpool(dev, "~>\n", 3);
PSDRV_WriteGRestore(physDev); PSDRV_WriteGRestore(dev);
PSDRV_ResetClip(physDev); PSDRV_ResetClip(dev);
return abs(heightSrc); return abs(heightSrc);
} }
...@@ -27,8 +27,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv); ...@@ -27,8 +27,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
/*********************************************************************** /***********************************************************************
* SelectBrush (WINEPS.@) * 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; LOGBRUSH logbrush;
if (!GetObjectA( hbrush, sizeof(logbrush), &logbrush )) return 0; if (!GetObjectA( hbrush, sizeof(logbrush), &logbrush )) return 0;
...@@ -41,14 +42,14 @@ HBRUSH CDECL PSDRV_SelectBrush( PSDRV_PDEVICE *physDev, HBRUSH hbrush ) ...@@ -41,14 +42,14 @@ HBRUSH CDECL PSDRV_SelectBrush( PSDRV_PDEVICE *physDev, HBRUSH hbrush )
switch(logbrush.lbStyle) { switch(logbrush.lbStyle) {
case BS_SOLID: case BS_SOLID:
PSDRV_CreateColor(physDev, &physDev->brush.color, logbrush.lbColor); PSDRV_CreateColor(dev, &physDev->brush.color, logbrush.lbColor);
break; break;
case BS_NULL: case BS_NULL:
break; break;
case BS_HATCHED: case BS_HATCHED:
PSDRV_CreateColor(physDev, &physDev->brush.color, logbrush.lbColor); PSDRV_CreateColor(dev, &physDev->brush.color, logbrush.lbColor);
break; break;
case BS_PATTERN: case BS_PATTERN:
...@@ -68,11 +69,13 @@ HBRUSH CDECL PSDRV_SelectBrush( PSDRV_PDEVICE *physDev, HBRUSH hbrush ) ...@@ -68,11 +69,13 @@ HBRUSH CDECL PSDRV_SelectBrush( PSDRV_PDEVICE *physDev, HBRUSH hbrush )
/*********************************************************************** /***********************************************************************
* SetDCBrushColor (WINEPS.@) * 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 )) 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; physDev->brush.set = FALSE;
} }
return color; return color;
...@@ -84,8 +87,9 @@ COLORREF CDECL PSDRV_SetDCBrushColor( PSDRV_PDEVICE *physDev, COLORREF color ) ...@@ -84,8 +87,9 @@ COLORREF CDECL PSDRV_SetDCBrushColor( PSDRV_PDEVICE *physDev, COLORREF color )
* PSDRV_SetBrush * PSDRV_SetBrush
* *
*/ */
static BOOL PSDRV_SetBrush(PSDRV_PDEVICE *physDev) static BOOL PSDRV_SetBrush( PHYSDEV dev )
{ {
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
LOGBRUSH logbrush; LOGBRUSH logbrush;
BOOL ret = TRUE; BOOL ret = TRUE;
...@@ -98,7 +102,7 @@ static BOOL PSDRV_SetBrush(PSDRV_PDEVICE *physDev) ...@@ -98,7 +102,7 @@ static BOOL PSDRV_SetBrush(PSDRV_PDEVICE *physDev)
switch (logbrush.lbStyle) { switch (logbrush.lbStyle) {
case BS_SOLID: case BS_SOLID:
case BS_HATCHED: case BS_HATCHED:
PSDRV_WriteSetColor(physDev, &physDev->brush.color); PSDRV_WriteSetColor(dev, &physDev->brush.color);
break; break;
case BS_NULL: case BS_NULL:
...@@ -119,12 +123,12 @@ static BOOL PSDRV_SetBrush(PSDRV_PDEVICE *physDev) ...@@ -119,12 +123,12 @@ static BOOL PSDRV_SetBrush(PSDRV_PDEVICE *physDev)
* PSDRV_Fill * PSDRV_Fill
* *
*/ */
static BOOL PSDRV_Fill(PSDRV_PDEVICE *physDev, BOOL EO) static BOOL PSDRV_Fill(PHYSDEV dev, BOOL EO)
{ {
if(!EO) if(!EO)
return PSDRV_WriteFill(physDev); return PSDRV_WriteFill(dev);
else else
return PSDRV_WriteEOFill(physDev); return PSDRV_WriteEOFill(dev);
} }
...@@ -133,12 +137,12 @@ static BOOL PSDRV_Fill(PSDRV_PDEVICE *physDev, BOOL EO) ...@@ -133,12 +137,12 @@ static BOOL PSDRV_Fill(PSDRV_PDEVICE *physDev, BOOL EO)
* PSDRV_Clip * PSDRV_Clip
* *
*/ */
static BOOL PSDRV_Clip(PSDRV_PDEVICE *physDev, BOOL EO) static BOOL PSDRV_Clip(PHYSDEV dev, BOOL EO)
{ {
if(!EO) if(!EO)
return PSDRV_WriteClip(physDev); return PSDRV_WriteClip(dev);
else else
return PSDRV_WriteEOClip(physDev); return PSDRV_WriteEOClip(dev);
} }
/********************************************************************** /**********************************************************************
...@@ -146,8 +150,9 @@ static BOOL PSDRV_Clip(PSDRV_PDEVICE *physDev, BOOL EO) ...@@ -146,8 +150,9 @@ static BOOL PSDRV_Clip(PSDRV_PDEVICE *physDev, BOOL EO)
* PSDRV_Brush * 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; LOGBRUSH logbrush;
BOOL ret = TRUE; BOOL ret = TRUE;
...@@ -162,56 +167,56 @@ BOOL PSDRV_Brush(PSDRV_PDEVICE *physDev, BOOL EO) ...@@ -162,56 +167,56 @@ BOOL PSDRV_Brush(PSDRV_PDEVICE *physDev, BOOL EO)
switch (logbrush.lbStyle) { switch (logbrush.lbStyle) {
case BS_SOLID: case BS_SOLID:
PSDRV_WriteGSave(physDev); PSDRV_WriteGSave(dev);
PSDRV_SetBrush(physDev); PSDRV_SetBrush(dev);
PSDRV_Fill(physDev, EO); PSDRV_Fill(dev, EO);
PSDRV_WriteGRestore(physDev); PSDRV_WriteGRestore(dev);
break; break;
case BS_HATCHED: case BS_HATCHED:
PSDRV_WriteGSave(physDev); PSDRV_WriteGSave(dev);
PSDRV_SetBrush(physDev); PSDRV_SetBrush(dev);
switch(logbrush.lbHatch) { switch(logbrush.lbHatch) {
case HS_VERTICAL: case HS_VERTICAL:
case HS_CROSS: case HS_CROSS:
PSDRV_WriteGSave(physDev); PSDRV_WriteGSave(dev);
PSDRV_Clip(physDev, EO); PSDRV_Clip(dev, EO);
PSDRV_WriteHatch(physDev); PSDRV_WriteHatch(dev);
PSDRV_WriteStroke(physDev); PSDRV_WriteStroke(dev);
PSDRV_WriteGRestore(physDev); PSDRV_WriteGRestore(dev);
if(logbrush.lbHatch == HS_VERTICAL) if(logbrush.lbHatch == HS_VERTICAL)
break; break;
/* else fallthrough for HS_CROSS */ /* else fallthrough for HS_CROSS */
case HS_HORIZONTAL: case HS_HORIZONTAL:
PSDRV_WriteGSave(physDev); PSDRV_WriteGSave(dev);
PSDRV_Clip(physDev, EO); PSDRV_Clip(dev, EO);
PSDRV_WriteRotate(physDev, 90.0); PSDRV_WriteRotate(dev, 90.0);
PSDRV_WriteHatch(physDev); PSDRV_WriteHatch(dev);
PSDRV_WriteStroke(physDev); PSDRV_WriteStroke(dev);
PSDRV_WriteGRestore(physDev); PSDRV_WriteGRestore(dev);
break; break;
case HS_FDIAGONAL: case HS_FDIAGONAL:
case HS_DIAGCROSS: case HS_DIAGCROSS:
PSDRV_WriteGSave(physDev); PSDRV_WriteGSave(dev);
PSDRV_Clip(physDev, EO); PSDRV_Clip(dev, EO);
PSDRV_WriteRotate(physDev, -45.0); PSDRV_WriteRotate(dev, -45.0);
PSDRV_WriteHatch(physDev); PSDRV_WriteHatch(dev);
PSDRV_WriteStroke(physDev); PSDRV_WriteStroke(dev);
PSDRV_WriteGRestore(physDev); PSDRV_WriteGRestore(dev);
if(logbrush.lbHatch == HS_FDIAGONAL) if(logbrush.lbHatch == HS_FDIAGONAL)
break; break;
/* else fallthrough for HS_DIAGCROSS */ /* else fallthrough for HS_DIAGCROSS */
case HS_BDIAGONAL: case HS_BDIAGONAL:
PSDRV_WriteGSave(physDev); PSDRV_WriteGSave(dev);
PSDRV_Clip(physDev, EO); PSDRV_Clip(dev, EO);
PSDRV_WriteRotate(physDev, 45.0); PSDRV_WriteRotate(dev, 45.0);
PSDRV_WriteHatch(physDev); PSDRV_WriteHatch(dev);
PSDRV_WriteStroke(physDev); PSDRV_WriteStroke(dev);
PSDRV_WriteGRestore(physDev); PSDRV_WriteGRestore(dev);
break; break;
default: default:
...@@ -219,7 +224,7 @@ BOOL PSDRV_Brush(PSDRV_PDEVICE *physDev, BOOL EO) ...@@ -219,7 +224,7 @@ BOOL PSDRV_Brush(PSDRV_PDEVICE *physDev, BOOL EO)
ret = FALSE; ret = FALSE;
break; break;
} }
PSDRV_WriteGRestore(physDev); PSDRV_WriteGRestore(dev);
break; break;
case BS_NULL: case BS_NULL:
...@@ -236,10 +241,10 @@ BOOL PSDRV_Brush(PSDRV_PDEVICE *physDev, BOOL EO) ...@@ -236,10 +241,10 @@ BOOL PSDRV_Brush(PSDRV_PDEVICE *physDev, BOOL EO)
GetBitmapBits( (HBITMAP)logbrush.lbHatch, bm.bmWidthBytes * bm.bmHeight, bits); GetBitmapBits( (HBITMAP)logbrush.lbHatch, bm.bmWidthBytes * bm.bmHeight, bits);
if(physDev->pi->ppd->LanguageLevel > 1) { if(physDev->pi->ppd->LanguageLevel > 1) {
PSDRV_WriteGSave(physDev); PSDRV_WriteGSave(dev);
PSDRV_WritePatternDict(physDev, &bm, bits); PSDRV_WritePatternDict(dev, &bm, bits);
PSDRV_Fill(physDev, EO); PSDRV_Fill(dev, EO);
PSDRV_WriteGRestore(physDev); PSDRV_WriteGRestore(dev);
} else { } else {
FIXME("Trying to set a pattern brush on a level 1 printer\n"); FIXME("Trying to set a pattern brush on a level 1 printer\n");
ret = FALSE; ret = FALSE;
...@@ -255,10 +260,10 @@ BOOL PSDRV_Brush(PSDRV_PDEVICE *physDev, BOOL EO) ...@@ -255,10 +260,10 @@ BOOL PSDRV_Brush(PSDRV_PDEVICE *physDev, BOOL EO)
TRACE("size %dx%dx%d\n", bmi->bmiHeader.biWidth, TRACE("size %dx%dx%d\n", bmi->bmiHeader.biWidth,
bmi->bmiHeader.biHeight, bmi->bmiHeader.biBitCount); bmi->bmiHeader.biHeight, bmi->bmiHeader.biBitCount);
if(physDev->pi->ppd->LanguageLevel > 1) { if(physDev->pi->ppd->LanguageLevel > 1) {
PSDRV_WriteGSave(physDev); PSDRV_WriteGSave(dev);
ret = PSDRV_WriteDIBPatternDict(physDev, bmi, usage); ret = PSDRV_WriteDIBPatternDict(dev, bmi, usage);
PSDRV_Fill(physDev, EO); PSDRV_Fill(dev, EO);
PSDRV_WriteGRestore(physDev); PSDRV_WriteGRestore(dev);
} else { } else {
FIXME("Trying to set a pattern brush on a level 1 printer\n"); FIXME("Trying to set a pattern brush on a level 1 printer\n");
ret = FALSE; ret = FALSE;
......
...@@ -155,9 +155,10 @@ static VOID ScaleFont(const AFM *afm, LONG lfHeight, PSFONT *font, ...@@ -155,9 +155,10 @@ static VOID ScaleFont(const AFM *afm, LONG lfHeight, PSFONT *font,
* Set up physDev->font for a builtin 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) LOGFONTW *plf, LPSTR FaceName)
{ {
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
AFMLISTENTRY *afmle; AFMLISTENTRY *afmle;
FONTFAMILY *family; FONTFAMILY *family;
BOOL bd = FALSE, it = FALSE; BOOL bd = FALSE, it = FALSE;
...@@ -232,15 +233,17 @@ BOOL PSDRV_SelectBuiltinFont(PSDRV_PDEVICE *physDev, HFONT hfont, ...@@ -232,15 +233,17 @@ BOOL PSDRV_SelectBuiltinFont(PSDRV_PDEVICE *physDev, HFONT hfont,
return TRUE; return TRUE;
} }
BOOL PSDRV_WriteSetBuiltinFont(PSDRV_PDEVICE *physDev) BOOL PSDRV_WriteSetBuiltinFont(PHYSDEV dev)
{ {
return PSDRV_WriteSetFont(physDev, PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
physDev->font.fontinfo.Builtin.afm->FontName,
return PSDRV_WriteSetFont(dev, physDev->font.fontinfo.Builtin.afm->FontName,
physDev->font.size, physDev->font.escapement); 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; int i;
LPCSTR name; LPCSTR name;
...@@ -248,7 +251,7 @@ BOOL PSDRV_WriteBuiltinGlyphShow(PSDRV_PDEVICE *physDev, LPCWSTR str, INT count) ...@@ -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; name = PSDRV_UVMetrics(str[i], physDev->font.fontinfo.Builtin.afm)->N->sz;
PSDRV_WriteGlyphShow(physDev, name); PSDRV_WriteGlyphShow(dev, name);
} }
return TRUE; return TRUE;
...@@ -257,8 +260,10 @@ BOOL PSDRV_WriteBuiltinGlyphShow(PSDRV_PDEVICE *physDev, LPCWSTR str, INT count) ...@@ -257,8 +260,10 @@ BOOL PSDRV_WriteBuiltinGlyphShow(PSDRV_PDEVICE *physDev, LPCWSTR str, INT count)
/*********************************************************************** /***********************************************************************
* PSDRV_GetTextMetrics * 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); assert(physDev->font.fontloc == Builtin);
memcpy(metrics, &(physDev->font.fontinfo.Builtin.tm), memcpy(metrics, &(physDev->font.fontinfo.Builtin.tm),
...@@ -308,9 +313,10 @@ const AFMMETRICS *PSDRV_UVMetrics(LONG UV, const AFM *afm) ...@@ -308,9 +313,10 @@ const AFMMETRICS *PSDRV_UVMetrics(LONG UV, const AFM *afm)
/*********************************************************************** /***********************************************************************
* PSDRV_GetTextExtentExPoint * 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) INT maxExt, LPINT lpnFit, LPINT alpDx, LPSIZE size)
{ {
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
int nfit = 0; int nfit = 0;
int i; int i;
float width = 0.0; float width = 0.0;
...@@ -346,8 +352,9 @@ BOOL CDECL PSDRV_GetTextExtentExPoint(PSDRV_PDEVICE *physDev, LPCWSTR str, INT c ...@@ -346,8 +352,9 @@ BOOL CDECL PSDRV_GetTextExtentExPoint(PSDRV_PDEVICE *physDev, LPCWSTR str, INT c
/*********************************************************************** /***********************************************************************
* PSDRV_GetCharWidth * 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; UINT i;
assert(physDev->font.fontloc == Builtin); assert(physDev->font.fontloc == Builtin);
...@@ -406,9 +413,9 @@ static UINT PSDRV_GetFontMetric(HDC hdc, const AFM *afm, ...@@ -406,9 +413,9 @@ static UINT PSDRV_GetFontMetric(HDC hdc, const AFM *afm,
/*********************************************************************** /***********************************************************************
* PSDRV_EnumDeviceFonts * PSDRV_EnumDeviceFonts
*/ */
BOOL CDECL PSDRV_EnumDeviceFonts( PSDRV_PDEVICE *physDev, LPLOGFONTW plf, BOOL CDECL PSDRV_EnumDeviceFonts( PHYSDEV dev, LPLOGFONTW plf, FONTENUMPROCW proc, LPARAM lp )
FONTENUMPROCW proc, LPARAM lp )
{ {
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
ENUMLOGFONTEXW lf; ENUMLOGFONTEXW lf;
NEWTEXTMETRICEXW tm; NEWTEXTMETRICEXW tm;
BOOL b, bRet = 0; BOOL b, bRet = 0;
......
...@@ -35,8 +35,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv); ...@@ -35,8 +35,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
* small clip area in the printer dc that it can still write raw * 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. * 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"; CHAR szArrayName[] = "clippath";
DWORD size; DWORD size;
RGNDATA *rgndata = NULL; RGNDATA *rgndata = NULL;
...@@ -67,20 +68,20 @@ void PSDRV_SetClip( PSDRV_PDEVICE *physDev ) ...@@ -67,20 +68,20 @@ void PSDRV_SetClip( PSDRV_PDEVICE *physDev )
GetRegionData(hrgn, size, rgndata); GetRegionData(hrgn, size, rgndata);
PSDRV_WriteGSave(physDev); PSDRV_WriteGSave(dev);
/* check for NULL region */ /* check for NULL region */
if (rgndata->rdh.nCount == 0) if (rgndata->rdh.nCount == 0)
{ {
/* set an empty clip path. */ /* 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 */ /* optimize when it is a simple region */
else if (rgndata->rdh.nCount == 1) else if (rgndata->rdh.nCount == 1)
{ {
RECT *pRect = (RECT *)rgndata->Buffer; RECT *pRect = (RECT *)rgndata->Buffer;
PSDRV_WriteRectClip(physDev, pRect->left, pRect->top, PSDRV_WriteRectClip(dev, pRect->left, pRect->top,
pRect->right - pRect->left, pRect->right - pRect->left,
pRect->bottom - pRect->top); pRect->bottom - pRect->top);
} }
...@@ -89,20 +90,20 @@ void PSDRV_SetClip( PSDRV_PDEVICE *physDev ) ...@@ -89,20 +90,20 @@ void PSDRV_SetClip( PSDRV_PDEVICE *physDev )
UINT i; UINT i;
RECT *pRect = (RECT *)rgndata->Buffer; 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++) for (i = 0; i < rgndata->rdh.nCount; i++, pRect++)
{ {
PSDRV_WriteArrayPut(physDev, szArrayName, i * 4, PSDRV_WriteArrayPut(dev, szArrayName, i * 4,
pRect->left); pRect->left);
PSDRV_WriteArrayPut(physDev, szArrayName, i * 4 + 1, PSDRV_WriteArrayPut(dev, szArrayName, i * 4 + 1,
pRect->top); pRect->top);
PSDRV_WriteArrayPut(physDev, szArrayName, i * 4 + 2, PSDRV_WriteArrayPut(dev, szArrayName, i * 4 + 2,
pRect->right - pRect->left); pRect->right - pRect->left);
PSDRV_WriteArrayPut(physDev, szArrayName, i * 4 + 3, PSDRV_WriteArrayPut(dev, szArrayName, i * 4 + 3,
pRect->bottom - pRect->top); pRect->bottom - pRect->top);
} }
PSDRV_WriteRectClip2(physDev, szArrayName); PSDRV_WriteRectClip2(dev, szArrayName);
} }
} }
end: end:
...@@ -114,13 +115,14 @@ end: ...@@ -114,13 +115,14 @@ end:
/*********************************************************************** /***********************************************************************
* PSDRV_ResetClip * 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); HRGN hrgn = CreateRectRgn(0,0,0,0);
BOOL empty; BOOL empty;
empty = !GetClipRgn(physDev->hdc, hrgn); empty = !GetClipRgn(physDev->hdc, hrgn);
if(!empty && !physDev->pathdepth) if(!empty && !physDev->pathdepth)
PSDRV_WriteGRestore(physDev); PSDRV_WriteGRestore(dev);
DeleteObject(hrgn); DeleteObject(hrgn);
} }
...@@ -60,9 +60,9 @@ BOOL PSDRV_CopyColor(PSCOLOR *col1, PSCOLOR *col2) ...@@ -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 * Result is grey scale if ColorDevice field of ppd is CD_False else an
* rgb colour is produced. * rgb colour is produced.
*/ */
void PSDRV_CreateColor( PSDRV_PDEVICE *physDev, PSCOLOR *pscolor, void PSDRV_CreateColor( PHYSDEV dev, PSCOLOR *pscolor, COLORREF wincolor )
COLORREF wincolor )
{ {
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
int ctype = wincolor >> 24; int ctype = wincolor >> 24;
float r, g, b; float r, g, b;
...@@ -90,9 +90,10 @@ void PSDRV_CreateColor( PSDRV_PDEVICE *physDev, PSCOLOR *pscolor, ...@@ -90,9 +90,10 @@ void PSDRV_CreateColor( PSDRV_PDEVICE *physDev, PSCOLOR *pscolor,
/*********************************************************************** /***********************************************************************
* PSDRV_SetBkColor * 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; return color;
} }
...@@ -100,9 +101,10 @@ COLORREF CDECL PSDRV_SetBkColor( PSDRV_PDEVICE *physDev, COLORREF color ) ...@@ -100,9 +101,10 @@ COLORREF CDECL PSDRV_SetBkColor( PSDRV_PDEVICE *physDev, COLORREF color )
/*********************************************************************** /***********************************************************************
* PSDRV_SetTextColor * 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; physDev->font.set = FALSE;
return color; return color;
} }
...@@ -49,14 +49,13 @@ BOOL WINAPI GetTransform( HDC hdc, DWORD which, XFORM *xform ); ...@@ -49,14 +49,13 @@ BOOL WINAPI GetTransform( HDC hdc, DWORD which, XFORM *xform );
/**************************************************************************** /****************************************************************************
* get_download_name * get_download_name
*/ */
static void get_download_name(PSDRV_PDEVICE *physDev, LPOUTLINETEXTMETRICA static void get_download_name(PHYSDEV dev, LPOUTLINETEXTMETRICA potm, char **str)
potm, char **str)
{ {
int len; int len;
char *p; char *p;
DWORD size; 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) if(size != 0 && size != GDI_ERROR)
{ {
BYTE *name = HeapAlloc(GetProcessHeap(), 0, size); BYTE *name = HeapAlloc(GetProcessHeap(), 0, size);
...@@ -74,7 +73,7 @@ static void get_download_name(PSDRV_PDEVICE *physDev, LPOUTLINETEXTMETRICA ...@@ -74,7 +73,7 @@ static void get_download_name(PSDRV_PDEVICE *physDev, LPOUTLINETEXTMETRICA
USHORT offset; USHORT offset;
} *name_record; } *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); count = GET_BE_WORD(name + 2);
strings = name + GET_BE_WORD(name + 4); strings = name + GET_BE_WORD(name + 4);
name_record = (typeof(name_record))(name + 6); name_record = (typeof(name_record))(name + 6);
...@@ -197,8 +196,10 @@ static BOOL get_bbox(HDC hdc, RECT *rc, UINT *emsize) ...@@ -197,8 +196,10 @@ static BOOL get_bbox(HDC hdc, RECT *rc, UINT *emsize)
* Set up physDev->font for a downloadable font * 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.fontloc = Download;
physDev->font.fontinfo.Download = NULL; physDev->font.fontinfo.Download = NULL;
...@@ -246,8 +247,9 @@ static inline float ps_round(float f) ...@@ -246,8 +247,9 @@ static inline float ps_round(float f)
* Write setfont for download font. * 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; char *ps_name;
LPOUTLINETEXTMETRICA potm; LPOUTLINETEXTMETRICA potm;
DWORD len = GetOutlineTextMetricsA(physDev->hdc, 0, NULL); DWORD len = GetOutlineTextMetricsA(physDev->hdc, 0, NULL);
...@@ -261,7 +263,7 @@ BOOL PSDRV_WriteSetDownloadFont(PSDRV_PDEVICE *physDev) ...@@ -261,7 +263,7 @@ BOOL PSDRV_WriteSetDownloadFont(PSDRV_PDEVICE *physDev)
potm = HeapAlloc(GetProcessHeap(), 0, len); potm = HeapAlloc(GetProcessHeap(), 0, len);
GetOutlineTextMetricsA(physDev->hdc, len, potm); 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); physDev->font.fontinfo.Download = is_font_downloaded(physDev, ps_name);
if (!GetObjectW( GetCurrentObject(physDev->hdc, OBJ_FONT), sizeof(lf), &lf )) if (!GetObjectW( GetCurrentObject(physDev->hdc, OBJ_FONT), sizeof(lf), &lf ))
...@@ -297,7 +299,7 @@ BOOL PSDRV_WriteSetDownloadFont(PSDRV_PDEVICE *physDev) ...@@ -297,7 +299,7 @@ BOOL PSDRV_WriteSetDownloadFont(PSDRV_PDEVICE *physDev)
return FALSE; return FALSE;
} }
if(!is_room_for_font(physDev)) if(!is_room_for_font(physDev))
PSDRV_EmptyDownloadList(physDev, TRUE); PSDRV_EmptyDownloadList(dev, TRUE);
pdl = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*pdl)); pdl = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*pdl));
pdl->ps_name = HeapAlloc(GetProcessHeap(), 0, strlen(ps_name)+1); pdl->ps_name = HeapAlloc(GetProcessHeap(), 0, strlen(ps_name)+1);
...@@ -305,11 +307,11 @@ BOOL PSDRV_WriteSetDownloadFont(PSDRV_PDEVICE *physDev) ...@@ -305,11 +307,11 @@ BOOL PSDRV_WriteSetDownloadFont(PSDRV_PDEVICE *physDev)
pdl->next = NULL; pdl->next = NULL;
if(physDev->pi->ppd->TTRasterizer == RO_Type42) { 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; pdl->type = Type42;
} }
if(pdl->typeinfo.Type42 == NULL) { 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->type = Type1;
} }
pdl->next = physDev->downloaded_fonts; pdl->next = physDev->downloaded_fonts;
...@@ -319,13 +321,12 @@ BOOL PSDRV_WriteSetDownloadFont(PSDRV_PDEVICE *physDev) ...@@ -319,13 +321,12 @@ BOOL PSDRV_WriteSetDownloadFont(PSDRV_PDEVICE *physDev)
if(pdl->type == Type42) { if(pdl->type == Type42) {
char g_name[MAX_G_NAME + 1]; char g_name[MAX_G_NAME + 1];
get_glyph_name(physDev->hdc, 0, g_name); 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, PSDRV_WriteSetFont(dev, ps_name, physDev->font.size, physDev->font.escapement);
physDev->font.escapement);
HeapFree(GetProcessHeap(), 0, ps_name); HeapFree(GetProcessHeap(), 0, ps_name);
HeapFree(GetProcessHeap(), 0, potm); HeapFree(GetProcessHeap(), 0, potm);
...@@ -345,9 +346,10 @@ void get_glyph_name(HDC hdc, WORD index, char *name) ...@@ -345,9 +346,10 @@ void get_glyph_name(HDC hdc, WORD index, char *name)
* Download and write out a number of glyphs * 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) UINT count)
{ {
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
UINT i; UINT i;
char g_name[MAX_G_NAME + 1]; char g_name[MAX_G_NAME + 1];
assert(physDev->font.fontloc == Download); assert(physDev->font.fontloc == Download);
...@@ -356,18 +358,16 @@ BOOL PSDRV_WriteDownloadGlyphShow(PSDRV_PDEVICE *physDev, WORD *glyphs, ...@@ -356,18 +358,16 @@ BOOL PSDRV_WriteDownloadGlyphShow(PSDRV_PDEVICE *physDev, WORD *glyphs,
case Type42: case Type42:
for(i = 0; i < count; i++) { for(i = 0; i < count; i++) {
get_glyph_name(physDev->hdc, glyphs[i], g_name); get_glyph_name(physDev->hdc, glyphs[i], g_name);
T42_download_glyph(physDev, physDev->font.fontinfo.Download, T42_download_glyph(dev, physDev->font.fontinfo.Download, glyphs[i], g_name);
glyphs[i], g_name); PSDRV_WriteGlyphShow(dev, g_name);
PSDRV_WriteGlyphShow(physDev, g_name);
} }
break; break;
case Type1: case Type1:
for(i = 0; i < count; i++) { for(i = 0; i < count; i++) {
get_glyph_name(physDev->hdc, glyphs[i], g_name); get_glyph_name(physDev->hdc, glyphs[i], g_name);
T1_download_glyph(physDev, physDev->font.fontinfo.Download, T1_download_glyph(dev, physDev->font.fontinfo.Download, glyphs[i], g_name);
glyphs[i], g_name); PSDRV_WriteGlyphShow(dev, g_name);
PSDRV_WriteGlyphShow(physDev, g_name);
} }
break; break;
...@@ -384,8 +384,9 @@ BOOL PSDRV_WriteDownloadGlyphShow(PSDRV_PDEVICE *physDev, WORD *glyphs, ...@@ -384,8 +384,9 @@ BOOL PSDRV_WriteDownloadGlyphShow(PSDRV_PDEVICE *physDev, WORD *glyphs,
* Clear the list of downloaded fonts * 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; DOWNLOAD *pdl, *old;
static const char undef[] = "/%s findfont 40 scalefont setfont /%s undefinefont\n"; static const char undef[] = "/%s findfont 40 scalefont setfont /%s undefinefont\n";
char buf[sizeof(undef) + 200]; char buf[sizeof(undef) + 200];
...@@ -402,7 +403,7 @@ BOOL PSDRV_EmptyDownloadList(PSDRV_PDEVICE *physDev, BOOL write_undef) ...@@ -402,7 +403,7 @@ BOOL PSDRV_EmptyDownloadList(PSDRV_PDEVICE *physDev, BOOL write_undef)
while(pdl) { while(pdl) {
if(write_undef) { if(write_undef) {
sprintf(buf, undef, default_font, pdl->ps_name); sprintf(buf, undef, default_font, pdl->ps_name);
PSDRV_WriteSpool(physDev, buf, strlen(buf)); PSDRV_WriteSpool(dev, buf, strlen(buf));
} }
switch(pdl->type) { switch(pdl->type) {
......
...@@ -47,9 +47,11 @@ static const char psbegindocument[] = ...@@ -47,9 +47,11 @@ static const char psbegindocument[] =
"%%BeginDocument: Wine passthrough\n"; "%%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; DWORD written;
if (!WritePrinter(physDev->job.hprinter, (LPBYTE) data, num, &written) || (written != num)) if (!WritePrinter(physDev->job.hprinter, (LPBYTE) data, num, &written) || (written != num))
return SP_OUTOFDISK; return SP_OUTOFDISK;
...@@ -59,9 +61,11 @@ DWORD write_spool( PSDRV_PDEVICE *physDev, const void *data, DWORD num ) ...@@ -59,9 +61,11 @@ DWORD write_spool( PSDRV_PDEVICE *physDev, const void *data, DWORD num )
/********************************************************************** /**********************************************************************
* ExtEscape (WINEPS.@) * 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 ) INT cbOutput, LPVOID out_data )
{ {
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
switch(nEscape) switch(nEscape)
{ {
case QUERYESCSUPPORT: case QUERYESCSUPPORT:
...@@ -275,10 +279,10 @@ INT CDECL PSDRV_ExtEscape( PSDRV_PDEVICE *physDev, INT nEscape, INT cbInput, LPC ...@@ -275,10 +279,10 @@ INT CDECL PSDRV_ExtEscape( PSDRV_PDEVICE *physDev, INT nEscape, INT cbInput, LPC
* in_data[0] instead. * in_data[0] instead.
*/ */
if(!physDev->job.in_passthrough) { if(!physDev->job.in_passthrough) {
write_spool(physDev, psbegindocument, sizeof(psbegindocument)-1); write_spool(dev, psbegindocument, sizeof(psbegindocument)-1);
physDev->job.in_passthrough = TRUE; 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: case POSTSCRIPT_IGNORE:
...@@ -317,7 +321,7 @@ INT CDECL PSDRV_ExtEscape( PSDRV_PDEVICE *physDev, INT nEscape, INT cbInput, LPC ...@@ -317,7 +321,7 @@ INT CDECL PSDRV_ExtEscape( PSDRV_PDEVICE *physDev, INT nEscape, INT cbInput, LPC
info->RenderMode, info->FillMode, info->BkMode); info->RenderMode, info->FillMode, info->BkMode);
switch(info->RenderMode) { switch(info->RenderMode) {
case RENDERMODE_NO_DISPLAY: 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; break;
case RENDERMODE_OPEN: case RENDERMODE_OPEN:
case RENDERMODE_CLOSED: case RENDERMODE_CLOSED:
...@@ -335,17 +339,17 @@ INT CDECL PSDRV_ExtEscape( PSDRV_PDEVICE *physDev, INT nEscape, INT cbInput, LPC ...@@ -335,17 +339,17 @@ INT CDECL PSDRV_ExtEscape( PSDRV_PDEVICE *physDev, INT nEscape, INT cbInput, LPC
switch(mode) { switch(mode) {
case CLIP_SAVE: case CLIP_SAVE:
TRACE("CLIP_TO_PATH: CLIP_SAVE\n"); TRACE("CLIP_TO_PATH: CLIP_SAVE\n");
PSDRV_WriteGSave(physDev); PSDRV_WriteGSave(dev);
return 1; return 1;
case CLIP_RESTORE: case CLIP_RESTORE:
TRACE("CLIP_TO_PATH: CLIP_RESTORE\n"); TRACE("CLIP_TO_PATH: CLIP_RESTORE\n");
PSDRV_WriteGRestore(physDev); PSDRV_WriteGRestore(dev);
return 1; return 1;
case CLIP_INCLUSIVE: case CLIP_INCLUSIVE:
TRACE("CLIP_TO_PATH: CLIP_INCLUSIVE\n"); TRACE("CLIP_TO_PATH: CLIP_INCLUSIVE\n");
/* FIXME to clip or eoclip ? (see PATH_INFO.FillMode) */ /* FIXME to clip or eoclip ? (see PATH_INFO.FillMode) */
PSDRV_WriteClip(physDev); PSDRV_WriteClip(dev);
PSDRV_WriteNewPath(physDev); PSDRV_WriteNewPath(dev);
return 1; return 1;
case CLIP_EXCLUSIVE: case CLIP_EXCLUSIVE:
FIXME("CLIP_EXCLUSIVE: not implemented\n"); FIXME("CLIP_EXCLUSIVE: not implemented\n");
...@@ -364,19 +368,21 @@ INT CDECL PSDRV_ExtEscape( PSDRV_PDEVICE *physDev, INT nEscape, INT cbInput, LPC ...@@ -364,19 +368,21 @@ INT CDECL PSDRV_ExtEscape( PSDRV_PDEVICE *physDev, INT nEscape, INT cbInput, LPC
/************************************************************************ /************************************************************************
* PSDRV_StartPage * 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) { if(!physDev->job.OutOfPage) {
FIXME("Already started a page?\n"); FIXME("Already started a page?\n");
return 1; return 1;
} }
if(physDev->job.PageNo++ == 0) { if(physDev->job.PageNo++ == 0) {
if(!PSDRV_WriteHeader( physDev, physDev->job.DocName )) if(!PSDRV_WriteHeader( dev, physDev->job.DocName ))
return 0; return 0;
} }
if(!PSDRV_WriteNewPage( physDev )) if(!PSDRV_WriteNewPage( dev ))
return 0; return 0;
physDev->job.OutOfPage = FALSE; physDev->job.OutOfPage = FALSE;
return 1; return 1;
...@@ -386,15 +392,17 @@ INT CDECL PSDRV_StartPage( PSDRV_PDEVICE *physDev ) ...@@ -386,15 +392,17 @@ INT CDECL PSDRV_StartPage( PSDRV_PDEVICE *physDev )
/************************************************************************ /************************************************************************
* PSDRV_EndPage * 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) { if(physDev->job.OutOfPage) {
FIXME("Already ended a page?\n"); FIXME("Already ended a page?\n");
return 1; return 1;
} }
if(!PSDRV_WriteEndPage( physDev )) if(!PSDRV_WriteEndPage( dev ))
return 0; return 0;
PSDRV_EmptyDownloadList(physDev, FALSE); PSDRV_EmptyDownloadList(dev, FALSE);
physDev->job.OutOfPage = TRUE; physDev->job.OutOfPage = TRUE;
return 1; return 1;
} }
...@@ -403,8 +411,9 @@ INT CDECL PSDRV_EndPage( PSDRV_PDEVICE *physDev ) ...@@ -403,8 +411,9 @@ INT CDECL PSDRV_EndPage( PSDRV_PDEVICE *physDev )
/************************************************************************ /************************************************************************
* PSDRV_StartDocA * 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; DOC_INFO_1A di;
TRACE("(%p, %p) => %s, %s, %s\n", physDev, doc, debugstr_a(doc->lpszDocName), 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 ) ...@@ -460,13 +469,13 @@ static INT PSDRV_StartDocA( PSDRV_PDEVICE *physDev, const DOCINFOA *doc )
/************************************************************************ /************************************************************************
* PSDRV_StartDoc * PSDRV_StartDoc
*/ */
INT CDECL PSDRV_StartDoc( PSDRV_PDEVICE *physDev, const DOCINFOW *doc ) INT CDECL PSDRV_StartDoc( PHYSDEV dev, const DOCINFOW *doc )
{ {
DOCINFOA docA; DOCINFOA docA;
INT ret, len; INT ret, len;
LPSTR docname = NULL, output = NULL, datatype = NULL; 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)); debugstr_w(doc->lpszOutput), debugstr_w(doc->lpszDatatype));
docA.cbSize = doc->cbSize; docA.cbSize = doc->cbSize;
...@@ -493,7 +502,7 @@ INT CDECL PSDRV_StartDoc( PSDRV_PDEVICE *physDev, const DOCINFOW *doc ) ...@@ -493,7 +502,7 @@ INT CDECL PSDRV_StartDoc( PSDRV_PDEVICE *physDev, const DOCINFOW *doc )
docA.lpszDatatype = datatype; docA.lpszDatatype = datatype;
docA.fwType = doc->fwType; docA.fwType = doc->fwType;
ret = PSDRV_StartDocA(physDev, &docA); ret = PSDRV_StartDocA(dev, &docA);
HeapFree( GetProcessHeap(), 0, docname ); HeapFree( GetProcessHeap(), 0, docname );
HeapFree( GetProcessHeap(), 0, output ); HeapFree( GetProcessHeap(), 0, output );
...@@ -505,9 +514,11 @@ INT CDECL PSDRV_StartDoc( PSDRV_PDEVICE *physDev, const DOCINFOW *doc ) ...@@ -505,9 +514,11 @@ INT CDECL PSDRV_StartDoc( PSDRV_PDEVICE *physDev, const DOCINFOW *doc )
/************************************************************************ /************************************************************************
* PSDRV_EndDoc * 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; INT ret = 1;
if(!physDev->job.id) { if(!physDev->job.id) {
FIXME("hJob == 0. Now what?\n"); FIXME("hJob == 0. Now what?\n");
return 0; return 0;
...@@ -515,9 +526,9 @@ INT CDECL PSDRV_EndDoc( PSDRV_PDEVICE *physDev ) ...@@ -515,9 +526,9 @@ INT CDECL PSDRV_EndDoc( PSDRV_PDEVICE *physDev )
if(!physDev->job.OutOfPage) { if(!physDev->job.OutOfPage) {
WARN("Somebody forgot an EndPage\n"); WARN("Somebody forgot an EndPage\n");
PSDRV_EndPage( physDev ); PSDRV_EndPage( dev );
} }
PSDRV_WriteFooter( physDev ); PSDRV_WriteFooter( dev );
ret = EndDocPrinter(physDev->job.hprinter); ret = EndDocPrinter(physDev->job.hprinter);
ClosePrinter(physDev->job.hprinter); ClosePrinter(physDev->job.hprinter);
......
...@@ -36,8 +36,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv); ...@@ -36,8 +36,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
/*********************************************************************** /***********************************************************************
* SelectFont (WINEPS.@) * 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; LOGFONTW lf;
BOOL subst = FALSE; BOOL subst = FALSE;
char FaceName[LF_FACESIZE]; char FaceName[LF_FACESIZE];
...@@ -112,28 +113,30 @@ HFONT CDECL PSDRV_SelectFont( PSDRV_PDEVICE *physDev, HFONT hfont, HANDLE gdiFon ...@@ -112,28 +113,30 @@ HFONT CDECL PSDRV_SelectFont( PSDRV_PDEVICE *physDev, HFONT hfont, HANDLE gdiFon
physDev->font.set = FALSE; physDev->font.set = FALSE;
if(gdiFont && !subst) { if(gdiFont && !subst) {
if(PSDRV_SelectDownloadFont(physDev)) if(PSDRV_SelectDownloadFont(dev))
return 0; /* use gdi font */ return 0; /* use gdi font */
} }
PSDRV_SelectBuiltinFont(physDev, hfont, &lf, FaceName); PSDRV_SelectBuiltinFont(dev, hfont, &lf, FaceName);
return (HFONT)1; /* use device font */ return (HFONT)1; /* use device font */
} }
/*********************************************************************** /***********************************************************************
* PSDRV_SetFont * 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; if(physDev->font.set) return TRUE;
switch(physDev->font.fontloc) { switch(physDev->font.fontloc) {
case Builtin: case Builtin:
PSDRV_WriteSetBuiltinFont(physDev); PSDRV_WriteSetBuiltinFont(dev);
break; break;
case Download: case Download:
PSDRV_WriteSetDownloadFont(physDev); PSDRV_WriteSetDownloadFont(dev);
break; break;
default: default:
ERR("fontloc = %d\n", physDev->font.fontloc); ERR("fontloc = %d\n", physDev->font.fontloc);
......
...@@ -381,8 +381,10 @@ BOOL CDECL PSDRV_CreateDC( HDC hdc, PSDRV_PDEVICE **pdev, LPCWSTR driver, LPCWST ...@@ -381,8 +381,10 @@ BOOL CDECL PSDRV_CreateDC( HDC hdc, PSDRV_PDEVICE **pdev, LPCWSTR driver, LPCWST
/********************************************************************** /**********************************************************************
* PSDRV_DeleteDC * PSDRV_DeleteDC
*/ */
BOOL CDECL PSDRV_DeleteDC( PSDRV_PDEVICE *physDev ) BOOL CDECL PSDRV_DeleteDC( PHYSDEV dev )
{ {
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
TRACE("\n"); TRACE("\n");
HeapFree( PSDRV_Heap, 0, physDev->Devmode ); HeapFree( PSDRV_Heap, 0, physDev->Devmode );
...@@ -396,8 +398,10 @@ BOOL CDECL PSDRV_DeleteDC( PSDRV_PDEVICE *physDev ) ...@@ -396,8 +398,10 @@ BOOL CDECL PSDRV_DeleteDC( PSDRV_PDEVICE *physDev )
/********************************************************************** /**********************************************************************
* ResetDC (WINEPS.@) * 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) { if(lpInitData) {
DEVMODEA *devmodeA = DEVMODEdupWtoA(PSDRV_Heap, lpInitData); DEVMODEA *devmodeA = DEVMODEdupWtoA(PSDRV_Heap, lpInitData);
PSDRV_MergeDevmodes(physDev->Devmode, (PSDRV_DEVMODEA *)devmodeA, physDev->pi); PSDRV_MergeDevmodes(physDev->Devmode, (PSDRV_DEVMODEA *)devmodeA, physDev->pi);
...@@ -410,8 +414,10 @@ HDC CDECL PSDRV_ResetDC( PSDRV_PDEVICE *physDev, const DEVMODEW *lpInitData ) ...@@ -410,8 +414,10 @@ HDC CDECL PSDRV_ResetDC( PSDRV_PDEVICE *physDev, const DEVMODEW *lpInitData )
/*********************************************************************** /***********************************************************************
* GetDeviceCaps (WINEPS.@) * 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) switch(cap)
{ {
case DRIVERVERSION: case DRIVERVERSION:
......
...@@ -37,8 +37,9 @@ static const char PEN_alternate[] = "1"; ...@@ -37,8 +37,9 @@ static const char PEN_alternate[] = "1";
/*********************************************************************** /***********************************************************************
* SelectPen (WINEPS.@) * 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; LOGPEN logpen;
if (!GetObjectW( hpen, sizeof(logpen), &logpen )) if (!GetObjectW( hpen, sizeof(logpen), &logpen ))
...@@ -66,7 +67,7 @@ HPEN CDECL PSDRV_SelectPen( PSDRV_PDEVICE *physDev, HPEN hpen ) ...@@ -66,7 +67,7 @@ HPEN CDECL PSDRV_SelectPen( PSDRV_PDEVICE *physDev, HPEN hpen )
physDev->pen.width = logpen.lopnWidth.x; physDev->pen.width = logpen.lopnWidth.x;
if ((logpen.lopnStyle & PS_GEOMETRIC) || (physDev->pen.width > 1)) 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(physDev->pen.width < 0) physDev->pen.width = -physDev->pen.width;
} }
if (hpen == GetStockObject( DC_PEN )) if (hpen == GetStockObject( DC_PEN ))
...@@ -88,7 +89,7 @@ HPEN CDECL PSDRV_SelectPen( PSDRV_PDEVICE *physDev, HPEN hpen ) ...@@ -88,7 +89,7 @@ HPEN CDECL PSDRV_SelectPen( PSDRV_PDEVICE *physDev, HPEN hpen )
case PS_ENDCAP_FLAT: physDev->pen.endcap = 0; break; 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; physDev->pen.style = logpen.lopnStyle & PS_STYLE_MASK;
switch(physDev->pen.style) { switch(physDev->pen.style) {
...@@ -129,10 +130,12 @@ HPEN CDECL PSDRV_SelectPen( PSDRV_PDEVICE *physDev, HPEN hpen ) ...@@ -129,10 +130,12 @@ HPEN CDECL PSDRV_SelectPen( PSDRV_PDEVICE *physDev, HPEN hpen )
/*********************************************************************** /***********************************************************************
* SetDCPenColor (WINEPS.@) * 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 )) 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; return color;
} }
...@@ -142,13 +145,15 @@ COLORREF CDECL PSDRV_SetDCPenColor( PSDRV_PDEVICE *physDev, COLORREF color ) ...@@ -142,13 +145,15 @@ COLORREF CDECL PSDRV_SetDCPenColor( PSDRV_PDEVICE *physDev, COLORREF color )
* PSDRV_SetPen * 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) { if (physDev->pen.style != PS_NULL) {
PSDRV_WriteSetColor(physDev, &physDev->pen.color); PSDRV_WriteSetColor(dev, &physDev->pen.color);
if(!physDev->pen.set) { if(!physDev->pen.set) {
PSDRV_WriteSetPen(physDev); PSDRV_WriteSetPen(dev);
physDev->pen.set = TRUE; physDev->pen.set = TRUE;
} }
} }
......
...@@ -29,17 +29,18 @@ ...@@ -29,17 +29,18 @@
WINE_DEFAULT_DEBUG_CHANNEL(psdrv); 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, LPCWSTR str, UINT count,
BOOL bDrawBackground, const INT *lpDx); BOOL bDrawBackground, const INT *lpDx);
/*********************************************************************** /***********************************************************************
* PSDRV_ExtTextOut * 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 RECT *lprect, LPCWSTR str, UINT count,
const INT *lpDx ) const INT *lpDx )
{ {
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
BOOL bResult = TRUE; BOOL bResult = TRUE;
BOOL bClipped = FALSE; BOOL bClipped = FALSE;
BOOL bOpaque = FALSE; BOOL bOpaque = FALSE;
...@@ -50,50 +51,51 @@ BOOL CDECL PSDRV_ExtTextOut( PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags, ...@@ -50,50 +51,51 @@ BOOL CDECL PSDRV_ExtTextOut( PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags,
if(physDev->job.id == 0) return FALSE; if(physDev->job.id == 0) return FALSE;
/* write font if not already written */ /* write font if not already written */
PSDRV_SetFont(physDev); PSDRV_SetFont(dev);
PSDRV_SetClip(physDev); PSDRV_SetClip(dev);
/* set clipping and/or draw background */ /* set clipping and/or draw background */
if ((flags & (ETO_CLIPPED | ETO_OPAQUE)) && (lprect != NULL)) if ((flags & (ETO_CLIPPED | ETO_OPAQUE)) && (lprect != NULL))
{ {
PSDRV_WriteGSave(physDev); PSDRV_WriteGSave(dev);
PSDRV_WriteRectangle(physDev, lprect->left, lprect->top, lprect->right - lprect->left, PSDRV_WriteRectangle(dev, lprect->left, lprect->top, lprect->right - lprect->left,
lprect->bottom - lprect->top); lprect->bottom - lprect->top);
if (flags & ETO_OPAQUE) if (flags & ETO_OPAQUE)
{ {
bOpaque = TRUE; bOpaque = TRUE;
PSDRV_WriteGSave(physDev); PSDRV_WriteGSave(dev);
PSDRV_WriteSetColor(physDev, &physDev->bkColor); PSDRV_WriteSetColor(dev, &physDev->bkColor);
PSDRV_WriteFill(physDev); PSDRV_WriteFill(dev);
PSDRV_WriteGRestore(physDev); PSDRV_WriteGRestore(dev);
} }
if (flags & ETO_CLIPPED) if (flags & ETO_CLIPPED)
{ {
bClipped = TRUE; bClipped = TRUE;
PSDRV_WriteClip(physDev); PSDRV_WriteClip(dev);
} }
bResult = PSDRV_Text(physDev, x, y, flags, str, count, !(bClipped && bOpaque), lpDx); bResult = PSDRV_Text(dev, x, y, flags, str, count, !(bClipped && bOpaque), lpDx);
PSDRV_WriteGRestore(physDev); PSDRV_WriteGRestore(dev);
} }
else 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; return bResult;
} }
/*********************************************************************** /***********************************************************************
* PSDRV_Text * 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) UINT count, BOOL bDrawBackground, const INT *lpDx)
{ {
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
WORD *glyphs = NULL; WORD *glyphs = NULL;
if (!count) if (!count)
...@@ -102,13 +104,13 @@ static BOOL PSDRV_Text(PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags, LPCWSTR ...@@ -102,13 +104,13 @@ static BOOL PSDRV_Text(PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags, LPCWSTR
if(physDev->font.fontloc == Download) if(physDev->font.fontloc == Download)
glyphs = (LPWORD)str; glyphs = (LPWORD)str;
PSDRV_WriteMoveTo(physDev, x, y); PSDRV_WriteMoveTo(dev, x, y);
if(!lpDx) { if(!lpDx) {
if(physDev->font.fontloc == Download) if(physDev->font.fontloc == Download)
PSDRV_WriteDownloadGlyphShow(physDev, glyphs, count); PSDRV_WriteDownloadGlyphShow(dev, glyphs, count);
else else
PSDRV_WriteBuiltinGlyphShow(physDev, str, count); PSDRV_WriteBuiltinGlyphShow(dev, str, count);
} }
else { else {
UINT i; UINT i;
...@@ -116,9 +118,9 @@ static BOOL PSDRV_Text(PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags, LPCWSTR ...@@ -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++) { for(i = 0; i < count-1; i++) {
if(physDev->font.fontloc == Download) if(physDev->font.fontloc == Download)
PSDRV_WriteDownloadGlyphShow(physDev, glyphs + i, 1); PSDRV_WriteDownloadGlyphShow(dev, glyphs + i, 1);
else else
PSDRV_WriteBuiltinGlyphShow(physDev, str + i, 1); PSDRV_WriteBuiltinGlyphShow(dev, str + i, 1);
if(flags & ETO_PDY) if(flags & ETO_PDY)
{ {
offset.x += lpDx[i * 2]; offset.x += lpDx[i * 2];
...@@ -126,12 +128,12 @@ static BOOL PSDRV_Text(PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags, LPCWSTR ...@@ -126,12 +128,12 @@ static BOOL PSDRV_Text(PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags, LPCWSTR
} }
else else
offset.x += lpDx[i]; 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) if(physDev->font.fontloc == Download)
PSDRV_WriteDownloadGlyphShow(physDev, glyphs + i, 1); PSDRV_WriteDownloadGlyphShow(dev, glyphs + i, 1);
else else
PSDRV_WriteBuiltinGlyphShow(physDev, str + i, 1); PSDRV_WriteBuiltinGlyphShow(dev, str + i, 1);
} }
return TRUE; return TRUE;
......
...@@ -70,7 +70,7 @@ static inline WORD get_be_word(const void *p) { return RtlUshortByteSwap(*(WOR ...@@ -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); } static inline DWORD get_be_dword(const void *p) { return RtlUlongByteSwap(*(DWORD*)p); }
#endif #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; char *buf;
TYPE1 *t1; TYPE1 *t1;
...@@ -113,7 +113,7 @@ TYPE1 *T1_download_header(PSDRV_PDEVICE *physDev, char *ps_name, RECT *bbox, UIN ...@@ -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, sprintf(buf, dict, ps_name, t1->emsize, t1->emsize,
bbox->left, bbox->bottom, bbox->right, bbox->top); bbox->left, bbox->bottom, bbox->right, bbox->top);
PSDRV_WriteSpool(physDev, buf, strlen(buf)); PSDRV_WriteSpool(dev, buf, strlen(buf));
HeapFree(GetProcessHeap(), 0, buf); HeapFree(GetProcessHeap(), 0, buf);
return t1; return t1;
...@@ -512,8 +512,7 @@ static inline BOOL on_point(const glyph_outline *outline, WORD pt) ...@@ -512,8 +512,7 @@ static inline BOOL on_point(const glyph_outline *outline, WORD pt)
return outline->flags[pt] & 1; return outline->flags[pt] & 1;
} }
BOOL T1_download_glyph(PSDRV_PDEVICE *physDev, DOWNLOAD *pdl, DWORD index, BOOL T1_download_glyph(PHYSDEV dev, DOWNLOAD *pdl, DWORD index, char *glyph_name)
char *glyph_name)
{ {
DWORD len; DWORD len;
WORD cur_pt, cont; WORD cur_pt, cont;
...@@ -551,9 +550,9 @@ BOOL T1_download_glyph(PSDRV_PDEVICE *physDev, DOWNLOAD *pdl, DWORD index, ...@@ -551,9 +550,9 @@ BOOL T1_download_glyph(PSDRV_PDEVICE *physDev, DOWNLOAD *pdl, DWORD index,
outline.flags = NULL; outline.flags = NULL;
outline.end_pts = NULL; outline.end_pts = NULL;
outline.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); charstring = str_init(100);
curpos.x = outline.lsb; curpos.x = outline.lsb;
...@@ -633,14 +632,14 @@ BOOL T1_download_glyph(PSDRV_PDEVICE *physDev, DOWNLOAD *pdl, DWORD index, ...@@ -633,14 +632,14 @@ BOOL T1_download_glyph(PSDRV_PDEVICE *physDev, DOWNLOAD *pdl, DWORD index,
strlen(pdl->ps_name) + strlen(glyph_name) + 100); strlen(pdl->ps_name) + strlen(glyph_name) + 100);
sprintf(buf, "%%%%glyph %04x\n", index); sprintf(buf, "%%%%glyph %04x\n", index);
PSDRV_WriteSpool(physDev, buf, strlen(buf)); PSDRV_WriteSpool(dev, buf, strlen(buf));
len = str_get_bytes(charstring, &bytes); len = str_get_bytes(charstring, &bytes);
sprintf(buf, glyph_def_begin, pdl->ps_name, glyph_name, len); sprintf(buf, glyph_def_begin, pdl->ps_name, glyph_name, len);
PSDRV_WriteSpool(physDev, buf, strlen(buf)); PSDRV_WriteSpool(dev, buf, strlen(buf));
PSDRV_WriteBytes(physDev, bytes, len); PSDRV_WriteBytes(dev, bytes, len);
sprintf(buf, glyph_def_end); sprintf(buf, glyph_def_end);
PSDRV_WriteSpool(physDev, buf, strlen(buf)); PSDRV_WriteSpool(dev, buf, strlen(buf));
str_free(charstring); str_free(charstring);
t1->glyph_sent[index] = TRUE; t1->glyph_sent[index] = TRUE;
......
...@@ -134,7 +134,7 @@ static BOOL get_glyf_pos(TYPE42 *t42, DWORD index, DWORD *start, DWORD *end) ...@@ -134,7 +134,7 @@ static BOOL get_glyf_pos(TYPE42 *t42, DWORD index, DWORD *start, DWORD *end)
return TRUE; 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) RECT *bbox, UINT emsize)
{ {
DWORD i, j, tablepos, nb_blocks, glyf_off = 0, loca_off = 0, cur_off; 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, ...@@ -173,7 +173,7 @@ TYPE42 *T42_download_header(PSDRV_PDEVICE *physDev, char *ps_name,
t42->num_of_written_tables = 0; t42->num_of_written_tables = 0;
for(i = 0; i < num_of_tables; i++) { 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].len > 0xffff && t42->tables[i].write) break;
if(t42->tables[i].write) t42->num_of_written_tables++; if(t42->tables[i].write) t42->num_of_written_tables++;
if(t42->tables[i].MS_tag == MS_MAKE_TAG('l','o','c','a')) 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, ...@@ -207,13 +207,13 @@ TYPE42 *T42_download_header(PSDRV_PDEVICE *physDev, char *ps_name,
(float)bbox->right / emsize, (float)bbox->top / emsize); (float)bbox->right / emsize, (float)bbox->top / emsize);
pop_lc_numeric(); pop_lc_numeric();
PSDRV_WriteSpool(physDev, buf, strlen(buf)); PSDRV_WriteSpool(dev, buf, strlen(buf));
t42->num_of_written_tables++; /* explicitly add glyf */ t42->num_of_written_tables++; /* explicitly add glyf */
sprintf(buf, TT_offset_table, t42->num_of_written_tables, 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); 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; tablepos = 12 + t42->num_of_written_tables * 16;
cur_off = 12; cur_off = 12;
...@@ -222,7 +222,7 @@ TYPE42 *T42_download_header(PSDRV_PDEVICE *physDev, char *ps_name, ...@@ -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), 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].check, t42->tables[i].len ? tablepos : 0,
t42->tables[i].len); t42->tables[i].len);
PSDRV_WriteSpool(physDev, buf, strlen(buf)); PSDRV_WriteSpool(dev, buf, strlen(buf));
tablepos += ((t42->tables[i].len + 3) & ~3); tablepos += ((t42->tables[i].len + 3) & ~3);
if(t42->tables[i].MS_tag == MS_MAKE_TAG('l','o','c','a')) if(t42->tables[i].MS_tag == MS_MAKE_TAG('l','o','c','a'))
loca_off = cur_off; loca_off = cur_off;
...@@ -230,19 +230,19 @@ TYPE42 *T42_download_header(PSDRV_PDEVICE *physDev, char *ps_name, ...@@ -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), 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); t42->tables[t42->glyf_tab].check, tablepos, t42->tables[t42->glyf_tab].len);
PSDRV_WriteSpool(physDev, buf, strlen(buf)); PSDRV_WriteSpool(dev, buf, strlen(buf));
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_off = cur_off; glyf_off = cur_off;
for(i = 0; i < num_of_tables; i++) { for(i = 0; i < num_of_tables; i++) {
if(t42->tables[i].len == 0 || !t42->tables[i].write) continue; 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++) { for(j = 0; j < ((t42->tables[i].len + 3) & ~3); j++) {
sprintf(buf, "%02x", t42->tables[i].data[j]); sprintf(buf, "%02x", t42->tables[i].data[j]);
PSDRV_WriteSpool(physDev, buf, strlen(buf)); PSDRV_WriteSpool(dev, buf, strlen(buf));
if(j % 16 == 15) PSDRV_WriteSpool(physDev, "\n", 1); 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 /* 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, ...@@ -261,17 +261,17 @@ TYPE42 *T42_download_header(PSDRV_PDEVICE *physDev, char *ps_name,
t42->glyf_blocks[nb_blocks-1] = end; t42->glyf_blocks[nb_blocks-1] = end;
} }
PSDRV_WriteSpool(physDev, "[ ", 2); PSDRV_WriteSpool(dev, "[ ", 2);
for(i = 1; t42->glyf_blocks[i]; i++) { for(i = 1; t42->glyf_blocks[i]; i++) {
sprintf(buf,"%d ", t42->glyf_blocks[i] - t42->glyf_blocks[i-1] + 1); sprintf(buf,"%d ", t42->glyf_blocks[i] - t42->glyf_blocks[i-1] + 1);
/* again add one byte for old PostScript rips */ /* again add one byte for old PostScript rips */
PSDRV_WriteSpool(physDev, buf, strlen(buf)); PSDRV_WriteSpool(dev, buf, strlen(buf));
if(i % 8 == 0) 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); sprintf(buf, end, loca_off, glyf_off);
PSDRV_WriteSpool(physDev, buf, strlen(buf)); PSDRV_WriteSpool(dev, buf, strlen(buf));
HeapFree(GetProcessHeap(), 0, buf); HeapFree(GetProcessHeap(), 0, buf);
return t42; return t42;
} }
...@@ -279,7 +279,7 @@ TYPE42 *T42_download_header(PSDRV_PDEVICE *physDev, char *ps_name, ...@@ -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) char *glyph_name)
{ {
DWORD start, end, i; DWORD start, end, i;
...@@ -326,8 +326,8 @@ BOOL T42_download_glyph(PSDRV_PDEVICE *physDev, DOWNLOAD *pdl, DWORD index, ...@@ -326,8 +326,8 @@ BOOL T42_download_glyph(PSDRV_PDEVICE *physDev, DOWNLOAD *pdl, DWORD index,
sg_index = GET_BE_WORD(sg_start + 2); sg_index = GET_BE_WORD(sg_start + 2);
TRACE("Sending subglyph %04x for glyph %04x\n", sg_index, index); TRACE("Sending subglyph %04x for glyph %04x\n", sg_index, index);
get_glyph_name(physDev->hdc, sg_index, sg_name); get_glyph_name(dev->hdc, sg_index, sg_name);
T42_download_glyph(physDev, pdl, sg_index, sg_name); T42_download_glyph(dev, pdl, sg_index, sg_name);
sg_start += 4; sg_start += 4;
if(sg_flags & ARG_1_AND_2_ARE_WORDS) if(sg_flags & ARG_1_AND_2_ARE_WORDS)
sg_start += 4; sg_start += 4;
...@@ -351,18 +351,18 @@ BOOL T42_download_glyph(PSDRV_PDEVICE *physDev, DOWNLOAD *pdl, DWORD index, ...@@ -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 /* 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 */ 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]); 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++) { for(i = start; i < end; i++) {
sprintf(buf, "%02x", *(t42->tables[t42->glyf_tab].data + 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) 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); 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; t42->glyph_sent[index] = TRUE;
HeapFree(GetProcessHeap(), 0, buf); HeapFree(GetProcessHeap(), 0, buf);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment