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);
*
* 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_WriteGSave(physDev);
PSDRV_WriteNewPath(physDev);
PSDRV_WriteRectangle(physDev, xDst, yDst, widthDst, heightDst);
PSDRV_WriteSetColor(physDev, &bkgnd);
PSDRV_WriteFill(physDev);
PSDRV_WriteGRestore(physDev);
PSDRV_WriteSetColor(physDev, &foregnd);
PSDRV_WriteImage(physDev, 1, xDst, yDst, widthDst, heightDst,
PSDRV_CreateColor(dev, &foregnd, map[0]);
PSDRV_CreateColor(dev, &bkgnd, map[1]);
PSDRV_WriteGSave(dev);
PSDRV_WriteNewPath(dev);
PSDRV_WriteRectangle(dev, xDst, yDst, widthDst, heightDst);
PSDRV_WriteSetColor(dev, &bkgnd);
PSDRV_WriteFill(dev);
PSDRV_WriteGRestore(dev);
PSDRV_WriteSetColor(dev, &foregnd);
PSDRV_WriteImage(dev, 1, xDst, yDst, widthDst, heightDst,
widthSrc, heightSrc, TRUE);
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);
......
......@@ -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;
}
}
......
......@@ -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);
......
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